Tweak module display and logic

This commit is contained in:
2023-01-12 12:51:24 +00:00
parent 94c0af97fd
commit 37e26f53e6
19 changed files with 250 additions and 80 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

+6 -9
View File
@@ -94,8 +94,8 @@ itemCombinations =
, po [cr MICROCHIP, cr TRANSMITTER, cr HEATSENSOR] (autoDetector CREATUREDETECTOR) , po [cr MICROCHIP, cr TRANSMITTER, cr HEATSENSOR] (autoDetector CREATUREDETECTOR)
, po [cr BATTERY, cr LED] torch , po [cr BATTERY, cr LED] torch
, po [hd TORCH, eq HAT] headLamp , po [hd TORCH, eq HAT] headLamp
, po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (makeTypeCraft INCENDIARYMODULE) , po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (bulletPayloadCraft IncBall)
, po [cr TRANSFORMER, cr BATTERY, cr MICROCHIP] (makeTypeCraft STATICMODULE) , po [cr TRANSFORMER, cr BATTERY, cr MICROCHIP] (bulletPayloadCraft TeslaBall)
] ]
++ map (\i -> po [HELD (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 [cr PIPE, HELD (BANGSTICK i)] $ bangStick (i + 1)) [1 .. 8] ++ map (\i -> po [cr PIPE, HELD (BANGSTICK i)] $ bangStick (i + 1)) [1 .. 8]
@@ -159,17 +159,14 @@ moduleCombinations =
( ModBulletCollision ( ModBulletCollision
, bulletWeapons , bulletWeapons
, ,
[ amod [cr BOUNCEMODULE] BOUNCEBUL [ amod [cr (BULBODYMODULE be)] (BULBODY be) | be <- [minBound..]
, amod [cr PENMODULE] PENBUL
] ]
) )
, ,
( ModBulletPayload ( ModBulletPayload
, bulletWeapons , bulletWeapons
, ,
[ amod [cr INCENDIARYMODULE] INCENDBUL [ amod [cr (BULPAYLOADMODULE x)] (BULPAY x) | x <- [minBound ..]
, amod [cr STATICMODULE] STATICBUL
, amod [cr CONCUSSMODULE] CONCUSBUL
] ]
) )
, ,
@@ -194,9 +191,9 @@ moduleCombinations =
( ModDualBeam ( ModDualBeam
, [dualBeam] , [dualBeam]
, ,
[ amod [cr INCENDIARYMODULE] INCENDLAS [ amod [cr (BULPAYLOADMODULE IncBall)] INCENDLAS
, amod [cr TRANSFORMER] SPLITLAS , amod [cr TRANSFORMER] SPLITLAS
, amod [cr STATICMODULE] STATICLAS , amod [cr (BULPAYLOADMODULE TeslaBall)] STATICLAS
] ]
) )
, ,
+2 -5
View File
@@ -13,11 +13,8 @@ moduleModification imt = case imt of
DRUMMAG -> itUse . heldConsumption . laMax .~ 45 DRUMMAG -> itUse . heldConsumption . laMax .~ 45
BELTMAG -> itUse . heldConsumption . laMax .~ 150 BELTMAG -> itUse . heldConsumption . laMax .~ 150
MAGNETMAG -> itUse . heldDelay . rateMax .~ 4 MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
INCENDBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall IncBall BULPAY thepayload -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall thepayload
BOUNCEBUL -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ BounceBullet BULBODY thebody -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ thebody
PENBUL -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ PenetrateBullet
STATICBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall TeslaBall
CONCUSBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall ConcBall
TARGET t -> itUse . useTargeting ?~ t TARGET t -> itUse . useTargeting ?~ t
MAGNETTRAJ -> MAGNETTRAJ ->
(itUse . heldConsumption . laAmmoType . amBullet . buTrajectory .~ MagnetTrajectory 0) (itUse . heldConsumption . laAmmoType . amBullet . buTrajectory .~ MagnetTrajectory 0)
+14 -12
View File
@@ -176,16 +176,18 @@ inventoryX c = case c of
, makeTypeCraftNum 5 TRANSFORMER , makeTypeCraftNum 5 TRANSFORMER
, makeTypeCraftNum 5 PRISM , makeTypeCraftNum 5 PRISM
, makeTypeCraftNum 5 LIGHTER , makeTypeCraftNum 5 LIGHTER
, makeTypeCraftNum 5 INCENDIARYMODULE , makeTypeCraftNum 5 (BULPAYLOADMODULE IncBall)
] ]
'G' -> 'G' ->
[ autoPistol [ autoPistol
, pistol , pistol
, makeTypeCraftNum 2 HARDWARE , makeTypeCraftNum 2 HARDWARE
, makeTypeCraftNum 2 MAGNET , makeTypeCraftNum 2 MAGNET
, makeTypeCraftNum 5 INCENDIARYMODULE , makeTypeCraftNum 5 (BULPAYLOADMODULE IncBall)
, makeTypeCraftNum 5 CONCUSSMODULE , makeTypeCraftNum 5 (BULPAYLOADMODULE TeslaBall)
, makeTypeCraftNum 5 STATICMODULE , makeTypeCraftNum 5 (BULPAYLOADMODULE ConcBall)
, makeTypeCraftNum 5 (BULBODYMODULE BounceBullet)
, makeTypeCraftNum 5 (BULBODYMODULE PenetrateBullet)
] ]
'H' -> [shatterGun] 'H' -> [shatterGun]
'I' -> 'I' ->
@@ -212,11 +214,11 @@ inventoryX c = case c of
, makeTypeCraftNum 1 LIGHTSENSOR , makeTypeCraftNum 1 LIGHTSENSOR
, makeTypeCraftNum 1 SOUNDSENSOR , makeTypeCraftNum 1 SOUNDSENSOR
, makeTypeCraftNum 1 HEATSENSOR , makeTypeCraftNum 1 HEATSENSOR
, makeTypeCraftNum 1 BOUNCEMODULE , makeTypeCraftNum 1 (BULBODYMODULE BounceBullet)
, makeTypeCraftNum 1 PENMODULE , makeTypeCraftNum 1 (BULBODYMODULE PenetrateBullet)
, makeTypeCraftNum 1 INCENDIARYMODULE , makeTypeCraftNum 1 (BULPAYLOADMODULE IncBall)
, makeTypeCraftNum 1 CONCUSSMODULE , makeTypeCraftNum 1 (BULPAYLOADMODULE TeslaBall)
, makeTypeCraftNum 1 STATICMODULE , makeTypeCraftNum 1 (BULPAYLOADMODULE ConcBall)
] ]
'L' -> [scrollWatch] 'L' -> [scrollWatch]
'M' -> stackedInventory 'M' -> stackedInventory
@@ -236,9 +238,9 @@ testInventory =
, flatShield , flatShield
, sniperRifle , sniperRifle
, makeTypeCraftNum 1 MOTOR , makeTypeCraftNum 1 MOTOR
, makeTypeCraft INCENDIARYMODULE , makeTypeCraft (BULPAYLOADMODULE IncBall)
, makeTypeCraft STATICMODULE , makeTypeCraft (BULPAYLOADMODULE TeslaBall)
, makeTypeCraft CONCUSSMODULE , makeTypeCraft (BULPAYLOADMODULE ConcBall)
, teleportModule , teleportModule
, makeTypeCraftNum 10 HARDWARE , makeTypeCraftNum 10 HARDWARE
, makeTypeCraftNum 3 SPRING , makeTypeCraftNum 3 SPRING
-1
View File
@@ -13,7 +13,6 @@ aimingWeaponHandlePos cr it = case it ^? itUse . heldAim . aimStance of
Just TwoHandTwist -> -5 Just TwoHandTwist -> -5
Just OneHand -> 14 Just OneHand -> 14
Just TwoHandFlat -> 1.2 * _crRad cr Just TwoHandFlat -> 1.2 * _crRad cr
-- Just LeaveHolstered -> 0
Nothing -> 0 Nothing -> 0
aimingWeaponZeroPos :: Creature -> Item -> Float aimingWeaponZeroPos :: Creature -> Item -> Float
+2 -1
View File
@@ -43,7 +43,7 @@ data BulletEffect
| PenetrateBullet | PenetrateBullet
deriving (Eq, Ord, Show, Enum, Bounded, Read) --Generic, Flat) deriving (Eq, Ord, Show, Enum, Bounded, Read) --Generic, Flat)
data BulletSpawn = BulBall EnergyBallType | BulSpark data BulletSpawn = BulBall {_spawnEBT :: EnergyBallType} | BulSpark
deriving (Show, Eq, Ord, Read) --Generic, Flat) deriving (Show, Eq, Ord, Read) --Generic, Flat)
data BulletTrajectory data BulletTrajectory
@@ -54,6 +54,7 @@ data BulletTrajectory
deriving (Show, Eq, Ord, Read) --Generic, Flat) deriving (Show, Eq, Ord, Read) --Generic, Flat)
makeLenses ''Bullet makeLenses ''Bullet
makeLenses ''BulletSpawn
deriveJSON defaultOptions ''EnergyBallType deriveJSON defaultOptions ''EnergyBallType
deriveJSON defaultOptions ''BulletUpdateMod deriveJSON defaultOptions ''BulletUpdateMod
deriveJSON defaultOptions ''BulletEffect deriveJSON defaultOptions ''BulletEffect
-1
View File
@@ -14,7 +14,6 @@ data EquipSite
| GoesOnBack | GoesOnBack
| GoesOnWrist | GoesOnWrist
| GoesOnLegs | GoesOnLegs
| GoesOnSpecial
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
--deriving (Eq, Ord, Show, Read) --Generic, Flat) --deriving (Eq, Ord, Show, Read) --Generic, Flat)
+4 -10
View File
@@ -67,13 +67,10 @@ data CraftType
| BATTERY | BATTERY
| FUELCELL | FUELCELL
| PORTABLEFUSION | PORTABLEFUSION
| INCENDIARYMODULE
| STATICMODULE
| CONCUSSMODULE
| FRAGMODULE | FRAGMODULE
| FLASHMODULE | FLASHMODULE
| BOUNCEMODULE | BULPAYLOADMODULE EnergyBallType
| PENMODULE | BULBODYMODULE BulletEffect
| TELEPORTMODULE | TELEPORTMODULE
| TIMEMODULE | TIMEMODULE
| SIZEMODULE | SIZEMODULE
@@ -186,11 +183,8 @@ data ItemModuleType
| DRUMMAG | DRUMMAG
| BELTMAG | BELTMAG
| MAGNETMAG | MAGNETMAG
| INCENDBUL | BULPAY EnergyBallType
| BOUNCEBUL | BULBODY BulletEffect
| PENBUL
| STATICBUL
| CONCUSBUL
| TARGET TargetType | TARGET TargetType
| MAGNETTRAJ | MAGNETTRAJ
| FLECHETRAJ | FLECHETRAJ
+1 -1
View File
@@ -6,7 +6,7 @@ import Dodge.Data.Item.Use.Equipment
defaultEquip :: EquipEffect defaultEquip :: EquipEffect
defaultEquip = defaultEquip =
EquipEffect EquipEffect
{ _eeSite = GoesOnSpecial { _eeSite = GoesOnHead
, _eeUse = EDoNothing , _eeUse = EDoNothing
, _eeOnEquip = EDoNothing , _eeOnEquip = EDoNothing
, _eeOnRemove = EDoNothing , _eeOnRemove = EDoNothing
+1 -1
View File
@@ -23,7 +23,7 @@ initialAnoTree =
[ IntAnno $ AnTree . startRoom [ IntAnno $ AnTree . startRoom
, IntAnno $ , IntAnno $
PassthroughLockKeyLists PassthroughLockKeyLists
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE, HELD SPARKGUN])] [(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT (BULPAYLOADMODULE TeslaBall), HELD SPARKGUN])]
itemRooms itemRooms
, IntAnno $ AnTree . lasSensorTurretTest , IntAnno $ AnTree . lasSensorTurretTest
, -- , AnRoom $ tanksRoom [] [] <&> rmPmnts .~ [] , -- , AnRoom $ tanksRoom [] [] <&> rmPmnts .~ []
-1
View File
@@ -297,7 +297,6 @@ equipSiteToPositions es = case es of
GoesOnBack -> [OnBack] GoesOnBack -> [OnBack]
GoesOnWrist -> [OnLeftWrist, OnRightWrist] GoesOnWrist -> [OnLeftWrist, OnRightWrist]
GoesOnLegs -> [OnLegs] GoesOnLegs -> [OnLegs]
GoesOnSpecial -> [OnSpecial]
closeObjScrollDir :: Float -> World -> World closeObjScrollDir :: Float -> World -> World
closeObjScrollDir x closeObjScrollDir x
+12 -6
View File
@@ -16,17 +16,23 @@ makeTypeCraftNum i ct =
makeTypeCraft :: CraftType -> Item makeTypeCraft :: CraftType -> Item
makeTypeCraft = makeTypeCraftNum 1 makeTypeCraft = makeTypeCraftNum 1
bulletPayloadCraft :: EnergyBallType -> Item
bulletPayloadCraft ebt =
makeTypeCraft (BULPAYLOADMODULE ebt)
& itInvSize .~ 1
& itInvColor .~ chartreuse
incendiaryModule :: Item incendiaryModule :: Item
incendiaryModule = incendiaryModule = bulletPayloadCraft IncBall
makeTypeCraft INCENDIARYMODULE
bulletBodyCraft :: BulletEffect -> Item
bulletBodyCraft ebt =
makeTypeCraft (BULBODYMODULE ebt)
& itInvSize .~ 1 & itInvSize .~ 1
& itInvColor .~ chartreuse & itInvColor .~ chartreuse
bounceModule :: Item bounceModule :: Item
bounceModule = bounceModule = bulletBodyCraft BounceBullet
makeTypeCraft BOUNCEMODULE
& itInvSize .~ 1
& itInvColor .~ chartreuse
teleportModule :: Item teleportModule :: Item
teleportModule = teleportModule =
+67 -5
View File
@@ -9,10 +9,11 @@ import LensHelp
import Picture import Picture
import Shape import Shape
import ShapePicture import ShapePicture
import qualified Data.Map.Strict as M
itemSPic :: Item -> SPic itemSPic :: Item -> SPic
itemSPic it = itemSPic it =
foldMap (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of M.foldMapWithKey (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
NoItemType -> over _1 (colorSH magenta) defSPic NoItemType -> over _1 (colorSH magenta) defSPic
CRAFT _ -> defSPic CRAFT _ -> defSPic
HELD ht -> heldItemSPic ht it HELD ht -> heldItemSPic ht it
@@ -55,6 +56,56 @@ leftItemSPic lt _ = case lt of
BLINKER -> defSPic BLINKER -> defSPic
_ -> defSPic _ -> defSPic
magazinePosition :: HeldItemType -> Maybe (Point3, Point3)
magazinePosition hit = case hit of
FLATSHIELD -> Nothing
FORCEFIELDGUN -> Nothing
TORCH -> Nothing
BANGSTICK _ -> Nothing
PISTOL -> Just (V3 5 2 0, V3 0 1 0)
REVOLVER -> Nothing
REVOLVERX _ -> Nothing
MACHINEPISTOL -> Just (V3 5 2 0, V3 0 1 0)
AUTOPISTOL -> Just (V3 5 2 0, V3 0 1 0)
SMG -> Just (V3 7 (-2) 0 , V3 0 0 0)
BANGCONE -> Nothing
BLUNDERBUSS -> Nothing
GRAPECANNON _ -> Nothing
MINIGUNX _ -> Nothing
VOLLEYGUN _ -> Nothing
RIFLE -> Nothing
REPEATER -> Just (V3 10 (-2) 0 , V3 0 0 0)
AUTORIFLE -> Just (V3 10 (-2) 0 , V3 0 0 0)
BURSTRIFLE -> Just (V3 10 (-2) 0 , V3 0 0 0)
BANGROD -> Nothing
ELEPHANTGUN -> Nothing
AMR -> Just (V3 10 (-2) 0 , V3 0 0 0)
AUTOAMR -> Just (V3 10 (-2) 0 , V3 0 0 0)
SNIPERRIFLE -> Nothing
MACHINEGUN -> Just (V3 10 (-2) 0 , V3 0 0 0)
FLAMESPITTER -> Nothing
FLAMETHROWER -> Nothing
FLAMETORRENT -> Nothing
FLAMEWALL -> Nothing
BLOWTORCH -> Nothing
SPARKGUN -> Nothing
TESLAGUN -> Nothing
LASGUN -> Nothing
LASCIRCLE -> Nothing
DUALBEAM -> Nothing
LASWIDE _ -> Nothing
--SONICGUN -> noPic baseSonicShape
TRACTORGUN -> Nothing
LAUNCHER -> Nothing
LAUNCHERX _ -> Nothing
REMOTELAUNCHER -> Nothing
POISONSPRAYER -> Nothing
DRONELAUNCHER -> Nothing
SHATTERGUN -> Nothing
HELDDETECTOR _ -> Nothing
KEYCARD _ -> Nothing
BINOCULARS -> Nothing
heldItemSPic :: HeldItemType -> Item -> SPic heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic FLATSHIELD -> flatShieldEquipSPic
@@ -131,8 +182,8 @@ torchShape =
bot = upperPrismPoly 0.5 $ rectXH 9 2 bot = upperPrismPoly 0.5 $ rectXH 9 2
back = upperPrismPoly 3 $ rectXH 1 2 back = upperPrismPoly 3 $ rectXH 1 2
modulesSPic :: Item -> ItemModuleType -> SPic modulesSPic :: Item -> ModuleSlot -> ItemModuleType -> SPic
modulesSPic it imt = case imt of modulesSPic it _ imt = case imt of
ATTACHTORCH -> noPic (overPosSH (+.+.+ _dimAttachPos (_itDimension it)) torchShape) ATTACHTORCH -> noPic (overPosSH (+.+.+ _dimAttachPos (_itDimension it)) torchShape)
_ -> mempty _ -> mempty
@@ -189,12 +240,23 @@ makeSingleClipAt p it = case it ^? itUse . heldConsumption . laLoaded of
makeTinClipAt :: Float -> Point3 -> Item -> Shape makeTinClipAt :: Float -> Point3 -> Item -> Shape
makeTinClipAt r p it = makeTinClipAt r p it =
translateSH p . overPosSH (rotate3z r) $ translateSH p . overPosSH (rotate3z r) $
upperPrismPoly 1 $ (upperPrismPoly 1 $
reverse $ reverse $
rectNSWE 0 (- y) (-2) 2 rectNSWE 0 (- y) (-2) 2) <> tips
where where
y = fromIntegral y' * 0.3 y = fromIntegral y' * 0.3
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laLoaded y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laLoaded
tips = fromMaybe mempty $ do
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn . spawnEBT
return $ colorSH (bulletPayloadColor ebt) $ upperPrismPoly 1.1 $
reverse $
rectNSWE 0 (- y) (-2) (-1)
bulletPayloadColor :: EnergyBallType -> Color
bulletPayloadColor ebt = case ebt of
IncBall -> orange
TeslaBall -> cyan
ConcBall -> white
volleyGunSPic :: Int -> Item -> SPic volleyGunSPic :: Int -> Item -> SPic
volleyGunSPic i it = volleyGunSPic i it =
+26 -14
View File
@@ -1,5 +1,6 @@
module Dodge.Item.Info where module Dodge.Item.Info where
import Dodge.Module.Info
import Data.Char import Data.Char
import Dodge.Data.Item import Dodge.Data.Item
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
@@ -8,11 +9,12 @@ import LensHelp
itemInfo :: Item -> String itemInfo :: Item -> String
itemInfo itm = itmBaseInfo itm ++ " " ++ itmUsageInfo itm itemInfo itm = itmBaseInfo itm ++ " " ++ itmUsageInfo itm
++ itmSpaceInfo itm ++ itmSpaceInfo itm
++ itmModuleInfo (itm ^. itType . iyModules)
itmSpaceInfo :: Item -> String itmSpaceInfo :: Item -> String
itmSpaceInfo itm = case (ceiling $ _itInvSize itm) of itmSpaceInfo itm = case (ceiling $ _itInvSize itm) of
1 -> "It takes up one inventory slot. " 1 -> " It takes up one inventory slot. "
x -> "It takes up " ++ showInt x ++ " inventory slots. " x -> " It takes up " ++ showInt x ++ " inventory slots. "
itmBaseInfo :: Item -> String itmBaseInfo :: Item -> String
itmBaseInfo itm = case itm ^. itType . iyBase of itmBaseInfo itm = case itm ^. itType . iyBase of
@@ -180,13 +182,10 @@ craftInfo fit = case fit of
BATTERY -> "A store of electical potential energy." BATTERY -> "A store of electical potential energy."
FUELCELL -> "A devices that converts chemical energy into electricity." FUELCELL -> "A devices that converts chemical energy into electricity."
PORTABLEFUSION -> "A miniature nuclear reactor." PORTABLEFUSION -> "A miniature nuclear reactor."
INCENDIARYMODULE -> "A device that converts projectiles into incendiary projectiles." BULPAYLOADMODULE ebt -> "A device that converts projectiles into " ++ displayBulletPayload ebt ++ " projectiles."
STATICMODULE -> "A device that converts projectiles into electrostatic projectiles."
CONCUSSMODULE -> "A device that converts projectiles into concussive projectiles."
FRAGMODULE -> "A device that converts projectiles into fragmentation projectiles." FRAGMODULE -> "A device that converts projectiles into fragmentation projectiles."
FLASHMODULE -> "A device that converts projectiles into flashbang projectiles." FLASHMODULE -> "A device that converts projectiles into flashbang projectiles."
BOUNCEMODULE -> "A device that converts projectiles into bouncing projectiles." BULBODYMODULE be -> "A device that converts projectiles into " ++ displayBulletBody be ++ " projectiles."
PENMODULE -> "A device that converts projectiles into pentrating projectiles."
TELEPORTMODULE -> "A device that allows for near-instant translocation across space." TELEPORTMODULE -> "A device that allows for near-instant translocation across space."
TIMEMODULE -> "A device that can affect temporality." TIMEMODULE -> "A device that can affect temporality."
SIZEMODULE -> "A device that can affect physical size." SIZEMODULE -> "A device that can affect physical size."
@@ -231,23 +230,36 @@ equipSiteInfo es = case es of
GoesOnBack -> " on the back" GoesOnBack -> " on the back"
GoesOnWrist -> " on a wrist" GoesOnWrist -> " on a wrist"
GoesOnLegs -> " on both legs" GoesOnLegs -> " on both legs"
GoesOnSpecial -> " in a unique location"
itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String
itmModuleInfo m itmModuleInfo m
| m == mempty = "" | m == mempty = ""
| otherwise = "Modifications can be made " | otherwise = mms ++ ems
where
(mademods,emptymods) = M.partition (/= EMPTYMODULE) m
mms | mademods == mempty = ""
| otherwise = " Modifications have been made "
++ makeCommaList (map moduleInfo $ M.keys mademods)
ems | emptymods == mempty = ""
| otherwise = " Modifications can be made "
++ makeCommaList (map moduleInfo $ M.keys emptymods)
makeCommaList :: [String] -> String
makeCommaList [] = ""
makeCommaList (x:[]) = x ++ "."
makeCommaList (x:y:[]) = x ++ " and " ++ y ++ "."
makeCommaList (x:xs) = x ++ ", " ++ makeCommaList xs
moduleInfo :: ModuleSlot -> String moduleInfo :: ModuleSlot -> String
moduleInfo imt = case imt of moduleInfo imt = case imt of
ModBulletCollision -> "that affect how fired bullets collide with objects" ModBulletCollision -> "to affect how fired bullets collide with objects"
ModBulletPayload -> "that change bullet payloads" ModBulletPayload -> "to bullet payloads"
ModRifleMag -> "to the magazine" ModRifleMag -> "to the magazine"
ModAutoMag -> "to the magazine" ModAutoMag -> "to the magazine"
ModTarget -> "to add a targeting system" ModTarget -> "to add a targeting system or scope"
ModBulletTrajectory -> "to the trajectory of fired bullets" ModBulletTrajectory -> "to utilize any installed targeting system to affect the trajectory of fired bullets"
ModLauncherHoming -> "to add a homing system" ModLauncherHoming -> "to add a homing system"
ModBattery -> "to its battery system" ModBattery -> "to its battery system"
ModTeleport -> "to add a teleporation system" ModTeleport -> "to add a teleporation system"
ModDualBeam -> "to the dual beams" ModDualBeam -> "to the dual beams"
ModHeldAttach -> "by adding an attachment" ModHeldAttach -> "to add an attachment that may have any number of effects"
+88
View File
@@ -0,0 +1,88 @@
module Dodge.Item.Module where
import Dodge.Data.Item.Combine
import Geometry.Data
moduleAttachPosition :: ItemBaseType -> ModuleSlot -> (Point3, Point3)
moduleAttachPosition ibt ms = case ms of
ModBulletCollision -> (V3 (x - 2.5) y (0.5 * z) , V3 0 1 0)
ModBulletPayload -> (V3 (-x) 0 (0.5 * z), V3 (-1) 0 0)
ModRifleMag -> undefined
ModAutoMag -> undefined
ModTarget -> (V3 0 0 z, V3 0 0 1)
ModBulletTrajectory -> undefined
ModLauncherHoming -> undefined
ModBattery -> undefined
ModTeleport -> undefined
ModDualBeam -> undefined
ModHeldAttach -> undefined
where
V3 x y z = itBounds ibt
itBounds :: ItemBaseType -> Point3
itBounds ibt = case ibt of
HELD hit -> heldBounds hit
_ -> V3 0 0 0
heldBounds :: HeldItemType -> Point3
heldBounds hit = case hit of
BANGSTICK _ -> V3 0 0 0
PISTOL -> bss
REVOLVER -> bss
REVOLVERX _ -> bss
MACHINEPISTOL -> bss
AUTOPISTOL -> bss
SMG -> smgs
BANGCONE -> cs
BLUNDERBUSS -> bbs
GRAPECANNON _ -> bbs
MINIGUNX _ -> minis
VOLLEYGUN _ -> undefined
RIFLE -> rs
REPEATER -> rs
AUTORIFLE -> rs
BURSTRIFLE -> rs
BANGROD -> amrs
ELEPHANTGUN -> amrs
AMR -> amrs
AUTOAMR -> amrs
SNIPERRIFLE -> amrs
MACHINEGUN -> amrs
FLAMESPITTER -> fs
FLAMETHROWER -> fs
FLAMETORRENT -> fs
FLAMEWALL -> fs
BLOWTORCH -> fs
SPARKGUN -> ts
TESLAGUN -> ts
LASGUN -> ls
LASCIRCLE -> ls
DUALBEAM -> ls
LASWIDE _ -> ls
TRACTORGUN -> ls
LAUNCHER -> launchs
LAUNCHERX _ -> launchs
REMOTELAUNCHER -> launchs
POISONSPRAYER -> fs
DRONELAUNCHER -> fs
SHATTERGUN -> launchs
FORCEFIELDGUN -> launchs
HELDDETECTOR _ -> launchs
TORCH -> launchs
BINOCULARS -> launchs
FLATSHIELD -> launchs
KEYCARD _ -> launchs
where
bss = V3 10 2 3
smgs = V3 20 2 3
cs = V3 5 2 3
bbs = V3 20 2 3
minis = V3 10 2 3
rs = V3 25 2 3
amrs = V3 30 2 3
fs = V3 10 2 3
ts = V3 10 2 3
ls = V3 30 2 3
launchs = V3 10 10 10
+5 -5
View File
@@ -25,8 +25,8 @@ 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 [HELD LAUNCHER, HELD LASGUN, HELD SPARKGUN, HELD FLATSHIELD, HELD FORCEFIELDGUN]) [ (lasCenSensEdge, takeOne [HELD LAUNCHER, HELD LASGUN, HELD SPARKGUN, HELD FLATSHIELD, HELD FORCEFIELDGUN])
, (sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE, HELD SPARKGUN]) , (sensorRoomRunPast ELECTRICAL, takeOne [CRAFT (BULPAYLOADMODULE TeslaBall), HELD SPARKGUN])
, (sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT INCENDIARYMODULE]) , (sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT (BULPAYLOADMODULE IncBall)])
, (sensorRoomRunPast LASERING, return $ HELD LASGUN) , (sensorRoomRunPast LASERING, return $ HELD LASGUN)
, (const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3)) , (const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
, (const longRoomRunPast, takeOne [HELD SNIPERRIFLE, HELD FLATSHIELD]) , (const longRoomRunPast, takeOne [HELD SNIPERRIFLE, HELD FLATSHIELD])
@@ -107,17 +107,17 @@ itemRooms =
] ]
) )
, ,
( CRAFT INCENDIARYMODULE ( CRAFT (BULPAYLOADMODULE IncBall)
, join $ , join $
takeOne takeOne
[ rc [incendiaryModule] [ rc [incendiaryModule]
] ]
) )
, ,
( CRAFT STATICMODULE ( CRAFT (BULPAYLOADMODULE TeslaBall)
, join $ , join $
takeOne takeOne
[ rc [makeTypeCraft STATICMODULE] [ rc [makeTypeCraft (BULPAYLOADMODULE TeslaBall)]
] ]
) )
] ]
+4 -5
View File
@@ -6,6 +6,7 @@ module Dodge.Module (
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
import Dodge.Data.Item import Dodge.Data.Item
import Dodge.Module.Info
moduleSizes :: Item -> Int moduleSizes :: Item -> Int
moduleSizes = sum . fmap moduleSize . _iyModules . _itType moduleSizes = sum . fmap moduleSize . _iyModules . _itType
@@ -24,11 +25,8 @@ moduleName imt = case imt of
DRUMMAG -> Just "+DRUM MAG" DRUMMAG -> Just "+DRUM MAG"
BELTMAG -> Just "+BELT FEED" BELTMAG -> Just "+BELT FEED"
MAGNETMAG -> Just "+MAGNET FEED" MAGNETMAG -> Just "+MAGNET FEED"
INCENDBUL -> Just "+INCENDIARY" BULPAY thepayload -> Just $ "+" ++ displayBulletPayload thepayload
BOUNCEBUL -> Just "+BOUNCE" BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
PENBUL -> Just "+PENETRATE"
STATICBUL -> Just "+STATIC"
CONCUSBUL -> Just "+CONCUSS"
TARGET TargetRBCreature -> Just "+CREATURETARGETING" TARGET TargetRBCreature -> Just "+CREATURETARGETING"
TARGET TargetLaser -> Just "+LASERTARGETING" TARGET TargetLaser -> Just "+LASERTARGETING"
TARGET TargetRBPress -> Just "+POSTIONALTARGETING" TARGET TargetRBPress -> Just "+POSTIONALTARGETING"
@@ -45,6 +43,7 @@ moduleName imt = case imt of
EXTRABATTERY -> Just "+BATTERY" EXTRABATTERY -> Just "+BATTERY"
ATTACHTORCH -> Just "+TORCH" ATTACHTORCH -> Just "+TORCH"
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m --moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
--moduleFold g f e = foldr (g . fromMaybe e . f) e --moduleFold g f e = foldr (g . fromMaybe e . f) e
-- . fmap fromModuleType -- . fmap fromModuleType
+15
View File
@@ -0,0 +1,15 @@
module Dodge.Module.Info where
--import qualified Data.Map.Strict as M
import Dodge.Data.Item
displayBulletBody :: BulletEffect -> String
displayBulletBody be = case be of
DestroyBullet -> "DESBUL-shouldn't display"
BounceBullet -> "BOUNCING"
PenetrateBullet -> "PENETRATING"
displayBulletPayload :: EnergyBallType -> String
displayBulletPayload ebt = case ebt of
IncBall -> "INCENDIARY"
TeslaBall -> "STATIC"
ConcBall -> "CONCUSSIVE"
+3 -3
View File
@@ -126,13 +126,13 @@ drawExamineInventory cfig mtweaki w =
closeObjectInfo :: Int -> Either FloorItem Button -> String closeObjectInfo :: Int -> Either FloorItem Button -> String
closeObjectInfo n x = case x of closeObjectInfo n x = case x of
Left (FlIt {_flIt = itm}) -> "On the floor" ++ floorItemPickupInfo n itm ++ itemInfo itm Left (FlIt {_flIt = itm}) -> itemInfo itm ++ " It is on the floor" ++ floorItemPickupInfo n itm
Right _ -> "Some sort of switch or button." Right _ -> "Some sort of switch or button."
floorItemPickupInfo :: Int -> Item -> String floorItemPickupInfo :: Int -> Item -> String
floorItemPickupInfo n itm floorItemPickupInfo n itm
| n >= ceiling (_itInvSize itm) = ", but you have space to pick it up. " | n >= ceiling (_itInvSize itm) = ", but you have space to pick it up."
| otherwise = ", and you don't have space to pick it up. " | otherwise = ", and you don't have space to pick it up."
yourAugmentedItem :: (Item -> a) -> a -> (Either FloorItem Button -> a) -> World -> a yourAugmentedItem :: (Item -> a) -> a -> (Either FloorItem Button -> a) -> World -> a
yourAugmentedItem f x g w yourAugmentedItem f x g w