Mushroom groves: unclaimable moss where giant mushrooms grow slowly and glow when ready to fell
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
368a338ccf
commit
f8eda88bb3
26 files changed
+321
-43
No files matched your search
+27
-3
@@ -526,6 +526,10 @@ fn ambient_field(map: &Map) -> Vec<f32> {
|
||||
if t.river() == Some(Kind::Lava) {
|
||||
f[i] = f[i].max(0.8); // lava lights up its surroundings
|
||||
}
|
||||
// the spores of a mushroom grove glow faintly
|
||||
if t.kind == Kind::Grove || (t.kind == Kind::Mushroom && t.res & MUSH_GROVE != 0) {
|
||||
f[i] = f[i].max(0.45);
|
||||
}
|
||||
if t.kind == Kind::Core {
|
||||
f[i] = 1.0;
|
||||
}
|
||||
@@ -765,6 +769,10 @@ fn build_chunk(map: &Map, amb: &[f32], glow: &[f32], cx: i32, cz: i32, atlas: &T
|
||||
if map.sky(idx(x, z)) && t.kind == Kind::Floor && t.owner == Owner::None {
|
||||
tex = if season() == 2 { T_SNOW } else { T_GRASS } + (t.var as u32 & 3);
|
||||
}
|
||||
// a grove's mushroom stands on moss
|
||||
if t.kind == Kind::Mushroom && t.res & MUSH_GROVE != 0 {
|
||||
tex = crate::gfx::T_MOSS + (t.var as u32 & 3);
|
||||
}
|
||||
let (ua, ub) = cell_uv(tex);
|
||||
let (xf, zf) = (x as f32, z as f32);
|
||||
if !map.shown(idx(x, z)) {
|
||||
@@ -976,11 +984,16 @@ fn build_chunk(map: &Map, amb: &[f32], glow: &[f32], cx: i32, cz: i32, atlas: &T
|
||||
let tint = |v: Vec3| col(lava_lit(if t.marked { v * vec3(1.3, 1.15, 0.5) } else { v }, lg), 1.0);
|
||||
let s = 0.85 + 0.1 * (t.var & 3) as f32;
|
||||
if t.kind == Kind::Mushroom {
|
||||
// it grows from a sprout to full size in steps; grown, its cap glows teal
|
||||
let stage = mushroom_stage(&t);
|
||||
let s = s * (0.3 + 0.7 * stage as f32 / 4.0);
|
||||
let h = 0.75 * s;
|
||||
let sc = tint(Vec3::splat(a.max(0.35)));
|
||||
mb.boxy(vec3(cx - 0.12, 0.0, cz - 0.12), vec3(cx + 0.12, h, cz + 0.12), T_STEM, sc, sc);
|
||||
// the cap glows a little in the dark
|
||||
let cc = tint(Vec3::splat(a.max(0.7)));
|
||||
let w = 0.12 * s.max(0.6);
|
||||
mb.boxy(vec3(cx - w, 0.0, cz - w), vec3(cx + w, h, cz + w), T_STEM, sc, sc);
|
||||
// the cap glows a little in the dark; a grown one in its own colour
|
||||
let hue = if stage >= 4 { vec3(0.55, 1.35, 1.25) } else { vec3(0.95, 0.8, 0.62) };
|
||||
let cc = tint(Vec3::splat(a.max(0.7)) * hue);
|
||||
mb.boxy(vec3(cx - 0.42 * s, h, cz - 0.42 * s), vec3(cx + 0.42 * s, h + 0.26, cz + 0.42 * s), T_CAP, cc, cc);
|
||||
mb.boxy(vec3(cx - 0.26 * s, h + 0.26, cz - 0.26 * s), vec3(cx + 0.26 * s, h + 0.38, cz + 0.26 * s), T_CAP, cc, cc);
|
||||
} else {
|
||||
@@ -1202,6 +1215,7 @@ fn chunk_sig(map: &Map, cx: i32, cz: i32) -> u64 {
|
||||
Kind::Farm => t.food as u64,
|
||||
Kind::Treasury => (t.gold / 50) as u64 | (t.res as u64) << 5,
|
||||
Kind::Drawbridge => t.res as u64,
|
||||
Kind::Mushroom => mushroom_stage(&t) as u64 | (t.res as u64) << 3,
|
||||
_ => 0,
|
||||
};
|
||||
let shown = map.shown(idx(x, z)) as u64 | (map.sky(idx(x, z)) as u64) << 1;
|
||||
@@ -2449,6 +2463,15 @@ fn draw_landmarks_solid(g: &Game, t: f32) {
|
||||
let _ = t;
|
||||
}
|
||||
|
||||
// growth stage of a giant mushroom: 0 a sprout .. 4 fully grown (felling only then)
|
||||
fn mushroom_stage(t: &Tile) -> u32 {
|
||||
if t.grown() {
|
||||
4
|
||||
} else {
|
||||
((t.growth() * 4.0) as u32).min(3)
|
||||
}
|
||||
}
|
||||
|
||||
// the colour of a master side (the first master red, rivals green, blue and yellow)
|
||||
pub fn master_rgb(side: u8) -> Vec3 {
|
||||
match side {
|
||||
@@ -3337,6 +3360,7 @@ pub fn minimap_color(tile: &Tile) -> [u8; 4] {
|
||||
Kind::Drawbridge => [120, 80, 50, 255],
|
||||
Kind::Obsidian => [60, 40, 70, 255],
|
||||
Kind::Mushroom => [150, 90, 200, 255],
|
||||
Kind::Grove => [50, 110, 92, 255],
|
||||
Kind::Tree => [40, 100, 40, 255],
|
||||
Kind::Shard => [255, 60, 120, 255],
|
||||
Kind::Aerie => [170, 140, 90, 255],
|
||||
|
||||
Reference in new issue
Block a user