Holidays: Christmas and Easter beside Halloween, two weeks before to a few days after; decorations in the dungeon and around the title

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-07 22:40:27 +01:00
1 parent c23c4d28ec
commit 8f670554c7
5 files changed
+281 -5

No files matched your search

+35
View File
@@ -94,6 +94,9 @@ pub const I_CATAPULT: u32 = 210; // catapult tool
pub const T_SNOW: u32 = 211; // 4 variants: snow on the land above ground (winter)
pub const T_PUMPKIN: u32 = 215; // a carved pumpkin (Halloween)
pub const T_MOSS: u32 = 216; // 4 variants: mushroom grove ground, moss with glowing spores
pub const T_GIFT: u32 = 220; // a wrapped present (Christmas)
pub const T_FIR: u32 = 221; // fir needles with baubles (Christmas)
pub const T_EGG: u32 = 222; // 2 variants: a painted egg (Easter)
pub struct Gfx {
pub atlas: Texture2D,
@@ -1256,6 +1259,38 @@ fn gen_atlas() -> Image {
Some(c(240, 128, 30))
}
});
// Christmas: a present in red paper with a golden ribbon, fir needles with baubles
cv.cell(T_GIFT, |x, y| {
if x == 7 || x == 8 || y == 7 || y == 8 {
Some(c(250, 210, 80))
} else if (x + y) % 5 == 0 {
Some(c(200, 30, 40))
} else {
Some(c(176, 24, 34))
}
});
cv.cell(T_FIR, |x, y| {
let r = hash(x, y, 470);
if r % 29 == 0 {
Some([c(240, 60, 60), c(250, 210, 80), c(90, 160, 255)][(r / 29 % 3) as usize])
} else if (x + 2 * y) % 5 == 0 {
Some(c(20, 70, 40))
} else {
Some(shade((34, 104, 56), (rnd(x, y, 471) * 16.0) as i32 - 8))
}
});
// Easter: painted eggs, stripes and zigzags in spring colours
for v in 0..2u32 {
cv.cell(T_EGG + v, |x, y| {
let cols = if v == 0 { [c(140, 200, 250), c(250, 230, 120), c(255, 255, 255)] } else { [c(250, 160, 200), c(150, 220, 140), c(255, 250, 230)] };
let zig = (y + (x % 4 - 2).abs()) % 8;
Some(match zig {
0 | 1 => cols[1],
4 => cols[2],
_ => cols[0],
})
});
}
// grass above ground
for v in 0..4u32 {
cv.cell(T_GRASS + v, |x, y| {