This commit is contained in:
2022-07-27 12:49:23 +01:00
parent 6554d219dc
commit 8d17ce66e9
106 changed files with 2911 additions and 2678 deletions
+4 -24
View File
@@ -5,31 +5,24 @@ module Dodge.Item
, module Dodge.Item.PassKey
, module Dodge.Item.Craftable
, itemFromBase
, baseToFamily
) where
import Dodge.Data
import Dodge.Item.Weapon
import Dodge.Item.Equipment
import Dodge.Item.Consumable
import Dodge.Item.PassKey
import Dodge.Item.Family
import Dodge.Item.Craftable
-- this is not ideal, should fold the itemtype into a stackable/unstackable type
itemFromBase :: ItemBaseType -> Item
itemFromBase ibt = case ibt of
NOTDEFINED -> error "cannot create undefined item"
EFFGUN _ -> undefined
AUTOEFFGUN _ -> undefined
-- Weapons
HELD ht -> itemFromHeldType ht
LEFT lt -> itemFromLeftType lt
EQUIP et -> itemFromEquipType et
--GRENADE
--REMOTEBOMB
-- Utility items
Consumable et -> itemFromConsumableType et
CRAFT cr -> makeTypeCraft cr
KEYCARD i -> keyCard i
itemFromConsumableType :: ConsumableItemType -> Item
itemFromConsumableType ct = case ct of
MEDKIT i -> medkit i
itemFromEquipType :: EquipItemType -> Item
itemFromEquipType et = case et of
@@ -59,6 +52,7 @@ itemFromLeftType lt = case lt of
-- Equipment
itemFromHeldType :: HeldItemType -> Item
itemFromHeldType ht = case ht of
KEYCARD i -> keyCard i
TORCH -> torch
SHATTERGUN -> shatterGun
BANGSTICK i -> bangStick i
@@ -118,17 +112,3 @@ itemFromHeldType ht = case ht of
HELDDETECTOR d -> clickDetector d
FLATSHIELD -> flatShield
baseToFamily :: ItemBaseType -> ItemFamily
baseToFamily ibt = case ibt of
NOTDEFINED -> undefined
EFFGUN _ -> undefined
AUTOEFFGUN _ -> undefined
HELD _ -> HeldFamily
LEFT _ -> LeftClickFamily
EQUIP _ -> EquipmentFamily
CRAFT _ -> CraftingFamily
KEYCARD _ -> HeldFamily
MEDKIT _ -> ConsumableFamily