Cleanup UseEquip constructor
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
|||||||
All good (602 modules, at 10:06:36)
|
All good (602 modules, at 10:15:11)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ itemUseEffect cr it w = case it ^. ldtValue . itUse of
|
|||||||
UseHeld{} -> heldEffect it cr w
|
UseHeld{} -> heldEffect it cr w
|
||||||
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
& pointerToItem itm . itUse . heldHammer .~ HammerDown
|
||||||
UseHotkey{} -> doequipmentchange
|
UseHotkey{} -> doequipmentchange
|
||||||
EquipUse{} -> doequipmentchange
|
UseEquip{} -> doequipmentchange
|
||||||
(UseConsume eff) -> useC eff (_ldtValue it) cr w
|
(UseConsume eff) -> useC eff (_ldtValue it) cr w
|
||||||
CraftUse{} -> w
|
CraftUse{} -> w
|
||||||
UseAttach{} -> selectUse it cr w
|
UseAttach{} -> selectUse it cr w
|
||||||
@@ -105,7 +105,7 @@ useItemLeftClick cr w = fromMaybe w $ do
|
|||||||
case ituse of
|
case ituse of
|
||||||
UseHeld{} -> return w
|
UseHeld{} -> return w
|
||||||
UseConsume{} -> return $ useItemLeftClick' cr w
|
UseConsume{} -> return $ useItemLeftClick' cr w
|
||||||
EquipUse{} -> return $ useItemLeftClick' cr w
|
UseEquip{} -> return $ useItemLeftClick' cr w
|
||||||
UseHotkey{} -> return $ useItemLeftClick' cr w
|
UseHotkey{} -> return $ useItemLeftClick' cr w
|
||||||
UseAmmoMag{} -> return w
|
UseAmmoMag{} -> return w
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import Dodge.Item.HeldOffset
|
|||||||
import Dodge.LightSource
|
import Dodge.LightSource
|
||||||
import Dodge.Prop.Gib
|
import Dodge.Prop.Gib
|
||||||
import Dodge.SoundLogic
|
import Dodge.SoundLogic
|
||||||
--import Dodge.WorldEvent.Flash
|
|
||||||
import Dodge.Zoning.Creature
|
import Dodge.Zoning.Creature
|
||||||
import FoldableHelp
|
import FoldableHelp
|
||||||
import Geometry
|
import Geometry
|
||||||
@@ -72,16 +71,14 @@ stateUpdate f =
|
|||||||
]
|
]
|
||||||
|
|
||||||
checkDeath :: Creature -> World -> World
|
checkDeath :: Creature -> World -> World
|
||||||
checkDeath cr w
|
checkDeath cr
|
||||||
| _crHP cr > 0 =
|
| _crHP cr > 0 =
|
||||||
w
|
cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
|
||||||
& cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage .~ []
|
|
||||||
| otherwise =
|
| otherwise =
|
||||||
w
|
dropByState cr
|
||||||
& dropByState cr
|
. removecr
|
||||||
& removecr
|
. stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
||||||
& stopSoundFrom (CrWeaponSound (_crID cr) 0)
|
. corpseOrGib cr
|
||||||
& corpseOrGib cr
|
|
||||||
where
|
where
|
||||||
removecr
|
removecr
|
||||||
| _crID cr == 0 =
|
| _crID cr == 0 =
|
||||||
|
|||||||
@@ -50,13 +50,9 @@ data ItemUse
|
|||||||
, _leftConsumption :: LeftConsumption
|
, _leftConsumption :: LeftConsumption
|
||||||
}
|
}
|
||||||
| UseConsume { _cUse :: Cuse }
|
| UseConsume { _cUse :: Cuse }
|
||||||
| EquipUse
|
| UseEquip { _uequipEffect :: EquipEffect }
|
||||||
{ _equipEffect :: EquipEffect
|
|
||||||
, _equipTargeting :: Maybe TargetingType
|
|
||||||
}
|
|
||||||
| CraftUse
|
| CraftUse
|
||||||
| UseAttach
|
| UseAttach {_uaParams :: AttachParams}
|
||||||
{_uaParams :: AttachParams}
|
|
||||||
| UseAmmoMag
|
| UseAmmoMag
|
||||||
{ _amagLoadStatus :: ReloadStatus
|
{ _amagLoadStatus :: ReloadStatus
|
||||||
, _amagParams :: AmmoParams
|
, _amagParams :: AmmoParams
|
||||||
|
|||||||
@@ -21,9 +21,8 @@ defaultLeftUse = UseHotkey
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultEquipUse :: ItemUse
|
defaultEquipUse :: ItemUse
|
||||||
defaultEquipUse = EquipUse
|
defaultEquipUse = UseEquip
|
||||||
{ _equipEffect = defaultEquip
|
{ _uequipEffect = defaultEquip
|
||||||
, _equipTargeting = Nothing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultHeldUse :: ItemUse
|
defaultHeldUse :: ItemUse
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ itemNumberDisplay :: Creature -> Item -> [String]
|
|||||||
itemNumberDisplay cr itm = case iu of
|
itemNumberDisplay cr itm = case iu of
|
||||||
UseHeld{} -> []
|
UseHeld{} -> []
|
||||||
UseHotkey{} -> [showAutoRechargeProgress (_leftConsumption iu)]
|
UseHotkey{} -> [showAutoRechargeProgress (_leftConsumption iu)]
|
||||||
EquipUse{} -> showEquipmentNumber cr itm
|
UseEquip{} -> showEquipmentNumber cr itm
|
||||||
CraftUse -> []
|
CraftUse -> []
|
||||||
UseConsume {} -> []
|
UseConsume {} -> []
|
||||||
UseAttach {} -> []
|
UseAttach {} -> []
|
||||||
|
|||||||
Reference in New Issue
Block a user