Improve frontArmour equipment
This commit is contained in:
@@ -6,7 +6,7 @@ import Dodge.Data
|
||||
import Dodge.Inventory
|
||||
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.IntSet as IS
|
||||
--import qualified Data.IntSet as IS
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
|
||||
@@ -68,29 +68,6 @@ eqSiteToPos cr es = case es of
|
||||
Nothing -> OnLeftWrist
|
||||
_ -> OnRightWrist
|
||||
|
||||
removeEquipmentUsingSite :: EquipSite -> Creature -> Creature
|
||||
removeEquipmentUsingSite esite cr = case esite of
|
||||
GoesOnSpecial -> cr
|
||||
_ -> case cr ^? crEquipment . esiteToPoint of
|
||||
Just invid -> cr & crInvEquipped . at invid .~ Nothing
|
||||
_ -> cr
|
||||
where
|
||||
esiteToPoint = case esite of
|
||||
GoesOnHead -> ix OnHead
|
||||
GoesOnChest -> ix OnChest
|
||||
GoesOnBack -> ix OnBack
|
||||
GoesOnWrist -> ix OnLeftWrist
|
||||
GoesOnLegs -> ix OnLegs
|
||||
|
||||
setEquipmentSite :: EquipSite -> Maybe Int -> Creature -> Creature
|
||||
setEquipmentSite esite = case esite of
|
||||
GoesOnHead -> set (crEquipment . at OnHead)
|
||||
GoesOnChest -> set (crEquipment . at OnChest)
|
||||
GoesOnBack -> set (crEquipment . at OnBack)
|
||||
GoesOnWrist -> set (crEquipment . at OnLeftWrist)
|
||||
GoesOnLegs -> set (crEquipment . at OnLegs)
|
||||
GoesOnSpecial -> const id
|
||||
|
||||
useLeftItem :: Int -> World -> World
|
||||
useLeftItem cid w
|
||||
| _crInvLock cr = w
|
||||
|
||||
Reference in New Issue
Block a user