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
+2 -1
View File
@@ -38,7 +38,8 @@ hatCombinations =
magazineCombinations :: [([(ItAmount,ItemBaseType)],Item)]
magazineCombinations =
[ po [CRAFT TIN, CRAFT SPRING] tinMag ]
[ po [CRAFT TIN, CRAFT SPRING] tinMag
]
where
po xs it = (map o xs, it)
o = (1,)
+2 -1
View File
@@ -107,7 +107,8 @@ data ScrollAttachType
deriving (Eq, Ord, Show, Read)
data AmmoAttachType
= TINMAG
= REVOLVEMAG
| TINMAG
| DRUMMAG
| BULLETBELT
deriving (Eq, Ord, Show, Read)
+14 -1
View File
@@ -1,16 +1,29 @@
module Dodge.Item.Ammo where
import Dodge.Reloading.Action
import Control.Lens
import Dodge.Data.World
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 = defaultHeldItem & itType . iyBase .~ ATTACH (AMMOATTACH TINMAG)
& itUse .~ AttachUse {_attachParams = AmmoAttachParams {_ammoAttachParams = InternalAmmo
{ _iaMax = 15
, _iaLoaded = 15
, _iaPrimed = True
, _iaCycle = []
, _iaCycle = [loadEject 10, loadInsert 10, loadPrime 10]
, _iaProgress = Nothing
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ import qualified Data.Map.Strict as M
import Data.Maybe
import Dodge.Data.Item
import Dodge.Item.AmmoPosition
import Dodge.Item.Weapon.FractionLoaded
--import Dodge.Item.Weapon.FractionLoaded
import Geometry
import LensHelp
import qualified Linear.Quaternion as Q
+3 -3
View File
@@ -3,9 +3,9 @@ module Dodge.Item.Weapon.FractionLoaded (
-- fractionLoadedAmmo2,
) where
import Control.Lens
import Data.Maybe
import Dodge.Data.Item
--import Control.Lens
--import Data.Maybe
--import Dodge.Data.Item
-- ---- this shouldn't really be used
-- loadedAmmo :: Item -> Int