Add persistent destructible world structures and building kits

This commit is contained in:
dingo
2026-09-09 22:46:06 -04:00
parent c2bef2a45f
commit e80064976a
36 changed files with 932 additions and 43 deletions
+4 -1
View File
@@ -278,6 +278,9 @@ func (w *World) checkPower(c *Character, v p.LearnedPower, target string) error
for _, e := range w.combatTargets(true, v.Attack.Effect) {
if e.ID == target {
if length3(body(c.View.Entity.Position), body(e.Position)) > v.Attack.Range+func() float64 {
if e.Kind == "structure" {
return math.Max(*e.Width, *e.Depth) / 2
}
if target == "boss" {
return 4
}
@@ -285,7 +288,7 @@ func (w *World) checkPower(c *Character, v p.LearnedPower, target string) error
}() {
return errors.New("power target out of range")
}
if _, blocked := w.terrainHit(body(c.View.Entity.Position), body(e.Position)); blocked {
if _, blocked := w.combatLine(body(c.View.Entity.Position), body(e.Position), e.ID); blocked {
return errors.New("terrain blocks power")
}
found = true