Creature equipment: the forge makes iron, steel and rune gear for the strongest creatures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 00:26:59 +01:00
1 parent 82dd8c73e1
commit 4c440fb97f
25 files changed
+215 -4

No files matched your search

+5 -1
View File
@@ -206,6 +206,10 @@ impl Game {
// the forge: the work of the creatures there goes into the oldest order
pub(crate) fn update_forge(&mut self, dt: f32) {
let work = std::mem::take(&mut self.forge_work);
if !self.traps.iter().any(|t| t.stage == ORDERED) {
// no order: the forge makes equipment
self.forge_gear(work);
}
if let Some(k) = self.traps.iter().position(|t| t.stage == ORDERED) {
self.traps[k].progress += work;
if self.traps[k].progress >= self.traps[k].kind.work() {
@@ -244,7 +248,7 @@ impl Game {
// is there forge work to do (an order waiting)?
pub fn forge_orders(&self) -> bool {
self.traps.iter().any(|t| t.stage == ORDERED)
self.traps.iter().any(|t| t.stage == ORDERED) || self.gear_wanted()
}
// an imp looking for work: a finished crate to carry; returns the path to the crate