Move towards adding reflective shield

This commit is contained in:
2021-11-05 12:14:11 +00:00
parent 5cbfa6f1ff
commit 2c768845b2
9 changed files with 8 additions and 25 deletions
+2 -2
View File
@@ -176,10 +176,10 @@ startInventory = IM.fromList (zip [0..20]
,blinkGun ,blinkGun
,miniGun ,miniGun
,bezierGun ,bezierGun
,multGun -- ,multGun
,boosterGun ,boosterGun
,remoteLauncher ,remoteLauncher
,remoteBomb ,flatShield
,grenade ,grenade
,spawnGun (lamp 5) ,spawnGun (lamp 5)
,lasGun ,lasGun
-1
View File
@@ -9,7 +9,6 @@ module Dodge.Creature.Inanimate
, explosiveBarrel , explosiveBarrel
) where ) where
import Dodge.Data import Dodge.Data
import Dodge.Data.DamageType
import Dodge.WorldEvent.Explosion import Dodge.WorldEvent.Explosion
import Dodge.Creature.Picture import Dodge.Creature.Picture
--import Dodge.Creature.Stance.Data --import Dodge.Creature.Stance.Data
-1
View File
@@ -3,7 +3,6 @@ module Dodge.Creature.State
, doDamage , doDamage
) where ) where
import Dodge.Data import Dodge.Data
import Dodge.Data.DamageType
import Dodge.Data.SoundOrigin import Dodge.Data.SoundOrigin
import Dodge.Item.Data import Dodge.Item.Data
import Dodge.Creature.State.Data import Dodge.Creature.State.Data
+1 -4
View File
@@ -288,8 +288,6 @@ data Item
, _wpRange :: Float , _wpRange :: Float
, _itHammer :: HammerPosition , _itHammer :: HammerPosition
, _itFloorPict :: Item -> SPic , _itFloorPict :: Item -> SPic
, _itMaxStack :: Int
, _itAmount :: Int
, _itAimingSpeed :: Float , _itAimingSpeed :: Float
, _itAimingRange :: Float , _itAimingRange :: Float
, _itZoom :: ItZoom , _itZoom :: ItZoom
@@ -337,8 +335,6 @@ data Item
} }
| Equipment | Equipment
{ _itName :: String { _itName :: String
, _itMaxStack :: Int
, _itAmount :: Int
, _itFloorPict :: Item -> SPic , _itFloorPict :: Item -> SPic
, _itEquipPict :: Creature -> Int -> SPic , _itEquipPict :: Creature -> Int -> SPic
, _itIdentity :: ItemIdentity , _itIdentity :: ItemIdentity
@@ -572,6 +568,7 @@ data MachineType
| Turret | Turret
{ _tuWeapon :: Item { _tuWeapon :: Item
, _tuTurnSpeed :: Float , _tuTurnSpeed :: Float
, _tuFiring :: Bool
} }
data Door = Door data Door = Door
{ _drID :: Int { _drID :: Int
-2
View File
@@ -129,8 +129,6 @@ defaultEquipment :: Item
defaultEquipment = Equipment defaultEquipment = Equipment
{ _itIdentity = Generic { _itIdentity = Generic
, _itName = "genericEquipment" , _itName = "genericEquipment"
, _itMaxStack = 1
, _itAmount = 1
, _itFloorPict = \_ -> (,) emptySH $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itFloorPict = \_ -> (,) emptySH $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = NoItEffect , _itEffect = NoItEffect
-2
View File
@@ -32,8 +32,6 @@ defaultGun = Weapon
, _wpRange = 20 , _wpRange = 20
, _itHammer = HammerUp , _itHammer = HammerUp
, _itFloorPict = const emptyBlank , _itFloorPict = const emptyBlank
, _itAmount = 1
, _itMaxStack = 1
, _itAimingSpeed = 1 , _itAimingSpeed = 1
, _itAimingRange = 0 , _itAimingRange = 0
, _itZoom = ItZoom 20 0.2 1 , _itZoom = ItZoom 20 0.2 1
+3 -1
View File
@@ -46,7 +46,9 @@ addItem _ it' = it' & itAmount +~ 1
--numInventorySlots = 9 --numInventorySlots = 9
itNotFull :: Item -> Bool itNotFull :: Item -> Bool
itNotFull it = _itMaxStack it > _itAmount it itNotFull it = case it ^? itMaxStack of
Just themax -> themax > _itAmount it
Nothing -> False
rmInvItem rmInvItem
:: Int -- ^ Creature id :: Int -- ^ Creature id
+2 -8
View File
@@ -13,8 +13,6 @@ magShield :: Item
magShield = defaultEquipment magShield = defaultEquipment
{ _itIdentity = MagShield { _itIdentity = MagShield
, _itName = "MAGSHIELD" , _itName = "MAGSHIELD"
, _itMaxStack = 1
, _itAmount = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itID = Nothing , _itID = Nothing
@@ -23,8 +21,6 @@ flameShield :: Item
flameShield = defaultEquipment flameShield = defaultEquipment
{ _itIdentity = FlameShield { _itIdentity = FlameShield
, _itName = "FLAMESHIELD" , _itName = "FLAMESHIELD"
, _itMaxStack = 1
, _itAmount = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _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)] , _itEquipPict = \cr _ -> (,) emptySH $ onLayer CrLayer $ pictures [color cyan $ circle (_crRad cr+2)]
, _itID = Nothing , _itID = Nothing
@@ -34,8 +30,6 @@ frontArmour :: Item
frontArmour = defaultEquipment frontArmour = defaultEquipment
{ _itIdentity = FrontArmour { _itIdentity = FrontArmour
, _itName = "FARMOUR" , _itName = "FARMOUR"
, _itMaxStack = 1
, _itAmount = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures
[color (greyN 0.1) $ thickArc 0 (pi/2) 10 5 [color (greyN 0.1) $ thickArc 0 (pi/2) 10 5
,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5 ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5
@@ -47,13 +41,13 @@ frontArmour = defaultEquipment
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itID = Nothing , _itID = Nothing
} }
flatShield :: Item
flatShield = defaultEquipment
{- | Increases speed, reduces friction, cannot only move forwards. -} {- | Increases speed, reduces friction, cannot only move forwards. -}
jetPack :: Item jetPack :: Item
jetPack = defaultEquipment jetPack = defaultEquipment
{ _itIdentity = JetPack { _itIdentity = JetPack
, _itName = "JETPACK" , _itName = "JETPACK"
, _itMaxStack = 1
, _itAmount = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer
$ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ] $ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ]
-4
View File
@@ -302,8 +302,6 @@ radar = defaultGun
, _wpRange = 20 , _wpRange = 20
, _itHammer = HammerUp , _itHammer = HammerUp
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
, _itAmount = 1
, _itMaxStack = 1
, _itAimingRange = 1 , _itAimingRange = 1
, _itZoom = defaultItZoom { _itZoomMax = 1} , _itZoom = defaultItZoom { _itZoomMax = 1}
, _itAimZoom = defaultItZoom { _itZoomMax = 1} , _itAimZoom = defaultItZoom { _itZoomMax = 1}
@@ -328,8 +326,6 @@ sonar = defaultGun
, _wpRange = 20 , _wpRange = 20
, _itHammer = HammerUp , _itHammer = HammerUp
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
, _itAmount = 1
, _itMaxStack = 1
, _itAimingRange = 1 , _itAimingRange = 1
, _itZoom = defaultItZoom {_itZoomMax = 1} , _itZoom = defaultItZoom {_itZoomMax = 1}
, _itAimZoom = defaultItZoom {_itZoomMax = 1} , _itAimZoom = defaultItZoom {_itZoomMax = 1}