diff --git a/src/Dodge/Creature.hs b/src/Dodge/Creature.hs index 5d4ad2d84..90d1220ff 100644 --- a/src/Dodge/Creature.hs +++ b/src/Dodge/Creature.hs @@ -176,10 +176,10 @@ startInventory = IM.fromList (zip [0..20] ,blinkGun ,miniGun ,bezierGun - ,multGun +-- ,multGun ,boosterGun ,remoteLauncher - ,remoteBomb + ,flatShield ,grenade ,spawnGun (lamp 5) ,lasGun diff --git a/src/Dodge/Creature/Inanimate.hs b/src/Dodge/Creature/Inanimate.hs index 6dfc93b05..0bdec8f90 100644 --- a/src/Dodge/Creature/Inanimate.hs +++ b/src/Dodge/Creature/Inanimate.hs @@ -9,7 +9,6 @@ module Dodge.Creature.Inanimate , explosiveBarrel ) where import Dodge.Data -import Dodge.Data.DamageType import Dodge.WorldEvent.Explosion import Dodge.Creature.Picture --import Dodge.Creature.Stance.Data diff --git a/src/Dodge/Creature/State.hs b/src/Dodge/Creature/State.hs index a27c710f4..9f7b82f3b 100644 --- a/src/Dodge/Creature/State.hs +++ b/src/Dodge/Creature/State.hs @@ -3,7 +3,6 @@ module Dodge.Creature.State , doDamage ) where import Dodge.Data -import Dodge.Data.DamageType import Dodge.Data.SoundOrigin import Dodge.Item.Data import Dodge.Creature.State.Data diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index fcd0b420d..3f5c33999 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -288,8 +288,6 @@ data Item , _wpRange :: Float , _itHammer :: HammerPosition , _itFloorPict :: Item -> SPic - , _itMaxStack :: Int - , _itAmount :: Int , _itAimingSpeed :: Float , _itAimingRange :: Float , _itZoom :: ItZoom @@ -337,8 +335,6 @@ data Item } | Equipment { _itName :: String - , _itMaxStack :: Int - , _itAmount :: Int , _itFloorPict :: Item -> SPic , _itEquipPict :: Creature -> Int -> SPic , _itIdentity :: ItemIdentity @@ -572,6 +568,7 @@ data MachineType | Turret { _tuWeapon :: Item , _tuTurnSpeed :: Float + , _tuFiring :: Bool } data Door = Door { _drID :: Int diff --git a/src/Dodge/Default.hs b/src/Dodge/Default.hs index 975df7861..248972f5f 100644 --- a/src/Dodge/Default.hs +++ b/src/Dodge/Default.hs @@ -129,8 +129,6 @@ defaultEquipment :: Item defaultEquipment = Equipment { _itIdentity = Generic , _itName = "genericEquipment" - , _itMaxStack = 1 - , _itAmount = 1 , _itFloorPict = \_ -> (,) emptySH $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itEquipPict = \_ _ -> (,) emptySH blank , _itEffect = NoItEffect diff --git a/src/Dodge/Default/Weapon.hs b/src/Dodge/Default/Weapon.hs index f56007f5a..0d71fd68c 100644 --- a/src/Dodge/Default/Weapon.hs +++ b/src/Dodge/Default/Weapon.hs @@ -32,8 +32,6 @@ defaultGun = Weapon , _wpRange = 20 , _itHammer = HammerUp , _itFloorPict = const emptyBlank - , _itAmount = 1 - , _itMaxStack = 1 , _itAimingSpeed = 1 , _itAimingRange = 0 , _itZoom = ItZoom 20 0.2 1 diff --git a/src/Dodge/Inventory.hs b/src/Dodge/Inventory.hs index 036cbc491..83813b3f1 100644 --- a/src/Dodge/Inventory.hs +++ b/src/Dodge/Inventory.hs @@ -46,7 +46,9 @@ addItem _ it' = it' & itAmount +~ 1 --numInventorySlots = 9 itNotFull :: Item -> Bool -itNotFull it = _itMaxStack it > _itAmount it +itNotFull it = case it ^? itMaxStack of + Just themax -> themax > _itAmount it + Nothing -> False rmInvItem :: Int -- ^ Creature id diff --git a/src/Dodge/Item/Equipment.hs b/src/Dodge/Item/Equipment.hs index 400a8c293..34280431b 100644 --- a/src/Dodge/Item/Equipment.hs +++ b/src/Dodge/Item/Equipment.hs @@ -13,8 +13,6 @@ magShield :: Item magShield = defaultEquipment { _itIdentity = MagShield , _itName = "MAGSHIELD" - , _itMaxStack = 1 - , _itAmount = 1 , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itEquipPict = \_ _ -> (,) emptySH blank , _itID = Nothing @@ -23,8 +21,6 @@ flameShield :: Item flameShield = defaultEquipment { _itIdentity = FlameShield , _itName = "FLAMESHIELD" - , _itMaxStack = 1 - , _itAmount = 1 , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itEquipPict = \cr _ -> (,) emptySH $ onLayer CrLayer $ pictures [color cyan $ circle (_crRad cr+2)] , _itID = Nothing @@ -34,8 +30,6 @@ frontArmour :: Item frontArmour = defaultEquipment { _itIdentity = FrontArmour , _itName = "FARMOUR" - , _itMaxStack = 1 - , _itAmount = 1 , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures [color (greyN 0.1) $ thickArc 0 (pi/2) 10 5 ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5 @@ -47,13 +41,13 @@ frontArmour = defaultEquipment , _itEffect = NoItEffect , _itID = Nothing } +flatShield :: Item +flatShield = defaultEquipment {- | Increases speed, reduces friction, cannot only move forwards. -} jetPack :: Item jetPack = defaultEquipment { _itIdentity = JetPack , _itName = "JETPACK" - , _itMaxStack = 1 - , _itAmount = 1 , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer $ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ] diff --git a/src/Dodge/Item/Weapon.hs b/src/Dodge/Item/Weapon.hs index e6a9e2c8b..114d3200d 100644 --- a/src/Dodge/Item/Weapon.hs +++ b/src/Dodge/Item/Weapon.hs @@ -302,8 +302,6 @@ radar = defaultGun , _wpRange = 20 , _itHammer = HammerUp , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) - , _itAmount = 1 - , _itMaxStack = 1 , _itAimingRange = 1 , _itZoom = defaultItZoom { _itZoomMax = 1} , _itAimZoom = defaultItZoom { _itZoomMax = 1} @@ -328,8 +326,6 @@ sonar = defaultGun , _wpRange = 20 , _itHammer = HammerUp , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) - , _itAmount = 1 - , _itMaxStack = 1 , _itAimingRange = 1 , _itZoom = defaultItZoom {_itZoomMax = 1} , _itAimZoom = defaultItZoom {_itZoomMax = 1}