Allow for bullet drag
This commit is contained in:
@@ -106,8 +106,8 @@ creatureTurnToward p turnSpeed cr
|
||||
equipSpeed :: Item -> Float
|
||||
equipSpeed _ = 1
|
||||
{- | Speed modifier of an item when aiming. -}
|
||||
equipAimSpeed :: Item -> Float
|
||||
equipAimSpeed :: Item -> Float -- TODO remove/rethink
|
||||
equipAimSpeed it
|
||||
| _itIdentity it == FrontArmour = 0.5
|
||||
| _itIdentity it == FlameShield = 0.5
|
||||
| _itCombineType it == FRONTARMOUR = 0.5
|
||||
| _itCombineType it == FLAMESHIELD = 0.5
|
||||
| otherwise = 1
|
||||
|
||||
@@ -4,7 +4,7 @@ module Dodge.Creature.Impulse.UseItem
|
||||
, useLeftItem
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Inventory
|
||||
--import Dodge.Inventory
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Control.Lens
|
||||
@@ -22,7 +22,7 @@ tryUseItem cr' w = case w ^? creatures . ix (_crID cr') of
|
||||
Nothing -> w
|
||||
|
||||
itemEffect :: Creature -> Item -> World -> World
|
||||
itemEffect cr Consumable{_cnEffect=eff } w = maybe w (rmSelectedInvItem (_crID cr)) (eff (_crID cr) w)
|
||||
--itemEffect cr Consumable{_cnEffect=eff } w = maybe w (rmSelectedInvItem (_crID cr)) (eff (_crID cr) w)
|
||||
itemEffect cr it w = case it ^? itUse of
|
||||
Just RightUse {_rUse = eff,_useMods = usemods} -> foldr ($) eff usemods it cr w
|
||||
Just LeftUse {} -> w
|
||||
|
||||
@@ -11,7 +11,7 @@ import Control.Lens
|
||||
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
||||
crIsArmouredFrom p cr
|
||||
= p /= _crPos cr
|
||||
&& any (\it -> it ^? itIdentity == Just FrontArmour) (_crInv cr)
|
||||
&& any (\it -> it ^? itCombineType == Just FRONTARMOUR) (_crInv cr)
|
||||
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
|
||||
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ movementSideEff cr w
|
||||
_ -> w
|
||||
| otherwise = footstepSideEffect cr w
|
||||
where
|
||||
hasJetPack = any (\it -> it ^? itIdentity == Just JetPack) $ _crInv cr
|
||||
hasJetPack = any (\it -> it ^? itCombineType == Just JETPACK) $ _crInv cr
|
||||
oldPos = _crOldPos cr
|
||||
momentum' = 0.97 *.* (_crPos cr -.- _crOldPos cr)
|
||||
momentum'' | magV momentum' > 3 = 3 *.* normalizeV momentum'
|
||||
@@ -158,6 +158,7 @@ weaponReloadSounds cr w = case cr ^? crInv . ix (_crInvSel cr) . itConsumption o
|
||||
ActivePartial{} | _reloadState am == Nothing' -> w
|
||||
ActivePartial{} -> soundContinue (CrReloadSound cid) (_crPos cr) reloadS (Just 1) w
|
||||
Just ChargeableAmmo {} -> w
|
||||
Just NoConsumption {} -> w
|
||||
Just ItemItselfConsumable {} -> w
|
||||
Nothing -> w
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user