This commit is contained in:
Forrest 2026-10-04 17:30:48 -04:00
parent 4298caf5cb
commit 2e6638b744
19 changed files with 484 additions and 185 deletions

View file

@ -21,8 +21,8 @@ extends SceneTree
## guard: it goes for the most urgent threat (carriers, then thieves
## taking something, then dropped loot and loose animals, then other
## thieves), attacks thieves in range with a clear line with its best
## weapon (a pumpkin bomb into a crowd, the corn shooter once bought, else
## the pitchfork, closing in to stab), uses fear on a
## weapons (a pumpkin bomb from the off-hand into a crowd, and the corn
## shooter once bought, else the pitchfork, closing in to stab), uses fear on a
## carrier or a crowd in range, leads animals following it back to the pen
## when no carrier is close, and patches up when hurt and nothing is close.
## --minutes=10 night time to play (rounded up to whole nights)
@ -458,8 +458,8 @@ func _guard() -> void:
_walk_toward(goal, me)
## Attacks the thief at target with the best weapon owned: a pumpkin bomb into a crowd of three
## or more when one is ready, else the corn shooter, else the pitchfork (only within its reach).
## Attacks the thief at target with the best weapons owned: a pumpkin bomb into a crowd of three
## or more when one is ready, and the corn shooter, else the pitchfork (only within its reach).
## Returns the distance it holds ground at.
func _attack(target: Vector2, me: Vector2) -> float:
var c := _sim.combat
@ -470,8 +470,8 @@ func _attack(target: Vector2, me: Vector2) -> float:
if es.alive[d] == 1 and Vector2(es.pos_x[d], es.pos_z[d]).distance_to(target) <= cfg.bomb_radius:
crowd += 1
var far := target.distance_to(me)
if crowd >= 3 and c.bomb_left == 0.0 and far >= cfg.bomb_min_range and far <= cfg.bomb_range and c.equip(ScarecrowCombat.Weapon.PUMPKIN_BOMB):
if c.attack_toward(target):
if crowd >= 3 and c.offhand == ScarecrowCombat.Weapon.PUMPKIN_BOMB and far >= cfg.bomb_min_range and far <= cfg.bomb_range:
if c.offhand_toward(target):
_shots += 1
if c.equip(ScarecrowCombat.Weapon.CORN_SHOOTER):
if c.attack_toward(target):