This commit is contained in:
2022-06-07 21:34:34 +01:00
parent d2c3d14e46
commit e85bd36fe4
28 changed files with 222 additions and 232 deletions
+12 -12
View File
@@ -41,15 +41,15 @@ launcher = defaultGun
{ _itName = "ROCKO"
, _itType = LAUNCHER
, _itConsumption = defaultAmmo
{ _aoType = ProjectileAmmo
{ _laType = ProjectileAmmo
{ _amPayload = makeExplosionAt
, _amString = "EXPLOSIVE SHELL"
, _amPjDraw = drawShell
, _amPjCreation = fireShell
}
, _ammoBaseMax = 1
, _ammoLoaded = 1
, _reloadTime = 80
, _laMax = 1
, _laLoaded = 1
, _laReloadTime = 80
}
, _itUse = ruseRate 20 usePjCreation upHammer
[ hammerCheckI
@@ -88,8 +88,8 @@ launcherX :: Int -> Item
launcherX i = launcher
& itName .~ ("ROCKO-" ++ show i)
& itType .~ LAUNCHERX i
& itConsumption . ammoBaseMax .~ i
& itConsumption . ammoLoaded .~ i
& itConsumption . laMax .~ i
& itConsumption . laLoaded .~ i
& itUse . rUse .~ usePjCreationX i
& itUse . useMods .~
[ hammerCheckI
@@ -100,14 +100,14 @@ launcherX i = launcher
]
usePjCreation :: Item -> Creature -> World -> World
usePjCreation it = _amPjCreation (_aoType (_itConsumption it)) it
usePjCreation it = _amPjCreation (_laType (_itConsumption it)) it
usePjCreationX :: Int -> Item -> Creature -> World -> World
usePjCreationX i it cr = foldr f
(_amPjCreation (_aoType (_itConsumption it)) it cr)
(_amPjCreation (_laType (_itConsumption it)) it cr)
[1..i-1]
where
f n = (. _amPjCreation (_aoType (_itConsumption it)) it (cr & crDir +~ (2*pi*fromIntegral n / fromIntegral i)))
f n = (. _amPjCreation (_laType (_itConsumption it)) it (cr & crDir +~ (2*pi*fromIntegral n / fromIntegral i)))
launcherPic :: Item -> SPic
launcherPic _ =
@@ -291,7 +291,7 @@ remoteLauncher = launcher
& itType .~ REMOTELAUNCHER
& itUse . rUse .~ fireRemoteShell
& itScope .~ RemoteScope (V2 0 0) 1 True
& itConsumption . aoType . amPjDraw .~ drawRemoteShell
& itConsumption . laType . amPjDraw .~ drawRemoteShell
-- TODO consider allowing tweaking rocket speed
fireRemoteShell :: Item -> Creature -> World -> World
@@ -385,13 +385,13 @@ makeShell it cr theupdate w = w & props %~ IM.insert i Shell
, _pjZ = 20
, _pjStartPos = pos
, _pjVel = rotateV dir (V2 1 0)
, _prDraw = _amPjDraw $ _aoType am
, _prDraw = _amPjDraw $ _laType am
, _pjID = i
, _pjUpdate = theupdate
, _pjAcc = rotateV dir (V2 3 0)
, _pjDir = dir
, _pjSpin = 0
, _pjPayload = _amPayload $ _aoType am
, _pjPayload = _amPayload $ _laType am
, _pjTimer = 50
}
where