Some cleanup of rendering/poking, remove forcefield gun

This commit is contained in:
2024-10-01 13:19:34 +01:00
parent 6438da0037
commit d357d5a03c
11 changed files with 64 additions and 148 deletions
+1 -2
View File
@@ -122,8 +122,7 @@ inventoryX c = case c of
, makeTypeCraftNum 2 PIPE
]
'B' ->
[ forceFieldGun
, wristArmour
[ wristArmour
, wristArmour
, autoRifle
, tinMag
-1
View File
@@ -164,7 +164,6 @@ data HeldItemType
| POISONSPRAYER
| DRONELAUNCHER
| SHATTERGUN
| FORCEFIELDGUN
| HELDDETECTOR Detector
| TORCH
| FLATSHIELD
-20
View File
@@ -191,7 +191,6 @@ useLoadedAmmo itmtree cr (cme, w) (mzid, Just (mz, x, magtree)) = (,) (cme & cme
MuzzleLauncher -> createProjectile magtree mz itmtree cr w
MuzzleNozzle{} -> useGasParams mid mz itm cr $ walkNozzle mzid mz itm cr w
MuzzleShatter -> shootShatter itm cr w
MuzzleForceField -> useForceFieldGun itm cr w
MuzzleDetector -> itemDetectorEffect itm cr w
where
mid = magtree ^? ldtValue . itLocation . ilInvID
@@ -444,25 +443,6 @@ shootTeslaArc itm cr mz w =
pos = _crPos cr + rotateV (_crDir cr) (_mzPos mz + aimingWeaponZeroPos cr itm)
dir = _crDir cr + _mzRot mz
-- I believe because the targeting returns to nothing straight after you release
-- the rmb, it is possible for this to do nothing
-- TODO investigate more and fix
useForceFieldGun :: Item -> Creature -> World -> World
useForceFieldGun _ _ = id
--useForceFieldGun itm cr w = fromMaybe w $ do
-- a <- cr ^? crTargeting . ctPos . _Just
-- let mwp = mouseWorldPos (w ^. input) (w ^. wCam)
-- b = if dist a mwp < 100 then mwp else a +.+ 100 *.* normalizeV (mwp -.- a)
-- wlline = (a, b)
-- return $
-- w
-- & cWorld . lWorld . walls %~ IM.insertWith (\_ x -> x) i forceField{_wlID = i}
-- & cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (_ilInvID (_itLocation itm)) . itParams . paramMID ?~ i
-- & moveWallIDUnsafe i wlline
-- where
-- i = fromMaybe (IM.newKey (_walls (_lWorld (_cWorld w)))) $ itm ^? itParams . paramMID . _Just
determineProjectileTracking ::
LabelDoubleTree ComposeLinkType Item ->
LabelDoubleTree ComposeLinkType Item ->
-1
View File
@@ -64,6 +64,5 @@ itemFromHeldType ht = case ht of
-- REMOTELAUNCHER -> remoteLauncher
POISONSPRAYER -> poisonSprayer
DRONELAUNCHER -> undefined
FORCEFIELDGUN -> forceFieldGun
HELDDETECTOR d -> clickDetector d
FLATSHIELD -> flatShield
-16
View File
@@ -31,22 +31,6 @@ torch =
-- & itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
forceFieldGun :: Item
forceFieldGun =
defaultHeldItem
-- & itUse . useTargeting ?~ TargetRBLine
-- & itType . iyModules . at ModTarget ?~ TARGET TargetRBLine
& itParams .~ ParamMID Nothing
-- & itUse . heldUse .~ HeldForceField --useForceFieldGun
& itUse . heldDelay .~ NoDelay
-- & itUse . heldMods .~ AmmoHammerTimeUseOneMod -- this is slightly different
-- & itUse . heldMods .~ ForceFieldMod -- this is slightly different
-- than the list below
--[ hammerCheckI , ammoCheckI , useAmmoAmount 1]
& itType .~ HELD FORCEFIELDGUN
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleForceField
{- |
Sends out pulses that display walls.
-}
-7
View File
@@ -90,13 +90,6 @@ itemRooms =
[ rc [sniperRifle]
]
)
,
( HELD FORCEFIELDGUN
, join $
takeOne
[ rc [forceFieldGun]
]
)
,
( HELD $ KEYCARD 0
, join $
+9 -9
View File
@@ -59,8 +59,8 @@ doDrawing' win pdata u = do
shadV = _pictureShaders pdata
nFls = w ^. cWorld . numberFloorVerxs
-- bind as much data into vbos as feasible at this point
-- count mutable vectors setup (what is the 6 here?)
layerCounts <- UMV.replicate (numLayers * 6) 0
-- count mutable vectors setup
pokeCounts <- UMV.replicate (numLayers * numShads) 0
-- attempt to poke in parallel
let wswp = wallSPics <> worldSPic cfig u
ws = wswp ^. _1
@@ -70,7 +70,7 @@ doDrawing' win pdata u = do
(\_ a b -> return (a, b))
( pokeLayVerxs
shadV
layerCounts
pokeCounts
wp
)
( pokeWallsWindows
@@ -94,7 +94,7 @@ doDrawing' win pdata u = do
(V.fromList $ w ^. cWorld . lWorld . clouds)
--(sortOn (^. clPos . _3) $ w ^. cWorld . lWorld . clouds)
-- bind wall points, silhouette data, surface geometry
bufferShaderLayers shadV layerCounts
bufferShaderLayers shadV pokeCounts
mapM_
(uncurry bufferPokedVBO)
[ (pdata ^. vboWindows, nWins)
@@ -219,9 +219,9 @@ doDrawing' win pdata u = do
glDepthFunc GL_LESS
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
glDepthMask GL_FALSE
renderLayer BloomNoZWrite shadV layerCounts
renderLayer BloomNoZWrite shadV pokeCounts
glDepthMask GL_TRUE
renderLayer BloomLayer shadV layerCounts
renderLayer BloomLayer shadV pokeCounts
--setup downscale viewport for blurring bloom
--setViewportSize (round winx `div` (2 * resFact)) (round winy `div` (2 * resFact))
setViewport _graphics_downsize_resolution cfig
@@ -253,7 +253,7 @@ doDrawing' win pdata u = do
GL_COLOR
0
ptr
-- renderLayer MidLayer shadV layerCounts
-- renderLayer MidLayer shadV pokeCounts
glUseProgram (pdata ^. cloudShader . shaderUINT)
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
glDrawElements
@@ -372,11 +372,11 @@ doDrawing' win pdata u = do
--glDepthMask GL_TRUE
glEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
renderLayer DebugLayer shadV layerCounts
renderLayer DebugLayer shadV pokeCounts
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig))
$ \ptr -> glNamedBufferSubData (pdata ^. matUBO) 0 64 ptr
renderLayer FixedCoordLayer shadV layerCounts
renderLayer FixedCoordLayer shadV pokeCounts
SDL.glSwapWindow win
getDistortions :: Configuration -> World -> [Distortion]