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
dam = _ptDamage pt
xp = sp +.+ 800 *.* unitVectorAtAngle dir
-- thHit' = thingHit sp xp w
(thHit, ps) = reflectLaserAlong phasev sp xp w
drawLaser :: Particle -> Picture
--drawLaser pt = setLayer BloomNoZWrite $ pictures
--[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
drawLaser pt =
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
]
where
+2 -3
View File
@@ -4,6 +4,7 @@ import Dodge.Base.Collide
import Dodge.Material
--import Dodge.Block.Debris
import Dodge.Zone
import Dodge.Wall.Zone
import Dodge.WorldEvent.Sound
import Dodge.Wall.Delete
import Dodge.Wall.Dust
@@ -34,9 +35,7 @@ unshadowBlock :: Int -> World -> World
unshadowBlock wlid w = case w ^? walls . ix wlid of
Just wl -> w
& walls . ix wlid . wlUnshadowed .~ True
& wlZoning . znObjects . ix x . ix y . ix wlid . wlUnshadowed .~ True
where
V2 x y = wlZoneOfPoint $ uncurry midPoint (_wlLine wl)
& insertWallInZones (wl & wlUnshadowed .~ True)
Nothing -> w
checkBlockHP :: Block -> World -> World
+37 -39
View File
@@ -17,59 +17,57 @@ import LensHelp
itemCombinations :: [([(IcAmount,ItemBaseType)],Item)]
itemCombinations =
[ po [CRAFT PIPE, CRAFT HARDWARE] (bangStick 1)
, po [BANGSTICK 1, CRAFT TIN] pistol
, po [PISTOL, CRAFT SPRING] autoPistol
, po [AUTOPISTOL, cr PLANK] smg
, po [AUTOPISTOL, cr SPRING] machinePistol
, po [BANGSTICK 1,cr CAN] revolver
, po [REVOLVER, cr SPRING] $ revolverX 1
, po [HELD (BANGSTICK 1), CRAFT TIN] pistol
, po [HELD PISTOL, CRAFT SPRING] autoPistol
, po [HELD AUTOPISTOL, cr PLANK] smg
, po [HELD AUTOPISTOL, cr SPRING] machinePistol
, po [HELD (BANGSTICK 1),cr CAN] revolver
, po [HELD REVOLVER, cr SPRING] $ revolverX 1
, po [cr CAN,cr HARDWARE] bangCone
, po [BANGCONE,cr PLANK] blunderbuss
, po [BLUNDERBUSS,cr DRUM] (grapeCannon 1)
, po [HELD BANGCONE,cr PLANK] blunderbuss
, po [HELD BLUNDERBUSS,cr DRUM] (grapeCannon 1)
-- , po [BANGCONE,PUMP,HARDWARE] $ grenadeLauncher 1
-- , po [GRENADELAUNCHER 1,MOTOR,DRUM] $ grenadeLauncher 2
-- , po [cr PIPE, cr HARDWARE] (volleyGun 1)
, po [BANGSTICK 1,cr PLANK] rifle
, po [BANGSTICK 1,BANGSTICK 1,BANGSTICK 1] (volleyGun 3)
, po [RIFLE,cr TIN] repeater
, po [REPEATER,cr SPRING] autoRifle
, po [REPEATER,cr CAN] burstRifle
, po [HELD (BANGSTICK 1),cr PLANK] rifle
, po [HELD (BANGSTICK 1),HELD (BANGSTICK 1),HELD (BANGSTICK 1)] (volleyGun 3)
, po [HELD RIFLE,cr TIN] repeater
, po [HELD REPEATER,cr SPRING] autoRifle
, po [HELD REPEATER,cr CAN] burstRifle
-- , po [BURSTRIFLE,cr SPRING,cr HARDWARE] fastBurstRifle
-- , po [FASTBURSTRIFLE,cr SPRING,cr HARDWARE] completeBurstRifle
, po [cr MOTOR,VOLLEYGUN 3] $ miniGunX 3
, po [cr MOTOR,VOLLEYGUN 4] $ miniGunX 4
, po [cr MOTOR,VOLLEYGUN 5] $ miniGunX 5
, po [cr MOTOR,VOLLEYGUN 6] $ miniGunX 6
]
++ [ po [cr MOTOR,HELD (VOLLEYGUN i)] $ miniGunX i | i <- [3..10]
] ++
-- , po [BANGSTICK 1,cr TUBE] elephantGun
, po [AMR,cr PIPE] sniperRifle
, po [RIFLE,cr PIPE] amr
, po [AMR,cr SPRING] autoAmr
, po [AMR,cr MOTOR] machineGun
[ po [HELD AMR,cr PIPE] sniperRifle
, po [HELD RIFLE,cr PIPE] amr
, po [HELD AMR,cr SPRING] autoAmr
, po [HELD AMR,cr MOTOR] machineGun
, p [p 2 $ cr TUBE,o $ cr HARDWARE] launcher
, p [p 2 $ cr TUBE,o LAUNCHER] (launcherX 2)
] ++ [ p [p 2 $ cr TUBE,o $ LAUNCHERX i] (launcherX (i+1)) | i <- [2..9]]
, p [p 2 $ cr TUBE,o $ HELD LAUNCHER] (launcherX 2)
] ++ [ p [p 2 $ cr TUBE,o $ HELD (LAUNCHERX i)] (launcherX (i+1)) | i <- [2..9]]
++
[ po [cr LIGHTER,cr PUMP,cr CAN] flameSpitter
, po [FLAMESPITTER,cr CAN,cr PUMP] blowTorch
, po [FLAMESPITTER,cr DRUM] flameThrower
, po [FLAMETHROWER,cr DRUM] flameWall
, po [FLAMETHROWER,cr PUMP] flameTorrent
, po [HELD FLAMESPITTER,cr CAN,cr PUMP] blowTorch
, po [HELD FLAMESPITTER,cr DRUM] flameThrower
, po [HELD FLAMETHROWER,cr DRUM] flameWall
, po [HELD FLAMETHROWER,cr PUMP] flameTorrent
, p [o $ cr PRISM,o $ cr TRANSFORMER,o $ cr PIPE] lasGun
-- , p [o LASGUN,o $ cr PRISM] lasSway
-- , p [o LASGUN,o $ cr HARDWARE] lasSwing
-- , 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
, po [LASGUN, cr TRANSFORMER] (lasWide 2)
, po [LASGUN,LASGUN,LASGUN,cr HARDWARE] lasCircle
, po [HELD LASGUN, cr TRANSFORMER] (lasWide 2)
, po [HELD LASGUN,HELD LASGUN,HELD LASGUN,cr HARDWARE] lasCircle
, 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 BLINKER, p 2 $ cr MICROCHIP] unsafeBlinkGun
@@ -84,13 +82,13 @@ itemCombinations =
, 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 [cr PIPE,BANGSTICK i] $ bangStick (i+1)) [1..8]
++ map (\i -> po [REVOLVERX i,cr CAN] $ revolverX (i+1)) [1..5]
++ map (\i -> po [VOLLEYGUN i,BANGSTICK 1] $ volleyGun (i+1)) [3..5]
++ map (\i -> po [MINIGUNX i,BANGSTICK 1] $ miniGunX (i+1)) [3..15]
++ map (\i -> po [GRAPECANNON i,cr DRUM] $ grapeCannon (i+1)) [1,2,3]
++ map (\i -> po [cr PIPE,HELD (BANGSTICK i)] $ bangStick (i+1)) [1..8]
++ map (\i -> po [HELD (REVOLVERX i),cr CAN] $ revolverX (i+1)) [1..5]
++ map (\i -> po [HELD (VOLLEYGUN i),HELD (BANGSTICK 1)] $ volleyGun (i+1)) [3..5]
++ map (\i -> po [HELD (MINIGUNX i),HELD (BANGSTICK 1)] $ miniGunX (i+1)) [3..15]
++ 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
| (modtype,is,ms) <- moduleCombinations
@@ -181,7 +179,7 @@ batteryGuns =
, sparkGun
, lasGun
-- , lasSway
, lasSwing
-- , lasSwing
] ++
[ lasWide i | i <- [2..10]
]
+39 -34
View File
@@ -72,7 +72,42 @@ data ItemBaseType
| EFFGUN String
| AUTOEFFGUN String
-- 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
| REVOLVER
| REVOLVERX {_xNum :: Int}
@@ -109,9 +144,9 @@ data ItemBaseType
| TESLAGUN
| LASGUN
| LASCIRCLE
| LASPULSE
-- | LASPULSE
| DUALBEAM
| LASGUNSWING
-- | LASGUNSWING
-- | LASGUNSWAY
-- | LASGUNWIDEPULSE
| LASWIDE {_xNum :: Int}
@@ -126,38 +161,8 @@ data ItemBaseType
| DRONELAUNCHER
| SHATTERGUN
-- | GRENADE
-- | REMOTEBOMB
-- Utility items
| BOOSTER
| REWINDER
| BLINKER
| BLINKERUNSAFE
| 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)
data ItemModuleType
+9 -9
View File
@@ -43,13 +43,13 @@ bulletCombinations = filter
maxShowX :: ItemBaseType -> Maybe Int
maxShowX bt = case bt of
BANGSTICK _ -> Just 2
REVOLVERX _ -> Just 1
VOLLEYGUN _ -> Just 3
MINIGUNX _ -> Just 3
GRAPECANNON _ -> Just 1
LAUNCHERX _ -> Just 2
LASWIDE _ -> Just 2
HELD (BANGSTICK _) -> Just 2
HELD (REVOLVERX _) -> Just 1
HELD (VOLLEYGUN _) -> Just 3
HELD (MINIGUNX _) -> Just 3
HELD (GRAPECANNON _) -> Just 1
HELD (LAUNCHERX _) -> Just 2
HELD (LASWIDE _) -> Just 2
-- LASGUNFOCUS _ -> Just 2
_ -> Nothing
@@ -73,12 +73,12 @@ combinationsGraph = FGL.labnfilter (f . _unCombNode . snd)
f (Left (CRAFT _)) = False
f (Left bt) = case maxShowX bt of
Nothing -> True
Just i -> _xNum bt <= i
Just i -> _xNum (_ibtHeld bt) <= i
belowNumX :: ItemBaseType -> Bool
belowNumX bt = case maxShowX bt of
Nothing -> True
Just i -> _xNum bt <= i
Just i -> _xNum (_ibtHeld bt) <= i
toCombNodeLabel :: CombNode -> String
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 <&> (,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 [] = Nothing
+1 -1
View File
@@ -58,7 +58,7 @@ initialAnoTree = OnwardList
, AnRoom pistolerRoom
, AnRoom doubleCorridorBarrels
, IntAnno $ PassthroughLockKeyLists
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,SPARKGUN] )] itemRooms
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,HELD SPARKGUN] )] itemRooms
, IntAnno $ PassthroughLockKeyLists keyCardRunPastRand itemRooms
, IntAnno $ AnTree . warningRooms
, AnTree $ rToOnward "chaseCrit+armourChaseCrit rectRoom"
+38 -144
View File
@@ -22,6 +22,39 @@ itemFromBase ibt = case ibt of
EFFGUN _ -> undefined
AUTOEFFGUN _ -> undefined
-- 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
PISTOL -> pistol
REVOLVER -> revolver
@@ -60,9 +93,9 @@ itemFromBase ibt = case ibt of
TESLAGUN -> teslaGun
LASGUN -> lasGun
LASCIRCLE -> lasCircle
LASPULSE -> lasPulse
--LASPULSE -> lasPulse
DUALBEAM -> dualBeam
LASGUNSWING -> lasSwing
--LASGUNSWING -> lasSwing
--LASGUNSWAY -> lasSway
-- LASGUNWIDEPULSE -> lasWidePulse
LASWIDE i -> lasWide i
@@ -75,156 +108,17 @@ itemFromBase ibt = case ibt of
REMOTELAUNCHER -> remoteLauncher
POISONSPRAYER -> poisonSprayer
DRONELAUNCHER -> droneLauncher
--GRENADE
--REMOTEBOMB
-- Utility items
BOOSTER -> boosterGun
REWINDER -> rewindGun
BLINKER -> blinkGun
BLINKERUNSAFE -> unsafeBlinkGun
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 ibt = case ibt of
NOTDEFINED -> undefined
EFFGUN _ -> HeldFamily
AUTOEFFGUN _ -> HeldFamily
BANGSTICK _ -> 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
EFFGUN _ -> undefined
AUTOEFFGUN _ -> undefined
HELD _ -> HeldFamily
BOOSTER -> LeftClickFamily
REWINDER -> LeftClickFamily
BLINKER -> LeftClickFamily
BLINKERUNSAFE -> LeftClickFamily
FORCEFIELDGUN -> LeftClickFamily
SHRINKER -> LeftClickFamily
SPAWNER -> LeftClickFamily
CLICKDETECTOR _ -> HeldFamily
+1
View File
@@ -17,6 +17,7 @@ import qualified Data.IntMap.Strict as IM
import Control.Lens
import Data.Maybe
itemEquipPict :: Creature -> Item -> SPic
itemEquipPict cr it = case it ^?! itUse of
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
-- , lasWidePulse
--, lasSway
, lasSwing
-- , lasSwing
--, lasFocus
, lasPulse
-- , lasPulse
, sparkGun
, teslaGun
, teslaParams
@@ -70,7 +70,7 @@ defaultAutoBatteryGun = defaultAutoGun
sparkGun :: Item
sparkGun = teslaGun
& itType . iyBase .~ SPARKGUN
& itType . iyBase .~ HELD SPARKGUN
& itParams . arcSize .~ 10
teslaGun :: Item
teslaGun = defaultBatteryGun
@@ -96,7 +96,7 @@ teslaGun = defaultBatteryGun
& itUse . useAim . aimStance .~ TwoHandFlat
& itUse . useAim . aimHandlePos .~ 4
& itUse . useAim . aimMuzPos .~ 4
& itType . iyBase .~ TESLAGUN
& itType . iyBase .~ HELD TESLAGUN
teslaGunPic :: Item -> SPic
teslaGunPic _ = noPic $ colorSH blue $
upperPrismPoly 5 (rectNESW xb 8 xa 0)
@@ -104,27 +104,27 @@ teslaGunPic _ = noPic $ colorSH blue $
where
xa = 1
xb = 9
lasPulse :: Item
lasPulse = lasGun
& itType . iyBase .~ LASPULSE
& itUse . useMods .~
[ ammoCheckI
, withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2
, withItemUpdate itup
$ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8)
, useAmmoAmount 1
]
where
itup it = it
& itParams . lasCycle %~ (\i -> (i+1) `mod` 20)
& itParams . lasDamage .~ ceiling ((22 :: Float) * frac it)
& itParams . lasColor .~ frac it * orange
frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1))
--lasPulse :: Item
--lasPulse = lasGun
-- & itType . iyBase .~ LASPULSE
-- & itUse . useMods .~
-- [ ammoCheckI
-- , withItem $ \it -> withTempLight 1 (100 * frac it) (xyzV4 (_lasColor $ _itParams it))
-- , withItem $ \it -> withSoundForVol (frac it) tone440sawtoothquietS 2
-- , withItemUpdate itup
-- $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) (frac it * 0.8)
-- , useAmmoAmount 1
-- ]
-- where
-- itup it = it
-- & itParams . lasCycle %~ (\i -> (i+1) `mod` 20)
-- & itParams . lasDamage .~ ceiling ((22 :: Float) * frac it)
-- & itParams . lasColor .~ frac it * orange
-- frac it = 0.5 * (1 + sin (pi * fromIntegral (_lasCycle $ _itParams it) * 0.1))
lasCircle :: Item
lasCircle = lasGun
& itType . iyBase .~ LASCIRCLE
& itType . iyBase .~ HELD LASCIRCLE
& itParams . lasColor .~ orange
& itParams . lasDamage .~ 2
& itConsumption . laMax .~ 10000
@@ -150,7 +150,7 @@ lasCircle = lasGun
lasWide :: Int -> Item
lasWide n = lasGun
& itType . iyBase .~ LASWIDE n
& itType . iyBase .~ HELD (LASWIDE n)
& itParams . lasColor .~ yellow
& itParams . lasDamage .~ 2
& itUse . useMods .~
@@ -238,7 +238,7 @@ lasWide n = lasGun
dualBeam :: Item
dualBeam = lasGun
& itType . iyBase .~ DUALBEAM
& itType . iyBase .~ HELD DUALBEAM
& itUse . useAim . aimMuzPos .~ 0
& itDimension .dimSPic .~ dualBeamPic
& itParams .~ DualBeam
@@ -266,24 +266,24 @@ dualBeam = lasGun
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
where
thegap = _dbGap . _itParams
lasSwing :: Item
lasSwing = lasGun
& itType . iyBase .~ LASGUNSWING
& itParams . lasColor .~ orange
& itUse . useMods .~
[ ammoCheckI
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withSoundForI tone440sawtoothquietS 2
, useAmmoAmount 1
, withItemUpdate itup $ \it -> duplicateOffsetsFocus (x it)
]
where
itup = itParams . lasCycle %~ (\i -> (i+1) `mod` 200)
x it = [-y,y]
where
y = 15 * sin (pi * fromIntegral x' * 0.01)
x' = _lasCycle $ _itParams it
--lasSwing :: Item
--lasSwing = lasGun
-- & itType . iyBase .~ LASGUNSWING
-- & itParams . lasColor .~ orange
-- & itUse . useMods .~
-- [ ammoCheckI
-- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
-- , withItem $ \it -> withMuzPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
-- , withSoundForI tone440sawtoothquietS 2
-- , useAmmoAmount 1
-- , withItemUpdate itup $ \it -> duplicateOffsetsFocus (x it)
-- ]
-- where
-- itup = itParams . lasCycle %~ (\i -> (i+1) `mod` 200)
-- x it = [-y,y]
-- where
-- y = 15 * sin (pi * fromIntegral x' * 0.01)
-- x' = _lasCycle $ _itParams it
lasGun :: Item
lasGun = defaultAutoBatteryGun
& itConsumption .~ ( defaultLoadable
@@ -321,7 +321,7 @@ lasGun = defaultAutoBatteryGun
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ LASGUN
& itType . iyBase .~ HELD LASGUN
lasGunPic :: Item -> SPic
lasGunPic it =
@@ -392,7 +392,7 @@ tractorGun = lasGun
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ TRACTORGUN
& itType . iyBase .~ HELD TRACTORGUN
tractorGunTweak :: TweakParam
tractorGunTweak = TweakParam
@@ -437,7 +437,6 @@ shootTeslaArc it cr w = w'
shootLaser :: Item -> Creature -> World -> World
shootLaser it cr = instantParticles .:~ lasRayAt (_lasColor $ _itParams it) dam phasev pos dir
where
--pos = _crPos cr +.+ aimingMuzzlePos cr it *.* unitVectorAtAngle dir
pos = _crPos cr
dir = _crDir cr
phasev = _phaseV . _itParams $ _crInv cr IM.! crSel cr
+6 -6
View File
@@ -115,7 +115,7 @@ volleyGun i = defaultBulletWeapon
,_brlInaccuracy = 0.1
}
& itParams . torqueAfter .~ 0.48 + 0.2 * fromIntegral i
& itType . iyBase .~ VOLLEYGUN i
& itType . iyBase .~ HELD (VOLLEYGUN i)
caneStickSoundChoice :: Item -> SoundID
caneStickSoundChoice it
| _laLoaded (_itConsumption it) < 2 = tap3S
@@ -137,7 +137,7 @@ rifle = defaultBangCane
}
}
& itUse . useAim . aimStance .~ TwoHandTwist
& itType . iyBase .~ RIFLE
& itType . iyBase .~ HELD RIFLE
& itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadEject 5, loadInsert 5 ,loadPrime 5]
& itUse . useAim . aimWeight .~ 6
@@ -147,7 +147,7 @@ rifle = defaultBangCane
repeater :: Item
repeater = rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ REPEATER
& itType . iyBase .~ HELD REPEATER
& itConsumption . laCycle .~ [loadEject 50, loadInsert 40 ,loadPrime 20]
& itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape
@@ -162,13 +162,13 @@ baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2
autoRifle :: Item
autoRifle = repeater
& itType . iyBase .~ AUTORIFLE
& itType . iyBase .~ HELD AUTORIFLE
& itUse . useMods %~ ((ammoCheckI :) . tail)
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
-- & itUse . useDelay . rateMax .~ 6
burstRifle :: Item
burstRifle = repeater
& itType . iyBase .~ BURSTRIFLE
& itType . iyBase .~ HELD BURSTRIFLE
& itParams . gunBarrels . brlInaccuracy .~ 0.05
& itUse . useDelay . rateMax .~ 18
& itUse . useMods .~
@@ -282,7 +282,7 @@ miniGunX i = defaultAutoGun
, _dimSPic = miniGunXPictItem i
}
}
& itType . iyBase .~ MINIGUNX i
& itType . iyBase .~ HELD (MINIGUNX i)
& itUse . useAim . aimMuzPos .~ 40
miniGunXPictItem :: Int -> Item -> SPic
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it)
+6 -6
View File
@@ -65,7 +65,7 @@ bangRod = defaultBulletWeapon
}
& itConsumption . laMax .~ 1
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5]
& itType . iyBase .~ BANGROD
& itType . iyBase .~ HELD BANGROD
& itUse . useAim . aimWeight .~ 8
& itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand
@@ -79,7 +79,7 @@ baseAMRShape :: Shape
baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
elephantGun :: Item
elephantGun = bangRod
& itType . iyBase .~ ELEPHANTGUN
& itType . iyBase .~ HELD ELEPHANTGUN
& itUse . useAim . aimStance .~ TwoHandTwist
& itParams . gunBarrels .~ SingleBarrel 0.05
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
@@ -100,7 +100,7 @@ elephantGun = bangRod
& itParams . torqueAfter .~ 0.1
amr :: Item
amr = elephantGun
& itType . iyBase .~ AMR
& itType . iyBase .~ HELD AMR
& itConsumption . laMax .~ 15
& itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape
<> makeTinClipAt 0 (V3 10 (-2) 0) it
@@ -108,12 +108,12 @@ amr = elephantGun
autoAmr :: Item
autoAmr = amr
& itType . iyBase .~ AUTOAMR
& itType . iyBase .~ HELD AUTOAMR
& itUse . useMods %~ ((ammoCheckI :) . tail)
sniperRifle :: Item
sniperRifle = elephantGun
& itType . iyBase .~ SNIPERRIFLE
& itType . iyBase .~ HELD SNIPERRIFLE
& itParams . gunBarrels .~ SingleBarrel 0
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
& itUse . heldScroll .~ zoomLongGun
@@ -122,7 +122,7 @@ sniperRifle = elephantGun
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
machineGun :: Item
machineGun = bangRod
& itType . iyBase .~ MACHINEGUN
& itType . iyBase .~ HELD MACHINEGUN
& itUse . useDelay . rateMax .~ 25
& itUse . useMods .~
[ ammoCheckI
+7 -7
View File
@@ -75,7 +75,7 @@ bangStick i = defaultBulletWeapon
<> stickClip it
}
}
& itType . iyBase .~ BANGSTICK i
& itType . iyBase .~ HELD (BANGSTICK i)
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 10
& itConsumption . laMax .~ i
@@ -111,7 +111,7 @@ revolver = pistol
& laMax .~ 6
& laCycle .~ [loadPartialInsert 10 1] )
& itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> revolverClip it)
& itType . iyBase .~ REVOLVER
& itType . iyBase .~ HELD REVOLVER
revolverClip :: Item -> Shape
revolverClip it = case it ^? itConsumption . laLoaded of
@@ -170,23 +170,23 @@ pistol = bangStick 1
. ( recoil .~ 10 )
. ( torqueAfter .~ 0.2 )
)
& itType . iyBase .~ PISTOL
& itType . iyBase .~ HELD PISTOL
autoPistol :: Item
autoPistol = pistol
& itUse . useMods .~ (ammoCheckI : pistolAfterHamMods)
& itType . iyBase .~ AUTOPISTOL
& itType . iyBase .~ HELD AUTOPISTOL
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
machinePistol :: Item
machinePistol = autoPistol
& itUse . useDelay . rateMax .~ 2
& itUse . useMods .~ (ammoCheckI : machinePistolAfterHamMods)
& itType . iyBase .~ MACHINEPISTOL
& itType . iyBase .~ HELD MACHINEPISTOL
& itType . iyModules . at ModAutoMag .~ Nothing
& itParams . recoil .~ 20
smg :: Item
smg = autoPistol -- & some parameter affecting stability
& itUse . useMods .~ (ammoCheckI : smgAfterHamMods)
& itType . iyBase .~ SMG
& itType . iyBase .~ HELD SMG
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 2
& itParams . torqueAfter .~ 0.05
@@ -211,4 +211,4 @@ revolverX i = revolver
, withRecoil
]
& 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 . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& itUse . heldScroll .~ scrollCharMode
& itType . iyBase .~ AUTOGUN
& itType . iyBase .~ HELD AUTOGUN
autoGunPic :: Item -> SPic
autoGunPic it = noPic $
colorSH red (prismPoly
@@ -125,7 +125,7 @@ bangCone = defaultBulletWeapon
]
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 15
& itType . iyBase .~ BANGCONE
& itType . iyBase .~ HELD BANGCONE
& itConsumption . laMax .~ 5
& itConsumption . laCycle .~ [loadEject 5, loadInsert 20 , loadPrime 5]
coneRandItemUpdate :: State StdGen (Item -> Item)
@@ -156,10 +156,10 @@ blunderbuss = bangCone
& itUse . useAim . aimWeight .~ 6
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 30
& itType . iyBase .~ BLUNDERBUSS
& itType . iyBase .~ HELD BLUNDERBUSS
grapeCannon :: Int -> Item
grapeCannon i = blunderbuss
& itType . iyBase .~ GRAPECANNON i
& itType . iyBase .~ HELD (GRAPECANNON i)
& itConsumption . laMax .~ 25 + 25 * i
& itConsumption . laCycle .~ [loadEject 5, loadInsert (30 + i * 10) , loadPrime 5]
& itParams . recoil .~ (150 + fromIntegral i * 50)
+1 -1
View File
@@ -33,7 +33,7 @@ droneLauncher = defaultWeapon
& itUse . useAim . aimStance .~ TwoHandTwist
& itConsumption . laAmmoType .~ DroneAmmo { _amString = "LASDRONE" }
& itConsumption . laMax .~ 2
& itType . iyBase .~ DRONELAUNCHER
& itType . iyBase .~ HELD DRONELAUNCHER
lasDronesPic :: Item -> SPic
lasDronesPic _ =
+3 -3
View File
@@ -77,12 +77,12 @@ launcher = defaultWeapon
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 5
& itUse . useAim . aimMuzPos .~ 20
& itType . iyBase .~ LAUNCHER
& itType . iyBase .~ HELD LAUNCHER
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
launcherX :: Int -> Item
launcherX i = launcher
& itType . iyBase .~ LAUNCHERX i
& itType . iyBase .~ HELD (LAUNCHERX i)
& itConsumption . laMax .~ i
& itConsumption . laLoaded .~ i
& itUse . rUse .~ usePjCreationX i
@@ -278,7 +278,7 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
remoteLauncher :: Item
remoteLauncher = launcher
& itType . iyBase .~ REMOTELAUNCHER
& itType . iyBase .~ HELD REMOTELAUNCHER
& itUse . rUse .~ fireRemoteShell
& itScope .~ RemoteScope (V2 0 0) 1 True
& itConsumption . laAmmoType . amPjDraw .~ drawRemoteShell
+1 -1
View File
@@ -28,7 +28,7 @@ import LensHelp
shatterGun :: Item
shatterGun = defaultWeapon
& itType . iyBase .~ SHATTERGUN
& itType . iyBase .~ HELD SHATTERGUN
& itUse . useDelay . rateMax .~ 10
& itUse . rUse .~ shootShatter
& itUse . useMods .~
+1 -1
View File
@@ -53,7 +53,7 @@ sonicGun = defaultAutoGun
& itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimMuzPos .~ 25
& itType . iyBase .~ SONICGUN
& itType . iyBase .~ HELD SONICGUN
baseSonicShape :: Shape
baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2
+6 -6
View File
@@ -40,7 +40,7 @@ import Control.Monad.State
import System.Random
poisonSprayer :: Item
poisonSprayer = flameThrower
& itType . iyBase .~ POISONSPRAYER
& itType . iyBase .~ HELD POISONSPRAYER
& itConsumption . laAmmoType .~ GasAmmo
{ _amString = "POISONGAS"
, _amCreateGas = aGasCloud
@@ -67,7 +67,7 @@ flamerPic it =
am = fractionLoadedAmmo2 it
flameSpitter :: Item
flameSpitter = flameThrower
& itType . iyBase .~ FLAMESPITTER
& itType . iyBase .~ HELD FLAMESPITTER
& itConsumption . laMax .~ 10
& itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 20]
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4
@@ -90,7 +90,7 @@ flameSpitter = flameThrower
flameTorrent :: Item
flameTorrent = flameThrower
& itType . iyBase .~ FLAMETORRENT
& itType . iyBase .~ HELD FLAMETORRENT
& itUse . useAim . aimZoom .~ defaultItZoom
& itParams . sprayNozzles . ix 0 %~
( (nzPressure .~ 10)
@@ -100,10 +100,10 @@ flameTorrent = flameThrower
blowTorch :: Item
blowTorch = flameThrower
& itType . iyBase .~ BLOWTORCH
& itType . iyBase .~ HELD BLOWTORCH
flameWall :: Item
flameWall = flameThrower
& itType . iyBase .~ FLAMEWALL
& itType . iyBase .~ HELD FLAMEWALL
& itParams . sprayNozzles .~ zipWith makeNozzle [0,0.6,-0.6] [2,2.5,2.5]
where
makeNozzle dir pres = Nozzle
@@ -157,7 +157,7 @@ flameThrower = defaultAutoGun
& itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimHandlePos .~ 0
& itUse . useAim . aimMuzPos .~ 18
& itType . iyBase .~ FLAMETHROWER
& itType . iyBase .~ HELD FLAMETHROWER
aGasCloud :: Float -> Point2 -> Float -> Creature -> World -> World
aGasCloud pressure pos dir cr = makeGasCloud pos
+1 -1
View File
@@ -124,7 +124,7 @@ forceFieldGun = defaultWeapon
& itUse . useDelay .~ NoDelay
& itUse . useMods .~
[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType . iyBase .~ FORCEFIELDGUN
& itType . iyBase .~ HELD FORCEFIELDGUN
-- I believe because the targeting returns to nothing straight after you release
-- the rmb, it is possible for this to do nothing
-- 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 = [(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 =
@@ -27,14 +27,14 @@ lockRoomMultiItems =
lockRoomKeyItems :: RandomGen g => [ (Int -> State g (MetaTree Room String) , State g ItemBaseType ) ]
lockRoomKeyItems =
[(lasCenSensEdge, takeOne [LAUNCHER,LASGUN,SPARKGUN,FLATSHIELD,FORCEFIELDGUN] )
,(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,SPARKGUN] )
,(sensorRoomRunPast FLAMING, takeOne [FLAMESPITTER, CRAFT INCENDIARYMODULE] )
,(sensorRoomRunPast LASERING, return LASGUN )
,(const slowDoorRoomRunPast, return $ MINIGUNX 3)
,(const longRoomRunPast, takeOne [SNIPERRIFLE,FLATSHIELD])
,(const glassLessonRunPast, takeOne [LASGUN])
,(const $ lasTunnelRunPast 400, takeOne [FLATSHIELD,FORCEFIELDGUN])
[(lasCenSensEdge, takeOne [HELD LAUNCHER,HELD LASGUN,HELD SPARKGUN,FLATSHIELD,HELD FORCEFIELDGUN] )
,(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE,HELD SPARKGUN] )
,(sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT INCENDIARYMODULE] )
,(sensorRoomRunPast LASERING, return $ HELD LASGUN )
,(const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
,(const longRoomRunPast, takeOne [HELD SNIPERRIFLE,FLATSHIELD])
,(const glassLessonRunPast, takeOne [HELD LASGUN])
,(const $ lasTunnelRunPast 400, takeOne [FLATSHIELD,HELD FORCEFIELDGUN])
,(keyCardRoomRunPast 0, return (KEYCARD 0))
]
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 =
[ (LAUNCHER , join $ takeOne
[ (HELD LAUNCHER , join $ takeOne
[corridorBoss launcherCrit
, rc $ map makeTypeCraft [TUBE,TUBE,HARDWARE]
]
)
, (MINIGUNX 3 , join $ takeOne
, (HELD (MINIGUNX 3) , join $ takeOne
[roomMiniIntro
, rc $ map makeTypeCraft ([MOTOR,HARDWARE] ++ replicate 6 PIPE)
] )
, (LASGUN , join $ takeOne
, (HELD LASGUN , join $ takeOne
[rc $ map makeTypeCraft [PRISM,TRANSFORMER,PIPE]
]
)
, (SPARKGUN , join $ takeOne
, (HELD SPARKGUN , join $ takeOne
[rc $ map makeTypeCraft [TRANSFORMER,CAN,CAN]
]
)
, (FLAMESPITTER , join $ takeOne
, (HELD FLAMESPITTER , join $ takeOne
[rc $ map makeTypeCraft [LIGHTER,PUMP,CAN]
]
)
@@ -68,11 +68,11 @@ itemRooms =
,rc $ map makeTypeCraft [DRUM,DRUM,PLATE]
]
)
, (SNIPERRIFLE , join $ takeOne
, (HELD SNIPERRIFLE , join $ takeOne
[rc [sniperRifle]
]
)
, (FORCEFIELDGUN , join $ takeOne
, (HELD FORCEFIELDGUN , join $ takeOne
[rc [forceFieldGun]
]
)
+2
View File
@@ -9,6 +9,8 @@ import Control.Lens
--import Streaming
--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 wl = wlZoning %~ updateZoning (IM.insert (_wlID wl)) wl
--insertWallInZones wl = wlZoning .updatets