Skip to content
This repository
Newer
Older
100644 109 lines (98 sloc) 4.2 kb
0fabeb49 »
2010-04-14 Use ByteStrings.
1 {-# LANGUAGE OverloadedStrings #-}
eb4b7b81 »
2012-05-08 Package move to Roguestar.Lib.
2 module Roguestar.Lib.PlanetData
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
3 (PlanetRegion(..),
4 PlanetInfo(..),
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
5 addTown,
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
6 nonaligned_first_series_planets,
7 nonaligned_second_series_planets,
8 cyborg_planets)
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
9 where
10
eb4b7b81 »
2012-05-08 Package move to Roguestar.Lib.
11 import Roguestar.Lib.PersistantData
12 import Roguestar.Lib.TerrainData
13 import Roguestar.Lib.BuildingData
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
14 import Data.Ratio
0fabeb49 »
2010-04-14 Use ByteStrings.
15 import qualified Data.ByteString.Char8 as B
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
16
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
17 -- | Information used to construct new planets. A "planet" is an abstract stack of
18 -- Planes, with the planet's surface being on top and various dungeon levels below.
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
19 --
20 -- 'PlanetInfo's are sorted by their 'planet_info_priority' fields.
21 --
22 data PlanetInfo = PlanetInfo {
23 -- | Between 0 and 1 are randomly added to this value, and then all 'PlanetInfo's are sorted by priority.
24 -- This gives the order in which players visit planets.
25 planet_info_priority :: Double,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
26 planet_info_region :: PlanetRegion,
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
27 -- | Some planets have names.
0fabeb49 »
2010-04-14 Use ByteStrings.
28 planet_info_name :: Maybe B.ByteString,
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
29 -- | Number of dungeon levels on the planet.
30 planet_info_depth :: Integer,
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
31 planet_info_biome :: Biome,
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
32 planet_info_dungeon :: Biome,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
33 planet_info_town :: [(Rational,BuildingPrototype)],
34 planet_info_node_type :: BuildingPrototype }
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
35
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
36 nonaligned :: Integer -> B.ByteString -> Biome -> PlanetInfo
37 nonaligned x name biome = PlanetInfo {
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
38 planet_info_priority = fromInteger x / 3,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
39 planet_info_region = NonAlignedRegion,
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
40 planet_info_name = case name of
41 "" -> Nothing
42 _ -> Just name,
43 planet_info_depth = x,
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
44 planet_info_biome = biome,
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
45 planet_info_dungeon = case () of
46 () | biome == OceanBiome -> AbyssalDungeon
25168cbf »
2010-12-31 Nodes that can be picked up and add to Characters' score.
47 () | biome == SwampBiome -> AbyssalDungeon
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
48 () | x == 1 -> ShallowDungeon
49 () -> DeepDungeon,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
50 planet_info_town = [(1,basic_stargate)],
51 planet_info_node_type = powerup }
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
52
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
53 cyber :: B.ByteString -> Biome -> PlanetInfo
54 cyber name biome = PlanetInfo {
55 planet_info_priority = 0.0,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
56 planet_info_region = CyborgRegion,
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
57 planet_info_name = case name of
58 "" -> Nothing
59 _ -> Just name,
60 planet_info_depth = 5,
61 planet_info_biome = biome,
62 planet_info_dungeon = FrozenDungeon,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
63 planet_info_town = [(1,cybergate)],
64 planet_info_node_type = powerup }
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
65
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
66 addTown :: PlanetInfo -> [(Rational,BuildingPrototype)] -> PlanetInfo
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
67 addTown planet_info town = planet_info { planet_info_town = planet_info_town planet_info ++ town }
68
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
69 removeTown :: PlanetInfo -> [(BuildingPrototype)] -> PlanetInfo
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
70 removeTown planet_info town = planet_info { planet_info_town = filter (\(_,building) -> not $ building `elem` town) $ planet_info_town planet_info }
d8f38aa8 »
2010-03-16 Stargates allow transit between planets.
71
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
72 nonaligned_first_series_planets :: [PlanetInfo]
73 nonaligned_first_series_planets = [
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
74 nonaligned 1 "" RockBiome,
75 nonaligned 1 "" IcyRockBiome,
76 nonaligned 2 "roanoke" SwampBiome,
77 nonaligned 2 "pamlico" SwampBiome,
78 nonaligned 2 "pungo" ForestBiome,
79 nonaligned 2 "neuse" ForestBiome,
80 nonaligned 2 "crabtree" SwampBiome,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
81 nonaligned 2 "eno" SwampBiome `addTown` [(1%20,monolith)],
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
82 nonaligned 2 "yadkin" SwampBiome,
83 nonaligned 2 "catawba" ForestBiome,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
84 (nonaligned 5 "pasquotank" ForestBiome `addTown` [(1,cybergate)]) { planet_info_priority = 100.0 }]
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
85
86 nonaligned_second_series_planets :: [PlanetInfo]
87 nonaligned_second_series_planets = [
88 nonaligned 1 "" TundraBiome,
89 nonaligned 1 "" DesertBiome,
90 nonaligned 1 "" MountainBiome,
91 nonaligned 2 "dogwood" GrasslandBiome,
0f4b3f5d »
2011-04-19 Adds a cyborg stargate to the engine (no model).
92 nonaligned 3 "cardinal" GrasslandBiome,
93 nonaligned 4 "currituck" OceanBiome,
94 nonaligned 4 "hatteras" OceanBiome,
95 nonaligned 4 "lookout" OceanBiome,
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
96 nonaligned 4 "ocracoke" OceanBiome,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
97 (nonaligned 7 "emerald" GrasslandBiome `removeTown` [basic_stargate]) { planet_info_priority = 100.0 }]
a8e6f0d6 »
2010-07-28 Generate downstairs tiles.
98
2d235a18 »
2011-05-26 Adds improved "AbstractLocation" model for locations, network of cybo…
99 cyborg_planets = [
100 cyber "" TundraBiome,
101 cyber "" TundraBiome,
102 cyber "" TundraBiome,
103 cyber "rainwater" PolarBiome,
104 cyber "spyglass" PolarBiome,
105 cyber "fairview" IcyRockBiome,
106 cyber "iredale" IcyRockBiome,
045473d0 »
2012-03-31 Major restructuring of the location system, which doesn't seem to be …
107 (cyber "belleview" IcyRockBiome `removeTown` [cybergate]) { planet_info_priority = 100.0 }]
108
Something went wrong with that request. Please try again.