Add 3 files
Browse files- README.md +6 -4
- index.html +724 -19
- prompts.txt +5 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: red
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: rogelike
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: red
|
| 5 |
+
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,724 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Roguelike Deckbuilder</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<style>
|
| 9 |
+
@keyframes shake {
|
| 10 |
+
0%, 100% { transform: translateX(0); }
|
| 11 |
+
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
|
| 12 |
+
20%, 40%, 60%, 80% { transform: translateX(5px); }
|
| 13 |
+
}
|
| 14 |
+
.shake {
|
| 15 |
+
animation: shake 0.5s ease-in-out;
|
| 16 |
+
}
|
| 17 |
+
@keyframes pulse {
|
| 18 |
+
0%, 100% { transform: scale(1); }
|
| 19 |
+
50% { transform: scale(1.05); }
|
| 20 |
+
}
|
| 21 |
+
.pulse {
|
| 22 |
+
animation: pulse 1s infinite;
|
| 23 |
+
}
|
| 24 |
+
.hp-rolling {
|
| 25 |
+
color: #ef4444;
|
| 26 |
+
font-weight: bold;
|
| 27 |
+
}
|
| 28 |
+
.card {
|
| 29 |
+
transition: all 0.2s ease;
|
| 30 |
+
}
|
| 31 |
+
.card:hover {
|
| 32 |
+
transform: translateY(-5px);
|
| 33 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
|
| 34 |
+
}
|
| 35 |
+
.emoji {
|
| 36 |
+
font-size: 3rem;
|
| 37 |
+
line-height: 1;
|
| 38 |
+
}
|
| 39 |
+
.player-emoji {
|
| 40 |
+
font-size: 2.5rem;
|
| 41 |
+
line-height: 1;
|
| 42 |
+
}
|
| 43 |
+
.upgrade-card {
|
| 44 |
+
border: 2px solid #8b5cf6;
|
| 45 |
+
}
|
| 46 |
+
.upgrade-card:hover {
|
| 47 |
+
border-color: #a78bfa;
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
</head>
|
| 51 |
+
<body class="bg-gray-900 text-white min-h-screen">
|
| 52 |
+
<div class="container mx-auto px-4 py-8">
|
| 53 |
+
<div class="flex justify-between items-center mb-8">
|
| 54 |
+
<h1 class="text-3xl font-bold text-purple-400">Roguelike Deckbuilder</h1>
|
| 55 |
+
<div class="flex space-x-4">
|
| 56 |
+
<div class="bg-gray-800 px-4 py-2 rounded-lg">
|
| 57 |
+
<span class="text-gray-400">HP: </span>
|
| 58 |
+
<span id="player-hp" class="font-bold">100</span>/<span id="player-max-hp">100</span>
|
| 59 |
+
</div>
|
| 60 |
+
<div class="bg-gray-800 px-4 py-2 rounded-lg">
|
| 61 |
+
<span class="text-gray-400">Energy: </span>
|
| 62 |
+
<span id="player-energy" class="font-bold text-blue-400">3</span>/3
|
| 63 |
+
</div>
|
| 64 |
+
<div class="bg-gray-800 px-4 py-2 rounded-lg">
|
| 65 |
+
<span class="text-gray-400">Floor: </span>
|
| 66 |
+
<span id="floor" class="font-bold">1</span>
|
| 67 |
+
</div>
|
| 68 |
+
<div class="bg-gray-800 px-4 py-2 rounded-lg">
|
| 69 |
+
<span class="text-gray-400">Gold: </span>
|
| 70 |
+
<span id="player-gold" class="font-bold text-yellow-400">0</span>
|
| 71 |
+
</div>
|
| 72 |
+
</div>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 76 |
+
<!-- Left Column - Player -->
|
| 77 |
+
<div class="lg:col-span-1">
|
| 78 |
+
<!-- Player Area -->
|
| 79 |
+
<div class="bg-gray-800 rounded-xl p-6 flex flex-col">
|
| 80 |
+
<h2 class="text-xl font-bold mb-4 text-green-400">Player</h2>
|
| 81 |
+
<div class="bg-gray-700 rounded-lg p-6 w-full text-center mb-4 flex-grow flex flex-col items-center justify-center">
|
| 82 |
+
<div class="player-emoji mb-4" id="player-emoji">🦊</div>
|
| 83 |
+
<div class="my-2">
|
| 84 |
+
<span class="text-gray-400">HP: </span>
|
| 85 |
+
<span id="player-hp-display" class="font-bold">100</span>/<span id="player-max-hp-display">100</span>
|
| 86 |
+
</div>
|
| 87 |
+
<div class="my-2">
|
| 88 |
+
<span class="text-gray-400">Block: </span>
|
| 89 |
+
<span id="player-block" class="font-bold text-blue-400">0</span>
|
| 90 |
+
</div>
|
| 91 |
+
<div class="my-2">
|
| 92 |
+
<span class="text-gray-400">Strength: </span>
|
| 93 |
+
<span id="player-strength" class="font-bold text-red-400">0</span>
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Middle Column - Enemy -->
|
| 100 |
+
<div class="lg:col-span-1">
|
| 101 |
+
<!-- Enemy Area -->
|
| 102 |
+
<div class="bg-gray-800 rounded-xl p-6 flex flex-col">
|
| 103 |
+
<h2 class="text-xl font-bold mb-4 text-red-400">Enemy</h2>
|
| 104 |
+
<div id="enemy-container" class="bg-gray-700 rounded-lg p-6 w-full text-center mb-4 flex-grow flex flex-col items-center justify-center">
|
| 105 |
+
<div class="emoji mb-4" id="enemy-emoji">🐺</div>
|
| 106 |
+
<div class="text-2xl font-bold" id="enemy-name">Slime</div>
|
| 107 |
+
<div class="my-2">
|
| 108 |
+
<span class="text-gray-400">HP: </span>
|
| 109 |
+
<span id="enemy-hp" class="font-bold">30</span>/<span id="enemy-max-hp">30</span>
|
| 110 |
+
</div>
|
| 111 |
+
<div class="my-2">
|
| 112 |
+
<span class="text-gray-400">Intent: </span>
|
| 113 |
+
<span id="enemy-intent" class="font-bold text-yellow-400">Attack (10)</span>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
<div id="enemy-attack" class="hidden bg-red-900 text-white px-4 py-2 rounded-lg mb-4">
|
| 117 |
+
Enemy attacks for <span id="enemy-damage">10</span> damage!
|
| 118 |
+
</div>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
|
| 122 |
+
<!-- Right Column - Cards and Log -->
|
| 123 |
+
<div class="lg:col-span-1 space-y-8">
|
| 124 |
+
<!-- Player Deck Area -->
|
| 125 |
+
<div class="bg-gray-800 rounded-xl p-6">
|
| 126 |
+
<h2 class="text-xl font-bold mb-4 text-green-400">Your Hand</h2>
|
| 127 |
+
<div id="hand" class="grid grid-cols-1 gap-4 mb-4">
|
| 128 |
+
<!-- Cards will be inserted here -->
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div class="mt-4 flex justify-between">
|
| 132 |
+
<div>
|
| 133 |
+
<h3 class="text-lg font-bold mb-2 text-gray-400">Deck: <span id="deck-count">10</span> cards</h3>
|
| 134 |
+
<h3 class="text-lg font-bold mb-2 text-gray-400">Discard: <span id="discard-count">0</span> cards</h3>
|
| 135 |
+
</div>
|
| 136 |
+
<div class="flex justify-center">
|
| 137 |
+
<button id="end-turn-btn" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-2 px-6 rounded-lg transition">
|
| 138 |
+
End Turn
|
| 139 |
+
</button>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
</div>
|
| 143 |
+
|
| 144 |
+
<!-- Battle Area -->
|
| 145 |
+
<div class="bg-gray-800 rounded-xl p-6">
|
| 146 |
+
<h2 class="text-xl font-bold mb-4 text-yellow-400">Battle Log</h2>
|
| 147 |
+
<div id="battle-log" class="bg-gray-900 rounded-lg p-4 h-64 overflow-y-auto mb-4">
|
| 148 |
+
<div class="text-gray-400">Battle begins!</div>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
|
| 154 |
+
<!-- Upgrade Modal -->
|
| 155 |
+
<div id="upgrade-modal" class="hidden fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50">
|
| 156 |
+
<div class="bg-gray-800 rounded-xl p-8 max-w-2xl w-full">
|
| 157 |
+
<h2 class="text-3xl font-bold text-purple-500 mb-4">Choose an Upgrade</h2>
|
| 158 |
+
<p class="text-xl mb-6">You earned <span id="upgrade-gold" class="text-yellow-400">50</span> gold! Select an upgrade:</p>
|
| 159 |
+
|
| 160 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
|
| 161 |
+
<div id="upgrade-1" class="upgrade-card bg-gray-700 rounded-lg p-4 cursor-pointer hover:bg-gray-600 transition">
|
| 162 |
+
<h3 class="font-bold text-lg mb-2">Max HP +10</h3>
|
| 163 |
+
<p class="text-sm text-gray-400">Increase your maximum HP by 10</p>
|
| 164 |
+
<div class="mt-2 text-yellow-400 font-bold">Cost: 50 gold</div>
|
| 165 |
+
</div>
|
| 166 |
+
<div id="upgrade-2" class="upgrade-card bg-gray-700 rounded-lg p-4 cursor-pointer hover:bg-gray-600 transition">
|
| 167 |
+
<h3 class="font-bold text-lg mb-2">Energy +1</h3>
|
| 168 |
+
<p class="text-sm text-gray-400">Gain 1 additional energy per turn</p>
|
| 169 |
+
<div class="mt-2 text-yellow-400 font-bold">Cost: 75 gold</div>
|
| 170 |
+
</div>
|
| 171 |
+
<div id="upgrade-3" class="upgrade-card bg-gray-700 rounded-lg p-4 cursor-pointer hover:bg-gray-600 transition">
|
| 172 |
+
<h3 class="font-bold text-lg mb-2">Strength +1</h3>
|
| 173 |
+
<p class="text-sm text-gray-400">Increase your attack damage by 1</p>
|
| 174 |
+
<div class="mt-2 text-yellow-400 font-bold">Cost: 50 gold</div>
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
|
| 178 |
+
<div class="flex justify-between">
|
| 179 |
+
<button id="skip-upgrade" class="bg-gray-600 hover:bg-gray-500 text-white font-bold py-2 px-6 rounded-lg transition">
|
| 180 |
+
Skip (Save Gold)
|
| 181 |
+
</button>
|
| 182 |
+
<div class="text-lg">
|
| 183 |
+
<span class="text-gray-400">Current Gold: </span>
|
| 184 |
+
<span id="current-gold" class="font-bold text-yellow-400">0</span>
|
| 185 |
+
</div>
|
| 186 |
+
</div>
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
|
| 190 |
+
<!-- Game Over Modal -->
|
| 191 |
+
<div id="game-over-modal" class="hidden fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50">
|
| 192 |
+
<div class="bg-gray-800 rounded-xl p-8 max-w-md w-full">
|
| 193 |
+
<h2 class="text-3xl font-bold text-red-500 mb-4">Game Over</h2>
|
| 194 |
+
<p class="text-xl mb-6">You reached floor <span id="final-floor">1</span>!</p>
|
| 195 |
+
<button id="restart-btn" class="w-full bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 px-4 rounded-lg transition">
|
| 196 |
+
Play Again
|
| 197 |
+
</button>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
<script>
|
| 203 |
+
// Game State
|
| 204 |
+
const gameState = {
|
| 205 |
+
player: {
|
| 206 |
+
hp: 100,
|
| 207 |
+
maxHp: 100,
|
| 208 |
+
energy: 3,
|
| 209 |
+
maxEnergy: 3,
|
| 210 |
+
deck: [],
|
| 211 |
+
hand: [],
|
| 212 |
+
discard: [],
|
| 213 |
+
block: 0,
|
| 214 |
+
strength: 0,
|
| 215 |
+
gold: 0,
|
| 216 |
+
emoji: "🦊"
|
| 217 |
+
},
|
| 218 |
+
enemy: {
|
| 219 |
+
name: "Slime",
|
| 220 |
+
hp: 30,
|
| 221 |
+
maxHp: 30,
|
| 222 |
+
intent: "Attack",
|
| 223 |
+
damage: 10,
|
| 224 |
+
emoji: "🐺",
|
| 225 |
+
actions: [
|
| 226 |
+
{ type: "Attack", damage: 10 },
|
| 227 |
+
{ type: "Attack", damage: 12 },
|
| 228 |
+
{ type: "Debuff", amount: 2 }
|
| 229 |
+
]
|
| 230 |
+
},
|
| 231 |
+
floor: 1,
|
| 232 |
+
isPlayerTurn: true,
|
| 233 |
+
hpRolling: false,
|
| 234 |
+
hpRollTarget: 0,
|
| 235 |
+
hpRollInterval: null,
|
| 236 |
+
gameOver: false
|
| 237 |
+
};
|
| 238 |
+
|
| 239 |
+
// Card Definitions
|
| 240 |
+
const cards = [
|
| 241 |
+
{ id: 1, name: "Strike", cost: 1, description: "Deal 6 damage", type: "Attack", damage: 6 },
|
| 242 |
+
{ id: 2, name: "Defend", cost: 1, description: "Gain 5 Block", type: "Block", block: 5 },
|
| 243 |
+
{ id: 3, name: "Bash", cost: 2, description: "Deal 10 damage", type: "Attack", damage: 10 },
|
| 244 |
+
{ id: 4, name: "Slash", cost: 1, description: "Deal 8 damage", type: "Attack", damage: 8 },
|
| 245 |
+
{ id: 5, name: "Dodge", cost: 1, description: "Gain 3 Block", type: "Block", block: 3 },
|
| 246 |
+
{ id: 6, name: "Fireball", cost: 2, description: "Deal 15 damage", type: "Attack", damage: 15 },
|
| 247 |
+
{ id: 7, name: "Heal", cost: 2, description: "Heal 8 HP", type: "Heal", heal: 8 },
|
| 248 |
+
{ id: 8, name: "Double Strike", cost: 2, description: "Deal 5 damage twice", type: "Attack", damage: 5, hits: 2 },
|
| 249 |
+
{ id: 9, name: "Shield", cost: 1, description: "Gain 7 Block", type: "Block", block: 7 },
|
| 250 |
+
{ id: 10, name: "Cleave", cost: 1, description: "Deal 4 damage to all enemies", type: "Attack", damage: 4, aoe: true }
|
| 251 |
+
];
|
| 252 |
+
|
| 253 |
+
// Initialize the game
|
| 254 |
+
function initGame() {
|
| 255 |
+
gameState.player.deck = [...cards];
|
| 256 |
+
gameState.player.hand = [];
|
| 257 |
+
gameState.player.discard = [];
|
| 258 |
+
gameState.player.hp = gameState.player.maxHp;
|
| 259 |
+
gameState.player.block = 0;
|
| 260 |
+
gameState.player.strength = 0;
|
| 261 |
+
gameState.player.gold = 0;
|
| 262 |
+
gameState.player.emoji = "🦊";
|
| 263 |
+
gameState.floor = 1;
|
| 264 |
+
gameState.gameOver = false;
|
| 265 |
+
|
| 266 |
+
// Clear battle log
|
| 267 |
+
document.getElementById('battle-log').innerHTML = '<div class="text-gray-400">Battle begins!</div>';
|
| 268 |
+
|
| 269 |
+
// Create a new enemy for the first floor
|
| 270 |
+
createEnemy();
|
| 271 |
+
|
| 272 |
+
// Shuffle deck and draw starting hand
|
| 273 |
+
shuffleDeck();
|
| 274 |
+
drawHand();
|
| 275 |
+
|
| 276 |
+
updateUI();
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
// Create a new enemy with scaled stats based on floor
|
| 280 |
+
function createEnemy() {
|
| 281 |
+
const enemyTypes = [
|
| 282 |
+
{ name: "Slime", emoji: "🐍", baseHp: 30, baseDamage: 10 },
|
| 283 |
+
{ name: "Goblin", emoji: "👹", baseHp: 40, baseDamage: 12 },
|
| 284 |
+
{ name: "Skeleton", emoji: "💀", baseHp: 35, baseDamage: 14 },
|
| 285 |
+
{ name: "Orc", emoji: "👺", baseHp: 50, baseDamage: 15 },
|
| 286 |
+
{ name: "Dragon", emoji: "🐉", baseHp: 60, baseDamage: 18 }
|
| 287 |
+
];
|
| 288 |
+
|
| 289 |
+
const type = enemyTypes[Math.floor(Math.random() * enemyTypes.length)];
|
| 290 |
+
const scale = 1 + (gameState.floor - 1) * 0.2;
|
| 291 |
+
|
| 292 |
+
gameState.enemy = {
|
| 293 |
+
name: type.name,
|
| 294 |
+
emoji: type.emoji,
|
| 295 |
+
hp: Math.floor(type.baseHp * scale),
|
| 296 |
+
maxHp: Math.floor(type.baseHp * scale),
|
| 297 |
+
intent: "Attack",
|
| 298 |
+
damage: Math.floor(type.baseDamage * scale),
|
| 299 |
+
actions: [
|
| 300 |
+
{ type: "Attack", damage: Math.floor(type.baseDamage * scale) },
|
| 301 |
+
{ type: "Attack", damage: Math.floor(type.baseDamage * 1.2 * scale) },
|
| 302 |
+
{ type: "Debuff", amount: 2 }
|
| 303 |
+
]
|
| 304 |
+
};
|
| 305 |
+
|
| 306 |
+
setEnemyIntent();
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
// Set enemy's next action
|
| 310 |
+
function setEnemyIntent() {
|
| 311 |
+
const action = gameState.enemy.actions[Math.floor(Math.random() * gameState.enemy.actions.length)];
|
| 312 |
+
|
| 313 |
+
if (action.type === "Attack") {
|
| 314 |
+
gameState.enemy.intent = "Attack";
|
| 315 |
+
gameState.enemy.damage = action.damage;
|
| 316 |
+
} else if (action.type === "Debuff") {
|
| 317 |
+
gameState.enemy.intent = "Debuff";
|
| 318 |
+
gameState.enemy.damage = action.amount;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
updateEnemyUI();
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
// Shuffle the deck
|
| 325 |
+
function shuffleDeck() {
|
| 326 |
+
for (let i = gameState.player.deck.length - 1; i > 0; i--) {
|
| 327 |
+
const j = Math.floor(Math.random() * (i + 1));
|
| 328 |
+
[gameState.player.deck[i], gameState.player.deck[j]] = [gameState.player.deck[j], gameState.player.deck[i]];
|
| 329 |
+
}
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
// Draw a hand of 5 cards
|
| 333 |
+
function drawHand() {
|
| 334 |
+
// Clear current hand (cards go to discard at end of turn)
|
| 335 |
+
gameState.player.hand = [];
|
| 336 |
+
gameState.player.energy = gameState.player.maxEnergy;
|
| 337 |
+
|
| 338 |
+
let cardsDrawn = 0;
|
| 339 |
+
|
| 340 |
+
while (cardsDrawn < 5) {
|
| 341 |
+
// If deck is empty, try to reshuffle discard into deck
|
| 342 |
+
if (gameState.player.deck.length === 0) {
|
| 343 |
+
if (gameState.player.discard.length === 0) {
|
| 344 |
+
// No cards left at all
|
| 345 |
+
addToLog("No cards left to draw!", "red-400");
|
| 346 |
+
break;
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
// Reshuffle discard into deck
|
| 350 |
+
addToLog("Shuffling discard pile into deck!", "purple-400");
|
| 351 |
+
gameState.player.deck = [...gameState.player.discard];
|
| 352 |
+
gameState.player.discard = [];
|
| 353 |
+
shuffleDeck();
|
| 354 |
+
}
|
| 355 |
+
|
| 356 |
+
// Draw a card
|
| 357 |
+
gameState.player.hand.push(gameState.player.deck.pop());
|
| 358 |
+
cardsDrawn++;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
updateHandUI();
|
| 362 |
+
updateDeckUI();
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
// Play a card
|
| 366 |
+
function playCard(cardIndex) {
|
| 367 |
+
if (!gameState.isPlayerTurn || gameState.gameOver) return;
|
| 368 |
+
|
| 369 |
+
const card = gameState.player.hand[cardIndex];
|
| 370 |
+
|
| 371 |
+
// Check if player has enough energy
|
| 372 |
+
if (gameState.player.energy < card.cost) {
|
| 373 |
+
addToLog("Not enough energy to play " + card.name + "!", "red-400");
|
| 374 |
+
return;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
// Spend energy
|
| 378 |
+
gameState.player.energy -= card.cost;
|
| 379 |
+
|
| 380 |
+
// Handle card effects
|
| 381 |
+
if (card.type === "Attack") {
|
| 382 |
+
let totalDamage = card.damage + gameState.player.strength;
|
| 383 |
+
|
| 384 |
+
if (card.hits) {
|
| 385 |
+
for (let i = 0; i < card.hits; i++) {
|
| 386 |
+
dealDamageToEnemy(totalDamage);
|
| 387 |
+
}
|
| 388 |
+
addToLog(`Dealt ${totalDamage} damage ${card.hits} times with ${card.name}!`, "green-400");
|
| 389 |
+
} else if (card.aoe) {
|
| 390 |
+
dealDamageToEnemy(totalDamage);
|
| 391 |
+
addToLog(`Dealt ${totalDamage} damage to all enemies with ${card.name}!`, "green-400");
|
| 392 |
+
} else {
|
| 393 |
+
dealDamageToEnemy(totalDamage);
|
| 394 |
+
addToLog(`Dealt ${totalDamage} damage with ${card.name}!`, "green-400");
|
| 395 |
+
}
|
| 396 |
+
} else if (card.type === "Block") {
|
| 397 |
+
gameState.player.block += card.block;
|
| 398 |
+
addToLog(`Gained ${card.block} Block from ${card.name}!`, "blue-400");
|
| 399 |
+
} else if (card.type === "Heal") {
|
| 400 |
+
gameState.player.hp = Math.min(gameState.player.hp + card.heal, gameState.player.maxHp);
|
| 401 |
+
addToLog(`Healed ${card.heal} HP with ${card.name}!`, "green-400");
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
// Move card to discard
|
| 405 |
+
gameState.player.discard.push(card);
|
| 406 |
+
gameState.player.hand.splice(cardIndex, 1);
|
| 407 |
+
|
| 408 |
+
// Check if enemy is dead
|
| 409 |
+
if (gameState.enemy.hp <= 0) {
|
| 410 |
+
addToLog(`Defeated the ${gameState.enemy.name}!`, "purple-400");
|
| 411 |
+
|
| 412 |
+
// Award gold
|
| 413 |
+
const goldEarned = Math.floor(20 + Math.random() * 20);
|
| 414 |
+
gameState.player.gold += goldEarned;
|
| 415 |
+
addToLog(`Earned ${goldEarned} gold!`, "yellow-400");
|
| 416 |
+
|
| 417 |
+
setTimeout(() => {
|
| 418 |
+
gameState.floor++;
|
| 419 |
+
|
| 420 |
+
// Every 3 floors, show upgrade options
|
| 421 |
+
if (gameState.floor % 3 === 0) {
|
| 422 |
+
showUpgradeOptions();
|
| 423 |
+
} else {
|
| 424 |
+
createEnemy();
|
| 425 |
+
addToLog(`Moving to floor ${gameState.floor}...`, "yellow-400");
|
| 426 |
+
|
| 427 |
+
// At start of new floor, shuffle discard into deck
|
| 428 |
+
gameState.player.deck = [...gameState.player.discard, ...gameState.player.deck];
|
| 429 |
+
gameState.player.discard = [];
|
| 430 |
+
shuffleDeck();
|
| 431 |
+
|
| 432 |
+
drawHand();
|
| 433 |
+
}
|
| 434 |
+
}, 1000);
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
updateUI();
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
// Show upgrade options to player
|
| 441 |
+
function showUpgradeOptions() {
|
| 442 |
+
document.getElementById('upgrade-gold').textContent = gameState.player.gold;
|
| 443 |
+
document.getElementById('current-gold').textContent = gameState.player.gold;
|
| 444 |
+
document.getElementById('upgrade-modal').classList.remove('hidden');
|
| 445 |
+
}
|
| 446 |
+
|
| 447 |
+
// Apply upgrade based on player choice
|
| 448 |
+
function applyUpgrade(choice) {
|
| 449 |
+
document.getElementById('upgrade-modal').classList.add('hidden');
|
| 450 |
+
|
| 451 |
+
switch(choice) {
|
| 452 |
+
case 1: // Max HP
|
| 453 |
+
if (gameState.player.gold >= 50) {
|
| 454 |
+
gameState.player.gold -= 50;
|
| 455 |
+
gameState.player.maxHp += 10;
|
| 456 |
+
gameState.player.hp += 10;
|
| 457 |
+
addToLog("Your max HP increased by 10!", "green-400");
|
| 458 |
+
}
|
| 459 |
+
break;
|
| 460 |
+
case 2: // Energy
|
| 461 |
+
if (gameState.player.gold >= 75) {
|
| 462 |
+
gameState.player.gold -= 75;
|
| 463 |
+
gameState.player.maxEnergy += 1;
|
| 464 |
+
addToLog("You gained +1 energy per turn!", "blue-400");
|
| 465 |
+
}
|
| 466 |
+
break;
|
| 467 |
+
case 3: // Strength
|
| 468 |
+
if (gameState.player.gold >= 50) {
|
| 469 |
+
gameState.player.gold -= 50;
|
| 470 |
+
gameState.player.strength += 1;
|
| 471 |
+
addToLog("Your attacks deal +1 damage!", "red-400");
|
| 472 |
+
}
|
| 473 |
+
break;
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
// Proceed to next floor
|
| 477 |
+
createEnemy();
|
| 478 |
+
addToLog(`Moving to floor ${gameState.floor}...`, "yellow-400");
|
| 479 |
+
|
| 480 |
+
// At start of new floor, shuffle discard into deck
|
| 481 |
+
gameState.player.deck = [...gameState.player.discard, ...gameState.player.deck];
|
| 482 |
+
gameState.player.discard = [];
|
| 483 |
+
shuffleDeck();
|
| 484 |
+
|
| 485 |
+
drawHand();
|
| 486 |
+
updateUI();
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
// Deal damage to enemy
|
| 490 |
+
function dealDamageToEnemy(amount) {
|
| 491 |
+
gameState.enemy.hp -= amount;
|
| 492 |
+
|
| 493 |
+
// Shake enemy when hit
|
| 494 |
+
const enemyElement = document.getElementById('enemy-container');
|
| 495 |
+
enemyElement.classList.add('shake');
|
| 496 |
+
setTimeout(() => {
|
| 497 |
+
enemyElement.classList.remove('shake');
|
| 498 |
+
}, 500);
|
| 499 |
+
|
| 500 |
+
if (gameState.enemy.hp <= 0) {
|
| 501 |
+
gameState.enemy.hp = 0;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
updateEnemyUI();
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
// End player's turn
|
| 508 |
+
function endTurn() {
|
| 509 |
+
if (!gameState.isPlayerTurn || gameState.gameOver) return;
|
| 510 |
+
|
| 511 |
+
gameState.isPlayerTurn = false;
|
| 512 |
+
addToLog("Ending turn...", "gray-400");
|
| 513 |
+
|
| 514 |
+
// Discard remaining hand
|
| 515 |
+
gameState.player.discard.push(...gameState.player.hand);
|
| 516 |
+
gameState.player.hand = [];
|
| 517 |
+
|
| 518 |
+
// Enemy turn
|
| 519 |
+
setTimeout(() => {
|
| 520 |
+
enemyTurn();
|
| 521 |
+
}, 1000);
|
| 522 |
+
|
| 523 |
+
updateUI();
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
// Enemy's turn
|
| 527 |
+
function enemyTurn() {
|
| 528 |
+
if (gameState.enemy.intent === "Attack") {
|
| 529 |
+
const damage = Math.max(0, gameState.enemy.damage - gameState.player.block);
|
| 530 |
+
|
| 531 |
+
// Show attack animation
|
| 532 |
+
const enemyAttackElement = document.getElementById('enemy-attack');
|
| 533 |
+
document.getElementById('enemy-damage').textContent = damage;
|
| 534 |
+
enemyAttackElement.classList.remove('hidden');
|
| 535 |
+
|
| 536 |
+
setTimeout(() => {
|
| 537 |
+
enemyAttackElement.classList.add('hidden');
|
| 538 |
+
|
| 539 |
+
if (damage > 0) {
|
| 540 |
+
// Start HP rolling effect
|
| 541 |
+
startHPRoll(gameState.player.hp - damage);
|
| 542 |
+
addToLog(`${gameState.enemy.name} attacks for ${damage} damage!`, "red-400");
|
| 543 |
+
} else {
|
| 544 |
+
addToLog(`${gameState.enemy.name} attacks but you blocked all damage!`, "blue-400");
|
| 545 |
+
}
|
| 546 |
+
|
| 547 |
+
// Reset block at end of turn
|
| 548 |
+
gameState.player.block = 0;
|
| 549 |
+
|
| 550 |
+
// Start player's next turn
|
| 551 |
+
startPlayerTurn();
|
| 552 |
+
}, 1000);
|
| 553 |
+
} else if (gameState.enemy.intent === "Debuff") {
|
| 554 |
+
addToLog(`${gameState.enemy.name} weakens you for ${gameState.enemy.damage} damage next turn!`, "yellow-400");
|
| 555 |
+
// In a more complex game, we'd implement debuffs here
|
| 556 |
+
|
| 557 |
+
// Start player's next turn
|
| 558 |
+
startPlayerTurn();
|
| 559 |
+
}
|
| 560 |
+
}
|
| 561 |
+
|
| 562 |
+
// Start player's turn
|
| 563 |
+
function startPlayerTurn() {
|
| 564 |
+
gameState.isPlayerTurn = true;
|
| 565 |
+
setEnemyIntent();
|
| 566 |
+
drawHand();
|
| 567 |
+
addToLog("Your turn! Draw 5 cards.", "green-400");
|
| 568 |
+
updateUI();
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
// Start Earthbound-style HP rolling effect
|
| 572 |
+
function startHPRoll(targetHp) {
|
| 573 |
+
if (gameState.hpRolling) {
|
| 574 |
+
clearInterval(gameState.hpRollInterval);
|
| 575 |
+
}
|
| 576 |
+
|
| 577 |
+
gameState.hpRolling = true;
|
| 578 |
+
gameState.hpRollTarget = Math.max(0, targetHp);
|
| 579 |
+
|
| 580 |
+
const hpElement = document.getElementById('player-hp-display');
|
| 581 |
+
hpElement.classList.add('hp-rolling');
|
| 582 |
+
|
| 583 |
+
gameState.hpRollInterval = setInterval(() => {
|
| 584 |
+
if (gameState.player.hp > gameState.hpRollTarget) {
|
| 585 |
+
gameState.player.hp--;
|
| 586 |
+
updatePlayerUI();
|
| 587 |
+
|
| 588 |
+
// Check for death
|
| 589 |
+
if (gameState.player.hp <= 0) {
|
| 590 |
+
gameState.player.hp = 0;
|
| 591 |
+
gameOver();
|
| 592 |
+
clearInterval(gameState.hpRollInterval);
|
| 593 |
+
gameState.hpRolling = false;
|
| 594 |
+
hpElement.classList.remove('hp-rolling');
|
| 595 |
+
}
|
| 596 |
+
} else {
|
| 597 |
+
clearInterval(gameState.hpRollInterval);
|
| 598 |
+
gameState.hpRolling = false;
|
| 599 |
+
hpElement.classList.remove('hp-rolling');
|
| 600 |
+
}
|
| 601 |
+
}, 100);
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
// Game over
|
| 605 |
+
function gameOver() {
|
| 606 |
+
gameState.gameOver = true;
|
| 607 |
+
addToLog("You have been defeated!", "red-400");
|
| 608 |
+
|
| 609 |
+
// Show game over modal
|
| 610 |
+
document.getElementById('final-floor').textContent = gameState.floor;
|
| 611 |
+
document.getElementById('game-over-modal').classList.remove('hidden');
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
// Restart game
|
| 615 |
+
function restartGame() {
|
| 616 |
+
document.getElementById('game-over-modal').classList.add('hidden');
|
| 617 |
+
initGame();
|
| 618 |
+
}
|
| 619 |
+
|
| 620 |
+
// Update all UI elements
|
| 621 |
+
function updateUI() {
|
| 622 |
+
updatePlayerUI();
|
| 623 |
+
updateEnemyUI();
|
| 624 |
+
updateHandUI();
|
| 625 |
+
updateDeckUI();
|
| 626 |
+
|
| 627 |
+
document.getElementById('floor').textContent = gameState.floor;
|
| 628 |
+
document.getElementById('player-energy').textContent = gameState.player.energy;
|
| 629 |
+
document.getElementById('player-gold').textContent = gameState.player.gold;
|
| 630 |
+
|
| 631 |
+
// Disable end turn button if not player's turn
|
| 632 |
+
document.getElementById('end-turn-btn').disabled = !gameState.isPlayerTurn;
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
// Update player UI
|
| 636 |
+
function updatePlayerUI() {
|
| 637 |
+
document.getElementById('player-hp').textContent = gameState.player.hp;
|
| 638 |
+
document.getElementById('player-max-hp').textContent = gameState.player.maxHp;
|
| 639 |
+
document.getElementById('player-hp-display').textContent = gameState.player.hp;
|
| 640 |
+
document.getElementById('player-max-hp-display').textContent = gameState.player.maxHp;
|
| 641 |
+
document.getElementById('player-block').textContent = gameState.player.block;
|
| 642 |
+
document.getElementById('player-strength').textContent = gameState.player.strength;
|
| 643 |
+
document.getElementById('player-emoji').textContent = gameState.player.emoji;
|
| 644 |
+
}
|
| 645 |
+
|
| 646 |
+
// Update enemy UI
|
| 647 |
+
function updateEnemyUI() {
|
| 648 |
+
document.getElementById('enemy-name').textContent = gameState.enemy.name;
|
| 649 |
+
document.getElementById('enemy-hp').textContent = gameState.enemy.hp;
|
| 650 |
+
document.getElementById('enemy-max-hp').textContent = gameState.enemy.maxHp;
|
| 651 |
+
document.getElementById('enemy-emoji').textContent = gameState.enemy.emoji;
|
| 652 |
+
|
| 653 |
+
if (gameState.enemy.intent === "Attack") {
|
| 654 |
+
document.getElementById('enemy-intent').textContent = `Attack (${gameState.enemy.damage})`;
|
| 655 |
+
document.getElementById('enemy-intent').className = "font-bold text-red-400";
|
| 656 |
+
} else if (gameState.enemy.intent === "Debuff") {
|
| 657 |
+
document.getElementById('enemy-intent').textContent = `Debuff (${gameState.enemy.damage})`;
|
| 658 |
+
document.getElementById('enemy-intent').className = "font-bold text-yellow-400";
|
| 659 |
+
}
|
| 660 |
+
}
|
| 661 |
+
|
| 662 |
+
// Update hand UI
|
| 663 |
+
function updateHandUI() {
|
| 664 |
+
const handElement = document.getElementById('hand');
|
| 665 |
+
handElement.innerHTML = '';
|
| 666 |
+
|
| 667 |
+
gameState.player.hand.forEach((card, index) => {
|
| 668 |
+
const cardElement = document.createElement('div');
|
| 669 |
+
cardElement.className = `card bg-gray-700 rounded-lg p-4 cursor-pointer ${gameState.player.energy < card.cost ? 'opacity-50' : ''}`;
|
| 670 |
+
cardElement.innerHTML = `
|
| 671 |
+
<div class="font-bold text-lg mb-2">${card.name}</div>
|
| 672 |
+
<div class="text-sm text-gray-400 mb-2">Cost: <span class="text-blue-400">${card.cost}</span></div>
|
| 673 |
+
<div class="text-sm">${card.description}</div>
|
| 674 |
+
${gameState.player.strength > 0 && card.type === "Attack" ? `<div class="text-xs mt-2 text-red-400">+${gameState.player.strength} damage</div>` : ''}
|
| 675 |
+
`;
|
| 676 |
+
|
| 677 |
+
cardElement.addEventListener('click', () => playCard(index));
|
| 678 |
+
handElement.appendChild(cardElement);
|
| 679 |
+
});
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
// Update deck and discard counts
|
| 683 |
+
function updateDeckUI() {
|
| 684 |
+
document.getElementById('deck-count').textContent = gameState.player.deck.length;
|
| 685 |
+
document.getElementById('discard-count').textContent = gameState.player.discard.length;
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
// Add message to battle log
|
| 689 |
+
function addToLog(message, color = "white") {
|
| 690 |
+
const logElement = document.getElementById('battle-log');
|
| 691 |
+
const messageElement = document.createElement('div');
|
| 692 |
+
messageElement.className = `text-${color}`;
|
| 693 |
+
messageElement.textContent = message;
|
| 694 |
+
logElement.appendChild(messageElement);
|
| 695 |
+
logElement.scrollTop = logElement.scrollHeight;
|
| 696 |
+
}
|
| 697 |
+
|
| 698 |
+
// Event Listeners
|
| 699 |
+
document.getElementById('end-turn-btn').addEventListener('click', endTurn);
|
| 700 |
+
document.getElementById('restart-btn').addEventListener('click', restartGame);
|
| 701 |
+
|
| 702 |
+
// Upgrade event listeners
|
| 703 |
+
document.getElementById('upgrade-1').addEventListener('click', () => applyUpgrade(1));
|
| 704 |
+
document.getElementById('upgrade-2').addEventListener('click', () => applyUpgrade(2));
|
| 705 |
+
document.getElementById('upgrade-3').addEventListener('click', () => applyUpgrade(3));
|
| 706 |
+
document.getElementById('skip-upgrade').addEventListener('click', () => {
|
| 707 |
+
document.getElementById('upgrade-modal').classList.add('hidden');
|
| 708 |
+
createEnemy();
|
| 709 |
+
addToLog(`Moving to floor ${gameState.floor}...`, "yellow-400");
|
| 710 |
+
|
| 711 |
+
// At start of new floor, shuffle discard into deck
|
| 712 |
+
gameState.player.deck = [...gameState.player.discard, ...gameState.player.deck];
|
| 713 |
+
gameState.player.discard = [];
|
| 714 |
+
shuffleDeck();
|
| 715 |
+
|
| 716 |
+
drawHand();
|
| 717 |
+
updateUI();
|
| 718 |
+
});
|
| 719 |
+
|
| 720 |
+
// Initialize the game
|
| 721 |
+
initGame();
|
| 722 |
+
</script>
|
| 723 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Jaspior/rogelike" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 724 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
the code is very nice, just make the layout landscape insted portrait and put an emoticon as the enemy and as the player, please
|
| 2 |
+
ok, just more two things:
|
| 3 |
+
desfaça a úlitma alteração. COloque os cards de ataque e o log à direita do jogador e inimigo. De a possibilidade do jogador ficar mais forte também.
|
| 4 |
+
ok, the used cars aren't being recycling. Please, put the hand and battle log on the side of the battle, please
|
| 5 |
+
the card arent working =(
|