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:
1 parent
82dd8c73e1
commit
4c440fb97f
25 files changed
+215
-4
No files matched your search
+5
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user