Add loading cycles to magazines

This commit is contained in:
2024-06-21 13:37:51 +01:00
parent 0a1b0386b9
commit 872e60438e
8 changed files with 367 additions and 370 deletions
+101 -115
View File
@@ -1,40 +1,3 @@
/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] /home/justin/Haskell/loop/src/Dodge/Item/Draw/SPic.hs:68:1-12: warning: [-Wunused-top-binds]
Defined but not used: ammoPosition Defined but not used: ammoPosition
| |
@@ -90,91 +53,21 @@
| |
448 | lasGunPic 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] /home/justin/Haskell/loop/src/Dodge/Item/Held/SprayGuns.hs:12:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant The import of Dodge.Reloading.Action is redundant
| |
12 | import Dodge.Reloading.Action 12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Held/Rod.hs:13:1-29: warning: [-Wunused-imports] /home/justin/Haskell/loop/src/Dodge/Item/Held/Launcher.hs:4:1-29: warning: [-Wunused-imports]
The import of Dodge.Reloading.Action is redundant The import of Dodge.Reloading.Action is redundant
| |
13 | import Dodge.Reloading.Action 4 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Item/Info.hs:(62,16)-(107,62): warning: [-Wincomplete-patterns] /home/justin/Haskell/loop/src/Dodge/Item/Held/Cone.hs:6:1-29: warning: [-Wunused-imports]
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 The import of Dodge.Reloading.Action is redundant
| |
14 | import Dodge.Reloading.Action 6 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:19-20: warning: [-Wunused-matches] /home/justin/Haskell/loop/src/Dodge/Base/You.hs:45:19-20: warning: [-Wunused-matches]
Defined but not used: cr Defined but not used: cr
| |
@@ -195,6 +88,99 @@
| |
12 | import Dodge.Reloading.Action 12 | import Dodge.Reloading.Action
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/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/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/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/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/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/Item.hs:(29,25)-(34,40): warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: AMMOATTACH REVOLVEMAG
|
29 | itemFromAttachType at = case at of
| ^^^^^^^^^^...
/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/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/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/Default/Item/Use/Consumption.hs:6:1-29: warning: [-Wunused-imports] /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 The import of Dodge.Reloading.Action is redundant
| |
+1 -1
View File
@@ -22,7 +22,7 @@ digraph {
28 [shape=box 28 [shape=box
,label="EQUIP {_ibtEquip = TARGETINGHAT TargetCursor}"]; ,label="EQUIP {_ibtEquip = TARGETINGHAT TargetCursor}"];
31 [shape=box 31 [shape=box
,label="ATTACH {_ibtAttach = AMMOATTACH TINMAG}"]; ,label="ATTACH {_ibtAttach = AMMOATTACH REVOLVEMAG}"];
35 [shape=box 35 [shape=box
,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"]; ,label="HELD {_ibtHeld = BANGSTICK {_xNum = 1}}"];
39 [shape=box 39 [shape=box
+2 -1
View File
@@ -38,7 +38,8 @@ hatCombinations =
magazineCombinations :: [([(ItAmount,ItemBaseType)],Item)] magazineCombinations :: [([(ItAmount,ItemBaseType)],Item)]
magazineCombinations = magazineCombinations =
[ po [CRAFT TIN, CRAFT SPRING] tinMag ] [ po [CRAFT TIN, CRAFT SPRING] tinMag
]
where where
po xs it = (map o xs, it) po xs it = (map o xs, it)
o = (1,) o = (1,)
+2 -1
View File
@@ -107,7 +107,8 @@ data ScrollAttachType
deriving (Eq, Ord, Show, Read) deriving (Eq, Ord, Show, Read)
data AmmoAttachType data AmmoAttachType
= TINMAG = REVOLVEMAG
| TINMAG
| DRUMMAG | DRUMMAG
| BULLETBELT | BULLETBELT
deriving (Eq, Ord, Show, Read) deriving (Eq, Ord, Show, Read)
+14 -1
View File
@@ -1,16 +1,29 @@
module Dodge.Item.Ammo where module Dodge.Item.Ammo where
import Dodge.Reloading.Action
import Control.Lens import Control.Lens
import Dodge.Data.World import Dodge.Data.World
import Dodge.Default.Item import Dodge.Default.Item
revolveMag :: Item
revolveMag = defaultHeldItem & itType . iyBase .~ ATTACH (AMMOATTACH REVOLVEMAG)
& itUse .~ AttachUse {_attachParams = AmmoAttachParams {_ammoAttachParams = InternalAmmo
{ _iaMax = 6
, _iaLoaded = 6
, _iaPrimed = True
, _iaCycle = [loadPartialInsert 10 1]
, _iaProgress = Nothing
}
}
}
tinMag :: Item tinMag :: Item
tinMag = defaultHeldItem & itType . iyBase .~ ATTACH (AMMOATTACH TINMAG) tinMag = defaultHeldItem & itType . iyBase .~ ATTACH (AMMOATTACH TINMAG)
& itUse .~ AttachUse {_attachParams = AmmoAttachParams {_ammoAttachParams = InternalAmmo & itUse .~ AttachUse {_attachParams = AmmoAttachParams {_ammoAttachParams = InternalAmmo
{ _iaMax = 15 { _iaMax = 15
, _iaLoaded = 15 , _iaLoaded = 15
, _iaPrimed = True , _iaPrimed = True
, _iaCycle = [] , _iaCycle = [loadEject 10, loadInsert 10, loadPrime 10]
, _iaProgress = Nothing , _iaProgress = Nothing
} }
} }
+1 -1
View File
@@ -7,7 +7,7 @@ import qualified Data.Map.Strict as M
import Data.Maybe import Data.Maybe
import Dodge.Data.Item import Dodge.Data.Item
import Dodge.Item.AmmoPosition import Dodge.Item.AmmoPosition
import Dodge.Item.Weapon.FractionLoaded --import Dodge.Item.Weapon.FractionLoaded
import Geometry import Geometry
import LensHelp import LensHelp
import qualified Linear.Quaternion as Q import qualified Linear.Quaternion as Q
+3 -3
View File
@@ -3,9 +3,9 @@ module Dodge.Item.Weapon.FractionLoaded (
-- fractionLoadedAmmo2, -- fractionLoadedAmmo2,
) where ) where
import Control.Lens --import Control.Lens
import Data.Maybe --import Data.Maybe
import Dodge.Data.Item --import Dodge.Data.Item
-- ---- this shouldn't really be used -- ---- this shouldn't really be used
-- loadedAmmo :: Item -> Int -- loadedAmmo :: Item -> Int
+243 -247
View File
File diff suppressed because it is too large Load Diff