Fix overflowing credits, rules, and HUD/status labels in Scoundrel
This commit is contained in:
1 parent
21a135eff2
commit
16552d5580
3 files changed
+99
-92
No files matched your search
Binary file not shown.
Binary file not shown.
+99
-92
@@ -325,8 +325,8 @@ class ScoundrelGame {
|
|||||||
room[i] = 0;
|
room[i] = 0;
|
||||||
}
|
}
|
||||||
dealRoomIfNeeded();
|
dealRoomIfNeeded();
|
||||||
statusLine1 = "Entered the dungeon. Pick 3 of 4 cards.";
|
statusLine1 = "Pick 3 of 4 room cards.";
|
||||||
statusLine2 = "1-4/D-Pad: Card | *: Run | #: Rules";
|
statusLine2 = "1-4/OK:Play *:Run #:Help";
|
||||||
}
|
}
|
||||||
|
|
||||||
void finishGame(bool won) {
|
void finishGame(bool won) {
|
||||||
@@ -367,14 +367,14 @@ class ScoundrelGame {
|
|||||||
potionDrank = false;
|
potionDrank = false;
|
||||||
canRun = true;
|
canRun = true;
|
||||||
++roomsCleared;
|
++roomsCleared;
|
||||||
statusLine2 = "Room cleared! Moving deeper...";
|
statusLine2 = "Room cleared! Deeper...";
|
||||||
dealRoomIfNeeded();
|
dealRoomIfNeeded();
|
||||||
} else if (!lastRoom && engaged == 3) {
|
} else if (!lastRoom && engaged == 3) {
|
||||||
engaged = 0;
|
engaged = 0;
|
||||||
potionDrank = false;
|
potionDrank = false;
|
||||||
canRun = true;
|
canRun = true;
|
||||||
++roomsCleared;
|
++roomsCleared;
|
||||||
statusLine2 = "Room cleared! 1 card carried over.";
|
statusLine2 = "Room cleared! 1 card kept";
|
||||||
dealRoomIfNeeded();
|
dealRoomIfNeeded();
|
||||||
} else {
|
} else {
|
||||||
ensureValidSelection();
|
ensureValidSelection();
|
||||||
@@ -393,22 +393,21 @@ class ScoundrelGame {
|
|||||||
healthLost = diff;
|
healthLost = diff;
|
||||||
durability = val - 1;
|
durability = val - 1;
|
||||||
if (durability < 2) {
|
if (durability < 2) {
|
||||||
statusLine2 = "Weapon shattered after the blow!";
|
statusLine2 = "Weapon broke after hit!";
|
||||||
durability = 0;
|
durability = 0;
|
||||||
weapon = 0;
|
weapon = 0;
|
||||||
} else {
|
} else {
|
||||||
statusLine2 = "Weapon max monster level is now " + std::to_string(durability) + ".";
|
statusLine2 = "Weapon Max Lv now " + std::to_string(durability) + ".";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
statusLine2 = "Fought barehanded (-" + std::to_string(healthLost) + " HP).";
|
statusLine2 = "Barehanded (-" + std::to_string(healthLost) + " HP).";
|
||||||
}
|
}
|
||||||
|
|
||||||
hp -= healthLost;
|
hp -= healthLost;
|
||||||
if (hp < 0) hp = 0;
|
if (hp < 0) hp = 0;
|
||||||
score += val;
|
score += val;
|
||||||
statusLine1 = std::string("Slain ") + monsterNameForLevel(val) +
|
statusLine1 = std::string("Slain ") + monsterNameForLevel(val) +
|
||||||
" (Lv." + std::to_string(val) + "), lost " +
|
": -" + std::to_string(healthLost) + " HP";
|
||||||
std::to_string(healthLost) + " HP.";
|
|
||||||
checkRoomAdvance();
|
checkRoomAdvance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,16 +435,16 @@ class ScoundrelGame {
|
|||||||
weapon = ci.level;
|
weapon = ci.level;
|
||||||
durability = 14;
|
durability = 14;
|
||||||
statusLine1 = std::string("Equipped ") + weaponNameForLevel(weapon) +
|
statusLine1 = std::string("Equipped ") + weaponNameForLevel(weapon) +
|
||||||
" (Lv." + std::to_string(weapon) + ").";
|
" (+" + std::to_string(weapon) + ")";
|
||||||
statusLine2 = "Weapon durability reset to max (Lv.14).";
|
statusLine2 = "Weapon Max Lv reset: 14.";
|
||||||
checkRoomAdvance();
|
checkRoomAdvance();
|
||||||
} else if (ci.type == CardType::PotionHeart) {
|
} else if (ci.type == CardType::PotionHeart) {
|
||||||
room[slot] = 0;
|
room[slot] = 0;
|
||||||
++engaged;
|
++engaged;
|
||||||
canRun = false;
|
canRun = false;
|
||||||
if (potionDrank) {
|
if (potionDrank) {
|
||||||
statusLine1 = "Potion discarded! (Max 1 per room)";
|
statusLine1 = "Potion wasted (max 1/rm)";
|
||||||
statusLine2 = "Already drank a potion in this room.";
|
statusLine2 = "Already healed this room";
|
||||||
} else {
|
} else {
|
||||||
potionDrank = true;
|
potionDrank = true;
|
||||||
int prevHp = hp;
|
int prevHp = hp;
|
||||||
@@ -454,9 +453,9 @@ class ScoundrelGame {
|
|||||||
if (deckIdx >= 44 || deck[deckIdx] == 0) {
|
if (deckIdx >= 44 || deck[deckIdx] == 0) {
|
||||||
lastPotionVal = ci.level;
|
lastPotionVal = ci.level;
|
||||||
}
|
}
|
||||||
statusLine1 = "Drank Lv." + std::to_string(ci.level) +
|
statusLine1 = "Potion +" + std::to_string(hp - prevHp) +
|
||||||
" Potion (+" + std::to_string(hp - prevHp) + " HP).";
|
" HP (Lv." + std::to_string(ci.level) + ")";
|
||||||
statusLine2 = "HP is now " + std::to_string(hp) + "/20.";
|
statusLine2 = "Health is now " + std::to_string(hp) + "/20 HP.";
|
||||||
}
|
}
|
||||||
checkRoomAdvance();
|
checkRoomAdvance();
|
||||||
}
|
}
|
||||||
@@ -465,11 +464,11 @@ class ScoundrelGame {
|
|||||||
void runFromRoom() {
|
void runFromRoom() {
|
||||||
if (!canRun || engaged > 0 || lastRoom) {
|
if (!canRun || engaged > 0 || lastRoom) {
|
||||||
if (lastRoom) {
|
if (lastRoom) {
|
||||||
statusLine2 = "Cannot run from the final room!";
|
statusLine2 = "No running in last room!";
|
||||||
} else if (engaged > 0) {
|
} else if (engaged > 0) {
|
||||||
statusLine2 = "Cannot run after engaging a card!";
|
statusLine2 = "Can't run mid-room!";
|
||||||
} else {
|
} else {
|
||||||
statusLine2 = "Cannot run twice in a row!";
|
statusLine2 = "Can't run 2x in a row!";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -498,8 +497,8 @@ class ScoundrelGame {
|
|||||||
engaged = 0;
|
engaged = 0;
|
||||||
lastRoom = false;
|
lastRoom = false;
|
||||||
dealRoomIfNeeded();
|
dealRoomIfNeeded();
|
||||||
statusLine1 = "Fled the room! Cards placed at bottom.";
|
statusLine1 = "Fled! 4 cards -> bottom.";
|
||||||
statusLine2 = "Must clear this room before running again.";
|
statusLine2 = "Clear room to run again.";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -626,7 +625,6 @@ int main() {
|
|||||||
GC gc = neo.gc;
|
GC gc = neo.gc;
|
||||||
PangoLayout* layoutMain = neo.layoutMain;
|
PangoLayout* layoutMain = neo.layoutMain;
|
||||||
PangoLayout* layoutSmall = neo.layoutSmall;
|
PangoLayout* layoutSmall = neo.layoutSmall;
|
||||||
PangoLayout* layoutNum = neo.layoutNum;
|
|
||||||
PluginTheme& theme = neo.theme;
|
PluginTheme& theme = neo.theme;
|
||||||
|
|
||||||
Atom wmDelete = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
Atom wmDelete = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
|
||||||
@@ -654,7 +652,7 @@ int main() {
|
|||||||
XftColor* hpCol = (game.hp >= 12) ? &theme.colGreen
|
XftColor* hpCol = (game.hp >= 12) ? &theme.colGreen
|
||||||
: ((game.hp >= 6) ? &theme.colYellow : &theme.colRed);
|
: ((game.hp >= 6) ? &theme.colYellow : &theme.colRed);
|
||||||
std::string hpText = "HP " + std::to_string(game.hp) + "/20";
|
std::string hpText = "HP " + std::to_string(game.hp) + "/20";
|
||||||
neo.drawPango(layoutSmall, hpCol, 6, 2, 16, hpText, 82);
|
neo.drawPango(layoutSmall, hpCol, 6, 2, 16, hpText, 78);
|
||||||
|
|
||||||
int barX = 6, barY = 20, barW = 74, barH = 10;
|
int barX = 6, barY = 20, barW = 74, barH = 10;
|
||||||
XSetForeground(dpy, gc, theme.spec.bgAltOdd);
|
XSetForeground(dpy, gc, theme.spec.bgAltOdd);
|
||||||
@@ -671,19 +669,19 @@ int main() {
|
|||||||
|
|
||||||
// Center: Deck & Rooms cleared
|
// Center: Deck & Rooms cleared
|
||||||
std::string deckStr = "DECK: " + std::to_string(game.remainingDeckCards());
|
std::string deckStr = "DECK: " + std::to_string(game.remainingDeckCards());
|
||||||
std::string rmStr = "ROOMS: " + std::to_string(game.roomsCleared);
|
std::string rmStr = "ROOM: " + std::to_string(game.roomsCleared);
|
||||||
neo.drawPango(layoutSmall, &theme.colLight, 86, 2, 16, deckStr, 72, 1);
|
neo.drawPango(layoutSmall, &theme.colLight, 84, 2, 16, deckStr, 72, 1);
|
||||||
neo.drawPango(layoutSmall, &theme.colMuted, 86, 18, 16, rmStr, 72, 1);
|
neo.drawPango(layoutSmall, &theme.colMuted, 84, 18, 16, rmStr, 72, 1);
|
||||||
|
|
||||||
// Right: Equipped Weapon & Durability
|
// Right: Equipped Weapon & Durability
|
||||||
if (game.weapon > 0) {
|
if (game.weapon > 0) {
|
||||||
std::string wpnStr = "WPN +" + std::to_string(game.weapon);
|
std::string wpnStr = "WPN +" + std::to_string(game.weapon);
|
||||||
std::string durStr = "MAX LV:" + std::to_string(game.durability);
|
std::string durStr = "MAX:" + std::to_string(game.durability);
|
||||||
neo.drawPango(layoutSmall, &theme.colBlue, 160, 2, 16, wpnStr, 74, 2);
|
neo.drawPango(layoutSmall, &theme.colBlue, 158, 2, 16, wpnStr, 76, 2);
|
||||||
neo.drawPango(layoutSmall, &theme.colYellow, 160, 18, 16, durStr, 74, 2);
|
neo.drawPango(layoutSmall, &theme.colYellow, 158, 18, 16, durStr, 76, 2);
|
||||||
} else {
|
} else {
|
||||||
neo.drawPango(layoutSmall, &theme.colMuted, 160, 2, 16, "NO WEAPON", 74, 2);
|
neo.drawPango(layoutSmall, &theme.colMuted, 158, 2, 16, "NO WEAP", 76, 2);
|
||||||
neo.drawPango(layoutSmall, &theme.colMuted, 160, 18, 16, "BAREHAND", 74, 2);
|
neo.drawPango(layoutSmall, &theme.colMuted, 158, 18, 16, "BAREHAND", 76, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Dungeon Room (4 Cards side-by-side, Y=42..166)
|
// 2. Dungeon Room (4 Cards side-by-side, Y=42..166)
|
||||||
@@ -755,7 +753,7 @@ int main() {
|
|||||||
if (ci.type == CardType::MonsterSpade || ci.type == CardType::MonsterClub) {
|
if (ci.type == CardType::MonsterSpade || ci.type == CardType::MonsterClub) {
|
||||||
if (game.weapon > 0 && ci.level <= game.durability) {
|
if (game.weapon > 0 && ci.level <= game.durability) {
|
||||||
int dmg = std::max(0, ci.level - game.weapon);
|
int dmg = std::max(0, ci.level - game.weapon);
|
||||||
effectStr = "-" + std::to_string(dmg) + " HP*";
|
effectStr = "-" + std::to_string(dmg) + " HP";
|
||||||
effCol = &theme.colYellow;
|
effCol = &theme.colYellow;
|
||||||
} else {
|
} else {
|
||||||
effectStr = "-" + std::to_string(ci.level) + " HP";
|
effectStr = "-" + std::to_string(ci.level) + " HP";
|
||||||
@@ -785,53 +783,53 @@ int main() {
|
|||||||
XSetForeground(dpy, gc, theme.spec.border);
|
XSetForeground(dpy, gc, theme.spec.border);
|
||||||
XDrawRectangle(dpy, pix, gc, 6, 170, W - 13, 95);
|
XDrawRectangle(dpy, pix, gc, 6, 170, W - 13, 95);
|
||||||
|
|
||||||
std::string inspectHeader = "Slot [" + std::to_string(game.selectedSlot + 1) + "]: ";
|
std::string inspectHeader = "[" + std::to_string(game.selectedSlot + 1) + "] ";
|
||||||
int selCode = (game.selectedSlot >= 0 && game.selectedSlot < 4)
|
int selCode = (game.selectedSlot >= 0 && game.selectedSlot < 4)
|
||||||
? game.room[game.selectedSlot]
|
? game.room[game.selectedSlot]
|
||||||
: 0;
|
: 0;
|
||||||
if (selCode == 0) {
|
if (selCode == 0) {
|
||||||
inspectHeader += "Empty";
|
inspectHeader += "Empty Slot";
|
||||||
} else {
|
} else {
|
||||||
CardInfo sci = decodeCard(selCode);
|
CardInfo sci = decodeCard(selCode);
|
||||||
if (sci.type == CardType::MonsterSpade || sci.type == CardType::MonsterClub) {
|
if (sci.type == CardType::MonsterSpade || sci.type == CardType::MonsterClub) {
|
||||||
inspectHeader += std::string(monsterNameForLevel(sci.level)) +
|
inspectHeader += std::string(monsterNameForLevel(sci.level)) +
|
||||||
" (Lv." + std::to_string(sci.level) + ")";
|
" Lv." + std::to_string(sci.level);
|
||||||
} else if (sci.type == CardType::WeaponDiamond) {
|
} else if (sci.type == CardType::WeaponDiamond) {
|
||||||
inspectHeader += std::string(weaponNameForLevel(sci.level)) +
|
inspectHeader += std::string(weaponNameForLevel(sci.level)) +
|
||||||
" (+" + std::to_string(sci.level) + " ATK)";
|
" +" + std::to_string(sci.level) + " ATK";
|
||||||
} else if (sci.type == CardType::PotionHeart) {
|
} else if (sci.type == CardType::PotionHeart) {
|
||||||
inspectHeader += "Health Potion (+" + std::to_string(sci.level) + " HP)";
|
inspectHeader += "Potion (+" + std::to_string(sci.level) + " HP)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
neo.drawPango(layoutSmall, &theme.colYellow, 12, 174, 18, inspectHeader, W - 24);
|
neo.drawPango(layoutSmall, &theme.colYellow, 10, 174, 18, inspectHeader, W - 20);
|
||||||
|
|
||||||
// Progress in current room + Run availability + Score
|
// Progress in current room + Run availability + Score
|
||||||
int cardsNeeded = game.lastRoom ? game.remainingRoomCards() : (3 - game.engaged);
|
int cardsNeeded = game.lastRoom ? game.remainingRoomCards() : (3 - game.engaged);
|
||||||
if (cardsNeeded < 0) cardsNeeded = 0;
|
if (cardsNeeded < 0) cardsNeeded = 0;
|
||||||
std::string roomProg = "Turn: " + std::to_string(game.engaged) + "/3 (" +
|
std::string roomProg = "Cards: " + std::to_string(game.engaged) + "/3 (" +
|
||||||
std::to_string(cardsNeeded) + " left) | ";
|
std::to_string(cardsNeeded) + " left) ";
|
||||||
if (game.canRun && game.engaged == 0 && !game.lastRoom) {
|
if (game.canRun && game.engaged == 0 && !game.lastRoom) {
|
||||||
roomProg += "*:Run OK";
|
roomProg += "*:Run";
|
||||||
} else {
|
} else {
|
||||||
roomProg += "No Run";
|
roomProg += "NoRun";
|
||||||
}
|
}
|
||||||
neo.drawPango(layoutSmall, &theme.colLight, 12, 193, 18, roomProg, W - 24);
|
neo.drawPango(layoutSmall, &theme.colLight, 10, 193, 18, roomProg, W - 20);
|
||||||
|
|
||||||
XSetForeground(dpy, gc, theme.spec.border);
|
XSetForeground(dpy, gc, theme.spec.border);
|
||||||
XDrawLine(dpy, pix, gc, 10, 213, W - 11, 213);
|
XDrawLine(dpy, pix, gc, 10, 213, W - 11, 213);
|
||||||
|
|
||||||
neo.drawPango(layoutSmall, &theme.colWhite, 12, 216, 18, game.statusLine1, W - 24);
|
neo.drawPango(layoutSmall, &theme.colWhite, 10, 216, 18, game.statusLine1, W - 20);
|
||||||
neo.drawPango(layoutSmall, &theme.colMuted, 12, 234, 18, game.statusLine2, W - 24);
|
neo.drawPango(layoutSmall, &theme.colMuted, 10, 234, 18, game.statusLine2, W - 20);
|
||||||
|
|
||||||
std::string scoreFooter = "Score: " + std::to_string(game.score) +
|
std::string scoreFooter = "Scr:" + std::to_string(game.score) +
|
||||||
" Best: " + std::to_string(game.stats.bestScore) +
|
" Best:" + std::to_string(game.stats.bestScore) +
|
||||||
" W/P: " + std::to_string(game.stats.gamesWon) +
|
" W:" + std::to_string(game.stats.gamesWon) +
|
||||||
"/" + std::to_string(game.stats.gamesPlayed);
|
"/" + std::to_string(game.stats.gamesPlayed);
|
||||||
neo.drawPango(layoutSmall, &theme.colBlue, 12, 250, 15, scoreFooter, W - 24);
|
neo.drawPango(layoutSmall, &theme.colBlue, 10, 250, 15, scoreFooter, W - 20);
|
||||||
|
|
||||||
// 4. Modals
|
// 4. Modals
|
||||||
if (game.modal == UiModal::WeaponPrompt) {
|
if (game.modal == UiModal::WeaponPrompt) {
|
||||||
int mx = 14, my = 56, mw = W - 28, mh = 176;
|
int mx = 10, my = 54, mw = W - 20, mh = 178;
|
||||||
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
||||||
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
||||||
XSetForeground(dpy, gc, theme.spec.accent);
|
XSetForeground(dpy, gc, theme.spec.accent);
|
||||||
@@ -839,63 +837,66 @@ int main() {
|
|||||||
XDrawRectangle(dpy, pix, gc, mx + 1, my + 1, mw - 3, mh - 3);
|
XDrawRectangle(dpy, pix, gc, mx + 1, my + 1, mw - 3, mh - 3);
|
||||||
|
|
||||||
std::string title = std::string("Fight ") +
|
std::string title = std::string("Fight ") +
|
||||||
monsterNameForLevel(game.pendingMonsterLevel) +
|
monsterNameForLevel(game.pendingMonsterLevel);
|
||||||
" (Lv." + std::to_string(game.pendingMonsterLevel) + ")";
|
|
||||||
neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 8, 22, title, mw - 16, 1);
|
neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 8, 22, title, mw - 16, 1);
|
||||||
|
|
||||||
int wpnDmg = std::max(0, game.pendingMonsterLevel - game.weapon);
|
int wpnDmg = std::max(0, game.pendingMonsterLevel - game.weapon);
|
||||||
int newDur = game.pendingMonsterLevel - 1;
|
int newDur = game.pendingMonsterLevel - 1;
|
||||||
std::string durEffect = (newDur < 2)
|
std::string durEffect = (newDur < 2)
|
||||||
? "Weapon breaks!"
|
? "Breaks!"
|
||||||
: ("Max Lv -> " + std::to_string(newDur));
|
: ("MaxLv->" + std::to_string(newDur));
|
||||||
|
|
||||||
for (int opt = 0; opt < 2; ++opt) {
|
for (int opt = 0; opt < 2; ++opt) {
|
||||||
int oy = my + 40 + opt * 56;
|
int oy = my + 40 + opt * 56;
|
||||||
bool sel = (game.weaponChoiceIdx == opt);
|
bool sel = (game.weaponChoiceIdx == opt);
|
||||||
XSetForeground(dpy, gc, sel ? theme.spec.selBg : theme.spec.bgAltOdd);
|
XSetForeground(dpy, gc, sel ? theme.spec.selBg : theme.spec.bgAltOdd);
|
||||||
XFillRectangle(dpy, pix, gc, mx + 10, oy, mw - 20, 48);
|
XFillRectangle(dpy, pix, gc, mx + 8, oy, mw - 16, 48);
|
||||||
XSetForeground(dpy, gc, sel ? theme.spec.accent : theme.spec.border);
|
XSetForeground(dpy, gc, sel ? theme.spec.accent : theme.spec.border);
|
||||||
XDrawRectangle(dpy, pix, gc, mx + 10, oy, mw - 21, 47);
|
XDrawRectangle(dpy, pix, gc, mx + 8, oy, mw - 17, 47);
|
||||||
|
|
||||||
if (opt == 0) {
|
if (opt == 0) {
|
||||||
std::string l1 = "[1] Use Weapon (+" + std::to_string(game.weapon) + ")";
|
std::string l1 = "[1] Weapon (+" + std::to_string(game.weapon) + " ATK)";
|
||||||
std::string l2 = "Lose " + std::to_string(wpnDmg) + " HP | " + durEffect;
|
std::string l2 = "-" + std::to_string(wpnDmg) + " HP | " + durEffect;
|
||||||
neo.drawPango(layoutMain, &theme.colWhite, mx + 16, oy + 4, 20, l1, mw - 32);
|
neo.drawPango(layoutMain, &theme.colWhite, mx + 14, oy + 4, 20, l1, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colYellow, mx + 16, oy + 25, 18, l2, mw - 32);
|
neo.drawPango(layoutSmall, &theme.colYellow, mx + 14, oy + 25, 18, l2, mw - 28);
|
||||||
} else {
|
} else {
|
||||||
std::string l1 = "[2] Fight Barehanded";
|
std::string l1 = "[2] Barehanded";
|
||||||
std::string l2 = "Lose " + std::to_string(game.pendingMonsterLevel) +
|
std::string l2 = "-" + std::to_string(game.pendingMonsterLevel) +
|
||||||
" HP | Keep Weapon";
|
" HP | Keep Weapon";
|
||||||
neo.drawPango(layoutMain, &theme.colWhite, mx + 16, oy + 4, 20, l1, mw - 32);
|
neo.drawPango(layoutMain, &theme.colWhite, mx + 14, oy + 4, 20, l1, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colRed, mx + 16, oy + 25, 18, l2, mw - 32);
|
neo.drawPango(layoutSmall, &theme.colRed, mx + 14, oy + 25, 18, l2, mw - 28);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
neo.drawSoftbar("Confirm", "Select", "Cancel", &theme.colYellow);
|
neo.drawSoftbar("Confirm", "Select", "Cancel", &theme.colYellow);
|
||||||
} else if (game.modal == UiModal::RulesHelp) {
|
} else if (game.modal == UiModal::RulesHelp) {
|
||||||
int mx = 10, my = 38, mw = W - 20, mh = 228;
|
int mx = 6, my = 36, mw = W - 12, mh = 230;
|
||||||
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
||||||
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
||||||
XSetForeground(dpy, gc, theme.spec.accent);
|
XSetForeground(dpy, gc, theme.spec.accent);
|
||||||
XDrawRectangle(dpy, pix, gc, mx, my, mw - 1, mh - 1);
|
XDrawRectangle(dpy, pix, gc, mx, my, mw - 1, mh - 1);
|
||||||
|
|
||||||
neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 6, 20,
|
neo.drawPango(layoutMain, &theme.colYellow, mx + 6, my + 5, 20,
|
||||||
"Scoundrel Rules", mw - 16, 1);
|
"Scoundrel Rules", mw - 12, 1);
|
||||||
static const char* kRules[] = {
|
static const char* kRules[12] = {
|
||||||
"Deck: 26 Monsters (2-14),",
|
"Deck: 26 Monsters (2-14)",
|
||||||
"9 Weapons (2-10), 9 Potions.",
|
"9 Weaps, 9 Potions (2-10)",
|
||||||
"Play 3 of 4 cards per room;",
|
"Play 3 of 4 cards/room;",
|
||||||
"4th card carries to next room.",
|
"4th card stays for next.",
|
||||||
"Weapons reduce Monster dmg,",
|
"Weapon cuts Monster dmg",
|
||||||
"but can only hit Monsters <=",
|
"if Monster Lv <= Max Lv",
|
||||||
"last slain Monster's level - 1.",
|
"(last slain Lv minus 1).",
|
||||||
"Max 1 Potion heals per room.",
|
"Max 1 Potion heals/room.",
|
||||||
"*: Run (puts 4 cards at bottom,",
|
"*: Run (4 cards->bottom,",
|
||||||
"cannot run 2 rooms in a row).",
|
"no running 2x in a row).",
|
||||||
"Keys: 1-4/Arrows, *:Run, 0:New"
|
"1-4/OK:Play *:Run 0:New",
|
||||||
|
"By Z.Gage,K.Bieg/Luxferre"
|
||||||
};
|
};
|
||||||
for (int i = 0; i < 11; ++i) {
|
for (int i = 0; i < 12; ++i) {
|
||||||
neo.drawPango(layoutSmall, &theme.colLight, mx + 8, my + 28 + i * 17,
|
XftColor* lineCol = (i == 10)
|
||||||
16, kRules[i], mw - 16);
|
? &theme.colYellow
|
||||||
|
: ((i == 11) ? &theme.colBlue : &theme.colLight);
|
||||||
|
neo.drawPango(layoutSmall, lineCol, mx + 6, my + 27 + i * 16,
|
||||||
|
16, kRules[i], mw - 12);
|
||||||
}
|
}
|
||||||
neo.drawSoftbar("Resume", "OK", "Close", &theme.colYellow);
|
neo.drawSoftbar("Resume", "OK", "Close", &theme.colYellow);
|
||||||
} else if (game.modal == UiModal::QuitConfirm) {
|
} else if (game.modal == UiModal::QuitConfirm) {
|
||||||
@@ -930,7 +931,7 @@ int main() {
|
|||||||
}
|
}
|
||||||
neo.drawSoftbar("Select", "OK", "Back", &theme.colYellow);
|
neo.drawSoftbar("Select", "OK", "Back", &theme.colYellow);
|
||||||
} else if (game.modal == UiModal::GameOver) {
|
} else if (game.modal == UiModal::GameOver) {
|
||||||
int mx = 14, my = 52, mw = W - 28, mh = 188;
|
int mx = 10, my = 42, mw = W - 20, mh = 208;
|
||||||
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
XSetForeground(dpy, gc, theme.spec.bgHeader);
|
||||||
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
XFillRectangle(dpy, pix, gc, mx, my, mw, mh);
|
||||||
unsigned long frameCol = game.wonGame ? theme.spec.success : theme.spec.danger;
|
unsigned long frameCol = game.wonGame ? theme.spec.success : theme.spec.danger;
|
||||||
@@ -938,14 +939,14 @@ int main() {
|
|||||||
XDrawRectangle(dpy, pix, gc, mx, my, mw - 1, mh - 1);
|
XDrawRectangle(dpy, pix, gc, mx, my, mw - 1, mh - 1);
|
||||||
XDrawRectangle(dpy, pix, gc, mx + 1, my + 1, mw - 3, mh - 3);
|
XDrawRectangle(dpy, pix, gc, mx + 1, my + 1, mw - 3, mh - 3);
|
||||||
|
|
||||||
neo.drawPango(layoutNum, game.wonGame ? &theme.colGreen : &theme.colRed,
|
neo.drawPango(layoutMain, game.wonGame ? &theme.colGreen : &theme.colRed,
|
||||||
mx + 8, my + 10, 28,
|
mx + 8, my + 8, 22,
|
||||||
game.wonGame ? "DUNGEON CLEARED!" : "YOU DIED!", mw - 16, 1);
|
game.wonGame ? "DUNGEON CLEARED!" : "YOU DIED!", mw - 16, 1);
|
||||||
|
|
||||||
std::string subtitle = game.wonGame
|
std::string subtitle = game.wonGame
|
||||||
? (std::string("Rank: ") + winRankForScore(game.score))
|
? (std::string("Rank: ") + winRankForScore(game.score))
|
||||||
: game.statusLine1;
|
: game.statusLine1;
|
||||||
neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 44, 22,
|
neo.drawPango(layoutSmall, &theme.colYellow, mx + 8, my + 32, 18,
|
||||||
subtitle, mw - 16, 1);
|
subtitle, mw - 16, 1);
|
||||||
|
|
||||||
std::string scStr = "Final Score: " + std::to_string(game.score);
|
std::string scStr = "Final Score: " + std::to_string(game.score);
|
||||||
@@ -954,12 +955,18 @@ int main() {
|
|||||||
std::string winRate = "Wins: " + std::to_string(game.stats.gamesWon) +
|
std::string winRate = "Wins: " + std::to_string(game.stats.gamesWon) +
|
||||||
" / " + std::to_string(game.stats.gamesPlayed);
|
" / " + std::to_string(game.stats.gamesPlayed);
|
||||||
|
|
||||||
neo.drawPango(layoutMain, &theme.colWhite, mx + 16, my + 76, 20, scStr, mw - 32);
|
neo.drawPango(layoutMain, &theme.colWhite, mx + 14, my + 60, 20, scStr, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colBlue, mx + 16, my + 100, 18, bestStr, mw - 32);
|
neo.drawPango(layoutSmall, &theme.colBlue, mx + 14, my + 84, 18, bestStr, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colLight, mx + 16, my + 120, 18, rmStr2, mw - 32);
|
neo.drawPango(layoutSmall, &theme.colLight, mx + 14, my + 104, 18, rmStr2, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colMuted, mx + 16, my + 140, 18, winRate, mw - 32);
|
neo.drawPango(layoutSmall, &theme.colMuted, mx + 14, my + 124, 18, winRate, mw - 28);
|
||||||
neo.drawPango(layoutSmall, &theme.colYellow, mx + 8, my + 164, 18,
|
|
||||||
"Orig: Z.Gage & K.Bieg | Port: Luxferre", mw - 16, 1);
|
XSetForeground(dpy, gc, theme.spec.border);
|
||||||
|
XDrawLine(dpy, pix, gc, mx + 12, my + 148, mx + mw - 13, my + 148);
|
||||||
|
|
||||||
|
neo.drawPango(layoutSmall, &theme.colYellow, mx + 8, my + 154, 17,
|
||||||
|
"Game: Z. Gage & K. Bieg", mw - 16, 1);
|
||||||
|
neo.drawPango(layoutSmall, &theme.colLight, mx + 8, my + 172, 17,
|
||||||
|
"Port: Luxferre", mw - 16, 1);
|
||||||
|
|
||||||
neo.drawSoftbar("New Game", "Play", "Quit", &theme.colGreen);
|
neo.drawSoftbar("New Game", "Play", "Quit", &theme.colGreen);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user