Gladiator arena: gold economy, outfitting shop, permadeath runs
Turns the sandbox into a survival roguelike loop: outfit your gladiator with banked gold, enter the arena, earn gold from kills and wave clears, die, keep 10% of your total value (floored at the 500 fresh-start). Economy (GameState autoload): - banked_gold, owned items, and loadout persist to user://save.cfg - Kill gold (basic 10g, armed 25g) credited server-side to the killer - Wave-clear bonus (25 + 5/wave) for all players; wave synced to peers - Death settlement liquidates gear, guarded against double-fire Character creation / shop: - Menu reframed: armory shop + live Character Sheet loadout preview - Character Sheet gains preview mode (renders from loadout, no player) - Buy/Equip with hand rules; two-handers and off-hands displace each other symmetrically (shop and in-game pickups) - Chosen loadout auto-equips on spawn via existing RPC path Combat feel: - Attacks snap to camera facing and lock direction for the swing - Dash commits to its direction for the full duration - Weapon slots show name text when no icon is set - Hitbox/hurtbox debug meshes hidden by default (H toggles) Death is final: players no longer respawn; a results screen shows waves, time, kills, and the settlement, then returns to camp. Armed enemies no longer respawn (were an infinite gold farm and respawned invisible).
This commit is contained in:
@@ -71,6 +71,9 @@ func start_wave():
|
||||
print("[EnemySpawner] Starting wave ", current_wave)
|
||||
wave_started.emit(current_wave)
|
||||
|
||||
# Broadcast wave number to every peer's GameState (for HUD + run stats)
|
||||
GameState.server_sync_wave(current_wave)
|
||||
|
||||
# Spawn enemies
|
||||
for i in range(enemies_per_wave):
|
||||
_spawn_enemy(i, enemies_per_wave)
|
||||
@@ -152,6 +155,10 @@ func _on_enemy_died(killer_id: int, enemy: Node):
|
||||
|
||||
print("[EnemySpawner] Enemy ", enemy.name, " defeated by ", killer_id)
|
||||
|
||||
# Credit kill gold to the killing player (server decides, credits their peer)
|
||||
if killer_id > 0 and Network.players.has(killer_id) and enemy is BaseEnemy:
|
||||
GameState.server_credit_kill(killer_id, enemy.gold_reward)
|
||||
|
||||
# Will be cleaned up in _update_active_enemies
|
||||
|
||||
## Update list of active enemies and check if wave complete
|
||||
@@ -177,6 +184,11 @@ func _on_wave_completed():
|
||||
print("[EnemySpawner] Wave ", current_wave, " completed!")
|
||||
wave_completed.emit(current_wave)
|
||||
|
||||
# Wave-clear bonus for every living player (scales with wave number)
|
||||
var wave_bonus: int = 25 + current_wave * 5
|
||||
for peer_id in Network.players.keys():
|
||||
GameState.server_credit_gold(peer_id, wave_bonus)
|
||||
|
||||
# Clean up dead enemies after a delay
|
||||
await get_tree().create_timer(2.0).timeout
|
||||
_cleanup_dead_enemies()
|
||||
|
||||
Reference in New Issue
Block a user