Remove equipment records

This commit is contained in:
2025-06-05 15:54:33 +01:00
parent 5f3b932338
commit 4b326433ab
15 changed files with 78 additions and 69 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ digraph {
74 [shape=box
,label="HELD {_ibtHeld = BLINKER}"];
77 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD}"];
,label="EQUIP {_ibtEquip = MAGSHIELD MagnetRepulse}"];
80 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"];
86 [shape=box
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -6,7 +6,7 @@ module Dodge.Combine.Combinations
, bulletWeapons
) where
--import Data.Bifunctor
import Dodge.Data.Magnet
import Dodge.Item.Ammo
import Dodge.Data.Item
import Dodge.Item
@@ -95,7 +95,7 @@ itemCombinations =
, p [o (HELD SPARKGUN), p 2 $ cr PIPE] teslaGun
-- , p [o $ cr TELEPORTMODULE, p 2 $ cr MICROCHIP] blinker
, p [o $ HELD BLINKER, p 2 $ cr MICROCHIP] unsafeBlinker
, po [cr MAGNET, cr TIN] magShield
, po [cr MAGNET, cr TIN] (magShield MagnetRepulse)
, p [p 2 $ cr PIPE, o $ cr PLATE, o $ cr MOTOR] powerLegs
, p [p 4 $ cr CAN] metalPlate
, p [p 3 $ cr TIN] metalPlate
+3 -2
View File
@@ -22,6 +22,7 @@ module Dodge.Creature (
module Dodge.Creature.YourControl,
) where
import Dodge.Data.Magnet
import Dodge.Item.Ammo
import Dodge.Item.Scope
import Control.Lens
@@ -292,7 +293,7 @@ testInventory =
[ autoAmr
, brainHat
, headLamp
, magShield
, magShield MagnetRepulse
, frontArmour
, wristArmour
, flatShield
@@ -309,7 +310,7 @@ testInventory =
stackedInventory :: [Item]
stackedInventory =
[ torch
, magShield
, magShield MagnetRepulse
, bangCone
, megaTinMag 100
, arHUD
+1 -1
View File
@@ -12,7 +12,7 @@ equipType itm = case itm ^. itType of
eitType :: EquipItemType -> EquipType
eitType = \case
MAGSHIELD -> GoesOnWrist
MAGSHIELD _ -> GoesOnWrist
FLAMESHIELD -> GoesOnWrist
FRONTARMOUR -> GoesOnChest
WRISTARMOUR -> GoesOnWrist
+2 -1
View File
@@ -4,6 +4,7 @@
module Dodge.Data.Item.Combine where
import Dodge.Data.Magnet
import Dodge.Data.Payload
import Control.Lens
import Data.Aeson
@@ -116,7 +117,7 @@ data ConsumableItemType
deriving (Eq, Ord, Show, Read)
data EquipItemType
= MAGSHIELD
= MAGSHIELD MagnetBuBu
| FLAMESHIELD
| FRONTARMOUR
| WRISTARMOUR
+7 -8
View File
@@ -11,16 +11,15 @@ import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Equipment.Misc
import Dodge.Data.Item.HeldUse
data EquipEffect = EquipEffect
{ _eeUse :: Euse --Item -> Creature -> World -> World
-- , _eeOnEquip :: ItmCrWdWd --Item -> Creature -> World -> World
-- , _eeOnRemove :: ItmCrWdWd --Item -> Creature -> World -> World
-- , _eeParams :: EquipParams
-- , _eeViewDist :: Maybe Float
-- , _eeAttachPos :: Point3
}
-- { _eeUse :: Euse --Item -> Creature -> World -> World
---- , _eeOnEquip :: ItmCrWdWd --Item -> Creature -> World -> World
---- , _eeOnRemove :: ItmCrWdWd --Item -> Creature -> World -> World
---- , _eeParams :: EquipParams
---- , _eeViewDist :: Maybe Float
---- , _eeAttachPos :: Point3
-- }
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ItmCrWdWd
+1 -2
View File
@@ -1,13 +1,12 @@
module Dodge.Default.Item.Use.Equipment where
import Dodge.Data.Item.HeldUse
import Dodge.Data.Item.Use.Equipment
defaultEquip :: EquipEffect
defaultEquip =
EquipEffect
{ --_eeType = GoesOnHead
_eeUse = EDoNothing
-- _eeUse = EDoNothing
-- , _eeOnEquip = ItmCrWdWdDoNothing
-- , _eeOnRemove = ItmCrWdWdDoNothing
-- , _eeParams = NoEquipParams
+17 -15
View File
@@ -3,17 +3,17 @@ module Dodge.Equipment (
effectOnEquip,
) where
import Dodge.Creature.Test
import Dodge.Creature.HandPos
import Geometry
import Dodge.Wall.Move
import Dodge.Wall.ForceField
import qualified IntMapHelp as IM
import Dodge.Wall.Delete
import Dodge.Item.Location
import Control.Lens
import Dodge.Data.World
import Data.Maybe
import Dodge.Creature.HandPos
import Dodge.Creature.Test
import Dodge.Data.World
import Dodge.Item.Location
import Dodge.Wall.Delete
import Dodge.Wall.ForceField
import Dodge.Wall.Move
import Geometry
import qualified IntMapHelp as IM
effectOnRemove :: Item -> Creature -> World -> World
effectOnRemove itm = case itm ^. itType of
@@ -38,13 +38,15 @@ effectOnEquip itm = case itm ^. itType of
onEquipWristShield' :: Item -> Creature -> World -> World
onEquipWristShield' itm cr w =
w
-- & pointerToItem itm . itUse . uequipEffect . eeParams .~ EquipID i
& pointerToItem itm . itParams .~ ItemParamID {_itParamID = i}
-- & pointerToItem itm . itUse . uequipEffect . eeParams .~ EquipID i
& pointerToItem itm . itParams .~ ItemParamID{_itParamID = i}
& cWorld . lWorld . walls . at i ?~ forceField{_wlID = i}
& setWristShieldPos (itm
-- & itUse . uequipEffect . eeParams .~ EquipID i
& itParams .~ ItemParamID {_itParamID = i}
) cr
& setWristShieldPos
( itm
-- & itUse . uequipEffect . eeParams .~ EquipID i
& itParams .~ ItemParamID{_itParamID = i}
)
cr
where
i = IM.newKey (w ^. cWorld . lWorld . walls)
+11 -6
View File
@@ -33,14 +33,19 @@ doItmCrWdWd x itm cr = case x of
useE :: LocationLDT ItemLink ComposedItem -> Creature -> World -> World
useE loc cr = case eo of
Nothing -> id
Just EDoNothing -> id
Just (EMagShield mt) -> useMagShield mt itm cr
Just EWristShield -> setWristShieldPos itm cr
Just EHeadLamp -> createHeadLamp itm cr
-- Nothing -> id
-- Just EDoNothing -> id
--Just (EMagShield mt)
EQUIP (MAGSHIELD mt) -> useMagShield mt itm cr
--Just EWristShield
EQUIP WRISTARMOUR -> setWristShieldPos itm cr
--Just EHeadLamp
EQUIP HEADLAMP -> createHeadLamp itm cr
_ -> id
where
itm = loc ^. locLDT . ldtValue . _1
eo = itm ^? itUse . uequipEffect . eeUse
eo = itm ^. itType
--eo = itm ^? itUse . uequipEffect . eeUse
-- this should probably drain energy
useMagShield :: MagnetBuBu -> Item -> Creature -> World -> World
+2 -3
View File
@@ -47,7 +47,7 @@ itemFromAmmoMag at = case at of
CHEMFUELPOUCH -> chemFuelPouch
itemFromAttachType :: AttachType -> Item
itemFromAttachType at = case at of
itemFromAttachType = \case
UNDERBARRELSLOT -> underBarrelSlot
ZOOMSCOPE -> zoomScope
BULLETSYNTH -> bulletSynthesizer
@@ -57,13 +57,12 @@ itemFromAttachType at = case at of
GYROSCOPE -> gyroscope
REMOTEDETONATOR -> remoteDetonator
SMOKEREDUCER -> smokeReducer
-- ROCKETHOMER -> rocketHomer
HOMINGMODULE -> homingModule
SHELLPAYLOAD p -> shellModule p
itemFromEquipType :: EquipItemType -> Item
itemFromEquipType et = case et of
MAGSHIELD -> magShield
MAGSHIELD mt -> magShield mt
FLAMESHIELD -> flameShield
FRONTARMOUR -> frontArmour
WRISTARMOUR -> wristArmour
+1 -1
View File
@@ -144,7 +144,7 @@ fractionLoadedAmmo rs = fromIntegral (_iaLoaded rs) / fromIntegral (_iaMax rs)
equipItemSPic :: EquipItemType -> Item -> SPic
equipItemSPic et _ = case et of
WRIST_ECG -> defSPic
MAGSHIELD -> defSPic
MAGSHIELD _ -> defSPic
FLAMESHIELD -> defSPic
FRONTARMOUR -> defSPic
-- ( mempty
+9 -9
View File
@@ -23,11 +23,11 @@ import Dodge.Data.Item
import Dodge.Default
import LensHelp
magShield :: Item
magShield =
magShield :: MagnetBuBu -> Item
magShield mt =
defaultEquipment
& itUse . uequipEffect . eeUse .~ EMagShield MagnetRepulse
& itType .~ EQUIP MAGSHIELD
-- & itUse . uequipEffect . eeUse .~ EMagShield MagnetRepulse
& itType .~ EQUIP (MAGSHIELD mt)
flameShield :: Item
flameShield =
@@ -43,14 +43,14 @@ wristArmour :: Item
wristArmour =
defaultEquipment
-- & itUse . uequipEffect . eeOnEquip .~ EonWristShield
& itUse . uequipEffect . eeUse .~ EWristShield
-- & itUse . uequipEffect . eeUse .~ EWristShield
-- & itUse . uequipEffect . eeOnRemove .~ EoffWristShield
& itType .~ EQUIP WRISTARMOUR
batteryPack :: Item
batteryPack =
defaultEquipment
& itUse . uequipEffect . eeUse .~ EDoNothing
-- & itUse . uequipEffect . eeUse .~ EDoNothing
& itConsumables
.~ AmmoMag
{ _magParams = NoAmmoParams
@@ -80,7 +80,7 @@ fuelPack =
bulletBeltPack :: Item
bulletBeltPack =
defaultEquipment
& itUse . uequipEffect . eeUse .~ EDoNothing
-- & itUse . uequipEffect . eeUse .~ EDoNothing
& itConsumables
.~ AmmoMag
{ _magParams = BulletParams defaultBullet
@@ -95,7 +95,7 @@ bulletBeltPack =
bulletBeltBracer :: Item
bulletBeltBracer =
defaultEquipment
& itUse . uequipEffect . eeUse .~ EDoNothing
-- & itUse . uequipEffect . eeUse .~ EDoNothing
& itConsumables
.~ AmmoMag
{ _magParams = BulletParams defaultBullet
@@ -116,7 +116,7 @@ hat = defaultEquipment & itType .~ EQUIP HAT
headLamp :: Item
headLamp =
defaultEquipment
& itUse . uequipEffect . eeUse .~ EHeadLamp
-- & itUse . uequipEffect . eeUse .~ EHeadLamp
& itType .~ EQUIP HEADLAMP
powerLegs :: Item
+2 -1
View File
@@ -138,7 +138,8 @@ heldInfo hit = case hit of
equipInfo :: EquipItemType -> String
equipInfo eit = case eit of
MAGSHIELD -> "A device designed to repulse nearby metallic objects."
MAGSHIELD mt -> "A device designed to repulse nearby metallic objects. Of type: "
<> show mt <> "."
FLAMESHIELD -> "A device designed to repulse nearby flames."
FRONTARMOUR -> "A device designed to shield from the front."
WRISTARMOUR -> "A device that projects a forcefield."
+18 -16
View File
@@ -2531,7 +2531,6 @@ _ebVel src/Dodge/Data/EnergyBall.hs 16;" f
_ebWidth src/Dodge/Data/EnergyBall.hs 19;" f
_eboName src/Shader/Data.hs 89;" f
_eboPtr src/Shader/Data.hs 90;" f
_eeOnEquip src/Dodge/Data/Item/Use/Equipment.hs 18;" f
_eeUse src/Dodge/Data/Item/Use/Equipment.hs 17;" f
_emoMenuOption src/Dodge/Data/Universe.hs 77;" f
_energyBalls src/Dodge/Data/LWorld.hs 109;" f
@@ -3590,9 +3589,9 @@ centroidNum src/Geometry/Polygon.hs 133;" f
chainCreatureUpdates src/Dodge/Creature/ChainUpdates.hs 6;" f
chainLinkOrientation src/Dodge/Creature/State.hs 275;" f
chainPairs src/Geometry.hs 359;" f
changeSwapOther src/Dodge/Inventory.hs 143;" f
changeSwapSel src/Dodge/Inventory.hs 136;" f
changeSwapWith src/Dodge/Inventory.hs 177;" f
changeSwapOther src/Dodge/Inventory.hs 144;" f
changeSwapSel src/Dodge/Inventory.hs 137;" f
changeSwapWith src/Dodge/Inventory.hs 178;" f
charToTuple src/Picture/Base.hs 317;" f
charToTupleGrad src/Picture/Text.hs 18;" f
chartreuse src/Color.hs 24;" f
@@ -3955,7 +3954,7 @@ deleteWallIDs src/Dodge/Wall/Delete.hs 28;" f
denormalEdges src/Polyhedra.hs 136;" f
destroyBlock src/Dodge/Block.hs 56;" f
destroyDoor src/Dodge/Block.hs 83;" f
destroyInvItem src/Dodge/Inventory.hs 42;" f
destroyInvItem src/Dodge/Inventory.hs 43;" f
destroyLS src/Dodge/LightSource.hs 32;" f
destroyLSFlashAt src/Dodge/LightSource.hs 42;" f
destroyMachine src/Dodge/Machine/Destroy.hs 12;" f
@@ -4245,7 +4244,8 @@ dummyMenuOption src/Dodge/Menu/Option.hs 74;" f
ebFlicker src/Dodge/EnergyBall.hs 98;" f
edgeFormatting src/Dodge/Combine/Graph.hs 130;" f
edgeToPic src/Dodge/Debug/Picture.hs 431;" f
effectOnRemove src/Dodge/Equipment.hs 7;" f
effectOnEquip src/Dodge/Equipment.hs 33;" f
effectOnRemove src/Dodge/Equipment.hs 18;" f
effectWhileAttached src/Dodge/ItEffect.hs 58;" f
eitType src/Dodge/Data/EquipType.hs 13;" f
ejectS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 502;" f
@@ -4651,8 +4651,8 @@ invRootItemEffs src/Dodge/Creature/State.hs 171;" f
invRootMap src/Dodge/Item/Grammar.hs 286;" f
invRootTrees src/Dodge/Item/Grammar.hs 307;" f
invSelectionItem src/Dodge/Inventory/SelectionList.hs 30;" f
invSetSelection src/Dodge/Inventory.hs 184;" f
invSetSelectionPos src/Dodge/Inventory.hs 192;" f
invSetSelection src/Dodge/Inventory.hs 185;" f
invSetSelectionPos src/Dodge/Inventory.hs 193;" f
invShiftPointBy src/Dodge/ShiftPoint.hs 8;" f
invSideEff src/Dodge/Creature/State.hs 165;" f
invSize src/Dodge/Inventory/CheckSlots.hs 25;" f
@@ -5121,8 +5121,9 @@ obstacleColor src/Dodge/Debug/Picture.hs 257;" f
obstructPathsCrossing src/Dodge/Path.hs 138;" f
oldMachineBootS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 534;" f
onEquipWristShield src/Dodge/Euse.hs 56;" f
onEquipWristShield' src/Dodge/Equipment.hs 38;" f
onRemoveWristShield src/Dodge/Euse.hs 69;" f
onRemoveWristShield' src/Dodge/Equipment.hs 12;" f
onRemoveWristShield' src/Dodge/Equipment.hs 23;" f
onXY src/Geometry/Vector3D.hs 130;" f
oneH src/Dodge/Creature/Test.hs 99;" f
openConsole src/Dodge/Update.hs 129;" f
@@ -5529,7 +5530,7 @@ rightPadNoSquash src/Padding.hs 23;" f
rlPosDir src/Dodge/RoomLink.hs 94;" f
rlauncherPic src/Dodge/Item/Draw/SPic.hs 385;" f
rmInLinks src/Dodge/RoomLink.hs 138;" f
rmInvItem src/Dodge/Inventory.hs 63;" f
rmInvItem src/Dodge/Inventory.hs 64;" f
rmLinksOfType src/Dodge/RoomLink.hs 135;" f
rmOutLinks src/Dodge/RoomLink.hs 138;" f
roomC src/Dodge/Room/Room.hs 38;" f
@@ -5621,8 +5622,8 @@ screenPolygon src/Dodge/Base/Window.hs 17;" f
screenPolygonBord src/Dodge/Base/Window.hs 27;" f
screenPosAbs src/Dodge/ScreenPos.hs 15;" f
screenToWorldPos src/Dodge/Base/Coordinate.hs 54;" f
scrollAugInvSel src/Dodge/Inventory.hs 203;" f
scrollAugNextInSection src/Dodge/Inventory.hs 216;" f
scrollAugInvSel src/Dodge/Inventory.hs 204;" f
scrollAugNextInSection src/Dodge/Inventory.hs 217;" f
scrollCommandStrings src/Dodge/Update/Scroll.hs 161;" f
scrollCommands src/Dodge/Update/Scroll.hs 158;" f
scrollDebugInfoInt src/Dodge/Debug.hs 71;" f
@@ -5703,6 +5704,7 @@ setViewDistance src/Dodge/Update/Camera.hs 227;" f
setViewPos src/Dodge/Creature/ReaderUpdate.hs 61;" f
setViewport src/Dodge/Render.hs 388;" f
setVol src/Dodge/Config/Update.hs 30;" f
setWristShieldPos src/Dodge/Equipment.hs 51;" f
setWristShieldPos src/Dodge/Euse.hs 79;" f
setupConLoop src/Loop.hs 102;" f
setupConLoop' src/Loop.hs 192;" f
@@ -5938,7 +5940,7 @@ swapAnyExtraSelection src/Dodge/Inventory/Swap.hs 55;" f
swapInOutLinks src/Dodge/RoomLink.hs 80;" f
swapIndices src/ListHelp.hs 50;" f
swapInvItems src/Dodge/Inventory/Swap.hs 20;" f
swapItemWith src/Dodge/Inventory.hs 166;" f
swapItemWith src/Dodge/Inventory.hs 167;" f
swarmCrit src/Dodge/Creature/SwarmCrit.hs 10;" f
swarmUsingCenter src/Dodge/Creature/Boid.hs 171;" f
switchDoor src/Dodge/Placement/Instance/Door.hs 96;" f
@@ -6046,10 +6048,10 @@ toV4 src/Geometry/Data.hs 40;" f
toggleCombineInv src/Dodge/DisplayInventory.hs 317;" f
toggleCommand src/Dodge/Terminal.hs 196;" f
toggleEquipmentAt src/Dodge/Creature/Impulse/UseItem.hs 94;" f
toggleExamineInv src/Dodge/Creature/Impulse/UseItem.hs 132;" f
toggleExamineInv src/Dodge/Creature/Impulse/UseItem.hs 134;" f
toggleExamineInv src/Dodge/ToggleExamine.hs 5;" f
toggleJust src/MaybeHelp.hs 41;" f
toggleMapperInv src/Dodge/Creature/Impulse/UseItem.hs 137;" f
toggleMapperInv src/Dodge/Creature/Impulse/UseItem.hs 139;" f
togglesToEffects src/Dodge/Terminal.hs 248;" f
tone440S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 488;" f
tone440raiseS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 508;" f
@@ -6186,7 +6188,7 @@ updateBulVel src/Dodge/Bullet.hs 53;" f
updateBullet src/Dodge/Bullet.hs 21;" f
updateBullets src/Dodge/Update.hs 539;" f
updateCamera src/Dodge/Update/Camera.hs 28;" f
updateCloseObjects src/Dodge/Inventory.hs 115;" f
updateCloseObjects src/Dodge/Inventory.hs 116;" f
updateCloud src/Dodge/Update.hs 738;" f
updateClouds src/Dodge/Update.hs 613;" f
updateCombinePositioning src/Dodge/DisplayInventory.hs 37;" f