Hlint, cleanup

This commit is contained in:
2026-03-30 09:29:50 +01:00
parent 1919757fca
commit 4598deb70f
8 changed files with 59 additions and 47 deletions
+4
View File
@@ -61,8 +61,12 @@ rightHandPQ cr
| oneH cr = (V3 11 (-3) 20, Q.qID)
| twists cr = (V3 0 5 20, Q.qz (-1)) `Q.comp` (V3 4 (-10) 0, Q.qID)
| twoFlat cr = (V3 4 (-8) 12, Q.qID)
-- | wl <- crRightHandWall cr = (0, Q.qID)
| otherwise = (handWalkingPos LeftForward (-8) cr, Q.qID)
--crRightHandWall :: IM.IntMap Wall -> Creature -> Wall
--crRightHandWall wls cr
translateToRightHand :: Creature -> SPic -> SPic
translateToRightHand = overPosSP . translatePointToRightHand
+1 -1
View File
@@ -36,7 +36,7 @@ data PSType
, _putMachineMachine :: Machine
, _putMachineMaybeItem :: Maybe Item
}
| PutLS LightSource
| PutLS {_putLS :: LightSource}
| PutButton {_putButton :: Button}
| PutProp Prop
| PutTerminal {_unputTerminal :: Terminal}
+1 -1
View File
@@ -119,7 +119,7 @@ putLitButOnPosExtTrig' col thePS cnt =
<&> plSpot
.~ _plSpot plmnt
where
buteff i j = SetTriggerAndSetLSCol True i (V3 0 0.5 0) j
buteff i = SetTriggerAndSetLSCol True i (V3 0 0.5 0)
shp = fmap (fmap $ colorSH col) aShape
trigid tp = fromJust $ _plMID tp
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
@@ -18,6 +18,7 @@ module Dodge.Placement.Instance.LightSource (
mntLightLnkCond',
spanLS,
mntLightLnkShape,
spanColLightI,
) where
import Color
+1 -1
View File
@@ -30,7 +30,7 @@ plDoor dr wl gw =
lerposa = doDoorLerp dr (dr ^. drLerp)
addWalls =
insertStructureWalls
(\x -> DoorPart x isauto)
(`DoorPart` isauto)
wl
(map fst pps & each %~ shiftPointBy lerposa)
drid
+15 -6
View File
@@ -181,7 +181,7 @@ slowCrushRoom = do
dr1 = dr
& drOnePos .~ (V2 145 (-40), 0)
& drZeroPos .~ (V2 145 50, 0)
apos edge = (rprBool (t edge) & psSelect . mapped . mapped . _Just . _1 %~ f)
apos edge = rprBool (t edge) & psSelect . mapped . mapped . _Just . _1 %~ f
f ps = case ps of
PS _ r -> ps & psRot +~ pi & psPos +~ rotateV r (V2 0 (-5))
_ -> ps
@@ -191,7 +191,7 @@ slowCrushRoom = do
pushCaverns :: RandomGen g => State g Room
pushCaverns = do
rm <- shuffleLinks =<< removeLights <$> roomRectAutoLights 250 100
rm <- shuffleLinks . removeLights =<< roomRectAutoLights 250 100
iside <- takeOne [North,South]
oside <- takeOne [North,South]
crs <- takeOne [[] ]
@@ -199,10 +199,14 @@ pushCaverns = do
[ [MountedLight (V3 55 0 50) 200 0.5 , MountedSPic (noPic $ aBar 55 [V2 10 0,V2 60 0])]
, [MountedLight (V3 20 0 50) 200 0.5 , MountedSPic (noPic $ aBar 55 [V2 10 0,V2 22 0])]
, [MountedLight (V3 30 45 50) 200 0.5 , MountedSPic (noPic $ aBar 55 [V2 10 45,V2 32 45])]
, [MountedLight (V3 55 45 50) 200 0.5
, [MountedLight (V3 20 45 50) 200 0.5
, MountedSPic (noPic $ aBar 55 [V2 10 45,V2 60 45])
, MountedSPic (noPic $ aBar 55 [V2 10 (-45),V2 60 (-45)])]
]
let lts = [spanColLightI (V3 0.5 0 0) 40 (V2 5 (g iside)) (V2 10 (g iside - dorot' iside 10))
& plType . putLS . lsParam . lsRad .~ 30
,spanColLightI (V3 0.5 0 0) 40 (V2 245 (g oside)) (V2 240 (g oside - dorot' oside 10))
& plType . putLS . lsParam . lsRad .~ 30]
return $ rm
& rmPolys <>~ [dorot iside (trapTBH 20 10 10) & each +~ V2 20 (g iside)
,dorot oside (trapTBH 20 10 10) & each +~ V2 230 (g oside)]
@@ -222,11 +226,16 @@ pushCaverns = do
& drMounts .~ (l & each . moPos . _xy %~ rotateV pi)) defaultDoorWall)
, psPtPl (spos (slinks West $ cardReverse iside) f') (lowBlock Stone (greyN 0.5) 10 $ rectWH 20 10)
, psPtPl (spos (slinks East $ cardReverse oside) f') (lowBlock Stone (greyN 0.5) 10 $ rectWH 20 10)
] <> crs
]
<> lts
<> crs
where
dorot = \case
North -> id
_ -> fmap negate
dorot' = \case
North -> id
_ -> negate
slinks x y s = (FromEdge x 0 `S.member` s) && OnEdge y `S.member` s
dr = defaultDoor
& drUpdate .~ DoorLerp 0.005
@@ -242,7 +251,7 @@ pushCaverns = do
f' ps = case ps of
PS _ r -> ps & psRot +~ pi & psPos +~ rotateV r (V2 0 10)
_ -> ps
spos h f'' = (rprBool (t' h) & psSelect . mapped . mapped . _Just . _1 %~ f'')
spos h f'' = rprBool (t' h) & psSelect . mapped . mapped . _Just . _1 %~ f''
t' h rp _ = case _rpType rp of
UnusedLink s -> h s
_ -> False
@@ -292,7 +301,7 @@ slowCrush90 = do
f ps = case ps of
PS _ r -> ps & psRot +~ pi & psPos +~ rotateV r (V2 0 (-5))
_ -> ps
spos h = (rprBool (t' h) & psSelect . mapped . mapped . _Just . _1 %~ f)
spos h = rprBool (t' h) & psSelect . mapped . mapped . _Just . _1 %~ f
t' h rp _ = case _rpType rp of
UnusedLink s -> h s
_ -> False
+4 -7
View File
@@ -958,7 +958,7 @@ radiusSpring r a b
simpleCrSprings :: World -> World
simpleCrSprings w =
IM.foldl' (flip crSpring) w $
IM.filter (canSpring) $ w ^. cWorld . lWorld . creatures
IM.filter canSpring $ w ^. cWorld . lWorld . creatures
-- note that this may in rare cases not push creatures away from each other
crSpring :: Creature -> World -> World
@@ -979,13 +979,10 @@ crCrSpring c1 c2
| id1 == id2 = id
| vec == V2 0 0 = id
| diff >= comRad = id
| otherwise =
( cWorld . lWorld . creatures
%~ ( (ix id1 . crPos . _xy +~ overlap c2)
. (ix id2 . crPos . _xy -~ overlap c1)
)
)
| otherwise = cWorld . lWorld . creatures %~ ( olap c1 c2 . olap c2 c1)
where
olap a b = ix (a ^. crID) . crPos . _xy +~ overlap b
id1 = _crID c1
id2 = _crID c2
vec = c1 ^. crPos . _xy - c2 ^. crPos . _xy
+32 -31
View File
@@ -2155,6 +2155,7 @@ _putDoorWall src/Dodge/Data/GenWorld.hs 55;" f
_putEndPoint src/Dodge/Data/GenWorld.hs 52;" f
_putID src/Dodge/Data/GenWorld.hs 60;" f
_putItem src/Dodge/Data/GenWorld.hs 43;" f
_putLS src/Dodge/Data/GenWorld.hs 39;" f
_putLabel src/Dodge/Data/GenWorld.hs 66;" f
_putMachineMachine src/Dodge/Data/GenWorld.hs 36;" f
_putMachineMaybeItem src/Dodge/Data/GenWorld.hs 37;" f
@@ -2522,11 +2523,11 @@ _wsMachine src/Dodge/Data/Wall/Structure.hs 14;" f
_xNum src/Dodge/Data/Item/Combine.hs 141;" f
_xNum src/Dodge/Data/Item/Combine.hs 151;" f
_xNum src/Dodge/Data/Item/Combine.hs 171;" f
aBar src/Dodge/Placement/Instance/LightSource.hs 69;" f
aBar src/Dodge/Placement/Instance/LightSource.hs 70;" f
aFlame src/Dodge/Gas.hs 20;" f
aGasCloud src/Dodge/Gas.hs 15;" f
aRadarPulse src/Dodge/RadarSweep.hs 20;" f
aShape src/Dodge/Placement/Instance/LightSource.hs 94;" f
aShape src/Dodge/Placement/Instance/LightSource.hs 95;" f
aSound src/Dodge/SoundLogic.hs 74;" f
aTreeStrut src/Dodge/Tree/GenerateStructure.hs 42;" f
accessTerminal src/Dodge/WorldEffect.hs 63;" f
@@ -2534,7 +2535,7 @@ activateDetonator src/Dodge/Creature/Impulse/UseItem.hs 63;" f
activeTargetCursorPic src/Dodge/Targeting/Draw.hs 31;" f
addArmour src/Dodge/Creature.hs 82;" f
addBranchAt src/Dodge/Tree/GenerateStructure.hs 18;" f
addButtonSlowDoor src/Dodge/Room/LongDoor.hs 98;" f
addButtonSlowDoor src/Dodge/Room/LongDoor.hs 101;" f
addCrGibs src/Dodge/Prop/Gib.hs 17;" f
addDepth src/Picture/Base.hs 125;" f
addDoorAtNthLinkToggleInterrupt src/Dodge/Room/Warning.hs 43;" f
@@ -2565,7 +2566,7 @@ addPolyWalls src/Dodge/LevelGen/StaticWalls.hs 129;" f
addRandomGirderEW src/Dodge/Room/Girder.hs 9;" f
addRandomGirderFrom src/Dodge/Room/Girder.hs 16;" f
addSideEffect src/Dodge/Concurrent.hs 29;" f
addSouthPillars src/Dodge/Room/LongDoor.hs 89;" f
addSouthPillars src/Dodge/Room/LongDoor.hs 92;" f
addTermSignal src/Dodge/Event/Input.hs 31;" f
addToTrunk src/TreeHelp.hs 157;" f
addWarningTerminal src/Dodge/Room/Warning.hs 94;" f
@@ -3776,7 +3777,7 @@ horPipe src/Dodge/Placement/Instance/Pipe.hs 9;" f
hotkeyToChar src/Dodge/Inventory/SelectionList.hs 185;" f
hotkeyToScancode src/Dodge/Creature/YourControl.hs 82;" f
hotkeyToString src/Dodge/Inventory/SelectionList.hs 182;" f
iShape src/Dodge/Placement/Instance/LightSource.hs 57;" f
iShape src/Dodge/Placement/Instance/LightSource.hs 58;" f
icosahedronPoints src/Polyhedra/Geodesic.hs 12;" f
icosohedronFaces src/Polyhedra/Geodesic.hs 19;" f
inLink src/Dodge/RoomLink.hs 128;" f
@@ -3950,7 +3951,7 @@ itmBaseInfo src/Dodge/Item/Info.hs 30;" f
itmEquipSiteInfo src/Dodge/Item/Info.hs 250;" f
itmSpaceInfo src/Dodge/Item/Info.hs 25;" f
itmUsageInfo src/Dodge/Item/Info.hs 230;" f
jShape src/Dodge/Placement/Instance/LightSource.hs 72;" f
jShape src/Dodge/Placement/Instance/LightSource.hs 73;" f
joinItemsInList src/Dodge/Item/Grammar.hs 215;" f
joystick src/Dodge/Item/Scope.hs 158;" f
jps0' src/Dodge/LevelGen/PlacementHelper.hs 61;" f
@@ -3973,7 +3974,7 @@ lChasm src/Dodge/Room/Tutorial.hs 145;" f
lConnect src/Dodge/Render/Connectors.hs 43;" f
lConnectCol src/Dodge/Render/Connectors.hs 46;" f
lConnectMulti src/Dodge/Render/Connectors.hs 51;" f
lShape src/Dodge/Placement/Instance/LightSource.hs 60;" f
lShape src/Dodge/Placement/Instance/LightSource.hs 61;" f
lamp src/Dodge/Creature/Lamp.hs 18;" f
lampCrSPic src/Dodge/Render/ShapePicture.hs 125;" f
lasCenRunClose' src/Dodge/Room/LasTurret.hs 309;" f
@@ -4011,7 +4012,7 @@ legPQ src/Dodge/Creature/HandPos.hs 91;" f
legPQ' src/Dodge/Creature/HandPos.hs 96;" f
legsSPic src/Dodge/Item/Draw/SPic.hs 448;" f
lerpP2A src/Dodge/ShiftPoint.hs 14;" f
liShape src/Dodge/Placement/Instance/LightSource.hs 85;" f
liShape src/Dodge/Placement/Instance/LightSource.hs 86;" f
light src/Color.hs 131;" f
lightSensByDoor src/Dodge/Room/LasTurret.hs 77;" f
lightSensInsideDoor src/Dodge/Room/LasTurret.hs 64;" f
@@ -4107,7 +4108,7 @@ makeCorpse src/Dodge/Corpse/Make.hs 13;" f
makeDebris src/Dodge/Block/Debris.hs 48;" f
makeDebrisDirected src/Dodge/Block/Debris.hs 51;" f
makeDoorDebris src/Dodge/Block/Debris.hs 26;" f
makeDumbSwitch src/Dodge/Room/LongDoor.hs 142;" f
makeDumbSwitch src/Dodge/Room/LongDoor.hs 145;" f
makeDustAt src/Dodge/WorldEvent/Cloud.hs 17;" f
makeExplosionAt src/Dodge/WorldEvent/Explosion.hs 68;" f
makeFlak src/Dodge/Bullet.hs 146;" f
@@ -4238,12 +4239,12 @@ mkDustCloudLike src/Shader/Poke/Cloud.hs 27;" f
mkGraphFromEdges src/GraphHelp.hs 4;" f
mkNode src/Dodge/Graph.hs 29;" f
mkRectangle src/Dodge/LevelGen/DoorPane.hs 7;" f
mntLS src/Dodge/Placement/Instance/LightSource.hs 106;" f
mntLSCond src/Dodge/Placement/Instance/LightSource.hs 111;" f
mntLSOn src/Dodge/Placement/Instance/LightSource.hs 36;" f
mntLightLnkCond src/Dodge/Placement/Instance/LightSource.hs 128;" f
mntLightLnkCond' src/Dodge/Placement/Instance/LightSource.hs 136;" f
mntLightLnkShape src/Dodge/Placement/Instance/LightSource.hs 133;" f
mntLS src/Dodge/Placement/Instance/LightSource.hs 107;" f
mntLSCond src/Dodge/Placement/Instance/LightSource.hs 112;" f
mntLSOn src/Dodge/Placement/Instance/LightSource.hs 37;" f
mntLightLnkCond src/Dodge/Placement/Instance/LightSource.hs 129;" f
mntLightLnkCond' src/Dodge/Placement/Instance/LightSource.hs 137;" f
mntLightLnkShape src/Dodge/Placement/Instance/LightSource.hs 134;" f
moPos src/Dodge/Data/MountedObject.hs 18;" f
modTo src/Geometry/Zone.hs 18;" f
mouseClickOptionsList src/Dodge/Update/Input/ScreenLayer.hs 70;" f
@@ -4560,7 +4561,7 @@ psposAddLabel src/Dodge/PlacementSpot.hs 71;" f
pt0 src/Dodge/LevelGen/PlacementHelper.hs 55;" f
ptCont src/Dodge/LevelGen/PlacementHelper.hs 21;" f
pulseChecker src/Dodge/Item/Equipment.hs 84;" f
pushCaverns src/Dodge/Room/LongDoor.hs 189;" f
pushCaverns src/Dodge/Room/LongDoor.hs 192;" f
pushCr src/Dodge/WallCreatureCollisions.hs 43;" f
pushL src/DoubleStack.hs 20;" f
pushOutFromCorners src/Dodge/WallCreatureCollisions.hs 116;" f
@@ -4577,7 +4578,7 @@ putDoor src/Dodge/Room/Airlock.hs 116;" f
putDoubleDoor src/Dodge/Placement/Instance/Door.hs 17;" f
putDoubleDoorThen src/Dodge/Placement/Instance/Door.hs 20;" f
putImmediateMessageTerminal src/Dodge/Placement/Instance/Terminal.hs 60;" f
putLamp src/Dodge/Placement/Instance/LightSource.hs 197;" f
putLamp src/Dodge/Placement/Instance/LightSource.hs 198;" f
putLasTurret src/Dodge/Placement/Instance/Turret.hs 23;" f
putLitButOnPos src/Dodge/Placement/Instance/Button.hs 64;" f
putLitButOnPosExtTrig src/Dodge/Placement/Instance/Button.hs 97;" f
@@ -5016,10 +5017,10 @@ slapClean7S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 747;" f
slapS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 667;" f
slideDoorS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 629;" f
slideWindow src/ListHelp.hs 81;" f
slowCrush90 src/Dodge/Room/LongDoor.hs 236;" f
slowCrushRoom src/Dodge/Room/LongDoor.hs 145;" f
slowDoorRoom src/Dodge/Room/LongDoor.hs 282;" f
slowDoorRoomRunPast src/Dodge/Room/LongDoor.hs 299;" f
slowCrush90 src/Dodge/Room/LongDoor.hs 257;" f
slowCrushRoom src/Dodge/Room/LongDoor.hs 148;" f
slowDoorRoom src/Dodge/Room/LongDoor.hs 303;" f
slowDoorRoomRunPast src/Dodge/Room/LongDoor.hs 320;" f
smallBattery src/Dodge/Item/Ammo.hs 57;" f
smallBranch src/Dodge/Tree/GenerateStructure.hs 32;" f
smallChaseCrit src/Dodge/Creature/ChaseCrit.hs 14;" f
@@ -5054,15 +5055,15 @@ soundToOnomato src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 175;" f
soundToVol src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 4;" f
soundWithStatus src/Dodge/SoundLogic.hs 104;" f
soundWithStatusVolume src/Dodge/SoundLogic.hs 54;" f
southPillarsRoom src/Dodge/Room/LongDoor.hs 86;" f
southPillarsRoom src/Dodge/Room/LongDoor.hs 89;" f
spPos src/ShapePicture/Data.hs 11;" f
spaceAction src/Dodge/Update/Input/InGame.hs 504;" f
spanColLightBlackI src/Dodge/Placement/Instance/LightSource.hs 161;" f
spanColLightI src/Dodge/Placement/Instance/LightSource.hs 154;" f
spanLS src/Dodge/Placement/Instance/LightSource.hs 146;" f
spanLightI src/Dodge/Placement/Instance/LightSource.hs 168;" f
spanLightL src/Dodge/Placement/Instance/LightSource.hs 182;" f
spanLightY src/Dodge/Placement/Instance/LightSource.hs 172;" f
spanColLightBlackI src/Dodge/Placement/Instance/LightSource.hs 162;" f
spanColLightI src/Dodge/Placement/Instance/LightSource.hs 155;" f
spanLS src/Dodge/Placement/Instance/LightSource.hs 147;" f
spanLightI src/Dodge/Placement/Instance/LightSource.hs 169;" f
spanLightL src/Dodge/Placement/Instance/LightSource.hs 183;" f
spanLightY src/Dodge/Placement/Instance/LightSource.hs 173;" f
sparkDam src/Dodge/Spark.hs 37;" f
sparkRandDir src/Dodge/Spark.hs 117;" f
sparkToDamage src/Dodge/Spark.hs 40;" f
@@ -5362,8 +5363,8 @@ tutRezBox src/Dodge/Room/Tutorial.hs 525;" f
tutRoomTree src/Dodge/Floor.hs 20;" f
tutorialMessage1 src/Dodge/Room/Tutorial.hs 550;" f
tweenAngles src/Geometry/Vector.hs 192;" f
twinSlowDoorChasers src/Dodge/Room/LongDoor.hs 80;" f
twinSlowDoorRoom src/Dodge/Room/LongDoor.hs 36;" f
twinSlowDoorChasers src/Dodge/Room/LongDoor.hs 83;" f
twinSlowDoorRoom src/Dodge/Room/LongDoor.hs 39;" f
twists src/Dodge/Creature/Test.hs 103;" f
twoFlat src/Dodge/Creature/Test.hs 100;" f
twoFlatHRot src/Dodge/Item/HeldOffset.hs 77;" f
@@ -5558,7 +5559,7 @@ vCen3 src/Geometry/Vector3D.hs 115;" f
vInverse src/Geometry/Vector.hs 156;" f
vNormal src/Geometry/Vector.hs 151;" f
vNormaly src/Geometry/Vector3D.hs 72;" f
vShape src/Dodge/Placement/Instance/LightSource.hs 99;" f
vShape src/Dodge/Placement/Instance/LightSource.hs 100;" f
vToL src/MatrixHelper.hs 56;" f
vToQuat src/Quaternion.hs 42;" f
validTerminalCommands src/Dodge/Debug/Terminal.hs 137;" f