AI refactor
This commit is contained in:
+22
-14
@@ -6,6 +6,9 @@ module Dodge.Creature
|
||||
import Dodge.Creature.Stance.Data
|
||||
import Dodge.Creature.State.Data
|
||||
import Dodge.Creature.Impulse.Data
|
||||
import Dodge.Creature.ImpulseRat
|
||||
import Dodge.Creature.ActionRat
|
||||
import Dodge.Creature.Rationality.Data
|
||||
import Dodge.Data
|
||||
import Dodge.AIs
|
||||
import Dodge.Default
|
||||
@@ -18,6 +21,7 @@ import Dodge.Creature.Inanimate
|
||||
import Dodge.Creature.State
|
||||
import Dodge.Creature.Picture
|
||||
import Dodge.Creature.Rationality
|
||||
import Dodge.Creature.ChooseTarget
|
||||
import Dodge.Item
|
||||
import Dodge.Picture.Layer
|
||||
import Dodge.Creature.Picture
|
||||
@@ -53,7 +57,7 @@ spawnerCrit = defaultCreature
|
||||
}
|
||||
smallChaseCrit :: Creature
|
||||
smallChaseCrit = defaultCreature
|
||||
{ _crUpdate = stateUpdate chaseAI
|
||||
{ _crUpdate = stateUpdate $ meleeCooldown $ impulsiveAI $ chaseTarget targetYouLOS
|
||||
, _crHP = 1
|
||||
, _crRad = 4
|
||||
, _crPict = basicCrPict green
|
||||
@@ -66,18 +70,7 @@ smallChaseCrit = defaultCreature
|
||||
}
|
||||
chaseCrit :: Creature
|
||||
chaseCrit = defaultCreature
|
||||
{ _crUpdate = stateUpdate $ impulsiveAI $ applyBasicImpulse
|
||||
, _crHP = 300
|
||||
, _crPict = basicCrPict green
|
||||
, _crState = defaultState
|
||||
{_goals = [[Wait]]
|
||||
,_faction = ChaseCritters
|
||||
}
|
||||
, _crInv = IM.empty
|
||||
}
|
||||
chaseCrit' :: Creature
|
||||
chaseCrit' = defaultCreature
|
||||
{ _crUpdate = stateUpdate chaseAI
|
||||
{ _crUpdate = stateUpdate $ meleeCooldown $ impulsiveAI $ chaseTarget targetYouLOS
|
||||
, _crHP = 300
|
||||
, _crPict = basicCrPict green
|
||||
, _crState = defaultState
|
||||
@@ -85,10 +78,11 @@ chaseCrit' = defaultCreature
|
||||
,_faction = ChaseCritters
|
||||
}
|
||||
, _crInv = IM.empty
|
||||
, _crMeleeCooldown = Just 0
|
||||
}
|
||||
armourChaseCrit :: Creature
|
||||
armourChaseCrit = defaultCreature
|
||||
{ _crUpdate = stateUpdate chaseAI
|
||||
{ _crUpdate = stateUpdate $ meleeCooldown $ impulsiveAI $ chaseTarget targetYouLOS
|
||||
, _crHP = 300
|
||||
, _crPict = basicCrPict green
|
||||
, _crState = defaultState {_goals = [[Wait]]}
|
||||
@@ -97,6 +91,20 @@ armourChaseCrit = defaultCreature
|
||||
,(1,medkit 200)
|
||||
]
|
||||
}
|
||||
miniGunCrit' :: Creature
|
||||
miniGunCrit' = defaultCreature
|
||||
{ _crPict = basicCrPict red
|
||||
, _crUpdate = stateUpdate $ impulsiveAI $ actionUpdateAI $ shootAtTarget targetYouLOS
|
||||
, _crInv = IM.fromList [(0,miniGun)]
|
||||
, _crInvSel = 0
|
||||
, _crRad = 10
|
||||
, _crState = defaultState
|
||||
, _crHP = 500
|
||||
, _crRationality = ActionRat
|
||||
{ _crImpulse = []
|
||||
, _crAction = [AimAtCloseSlow 0 (0,0) 0.05 0.2 (pi/4) ]
|
||||
}
|
||||
}
|
||||
miniGunCrit :: Creature
|
||||
miniGunCrit = defaultCreature
|
||||
{ _crPict = basicCrPict red
|
||||
|
||||
Reference in New Issue
Block a user