Wave escalation and the Snippest boss
Escalation (EnemySpawner exports, all tunable): - Wave size grows +1 enemy per wave, capped at 20 - Enemy health +15% and damage +10% per wave, applied identically on every peer via the spawn RPC before _ready (so hitbox stats and current_health pick them up) Boss milestone every 5th wave: the Snippest - the basic lobster at 5x scale and 5x combat stats (50 HP, 25 damage, 5x knockback and reach). Movement deliberately not 5x (1.2x - it lumbers). Pays 250 gold and always drops a health orb. Wave escalation multipliers stack on top, so later bosses keep scaling. Boss scene instances basic_enemy.tscn with the BossLobster script; visual/collision children are scaled uniformly in code (not the CharacterBody3D root, not shared shape resources).
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
extends BasicEnemy
|
||||
class_name BossLobster
|
||||
## The Snippest itself: a lobster five times the size with five times the stats.
|
||||
## Spawned by the EnemySpawner on boss milestone waves.
|
||||
|
||||
const BOSS_MULTIPLIER := 5.0
|
||||
|
||||
func _ready():
|
||||
# 5x combat stats - applied BEFORE super._ready() so the hitbox
|
||||
# picks them up via set_stats(attack_damage, attack_knockback)
|
||||
max_health *= BOSS_MULTIPLIER
|
||||
attack_damage *= BOSS_MULTIPLIER
|
||||
attack_knockback *= BOSS_MULTIPLIER
|
||||
attack_range *= BOSS_MULTIPLIER # A 5x lobster has 5x reach
|
||||
|
||||
# Deliberately NOT 5x: movement (17.5 speed would be inescapable).
|
||||
# Big things lumber. Tune here if the boss should be faster.
|
||||
move_speed *= 1.2
|
||||
|
||||
# Boss rewards: jackpot gold, guaranteed health orb
|
||||
gold_reward = 250
|
||||
health_orb_drop_chance = 1.0
|
||||
|
||||
super._ready()
|
||||
|
||||
_apply_boss_scale()
|
||||
|
||||
## Uniformly scale the visual and collision children 5x around the root.
|
||||
## Child-node scaling (not root CharacterBody3D scale, not shared shape
|
||||
## resources) keeps physics sane and other lobsters unaffected.
|
||||
func _apply_boss_scale():
|
||||
for child_name in ["Mesh", "CollisionShape3D", "HurtBox", "HitBox"]:
|
||||
var child = get_node_or_null(child_name)
|
||||
if child:
|
||||
child.transform = child.transform.scaled(Vector3.ONE * BOSS_MULTIPLIER)
|
||||
Reference in New Issue
Block a user