Tweak hover crit height
This commit is contained in:
@@ -39,4 +39,4 @@ hoverCrit =
|
||||
& crHP .~ HP 10000
|
||||
& crType .~ HoverCrit 0
|
||||
& crFaction .~ ColorFaction blue
|
||||
& crStance . carriage .~ Flying 15 0.91 0
|
||||
& crStance . carriage .~ Flying 15 0.975 0
|
||||
|
||||
@@ -8,7 +8,7 @@ crMvType :: Creature -> CrMvType
|
||||
crMvType cr = case _crType cr of
|
||||
Avatar {_avMoveSpeed = s} -> MvWalking s
|
||||
ChaseCrit {} -> defaultChaseMvType
|
||||
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.3
|
||||
HoverCrit {} -> defaultChaseMvType & mvSpeed .~ 0.1
|
||||
SwarmCrit -> defaultChaseMvType
|
||||
AutoCrit -> defaultAimMvType
|
||||
BarrelCrit {} -> defaultAimMvType
|
||||
|
||||
@@ -52,12 +52,14 @@ basicCrShape cr
|
||||
rotmdir = rotateSH (_crMvDir cr - _crDir cr)
|
||||
|
||||
drawHoverCrit :: Creature -> Shape
|
||||
drawHoverCrit cr = colorSH (_skinUpper cskin)
|
||||
(overPosSH (Q.apply tpq) $ upperBoxHalf Medium Typical 2 $ square 5)
|
||||
drawHoverCrit cr = colorSH (_skinHead cskin)
|
||||
(overPosSH (Q.apply tpq) $ upperBoxHalf Medium Typical 1 $ square 4)
|
||||
<> colorSH (_skinUpper cskin)
|
||||
(mconcat [overPosSH (Q.apply $ f a) $ upperBox Medium Typical 1 $ polyCirc 3 5 | a <- [0,pi/2,pi,1.5*pi]])
|
||||
where
|
||||
cskin = crShape $ _crType cr
|
||||
z = cr ^?! crStance . carriage . flyHeight
|
||||
tpq = (V3 0 0 z, Q.qid)
|
||||
f a = tpq `Q.comp` (1 & _xy .~ rotateV a 5, Q.qid)
|
||||
tpq = (V3 0 0 0, Q.qid)
|
||||
|
||||
drawChaseCrit :: Creature -> Shape
|
||||
drawChaseCrit cr = mconcat
|
||||
|
||||
@@ -48,7 +48,11 @@ doDamage cid w = fromMaybe w $ do
|
||||
-- TODO generalise shake to arbitrary damage amounts
|
||||
applyPastDamages :: Creature -> World -> World
|
||||
applyPastDamages cr w
|
||||
| HoverCrit {} <- cr ^. crType = w
|
||||
| HoverCrit {} <- cr ^. crType
|
||||
, _crPain cr > 50 = w
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crPain -~ 50
|
||||
& cWorld . lWorld . creatures . ix (_crID cr) . crPos . _z %~ max 12 . (subtract 1)
|
||||
| HoverCrit {} <- cr ^. crType = w
|
||||
| _crPain cr > 200 = dojitter 3 100
|
||||
| _crPain cr > 20 = dojitter 2 10
|
||||
| _crPain cr > 0 = dojitter 1 1
|
||||
|
||||
@@ -22,8 +22,12 @@ updateCarriage cid w
|
||||
Nothing
|
||||
& over (cWorld . lWorld . creatures . ix cid . crStance . carriage) resetStride
|
||||
| Just cr <- w ^? cWorld . lWorld . creatures . ix cid
|
||||
, Flying _ x oop <- cr ^. crStance . carriage =
|
||||
, z <- cr ^. crPos . _z
|
||||
, Flying dz x oop <- cr ^. crStance . carriage =
|
||||
w & cWorld . lWorld . creatures . ix cid . crPos . _xy +~ x *^ f (cr ^. crOldPos . _xy - oop)
|
||||
& cWorld . lWorld . creatures . ix cid . crPos . _z +~ dz
|
||||
& cWorld . lWorld . creatures . ix cid . crStance . carriage . zSpeed
|
||||
%~ if z < 17 then min 0.05 . (+0.001) else max (-0.05) . (subtract 0.001)
|
||||
| otherwise = w
|
||||
where
|
||||
-- limits max speed gained through inertia
|
||||
|
||||
Reference in New Issue
Block a user