Remove (by commenting out) module item-type system
This commit is contained in:
+115
-1
@@ -1 +1,115 @@
|
|||||||
All good (616 modules, at 21:51:07)
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:6:1-19: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Control.Lens’ is redundant
|
||||||
|
|
|
||||||
|
6 | import Control.Lens
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:7:1-20: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Control.Monad’ is redundant
|
||||||
|
|
|
||||||
|
7 | import Control.Monad
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:11:1-28: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Data.Map.Merge.Strict’ is redundant
|
||||||
|
|
|
||||||
|
11 | import Data.Map.Merge.Strict
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:13:1-17: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Data.Maybe’ is redundant
|
||||||
|
|
|
||||||
|
13 | import Data.Maybe
|
||||||
|
| ^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:21:1-19: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Module’ is redundant
|
||||||
|
|
|
||||||
|
21 | import Dodge.Module
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine.hs:64:5-7: warning: [-Wunused-matches]
|
||||||
|
Defined but not used: ‘inv’
|
||||||
|
|
|
||||||
|
64 | cmm inv (is, itm) = (is, ([], itm))
|
||||||
|
| ^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:16:1-19: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Module’ is redundant
|
||||||
|
|
|
||||||
|
16 | import Dodge.Module
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Item/SlotsTaken.hs:7:1-19: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Module’ is redundant
|
||||||
|
|
|
||||||
|
7 | import Dodge.Module
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Module.hs:7:1-37: warning: [-Wunused-imports]
|
||||||
|
The qualified import of ‘Data.Map.Strict’ is redundant
|
||||||
|
|
|
||||||
|
7 | import qualified Data.Map.Strict as M
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Module.hs:8:1-22: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Data.Item’ is redundant
|
||||||
|
|
|
||||||
|
8 | import Dodge.Data.Item
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Module.hs:9:1-24: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Module.Info’ is redundant
|
||||||
|
|
|
||||||
|
9 | import Dodge.Module.Info
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Combinations.hs:226:1-15: warning: [-Wunused-top-binds]
|
||||||
|
Defined but not used: ‘homingLaunchers’
|
||||||
|
|
|
||||||
|
226 | homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Combinations.hs:241:1-15: warning: [-Wunused-top-binds]
|
||||||
|
Defined but not used: ‘bulletMagazines’
|
||||||
|
|
|
||||||
|
241 | bulletMagazines =
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:9:1-37: warning: [-Wunused-imports]
|
||||||
|
The qualified import of ‘Data.Map.Strict’ is redundant
|
||||||
|
|
|
||||||
|
9 | import qualified Data.Map.Strict as M
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Item/Info.hs:4:1-37: warning: [-Wunused-imports]
|
||||||
|
The qualified import of ‘Data.Map.Strict’ is redundant
|
||||||
|
|
|
||||||
|
4 | import qualified Data.Map.Strict as M
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:8:1-37: warning: [-Wunused-imports]
|
||||||
|
The qualified import of ‘Data.Map.Strict’ is redundant
|
||||||
|
|
|
||||||
|
8 | import qualified Data.Map.Strict as M
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:3:1-20: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Data.Foldable’ is redundant
|
||||||
|
|
|
||||||
|
3 | import Data.Foldable
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:4:1-22: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Data.Beam’ is redundant
|
||||||
|
|
|
||||||
|
4 | import Dodge.Data.Beam
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:5:1-22: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Data.Item’ is redundant
|
||||||
|
|
|
||||||
|
5 | import Dodge.Data.Item
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:6:1-18: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Dodge.Tesla’ is redundant
|
||||||
|
|
|
||||||
|
6 | import Dodge.Tesla
|
||||||
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:7:1-15: warning: [-Wunused-imports]
|
||||||
|
The import of ‘Geometry’ is redundant
|
||||||
|
|
|
||||||
|
7 | import Geometry
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Combine/Module.hs:8:1-15: warning: [-Wunused-imports]
|
||||||
|
The import of ‘LensHelp’ is redundant
|
||||||
|
|
|
||||||
|
8 | import LensHelp
|
||||||
|
| ^^^^^^^^^^^^^^^
|
||||||
|
/home/justin/Haskell/loop/src/Dodge/Data/Item/Combine.hs:12:1-37: warning: [-Wunused-imports]
|
||||||
|
The qualified import of ‘Data.Map.Strict’ is redundant
|
||||||
|
|
|
||||||
|
12 | import qualified Data.Map.Strict as M
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+4
-4
@@ -39,7 +39,7 @@ mvBullet x w bu
|
|||||||
$ applyMagnetsToBul bu w
|
$ applyMagnetsToBul bu w
|
||||||
where
|
where
|
||||||
endspawn = fromMaybe id $ do
|
endspawn = fromMaybe id $ do
|
||||||
partspawn <- bulletSpawn bu
|
partspawn <- useBulletPayload bu
|
||||||
return $ partspawn p
|
return $ partspawn p
|
||||||
p = _buPos bu
|
p = _buPos bu
|
||||||
|
|
||||||
@@ -102,8 +102,8 @@ bounceDir (_, Right wl) | _wlBouncy wl = Just $ uncurry (-.-) (_wlLine wl)
|
|||||||
bounceDir (p, Left cr) | crIsArmouredFrom p cr = Just $ vNormal $ p -.- _crPos cr
|
bounceDir (p, Left cr) | crIsArmouredFrom p cr = Just $ vNormal $ p -.- _crPos cr
|
||||||
bounceDir _ = Nothing
|
bounceDir _ = Nothing
|
||||||
|
|
||||||
bulletSpawn :: Bullet -> Maybe (Point2 -> World -> World)
|
useBulletPayload :: Bullet -> Maybe (Point2 -> World -> World)
|
||||||
bulletSpawn bu = case _buSpawn bu of
|
useBulletPayload bu = case _buPayload bu of
|
||||||
BulSpark -> Nothing
|
BulSpark -> Nothing
|
||||||
BulFlak -> Just (makeFlak bu)
|
BulFlak -> Just (makeFlak bu)
|
||||||
BulFrag -> Just makeFragBullets
|
BulFrag -> Just makeFragBullets
|
||||||
@@ -135,7 +135,7 @@ makeFlak bu _ w = w & cWorld . lWorld . instantBullets .++~ [f x | x <- xs]
|
|||||||
xs = take 5 $ randomRs (-s,s) $ _randGen w
|
xs = take 5 $ randomRs (-s,s) $ _randGen w
|
||||||
f x = bu & buVel %~ g x
|
f x = bu & buVel %~ g x
|
||||||
& buTimer .~ 97
|
& buTimer .~ 97
|
||||||
& buSpawn .~ BulSpark
|
& buPayload .~ BulSpark
|
||||||
& buWidth .~ 0.5
|
& buWidth .~ 0.5
|
||||||
& buDamages .~
|
& buDamages .~
|
||||||
[ Damage PIERCING 25 0 0 0 $ PushBackDamage 2
|
[ Damage PIERCING 25 0 0 0 $ PushBackDamage 2
|
||||||
|
|||||||
+29
-26
@@ -61,34 +61,37 @@ combineListInfo w = filter f . map (cmm inv) $ combineItemListYouX w
|
|||||||
f (is, (_, itm)) = _itType itm `notElem` fmap _itType (IM.restrictKeys inv (IS.fromList is))
|
f (is, (_, itm)) = _itType itm `notElem` fmap _itType (IM.restrictKeys inv (IS.fromList is))
|
||||||
|
|
||||||
cmm :: IM.IntMap Item -> ([Int], Item) -> ([Int], ([String], Item))
|
cmm :: IM.IntMap Item -> ([Int], Item) -> ([Int], ([String], Item))
|
||||||
cmm inv (is, itm) = (is, itm & itType . iyModules %%~ flip combineModuleMaps mms)
|
cmm inv (is, itm) = (is, ([], itm))
|
||||||
where
|
|
||||||
mms = map (_iyModules . _itType . (inv IM.!)) is
|
|
||||||
|
|
||||||
combineModuleMaps ::
|
--cmm :: IM.IntMap Item -> ([Int], Item) -> ([Int], ([String], Item))
|
||||||
M.Map ModuleSlot ItemModuleType ->
|
--cmm inv (is, itm) = (is, itm & itType . iyModules %%~ flip combineModuleMaps mms)
|
||||||
[M.Map ModuleSlot ItemModuleType] ->
|
-- where
|
||||||
([String], M.Map ModuleSlot ItemModuleType)
|
-- mms = map (_iyModules . _itType . (inv IM.!)) is
|
||||||
combineModuleMaps = foldM combineTwoModuleMaps
|
|
||||||
|
|
||||||
combineTwoModuleMaps ::
|
--combineModuleMaps ::
|
||||||
M.Map ModuleSlot ItemModuleType ->
|
-- M.Map ModuleSlot ItemModuleType ->
|
||||||
M.Map ModuleSlot ItemModuleType ->
|
-- [M.Map ModuleSlot ItemModuleType] ->
|
||||||
([String], M.Map ModuleSlot ItemModuleType)
|
-- ([String], M.Map ModuleSlot ItemModuleType)
|
||||||
combineTwoModuleMaps =
|
--combineModuleMaps = foldM combineTwoModuleMaps
|
||||||
mergeA
|
|
||||||
preserveMissing
|
--combineTwoModuleMaps ::
|
||||||
(filterAMissing f)
|
-- M.Map ModuleSlot ItemModuleType ->
|
||||||
(zipWithAMatched g)
|
-- M.Map ModuleSlot ItemModuleType ->
|
||||||
where
|
-- ([String], M.Map ModuleSlot ItemModuleType)
|
||||||
f _ EMPTYMODULE = ([], False)
|
--combineTwoModuleMaps =
|
||||||
f _ md = ([rm "REMOVES" md], False)
|
-- mergeA
|
||||||
g _ EMPTYMODULE md = ([], md)
|
-- preserveMissing
|
||||||
g _ md EMPTYMODULE = ([], md)
|
-- (filterAMissing f)
|
||||||
g _ md2 md1 = ([rm "REPLACES" md1 ++ rm " WITH" md2], md2)
|
-- (zipWithAMatched g)
|
||||||
rm str md = str ++ " " ++ fullModuleName md
|
-- where
|
||||||
|
-- f _ EMPTYMODULE = ([], False)
|
||||||
|
-- f _ md = ([rm "REMOVES" md], False)
|
||||||
|
-- g _ EMPTYMODULE md = ([], md)
|
||||||
|
-- g _ md EMPTYMODULE = ([], md)
|
||||||
|
-- g _ md2 md1 = ([rm "REPLACES" md1 ++ rm " WITH" md2], md2)
|
||||||
|
-- rm str md = str ++ " " ++ fullModuleName md
|
||||||
|
|
||||||
-- g above could be a monoid of some description...
|
-- g above could be a monoid of some description...
|
||||||
|
|
||||||
fullModuleName :: ItemModuleType -> String
|
--fullModuleName :: ItemModuleType -> String
|
||||||
fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
--fullModuleName = fromMaybe "EMPTYMODULE" . moduleName
|
||||||
|
|||||||
@@ -116,11 +116,11 @@ itemCombinations =
|
|||||||
++ map (\i -> po [hd (VOLLEYGUN i), HELD (BANGSTICK 1)] $ volleyGun (i + 1)) [3 .. 5]
|
++ 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 (MINIGUNX i), HELD (BANGSTICK 1)] $ miniGunX (i + 1)) [3 .. 15]
|
||||||
++ map (\i -> po [hd (GRAPECANNON i), cr STEELDRUM] $ grapeCannon (i + 1)) [1, 2, 3]
|
++ 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
|
-- ++ [ po (_iyBase (_itType it) : mtype) $ it & itType . iyModules . ix modtype .~ m
|
||||||
| (modtype, is, ms) <- moduleCombinations
|
-- | (modtype, is, ms) <- moduleCombinations
|
||||||
, it <- is
|
-- , it <- is
|
||||||
, (mtype, m) <- ms
|
-- , (mtype, m) <- ms
|
||||||
]
|
-- ]
|
||||||
where
|
where
|
||||||
p = (,)
|
p = (,)
|
||||||
po xs it = (map o xs, it)
|
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
|
-- 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
|
-- exist on the item, and the item must be in the given list below
|
||||||
-- these two requirements should probably be combined
|
-- these two requirements should probably be combined
|
||||||
moduleCombinations :: [(ModuleSlot, [Item], [([ItemBaseType], ItemModuleType)])]
|
--moduleCombinations :: [(ModuleSlot, [Item], [([ItemBaseType], ItemModuleType)])]
|
||||||
moduleCombinations =
|
--moduleCombinations =
|
||||||
[
|
-- [
|
||||||
( ModHeldAttach
|
-- ( 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
|
|
||||||
-- ,
|
-- ,
|
||||||
-- [ amod [cr TELEPORTMODULE, cr MICROCHIP] WEPTELE
|
-- [ rifle
|
||||||
|
-- , autoRifle
|
||||||
|
-- , burstRifle
|
||||||
|
-- ]
|
||||||
|
-- ,
|
||||||
|
-- [ amod [cr TAPE, HELD TORCH] ATTACHTORCH
|
||||||
-- ]
|
-- ]
|
||||||
-- )
|
-- )
|
||||||
,
|
-- ,
|
||||||
( ModLauncherHoming
|
-- ( ModAutoMag
|
||||||
, homingLaunchers
|
-- ,
|
||||||
,
|
-- [ autoRifle
|
||||||
[ amod [cr MICROCHIP, cr TRANSMITTER] LAUNCHHOME
|
-- , autoPistol
|
||||||
]
|
-- , smg
|
||||||
)
|
-- ]
|
||||||
|
-- ,
|
||||||
]
|
-- [ amod [cr MAGNET, cr HARDWARE] MAGNETMAG
|
||||||
where
|
-- ]
|
||||||
amod = (,)
|
-- )
|
||||||
cr = CRAFT
|
-- ,
|
||||||
|
-- ( 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 :: [Item]
|
||||||
homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
|
homingLaunchers = launcher : [launcherX i | i <- [2 .. 10]]
|
||||||
|
|||||||
+36
-36
@@ -7,40 +7,40 @@ import Dodge.Tesla
|
|||||||
import Geometry
|
import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
moduleModification :: ItemModuleType -> Item -> Item
|
--moduleModification :: ItemModuleType -> Item -> Item
|
||||||
moduleModification imt = case imt of
|
--moduleModification imt = case imt of
|
||||||
EMPTYMODULE -> id
|
-- EMPTYMODULE -> id
|
||||||
-- BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
|
---- BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
|
||||||
MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
|
-- MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
|
||||||
BULPAY BulFlak -> (itUse . amagParams . ampBullet . buSpawn .~ BulFlak)
|
-- BULPAY BulFlak -> (itUse . amagParams . ampBullet . buPayload .~ BulFlak)
|
||||||
. (itUse . amagParams . ampBullet . buTimer .~ 3)
|
-- . (itUse . amagParams . ampBullet . buTimer .~ 3)
|
||||||
BULPAY thepayload -> itUse . amagParams . ampBullet . buSpawn .~ thepayload
|
-- BULPAY thepayload -> itUse . amagParams . ampBullet . buPayload .~ thepayload
|
||||||
BULBODY thebody -> itUse . amagParams . ampBullet . buEffect .~ thebody
|
-- BULBODY thebody -> itUse . amagParams . ampBullet . buEffect .~ thebody
|
||||||
TARGET {} -> id -- itUse . useTargeting ?~ t
|
-- TARGET {} -> id -- itUse . useTargeting ?~ t
|
||||||
BULTRAJ BasicBulletTrajectoryType -> id
|
-- BULTRAJ BasicBulletTrajectoryType -> id
|
||||||
BULTRAJ MagnetTrajectoryType ->
|
-- BULTRAJ MagnetTrajectoryType ->
|
||||||
(itUse . amagParams . ampBullet . buTrajectory .~ MagnetTrajectory 0)
|
-- (itUse . amagParams . ampBullet . buTrajectory .~ MagnetTrajectory 0)
|
||||||
. (itUse . amagParams . ampBullet . buVel .~ V2 10 0)
|
-- . (itUse . amagParams . ampBullet . buVel .~ V2 10 0)
|
||||||
BULTRAJ FlechetteTrajectoryType ->
|
-- BULTRAJ FlechetteTrajectoryType ->
|
||||||
itUse . amagParams . ampBullet . buTrajectory .~ FlechetteTrajectory 0
|
-- itUse . amagParams . ampBullet . buTrajectory .~ FlechetteTrajectory 0
|
||||||
BULTRAJ BezierTrajectoryType ->
|
-- BULTRAJ BezierTrajectoryType ->
|
||||||
itUse . amagParams . ampBullet . buTrajectory .~ BezierTrajectory 0 0 0
|
-- itUse . amagParams . ampBullet . buTrajectory .~ BezierTrajectory 0 0 0
|
||||||
INCENDLAS -> itParams . lasBeam .~ BeamCombine FlameBeamCombine
|
-- INCENDLAS -> itParams . lasBeam .~ BeamCombine FlameBeamCombine
|
||||||
SPLITLAS -> itParams . lasBeam .~ BeamCombine SplitBeamCombine
|
-- SPLITLAS -> itParams . lasBeam .~ BeamCombine SplitBeamCombine
|
||||||
STATICLAS ->
|
-- STATICLAS ->
|
||||||
(itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
|
-- (itParams . lasBeam .~ BeamCombine TeslaBeamCombine)
|
||||||
. (itParams . subParams ?~ teslaParams)
|
-- . (itParams . subParams ?~ teslaParams)
|
||||||
-- WEPTELE -> makeDirectedTele
|
---- WEPTELE -> makeDirectedTele
|
||||||
--LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
|
-- --LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
|
||||||
LAUNCHHOME -> id
|
-- LAUNCHHOME -> id
|
||||||
ATTACHTORCH -> id
|
-- ATTACHTORCH -> id
|
||||||
-- where
|
---- where
|
||||||
-- makeDirectedTele it =
|
---- makeDirectedTele it =
|
||||||
-- it
|
---- it
|
||||||
-- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
---- & itUse . heldMods %~ ModWithDirectedTeleport -- .:~ withPosDirWallCheck directedTelPos
|
||||||
-- -- for the camera: the simplest option is to remove all zoom/offset
|
---- -- for the camera: the simplest option is to remove all zoom/offset
|
||||||
-- & itUse . heldAim . aimZoom . izFac .~ 1
|
---- & itUse . heldAim . aimZoom . izFac .~ 1
|
||||||
-- & itUse . heldAim . aimRange .~ 0
|
---- & itUse . heldAim . aimRange .~ 0
|
||||||
|
|
||||||
-- a better option would be to involve a "scope" centered on the firing
|
-- a better option would be to involve a "scope" centered on the firing
|
||||||
-- position
|
-- position
|
||||||
@@ -49,5 +49,5 @@ moduleModification imt = case imt of
|
|||||||
-- p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
|
-- p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
|
||||||
-- a = argV (mouseWorldPos w -.- p)
|
-- a = argV (mouseWorldPos w -.- p)
|
||||||
|
|
||||||
applyModules :: Item -> Item
|
--applyModules :: Item -> Item
|
||||||
applyModules it = foldl' (flip moduleModification) it (it ^. itType . iyModules)
|
--applyModules it = foldl' (flip moduleModification) it (it ^. itType . iyModules)
|
||||||
|
|||||||
@@ -251,10 +251,13 @@ inventoryX c = case c of
|
|||||||
'V' ->
|
'V' ->
|
||||||
[targetingScope tt | tt <- [minBound .. maxBound]]
|
[targetingScope tt | tt <- [minBound .. maxBound]]
|
||||||
<>
|
<>
|
||||||
[ autoRifle
|
[ augmentedHUD
|
||||||
|
, autoRifle
|
||||||
, megaTinMag 10200
|
, megaTinMag 10200
|
||||||
] <>
|
] <>
|
||||||
[bulletTargetingModule btt | btt <- [minBound .. maxBound]]
|
[bulletTargetingModule btt | btt <- [minBound .. maxBound]]
|
||||||
|
<> [bulletModule (BulletModPayload (BulBall x)) | x <- [minBound .. maxBound]]
|
||||||
|
<> [bulletModule (BulletModEffect x) | x <- [minBound .. maxBound]]
|
||||||
_ -> []
|
_ -> []
|
||||||
|
|
||||||
testInventory :: [Item]
|
testInventory :: [Item]
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ itemUseEffect cr it w = case it ^. ldtValue . itUse of
|
|||||||
TargetingUse {} -> w
|
TargetingUse {} -> w
|
||||||
AmmoMagUse{} -> w
|
AmmoMagUse{} -> w
|
||||||
ScopeUse{} -> w
|
ScopeUse{} -> w
|
||||||
BulletTrajectoryUse{} -> w
|
BulletModUse{} -> w
|
||||||
where
|
where
|
||||||
itm = it ^. ldtValue
|
itm = it ^. ldtValue
|
||||||
doequipmentchange = fromMaybe w $ do
|
doequipmentchange = fromMaybe w $ do
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module Dodge.Creature.Picture (
|
|||||||
deadFeet,
|
deadFeet,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Item.Grammar
|
||||||
import Shape
|
import Shape
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Dodge.Creature.HandPos (translateToLeftHand, translateToRightHand)
|
import Dodge.Creature.HandPos (translateToLeftHand, translateToRightHand)
|
||||||
@@ -172,4 +173,4 @@ shoulderSH = translateSHz 20
|
|||||||
|
|
||||||
drawEquipment :: Creature -> SPic
|
drawEquipment :: Creature -> SPic
|
||||||
{-# INLINE drawEquipment #-}
|
{-# INLINE drawEquipment #-}
|
||||||
drawEquipment cr = foldMap (itemEquipPict cr) (_crInv cr)
|
drawEquipment cr = foldMap (itemEquipPict cr) (invLDT $ _crInv cr)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import Geometry.Data
|
|||||||
data Bullet = Bullet
|
data Bullet = Bullet
|
||||||
{ _buDelayFraction :: Float
|
{ _buDelayFraction :: Float
|
||||||
, _buEffect :: BulletEffect
|
, _buEffect :: BulletEffect
|
||||||
, _buSpawn :: BulletSpawn
|
, _buPayload :: BulletPayload
|
||||||
, _buTrajectory :: BulletTrajectory
|
, _buTrajectory :: BulletTrajectory
|
||||||
, _buVel :: Point2
|
, _buVel :: Point2
|
||||||
, _buDrag :: Float
|
, _buDrag :: Float
|
||||||
@@ -39,7 +39,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
|
data BulletPayload
|
||||||
= BulBall {_spawnEBT :: EnergyBallType}
|
= BulBall {_spawnEBT :: EnergyBallType}
|
||||||
| BulSpark
|
| BulSpark
|
||||||
| BulFlak
|
| BulFlak
|
||||||
@@ -62,10 +62,10 @@ data BulletTrajectoryType
|
|||||||
deriving (Show, Eq, Ord, Read, Enum, Bounded) --Generic, Flat)
|
deriving (Show, Eq, Ord, Read, Enum, Bounded) --Generic, Flat)
|
||||||
|
|
||||||
makeLenses ''Bullet
|
makeLenses ''Bullet
|
||||||
makeLenses ''BulletSpawn
|
makeLenses ''BulletPayload
|
||||||
deriveJSON defaultOptions ''EnergyBallType
|
deriveJSON defaultOptions ''EnergyBallType
|
||||||
deriveJSON defaultOptions ''BulletEffect
|
deriveJSON defaultOptions ''BulletEffect
|
||||||
deriveJSON defaultOptions ''BulletSpawn
|
deriveJSON defaultOptions ''BulletPayload
|
||||||
deriveJSON defaultOptions ''BulletTrajectory
|
deriveJSON defaultOptions ''BulletTrajectory
|
||||||
deriveJSON defaultOptions ''BulletTrajectoryType
|
deriveJSON defaultOptions ''BulletTrajectoryType
|
||||||
deriveJSON defaultOptions ''Bullet
|
deriveJSON defaultOptions ''Bullet
|
||||||
|
|||||||
@@ -16,20 +16,26 @@ data ComposeLinkType
|
|||||||
= AmmoInLink Int AmmoType
|
= AmmoInLink Int AmmoType
|
||||||
| AmmoModLink
|
| AmmoModLink
|
||||||
| AmmoTargetingLink
|
| AmmoTargetingLink
|
||||||
|
| AmmoPayloadLink
|
||||||
|
| AmmoEffectLink
|
||||||
| WeaponScopeLink
|
| WeaponScopeLink
|
||||||
| WeaponTargetingLink
|
| WeaponTargetingLink
|
||||||
| RemoteScreenLink
|
| RemoteScreenLink
|
||||||
|
| AugmentedHUDLink
|
||||||
deriving (Eq,Ord,Show,Read)
|
deriving (Eq,Ord,Show,Read)
|
||||||
|
|
||||||
data ItemStructuralFunction
|
data ItemStructuralFunction
|
||||||
= WeaponPlatformSF
|
= WeaponPlatformSF
|
||||||
| WeaponScopeSF
|
| WeaponScopeSF
|
||||||
| WeaponTargetingSF
|
| WeaponTargetingSF
|
||||||
|
| AugmentedHUDSF
|
||||||
| AmmoMagSF AmmoType
|
| AmmoMagSF AmmoType
|
||||||
| RemoteScreenSF
|
| RemoteScreenSF
|
||||||
| UncomposableIsolateSF
|
| UncomposableIsolateSF
|
||||||
| AmmoModifierSF AmmoType
|
| AmmoModifierSF AmmoType
|
||||||
| AmmoTargetingSF AmmoType
|
| AmmoTargetingSF AmmoType
|
||||||
|
| AmmoPayloadSF AmmoType
|
||||||
|
| AmmoEffectSF AmmoType
|
||||||
deriving (Eq,Ord,Show,Read)
|
deriving (Eq,Ord,Show,Read)
|
||||||
|
|
||||||
type PartiallyComposedItem = (Item, ItemStructuralFunction, LinkTest)
|
type PartiallyComposedItem = (Item, ItemStructuralFunction, LinkTest)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
module Dodge.Data.Item.Combine where
|
module Dodge.Data.Item.Combine where
|
||||||
|
|
||||||
|
import Dodge.Data.Item.BulletMod
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.TH
|
import Data.Aeson.TH
|
||||||
@@ -15,7 +16,7 @@ import Dodge.Data.Item.Use.Consumption
|
|||||||
|
|
||||||
data ItemType = ItemType
|
data ItemType = ItemType
|
||||||
{ _iyBase :: ItemBaseType
|
{ _iyBase :: ItemBaseType
|
||||||
, _iyModules :: M.Map ModuleSlot ItemModuleType
|
-- , _iyModules :: M.Map ModuleSlot ItemModuleType
|
||||||
}
|
}
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
@@ -91,7 +92,7 @@ data ItemBaseType
|
|||||||
| ATTACH {_ibtAttach :: AttachType}
|
| ATTACH {_ibtAttach :: AttachType}
|
||||||
| AMMOMAG {_ibtAmmoMag :: AmmoMagType}
|
| AMMOMAG {_ibtAmmoMag :: AmmoMagType}
|
||||||
| TARGETING {_ibtTargeting :: TargetingType}
|
| TARGETING {_ibtTargeting :: TargetingType}
|
||||||
| HOMING {_ibtHoming :: BulletTrajectoryType}
|
| BULLETMOD {_ibtBulletMod :: BulletMod}
|
||||||
deriving (Eq, Ord, Show, Read)
|
deriving (Eq, Ord, Show, Read)
|
||||||
|
|
||||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
@@ -101,6 +102,7 @@ data AttachType
|
|||||||
| BULLETSYNTHESIZER
|
| BULLETSYNTHESIZER
|
||||||
| REMOTESCREEN
|
| REMOTESCREEN
|
||||||
| HOMINGMODULE
|
| HOMINGMODULE
|
||||||
|
| AUGMENTEDHUD
|
||||||
-- | FLETCHINGMODULE
|
-- | FLETCHINGMODULE
|
||||||
-- | BULPAYLOADATTACH
|
-- | BULPAYLOADATTACH
|
||||||
-- | BULTRAJECTORYATTACH
|
-- | BULTRAJECTORYATTACH
|
||||||
@@ -204,20 +206,20 @@ data HeldItemType
|
|||||||
| KEYCARD Int
|
| KEYCARD Int
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
data ItemModuleType
|
--data ItemModuleType
|
||||||
= EMPTYMODULE
|
-- = EMPTYMODULE
|
||||||
| MAGNETMAG
|
-- | MAGNETMAG
|
||||||
| BULPAY BulletSpawn
|
-- | BULPAY BulletPayload
|
||||||
| BULBODY BulletEffect
|
-- | BULBODY BulletEffect
|
||||||
| BULTRAJ {_imtBulletTrajectoryType :: BulletTrajectoryType}
|
-- | BULTRAJ {_imtBulletTrajectoryType :: BulletTrajectoryType}
|
||||||
| TARGET {_imtTargetType :: TargetingType}
|
-- | TARGET {_imtTargetType :: TargetingType}
|
||||||
| INCENDLAS
|
-- | INCENDLAS
|
||||||
| SPLITLAS
|
-- | SPLITLAS
|
||||||
| STATICLAS
|
-- | STATICLAS
|
||||||
-- | WEPTELE
|
---- | WEPTELE
|
||||||
| LAUNCHHOME
|
-- | LAUNCHHOME
|
||||||
| ATTACHTORCH
|
-- | ATTACHTORCH
|
||||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
data Detector
|
data Detector
|
||||||
= ITEMDETECTOR
|
= ITEMDETECTOR
|
||||||
@@ -242,7 +244,7 @@ data ModuleSlot
|
|||||||
makeLenses ''ItemType
|
makeLenses ''ItemType
|
||||||
makeLenses ''ItemBaseType
|
makeLenses ''ItemBaseType
|
||||||
makeLenses ''HeldItemType
|
makeLenses ''HeldItemType
|
||||||
makeLenses ''ItemModuleType
|
--makeLenses ''ItemModuleType
|
||||||
makeLenses ''AttachType
|
makeLenses ''AttachType
|
||||||
deriveJSON defaultOptions ''Stack
|
deriveJSON defaultOptions ''Stack
|
||||||
deriveJSON defaultOptions ''CraftType
|
deriveJSON defaultOptions ''CraftType
|
||||||
@@ -253,7 +255,7 @@ deriveJSON defaultOptions ''Detector
|
|||||||
deriveJSON defaultOptions ''EquipItemType
|
deriveJSON defaultOptions ''EquipItemType
|
||||||
deriveJSON defaultOptions ''LeftItemType
|
deriveJSON defaultOptions ''LeftItemType
|
||||||
deriveJSON defaultOptions ''HeldItemType
|
deriveJSON defaultOptions ''HeldItemType
|
||||||
deriveJSON defaultOptions ''ItemModuleType
|
--deriveJSON defaultOptions ''ItemModuleType
|
||||||
deriveJSON defaultOptions ''ModuleSlot
|
deriveJSON defaultOptions ''ModuleSlot
|
||||||
deriveJSON defaultOptions ''ItemBaseType
|
deriveJSON defaultOptions ''ItemBaseType
|
||||||
deriveJSON defaultOptions ''ItemType
|
deriveJSON defaultOptions ''ItemType
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ module Dodge.Data.Item.Use (
|
|||||||
module Dodge.Data.Hammer,
|
module Dodge.Data.Hammer,
|
||||||
module Dodge.Data.Item.Targeting,
|
module Dodge.Data.Item.Targeting,
|
||||||
module Dodge.Data.GenFloat,
|
module Dodge.Data.GenFloat,
|
||||||
module Dodge.Data.Item.Scope
|
module Dodge.Data.Item.Scope,
|
||||||
|
module Dodge.Data.Item.BulletMod
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Data.Item.BulletMod
|
||||||
import Dodge.Data.Item.Scope
|
import Dodge.Data.Item.Scope
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
@@ -78,8 +80,8 @@ data ItemUse
|
|||||||
, _tgID :: Maybe Int
|
, _tgID :: Maybe Int
|
||||||
, _tgActive :: Bool
|
, _tgActive :: Bool
|
||||||
}
|
}
|
||||||
| BulletTrajectoryUse
|
| BulletModUse
|
||||||
{ _btuBulletTrajectory :: BulletTrajectoryType
|
{ _buMod :: BulletMod
|
||||||
}
|
}
|
||||||
deriving (Eq, Show, Read) --Generic, Flat)
|
deriving (Eq, Show, Read) --Generic, Flat)
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ defaultItemDimension = ItemDimension
|
|||||||
defaultHeldItem :: Item
|
defaultHeldItem :: Item
|
||||||
defaultHeldItem = Item
|
defaultHeldItem = Item
|
||||||
{ _itCurseStatus = Uncursed
|
{ _itCurseStatus = Uncursed
|
||||||
, _itType = ItemType (HELD PISTOL) mempty
|
, _itType = ItemType (HELD PISTOL) -- mempty
|
||||||
, _itEffect = defaultItEffect
|
, _itEffect = defaultItEffect
|
||||||
, _itID = 0
|
, _itID = 0
|
||||||
, _itInvSize = 1
|
, _itInvSize = 1
|
||||||
@@ -50,7 +50,7 @@ defaultBulletWeapon =
|
|||||||
-- & itUse . heldMods .~ PistolMod
|
-- & itUse . heldMods .~ PistolMod
|
||||||
& itUse . heldAmmoTypes .~ singleAmmo BulletAmmo
|
& itUse . heldAmmoTypes .~ singleAmmo BulletAmmo
|
||||||
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
|
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
|
||||||
& itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
|
||||||
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet]
|
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet]
|
||||||
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
|
||||||
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
||||||
|
|||||||
+9
-11
@@ -3,9 +3,6 @@ module Dodge.HeldUse
|
|||||||
(heldEffect
|
(heldEffect
|
||||||
, mcUseHeld
|
, mcUseHeld
|
||||||
)
|
)
|
||||||
-- ( heldEffect
|
|
||||||
-- , mcUseHeld
|
|
||||||
-- )
|
|
||||||
where
|
where
|
||||||
|
|
||||||
import Dodge.Base.Coordinate
|
import Dodge.Base.Coordinate
|
||||||
@@ -45,13 +42,6 @@ import RandomHelp
|
|||||||
--import Sound.Data
|
--import Sound.Data
|
||||||
--import Data.Foldable
|
--import Data.Foldable
|
||||||
|
|
||||||
--heldEffect :: HeldMod -> LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
|
||||||
--heldEffect effecttype = case effecttype of
|
|
||||||
-- PistolMod -> bulGunEffect
|
|
||||||
---- FireRemoteShellMod -> undefined
|
|
||||||
-- ExplodeRemoteShellMod -> undefined
|
|
||||||
-- DoNothingMod -> const $ const id
|
|
||||||
|
|
||||||
heldEffect :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
heldEffect :: LabelDoubleTree ComposeLinkType Item -> Creature -> World -> World
|
||||||
heldEffect = hammerCheck $ useTimeCheck heldEffectMuzzles
|
heldEffect = hammerCheck $ useTimeCheck heldEffectMuzzles
|
||||||
|
|
||||||
@@ -280,14 +270,22 @@ getBulletType :: LabelDoubleTree ComposeLinkType Item
|
|||||||
-> Maybe Bullet
|
-> Maybe Bullet
|
||||||
getBulletType itmtree magtree mz cr w = magtree ^? ldtValue . itUse . amagParams . ampBullet
|
getBulletType itmtree magtree mz cr w = magtree ^? ldtValue . itUse . amagParams . ampBullet
|
||||||
<&> buTrajectory .~ btraj
|
<&> buTrajectory .~ btraj
|
||||||
|
<&> buPayload .~ bpayload
|
||||||
|
<&> buEffect .~ beffect
|
||||||
where
|
where
|
||||||
-- consider modifying other parameters here too
|
-- consider modifying other parameters here too
|
||||||
btraj = fromMaybe BasicBulletTrajectory $ do
|
btraj = fromMaybe BasicBulletTrajectory $ do
|
||||||
targetingtree <- lookup WeaponTargetingLink (itmtree ^. ldtRight) -- left or right for these
|
targetingtree <- lookup WeaponTargetingLink (itmtree ^. ldtRight) -- left or right for these
|
||||||
tp <- targetingtree ^? ldtValue . itUse . tgPos . _Just
|
tp <- targetingtree ^? ldtValue . itUse . tgPos . _Just
|
||||||
attree <- lookup AmmoTargetingLink (magtree ^. ldtLeft)
|
attree <- lookup AmmoTargetingLink (magtree ^. ldtLeft)
|
||||||
bt <- attree ^? ldtValue . itUse . btuBulletTrajectory
|
bt <- attree ^? ldtValue . itUse . buMod . bmTrajectory
|
||||||
return $ getBulletTrajectory mz (itmtree ^. ldtValue) bt tp cr w
|
return $ getBulletTrajectory mz (itmtree ^. ldtValue) bt tp cr w
|
||||||
|
bpayload = fromMaybe BulSpark $ do
|
||||||
|
attree <- lookup AmmoPayloadLink (magtree ^. ldtLeft)
|
||||||
|
attree ^? ldtValue . itUse . buMod . bmPayload
|
||||||
|
beffect = fromMaybe DestroyBullet $ do
|
||||||
|
attree <- lookup AmmoEffectLink (magtree ^. ldtLeft)
|
||||||
|
attree ^? ldtValue . itUse . buMod . bmEffect
|
||||||
|
|
||||||
getBulletTrajectory :: Muzzle -> Item
|
getBulletTrajectory :: Muzzle -> Item
|
||||||
-> BulletTrajectoryType -> Point2 -> Creature -> World -> BulletTrajectory
|
-> BulletTrajectoryType -> Point2 -> Creature -> World -> BulletTrajectory
|
||||||
|
|||||||
+2
-1
@@ -26,7 +26,7 @@ itemFromBase ibt = case ibt of
|
|||||||
ATTACH at -> itemFromAttachType at
|
ATTACH at -> itemFromAttachType at
|
||||||
AMMOMAG t -> itemFromAmmoMag t
|
AMMOMAG t -> itemFromAmmoMag t
|
||||||
TARGETING tt -> targetingScope tt
|
TARGETING tt -> targetingScope tt
|
||||||
HOMING btt -> bulletTargetingModule btt
|
BULLETMOD bm -> bulletModule bm
|
||||||
|
|
||||||
itemFromAmmoMag :: AmmoMagType -> Item
|
itemFromAmmoMag :: AmmoMagType -> Item
|
||||||
itemFromAmmoMag at = case at of
|
itemFromAmmoMag at = case at of
|
||||||
@@ -45,6 +45,7 @@ itemFromAttachType at = case at of
|
|||||||
REMOTESCREEN -> remoteScreen
|
REMOTESCREEN -> remoteScreen
|
||||||
-- ROCKETHOMER -> rocketHomer
|
-- ROCKETHOMER -> rocketHomer
|
||||||
HOMINGMODULE -> homingModule
|
HOMINGMODULE -> homingModule
|
||||||
|
AUGMENTEDHUD -> augmentedHUD
|
||||||
|
|
||||||
|
|
||||||
itemFromConsumableType :: ConsumableItemType -> Item
|
itemFromConsumableType :: ConsumableItemType -> Item
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ megaTinMag x = tinMag
|
|||||||
tinMag :: Item
|
tinMag :: Item
|
||||||
tinMag =
|
tinMag =
|
||||||
defaultHeldItem & itType . iyBase .~ AMMOMAG TINMAG
|
defaultHeldItem & itType . iyBase .~ AMMOMAG TINMAG
|
||||||
& itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
|
||||||
& itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
||||||
& itUse
|
& itUse
|
||||||
.~ AmmoMagUse
|
.~ AmmoMagUse
|
||||||
{ _amagParams = BulletParams defaultBullet
|
{ _amagParams = BulletParams defaultBullet
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
module Dodge.Item.Display (
|
module Dodge.Item.Display (
|
||||||
itemDisplay,
|
itemDisplay,
|
||||||
canAttachTargeting,
|
-- canAttachTargeting,
|
||||||
itemString,
|
itemString,
|
||||||
itemBaseName,
|
itemBaseName,
|
||||||
basicItemDisplay,
|
basicItemDisplay,
|
||||||
@@ -17,11 +17,11 @@ import Dodge.Module
|
|||||||
import LensHelp
|
import LensHelp
|
||||||
import Padding
|
import Padding
|
||||||
|
|
||||||
canAttachTargeting :: TargetingType -> Item -> Bool
|
--canAttachTargeting :: TargetingType -> Item -> Bool
|
||||||
canAttachTargeting TARGETLASER _ = True
|
--canAttachTargeting TARGETLASER _ = True
|
||||||
canAttachTargeting _ itm =
|
--canAttachTargeting _ itm =
|
||||||
isJust (itm ^? itType . iyModules . ix ModBulletTrajectory . imtBulletTrajectoryType)
|
-- isJust (itm ^? itType . iyModules . ix ModBulletTrajectory . imtBulletTrajectoryType)
|
||||||
|| Just LAUNCHHOME == (itm ^? itType . iyModules . ix ModLauncherHoming)
|
-- || Just LAUNCHHOME == (itm ^? itType . iyModules . ix ModLauncherHoming)
|
||||||
|
|
||||||
--targetingTypeString :: TargetType -> String
|
--targetingTypeString :: TargetType -> String
|
||||||
--targetingTypeString tt = case tt of
|
--targetingTypeString tt = case tt of
|
||||||
@@ -54,7 +54,7 @@ basicItemDisplay itm =
|
|||||||
itemBaseName itm :
|
itemBaseName itm :
|
||||||
--catMaybes [maybeWarmupStatus itm, maybeRateStatus itm]
|
--catMaybes [maybeWarmupStatus itm, maybeRateStatus itm]
|
||||||
catMaybes [maybeWarmupStatus itm]
|
catMaybes [maybeWarmupStatus itm]
|
||||||
++ moduleStrings itm
|
-- ++ moduleStrings itm
|
||||||
++ repeat "*"
|
++ repeat "*"
|
||||||
|
|
||||||
itemString :: Item -> String
|
itemString :: Item -> String
|
||||||
@@ -72,7 +72,9 @@ itemBaseName itm = case _iyBase $ _itType itm of
|
|||||||
ATTACH ait -> showAttachItem ait itm
|
ATTACH ait -> showAttachItem ait itm
|
||||||
AMMOMAG ait -> show ait
|
AMMOMAG ait -> show ait
|
||||||
TARGETING tt -> show tt
|
TARGETING tt -> show tt
|
||||||
HOMING btt -> show btt
|
BULLETMOD (BulletModTrajectory btt) -> show btt
|
||||||
|
BULLETMOD (BulletModPayload btt) -> show btt
|
||||||
|
BULLETMOD (BulletModEffect btt) -> show btt
|
||||||
|
|
||||||
showAttachItem :: AttachType -> Item -> String
|
showAttachItem :: AttachType -> Item -> String
|
||||||
showAttachItem t itm = case t of
|
showAttachItem t itm = case t of
|
||||||
@@ -81,6 +83,7 @@ showAttachItem t itm = case t of
|
|||||||
BULLETSYNTHESIZER -> "BSYNTH"
|
BULLETSYNTHESIZER -> "BSYNTH"
|
||||||
REMOTESCREEN -> "REMOTE SCREEN " ++ show (itm ^? itUse . atLinkedProjectile . _Just)
|
REMOTESCREEN -> "REMOTE SCREEN " ++ show (itm ^? itUse . atLinkedProjectile . _Just)
|
||||||
HOMINGMODULE -> "HOMING MOD"
|
HOMINGMODULE -> "HOMING MOD"
|
||||||
|
AUGMENTEDHUD -> "AUGMENTED HUD"
|
||||||
|
|
||||||
showEquipItem :: EquipItemType -> String
|
showEquipItem :: EquipItemType -> String
|
||||||
showEquipItem eit = case eit of
|
showEquipItem eit = case eit of
|
||||||
@@ -124,7 +127,7 @@ itemNumberDisplay cr itm = case iu of
|
|||||||
ScopeUse {} -> []
|
ScopeUse {} -> []
|
||||||
TargetingUse {_tgPos = mp} -> [maybe "" shortShow mp]
|
TargetingUse {_tgPos = mp} -> [maybe "" shortShow mp]
|
||||||
-- this could be cleaner here...
|
-- this could be cleaner here...
|
||||||
BulletTrajectoryUse {} -> mempty
|
BulletModUse {} -> mempty
|
||||||
where
|
where
|
||||||
iu = itm ^?! itUse
|
iu = itm ^?! itUse
|
||||||
|
|
||||||
|
|||||||
+10
-6
@@ -5,6 +5,8 @@ module Dodge.Item.Draw (
|
|||||||
heldItemOffset,
|
heldItemOffset,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Data.ComposedItem
|
||||||
|
import Dodge.Data.DoubleTree
|
||||||
import Geometry.Data
|
import Geometry.Data
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
@@ -14,15 +16,17 @@ import Dodge.Item.Draw.SPic
|
|||||||
import Dodge.Item.HeldOffset
|
import Dodge.Item.HeldOffset
|
||||||
import ShapePicture
|
import ShapePicture
|
||||||
|
|
||||||
itemEquipPict :: Creature -> Item -> SPic
|
itemEquipPict :: Creature -> LabelDoubleTree ComposeLinkType PartiallyComposedItem -> SPic
|
||||||
itemEquipPict cr it = case it ^. itUse of
|
itemEquipPict cr itmtree = case itm ^. itUse of
|
||||||
HeldUse{} | it ^? itLocation . ilIsRoot == Just True
|
HeldUse{} | itm ^? itLocation . ilIsRoot == Just True
|
||||||
-> overPosSP (heldItemOffset it cr) (itemSPic it)
|
-> overPosSP (heldItemOffset itm cr) (itemSPic itmtree)
|
||||||
ituse -> fromMaybe mempty $ do
|
ituse -> fromMaybe mempty $ do
|
||||||
attachpos <- ituse ^? equipEffect . eeAttachPos
|
attachpos <- ituse ^? equipEffect . eeAttachPos
|
||||||
i <- it ^? itLocation . ilInvID
|
i <- itm ^? itLocation . ilInvID
|
||||||
epos <- cr ^? crInvEquipped . ix i
|
epos <- cr ^? crInvEquipped . ix i
|
||||||
return $ equipPosition epos cr attachpos (itemSPic it)
|
return $ equipPosition epos cr attachpos (itemSPic itmtree)
|
||||||
|
where
|
||||||
|
itm = itmtree ^. ldtValue . _1
|
||||||
|
|
||||||
equipPosition :: EquipPosition -> Creature -> Point3 -> SPic -> SPic
|
equipPosition :: EquipPosition -> Creature -> Point3 -> SPic -> SPic
|
||||||
equipPosition epos cr p sh = case epos of
|
equipPosition epos cr p sh = case epos of
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ module Dodge.Item.Draw.SPic (
|
|||||||
itemSPic,
|
itemSPic,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.Data.ComposedItem
|
||||||
|
import Dodge.Data.DoubleTree
|
||||||
import Color
|
import Color
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
--import Data.Maybe
|
--import Data.Maybe
|
||||||
@@ -24,9 +26,10 @@ import ShapePicture
|
|||||||
-- hit <- itm ^? itType . iyBase . ibtHeld
|
-- hit <- itm ^? itType . iyBase . ibtHeld
|
||||||
-- return mempty
|
-- return mempty
|
||||||
|
|
||||||
itemSPic :: Item -> SPic
|
itemSPic :: LabelDoubleTree ComposeLinkType PartiallyComposedItem -> SPic
|
||||||
itemSPic it =
|
itemSPic itmtree =
|
||||||
M.foldMapWithKey (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
|
--M.foldMapWithKey (modulesSPic it) (_iyModules $ _itType it) <> case it ^. itType . iyBase of
|
||||||
|
case it ^. itType . iyBase of
|
||||||
CRAFT _ -> defSPic
|
CRAFT _ -> defSPic
|
||||||
HELD ht -> heldItemSPic ht it
|
HELD ht -> heldItemSPic ht it
|
||||||
LEFT lt -> leftItemSPic lt it
|
LEFT lt -> leftItemSPic lt it
|
||||||
@@ -35,7 +38,9 @@ itemSPic it =
|
|||||||
ATTACH {} -> defSPic
|
ATTACH {} -> defSPic
|
||||||
AMMOMAG {} -> defSPic
|
AMMOMAG {} -> defSPic
|
||||||
TARGETING {} -> defSPic
|
TARGETING {} -> defSPic
|
||||||
HOMING {} -> defSPic
|
BULLETMOD {} -> defSPic
|
||||||
|
where
|
||||||
|
it = itmtree ^. ldtValue . _1
|
||||||
|
|
||||||
equipItemSPic :: EquipItemType -> Item -> SPic
|
equipItemSPic :: EquipItemType -> Item -> SPic
|
||||||
equipItemSPic et _ = case et of
|
equipItemSPic et _ = case et of
|
||||||
@@ -216,10 +221,10 @@ torchShape =
|
|||||||
bot = upperPrismPolySE 0.5 $ rectXH 9 2
|
bot = upperPrismPolySE 0.5 $ rectXH 9 2
|
||||||
back = upperPrismPolySE 3 $ rectXH 1 2
|
back = upperPrismPolySE 3 $ rectXH 1 2
|
||||||
|
|
||||||
modulesSPic :: Item -> ModuleSlot -> 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
|
||||||
|
|
||||||
baseStickShapeX :: Item -> Int -> Shape
|
baseStickShapeX :: Item -> Int -> Shape
|
||||||
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldAim . aimMuzzles)
|
baseStickShapeX it _ = foldMap f (it ^?! itUse . heldAim . aimMuzzles)
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
module Dodge.Item.Family where
|
|
||||||
|
|
||||||
data ItemFamily = HeldFamily
|
|
||||||
| CraftingFamily
|
|
||||||
| EquipmentFamily
|
|
||||||
| LeftClickFamily
|
|
||||||
| ConsumableFamily
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
module Dodge.Item.Grammar (
|
module Dodge.Item.Grammar (
|
||||||
|
invLDT,
|
||||||
invTrees,
|
invTrees,
|
||||||
invIndentIM,
|
invIndentIM,
|
||||||
invAdj,
|
invAdj,
|
||||||
@@ -38,12 +39,14 @@ basePartiallyComposedItem itm = case itm ^. itType . iyBase of
|
|||||||
[(WeaponTargetingSF,WeaponTargetingLink), (WeaponScopeSF,WeaponScopeLink)]
|
[(WeaponTargetingSF,WeaponTargetingLink), (WeaponScopeSF,WeaponScopeLink)]
|
||||||
)
|
)
|
||||||
AMMOMAG _ -> ammoComposedItem itm
|
AMMOMAG _ -> ammoComposedItem itm
|
||||||
TARGETING {} -> (itm,WeaponTargetingSF, LinkTest (const Nothing) (const Nothing))
|
TARGETING {} -> (itm,WeaponTargetingSF, useBreakListsLinkTest [(AugmentedHUDSF,AugmentedHUDLink)] [])
|
||||||
ATTACH ZOOMSCOPE -> (itm,WeaponScopeSF, LinkTest (const Nothing) (const Nothing))
|
ATTACH ZOOMSCOPE -> (itm,WeaponScopeSF, LinkTest (const Nothing) (const Nothing))
|
||||||
ATTACH HOMINGMODULE -> (itm,AmmoTargetingSF ProjectileAmmo, LinkTest (const Nothing) (const Nothing))
|
ATTACH HOMINGMODULE -> (itm,AmmoTargetingSF ProjectileAmmo, LinkTest (const Nothing) (const Nothing))
|
||||||
HOMING {}
|
ATTACH AUGMENTEDHUD -> nolinks AugmentedHUDSF
|
||||||
-> (itm,AmmoTargetingSF BulletAmmo, LinkTest (const Nothing) (const Nothing))
|
BULLETMOD BulletModTrajectory {} -> nolinks $ AmmoTargetingSF BulletAmmo
|
||||||
ATTACH REMOTESCREEN -> (itm,RemoteScreenSF, LinkTest (const Nothing) (const Nothing))
|
BULLETMOD BulletModPayload {} -> nolinks $ AmmoPayloadSF BulletAmmo
|
||||||
|
BULLETMOD BulletModEffect {} -> nolinks $ AmmoEffectSF BulletAmmo
|
||||||
|
ATTACH REMOTESCREEN -> nolinks RemoteScreenSF
|
||||||
ATTACH BULLETSYNTHESIZER -> (itm,AmmoModifierSF BulletAmmo, LinkTest (const Nothing) (const Nothing))
|
ATTACH BULLETSYNTHESIZER -> (itm,AmmoModifierSF BulletAmmo, LinkTest (const Nothing) (const Nothing))
|
||||||
LEFT {} -> isolate
|
LEFT {} -> isolate
|
||||||
EQUIP {} -> isolate
|
EQUIP {} -> isolate
|
||||||
@@ -51,6 +54,7 @@ basePartiallyComposedItem itm = case itm ^. itType . iyBase of
|
|||||||
CRAFT {} -> isolate
|
CRAFT {} -> isolate
|
||||||
-- _ ->
|
-- _ ->
|
||||||
where
|
where
|
||||||
|
nolinks x = (itm,x, LinkTest (const Nothing) (const Nothing))
|
||||||
isolate = (itm,UncomposableIsolateSF, LinkTest (const Nothing) (const Nothing))
|
isolate = (itm,UncomposableIsolateSF, LinkTest (const Nothing) (const Nothing))
|
||||||
|
|
||||||
ammoComposedItem :: Item -> PartiallyComposedItem
|
ammoComposedItem :: Item -> PartiallyComposedItem
|
||||||
@@ -61,6 +65,8 @@ ammoComposedItem itm = fromMaybe (error "in ammoComposedItem, wrong item") $ do
|
|||||||
, useBreakListsLinkTest
|
, useBreakListsLinkTest
|
||||||
[(AmmoModifierSF atype, AmmoModLink)
|
[(AmmoModifierSF atype, AmmoModLink)
|
||||||
,(AmmoTargetingSF atype, AmmoTargetingLink)
|
,(AmmoTargetingSF atype, AmmoTargetingLink)
|
||||||
|
,(AmmoPayloadSF atype, AmmoPayloadLink)
|
||||||
|
,(AmmoEffectSF atype, AmmoEffectLink)
|
||||||
,(RemoteScreenSF, RemoteScreenLink)
|
,(RemoteScreenSF, RemoteScreenLink)
|
||||||
]
|
]
|
||||||
[]
|
[]
|
||||||
@@ -150,6 +156,7 @@ invIndentIM :: IM.IntMap Item -> IM.IntMap (Item, Int, LabelDoubleTreeNodeType C
|
|||||||
invIndentIM = IM.fromAscList . zip [0 ..] . reverse . map (over _1 (^. _1))
|
invIndentIM = IM.fromAscList . zip [0 ..] . reverse . map (over _1 (^. _1))
|
||||||
. concatMap ldtToIndentList . invLDT
|
. concatMap ldtToIndentList . invLDT
|
||||||
|
|
||||||
|
-- returns an intmap with trees for all items, including non-roots
|
||||||
invTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ComposeLinkType Item)
|
invTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ComposeLinkType Item)
|
||||||
invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . invLDT
|
invTrees = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . invLDT
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ sparkGun =
|
|||||||
|
|
||||||
teslaGun :: Item
|
teslaGun :: Item
|
||||||
teslaGun =
|
teslaGun =
|
||||||
defaultBatteryGun
|
--defaultBatteryGun
|
||||||
|
defaultHeldItem
|
||||||
& itUse . heldParams .~ BeamShooterParams (Just (elecCrackleS,2))
|
& itUse . heldParams .~ BeamShooterParams (Just (elecCrackleS,2))
|
||||||
& itDimension . dimRad .~ 9
|
& itDimension . dimRad .~ 9
|
||||||
& itDimension . dimCenter .~ V3 4 0 0
|
& itDimension . dimCenter .~ V3 4 0 0
|
||||||
@@ -43,7 +44,7 @@ teslaGun =
|
|||||||
lasGun :: Item
|
lasGun :: Item
|
||||||
lasGun =
|
lasGun =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
& itType . iyModules .~ batteryModules
|
-- & itType . iyModules .~ batteryModules
|
||||||
-- & itUse . heldMods .~ PistolMod
|
-- & itUse . heldMods .~ PistolMod
|
||||||
& itUse . heldParams .~ BeamShooterParams (Just (tone440sawtoothquietS,2))
|
& itUse . heldParams .~ BeamShooterParams (Just (tone440sawtoothquietS,2))
|
||||||
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
|
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
|
||||||
@@ -119,17 +120,17 @@ tractorGunTweak =
|
|||||||
-- & itUse . heldAim . aimMuzzles
|
-- & itUse . heldAim . aimMuzzles
|
||||||
-- .~ [Muzzle (V2 30 y) 0 0 0 DefaultFlareType MuzzleLaser Nothing | y <- spreadFromCenter n 1]
|
-- .~ [Muzzle (V2 30 y) 0 0 0 DefaultFlareType MuzzleLaser Nothing | y <- spreadFromCenter n 1]
|
||||||
|
|
||||||
defaultBatteryGun :: Item
|
--defaultBatteryGun :: Item
|
||||||
defaultBatteryGun =
|
--defaultBatteryGun =
|
||||||
defaultHeldItem
|
-- defaultHeldItem
|
||||||
& itType . iyModules .~ batteryModules
|
-- & itType . iyModules .~ batteryModules
|
||||||
|
|
||||||
batteryModules :: M.Map ModuleSlot ItemModuleType
|
--batteryModules :: M.Map ModuleSlot ItemModuleType
|
||||||
batteryModules =
|
--batteryModules =
|
||||||
M.fromList
|
-- M.fromList
|
||||||
[ (ModBattery, EMPTYMODULE)
|
-- [ (ModBattery, EMPTYMODULE)
|
||||||
, (ModTeleport, EMPTYMODULE)
|
-- , (ModTeleport, EMPTYMODULE)
|
||||||
]
|
-- ]
|
||||||
|
|
||||||
--lasCircle :: Item
|
--lasCircle :: Item
|
||||||
--lasCircle =
|
--lasCircle =
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ rifle =
|
|||||||
& itUse . heldAim . aimRange .~ 1
|
& itUse . heldAim . aimRange .~ 1
|
||||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
|
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 25 0
|
||||||
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
|
||||||
|
|
||||||
--repeater :: Item
|
--repeater :: Item
|
||||||
--repeater =
|
--repeater =
|
||||||
@@ -71,7 +71,7 @@ autoRifle =
|
|||||||
& itType . iyBase .~ HELD AUTORIFLE
|
& itType . iyBase .~ HELD AUTORIFLE
|
||||||
& itUse . heldTriggerType .~ AutoTrigger
|
& itUse . heldTriggerType .~ AutoTrigger
|
||||||
-- & itUse . heldMods .~ AutoRifleMod
|
-- & itUse . heldMods .~ AutoRifleMod
|
||||||
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
||||||
|
|
||||||
-- & itUse . useDelay . rateMax .~ 6
|
-- & itUse . useDelay . rateMax .~ 6
|
||||||
burstRifle :: Item
|
burstRifle :: Item
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ launcher =
|
|||||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLauncher
|
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLauncher
|
||||||
& itUse . heldAmmoTypes .~ singleAmmo ProjectileAmmo
|
& itUse . heldAmmoTypes .~ singleAmmo ProjectileAmmo
|
||||||
& itType . iyBase .~ HELD LAUNCHER
|
& itType . iyBase .~ HELD LAUNCHER
|
||||||
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
|
||||||
& itUse . heldParams . muzVel .~ ConstFloat 0
|
& itUse . heldParams . muzVel .~ ConstFloat 0
|
||||||
& itUse . heldParams . rifling .~ ConstFloat 0
|
& itUse . heldParams . rifling .~ ConstFloat 0
|
||||||
& itUse . heldParams . recoil .~ 0
|
& itUse . heldParams . recoil .~ 0
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ autoPistol =
|
|||||||
& itUse . heldTriggerType .~ AutoTrigger
|
& itUse . heldTriggerType .~ AutoTrigger
|
||||||
& itUse . heldParams . bulGunSound ?~ (tap1S,0)
|
& itUse . heldParams . bulGunSound ?~ (tap1S,0)
|
||||||
& itType . iyBase .~ HELD AUTOPISTOL
|
& itType . iyBase .~ HELD AUTOPISTOL
|
||||||
& itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
-- & itType . iyModules . at ModAutoMag ?~ EMPTYMODULE
|
||||||
|
|
||||||
machinePistol :: Item
|
machinePistol :: Item
|
||||||
machinePistol =
|
machinePistol =
|
||||||
@@ -66,7 +66,7 @@ machinePistol =
|
|||||||
--rateMax .~ 2
|
--rateMax .~ 2
|
||||||
-- & itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
|
-- & itUse . heldMods .~ PistolMod -- (ammoCheckI : machinePistolAfterHamMods)
|
||||||
& itType . iyBase .~ HELD MACHINEPISTOL
|
& itType . iyBase .~ HELD MACHINEPISTOL
|
||||||
& itType . iyModules . at ModAutoMag .~ Nothing
|
-- & itType . iyModules . at ModAutoMag .~ Nothing
|
||||||
& itUse . heldParams . recoil .~ 20
|
& itUse . heldParams . recoil .~ 20
|
||||||
|
|
||||||
smg :: Item
|
smg :: Item
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ forceFieldGun :: Item
|
|||||||
forceFieldGun =
|
forceFieldGun =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
-- & itUse . useTargeting ?~ TargetRBLine
|
-- & itUse . useTargeting ?~ TargetRBLine
|
||||||
& itType . iyModules . at ModTarget ?~ TARGET TargetRBLine
|
-- & itType . iyModules . at ModTarget ?~ TARGET TargetRBLine
|
||||||
& itParams .~ ParamMID Nothing
|
& itParams .~ ParamMID Nothing
|
||||||
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun
|
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun
|
||||||
& itUse . heldDelay .~ NoDelay
|
& itUse . heldDelay .~ NoDelay
|
||||||
|
|||||||
+17
-17
@@ -11,7 +11,7 @@ itemInfo :: Item -> String
|
|||||||
itemInfo itm =
|
itemInfo itm =
|
||||||
itmBaseInfo itm ++ " " ++ itmUsageInfo itm
|
itmBaseInfo itm ++ " " ++ itmUsageInfo itm
|
||||||
++ itmSpaceInfo itm
|
++ itmSpaceInfo itm
|
||||||
++ itmModuleInfo (itm ^. itType . iyModules)
|
-- ++ itmModuleInfo (itm ^. itType . iyModules)
|
||||||
|
|
||||||
itmSpaceInfo :: Item -> String
|
itmSpaceInfo :: Item -> String
|
||||||
itmSpaceInfo itm = case ceiling $ _itInvSize itm of
|
itmSpaceInfo itm = case ceiling $ _itInvSize itm of
|
||||||
@@ -232,22 +232,22 @@ equipSiteInfo es = case es of
|
|||||||
GoesOnWrist -> " on a wrist"
|
GoesOnWrist -> " on a wrist"
|
||||||
GoesOnLegs -> " on both legs"
|
GoesOnLegs -> " on both legs"
|
||||||
|
|
||||||
itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String
|
--itmModuleInfo :: M.Map ModuleSlot ItemModuleType -> String
|
||||||
itmModuleInfo m
|
--itmModuleInfo m
|
||||||
| m == mempty = ""
|
-- | m == mempty = ""
|
||||||
| otherwise = mms ++ ems
|
-- | otherwise = mms ++ ems
|
||||||
where
|
-- where
|
||||||
(mademods, emptymods) = M.partition (/= EMPTYMODULE) m
|
-- (mademods, emptymods) = M.partition (/= EMPTYMODULE) m
|
||||||
mms
|
-- mms
|
||||||
| mademods == mempty = ""
|
-- | mademods == mempty = ""
|
||||||
| otherwise =
|
-- | otherwise =
|
||||||
" Modifications have been made "
|
-- " Modifications have been made "
|
||||||
++ makeCommaList (map moduleInfo $ M.keys mademods)
|
-- ++ makeCommaList (map moduleInfo $ M.keys mademods)
|
||||||
ems
|
-- ems
|
||||||
| emptymods == mempty = ""
|
-- | emptymods == mempty = ""
|
||||||
| otherwise =
|
-- | otherwise =
|
||||||
" Modifications can be made "
|
-- " Modifications can be made "
|
||||||
++ makeCommaList (map moduleInfo $ M.keys emptymods)
|
-- ++ makeCommaList (map moduleInfo $ M.keys emptymods)
|
||||||
|
|
||||||
makeCommaList :: [String] -> String
|
makeCommaList :: [String] -> String
|
||||||
makeCommaList [] = ""
|
makeCommaList [] = ""
|
||||||
|
|||||||
@@ -14,4 +14,4 @@ itemInvColor itm = case itm ^. itType . iyBase of
|
|||||||
ATTACH {} -> orange
|
ATTACH {} -> orange
|
||||||
TARGETING {} -> chartreuse
|
TARGETING {} -> chartreuse
|
||||||
AMMOMAG {} -> greyN 0.8
|
AMMOMAG {} -> greyN 0.8
|
||||||
HOMING {} -> rose
|
BULLETMOD {} -> rose
|
||||||
|
|||||||
+18
-4
@@ -5,6 +5,9 @@ module Dodge.Item.Scope (
|
|||||||
homingModule,
|
homingModule,
|
||||||
fletchingModule,
|
fletchingModule,
|
||||||
bulletTargetingModule,
|
bulletTargetingModule,
|
||||||
|
augmentedHUD,
|
||||||
|
bulletModule,
|
||||||
|
bulletPayloadModule,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -33,11 +36,22 @@ homingModule =
|
|||||||
fletchingModule :: Item
|
fletchingModule :: Item
|
||||||
fletchingModule = bulletTargetingModule FlechetteTrajectoryType
|
fletchingModule = bulletTargetingModule FlechetteTrajectoryType
|
||||||
|
|
||||||
bulletTargetingModule :: BulletTrajectoryType -> Item
|
bulletModule :: BulletMod -> Item
|
||||||
bulletTargetingModule btt =
|
bulletModule bm =
|
||||||
defaultHeldItem
|
defaultHeldItem
|
||||||
& itType . iyBase .~ HOMING btt
|
& itType . iyBase .~ BULLETMOD bm
|
||||||
& itUse .~ BulletTrajectoryUse btt
|
& itUse .~ BulletModUse bm
|
||||||
|
|
||||||
|
bulletTargetingModule :: BulletTrajectoryType -> Item
|
||||||
|
bulletTargetingModule = bulletModule . BulletModTrajectory
|
||||||
|
|
||||||
|
bulletPayloadModule :: BulletPayload -> Item
|
||||||
|
bulletPayloadModule = bulletModule . BulletModPayload
|
||||||
|
|
||||||
|
augmentedHUD :: Item
|
||||||
|
augmentedHUD = defaultHeldItem
|
||||||
|
& itType . iyBase .~ ATTACH AUGMENTEDHUD
|
||||||
|
& itUse .~ AttachUse Nothing
|
||||||
|
|
||||||
remoteScreen :: Item
|
remoteScreen :: Item
|
||||||
remoteScreen =
|
remoteScreen =
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import Dodge.Data.Item
|
|||||||
import Dodge.Module
|
import Dodge.Module
|
||||||
|
|
||||||
itSlotsTaken :: Item -> Int
|
itSlotsTaken :: Item -> Int
|
||||||
itSlotsTaken it = moduleSizes it + ceiling (_itInvSize it)
|
itSlotsTaken it = ceiling (_itInvSize it)
|
||||||
|
--itSlotsTaken it = moduleSizes it + ceiling (_itInvSize it)
|
||||||
|
|
||||||
--itSlotsTaken :: Item -> Int
|
--itSlotsTaken :: Item -> Int
|
||||||
--itSlotsTaken it = case it ^? itUse . useAmount of
|
--itSlotsTaken it = case it ^? itUse . useAmount of
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ defaultBullet =
|
|||||||
Bullet
|
Bullet
|
||||||
{ _buDelayFraction = 1
|
{ _buDelayFraction = 1
|
||||||
, _buEffect = DestroyBullet
|
, _buEffect = DestroyBullet
|
||||||
, _buSpawn = BulSpark
|
, _buPayload = BulSpark
|
||||||
, _buTrajectory = BasicBulletTrajectory
|
, _buTrajectory = BasicBulletTrajectory
|
||||||
, _buVel = V2 50 0
|
, _buVel = V2 50 0
|
||||||
, _buDrag = 1
|
, _buDrag = 1
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
module Dodge.Machine.Draw where
|
module Dodge.Machine.Draw
|
||||||
|
( drawMachine
|
||||||
|
) where
|
||||||
|
|
||||||
|
import Dodge.Data.ComposedItem
|
||||||
|
import Dodge.DoubleTree
|
||||||
import Dodge.Data.Machine
|
import Dodge.Data.Machine
|
||||||
import Dodge.Item.Draw.SPic
|
import Dodge.Item.Draw.SPic
|
||||||
import Dodge.Item.HeldOffset
|
import Dodge.Item.HeldOffset
|
||||||
@@ -56,9 +60,10 @@ drawBaseMachine h mc =
|
|||||||
$ _mcWidth mc
|
$ _mcWidth mc
|
||||||
|
|
||||||
drawTurret :: Turret -> Machine -> SPic
|
drawTurret :: Turret -> Machine -> SPic
|
||||||
drawTurret tu mc = overPosSP (turretItemOffset it tu mc) (itemSPic it)
|
drawTurret tu mc = overPosSP (turretItemOffset itm tu mc) (itemSPic ittree)
|
||||||
where
|
where
|
||||||
it = _tuWeapon tu
|
itm = _tuWeapon tu
|
||||||
|
ittree = singleLDT (itm,UncomposableIsolateSF,LinkTest (const Nothing) (const Nothing))
|
||||||
|
|
||||||
sensorSPic :: (PaletteColor, DecorationShape) -> Machine -> SPic
|
sensorSPic :: (PaletteColor, DecorationShape) -> Machine -> SPic
|
||||||
sensorSPic (pc, ds) mc =
|
sensorSPic (pc, ds) mc =
|
||||||
|
|||||||
+31
-31
@@ -1,43 +1,43 @@
|
|||||||
module Dodge.Module (
|
module Dodge.Module (
|
||||||
moduleSizes,
|
-- moduleSizes,
|
||||||
moduleStrings,
|
-- moduleStrings,
|
||||||
moduleName,
|
-- moduleName,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
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
|
import Dodge.Module.Info
|
||||||
|
|
||||||
moduleSizes :: Item -> Int
|
--moduleSizes :: Item -> Int
|
||||||
moduleSizes = sum . fmap moduleSize . _iyModules . _itType
|
--moduleSizes = sum . fmap moduleSize . _iyModules . _itType
|
||||||
|
--
|
||||||
|
--moduleSize :: ItemModuleType -> Int
|
||||||
|
--moduleSize imt = case imt of
|
||||||
|
-- EMPTYMODULE -> 0
|
||||||
|
-- _ -> 1
|
||||||
|
|
||||||
moduleSize :: ItemModuleType -> Int
|
--moduleStrings :: Item -> [String]
|
||||||
moduleSize imt = case imt of
|
--moduleStrings = M.elems . M.mapMaybe moduleName . _iyModules . _itType
|
||||||
EMPTYMODULE -> 0
|
|
||||||
_ -> 1
|
|
||||||
|
|
||||||
moduleStrings :: Item -> [String]
|
--moduleName :: ItemModuleType -> Maybe String
|
||||||
moduleStrings = M.elems . M.mapMaybe moduleName . _iyModules . _itType
|
--moduleName imt = case imt of
|
||||||
|
-- EMPTYMODULE -> Nothing
|
||||||
moduleName :: ItemModuleType -> Maybe String
|
---- BELTMAG -> Just "+BELT FEED"
|
||||||
moduleName imt = case imt of
|
-- MAGNETMAG -> Just "+MAGNET FEED"
|
||||||
EMPTYMODULE -> Nothing
|
-- BULPAY thepayload -> Just $ "+" ++ displayBulletPayload thepayload
|
||||||
-- BELTMAG -> Just "+BELT FEED"
|
-- BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
|
||||||
MAGNETMAG -> Just "+MAGNET FEED"
|
-- BULTRAJ thetraj -> Just $ "+" ++ displayBulletTraj thetraj
|
||||||
BULPAY thepayload -> Just $ "+" ++ displayBulletPayload thepayload
|
-- TARGET TargetRBCreature -> Just "+CREATURETARGETING"
|
||||||
BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
|
-- TARGET TARGETLASER -> Just "+LASERTARGETING"
|
||||||
BULTRAJ thetraj -> Just $ "+" ++ displayBulletTraj thetraj
|
-- TARGET TargetRBPress -> Just "+POSTIONALTARGETING"
|
||||||
TARGET TargetRBCreature -> Just "+CREATURETARGETING"
|
-- TARGET TargetCursor -> Just "+CURSORTARGETING"
|
||||||
TARGET TARGETLASER -> Just "+LASERTARGETING"
|
-- TARGET TargetRBLine -> Just "+LINETARGETING"
|
||||||
TARGET TargetRBPress -> Just "+POSTIONALTARGETING"
|
-- INCENDLAS -> Just "+INCENDIARY"
|
||||||
TARGET TargetCursor -> Just "+CURSORTARGETING"
|
-- SPLITLAS -> Just "+SPLIT"
|
||||||
TARGET TargetRBLine -> Just "+LINETARGETING"
|
-- STATICLAS -> Just "+STATIC"
|
||||||
INCENDLAS -> Just "+INCENDIARY"
|
---- WEPTELE -> Just "+DIRECTEDTELE"
|
||||||
SPLITLAS -> Just "+SPLIT"
|
-- LAUNCHHOME -> Just "+TARGET HOMING"
|
||||||
STATICLAS -> Just "+STATIC"
|
-- ATTACHTORCH -> Just "+TORCH"
|
||||||
-- WEPTELE -> Just "+DIRECTEDTELE"
|
|
||||||
LAUNCHHOME -> Just "+TARGET HOMING"
|
|
||||||
ATTACHTORCH -> Just "+TORCH"
|
|
||||||
|
|
||||||
|
|
||||||
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ displayBulletBody be = case be of
|
|||||||
BounceBullet -> "bouncing"
|
BounceBullet -> "bouncing"
|
||||||
PenetrateBullet -> "penetrating"
|
PenetrateBullet -> "penetrating"
|
||||||
|
|
||||||
displayBulletPayload :: BulletSpawn -> String
|
displayBulletPayload :: BulletPayload -> String
|
||||||
displayBulletPayload x = case x of
|
displayBulletPayload x = case x of
|
||||||
BulSpark -> ""
|
BulSpark -> ""
|
||||||
BulFrag -> "fragmentation"
|
BulFrag -> "fragmentation"
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ module Dodge.Render.ShapePicture (
|
|||||||
worldSPic,
|
worldSPic,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Dodge.DoubleTree
|
||||||
|
import Dodge.Data.ComposedItem
|
||||||
import NewInt
|
import NewInt
|
||||||
import Dodge.Render.List
|
import Dodge.Render.List
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
@@ -161,7 +163,8 @@ ppDraw c = uncurryV translate (_ppPos c) $ rotate (_ppRot c) (_ppPict c)
|
|||||||
floorItemSPic :: FloorItem -> SPic
|
floorItemSPic :: FloorItem -> SPic
|
||||||
floorItemSPic flit =
|
floorItemSPic flit =
|
||||||
uncurryV translateSPxy (_flItPos flit) $
|
uncurryV translateSPxy (_flItPos flit) $
|
||||||
rotateSP (_flItRot flit) (itemSPic (_flIt flit))
|
rotateSP (_flItRot flit)
|
||||||
|
(itemSPic $ singleLDT ((_flIt flit),UncomposableIsolateSF,LinkTest (const Nothing) (const Nothing)))
|
||||||
|
|
||||||
btSPic :: Button -> SPic
|
btSPic :: Button -> SPic
|
||||||
btSPic bt =
|
btSPic bt =
|
||||||
|
|||||||
Reference in New Issue
Block a user