Refactor, try to limit dependencies
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
{- | Not a good name, perhaps: internal creature actions. -}
|
||||
module Dodge.Creature.Volition
|
||||
( holsterWeapon
|
||||
, drawWeapon
|
||||
, shootTillEmpty
|
||||
-- , fleeFrom
|
||||
, shootFirstMiss
|
||||
) where
|
||||
import Dodge.Data
|
||||
-- | Not a good name, perhaps: internal creature actions.
|
||||
module Dodge.Creature.Volition (
|
||||
holsterWeapon,
|
||||
drawWeapon,
|
||||
shootTillEmpty,
|
||||
shootFirstMiss,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Data.CreatureEffect
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Geometry
|
||||
|
||||
@@ -14,24 +15,24 @@ holsterWeapon, drawWeapon :: Action
|
||||
holsterWeapon = DoImpulses [ChangePosture AtEase, MakeSound whiteNoiseFadeOutS]
|
||||
drawWeapon = DoImpulses [ChangePosture Aiming, MakeSound whiteNoiseFadeInS]
|
||||
|
||||
|
||||
shootTillEmpty :: Action
|
||||
--shootTillEmpty = (crCanShoot `DoActionWhile` DoImpulses [UseItem])
|
||||
shootTillEmpty = (WdCrBlfromCrBl CrCanShoot `DoActionWhile` DoImpulses [UseItem])
|
||||
`DoActionThen` 20 `WaitThen` holsterWeapon
|
||||
shootTillEmpty =
|
||||
(WdCrBlfromCrBl CrCanShoot `DoActionWhile` DoImpulses [UseItem])
|
||||
`DoActionThen` 20 `WaitThen` holsterWeapon
|
||||
|
||||
--advanceShoot :: Int -> Action
|
||||
--advanceShoot tcid = lostest `DoActionWhile`
|
||||
-- advanceShoot' `DoActionThen`
|
||||
-- 75 `DoReplicate`
|
||||
-- 75 `DoReplicate`
|
||||
-- advanceShoot'
|
||||
-- where
|
||||
-- lostest (w,cr) = canSee (_crID cr) tcid w
|
||||
-- lostest (w,cr) = canSee (_crID cr) tcid w
|
||||
-- advanceShoot' = ImpulsesList [[UseItem, MoveForward 3]]
|
||||
|
||||
shootFirstMiss :: Action
|
||||
shootFirstMiss =
|
||||
LeadTarget (V2 30 50) `DoActionThen`
|
||||
DoImpulses [UseItem] `DoActionThen`
|
||||
(WdCrBlfromCrBl CrCanShoot `DoActionWhile` DoActions [LeadTarget (V2 0 0),DoImpulses [UseItem]])
|
||||
`DoActionThen` 20 `WaitThen` holsterWeapon
|
||||
LeadTarget (V2 30 50)
|
||||
`DoActionThen` DoImpulses [UseItem]
|
||||
`DoActionThen` (WdCrBlfromCrBl CrCanShoot `DoActionWhile` DoActions [LeadTarget (V2 0 0), DoImpulses [UseItem]])
|
||||
`DoActionThen` 20 `WaitThen` holsterWeapon
|
||||
|
||||
Reference in New Issue
Block a user