Partial refactor of bullet weapon effect chain

This commit is contained in:
2024-09-16 13:05:59 +01:00
parent 6f372109d9
commit abc0dd1106
23 changed files with 655 additions and 510 deletions
+5 -1
View File
@@ -4,6 +4,7 @@ module Dodge.Default.Item (
module Dodge.Default.Item.Effect,
) where
import qualified Data.IntMap.Strict as IM
import Control.Lens
import qualified Data.Map.Strict as M
import Dodge.Data.Item
@@ -41,10 +42,13 @@ defaultLeftItem = defaultHeldItem & itUse .~ defaultLeftUse
defaultCraftItem :: Item
defaultCraftItem = defaultHeldItem & itUse .~ CraftUse
singleAmmo :: a -> IM.IntMap a
singleAmmo x = IM.insert 0 x mempty
defaultBulletWeapon :: Item
defaultBulletWeapon =
defaultWeapon
& itUse . heldAmmoTypes .~ [BulletAmmo]
& itUse . heldAmmoTypes .~ singleAmmo BulletAmmo
-- & itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
& itType . iyModules . at ModBulletCollision ?~ EMPTYMODULE
-- & itType . iyModules . at ModBulletPayload ?~ EMPTYMODULE