Work on room generation/laser run past
This commit is contained in:
@@ -16,3 +16,7 @@ materialColor = \case
|
||||
Flesh -> red
|
||||
Electronics -> greyN 0.2
|
||||
ForceField -> magenta
|
||||
Photovoltaic -> yellow
|
||||
LightningRod -> yellow
|
||||
Pyroelectric -> yellow
|
||||
Piezoelectric -> yellow
|
||||
|
||||
@@ -25,6 +25,10 @@ damMatSideEffect dm = \case
|
||||
Dirt -> damageDirt dm
|
||||
Glass -> damageGlass dm
|
||||
Crystal -> damageCrystal dm
|
||||
Photovoltaic -> damagePhotovoltaic dm
|
||||
LightningRod -> damageLightningRod dm
|
||||
Pyroelectric -> damagePyroelectric dm
|
||||
Piezoelectric -> damagePiezoelectric dm
|
||||
_ -> defDamageMaterial dm
|
||||
|
||||
defDamageMaterial :: Damage -> ECW -> World -> (Int,World)
|
||||
@@ -66,6 +70,56 @@ damageStone dm ecw w = case dm of
|
||||
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
|
||||
outTo x t = x -.- squashNormalizeV t
|
||||
|
||||
damageLightningRod :: Damage -> ECW -> World -> (Int,World)
|
||||
damageLightningRod dm ecw w = case dm of
|
||||
Electrical{} -> (dm ^. dmAmount, w)
|
||||
_ -> damageStone dm ecw w
|
||||
|
||||
damagePyroelectric :: Damage -> ECW -> World -> (Int,World)
|
||||
damagePyroelectric dm ecw w = case dm of
|
||||
Flaming{} -> (dm ^. dmAmount, w)
|
||||
Explosive{} -> (dm ^. dmAmount, w)
|
||||
Sparking{} -> (dm ^. dmAmount, w)
|
||||
_ -> damageStone dm ecw w
|
||||
|
||||
-- this should be correct
|
||||
-- to be honest, we shouldn't just pass an int forward here...
|
||||
damagePiezoelectric :: Damage -> ECW -> World -> (Int,World)
|
||||
damagePiezoelectric = damageStone
|
||||
|
||||
|
||||
damagePhotovoltaic :: Damage -> ECW -> World -> (Int,World)
|
||||
damagePhotovoltaic dm ecw w = case dm of
|
||||
Lasering _ p t -> f dmam $ laserSpark (outTo p t) (rdir p t)
|
||||
Piercing _ p t ->
|
||||
f dmam $ makeSpark NormalSpark (outTo p t) (rdir p t)
|
||||
. makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
-- . randsound p [slapS, slap1S,slap2S,slap3S,slap4S,slap5S,slap6S,slap7S]
|
||||
. randsound p [slapS, slap1S, slap2S]
|
||||
Blunt _ p t -> f dmam $ makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
Shattering _ p t -> f dmam $ makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
Crushing{} -> f dmam id
|
||||
Explosive{} -> f dmam id
|
||||
Sparking{} -> f 0 id
|
||||
Flaming{} -> f 0 id
|
||||
Electrical{} -> f 0 id
|
||||
Poison{} -> f 0 id
|
||||
Enterrement{} -> f 0 id
|
||||
Flashing{} -> f 0 id
|
||||
where
|
||||
f x g = (x, g w)
|
||||
dmam = dm ^. dmAmount
|
||||
rdir p t = argV $ reflectIn v t
|
||||
where
|
||||
v = case ecw of
|
||||
Right wl -> uncurry (-) $ _wlLine wl
|
||||
Left cr -> vNormal (p - cr ^. crPos . _xy)
|
||||
randsound p xs =
|
||||
let (x, g) = runState (takeOne xs) $ _randGen w
|
||||
in soundStart so p x Nothing . set randGen g
|
||||
so = DamageHitSound (w ^. cWorld . lWorld . lClock)
|
||||
outTo x t = x -.- squashNormalizeV t
|
||||
|
||||
damageMetal :: Damage -> ECW -> World -> (Int,World)
|
||||
damageMetal dm ecw w = case dm of
|
||||
Lasering _ p t -> f 0 $ laserSpark (outTo p t) (rdir p t)
|
||||
|
||||
@@ -15,6 +15,10 @@ destroyMatS mat = case mat of
|
||||
Electronics -> [metal1S, metal2S, metal3S, metal4S, metal5S, metal6S,metal7S]
|
||||
Flesh -> [gut1S, gut2S, gut3S, gut4S, gut5S, gut6S]
|
||||
ForceField -> []
|
||||
Photovoltaic -> [glassShat1S, glassShat2S, glassShat3S, glassShat4S]
|
||||
LightningRod -> [glassShat1S, glassShat2S, glassShat3S, glassShat4S]
|
||||
Pyroelectric -> [glassShat1S, glassShat2S, glassShat3S, glassShat4S]
|
||||
Piezoelectric -> [glassShat1S, glassShat2S, glassShat3S, glassShat4S]
|
||||
|
||||
--weakenMatS :: Material -> [SoundID]
|
||||
--weakenMatS mat = case mat of
|
||||
|
||||
Reference in New Issue
Block a user