Commit before rethinking item ammo containers

This commit is contained in:
2024-12-18 19:20:37 +00:00
parent 9bc9dd2a08
commit db8e26b99d
4 changed files with 239 additions and 227 deletions
+6 -3
View File
@@ -8,15 +8,17 @@ module Dodge.Default.Item (
module Dodge.Default.Item.Use,
) where
import qualified Data.IntMap.Strict as IM
import Control.Lens
import qualified Data.IntMap.Strict as IM
import Dodge.Data.Item
import Dodge.Default.Item.Use
import Geometry.Data
defaultHeldItem :: Item
defaultHeldItem = Item
defaultHeldItem =
Item
{ _itType = HELD PISTOL
, _itConsumables = NoConsumables
, _itEffect = defaultItEffect
, _itID = 0 -- should this return an error ? const $ error "itID not correctly initialised" ?
, _itTargeting = NoItTargeting
@@ -36,7 +38,8 @@ singleAmmo :: a -> IM.IntMap a
singleAmmo x = IM.insert 0 x mempty
defaultBulletWeapon :: Item
defaultBulletWeapon = defaultHeldItem
defaultBulletWeapon =
defaultHeldItem
& itAmmoSlots .~ singleAmmo BulletAmmo
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet (UseExactly 1)]