Versus teams, gold for allies, fallen hearts as spectators, multi-mission editor co-op

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-05 19:59:43 +01:00
1 parent 811c955bad
commit fc9c49d4ca
16 files changed
+1896 -49

No files matched your search

+12 -7
View File
@@ -202,9 +202,14 @@ impl Game {
targets.push((1, 3));
}
} else {
targets.push((0, 3));
// the masters (the player, or the human masters of a match) that are not allies
for s in self.master_sides() {
if !self.is_out(s) && !self.allied(side, s) {
targets.push((s, 3));
}
}
for o in &self.rivals {
if o.alive && o.side != side && !self.is_coop_ally_side(o.side) {
if o.alive && o.side != side && !self.allied(side, o.side) {
targets.push((o.side, 1));
}
}
@@ -319,8 +324,8 @@ impl Game {
fn target_alive(&self, target: u8) -> bool {
match target {
0 => self.core_hp > 0.0,
1 => self.has_gate() && self.gate_hp > 0.0,
s if self.is_master(s) => !self.is_out(s) && self.core_hp_of(s) > 0.0,
s => self.rival_alive(s),
}
}
@@ -330,9 +335,9 @@ impl Game {
let dmg = e.atk();
e.cd = st(e.kind).interval;
match target {
0 => {
self.core_hp -= dmg;
let (cx, cy) = self.map.core;
s if self.is_master(s) => {
self.damage_master_core(s, dmg);
let (cx, cy) = self.core_of_side(s);
self.fx(2, (e.x + cx as f32 + 1.5) * 0.5, (e.y + cy as f32 + 1.5) * 0.5, 0.0, 0.0, 0.3, 0xff4040ff);
self.sfx(Sfx::CoreHit, e.x, e.y);
self.hint(6, "hint.core_attacked");
@@ -366,7 +371,7 @@ impl Game {
e.repath = 1.5;
// attackers dig their way like heroes; the player's creatures only walk
let goal = |i: usize| self.target_core_adjacent(i, target);
let found = if e.side() == 0 { self.map.search(cur, self.map.creature_cost(flies(e.kind)), goal, true) } else { self.map.search(cur, self.map.hero_cost_as(flies(e.kind)), goal, true) };
let found = if !e.hero && self.is_master(e.side()) { self.map.search(cur, self.map.creature_cost(flies(e.kind)), goal, true) } else { self.map.search(cur, self.map.hero_cost_as(flies(e.kind)), goal, true) };
match found {
Some(p) => e.path = p,
None => {