Refactoring and linting
This commit is contained in:
@@ -469,7 +469,7 @@ miniAI w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -588,7 +588,7 @@ strafeOrChargeAI inRange outRange w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -1103,7 +1103,7 @@ circleClockwiseAI inRange outRange w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -1200,7 +1200,7 @@ twitchMissAI inRange outRange w (f,g) cr =
|
||||
cid = _crID cr
|
||||
ypos = _crPos $ you w
|
||||
wp = _crInv cr IM.! _crInvSel cr
|
||||
fireRate = fromMaybe 0 $ wp ^? wpFireRate
|
||||
fireRate = fromMaybe 0 $ wp ^? itUseRate
|
||||
noAmmo = 0 == _wpLoadedAmmo wp
|
||||
strafeCloseSlow p | errorAngleVV 22 (p -.- cpos)
|
||||
(unitVectorAtAngle (_crDir cr)) < 0.1
|
||||
@@ -1299,7 +1299,7 @@ closeToRangeAI inRange outRange w (f,g) cr =
|
||||
cid = _crID cr
|
||||
ypos = _crPos $ you w
|
||||
wp = _crInv cr IM.! _crInvSel cr
|
||||
fireRate = fromMaybe 0 $ wp ^? wpFireRate
|
||||
fireRate = fromMaybe 0 $ wp ^? itUseRate
|
||||
(aimtime,g1) = randomR (80,120) g
|
||||
noAmmo = 0 == _wpLoadedAmmo wp
|
||||
strafeCloseSlow p | errorAngleVV 22 (p -.- cpos)
|
||||
@@ -1426,7 +1426,7 @@ suppressShooterAI w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -1530,7 +1530,7 @@ basicShooterAI w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -1633,7 +1633,7 @@ sniperAI w (f,g) cr =
|
||||
addAction newActions
|
||||
= Just . over (crState . goals) (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = Just
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
in --if _crHP cr <= 0 then killCr w f cr else
|
||||
case head $ _goals $ _crState cr of
|
||||
[] | canSeeFire cpos ypos w -> ( ( f , g1 )
|
||||
@@ -1735,7 +1735,7 @@ sniperAI w (f,g) cr =
|
||||
-- addAction newActions = over (creatures . ix cid . crState . goals)
|
||||
-- (\(as:ass) -> (newActions++as):ass)
|
||||
-- autoFireTweak p | _wpIsAuto wp = id
|
||||
-- | otherwise = replaceGoal [[AimAt p (_wpFireRate wp * 2)]]
|
||||
-- | otherwise = replaceGoal [[AimAt p (_itUseRate wp * 2)]]
|
||||
-- in if _crHP cr <= 0 then killCr cid w else
|
||||
-- case head $ _goals $ _crState cr of
|
||||
-- [] | canSeeAny cid (_yourID w) w
|
||||
|
||||
Reference in New Issue
Block a user