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
+6 -9
View File
@@ -94,8 +94,8 @@ itemCombinations =
, po [cr MICROCHIP, cr TRANSMITTER, cr HEATSENSOR] (autoDetector CREATUREDETECTOR)
, po [cr BATTERY, cr LED] torch
, po [hd TORCH, eq HAT] headLamp
, po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (makeTypeCraft INCENDIARYMODULE)
, po [cr TRANSFORMER, cr BATTERY, cr MICROCHIP] (makeTypeCraft STATICMODULE)
, po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (bulletPayloadCraft IncBall)
, 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 [cr PIPE, HELD (BANGSTICK i)] $ bangStick (i + 1)) [1 .. 8]
@@ -159,17 +159,14 @@ moduleCombinations =
( ModBulletCollision
, bulletWeapons
,
[ amod [cr BOUNCEMODULE] BOUNCEBUL
, amod [cr PENMODULE] PENBUL
[ amod [cr (BULBODYMODULE be)] (BULBODY be) | be <- [minBound..]
]
)
,
( ModBulletPayload
, bulletWeapons
,
[ amod [cr INCENDIARYMODULE] INCENDBUL
, amod [cr STATICMODULE] STATICBUL
, amod [cr CONCUSSMODULE] CONCUSBUL
[ amod [cr (BULPAYLOADMODULE x)] (BULPAY x) | x <- [minBound ..]
]
)
,
@@ -194,9 +191,9 @@ moduleCombinations =
( ModDualBeam
, [dualBeam]
,
[ amod [cr INCENDIARYMODULE] INCENDLAS
[ amod [cr (BULPAYLOADMODULE IncBall)] INCENDLAS
, 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
BELTMAG -> itUse . heldConsumption . laMax .~ 150
MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
INCENDBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall IncBall
BOUNCEBUL -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ BounceBullet
PENBUL -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ PenetrateBullet
STATICBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall TeslaBall
CONCUSBUL -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall ConcBall
BULPAY thepayload -> itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulBall thepayload
BULBODY thebody -> itUse . heldConsumption . laAmmoType . amBullet . buEffect .~ thebody
TARGET t -> itUse . useTargeting ?~ t
MAGNETTRAJ ->
(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 PRISM
, makeTypeCraftNum 5 LIGHTER
, makeTypeCraftNum 5 INCENDIARYMODULE
, makeTypeCraftNum 5 (BULPAYLOADMODULE IncBall)
]
'G' ->
[ autoPistol
, pistol
, makeTypeCraftNum 2 HARDWARE
, makeTypeCraftNum 2 MAGNET
, makeTypeCraftNum 5 INCENDIARYMODULE
, makeTypeCraftNum 5 CONCUSSMODULE
, makeTypeCraftNum 5 STATICMODULE
, makeTypeCraftNum 5 (BULPAYLOADMODULE IncBall)
, makeTypeCraftNum 5 (BULPAYLOADMODULE TeslaBall)
, makeTypeCraftNum 5 (BULPAYLOADMODULE ConcBall)
, makeTypeCraftNum 5 (BULBODYMODULE BounceBullet)
, makeTypeCraftNum 5 (BULBODYMODULE PenetrateBullet)
]
'H' -> [shatterGun]
'I' ->
@@ -212,11 +214,11 @@ inventoryX c = case c of
, makeTypeCraftNum 1 LIGHTSENSOR
, makeTypeCraftNum 1 SOUNDSENSOR
, makeTypeCraftNum 1 HEATSENSOR
, makeTypeCraftNum 1 BOUNCEMODULE
, makeTypeCraftNum 1 PENMODULE
, makeTypeCraftNum 1 INCENDIARYMODULE
, makeTypeCraftNum 1 CONCUSSMODULE
, makeTypeCraftNum 1 STATICMODULE
, makeTypeCraftNum 1 (BULBODYMODULE BounceBullet)
, makeTypeCraftNum 1 (BULBODYMODULE PenetrateBullet)
, makeTypeCraftNum 1 (BULPAYLOADMODULE IncBall)
, makeTypeCraftNum 1 (BULPAYLOADMODULE TeslaBall)
, makeTypeCraftNum 1 (BULPAYLOADMODULE ConcBall)
]
'L' -> [scrollWatch]
'M' -> stackedInventory
@@ -236,9 +238,9 @@ testInventory =
, flatShield
, sniperRifle
, makeTypeCraftNum 1 MOTOR
, makeTypeCraft INCENDIARYMODULE
, makeTypeCraft STATICMODULE
, makeTypeCraft CONCUSSMODULE
, makeTypeCraft (BULPAYLOADMODULE IncBall)
, makeTypeCraft (BULPAYLOADMODULE TeslaBall)
, makeTypeCraft (BULPAYLOADMODULE ConcBall)
, teleportModule
, makeTypeCraftNum 10 HARDWARE
, makeTypeCraftNum 3 SPRING
-1
View File
@@ -13,7 +13,6 @@ aimingWeaponHandlePos cr it = case it ^? itUse . heldAim . aimStance of
Just TwoHandTwist -> -5
Just OneHand -> 14
Just TwoHandFlat -> 1.2 * _crRad cr
-- Just LeaveHolstered -> 0
Nothing -> 0
aimingWeaponZeroPos :: Creature -> Item -> Float
+2 -1
View File
@@ -43,7 +43,7 @@ data BulletEffect
| PenetrateBullet
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)
data BulletTrajectory
@@ -54,6 +54,7 @@ data BulletTrajectory
deriving (Show, Eq, Ord, Read) --Generic, Flat)
makeLenses ''Bullet
makeLenses ''BulletSpawn
deriveJSON defaultOptions ''EnergyBallType
deriveJSON defaultOptions ''BulletUpdateMod
deriveJSON defaultOptions ''BulletEffect
-1
View File
@@ -14,7 +14,6 @@ data EquipSite
| GoesOnBack
| GoesOnWrist
| GoesOnLegs
| GoesOnSpecial
deriving (Eq,Ord,Show,Read)
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
+4 -10
View File
@@ -67,13 +67,10 @@ data CraftType
| BATTERY
| FUELCELL
| PORTABLEFUSION
| INCENDIARYMODULE
| STATICMODULE
| CONCUSSMODULE
| FRAGMODULE
| FLASHMODULE
| BOUNCEMODULE
| PENMODULE
| BULPAYLOADMODULE EnergyBallType
| BULBODYMODULE BulletEffect
| TELEPORTMODULE
| TIMEMODULE
| SIZEMODULE
@@ -186,11 +183,8 @@ data ItemModuleType
| DRUMMAG
| BELTMAG
| MAGNETMAG
| INCENDBUL
| BOUNCEBUL
| PENBUL
| STATICBUL
| CONCUSBUL
| BULPAY EnergyBallType
| BULBODY BulletEffect
| TARGET TargetType
| MAGNETTRAJ
| FLECHETRAJ
+1 -1
View File
@@ -6,7 +6,7 @@ import Dodge.Data.Item.Use.Equipment
defaultEquip :: EquipEffect
defaultEquip =
EquipEffect
{ _eeSite = GoesOnSpecial
{ _eeSite = GoesOnHead
, _eeUse = EDoNothing
, _eeOnEquip = EDoNothing
, _eeOnRemove = EDoNothing
+1 -1
View File
@@ -23,7 +23,7 @@ initialAnoTree =
[ IntAnno $ AnTree . startRoom
, IntAnno $
PassthroughLockKeyLists
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE, HELD SPARKGUN])]
[(sensorRoomRunPast ELECTRICAL, takeOne [CRAFT (BULPAYLOADMODULE TeslaBall), HELD SPARKGUN])]
itemRooms
, IntAnno $ AnTree . lasSensorTurretTest
, -- , AnRoom $ tanksRoom [] [] <&> rmPmnts .~ []
-1
View File
@@ -297,7 +297,6 @@ equipSiteToPositions es = case es of
GoesOnBack -> [OnBack]
GoesOnWrist -> [OnLeftWrist, OnRightWrist]
GoesOnLegs -> [OnLegs]
GoesOnSpecial -> [OnSpecial]
closeObjScrollDir :: Float -> World -> World
closeObjScrollDir x
+12 -6
View File
@@ -16,17 +16,23 @@ makeTypeCraftNum i ct =
makeTypeCraft :: CraftType -> Item
makeTypeCraft = makeTypeCraftNum 1
bulletPayloadCraft :: EnergyBallType -> Item
bulletPayloadCraft ebt =
makeTypeCraft (BULPAYLOADMODULE ebt)
& itInvSize .~ 1
& itInvColor .~ chartreuse
incendiaryModule :: Item
incendiaryModule =
makeTypeCraft INCENDIARYMODULE
incendiaryModule = bulletPayloadCraft IncBall
bulletBodyCraft :: BulletEffect -> Item
bulletBodyCraft ebt =
makeTypeCraft (BULBODYMODULE ebt)
& itInvSize .~ 1
& itInvColor .~ chartreuse
bounceModule :: Item
bounceModule =
makeTypeCraft BOUNCEMODULE
& itInvSize .~ 1
& itInvColor .~ chartreuse
bounceModule = bulletBodyCraft BounceBullet
teleportModule :: Item
teleportModule =
+67 -5
View File
@@ -9,10 +9,11 @@ import LensHelp
import Picture
import Shape
import ShapePicture
import qualified Data.Map.Strict as M
itemSPic :: Item -> SPic
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
CRAFT _ -> defSPic
HELD ht -> heldItemSPic ht it
@@ -55,6 +56,56 @@ leftItemSPic lt _ = case lt of
BLINKER -> 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 ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic
@@ -131,8 +182,8 @@ torchShape =
bot = upperPrismPoly 0.5 $ rectXH 9 2
back = upperPrismPoly 3 $ rectXH 1 2
modulesSPic :: Item -> ItemModuleType -> SPic
modulesSPic it imt = case imt of
modulesSPic :: Item -> ModuleSlot -> ItemModuleType -> SPic
modulesSPic it _ imt = case imt of
ATTACHTORCH -> noPic (overPosSH (+.+.+ _dimAttachPos (_itDimension it)) torchShape)
_ -> mempty
@@ -189,12 +240,23 @@ makeSingleClipAt p it = case it ^? itUse . heldConsumption . laLoaded of
makeTinClipAt :: Float -> Point3 -> Item -> Shape
makeTinClipAt r p it =
translateSH p . overPosSH (rotate3z r) $
upperPrismPoly 1 $
(upperPrismPoly 1 $
reverse $
rectNSWE 0 (- y) (-2) 2
rectNSWE 0 (- y) (-2) 2) <> tips
where
y = fromIntegral y' * 0.3
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 i it =
+26 -14
View File
@@ -1,5 +1,6 @@
module Dodge.Item.Info where
import Dodge.Module.Info
import Data.Char
import Dodge.Data.Item
import qualified Data.Map.Strict as M
@@ -8,11 +9,12 @@ import LensHelp
itemInfo :: Item -> String
itemInfo itm = itmBaseInfo itm ++ " " ++ itmUsageInfo itm
++ itmSpaceInfo itm
++ itmModuleInfo (itm ^. itType . iyModules)
itmSpaceInfo :: Item -> String
itmSpaceInfo itm = case (ceiling $ _itInvSize itm) of
1 -> "It takes up one inventory slot. "
x -> "It takes up " ++ showInt x ++ " inventory slots. "
1 -> " It takes up one inventory slot. "
x -> " It takes up " ++ showInt x ++ " inventory slots. "
itmBaseInfo :: Item -> String
itmBaseInfo itm = case itm ^. itType . iyBase of
@@ -180,13 +182,10 @@ craftInfo fit = case fit of
BATTERY -> "A store of electical potential energy."
FUELCELL -> "A devices that converts chemical energy into electricity."
PORTABLEFUSION -> "A miniature nuclear reactor."
INCENDIARYMODULE -> "A device that converts projectiles into incendiary projectiles."
STATICMODULE -> "A device that converts projectiles into electrostatic projectiles."
CONCUSSMODULE -> "A device that converts projectiles into concussive projectiles."
BULPAYLOADMODULE ebt -> "A device that converts projectiles into " ++ displayBulletPayload ebt ++ " projectiles."
FRAGMODULE -> "A device that converts projectiles into fragmentation projectiles."
FLASHMODULE -> "A device that converts projectiles into flashbang projectiles."
BOUNCEMODULE -> "A device that converts projectiles into bouncing projectiles."
PENMODULE -> "A device that converts projectiles into pentrating projectiles."
BULBODYMODULE be -> "A device that converts projectiles into " ++ displayBulletBody be ++ " projectiles."
TELEPORTMODULE -> "A device that allows for near-instant translocation across space."
TIMEMODULE -> "A device that can affect temporality."
SIZEMODULE -> "A device that can affect physical size."
@@ -231,23 +230,36 @@ equipSiteInfo es = case es of
GoesOnBack -> " on the back"
GoesOnWrist -> " on a wrist"
GoesOnLegs -> " on both legs"
GoesOnSpecial -> " in a unique location"
itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String
itmModuleInfo m
| 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 imt = case imt of
ModBulletCollision -> "that affect how fired bullets collide with objects"
ModBulletPayload -> "that change bullet payloads"
ModBulletCollision -> "to affect how fired bullets collide with objects"
ModBulletPayload -> "to bullet payloads"
ModRifleMag -> "to the magazine"
ModAutoMag -> "to the magazine"
ModTarget -> "to add a targeting system"
ModBulletTrajectory -> "to the trajectory of fired bullets"
ModTarget -> "to add a targeting system or scope"
ModBulletTrajectory -> "to utilize any installed targeting system to affect the trajectory of fired bullets"
ModLauncherHoming -> "to add a homing system"
ModBattery -> "to its battery system"
ModTeleport -> "to add a teleporation system"
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 =
[ (lasCenSensEdge, takeOne [HELD LAUNCHER, HELD LASGUN, HELD SPARKGUN, HELD FLATSHIELD, HELD FORCEFIELDGUN])
, (sensorRoomRunPast ELECTRICAL, takeOne [CRAFT STATICMODULE, HELD SPARKGUN])
, (sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT INCENDIARYMODULE])
, (sensorRoomRunPast ELECTRICAL, takeOne [CRAFT (BULPAYLOADMODULE TeslaBall), HELD SPARKGUN])
, (sensorRoomRunPast FLAMING, takeOne [HELD FLAMESPITTER, CRAFT (BULPAYLOADMODULE IncBall)])
, (sensorRoomRunPast LASERING, return $ HELD LASGUN)
, (const slowDoorRoomRunPast, return $ HELD (MINIGUNX 3))
, (const longRoomRunPast, takeOne [HELD SNIPERRIFLE, HELD FLATSHIELD])
@@ -107,17 +107,17 @@ itemRooms =
]
)
,
( CRAFT INCENDIARYMODULE
( CRAFT (BULPAYLOADMODULE IncBall)
, join $
takeOne
[ rc [incendiaryModule]
]
)
,
( CRAFT STATICMODULE
( CRAFT (BULPAYLOADMODULE TeslaBall)
, join $
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 Dodge.Data.Item
import Dodge.Module.Info
moduleSizes :: Item -> Int
moduleSizes = sum . fmap moduleSize . _iyModules . _itType
@@ -24,11 +25,8 @@ moduleName imt = case imt of
DRUMMAG -> Just "+DRUM MAG"
BELTMAG -> Just "+BELT FEED"
MAGNETMAG -> Just "+MAGNET FEED"
INCENDBUL -> Just "+INCENDIARY"
BOUNCEBUL -> Just "+BOUNCE"
PENBUL -> Just "+PENETRATE"
STATICBUL -> Just "+STATIC"
CONCUSBUL -> Just "+CONCUSS"
BULPAY thepayload -> Just $ "+" ++ displayBulletPayload thepayload
BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
TARGET TargetRBCreature -> Just "+CREATURETARGETING"
TARGET TargetLaser -> Just "+LASERTARGETING"
TARGET TargetRBPress -> Just "+POSTIONALTARGETING"
@@ -45,6 +43,7 @@ moduleName imt = case imt of
EXTRABATTERY -> Just "+BATTERY"
ATTACHTORCH -> Just "+TORCH"
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
--moduleFold g f e = foldr (g . fromMaybe e . f) e
-- . 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 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."
floorItemPickupInfo :: Int -> Item -> String
floorItemPickupInfo n itm
| n >= ceiling (_itInvSize itm) = ", but you have space to pick it up. "
| otherwise = ", and you don't 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."
yourAugmentedItem :: (Item -> a) -> a -> (Either FloorItem Button -> a) -> World -> a
yourAugmentedItem f x g w