This commit is contained in:
2022-07-13 22:22:24 +01:00
parent 33e9b5b1f0
commit 35a1eb9732
18 changed files with 89 additions and 69 deletions
+25 -9
View File
@@ -1,10 +1,12 @@
module Dodge.Item.Equipment
( module Dodge.Item.Equipment.Booster
, torch
, magShield
, powerLegs
, flatShield
, wristInvisibility
, wristArmour
, hat
, brainHat
, frontArmour
, headLamp
@@ -19,7 +21,6 @@ import Dodge.Item.Draw
import Dodge.Item.Equipment.Booster
import Dodge.LightSource
import Dodge.Default
import Dodge.Default.Wall
import Dodge.Creature.Test
import Dodge.Creature.HandPos
import Dodge.Wall
@@ -105,13 +106,22 @@ setWristShieldPos itm cr w = w
| otherwise = id
f = (+.+ _crPos cr) . stripZ . rotate3 (_crDir cr) . handtrans cr
torch :: Item
torch = defaultWeapon
& itEffect .~ effectOnOffHeld createHeldLight (const $ const id)
createHeldLight :: Creature -> Int -> World -> World
createHeldLight cr i w = w
removeHeldLight :: Creature -> Int -> World -> World
removeHeldLight cr i w = w
flatShield :: Item
flatShield = defaultEquipment
{ _itEffect = effectOnOffHeld createShieldWall removeShieldWall
flatShield = defaultWeapon
& itEffect .~ effectOnOffHeld createShieldWall removeShieldWall
-- the above seems to work, but I am not sure why: it may break on edge
-- cases
, _itUse = RightUse
& itUse .~ defaultrUse
{ _rUse = \_ _ -> id
, _useDelay = NoDelay
, _useMods = []
@@ -126,9 +136,8 @@ flatShield = defaultEquipment
}
, _heldScroll = \_ _ -> id
}
, _itInvSize = 3
}
& itType . iyBase .~ EQUIP FLATSHIELD
& itInvSize .~ 3
& itType . iyBase .~ HELD FLATSHIELD
shieldWall :: Int -> Wall
shieldWall crid = defaultWall
@@ -184,9 +193,9 @@ effectOnOffHeld f f' = ItInvEffectID
, _ieMID = Nothing
}
where
g itm cr w
g itm cr w
| crSel cr == invid = f cr invid w
| otherwise = f' cr invid w
| otherwise = f' cr invid w
where
invid = _ipInvID $ _itPos itm
@@ -205,6 +214,13 @@ brainHat = defaultEquipment
}
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP BRAINHAT
hat :: Item
hat = defaultEquipment
{ _itEffect = NoItEffect
, _itID = Nothing
}
& itUse . eqEq . eqSite .~ GoesOnHead
& itType . iyBase .~ EQUIP HAT
headLamp1 :: Item
headLamp1 = defaultEquipment