Orders: attack (fighting creatures nearby go for an enemy or enemy tower) and guard (up to three creatures hold a room for two minutes); right click with an order tool cancels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-04 07:52:03 +01:00
1 parent b3583f5e7e
commit 0606c1f994
9 files changed
+230 -6

No files matched your search

+20
View File
@@ -78,6 +78,7 @@ pub const T_GRAVEYARD: u32 = 170;
pub const T_GUARDPOST: u32 = 174;
pub const T_ARENA: u32 = 178;
pub const T_ALTAR: u32 = 182;
pub const I_ORDERS: u32 = 186; // attack, guard
pub struct Gfx {
pub atlas: Texture2D,
@@ -996,6 +997,25 @@ fn gen_atlas() -> Image {
for (k, f) in spells.iter().enumerate() {
cv.cell(I_SPELLS + k as u32, |x, y| f(x, y));
}
// order icons: crossed blades (attack), a shield (guard)
cv.cell(I_ORDERS, |x, y| {
let blade = (x - y).abs() <= 1 || (x + y - 15).abs() <= 1;
if blade && (2..=13).contains(&x) && (2..=13).contains(&y) {
Some(if (x - y).abs() == 0 || (x + y - 15) == 0 { c(240, 240, 250) } else { c(170, 170, 185) })
} else if (y == 12 || y == 13) && (x == 2 || x == 3 || x == 12 || x == 13) {
Some(c(140, 90, 40))
} else {
None
}
});
cv.cell(I_ORDERS + 1, |x, y| {
let w = if y < 9 { 6 } else { 6 - (y - 8) };
if (2..=14).contains(&y) && (x - 8).abs() <= w.max(0) {
Some(if (x - 8).abs() == w.max(0) || y == 2 { c(220, 190, 80) } else if x == 8 || y == 6 { c(220, 190, 80) } else { c(150, 30, 36) })
} else {
None
}
});
// aerie: straw and twigs on stone, a few feathers
for v in 0..4u32 {
cv.cell(T_AERIE + v, |x, y| {