Cleanup, work towards unifying spayguns
This commit is contained in:
@@ -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 _ =
|
||||
|
||||
Reference in New Issue
Block a user