Control wall damage effects using the wall
This commit is contained in:
@@ -9,7 +9,7 @@ import Dodge.SoundLogic.LoadSound
|
||||
import Dodge.Creature.State.Data
|
||||
import Dodge.Data.DamageType
|
||||
import Dodge.WorldEvent
|
||||
import Dodge.WorldEvent.DamageBlock
|
||||
import Dodge.Wall.Damage
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Draw
|
||||
import Dodge.Item.Data
|
||||
@@ -186,7 +186,6 @@ moveLaser phaseV pos dir w pt
|
||||
)
|
||||
where
|
||||
xp = pos +.+ 800 *.* unitVectorAtAngle dir
|
||||
reflectDir wall = argV (reflectIn (uncurry (-.-) (_wlLine wall)) (xp -.- pos))
|
||||
f :: [Wall] -> Point2 -> Point2 -> (Maybe (Point2,Either Creature Wall),[Point2])
|
||||
f seenWs x y = case find (h' seenWs) $ thingsHitExceptCrLongLine Nothing x y w of
|
||||
Just (p,Right wl)
|
||||
@@ -225,9 +224,7 @@ moveLaser phaseV pos dir w pt
|
||||
hitEffect = case thHit of
|
||||
Just (p,Left cr)
|
||||
-> creatures . ix (_crID cr) . crState . crDamage %~ (Lasering 19 pos p xp :)
|
||||
Just (p,Right wl) -> colSpark 8 (V4 20 (-5) 0 1) (p +.+ safeNormalizeV (pos -.- p))
|
||||
(reflectDir wl)
|
||||
. damageWall (Lasering 19 pos p xp) wl
|
||||
Just (p,Right wl) -> damageWall (Lasering 19 pos p xp) wl
|
||||
_ -> id
|
||||
pic = setLayer 1 $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 yellow) $ lineOfThickness 20 (pos:ps)
|
||||
|
||||
Reference in New Issue
Block a user