about summary refs log tree commit diff stats
path: root/data/maps
diff options
context:
space:
mode:
Diffstat (limited to 'data/maps')
-rw-r--r--data/maps/the_ancient/connections.txtpb10
-rw-r--r--data/maps/the_ancient/doors.txtpb18
-rw-r--r--data/maps/the_ancient/rooms/Ending.txtpb3
-rw-r--r--data/maps/the_ancient/rooms/Inside.txtpb10
-rw-r--r--data/maps/the_ancient/rooms/Outside.txtpb8
5 files changed, 49 insertions, 0 deletions
diff --git a/data/maps/the_ancient/connections.txtpb b/data/maps/the_ancient/connections.txtpb new file mode 100644 index 0000000..23989ab --- /dev/null +++ b/data/maps/the_ancient/connections.txtpb
@@ -0,0 +1,10 @@
1connections {
2 from_room: "Outside"
3 to_room: "Inside"
4 door { name: "Front Door" }
5}
6connections {
7 from_room: "Inside"
8 to_room: "Ending"
9 door { name: "End Door" }
10}
diff --git a/data/maps/the_ancient/doors.txtpb b/data/maps/the_ancient/doors.txtpb new file mode 100644 index 0000000..894fbf5 --- /dev/null +++ b/data/maps/the_ancient/doors.txtpb
@@ -0,0 +1,18 @@
1doors {
2 name: "Front Door"
3 type: STANDARD
4 panels { room: "Outside" name: "THIS" }
5 location_room: "Outside"
6}
7doors {
8 name: "End Door"
9 type: STANDARD
10 # TODO: all the keyholders!
11 location_room: "Inside"
12}
13doors {
14 name: "Lavender Cubes"
15 type: STANDARD
16 panels { room: "Inside" name: "COLOR" }
17 location_room: "Inside"
18}
diff --git a/data/maps/the_ancient/rooms/Ending.txtpb b/data/maps/the_ancient/rooms/Ending.txtpb new file mode 100644 index 0000000..486ed26 --- /dev/null +++ b/data/maps/the_ancient/rooms/Ending.txtpb
@@ -0,0 +1,3 @@
1name: "Ending"
2display_name: "Ending"
3# TODO: Green Ending
diff --git a/data/maps/the_ancient/rooms/Inside.txtpb b/data/maps/the_ancient/rooms/Inside.txtpb new file mode 100644 index 0000000..d5f869b --- /dev/null +++ b/data/maps/the_ancient/rooms/Inside.txtpb
@@ -0,0 +1,10 @@
1name: "Inside"
2display_name: "Inside"
3panels {
4 name: "COLOR"
5 path: "Panels/panel_2"
6 clue: "color"
7 answer: "lavender"
8 symbols: "example"
9 # TODO: how does this connect to the "lavender_cubes" switch?
10}
diff --git a/data/maps/the_ancient/rooms/Outside.txtpb b/data/maps/the_ancient/rooms/Outside.txtpb new file mode 100644 index 0000000..6f49bba --- /dev/null +++ b/data/maps/the_ancient/rooms/Outside.txtpb
@@ -0,0 +1,8 @@
1name: "Outside"
2display_name: "Outside"
3panels {
4 name: "THIS"
5 path: "Panels/panel_1"
6 clue: "this"
7 answer: "sphinx"
8}
">'..', '.', preg_replace('/([^0-9\.]+)/', '.$1.', str_replace(array('-', '_', '+'), '.', trim($version1))))); $v2 = explode('.', str_replace('..', '.', preg_replace('/([^0-9\.]+)/', '.$1.', str_replace(array('-', '_', '+'), '.', trim($version2))))); // Replace empty entries at the start of the array while (empty($v1[0]) && array_shift($v1)) {} while (empty($v2[0]) && array_shift($v2)) {} // Release state order // '#' stands for any number $versions = array( 'dev' => 0, 'alpha' => 1, 'a' => 1, 'beta' => 2, 'b' => 2, 'RC' => 3, '#' => 4, 'p' => 5, 'pl' => 5); // Loop through each segment in the version string $compare = 0; for ($i = 0, $x = min(count($v1), count($v2)); $i < $x; $i++) { if ($v1[$i] == $v2[$i]) { continue; } $i1 = $v1[$i]; $i2 = $v2[$i]; if (is_numeric($i1) && is_numeric($i2)) { $compare = ($i1 < $i2) ? -1 : 1; break; } // We use the position of '#' in the versions list // for numbers... (so take care of # in original string) if ($i1 == '#') { $i1 = ''; } elseif (is_numeric($i1)) { $i1 = '#'; } if ($i2 == '#') { $i2 = ''; } elseif (is_numeric($i2)) { $i2 = '#'; } if (isset($versions[$i1]) && isset($versions[$i2])) { $compare = ($versions[$i1] < $versions[$i2]) ? -1 : 1; } elseif (isset($versions[$i1])) { $compare = 1; } elseif (isset($versions[$i2])) { $compare = -1; } else { $compare = 0; } break; } // If previous loop didn't find anything, compare the "extra" segments if ($compare == 0) { if (count($v2) > count($v1)) { if (isset($versions[$v2[$i]])) { $compare = ($versions[$v2[$i]] < 4) ? 1 : -1; } else { $compare = -1; } } elseif (count($v2) < count($v1)) { if (isset($versions[$v1[$i]])) { $compare = ($versions[$v1[$i]] < 4) ? -1 : 1; } else { $compare = 1; } } } // Compare the versions if (func_num_args() > 2) { switch ($operator) { case '>': case 'gt': return (bool) ($compare > 0); break; case '>=': case 'ge': return (bool) ($compare >= 0); break; case '<=': case 'le': return (bool) ($compare <= 0); break; case '==': case '=': case 'eq': return (bool) ($compare == 0); break; case '<>': case '!=': case 'ne': return (bool) ($compare != 0); break; case '': case '<': case 'lt': return (bool) ($compare < 0); break; default: return; } } return $compare; } } ?>