Commit before partial cleanup, continue weapon effect refactor

This commit is contained in:
2024-09-21 16:04:23 +01:00
parent bb18831393
commit 9dff2fcd7a
37 changed files with 817 additions and 856 deletions
+1 -78
View File
@@ -1,78 +1 @@
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:(45,25)-(323,30): warning: [-Wincomplete-patterns] All good (617 modules, at 16:01:23)
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
FlameSpitterMod
FlameSpitterRepeatMod
|
45 | heldEffect effecttype = case effecttype of
| ^^^^^^^^^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:503:1-10: warning: [-Wmissing-signatures]
Top-level binding with no type signature:
walkNozzle :: Muzzle -> p1 -> p2 -> World -> World
|
503 | walkNozzle mz itm cr w = w
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:503:15-17: warning: [-Wunused-matches]
Defined but not used: itm
|
503 | walkNozzle mz itm cr w = w
| ^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:503:19-20: warning: [-Wunused-matches]
Defined but not used: cr
|
503 | walkNozzle mz itm cr w = w
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:507:6-15: warning: [-Wunused-local-binds]
Defined but not used: walkamount
|
507 | (walkamount, g) = randomR (- aspeed, aspeed) (_randGen w)
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:509:5-8: warning: [-Wunused-local-binds]
Defined but not used: maxa
|
509 | maxa = _nzMaxWalkAngle nz
| ^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:510:5-6: warning: [-Wunused-local-binds]
Defined but not used: wa
|
510 | wa = min maxa $ max (negate maxa) (_nzCurrentWalkAngle nz + walkamount)
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:552:1-17: warning: [-Wmissing-signatures]
Top-level binding with no type signature:
removeAmmoFromMag :: Int -> Maybe Int -> Creature -> World -> World
|
552 | removeAmmoFromMag x mid cr = fromMaybe id $ do
| ^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:565:5-7: warning: [-Wunused-local-binds]
Defined but not used: cid
|
565 | cid = _crID cr
| ^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:(608,13)-(830,9): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
FlameSpitterMod
FlameSpitterRepeatMod
|
608 | useMod hm = case hm of
| ^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:(936,14)-(952,85): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched: HeldOverNozzlesUseGasParams
|
936 | useHeld hu = case hu of
| ^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:1045:1-10: warning: [-Wmissing-signatures]
Top-level binding with no type signature:
doGenFloat :: RandomGen g => GenFloat -> g -> (Float, g)
|
1045 | doGenFloat (ConstFloat x) g = (x,g)
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:1106:21-22: warning: [-Wunused-matches]
Defined but not used: mz
|
1106 | shootTeslaArc it cr mz w =
| ^^
+76 -107
View File
@@ -56,54 +56,48 @@ digraph {
70 [shape=box 70 [shape=box
,label="HELD {_ibtHeld = AUTOAMR}"]; ,label="HELD {_ibtHeld = AUTOAMR}"];
72 [shape=box 72 [shape=box
,label="HELD {_ibtHeld = MACHINEGUN}"];
74 [shape=box
,label="HELD {_ibtHeld = LAUNCHER}"]; ,label="HELD {_ibtHeld = LAUNCHER}"];
77 [shape=box 75 [shape=box
,label="HELD {_ibtHeld = LAUNCHERX {_xNum = 2}}"]; ,label="HELD {_ibtHeld = LAUNCHERX {_xNum = 2}}"];
81 [shape=box 79 [shape=box
,label="HELD {_ibtHeld = FLAMESPITTER}"]; ,label="HELD {_ibtHeld = FLAMESPITTER}"];
85 [shape=box 83 [shape=box
,label="HELD {_ibtHeld = BLOWTORCH}"]; ,label="HELD {_ibtHeld = BLOWTORCH}"];
87 [shape=box 85 [shape=box
,label="HELD {_ibtHeld = FLAMETHROWER}"]; ,label="HELD {_ibtHeld = FLAMETHROWER}"];
89 [shape=box 87 [shape=box
,label="HELD {_ibtHeld = FLAMEWALL}"]; ,label="HELD {_ibtHeld = FLAMEWALL}"];
91 [shape=box 89 [shape=box
,label="HELD {_ibtHeld = FLAMETORRENT}"]; ,label="HELD {_ibtHeld = FLAMETORRENT}"];
93 [shape=box 91 [shape=box
,label="HELD {_ibtHeld = LASGUN}"]; ,label="HELD {_ibtHeld = LASGUN}"];
95 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
97 [shape=box 97 [shape=box
,label="HELD {_ibtHeld = DUALBEAM}"]; ,label="HELD {_ibtHeld = TESLAGUN}"];
99 [shape=box 99 [shape=box
,label="HELD {_ibtHeld = LASWIDE {_xNum = 2}}"]; ,label="LEFT {_ibtLeft = BLINKER}"];
101 [shape=box 102 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
103 [shape=box
,label="HELD {_ibtHeld = TESLAGUN}"];
105 [shape=box
,label="LEFT {_ibtLeft = BLINKER}"];
108 [shape=box
,label="LEFT {_ibtLeft = BLINKERUNSAFE}"]; ,label="LEFT {_ibtLeft = BLINKERUNSAFE}"];
110 [shape=box 104 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD}"]; ,label="EQUIP {_ibtEquip = MAGSHIELD}"];
113 [shape=box 107 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"]; ,label="EQUIP {_ibtEquip = POWERLEGS}"];
119 [shape=box 113 [shape=box
,label="HELD {_ibtHeld = FLATSHIELD}"]; ,label="HELD {_ibtHeld = FLATSHIELD}"];
129 [shape=box 123 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR ITEMDETECTOR}"]; ,label="EQUIP {_ibtEquip = AUTODETECTOR ITEMDETECTOR}"];
132 [shape=box 126 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR WALLDETECTOR}"]; ,label="EQUIP {_ibtEquip = AUTODETECTOR WALLDETECTOR}"];
134 [shape=box 128 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR CREATUREDETECTOR}"]; ,label="EQUIP {_ibtEquip = AUTODETECTOR CREATUREDETECTOR}"];
136 [shape=box 130 [shape=box
,label="HELD {_ibtHeld = TORCH}"]; ,label="HELD {_ibtHeld = TORCH}"];
137 [shape=box 131 [shape=box
,label="AMMOMAG {_ibtAmmoMag = BATTERY}"]; ,label="AMMOMAG {_ibtAmmoMag = BATTERY}"];
140 [shape=box 134 [shape=box
,label="EQUIP {_ibtEquip = HEADLAMP}"]; ,label="EQUIP {_ibtEquip = HEADLAMP}"];
148 [shape=box 140 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"]; ,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"];
} }
subgraph 2 { subgraph 2 {
@@ -134,43 +128,39 @@ digraph {
68 [shape=point]; 68 [shape=point];
69 [shape=point]; 69 [shape=point];
71 [shape=point]; 71 [shape=point];
73 [shape=point]; 74 [shape=point];
76 [shape=point]; 76 [shape=point];
78 [shape=point]; 78 [shape=point];
80 [shape=point]; 82 [shape=point];
84 [shape=point]; 84 [shape=point];
86 [shape=point]; 86 [shape=point];
88 [shape=point]; 88 [shape=point];
90 [shape=point]; 90 [shape=point];
92 [shape=point]; 94 [shape=point];
96 [shape=point]; 96 [shape=point];
98 [shape=point]; 98 [shape=point];
100 [shape=point]; 101 [shape=point];
102 [shape=point]; 103 [shape=point];
104 [shape=point]; 106 [shape=point];
107 [shape=point];
109 [shape=point]; 109 [shape=point];
110 [shape=point];
111 [shape=point];
112 [shape=point]; 112 [shape=point];
115 [shape=point]; 114 [shape=point];
116 [shape=point]; 116 [shape=point];
117 [shape=point]; 119 [shape=point];
118 [shape=point];
120 [shape=point];
122 [shape=point]; 122 [shape=point];
125 [shape=point]; 125 [shape=point];
128 [shape=point]; 127 [shape=point];
131 [shape=point]; 129 [shape=point];
133 [shape=point]; 133 [shape=point];
135 [shape=point]; 135 [shape=point];
137 [shape=point];
139 [shape=point]; 139 [shape=point];
141 [shape=point]; 141 [shape=point];
143 [shape=point]; 143 [shape=point];
145 [shape=point]; 145 [shape=point];
147 [shape=point]; 147 [shape=point];
149 [shape=point];
151 [shape=point];
153 [shape=point];
155 [shape=point];
} }
0 -> 1 [xlabel="",tailport=e]; 0 -> 1 [xlabel="",tailport=e];
2 -> 0 [xlabel=1 2 -> 0 [xlabel=1
@@ -198,7 +188,7 @@ digraph {
16 -> 27 [xlabel=1 16 -> 27 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
16 -> 139 [xlabel=1 16 -> 133 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
18 -> 19 [xlabel="",tailport=e]; 18 -> 19 [xlabel="",tailport=e];
@@ -222,13 +212,13 @@ digraph {
35 -> 56 [xlabel=1 35 -> 56 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
35 -> 147 [xlabel=1 35 -> 139 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
35 -> 151 [xlabel=1 35 -> 143 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
35 -> 153 [xlabel=1 35 -> 145 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
38 -> 39 [xlabel="",tailport=e]; 38 -> 39 [xlabel="",tailport=e];
@@ -253,7 +243,7 @@ digraph {
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
52 -> 53 [xlabel="",tailport=e]; 52 -> 53 [xlabel="",tailport=e];
53 -> 155 [xlabel=1 53 -> 147 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
54 -> 55 [xlabel="",tailport=e]; 54 -> 55 [xlabel="",tailport=e];
@@ -270,13 +260,13 @@ digraph {
57 -> 62 [xlabel=1 57 -> 62 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
57 -> 151 [xlabel=1 57 -> 143 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
58 -> 59 [xlabel="",tailport=e]; 58 -> 59 [xlabel="",tailport=e];
60 -> 61 [xlabel="",tailport=e]; 60 -> 61 [xlabel="",tailport=e];
62 -> 63 [xlabel="",tailport=e]; 62 -> 63 [xlabel="",tailport=e];
63 -> 153 [xlabel=1 63 -> 145 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
65 -> 66 [xlabel="",tailport=e]; 65 -> 66 [xlabel="",tailport=e];
@@ -286,94 +276,73 @@ digraph {
67 -> 69 [xlabel=1 67 -> 69 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
67 -> 71 [xlabel=1
,arrowhead=onone
,headport=w];
68 -> 67 [xlabel="",tailport=e]; 68 -> 67 [xlabel="",tailport=e];
69 -> 70 [xlabel="",tailport=e]; 69 -> 70 [xlabel="",tailport=e];
71 -> 72 [xlabel="",tailport=e]; 71 -> 72 [xlabel="",tailport=e];
73 -> 74 [xlabel="",tailport=e]; 72 -> 74 [xlabel=1
74 -> 76 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
76 -> 77 [xlabel="",tailport=e]; 74 -> 75 [xlabel="",tailport=e];
77 -> 78 [xlabel=1 75 -> 76 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
80 -> 81 [xlabel="",tailport=e]; 78 -> 79 [xlabel="",tailport=e];
81 -> 84 [xlabel=1 79 -> 82 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
81 -> 86 [xlabel=1 79 -> 84 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
82 -> 83 [xlabel="",tailport=e];
84 -> 85 [xlabel="",tailport=e]; 84 -> 85 [xlabel="",tailport=e];
85 -> 86 [xlabel=1
,arrowhead=onone
,headport=w];
85 -> 88 [xlabel=1
,arrowhead=onone
,headport=w];
86 -> 87 [xlabel="",tailport=e]; 86 -> 87 [xlabel="",tailport=e];
87 -> 88 [xlabel=1
,arrowhead=onone
,headport=w];
87 -> 90 [xlabel=1
,arrowhead=onone
,headport=w];
88 -> 89 [xlabel="",tailport=e]; 88 -> 89 [xlabel="",tailport=e];
90 -> 91 [xlabel="",tailport=e]; 90 -> 91 [xlabel="",tailport=e];
92 -> 93 [xlabel="",tailport=e]; 94 -> 95 [xlabel="",tailport=e];
93 -> 96 [xlabel=1 95 -> 96 [xlabel=1
,arrowhead=onone
,headport=w];
93 -> 96 [xlabel=1
,arrowhead=onone
,headport=w];
93 -> 98 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
96 -> 97 [xlabel="",tailport=e]; 96 -> 97 [xlabel="",tailport=e];
98 -> 99 [xlabel="",tailport=e]; 98 -> 99 [xlabel="",tailport=e];
99 -> 145 [xlabel=1 99 -> 101 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
100 -> 101 [xlabel="" 101 -> 102 [xlabel=""
,tailport=e]; ,tailport=e];
101 -> 102 [xlabel=1 103 -> 104 [xlabel=""
,arrowhead=onone
,headport=w];
102 -> 103 [xlabel=""
,tailport=e]; ,tailport=e];
104 -> 105 [xlabel="" 106 -> 107 [xlabel=""
,tailport=e];
105 -> 107 [xlabel=1
,arrowhead=onone
,headport=w];
107 -> 108 [xlabel=""
,tailport=e];
109 -> 110 [xlabel=""
,tailport=e]; ,tailport=e];
112 -> 113 [xlabel="" 112 -> 113 [xlabel=""
,tailport=e]; ,tailport=e];
118 -> 119 [xlabel="" 122 -> 123 [xlabel=""
,tailport=e]; ,tailport=e];
128 -> 129 [xlabel="" 125 -> 126 [xlabel=""
,tailport=e]; ,tailport=e];
131 -> 132 [xlabel="" 127 -> 128 [xlabel=""
,tailport=e]; ,tailport=e];
129 -> 130 [xlabel=""
,tailport=e];
130 -> 133 [xlabel=1
,arrowhead=onone
,headport=w];
131 -> 129 [xlabel=1
,arrowhead=onone
,headport=w];
131 -> 137 [xlabel=1
,arrowhead=onone
,headport=w];
133 -> 134 [xlabel="" 133 -> 134 [xlabel=""
,tailport=e]; ,tailport=e];
135 -> 136 [xlabel=""
,tailport=e];
136 -> 139 [xlabel=1
,arrowhead=onone
,headport=w];
137 -> 135 [xlabel=1
,arrowhead=onone
,headport=w];
137 -> 143 [xlabel=1
,arrowhead=onone
,headport=w];
139 -> 140 [xlabel="" 139 -> 140 [xlabel=""
,tailport=e]; ,tailport=e];
147 -> 148 [xlabel="" 140 -> 141 [xlabel=1
,tailport=e];
148 -> 149 [xlabel=1
,arrowhead=onone ,arrowhead=onone
,headport=w]; ,headport=w];
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -6
View File
@@ -76,7 +76,7 @@ itemCombinations =
++ [ po [HELD AMR, cr PIPE] sniperRifle ++ [ po [HELD AMR, cr PIPE] sniperRifle
, po [HELD RIFLE, cr PIPE] amr , po [HELD RIFLE, cr PIPE] amr
, po [HELD AMR, cr SPRING] autoAmr , po [HELD AMR, cr SPRING] autoAmr
, po [HELD AMR, cr MOTOR] machineGun -- , po [HELD AMR, cr MOTOR] machineGun
, p [p 2 $ cr TUBE, o $ cr HARDWARE] launcher , p [p 2 $ cr TUBE, o $ cr HARDWARE] launcher
, p [p 2 $ cr TUBE, o $ HELD LAUNCHER] (launcherX 2) , p [p 2 $ cr TUBE, o $ HELD LAUNCHER] (launcherX 2)
] ]
@@ -87,8 +87,8 @@ itemCombinations =
, po [HELD FLAMETHROWER, cr STEELDRUM] flameWall , po [HELD FLAMETHROWER, cr STEELDRUM] flameWall
, po [HELD FLAMETHROWER, cr PUMP] flameTorrent , po [HELD FLAMETHROWER, cr PUMP] flameTorrent
, p [o $ cr PRISM, o $ cr TRANSFORMER, o $ cr PIPE] lasGun , p [o $ cr PRISM, o $ cr TRANSFORMER, o $ cr PIPE] lasGun
, po [HELD LASGUN, HELD LASGUN, cr HARDWARE] dualBeam -- , po [HELD LASGUN, HELD LASGUN, cr HARDWARE] dualBeam
, po [HELD LASGUN, cr TRANSFORMER] (lasWide 2) -- , po [HELD LASGUN, cr TRANSFORMER] (lasWide 2)
-- , po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle -- , po [HELD LASGUN, HELD LASGUN, HELD LASGUN, cr HARDWARE] lasCircle
, p [o $ cr TRANSFORMER, p 2 $ cr CAN] sparkGun , p [o $ cr TRANSFORMER, p 2 $ cr CAN] sparkGun
, p [o (HELD SPARKGUN), p 2 $ cr PIPE] teslaGun , p [o (HELD SPARKGUN), p 2 $ cr PIPE] teslaGun
@@ -111,7 +111,7 @@ itemCombinations =
, po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (energyBallCraft IncBall) , po [cr LIGHTER, cr THERMOMETER, cr MICROCHIP] (energyBallCraft IncBall)
, po [cr TRANSFORMER, AMMOMAG BATTERY, cr MICROCHIP] (energyBallCraft TeslaBall) , po [cr TRANSFORMER, AMMOMAG BATTERY, cr MICROCHIP] (energyBallCraft TeslaBall)
] ]
++ map (\i -> po [HELD (LASWIDE i), cr TRANSFORMER] $ lasWide (i + 1)) [2 .. 9] -- ++ map (\i -> po [HELD (LASWIDE i), cr TRANSFORMER] $ lasWide (i + 1)) [2 .. 9]
++ map (\i -> po [cr PIPE, HELD (BANGSTICK i)] $ bangStick (i + 1)) [1 .. 8] ++ map (\i -> po [cr PIPE, HELD (BANGSTICK i)] $ bangStick (i + 1)) [1 .. 8]
++ 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]
@@ -194,7 +194,8 @@ moduleCombinations =
) )
, ,
( ModDualBeam ( ModDualBeam
, [dualBeam] ,[]
-- , [dualBeam]
, ,
[ amod [cr (ENERGYBALLCRAFT IncBall)] INCENDLAS [ amod [cr (ENERGYBALLCRAFT IncBall)] INCENDLAS
, amod [cr TRANSFORMER] SPLITLAS , amod [cr TRANSFORMER] SPLITLAS
@@ -260,7 +261,7 @@ bulletWeapons =
, burstRifle , burstRifle
, bangCone , bangCone
, blunderbuss , blunderbuss
, machineGun -- , machineGun
, elephantGun , elephantGun
, sniperRifle , sniperRifle
, amr , amr
+1 -1
View File
@@ -48,7 +48,7 @@ maxShowX bt = case bt of
HELD (MINIGUNX _) -> Just 3 HELD (MINIGUNX _) -> Just 3
HELD (GRAPECANNON _) -> Just 1 HELD (GRAPECANNON _) -> Just 1
HELD (LAUNCHERX _) -> Just 2 HELD (LAUNCHERX _) -> Just 2
HELD (LASWIDE _) -> Just 2 -- HELD (LASWIDE _) -> Just 2
-- LASGUNFOCUS _ -> Just 2 -- LASGUNFOCUS _ -> Just 2
_ -> Nothing _ -> Nothing
+7 -7
View File
@@ -204,7 +204,7 @@ inventoryX c = case c of
'J' -> 'J' ->
[ lasGun [ lasGun
, lasGun , lasGun
, dualBeam --, dualBeam
] <> makeTypeCraftNum 10 TRANSFORMER ] <> makeTypeCraftNum 10 TRANSFORMER
'K' -> 'K' ->
[ autoRifle [ autoRifle
@@ -268,17 +268,17 @@ testInventory =
stackedInventory :: [Item] stackedInventory :: [Item]
stackedInventory = stackedInventory =
[ burstRifle [ targetingScope TARGETLASER
, poisonSprayer , zoomScope
, chemFuelPouch , burstRifle
, megaTinMag , megaTinMag
, teslaGun , teslaGun
, lasGun
, tractorGun
, megaBattery , megaBattery
, bulletSynthesizer , bulletSynthesizer
, drumMag , drumMag
, launcher , launcher
, rocketRemoteScreen
, megaShellMag
, launcherX 3 , launcherX 3
, megaShellMag , megaShellMag
, megaShellMag , megaShellMag
@@ -301,7 +301,7 @@ stackedInventory =
, flatShield , flatShield
, spawnGun (lamp 5) , spawnGun (lamp 5)
, lasGun , lasGun
, lasWide 20 -- , lasWide 20
, poisonSprayer , poisonSprayer
, bulletBeltPack , bulletBeltPack
, bulletBeltBracer , bulletBeltBracer
+6
View File
@@ -62,9 +62,13 @@ stateUpdate f =
, updateInv -- upInv must be called before invSideEff 22.05.23 , updateInv -- upInv must be called before invSideEff 22.05.23
, invSideEff , invSideEff
, equipmentEffects , equipmentEffects
, heldItemEffects
, heldAimEffects , heldAimEffects
] ]
heldItemEffects :: Creature -> World -> World
heldItemEffects _ = id
heldAimEffects :: Creature -> World -> World heldAimEffects :: Creature -> World -> World
heldAimEffects cr = fromMaybe id $ do heldAimEffects cr = fromMaybe id $ do
guard (crIsAiming cr) guard (crIsAiming cr)
@@ -270,6 +274,8 @@ updateAutoRecharge it = case it ^? itUse . leftConsumption of
| l < m -> it & itUse . leftConsumption . arProgress -~ 1 | l < m -> it & itUse . leftConsumption . arProgress -~ 1
_ -> it _ -> it
--itemGetTargeting :: LabelDoubleTree ComposeLinkType Item
-- I feel like there should be a centralised function that supersumes this -- I feel like there should be a centralised function that supersumes this
-- i.e. a function that deals with all states that depend upon item positioning -- i.e. a function that deals with all states that depend upon item positioning
-- in the inventory -- in the inventory
+5
View File
@@ -13,13 +13,18 @@ import Dodge.Data.Item.Use.Consumption.Ammo
data ComposeLinkType data ComposeLinkType
= AmmoInLink Int AmmoType = AmmoInLink Int AmmoType
| AmmoModLink | AmmoModLink
| WeaponScopeLink
| WeaponTargetingLink
| RocketRemoteScreenLink
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
data ComposedItem = WeaponCI data ComposedItem = WeaponCI
| WeaponScopeCI | WeaponScopeCI
| WeaponTargetingCI
| AmmoModifierCI AmmoType | AmmoModifierCI AmmoType
| AmmoCI AmmoType | AmmoCI AmmoType
| UncomposableCI | UncomposableCI
| RocketRemoteScreenCI
deriving (Eq,Ord,Show,Read) deriving (Eq,Ord,Show,Read)
makeLenses ''ComposedItem makeLenses ''ComposedItem
+5 -3
View File
@@ -98,6 +98,8 @@ data AttachType
= SCROLLATTACH ScrollAttachType = SCROLLATTACH ScrollAttachType
| TARGETATTACH {_ibtAttachTarget :: TargetType} | TARGETATTACH {_ibtAttachTarget :: TargetType}
| BULLETSYNTHESIZER | BULLETSYNTHESIZER
| ROCKETHOMER
| ROCKETREMOTESCREEN
-- | BULPAYLOADATTACH -- | BULPAYLOADATTACH
-- | BULTRAJECTORYATTACH -- | BULTRAJECTORYATTACH
deriving (Eq, Ord, Show, Read) deriving (Eq, Ord, Show, Read)
@@ -178,7 +180,7 @@ data HeldItemType
| AMR | AMR
| AUTOAMR | AUTOAMR
| SNIPERRIFLE | SNIPERRIFLE
| MACHINEGUN -- | MACHINEGUN
| FLAMESPITTER | FLAMESPITTER
| FLAMETHROWER | FLAMETHROWER
| FLAMETORRENT | FLAMETORRENT
@@ -188,8 +190,8 @@ data HeldItemType
| TESLAGUN | TESLAGUN
| LASGUN | LASGUN
-- | LASCIRCLE -- | LASCIRCLE
| DUALBEAM -- | DUALBEAM
| LASWIDE {_xNum :: Int} -- | LASWIDE {_xNum :: Int}
| TRACTORGUN | TRACTORGUN
| LAUNCHER | LAUNCHER
| LAUNCHERX {_xNum :: Int} | LAUNCHERX {_xNum :: Int}
+11 -6
View File
@@ -16,17 +16,22 @@ data UseDelay -- should just be Delay
{ _rateMax :: Int { _rateMax :: Int
, _rateTime :: Int , _rateTime :: Int
} }
| VariableRate -- | VariableRate
{ _rateMax :: Int -- { _rateMax :: Int
, _rateTime :: Int -- , _rateTime :: Int
, _rateMaxMax :: Int -- , _rateMaxMax :: Int
, _rateMinMax :: Int -- , _rateMinMax :: Int
} -- }
| WarmUpNoDelay | WarmUpNoDelay
{ _warmTime :: Int { _warmTime :: Int
, _warmMax :: Int , _warmMax :: Int
, _warmSound :: SoundID , _warmSound :: SoundID
} }
-- | ChargingRate
-- { _chargeTime :: Int
-- , _chargeMax :: Int
-- , _chargeSound :: Maybe SoundID
-- }
deriving (Eq, Ord, Show, Read) --Generic, Flat) deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''UseDelay makeLenses ''UseDelay
+10 -10
View File
@@ -15,14 +15,14 @@ import Control.Lens
data Huse data Huse
= HeldDoNothing = HeldDoNothing
-- | HeldUseAmmoParams -- | HeldUseAmmoParams
| HeldOverNozzlesUseGasParams -- | HeldOverNozzlesUseGasParams
| HeldPJCreation -- | HeldPJCreation
| HeldPJCreationX Int -- | HeldPJCreationX Int
| HeldFireRemoteShell | HeldFireRemoteShell
| HeldExplodeRemoteShell Int Int | HeldExplodeRemoteShell Int Int
| HeldDetectorEffect Detector | HeldDetectorEffect Detector
-- | HeldTeslaArc -- | HeldTeslaArc
| HeldLaser -- | HeldLaser
| HeldCircleLaser | HeldCircleLaser
| HeldDualLaser | HeldDualLaser
| HeldTractor | HeldTractor
@@ -68,17 +68,17 @@ data Luse
data HeldMod data HeldMod
= PistolMod = PistolMod
-- | PoisonSprayerMod -- | PoisonSprayerMod
| FlameSpitterMod -- | FlameSpitterMod
| FlameSpitterRepeatMod -- | FlameSpitterRepeatMod
-- | FlameThrowerMod -- | FlameThrowerMod
-- | LauncherMod -- | LauncherMod
-- | TeslaMod -- | TeslaMod
-- | CircleLaserMod -- | CircleLaserMod
| LasWideMod Int -- | LasWideMod Int
| DualBeamMod -- | DualBeamMod
-- | LasMod -- | LasMod
-- | LauncherXMod Int -- | LauncherXMod Int
| ShatterMod -- | ShatterMod
-- | AmmoCheckMod -- | AmmoCheckMod
-- | AmmoUseCheckMod -- | AmmoUseCheckMod
-- | AmmoHammerTimeUseOneMod -- | AmmoHammerTimeUseOneMod
@@ -103,7 +103,7 @@ data HeldMod
| FireRemoteShellMod | FireRemoteShellMod
| ExplodeRemoteShellMod | ExplodeRemoteShellMod
| DoNothingMod | DoNothingMod
| ForceFieldMod -- | ForceFieldMod
| DetectorMod Detector | DetectorMod Detector
deriving (Eq, Ord, Show, Read) --Generic, Flat) deriving (Eq, Ord, Show, Read) --Generic, Flat)
+6
View File
@@ -39,6 +39,7 @@ data ItemUse
, _heldAmmoTypes :: IM.IntMap AmmoType , _heldAmmoTypes :: IM.IntMap AmmoType
, _heldParams :: HeldParams , _heldParams :: HeldParams
, _heldTriggerType :: TriggerType , _heldTriggerType :: TriggerType
, _heldUsageTime :: Int -- this is not yet implemented
-- , _useTargeting :: Maybe TargetType -- , _useTargeting :: Maybe TargetType
} }
| LeftUse | LeftUse
@@ -163,6 +164,9 @@ data MuzzleEffect
, _nzCurrentWalkAngle :: Float , _nzCurrentWalkAngle :: Float
, _nzWalkSpeed :: Float , _nzWalkSpeed :: Float
} }
| MuzzleShatter
| MuzzleForceField
| MuzzleDetector
deriving (Eq, Ord, Show, Read) --Generic, Flat) deriving (Eq, Ord, Show, Read) --Generic, Flat)
data Muzzle = Muzzle data Muzzle = Muzzle
@@ -172,6 +176,7 @@ data Muzzle = Muzzle
, _mzAmmoSlot :: Int , _mzAmmoSlot :: Int
, _mzFlareType :: FlareType , _mzFlareType :: FlareType
, _mzEffect :: MuzzleEffect , _mzEffect :: MuzzleEffect
, _mzChargeRequirement :: Maybe Int
-- , _mzRecoil :: Float -- , _mzRecoil :: Float
-- , _mzTorque :: Float -- , _mzTorque :: Float
-- , _mzSidePush :: Float -- , _mzSidePush :: Float
@@ -208,6 +213,7 @@ makeLenses ''HeldParams
makeLenses ''AttachParams makeLenses ''AttachParams
makeLenses ''ScrollAttachParams makeLenses ''ScrollAttachParams
makeLenses ''AmmoParams makeLenses ''AmmoParams
makeLenses ''MuzzleEffect
deriveJSON defaultOptions ''MuzzleEffect deriveJSON defaultOptions ''MuzzleEffect
deriveJSON defaultOptions ''FlareType deriveJSON defaultOptions ''FlareType
deriveJSON defaultOptions ''TriggerType deriveJSON defaultOptions ''TriggerType
+1 -1
View File
@@ -52,7 +52,7 @@ defaultBulletWeapon =
& 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 Nothing]
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE -- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE
-- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE -- & itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
+1
View File
@@ -47,4 +47,5 @@ defaultHeldUse =
, _weaponRepeat = [] , _weaponRepeat = []
} }
, _heldTriggerType = HammerTrigger , _heldTriggerType = HammerTrigger
, _heldUsageTime = 0
} }
+1
View File
@@ -25,6 +25,7 @@ defaultMuzzle = Muzzle
, _mzAmmoSlot = 0 , _mzAmmoSlot = 0
, _mzFlareType = DefaultFlareType , _mzFlareType = DefaultFlareType
, _mzEffect = MuzzleShootBullet , _mzEffect = MuzzleShootBullet
, _mzChargeRequirement = Nothing
} }
+97 -85
View File
@@ -86,27 +86,27 @@ heldEffect effecttype = case effecttype of
-- , withTempLight 1 100 (V3 0 0 1) -- , withTempLight 1 100 (V3 0 0 1)
-- , ammoCheckI -- , ammoCheckI
-- ] -- ]
LasWideMod n -> foldl' (&) (shootLaser . _ldtValue) -- LasWideMod n -> foldl' (&) (shootLaser . _ldtValue)
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, withItem $ \it -> -- , withItem $ \it ->
duplicateNumBarrels -- duplicateNumBarrels
-- ( min ---- ( min
-- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded) ---- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
(it ^?! itParams . lasCycle `div` lasWideRate) -- (it ^?! itParams . lasCycle `div` lasWideRate)
-- ) ---- )
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it)) -- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withSoundForI tone440sawtoothquietS 2 -- , withSoundForI tone440sawtoothquietS 2
, withItemUpdateFirst (increasecycleLasWide n) -- , withItemUpdateFirst (increasecycleLasWide n)
, ammoCheckI -- , ammoCheckI
] -- ]
DualBeamMod -> foldl' (&) (shootDualLaser . _ldtValue) -- DualBeamMod -> foldl' (&) (shootDualLaser . _ldtValue)
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2 -- , withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8 -- , withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
, withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, ammoCheckI -- , ammoCheckI
] -- ]
-- LasMod -> foldl' (&) (shootLaser . _ldtValue) -- LasMod -> foldl' (&) (shootLaser . _ldtValue)
-- [ useAmmoAmount 1 -- [ useAmmoAmount 1
-- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
@@ -122,13 +122,13 @@ heldEffect effecttype = case effecttype of
-- --, ammoCheckI -- --, ammoCheckI
-- , blCheck -- , blCheck
-- ] -- ]
ShatterMod -> foldl' (&) (shootShatter . _ldtValue) -- ShatterMod -> foldl' (&) (shootShatter . _ldtValue)
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, -- , withSoundStart tap3S -- , -- , withSoundStart tap3S
useTimeCheck -- useTimeCheck
, ammoCheckI -- , ammoCheckI
, blCheck -- , blCheck
] -- ]
-- BangCaneMod -> bulletGunEffect -- BangCaneMod -> bulletGunEffect
-- [ withFlare -- [ withFlare
-- , withSmoke 1 black 20 200 5 -- , withSmoke 1 black 20 200 5
@@ -319,16 +319,16 @@ heldEffect effecttype = case effecttype of
FireRemoteShellMod -> undefined FireRemoteShellMod -> undefined
ExplodeRemoteShellMod -> undefined ExplodeRemoteShellMod -> undefined
DoNothingMod -> const $ const id DoNothingMod -> const $ const id
ForceFieldMod -> undefined -- ForceFieldMod -> undefined
DetectorMod _ -> undefined DetectorMod _ -> undefined
where where
-- f = do -- f = do
-- nzpres <- state $ randomR (3, 4) -- nzpres <- state $ randomR (3, 4)
-- return $ sprayNozzles . ix 0 . nzPressure .~ nzpres -- return $ sprayNozzles . ix 0 . nzPressure .~ nzpres
increasecycleLasWide n it = case _heldHammer (_itUse it) of -- increasecycleLasWide n it = case _heldHammer (_itUse it) of
HammerUp -> it & itParams . lasCycle .~ 1 -- HammerUp -> it & itParams . lasCycle .~ 1
_ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1)) -- _ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1))
thegapDualBeam = _dbGap . _itParams -- thegapDualBeam = _dbGap . _itParams
--directedTelPos _ cr w = (p, a) --directedTelPos _ cr w = (p, a)
-- where -- where
-- p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just -- p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just
@@ -499,15 +499,24 @@ useLoadedAmmo itm cr (cme,w) (mz,x,mid) = (,) (cme & cmeSound .~ True) $
MuzzleTractor -> shootTractorBeam itm cr w MuzzleTractor -> shootTractorBeam itm cr w
MuzzleLauncher -> createProjectile' mid mz itm cr w MuzzleLauncher -> createProjectile' mid mz itm cr w
MuzzleNozzle {} -> useGasParams mid mz itm cr $ walkNozzle mz itm cr w MuzzleNozzle {} -> useGasParams mid mz itm cr $ walkNozzle mz itm cr w
MuzzleShatter -> shootShatter itm cr w
MuzzleForceField -> useForceFieldGun itm cr w
MuzzleDetector -> itemDetectorEffect itm cr w
walkNozzle mz itm cr w = w itemDetectorEffect :: Item -> Creature -> World -> World
& randGen .~ g itemDetectorEffect itm cr w = fromMaybe w $ do
where HELDDETECTOR dt <- itm ^? itType . iyBase . ibtHeld
nz = _mzEffect mz return $ detectorEffect dt itm cr w
(walkamount, g) = randomR (- aspeed, aspeed) (_randGen w)
aspeed = _nzWalkSpeed nz walkNozzle :: Muzzle -> Item -> Creature -> World -> World
maxa = _nzMaxWalkAngle nz walkNozzle _ _ _ w = w
wa = min maxa $ max (negate maxa) (_nzCurrentWalkAngle nz + walkamount) -- & randGen .~ g
-- where
-- nz = _mzEffect mz
-- (walkamount, g) = randomR (- aspeed, aspeed) (_randGen w)
-- aspeed = _nzWalkSpeed nz
-- maxa = _nzMaxWalkAngle nz
-- wa = min maxa $ max (negate maxa) (_nzCurrentWalkAngle nz + walkamount)
shootTractorBeam :: Item -> Creature -> World -> World shootTractorBeam :: Item -> Creature -> World -> World
@@ -549,6 +558,7 @@ shootLaser' itm cr mz w = w
inacc = _mzInaccuracy mz inacc = _mzInaccuracy mz
dir = _crDir cr + _mzRot mz + a dir = _crDir cr + _mzRot mz + a
removeAmmoFromMag :: Int -> Maybe Int -> Creature -> World -> World
removeAmmoFromMag x mid cr = fromMaybe id $ do removeAmmoFromMag x mid cr = fromMaybe id $ do
magid <- mid magid <- mid
return $ cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix magid . itUse . amagLoadStatus . iaLoaded -~ x return $ cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix magid . itUse . amagLoadStatus . iaLoaded -~ x
@@ -559,10 +569,10 @@ shootBullet itm cr w (mz,x,mid) = fromMaybe w $ do
-- should be able to pass the magazine in from elsewhere? -- should be able to pass the magazine in from elsewhere?
thebullet <- cr ^? crInv . ix magid . itUse . amagParams . ampBullet thebullet <- cr ^? crInv . ix magid . itUse . amagParams . ampBullet
return $ w & flip (foldl' (&)) (replicate x (makeBullet thebullet itm cr mz)) return $ w & flip (foldl' (&)) (replicate x (makeBullet thebullet itm cr mz))
& makeMuzzleFlare mz itm cr -- & makeMuzzleFlare mz itm cr
& makeMuzzleSmoke mz itm cr -- & makeMuzzleSmoke mz itm cr
where -- where
cid = _crID cr -- cid = _crID cr
-- the random generator is not updated here, not sure if that is a problem -- the random generator is not updated here, not sure if that is a problem
makeBullet :: Bullet -> Item -> Creature -> Muzzle -> World -> World makeBullet :: Bullet -> Item -> Creature -> Muzzle -> World -> World
@@ -610,7 +620,7 @@ useMod hm = case hm of
FireRemoteShellMod -> undefined FireRemoteShellMod -> undefined
ExplodeRemoteShellMod -> undefined ExplodeRemoteShellMod -> undefined
DoNothingMod -> undefined DoNothingMod -> undefined
ForceFieldMod -> undefined -- ForceFieldMod -> undefined
DetectorMod _ -> undefined DetectorMod _ -> undefined
-- HeldModNothing -> [] -- HeldModNothing -> []
-- PoisonSprayerMod -> -- PoisonSprayerMod ->
@@ -664,27 +674,27 @@ useMod hm = case hm of
-- , withItemUpdateFirst increasecycleLasCircle -- , withItemUpdateFirst increasecycleLasCircle
-- , ammoCheckI -- , ammoCheckI
-- ] -- ]
LasWideMod n -> -- LasWideMod n ->
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, withItem $ \it -> -- , withItem $ \it ->
duplicateNumBarrels -- duplicateNumBarrels
-- ( min ---- ( min
-- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded) ---- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
(it ^?! itParams . lasCycle `div` lasWideRate) -- (it ^?! itParams . lasCycle `div` lasWideRate)
-- ) ---- )
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it)) -- , withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withSoundForI tone440sawtoothquietS 2 -- , withSoundForI tone440sawtoothquietS 2
, withItemUpdateFirst (increasecycleLasWide n) -- , withItemUpdateFirst (increasecycleLasWide n)
, ammoCheckI -- , ammoCheckI
] -- ]
DualBeamMod -> -- DualBeamMod ->
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, withSoundForI tone440sawtoothquietS 2 -- , withSoundForI tone440sawtoothquietS 2
, withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8 -- , withItem $ \it -> withCrPosShift (V2 0 (- thegapDualBeam it)) $ flareCircleAt (_lasColor2 $ _itParams it) 0.8
, withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPosShift (V2 0 (thegapDualBeam it)) $ flareCircleAt (_lasColor $ _itParams it) 0.8
, ammoCheckI -- , ammoCheckI
] -- ]
-- LasMod -> -- LasMod ->
-- [ useAmmoAmount 1 -- [ useAmmoAmount 1
-- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8 -- , withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
@@ -700,13 +710,13 @@ useMod hm = case hm of
-- --, ammoCheckI -- --, ammoCheckI
-- , blCheck -- , blCheck
-- ] -- ]
ShatterMod -> -- ShatterMod ->
[ useAmmoAmount 1 -- [ useAmmoAmount 1
, -- , withSoundStart tap3S -- , -- , withSoundStart tap3S
useTimeCheck -- useTimeCheck
, ammoCheckI -- , ammoCheckI
, blCheck -- , blCheck
] -- ]
-- AmmoCheckMod -> [ammoCheckI] -- AmmoCheckMod -> [ammoCheckI]
-- AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI] -- AmmoUseCheckMod -> [useAmmoAmount 1, useTimeCheck, ammoCheckI]
-- AmmoHammerTimeUseOneMod -> -- AmmoHammerTimeUseOneMod ->
@@ -910,10 +920,10 @@ useMod hm = case hm of
--increasecycleLasCircle it = it & itParams . lasCycle %~ (flip mod 2000 . (+ 1)) --increasecycleLasCircle it = it & itParams . lasCycle %~ (flip mod 2000 . (+ 1))
----f it = [it & itParams . lasCycle +~ x | x <- [0,100 .. 1900] ] ----f it = [it & itParams . lasCycle +~ x | x <- [0,100 .. 1900] ]
--fLasCircle it = [it & itParams . lasCycle +~ x | x <- [0, 50 .. 1999]] --fLasCircle it = [it & itParams . lasCycle +~ x | x <- [0, 50 .. 1999]]
increasecycleLasWide n it = case _heldHammer (_itUse it) of -- increasecycleLasWide n it = case _heldHammer (_itUse it) of
HammerUp -> it & itParams . lasCycle .~ 1 -- HammerUp -> it & itParams . lasCycle .~ 1
_ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1)) -- _ -> it & itParams . lasCycle %~ (min (n * lasWideRate) . (+ 1))
thegapDualBeam = _dbGap . _itParams -- thegapDualBeam = _dbGap . _itParams
--directedTelPos _ cr w = (p, a) --directedTelPos _ cr w = (p, a)
-- where -- where
-- p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just -- p = fromMaybe (_crPos cr) $ cr ^? crTargeting . ctPos . _Just
@@ -937,12 +947,12 @@ useHeld hu = case hu of
HeldDoNothing -> const $ const id HeldDoNothing -> const $ const id
-- HeldUseAmmoParams -> shootBullet -- HeldUseAmmoParams -> shootBullet
-- HeldOverNozzlesUseGasParams -> overNozzles useGasParams -- HeldOverNozzlesUseGasParams -> overNozzles useGasParams
HeldPJCreation -> usePjCreation -- HeldPJCreation -> usePjCreation
HeldPJCreationX _ -> usePjCreationX -- HeldPJCreationX _ -> usePjCreationX
HeldFireRemoteShell -> fireRemoteShell HeldFireRemoteShell -> fireRemoteShell
HeldDetectorEffect dt -> detectorEffect dt . _ldtValue HeldDetectorEffect dt -> detectorEffect dt . _ldtValue
-- HeldTeslaArc -> shootTeslaArc . _ldtValue -- HeldTeslaArc -> shootTeslaArc . _ldtValue
HeldLaser -> shootLaser . _ldtValue -- HeldLaser -> shootLaser . _ldtValue
HeldCircleLaser -> circleLaser . _ldtValue HeldCircleLaser -> circleLaser . _ldtValue
HeldDualLaser -> shootDualLaser . _ldtValue HeldDualLaser -> shootDualLaser . _ldtValue
HeldTractor -> aTractorBeam . _ldtValue HeldTractor -> aTractorBeam . _ldtValue
@@ -1042,6 +1052,8 @@ useGasParams mmagid mz itm cr w =
gasCreate :: GasFuel -> GasCreate -> GasCreate gasCreate :: GasFuel -> GasCreate -> GasCreate
gasCreate = flip const gasCreate = flip const
doGenFloat :: RandomGen g => GenFloat -> g -> (Float, g)
doGenFloat (ConstFloat x) g = (x,g) doGenFloat (ConstFloat x) g = (x,g)
doGenFloat (UniRandFloat x y) g = randomR (x,y) g doGenFloat (UniRandFloat x y) g = randomR (x,y) g
@@ -1103,14 +1115,14 @@ mcShootLaser it mc = cWorld . lWorld . lasers .:~ lasRayAt (_lasColor $ _itParam
-- | assumes that the item is held -- | assumes that the item is held
shootTeslaArc :: Item -> Creature -> Muzzle -> World -> World shootTeslaArc :: Item -> Creature -> Muzzle -> World -> World
shootTeslaArc it cr mz w = shootTeslaArc itm cr mz w =
w' w'
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itParams .~ ip & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix itRef . itParams .~ ip
where where
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
(w', ip) = makeTeslaArc (_itParams it) pos dir w (w', ip) = makeTeslaArc (_itParams itm) pos dir w
pos = _crPos cr +.+ aimingMuzzleLength cr it *.* unitVectorAtAngle dir pos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
dir = _crDir cr dir = _crDir cr + _mzRot mz
-- I believe because the targeting returns to nothing straight after you release -- I believe because the targeting returns to nothing straight after you release
-- the rmb, it is possible for this to do nothing -- the rmb, it is possible for this to do nothing
+2
View File
@@ -41,6 +41,8 @@ itemFromAttachType at = case at of
SCROLLATTACH ZOOMSCOPE -> zoomScope SCROLLATTACH ZOOMSCOPE -> zoomScope
TARGETATTACH tt -> targetingScope tt TARGETATTACH tt -> targetingScope tt
BULLETSYNTHESIZER -> bulletSynthesizer BULLETSYNTHESIZER -> bulletSynthesizer
ROCKETREMOTESCREEN -> rocketRemoteScreen
ROCKETHOMER -> rocketHomer
itemFromConsumableType :: ConsumableItemType -> Item itemFromConsumableType :: ConsumableItemType -> Item
+5
View File
@@ -105,3 +105,8 @@ bulletSynthesizer :: Item
bulletSynthesizer = defaultHeldItem bulletSynthesizer = defaultHeldItem
& itType . iyBase .~ ATTACH BULLETSYNTHESIZER & itType . iyBase .~ ATTACH BULLETSYNTHESIZER
& itUse .~ AttachUse NoAttachParams & itUse .~ AttachUse NoAttachParams
rocketHomer :: Item
rocketHomer = defaultHeldItem
& itType . iyBase .~ ATTACH ROCKETHOMER
& itUse .~ AttachUse NoAttachParams
+8 -5
View File
@@ -51,7 +51,8 @@ basicItemDisplay :: Item -> [String]
basicItemDisplay itm = basicItemDisplay itm =
Prelude.take (itSlotsTaken itm) $ Prelude.take (itSlotsTaken itm) $
itemBaseName itm : itemBaseName itm :
catMaybes [maybeWarmupStatus itm, maybeRateStatus itm] --catMaybes [maybeWarmupStatus itm, maybeRateStatus itm]
catMaybes [maybeWarmupStatus itm]
++ moduleStrings itm ++ moduleStrings itm
++ repeat "*" ++ repeat "*"
@@ -75,6 +76,8 @@ showAttachItem t = case t of
SCROLLATTACH x -> show x SCROLLATTACH x -> show x
TARGETATTACH x -> show x TARGETATTACH x -> show x
BULLETSYNTHESIZER -> "BSYNTH" BULLETSYNTHESIZER -> "BSYNTH"
ROCKETREMOTESCREEN -> "REMOTE SCREEN"
ROCKETHOMER -> "HOMING MOD"
showEquipItem :: EquipItemType -> String showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of showEquipItem eit = case eit of
@@ -182,7 +185,7 @@ maybeWarmupStatus it = case it ^? itUse . heldDelay . warmMax of
let n = show x let n = show x
in Just $ Prelude.take (5 - Prelude.length n) "*WARM" ++ n in Just $ Prelude.take (5 - Prelude.length n) "*WARM" ++ n
maybeRateStatus :: Item -> Maybe String --maybeRateStatus :: Item -> Maybe String
maybeRateStatus it = case it ^? itUse . heldDelay . rateMaxMax of --maybeRateStatus it = case it ^? itUse . heldDelay . rateMaxMax of
Nothing -> Nothing -- Nothing -> Nothing
_ -> Just $ leftPad 3 ' ' (show (_rateMax . _heldDelay $ _itUse it)) -- _ -> Just $ leftPad 3 ' ' (show (_rateMax . _heldDelay $ _itUse it))
+16 -16
View File
@@ -177,7 +177,7 @@ heldItemSPic ht it = case ht of
AMR -> noPic $ baseAMRShape <> addTinClip it AMR -> noPic $ baseAMRShape <> addTinClip it
AUTOAMR -> noPic $ baseAMRShape <> addTinClip it AUTOAMR -> noPic $ baseAMRShape <> addTinClip it
SNIPERRIFLE -> noPic $ baseAMRShape -- <> addBullets it SNIPERRIFLE -> noPic $ baseAMRShape -- <> addBullets it
MACHINEGUN -> noPic $ baseAMRShape <> addTinClip it -- MACHINEGUN -> noPic $ baseAMRShape <> addTinClip it
FLAMESPITTER -> flamerPic it FLAMESPITTER -> flamerPic it
FLAMETHROWER -> flamerPic it FLAMETHROWER -> flamerPic it
FLAMETORRENT -> flamerPic it FLAMETORRENT -> flamerPic it
@@ -187,8 +187,8 @@ heldItemSPic ht it = case ht of
TESLAGUN -> teslaGunPic TESLAGUN -> teslaGunPic
LASGUN -> lasGunPic it LASGUN -> lasGunPic it
-- LASCIRCLE -> lasGunPic it -- LASCIRCLE -> lasGunPic it
DUALBEAM -> dualBeamPic it -- DUALBEAM -> dualBeamPic it
LASWIDE _ -> lasGunPic it -- LASWIDE _ -> lasGunPic it
--SONICGUN -> noPic baseSonicShape --SONICGUN -> noPic baseSonicShape
TRACTORGUN -> tractorGunPic it TRACTORGUN -> tractorGunPic it
LAUNCHER -> launcherPic it LAUNCHER -> launcherPic it
@@ -468,19 +468,19 @@ lasGunPic _ =
amFrac = 0.5 amFrac = 0.5
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
dualBeamPic :: Item -> SPic --dualBeamPic :: Item -> SPic
dualBeamPic it = --dualBeamPic it =
( colorSH blue $ -- ( colorSH blue $
upperBoxST 4 (rectNESW gap 3 (- gap) 1) -- upperBoxST 4 (rectNESW gap 3 (- gap) 1)
<> upperBoxSU 4 (rectNESW gap (-1) (- gap) (-3)) -- <> upperBoxSU 4 (rectNESW gap (-1) (- gap) (-3))
<> upperBoxSU 1 (rectNESW gap 3 (- gap) (-3)) -- <> upperBoxSU 1 (rectNESW gap 3 (- gap) (-3))
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (- gap) (-1) -- , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (- gap) (-1)
) -- )
where -- where
--amFrac = fractionLoadedAmmo it -- --amFrac = fractionLoadedAmmo it
amFrac = 0.5 -- amFrac = 0.5
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red -- col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
gap = _dbGap (_itParams it) - 3 -- gap = _dbGap (_itParams it) - 3
tractorGunPic :: Item -> SPic tractorGunPic :: Item -> SPic
tractorGunPic = lasGunPic tractorGunPic = lasGunPic
+9 -3
View File
@@ -30,13 +30,19 @@ singleLDT x = LDT x [] []
baseComposedItem :: ItemBaseType -> Item -> CIL baseComposedItem :: ItemBaseType -> Item -> CIL
baseComposedItem ibt itm = case ibt of baseComposedItem ibt itm = case ibt of
HELD _ -> heldComposedItem itm HELD hit -> heldComposedItem itm hit
AMMOMAG _ -> ammoComposedItem itm AMMOMAG _ -> ammoComposedItem itm
ATTACH BULLETSYNTHESIZER -> (AmmoModifierCI BulletAmmo, [], []) ATTACH BULLETSYNTHESIZER -> (AmmoModifierCI BulletAmmo, [], [])
ATTACH (TARGETATTACH{}) -> (WeaponTargetingCI, [], [])
ATTACH (SCROLLATTACH ZOOMSCOPE) -> (WeaponScopeCI, [], [])
ATTACH ROCKETHOMER -> (AmmoModifierCI ProjectileAmmo, [], [])
ATTACH ROCKETREMOTESCREEN -> (AmmoModifierCI ProjectileAmmo, [], [])
_ -> (UncomposableCI, [], []) _ -> (UncomposableCI, [], [])
heldComposedItem :: Item -> CIL heldComposedItem :: Item -> HeldItemType -> CIL
heldComposedItem itm = (WeaponCI, map f ats, []) heldComposedItem itm hit = case hit of
_ -> (WeaponCI, map f ats,
[(WeaponTargetingLink,WeaponTargetingCI),(WeaponScopeLink,WeaponScopeCI)])
where where
ats = maybe [] IM.toList $ itm ^? itUse . heldAmmoTypes ats = maybe [] IM.toList $ itm ^? itUse . heldAmmoTypes
f (i,atype) = (AmmoInLink i atype,AmmoCI atype) f (i,atype) = (AmmoInLink i atype,AmmoCI atype)
+3 -3
View File
@@ -46,7 +46,7 @@ itemFromHeldType ht = case ht of
AMR -> amr AMR -> amr
AUTOAMR -> autoAmr AUTOAMR -> autoAmr
SNIPERRIFLE -> sniperRifle SNIPERRIFLE -> sniperRifle
MACHINEGUN -> machineGun -- MACHINEGUN -> machineGun
FLAMESPITTER -> flameSpitter FLAMESPITTER -> flameSpitter
FLAMETHROWER -> flameThrower FLAMETHROWER -> flameThrower
FLAMETORRENT -> flameTorrent FLAMETORRENT -> flameTorrent
@@ -56,8 +56,8 @@ itemFromHeldType ht = case ht of
TESLAGUN -> teslaGun TESLAGUN -> teslaGun
LASGUN -> lasGun LASGUN -> lasGun
-- LASCIRCLE -> lasCircle -- LASCIRCLE -> lasCircle
DUALBEAM -> dualBeam -- DUALBEAM -> dualBeam
LASWIDE i -> lasWide i -- LASWIDE i -> lasWide i
TRACTORGUN -> tractorGun TRACTORGUN -> tractorGun
LAUNCHER -> launcher LAUNCHER -> launcher
LAUNCHERX i -> launcherX i LAUNCHERX i -> launcherX i
+38 -37
View File
@@ -2,8 +2,8 @@ module Dodge.Item.Held.BatteryGuns where
import Dodge.SoundLogic.ExternallyGeneratedSounds import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Default.Item import Dodge.Default.Item
import Dodge.Base --import Dodge.Base
import Dodge.Data.Beam --import Dodge.Data.Beam
import Color import Color
import Control.Lens import Control.Lens
import qualified Data.Map.Strict as M import qualified Data.Map.Strict as M
@@ -32,7 +32,7 @@ teslaGun =
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
-- & itUse . heldAim . aimMuzPos .~ 4 -- & itUse . heldAim . aimMuzPos .~ 4
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0 0 TeslaGunFlare MuzzleTesla] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 4 0) 0 0 0 TeslaGunFlare MuzzleTesla Nothing]
& itType . iyBase .~ HELD TESLAGUN & itType . iyBase .~ HELD TESLAGUN
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo & itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldTriggerType .~ AutoTrigger & itUse . heldTriggerType .~ AutoTrigger
@@ -46,7 +46,7 @@ lasGun =
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo & itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldDelay .~ NoDelay & itUse . heldDelay .~ NoDelay
& itUse . heldTriggerType .~ AutoTrigger & itUse . heldTriggerType .~ AutoTrigger
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0 LasGunFlare MuzzleLaser] & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0 LasGunFlare MuzzleLaser Nothing]
& itParams & itParams
.~ Refracting .~ Refracting
{ _phaseV = 1 { _phaseV = 1
@@ -91,7 +91,8 @@ tractorGun =
-- & itUse . heldMods .~ TractorMod -- & itUse . heldMods .~ TractorMod
& itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0 DefaultFlareType MuzzleTractor] & itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ DefaultFlareType
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleTractor
& itType . iyBase .~ HELD TRACTORGUN & itType . iyBase .~ HELD TRACTORGUN
tractorGunTweak :: TweakParam tractorGunTweak :: TweakParam
@@ -102,15 +103,15 @@ tractorGunTweak =
, _tweakMax = 4 , _tweakMax = 4
} }
lasWide :: Int -> Item --lasWide :: Int -> Item
lasWide n = --lasWide n =
lasGun -- lasGun
& itType . iyBase .~ HELD (LASWIDE n) -- & itType . iyBase .~ HELD (LASWIDE n)
& itParams . lasColor .~ yellow -- & itParams . lasColor .~ yellow
& itParams . lasDamage .~ 2 -- & itParams . lasDamage .~ 2
& itUse . heldMods .~ LasWideMod n -- & itUse . heldMods .~ LasWideMod n
& itUse . heldAim . aimMuzzles -- & itUse . heldAim . aimMuzzles
.~ [Muzzle (V2 30 y) 0 0 0 DefaultFlareType MuzzleLaser | y <- spreadFromCenter n 1] -- .~ [Muzzle (V2 30 y) 0 0 0 DefaultFlareType MuzzleLaser Nothing | y <- spreadFromCenter n 1]
defaultBatteryGun :: Item defaultBatteryGun :: Item
defaultBatteryGun = defaultBatteryGun =
@@ -136,26 +137,26 @@ batteryModules =
-- & itUse . heldAim . aimWeight .~ 6 -- & itUse . heldAim . aimWeight .~ 6
-- & itUse . heldAim . aimRange .~ 1 -- & itUse . heldAim . aimRange .~ 1
dualBeam :: Item --dualBeam :: Item
dualBeam = --dualBeam =
lasGun -- lasGun
& itType . iyBase .~ HELD DUALBEAM -- & itType . iyBase .~ HELD DUALBEAM
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0 DefaultFlareType MuzzleLaser] -- & itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0 0 DefaultFlareType MuzzleLaser Nothing]
& itParams -- & itParams
.~ DualBeam -- .~ DualBeam
{ _phaseV = 1 -- { _phaseV = 1
, _lasColor = red -- , _lasColor = red
, _lasColor2 = green -- , _lasColor2 = green
, _lasCycle = 0 -- , _lasCycle = 0
, _lasDamage = 11 -- , _lasDamage = 11
, _lasBeam = BeamCombine LasBeamCombine -- , _lasBeam = BeamCombine LasBeamCombine
, _subParams = Nothing -- , _subParams = Nothing
, _dbGap = 20 -- , _dbGap = 20
} -- }
-- & itUse . heldUse .~ HeldDualLaser --shootDualLaser ---- & itUse . heldUse .~ HeldDualLaser --shootDualLaser
& itUse . heldDelay .~ NoDelay -- & itUse . heldDelay .~ NoDelay
& itUse . heldMods .~ DualBeamMod -- & itUse . heldMods .~ DualBeamMod
& itUse . heldAim . aimWeight .~ 6 -- & itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1 -- & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandFlat -- & itUse . heldAim . aimStance .~ TwoHandFlat
& itType . iyModules . at ModDualBeam ?~ EMPTYMODULE -- & itType . iyModules . at ModDualBeam ?~ EMPTYMODULE
+2 -2
View File
@@ -28,7 +28,6 @@ defaultBangCane =
-- & itUse . heldMods .~ BangCaneMod -- & itUse . heldMods .~ BangCaneMod
& itUse . heldAim . aimStance .~ OneHand & itUse . heldAim . aimStance .~ OneHand
-- & itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet]
volleyGun :: Int -> Item volleyGun :: Int -> Item
volleyGun i = volleyGun i =
@@ -43,6 +42,7 @@ volleyGun i =
<*> ZipList [0..i-1] <*> ZipList [0..i-1]
<*> pure PistolFlare <*> pure PistolFlare
<*> pure MuzzleShootBullet <*> pure MuzzleShootBullet
<*> pure Nothing
) )
& itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i & itUse . heldParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itUse . heldParams . recoil .~ 20 + 10 * fromIntegral i & itUse . heldParams . recoil .~ 20 + 10 * fromIntegral i
@@ -97,7 +97,7 @@ miniGunX i =
& itUse . heldParams . bulGunSound ?~ (mini1S,2) & itUse . heldParams . bulGunSound ?~ (mini1S,2)
& itUse . heldAim . aimTurnSpeed .~ 0.5 & itUse . heldAim . aimTurnSpeed .~ 0.5
& itUse . heldAim . aimMuzzles & itUse . heldAim . aimMuzzles
.~ replicate i (Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet) .~ replicate i (Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet Nothing)
& itUse . heldParams . recoil .~ 10 * fromIntegral i & itUse . heldParams . recoil .~ 10 * fromIntegral i
& itUse . heldParams . torqueAfter .~ 0.04 + 0.02 * fromIntegral i & itUse . heldParams . torqueAfter .~ 0.04 + 0.02 * fromIntegral i
& itUse . heldParams . sidePush .~ 10 * fromIntegral i & itUse . heldParams . sidePush .~ 10 * fromIntegral i
+1 -1
View File
@@ -17,7 +17,7 @@ bangCone =
& itUse . heldMods .~ PistolMod & itUse . heldMods .~ PistolMod
-- & itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles & itUse . heldAim . aimMuzzles
.~ replicate 15 (Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType MuzzleShootBullet) .~ replicate 15 (Muzzle (V2 15 0) 0 0.5 0 DefaultFlareType MuzzleShootBullet Nothing)
& itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8 & itUse . heldParams . muzVel .~ UniRandFloat 0.5 0.8
& itUse . heldParams . rifling .~ UniRandFloat 0.3 0.8 & itUse . heldParams . rifling .~ UniRandFloat 0.3 0.8
& itUse . heldParams . recoil .~ 150 & itUse . heldParams . recoil .~ 150
+3 -1
View File
@@ -34,7 +34,8 @@ launcher =
& itUse . heldAim . aimStance .~ TwoHandOver & itUse . heldAim . aimStance .~ TwoHandOver
-- & itUse . heldAim . aimHandlePos .~ V2 3 0 -- & itUse . heldAim . aimHandlePos .~ V2 3 0
-- & itUse . heldAim . aimMuzPos .~ 20 -- & itUse . heldAim . aimMuzPos .~ 20
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0 0 DefaultFlareType MuzzleLauncher] & itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& 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
@@ -55,6 +56,7 @@ launcherX i =
<*> ZipList [0..] <*> ZipList [0..]
<*> pure DefaultFlareType <*> pure DefaultFlareType
<*> pure MuzzleLauncher <*> pure MuzzleLauncher
<*> pure Nothing
) )
& itUse . heldAmmoTypes .~ IM.fromList [(j,ProjectileAmmo) | j <- [0..i-1]] & itUse . heldAmmoTypes .~ IM.fromList [(j,ProjectileAmmo) | j <- [0..i-1]]
where where
+18 -17
View File
@@ -4,7 +4,7 @@ module Dodge.Item.Held.Rod (
amr, amr,
autoAmr, autoAmr,
sniperRifle, sniperRifle,
machineGun, -- machineGun,
) where ) where
import Dodge.SoundLogic.ExternallyGeneratedSounds import Dodge.SoundLogic.ExternallyGeneratedSounds
@@ -31,7 +31,8 @@ bangRod =
& itUse . heldAim . aimStance .~ OneHand & itUse . heldAim . aimStance .~ OneHand
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
-- & itUse . heldAim . aimHandlePos .~ 5 -- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 30 0) 0 0.1 0 HeavySmokeFlare MuzzleShootBullet] & itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ HeavySmokeFlare
-- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo -- & itUse . heldConsumption . laAmmoType .~ hvBulletAmmo
elephantGun :: Item elephantGun :: Item
@@ -59,18 +60,18 @@ sniperRifle =
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0 & itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1} & itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
machineGun :: Item --machineGun :: Item
machineGun = --machineGun =
bangRod -- bangRod
& itType . iyBase .~ HELD MACHINEGUN -- & itType . iyBase .~ HELD MACHINEGUN
-- & itUse . heldMods .~ MachineGunMod ---- & itUse . heldMods .~ MachineGunMod
& itUse . heldMods .~ PistolMod -- & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimWeight .~ 8 -- & itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 1 -- & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimStance .~ TwoHandUnder -- & itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} -- & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldDelay .~ VariableRate -- & itUse . heldDelay .~ VariableRate
{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0} -- {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
& itInvSize .~ 3 -- & itInvSize .~ 3
& itUse . heldParams . torqueAfter .~ 0.2 -- not sure if this is necessary? -- & itUse . heldParams . torqueAfter .~ 0.2 -- not sure if this is necessary?
& itUse . heldTriggerType .~ AutoTrigger -- & itUse . heldTriggerType .~ AutoTrigger
+7 -2
View File
@@ -33,8 +33,12 @@ flameSpitter =
& itType . iyBase .~ HELD FLAMESPITTER & itType . iyBase .~ HELD FLAMESPITTER
-- & itParams . sprayNozzles . ix 0 . nzPressure .~ 4 -- & itParams . sprayNozzles . ix 0 . nzPressure .~ 4
& itUse . heldAim . aimStance .~ OneHand & itUse . heldAim . aimStance .~ OneHand
& itUse . heldDelay .~ FixedRate{_rateMax = 12, _rateTime = 0} & itUse . heldDelay .~ FixedRate{_rateMax = 3, _rateTime = 0}
& itUse . heldMods .~ FlameSpitterMod -- & itUse . heldMods .~ FlameSpitterMod
& itUse . heldParams . weaponInvLock .~ 10
& itUse . heldParams . weaponRepeat .~ [1..9]
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect . nzPressure .~ UniRandFloat 3 4
& itUse . heldTriggerType .~ HammerTrigger
flameTorrent :: Item flameTorrent :: Item
flameTorrent = flameTorrent =
@@ -88,6 +92,7 @@ flameThrower =
, _nzWalkSpeed = 0.01 , _nzWalkSpeed = 0.01
, _nzCurrentWalkAngle = 0 , _nzCurrentWalkAngle = 0
} }
Nothing
] ]
& itUse . heldAmmoTypes .~ singleAmmo GasAmmo & itUse . heldAmmoTypes .~ singleAmmo GasAmmo
& itType . iyBase .~ HELD FLAMETHROWER & itType . iyBase .~ HELD FLAMETHROWER
+1 -1
View File
@@ -27,7 +27,7 @@ bangStick i =
-- & itUse . heldMods .~ BangStickMod -- & itUse . heldMods .~ BangStickMod
& itUse . heldMods .~ PistolMod & itUse . heldMods .~ PistolMod
& itUse . heldAim . aimMuzzles & itUse . heldAim . aimMuzzles
.~ [Muzzle (V2 10 0) a 0.01 0 DefaultFlareType MuzzleShootBullet | a <- spreadAroundCenter i baseStickSpread] .~ [Muzzle (V2 10 0) a 0.01 0 DefaultFlareType MuzzleShootBullet Nothing | a <- spreadAroundCenter i baseStickSpread]
baseStickSpread :: Float baseStickSpread :: Float
baseStickSpread = 0.2 baseStickSpread = 0.2
+4 -2
View File
@@ -40,11 +40,12 @@ forceFieldGun =
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun -- & itUse . heldUse .~ HeldForceField --useForceFieldGun
& itUse . heldDelay .~ NoDelay & itUse . heldDelay .~ NoDelay
-- & itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different -- & itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
& itUse . heldMods .~ ForceFieldMod -- this is slightly different -- & itUse . heldMods .~ ForceFieldMod -- this is slightly different
-- than the list below -- than the list below
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1] --[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType . iyBase .~ HELD FORCEFIELDGUN & itType . iyBase .~ HELD FORCEFIELDGUN
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo & itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleForceField
{- | {- |
Sends out pulses that display walls. Sends out pulses that display walls.
@@ -55,7 +56,8 @@ clickDetector dt =
& itUse . heldDelay . rateMax .~ 20 & itUse . heldDelay . rateMax .~ 20
-- & itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt -- & itUse . heldUse .~ HeldDetectorEffect dt --detectorEffect dt
-- & itUse . heldMods .~ AmmoUseCheckMod -- & itUse . heldMods .~ AmmoUseCheckMod
& itUse . heldMods .~ DetectorMod dt --detectorEffect dt -- & itUse . heldMods .~ DetectorMod dt --detectorEffect dt
& itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1} & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
& itType . iyBase .~ HELD (HELDDETECTOR dt) & itType . iyBase .~ HELD (HELDDETECTOR dt)
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleDetector
+6 -1
View File
@@ -3,12 +3,17 @@ module Dodge.Item.Held.Weapons where
import Dodge.Default.Item import Dodge.Default.Item
import Dodge.Data.Item import Dodge.Data.Item
import Control.Lens import Control.Lens
import Linear.V2
shatterGun :: Item shatterGun :: Item
shatterGun = shatterGun =
defaultHeldItem defaultHeldItem
& itType . iyBase .~ HELD SHATTERGUN & itType . iyBase .~ HELD SHATTERGUN
& itUse . heldDelay . rateMax .~ 10 & itUse . heldDelay . rateMax .~ 10
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzPos .~ V2 30 0
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleShatter
-- & itUse . heldUse .~ HeldShatter --shootShatter -- & itUse . heldUse .~ HeldShatter --shootShatter
& itUse . heldMods .~ ShatterMod -- & itUse . heldMods .~ ShatterMod
& itUse . heldAim . aimStance .~ TwoHandFlat & itUse . heldAim . aimStance .~ TwoHandFlat
+3 -3
View File
@@ -81,7 +81,7 @@ heldInfo hit = case hit of
AMR -> "An antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon." AMR -> "An antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon."
AUTOAMR -> "An automatic antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon." AUTOAMR -> "An automatic antimateriel rifle, designed to disable military equipment. Its long barrel is fed by a magazine that must be replaced when reloading the weapon."
SNIPERRIFLE -> "A firearm designed with long range capability in mind. Its long barrel requires reloading after each shot." SNIPERRIFLE -> "A firearm designed with long range capability in mind. Its long barrel requires reloading after each shot."
MACHINEGUN -> "A heavy firearm whose rate of fire increases during a barrage." -- MACHINEGUN -> "A heavy firearm whose rate of fire increases during a barrage."
FLAMESPITTER -> "A weapon that globs out burning fuel." FLAMESPITTER -> "A weapon that globs out burning fuel."
FLAMETHROWER -> "A weapon that squirts out burning fuel." FLAMETHROWER -> "A weapon that squirts out burning fuel."
FLAMETORRENT -> "A weapon that streams out burning fuel in a torrent." FLAMETORRENT -> "A weapon that streams out burning fuel in a torrent."
@@ -91,8 +91,8 @@ heldInfo hit = case hit of
TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object." TESLAGUN -> "A weapon that discharges a sustained arc of electricity. The arc will attempt to discharge at a nearby object."
LASGUN -> "A weapon that continuously emits photons in a narrow beam." LASGUN -> "A weapon that continuously emits photons in a narrow beam."
-- LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user." -- LASCIRCLE -> "A extensive configuration of prisms and mirrors that produces multiple laser beams around its user."
DUALBEAM -> "A weapon that emits two beams that converge at a selectable point in front of the user." -- DUALBEAM -> "A weapon that emits two beams that converge at a selectable point in front of the user."
LASWIDE _ -> "A weapon that continuously emits photons in a narrow beam. The beam expands as the weapon heats up." -- LASWIDE _ -> "A weapon that continuously emits photons in a narrow beam. The beam expands as the weapon heats up."
TRACTORGUN -> "An item that produces a beam of gravitons." TRACTORGUN -> "An item that produces a beam of gravitons."
LAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin." LAUNCHER -> "A large tube that can launch self propelled projectiles. Moving the tube after launch will cause the projectile to spin."
LAUNCHERX i -> over _head toUpper (showInt i) ++ " tubes that can launch self propelled projectiles. Tubes that do not face forward launch their projecitles at an angle." LAUNCHERX i -> over _head toUpper (showInt i) ++ " tubes that can launch self propelled projectiles. Tubes that do not face forward launch their projecitles at an angle."
+3 -3
View File
@@ -45,7 +45,7 @@ heldBounds hit = case hit of
AMR -> amrs AMR -> amrs
AUTOAMR -> amrs AUTOAMR -> amrs
SNIPERRIFLE -> amrs SNIPERRIFLE -> amrs
MACHINEGUN -> amrs -- MACHINEGUN -> amrs
FLAMESPITTER -> fs FLAMESPITTER -> fs
FLAMETHROWER -> fs FLAMETHROWER -> fs
FLAMETORRENT -> fs FLAMETORRENT -> fs
@@ -55,8 +55,8 @@ heldBounds hit = case hit of
TESLAGUN -> ts TESLAGUN -> ts
LASGUN -> ls LASGUN -> ls
-- LASCIRCLE -> ls -- LASCIRCLE -> ls
DUALBEAM -> ls -- DUALBEAM -> ls
LASWIDE _ -> ls --LASWIDE _ -> ls
TRACTORGUN -> ls TRACTORGUN -> ls
LAUNCHER -> launchs LAUNCHER -> launchs
LAUNCHERX _ -> launchs LAUNCHERX _ -> launchs
+7
View File
@@ -1,6 +1,7 @@
module Dodge.Item.Scope ( module Dodge.Item.Scope (
zoomScope, zoomScope,
targetingScope, targetingScope,
rocketRemoteScreen,
) where ) where
import Control.Lens import Control.Lens
@@ -18,3 +19,9 @@ targetingScope tt =
defaultHeldItem defaultHeldItem
& itType . iyBase .~ ATTACH (TARGETATTACH tt) & itType . iyBase .~ ATTACH (TARGETATTACH tt)
& itUse .~ AttachUse TargetAttachParams & itUse .~ AttachUse TargetAttachParams
rocketRemoteScreen :: Item
rocketRemoteScreen =
defaultHeldItem
& itType . iyBase .~ ATTACH ROCKETREMOTESCREEN
& itUse .~ AttachUse NoAttachParams
+43 -42
View File
@@ -18,7 +18,7 @@ module Dodge.Item.Weapon.TriggerType (
withItem, withItem,
withItemUpdate, withItemUpdate,
withItemUpdateFirst, withItemUpdateFirst,
rateIncAB, -- rateIncAB,
torqueBefore, torqueBefore,
torqueBeforeAtLeast, torqueBeforeAtLeast,
withTorqueAfter, withTorqueAfter,
@@ -161,44 +161,44 @@ itUseCharge x = itUse . leftConsumption . arLoaded %~ (max 0 . subtract x)
--itUseAmmo :: Int -> Item -> Item --itUseAmmo :: Int -> Item -> Item
--itUseAmmo x = itUse . heldConsumption . laSource . _InternalSource . iaLoaded %~ (max 0 . subtract x) --itUseAmmo x = itUse . heldConsumption . laSource . _InternalSource . iaLoaded %~ (max 0 . subtract x)
{- | Fires at an increasing rate. --{- | Fires at an increasing rate.
Has different effect after first fire. --Has different effect after first fire.
Applies ammo check and use cooldown check. --Applies ammo check and use cooldown check.
-} ---}
rateIncAB :: --rateIncAB ::
-- | Extra effect on first fire -- -- | Extra effect on first fire
ChainEffect -> -- ChainEffect ->
-- | Extra effect on continued fire -- -- | Extra effect on continued fire
ChainEffect -> -- ChainEffect ->
ChainEffect -- ChainEffect
rateIncAB exeffFirst exeffCont eff item cr w --rateIncAB exeffFirst exeffCont eff item cr w
| repeatFire = -- | repeatFire =
w -- w
& pointItem -- & pointItem
%~ ( (itUse . heldDelay . rateMax .~ max fastRate (currentRate - 1)) -- %~ ( (itUse . heldDelay . rateMax .~ max fastRate (currentRate - 1))
-- . itUseAmmo 1 ---- . itUseAmmo 1
. (itUse . heldDelay . rateTime .~ currentRate) -- . (itUse . heldDelay . rateTime .~ currentRate)
) -- )
& exeffCont eff item cr -- & exeffCont eff item cr
| firstFire = -- | firstFire =
w -- w
& pointItem -- & pointItem
%~ ( (itUse . heldDelay . rateMax .~ startRate - 1) -- %~ ( (itUse . heldDelay . rateMax .~ startRate - 1)
-- . itUseAmmo 1 ---- . itUseAmmo 1
. (itUse . heldDelay . rateTime .~ startRate) -- . (itUse . heldDelay . rateTime .~ startRate)
) -- )
& exeffFirst eff item cr -- & exeffFirst eff item cr
| otherwise = w -- | otherwise = w
where -- where
item' = _ldtValue item -- item' = _ldtValue item
fastRate = _rateMinMax . _heldDelay $ _itUse item' -- fastRate = _rateMinMax . _heldDelay $ _itUse item'
startRate = _rateMaxMax . _heldDelay $ _itUse item' -- startRate = _rateMaxMax . _heldDelay $ _itUse item'
cid = _crID cr -- cid = _crID cr
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change -- itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
pointItem = cWorld . lWorld . creatures . ix cid . crInv . ix itRef -- pointItem = cWorld . lWorld . creatures . ix cid . crInv . ix itRef
currentRate = _rateMax (_heldDelay (_itUse item')) -- currentRate = _rateMax (_heldDelay (_itUse item'))
repeatFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item')) == 1 -- repeatFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item')) == 1
firstFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item')) == 0 -- firstFire = crWeaponReady cr && _rateTime (_heldDelay (_itUse item')) == 0
-- | Apply effect after a warm up. -- | Apply effect after a warm up.
@@ -377,7 +377,7 @@ Applies a world effect after an item use cooldown check.
-} -}
useTimeCheck :: ChainEffect useTimeCheck :: ChainEffect
useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay of useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay of
Just (FixedRate _ 0) -> f item cr $ setUseTime w Just (FixedRate _ 0) -> f item cr $ setUseRate w
Just (FixedRate _ _) -> w Just (FixedRate _ _) -> w
Just (WarmUpNoDelay wt wm ws) | wt < wm -> w Just (WarmUpNoDelay wt wm ws) | wt < wm -> w
& soundContinue (CrWeaponSound cid 0) (_crPos cr) ws (Just 2) & soundContinue (CrWeaponSound cid 0) (_crPos cr) ws (Just 2)
@@ -385,10 +385,11 @@ useTimeCheck f item cr w = case item ^? ldtValue . itUse . heldDelay of
Just (WarmUpNoDelay _ wm _) -> f item cr w Just (WarmUpNoDelay _ wm _) -> f item cr w
& cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . warmTime .~ (wm+1) & cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . warmTime .~ (wm+1)
Just NoDelay -> f item cr w Just NoDelay -> f item cr w
_ -> w -- Just (VariableRate rmax rtime rmaxmax rminmax) -> undefined
Nothing -> w
where where
cid = _crID cr cid = _crID cr
setUseTime = cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . rateTime setUseRate = cWorld . lWorld . creatures . ix cid . crInv . ix itRef . itUse . heldDelay . rateTime
+~ userate +~ userate
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
userate = fromMaybe 0 $ item ^? ldtValue . itUse . heldDelay . rateMax userate = fromMaybe 0 $ item ^? ldtValue . itUse . heldDelay . rateMax
+1 -1
View File
@@ -21,7 +21,7 @@ updateTargeting tu = case tu of
Nothing -> clearTargeting Nothing -> clearTargeting
Just TARGETLASER -> targetLaserUpdate' Just TARGETLASER -> targetLaserUpdate'
Just TargetRBPress -> upCT (flip targetRBPressUpdate . _crTargeting) Just TargetRBPress -> upCT (flip targetRBPressUpdate . _crTargeting)
Just TargetRBLine -> upCT (flip targetRBPressUpdate . _crTargeting) Just TargetRBLine -> upCT (flip targetRBPressUpdate . _crTargeting)
Just TargetRBCreature -> upCT targetRBCreatureUp Just TargetRBCreature -> upCT targetRBCreatureUp
Just TargetCursor -> upCT (flip targetCursorUpdate . _crTargeting) Just TargetCursor -> upCT (flip targetCursorUpdate . _crTargeting)
+401 -411
View File
File diff suppressed because it is too large Load Diff