Move function fields outside equipment

This commit is contained in:
2022-07-20 20:40:13 +01:00
parent e9f0130013
commit 845c1f282e
14 changed files with 87 additions and 29 deletions
+15 -8
View File
@@ -15,6 +15,13 @@ module Dodge.Item.Equipment
, speedLegs
, jumpLegs
, flameShield
, useMagShield
, setWristShieldPos
, createHeadLamp
, overCID
, onEquipWristShield
, onRemoveWristShield
) where
import Dodge.Data
import Dodge.LightSource.Torch
@@ -38,7 +45,7 @@ magShield = defaultEquipment
{ _itID = Nothing
, _itAttachment = AttachMInt Nothing
}
& itUse . eqEq . eqUse .~ useMagShield
& itUse . eqEq . eqUse .~ EMagShield --useMagShield
& itUse . eqEq . eqSite .~ GoesOnWrist
& itType . iyBase .~ EQUIP MAGSHIELD
useMagShield :: Item -> Creature -> World -> World
@@ -73,9 +80,9 @@ wristArmour = defaultEquipment
{_itID = Nothing
}
& itUse . eqEq . eqSite .~ GoesOnWrist
& itUse . eqEq . eqOnEquip .~ onEquipWristShield
& itUse . eqEq . eqUse .~ setWristShieldPos
& itUse . eqEq . eqOnRemove .~ onRemoveWristShield
& itUse . eqEq . eqOnEquip .~ EonWristShield --onEquipWristShield
& itUse . eqEq . eqUse .~ EWristShield --setWristShieldPos
& itUse . eqEq . eqOnRemove .~ EoffWristShield --onRemoveWristShield
& itType . iyBase .~ EQUIP WRISTARMOUR
onEquipWristShield :: Item -> Creature -> World -> World
@@ -232,7 +239,7 @@ headLamp1 = defaultEquipment
{ _itEffect = NoItEffect
, _itID = Nothing
}
& itUse . eqEq . eqUse .~ createHeadLamp
& itUse . eqEq . eqUse .~ EHeadLamp --createHeadLamp
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP HEADLAMP1
headLamp :: Item
@@ -240,7 +247,7 @@ headLamp = defaultEquipment
{ _itEffect = NoItEffect
, _itID = Nothing
}
& itUse . eqEq . eqUse .~ createHeadLamp
& itUse . eqEq . eqUse .~ EHeadLamp --createHeadLamp
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP HEADLAMP
@@ -268,8 +275,8 @@ wristInvisibility = defaultEquipment
{ _itID = Nothing
}
& itUse . eqEq . eqSite .~ GoesOnWrist
& itUse . eqEq . eqOnEquip .~ overCID (crCamouflage .~ Invisible)
& itUse . eqEq . eqOnRemove .~ overCID (crCamouflage .~ FullyVisible)
& itUse . eqEq . eqOnEquip .~ ECamouflage Invisible --overCID (crCamouflage .~ Invisible)
& itUse . eqEq . eqOnRemove .~ ECamouflage FullyVisible --overCID (crCamouflage .~ FullyVisible)
& itType . iyBase .~ EQUIP (INVISIBILITYEQUIPMENT GoesOnWrist)
overCID :: (Creature -> Creature) -> Item -> Creature -> World -> World