Cleanup, work towards unifying spayguns

This commit is contained in:
2022-03-03 10:34:56 +00:00
parent 163d0c584a
commit 08389ad4e0
11 changed files with 118 additions and 91 deletions
+15 -10
View File
@@ -1,6 +1,6 @@
module Dodge.Item.Weapon.Launcher
( launcher
, doubleLauncher
, launcherX
, remoteLauncher
, fireTrackingShell
) where
@@ -83,25 +83,30 @@ launcher = defaultGun
}
& itModules . at ModLauncherHoming ?~ DefaultModule
doubleLauncher :: Item
doubleLauncher = launcher
& itName .~ "DOUBLEROCKO"
& itType .~ DOUBLELAUNCHER
& itUse . rUse .~ usePjCreationDouble
launcherX :: Int -> Item
launcherX i = launcher
& itName .~ ("ROCKO-" ++ show i)
& itType .~ LAUNCHERX i
& itConsumption . ammoBaseMax .~ i
& itConsumption . ammoLoaded .~ i
& itUse . rUse .~ usePjCreationX i
& itUse . useMods .~
[ hammerCheckI
, ammoCheckI
, useTimeCheck
, withSoundStart tap4S
, useAmmoAmount 1
, useAmmoAmount i
]
usePjCreation :: Item -> Creature -> World -> World
usePjCreation it = _amPjCreation (_aoType (_itConsumption it)) it
usePjCreationDouble :: Item -> Creature -> World -> World
usePjCreationDouble it cr = _amPjCreation (_aoType (_itConsumption it)) it cr
. _amPjCreation (_aoType (_itConsumption it)) it (cr & crDir +~ pi)
usePjCreationX :: Int -> Item -> Creature -> World -> World
usePjCreationX i it cr = foldr f
(_amPjCreation (_aoType (_itConsumption it)) it cr)
[1..i-1]
where
f n = (. _amPjCreation (_aoType (_itConsumption it)) it (cr & crDir +~ (2*pi*fromIntegral n / fromIntegral i)))
launcherPic :: Item -> SPic
launcherPic _ =