This commit is contained in:
Forrest 2026-10-01 23:01:56 -04:00
parent 0cba7f5ee0
commit 32ed347b58
172 changed files with 5464 additions and 582 deletions

View file

@ -159,7 +159,9 @@ static func _beta_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> v
static func _code_zero_resolve(s: Dictionary, _item: Dictionary, src: Dictionary) -> void:
var foes := State.opponents_in_combat(s, src.ref)
for r in foes:
var counters := State.counters_of(State.anomaly(s, r))
State.anomaly(s, r).infection += 1
State.emit_counters(s, r, counters)
State.fired(s, "Code Zero", src.controller)
var names := ", ".join(foes.map(func(r): return "%s (%d)" % [State.anomaly_name(s, r), State.infection_of(State.anomaly(s, r))]))
State.say(s, "Patient Zero infects %s." % names)
@ -184,7 +186,7 @@ static func _leaker_resolve(s: Dictionary, _item: Dictionary, src: Dictionary) -
static func _leaker_discard(s: Dictionary, data: Dictionary, card: Variant) -> void:
var p: int = data.ref.player
if State.remove_from(s.players[State.other(p)].hand, card):
State.to_discard(s, card)
State.to_discard(s, card, "hand", "discarded")
State.say(s, "Exfiltrate: %s discards %s." % [State.player_name(State.other(p)), State.name_of(s, card)])
if State.anomaly(s, data.ref).breachedTurn == s.turn:
Flow.draw_cards(s, p, 1)
@ -209,14 +211,16 @@ static func _backup_resolve(s: Dictionary, item: Dictionary, src: Dictionary) ->
if av.at == null or av.damage == 0:
return
var healed := mini(3, av.damage)
var counters := State.counters_of(av)
av.damage -= healed
State.emit_counters(s, src.ref, counters)
State.fired(s, "Backup Machine", p)
State.say(s, "Restore Point heals %d damage on %s." % [healed, State.anomaly_name(s, src.ref)])
return
var card: int = item.args.card
if not State.remove_from(s.players[p].discard, card):
return
State.to_hand(s, card)
State.to_hand(s, card, "discard")
State.fired(s, "Backup Machine", p)
State.say(s, "Restore Point returns %s to %s's hand." % [State.name_of(s, card), State.player_name(p)])
if State.def_of(s, card).kind != "hardware" or Query.slots_free(s, src.ref) <= 0:
@ -237,7 +241,7 @@ static func _backup_resolve(s: Dictionary, item: Dictionary, src: Dictionary) ->
static func _backup_install(s: Dictionary, data: Dictionary, yes: Variant) -> void:
if not yes or State.anomaly(s, data.ref).at == null or not s.players[data.ref.player].hand.has(data.card):
return
s.players[data.ref.player].bandwidth -= data.cost
State.add_bandwidth(s, data.ref.player, -data.cost)
s.stats.bandwidthOnCards[data.ref.player] += data.cost
HardwareCards.attach_hardware(s, data.card, data.ref)
State.say(s, "%s is installed on %s." % [State.name_of(s, data.card), State.anomaly_name(s, data.ref)])
@ -266,6 +270,8 @@ static func _bits_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> v
for v in before:
after.append(State.roll_die(s) if v <= k else v)
c.dice[key] = after
if State.has_events(s):
State.emit(s, {"k": "rerolled", "ref": src.ref.duplicate(), "dice": after.duplicate()})
State.fired(s, "Broken Bits", src.controller)
var rerolled := before.filter(func(v): return v <= k).size()
State.say(s, "Bit Flip rerolls %d dice: [%s] → [%s]." % [rerolled, ",".join(before.map(func(v): return str(v))), ",".join(after.map(func(v): return str(v)))])

View file

