Champions of the Order lead every fifth wave: four bosses with abilities, a health bar and loot
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9debc08a0a
commit
9535e68df0
23 files changed
+303
-1
No files matched your search
+13
@@ -296,6 +296,8 @@ pub struct Ent {
|
||||
pub target: Option<u8>, // attackers: side whose core (or gate) they march on
|
||||
#[serde(default)]
|
||||
pub chained: bool, // a lone creature chained in a sealed cave: joins when the cave is claimed
|
||||
#[serde(default)]
|
||||
pub boss: u8, // a champion of the Order leading a wave (see bosses.rs), 0: none
|
||||
#[serde(skip, default = "zero_f32")]
|
||||
pub disp_x: f32, // smoothed screen position (not part of the saved or synced world state)
|
||||
#[serde(skip, default = "zero_f32")]
|
||||
@@ -366,6 +368,7 @@ impl Ent {
|
||||
side: 0,
|
||||
target: None,
|
||||
chained: false,
|
||||
boss: 0,
|
||||
disp_x: 0.0,
|
||||
disp_y: 0.0,
|
||||
}
|
||||
@@ -2152,6 +2155,12 @@ impl Game {
|
||||
self.last_wave_value = Self::squad_value(&list);
|
||||
let before = self.ents.len();
|
||||
self.spawn_squad(&list, false);
|
||||
// the paladin of every fifth wave is one of the Order's champions
|
||||
if boss.is_some() {
|
||||
if let Some(j) = (before..self.ents.len()).find(|&j| self.ents[j].kind == Paladin) {
|
||||
self.make_boss(j, 1 + ((w / 5 - 1) % 4) as u8);
|
||||
}
|
||||
}
|
||||
if goal != self.me_side {
|
||||
for e in self.ents[before..].iter_mut() {
|
||||
e.target = Some(goal);
|
||||
@@ -2731,6 +2740,7 @@ impl Game {
|
||||
}
|
||||
|
||||
pub(crate) fn kill(&mut self, j: usize) {
|
||||
self.boss_loot(j);
|
||||
let e = &self.ents[j];
|
||||
if e.hero && e.captive == 0 && self.prison_space() > 0 {
|
||||
// knocked out instead of killed: imps carry the hero to the torture chamber
|
||||
@@ -4450,6 +4460,9 @@ impl Game {
|
||||
// ---------------------------------------------------------------- heroes
|
||||
|
||||
fn hero_ai(&mut self, e: &mut Ent, dt: f32) {
|
||||
if e.boss > 0 {
|
||||
self.boss_ability(e, dt);
|
||||
}
|
||||
if e.kind == EK::Fairy {
|
||||
// fairy dust: the heroes around are healed a little all the time
|
||||
for o in self.ents.iter_mut() {
|
||||
|
||||
Reference in new issue
Block a user