Add pathing to roomNgon
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,5 +1,7 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Room.Ngon where
|
||||
|
||||
import Dodge.Room.Path
|
||||
import Data.List
|
||||
import qualified Data.Set as S
|
||||
--import Data.Maybe
|
||||
@@ -19,7 +21,7 @@ roomNgon n x = do
|
||||
defaultRoom
|
||||
{ _rmPolys = [poly]
|
||||
, _rmLinks = map f lnks -- muout (init lnks) ++ muin[last lnks]
|
||||
, _rmPath = mempty -- TODO
|
||||
, _rmPath = linksGridToPath (map f lnks) path4
|
||||
, _rmPmnts = [thelight]
|
||||
, _rmBound = [poly]
|
||||
, _rmFloor = Tiled [makeTileFromPoly poly 2]
|
||||
@@ -30,6 +32,10 @@ roomNgon n x = do
|
||||
rots = map ((rot *) . fromIntegral) [0 .. n -1]
|
||||
poly = polyOrthDist n x
|
||||
path1 = polyOrthDist n (x-10)
|
||||
path2 = concat $ zipWith g path1 (tail path1 <> [head path1])
|
||||
path3 = loopPairs path2 <> fmap (,V2 0 0) path2
|
||||
path4 = concatMap doublePair path3
|
||||
g z y = [z, 0.5 * (z + y)]
|
||||
lnks =
|
||||
sortOn ((\(V2 a b) -> (negate b, a)) . fst . snd)
|
||||
. zip [0 ..]
|
||||
|
||||
@@ -2587,7 +2587,7 @@ addHighGirder src/Dodge/Room/Modify/Girder.hs 132;" f
|
||||
addHighGirder' src/Dodge/Room/Modify/Girder.hs 142;" f
|
||||
addIndefiniteArticle src/StringHelp.hs 17;" f
|
||||
addNodes src/Dodge/Path.hs 115;" f
|
||||
addPane src/Dodge/Placement/PlaceSpot.hs 154;" f
|
||||
addPane src/Dodge/Placement/PlaceSpot.hs 169;" f
|
||||
addPlmnt src/Dodge/LevelGen/PlacementHelper.hs 87;" f
|
||||
addPointPolygon src/Geometry/Polygon.hs 120;" f
|
||||
addPolyWall src/Dodge/LevelGen/StaticWalls.hs 141;" f
|
||||
@@ -2829,7 +2829,7 @@ cdtPropagateFold src/Dodge/DoubleTree.hs 407;" f
|
||||
cenLasTur src/Dodge/Room/LasTurret.hs 25;" f
|
||||
centerText src/Picture/Base.hs 184;" f
|
||||
centerVaultExplosiveExit src/Dodge/Room/NoNeedWeapon.hs 20;" f
|
||||
centerVaultRoom src/Dodge/Room/Procedural.hs 290;" f
|
||||
centerVaultRoom src/Dodge/Room/Procedural.hs 291;" f
|
||||
centroid src/Geometry/Polygon.hs 154;" f
|
||||
centroidNum src/Geometry/Polygon.hs 157;" f
|
||||
chainCreatureUpdates src/Dodge/Creature/ChainUpdates.hs 6;" f
|
||||
@@ -2886,7 +2886,7 @@ clAlt src/Dodge/Cloud.hs 5;" f
|
||||
clClSpringVel src/Dodge/Update.hs 827;" f
|
||||
clColor src/Shader/Poke/Cloud.hs 35;" f
|
||||
clZoneSize src/Dodge/Zoning/Cloud.hs 21;" f
|
||||
clampPath src/Dodge/Room/Procedural.hs 167;" f
|
||||
clampPath src/Dodge/Room/Procedural.hs 168;" f
|
||||
clang1S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 560;" f
|
||||
clang2S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 676;" f
|
||||
clangS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 542;" f
|
||||
@@ -2945,11 +2945,11 @@ combinationsGraph src/Dodge/Combine/Graph.hs 74;" f
|
||||
combinationsOf src/Multiset.hs 46;" f
|
||||
combinationsTrie src/Dodge/Combine.hs 43;" f
|
||||
combineAwareness src/Dodge/Creature/Perception.hs 110;" f
|
||||
combineFloors src/Dodge/Room/Procedural.hs 173;" f
|
||||
combineFloors src/Dodge/Room/Procedural.hs 174;" f
|
||||
combineInventoryExtra src/Dodge/Render/HUD.hs 337;" f
|
||||
combineItemListYouX src/Dodge/Combine.hs 35;" f
|
||||
combineList src/Dodge/Combine.hs 21;" f
|
||||
combineRooms src/Dodge/Room/Procedural.hs 153;" f
|
||||
combineRooms src/Dodge/Room/Procedural.hs 154;" f
|
||||
combineS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 480;" f
|
||||
combineTree src/Dodge/Tree/Compose.hs 67;" f
|
||||
commandColor src/Dodge/Terminal.hs 114;" f
|
||||
@@ -4059,6 +4059,7 @@ lineOutputTerminal src/Dodge/Room/Warning.hs 66;" f
|
||||
lineSplit src/Justify.hs 26;" f
|
||||
lineThick src/Picture/Base.hs 234;" f
|
||||
lineUp src/Dodge/Creature/Boid.hs 148;" f
|
||||
linksGridToPath src/Dodge/Room/Path.hs 36;" f
|
||||
linksOnPath src/Dodge/Room/CheckConsistency.hs 6;" f
|
||||
listConfig src/Dodge/Menu.hs 216;" f
|
||||
listControls src/Dodge/Menu.hs 228;" f
|
||||
@@ -4067,7 +4068,7 @@ listGuard src/Dodge/Creature/ReaderUpdate.hs 190;" f
|
||||
listSelectionColorPicture src/Dodge/DisplayInventory.hs 302;" f
|
||||
litCorridor90 src/Dodge/Room/RoadBlock.hs 26;" f
|
||||
lmt src/MatrixHelper.hs 43;" f
|
||||
lnkBothAnd src/Dodge/Room/Procedural.hs 123;" f
|
||||
lnkBothAnd src/Dodge/Room/Procedural.hs 124;" f
|
||||
lnkMidPosInvSelsCol src/Dodge/Render/HUD.hs 387;" f
|
||||
loadDodgeConfig src/Dodge/Config/Load.hs 9;" f
|
||||
loadMusic src/Dodge/SoundLogic/LoadSound.hs 30;" f
|
||||
@@ -4162,7 +4163,6 @@ makeMuzzleFlare src/Dodge/HeldUse.hs 648;" f
|
||||
makeParagraph src/Justify.hs 6;" f
|
||||
makePathBetween src/Dodge/Path.hs 35;" f
|
||||
makePathBetweenPs src/Dodge/Path.hs 54;" f
|
||||
makePathFromLinksGrid src/Dodge/Room/Path.hs 41;" f
|
||||
makePoisonExplosionAt src/Dodge/WorldEvent/Explosion.hs 25;" f
|
||||
makeRect src/Grid.hs 82;" f
|
||||
makeSelectionListPictures src/Dodge/Render/List.hs 65;" f
|
||||
@@ -4309,18 +4309,18 @@ multiLookupTrie src/SimpleTrie.hs 57;" f
|
||||
multiLookupTrieI src/SimpleTrie.hs 66;" f
|
||||
muout src/Dodge/RoomLink.hs 144;" f
|
||||
muzFlareAt src/Dodge/HeldUse.hs 674;" f
|
||||
mvButton src/Dodge/Placement/PlaceSpot.hs 162;" f
|
||||
mvCr src/Dodge/Placement/PlaceSpot.hs 168;" f
|
||||
mvFS src/Dodge/Placement/PlaceSpot.hs 171;" f
|
||||
mvButton src/Dodge/Placement/PlaceSpot.hs 177;" f
|
||||
mvCr src/Dodge/Placement/PlaceSpot.hs 183;" f
|
||||
mvFS src/Dodge/Placement/PlaceSpot.hs 186;" f
|
||||
mvGust src/Dodge/Update.hs 770;" f
|
||||
mvLS src/Dodge/Placement/PlaceSpot.hs 229;" f
|
||||
mvLS src/Dodge/Placement/PlaceSpot.hs 251;" f
|
||||
mvP src/Dodge/Wall/Move.hs 54;" f
|
||||
mvPP src/Dodge/Placement/PlaceSpot.hs 165;" f
|
||||
mvPP src/Dodge/Placement/PlaceSpot.hs 180;" f
|
||||
mvPointAlongAtSpeed src/Dodge/Base.hs 121;" f
|
||||
mvPointMeleeTarg src/Dodge/Creature/Boid.hs 314;" f
|
||||
mvPointToward src/Dodge/Base.hs 136;" f
|
||||
mvPointTowardAtSpeed src/Dodge/Base.hs 105;" f
|
||||
mvProp src/Dodge/Placement/PlaceSpot.hs 159;" f
|
||||
mvProp src/Dodge/Placement/PlaceSpot.hs 174;" f
|
||||
mvPs src/Dodge/Wall/Move.hs 58;" f
|
||||
myIntersectLineLine src/Geometry/Intersect.hs 207;" f
|
||||
myIntersectSegSeg src/Geometry/Intersect.hs 185;" f
|
||||
@@ -4409,7 +4409,7 @@ overrideMeleeCloseTarget src/Dodge/Creature/ReaderUpdate.hs 35;" f
|
||||
overwriteLabel src/Dodge/Tree/Compose.hs 31;" f
|
||||
p src/ShortShow.hs 44;" f
|
||||
pContID src/Dodge/LevelGen/PlacementHelper.hs 15;" f
|
||||
pairInPolys src/Dodge/Room/Path.hs 52;" f
|
||||
pairInPolys src/Dodge/Room/Path.hs 45;" f
|
||||
pairPolyPointsIntersect src/Geometry/ConvexPoly.hs 70;" f
|
||||
pairsToGraph src/Dodge/Path.hs 110;" f
|
||||
pairsToIncidence src/Dodge/Graph.hs 20;" f
|
||||
@@ -4460,22 +4460,22 @@ pjRemoteSetDirection src/Dodge/Projectile/Update.hs 225;" f
|
||||
plBlock src/Dodge/Placement/PlaceSpot/Block.hs 18;" f
|
||||
plDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 22;" f
|
||||
plLineBlock src/Dodge/Placement/PlaceSpot/Block.hs 50;" f
|
||||
plMachine src/Dodge/Placement/PlaceSpot.hs 174;" f
|
||||
plMachine' src/Dodge/Placement/PlaceSpot.hs 204;" f
|
||||
plMachine src/Dodge/Placement/PlaceSpot.hs 189;" f
|
||||
plMachine' src/Dodge/Placement/PlaceSpot.hs 226;" f
|
||||
plNew src/Dodge/Base/NewID.hs 19;" f
|
||||
plNewID src/Dodge/Base/NewID.hs 7;" f
|
||||
plNewUpID src/Dodge/Base/NewID.hs 13;" f
|
||||
plNewUsing src/Dodge/Base/NewID.hs 27;" f
|
||||
plRRpt src/Dodge/LevelGen/PlacementHelper.hs 33;" f
|
||||
plSlideDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 78;" f
|
||||
plTurret src/Dodge/Placement/PlaceSpot.hs 180;" f
|
||||
placeMachineWalls src/Dodge/Placement/PlaceSpot.hs 218;" f
|
||||
placePlainPSSpot src/Dodge/Placement/PlaceSpot.hs 41;" f
|
||||
placeSpot src/Dodge/Placement/PlaceSpot.hs 31;" f
|
||||
placeSpotID src/Dodge/Placement/PlaceSpot.hs 91;" f
|
||||
placeSpotRoomRand src/Dodge/Placement/PlaceSpot.hs 78;" f
|
||||
placeSpotUsingLink src/Dodge/Placement/PlaceSpot.hs 59;" f
|
||||
placeWallPoly src/Dodge/Placement/PlaceSpot.hs 148;" f
|
||||
plTurret src/Dodge/Placement/PlaceSpot.hs 195;" f
|
||||
placeMachineWalls src/Dodge/Placement/PlaceSpot.hs 240;" f
|
||||
placePlainPSSpot src/Dodge/Placement/PlaceSpot.hs 42;" f
|
||||
placeSpot src/Dodge/Placement/PlaceSpot.hs 32;" f
|
||||
placeSpotID src/Dodge/Placement/PlaceSpot.hs 98;" f
|
||||
placeSpotRoomRand src/Dodge/Placement/PlaceSpot.hs 86;" f
|
||||
placeSpotUsingLink src/Dodge/Placement/PlaceSpot.hs 63;" f
|
||||
placeWallPoly src/Dodge/Placement/PlaceSpot.hs 163;" f
|
||||
plainRegex src/Dodge/DisplayInventory.hs 189;" f
|
||||
playIfFree src/Sound.hs 137;" f
|
||||
playPositionalSoundQueue src/Sound.hs 145;" f
|
||||
@@ -4661,8 +4661,8 @@ qID src/Quaternion.hs 62;" f
|
||||
qToAng src/Quaternion.hs 59;" f
|
||||
qToV2 src/Quaternion.hs 56;" f
|
||||
qToV3 src/Quaternion.hs 53;" f
|
||||
quarterRoomSquare src/Dodge/Room/Procedural.hs 214;" f
|
||||
quarterRoomTri src/Dodge/Room/Procedural.hs 178;" f
|
||||
quarterRoomSquare src/Dodge/Room/Procedural.hs 215;" f
|
||||
quarterRoomTri src/Dodge/Room/Procedural.hs 179;" f
|
||||
quitCommand src/Dodge/Terminal.hs 93;" f
|
||||
qz src/Quaternion.hs 71;" f
|
||||
rLauncher src/Dodge/Item/Held/Launcher.hs 14;" f
|
||||
@@ -4694,8 +4694,8 @@ randSparkExtraVel src/Dodge/Spark.hs 92;" f
|
||||
randWallReflect src/Dodge/Update.hs 626;" f
|
||||
randomChallenges src/Dodge/Room/Start.hs 63;" f
|
||||
randomCompass src/Dodge/Layout.hs 57;" f
|
||||
randomFourCornerRoom src/Dodge/Room/Procedural.hs 267;" f
|
||||
randomFourCornerRoomCrsIts src/Dodge/Room/Procedural.hs 279;" f
|
||||
randomFourCornerRoom src/Dodge/Room/Procedural.hs 268;" f
|
||||
randomFourCornerRoomCrsIts src/Dodge/Room/Procedural.hs 280;" f
|
||||
randomLightPositions src/Dodge/Room/Modify/Girder.hs 152;" f
|
||||
randomMediumRoom src/Dodge/Room/Boss.hs 76;" f
|
||||
randomPath src/TreeHelp.hs 145;" f
|
||||
@@ -4812,7 +4812,7 @@ roomPillarsContaining src/Dodge/Room/Containing.hs 39;" f
|
||||
roomPillarsPassage src/Dodge/Room/Pillar.hs 93;" f
|
||||
roomPillarsSquare src/Dodge/Room/Pillar.hs 49;" f
|
||||
roomRect src/Dodge/Room/Procedural.hs 38;" f
|
||||
roomRectAutoLinks src/Dodge/Room/Procedural.hs 140;" f
|
||||
roomRectAutoLinks src/Dodge/Room/Procedural.hs 141;" f
|
||||
roomShuriken src/Dodge/Room/Boss.hs 123;" f
|
||||
roomTwistCross src/Dodge/Room/Boss.hs 154;" f
|
||||
roomsContaining src/Dodge/Room/Containing.hs 20;" f
|
||||
@@ -5247,7 +5247,7 @@ terminalWheelEvent src/Dodge/Update/Scroll.hs 131;" f
|
||||
teslaGun src/Dodge/Item/Held/BatteryGuns.hs 19;" f
|
||||
teslaGunPic src/Dodge/Item/Draw/SPic.hs 424;" f
|
||||
teslaParams src/Dodge/Item/Held/BatteryGuns.hs 25;" f
|
||||
testCrossWalls src/Dodge/Room/Path.hs 48;" f
|
||||
testCrossWalls src/Dodge/Room/Path.hs 41;" f
|
||||
testEvent src/Dodge/Event/Test.hs 9;" f
|
||||
testInventory src/Dodge/Creature.hs 292;" f
|
||||
testStringInit src/Dodge/TestString.hs 33;" f
|
||||
@@ -5721,7 +5721,7 @@ zConnectColMidX src/Dodge/Render/Connectors.hs 31;" f
|
||||
zeroZ src/Geometry/Vector.hs 8;" f
|
||||
zipArcs src/Dodge/Tesla.hs 52;" f
|
||||
zipCount src/Dodge/Tree/Shift.hs 136;" f
|
||||
zipCountDown src/Dodge/Room/Procedural.hs 120;" f
|
||||
zipCountDown src/Dodge/Room/Procedural.hs 121;" f
|
||||
zoneCloud src/Dodge/Zoning/Cloud.hs 27;" f
|
||||
zoneClouds src/Dodge/Update.hs 460;" f
|
||||
zoneCreature src/Dodge/Zoning/Creature.hs 54;" f
|
||||
|
||||
Reference in New Issue
Block a user