Start moving creature properties out of records
This commit is contained in:
@@ -32,7 +32,7 @@ flockArmourChaseCrit =
|
||||
, _crGroup = ShieldGroup
|
||||
, _crMvType = defaultChaseMvType
|
||||
}
|
||||
& crType . humanoidAI .~ FlockArmourChaseAI
|
||||
-- & crType . humanoidAI .~ FlockArmourChaseAI
|
||||
|
||||
armourChaseCrit :: Creature
|
||||
armourChaseCrit =
|
||||
|
||||
@@ -3,11 +3,11 @@ module Dodge.Creature.AutoCrit (
|
||||
) where
|
||||
|
||||
import Dodge.Item.Held.Cane
|
||||
import Control.Lens
|
||||
--import Control.Lens
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Default
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
--import Picture
|
||||
|
||||
autoCrit :: Creature
|
||||
autoCrit =
|
||||
@@ -17,5 +17,5 @@ autoCrit =
|
||||
, _crHP = 300
|
||||
, _crMvType = defaultAimMvType
|
||||
}
|
||||
& crType . skinUpper .~ lightx4 red
|
||||
& crType . humanoidAI .~ AutoAI
|
||||
-- & crType . skinUpper .~ lightx4 red
|
||||
-- & crType . humanoidAI .~ AutoAI
|
||||
|
||||
@@ -18,7 +18,7 @@ smallChaseCrit =
|
||||
{ _crHP = 1
|
||||
, _crRad = 4
|
||||
, _crInv = mempty
|
||||
, _crCorpse = MakeDefaultCorpse
|
||||
-- , _crCorpse = MakeDefaultCorpse
|
||||
}
|
||||
|
||||
invisibleChaseCrit :: Creature
|
||||
@@ -39,7 +39,7 @@ chaseCrit =
|
||||
, _crVocalization = chaseCritVocalization
|
||||
, _crMvType = defaultChaseMvType
|
||||
}
|
||||
& crType . humanoidAI .~ ChaseAI
|
||||
-- & crType . humanoidAI .~ ChaseAI
|
||||
|
||||
chaseCritVocalization :: Vocalization
|
||||
chaseCritVocalization =
|
||||
|
||||
@@ -63,9 +63,7 @@ useItemLoc cr loc pt w
|
||||
ldt = loc ^. locLDT
|
||||
itm = ldt ^. ldtValue . _1
|
||||
|
||||
useLocation ::
|
||||
LocationLDT ItemLink ComposedItem ->
|
||||
LocationLDT ItemLink ComposedItem
|
||||
useLocation :: LocationLDT ItemLink ComposedItem -> LocationLDT ItemLink ComposedItem
|
||||
useLocation loc
|
||||
| isJust $ loc ^? locLDT . ldtValue . _1 . itType . ibtEquip = loc
|
||||
| isJust $ loc ^? locLDT . ldtValue . _1 . itUse . uaParams . apProjectiles . ix 0 =
|
||||
|
||||
@@ -18,7 +18,7 @@ barrel :: Creature
|
||||
barrel =
|
||||
defaultInanimate
|
||||
{ _crHP = 500
|
||||
, _crType = Barreloid PlainBarrel
|
||||
, _crType = BarrelCrit PlainBarrel
|
||||
, _crState =
|
||||
defaultState
|
||||
{ _csSpState = Barrel []
|
||||
@@ -30,7 +30,7 @@ explosiveBarrel :: Creature
|
||||
explosiveBarrel =
|
||||
defaultInanimate
|
||||
{ _crHP = 400
|
||||
, _crType = Barreloid ExplosiveBarrel
|
||||
, _crType = BarrelCrit ExplosiveBarrel
|
||||
, _crState =
|
||||
defaultState
|
||||
{ _csSpState = Barrel []
|
||||
|
||||
@@ -14,7 +14,7 @@ colorLamp ::
|
||||
colorLamp col h =
|
||||
defaultInanimate
|
||||
{ _crHP = 100
|
||||
, _crType = Lampoid h col Nothing
|
||||
, _crType = LampCrit h col Nothing
|
||||
, _crRad = 3
|
||||
, _crMass = 3
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ module Dodge.Creature.LauncherCrit (
|
||||
) where
|
||||
|
||||
import Dodge.Item.Held.Launcher
|
||||
import Control.Lens
|
||||
--import Control.Lens
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Default
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
--import Picture
|
||||
|
||||
launcherCrit :: Creature
|
||||
launcherCrit =
|
||||
@@ -17,5 +17,5 @@ launcherCrit =
|
||||
, _crState = defaultState
|
||||
, _crHP = 300
|
||||
}
|
||||
& crType . skinUpper .~ lightx4 red
|
||||
& crType . humanoidAI .~ LauncherAI
|
||||
-- & crType . skinUpper .~ lightx4 red
|
||||
-- & crType . humanoidAI .~ LauncherAI
|
||||
|
||||
@@ -2,12 +2,12 @@ module Dodge.Creature.LtAutoCrit (
|
||||
ltAutoCrit,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
--import Control.Lens
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Held.Stick
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
--import Picture
|
||||
|
||||
ltAutoCrit :: Creature
|
||||
ltAutoCrit =
|
||||
@@ -16,5 +16,6 @@ ltAutoCrit =
|
||||
, _crRad = 10
|
||||
, _crHP = 500
|
||||
}
|
||||
& crType . humanoidAI .~ LtAutoAI
|
||||
& crType . skinUpper .~ lightx4 red
|
||||
-- & crType .~ LtAutoCrit
|
||||
-- & crType . humanoidAI .~ LtAutoAI
|
||||
-- & crType . skinUpper .~ lightx4 red
|
||||
|
||||
@@ -9,6 +9,7 @@ module Dodge.Creature.Picture (
|
||||
deadFeet,
|
||||
) where
|
||||
|
||||
import Dodge.Creature.Shape
|
||||
import Control.Lens
|
||||
import Dodge.Creature.HandPos (translateToLeftHand, translateToRightHand)
|
||||
import Dodge.Creature.Test
|
||||
@@ -44,7 +45,7 @@ basicCrShape cr
|
||||
, rotmdir $ colorSH (_skinLower cskin) $ feet cr
|
||||
]
|
||||
where
|
||||
cskin = _crType cr
|
||||
cskin = crShape $ _crType cr
|
||||
crsize = 0.1 * _crRad cr
|
||||
tr = uncurryV translateSHxy (_crPos cr)
|
||||
rotdir = rotateSH (_crDir cr)
|
||||
|
||||
@@ -2,12 +2,12 @@ module Dodge.Creature.PistolCrit (
|
||||
pistolCrit,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
--import Control.Lens
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Held.Stick
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
--import Picture
|
||||
|
||||
pistolCrit :: Creature
|
||||
pistolCrit =
|
||||
@@ -16,5 +16,5 @@ pistolCrit =
|
||||
, _crRad = 10
|
||||
, _crHP = 500
|
||||
}
|
||||
& crType . humanoidAI .~ PistolAI
|
||||
& crType . skinUpper .~ lightx4 red
|
||||
-- & crType . humanoidAI .~ PistolAI
|
||||
-- & crType . skinUpper .~ lightx4 red
|
||||
|
||||
@@ -2,12 +2,12 @@ module Dodge.Creature.SpreadGunCrit (
|
||||
spreadGunCrit,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
--import Control.Lens
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Held.Stick
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
--import Picture
|
||||
|
||||
spreadGunCrit :: Creature
|
||||
spreadGunCrit =
|
||||
@@ -16,5 +16,5 @@ spreadGunCrit =
|
||||
, _crRad = 10
|
||||
, _crHP = 500
|
||||
}
|
||||
& crType . humanoidAI .~ SpreadGunAI
|
||||
& crType . skinUpper .~ lightx4 red
|
||||
-- & crType . humanoidAI .~ SpreadGunAI
|
||||
-- & crType . skinUpper .~ lightx4 red
|
||||
|
||||
@@ -100,8 +100,8 @@ checkDeath cr w
|
||||
where
|
||||
removecr
|
||||
| _crID cr == 0 =
|
||||
(cWorld . lWorld . creatures . ix (_crID cr) . crType .~ NonDrawnCreature)
|
||||
. (cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ 0)
|
||||
-- (cWorld . lWorld . creatures . ix (_crID cr) . crType .~ NonDrawnCreature)
|
||||
(cWorld . lWorld . creatures . ix (_crID cr) . crHP .~ 0)
|
||||
-- hack to get around player creature being killed but left with more than 0 hp
|
||||
| otherwise = cWorld . lWorld . creatures . at (_crID cr) .~ Nothing
|
||||
|
||||
@@ -114,7 +114,7 @@ corpseOrGib cr = case cr ^? crState . csDamage . to maxDamageType . _Just . _1 o
|
||||
_ | _crPastDamage cr > 200 -> addCrGibs cr
|
||||
_ -> plNew (cWorld . lWorld . corpses) cpID thecorpse
|
||||
where
|
||||
thecorpse = makeDefaultCorpse cr
|
||||
thecorpse = makeCorpse cr
|
||||
|
||||
scorchSPic :: SPic -> SPic
|
||||
scorchSPic = _1 %~ overColSH (mixColors 0.9 0.1 black . normalizeColor)
|
||||
@@ -190,7 +190,7 @@ invItemLocUpdate cr loc w = doAnyEquipmentEffect loc cr $ case itm ^. itType of
|
||||
|
||||
doAnyEquipmentEffect :: LocationLDT ItemLink ComposedItem -> Creature -> World -> World
|
||||
doAnyEquipmentEffect loc cr = case itm ^? itLocation . ilEquipSite . _Just of
|
||||
Just _ -> useE loc cr
|
||||
Just _ -> equipBackgroundEffect loc cr
|
||||
_ -> id
|
||||
where
|
||||
itm = loc ^. locLDT . ldtValue . _1
|
||||
|
||||
@@ -13,12 +13,13 @@ swarmCrit =
|
||||
{ _crHP = 1
|
||||
, _crRad = 2
|
||||
, _crMass = 2
|
||||
, _crCorpse = MakeDefaultCorpse
|
||||
-- , _crCorpse = MakeDefaultCorpse
|
||||
, _crFaction = ColorFaction yellow
|
||||
, _crMeleeCooldown = 0
|
||||
}
|
||||
& crType . skinUpper .~ lightx4 yellow
|
||||
& crType . humanoidAI .~ SwarmAI
|
||||
& crType .~ SwarmCrit
|
||||
-- & crType . skinUpper .~ lightx4 yellow
|
||||
-- & crType . humanoidAI .~ SwarmAI
|
||||
|
||||
--swarmCritMoveFunc :: Creature -> Point2 -> Creature -> Point2
|
||||
--swarmCritMoveFunc tcr cenp cr
|
||||
|
||||
@@ -14,10 +14,10 @@ updateCreature :: Creature -> World -> World
|
||||
updateCreature cr = case _crType cr of
|
||||
Avatar{} -> (cWorld . lWorld . creatures . ix 0 . crType . avatarPulse %~ updatePulse)
|
||||
. crUpdate yourControl cr
|
||||
Lampoid{} -> updateLampoid cr
|
||||
Humanoid{} -> updateHumanoid cr
|
||||
Barreloid{} -> updateBarreloid cr
|
||||
NonDrawnCreature -> id
|
||||
LampCrit{} -> updateLampoid cr
|
||||
BarrelCrit{} -> updateBarreloid cr
|
||||
AvatarDead -> id
|
||||
_ -> updateHumanoid cr
|
||||
|
||||
updatePulse :: Pulse -> Pulse
|
||||
updatePulse PulseStatus {_pulseRate = pr, _pulseProgress = pp}
|
||||
|
||||
Reference in New Issue
Block a user