Tweak hover crit height

This commit is contained in:
2026-04-03 00:10:59 +01:00
parent 06c7e89dee
commit 8037c69d16
8 changed files with 72 additions and 60 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+6 -4
View File
@@ -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
+5 -1
View File
@@ -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
+5 -1
View File
@@ -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
+1 -1
View File
@@ -21,7 +21,7 @@ data Stance = Stance
data Carriage
= Walking {_strideAmount :: Float, _footForward :: FootForward}
| Floating
| Flying {_flyHeight :: Float, _flyInertia :: Float, _oldOldPos :: Point2}
| Flying {_zSpeed :: Float, _flyInertia :: Float, _oldOldPos :: Point2}
| Boosting Point2
| Falling {_fallFlail :: Float, _fallFoot :: FootForward}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
+8 -6
View File
@@ -35,12 +35,14 @@ import Data.Monoid
import RandomHelp
testStringInit :: Universe -> [String]
testStringInit u = [show p, show op, show oop, show (op - oop), show . norm $ op - oop]
where
f = fromMaybe 0
p = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crPos . _xy
op = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crOldPos . _xy
oop = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crStance . carriage . oldOldPos
testStringInit u = u ^.. uvWorld . cWorld . lWorld . creatures . each . crPos . _z . to show
-- u = [show p, show op, show oop, show (op - oop), show . norm $ op - oop, show d]
-- where
-- f = fromMaybe 0
-- p = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crPos . _xy
-- op = f $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crOldPos . _xy
-- oop = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crStance . carriage . oldOldPos
-- d = fromMaybe 0 $ u ^? uvWorld . cWorld . lWorld . creatures . ix 2 . crDir
-- fmap show (u ^.. uvWorld . cWorld . lWorld . creatures . ix 0 . crWallTouch . each)
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage)
-- (fmap show $ u ^.. uvWorld . cWorld . lWorld . creatures . each . crStance . carriage . strideAmount)