Improve click detectors

Introduce "gadgets" as a structural function, for items that can be used
when held and when not held. Click detectors are such an item. Make
click detectors correctly attach and use up batteries when used.
This commit is contained in:
2024-12-18 13:34:05 +00:00
parent 4d6d255893
commit c4e8046332
17 changed files with 119 additions and 79 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ singleAmmo x = IM.insert 0 x mempty
defaultBulletWeapon :: Item
defaultBulletWeapon = defaultHeldItem
& itAmmoSlots .~ singleAmmo BulletAmmo
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet]
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 15 0) 0 0.01 0 PistolFlare MuzzleShootBullet (UseExactly 1)]
defaultConsumable :: Item
defaultConsumable = defaultHeldItem & itUse .~ UseConsume CDoNothing
+1
View File
@@ -23,6 +23,7 @@ defaultAimParams =
, _mzAmmoSlot = 0
, _mzFlareType = DefaultFlareType
, _mzEffect = MuzzleShootBullet
, _mzAmmoPerShot = UseExactly 1
}
]
}