Imp digging animation and gold sack in high-res; sack also on the small imp instead of the coin sign

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-07 21:08:07 +01:00
1 parent 76f3b3c7b2
commit 2d1ed177a7
14 files changed
+370 -96

No files matched your search

+14 -2
View File
@@ -1762,7 +1762,18 @@ impl R3d {
let white = e.flash > 0.07;
let v = if e.captive != 0 { 0 } else { view };
let detailed = hd && w * 1.2 * px_per_tile >= crate::gfx::ACELL as f32 * 0.85;
let src = detailed.then(|| Gfx::hd_cell_view(e.kind, white, e.level, v)).flatten().unwrap_or_else(|| Gfx::sprite_cell_view(e.kind, white, e.level, v));
// treasure in a sack on the back; digging as a drawn animation (detailed sprites),
// frame by frame with the same rhythm as the swing below
let sack = e.carry > 0 && Gfx::has_sack(e.kind);
let hacking = e.working && !e.moving && !sleeping && matches!(e.job, Job::Dig(_) | Job::TearBridge(_));
let frame = ((ph * 1.3 / std::f32::consts::TAU).rem_euclid(1.0) * crate::gfx::HACK_FRAMES as f32) as u32;
let hd = if detailed { Gfx::hd_cell_view(e.kind, white, v, hacking.then_some(frame), sack) } else { None };
if hd.is_some() && hacking {
// the frames swing the pickaxe: no tilting of the whole figure
rot = 0.0;
lunge = 0.0;
}
let src = hd.or_else(|| sack.then(|| Gfx::sprite_cell_sack(e.kind, white, e.level, v)).flatten()).unwrap_or_else(|| Gfx::sprite_cell_view(e.kind, white, e.level, v));
let (mut u0, v0) = (src.x / sw, src.y / sh);
let (mut u1, v1) = ((src.x + src.w) / sw, (src.y + src.h) / sh);
if mirror {
@@ -1872,7 +1883,8 @@ impl R3d {
let rise = (k * 14.0 * F() as f32).floor();
gfx.glyph('z', head.x + cw * 2.0, head.y - GH * S() - rise, S(), Color::new(0.8, 0.85, 1.0, 1.0 - k));
}
if e.carry > 0 {
// treasure without a sack sprite: a coin over the unit (imps carry a sack instead)
if e.carry > 0 && !Gfx::has_sack(e.kind) {
let p = proj(vec3(e.disp_x, 0.35, e.disp_y));
gfx.glyph('☼', p.x + cw * 2.0, p.y - GH * small, small, Color::from_rgba(250, 210, 60, 255));
}