Add file
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
module Dodge.Creature.MoveType (crMvType) where
|
||||
|
||||
import Dodge.Data.FloatFunction
|
||||
import Dodge.Data.Creature
|
||||
|
||||
crMvType :: Creature -> CrMvType
|
||||
crMvType cr = case _crType cr of
|
||||
Avatar {_avMoveSpeed = s} -> MvWalking s
|
||||
AvatarDead -> defaultAimMvType
|
||||
ChaseCrit {} -> defaultChaseMvType
|
||||
SwarmCrit -> defaultChaseMvType
|
||||
AutoCrit -> defaultAimMvType
|
||||
BarrelCrit {} -> defaultAimMvType
|
||||
LampCrit {} -> defaultAimMvType
|
||||
|
||||
defaultAimMvType :: CrMvType
|
||||
defaultAimMvType =
|
||||
CrMvType
|
||||
{ _mvSpeed = 3
|
||||
, _mvTurnRad = FloatConst 0.2
|
||||
, _mvTurnJit = 0.05
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi / 8) 0.2 0.01
|
||||
}
|
||||
|
||||
defaultChaseMvType :: CrMvType
|
||||
defaultChaseMvType =
|
||||
CrMvType
|
||||
{ _mvSpeed = 2
|
||||
, _mvTurnRad = FloatAbsCheckGreaterLess (pi / 4) 0.2 0.05
|
||||
, _mvTurnJit = 0.2
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi / 8) 0.2 0.01
|
||||
}
|
||||
Reference in New Issue
Block a user