Stun turret turn with electrical damage
This commit is contained in:
@@ -10,28 +10,35 @@ import Dodge.Creature.Inanimate
|
||||
import Shape.Data
|
||||
import Dodge.Default
|
||||
import Dodge.RandomHelp
|
||||
import Color
|
||||
import Shape
|
||||
|
||||
mountLightOnShape
|
||||
:: (Point2 -> Point3 -> Shape) -- ^ function describing the mount shape
|
||||
-> Maybe Color -- ^ describing a possible color override for the shape
|
||||
-> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightOnShape shapeF ls wallp lsp = ps0j (PutForeground $ shapeF wallp lsp)
|
||||
mountLightOnShape shapeF mcol ls wallp lsp = ps0j (PutForeground . setCol $ shapeF wallp lsp)
|
||||
. ps0 (PutLS $ ls {_lsPos = lsp})
|
||||
where
|
||||
setCol = case mcol of
|
||||
Just col -> colorSH col
|
||||
Nothing -> id
|
||||
|
||||
mountLightID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightID = mountLightOnShape f
|
||||
where
|
||||
f wp (V3 x y z) = thinHighBar (z+5) wp pout
|
||||
where
|
||||
pout = V2 x y +.+ safeNormalizeV (V2 x y -.- wp)
|
||||
|
||||
redMID :: (LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement)
|
||||
redMID :: (Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement)
|
||||
-> Point2 -> Point3 -> Placement
|
||||
redMID f wallp lampp = f defaultLS wallp lampp (const Nothing)
|
||||
redMID f wallp lampp = f Nothing defaultLS wallp lampp (const Nothing)
|
||||
|
||||
mountLight :: Point2 -> Point3 -> Placement
|
||||
mountLight = redMID mountLightID
|
||||
|
||||
mountLightLID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightLID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightLID = mountLightOnShape f
|
||||
where
|
||||
f wallpos (V3 x y z) = thinHighBar (z + 5) wallposUp (turnpos `extendAway` wallposUp)
|
||||
@@ -44,7 +51,7 @@ mountLightLID = mountLightOnShape f
|
||||
mountLightL :: Point2 -> Point3 -> Placement
|
||||
mountLightL = redMID mountLightLID
|
||||
|
||||
mountLightJID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightJID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightJID = mountLightOnShape f
|
||||
where
|
||||
f wallpos (V3 x y z) = thinHighBar (z + 5) wallposUp turn1
|
||||
@@ -61,7 +68,7 @@ mountLightJID = mountLightOnShape f
|
||||
mountLightJ :: Point2 -> Point3 -> Placement
|
||||
mountLightJ = redMID mountLightJID
|
||||
|
||||
mountLightlID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightlID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightlID = mountLightOnShape f
|
||||
where
|
||||
f wallpos (V3 x y z) = thinHighBar (z + 5) wallposUp (turnpos `extendAway` wallposUp)
|
||||
@@ -74,7 +81,7 @@ mountLightlID = mountLightOnShape f
|
||||
mountLightll :: Point2 -> Point3 -> Placement
|
||||
mountLightll = redMID mountLightlID
|
||||
|
||||
mountLightAID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightAID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightAID = mountLightOnShape f
|
||||
where
|
||||
f wallpos (V3 x y z) = girder (z+10) 20 10 pout wallpos
|
||||
@@ -97,7 +104,7 @@ mountLightVCond f = updatePSToLevel 2 (const thePS) $ mountLightV 0 (V3 0 (-20)
|
||||
mntLightCond :: ((Point2,Float) -> Bool) -> Placement
|
||||
mntLightCond f = RandomPlacement $ takeOne [mountLightVCond f,mountLightACond f]
|
||||
|
||||
mountLightVID :: LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightVID :: Maybe Color -> LightSource -> Point2 -> Point3 -> (Int -> Maybe Placement) -> Placement
|
||||
mountLightVID = mountLightOnShape f
|
||||
where
|
||||
f wallpos (V3 x y z) = thinHighBar (z + 5) wallposUp (lxy `extendAway` wallposUp)
|
||||
|
||||
Reference in New Issue
Block a user