Remove (by commenting out) module item-type system

This commit is contained in:
2024-09-30 11:42:10 +01:00
parent 4545caa7e6
commit 0701c4043e
37 changed files with 877 additions and 696 deletions
+91 -91
View File
@@ -116,11 +116,11 @@ itemCombinations =
++ map (\i -> po [hd (VOLLEYGUN i), HELD (BANGSTICK 1)] $ volleyGun (i + 1)) [3 .. 5]
++ map (\i -> po [hd (MINIGUNX i), HELD (BANGSTICK 1)] $ miniGunX (i + 1)) [3 .. 15]
++ map (\i -> po [hd (GRAPECANNON i), cr STEELDRUM] $ grapeCannon (i + 1)) [1, 2, 3]
++ [ po (_iyBase (_itType it) : mtype) $ it & itType . iyModules . ix modtype .~ m
| (modtype, is, ms) <- moduleCombinations
, it <- is
, (mtype, m) <- ms
]
-- ++ [ po (_iyBase (_itType it) : mtype) $ it & itType . iyModules . ix modtype .~ m
-- | (modtype, is, ms) <- moduleCombinations
-- , it <- is
-- , (mtype, m) <- ms
-- ]
where
p = (,)
po xs it = (map o xs, it)
@@ -132,95 +132,95 @@ itemCombinations =
-- so there are two requirements for a module combination: the module slot must
-- exist on the item, and the item must be in the given list below
-- these two requirements should probably be combined
moduleCombinations :: [(ModuleSlot, [Item], [([ItemBaseType], ItemModuleType)])]
moduleCombinations =
[
( ModHeldAttach
,
[ rifle
, autoRifle
, burstRifle
]
,
[ amod [cr TAPE, HELD TORCH] ATTACHTORCH
]
)
,
( ModAutoMag
,
[ autoRifle
, autoPistol
, smg
]
,
[ amod [cr MAGNET, cr HARDWARE] MAGNETMAG
]
)
,
( ModBulletCollision
, bulletWeapons
,
[ amod [cr (BULBODYCRAFT be)] (BULBODY be) | be <- [minBound..]
]
)
,
( ModBulletPayload
, bulletMagazines
,
[ amod [cr (ENERGYBALLCRAFT x)] (BULPAY (BulBall x)) | x <- [minBound ..]
] ++
[ amod [cr GASINJECTOR] (BULPAY BulGas)
, amod [cr FRAGCRAFT] (BULPAY BulFrag)
, amod [cr FLAKCRAFT] (BULPAY BulFlak)
]
)
,
( ModTarget
, homingLaunchers ++ bulletWeapons
,
[ amod [cr MICROCHIP, cr HEATSENSOR] (TARGET TargetRBCreature)
, amod [cr MICROCHIP, cr LIGHTSENSOR] (TARGET TARGETLASER)
, amod [cr MICROCHIP, cr SOUNDSENSOR] (TARGET TargetRBPress)
]
)
,
( ModBulletTrajectory
, bulletWeapons
,
[ amod [cr MAGNET, cr MICROCHIP, cr HARDWARE] (BULTRAJ MagnetTrajectoryType)
, amod [cr MICROCHIP, cr HARDWARE] (BULTRAJ FlechetteTrajectoryType)
, amod [cr ANTIMATTER, cr HARDWARE] (BULTRAJ BezierTrajectoryType)
]
)
,
( ModDualBeam
,[]
-- , [dualBeam]
,
[ amod [cr (ENERGYBALLCRAFT IncBall)] INCENDLAS
, amod [cr TRANSFORMER] SPLITLAS
, amod [cr (ENERGYBALLCRAFT TeslaBall)] STATICLAS
]
)
-- ,
-- ( ModTeleport
-- , teleportableWeapons
--moduleCombinations :: [(ModuleSlot, [Item], [([ItemBaseType], ItemModuleType)])]
--moduleCombinations =
-- [
-- ( ModHeldAttach
-- ,
-- [ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
-- [ rifle
-- , autoRifle
-- , burstRifle
-- ]
-- ,
-- [ amod [cr TAPE, HELD TORCH] ATTACHTORCH
-- ]
-- )
,
( ModLauncherHoming
, homingLaunchers
,
[ amod [cr MICROCHIP, cr TRANSMITTER] LAUNCHHOME
]
)
]
where
amod = (,)
cr = CRAFT
-- ,
-- ( ModAutoMag
-- ,
-- [ autoRifle
-- , autoPistol
-- , smg
-- ]
-- ,
-- [ amod [cr MAGNET, cr HARDWARE] MAGNETMAG
-- ]
-- )
-- ,
-- ( ModBulletCollision
-- , bulletWeapons
-- ,
-- [ amod [cr (BULBODYCRAFT be)] (BULBODY be) | be <- [minBound..]
-- ]
-- )
-- ,
-- ( ModBulletPayload
-- , bulletMagazines
-- ,
-- [ amod [cr (ENERGYBALLCRAFT x)] (BULPAY (BulBall x)) | x <- [minBound ..]
-- ] ++
-- [ amod [cr GASINJECTOR] (BULPAY BulGas)
-- , amod [cr FRAGCRAFT] (BULPAY BulFrag)
-- , amod [cr FLAKCRAFT] (BULPAY BulFlak)
-- ]
-- )
-- ,
-- ( ModTarget
-- , homingLaunchers ++ bulletWeapons
-- ,
-- [ amod [cr MICROCHIP, cr HEATSENSOR] (TARGET TargetRBCreature)
-- , amod [cr MICROCHIP, cr LIGHTSENSOR] (TARGET TARGETLASER)
-- , amod [cr MICROCHIP, cr SOUNDSENSOR] (TARGET TargetRBPress)
-- ]
-- )
-- ,
-- ( ModBulletTrajectory
-- , bulletWeapons
-- ,
-- [ amod [cr MAGNET, cr MICROCHIP, cr HARDWARE] (BULTRAJ MagnetTrajectoryType)
-- , amod [cr MICROCHIP, cr HARDWARE] (BULTRAJ FlechetteTrajectoryType)
-- , amod [cr ANTIMATTER, cr HARDWARE] (BULTRAJ BezierTrajectoryType)
-- ]
-- )
-- ,
-- ( ModDualBeam
-- ,[]
---- , [dualBeam]
-- ,
-- [ amod [cr (ENERGYBALLCRAFT IncBall)] INCENDLAS
-- , amod [cr TRANSFORMER] SPLITLAS
-- , amod [cr (ENERGYBALLCRAFT TeslaBall)] STATICLAS
-- ]
-- )
---- ,
---- ( ModTeleport
---- , teleportableWeapons
---- ,
---- [ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
---- ]
---- )
-- ,
-- ( ModLauncherHoming
-- , homingLaunchers
-- ,
-- [ amod [cr MICROCHIP, cr TRANSMITTER] LAUNCHHOME
-- ]
-- )
--
-- ]
-- where
-- amod = (,)
-- cr = CRAFT
homingLaunchers :: [Item]
homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
+36 -36
View File
@@ -7,40 +7,40 @@ import Dodge.Tesla
import Geometry
import LensHelp
moduleModification :: ItemModuleType -> Item -> Item
moduleModification imt = case imt of
EMPTYMODULE -> id
-- BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
BULPAY BulFlak -> (itUse . amagParams . ampBullet . buSpawn .~ BulFlak)
. (itUse . amagParams . ampBullet . buTimer .~ 3)
BULPAY thepayload -> itUse . amagParams . ampBullet . buSpawn .~ thepayload
BULBODY thebody -> itUse . amagParams . ampBullet . buEffect .~ thebody
TARGET {} -> id -- itUse . useTargeting ?~ t
BULTRAJ BasicBulletTrajectoryType -> id
BULTRAJ MagnetTrajectoryType ->
(itUse . amagParams . ampBullet . buTrajectory .~ MagnetTrajectory 0)
. (itUse . amagParams . ampBullet . buVel .~ V2 10 0)
BULTRAJ FlechetteTrajectoryType ->
itUse . amagParams . ampBullet . buTrajectory .~ FlechetteTrajectory 0
BULTRAJ BezierTrajectoryType ->
itUse . amagParams . ampBullet . buTrajectory .~ BezierTrajectory 0 0 0
INCENDLAS -> itParams . lasBeam .~ BeamCombine FlameBeamCombine
SPLITLAS -> itParams . lasBeam .~ BeamCombine SplitBeamCombine
STATICLAS ->
(itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
. (itParams . subParams ?~ teslaParams)
-- WEPTELE -> makeDirectedTele
--LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
LAUNCHHOME -> id
ATTACHTORCH -> id
-- where
-- makeDirectedTele it =
-- it
-- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
-- -- for the camera: the simplest option is to remove all zoom/offset
-- & itUse . heldAim . aimZoom . izFac .~ 1
-- & itUse . heldAim . aimRange .~ 0
--moduleModification :: ItemModuleType -> Item -> Item
--moduleModification imt = case imt of
-- EMPTYMODULE -> id
---- BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
-- MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
-- BULPAY BulFlak -> (itUse . amagParams . ampBullet . buPayload .~ BulFlak)
-- . (itUse . amagParams . ampBullet . buTimer .~ 3)
-- BULPAY thepayload -> itUse . amagParams . ampBullet . buPayload .~ thepayload
-- BULBODY thebody -> itUse . amagParams . ampBullet . buEffect .~ thebody
-- TARGET {} -> id -- itUse . useTargeting ?~ t
-- BULTRAJ BasicBulletTrajectoryType -> id
-- BULTRAJ MagnetTrajectoryType ->
-- (itUse . amagParams . ampBullet . buTrajectory .~ MagnetTrajectory 0)
-- . (itUse . amagParams . ampBullet . buVel .~ V2 10 0)
-- BULTRAJ FlechetteTrajectoryType ->
-- itUse . amagParams . ampBullet . buTrajectory .~ FlechetteTrajectory 0
-- BULTRAJ BezierTrajectoryType ->
-- itUse . amagParams . ampBullet . buTrajectory .~ BezierTrajectory 0 0 0
-- INCENDLAS -> itParams . lasBeam .~ BeamCombine FlameBeamCombine
-- SPLITLAS -> itParams . lasBeam .~ BeamCombine SplitBeamCombine
-- STATICLAS ->
-- (itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
-- . (itParams . subParams ?~ teslaParams)
---- WEPTELE -> makeDirectedTele
-- --LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
-- LAUNCHHOME -> id
-- ATTACHTORCH -> id
---- where
---- makeDirectedTele it =
---- it
---- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
---- -- for the camera: the simplest option is to remove all zoom/offset
---- & itUse . heldAim . aimZoom . izFac .~ 1
---- & itUse . heldAim . aimRange .~ 0
-- a better option would be to involve a "scope" centered on the firing
-- position
@@ -49,5 +49,5 @@ moduleModification imt = case imt of
-- p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
-- a = argV (mouseWorldPos w -.- p)
applyModules :: Item -> Item
applyModules it = foldl' (flip moduleModification) it (it ^. itType . iyModules)
--applyModules :: Item -> Item
--applyModules it = foldl' (flip moduleModification) it (it ^. itType . iyModules)