Cleanup
This commit is contained in:
@@ -21,21 +21,6 @@ applyIndividualDamage cr w (Inertial _ _ v _) = w
|
||||
applyIndividualDamage cr w dm =
|
||||
let (i,w') = damMatSideEffect dm (crMaterial (_crType cr)) (Left cr) w
|
||||
in w' & damageHP cr i
|
||||
-- case dm of
|
||||
-- Piercing{} -> applyPiercingDamage cr dm w
|
||||
-- _ -> w & damageHP cr (_dmAmount dm)
|
||||
|
||||
--applyPiercingDamage :: Creature -> Damage -> World -> World
|
||||
--applyPiercingDamage cr dm w
|
||||
-- | crIsArmouredFrom (w ^. cWorld . lWorld . items) p cr
|
||||
-- = f . makeSpark NormalSpark p1 (argV (p1 - p)) $ w
|
||||
-- | otherwise = f . damageHP cr (_dmAmount dm) $ w
|
||||
-- where
|
||||
-- f = cWorld . lWorld . creatures . ix (_crID cr) . crPos . _xy +~ _dmVector dm
|
||||
-- / V2 x x
|
||||
-- x = crMass (_crType cr)
|
||||
-- p = _dmPos dm
|
||||
-- p1 = p + 2 *.* squashNormalizeV (p - cr ^. crPos . _xy)
|
||||
|
||||
damageHP :: Creature -> Int -> World -> World
|
||||
damageHP cr x =
|
||||
|
||||
@@ -271,10 +271,9 @@ viewTarget w cr = case cr ^? crIntention . viewPoint . _Just of
|
||||
|
||||
doStrategyActions :: Creature -> Creature
|
||||
doStrategyActions cr = case cr ^? crActionPlan . apStrategy of
|
||||
Just (StrategyActions strat acs) ->
|
||||
Just (SetStrategyAction strat acs) ->
|
||||
cr
|
||||
-- & crActionPlan . apAction .~ acs
|
||||
& crActionPlan . apAction .~ head acs
|
||||
& crActionPlan . apAction .~ acs
|
||||
& crActionPlan . apStrategy .~ strat
|
||||
_ -> cr
|
||||
|
||||
@@ -317,11 +316,11 @@ searchIfDamaged cr
|
||||
&& _apStrategy (_crActionPlan cr) == WatchAndWait =
|
||||
cr & crPerception . cpVigilance .~ Vigilant
|
||||
& crActionPlan . apStrategy
|
||||
.~ StrategyActions
|
||||
.~ SetStrategyAction
|
||||
LookAround
|
||||
[ TurnToPoint (cr ^. crPos . _xy -.- unitVectorAtAngle (_crDir cr))
|
||||
( TurnToPoint (cr ^. crPos . _xy -.- unitVectorAtAngle (_crDir cr))
|
||||
`DoActionThen` 40 `WaitThen` bfsThenReturn 500
|
||||
]
|
||||
)
|
||||
| otherwise = cr
|
||||
|
||||
bfsThenReturn :: Int -> Action
|
||||
|
||||
@@ -10,14 +10,14 @@ import Dodge.Data.Creature
|
||||
goToPostStrat :: Creature -> Strategy
|
||||
goToPostStrat cr = case find sentinelGoal $ _apGoal $ _crActionPlan cr of
|
||||
Just (SentinelAt p _) ->
|
||||
StrategyActions
|
||||
SetStrategyAction
|
||||
(GetTo p)
|
||||
[ DoActionThen (WaitThen 150 holsterIfAiming) $
|
||||
( DoActionThen (WaitThen 150 holsterIfAiming) $
|
||||
DoActionThen
|
||||
(PathTo p NoAction)
|
||||
NoAction
|
||||
-- $ DoImpulses [ChangeStrategy WatchAndWait]
|
||||
]
|
||||
)
|
||||
_ -> WatchAndWait
|
||||
where
|
||||
sentinelGoal (SentinelAt _ _) = True
|
||||
|
||||
@@ -66,11 +66,8 @@ updateLivingCreature cr = case cr ^. crType of
|
||||
. yourControl
|
||||
LampCrit{} -> updateLampoid cr
|
||||
BarrelCrit bt -> updateBarreloid bt cr
|
||||
ChaseCrit{} -> \w ->
|
||||
crUpdate cid . performActions cid $
|
||||
over (cWorld . lWorld . creatures . ix cid) (chaseCritInternal w) w
|
||||
CrabCrit{} ->
|
||||
crUpdate cid . performActions cid . crabCritInternal cid
|
||||
ChaseCrit{} -> crUpdate cid . performActions cid . updateChaseCrit cid
|
||||
CrabCrit{} -> crUpdate cid . performActions cid . crabCritInternal cid
|
||||
AutoCrit{} -> crUpdate cid
|
||||
SwarmCrit{} -> crUpdate cid
|
||||
HoverCrit{} -> \w ->
|
||||
@@ -97,7 +94,7 @@ updateHiveCrit cr cid w
|
||||
& tocr . crType . hiveGestation %~ (max 0 . subtract 1)
|
||||
| otherwise = w
|
||||
where
|
||||
nbees = 50
|
||||
nbees = 25
|
||||
tocr = cWorld . lWorld . creatures . ix cid
|
||||
nid = IM.newKey $ w ^. cWorld . lWorld . creatures
|
||||
ncr = beeCrit & crPos .~ (cr ^. crPos + (0 & _xy +~ 25))
|
||||
@@ -144,6 +141,7 @@ updateAggroBee cr cid w
|
||||
t = \case
|
||||
Avatar{} -> True
|
||||
ChaseCrit{} -> True
|
||||
CrabCrit{} -> True
|
||||
_ -> False
|
||||
|
||||
-- do bees need to be able to see slime targets?
|
||||
|
||||
Reference in New Issue
Block a user