Named creatures: names per kind and language, epithets at higher levels, memorial stones for the fallen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
189da6f408
commit
ad5ceb8c13
26 files changed
+685
-6
No files matched your search
+17
-2
@@ -292,6 +292,8 @@ pub struct Ent {
|
||||
#[serde(default)]
|
||||
pub plague: f32, // spell: seconds of plague left (poison that spreads)
|
||||
#[serde(default)]
|
||||
pub name: u32, // seed of the creature's name (names.rs), 0: none (heroes, siege engines)
|
||||
#[serde(default)]
|
||||
pub ab_cd: f32, // cooldown of the learned ability
|
||||
#[serde(default)]
|
||||
pub mood_t: f32, // seconds until the next mood check (likes and hatreds)
|
||||
@@ -381,6 +383,7 @@ impl Ent {
|
||||
shield: 0.0,
|
||||
invis: 0.0,
|
||||
plague: 0.0,
|
||||
name: 0,
|
||||
ab_cd: 0.0,
|
||||
mood_t: 0.0,
|
||||
guard: false,
|
||||
@@ -638,6 +641,8 @@ pub struct Game {
|
||||
#[serde(default)]
|
||||
pub weather: crate::weather::Weather, // above ground (weather.rs)
|
||||
#[serde(default)]
|
||||
pub memorials: Vec<crate::names::Memorial>, // stones for fallen creatures (names.rs)
|
||||
#[serde(default)]
|
||||
pub trading: crate::traders::Trading, // the visiting trader (traders.rs)
|
||||
#[serde(default)]
|
||||
pub happenings: Option<crate::events::Events>, // random events (free games and versus), see events.rs
|
||||
@@ -994,6 +999,7 @@ impl Game {
|
||||
dwarf_caves: Vec::new(),
|
||||
bridgework: Default::default(),
|
||||
weather: Default::default(),
|
||||
memorials: Vec::new(),
|
||||
trading: Default::default(),
|
||||
happenings: None,
|
||||
snares: Vec::new(),
|
||||
@@ -1352,6 +1358,9 @@ impl Game {
|
||||
e.disp_x = x;
|
||||
e.disp_y = y;
|
||||
e.level = level;
|
||||
if !hero && !matches!(kind, EK::Ram | EK::Catapult | EK::Trader) {
|
||||
e.name = crate::names::seed_for(id);
|
||||
}
|
||||
e.max_hp = s.hp * (1.0 + 0.15 * (level - 1) as f32);
|
||||
e.hp = e.max_hp;
|
||||
e.alive = true;
|
||||
@@ -1777,6 +1786,7 @@ impl Game {
|
||||
if (self.time / 2.0).floor() != ((self.time - dt) / 2.0).floor() {
|
||||
self.reinforce_corners();
|
||||
self.tidy_torch_stands();
|
||||
self.tidy_memorials();
|
||||
}
|
||||
self.update_forge(dt);
|
||||
self.update_research();
|
||||
@@ -2482,7 +2492,7 @@ impl Game {
|
||||
self.sfx(Sfx::LevelUp, e.x, e.y);
|
||||
}
|
||||
if !e.hero && e.level >= 3 {
|
||||
self.msg("msg.level_up", vec![format!("@{}", s.name), e.level.to_string()]);
|
||||
self.msg("msg.level_up", vec![crate::names::arg(e), e.level.to_string()]);
|
||||
}
|
||||
}
|
||||
if e.chained {
|
||||
@@ -2948,6 +2958,9 @@ impl Game {
|
||||
}
|
||||
}
|
||||
self.release_all(id);
|
||||
// a named creature of some standing gets a memorial stone
|
||||
let dead = self.ents[j].clone();
|
||||
let remembered = self.raise_memorial(&dead);
|
||||
self.fx(3, x, y, 0.0, 0.0, 0.7, 0xff505070);
|
||||
if kind != EK::Worker && kind != EK::Revenant {
|
||||
self.bury(x, y);
|
||||
@@ -2980,7 +2993,9 @@ impl Game {
|
||||
self.msg("msg.rival_unit_slain", vec![format!("@{}", s.name), (got as i32).to_string()]);
|
||||
} else {
|
||||
self.sfx(Sfx::Death, x, y);
|
||||
self.msg("msg.creature_died", vec![format!("@{}", s.name)]);
|
||||
if !remembered {
|
||||
self.msg("msg.creature_died", vec![crate::names::arg(&dead)]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user