@ -247,7 +247,7 @@ static func _sabotage_resolve(s: Dictionary, item: Dictionary) -> void:
State.fired(s, item.name, item.player)
if item.args.mode == "destroy":
State.uninstall_hardware(s, hw)
State.to_discard(s, hw)
State.to_discard(s, hw, "worn", "destroyed")
State.stat(s, "hardwareLost", owner.player)
State.say(s, "Sabotage destroys %s." % State.name_of(s, hw))
HardwareCards.shed_hardware(s, owner)
@ -400,7 +400,7 @@ static func _dump_discard(s: Dictionary, data: Dictionary, _value: Variant) -> v
static func _dump_drop(s: Dictionary, data: Dictionary, card: Variant) -> void:
if State.remove_from(s.players[data.player].hand, card):
State.to_discard(s, card)
State.to_discard(s, card, "hand", "discarded")
# Rollback
@ -421,7 +421,7 @@ static func _rollback_resolve(s: Dictionary, item: Dictionary) -> void:
var wearer = State.wearer_of(s, card)
if State.uninstall_program(s, card) == null and State.uninstall_hardware(s, card) == null:
return
State.to_hand(s, card)
State.to_hand(s, card, "worn" if wearer != null else "play")
State.fired(s, item.name, item.player)
State.say(s, "Rollback returns %s to %s's hand." % [State.name_of(s, card), State.player_name(State.owner_of(s, card))])
if wearer != null:
@ -565,8 +565,10 @@ static func _purge_resolve(s: Dictionary, item: Dictionary) -> void:
var here := CardUtil.mine(s, item.player, loc)
for r in here:
var av := State.anomaly(s, r)
var counters := State.counters_of(av)
av.infection = 0
av.permanentInfection = 0
State.emit_counters(s, r, counters)
av.mods = av.mods.filter(func(m): return m.cores >= 0 or m.by == item.player)
av.rootedUntil = 0
av.disabledUntil = 0
@ -591,7 +593,7 @@ static func _reset_resolve(s: Dictionary, item: Dictionary) -> void:
var back: Array = item.args.cards.filter(func(id): return State.program_location(s, id) == item.target)
for id in back:
State.uninstall_program(s, id)
State.to_hand(s, id)
State.to_hand(s, id, "play")
var gain: int = back.size() * (1 + item.power)
State.gain_bandwidth(s, item.player, gain)
State.fired(s, item.name, item.player)

View file

@ -35,7 +35,7 @@ static func shed_hardware(s: Dictionary, r: Dictionary) -> void:
hw = list[i]
break
State.uninstall_hardware(s, hw)
State.to_discard(s, hw)
State.to_discard(s, hw, "worn", "shed")
State.stat(s, "hardwareLost", r.player)
State.say(s, "%s is out of Expansion Slots and discards %s." % [State.anomaly_name(s, r), State.name_of(s, hw)])
@ -57,6 +57,7 @@ static func _wearing(wearer: Variant, r: Dictionary) -> bool:
static func attach_hardware(s: Dictionary, card: int, r: Dictionary) -> void:
State.remove_from(s.players[r.player].hand, card)
State.anomaly(s, r).hardware.append(card)
State.emit_install(s, card, "anomaly:%d:%d" % [r.player, r.slot])
s.cards[card].installedTurn = s.turn
State.stat(s, "hardwareInstalled", r.player)
State.played(s, State.name_of(s, card), r.player)
@ -264,7 +265,7 @@ static func _raid_defeated(s: Dictionary, _hw: int, ev: Dictionary) -> bool:
static func _raid_keep(s: Dictionary, data: Dictionary, keep: Variant) -> void:
if keep:
s.players[data.ref.player].bandwidth -= data.cost
State.add_bandwidth(s, data.ref.player, -data.cost)
State.stat(s, "bandwidthOnCards", data.ref.player, data.cost)
State.fired(s, "RAID Array", data.ref.player)
Flow.knock_out(s, data.ref, data.loc, data.role, keep)
@ -366,7 +367,7 @@ static func _hot_swap_resolve(s: Dictionary, item: Dictionary, src: Dictionary)
if not Query.slots_fit(s, r, out_card, into):
return
State.uninstall_hardware(s, out_card)
State.to_hand(s, out_card)
State.to_hand(s, out_card, "worn")
attach_hardware(s, into, r)
State.fired(s, "Hot-Swap Bay", src.controller)
State.say(s, "Hot-Swap Bay swaps %s for %s on %s." % [State.name_of(s, out_card), State.name_of(s, into), State.anomaly_name(s, r)])

View file

