Get rid of warnings

This commit is contained in:
2025-06-07 19:14:56 +01:00
parent 81a7dcd962
commit faa3c4cde4
12 changed files with 85 additions and 96 deletions
+1
View File
@@ -118,6 +118,7 @@ useBulletPayload bu = case _buPayload bu of
BulBall ExplosiveBall -> \p -> cWorld . lWorld . shockwaves .:~ concBall p
BulBall ElectricalBall -> makeStaticBall
BulBall FlashBall -> makeFlashBall
BulBall (FlameletBall x) -> \p -> makeFlamelet p 0 x 10
makeFragBullets :: Point2 -> World -> World
makeFragBullets p w = w & cWorld . lWorld . bullets .++~ bus
+1 -1
View File
@@ -36,7 +36,7 @@ data BulletEffect
data BulletPayload
= BulBall {_spawnEBT :: EnergyBallType}
| BulPlain {_sparkDam :: Int}
| BulPlain {_buDam :: Int}
| BulFlak
| BulFrag
| BulGas
+2 -5
View File
@@ -8,7 +8,6 @@ module Dodge.Data.EnergyBall (
module Dodge.Data.EnergyBall.Type,
) where
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -17,10 +16,8 @@ import Geometry.Data
data EnergyBall = EnergyBall
{ _ebVel :: Point2
, -- , _ebColor :: Color
_ebPos :: Point2
, -- , _ebWidth :: Float
_ebTimer :: Int
, _ebPos :: Point2
, _ebTimer :: Int
, _ebEff :: EnergyBallType
, _ebRot :: Float
}
-2
View File
@@ -5,10 +5,8 @@
module Dodge.Data.EnergyBall.Type where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Geometry.Data
data EnergyBallType
= FlamingBall
+3 -7
View File
@@ -114,7 +114,7 @@ damageCircle sp dt w =
wlstodam = wlsHitRadial sp r w
wldam p = ebtToDamage p dt
addcreaturedamages crs = foldl' (damageCrCircle crdam) crs crstodam
crdam p cr = ebtToDamage sp dt
crdam = ebtToDamage sp dt
crstodam = crsHitRadial sp r w
ebtToDamage :: Point2 -> EnergyBallType -> Damage
@@ -132,9 +132,5 @@ damageWlCircle ::
IM.IntMap [Damage]
damageWlCircle f wldams (p, wl) = IM.insertWith (++) (_wlID wl) [f p] wldams
damageCrCircle ::
(Point2 -> Creature -> Damage) ->
IM.IntMap Creature ->
(Point2, Creature) ->
IM.IntMap Creature
damageCrCircle crdam crs (p, cr) = crs & ix (_crID cr) . crState . csDamage .:~ crdam p cr
damageCrCircle :: Damage -> IM.IntMap Creature -> (Point2, Creature) -> IM.IntMap Creature
damageCrCircle crdam crs (_, cr) = crs & ix (_crID cr) . crState . csDamage .:~ crdam
+4 -4
View File
@@ -45,14 +45,14 @@ expireAndDamageFL ::
(World, Maybe Flame)
expireAndDamageFL bt things w = case List.safeHead things of
Nothing -> (w, Just $ bt & flTimer -~ 1)
Just x -> (doDamagesFL x bt w, Nothing)
Just (_,x) -> (doDamagesFL x w, Nothing)
doDamagesFL ::
(Point2, Either Creature Wall) ->
Flame ->
Either Creature Wall ->
-- Flame ->
World ->
World
doDamagesFL (p, thhit) bt = case thhit of
doDamagesFL thhit = case thhit of
Left cr ->
cWorld . lWorld . creatures . ix (_crID cr) . crState . csDamage
.:~ Flaming 1
+1 -1
View File
@@ -16,7 +16,7 @@ updateLaser w pt =
( case _lpType pt of
DamageLaser dam ->
damThingHitWith
(\p1 p2 p3 -> Lasering dam p2 (p3 - p2))
(\p1 p2 p3 -> Lasering dam p2 (p3 - p1))
sp
xp
thHit
+2 -1
View File
@@ -19,7 +19,7 @@ defDamageMaterial dm _ w = (_dmAmount dm, w)
damageStone :: Damage -> Float -> World -> (Int, World)
damageStone dm dir = case dm of
Lasering x p t -> a 0 $ makeSpark FireSpark (outTo p t) (argV $ reflectIn t v)
Lasering _ p t -> a 0 $ makeSpark FireSpark (outTo p t) (argV $ reflectIn t v)
Piercing x p t -> a x $ makeSpark NormalSpark (outTo p t) (argV $ reflectIn t v)
Blunt x p t -> a x $ makeSpark NormalSpark (outTo p t) (argV $ reflectIn t v)
Shattering {} -> a 0 id
@@ -30,6 +30,7 @@ damageStone dm dir = case dm of
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Flashing {} -> a 0 id
where
v = unitVectorAtAngle dir
a x f w = (x, f w)
+6 -6
View File
@@ -40,9 +40,9 @@ moveShockwave w sw
| otherwise =
cr & crState . csDamage
.:~ Explosive dam p
where
cpos = _crPos cr
v = normalizeV (cpos -.- p)
--where
-- cpos = _crPos cr
-- v = normalizeV (cpos -.- p)
moveInverseShockwave ::
World ->
@@ -63,6 +63,6 @@ moveInverseShockwave w sw
| otherwise =
cr & crState . csDamage
.:~ Explosive 1 p
where
cpos = _crPos cr
v = normalizeV (cpos -.- p)
--where
-- cpos = _crPos cr
-- v = normalizeV (cpos -.- p)
+4 -9
View File
@@ -22,24 +22,19 @@ updateSpark w sk
| otherwise = case thingHit sp ep w of
Nothing -> (w, Just $ sk & skPos .~ ep & skVel *~ 0.9 & skOldPos .~ sp)
Just (hp, hthing) ->
( sparkDam' sk sp ep (hp, hthing) w
( sparkDam sk hthing w
, Just $ sk & skPos .~ hp & skOldPos .~ sp & skVel .~ 0
)
where
sp = _skPos sk
ep = sp + _skVel sk
sparkDam' ::
sparkDam ::
Spark ->
Point2 ->
Point2 ->
(Point2, Either Creature Wall) ->
Either Creature Wall ->
World ->
World
sparkDam' sk sp ep mayEiCrWl = case mayEiCrWl of
(hitp, eicrwl) -> damageCrWl (thedam hitp) eicrwl
where
thedam hitp = sparkToDamage sk
sparkDam sk x = damageCrWl (sparkToDamage sk) x
sparkToDamage :: Spark -> Damage
sparkToDamage sp = case _skType sp of
+52 -51
View File
@@ -24,20 +24,20 @@ damageWallEffect dm wl = (,dm) . case _wlMaterial wl of
stoneWallDamage :: Damage -> Wall -> World -> World
stoneWallDamage dm wl = case dm of
Piercing d p t -> a d $ makeSpark NormalSpark (outTo p t)
Piercing _ p t -> makeSpark NormalSpark (outTo p t)
(reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Blunt d p t -> a d $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing d _ -> a d id
Explosive d _ -> a d id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing {} -> id
Explosive {} -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
outTo x y = x -.- squashNormalizeV y
-- d = _dmAmount dm
-- sp = _dmFrom dm
@@ -47,25 +47,24 @@ stoneWallDamage dm wl = case dm of
glassWallDamage :: Damage -> Wall -> World -> World
glassWallDamage dm wl w =
w & case dm of
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing d p t -> a d $ dosplint . makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt d p t -> a d $ dosplint . wlDustAt wl (outTo p t)
Shattering d p t -> a d $ dosplint . muchWlDustAt wl (outTo p t)
Crushing {} -> a d dosplint
Explosive {} -> a d dosplint
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing _ p t -> dosplint . makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt _ p t -> dosplint . wlDustAt wl (outTo p t)
Shattering _ p t -> dosplint . muchWlDustAt wl (outTo p t)
Crushing {} -> dosplint
Explosive {} -> dosplint
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
mbl = do
blid <- wl ^? wlStructure . wsBlock
w ^? cWorld . lWorld . blocks . ix blid
d :: Int
d = max 1 $ maybe 1 (subtract 1 . _blHP) mbl
a :: Int -> (World -> World) -> World -> (World)
a x f w' = (f w')
-- d :: Int
-- d = max 1 $ maybe 1 (subtract 1 . _blHP) mbl
dosplint = maybe id splinterBlock mbl
-- sp = _dmFrom dm
-- p = _dmAt dm
@@ -74,19 +73,20 @@ glassWallDamage dm wl w =
crystalWallDamage :: Damage -> Wall -> World -> World
crystalWallDamage dm wl = case dm of
Lasering d p t -> a 0 $ makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing d p t -> a 0 $ makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt d p t -> a 0 $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing {} -> a 0 id
Explosive {} -> a 0 id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> makeSpark FireSpark (outTo p t) (reflDirWall p (p+t) wl)
Piercing _ p t -> makeSpark NormalSpark (outTo p t) (reflDirWall p (p+t) wl) . wlDustAt wl (outTo p t)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing {} -> id
Explosive {} -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
-- a x f w = (f w)
--d = _dmAmount dm
--sp = _dmFrom dm
--p = _dmAt dm
@@ -95,19 +95,20 @@ crystalWallDamage dm wl = case dm of
dirtWallDamage :: Damage -> Wall -> World -> World
dirtWallDamage dm wl = case dm of
Lasering d p t -> a d $ wlDustAt wl (outTo p t)
Piercing d p t -> a d $ wlDustAt wl (outTo p t)
Blunt d p t -> a d $ wlDustAt wl (outTo p t)
Shattering d p t -> a d $ muchWlDustAt wl (outTo p t)
Crushing d _ -> a d id
Explosive d _ -> a d id
Sparking {} -> a 0 id
Flaming {} -> a 0 id
Electrical {} -> a 0 id
Poison {} -> a 0 id
Enterrement {} -> a 0 id
Lasering _ p t -> wlDustAt wl (outTo p t)
Piercing _ p t -> wlDustAt wl (outTo p t)
Blunt _ p t -> wlDustAt wl (outTo p t)
Shattering _ p t -> muchWlDustAt wl (outTo p t)
Crushing _ _ -> id
Explosive _ _ -> id
Sparking {} -> id
Flaming {} -> id
Electrical {} -> id
Poison {} -> id
Enterrement {} -> id
Flashing {} -> id
where
a x f w = (f w)
--a x f w = (f w)
--d = _dmAmount dm
--sp = _dmFrom dm
--p = _dmAt dm
+9 -9
View File
@@ -2346,6 +2346,7 @@ _btRot src/Dodge/Data/Button.hs 51;" f
_btState src/Dodge/Data/Button.hs 55;" f
_btTermMID src/Dodge/Data/Button.hs 56;" f
_btText src/Dodge/Data/Button.hs 54;" f
_buDam src/Dodge/Data/Bullet.hs 39;" f
_buDrag src/Dodge/Data/Bullet.hs 23;" f
_buEffect src/Dodge/Data/Bullet.hs 19;" f
_buOldPos src/Dodge/Data/Bullet.hs 25;" f
@@ -3107,7 +3108,6 @@ _soundVolumeFraction src/Sound/Data.hs 52;" f
_soundsToInvestigate src/Dodge/Data/Creature/Memory.hs 14;" f
_spPixelOff src/Dodge/Data/ScreenPos.hs 14;" f
_spScreenOff src/Dodge/Data/ScreenPos.hs 13;" f
_sparkDam src/Dodge/Data/Bullet.hs 39;" f
_sparks src/Dodge/Data/LWorld.hs 112;" f
_spawnEBT src/Dodge/Data/Bullet.hs 38;" f
_ssIndent src/Dodge/Data/SelectionList.hs 34;" f
@@ -3783,7 +3783,7 @@ craftInfo src/Dodge/Item/Info.hs 168;" f
craftItemSPic src/Dodge/Item/Draw/SPic.hs 57;" f
crankSlowS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 446;" f
createArc src/Dodge/Tesla/Arc.hs 81;" f
createBarrelSpark src/Dodge/Spark.hs 50;" f
createBarrelSpark src/Dodge/Spark.hs 45;" f
createFlIt src/Dodge/Placement/PlaceSpot.hs 180;" f
createForceField src/Dodge/ForceField.hs 7;" f
createGas src/Dodge/Gas.hs 8;" f
@@ -3817,7 +3817,7 @@ crsNearRect src/Dodge/Zoning/Creature.hs 38;" f
crsNearSeg src/Dodge/Zoning/Creature.hs 21;" f
crystalDebris src/Dodge/Block/Debris.hs 176;" f
crystalLine src/Dodge/Placement/Instance/Wall.hs 55;" f
crystalWallDamage src/Dodge/Wall/DamageEffect.hs 75;" f
crystalWallDamage src/Dodge/Wall/DamageEffect.hs 74;" f
cubeShape src/Dodge/Block/Debris.hs 196;" f
cullPoint src/Dodge/Render/ShapePicture.hs 76;" f
cullPretty src/AesonHelp.hs 14;" f
@@ -4952,7 +4952,7 @@ makeShaderVBO src/Shader/Compile.hs 32;" f
makeShockwaveAt src/Dodge/WorldEvent/Shockwave.hs 12;" f
makeShrapnelAt src/Dodge/Payload.hs 24;" f
makeSourcedShader src/Shader/Compile.hs 167;" f
makeSpark src/Dodge/Spark.hs 53;" f
makeSpark src/Dodge/Spark.hs 48;" f
makeStartCloudAt src/Dodge/WorldEvent/Cloud.hs 60;" f
makeStaticBall src/Dodge/WorldEvent/SpawnParticle.hs 22;" f
makeSubmenuOption src/Dodge/Menu/OptionType.hs 19;" f
@@ -5446,7 +5446,7 @@ radToDeg src/Geometry/Vector.hs 122;" f
randBlockBreakWeapon src/Dodge/Item/Random.hs 7;" f
randC1 src/Dodge/Placement/Instance/Creature.hs 8;" f
randDirPS src/Dodge/PlacementSpot.hs 56;" f
randDirSpark src/Dodge/Spark.hs 62;" f
randDirSpark src/Dodge/Spark.hs 57;" f
randEdgeTank src/Dodge/Room/Tanks.hs 33;" f
randEdgeTanks src/Dodge/Room/Tanks.hs 63;" f
randEnergyBallAt src/Dodge/WorldEvent/SpawnParticle.hs 14;" f
@@ -5463,7 +5463,7 @@ randOnUnitSphere src/RandomHelp.hs 90;" f
randPeaked src/RandomHelp.hs 138;" f
randPeakedParam src/RandomHelp.hs 130;" f
randProb src/RandomHelp.hs 68;" f
randSpark src/Dodge/Spark.hs 82;" f
randSpark src/Dodge/Spark.hs 77;" f
randWallReflect src/Dodge/Tesla/Arc.hs 57;" f
randWallReflect src/Dodge/Update.hs 580;" f
randomChallenges src/Dodge/Room/Start.hs 62;" f
@@ -5881,10 +5881,10 @@ spanColLightI src/Dodge/Placement/Instance/LightSource.hs 183;" f
spanLS src/Dodge/Placement/Instance/LightSource.hs 175;" f
spanLSLightI src/Dodge/Placement/Instance/LightSource.hs 168;" f
spanLightI src/Dodge/Placement/Instance/LightSource.hs 197;" f
sparkDam' src/Dodge/Spark.hs 32;" f
sparkDam src/Dodge/Spark.hs 32;" f
sparkGun src/Dodge/Item/Held/BatteryGuns.hs 13;" f
sparkRandDir src/Dodge/Spark.hs 105;" f
sparkToDamage src/Dodge/Spark.hs 44;" f
sparkRandDir src/Dodge/Spark.hs 100;" f
sparkToDamage src/Dodge/Spark.hs 39;" f
spawnCrNextTo src/Dodge/Item/Weapon/Spawn.hs 20;" f
spawnElectricalSparks src/Dodge/PosEvent.hs 19;" f
spawnGun src/Dodge/Item/Weapon/Spawn.hs 12;" f