Add boss room, tweak launchers
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
{-
|
||||
Rooms containing particularly challenging creatures.
|
||||
-}
|
||||
module Dodge.Room.Boss
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Room.Data
|
||||
import Dodge.Room.Placement
|
||||
import Dodge.LevelGen.Data
|
||||
import Geometry
|
||||
|
||||
import Control.Monad.State
|
||||
import Control.Lens
|
||||
import System.Random
|
||||
roomOctogon
|
||||
:: Float -- ^ Size
|
||||
-> Room
|
||||
roomOctogon x = Room
|
||||
{ _rmPolys = [rectNSWE x (-x) (-x) x
|
||||
,rectNSWE 0 (-(x + 40)) (-20) 20
|
||||
]
|
||||
, _rmLinks = [((0,x),0),((0,-(x+40)),pi)]
|
||||
, _rmPath = [((0,x),(0,-(x+40)))
|
||||
,((0,-(x+40)),(0,x))]
|
||||
, _rmPS =
|
||||
[PS (x-10,x-10) 0 $ putLamp
|
||||
,PS (10-x,x-10) 0 $ putLamp
|
||||
,PS (10-x,10-x) 0 $ putLamp
|
||||
,PS (x-10,10-x) 0 $ putLamp
|
||||
,crystalLine (-x,x/2) (negate (x/2), x)
|
||||
,crystalLine (x,x/2) (x/2, x)
|
||||
,crystalLine (x/2,-x) (x,negate (x/2))
|
||||
,crystalLine (negate $ x/2,-x) (-x,negate (x/2))
|
||||
,blockLine (-40,40-x) (40,40-x)
|
||||
]
|
||||
, _rmBound = rectNSWE x (-x) (-x) x
|
||||
}
|
||||
|
||||
bossRoom :: RandomGen g => Creature -> State g Room
|
||||
bossRoom cr = pure $ roomOctogon 300 & rmPS %~ ( PS (0,100) (pi/2) (PutCrit cr) :)
|
||||
@@ -15,6 +15,10 @@ singleBlock :: Point2 -> [PlacementSpot]
|
||||
singleBlock a = [PS a 0 $ PutBlock [5,20,20] (greyN 0.5)
|
||||
$ reverse $ rectNSWE 10 (-10) (-10) 10]
|
||||
|
||||
{-
|
||||
Places a line of blocks between two points.
|
||||
Width 9, also extends out from each point by 9.
|
||||
-}
|
||||
blockLine :: Point2 -> Point2 -> PlacementSpot
|
||||
blockLine a b = PS
|
||||
{ _psPos = (0,0)
|
||||
@@ -22,6 +26,10 @@ blockLine a b = PS
|
||||
, _psType = PutLineBlock baseBlockPane 9 9 a b
|
||||
}
|
||||
|
||||
{-
|
||||
Places an breakable window between two points.
|
||||
Width 8, also extends out from each point by 8.
|
||||
-}
|
||||
windowLine :: Point2 -> Point2 -> PlacementSpot
|
||||
windowLine a b = PS
|
||||
{ _psPos = (0,0)
|
||||
@@ -29,6 +37,26 @@ windowLine a b = PS
|
||||
, _psType = PutLineBlock baseWindowPane 8 8 a b
|
||||
}
|
||||
|
||||
{-
|
||||
Places an unbreakable window between two points.
|
||||
Width 7, also extends out from each point by 7.
|
||||
-}
|
||||
crystalLine :: Point2 -> Point2 -> PlacementSpot
|
||||
crystalLine a b = PS
|
||||
{ _psPos = (0,0)
|
||||
, _psRot = 0
|
||||
, _psType = PutWindow ps $ withAlpha 0.5 aquamarine
|
||||
}
|
||||
where
|
||||
ps =
|
||||
[ a +.+ left +.+ up
|
||||
, (a +.+ left) -.- up
|
||||
, (b -.- left) -.- up
|
||||
, (b -.- left) +.+ up
|
||||
]
|
||||
left = 7 *.* normalizeV (a-.-b)
|
||||
up = vNormal left
|
||||
|
||||
windowLineType :: Point2 -> Point2 -> PSType
|
||||
windowLineType a b = PutLineBlock baseWindowPane 8 8 a b
|
||||
|
||||
|
||||
Reference in New Issue
Block a user