diff --git a/overlay/rootfs/usr/bin/scoundrel b/overlay/rootfs/usr/bin/scoundrel index 07be668..bb1e664 100755 Binary files a/overlay/rootfs/usr/bin/scoundrel and b/overlay/rootfs/usr/bin/scoundrel differ diff --git a/prebuilt/games/usr/bin/scoundrel b/prebuilt/games/usr/bin/scoundrel index 07be668..bb1e664 100755 Binary files a/prebuilt/games/usr/bin/scoundrel and b/prebuilt/games/usr/bin/scoundrel differ diff --git a/src/games/scoundrel.cpp b/src/games/scoundrel.cpp index fe2e988..64fc2cd 100644 --- a/src/games/scoundrel.cpp +++ b/src/games/scoundrel.cpp @@ -325,8 +325,8 @@ class ScoundrelGame { room[i] = 0; } dealRoomIfNeeded(); - statusLine1 = "Entered the dungeon. Pick 3 of 4 cards."; - statusLine2 = "1-4/D-Pad: Card | *: Run | #: Rules"; + statusLine1 = "Pick 3 of 4 room cards."; + statusLine2 = "1-4/OK:Play *:Run #:Help"; } void finishGame(bool won) { @@ -367,14 +367,14 @@ class ScoundrelGame { potionDrank = false; canRun = true; ++roomsCleared; - statusLine2 = "Room cleared! Moving deeper..."; + statusLine2 = "Room cleared! Deeper..."; dealRoomIfNeeded(); } else if (!lastRoom && engaged == 3) { engaged = 0; potionDrank = false; canRun = true; ++roomsCleared; - statusLine2 = "Room cleared! 1 card carried over."; + statusLine2 = "Room cleared! 1 card kept"; dealRoomIfNeeded(); } else { ensureValidSelection(); @@ -393,22 +393,21 @@ class ScoundrelGame { healthLost = diff; durability = val - 1; if (durability < 2) { - statusLine2 = "Weapon shattered after the blow!"; + statusLine2 = "Weapon broke after hit!"; durability = 0; weapon = 0; } else { - statusLine2 = "Weapon max monster level is now " + std::to_string(durability) + "."; + statusLine2 = "Weapon Max Lv now " + std::to_string(durability) + "."; } } else { - statusLine2 = "Fought barehanded (-" + std::to_string(healthLost) + " HP)."; + statusLine2 = "Barehanded (-" + std::to_string(healthLost) + " HP)."; } hp -= healthLost; if (hp < 0) hp = 0; score += val; statusLine1 = std::string("Slain ") + monsterNameForLevel(val) + - " (Lv." + std::to_string(val) + "), lost " + - std::to_string(healthLost) + " HP."; + ": -" + std::to_string(healthLost) + " HP"; checkRoomAdvance(); } @@ -436,16 +435,16 @@ class ScoundrelGame { weapon = ci.level; durability = 14; statusLine1 = std::string("Equipped ") + weaponNameForLevel(weapon) + - " (Lv." + std::to_string(weapon) + ")."; - statusLine2 = "Weapon durability reset to max (Lv.14)."; + " (+" + std::to_string(weapon) + ")"; + statusLine2 = "Weapon Max Lv reset: 14."; checkRoomAdvance(); } else if (ci.type == CardType::PotionHeart) { room[slot] = 0; ++engaged; canRun = false; if (potionDrank) { - statusLine1 = "Potion discarded! (Max 1 per room)"; - statusLine2 = "Already drank a potion in this room."; + statusLine1 = "Potion wasted (max 1/rm)"; + statusLine2 = "Already healed this room"; } else { potionDrank = true; int prevHp = hp; @@ -454,9 +453,9 @@ class ScoundrelGame { if (deckIdx >= 44 || deck[deckIdx] == 0) { lastPotionVal = ci.level; } - statusLine1 = "Drank Lv." + std::to_string(ci.level) + - " Potion (+" + std::to_string(hp - prevHp) + " HP)."; - statusLine2 = "HP is now " + std::to_string(hp) + "/20."; + statusLine1 = "Potion +" + std::to_string(hp - prevHp) + + " HP (Lv." + std::to_string(ci.level) + ")"; + statusLine2 = "Health is now " + std::to_string(hp) + "/20 HP."; } checkRoomAdvance(); } @@ -465,11 +464,11 @@ class ScoundrelGame { void runFromRoom() { if (!canRun || engaged > 0 || lastRoom) { if (lastRoom) { - statusLine2 = "Cannot run from the final room!"; + statusLine2 = "No running in last room!"; } else if (engaged > 0) { - statusLine2 = "Cannot run after engaging a card!"; + statusLine2 = "Can't run mid-room!"; } else { - statusLine2 = "Cannot run twice in a row!"; + statusLine2 = "Can't run 2x in a row!"; } return; } @@ -498,8 +497,8 @@ class ScoundrelGame { engaged = 0; lastRoom = false; dealRoomIfNeeded(); - statusLine1 = "Fled the room! Cards placed at bottom."; - statusLine2 = "Must clear this room before running again."; + statusLine1 = "Fled! 4 cards -> bottom."; + statusLine2 = "Clear room to run again."; } }; @@ -626,7 +625,6 @@ int main() { GC gc = neo.gc; PangoLayout* layoutMain = neo.layoutMain; PangoLayout* layoutSmall = neo.layoutSmall; - PangoLayout* layoutNum = neo.layoutNum; PluginTheme& theme = neo.theme; Atom wmDelete = XInternAtom(dpy, "WM_DELETE_WINDOW", False); @@ -654,7 +652,7 @@ int main() { XftColor* hpCol = (game.hp >= 12) ? &theme.colGreen : ((game.hp >= 6) ? &theme.colYellow : &theme.colRed); 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; XSetForeground(dpy, gc, theme.spec.bgAltOdd); @@ -671,19 +669,19 @@ int main() { // Center: Deck & Rooms cleared std::string deckStr = "DECK: " + std::to_string(game.remainingDeckCards()); - std::string rmStr = "ROOMS: " + std::to_string(game.roomsCleared); - neo.drawPango(layoutSmall, &theme.colLight, 86, 2, 16, deckStr, 72, 1); - neo.drawPango(layoutSmall, &theme.colMuted, 86, 18, 16, rmStr, 72, 1); + std::string rmStr = "ROOM: " + std::to_string(game.roomsCleared); + neo.drawPango(layoutSmall, &theme.colLight, 84, 2, 16, deckStr, 72, 1); + neo.drawPango(layoutSmall, &theme.colMuted, 84, 18, 16, rmStr, 72, 1); // Right: Equipped Weapon & Durability if (game.weapon > 0) { std::string wpnStr = "WPN +" + std::to_string(game.weapon); - std::string durStr = "MAX LV:" + std::to_string(game.durability); - neo.drawPango(layoutSmall, &theme.colBlue, 160, 2, 16, wpnStr, 74, 2); - neo.drawPango(layoutSmall, &theme.colYellow, 160, 18, 16, durStr, 74, 2); + std::string durStr = "MAX:" + std::to_string(game.durability); + neo.drawPango(layoutSmall, &theme.colBlue, 158, 2, 16, wpnStr, 76, 2); + neo.drawPango(layoutSmall, &theme.colYellow, 158, 18, 16, durStr, 76, 2); } else { - neo.drawPango(layoutSmall, &theme.colMuted, 160, 2, 16, "NO WEAPON", 74, 2); - neo.drawPango(layoutSmall, &theme.colMuted, 160, 18, 16, "BAREHAND", 74, 2); + neo.drawPango(layoutSmall, &theme.colMuted, 158, 2, 16, "NO WEAP", 76, 2); + neo.drawPango(layoutSmall, &theme.colMuted, 158, 18, 16, "BAREHAND", 76, 2); } // 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 (game.weapon > 0 && ci.level <= game.durability) { int dmg = std::max(0, ci.level - game.weapon); - effectStr = "-" + std::to_string(dmg) + " HP*"; + effectStr = "-" + std::to_string(dmg) + " HP"; effCol = &theme.colYellow; } else { effectStr = "-" + std::to_string(ci.level) + " HP"; @@ -785,53 +783,53 @@ int main() { XSetForeground(dpy, gc, theme.spec.border); 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) ? game.room[game.selectedSlot] : 0; if (selCode == 0) { - inspectHeader += "Empty"; + inspectHeader += "Empty Slot"; } else { CardInfo sci = decodeCard(selCode); if (sci.type == CardType::MonsterSpade || sci.type == CardType::MonsterClub) { inspectHeader += std::string(monsterNameForLevel(sci.level)) + - " (Lv." + std::to_string(sci.level) + ")"; + " Lv." + std::to_string(sci.level); } else if (sci.type == CardType::WeaponDiamond) { inspectHeader += std::string(weaponNameForLevel(sci.level)) + - " (+" + std::to_string(sci.level) + " ATK)"; + " +" + std::to_string(sci.level) + " ATK"; } 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 int cardsNeeded = game.lastRoom ? game.remainingRoomCards() : (3 - game.engaged); if (cardsNeeded < 0) cardsNeeded = 0; - std::string roomProg = "Turn: " + std::to_string(game.engaged) + "/3 (" + - std::to_string(cardsNeeded) + " left) | "; + std::string roomProg = "Cards: " + std::to_string(game.engaged) + "/3 (" + + std::to_string(cardsNeeded) + " left) "; if (game.canRun && game.engaged == 0 && !game.lastRoom) { - roomProg += "*:Run OK"; + roomProg += "*:Run"; } 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); 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.colMuted, 12, 234, 18, game.statusLine2, W - 24); + neo.drawPango(layoutSmall, &theme.colWhite, 10, 216, 18, game.statusLine1, W - 20); + neo.drawPango(layoutSmall, &theme.colMuted, 10, 234, 18, game.statusLine2, W - 20); - std::string scoreFooter = "Score: " + std::to_string(game.score) + - " Best: " + std::to_string(game.stats.bestScore) + - " W/P: " + std::to_string(game.stats.gamesWon) + + std::string scoreFooter = "Scr:" + std::to_string(game.score) + + " Best:" + std::to_string(game.stats.bestScore) + + " W:" + std::to_string(game.stats.gamesWon) + "/" + 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 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); XFillRectangle(dpy, pix, gc, mx, my, mw, mh); XSetForeground(dpy, gc, theme.spec.accent); @@ -839,63 +837,66 @@ int main() { XDrawRectangle(dpy, pix, gc, mx + 1, my + 1, mw - 3, mh - 3); std::string title = std::string("Fight ") + - monsterNameForLevel(game.pendingMonsterLevel) + - " (Lv." + std::to_string(game.pendingMonsterLevel) + ")"; + monsterNameForLevel(game.pendingMonsterLevel); neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 8, 22, title, mw - 16, 1); int wpnDmg = std::max(0, game.pendingMonsterLevel - game.weapon); int newDur = game.pendingMonsterLevel - 1; std::string durEffect = (newDur < 2) - ? "Weapon breaks!" - : ("Max Lv -> " + std::to_string(newDur)); + ? "Breaks!" + : ("MaxLv->" + std::to_string(newDur)); for (int opt = 0; opt < 2; ++opt) { int oy = my + 40 + opt * 56; bool sel = (game.weaponChoiceIdx == opt); 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); - XDrawRectangle(dpy, pix, gc, mx + 10, oy, mw - 21, 47); + XDrawRectangle(dpy, pix, gc, mx + 8, oy, mw - 17, 47); if (opt == 0) { - std::string l1 = "[1] Use Weapon (+" + std::to_string(game.weapon) + ")"; - std::string l2 = "Lose " + std::to_string(wpnDmg) + " HP | " + durEffect; - neo.drawPango(layoutMain, &theme.colWhite, mx + 16, oy + 4, 20, l1, mw - 32); - neo.drawPango(layoutSmall, &theme.colYellow, mx + 16, oy + 25, 18, l2, mw - 32); + std::string l1 = "[1] Weapon (+" + std::to_string(game.weapon) + " ATK)"; + std::string l2 = "-" + std::to_string(wpnDmg) + " HP | " + durEffect; + neo.drawPango(layoutMain, &theme.colWhite, mx + 14, oy + 4, 20, l1, mw - 28); + neo.drawPango(layoutSmall, &theme.colYellow, mx + 14, oy + 25, 18, l2, mw - 28); } else { - std::string l1 = "[2] Fight Barehanded"; - std::string l2 = "Lose " + std::to_string(game.pendingMonsterLevel) + + std::string l1 = "[2] Barehanded"; + std::string l2 = "-" + std::to_string(game.pendingMonsterLevel) + " HP | Keep Weapon"; - neo.drawPango(layoutMain, &theme.colWhite, mx + 16, oy + 4, 20, l1, mw - 32); - neo.drawPango(layoutSmall, &theme.colRed, mx + 16, oy + 25, 18, l2, mw - 32); + neo.drawPango(layoutMain, &theme.colWhite, mx + 14, oy + 4, 20, l1, mw - 28); + neo.drawPango(layoutSmall, &theme.colRed, mx + 14, oy + 25, 18, l2, mw - 28); } } neo.drawSoftbar("Confirm", "Select", "Cancel", &theme.colYellow); } 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); XFillRectangle(dpy, pix, gc, mx, my, mw, mh); XSetForeground(dpy, gc, theme.spec.accent); XDrawRectangle(dpy, pix, gc, mx, my, mw - 1, mh - 1); - neo.drawPango(layoutMain, &theme.colYellow, mx + 8, my + 6, 20, - "Scoundrel Rules", mw - 16, 1); - static const char* kRules[] = { - "Deck: 26 Monsters (2-14),", - "9 Weapons (2-10), 9 Potions.", - "Play 3 of 4 cards per room;", - "4th card carries to next room.", - "Weapons reduce Monster dmg,", - "but can only hit Monsters <=", - "last slain Monster's level - 1.", - "Max 1 Potion heals per room.", - "*: Run (puts 4 cards at bottom,", - "cannot run 2 rooms in a row).", - "Keys: 1-4/Arrows, *:Run, 0:New" + neo.drawPango(layoutMain, &theme.colYellow, mx + 6, my + 5, 20, + "Scoundrel Rules", mw - 12, 1); + static const char* kRules[12] = { + "Deck: 26 Monsters (2-14)", + "9 Weaps, 9 Potions (2-10)", + "Play 3 of 4 cards/room;", + "4th card stays for next.", + "Weapon cuts Monster dmg", + "if Monster Lv <= Max Lv", + "(last slain Lv minus 1).", + "Max 1 Potion heals/room.", + "*: Run (4 cards->bottom,", + "no running 2x in a row).", + "1-4/OK:Play *:Run 0:New", + "By Z.Gage,K.Bieg/Luxferre" }; - for (int i = 0; i < 11; ++i) { - neo.drawPango(layoutSmall, &theme.colLight, mx + 8, my + 28 + i * 17, - 16, kRules[i], mw - 16); + for (int i = 0; i < 12; ++i) { + XftColor* lineCol = (i == 10) + ? &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); } else if (game.modal == UiModal::QuitConfirm) { @@ -930,7 +931,7 @@ int main() { } neo.drawSoftbar("Select", "OK", "Back", &theme.colYellow); } 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); XFillRectangle(dpy, pix, gc, mx, my, mw, mh); 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 + 1, my + 1, mw - 3, mh - 3); - neo.drawPango(layoutNum, game.wonGame ? &theme.colGreen : &theme.colRed, - mx + 8, my + 10, 28, + neo.drawPango(layoutMain, game.wonGame ? &theme.colGreen : &theme.colRed, + mx + 8, my + 8, 22, game.wonGame ? "DUNGEON CLEARED!" : "YOU DIED!", mw - 16, 1); std::string subtitle = game.wonGame ? (std::string("Rank: ") + winRankForScore(game.score)) : 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); 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::to_string(game.stats.gamesPlayed); - neo.drawPango(layoutMain, &theme.colWhite, mx + 16, my + 76, 20, scStr, mw - 32); - neo.drawPango(layoutSmall, &theme.colBlue, mx + 16, my + 100, 18, bestStr, mw - 32); - neo.drawPango(layoutSmall, &theme.colLight, mx + 16, my + 120, 18, rmStr2, mw - 32); - neo.drawPango(layoutSmall, &theme.colMuted, mx + 16, my + 140, 18, winRate, mw - 32); - neo.drawPango(layoutSmall, &theme.colYellow, mx + 8, my + 164, 18, - "Orig: Z.Gage & K.Bieg | Port: Luxferre", mw - 16, 1); + neo.drawPango(layoutMain, &theme.colWhite, mx + 14, my + 60, 20, scStr, mw - 28); + neo.drawPango(layoutSmall, &theme.colBlue, mx + 14, my + 84, 18, bestStr, mw - 28); + neo.drawPango(layoutSmall, &theme.colLight, mx + 14, my + 104, 18, rmStr2, mw - 28); + neo.drawPango(layoutSmall, &theme.colMuted, mx + 14, my + 124, 18, winRate, mw - 28); + + 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); } else {