Remove internal ammo

This commit is contained in:
2024-06-21 12:48:41 +01:00
parent d41604fcde
commit 0a1b0386b9
33 changed files with 838 additions and 789 deletions
+186 -5
View File
@@ -1,3 +1,180 @@
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:11:1-26: warning: [-Wunused-imports]
The import of Control.Applicative is redundant
|
11 | import Control.Applicative
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:12:1-20: warning: [-Wunused-imports]
The import of Control.Monad is redundant
|
12 | import Control.Monad
| ^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:15:1-22: warning: [-Wunused-imports]
The import of Dodge.Item.Info is redundant
|
15 | import Dodge.Item.Info
| ^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:87:16-17: warning: [-Wname-shadowing]
This binding for at shadows the existing binding
imported from LensHelp at /home/justin/Haskell/loop/src/Dodge/Item/Display.hs:18:1-15
(and originally defined in Control.Lens.At)
|
87 | showAttachItem at = case at of
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:132:21-22: warning: [-Wunused-matches]
Defined but not used: cr
|
132 | showEquipmentNumber cr itm = case _eeUse ee of
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Display.hs:155:20-21: warning: [-Wunused-matches]
Defined but not used: cr
|
155 | showReloadProgress cr itm = fromMaybe [] $ do
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:10:1-39: warning: [-Wunused-imports]
The import of Dodge.Item.Weapon.FractionLoaded is redundant
|
10 | import Dodge.Item.Weapon.FractionLoaded
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:68:1-12: warning: [-Wunused-top-binds]
Defined but not used: ammoPosition
|
68 | ammoPosition itm hit = case hit of
| ^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:119:1-16: warning: [-Wunused-top-binds]
Defined but not used: bangStickAmmoPos
|
119 | bangStickAmmoPos _ itm =
| ^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:125:1-16: warning: [-Wunused-top-binds]
Defined but not used: volleygunAmmoPos
|
125 | volleygunAmmoPos i =
| ^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:132:1-15: warning: [-Wunused-top-binds]
Defined but not used: multigunAmmoPos
|
132 | multigunAmmoPos i =
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:259:1-10: warning: [-Wunused-top-binds]
Defined but not used: drawBullet
|
259 | drawBullet itm p q =
| ^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:337:1-17: warning: [-Wunused-top-binds]
Defined but not used: bulletEffectColor
|
337 | bulletEffectColor x = case x of
| ^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:343:1-15: warning: [-Wunused-top-binds]
Defined but not used: bulletTrajColor
|
343 | bulletTrajColor x = case x of
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:350:1-18: warning: [-Wunused-top-binds]
Defined but not used: bulletPayloadColor
|
350 | bulletPayloadColor x = case x of
| ^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:358:1-15: warning: [-Wunused-top-binds]
Defined but not used: energyBallColor
|
358 | energyBallColor ebt = case ebt of
| ^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:407:11-12: warning: [-Wunused-matches]
Defined but not used: it
|
407 | flamerPic it =
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:448:11-12: warning: [-Wunused-matches]
Defined but not used: it
|
448 | lasGunPic it =
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/FractionLoaded.hs:6:1-19: warning: [-Wunused-imports]
The import of Control.Lens is redundant
|
6 | import Control.Lens
| ^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/FractionLoaded.hs:7:1-17: warning: [-Wunused-imports]
The import of Data.Maybe is redundant
|
7 | import Data.Maybe
| ^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/FractionLoaded.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/Euse.hs:4:1-20: warning: [-Wunused-imports]
The import of Control.Monad is redundant
|
4 | import Control.Monad
| ^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Euse.hs:47:15-17: warning: [-Wunused-matches]
Defined but not used: itm
|
47 | trySiphonFuel itm cr = id
| ^^^
/home/justin/Haskell/loop/src/Dodge/Euse.hs:47:19-20: warning: [-Wunused-matches]
Defined but not used: cr
|
47 | trySiphonFuel itm cr = id
| ^^
/home/justin/Haskell/loop/src/Dodge/HeldUse.hs:488:22-23: warning: [-Wunused-matches]
Defined but not used: it
|
488 | caneStickSoundChoice it = tap3S
| ^^
/home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:55: warning: [-Wtype-defaults]
• Defaulting the following constraints to type Integer
(Num a0)
arising from the literal 1
at /home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:55
(Enum a0)
arising from the arithmetic sequence 1 ..
at /home/justin/Haskell/loop/src/Dodge/Item/Weapon/TriggerType.hs:657:54-60
• In the expression: 1
In the second argument of take, namely [1 .. ]
In the third argument of foldr, namely (take numbul [1 .. ])
|
657 | duplicateLoaded eff it cr w = foldr f w (take numbul [1 .. ])
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Held/BatteryGuns.hs:10:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
10 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Cone.hs:6:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
6 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Launcher.hs:4:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
4 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/SprayGuns.hs:12:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Rod.hs:13:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
13 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Info.hs:(62,16)-(107,62): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: MULTIGUN _
|
62 | heldInfo hit = case hit of
| ^^^^^^^^^^^...
/home/justin/Haskell/loop/src/Dodge/Item/Held/Cane.hs:14:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
14 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:19-20: warning: [-Wunused-matches]
Defined but not used: cr
|
@@ -13,9 +190,13 @@
|
45 | upDownAttachments cr i j s = s
| ^
/home/justin/Haskell/loop/src/Dodge/Item/Info.hs:(62,16)-(109,62): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: MULTIGUN _
/home/justin/Haskell/loop/src/Dodge/Item/Held/Stick.hs:12:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
62 | heldInfo hit = case hit of
| ^^^^^^^^^^^...
12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Default/Item/Use/Consumption.hs:6:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant
|
6 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+141 -160
View File
@@ -34,82 +34,78 @@ digraph {
46 [shape=box
,label="HELD {_ibtHeld = MACHINEPISTOL}"];
48 [shape=box
,label="HELD {_ibtHeld = REVOLVER}"];
51 [shape=box
,label="HELD {_ibtHeld = REVOLVERX {_xNum = 1}}"];
53 [shape=box
,label="HELD {_ibtHeld = BANGCONE}"];
55 [shape=box
51 [shape=box
,label="HELD {_ibtHeld = BLUNDERBUSS}"];
57 [shape=box
53 [shape=box
,label="HELD {_ibtHeld = GRAPECANNON {_xNum = 1}}"];
59 [shape=box
55 [shape=box
,label="HELD {_ibtHeld = RIFLE}"];
61 [shape=box
57 [shape=box
,label="HELD {_ibtHeld = VOLLEYGUN {_xNum = 3}}"];
63 [shape=box
59 [shape=box
,label="HELD {_ibtHeld = REPEATER}"];
65 [shape=box
61 [shape=box
,label="HELD {_ibtHeld = AUTORIFLE}"];
67 [shape=box
63 [shape=box
,label="HELD {_ibtHeld = BURSTRIFLE}"];
69 [shape=box
65 [shape=box
,label="HELD {_ibtHeld = MINIGUNX {_xNum = 3}}"];
72 [shape=box
68 [shape=box
,label="HELD {_ibtHeld = SNIPERRIFLE}"];
73 [shape=box
69 [shape=box
,label="HELD {_ibtHeld = AMR}"];
76 [shape=box
72 [shape=box
,label="HELD {_ibtHeld = AUTOAMR}"];
78 [shape=box
74 [shape=box
,label="HELD {_ibtHeld = MACHINEGUN}"];
80 [shape=box
76 [shape=box
,label="HELD {_ibtHeld = LAUNCHER}"];
83 [shape=box
79 [shape=box
,label="HELD {_ibtHeld = LAUNCHERX {_xNum = 2}}"];
87 [shape=box
83 [shape=box
,label="HELD {_ibtHeld = FLAMESPITTER}"];
91 [shape=box
87 [shape=box
,label="HELD {_ibtHeld = BLOWTORCH}"];
93 [shape=box
89 [shape=box
,label="HELD {_ibtHeld = FLAMETHROWER}"];
95 [shape=box
91 [shape=box
,label="HELD {_ibtHeld = FLAMEWALL}"];
97 [shape=box
93 [shape=box
,label="HELD {_ibtHeld = FLAMETORRENT}"];
99 [shape=box
95 [shape=box
,label="HELD {_ibtHeld = LASGUN}"];
103 [shape=box
,label="HELD {_ibtHeld = DUALBEAM}"];
105 [shape=box
99 [shape=box
,label="HELD {_ibtHeld = DUALBEAM}"];
101 [shape=box
,label="HELD {_ibtHeld = LASWIDE {_xNum = 2}}"];
107 [shape=box
103 [shape=box
,label="HELD {_ibtHeld = LASCIRCLE}"];
109 [shape=box
105 [shape=box
,label="HELD {_ibtHeld = SPARKGUN}"];
111 [shape=box
107 [shape=box
,label="HELD {_ibtHeld = TESLAGUN}"];
113 [shape=box
109 [shape=box
,label="LEFT {_ibtLeft = BLINKER}"];
116 [shape=box
112 [shape=box
,label="LEFT {_ibtLeft = BLINKERUNSAFE}"];
118 [shape=box
114 [shape=box
,label="EQUIP {_ibtEquip = MAGSHIELD}"];
121 [shape=box
117 [shape=box
,label="EQUIP {_ibtEquip = POWERLEGS}"];
127 [shape=box
123 [shape=box
,label="HELD {_ibtHeld = FLATSHIELD}"];
137 [shape=box
133 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR ITEMDETECTOR}"];
140 [shape=box
136 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR WALLDETECTOR}"];
142 [shape=box
138 [shape=box
,label="EQUIP {_ibtEquip = AUTODETECTOR CREATUREDETECTOR}"];
144 [shape=box
140 [shape=box
,label="HELD {_ibtHeld = TORCH}"];
148 [shape=box
144 [shape=box
,label="EQUIP {_ibtEquip = HEADLAMP}"];
156 [shape=box
152 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 2}}"];
}
subgraph 2 {
@@ -137,41 +133,41 @@ digraph {
60 [shape=point];
62 [shape=point];
64 [shape=point];
66 [shape=point];
68 [shape=point];
67 [shape=point];
70 [shape=point];
71 [shape=point];
74 [shape=point];
73 [shape=point];
75 [shape=point];
77 [shape=point];
79 [shape=point];
78 [shape=point];
80 [shape=point];
82 [shape=point];
84 [shape=point];
86 [shape=point];
88 [shape=point];
90 [shape=point];
92 [shape=point];
94 [shape=point];
96 [shape=point];
98 [shape=point];
100 [shape=point];
102 [shape=point];
104 [shape=point];
106 [shape=point];
108 [shape=point];
110 [shape=point];
112 [shape=point];
115 [shape=point];
117 [shape=point];
111 [shape=point];
113 [shape=point];
116 [shape=point];
119 [shape=point];
120 [shape=point];
123 [shape=point];
121 [shape=point];
122 [shape=point];
124 [shape=point];
125 [shape=point];
126 [shape=point];
128 [shape=point];
130 [shape=point];
133 [shape=point];
136 [shape=point];
129 [shape=point];
132 [shape=point];
135 [shape=point];
137 [shape=point];
139 [shape=point];
141 [shape=point];
143 [shape=point];
145 [shape=point];
147 [shape=point];
149 [shape=point];
151 [shape=point];
@@ -179,9 +175,6 @@ digraph {
155 [shape=point];
157 [shape=point];
159 [shape=point];
161 [shape=point];
163 [shape=point];
165 [shape=point];
}
0 -> 1 [xlabel="",tailport=e];
2 -> 0 [xlabel=1
@@ -209,7 +202,7 @@ digraph {
16 -> 27 [xlabel=1
,arrowhead=onone
,headport=w];
16 -> 147 [xlabel=1
16 -> 143 [xlabel=1
,arrowhead=onone
,headport=w];
18 -> 19 [xlabel="",tailport=e];
@@ -221,28 +214,25 @@ digraph {
35 -> 38 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 47 [xlabel=1
35 -> 54 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 58 [xlabel=1
35 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 60 [xlabel=1
35 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 60 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 60 [xlabel=1
35 -> 56 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 151 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 155 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 161 [xlabel=1
,arrowhead=onone
,headport=w];
35 -> 163 [xlabel=1
35 -> 157 [xlabel=1
,arrowhead=onone
,headport=w];
38 -> 39 [xlabel="",tailport=e];
@@ -263,150 +253,141 @@ digraph {
,arrowhead=onone
,headport=w];
50 -> 51 [xlabel="",tailport=e];
51 -> 159 [xlabel=1
,arrowhead=onone
,headport=w];
52 -> 53 [xlabel="",tailport=e];
53 -> 54 [xlabel=1
51 -> 52 [xlabel=1
,arrowhead=onone
,headport=w];
52 -> 53 [xlabel="",tailport=e];
53 -> 159 [xlabel=1
,arrowhead=onone
,headport=w];
54 -> 55 [xlabel="",tailport=e];
55 -> 56 [xlabel=1
55 -> 58 [xlabel=1
,arrowhead=onone
,headport=w];
55 -> 70 [xlabel=1
,arrowhead=onone
,headport=w];
56 -> 57 [xlabel="",tailport=e];
57 -> 165 [xlabel=1
57 -> 64 [xlabel=1
,arrowhead=onone
,headport=w];
57 -> 155 [xlabel=1
,arrowhead=onone
,headport=w];
58 -> 59 [xlabel="",tailport=e];
59 -> 60 [xlabel=1
,arrowhead=onone
,headport=w];
59 -> 62 [xlabel=1
,arrowhead=onone
,headport=w];
59 -> 74 [xlabel=1
,arrowhead=onone
,headport=w];
60 -> 61 [xlabel="",tailport=e];
61 -> 68 [xlabel=1
,arrowhead=onone
,headport=w];
61 -> 161 [xlabel=1
,arrowhead=onone
,headport=w];
62 -> 63 [xlabel="",tailport=e];
63 -> 64 [xlabel=1
,arrowhead=onone
,headport=w];
63 -> 66 [xlabel=1
,arrowhead=onone
,headport=w];
64 -> 65 [xlabel="",tailport=e];
66 -> 67 [xlabel="",tailport=e];
68 -> 69 [xlabel="",tailport=e];
69 -> 163 [xlabel=1
65 -> 157 [xlabel=1
,arrowhead=onone
,headport=w];
67 -> 68 [xlabel="",tailport=e];
69 -> 67 [xlabel=1
,arrowhead=onone
,headport=w];
69 -> 71 [xlabel=1
,arrowhead=onone
,headport=w];
69 -> 73 [xlabel=1
,arrowhead=onone
,headport=w];
70 -> 69 [xlabel="",tailport=e];
71 -> 72 [xlabel="",tailport=e];
73 -> 71 [xlabel=1
,arrowhead=onone
,headport=w];
73 -> 75 [xlabel=1
,arrowhead=onone
,headport=w];
73 -> 77 [xlabel=1
,arrowhead=onone
,headport=w];
74 -> 73 [xlabel="",tailport=e];
73 -> 74 [xlabel="",tailport=e];
75 -> 76 [xlabel="",tailport=e];
77 -> 78 [xlabel="",tailport=e];
79 -> 80 [xlabel="",tailport=e];
80 -> 82 [xlabel=1
76 -> 78 [xlabel=1
,arrowhead=onone
,headport=w];
78 -> 79 [xlabel="",tailport=e];
79 -> 80 [xlabel=1
,arrowhead=onone
,headport=w];
82 -> 83 [xlabel="",tailport=e];
83 -> 84 [xlabel=1
83 -> 86 [xlabel=1
,arrowhead=onone
,headport=w];
83 -> 88 [xlabel=1
,arrowhead=onone
,headport=w];
86 -> 87 [xlabel="",tailport=e];
87 -> 90 [xlabel=1
88 -> 89 [xlabel="",tailport=e];
89 -> 90 [xlabel=1
,arrowhead=onone
,headport=w];
87 -> 92 [xlabel=1
89 -> 92 [xlabel=1
,arrowhead=onone
,headport=w];
90 -> 91 [xlabel="",tailport=e];
92 -> 93 [xlabel="",tailport=e];
93 -> 94 [xlabel=1
,arrowhead=onone
,headport=w];
93 -> 96 [xlabel=1
,arrowhead=onone
,headport=w];
94 -> 95 [xlabel="",tailport=e];
96 -> 97 [xlabel="",tailport=e];
95 -> 98 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 98 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 100 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
95 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
98 -> 99 [xlabel="",tailport=e];
99 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
99 -> 102 [xlabel=1
,arrowhead=onone
,headport=w];
99 -> 104 [xlabel=1
,arrowhead=onone
,headport=w];
99 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
99 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
99 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
100 -> 101 [xlabel=""
,tailport=e];
101 -> 149 [xlabel=1
,arrowhead=onone
,headport=w];
102 -> 103 [xlabel=""
,tailport=e];
104 -> 105 [xlabel=""
,tailport=e];
105 -> 153 [xlabel=1
105 -> 106 [xlabel=1
,arrowhead=onone
,headport=w];
106 -> 107 [xlabel=""
,tailport=e];
108 -> 109 [xlabel=""
,tailport=e];
109 -> 110 [xlabel=1
109 -> 111 [xlabel=1
,arrowhead=onone
,headport=w];
110 -> 111 [xlabel=""
111 -> 112 [xlabel=""
,tailport=e];
112 -> 113 [xlabel=""
113 -> 114 [xlabel=""
,tailport=e];
113 -> 115 [xlabel=1
,arrowhead=onone
,headport=w];
115 -> 116 [xlabel=""
116 -> 117 [xlabel=""
,tailport=e];
117 -> 118 [xlabel=""
122 -> 123 [xlabel=""
,tailport=e];
120 -> 121 [xlabel=""
132 -> 133 [xlabel=""
,tailport=e];
126 -> 127 [xlabel=""
135 -> 136 [xlabel=""
,tailport=e];
136 -> 137 [xlabel=""
137 -> 138 [xlabel=""
,tailport=e];
139 -> 140 [xlabel=""
,tailport=e];
141 -> 142 [xlabel=""
,tailport=e];
143 -> 144 [xlabel=""
,tailport=e];
144 -> 147 [xlabel=1
140 -> 143 [xlabel=1
,arrowhead=onone
,headport=w];
147 -> 148 [xlabel=""
143 -> 144 [xlabel=""
,tailport=e];
155 -> 156 [xlabel=""
151 -> 152 [xlabel=""
,tailport=e];
156 -> 157 [xlabel=1
152 -> 153 [xlabel=1
,arrowhead=onone
,headport=w];
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -12
View File
@@ -54,8 +54,6 @@ itemCombinations =
, po [HELD PISTOL, CRAFT SPRING] autoPistol
, po [HELD AUTOPISTOL, cr PLANK] smg
, po [HELD AUTOPISTOL, cr SPRING] machinePistol
, po [HELD (BANGSTICK 1), cr CAN] revolver
, po [HELD REVOLVER, cr SPRING] $ revolverX 1
, po [cr CAN, cr HARDWARE] bangCone
, po [HELD BANGCONE, cr PLANK] blunderbuss
, po [HELD BLUNDERBUSS, cr STEELDRUM] (grapeCannon 1)
@@ -107,7 +105,6 @@ itemCombinations =
]
++ 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 [hd (REVOLVERX i), cr CAN] $ revolverX (i + 1)) [1 .. 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 (GRAPECANNON i), cr STEELDRUM] $ grapeCannon (i + 1)) [1, 2, 3]
@@ -210,13 +207,7 @@ moduleCombinations =
[ amod [cr MICROCHIP, cr TRANSMITTER] LAUNCHHOME
]
)
,
( ModBattery
, batteryGuns
,
[ amod [cr BATTERY] EXTRABATTERY
]
)
]
where
amod = (,)
@@ -241,14 +232,12 @@ bulletWeapons :: [Item]
bulletWeapons =
[bangStick i | i <- [1 .. 9]]
++ [volleyGun i | i <- [3 .. 6]]
++ [revolverX i | i <- [1 .. 5]]
++ [miniGunX i | i <- [3 .. 16]]
++ [grapeCannon i | i <- [1, 2, 3, 4]]
++ [ pistol
, autoPistol
, smg
, machinePistol
, revolver
, rifle
, repeater
, autoRifle
-1
View File
@@ -44,7 +44,6 @@ bulletCombinations = filter
maxShowX :: ItemBaseType -> Maybe Int
maxShowX bt = case bt of
HELD (BANGSTICK _) -> Just 2
HELD (REVOLVERX _) -> Just 1
HELD (VOLLEYGUN _) -> Just 3
HELD (MINIGUNX _) -> Just 3
HELD (GRAPECANNON _) -> Just 1
-1
View File
@@ -32,7 +32,6 @@ moduleModification imt = case imt of
. (itParams . subParams ?~ teslaParams)
WEPTELE -> makeDirectedTele
LAUNCHHOME -> itUse . heldConsumption . laAmmoType . amPjCreation .~ CreateTrackingShell
EXTRABATTERY -> itUse . heldConsumption . laSource . _InternalSource . iaMax +~ 1000
ATTACHTORCH -> id
where
makeDirectedTele it =
+1 -1
View File
@@ -100,7 +100,7 @@ useItemLeftClick cr w = fromMaybe w $ do
invid <- cr ^? crManipulation . manObject . inInventory . ispItem
ituse <- cr ^? crInv . ix invid . itUse
case ituse of
HeldUse{} -> return $ hammerTest (cWorld . lWorld . creatures . ix (_crID cr) %~ crUpdateLoadSource)
HeldUse{} -> return $ hammerTest (cWorld . lWorld . creatures . ix (_crID cr) %~ crReload)
ConsumeUse{} -> return $ useItemRightClick cr w
EquipUse{} -> return $ useItemRightClick cr w
LeftUse{} -> return $ useItemRightClick cr w
+1 -1
View File
@@ -174,7 +174,7 @@ reloadOverride :: Creature -> Creature
reloadOverride cr = fromMaybe cr $ do
guard $ cr ^. crStance . posture == Aiming
itRef <- cr ^? crManipulation . manObject . inInventory . ispItem
guard $ cr ^? crInv . ix itRef . itUse . heldConsumption . laSource . _InternalSource . iaLoaded == Just 0
guard $ cr ^? crInv . ix (itRef + 1) . itUse . attachParams . ammoAttachParams . iaLoaded == Just 0
return $ cr & crActionPlan . apStrategy .~ StrategyActions Reload reloadActions
where
reloadActions =
+3 -15
View File
@@ -38,24 +38,12 @@ crIsReloading cr = case cr ^? crManipulation . manObject . inInventory . iselAct
Just ReloadAction{} -> True
_ -> False
-- Assumes the ammotype below the selected item is correct
crWeaponReady :: Creature -> Bool
crWeaponReady cr = fromMaybe False $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
asource <- cr ^? crInv . ix i . itUse . heldConsumption . laSource
case asource of
InternalSource ia -> return (_iaLoaded ia > 0 && _iaPrimed ia)
AboveSource -> do
x <- cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount
return (x > 0)
BelowSource -> do
x <- cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount
return (x > 0)
EitherSource -> return $
justIsPositive (cr ^? crInv . ix (i - 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
|| justIsPositive (cr ^? crInv . ix (i + 1) . itUse . equipEffect . eeUse . euseAmmoAmount)
where
justIsPositive Nothing = False
justIsPositive (Just x) = x > 0
x <- cr ^? crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
return (x > 0)
crCanSeeCr :: Creature -> (World, Creature) -> Bool
crCanSeeCr tcr (w, cr) = hasLOS (_crPos cr) (_crPos tcr) w
-3
View File
@@ -157,8 +157,6 @@ data LeftItemType
data HeldItemType
= BANGSTICK {_xNum :: Int}
| PISTOL
| REVOLVER
| REVOLVERX {_xNum :: Int}
| MACHINEPISTOL
| AUTOPISTOL
| SMG
@@ -215,7 +213,6 @@ data ItemModuleType
| STATICLAS
| WEPTELE
| LAUNCHHOME
| EXTRABATTERY
| ATTACHTORCH
deriving (Eq, Ord, Show, Read) --Generic, Flat)
-1
View File
@@ -20,7 +20,6 @@ import Dodge.Data.Item.Use.Consumption.LoadAction
data HeldConsumption
= LoadableAmmo
{ _laAmmoType :: AmmoType
, _laSource :: AmmoSource
, _laSourceType :: AmmoSourceType
}
| NoConsumption
@@ -9,14 +9,6 @@ defaultLoadable :: HeldConsumption
defaultLoadable =
LoadableAmmo
{ _laAmmoType = GenericAmmo
, _laSource =
InternalSource InternalAmmo
{ _iaMax = 15
, _iaLoaded = 0
, _iaPrimed = True
, _iaCycle = [loadEject 10, loadInsert 10, loadPrime 10]
, _iaProgress = Nothing
}
, _laSourceType = BulletSource
}
+18 -16
View File
@@ -32,7 +32,8 @@ useE eo = case eo of
EonWristShield -> onEquipWristShield
EoffWristShield -> onRemoveWristShield
EFuelSource 0 _ -> const . const id
EFuelSource{} -> trySiphonFuel
--EFuelSource{} -> trySiphonFuel
EFuelSource{} -> const . const id
EBatterySource{} -> tryChargeBattery
EAmmoSource{} -> tryAttachBulletBelt
@@ -43,21 +44,22 @@ tryChargeBattery :: Item -> Creature -> World -> World
tryChargeBattery _ _ w = w
trySiphonFuel :: Item -> Creature -> World -> World
trySiphonFuel itm cr w = fromMaybe w $ do
eix <- itm ^? itLocation . ipInvID
hix <- cr ^? crManipulation . manObject . inInventory . ispItem
guard (cr ^? crManipulation . manObject . inInventory . iselAction == Just NoInvSelAction)
la <- cr ^? crInv . ix hix . itUse . heldConsumption
atype <- la ^? laAmmoType
guard (isGas atype)
amax <- la ^? laSource . _InternalSource . iaMax
acur <- la ^? laSource . _InternalSource . iaLoaded
guard (amax > acur)
return $
w & cWorld . lWorld . creatures . ix (_crID cr) . crInv
%~ ( (ix hix . itUse . heldConsumption . laSource . _InternalSource . iaLoaded +~ 1)
. (ix eix . itUse . equipEffect . eeUse . euseFuelAmount -~ 1)
)
trySiphonFuel itm cr = id
--trySiphonFuel itm cr w = fromMaybe w $ do
-- eix <- itm ^? itLocation . ipInvID
-- hix <- cr ^? crManipulation . manObject . inInventory . ispItem
-- guard (cr ^? crManipulation . manObject . inInventory . iselAction == Just NoInvSelAction)
-- la <- cr ^? crInv . ix hix . itUse . heldConsumption
-- atype <- la ^? laAmmoType
-- guard (isGas atype)
-- amax <- la ^? laSource . _InternalSource . iaMax
-- acur <- la ^? laSource . _InternalSource . iaLoaded
-- guard (amax > acur)
-- return $
-- w & cWorld . lWorld . creatures . ix (_crID cr) . crInv
-- %~ ( (ix hix . itUse . heldConsumption . laSource . _InternalSource . iaLoaded +~ 1)
-- . (ix eix . itUse . equipEffect . eeUse . euseFuelAmount -~ 1)
-- )
isGas :: AmmoType -> Bool
isGas a = case a of
+6 -6
View File
@@ -83,10 +83,10 @@ useMod hm = case hm of
[ useAmmoAmount 1
, withItem $ \it ->
duplicateNumBarrels
( min
(it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
-- ( min
-- (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded)
(it ^?! itParams . lasCycle `div` lasWideRate)
)
-- )
, withItem $ \it -> withCrPos $ flareCircleAt (_lasColor $ _itParams it) 0.8
, withItem $ \it -> withTempLight 1 100 (xyzV4 (_lasColor $ _itParams it))
, withSoundForI tone440sawtoothquietS 2
@@ -485,9 +485,9 @@ fireRemoteShell it cr w =
j = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
caneStickSoundChoice :: Item -> SoundID
caneStickSoundChoice it
| (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded) < 2 = tap3S
| otherwise = shotgunS
caneStickSoundChoice it = tap3S
-- -- | (it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded) < 2 = tap3S
-- -- | otherwise = shotgunS
bangStickSoundChoice :: Item -> SoundID
bangStickSoundChoice = caneStickSoundChoice
+44 -31
View File
@@ -81,7 +81,13 @@ itemBaseName it = case _iyBase $ _itType it of
LEFT lit -> show lit
EQUIP eit -> showEquipItem eit
CONSUMABLE cit -> show cit
ATTACH ait -> show ait
ATTACH ait -> showAttachItem ait
showAttachItem :: AttachType -> String
showAttachItem at = case at of
SCROLLATTACH x -> show x
AMMOATTACH x -> show x
TARGETATTACH x -> show x
showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
@@ -111,60 +117,67 @@ showAutoRechargeProgress lc = case lc of
itemNumberDisplay :: Creature -> Item -> [String]
itemNumberDisplay cr itm = case iu of
HeldUse{} -> [showReloadProgress cr itm]
--HeldUse{} -> [showReloadProgress cr itm]
HeldUse{} -> []
LeftUse{} -> [showAutoRechargeProgress (_leftConsumption iu)]
EquipUse{} -> showEquipmentNumber cr itm
CraftUse x -> [show $ x ^. getItAmount]
ConsumeUse {_useAmount = x} -> [show $ x ^. getItAmount]
AttachUse {} -> []
AttachUse {} -> [showReloadProgress cr itm]
-- this could be cleaner here...
where
iu = itm ^?! itUse
showEquipmentNumber :: Creature -> Item -> [String]
showEquipmentNumber cr itm = case _eeUse ee of
EFuelSource x _ -> [show x]
EAmmoSource{} -> showAmmoSource cr itm
EAmmoSource{_euseAmmoAmount = x} -> [show x]--showAmmoSource cr itm
EBatterySource{_euseBatteryAmount = x} -> [show x]
_ -> [""]
where
ee = itm ^?! itUse . equipEffect
showAmmoSource :: Creature -> Item -> [String]
showAmmoSource cr itm = fromMaybe ["FAIL"] $ do
eu <- itm ^? itUse . equipEffect . eeUse
atype <- eu ^? euseAmmoSourceType
x <- fmap showIntKMG' $ eu ^? euseAmmoAmount
i <- itm ^? itLocation . ipInvID
( do
at' <- cr ^? crInv . ix (i + 1) . itUse . heldConsumption . laSourceType
as <- cr ^? crInv . ix (i + 1) . itUse . heldConsumption . laSource
guard (at' == atype && as == AboveSource)
return ["vvvv", x]
)
<|> Just [x]
--showAmmoSource :: Creature -> Item -> [String]
--showAmmoSource cr itm = fromMaybe ["FAIL"] $ do
-- eu <- itm ^? itUse . equipEffect . eeUse
-- atype <- eu ^? euseAmmoSourceType
-- x <- fmap showIntKMG' $ eu ^? euseAmmoAmount
-- i <- itm ^? itLocation . ipInvID
-- ( do
-- at' <- cr ^? crInv . ix (i + 1) . itUse . heldConsumption . laSourceType
-- as <- cr ^? crInv . ix (i + 1) . itUse . heldConsumption . laSource
-- guard (at' == atype && as == AboveSource)
-- return ["vvvv", x]
-- )
-- <|> Just [x]
showReloadProgress :: Creature -> Item -> String
showReloadProgress cr itm = case ic ^? laSource of
Just (InternalSource ia) -> case ia ^? iaProgress . _Just . ix 0 of
Nothing -> maybe "" show $ ic ^? laSource . _InternalSource . iaLoaded
Just la -> showLoadActionType la (_laSource ic)
Just AboveSource -> fromMaybe "^^^^" $ do
i <- fmap (subtract 1) $ itm ^? itLocation . ipInvID
_ <- cr ^? crInv . ix i . itUse . equipEffect . eeUse . euseAmmoAmount
return ""
_ -> ""
where
ic = itm ^?! itUse . heldConsumption
showReloadProgress cr itm = fromMaybe [] $ do
ia <- itm ^? itUse . attachParams . ammoAttachParams
return $ case ia ^? iaProgress . _Just . ix 0 of
Nothing -> maybe "" show $ ia ^? iaLoaded
Just la -> showLoadActionType la ia
--showReloadProgress :: Creature -> Item -> String
--showReloadProgress cr itm = case ic ^? laSource of
-- Just (InternalSource ia) -> case ia ^? iaProgress . _Just . ix 0 of
-- Nothing -> maybe "" show $ ic ^? laSource . _InternalSource . iaLoaded
-- Just la -> showLoadActionType la (_laSource ic)
-- Just AboveSource -> fromMaybe "^^^^" $ do
-- i <- fmap (subtract 1) $ itm ^? itLocation . ipInvID
-- _ <- cr ^? crInv . ix i . itUse . equipEffect . eeUse . euseAmmoAmount
-- return ""
-- _ -> ""
-- where
-- ic = itm ^?! itUse . heldConsumption
showLoadActionType :: LoadAction -> AmmoSource -> String
showLoadActionType :: LoadAction -> InternalAmmo -> String
showLoadActionType la as = case la of
LoadEject{} -> "E"
LoadInsert{} -> "L"
LoadAdd{} -> "A" ++ x
LoadPrime{} -> "P"
where
x = maybe "" show $ as ^? _InternalSource . iaLoaded
x = maybe "" show $ as ^? iaLoaded
maybeWarmupStatus :: Item -> Maybe String
maybeWarmupStatus it = case it ^? itUse . heldDelay . warmMax of
+70 -69
View File
@@ -71,8 +71,6 @@ ammoPosition itm hit = case hit of
TORCH -> NoAmmoPosition
BANGSTICK i -> bangStickAmmoPos i itm
PISTOL -> Magazine (V3 5 2 0) lhs
REVOLVER -> revolverAmmoPos
REVOLVERX _ -> revolverAmmoPos
MACHINEPISTOL -> Magazine (V3 5 2 0) lhs
AUTOPISTOL -> Magazine (V3 5 2 0) lhs
SMG -> Magazine (V3 7 (-2) 0) rhs
@@ -137,23 +135,21 @@ multigunAmmoPos i =
where
f n = fromIntegral n * 5 - ((fromIntegral i - 1) * 2.5)
revolverAmmoPos :: AmmoPosition
revolverAmmoPos =
Bullets
[(V3 5 0 1 + Q.rotate q (V3 0 0 2), q) | q <- qs]
where
qs = [Q.axisAngle (V3 1 0 0) (f i) | i <- [1 .. 6 :: Int]]
f i = fromIntegral i * pi / 3 + pi / 6
--revolverAmmoPos :: AmmoPosition
--revolverAmmoPos =
-- Bullets
-- [(V3 5 0 1 + Q.rotate q (V3 0 0 2), q) | q <- qs]
-- where
-- qs = [Q.axisAngle (V3 1 0 0) (f i) | i <- [1 .. 6 :: Int]]
-- f i = fromIntegral i * pi / 3 + pi / 6
heldItemSPic :: HeldItemType -> Item -> SPic
heldItemSPic ht it = case ht of
FLATSHIELD -> flatShieldEquipSPic
FORCEFIELDGUN -> defSPic
TORCH -> noPic torchShape
BANGSTICK i -> noPic $ baseStickShapeX it i <> addBullets it
BANGSTICK i -> noPic $ baseStickShapeX it i -- <> addBullets it
PISTOL -> noPic $ baseStickShape <> addTinClip it
REVOLVER -> noPic $ baseStickShape <> addBullets it
REVOLVERX _ -> noPic $ baseStickShape <> addBullets it
MACHINEPISTOL -> noPic $ baseStickShape <> addTinClip it
AUTOPISTOL -> noPic $ baseStickShape <> addTinClip it
SMG -> noPic $ baseSMGShape <> addTinClip it
@@ -161,17 +157,17 @@ heldItemSPic ht it = case ht of
BLUNDERBUSS -> noPic $ bangConeShape 20
GRAPECANNON _ -> noPic $ bangConeShape 20
MINIGUNX i -> miniGunXPictItem i it
VOLLEYGUN i -> noPic $ volleyGunShape i <> addBullets it
MULTIGUN i -> noPic $ volleyGunShape i <> addBullets it
RIFLE -> noPic $ baseRifleShape <> addBullets it
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
MULTIGUN i -> noPic $ volleyGunShape i -- <> addBullets it
RIFLE -> noPic $ baseRifleShape -- <> addBullets it
REPEATER -> noPic $ baseRifleShape <> addTinClip it
AUTORIFLE -> noPic $ baseRifleShape <> addTinClip it
BURSTRIFLE -> noPic $ baseRifleShape <> addTinClip it
BANGROD -> noPic $ baseRodShape <> addBullets it
ELEPHANTGUN -> noPic $ baseAMRShape <> addBullets it
BANGROD -> noPic $ baseRodShape -- <> addBullets it
ELEPHANTGUN -> noPic $ baseAMRShape -- <> addBullets it
AMR -> noPic $ baseAMRShape <> addTinClip it
AUTOAMR -> noPic $ baseAMRShape <> addTinClip it
SNIPERRIFLE -> noPic $ baseAMRShape <> addBullets it
SNIPERRIFLE -> noPic $ baseAMRShape -- <> addBullets it
MACHINEGUN -> noPic $ baseAMRShape <> addTinClip it
FLAMESPITTER -> flamerPic it
FLAMETHROWER -> flamerPic it
@@ -251,12 +247,12 @@ baseRifleShape :: Shape
--baseRifleShape = colorSH red $ xCylinder 4 2 25
baseRifleShape = colorSH red $ xCylinderST 3 25
addBullets :: Item -> Shape
addBullets itm = fromMaybe mempty $ do
x <- itm ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
hit <- itm ^? itType . iyBase . ibtHeld
ps <- fmap (take x) $ ammoPosition itm hit ^? amPosDirs
return $ foldMap (uncurry (drawBullet itm)) ps
--addBullets :: Item -> Shape
--addBullets itm = fromMaybe mempty $ do
-- x <- itm ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
-- hit <- itm ^? itType . iyBase . ibtHeld
-- ps <- fmap (take x) $ ammoPosition itm hit ^? amPosDirs
-- return $ foldMap (uncurry (drawBullet itm)) ps
-- why is this duplicated?
drawBullet :: Item -> Point3 -> Q.Quaternion Float -> Shape
@@ -293,47 +289,49 @@ drawBullet itm p q =
rectNSWE 0.2 (- 0.2) (-2) (-1)
addTinClip :: Item -> Shape
addTinClip itm = fromMaybe mempty $ do
hit <- itm ^? itType . iyBase . ibtHeld
let ap = ammoPosition itm hit
p <- ap ^? amposPos
d <- ap ^? amposDir
return $ translateSH p $ overPosSH (Q.rotate d) $ makeTinClip itm
makeTinClip :: Item -> Shape
makeTinClip it =
colorSH
midcol
( upperPrismPolyTS
1
( reverse $
rectNSWE 0 (- y) (-1) 1
)
)
<> tips
<> tails
where
midcol =
maybe
black
bulletEffectColor
(it ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
y = fromIntegral y' * 0.3
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
tips = fromMaybe mempty $ do
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
return $
colorSH (bulletPayloadColor ebt) $
upperPrismPolyTS 1.1 $
reverse $
rectNSWE 0 (- y) 1 2
tails = fromMaybe mempty $ do
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buTrajectory
return $
colorSH (bulletTrajColor ebt) $
upperPrismPolyTS 1.1 $
reverse $
rectNSWE 0 (- y) (-2) (-1)
addTinClip _ = mempty
--addTinClip :: Item -> Shape
--addTinClip itm = fromMaybe mempty $ do
-- hit <- itm ^? itType . iyBase . ibtHeld
-- let ap = ammoPosition itm hit
-- p <- ap ^? amposPos
-- d <- ap ^? amposDir
-- return $ translateSH p $ overPosSH (Q.rotate d) $ makeTinClip itm
--
--makeTinClip :: Item -> Shape
--makeTinClip it =
-- colorSH
-- midcol
-- ( upperPrismPolyTS
-- 1
-- ( reverse $
-- rectNSWE 0 (- y) (-1) 1
-- )
-- )
-- <> tips
-- <> tails
-- where
-- midcol =
-- maybe
-- black
-- bulletEffectColor
-- (it ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
-- y = fromIntegral y' * 0.3
-- y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
-- tips = fromMaybe mempty $ do
-- ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
-- return $
-- colorSH (bulletPayloadColor ebt) $
-- upperPrismPolyTS 1.1 $
-- reverse $
-- rectNSWE 0 (- y) 1 2
-- tails = fromMaybe mempty $ do
-- ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buTrajectory
-- return $
-- colorSH (bulletTrajColor ebt) $
-- upperPrismPolyTS 1.1 $
-- reverse $
-- rectNSWE 0 (- y) (-2) (-1)
bulletEffectColor :: BulletEffect -> Color
bulletEffectColor x = case x of
@@ -410,14 +408,15 @@ flamerPic it =
( colorSH yellow $
translateSHxy tx ty (upperPrismPolyST tz $ polyCirc 3 r)
<> xCylinderST 5 18
, color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * am)
--, color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * am)
, color black $ translate3 (V3 tx ty (tz + 0.01)) $ circleSolid (r * 0.5)
)
where
tx = 4
ty = - 6
tz = 3
r = 5
am = fractionLoadedAmmo2 it
-- am = fractionLoadedAmmo2 it
launcherPic :: Item -> SPic
launcherPic _ = noPic . colorSH cyan $ xCylinderST 5 20
@@ -454,7 +453,8 @@ lasGunPic it =
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0
)
where
amFrac = fractionLoadedAmmo it
--amFrac = fractionLoadedAmmo it
amFrac = 0.5
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
dualBeamPic :: Item -> SPic
@@ -466,7 +466,8 @@ dualBeamPic it =
, setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (- gap) (-1)
)
where
amFrac = fractionLoadedAmmo it
--amFrac = fractionLoadedAmmo it
amFrac = 0.5
col = brightX 2 1.5 $ mixColors amFrac (1 - amFrac) green red
gap = _dbGap (_itParams it) - 3
-2
View File
@@ -29,8 +29,6 @@ itemFromHeldType ht = case ht of
SHATTERGUN -> shatterGun
BANGSTICK i -> bangStick i
PISTOL -> pistol
REVOLVER -> revolver
REVOLVERX i -> revolverX i
MACHINEPISTOL -> machinePistol
AUTOPISTOL -> autoPistol
SMG -> smg
-7
View File
@@ -21,8 +21,6 @@ sparkGun =
teslaGun :: Item
teslaGun =
defaultBatteryGun
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 200
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
& itDimension . dimRad .~ 9
& itDimension . dimCenter .~ V3 4 0 0
& itParams .~ teslaParams
@@ -40,8 +38,6 @@ lasGun =
defaultAutoBatteryGun
& itUse . heldConsumption
.~ ( defaultLoadable
& laSource . _InternalSource . iaMax .~ 200000
& laSource . _InternalSource . iaCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
)
& itParams
.~ Refracting
@@ -81,8 +77,6 @@ tractorGun =
lasGun
& itUse . heldConsumption
.~ ( defaultLoadable
& laSource . _InternalSource . iaMax .~ 10000
& laSource . _InternalSource . iaCycle .~ [loadEject 10, loadInsert 10, loadPrime 60]
)
& itParams .~ Attracting{_attractionPower = 1}
& itTweaks
@@ -137,7 +131,6 @@ lasCircle =
& itType . iyBase .~ HELD LASCIRCLE
& itParams . lasColor .~ orange
& itParams . lasDamage .~ 2
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 10000
& itUse . heldUse .~ HeldLaser --shootLaser
& itUse . heldDelay .~ NoDelay
& itUse . heldUse .~ HeldCircleLaser --circleLaser
-13
View File
@@ -34,8 +34,6 @@ defaultBangCane =
& itUse . heldAim . aimStance .~ OneHand
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
volleyGun :: Int -> Item
volleyGun i =
@@ -46,7 +44,6 @@ volleyGun i =
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
& itParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (VOLLEYGUN i)
@@ -59,7 +56,6 @@ multiGun i =
& itUse . heldAim . aimStance .~ TwoHandFlat
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 3]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
& itParams . torqueAfter .~ 0.15 + 0.05 * fromIntegral i
& itType . iyBase .~ HELD (MULTIGUN i)
@@ -68,9 +64,6 @@ rifle =
defaultBangCane
& itUse . heldAim . aimStance .~ TwoHandUnder
& itType . iyBase .~ HELD RIFLE
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle
.~ [loadEject 5, loadInsert 5, loadPrime 5]
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
@@ -82,8 +75,6 @@ repeater =
rifle
& itType . iyModules . at ModRifleMag ?~ EMPTYMODULE
& itType . iyBase .~ HELD REPEATER
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 20, loadInsert 20, loadPrime 20]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 15
autoRifle :: Item
autoRifle =
@@ -111,10 +102,6 @@ miniGunUse i =
& heldAim . aimRange .~ 1
& heldAim . aimStance .~ TwoHandUnder
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& heldConsumption
.~ (defaultBulletLoadable & laSource .~ AboveSource)
-- & heldConsumption . laSource . _InternalSource . iaCycle
-- .~ [loadEject 40, loadInsert 40, loadPrime 40]
miniGunX :: Int -> Item
miniGunX i =
-6
View File
@@ -27,14 +27,10 @@ bangCone =
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.5]
& itType . iyBase .~ HELD BANGCONE
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 5
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 20, loadPrime 5]
blunderbuss :: Item
blunderbuss =
bangCone
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 25
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 30, loadPrime 5]
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimWeight .~ 6
-- & itUse . heldAim . aimHandlePos .~ 5
@@ -45,8 +41,6 @@ grapeCannon :: Int -> Item
grapeCannon i =
blunderbuss
& itType . iyBase .~ HELD (GRAPECANNON i)
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 25 + 25 * i
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert (30 + i * 10), loadPrime 5]
& itParams . recoil .~ (150 + fromIntegral i * 50)
& itParams . torqueAfter .~ (0.1 + 0.2 * fromIntegral i)
& itParams . randomOffset .~ (12 + 4 * fromIntegral i)
-5
View File
@@ -39,9 +39,6 @@ launcher =
, _amPjDraw = DrawShell
, _amPjCreation = CreateShell
}
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaLoaded .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 30, loadInsert 30, loadPrime 10]
& itType . iyBase .~ HELD LAUNCHER
& itType . iyModules . at ModLauncherHoming ?~ EMPTYMODULE
@@ -49,8 +46,6 @@ launcherX :: Int -> Item
launcherX i =
launcher
& itType . iyBase .~ HELD (LAUNCHERX i)
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
& itUse . heldConsumption . laSource . _InternalSource . iaLoaded .~ i
& itUse . heldUse .~ HeldPJCreationX i
& itUse . heldMods .~ LauncherXMod i
-5
View File
@@ -30,8 +30,6 @@ bangRod =
& itUse . heldMods .~ BangRodMod
& itDimension . dimRad .~ 12
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 10, loadPrime 5]
& itType . iyBase .~ HELD BANGROD
& itUse . heldAim . aimWeight .~ 8
& itUse . heldAim . aimRange .~ 1
@@ -54,7 +52,6 @@ amr :: Item
amr =
elephantGun
& itType . iyBase .~ HELD AMR
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 15
autoAmr :: Item
autoAmr =
@@ -80,7 +77,5 @@ machineGun =
& itUse . heldAim . aimStance .~ TwoHandUnder
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldDelay .~ VariableRate{_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 100
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 10, loadInsert 40, loadPrime 10]
& itInvSize .~ 3
& itParams . torqueAfter .~ 0.2 -- not sure if this is necessary?
-4
View File
@@ -28,8 +28,6 @@ flameSpitter :: Item
flameSpitter =
flameThrower
& itType . iyBase .~ HELD FLAMESPITTER
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 10
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 10, loadPrime 20]
& itParams . sprayNozzles . ix 0 . nzPressure .~ 4
& itUse . heldAim . aimStance .~ OneHand
& itUse . heldDelay .~ FixedRate{_rateMax = 12, _rateTime = 0}
@@ -96,12 +94,10 @@ flameThrower =
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 18 0) 0 0]
& itUse . heldConsumption
.~ ( defaultLoadable
& laSource . _InternalSource . iaMax .~ 250
& laAmmoType
.~ GasAmmo
{ _amString = "FLAME"
, _amCreateGas = CreateFlame --aFlame
}
& laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 10, loadPrime 20]
)
& itType . iyBase .~ HELD FLAMETHROWER
-23
View File
@@ -4,8 +4,6 @@ module Dodge.Item.Held.Stick (
autoPistol,
machinePistol,
smg,
revolver,
revolverX,
) where
import Dodge.Base
@@ -34,28 +32,15 @@ bangStick i =
& itUse . heldDelay . rateMax .~ 8
& itUse . heldMods .~ BangStickMod
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 | a <- spreadAroundCenter i baseStickSpread]
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
baseStickSpread :: Float
baseStickSpread = 0.2
revolver :: Item
revolver =
pistol
& itUse . heldConsumption
.~ ( defaultBulletLoadable
& laSource . _InternalSource . iaMax .~ 6
& laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
)
& itType . iyBase .~ HELD REVOLVER
pistol :: Item
pistol =
bangStick 1
& itUse . heldConsumption
.~ ( defaultBulletLoadable
& laSource .~ BelowSource
)
& itUse . heldDelay . rateMax .~ 6
& itUse . heldMods .~ PistolMod
@@ -94,11 +79,3 @@ smg =
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 20 0) 0 0]
-- & itUse . heldAim . aimHandlePos .~ 2
& itParams . torqueAfter .~ 0.05
revolverX :: Int -> Item
revolverX i =
revolver
& itUse . heldDelay . rateMax .~ 8
& itUse . heldMods .~ RevolverXMod
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i * 6
& itType . iyBase .~ HELD (REVOLVERX i)
-2
View File
@@ -63,8 +63,6 @@ heldInfo hit = case hit of
BANGSTICK 1 -> "A firearm with a short barrel that requires reloading after each shot."
BANGSTICK i -> over _head toUpper (showInt i) ++ " small gun barrels strapped together. Each barrel must be individually loaded, but not all need be loaded for the weapon to fire. All loaded barrels discharge simultaneously, with significant spread."
PISTOL -> "A small firearm fed by a magazine. The entire magazine must be replaced when reloading the weapon."
REVOLVER -> "A small firearm fed by a revolving cylinder. Single shot and load."
REVOLVERX i -> "A small firearm fed by " ++ showInt i ++ "revolving cylinders."
MACHINEPISTOL -> "A small firearm automatically, and extremely rapidly, fed by a magazine. The entire magazine must be replaced when reloading the weapon."
AUTOPISTOL -> "A small firearm automatically fed by a magazine. The entire magazine must be replaced when reloading the weapon."
SMG -> "A small firearm with an attached stock for stability."
-2
View File
@@ -28,8 +28,6 @@ heldBounds :: HeldItemType -> Point3
heldBounds hit = case hit of
BANGSTICK _ -> V3 0 0 0
PISTOL -> bss
REVOLVER -> bss
REVOLVERX _ -> bss
MACHINEPISTOL -> bss
AUTOPISTOL -> bss
SMG -> smgs
-1
View File
@@ -17,7 +17,6 @@ droneLauncher =
& itUse . heldAim . aimRange .~ 0.5
& itUse . heldAim . aimStance .~ TwoHandOver
& itUse . heldConsumption . laAmmoType .~ DroneAmmo{_amString = "LASDRONE"}
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 2
& itType . iyBase .~ HELD DRONELAUNCHER
lasDronesPic :: Item -> SPic
+19 -19
View File
@@ -1,26 +1,26 @@
module Dodge.Item.Weapon.FractionLoaded (
fractionLoadedAmmo,
fractionLoadedAmmo2,
-- fractionLoadedAmmo,
-- fractionLoadedAmmo2,
) where
import Control.Lens
import Data.Maybe
import Dodge.Data.Item
---- this shouldn't really be used
loadedAmmo :: Item -> Int
loadedAmmo itm = fromMaybe 0 $ itm ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
-- | _laTransfer (_itConsumption it) == NoTransfer = _laLoaded (_itConsumption it)
-- | otherwise = 0
fractionLoadedAmmo :: Item -> Float
fractionLoadedAmmo it = fromIntegral (loadedAmmo it) / fromIntegral itmaxammo
where
itmaxammo = fromMaybe 1 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaMax
fractionLoadedAmmo2 :: Item -> Float
fractionLoadedAmmo2 it =
1 - (1 - fromIntegral (loadedAmmo it) / fromIntegral itmaxammo) ** 2
where
itmaxammo = fromMaybe 1 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaMax
-- ---- this shouldn't really be used
-- loadedAmmo :: Item -> Int
-- loadedAmmo itm = fromMaybe 0 $ itm ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
--
-- -- | _laTransfer (_itConsumption it) == NoTransfer = _laLoaded (_itConsumption it)
-- -- | otherwise = 0
--
-- fractionLoadedAmmo :: Item -> Float
-- fractionLoadedAmmo it = fromIntegral (loadedAmmo it) / fromIntegral itmaxammo
-- where
-- itmaxammo = fromMaybe 1 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaMax
--
-- fractionLoadedAmmo2 :: Item -> Float
-- fractionLoadedAmmo2 it =
-- 1 - (1 - fromIntegral (loadedAmmo it) / fromIntegral itmaxammo) ** 2
-- where
-- itmaxammo = fromMaybe 1 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaMax
+20 -38
View File
@@ -140,23 +140,11 @@ withThickSmokeI eff item cr w =
-- TODO create a trigger that does different things on first and continued
-- fire.
ammoCheckI :: ChainEffect
ammoCheckI eff itm cr w = case itm ^? itUse . heldConsumption . laSource of
Just (InternalSource ia)
| _iaLoaded ia <= 0 || not (_iaPrimed ia) ->
failsound w
Just AboveSource
| fromMaybe True $ do
invid <- itm ^? itLocation . ipInvID
x <- cr ^? crInv . ix (invid - 1) . itUse . equipEffect . eeUse . euseAmmoAmount
return $ x <= 0 ->
failsound w
Just BelowSource
| fromMaybe True $ do
invid <- itm ^? itLocation . ipInvID
x <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
return $ x <= 0 ->
failsound w
_ -> eff itm cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
ammoCheckI eff itm cr w = fromMaybe (failsound w) $ do
invid <- itm ^? itLocation . ipInvID
x <- cr ^? crInv . ix (invid + 1) . itUse . attachParams . ammoAttachParams . iaLoaded
guard $ x > 0
return $ eff itm cr $ w & cWorld . lWorld . creatures . ix (_crID cr) %~ crCancelReloading
where
failsound = case w ^? input . mouseButtons . ix SDL.ButtonLeft of
Just 0 -> soundStart (CrReloadSound (_crID cr)) (_crPos cr) click1S Nothing
@@ -165,8 +153,8 @@ ammoCheckI eff itm cr w = case itm ^? itUse . heldConsumption . laSource of
itUseCharge :: Int -> Item -> Item
itUseCharge x = itUse . leftConsumption . arLoaded %~ (max 0 . subtract x)
itUseAmmo :: Int -> Item -> Item
itUseAmmo x = itUse . heldConsumption . laSource . _InternalSource . iaLoaded %~ (max 0 . subtract x)
--itUseAmmo :: Int -> Item -> Item
--itUseAmmo x = itUse . heldConsumption . laSource . _InternalSource . iaLoaded %~ (max 0 . subtract x)
{- | Fires at an increasing rate.
Has different effect after first fire.
@@ -183,7 +171,7 @@ rateIncAB exeffFirst exeffCont eff item cr w
w
& pointItem
%~ ( (itUse . heldDelay . rateMax .~ max fastRate (currentRate - 1))
. itUseAmmo 1
-- . itUseAmmo 1
. (itUse . heldDelay . rateTime .~ currentRate)
)
& exeffCont eff item cr
@@ -191,7 +179,7 @@ rateIncAB exeffFirst exeffCont eff item cr w
w
& pointItem
%~ ( (itUse . heldDelay . rateMax .~ startRate - 1)
. itUseAmmo 1
-- . itUseAmmo 1
. (itUse . heldDelay . rateTime .~ startRate)
)
& exeffFirst eff item cr
@@ -352,7 +340,7 @@ useAllAmmo eff item cr = fromMaybe id $ do
invid <- item ^? itLocation . ipInvID
return $ eff item cr
. (cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (invid + 1)
. itUse . heldConsumption . laSource . _InternalSource . iaLoaded .~ 0)
. itUse . attachParams . ammoAttachParams . iaLoaded .~ 0)
useAmmoUpTo :: Int -> ChainEffect
useAmmoUpTo amAmount eff itm cr = fromMaybe id $ do
@@ -370,18 +358,7 @@ useAmmoAmount amAmount eff item cr =
itref = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
useAmmoAmount' :: Int -> Int -> IM.IntMap Item -> IM.IntMap Item
useAmmoAmount' itref x inv = case inv ^? ix itref . itUse . heldConsumption . laSource of
Just InternalSource{} ->
inv & ix itref . itUse . heldConsumption . laSource . _InternalSource . iaLoaded -~ x
Just AboveSource ->
inv & ix (itref - 1) . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
Just BelowSource ->
inv & ix (itref + 1) . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
Just EitherSource -> case inv ^? ix (itref - 1) . itUse . equipEffect . eeUse . euseAmmoAmount of
Just amamount | amamount > 0 ->
inv & ix (itref - 1) . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
_ -> inv & ix (itref + 1) . itUse . equipEffect . eeUse . euseAmmoAmount -~ x
_ -> inv
useAmmoAmount' itref x inv = inv & ix (itref + 1) . itUse . attachParams . ammoAttachParams . iaLoaded -~ x
-- . crInv . ix itRef . itUse . heldConsumption . laSource
@@ -677,10 +654,12 @@ repeatOnFrames is hm f it cr w =
-- return $ f it cr' w'
duplicateLoaded :: ChainEffect
duplicateLoaded eff it cr w = foldr f w [1 .. numBul]
duplicateLoaded eff it cr w = foldr f w (take numbul [1 .. ])
where
f _ = eff it cr
numBul = it ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded
numbul = fromMaybe 0 $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoAttachParams . iaLoaded
duplicateNumBarrels :: Int -> ChainEffect
duplicateNumBarrels n eff itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim . aimMuzzles)
@@ -697,9 +676,12 @@ duplicateNumBarrels n eff itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim
(a,g) = randomR (-inacc,inacc) $ _randGen w'
duplicateLoadedBarrels :: ChainEffect
duplicateLoadedBarrels eff itm = duplicateNumBarrels numbul eff itm
duplicateLoadedBarrels eff itm cr = duplicateNumBarrels numbul eff itm cr
where
numbul = itm ^?! itUse . heldConsumption . laSource . _InternalSource . iaLoaded
numbul :: Int
numbul = fromMaybe 0 $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
cr ^? crInv . ix (i+1) . itUse . attachParams . ammoAttachParams . iaLoaded
duplicateOffsetsFocus :: [Float] -> ChainEffect
duplicateOffsetsFocus xs eff item cr w = foldr f w poss
-1
View File
@@ -37,7 +37,6 @@ moduleName imt = case imt of
STATICLAS -> Just "+STATIC"
WEPTELE -> Just "+DIRECTEDTELE"
LAUNCHHOME -> Just "+TARGET HOMING"
EXTRABATTERY -> Just "+BATTERY"
ATTACHTORCH -> Just "+TORCH"
+9 -10
View File
@@ -1,8 +1,7 @@
module Dodge.Reloading (
crCancelReloading,
crUpdateLoadSource,
crReload,
stepReloading,
tryStartLoading,
) where
import Control.Lens
@@ -18,7 +17,7 @@ crCancelReloading cr =
updateProgress = fromMaybe id $ do
InInventory (SelItem i _) <- cr ^? crManipulation . manObject
return $
crInv . ix i . itUse . heldConsumption . laSource . _InternalSource . iaProgress
crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams . iaProgress
%~ const Nothing
stepReloading :: Creature -> Creature
@@ -28,29 +27,29 @@ stepReloading cr = case cr ^? crManipulation . manObject . inInventory of
cr & crManipulation . manObject . inInventory . iselAction . actionProgress -~ 1
| otherwise ->
cr
& crInv . ix i . itUse . heldConsumption . laSource . _InternalSource %~ doLoadAction la
& crInv . ix i . itUse . heldConsumption . laSource . _InternalSource %~ rotateActionProgress
& crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams %~ doLoadAction la
& crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams %~ rotateActionProgress
& tryNextLoadAction
_ -> cr
tryNextLoadAction :: Creature -> Creature
tryNextLoadAction cr = case cr ^? crManipulation . manObject . inInventory of
Just (SelItem i _) -> case cr ^? crInv . ix i . itUse . heldConsumption . laSource . _InternalSource . iaProgress . _Just . ix 0 of
Just (SelItem i _) -> case cr ^? crInv . ix i . itUse . attachParams . ammoAttachParams . iaProgress . _Just . ix 0 of
Nothing -> cr & crManipulation . manObject . inInventory . iselAction .~ NoInvSelAction
Just la ->
cr & crManipulation . manObject . inInventory . iselAction . actionProgress .~ _actionTime la
& crManipulation . manObject . inInventory . iselAction . reloadAction .~ la
_ -> cr
crUpdateLoadSource :: Creature -> Creature
crUpdateLoadSource cr = case cr ^? crManipulation . manObject . inInventory . iselAction of
crReload :: Creature -> Creature
crReload cr = case cr ^? crManipulation . manObject . inInventory . iselAction of
Just NoInvSelAction -> cr & tryStartLoading
_ -> cr & crManipulation . manObject . inInventory . iselAction .~ NoInvSelAction
tryStartLoading :: Creature -> Creature
tryStartLoading cr = fromMaybe cr $ do
i <- cr ^? crManipulation . manObject . inInventory . ispItem
ia <- cr ^? crInv . ix i . itUse . heldConsumption . laSource . _InternalSource
ia <- cr ^? crInv . ix (i + 1) . itUse . attachParams . ammoAttachParams
return $ startLoading ia cr
-- case as of
@@ -67,7 +66,7 @@ startLoading ic cr = case ic ^? iaProgress . _Just . ix 0 of
i <- cr ^? crManipulation . manObject . inInventory . ispItem
return $
cr & startLoadingStep la
& crInv . ix i . itUse . heldConsumption . laSource . _InternalSource . iaProgress ?~ (la : las)
& crInv . ix i . itUse . attachParams . ammoAttachParams . iaProgress ?~ (la : las)
startLoadingStep :: LoadAction -> Creature -> Creature
startLoadingStep la cr = cr & crManipulation . manObject . inInventory . iselAction .~ ReloadAction (_actionTime la) la
+1 -1
View File
@@ -116,7 +116,7 @@ updateInitialPressInGame uv sc = case sc of
ScancodeP -> pauseGame uv
ScancodeF -> over uvWorld youDropItem uv
ScancodeM -> toggleMap uv
ScancodeR -> over (uvWorld . cWorld . lWorld . creatures . ix 0) crUpdateLoadSource uv
ScancodeR -> over (uvWorld . cWorld . lWorld . creatures . ix 0) crReload uv
ScancodeT -> over uvWorld testEvent uv
ScancodeX -> uv & uvWorld %~ toggleTweakInv
ScancodeC -> toggleCombineInv uv
+317 -319
View File
File diff suppressed because it is too large Load Diff