Make items recoverable from base type

This commit is contained in:
2022-06-14 22:09:26 +01:00
parent f3e1a34164
commit 485c42eb24
15 changed files with 537 additions and 241 deletions
+17 -12
View File
@@ -1,7 +1,23 @@
module Dodge.Item.Equipment where
module Dodge.Item.Equipment
( module Dodge.Item.Equipment.Booster
, magShield
, powerLegs
, flatShield
, wristInvisibility
, wristArmour
, brainHat
, frontArmour
, headLamp
, headLamp1
, jetPack
, speedLegs
, jumpLegs
, flameShield
) where
import Dodge.Data
import Dodge.Item.Draw
import Dodge.Item.Equipment.Shape
import Dodge.Item.Equipment.Booster
import Dodge.LightSource
import Dodge.Default
import Dodge.Default.Wall
@@ -134,17 +150,6 @@ flatShieldEquipSPic _ =
( colorSH yellow $ upperPrismPoly 10 (rectWH 2 10)
, mempty
)
effectOnEquip :: (Creature -> Item -> World -> World) -> ItEffect
effectOnEquip f = ItInvEffectID
{ _ieInv = g f
, _ieMID = Nothing
}
where
g f' itm cr w
| _crInvSel cr == invid = f' cr (_crInv (_creatures w IM.! _crID cr) IM.! invid) w
| otherwise = w
where
invid = fromJust $ _itInvPos itm
shieldWall :: Int -> Wall
shieldWall crid = defaultWall