@ -38,10 +38,10 @@ static func destroy_program(s: Dictionary, id: int) -> void:
for x in here:
if x.name == "Version Control":
State.fired(s, "Version Control", owner)
State.to_hand(s, id)
State.to_hand(s, id, "play")
State.say(s, "Version Control: %s returns to %s's hand." % [State.name_of(s, id), State.player_name(owner)])
return
State.to_discard(s, id)
State.to_discard(s, id, "play", "destroyed")
State.say(s, "%s is destroyed." % State.name_of(s, id))
@ -50,6 +50,7 @@ static func _install_free(s: Dictionary, card: int, at: String) -> void:
var p := State.owner_of(s, card)
State.remove_from(s.players[p].hand, card)
s.locations[at].programs.append(card)
State.emit_install(s, card, "loc:" + at)
s.cards[card].installedTurn = s.turn
State.stat(s, "programsInstalled", p)
State.played(s, State.name_of(s, card), p)
@ -91,6 +92,7 @@ static func _latest_penalty(s: Dictionary, av: Dictionary) -> Variant:
static func _remove_negative(s: Dictionary, r: Dictionary, what: String) -> void:
var av := State.anomaly(s, r)
var counters := State.counters_of(av)
if what == "infection":
av.infection -= 1
elif what == "bug":
@ -106,6 +108,7 @@ static func _remove_negative(s: Dictionary, r: Dictionary, what: String) -> void
elif what.begins_with("mod:"):
var seq := what.substr(4).to_int()
av.mods = av.mods.filter(func(m): return m.seq != seq)
State.emit_counters(s, r, counters)
static func scripts() -> Dictionary:
@ -575,7 +578,7 @@ static func _packet_loss_breach(s: Dictionary, src: Dictionary, ev: Dictionary)
return
var card: int = hand[Rng.rand_int(s.rng, hand.size())]
State.remove_from(hand, card)
State.to_discard(s, card)
State.to_discard(s, card, "hand", "discarded")
State.fired(s, "Packet Loss", src.controller)
State.say(s, "Packet Loss: %s discards %s at random." % [State.player_name(ev.ref.player), State.name_of(s, card)])
@ -678,7 +681,7 @@ static func _garbage_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -
if State.program_location(s, card) != src.at:
return
State.uninstall_program(s, card)
State.to_discard(s, card)
State.to_discard(s, card, "play", "sacrificed")
State.stat(s, "programsLost", src.controller)
State.gain_bandwidth(s, src.controller, State.def_of(s, card).bandwidth)
State.fired(s, "Garbage Collection", src.controller)
@ -705,7 +708,7 @@ static func _version_captured(s: Dictionary, src: Dictionary, ev: Dictionary) ->
static func _version_save(s: Dictionary, _data: Variant, card: Variant) -> void:
if State.uninstall_program(s, card) == null:
return
State.to_hand(s, card)
State.to_hand(s, card, "play")
State.fired(s, "Version Control", State.owner_of(s, card))
State.say(s, "Version Control returns %s to %s's hand." % [State.name_of(s, card), State.player_name(State.owner_of(s, card))])

View file

@ -189,6 +189,7 @@ static func _callable_redraw(s: Dictionary, data: Dictionary, again: Variant) ->
if not State.remove_from(pl.hand, data.card):
return
pl.deck.append(data.card)
State.emit_pile(s, data.card, "deck", "hand")
State.fired(s, "Callable Server", data.player)
Flow.draw_now(s, data.player)
s.stats.cardsDrawn[data.player] -= 1

View file

@ -39,7 +39,9 @@ static func add_bugs(s: Dictionary, r: Dictionary, n: int, source: String, by: i
State.say(s, "ECC Memory blocks %s's Bug counters on %s." % [source, State.anomaly_name(s, r)])
State.fired(s, "ECC Memory", r.player)
return false
var counters := State.counters_of(State.anomaly(s, r))
State.anomaly(s, r).bugs += n
State.emit_counters(s, r, counters)
State.fired(s, source, by)
State.say(s, "%s: %s gets %d Bug counter%s (%d total)." % [source, State.anomaly_name(s, r), n, "" if n == 1 else "s", State.anomaly(s, r).bugs])
return true
@ -47,10 +49,12 @@ static func add_bugs(s: Dictionary, r: Dictionary, n: int, source: String, by: i
static func infect(s: Dictionary, r: Dictionary, n: int, source: String, by: int, permanent := false) -> void:
var av := State.anomaly(s, r)
var counters := State.counters_of(av)
if permanent:
av.permanentInfection += n
else:
av.infection += n
State.emit_counters(s, r, counters)
State.fired(s, source, by)
State.say(s, "%s: %s gets %s %sInfection counter%s (%d total)." % [source, State.anomaly_name(s, r), "an" if n == 1 else str(n), "permanent " if permanent else "", "" if n == 1 else "s", av.infection + av.permanentInfection])