Bestiary in the title and pause menu; attacks look bigger with the unit level

- tabs: creatures, humans (incl. cave dwarves), dungeon buildings and towers, ranks
- every unit at every level: sprite with gear, rank badge, health, attack, range, speed, wage or bounty, what attracts it
- Crookfinger's texts: loving about the creatures, disgusted about the humans (EN/DE)
- projectiles, hit sparks and splashes grow with the attacker's level, with halos from Lv 5 and glow at Lv 9+

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-03 15:32:18 +01:00
1 parent 9a9f04ae1f
commit 1016ee5d6c
8 files changed
+514 -12

No files matched your search

+18 -4
View File
@@ -375,6 +375,7 @@ pub struct Fx {
pub col: u32,
pub h: f32, // height of the start point (3D)
pub h2: f32, // height of the end point (projectiles)
pub size: f32, // 1 = normal; attacks of higher levels look bigger
}
#[derive(Serialize, Deserialize)]
@@ -916,7 +917,7 @@ impl Game {
pub fn fx(&mut self, kind: u8, x: f32, y: f32, x2: f32, y2: f32, max: f32, col: u32) {
let h = if kind == 0 { 0.45 } else { 0.4 };
if self.fx.len() < 400 {
self.fx.push(Fx { kind, x, y, x2, y2, t: 0.0, max, col, h, h2: 0.45 });
self.fx.push(Fx { kind, x, y, x2, y2, t: 0.0, max, col, h, h2: 0.45, size: 1.0 });
}
}
@@ -924,14 +925,21 @@ impl Game {
#[allow(clippy::too_many_arguments)]
pub fn shot(&mut self, x: f32, y: f32, h: f32, x2: f32, y2: f32, h2: f32, max: f32, col: u32) {
if self.fx.len() < 400 {
self.fx.push(Fx { kind: 0, x, y, x2, y2, t: 0.0, max, col, h, h2 });
self.fx.push(Fx { kind: 0, x, y, x2, y2, t: 0.0, max, col, h, h2, size: 1.0 });
}
}
// the last effect gets bigger (attacks of experienced units)
fn grow_last_fx(&mut self, size: f32) {
if let Some(f) = self.fx.last_mut() {
f.size = size;
}
}
// effect at a given height
pub fn fx_at(&mut self, kind: u8, x: f32, y: f32, h: f32, max: f32, col: u32) {
if self.fx.len() < 400 {
self.fx.push(Fx { kind, x, y, x2: 0.0, y2: 0.0, t: 0.0, max, col, h, h2: h });
self.fx.push(Fx { kind, x, y, x2: 0.0, y2: 0.0, t: 0.0, max, col, h, h2: h, size: 1.0 });
}
}
@@ -1806,6 +1814,8 @@ impl Game {
let dmg = e.atk() * (0.85 + self.rng.f() * 0.3);
let (tx, ty) = (self.ents[j].x, self.ents[j].y);
let s = st(e.kind);
// the higher the level, the bigger the attack looks (up to almost twice at Lv 10)
let lv = 1.0 + 0.1 * (e.level.max(1) - 1) as f32;
if s.range > 1.5 {
let col = match e.kind {
EK::Mage => 0xffff44cc,
@@ -1818,9 +1828,11 @@ impl Game {
// flyers shoot from the air
let h = if flies(e.kind) { 0.8 } else { 0.45 };
self.shot(e.x, e.y, h, tx, ty, 0.45, 0.25, col);
self.grow_last_fx(lv);
self.sfx(Sfx::Shoot, e.x, e.y);
} else {
self.fx(2, tx, ty, 0.0, 0.0, 0.25, 0xffffffff);
self.fx(2, tx, ty, 0.0, 0.0, 0.25, if e.level >= 9 { 0xff60e0ff } else { 0xffffffff });
self.grow_last_fx(lv);
self.sfx(Sfx::MeleeHit, tx, ty);
}
e.xp += dmg * 0.6;
@@ -1836,6 +1848,7 @@ impl Game {
if let Some(o) = second {
let (ox, oy) = (self.ents[o].x, self.ents[o].y);
self.fx(2, ox, oy, 0.0, 0.0, 0.25, 0xff40a0ff);
self.grow_last_fx(lv);
self.ents[o].hp -= dmg * 0.5;
self.ents[o].flash = 0.15;
if self.ents[o].hp <= 0.0 {
@@ -1846,6 +1859,7 @@ impl Game {
if e.kind == EK::Priestess || e.kind == EK::Wyrm {
// fireball / fire breath: half damage to enemies around the target
self.fx(3, tx, ty, 0.0, 0.0, 0.5, 0xff3080ff);
self.grow_last_fx(lv);
let me = e.side();
let splash: Vec<usize> = self
.ents