Move toward data-ifying item SPics

This commit is contained in:
2022-07-11 11:32:25 +01:00
parent 3447b9b0bb
commit 33d94bd05a
23 changed files with 332 additions and 331 deletions
-4
View File
@@ -71,15 +71,11 @@ mvLaser phasev sp dir w pt =
where where
dam = _ptDamage pt dam = _ptDamage pt
xp = sp +.+ 800 *.* unitVectorAtAngle dir xp = sp +.+ 800 *.* unitVectorAtAngle dir
-- thHit' = thingHit sp xp w
(thHit, ps) = reflectLaserAlong phasev sp xp w (thHit, ps) = reflectLaserAlong phasev sp xp w
drawLaser :: Particle -> Picture drawLaser :: Particle -> Picture
--drawLaser pt = setLayer BloomNoZWrite $ pictures
--[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
drawLaser pt = drawLaser pt =
setLayer BloomNoZWrite $ pictures setLayer BloomNoZWrite $ pictures
-- [ setDepth 19 . color (brightX 1 0.5 col) $ thickLine 20 ps
[ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps [ setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
] ]
where where
+2 -3
View File
@@ -4,6 +4,7 @@ import Dodge.Base.Collide
import Dodge.Material import Dodge.Material
--import Dodge.Block.Debris --import Dodge.Block.Debris
import Dodge.Zone import Dodge.Zone
import Dodge.Wall.Zone
import Dodge.WorldEvent.Sound import Dodge.WorldEvent.Sound
import Dodge.Wall.Delete import Dodge.Wall.Delete
import Dodge.Wall.Dust import Dodge.Wall.Dust
@@ -34,9 +35,7 @@ unshadowBlock :: Int -> World -> World
unshadowBlock wlid w = case w ^? walls . ix wlid of unshadowBlock wlid w = case w ^? walls . ix wlid of
Just wl -> w Just wl -> w
& walls . ix wlid . wlUnshadowed .~ True & walls . ix wlid . wlUnshadowed .~ True
& wlZoning . znObjects . ix x . ix y . ix wlid . wlUnshadowed .~ True & insertWallInZones (wl & wlUnshadowed .~ True)
where
V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl)
Nothing -> w Nothing -> w
checkBlockHP :: Block -> World -> World checkBlockHP :: Block -> World -> World
+37 -39
View File
@@ -17,59 +17,57 @@ import LensHelp
itemCombinations :: [([(IcAmount,ItemBaseType)],Item)] itemCombinations :: [([(IcAmount,ItemBaseType)],Item)]
itemCombinations = itemCombinations =
[ po [CRAFT PIPE, CRAFT HARDWARE] (bangStick 1) [ po [CRAFT PIPE, CRAFT HARDWARE] (bangStick 1)
, po [BANGSTICK 1, CRAFT TIN] pistol , po [HELD (BANGSTICK 1), CRAFT TIN] pistol
, po [PISTOL, CRAFT SPRING] autoPistol , po [HELD PISTOL, CRAFT SPRING] autoPistol
, po [AUTOPISTOL, cr PLANK] smg , po [HELD AUTOPISTOL, cr PLANK] smg
, po [AUTOPISTOL, cr SPRING] machinePistol , po [HELD AUTOPISTOL, cr SPRING] machinePistol
, po [BANGSTICK 1,cr CAN] revolver , po [HELD (BANGSTICK 1),cr CAN] revolver
, po [REVOLVER, cr SPRING] $ revolverX 1 , po [HELD REVOLVER, cr SPRING] $ revolverX 1
, po [cr CAN,cr HARDWARE] bangCone , po [cr CAN,cr HARDWARE] bangCone
, po [BANGCONE,cr PLANK] blunderbuss , po [HELD BANGCONE,cr PLANK] blunderbuss
, po [BLUNDERBUSS,cr DRUM] (grapeCannon 1) , po [HELD BLUNDERBUSS,cr DRUM] (grapeCannon 1)
-- , po [BANGCONE,PUMP,HARDWARE] $ grenadeLauncher 1 -- , po [BANGCONE,PUMP,HARDWARE] $ grenadeLauncher 1
-- , po [GRENADELAUNCHER 1,MOTOR,DRUM] $ grenadeLauncher 2 -- , po [GRENADELAUNCHER 1,MOTOR,DRUM] $ grenadeLauncher 2
-- , po [cr PIPE, cr HARDWARE] (volleyGun 1) -- , po [cr PIPE, cr HARDWARE] (volleyGun 1)
, po [BANGSTICK 1,cr PLANK] rifle , po [HELD (BANGSTICK 1),cr PLANK] rifle
, po [BANGSTICK 1,BANGSTICK 1,BANGSTICK 1] (volleyGun 3) , po [HELD (BANGSTICK 1),HELD (BANGSTICK 1),HELD (BANGSTICK 1)] (volleyGun 3)
, po [RIFLE,cr TIN] repeater , po [HELD RIFLE,cr TIN] repeater
, po [REPEATER,cr SPRING] autoRifle , po [HELD REPEATER,cr SPRING] autoRifle
, po [REPEATER,cr CAN] burstRifle , po [HELD REPEATER,cr CAN] burstRifle
-- , po [BURSTRIFLE,cr SPRING,cr HARDWARE] fastBurstRifle -- , po [BURSTRIFLE,cr SPRING,cr HARDWARE] fastBurstRifle
-- , po [FASTBURSTRIFLE,cr SPRING,cr HARDWARE] completeBurstRifle -- , po [FASTBURSTRIFLE,cr SPRING,cr HARDWARE] completeBurstRifle
, po [cr MOTOR,VOLLEYGUN 3] $ miniGunX 3 ]
, po [cr MOTOR,VOLLEYGUN 4] $ miniGunX 4 ++ [ po [cr MOTOR,HELD (VOLLEYGUN i)] $ miniGunX i | i <- [3..10]
, po [cr MOTOR,VOLLEYGUN 5] $ miniGunX 5 ] ++
, po [cr MOTOR,VOLLEYGUN 6] $ miniGunX 6
-- , po [BANGSTICK 1,cr TUBE] elephantGun -- , po [BANGSTICK 1,cr TUBE] elephantGun
, po [AMR,cr PIPE] sniperRifle [ po [HELD AMR,cr PIPE] sniperRifle
, po [RIFLE,cr PIPE] amr , po [HELD RIFLE,cr PIPE] amr
, po [AMR,cr SPRING] autoAmr , po [HELD AMR,cr SPRING] autoAmr
, po [AMR,cr MOTOR] machineGun , po [HELD AMR,cr MOTOR] machineGun
, p [p 2 $ cr TUBE,o $ cr HARDWARE] launcher , p [p 2 $ cr TUBE,o $ cr HARDWARE] launcher
, p [p 2 $ cr TUBE,o LAUNCHER] (launcherX 2) , p [p 2 $ cr TUBE,o $ HELD LAUNCHER] (launcherX 2)
] ++ [ p [p 2 $ cr TUBE,o $ LAUNCHERX i] (launcherX (i+1)) | i <- [2..9]] ] ++ [ p [p 2 $ cr TUBE,o $ HELD (LAUNCHERX i)] (launcherX (i+1)) | i <- [2..9]]
++ ++
[ po [cr LIGHTER,cr PUMP,cr CAN] flameSpitter [ po [cr LIGHTER,cr PUMP,cr CAN] flameSpitter
, po [FLAMESPITTER,cr CAN,cr PUMP] blowTorch , po [HELD FLAMESPITTER,cr CAN,cr PUMP] blowTorch
, po [FLAMESPITTER,cr DRUM] flameThrower , po [HELD FLAMESPITTER,cr DRUM] flameThrower
, po [FLAMETHROWER,cr DRUM] flameWall , po [HELD FLAMETHROWER,cr DRUM] flameWall
, po [FLAMETHROWER,cr PUMP] flameTorrent , po [HELD FLAMETHROWER,cr PUMP] flameTorrent
, p [o $ cr PRISM,o $ cr TRANSFORMER,o $ cr PIPE] lasGun , p [o $ cr PRISM,o $ cr TRANSFORMER,o $ cr PIPE] lasGun
-- , p [o LASGUN,o $ cr PRISM] lasSway -- , p [o LASGUN,o $ cr PRISM] lasSway
-- , p [o LASGUN,o $ cr HARDWARE] lasSwing -- , p [o LASGUN,o $ cr HARDWARE] lasSwing
-- , p [o LASGUN,o PIPE] lasGunPulse -- , p [o LASGUN,o PIPE] lasGunPulse
, po [LASGUN,LASGUN,cr HARDWARE] dualBeam , po [HELD LASGUN,HELD LASGUN,cr HARDWARE] dualBeam
-- , p [o LASGUN,o $ cr PIPE, o $ cr PRISM] lasWidePulse -- , p [o LASGUN,o $ cr PIPE, o $ cr PRISM] lasWidePulse
, po [LASGUN, cr TRANSFORMER] (lasWide 2) , po [HELD LASGUN, cr TRANSFORMER] (lasWide 2)
, po [LASGUN,LASGUN,LASGUN,cr HARDWARE] lasCircle , po [HELD LASGUN,HELD LASGUN,HELD LASGUN,cr HARDWARE] lasCircle
, p [o $ cr TRANSFORMER,p 2 $ cr CAN] sparkGun , p [o $ cr TRANSFORMER,p 2 $ cr CAN] sparkGun
, p [o SPARKGUN,p 2 $ cr PIPE] teslaGun , p [o (HELD SPARKGUN),p 2 $ cr PIPE] teslaGun
, p [o $ cr TELEPORTMODULE,p 2 $ cr MICROCHIP] blinkGun , p [o $ cr TELEPORTMODULE,p 2 $ cr MICROCHIP] blinkGun
, p [o BLINKER, p 2 $ cr MICROCHIP] unsafeBlinkGun , p [o BLINKER, p 2 $ cr MICROCHIP] unsafeBlinkGun
@@ -84,13 +82,13 @@ itemCombinations =
, p [p 2 $ cr PLATE] flatShield , p [p 2 $ cr PLATE] flatShield
] ]
++ map (\i -> po [LASWIDE i,cr TRANSFORMER] $ lasWide (i+1)) [2..9] ++ map (\i -> po [HELD (LASWIDE i),cr TRANSFORMER] $ lasWide (i+1)) [2..9]
-- ++ map (\i -> po [LASGUNWIDE i,cr HARDWARE] $ lasFocus i) [2..10] -- ++ map (\i -> po [LASGUNWIDE i,cr HARDWARE] $ lasFocus i) [2..10]
++ map (\i -> po [cr PIPE,BANGSTICK i] $ bangStick (i+1)) [1..8] ++ map (\i -> po [cr PIPE,HELD (BANGSTICK i)] $ bangStick (i+1)) [1..8]
++ map (\i -> po [REVOLVERX i,cr CAN] $ revolverX (i+1)) [1..5] ++ map (\i -> po [HELD (REVOLVERX i),cr CAN] $ revolverX (i+1)) [1..5]
++ map (\i -> po [VOLLEYGUN i,BANGSTICK 1] $ volleyGun (i+1)) [3..5] ++ map (\i -> po [HELD (VOLLEYGUN i),HELD (BANGSTICK 1)] $ volleyGun (i+1)) [3..5]
++ map (\i -> po [MINIGUNX i,BANGSTICK 1] $ miniGunX (i+1)) [3..15] ++ map (\i -> po [HELD (MINIGUNX i),HELD (BANGSTICK 1)] $ miniGunX (i+1)) [3..15]
++ map (\i -> po [GRAPECANNON i,cr DRUM] $ grapeCannon (i+1)) [1,2,3] ++ map (\i -> po [HELD (GRAPECANNON i),cr DRUM] $ grapeCannon (i+1)) [1,2,3]
++ [ po (_iyBase (_itType it):mtype) $ it & itType . iyModules . ix modtype .~ m ++ [ po (_iyBase (_itType it):mtype) $ it & itType . iyModules . ix modtype .~ m
| (modtype,is,ms) <- moduleCombinations | (modtype,is,ms) <- moduleCombinations
@@ -181,7 +179,7 @@ batteryGuns =
, sparkGun , sparkGun
, lasGun , lasGun
-- , lasSway -- , lasSway
, lasSwing -- , lasSwing
] ++ ] ++
[ lasWide i | i <- [2..10] [ lasWide i | i <- [2..10]
] ]
+39 -34
View File
@@ -72,7 +72,42 @@ data ItemBaseType
| EFFGUN String | EFFGUN String
| AUTOEFFGUN String | AUTOEFFGUN String
-- Weapons -- Weapons
| BANGSTICK {_xNum :: Int} | HELD {_ibtHeld :: HeldItemType}
-- | GRENADE
-- | REMOTEBOMB
-- Utility items
| BOOSTER
| REWINDER
| BLINKER
| BLINKERUNSAFE
| SHRINKER
| SPAWNER
-- Equipment
| CLICKDETECTOR Detector
| AUTODETECTOR Detector
| MAGSHIELD
| FLAMESHIELD
| FRONTARMOUR
| WRISTARMOUR
| INVISIBILITYEQUIPMENT EquipSite
| BRAINHAT
| HEADLAMP
| HEADLAMP1
| POWERLEGS
| SPEEDLEGS
| JUMPLEGS
| FLATSHIELD
| JETPACK
--
| KEYCARD Int
--
| MEDKIT Int
| CRAFT CraftType
--
deriving (Eq,Ord,Show,Read)
data HeldItemType
= BANGSTICK {_xNum :: Int}
| PISTOL | PISTOL
| REVOLVER | REVOLVER
| REVOLVERX {_xNum :: Int} | REVOLVERX {_xNum :: Int}
@@ -109,9 +144,9 @@ data ItemBaseType
| TESLAGUN | TESLAGUN
| LASGUN | LASGUN
| LASCIRCLE | LASCIRCLE
| LASPULSE -- | LASPULSE
| DUALBEAM | DUALBEAM
| LASGUNSWING -- | LASGUNSWING
-- | LASGUNSWAY -- | LASGUNSWAY
-- | LASGUNWIDEPULSE -- | LASGUNWIDEPULSE
| LASWIDE {_xNum :: Int} | LASWIDE {_xNum :: Int}
@@ -126,38 +161,8 @@ data ItemBaseType
| DRONELAUNCHER | DRONELAUNCHER
| SHATTERGUN | SHATTERGUN
-- | GRENADE
-- | REMOTEBOMB
-- Utility items
| BOOSTER
| REWINDER
| BLINKER
| BLINKERUNSAFE
| FORCEFIELDGUN | FORCEFIELDGUN
| SHRINKER
| SPAWNER
-- Equipment
| CLICKDETECTOR Detector
| AUTODETECTOR Detector
| MAGSHIELD
| FLAMESHIELD
| FRONTARMOUR
| WRISTARMOUR
| INVISIBILITYEQUIPMENT EquipSite
| BRAINHAT
| HEADLAMP
| HEADLAMP1
| POWERLEGS
| SPEEDLEGS
| JUMPLEGS
| FLATSHIELD
| JETPACK
--
| KEYCARD Int
--
| MEDKIT Int
| CRAFT CraftType
--
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
data ItemModuleType data ItemModuleType
+9 -9
View File
@@ -43,13 +43,13 @@ bulletCombinations = filter
maxShowX :: ItemBaseType -> Maybe Int maxShowX :: ItemBaseType -> Maybe Int
maxShowX bt = case bt of maxShowX bt = case bt of
BANGSTICK _ -> Just 2 HELD (BANGSTICK _) -> Just 2
REVOLVERX _ -> Just 1 HELD (REVOLVERX _) -> Just 1
VOLLEYGUN _ -> Just 3 HELD (VOLLEYGUN _) -> Just 3
MINIGUNX _ -> Just 3 HELD (MINIGUNX _) -> Just 3
GRAPECANNON _ -> Just 1 HELD (GRAPECANNON _) -> Just 1
LAUNCHERX _ -> Just 2 HELD (LAUNCHERX _) -> Just 2
LASWIDE _ -> Just 2 HELD (LASWIDE _) -> Just 2
-- LASGUNFOCUS _ -> Just 2 -- LASGUNFOCUS _ -> Just 2
_ -> Nothing _ -> Nothing
@@ -73,12 +73,12 @@ combinationsGraph = FGL.labnfilter (f . _unCombNode . snd)
f (Left (CRAFT _)) = False f (Left (CRAFT _)) = False
f (Left bt) = case maxShowX bt of f (Left bt) = case maxShowX bt of
Nothing -> True Nothing -> True
Just i -> _xNum bt <= i Just i -> _xNum (_ibtHeld bt) <= i
belowNumX :: ItemBaseType -> Bool belowNumX :: ItemBaseType -> Bool
belowNumX bt = case maxShowX bt of belowNumX bt = case maxShowX bt of
Nothing -> True Nothing -> True
Just i -> _xNum bt <= i Just i -> _xNum (_ibtHeld bt) <= i
toCombNodeLabel :: CombNode -> String toCombNodeLabel :: CombNode -> String
toCombNodeLabel (CombNode (Left ibt)) = show ibt toCombNodeLabel (CombNode (Left ibt)) = show ibt
+2
View File
@@ -71,6 +71,8 @@ parseItem (x:xs)
= (readMaybe (x++" {_xNum=" ++ show (parseNum xs)++"}") <&> (,1)) = (readMaybe (x++" {_xNum=" ++ show (parseNum xs)++"}") <&> (,1))
<|> (readMaybe x <&> (,parseNum xs) ) <|> (readMaybe x <&> (,parseNum xs) )
<|> (readMaybe ("CRAFT "++x) <&> (,parseNum xs)) <|> (readMaybe ("CRAFT "++x) <&> (,parseNum xs))
<|> (readMaybe ("HELD "++x) <&> (,parseNum xs))
<|> (readMaybe ("HELD ("++x++" {_xNum=" ++ show (parseNum xs)++"}") <&> (,1))
<|> parseItem (xs & ix 0 .++~ (x ++ " ")) <|> parseItem (xs & ix 0 .++~ (x ++ " "))
parseItem [] = Nothing parseItem [] = Nothing
+1 -1
View File
@@ -58,7 +58,7 @@ initialAnoTree = OnwardList
, AnRoom pistolerRoom , AnRoom pistolerRoom
, AnRoom doubleCorridorBarrels , AnRoom doubleCorridorBarrels
, IntAnno $ PassthroughLockKeyLists , IntAnno $ PassthroughLockKeyLists
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,SPARKGUN] )] itemRooms [(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,HELD SPARKGUN] )] itemRooms
, IntAnno $ PassthroughLockKeyLists keyCardRunPastRand itemRooms , IntAnno $ PassthroughLockKeyLists keyCardRunPastRand itemRooms
, IntAnno $ AnTree . warningRooms , IntAnno $ AnTree . warningRooms
, AnTree $ rToOnward "chaseCrit+armourChaseCrit rectRoom" , AnTree $ rToOnward "chaseCrit+armourChaseCrit rectRoom"
+38 -144
View File
@@ -22,6 +22,39 @@ itemFromBase ibt = case ibt of
EFFGUN _ -> undefined EFFGUN _ -> undefined
AUTOEFFGUN _ -> undefined AUTOEFFGUN _ -> undefined
-- Weapons -- Weapons
HELD ht -> itemFromHeldType ht
--GRENADE
--REMOTEBOMB
-- Utility items
BOOSTER -> boosterGun
REWINDER -> rewindGun
BLINKER -> blinkGun
BLINKERUNSAFE -> unsafeBlinkGun
SHRINKER -> shrinkGun
SPAWNER -> error "need to datify creatures first"
-- Equipment
CLICKDETECTOR d -> clickDetector d
AUTODETECTOR d -> autoDetector d
MAGSHIELD -> magShield
FLAMESHIELD -> flameShield
FRONTARMOUR -> frontArmour
WRISTARMOUR -> wristArmour
INVISIBILITYEQUIPMENT GoesOnWrist -> wristInvisibility
INVISIBILITYEQUIPMENT _ -> error "need to define invisibility for more than wrist"
BRAINHAT -> brainHat
HEADLAMP -> headLamp
HEADLAMP1 -> headLamp1
POWERLEGS -> powerLegs
SPEEDLEGS -> speedLegs
JUMPLEGS -> jumpLegs
FLATSHIELD -> flatShield
JETPACK -> jetPack
CRAFT cr -> makeTypeCraft cr
KEYCARD i -> keyCard i
MEDKIT i -> medkit i
itemFromHeldType :: HeldItemType -> Item
itemFromHeldType ht = case ht of
SHATTERGUN -> shatterGun
BANGSTICK i -> bangStick i BANGSTICK i -> bangStick i
PISTOL -> pistol PISTOL -> pistol
REVOLVER -> revolver REVOLVER -> revolver
@@ -60,9 +93,9 @@ itemFromBase ibt = case ibt of
TESLAGUN -> teslaGun TESLAGUN -> teslaGun
LASGUN -> lasGun LASGUN -> lasGun
LASCIRCLE -> lasCircle LASCIRCLE -> lasCircle
LASPULSE -> lasPulse --LASPULSE -> lasPulse
DUALBEAM -> dualBeam DUALBEAM -> dualBeam
LASGUNSWING -> lasSwing --LASGUNSWING -> lasSwing
--LASGUNSWAY -> lasSway --LASGUNSWAY -> lasSway
-- LASGUNWIDEPULSE -> lasWidePulse -- LASGUNWIDEPULSE -> lasWidePulse
LASWIDE i -> lasWide i LASWIDE i -> lasWide i
@@ -75,156 +108,17 @@ itemFromBase ibt = case ibt of
REMOTELAUNCHER -> remoteLauncher REMOTELAUNCHER -> remoteLauncher
POISONSPRAYER -> poisonSprayer POISONSPRAYER -> poisonSprayer
DRONELAUNCHER -> droneLauncher DRONELAUNCHER -> droneLauncher
--GRENADE
--REMOTEBOMB
-- Utility items
BOOSTER -> boosterGun
REWINDER -> rewindGun
BLINKER -> blinkGun
BLINKERUNSAFE -> unsafeBlinkGun
FORCEFIELDGUN -> forceFieldGun FORCEFIELDGUN -> forceFieldGun
SHRINKER -> shrinkGun
SHATTERGUN -> shatterGun
SPAWNER -> error "need to datify creatures first"
-- Equipment
CLICKDETECTOR d -> clickDetector d
AUTODETECTOR d -> autoDetector d
MAGSHIELD -> magShield
FLAMESHIELD -> flameShield
FRONTARMOUR -> frontArmour
WRISTARMOUR -> wristArmour
INVISIBILITYEQUIPMENT GoesOnWrist -> wristInvisibility
INVISIBILITYEQUIPMENT _ -> error "need to define invisibility for more than wrist"
BRAINHAT -> brainHat
HEADLAMP -> headLamp
HEADLAMP1 -> headLamp1
POWERLEGS -> powerLegs
SPEEDLEGS -> speedLegs
JUMPLEGS -> jumpLegs
FLATSHIELD -> flatShield
JETPACK -> jetPack
CRAFT cr -> makeTypeCraft cr
KEYCARD i -> keyCard i
MEDKIT i -> medkit i
--
-- Crafting
--PIPE
--TUBE
--HARDWARE
--SPRING
--CAN
--TIN
--DRUM
--PLANK
--SHARDGLASS
--PUMP
--MOTOR
--TRANSFORMER
--PRISM
--LIGHTER
--MAGNET
--ANTIMATTER
--PLATE
--TRANSMITTER
--MICROCHIP
--AIUNIT
--CAMERA
--MINIDISPLAY -- visual display unit
--LED
--NAILBOX
--IRONBAR
--LIGHTSENSOR
--SOUNDSENSOR
--HEATSENSOR
--CREATURESENSOR
--WIRE
--BATTERY
--FUELCELL
--PORTABLEFUSION
-- Modules
-- bullet
--INCENDIARYMODULE
--STATICMODULE
--CONCUSSMODULE
--FRAGMODULE
--FLASHMODULE
--BOUNCEMODULE
--
--TELEPORTMODULE
--TIMEMODULE
--SIZEMODULE
--GRAVITYMODULE
--
--
--NoCombineType
--
baseToFamily :: ItemBaseType -> ItemFamily baseToFamily :: ItemBaseType -> ItemFamily
baseToFamily ibt = case ibt of baseToFamily ibt = case ibt of
NOTDEFINED -> undefined NOTDEFINED -> undefined
EFFGUN _ -> HeldFamily EFFGUN _ -> undefined
AUTOEFFGUN _ -> HeldFamily AUTOEFFGUN _ -> undefined
BANGSTICK _ -> HeldFamily HELD _ -> HeldFamily
PISTOL -> HeldFamily
REVOLVER -> HeldFamily
REVOLVERX _ -> HeldFamily
MACHINEPISTOL -> HeldFamily
AUTOPISTOL -> HeldFamily
SMG -> HeldFamily
BANGCONE -> HeldFamily
BLUNDERBUSS -> HeldFamily
GRAPECANNON _ -> HeldFamily
-- | GRENADELAUNCHER In-> HeldFamilyt -- number of chambers that can be reloaded
-- | MORTARCONE / HANDM-> HeldFamilyORTAR
-- | MINIGUN -> HeldFamily
MINIGUNX _ -> HeldFamily
VOLLEYGUN _ -> HeldFamily
RIFLE -> HeldFamily
REPEATER -> HeldFamily
AUTORIFLE -> HeldFamily
BURSTRIFLE -> HeldFamily
-- FASTBURSTRIFLE -> HeldFamily
-- COMPLETEBURSTRIFLE -> HeldFamily
BANGROD -> HeldFamily
ELEPHANTGUN -> HeldFamily
AMR -> HeldFamily
AUTOAMR -> HeldFamily
SNIPERRIFLE -> HeldFamily
MACHINEGUN -> HeldFamily
FLAMESPITTER -> HeldFamily
FLAMETHROWER -> HeldFamily
FLAMETORRENT -> HeldFamily
FLAMEWALL -> HeldFamily
BLOWTORCH -> HeldFamily
AUTOGUN -> HeldFamily
-- | SPREADGUN -> HeldFamily
-- | MULTGUN -> HeldFamily
SPARKGUN -> HeldFamily
TESLAGUN -> HeldFamily
LASGUN -> HeldFamily
LASCIRCLE -> HeldFamily
LASPULSE -> HeldFamily
DUALBEAM -> HeldFamily
LASGUNSWING -> HeldFamily
-- LASGUNSWAY -> HeldFamily
-- LASGUNWIDEPULSE -> HeldFamily
LASWIDE _ -> HeldFamily
--LASGUNFOCUS _ -> HeldFamily
SONICGUN -> HeldFamily
TRACTORGUN -> HeldFamily
LAUNCHER -> HeldFamily
LAUNCHERX _ -> HeldFamily
-- | TRACKINGLAUNCHER -> HeldFamily
REMOTELAUNCHER -> HeldFamily
POISONSPRAYER -> HeldFamily
DRONELAUNCHER -> HeldFamily
SHATTERGUN -> HeldFamily
-- | GRENADE
-- | REMOTEBOMB
BOOSTER -> LeftClickFamily BOOSTER -> LeftClickFamily
REWINDER -> LeftClickFamily REWINDER -> LeftClickFamily
BLINKER -> LeftClickFamily BLINKER -> LeftClickFamily
BLINKERUNSAFE -> LeftClickFamily BLINKERUNSAFE -> LeftClickFamily
FORCEFIELDGUN -> LeftClickFamily
SHRINKER -> LeftClickFamily SHRINKER -> LeftClickFamily
SPAWNER -> LeftClickFamily SPAWNER -> LeftClickFamily
CLICKDETECTOR _ -> HeldFamily CLICKDETECTOR _ -> HeldFamily
+1
View File
@@ -17,6 +17,7 @@ import qualified Data.IntMap.Strict as IM
import Control.Lens import Control.Lens
import Data.Maybe import Data.Maybe
itemEquipPict :: Creature -> Item -> SPic itemEquipPict :: Creature -> Item -> SPic
itemEquipPict cr it = case it ^?! itUse of itemEquipPict cr it = case it ^?! itUse of
RightUse {} -> pictureWeaponOnAim cr it RightUse {} -> pictureWeaponOnAim cr it
+105
View File
@@ -0,0 +1,105 @@
module Dodge.Item.Draw.SPic where
itemSPic :: Item -> SPic
itemSPic it = modulesSPic it <> case it ^. itType . iyBase of
HELD ht -> heldItemSPic ht it
_ -> mempty
-- NOTDEFINED ->
-- EFFGUN _ ->
-- AUTOEFFGUN _ ->
--
--
-- BOOSTER
-- REWINDER
-- BLINKER
-- BLINKERUNSAFE
-- FORCEFIELDGUN
-- SHRINKER
-- SPAWNER
--
-- CLICKDETECTOR Detector
-- AUTODETECTOR Detector
-- MAGSHIELD
-- FLAMESHIELD
-- FRONTARMOUR
-- WRISTARMOUR
-- INVISIBILITYEQUIPMENT EquipSite
-- BRAINHAT
-- HEADLAMP
-- HEADLAMP1
-- POWERLEGS
-- SPEEDLEGS
-- JUMPLEGS
-- FLATSHIELD
-- JETPACK
--
-- KEYCARD Int
--
-- MEDKIT Int
-- CRAFT CraftType
heldItemSPic ht it = case ht of
BANGSTICK i -> noPic & baseStickShapeX i <> stickClip it
-- PISTOL ->
-- REVOLVER ->
-- REVOLVERX i ->
-- MACHINEPISTOL ->
-- AUTOPISTOL ->
-- SMG ->
-- BANGCONE ->
-- BLUNDERBUSS ->
-- GRAPECANNON i ->
-- MINIGUNX i ->
-- VOLLEYGUN i ->
-- RIFLE ->
-- REPEATER ->
-- AUTORIFLE ->
-- BURSTRIFLE ->
-- BANGROD ->
-- ELEPHANTGUN ->
-- AMR ->
-- AUTOAMR ->
-- SNIPERRIFLE ->
-- MACHINEGUN ->
-- FLAMESPITTER ->
-- FLAMETHROWER ->
-- FLAMETORRENT ->
-- FLAMEWALL ->
-- BLOWTORCH ->
-- AUTOGUN ->
-- SPARKGUN ->
-- TESLAGUN ->
-- LASGUN ->
-- LASCIRCLE ->
-- DUALBEAM ->
-- LASWIDE i ->
-- SONICGUN ->
-- TRACTORGUN ->
-- LAUNCHER ->
-- LAUNCHERX i ->
-- REMOTELAUNCHER ->
-- POISONSPRAYER ->
-- DRONELAUNCHER ->
-- SHATTERGUN ->
modulesSPic :: Item -> SPic
modulesSPic it = mempty
baseStickShapeX :: Int -> Shape
baseStickShapeX i = foldMap f [0..i-1]
where
f j = rotateSH ang baseStickShape
where
ang = fromIntegral j * baseStickSpread - (fromIntegral i - 1) * baseStickSpread * 0.5
baseStickSpread :: Float
baseStickSpread = 0.2
stickClip :: Item -> Shape
stickClip it = case it ^? itConsumption . laLoaded of
Just x | x > 0 -> foldMap f [0..x-1]
_ -> mempty
where
f i = rotateSH ang $ translateSH (V3 5 0 3) $ upperPrismPoly 2 $ square 1.5
where
ang = baseStickSpread * fromIntegral i
- 0.5 * baseStickSpread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1)
+44 -45
View File
@@ -5,9 +5,9 @@ module Dodge.Item.Weapon.BatteryGuns
, lasWide , lasWide
-- , lasWidePulse -- , lasWidePulse
--, lasSway --, lasSway
, lasSwing -- , lasSwing
--, lasFocus --, lasFocus
, lasPulse -- , lasPulse
, sparkGun , sparkGun
, teslaGun , teslaGun
, teslaParams , teslaParams
@@ -70,7 +70,7 @@ defaultAutoBatteryGun = defaultAutoGun
sparkGun :: Item sparkGun :: Item
sparkGun = teslaGun sparkGun = teslaGun
& itType . iyBase .~ SPARKGUN & itType . iyBase .~ HELD SPARKGUN
& itParams . arcSize .~ 10 & itParams . arcSize .~ 10
teslaGun :: Item teslaGun :: Item
teslaGun = defaultBatteryGun teslaGun = defaultBatteryGun
@@ -96,7 +96,7 @@ teslaGun = defaultBatteryGun
& itUse . useAim . aimStance .~ TwoHandFlat & itUse . useAim . aimStance .~ TwoHandFlat
& itUse . useAim . aimHandlePos .~ 4 & itUse . useAim . aimHandlePos .~ 4
& itUse . useAim . aimMuzPos .~ 4 & itUse . useAim . aimMuzPos .~ 4
& itType . iyBase .~ TESLAGUN & itType . iyBase .~ HELD TESLAGUN
teslaGunPic :: Item -> SPic teslaGunPic :: Item -> SPic
teslaGunPic _ = noPic $ colorSH blue $ teslaGunPic _ = noPic $ colorSH blue $
upperPrismPoly 5 (rectNESW xb 8 xa 0) upperPrismPoly 5 (rectNESW xb 8 xa 0)
@@ -104,27 +104,27 @@ teslaGunPic _ = noPic $ colorSH blue $
where where
xa = 1 xa = 1
xb = 9 xb = 9
lasPulse :: Item --lasPulse :: Item
lasPulse = lasGun --lasPulse = lasGun
& itType . iyBase .~ LASPULSE -- & itType . iyBase .~ LASPULSE
& itUse . useMods .~ -- & itUse . useMods .~
[ ammoCheckI -- [ ammoCheckI
, withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it)) -- , withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2 -- , withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2
, withItemUpdate itup -- , withItemUpdate itup
$ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8) -- $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8)
, useAmmoAmount 1 -- , useAmmoAmount 1
] -- ]
where -- where
itup it = it -- itup it = it
& itParams . lasCycle %~ (\i -> (i+1) `mod` 20) -- & itParams . lasCycle %~ (\i -> (i+1) `mod` 20)
& itParams . lasDamage .~ ceiling ((22 :: Float) * frac it) -- & itParams . lasDamage .~ ceiling ((22 :: Float) * frac it)
& itParams . lasColor .~ frac it * orange -- & itParams . lasColor .~ frac it * orange
frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1)) -- frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1))
lasCircle :: Item lasCircle :: Item
lasCircle = lasGun lasCircle = lasGun
& itType . iyBase .~ LASCIRCLE & itType . iyBase .~ HELD LASCIRCLE
& itParams . lasColor .~ orange & itParams . lasColor .~ orange
& itParams . lasDamage .~ 2 & itParams . lasDamage .~ 2
& itConsumption . laMax .~ 10000 & itConsumption . laMax .~ 10000
@@ -150,7 +150,7 @@ lasCircle = lasGun
lasWide :: Int -> Item lasWide :: Int -> Item
lasWide n = lasGun lasWide n = lasGun
& itType . iyBase .~ LASWIDE n & itType . iyBase .~ HELD (LASWIDE n)
& itParams . lasColor .~ yellow & itParams . lasColor .~ yellow
& itParams . lasDamage .~ 2 & itParams . lasDamage .~ 2
& itUse . useMods .~ & itUse . useMods .~
@@ -238,7 +238,7 @@ lasWide n = lasGun
dualBeam :: Item dualBeam :: Item
dualBeam = lasGun dualBeam = lasGun
& itType . iyBase .~ DUALBEAM & itType . iyBase .~ HELD DUALBEAM
& itUse . useAim . aimMuzPos .~ 0 & itUse . useAim . aimMuzPos .~ 0
& itDimension .dimSPic .~ dualBeamPic & itDimension .dimSPic .~ dualBeamPic
& itParams .~ DualBeam & itParams .~ DualBeam
@@ -266,24 +266,24 @@ dualBeam = lasGun
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE & itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
where where
thegap = _dbGap . _itParams thegap = _dbGap . _itParams
lasSwing :: Item --lasSwing :: Item
lasSwing = lasGun --lasSwing = lasGun
& itType . iyBase .~ LASGUNSWING -- & itType . iyBase .~ LASGUNSWING
& itParams . lasColor .~ orange -- & itParams . lasColor .~ orange
& itUse . useMods .~ -- & itUse . useMods .~
[ ammoCheckI -- [ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it)) -- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2 -- , withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1 -- , useAmmoAmount 1
, withItemUpdate itup $ \it -> duplicateOffsetsFocus (x it) -- , withItemUpdate itup $ \it -> duplicateOffsetsFocus (x it)
] -- ]
where -- where
itup = itParams . lasCycle %~ (\i -> (i+1) `mod` 200) -- itup = itParams . lasCycle %~ (\i -> (i+1) `mod` 200)
x it = [-y,y] -- x it = [-y,y]
where -- where
y = 15 * sin (pi * fromIntegral x' * 0.01) -- y = 15 * sin (pi * fromIntegral x' * 0.01)
x' = _lasCycle $ _itParams it -- x' = _lasCycle $ _itParams it
lasGun :: Item lasGun :: Item
lasGun = defaultAutoBatteryGun lasGun = defaultAutoBatteryGun
& itConsumption .~ ( defaultLoadable & itConsumption .~ ( defaultLoadable
@@ -321,7 +321,7 @@ lasGun = defaultAutoBatteryGun
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30 & itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ LASGUN & itType . iyBase .~ HELD LASGUN
lasGunPic :: Item -> SPic lasGunPic :: Item -> SPic
lasGunPic it = lasGunPic it =
@@ -392,7 +392,7 @@ tractorGun = lasGun
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30 & itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ TRACTORGUN & itType . iyBase .~ HELD TRACTORGUN
tractorGunTweak :: TweakParam tractorGunTweak :: TweakParam
tractorGunTweak = TweakParam tractorGunTweak = TweakParam
@@ -437,7 +437,6 @@ shootTeslaArc it cr w = w'
shootLaser :: Item -> Creature -> World -> World shootLaser :: Item -> Creature -> World -> World
shootLaser it cr = instantParticles .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir shootLaser it cr = instantParticles .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir
where where
--pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
pos = _crPos cr pos = _crPos cr
dir = _crDir cr dir = _crDir cr
phasev = _phaseV . _itParams $ _crInv cr IM.! crSel cr phasev = _phaseV . _itParams $ _crInv cr IM.! crSel cr
+6 -6
View File
@@ -115,7 +115,7 @@ volleyGun i = defaultBulletWeapon
,_brlInaccuracy = 0.1 ,_brlInaccuracy = 0.1
} }
& itParams . torqueAfter .~ 0.48 + 0.2 * fromIntegral i & itParams . torqueAfter .~ 0.48 + 0.2 * fromIntegral i
& itType . iyBase .~ VOLLEYGUN i & itType . iyBase .~ HELD (VOLLEYGUN i)
caneStickSoundChoice :: Item -> SoundID caneStickSoundChoice :: Item -> SoundID
caneStickSoundChoice it caneStickSoundChoice it
| _laLoaded (_itConsumption it) < 2 = tap3S | _laLoaded (_itConsumption it) < 2 = tap3S
@@ -137,7 +137,7 @@ rifle = defaultBangCane
} }
} }
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itType . iyBase .~ RIFLE & itType . iyBase .~ HELD RIFLE
& itConsumption . laMax .~ 1 & itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadEject 5, loadInsert 5 ,loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert 5 ,loadPrime 5]
& itUse . useAim . aimWeight .~ 6 & itUse . useAim . aimWeight .~ 6
@@ -147,7 +147,7 @@ rifle = defaultBangCane
repeater :: Item repeater :: Item
repeater = rifle repeater = rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE & itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ REPEATER & itType . iyBase .~ HELD REPEATER
& itConsumption . laCycle .~ [loadEject 50, loadInsert 40 ,loadPrime 20] & itConsumption . laCycle .~ [loadEject 50, loadInsert 40 ,loadPrime 20]
& itConsumption . laMax .~ 15 & itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape & itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
@@ -162,13 +162,13 @@ baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
autoRifle :: Item autoRifle :: Item
autoRifle = repeater autoRifle = repeater
& itType . iyBase .~ AUTORIFLE & itType . iyBase .~ HELD AUTORIFLE
& itUse . useMods %~ ((ammoCheckI :) . tail) & itUse . useMods %~ ((ammoCheckI :) . tail)
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
-- & itUse . useDelay . rateMax .~ 6 -- & itUse . useDelay . rateMax .~ 6
burstRifle :: Item burstRifle :: Item
burstRifle = repeater burstRifle = repeater
& itType . iyBase .~ BURSTRIFLE & itType . iyBase .~ HELD BURSTRIFLE
& itParams . gunBarrels . brlInaccuracy .~ 0.05 & itParams . gunBarrels . brlInaccuracy .~ 0.05
& itUse . useDelay . rateMax .~ 18 & itUse . useDelay . rateMax .~ 18
& itUse . useMods .~ & itUse . useMods .~
@@ -282,7 +282,7 @@ miniGunX i = defaultAutoGun
, _dimSPic = miniGunXPictItem i , _dimSPic = miniGunXPictItem i
} }
} }
& itType . iyBase .~ MINIGUNX i & itType . iyBase .~ HELD (MINIGUNX i)
& itUse . useAim . aimMuzPos .~ 40 & itUse . useAim . aimMuzPos .~ 40
miniGunXPictItem :: Int -> Item -> SPic miniGunXPictItem :: Int -> Item -> SPic
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it) miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it)
+6 -6
View File
@@ -65,7 +65,7 @@ bangRod = defaultBulletWeapon
} }
& itConsumption . laMax .~ 1 & itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5]
& itType . iyBase .~ BANGROD & itType . iyBase .~ HELD BANGROD
& itUse . useAim . aimWeight .~ 8 & itUse . useAim . aimWeight .~ 8
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand & itUse . useAim . aimStance .~ OneHand
@@ -79,7 +79,7 @@ baseAMRShape :: Shape
baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2 baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
elephantGun :: Item elephantGun :: Item
elephantGun = bangRod elephantGun = bangRod
& itType . iyBase .~ ELEPHANTGUN & itType . iyBase .~ HELD ELEPHANTGUN
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itParams . gunBarrels .~ SingleBarrel 0.05 & itParams . gunBarrels .~ SingleBarrel 0.05
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape & itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
@@ -100,7 +100,7 @@ elephantGun = bangRod
& itParams . torqueAfter .~ 0.1 & itParams . torqueAfter .~ 0.1
amr :: Item amr :: Item
amr = elephantGun amr = elephantGun
& itType . iyBase .~ AMR & itType . iyBase .~ HELD AMR
& itConsumption . laMax .~ 15 & itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape & itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
<> makeTinClipAt 0 (V3 10 (-2) 0) it <> makeTinClipAt 0 (V3 10 (-2) 0) it
@@ -108,12 +108,12 @@ amr = elephantGun
autoAmr :: Item autoAmr :: Item
autoAmr = amr autoAmr = amr
& itType . iyBase .~ AUTOAMR & itType . iyBase .~ HELD AUTOAMR
& itUse . useMods %~ ((ammoCheckI :) . tail) & itUse . useMods %~ ((ammoCheckI :) . tail)
sniperRifle :: Item sniperRifle :: Item
sniperRifle = elephantGun sniperRifle = elephantGun
& itType . iyBase .~ SNIPERRIFLE & itType . iyBase .~ HELD SNIPERRIFLE
& itParams . gunBarrels .~ SingleBarrel 0 & itParams . gunBarrels .~ SingleBarrel 0
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5} & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
& itUse . heldScroll .~ zoomLongGun & itUse . heldScroll .~ zoomLongGun
@@ -122,7 +122,7 @@ sniperRifle = elephantGun
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1} & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
machineGun :: Item machineGun :: Item
machineGun = bangRod machineGun = bangRod
& itType . iyBase .~ MACHINEGUN & itType . iyBase .~ HELD MACHINEGUN
& itUse . useDelay . rateMax .~ 25 & itUse . useDelay . rateMax .~ 25
& itUse . useMods .~ & itUse . useMods .~
[ ammoCheckI [ ammoCheckI
+7 -7
View File
@@ -75,7 +75,7 @@ bangStick i = defaultBulletWeapon
<> stickClip it <> stickClip it
} }
} }
& itType . iyBase .~ BANGSTICK i & itType . iyBase .~ HELD (BANGSTICK i)
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 10 & itUse . useAim . aimMuzPos .~ 10
& itConsumption . laMax .~ i & itConsumption . laMax .~ i
@@ -111,7 +111,7 @@ revolver = pistol
& laMax .~ 6 & laMax .~ 6
& laCycle .~ [loadPartialInsert 10 1] ) & laCycle .~ [loadPartialInsert 10 1] )
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> revolverClip it) & itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> revolverClip it)
& itType . iyBase .~ REVOLVER & itType . iyBase .~ HELD REVOLVER
revolverClip :: Item -> Shape revolverClip :: Item -> Shape
revolverClip it = case it ^? itConsumption . laLoaded of revolverClip it = case it ^? itConsumption . laLoaded of
@@ -170,23 +170,23 @@ pistol = bangStick 1
. ( recoil .~ 10 ) . ( recoil .~ 10 )
. ( torqueAfter .~ 0.2 ) . ( torqueAfter .~ 0.2 )
) )
& itType . iyBase .~ PISTOL & itType . iyBase .~ HELD PISTOL
autoPistol :: Item autoPistol :: Item
autoPistol = pistol autoPistol = pistol
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods) & itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
& itType . iyBase .~ AUTOPISTOL & itType . iyBase .~ HELD AUTOPISTOL
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
machinePistol :: Item machinePistol :: Item
machinePistol = autoPistol machinePistol = autoPistol
& itUse . useDelay . rateMax .~ 2 & itUse . useDelay . rateMax .~ 2
& itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods) & itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ MACHINEPISTOL & itType . iyBase .~ HELD MACHINEPISTOL
& itType . iyModules . at ModAutoMag .~ Nothing & itType . iyModules . at ModAutoMag .~ Nothing
& itParams . recoil .~ 20 & itParams . recoil .~ 20
smg :: Item smg :: Item
smg = autoPistol -- & some parameter affecting stability smg = autoPistol -- & some parameter affecting stability
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods) & itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ SMG & itType . iyBase .~ HELD SMG
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 2 & itUse . useAim . aimHandlePos .~ 2
& itParams . torqueAfter .~ 0.05 & itParams . torqueAfter .~ 0.05
@@ -211,4 +211,4 @@ revolverX i = revolver
, withRecoil , withRecoil
] ]
& itConsumption . laMax .~ i * 6 & itConsumption . laMax .~ i * 6
& itType . iyBase .~ REVOLVERX i & itType . iyBase .~ HELD (REVOLVERX i)
+4 -4
View File
@@ -78,7 +78,7 @@ autoGun = defaultAutoGun
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& itUse . heldScroll .~ scrollCharMode & itUse . heldScroll .~ scrollCharMode
& itType . iyBase .~ AUTOGUN & itType . iyBase .~ HELD AUTOGUN
autoGunPic :: Item -> SPic autoGunPic :: Item -> SPic
autoGunPic it = noPic $ autoGunPic it = noPic $
colorSH red (prismPoly colorSH red (prismPoly
@@ -125,7 +125,7 @@ bangCone = defaultBulletWeapon
] ]
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 15 & itUse . useAim . aimMuzPos .~ 15
& itType . iyBase .~ BANGCONE & itType . iyBase .~ HELD BANGCONE
& itConsumption . laMax .~ 5 & itConsumption . laMax .~ 5
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
coneRandItemUpdate :: State StdGen (Item -> Item) coneRandItemUpdate :: State StdGen (Item -> Item)
@@ -156,10 +156,10 @@ blunderbuss = bangCone
& itUse . useAim . aimWeight .~ 6 & itUse . useAim . aimWeight .~ 6
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30 & itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ BLUNDERBUSS & itType . iyBase .~ HELD BLUNDERBUSS
grapeCannon :: Int -> Item grapeCannon :: Int -> Item
grapeCannon i = blunderbuss grapeCannon i = blunderbuss
& itType . iyBase .~ GRAPECANNON i & itType . iyBase .~ HELD (GRAPECANNON i)
& itConsumption . laMax .~ 25 + 25 * i & itConsumption . laMax .~ 25 + 25 * i
& itConsumption . laCycle .~ [loadEject 5, loadInsert (30 + i * 10) , loadPrime 5] & itConsumption . laCycle .~ [loadEject 5, loadInsert (30 + i * 10) , loadPrime 5]
& itParams . recoil .~ (150 + fromIntegral i * 50) & itParams . recoil .~ (150 + fromIntegral i * 50)
+1 -1
View File
@@ -33,7 +33,7 @@ droneLauncher = defaultWeapon
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itConsumption . laAmmoType .~ DroneAmmo { _amString = "LASDRONE" } & itConsumption . laAmmoType .~ DroneAmmo { _amString = "LASDRONE" }
& itConsumption . laMax .~ 2 & itConsumption . laMax .~ 2
& itType . iyBase .~ DRONELAUNCHER & itType . iyBase .~ HELD DRONELAUNCHER
lasDronesPic :: Item -> SPic lasDronesPic :: Item -> SPic
lasDronesPic _ = lasDronesPic _ =
+3 -3
View File
@@ -77,12 +77,12 @@ launcher = defaultWeapon
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 20 & itUse . useAim . aimMuzPos .~ 20
& itType . iyBase .~ LAUNCHER & itType . iyBase .~ HELD LAUNCHER
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE & itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
launcherX :: Int -> Item launcherX :: Int -> Item
launcherX i = launcher launcherX i = launcher
& itType . iyBase .~ LAUNCHERX i & itType . iyBase .~ HELD (LAUNCHERX i)
& itConsumption . laMax .~ i & itConsumption . laMax .~ i
& itConsumption . laLoaded .~ i & itConsumption . laLoaded .~ i
& itUse . rUse .~ usePjCreationX i & itUse . rUse .~ usePjCreationX i
@@ -278,7 +278,7 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
remoteLauncher :: Item remoteLauncher :: Item
remoteLauncher = launcher remoteLauncher = launcher
& itType . iyBase .~ REMOTELAUNCHER & itType . iyBase .~ HELD REMOTELAUNCHER
& itUse . rUse .~ fireRemoteShell & itUse . rUse .~ fireRemoteShell
& itScope .~ RemoteScope (V2 0 0) 1 True & itScope .~ RemoteScope (V2 0 0) 1 True
& itConsumption . laAmmoType . amPjDraw .~ drawRemoteShell & itConsumption . laAmmoType . amPjDraw .~ drawRemoteShell
+1 -1
View File
@@ -28,7 +28,7 @@ import LensHelp
shatterGun :: Item shatterGun :: Item
shatterGun = defaultWeapon shatterGun = defaultWeapon
& itType . iyBase .~ SHATTERGUN & itType . iyBase .~ HELD SHATTERGUN
& itUse . useDelay . rateMax .~ 10 & itUse . useDelay . rateMax .~ 10
& itUse . rUse .~ shootShatter & itUse . rUse .~ shootShatter
& itUse . useMods .~ & itUse . useMods .~
+1 -1
View File
@@ -53,7 +53,7 @@ sonicGun = defaultAutoGun
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimMuzPos .~ 25 & itUse . useAim . aimMuzPos .~ 25
& itType . iyBase .~ SONICGUN & itType . iyBase .~ HELD SONICGUN
baseSonicShape :: Shape baseSonicShape :: Shape
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2 baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
+6 -6
View File
@@ -40,7 +40,7 @@ import Control.Monad.State
import System.Random import System.Random
poisonSprayer :: Item poisonSprayer :: Item
poisonSprayer = flameThrower poisonSprayer = flameThrower
& itType . iyBase .~ POISONSPRAYER & itType . iyBase .~ HELD POISONSPRAYER
& itConsumption . laAmmoType .~ GasAmmo & itConsumption . laAmmoType .~ GasAmmo
{ _amString = "POISONGAS" { _amString = "POISONGAS"
, _amCreateGas = aGasCloud , _amCreateGas = aGasCloud
@@ -67,7 +67,7 @@ flamerPic it =
am = fractionLoadedAmmo2 it am = fractionLoadedAmmo2 it
flameSpitter :: Item flameSpitter :: Item
flameSpitter = flameThrower flameSpitter = flameThrower
& itType . iyBase .~ FLAMESPITTER & itType . iyBase .~ HELD FLAMESPITTER
& itConsumption . laMax .~ 10 & itConsumption . laMax .~ 10
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 20] & itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 20]
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4 & itParams . sprayNozzles . ix 0 . nzPressure .~ 4
@@ -90,7 +90,7 @@ flameSpitter = flameThrower
flameTorrent :: Item flameTorrent :: Item
flameTorrent = flameThrower flameTorrent = flameThrower
& itType . iyBase .~ FLAMETORRENT & itType . iyBase .~ HELD FLAMETORRENT
& itUse . useAim . aimZoom .~ defaultItZoom & itUse . useAim . aimZoom .~ defaultItZoom
& itParams . sprayNozzles . ix 0 %~ & itParams . sprayNozzles . ix 0 %~
( (nzPressure .~ 10) ( (nzPressure .~ 10)
@@ -100,10 +100,10 @@ flameTorrent = flameThrower
blowTorch :: Item blowTorch :: Item
blowTorch = flameThrower blowTorch = flameThrower
& itType . iyBase .~ BLOWTORCH & itType . iyBase .~ HELD BLOWTORCH
flameWall :: Item flameWall :: Item
flameWall = flameThrower flameWall = flameThrower
& itType . iyBase .~ FLAMEWALL & itType . iyBase .~ HELD FLAMEWALL
& itParams . sprayNozzles .~ zipWith makeNozzle [0,0.6,-0.6] [2,2.5,2.5] & itParams . sprayNozzles .~ zipWith makeNozzle [0,0.6,-0.6] [2,2.5,2.5]
where where
makeNozzle dir pres = Nozzle makeNozzle dir pres = Nozzle
@@ -157,7 +157,7 @@ flameThrower = defaultAutoGun
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 0 & itUse . useAim . aimHandlePos .~ 0
& itUse . useAim . aimMuzPos .~ 18 & itUse . useAim . aimMuzPos .~ 18
& itType . iyBase .~ FLAMETHROWER & itType . iyBase .~ HELD FLAMETHROWER
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
aGasCloud pressure pos dir cr = makeGasCloud pos aGasCloud pressure pos dir cr = makeGasCloud pos
+1 -1
View File
@@ -124,7 +124,7 @@ forceFieldGun = defaultWeapon
& itUse . useDelay .~ NoDelay & itUse . useDelay .~ NoDelay
& itUse . useMods .~ & itUse . useMods .~
[ hammerCheckI , ammoCheckI , useAmmoAmount 1] [ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType . iyBase .~ FORCEFIELDGUN & itType . iyBase .~ HELD FORCEFIELDGUN
-- I believe because the targeting returns to nothing straight after you release -- I believe because the targeting returns to nothing straight after you release
-- the rmb, it is possible for this to do nothing -- the rmb, it is possible for this to do nothing
-- TODO investigate more and fix -- TODO investigate more and fix
+16 -16
View File
@@ -15,7 +15,7 @@ import Dodge.Item
bossKeyItems :: RandomGen g => [ (State g (Tree Room), State g ItemBaseType) ] bossKeyItems :: RandomGen g => [ (State g (Tree Room), State g ItemBaseType) ]
bossKeyItems = [(return . cleatOnward <$> bossRoom autoCrit, takeOne [PISTOL]) ] bossKeyItems = [(return . cleatOnward <$> bossRoom autoCrit, takeOne [HELD PISTOL]) ]
lockRoomMultiItems :: RandomGen g => [ ( State g (MetaTree Room String) , State g [ItemBaseType] ) ] lockRoomMultiItems :: RandomGen g => [ ( State g (MetaTree Room String) , State g [ItemBaseType] ) ]
lockRoomMultiItems = lockRoomMultiItems =
@@ -27,14 +27,14 @@ lockRoomMultiItems =
lockRoomKeyItems :: RandomGen g => [ (Int -> State g (MetaTree Room String) , State g ItemBaseType ) ] lockRoomKeyItems :: RandomGen g => [ (Int -> State g (MetaTree Room String) , State g ItemBaseType ) ]
lockRoomKeyItems = lockRoomKeyItems =
[(lasCenSensEdge, takeOne [LAUNCHER,LASGUN,SPARKGUN,FLATSHIELD,FORCEFIELDGUN] ) [(lasCenSensEdge, takeOne [HELD LAUNCHER,HELD LASGUN,HELD SPARKGUN,FLATSHIELD,HELD FORCEFIELDGUN] )
,(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,SPARKGUN] ) ,(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,HELD SPARKGUN] )
,(sensorRoomRunPast FLAMING, takeOne [FLAMESPITTER, CRAFT INCENDIARYMODULE] ) ,(sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT INCENDIARYMODULE] )
,(sensorRoomRunPast LASERING, return LASGUN ) ,(sensorRoomRunPast LASERING, return $ HELD LASGUN )
,(const slowDoorRoomRunPast, return $ MINIGUNX 3) ,(const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
,(const longRoomRunPast, takeOne [SNIPERRIFLE,FLATSHIELD]) ,(const longRoomRunPast, takeOne [HELD SNIPERRIFLE,FLATSHIELD])
,(const glassLessonRunPast, takeOne [LASGUN]) ,(const glassLessonRunPast, takeOne [HELD LASGUN])
,(const $ lasTunnelRunPast 400, takeOne [FLATSHIELD,FORCEFIELDGUN]) ,(const $ lasTunnelRunPast 400, takeOne [FLATSHIELD,HELD FORCEFIELDGUN])
,(keyCardRoomRunPast 0, return (KEYCARD 0)) ,(keyCardRoomRunPast 0, return (KEYCARD 0))
] ]
keyCardRunPastRand :: RandomGen g => [ (Int -> State g (MetaTree Room String) , State g ItemBaseType ) ] keyCardRunPastRand :: RandomGen g => [ (Int -> State g (MetaTree Room String) , State g ItemBaseType ) ]
@@ -42,24 +42,24 @@ keyCardRunPastRand = [(keyCardRoomRunPast 0, return (KEYCARD 0)) ]
itemRooms :: RandomGen g => [(ItemBaseType, State g (MetaTree Room String))] itemRooms :: RandomGen g => [(ItemBaseType, State g (MetaTree Room String))]
itemRooms = itemRooms =
[ (LAUNCHER , join $ takeOne [ (HELD LAUNCHER , join $ takeOne
[corridorBoss launcherCrit [corridorBoss launcherCrit
, rc $ map makeTypeCraft [TUBE,TUBE,HARDWARE] , rc $ map makeTypeCraft [TUBE,TUBE,HARDWARE]
] ]
) )
, (MINIGUNX 3 , join $ takeOne , (HELD (MINIGUNX 3) , join $ takeOne
[roomMiniIntro [roomMiniIntro
, rc $ map makeTypeCraft ([MOTOR,HARDWARE] ++ replicate 6 PIPE) , rc $ map makeTypeCraft ([MOTOR,HARDWARE] ++ replicate 6 PIPE)
] ) ] )
, (LASGUN , join $ takeOne , (HELD LASGUN , join $ takeOne
[rc $ map makeTypeCraft [PRISM,TRANSFORMER,PIPE] [rc $ map makeTypeCraft [PRISM,TRANSFORMER,PIPE]
] ]
) )
, (SPARKGUN , join $ takeOne , (HELD SPARKGUN , join $ takeOne
[rc $ map makeTypeCraft [TRANSFORMER,CAN,CAN] [rc $ map makeTypeCraft [TRANSFORMER,CAN,CAN]
] ]
) )
, (FLAMESPITTER , join $ takeOne , (HELD FLAMESPITTER , join $ takeOne
[rc $ map makeTypeCraft [LIGHTER,PUMP,CAN] [rc $ map makeTypeCraft [LIGHTER,PUMP,CAN]
] ]
) )
@@ -68,11 +68,11 @@ itemRooms =
,rc $ map makeTypeCraft [DRUM,DRUM,PLATE] ,rc $ map makeTypeCraft [DRUM,DRUM,PLATE]
] ]
) )
, (SNIPERRIFLE , join $ takeOne , (HELD SNIPERRIFLE , join $ takeOne
[rc [sniperRifle] [rc [sniperRifle]
] ]
) )
, (FORCEFIELDGUN , join $ takeOne , (HELD FORCEFIELDGUN , join $ takeOne
[rc [forceFieldGun] [rc [forceFieldGun]
] ]
) )
+2
View File
@@ -9,6 +9,8 @@ import Control.Lens
--import Streaming --import Streaming
--import qualified Streaming.Prelude as S --import qualified Streaming.Prelude as S
-- need to verify that this not only inserts but also overwrites (updates) any
-- already existing walls
insertWallInZones :: Wall -> World -> World insertWallInZones :: Wall -> World -> World
insertWallInZones wl = wlZoning %~ updateZoning (IM.insert (_wlID wl)) wl insertWallInZones wl = wlZoning %~ updateZoning (IM.insert (_wlID wl)) wl
--insertWallInZones wl = wlZoning .updatets --insertWallInZones wl = wlZoning .updatets