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

@ -4,7 +4,7 @@ extends RefCounted
## by hand, tick by tick. Covers the join (the welcome, both scarecrows on both farms, names,
## co-op health), requests from the partner (start the day, build, buy), the partner's scarecrow
## moving, gathering, and shooting on the host (and its pick of weapon), the weapons' stabs and
## pumpkin bombs reaching the replica (drawn there, doing no damage of their own), enemies, loot,
## pumpkin bombs (thrown from the off-hand, not with the right click leaving build mode) reaching the replica (drawn there, doing no damage of their own), enemies, loot,
## and shots reaching the replica,
## the co-op fall rule (one down is out until morning, both down is Game Over) and Retry, message
## sizes with a crowd, dropped unreliable messages, and either side leaving.
@ -228,19 +228,36 @@ func _weapons_shown() -> void:
host.combat.equip(ScarecrowCombat.Weapon.PUMPKIN_BOMB)
host.combat.ready_for_morning()
var bursts := client.bombs.bursts
host.combat.attack_toward(Vector2(host.player.global_position.x + 6.0, host.player.global_position.z))
host.combat.offhand_toward(Vector2(host.player.global_position.x + 6.0, host.player.global_position.z))
_pump(3)
r.check(p1.weapon == ScarecrowCombat.Weapon.PUMPKIN_BOMB and client.bombs.flying() == 1, "P1's pumpkin bomb flies on the partner's farm too")
r.check(p1.weapon == ScarecrowCombat.Weapon.PITCHFORK and client.bombs.flying() == 1,
"P1's pumpkin bomb flies on the partner's farm too (from the off-hand: the pitchfork stays in hand there)")
_pump(90)
r.check(client.bombs.bursts == bursts + 1 and client.bombs.enemies_hit == 0 and host.bombs.flying() == 0,
"and bursts there, harmless (the host's burst does the damage)")
r.check(client.combat.equip(ScarecrowCombat.Weapon.PUMPKIN_BOMB), "the partner can take bombs up too (bought for both)")
r.check(client.combat.offhand == ScarecrowCombat.Weapon.PUMPKIN_BOMB and host.partner.combat.offhand == ScarecrowCombat.Weapon.PUMPKIN_BOMB,
"the partner has bombs in its off-hand too (bought for both)")
var thrown := host.partner.combat.bombs_thrown
Input.action_press("fire")
var attacks := host.partner.combat.attacks()
Input.action_press("offhand")
_pump(10)
Input.action_release("fire")
Input.action_release("offhand")
_pump(4)
r.check(host.partner.combat.bombs_thrown == thrown + 1 and client.combat.bomb_left > 0.0, "P2's throw happens on the host, and its recharge shows on the partner's HUD")
r.check(host.partner.combat.bombs_thrown == thrown + 1 and host.partner.combat.attacks() == attacks + 1 and client.combat.bomb_left > 0.0,
"the partner's right click throws on the host (and nothing else), and its recharge shows on the partner's HUD")
_pump(roundi(host.config.bomb_cooldown * 60.0) + 10)
client.build.set_active(true)
_pump(4)
thrown = host.partner.combat.bombs_thrown
Input.action_press("cancel") # the right mouse button: both actions
Input.action_press("offhand")
_pump(10)
var left := not client.build.active
Input.action_release("cancel")
Input.action_release("offhand")
_pump(4)
r.check(left and host.partner.combat.bombs_thrown == thrown,
"the partner's right click that leaves build mode throws nothing on the host, even held")
_pump(90)
for c: ScarecrowCombat in [host.combat, client.combat]:
c.equip(ScarecrowCombat.Weapon.PITCHFORK)