Remove creature records

This commit is contained in:
2025-06-06 13:36:18 +01:00
parent 73c79f2f4d
commit 0f55257bff
48 changed files with 621 additions and 610 deletions
+25 -26
View File
@@ -9,10 +9,11 @@ module Dodge.Creature.Action (
blinkActionMousePos,
blinkActionFail,
unsafeBlinkAction,
sizeSelf,
-- sizeSelf,
youDropItem,
) where
import Dodge.Creature.Radius
import Dodge.Item.BackgroundEffect
import Control.Applicative
import Control.Monad
@@ -23,13 +24,11 @@ import Dodge.Creature.Action.Blink
import Dodge.CreatureEffect
--import Dodge.Data.SelectionList
import Dodge.Data.World
import Dodge.Default
import Dodge.FloatFunction
import Dodge.FloorItem
import Dodge.Inventory
import Dodge.Path
import Dodge.SoundLogic
import Dodge.WallCreatureCollisions
import Geometry
import qualified IntMapHelp as IM
import LensHelp
@@ -59,7 +58,7 @@ performAimAt cr w tcid p = ([TurnToward tpos aimSp], Just $ AimAt tcid tpos)
performPathTo :: Creature -> World -> Point2 -> OutAction
performPathTo cr w p
| dist cpos p <= _crRad cr = ([], Nothing)
| dist cpos p <= crRad (cr ^. crType) = ([], Nothing)
| isWalkable cpos p w = ([MvTurnToward p, MvForward, RandomTurn jit], Just (PathTo p))
| otherwise = case pointTowardsImpulse p cpos w of
Just q ->
@@ -204,25 +203,25 @@ youDropItem w = fromMaybe w $ do
throwItem :: World -> World
throwItem = id
sizeSelf :: Float -> Creature -> World -> Maybe World
sizeSelf x cr w
| not (crOnWall cr1 w) =
Just $
w
& soundMultiFrom [TeleSound 0, TeleSound 1] cpos teleS Nothing
& cWorld . lWorld . distortions .:~ distortionBulge
& cWorld . lWorld . creatures . ix cid
%~ ( (crRad .~ 10 * x)
. (crMvType . mvSpeed .~ yourDefaultSpeed * x)
. (crStance . strideLength .~ ceiling (fromIntegral yourDefaultStrideLength * x))
)
| otherwise = Nothing
where
cr1 = colCrWall w (cr{_crRad = 10 * x})
distR = 120
distortionBulge
| _crRad cr < 10 * x = raddist 1.9
| otherwise = raddist 0.1
raddist = RadialDistortion cpos (cpos +.+ V2 distR 0) (cpos +.+ V2 0 distR)
cid = _crID cr
cpos = _crPos cr
--sizeSelf :: Float -> Creature -> World -> Maybe World
--sizeSelf x cr w
-- | not (crOnWall cr1 w) =
-- Just $
-- w
-- & soundMultiFrom [TeleSound 0, TeleSound 1] cpos teleS Nothing
-- & cWorld . lWorld . distortions .:~ distortionBulge
-- & cWorld . lWorld . creatures . ix cid
-- %~ ( (crRad .~ 10 * x)
-- . (crMvType . mvSpeed .~ yourDefaultSpeed * x)
-- . (crStance . strideLength .~ ceiling (fromIntegral yourDefaultStrideLength * x))
-- )
-- | otherwise = Nothing
-- where
-- cr1 = colCrWall w (cr{_crRad = 10 * x})
-- distR = 120
-- distortionBulge
-- | _crRad cr < 10 * x = raddist 1.9
-- | otherwise = raddist 0.1
-- raddist = RadialDistortion cpos (cpos +.+ V2 distR 0) (cpos +.+ V2 0 distR)
-- cid = _crID cr
-- cpos = _crPos cr