This commit is contained in:
2024-12-28 10:12:01 +00:00
parent 2abb70334f
commit 2e67924339
8 changed files with 90 additions and 96 deletions
+2 -2
View File
@@ -50,8 +50,8 @@ useSelectedItem crid w = (worldEventFlags . at InventoryChange ?~ ()) . fromMayb
activateDetonator
:: LabelDoubleTree ItemLink ComposedItem -> Creature -> World
-> World
activateDetonator det _ w = (foldl' remoteDetonate w
$ det ^. ldtValue . _1 . itUse . uaParams . apProjectiles)
activateDetonator det _ w = foldl' remoteDetonate w
(det ^. ldtValue . _1 . itUse . uaParams . apProjectiles)
& pointerToItemID (det ^. ldtValue . _1 . itID) . itUse . uaParams . apProjectiles .~ []
remoteDetonate :: World -> Int -> World
+1 -1
View File
@@ -112,7 +112,7 @@ drawCircCollisionTest :: World -> Picture
drawCircCollisionTest w = concat $ do
a <- w ^. input . heldWorldPos . at ButtonLeft
b <- w ^. input . heldWorldPos . at ButtonRight
let col | (anythingHitCirc 2 a b w) = red
let col | anythingHitCirc 2 a b w = red
| otherwise = green
return $
setLayer DebugLayer (color col $ line [a, b])
+6 -7
View File
@@ -1,5 +1,5 @@
{-# OPTIONS -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE TupleSections #-}
--{-# LANGUAGE TupleSections #-}
module Dodge.HeldUse (
heldEffect,
@@ -57,7 +57,7 @@ hammerCheck f it cr w = case it ^? ldtValue . itUse . heldTriggerType of
_ -> w
_ -> f it cr w
where
nomakeauto = not . isJust $ lookup MakeAutoLink (it ^. ldtRight)
nomakeauto = isNothing $ lookup MakeAutoLink (it ^. ldtRight)
-- | Applies a world effect after an item use cooldown check.
useTimeCheck :: ChainEffect
@@ -613,12 +613,12 @@ createProjectileR ::
Creature ->
World ->
World
createProjectileR magtree muz itmtree cr =
createProjectileR magtree muz itmtree =
createProjectile
(Rocket
(determineProjectileTracking magtree itmtree)
smoke
) magtree muz itmtree cr
) magtree muz itmtree
where
smoke
| isJust $ lookup SmokeReducerLink (magtree ^. ldtLeft) = Just ReducedRocketSmoke
@@ -636,11 +636,10 @@ createProjectile pjtype magtree muz itmtree cr = fromMaybe failsound $ do
magid <- magtree ^? ldtValue . itLocation . ilInvID
ammoitem <- cr ^? crInv . ix magid
let homing = determineProjectileTracking magtree itmtree
rdetonate = fmap (^. ldtValue . itID) $
rdetonate = (^. ldtValue . itID) <$>
lookup RemoteDetonatorLink (magtree ^. ldtLeft)
rscreen = fmap (^. ldtValue . itID) $
rscreen = (^. ldtValue . itID) <$>
lookup RemoteScreenLink (magtree ^. ldtLeft)
-- issmokeless = isJust $ lookup SmokeReducerLink (magtree ^. ldtLeft)
aparams <- ((magtree ^? ldtLeft) >>= lookup AmmoPayloadLink >>= (^? ldtValue . itType . ibtAttach . shellPayload))
<|> ammoitem ^? itConsumables . magParams . ampPayload
return $
+1 -1
View File
@@ -59,7 +59,7 @@ craftItemSPic = \case
GLASSSHARD -> colorSH azure $ upperPrismPolyST 1 [V2 0 (-1), V2 4 (-0.5), V2 0 1]
SCRAPMETAL -> colorSH (greyN 0.3) $ upperPrismPolyST 3 $ square 4
PUMP -> colorSH yellow . translateSH (V3 4 0 0) $
(upperCylinder Small Typical 1 $ polyCirc 4 4)
upperCylinder Small Typical 1 (polyCirc 4 4)
<> upperPrismPolyST 1 (rectNSWE (-2) (-4) 4 0)
<> upperPrismPolyST 1 (rectNSWE 4 2 0 (-4))
MOTOR -> colorSH orange $ xCylinderST 5 3 <> xCylinderST 3 5
+1 -1
View File
@@ -30,7 +30,7 @@ makeShrapnelAt p v w =
& cWorld . lWorld . bullets .++~ buls
where
-- speed = magV v
vs = replicateM 75 (randInCirc $ 10) & evalState $ _randGen w
vs = replicateM 75 (randInCirc 10) & evalState $ _randGen w
drags :: [Float]
drags = replicateM 75 (state $ randomR (0.85,0.9)) & evalState $ _randGen w
buls = zipWith f vs drags
+1 -1
View File
@@ -13,7 +13,7 @@ import ShapePicture
drawProjectile :: Projectile -> SPic
drawProjectile pj
| Just (DestroyPU{}) <- pj ^? prjUpdates . ix 0 = mempty
| Just DestroyPU{} <- pj ^? prjUpdates . ix 0 = mempty
| Just NoHoming <- pj ^? prjType . rkHoming =
drawShell Nothing pj
| Just _ <- pj ^? prjType . rkHoming =
+1 -1
View File
@@ -29,7 +29,7 @@ testStringInit :: Universe -> [String]
testStringInit u =
[show (u ^?! uvWorld . cWorld . lWorld . creatures . ix 0 . crPos)]
<>
(map show $ u ^.. uvWorld . cWorld . lWorld . projectiles . each . prjPos)
map show (u ^.. uvWorld . cWorld . lWorld . projectiles . each . prjPos)
--testStringInit u = foldMap prettyShort $ u ^. uvWorld . cWorld . lWorld . projectiles
-- (map (show . _ebPos) $ u ^. uvWorld . cWorld . lWorld . energyBalls)
-- <>