Work towards adding external ammo sources

This commit is contained in:
2023-05-17 11:01:52 +01:00
parent 63c71c852d
commit 7df81559d9
30 changed files with 246 additions and 196 deletions
+9 -6
View File
@@ -50,6 +50,8 @@ equipItemSPic et _ = case et of
BATTERYPACK -> noPic $ colorSH blue backpackShape
FUELPACK ->
noPic $ colorSH yellow $ upperPrismPolyMT 10 $ polyCirc 3 5
BULLETBELTPACK ->
noPic $ colorSH green backpackShape
AUTODETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPolySU 3 $ rectWH 2 2)
backpackShape :: Shape
@@ -249,7 +251,7 @@ baseRifleShape = colorSH red $ xCylinderST 3 25
addBullets :: Item -> Shape
addBullets itm = fromMaybe mempty $ do
x <- itm ^? itUse . heldConsumption . laLoaded
x <- itm ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
hit <- itm ^? itType . iyBase . ibtHeld
ps <- fmap (take x) $ ammoPosition itm hit ^? amPosDirs
return $ foldMap (uncurry (drawBullet itm)) ps
@@ -315,7 +317,7 @@ makeTinClip it =
bulletEffectColor
(it ^? itUse . heldConsumption . laAmmoType . amBullet . buEffect)
y = fromIntegral y' * 0.3
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laLoaded
y' = fromMaybe 0 $ it ^? itUse . heldConsumption . laSource . _InternalSource . iaLoaded
tips = fromMaybe mempty $ do
ebt <- it ^? itUse . heldConsumption . laAmmoType . amBullet . buSpawn
return $
@@ -371,12 +373,13 @@ volleyGunShape i =
)
miniGunXPictItem :: Int -> Item -> SPic
miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _heldConsumption (_itUse it))
miniGunXPictItem i it = miniGunXPict i spin
where
spin = (-10) * _laLoaded (_heldConsumption (_itUse it)) + _warmTime (_heldDelay $ _itUse it)
spin = (-10) -- * _iaLoaded (_laSource (_heldConsumption (_itUse it)))
+ _warmTime (_heldDelay $ _itUse it)
miniGunXPict :: Int -> Int -> Int -> SPic
miniGunXPict i spin _ =
miniGunXPict :: Int -> Int -> SPic
miniGunXPict i spin =
( colorSH red (rotateSHx a barrels)
<> baseRifleShape
, -- <> clip (-1) 0