Add persistent destructible world structures and building kits
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user