Slow down slime feeding
This commit is contained in:
@@ -58,6 +58,7 @@ slinkCrit = defaultCreature
|
||||
& crType .~ SlinkCrit
|
||||
{ _meleeCooldown = 0
|
||||
, _slinkSpine = replicate 15 (V3 0 0 2, Q.axisAngle (V3 0 1 0) (pi/15))
|
||||
, _slinkHeadPos = (V3 20 0 15, Q.axisAngle (V3 0 1 0) (pi/2))
|
||||
}
|
||||
& crFaction .~ ColorFaction red
|
||||
& crPerception . cpVision . viFOV .~ FloatFOV pi
|
||||
@@ -66,7 +67,7 @@ slimeCrit :: Creature
|
||||
slimeCrit = defaultCreature
|
||||
& crName .~ "slimeCrit"
|
||||
& crHP .~ HP 1000
|
||||
& crType .~ SlimeCrit r 0 0 (V2 r 0) False
|
||||
& crType .~ SlimeCrit r 0 0 (V2 r 0) False 0
|
||||
& crFaction .~ ColorFaction (light green)
|
||||
& crPerception . cpVision . viFOV .~ FloatFOV pi
|
||||
& crActionPlan .~ SlimeIntelligence
|
||||
|
||||
@@ -54,7 +54,8 @@ drawCreature w m cr = translateSP (_crPos cr) . fallrot . rotateSP (_crDir cr) $
|
||||
_ -> id
|
||||
|
||||
drawSlimeCrit :: Creature -> Shape
|
||||
drawSlimeCrit cr = colorSH green $ upperPrismPolyHalf Medium Typical r $ polyCirc 6 r
|
||||
drawSlimeCrit cr = colorSH green
|
||||
$ upperPrismPolyHalf Medium Typical (cr ^?! crType . slimeFeedProgress + min 10 r) $ polyCirc 6 r
|
||||
& each %~ scaleAlong d s
|
||||
& each %~ scaleAlong (vNormal d) (1 / s)
|
||||
& each %~ rotateV (-cr ^. crDir)
|
||||
@@ -93,11 +94,15 @@ basicCrShape cr
|
||||
|
||||
drawSlinkCrit :: Creature -> Shape
|
||||
drawSlinkCrit cr = snd (foldl' f ((V3 0 0 0,Q.qid), mempty) $ cr ^?! crType . slinkSpine)
|
||||
<> shead
|
||||
& each . sfColor .~ cskin ^?! skinUpper
|
||||
where
|
||||
shead = polyCirc 6 15
|
||||
& upperPrismPoly Medium Important 10
|
||||
& each . sfVs . each %~ Q.apply (cr ^?! crType . slinkHeadPos)
|
||||
cskin = crShape $ _crType cr
|
||||
f ((p,q),sh) (p',q') = ((p,q) `Q.comp` (p',q'), sh <> (g p' & each . sfVs . each %~ Q.apply (p,q)))
|
||||
g _ = upperPrismPoly Medium Important 2 $ polyCirc 6 10
|
||||
g _ = upperPrismPoly Medium Important 2 $ polyCirc 6 15
|
||||
|
||||
drawHoverCrit :: Creature -> Shape
|
||||
drawHoverCrit cr = colorSH (_skinHead cskin)
|
||||
|
||||
@@ -87,6 +87,7 @@ slimeCritUpdate cid w
|
||||
& cWorld . lWorld . creatures . ix cid . crDamage .~ []
|
||||
& tocr %~ doSlimeRadChange
|
||||
& tocr . crType . slimeSplitTimer %~ (max 0 . subtract 1)
|
||||
& tocr . crType . slimeFeedProgress %~ (max 0 . subtract 0.5)
|
||||
where
|
||||
tocr = cWorld . lWorld . creatures . ix cid
|
||||
cr = w ^?! cWorld . lWorld . creatures . ix cid
|
||||
@@ -160,6 +161,7 @@ splitSlimeCrit p v cr = do
|
||||
& crType . slimeRad .~ r2
|
||||
& crType . slimeCompression .~ rotateV (argV (-mvdir)) (V2 r2 0)
|
||||
& crDir .~ argV (-mvdir)
|
||||
& crType . slimeFeedProgress .~ 0
|
||||
)
|
||||
where
|
||||
cxy = cr ^. crPos . _xy
|
||||
|
||||
Reference in New Issue
Block a user