Cleanup
This commit is contained in:
@@ -39,6 +39,10 @@ itemCombinations = map (first toMultiset) $
|
|||||||
, p [RIFLE,SPRING,CAN] assaultRifle
|
, p [RIFLE,SPRING,CAN] assaultRifle
|
||||||
|
|
||||||
, p [PIPE,PIPE,PIPE,HARDWARE] bangRod
|
, p [PIPE,PIPE,PIPE,HARDWARE] bangRod
|
||||||
|
, p [BANGROD,PLANK,HARDWARE] elephantGun
|
||||||
|
, p [ELEPHANTGUN,HARDWARE,TIN] amr
|
||||||
|
, p [ELEPHANTGUN,HARDWARE,CAN] sniperRifle
|
||||||
|
, p [BANGROD,PLATE,DRUM,MOTOR] machineGun
|
||||||
|
|
||||||
, p [TUBE,TUBE,TUBE,HARDWARE] launcher
|
, p [TUBE,TUBE,TUBE,HARDWARE] launcher
|
||||||
]
|
]
|
||||||
@@ -49,7 +53,7 @@ itemCombinations = map (first toMultiset) $
|
|||||||
p = (,)
|
p = (,)
|
||||||
|
|
||||||
combinations :: [(M.Map CombineType Int, CombineType)]
|
combinations :: [(M.Map CombineType Int, CombineType)]
|
||||||
combinations = map (second _itCombineType) itemCombinations
|
combinations = map (second _itType) itemCombinations
|
||||||
|
|
||||||
combineToItem :: M.Map CombineType Int -> Maybe Item
|
combineToItem :: M.Map CombineType Int -> Maybe Item
|
||||||
combineToItem m = lookup m itemCombinations
|
combineToItem m = lookup m itemCombinations
|
||||||
@@ -82,7 +86,7 @@ itemMultisets (i,it) = case it ^? itConsumption . itAmount' of
|
|||||||
Nothing -> [ ([i], M.singleton thetype 1 ) ]
|
Nothing -> [ ([i], M.singleton thetype 1 ) ]
|
||||||
Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n]
|
Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n]
|
||||||
where
|
where
|
||||||
thetype = _itCombineType it
|
thetype = _itType it
|
||||||
|
|
||||||
|
|
||||||
itemTypeAmounts :: Item -> [[CombineType]]
|
itemTypeAmounts :: Item -> [[CombineType]]
|
||||||
@@ -90,13 +94,13 @@ itemTypeAmounts it = case it ^? itConsumption . itAmount' of
|
|||||||
Nothing -> [[thetype]]
|
Nothing -> [[thetype]]
|
||||||
Just i -> map (`replicate` thetype) [1 .. i]
|
Just i -> map (`replicate` thetype) [1 .. i]
|
||||||
where
|
where
|
||||||
thetype = _itCombineType it
|
thetype = _itType it
|
||||||
|
|
||||||
combineItemListYou :: World -> [([Int],Item)]
|
combineItemListYou :: World -> [([Int],Item)]
|
||||||
combineItemListYou = combineItemList . yourInv
|
combineItemListYou = combineItemList . yourInv
|
||||||
|
|
||||||
combineListYou :: World -> [([Int],CombineType)]
|
combineListYou :: World -> [([Int],CombineType)]
|
||||||
combineListYou = fmap (second _itCombineType) . combineItemListYou
|
combineListYou = fmap (second _itType) . combineItemListYou
|
||||||
|
|
||||||
toggleCombineInv :: World -> World
|
toggleCombineInv :: World -> World
|
||||||
toggleCombineInv w = case _inventoryMode w of
|
toggleCombineInv w = case _inventoryMode w of
|
||||||
|
|||||||
+17
-37
@@ -6,7 +6,6 @@ data CombineType
|
|||||||
= NOTDEFINED
|
= NOTDEFINED
|
||||||
-- Weapons
|
-- Weapons
|
||||||
| BANGSTICK Int
|
| BANGSTICK Int
|
||||||
| BANGROD
|
|
||||||
| PISTOL
|
| PISTOL
|
||||||
| REVOLVER
|
| REVOLVER
|
||||||
| REVOLVERX Int
|
| REVOLVERX Int
|
||||||
@@ -20,12 +19,17 @@ data CombineType
|
|||||||
| GRAPESHOTCANNON
|
| GRAPESHOTCANNON
|
||||||
| GRENADELAUNCHER Int -- number of chambers that can be reloaded
|
| GRENADELAUNCHER Int -- number of chambers that can be reloaded
|
||||||
-- | MORTARCONE / HANDMORTAR
|
-- | MORTARCONE / HANDMORTAR
|
||||||
| MINIGUN
|
|
||||||
| BANGCANE
|
| BANGCANE
|
||||||
|
| MINIGUN
|
||||||
| BANGCANEX Int
|
| BANGCANEX Int
|
||||||
| RIFLE
|
| RIFLE
|
||||||
| AUTORIFLE
|
| AUTORIFLE
|
||||||
| ASSAULTRIFLE
|
| ASSAULTRIFLE
|
||||||
|
| BANGROD
|
||||||
|
| ELEPHANTGUN
|
||||||
|
| AMR
|
||||||
|
| SNIPERRIFLE
|
||||||
|
| MACHINEGUN
|
||||||
| AUTOGUN
|
| AUTOGUN
|
||||||
| SPREADGUN
|
| SPREADGUN
|
||||||
| MULTGUN
|
| MULTGUN
|
||||||
@@ -67,40 +71,16 @@ data CombineType
|
|||||||
| PRISM
|
| PRISM
|
||||||
| LIGHTER
|
| LIGHTER
|
||||||
| MAGNET
|
| MAGNET
|
||||||
| TPipe
|
| PLATE
|
||||||
|
| MCHIP
|
||||||
|
| LED
|
||||||
|
| NAILBOX
|
||||||
|
| IRONBAR
|
||||||
|
| LIGHTSENSOR
|
||||||
|
| SOUNDSENSOR
|
||||||
|
| COPPERWIRE
|
||||||
|
| BATTERY
|
||||||
|
| FUELCELL
|
||||||
|
| PORTABLEFUSION
|
||||||
| NoCombineType
|
| NoCombineType
|
||||||
| TLongPipe
|
|
||||||
| TVeryLongPipe
|
|
||||||
| TTube
|
|
||||||
| TPlate
|
|
||||||
| TMChip
|
|
||||||
| TMagnet
|
|
||||||
| TMotor
|
|
||||||
| TLED
|
|
||||||
| THardware
|
|
||||||
| TNailbox
|
|
||||||
| TPlank
|
|
||||||
| TPrism
|
|
||||||
| TIronBar
|
|
||||||
| TLightSensor
|
|
||||||
| TSoundSensor
|
|
||||||
| THeatSensor
|
|
||||||
| TCopperWire
|
|
||||||
| TEmptyCan
|
|
||||||
| TEmptyTin
|
|
||||||
| TPistol
|
|
||||||
| TAutoGun
|
|
||||||
| TRifle
|
|
||||||
| TLtAutoGun
|
|
||||||
| THvAutoGun
|
|
||||||
| THvRifle
|
|
||||||
| TMultGun Int
|
|
||||||
| TSpreadGun Int
|
|
||||||
| TLauncher Int
|
|
||||||
| TBattery
|
|
||||||
| TFuelCell
|
|
||||||
| TPortableFusion
|
|
||||||
| TAutoFiringMech
|
|
||||||
| TFiringMech
|
|
||||||
| TTargetingModule
|
|
||||||
deriving (Eq,Ord,Show)
|
deriving (Eq,Ord,Show)
|
||||||
|
|||||||
@@ -111,6 +111,6 @@ equipSpeed _ = 1
|
|||||||
{- | Speed modifier of an item when aiming. -}
|
{- | Speed modifier of an item when aiming. -}
|
||||||
equipAimSpeed :: Item -> Float -- TODO remove/rethink
|
equipAimSpeed :: Item -> Float -- TODO remove/rethink
|
||||||
equipAimSpeed it
|
equipAimSpeed it
|
||||||
| _itCombineType it == FRONTARMOUR = 0.5
|
| _itType it == FRONTARMOUR = 0.5
|
||||||
| _itCombineType it == FLAMESHIELD = 0.5
|
| _itType it == FLAMESHIELD = 0.5
|
||||||
| otherwise = 1
|
| otherwise = 1
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import Control.Lens
|
|||||||
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
||||||
crIsArmouredFrom p cr
|
crIsArmouredFrom p cr
|
||||||
= p /= _crPos cr
|
= p /= _crPos cr
|
||||||
&& any (\it -> it ^? itCombineType == Just FRONTARMOUR) (_crInv cr)
|
&& any (\it -> it ^? itType == Just FRONTARMOUR) (_crInv cr)
|
||||||
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
|
&& angleVV (unitVectorAtAngle $ _crDir cr) (p -.- _crPos cr) < pi/2
|
||||||
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
-- even though angleVV can generate NaN, the comparison seems to deal with it
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ movementSideEff cr w
|
|||||||
_ -> w
|
_ -> w
|
||||||
| otherwise = footstepSideEffect cr w
|
| otherwise = footstepSideEffect cr w
|
||||||
where
|
where
|
||||||
hasJetPack = any (\it -> it ^? itCombineType == Just JETPACK) $ _crInv cr
|
hasJetPack = any (\it -> it ^? itType == Just JETPACK) $ _crInv cr
|
||||||
oldPos = _crOldPos cr
|
oldPos = _crOldPos cr
|
||||||
momentum' = 0.97 *.* (_crPos cr -.- _crOldPos cr)
|
momentum' = 0.97 *.* (_crPos cr -.- _crOldPos cr)
|
||||||
momentum'' | magV momentum' > 3 = 3 *.* normalizeV momentum'
|
momentum'' | magV momentum' > 3 = 3 *.* normalizeV momentum'
|
||||||
|
|||||||
+3
-33
@@ -340,7 +340,7 @@ data Item
|
|||||||
, _itFloorPict :: Item -> SPic
|
, _itFloorPict :: Item -> SPic
|
||||||
, _itEquipPict :: Creature -> Int -> SPic
|
, _itEquipPict :: Creature -> Int -> SPic
|
||||||
, _itScroll :: Float -> Creature -> Item -> Item
|
, _itScroll :: Float -> Creature -> Item -> Item
|
||||||
, _itCombineType :: CombineType
|
, _itType :: CombineType
|
||||||
, _itAttachment :: ItAttachment
|
, _itAttachment :: ItAttachment
|
||||||
, _itID :: Maybe Int
|
, _itID :: Maybe Int
|
||||||
, _itEffect :: ItEffect
|
, _itEffect :: ItEffect
|
||||||
@@ -353,36 +353,6 @@ data Item
|
|||||||
, _itParams :: ItemParams
|
, _itParams :: ItemParams
|
||||||
, _itTweaks :: ItemTweaks
|
, _itTweaks :: ItemTweaks
|
||||||
}
|
}
|
||||||
-- | Consumable
|
|
||||||
-- { _itName :: String
|
|
||||||
-- , _itMaxStack :: Int
|
|
||||||
-- , _itAmount :: Int
|
|
||||||
-- , _cnEffect :: Int -> World -> Maybe World
|
|
||||||
-- , _itFloorPict :: Item -> SPic
|
|
||||||
-- , _itEquipPict :: Creature -> Int -> SPic
|
|
||||||
-- , _itIdentity :: ItemIdentity
|
|
||||||
-- , _itID :: Maybe Int
|
|
||||||
-- , _itInvSize :: Int
|
|
||||||
-- , _itInvDisplay :: Item -> [String]
|
|
||||||
-- , _itInvColor :: Color
|
|
||||||
-- , _itEffect :: ItEffect
|
|
||||||
-- , _itCurseStatus :: CurseStatus
|
|
||||||
-- , _itDimension :: ItemDimension
|
|
||||||
-- }
|
|
||||||
-- | Craftable
|
|
||||||
-- { _itName :: String
|
|
||||||
-- , _itMaxStack :: Int
|
|
||||||
-- , _itAmount :: Int
|
|
||||||
-- , _itFloorPict :: Item -> SPic
|
|
||||||
-- , _itEquipPict :: Creature -> Int -> SPic
|
|
||||||
-- , _itIdentity :: ItemIdentity
|
|
||||||
-- , _itID :: Maybe Int
|
|
||||||
-- , _itInvSize :: Int
|
|
||||||
-- , _itInvDisplay :: Item -> [String]
|
|
||||||
-- , _itInvColor :: Color
|
|
||||||
-- , _itCurseStatus :: CurseStatus
|
|
||||||
-- , _itDimension :: ItemDimension
|
|
||||||
-- }
|
|
||||||
| Equipment
|
| Equipment
|
||||||
{ _itName :: String
|
{ _itName :: String
|
||||||
, _itFloorPict :: Item -> SPic
|
, _itFloorPict :: Item -> SPic
|
||||||
@@ -390,7 +360,7 @@ data Item
|
|||||||
-- , _itIdentity :: ItemIdentity
|
-- , _itIdentity :: ItemIdentity
|
||||||
, _itEffect :: ItEffect
|
, _itEffect :: ItEffect
|
||||||
, _itID :: Maybe Int
|
, _itID :: Maybe Int
|
||||||
, _itCombineType :: CombineType
|
, _itType :: CombineType
|
||||||
, _itZoom :: ItZoom
|
, _itZoom :: ItZoom
|
||||||
, _itInvSize :: Float
|
, _itInvSize :: Float
|
||||||
, _itInvDisplay :: Item -> [String]
|
, _itInvDisplay :: Item -> [String]
|
||||||
@@ -411,7 +381,7 @@ data Item
|
|||||||
--, _itIdentity :: ItemIdentity
|
--, _itIdentity :: ItemIdentity
|
||||||
, _itID :: Maybe Int
|
, _itID :: Maybe Int
|
||||||
, _itAttachment :: ItAttachment
|
, _itAttachment :: ItAttachment
|
||||||
, _itCombineType :: CombineType
|
, _itType :: CombineType
|
||||||
, _itInvSize :: Float
|
, _itInvSize :: Float
|
||||||
, _itInvDisplay :: Item -> [String]
|
, _itInvDisplay :: Item -> [String]
|
||||||
, _itInvColor :: Color
|
, _itInvColor :: Color
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ defaultState = CrSt
|
|||||||
defaultEquipment :: Item
|
defaultEquipment :: Item
|
||||||
defaultEquipment = Equipment
|
defaultEquipment = Equipment
|
||||||
{ _itCurseStatus = Uncursed
|
{ _itCurseStatus = Uncursed
|
||||||
, _itCombineType = NOTDEFINED
|
, _itType = NOTDEFINED
|
||||||
, _itName = "genericEquipment"
|
, _itName = "genericEquipment"
|
||||||
-- ,_itIdentity = Generic
|
-- ,_itIdentity = Generic
|
||||||
, _itFloorPict = \_ -> noShape $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
|
, _itFloorPict = \_ -> noShape $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
|
||||||
@@ -164,7 +164,7 @@ defaultConsumable = Item
|
|||||||
, _itEffect = NoItEffect
|
, _itEffect = NoItEffect
|
||||||
, _itScroll = \_ _ -> id
|
, _itScroll = \_ _ -> id
|
||||||
, _itAttachment = NoItAttachment
|
, _itAttachment = NoItAttachment
|
||||||
, _itCombineType = NoCombineType
|
, _itType = NoCombineType
|
||||||
, _itTargeting = Nothing
|
, _itTargeting = Nothing
|
||||||
, _itParams = NoParams
|
, _itParams = NoParams
|
||||||
, _itDimension = defaultItemDimension
|
, _itDimension = defaultItemDimension
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ defaultAimParams = AimParams
|
|||||||
defaultGun :: Item
|
defaultGun :: Item
|
||||||
defaultGun = Item
|
defaultGun = Item
|
||||||
{ _itName = "default"
|
{ _itName = "default"
|
||||||
, _itCombineType = NoCombineType
|
, _itType = NoCombineType
|
||||||
, _itCurseStatus = Uncursed
|
, _itCurseStatus = Uncursed
|
||||||
-- , _itIdentity = Pistol
|
-- , _itIdentity = Pistol
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
@@ -110,7 +110,7 @@ defaultGun = Item
|
|||||||
defaultCraftable :: Item
|
defaultCraftable :: Item
|
||||||
defaultCraftable = Item
|
defaultCraftable = Item
|
||||||
{ _itName = "default"
|
{ _itName = "default"
|
||||||
, _itCombineType = NoCombineType
|
, _itType = NoCombineType
|
||||||
, _itCurseStatus = Uncursed
|
, _itCurseStatus = Uncursed
|
||||||
-- , _itIdentity = Generic
|
-- , _itIdentity = Generic
|
||||||
, _itConsumption = NoConsumption
|
, _itConsumption = NoConsumption
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ checkInvSlotsYou it w
|
|||||||
findItemSlot :: Item -> IM.IntMap Item -> Int
|
findItemSlot :: Item -> IM.IntMap Item -> Int
|
||||||
findItemSlot it inv = case _itConsumption it of
|
findItemSlot it inv = case _itConsumption it of
|
||||||
ItemItselfConsumable _
|
ItemItselfConsumable _
|
||||||
-> fromMaybe newslot $ IM.findIndex (\it' -> _itCombineType it == _itCombineType it') inv
|
-> fromMaybe newslot $ IM.findIndex (\it' -> _itType it == _itType it') inv
|
||||||
_ -> newslot
|
_ -> newslot
|
||||||
where
|
where
|
||||||
newslot = maybe 0 ((+1) . fst) $ IM.lookupMax inv
|
newslot = maybe 0 ((+1) . fst) $ IM.lookupMax inv
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ import Shape
|
|||||||
|
|
||||||
keyToken :: Int -> Item
|
keyToken :: Int -> Item
|
||||||
keyToken n = defaultEquipment
|
keyToken n = defaultEquipment
|
||||||
{ _itCombineType = NOTDEFINED
|
{ _itType = NOTDEFINED
|
||||||
, _itName = "KEYTOKEN "++show n
|
, _itName = "KEYTOKEN "++show n
|
||||||
, _itMaxStack = 5
|
, _itMaxStack = 5
|
||||||
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 keyPic
|
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 keyPic
|
||||||
@@ -30,7 +30,7 @@ keyPic = color green $
|
|||||||
|
|
||||||
latchkey :: Int -> Item
|
latchkey :: Int -> Item
|
||||||
latchkey n = defaultEquipment
|
latchkey n = defaultEquipment
|
||||||
{ _itCombineType = NOTDEFINED
|
{ _itType = NOTDEFINED
|
||||||
, _itName = "KEY "++show n
|
, _itName = "KEY "++show n
|
||||||
, _itMaxStack = 1
|
, _itMaxStack = 1
|
||||||
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 latchkeyPic
|
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 latchkeyPic
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ makeTypeCraftNum i ct = defaultCraftable
|
|||||||
{ _itInvSize = 0.5
|
{ _itInvSize = 0.5
|
||||||
, _itCurseStatus = Uncursed
|
, _itCurseStatus = Uncursed
|
||||||
, _itName = show ct
|
, _itName = show ct
|
||||||
, _itCombineType = ct
|
, _itType = ct
|
||||||
, _itConsumption = ItemItselfConsumable i
|
, _itConsumption = ItemItselfConsumable i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import Control.Lens
|
|||||||
|
|
||||||
magShield :: Item
|
magShield :: Item
|
||||||
magShield = defaultEquipment
|
magShield = defaultEquipment
|
||||||
{ _itCombineType = MAGSHIELD
|
{ _itType = MAGSHIELD
|
||||||
, _itName = "MAGSHIELD"
|
, _itName = "MAGSHIELD"
|
||||||
, _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
|
||||||
@@ -26,7 +26,7 @@ magShield = defaultEquipment
|
|||||||
}
|
}
|
||||||
flameShield :: Item
|
flameShield :: Item
|
||||||
flameShield = defaultEquipment
|
flameShield = defaultEquipment
|
||||||
{ _itCombineType = FLAMESHIELD
|
{ _itType = FLAMESHIELD
|
||||||
, _itName = "FLAMESHIELD"
|
, _itName = "FLAMESHIELD"
|
||||||
, _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)]
|
||||||
@@ -35,7 +35,7 @@ flameShield = defaultEquipment
|
|||||||
{- | Slows you down, blocks forward projectiles. -}
|
{- | Slows you down, blocks forward projectiles. -}
|
||||||
frontArmour :: Item
|
frontArmour :: Item
|
||||||
frontArmour = defaultEquipment
|
frontArmour = defaultEquipment
|
||||||
{ _itCombineType = FRONTARMOUR
|
{ _itType = FRONTARMOUR
|
||||||
, _itName = "FARMOUR"
|
, _itName = "FARMOUR"
|
||||||
, _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
|
||||||
@@ -53,7 +53,7 @@ flatShield = defaultEquipment
|
|||||||
{ _itEquipPict = pictureWeaponOnAim' flatShieldEquipSPic -- this will not work any more because the shield has no aim stance
|
{ _itEquipPict = pictureWeaponOnAim' flatShieldEquipSPic -- this will not work any more because the shield has no aim stance
|
||||||
, _itEffect = effectOnOffEquip createShieldWall removeShieldWall
|
, _itEffect = effectOnOffEquip createShieldWall removeShieldWall
|
||||||
, _itName = "SHIELD"
|
, _itName = "SHIELD"
|
||||||
, _itCombineType = FLATSHIELD
|
, _itType = FLATSHIELD
|
||||||
}
|
}
|
||||||
flatShieldEquipSPic :: Item -> SPic
|
flatShieldEquipSPic :: Item -> SPic
|
||||||
flatShieldEquipSPic _ =
|
flatShieldEquipSPic _ =
|
||||||
@@ -131,7 +131,7 @@ effectOnOffEquip f f' = ItInvEffectID
|
|||||||
{- | Increases speed, reduces friction, cannot only move forwards. -}
|
{- | Increases speed, reduces friction, cannot only move forwards. -}
|
||||||
jetPack :: Item
|
jetPack :: Item
|
||||||
jetPack = defaultEquipment
|
jetPack = defaultEquipment
|
||||||
{ _itCombineType = JETPACK
|
{ _itType = JETPACK
|
||||||
, _itName = "JETPACK"
|
, _itName = "JETPACK"
|
||||||
, _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
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import qualified Data.IntMap.Strict as IM
|
|||||||
teslaGun :: Item
|
teslaGun :: Item
|
||||||
teslaGun = defaultGun
|
teslaGun = defaultGun
|
||||||
{ _itName = "TESLA"
|
{ _itName = "TESLA"
|
||||||
, _itCombineType = TESLAGUN
|
, _itType = TESLAGUN
|
||||||
-- , _itIdentity = TeslaGun
|
-- , _itIdentity = TeslaGun
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 200
|
{ _ammoMax = 200
|
||||||
@@ -64,7 +64,7 @@ teslaGunPic _ = noPic $ colorSH blue $
|
|||||||
lasGun :: Item
|
lasGun :: Item
|
||||||
lasGun = defaultAutoGun
|
lasGun = defaultAutoGun
|
||||||
{ _itName = "LASGUN ////"
|
{ _itName = "LASGUN ////"
|
||||||
, _itCombineType = LASGUN
|
, _itType = LASGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 200
|
{ _ammoMax = 200
|
||||||
, _ammoLoaded = 200
|
, _ammoLoaded = 200
|
||||||
@@ -120,7 +120,7 @@ lasGunPic it =
|
|||||||
tractorGun :: Item
|
tractorGun :: Item
|
||||||
tractorGun = defaultAutoGun
|
tractorGun = defaultAutoGun
|
||||||
{ _itName = "TRACTORGUN"
|
{ _itName = "TRACTORGUN"
|
||||||
, _itCombineType = TRACTORGUN
|
, _itType = TRACTORGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 10000
|
{ _ammoMax = 10000
|
||||||
, _ammoLoaded = 10000
|
, _ammoLoaded = 10000
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ maxT = 20
|
|||||||
boosterGun :: Item
|
boosterGun :: Item
|
||||||
boosterGun = defaultGun
|
boosterGun = defaultGun
|
||||||
{ _itName = "BOOSTER"
|
{ _itName = "BOOSTER"
|
||||||
, _itCombineType = BOOSTER
|
, _itType = BOOSTER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ module Dodge.Item.Weapon.BulletGuns
|
|||||||
, revolverX
|
, revolverX
|
||||||
, bangStick
|
, bangStick
|
||||||
, bangRod
|
, bangRod
|
||||||
|
, elephantGun
|
||||||
|
, amr
|
||||||
|
, sniperRifle
|
||||||
|
, machineGun
|
||||||
, bangCane
|
, bangCane
|
||||||
, bangCaneX
|
, bangCaneX
|
||||||
, rifle
|
, rifle
|
||||||
@@ -57,7 +61,7 @@ import System.Random
|
|||||||
autoGun :: Item
|
autoGun :: Item
|
||||||
autoGun = defaultAutoGun
|
autoGun = defaultAutoGun
|
||||||
{ _itName = "AUTOGUN"
|
{ _itName = "AUTOGUN"
|
||||||
, _itCombineType = AUTOGUN
|
, _itType = AUTOGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 30
|
, _ammoMax = 30
|
||||||
@@ -118,7 +122,7 @@ bangStick i = defaultGun
|
|||||||
{ _itName = case i of
|
{ _itName = case i of
|
||||||
1 -> "BANGSTICK"
|
1 -> "BANGSTICK"
|
||||||
_ -> "BANGSTICKx"++ show i
|
_ -> "BANGSTICKx"++ show i
|
||||||
, _itCombineType = BANGSTICK i
|
, _itType = BANGSTICK i
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = i
|
, _ammoMax = i
|
||||||
@@ -157,7 +161,7 @@ bangStick i = defaultGun
|
|||||||
bangCane :: Item
|
bangCane :: Item
|
||||||
bangCane = defaultGun
|
bangCane = defaultGun
|
||||||
{ _itName = "BANGCANE"
|
{ _itName = "BANGCANE"
|
||||||
, _itCombineType = BANGCANE
|
, _itType = BANGCANE
|
||||||
,_itParams = BulletShooter
|
,_itParams = BulletShooter
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = 0.8
|
||||||
, _rifling = 0.9
|
, _rifling = 0.9
|
||||||
@@ -184,12 +188,12 @@ bangCane = defaultGun
|
|||||||
, _itTweaks = defaultBulletSelTweak
|
, _itTweaks = defaultBulletSelTweak
|
||||||
} & itUse . useAim . aimSpeed .~ 0.4
|
} & itUse . useAim . aimSpeed .~ 0.4
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
bangCaneX :: Int -> Item
|
bangCaneX :: Int -> Item
|
||||||
bangCaneX i = bangCane
|
bangCaneX i = bangCane
|
||||||
{ _itName = "BANGCANEx"++show i
|
{ _itName = "BANGCANEx"++show i
|
||||||
, _itCombineType = BANGCANEX i
|
, _itType = BANGCANEX i
|
||||||
, _itUse = useAmmoParamsRate 6 upHammer
|
, _itUse = useAmmoParamsRate 6 upHammer
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
@@ -214,8 +218,9 @@ bangCaneX i = bangCane
|
|||||||
|
|
||||||
rifle :: Item
|
rifle :: Item
|
||||||
rifle = bangCane
|
rifle = bangCane
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
& itName .~ "RIFLE"
|
& itName .~ "RIFLE"
|
||||||
& itCombineType .~ RIFLE
|
& itType .~ RIFLE
|
||||||
& itConsumption . ammoMax .~ 15
|
& itConsumption . ammoMax .~ 15
|
||||||
& itConsumption . reloadType .~ ActiveClear
|
& itConsumption . reloadType .~ ActiveClear
|
||||||
& itConsumption . reloadTime .~ 80
|
& itConsumption . reloadTime .~ 80
|
||||||
@@ -223,13 +228,13 @@ rifle = bangCane
|
|||||||
autoRifle :: Item
|
autoRifle :: Item
|
||||||
autoRifle = rifle
|
autoRifle = rifle
|
||||||
& itName .~ "AUTORIFLE"
|
& itName .~ "AUTORIFLE"
|
||||||
& itCombineType .~ AUTORIFLE
|
& itType .~ AUTORIFLE
|
||||||
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
& itUse . useMods %~ ((ammoCheckI :) . tail)
|
||||||
-- & itUse . useDelay . rateMax .~ 6
|
-- & itUse . useDelay . rateMax .~ 6
|
||||||
assaultRifle :: Item
|
assaultRifle :: Item
|
||||||
assaultRifle = rifle
|
assaultRifle = rifle
|
||||||
& itName .~ "ASSAULTRIFLE"
|
& itName .~ "ASSAULTRIFLE"
|
||||||
& itCombineType .~ ASSAULTRIFLE
|
& itType .~ ASSAULTRIFLE
|
||||||
& itUse . useDelay . rateMax .~ 18
|
& itUse . useDelay . rateMax .~ 18
|
||||||
& itUse . useMods .~
|
& itUse . useMods .~
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
@@ -244,28 +249,68 @@ assaultRifle = rifle
|
|||||||
, withRecoilI 50
|
, withRecoilI 50
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bangRod :: Item
|
bangRod :: Item
|
||||||
bangRod = bangCane
|
bangRod = bangCane
|
||||||
{ _itName = "BANGROD"
|
{ _itName = "BANGROD"
|
||||||
, _itCombineType = BANGROD
|
, _itType = BANGROD
|
||||||
, _itParams = BulletShooter
|
, _itParams = BulletShooter
|
||||||
{ _muzVel = 0.8
|
{ _muzVel = 0.8
|
||||||
, _rifling = 1
|
, _rifling = 1
|
||||||
, _bore = 2
|
, _bore = 2
|
||||||
, _gunBarrels = SingleBarrel 0.05
|
, _gunBarrels = SingleBarrel 0.1
|
||||||
}
|
}
|
||||||
|
, _itUse = useAmmoParamsRate 6 upHammer
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart autoGunS
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, torqueAfterI 0.3
|
||||||
|
, applyInaccuracy
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoilI 50
|
||||||
|
]
|
||||||
, _itFloorPict = longGunSPic
|
, _itFloorPict = longGunSPic
|
||||||
} & itUse . useAim . aimSpeed .~ 0.2
|
}
|
||||||
|
& itConsumption . reloadType .~ ActiveClear
|
||||||
|
& itUse . useAim . aimSpeed .~ 0.2
|
||||||
& itUse . useAim . aimRange .~ 1
|
& itUse . useAim . aimRange .~ 1
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ OneHand
|
||||||
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
|
elephantGun :: Item
|
||||||
|
elephantGun = bangRod
|
||||||
|
& itName .~ "ELEPHANTGUN"
|
||||||
|
& itType .~ ELEPHANTGUN
|
||||||
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
|
& itParams . gunBarrels .~ SingleBarrel 0.05
|
||||||
|
& itUse . useMods .~
|
||||||
|
[ ammoHammerCheck
|
||||||
|
, useTimeCheck
|
||||||
|
, withSoundStart autoGunS
|
||||||
|
, useAmmoAmount 1
|
||||||
|
, torqueAfterI 0.1
|
||||||
|
, applyInaccuracy
|
||||||
|
, withMuzFlareI
|
||||||
|
, withRecoilI 50
|
||||||
|
]
|
||||||
|
amr :: Item
|
||||||
|
amr = elephantGun
|
||||||
|
& itName .~ "AMR"
|
||||||
|
& itType .~ AMR
|
||||||
|
& itConsumption . ammoMax .~ 15
|
||||||
|
sniperRifle :: Item
|
||||||
|
sniperRifle = elephantGun
|
||||||
|
& itName .~ "SNIPERRIFLE"
|
||||||
|
& itType .~ SNIPERRIFLE
|
||||||
|
& itParams . gunBarrels .~ SingleBarrel 0
|
||||||
|
machineGun :: Item
|
||||||
|
machineGun = bangRod
|
||||||
|
& itName .~ "MACHINEGUN"
|
||||||
|
& itType .~ MACHINEGUN
|
||||||
|
|
||||||
revolverX :: Int -> Item
|
revolverX :: Int -> Item
|
||||||
revolverX i = revolver
|
revolverX i = revolver
|
||||||
{ _itName = "REVx"++show i
|
{ _itName = "REVx"++show i
|
||||||
, _itCombineType = REVOLVERX i
|
, _itType = REVOLVERX i
|
||||||
, _itUse = useAmmoParamsRate 8 upHammer
|
, _itUse = useAmmoParamsRate 8 upHammer
|
||||||
[ ammoHammerCheck
|
[ ammoHammerCheck
|
||||||
, useTimeCheck
|
, useTimeCheck
|
||||||
@@ -285,7 +330,7 @@ revolverX i = revolver
|
|||||||
bangCone :: Item
|
bangCone :: Item
|
||||||
bangCone = defaultGun
|
bangCone = defaultGun
|
||||||
{ _itName = "BANGCONE"
|
{ _itName = "BANGCONE"
|
||||||
, _itCombineType = BANGCONE
|
, _itType = BANGCONE
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 5
|
, _ammoMax = 5
|
||||||
@@ -330,7 +375,7 @@ coneRandItemParams = do
|
|||||||
blunderbuss :: Item
|
blunderbuss :: Item
|
||||||
blunderbuss = bangCone
|
blunderbuss = bangCone
|
||||||
{_itName = "BLUNDERBUSS"
|
{_itName = "BLUNDERBUSS"
|
||||||
,_itCombineType = BLUNDERBUSS
|
,_itType = BLUNDERBUSS
|
||||||
,_itUse = useAmmoParamsRate 20 upHammer
|
,_itUse = useAmmoParamsRate 20 upHammer
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, hammerCheckI
|
, hammerCheckI
|
||||||
@@ -352,7 +397,7 @@ blunderbuss = bangCone
|
|||||||
grapeShotCannon :: Item
|
grapeShotCannon :: Item
|
||||||
grapeShotCannon = blunderbuss
|
grapeShotCannon = blunderbuss
|
||||||
{_itName = "GRAPESHOTCANNON"
|
{_itName = "GRAPESHOTCANNON"
|
||||||
,_itCombineType = GRAPESHOTCANNON
|
,_itType = GRAPESHOTCANNON
|
||||||
,_itUse = useAmmoParamsRate 20 upHammer
|
,_itUse = useAmmoParamsRate 20 upHammer
|
||||||
[ ammoCheckI
|
[ ammoCheckI
|
||||||
, hammerCheckI
|
, hammerCheckI
|
||||||
@@ -378,7 +423,7 @@ grenadeLauncher _ = bangCone
|
|||||||
revolver :: Item
|
revolver :: Item
|
||||||
revolver = pistol
|
revolver = pistol
|
||||||
{ _itName = "REVOLVER"
|
{ _itName = "REVOLVER"
|
||||||
, _itCombineType = REVOLVER
|
, _itType = REVOLVER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 6
|
, _ammoMax = 6
|
||||||
@@ -425,7 +470,7 @@ smgAfterHamMods =
|
|||||||
pistol :: Item
|
pistol :: Item
|
||||||
pistol = defaultGun
|
pistol = defaultGun
|
||||||
{ _itName = "PISTOL"
|
{ _itName = "PISTOL"
|
||||||
, _itCombineType = PISTOL
|
, _itType = PISTOL
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 15
|
, _ammoMax = 15
|
||||||
@@ -466,7 +511,7 @@ bulletClip x = rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW 3 0 (3 -
|
|||||||
hvAutoGun :: Item
|
hvAutoGun :: Item
|
||||||
hvAutoGun = defaultAutoGun
|
hvAutoGun = defaultAutoGun
|
||||||
{ _itName = "AUTO-HV"
|
{ _itName = "AUTO-HV"
|
||||||
, _itCombineType = HVAUTOGUN
|
, _itType = HVAUTOGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = hvBullet
|
{ _aoType = hvBullet
|
||||||
, _ammoMax = 100
|
, _ammoMax = 100
|
||||||
@@ -507,23 +552,23 @@ autoPistol :: Item
|
|||||||
autoPistol = pistol
|
autoPistol = pistol
|
||||||
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
|
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
|
||||||
& itName .~ "AUTOPISTOL"
|
& itName .~ "AUTOPISTOL"
|
||||||
& itCombineType .~ AUTOPISTOL
|
& itType .~ AUTOPISTOL
|
||||||
machinePistol :: Item
|
machinePistol :: Item
|
||||||
machinePistol = autoPistol
|
machinePistol = autoPistol
|
||||||
& itUse . useDelay . rateMax .~ 2
|
& itUse . useDelay . rateMax .~ 2
|
||||||
& itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods)
|
& itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods)
|
||||||
& itName .~ "MACHINEPISTOL"
|
& itName .~ "MACHINEPISTOL"
|
||||||
& itCombineType .~ MACHINEPISTOL
|
& itType .~ MACHINEPISTOL
|
||||||
smg :: Item
|
smg :: Item
|
||||||
smg = autoPistol -- & some parameter affecting stability
|
smg = autoPistol -- & some parameter affecting stability
|
||||||
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
|
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
|
||||||
& itName .~ "SMG"
|
& itName .~ "SMG"
|
||||||
& itCombineType .~ SMG
|
& itType .~ SMG
|
||||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||||
ltAutoGun :: Item
|
ltAutoGun :: Item
|
||||||
ltAutoGun = defaultAutoGun
|
ltAutoGun = defaultAutoGun
|
||||||
{ _itName = "AUTO-LT"
|
{ _itName = "AUTO-LT"
|
||||||
, _itCombineType = LTAUTOGUN
|
, _itType = LTAUTOGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 15
|
, _ammoMax = 15
|
||||||
@@ -563,7 +608,7 @@ ltAutoGunPic it =
|
|||||||
miniGun :: Item
|
miniGun :: Item
|
||||||
miniGun = defaultAutoGun
|
miniGun = defaultAutoGun
|
||||||
{ _itName = "MINI-G"
|
{ _itName = "MINI-G"
|
||||||
, _itCombineType = MINIGUN
|
, _itType = MINIGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 1500
|
, _ammoMax = 1500
|
||||||
@@ -672,7 +717,7 @@ miniGunPict spin am =
|
|||||||
spreadGun :: Item
|
spreadGun :: Item
|
||||||
spreadGun = defaultGun
|
spreadGun = defaultGun
|
||||||
{ _itName = "SPREAD"
|
{ _itName = "SPREAD"
|
||||||
, _itCombineType = SPREADGUN
|
, _itType = SPREADGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 5
|
, _ammoMax = 5
|
||||||
@@ -713,7 +758,7 @@ spreadGunPic it =
|
|||||||
multGun :: Item
|
multGun :: Item
|
||||||
multGun = defaultGun
|
multGun = defaultGun
|
||||||
{ _itName = "MULTGUN"
|
{ _itName = "MULTGUN"
|
||||||
, _itCombineType = MULTGUN
|
, _itType = MULTGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = basicBullet
|
{ _aoType = basicBullet
|
||||||
, _ammoMax = 5
|
, _ammoMax = 5
|
||||||
@@ -766,7 +811,7 @@ multGunSPic it =
|
|||||||
longGun :: Item
|
longGun :: Item
|
||||||
longGun = defaultGun
|
longGun = defaultGun
|
||||||
{ _itName = "LONGGUN"
|
{ _itName = "LONGGUN"
|
||||||
, _itCombineType = LONGGUN
|
, _itType = LONGGUN
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = hvBullet
|
{ _aoType = hvBullet
|
||||||
, _ammoMax = 1
|
, _ammoMax = 1
|
||||||
@@ -796,7 +841,7 @@ longGun = defaultGun
|
|||||||
}
|
}
|
||||||
longGunSPic :: Item -> SPic
|
longGunSPic :: Item -> SPic
|
||||||
longGunSPic _ =
|
longGunSPic _ =
|
||||||
( colorSH orange $ upperPrismPoly 5 $ rectWH 12 2
|
( colorSH orange $ upperPrismPoly 5 $ rectXH 25 2
|
||||||
, mempty
|
, mempty
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import Control.Lens
|
|||||||
lasDrones :: Item
|
lasDrones :: Item
|
||||||
lasDrones = defaultGun
|
lasDrones = defaultGun
|
||||||
{ _itName = "DRONES"
|
{ _itName = "DRONES"
|
||||||
, _itCombineType = DRONELAUNCHER
|
, _itType = DRONELAUNCHER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = DroneAmmo { _amString = "LASDRONE" }
|
{ _aoType = DroneAmmo { _amString = "LASDRONE" }
|
||||||
, _ammoMax = 2
|
, _ammoMax = 2
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import Control.Lens
|
|||||||
grenade :: Item
|
grenade :: Item
|
||||||
grenade = Throwable
|
grenade = Throwable
|
||||||
{ _itName = "GRENADE " ++ show fuseTime
|
{ _itName = "GRENADE " ++ show fuseTime
|
||||||
, _itCombineType = GRENADE
|
, _itType = GRENADE
|
||||||
, _itInvSize = 1
|
, _itInvSize = 1
|
||||||
, _itDimension = defaultItemDimension
|
, _itDimension = defaultItemDimension
|
||||||
, _itCurseStatus = Uncursed
|
, _itCurseStatus = Uncursed
|
||||||
@@ -212,7 +212,7 @@ defaultThrowable = grenade
|
|||||||
remoteBomb :: Item
|
remoteBomb :: Item
|
||||||
remoteBomb = defaultThrowable
|
remoteBomb = defaultThrowable
|
||||||
{ _itName = "REMOTEBOMB"
|
{ _itName = "REMOTEBOMB"
|
||||||
, _itCombineType = REMOTEBOMB
|
, _itType = REMOTEBOMB
|
||||||
, _itMaxStack = 1
|
, _itMaxStack = 1
|
||||||
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2
|
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2
|
||||||
[(-3,-3),(-3,3),(3,3),(3,-3)]
|
[(-3,-3),(-3,3),(3,3),(3,-3)]
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import System.Random
|
|||||||
launcher :: Item
|
launcher :: Item
|
||||||
launcher = defaultGun
|
launcher = defaultGun
|
||||||
{ _itName = "ROCKO"
|
{ _itName = "ROCKO"
|
||||||
, _itCombineType = LAUNCHER
|
, _itType = LAUNCHER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = defaultShellAmmo
|
{ _aoType = defaultShellAmmo
|
||||||
{ _amPayload = makeExplosionAt
|
{ _amPayload = makeExplosionAt
|
||||||
@@ -256,7 +256,7 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
|
|||||||
remoteLauncher :: Item
|
remoteLauncher :: Item
|
||||||
remoteLauncher = defaultGun
|
remoteLauncher = defaultGun
|
||||||
{ _itName = "ROCKO-REM"
|
{ _itName = "ROCKO-REM"
|
||||||
, _itCombineType = LAUNCHER
|
, _itType = LAUNCHER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _aoType = defaultShellAmmo
|
{ _aoType = defaultShellAmmo
|
||||||
{ _amPayload = makeExplosionAt
|
{ _amPayload = makeExplosionAt
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ Sends out pulses that display walls. -}
|
|||||||
radar :: Item
|
radar :: Item
|
||||||
radar = defaultGun
|
radar = defaultGun
|
||||||
{ _itName = "RADAR"
|
{ _itName = "RADAR"
|
||||||
, _itCombineType = RADAR
|
, _itType = RADAR
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
@@ -40,7 +40,7 @@ Sends out pulses that display creatures. -}
|
|||||||
sonar :: Item
|
sonar :: Item
|
||||||
sonar = defaultGun
|
sonar = defaultGun
|
||||||
{ _itName = "SONAR"
|
{ _itName = "SONAR"
|
||||||
, _itCombineType = RADAR
|
, _itType = RADAR
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
@@ -59,7 +59,7 @@ sonar = defaultGun
|
|||||||
Automatically sends out pulses that display creatures. -}
|
Automatically sends out pulses that display creatures. -}
|
||||||
autoSonar :: Item
|
autoSonar :: Item
|
||||||
autoSonar = defaultEquipment
|
autoSonar = defaultEquipment
|
||||||
{ _itCombineType = RADAR
|
{ _itType = RADAR
|
||||||
, _itName = "AUTOSONAR"
|
, _itName = "AUTOSONAR"
|
||||||
, _itMaxStack = 1
|
, _itMaxStack = 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)]
|
||||||
@@ -72,7 +72,7 @@ autoSonar = defaultEquipment
|
|||||||
Automatically sends out pulses that display walls. -}
|
Automatically sends out pulses that display walls. -}
|
||||||
autoRadar :: Item
|
autoRadar :: Item
|
||||||
autoRadar = defaultEquipment
|
autoRadar = defaultEquipment
|
||||||
{ _itCombineType = RADAR
|
{ _itType = RADAR
|
||||||
, _itName = "AUTORADAR"
|
, _itName = "AUTORADAR"
|
||||||
, _itMaxStack = 1
|
, _itMaxStack = 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)]
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import System.Random
|
|||||||
poisonSprayer :: Item
|
poisonSprayer :: Item
|
||||||
poisonSprayer = defaultAutoGun
|
poisonSprayer = defaultAutoGun
|
||||||
{ _itName = "POISON"
|
{ _itName = "POISON"
|
||||||
, _itCombineType = SPRAYER
|
, _itType = SPRAYER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 500
|
{ _ammoMax = 500
|
||||||
, _ammoLoaded = 500
|
, _ammoLoaded = 500
|
||||||
@@ -57,7 +57,7 @@ poisonSprayer = defaultAutoGun
|
|||||||
flamer :: Item
|
flamer :: Item
|
||||||
flamer = defaultAutoGun
|
flamer = defaultAutoGun
|
||||||
{ _itName = "FLAMER"
|
{ _itName = "FLAMER"
|
||||||
, _itCombineType = SQUIRTER
|
, _itType = SQUIRTER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 250
|
{ _ammoMax = 250
|
||||||
, _ammoLoaded = 250
|
, _ammoLoaded = 250
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import Control.Lens
|
|||||||
rewindGun :: Item
|
rewindGun :: Item
|
||||||
rewindGun = defaultGun
|
rewindGun = defaultGun
|
||||||
{ _itName = "REWINDER"
|
{ _itName = "REWINDER"
|
||||||
, _itCombineType = REWINDER
|
, _itType = REWINDER
|
||||||
, _itConsumption = ChargeableAmmo
|
, _itConsumption = ChargeableAmmo
|
||||||
{ _wpMaxCharge = 250
|
{ _wpMaxCharge = 250
|
||||||
, _wpCharge = 0
|
, _wpCharge = 0
|
||||||
@@ -55,7 +55,7 @@ useRewindGun _ _ w = case _rewindWorlds w of
|
|||||||
shrinkGun :: Item
|
shrinkGun :: Item
|
||||||
shrinkGun = defaultGun
|
shrinkGun = defaultGun
|
||||||
{ _itName = "SHRINKER"
|
{ _itName = "SHRINKER"
|
||||||
, _itCombineType = SHRINKER
|
, _itType = SHRINKER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
@@ -85,7 +85,7 @@ useShrinkGun cr invid w = if _itBool $ _itAttachment it
|
|||||||
blinkGun :: Item
|
blinkGun :: Item
|
||||||
blinkGun = defaultGun
|
blinkGun = defaultGun
|
||||||
{ _itName = "BLINKER"
|
{ _itName = "BLINKER"
|
||||||
, _itCombineType = BLINKER
|
, _itType = BLINKER
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
@@ -117,7 +117,7 @@ autoEffectGun name eff = defaultAutoGun
|
|||||||
forceFieldGun :: Item
|
forceFieldGun :: Item
|
||||||
forceFieldGun = defaultGun
|
forceFieldGun = defaultGun
|
||||||
{ _itName = "FORCEFIELD"
|
{ _itName = "FORCEFIELD"
|
||||||
, _itCombineType = FORCEFIELD
|
, _itType = FORCEFIELD
|
||||||
, _itConsumption = defaultAmmo
|
, _itConsumption = defaultAmmo
|
||||||
{ _ammoMax = 100
|
{ _ammoMax = 100
|
||||||
, _ammoLoaded = 100
|
, _ammoLoaded = 100
|
||||||
|
|||||||
+7
-2
@@ -16,8 +16,7 @@ module Geometry
|
|||||||
, module Geometry.Vector
|
, module Geometry.Vector
|
||||||
, module Geometry.Vector3D
|
, module Geometry.Vector3D
|
||||||
, module Geometry.LHS
|
, module Geometry.LHS
|
||||||
)
|
) where
|
||||||
where
|
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Geometry.Intersect
|
import Geometry.Intersect
|
||||||
import Geometry.Bezier
|
import Geometry.Bezier
|
||||||
@@ -67,6 +66,12 @@ rectNSWE !n !s !w !e = [V2 w n, V2 w s, V2 e s, V2 e n]
|
|||||||
rectWH :: Float -> Float -> [Point2]
|
rectWH :: Float -> Float -> [Point2]
|
||||||
rectWH w h = rectNSWE h (-h) (-w) w
|
rectWH w h = rectNSWE h (-h) (-w) w
|
||||||
|
|
||||||
|
rectXH :: Float -> Float -> [Point2]
|
||||||
|
rectXH x h = rectNSWE h (-h) 0 x
|
||||||
|
|
||||||
|
rectXY :: Float -> Float -> [Point2]
|
||||||
|
rectXY x y = rectNSWE y 0 0 x
|
||||||
|
|
||||||
square :: Float -> [Point2]
|
square :: Float -> [Point2]
|
||||||
square n = rectWH n n
|
square n = rectWH n n
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user