Park City Builder #164

Parent #8Owner #2Flags Source RPG Core/rpgcore-patched.db

Aliases: city builder, red button, button, builder, black box, box

3 verbs · 53 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
pr*ess pu*shany any anyrxd#164158
make_generic_cornerthis none thisrxd#16419
make_park_exitsthis none thisrxd#164174

Properties

PropertyDefinerFlagsOwnerValue
avenues#164rc#2
list of 20{"1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", "13th", "14th", "15th", "16th", "17th", "18th", "19th", "20th"}
streets#164rc#2
list of 20{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T"}
corners#164rc#2{}
corner_desc#164rc#2{" The asphalt streets have concrete curbs and sidewalks, with a black metal lamppost at each sidewalk corner. Most of the streetfront facades are constructed of reddish brick."}
corner_fakes#164rc#2{"streets", "sidewalks", "facades", "bricks"}
corner_details#164rc#2
list of 1{{{"lampposts", "lamps"}, {"Tapering upward, with the arches pointing toward the center of the intersection, each tipped with a halide lamp; the black fluted metal appears to be hollow iron."}}}
corner_seats#164rc#2{"the curb", "curb", "curbs", "down"}
corner_seat_desc#164rc#2"The curbs are molded concrete, marred from black auto tires and scraps of clinging trash."
park_desc#164rc#2{" Tall, thick oak and maple trees line the brick paths that meander through the park. A bench is conveniently located every few yards."}
park_fakes#164rc#2{"trees", "oaks", "maples", "paths", "bricks"}
park_details#164rc#2{}
park_seats#164rc#2{"the bench", "bench"}
park_seat_desc#164rc#2"The bench is constructed of wooden slats on a metal frame, and painted dark green."
no_can_go_msg#164rc#2"Dense landscaping blocks the way."
oclose_msg#8rc#2<clear>
close_msg#8rc#2<clear>
oopen_msg#8rc#2<clear>
open_msg#8rc#2<clear>
oput_fail_msg#8rc#2<clear>
put_fail_msg#8rc#2<clear>
opaque#8r#2<clear>
dark#8r#2<clear>
oremove_fail_msg#8rc#2<clear>
oremove_msg#8rc#2<clear>
remove_fail_msg#8rc#2<clear>
remove_msg#8rc#2<clear>
oput_msg#8rc#2<clear>
put_msg#8rc#2<clear>
oopen_fail_msg#8rc#2<clear>
open_fail_msg#8rc#2<clear>
empty_msg#8rc#2<clear>
opened#8r#2<clear>
open_key#8c#2<clear>
drop_failed_msg#5rc#2<clear>
drop_succeeded_msg#5rc#2<clear>
odrop_failed_msg#5rc#2<clear>
odrop_succeeded_msg#5rc#2<clear>
otake_succeeded_msg#5rc#2<clear>
otake_failed_msg#5rc#2<clear>
take_succeeded_msg#5rc#2<clear>
take_failed_msg#5rc#2<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#2<clear>
key#1c#20
aliases#1rc#2{"city builder", "red button", "button", "builder", "black box", "box"}
description#1rc#2"A flat black box with a single red button."
object_size#1r#36{0, 0}
html#1rc#2<clear>

Ancestry

Ancestors (nearest first): #8 generic container#5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n164_0 #164:pr*ess n35_1 #35:say_action n164_0->n35_1 n6_10 #6:notify n164_0->n6_10 n56_4 #56:yes_or_no n164_0->n56_4 n56_2 #56:read n164_0->n56_2 n56_1 #56:player_match_result n164_0->n56_1 n20_20 #20:match_player n164_0->n20_20 n80_21 #80:summarize_one_user n164_0->n80_21 n80_10 #80:get_quota n164_0->n80_10 n6_18 #6:tell n164_0->n6_18 n20_59 #20:name_and_number n164_0->n20_59 n20_15 #20:capitalize n164_0->n20_15 n63_2 #63:_create n164_0->n63_2 n80_19 #80:object_bytes n164_0->n80_19 n24_2 #24:set_owner n164_0->n24_2 n21_1 #21:set_names n164_0->n21_1 n164_1 #164:make_generic_corner n164_0->n164_1 n164_2 #164:make_park_exits n164_0->n164_2 n164_1->n6_10 n164_1->n63_2 n164_1->n80_19 n164_1->n21_1 n164_2->n6_10 n164_2->n63_2 n164_2->n80_19 n164_2->n21_1

Source

pr*ess pu*sh

Spec any any anyFlags rxdOwner #2Definer #164

Referenced by

none

Source

1$you:say_action("%N %<presses/press> the red button on a small black box. Bzzz!");
2if (!player.wizard)
3return player:notify("This device will only work for a wizard.");
4elseif ($command_utils:yes_or_no("Do you really want to build a city, and have you decided on the builder character to own the rooms?"))
5oname = $command_utils:read("who will own this school");
6if ($command_utils:player_match_failed(owner = $string_utils:match_player(oname), oname))
7return player:notify("There is no such player (process aborted).");
8elseif (owner.wizard)
9return player:notify("The owner should not be a wizard (process aborted).");
10endif
11csize = $command_utils:yes_or_no("Will this be a large city with a central park?");
12if (csize)
13cname = "Park City";
14horil = 19;
15vertl = 19;
16else
17cname = "Gitterberg";
18horil = 0;
19while ((horil < 1) || (horil > 20))
20horil = toint($command_utils:read("the distance across, East-West, in city blocks (20 max)"));
21endwhile
22vertl = 0;
23while ((vertl < 1) || (vertl > 20))
24vertl = toint($command_utils:read("the distance across, North-South, in city blocks (20 max)"));
25endwhile
26endif
27if ((qneed = $quota_utils:summarize_one_user(owner)[1] + ((horil * vertl) * 1750)) > $quota_utils:get_quota(owner))
28return player:tell("Increase the quota of ", $string_utils:nn(owner), " to about ", qneed, " bytes and try again.");
29endif
30cname = (cnom = $command_utils:read(tostr("what the city will be named (a blank response will result in the name \"", cname, "\")"))) ? $string_utils:capitalize(cnom) | cname;
31woods = csize ? $command_utils:yes_or_no("Will the park be heavily wooded?") | 0;
32player:notify("...prepping the realm wrapper");
33city = $recycler:_create($realm, owner);
34$byte_quota_utils:object_bytes(city);
35oowner = this.owner;
36$wiz_utils:set_owner(this, owner);
37city:moveto(this);
38suspend(1) || $wiz_utils:set_owner(this, oowner);
39$building_utils:set_names(city, cname);
40player:notify("...creating the generic street corner");
41gen_corner = this:make_generic_corner(city, owner);
42player:notify("...creating each row of streets, from North to South");
43this.corners = {};
44if (csize)
45for street in [1..20]
46this.corners = {@this.corners, {}};
47for avenue in [1..20]
48((!(avenue % 13)) && (!suspend(0))) && player:tell("...building ", this.avenues[avenue], " Avenue & ", this.streets[street], " Street");
49if (!((((street > 6) && (street < 15)) && (avenue > 6)) && (avenue < 15)))
50corner = $recycler:_create(gen_corner, owner);
51$byte_quota_utils:object_bytes(corner);
52corner:moveto(city);
53vert = (street < 11) ? "N. " | "S. ";
54hori = (avenue < 5) ? " West" | " East";
55(ticks_left() < 8000) && suspend(0);
56$building_utils:set_names(corner, tostr(vert, this.avenues[avenue], " Avenue & ", this.streets[street], " Street", hori));
57this.corners[street] = {@this.corners[street], corner};
58endif
59endfor
60endfor
61player:notify("...making e the central park");
62park = $recycler:_create($terrain, owner);
63$byte_quota_utils:object_bytes(park);
64park:moveto(city);
65$building_utils:set_names(park, tostr(cname, " Park"));
66park.description = this.park_desc;
67park.fakes = this.park_fakes;
68park.details = this.park_details;
69park.seat = `this.park_seats[1] ! ANY => ""';
70park.seat_aliai = `this.park_seats[2..$] ! ANY => {}';
71park.seat_desc = this.park_seat_desc ? this.park_seat_desc | $veroom.seat_desc;
72park.title_style = 1;
73park.seat_max = `this.park_seats[1] ! ANY => 0' ? 4 | 1;
74park.room_type = woods;
75park.no_can_go_msg = this.no_can_go_msg;
76player:notify("...making the corner virtual exits");
77for y in [1..length(this.corners)]
78for x in [1..length(this.corners[y])]
79(ticks_left() < 8000) && suspend(0);
80room = this.corners[y][x];
81"north dest";
82if ((y == 7) && (x > 14))
83north = this.corners[y - 1][x + 8];
84elseif (((y == 15) && (x > 6)) && (x < 15))
85north = $nothing;
86else
87north = `this.corners[y - 1][x] ! ANY => $nothing';
88endif
89room.virtual_exits = valid(north) ? {@room.virtual_exits, {{"North [n]", "n", "North"}, north, 0}} | room.virtual_exits;
90"south dest";
91if (((y == 6) && (x > 6)) && (x < 15))
92south = $nothing;
93elseif ((y == 14) && (x > 14))
94south = this.corners[y + 1][x + 8];
95else
96south = `this.corners[y + 1][x] ! ANY => $nothing';
97endif
98room.virtual_exits = valid(south) ? {@room.virtual_exits, {{"South [s]", "s", "South"}, south, 0}} | room.virtual_exits;
99"east dest";
100if (((y > 6) && (y < 15)) && (x == 6))
101east = $nothing;
102else
103east = `this.corners[y][x + 1] ! ANY => $nothing';
104endif
105room.virtual_exits = valid(east) ? {@room.virtual_exits, {{"East [e]", "e", "East"}, east, 0}} | room.virtual_exits;
106"west dest";
107if (((y > 6) && (y < 15)) && (x == 15))
108west = $nothing;
109else
110west = `this.corners[y][x - 1] ! ANY => $nothing';
111endif
112room.virtual_exits = valid(west) ? {@room.virtual_exits, {{"West [w]", "w", "West"}, west, 0}} | room.virtual_exits;
113endfor
114endfor
115player:notify("...making the park $terrexits");
116this:make_park_exits(park, owner);
117else
118for street in [1..vertl]
119this.corners = {@this.corners, {}};
120for avenue in [1..horil]
121((!(avenue % (horil / 2))) && (!suspend(0))) && player:tell("...building ", this.avenues[avenue], " Avenue & ", this.streets[street], " Street");
122((ticks_left() < 10000) || (seconds_left() < 5)) && suspend(0);
123corner = $recycler:_create(gen_corner, owner);
124(ticks_left() < 8000) && suspend(0);
125$byte_quota_utils:object_bytes(corner);
126corner:moveto(city);
127vert = (street < (vertl / 2)) ? "N. " | "";
128vert = (street > (vertl / 2)) ? "S. " | vert;
129hori = (avenue < (horil / 2)) ? " West" | "";
130hori = (avenue > (horil / 2)) ? " East" | hori;
131$building_utils:set_names(corner, tostr(vert, this.avenues[avenue], " Avenue & ", this.streets[street], " Street", hori));
132this.corners[street] = {@this.corners[street], corner};
133endfor
134endfor
135suspend(5) || player:notify("...making the corner virtual exits");
136for y in [1..length(this.corners)]
137lx = length(this.corners[y]);
138suspend(0);
139for x in [1..lx]
140(!(x % lx)) && suspend(0);
141room = this.corners[y][x];
142(ticks_left() < 8000) && suspend(0);
143north = `this.corners[y - 1][x] ! ANY => $nothing';
144room.virtual_exits = valid(north) ? {@room.virtual_exits, {{"North [n]", "n", "North"}, north, 0}} | room.virtual_exits;
145south = `this.corners[y + 1][x] ! ANY => $nothing';
146room.virtual_exits = valid(south) ? {@room.virtual_exits, {{"South [s]", "s", "South"}, south, 0}} | room.virtual_exits;
147east = `this.corners[y][x + 1] ! ANY => $nothing';
148room.virtual_exits = valid(east) ? {@room.virtual_exits, {{"East [e]", "e", "East"}, east, 0}} | room.virtual_exits;
149west = `this.corners[y][x - 1] ! ANY => $nothing';
150room.virtual_exits = valid(west) ? {@room.virtual_exits, {{"West [w]", "w", "West"}, west, 0}} | room.virtual_exits;
151endfor
152endfor
153endif
154player:tell("All done... @go ", this.corners[random($)][random($)], " and check it out.");
155else
156player:notify("Okay. Try again later.");
157endif
158this.corners = {};

make_generic_corner

Spec this none thisFlags rxdOwner #2Definer #164

Referenced by

Source

1if (!player.wizard)
2return player:notify("This device will only work for a wizard.");
3else
4city = args[1];
5owner = args[2];
6corner = $recycler:_create($veroom, owner);
7$byte_quota_utils:object_bytes(corner);
8corner:moveto(city);
9$building_utils:set_names(corner, "Street Corner");
10corner.description = this.corner_desc;
11corner.fakes = this.corner_fakes;
12corner.details = this.corner_details;
13corner.seat = `this.corner_seats[1] ! ANY => ""';
14corner.seat_aliai = `this.corner_seats[2..$] ! ANY => {}';
15corner.seat_desc = this.corner_seat_desc ? this.corner_seat_desc | $veroom.seat_desc;
16corner.title_style = 1;
17corner.seat_max = `this.corner_seats[1] ! ANY => 0' ? 10 | 1;
18return corner;
19endif

make_park_exits

Spec this none thisFlags rxdOwner #2Definer #164

Referenced by

Source

1if (!player.wizard)
2return player:notify("This device will only work for a wizard.");
3else
4park = args[1];
5owner = args[2];
6(ticks_left() < 4000) && suspend(0);
7player:notify("NORTH PARK GATE");
8gate = $recycler:_create($terrexit, owner);
9$byte_quota_utils:object_bytes(gate);
10$building_utils:set_names(gate, "North [n],n,North");
11gate.source = park;
12gate.dest = this.corners[6][10];
13gate.x_loc = 4;
14gate.y_loc = 1;
15gate.source:add_exit(gate);
16gate.dest:add_entrance(gate);
17gate = $recycler:_create($terrexit, owner);
18$byte_quota_utils:object_bytes(gate);
19$building_utils:set_names(gate, "South [s],s,South");
20gate.source = this.corners[6][10];
21gate.dest = park;
22gate.x_loc = 4;
23gate.y_loc = 1;
24gate.source:add_exit(gate);
25gate.dest:add_entrance(gate);
26move(gate, $nothing);
27"";
28player:notify("NORTHEAST PARK GATE");
29gate = $recycler:_create($terrexit, owner);
30$byte_quota_utils:object_bytes(gate);
31$building_utils:set_names(gate, "Northeast [ne],ne,Northeast");
32gate.source = park;
33gate.dest = this.corners[6][15];
34gate.x_loc = 8;
35gate.y_loc = 1;
36gate.source:add_exit(gate);
37gate.dest:add_entrance(gate);
38gate = $recycler:_create($terrexit, owner);
39$byte_quota_utils:object_bytes(gate);
40$building_utils:set_names(gate, "Southwest [sw],sw,Southwest");
41gate.source = this.corners[6][15];
42gate.dest = park;
43gate.x_loc = 8;
44gate.y_loc = 1;
45gate.source:add_exit(gate);
46gate.dest:add_entrance(gate);
47move(gate, $nothing);
48(ticks_left() < 4000) && suspend(0);
49player:notify("EAST PARK GATE");
50gate = $recycler:_create($terrexit, owner);
51$byte_quota_utils:object_bytes(gate);
52$building_utils:set_names(gate, "East [e],e,East");
53gate.source = park;
54gate.dest = this.corners[10][7];
55gate.x_loc = 8;
56gate.y_loc = 4;
57gate.source:add_exit(gate);
58gate.dest:add_entrance(gate);
59gate = $recycler:_create($terrexit, owner);
60$byte_quota_utils:object_bytes(gate);
61$building_utils:set_names(gate, "West [w],w,West");
62gate.source = this.corners[10][7];
63gate.dest = park;
64gate.x_loc = 8;
65gate.y_loc = 4;
66gate.source:add_exit(gate);
67gate.dest:add_entrance(gate);
68move(gate, $nothing);
69"";
70player:notify("SOUTHEAST PARK GATE");
71gate = $recycler:_create($terrexit, owner);
72$byte_quota_utils:object_bytes(gate);
73$building_utils:set_names(gate, "Southeast [se],se,Southeast");
74gate.source = park;
75gate.dest = this.corners[15][15];
76gate.x_loc = 8;
77gate.y_loc = 8;
78gate.source:add_exit(gate);
79gate.dest:add_entrance(gate);
80gate = $recycler:_create($terrexit, owner);
81$byte_quota_utils:object_bytes(gate);
82$building_utils:set_names(gate, "Northwest [nw],nw,Northwest");
83gate.source = this.corners[15][15];
84gate.dest = park;
85gate.x_loc = 8;
86gate.y_loc = 8;
87gate.source:add_exit(gate);
88gate.dest:add_entrance(gate);
89move(gate, $nothing);
90(ticks_left() < 4000) && suspend(0);
91player:notify("SOUTH PARK GATE");
92gate = $recycler:_create($terrexit, owner);
93$byte_quota_utils:object_bytes(gate);
94$building_utils:set_names(gate, "South [s],s,South");
95gate.source = park;
96gate.dest = this.corners[15][11];
97gate.x_loc = 5;
98gate.y_loc = 8;
99gate.source:add_exit(gate);
100gate.dest:add_entrance(gate);
101gate = $recycler:_create($terrexit, owner);
102$byte_quota_utils:object_bytes(gate);
103$building_utils:set_names(gate, "North [n],n,North");
104gate.source = this.corners[15][11];
105gate.dest = park;
106gate.x_loc = 5;
107gate.y_loc = 8;
108gate.source:add_exit(gate);
109gate.dest:add_entrance(gate);
110move(gate, $nothing);
111"";
112player:notify("SOUTHWEST PARK GATE");
113gate = $recycler:_create($terrexit, owner);
114$byte_quota_utils:object_bytes(gate);
115$building_utils:set_names(gate, "Southwest [sw],sw,Southwest");
116gate.source = park;
117gate.dest = this.corners[15][6];
118gate.x_loc = 1;
119gate.y_loc = 8;
120gate.source:add_exit(gate);
121gate.dest:add_entrance(gate);
122gate = $recycler:_create($terrexit, owner);
123$byte_quota_utils:object_bytes(gate);
124$building_utils:set_names(gate, "Northeast [ne],ne,Northeast");
125gate.source = this.corners[15][6];
126gate.dest = park;
127gate.x_loc = 1;
128gate.y_loc = 8;
129gate.source:add_exit(gate);
130gate.dest:add_entrance(gate);
131move(gate, $nothing);
132(ticks_left() < 4000) && suspend(0);
133player:notify("WEST PARK GATE");
134gate = $recycler:_create($terrexit, owner);
135$byte_quota_utils:object_bytes(gate);
136$building_utils:set_names(gate, "West [w],w,West");
137gate.source = park;
138gate.dest = this.corners[11][6];
139gate.x_loc = 1;
140gate.y_loc = 5;
141gate.source:add_exit(gate);
142gate.dest:add_entrance(gate);
143gate = $recycler:_create($terrexit, owner);
144$byte_quota_utils:object_bytes(gate);
145$building_utils:set_names(gate, "East [e],e,East");
146gate.source = this.corners[11][6];
147gate.dest = park;
148gate.x_loc = 1;
149gate.y_loc = 5;
150gate.source:add_exit(gate);
151gate.dest:add_entrance(gate);
152move(gate, $nothing);
153"";
154player:notify("NORTHWEST PARK GATE");
155gate = $recycler:_create($terrexit, owner);
156$byte_quota_utils:object_bytes(gate);
157$building_utils:set_names(gate, "Northwest [nw],nw,Northwest");
158gate.source = park;
159gate.dest = this.corners[6][6];
160gate.x_loc = 1;
161gate.y_loc = 1;
162gate.source:add_exit(gate);
163gate.dest:add_entrance(gate);
164gate = $recycler:_create($terrexit, owner);
165$byte_quota_utils:object_bytes(gate);
166$building_utils:set_names(gate, "Southeast [se],se,Southeast");
167gate.source = this.corners[6][6];
168gate.dest = park;
169gate.x_loc = 1;
170gate.y_loc = 1;
171gate.source:add_exit(gate);
172gate.dest:add_entrance(gate);
173move(gate, $nothing);
174endif