Major item refactor, still broken
This commit is contained in:
@@ -42,8 +42,8 @@ followImpulse cr w imp = case imp of
|
||||
let (newimp, newgen) = runState (doRandImpulse rimp) (_randGen w)
|
||||
in first ((randGen .~ newgen) .) $ followImpulse cr w newimp
|
||||
Bark sid -> (soundStart (CrMouth cid) cpos sid Nothing, resetCrVocCoolDown w cr)
|
||||
Move p -> crup $ crMvBy p cr
|
||||
MoveForward x -> crup $ crMvForward x cr
|
||||
Move p -> crup $ crMvBy p (w ^. cWorld . lWorld) cr
|
||||
MoveForward x -> crup $ crMvForward x (w ^. cWorld . lWorld) cr
|
||||
Turn a -> crup $ cr & crDir +~ a
|
||||
TurnToward p a -> crup $ creatureTurnToward p a cr
|
||||
TurnTo p -> crup $ creatureTurnTo p cr
|
||||
@@ -54,7 +54,7 @@ followImpulse cr w imp = case imp of
|
||||
SwitchToItem i -> crup $ cr & crManipulation . manObject .~ SelectedItem i i mempty
|
||||
Melee cid' ->
|
||||
( hitCr cid'
|
||||
, crMvAbsolute (10 *.* normalizeV (posFromID cid' -.- cpos)) $ cr & crType . meleeCooldown .~ 20
|
||||
, crMvAbsolute (w ^. cWorld . lWorld) (10 *.* normalizeV (posFromID cid' -.- cpos)) $ cr & crType . meleeCooldown .~ 20
|
||||
)
|
||||
RandomTurn a -> (randGen .~ snd (rr a), cr & crDir +~ fst (rr a))
|
||||
MakeSound sid -> (soundStart (CrSound (_crID cr)) (_crPos cr) sid Nothing, cr)
|
||||
@@ -71,7 +71,7 @@ followImpulse cr w imp = case imp of
|
||||
Just tcr -> followImpulse cr w (doCrImp f tcr)
|
||||
_ -> crup cr
|
||||
ImpulseUseAheadPos f -> followImpulse cr w (doP2Imp f (_crPos cr +.+ 20 *.* unitVectorAtAngle (_crDir cr)))
|
||||
MvForward -> crup $ crMvForward speed cr
|
||||
MvForward -> crup $ crMvForward speed (w ^. cWorld . lWorld) cr
|
||||
MvTurnToward p ->
|
||||
crup $
|
||||
creatureTurnToward p (turnRad $ safeAngleVV (p -.- cpos) (unitVectorAtAngle cdir)) cr
|
||||
|
||||
Reference in New Issue
Block a user