Generic Classroom #129
Aliases: school
8 verbs · 72 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
init_for_core | this none this | rxd | #129 | 12 |
learn | this none this | rxd | #129 | 58 |
enterfunc | this none this | rxd | #129 | 85 |
payme | this none this | rxd | #129 | 19 |
o*ut exit leave | none none none | rd | #129 | 5 |
withdraw collect | any none none | rd | #129 | 7 |
clear | this none this | rxd | #129 | 2 |
match_lang | this none this | rxd | #129 | 10 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
level | #129 | rc | #36 | 1 |
skill | #129 | rc | #36 | "" |
steps | #129 | rc | #36 | list of 4{" The professor begins the lecture with a quick review of the prerequisite material.", " He soon advances into ponderous theories and mind-bending facts, advocating the material with sincere gusto.", " You absorb as much as you can, hoping to remember enough for a clearer understanding later.", " The course ends with a quick overview, and you leave the class feeling mentally stimulated."} |
currency | #129 | rc | #36 | "gold" |
trapped | #129 | r | #36 | {} |
student | #129 | r | #36 | 0 |
cash | #129 | r | #36 | 0.0 |
trustees | #129 | rc | #36 | {#2} |
alumni | #129 | r | #36 | {} |
skill_cutoff_mod | #129 | rc | #36 | 0.5 |
virtual_exit_task | #118 | r | #2 | <clear> |
defaulting_exit_oleave_msg | #118 | rc | #36 | <clear> |
blessed_entrances | #118 | rc | #36 | <clear> |
virtual_exits | #118 | rc | #36 | {} |
give_short_alias | #118 | rc | #36 | <clear> |
virtual_exit_to_use | #118 | r | #2 | {} |
lit_from_outside | #118 | rc | #36 | <clear> |
bot_locked | #104 | rc | #36 | <clear> |
fakes | #104 | r | #36 | {"instructor", "teacher"} |
retail | #104 | rc | #36 | <clear> |
seat | #104 | r | #36 | <clear> |
pool | #104 | r | #36 | <clear> |
seat_desc | #104 | r | #36 | <clear> |
pool_desc | #104 | r | #36 | <clear> |
sit_phrase | #104 | rc | #36 | <clear> |
stand_phrase | #104 | rc | #36 | <clear> |
swim_phrase | #104 | rc | #36 | <clear> |
dry_phrase | #104 | rc | #36 | <clear> |
push_phrase | #104 | rc | #36 | <clear> |
seat_aliai | #104 | r | #36 | <clear> |
pool_aliai | #104 | r | #36 | <clear> |
seat_contents | #104 | r | #36 | <clear> |
pool_contents | #104 | r | #36 | <clear> |
seat_max | #104 | r | #36 | <clear> |
pool_max | #104 | r | #36 | <clear> |
details | #104 | rc | #36 | <clear> |
temp_detail_index | #104 | rc | #36 | <clear> |
temp_detail_desc | #104 | rc | #36 | <clear> |
outdoors | #104 | r | #36 | <clear> |
attack_queue | #104 | r | #2 | <clear> |
battle_on | #104 | r | #2 | <clear> |
stop_msg | #104 | rc | #36 | <clear> |
remove_msg | #104 | rc | #36 | <clear> |
dump_msg | #104 | rc | #36 | <clear> |
dump_loc | #104 | rc | #36 | <clear> |
sanctuary | #104 | rc | #36 | <clear> |
ansi_title | #104 | r | #36 | <clear> |
dark_desc | #104 | rc | #36 | <clear> |
title_style | #104 | rc | #36 | <clear> |
build_help | #104 | rc | #36 | list of 22{"Information specific to the generic school:", "", "* @chparent the room outside the classroom to $lobby.", "* Dig a room and name it whatever the name of your class is.", "* There should only be one exit from it and that exit needs to have the aliases out, o, leave and exit.", "* Describe the room and set the following props:", " .currency to the currency you wish to use.", " ex: @set here.currency to \"dollars\"", "", " .steps is set to the announcements you wish the room to make as the student is learning. @notedit here.steps and put each step on a separate line. There are defaults steps for every skill & stat on $edu_stds, so this is not necessary.", "", " .trustees is set to a list of the persons who are permitted to retrieve the money from the room.", " ex: @set here.trustees to {#622, #1276}", "", " .level is set to the level of the room on a scale of from 1 to 8. The room will potentially raise intelligence up to 17.5, but it will require a sequence of classes to achieve this. Level 1 goes up to 10.5, level 2 to 11.5, level 3 to 12.5, and level 4 to 13.5, etc.", " ex: @set here.level to 2", "", " @set here.skill to the name of a player skill or statistic. Be aware that the player statistic filters out candidates, so use discretion on choosing skills that are compatible with the statistic.", " @set here.skill to \"language~\", replacing \"language\" with a language name if you want to teach a specific language instead of a skill. Don't forget the tilde (~) at the end!", "", " @set here.skill_cutoff_mod to a floating point number between 0.1 and 1.0, default is 0.5. This number * here.level equals the maximum level of here.skill that can be learned from the class.", " @set here.skill_cutoff_mod to 0.25 or less for languages."} |
battle_task | #104 | r | #2 | <clear> |
dig_level | #104 | rc | #36 | <clear> |
holes | #104 | r | #2 | <clear> |
help_msg | #104 | rc | #36 | list of 1{"This room works in a fairly self-explanatory method for the student. The trustees of the room may remove the money collected with the use of the command 'withdraw/collect cash/money'."} |
who_location_msg | #3 | rc | #36 | <clear> |
free_home | #3 | rc | #36 | <clear> |
victim_ejection_msg | #3 | rc | #36 | <clear> |
ejection_msg | #3 | rc | #36 | <clear> |
oejection_msg | #3 | rc | #36 | <clear> |
residents | #3 | rc | #36 | <clear> |
free_entry | #3 | rc | #36 | <clear> |
entrances | #3 | c | #36 | <clear> |
blessed_object | #3 | rc | #36 | <clear> |
blessed_task | #3 | rc | #36 | <clear> |
exits | #3 | c | #36 | <clear> |
dark | #3 | rc | #36 | <clear> |
ctype | #3 | rc | #36 | <clear> |
key | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"school"} |
description | #1 | rc | #36 | " The instructor stands at the end of the classroom." |
object_size | #1 | r | #36 | {14049, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #118 virtual exit room → #104 RPG room → #3 generic room → #1 Root Class
Children: none
Call graph
Source
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2if (this == $school) 3this.fakes == {"instructor", "teacher"}; 4else 5for p in (properties($school)) 6if ((!p) in {"build_help", "help_msg"}) 7clear_property(this, p); 8endif 9endfor 10endif 11return pass(@args); 12endif
learn
Referenced by
- #129:enterfunc line 67:
this:learn
Source
1cost = tofloat(random(2) + 1); 2if (!this.skill) 3stat = 3; 4else 5stat = this.skill in player.stats[1]; 6endif 7boost = stat ? cost | (cost * 0.5); 8this.alumni = setadd(this.alumni, player); 9$scheduler:schedule(9000, this, "clear", player); 10if (!stat) 11if (this.skill[$] != "~") 12prop = this.skill; 13sktso = $edu_stds.(prop)[6]; 14skts = {prop, prop, @sktso}; 15adjlist = $edu_stds.(tostr(prop, "_adjust")); 16else 17skts = {@$edu_stds.language[6], "language"}; 18adjlist = $edu_stds.language_adjust; 19lang = this:match_lang(this.skill); 20if (valid(lang)) 21iter = player:roll_against("language") ? 20 | 10; 22if (la = player.race in $list_utils:slice(adjlist)) 23iter = $math_utils:round(adjlist[la][2] * tofloat(iter)); 24endif 25if (!(lang in player.languages[1])) 26player.languages[1] = {@player.languages[1], lang}; 27player.languages[2] = {@player.languages[2], 0.0}; 28endif 29for z in [1..iter] 30$lang_utils:advance_level(player, lang); 31endfor 32endif 33endif 34dilute = tofloat(length(skts)); 35player.stats[2][4] = player.stats[2][4] - (sqrt(cost) * 0.0125); 36player.stats_current[2][4] = player.stats_current[2][4] - (sqrt(cost) * 0.1); 37for skt in (skts) 38adjlist = $edu_stds.(tostr(skt, "_adjust")); 39tweak = (la = player.race in $list_utils:slice(adjlist)) ? adjlist[la][2] | 1.0; 40if (s = skt in player.skills[1]) 41denom = ((player.skills[2][s] + 0.9) * dilute) * 5.0; 42player.skills[2][s] = player.skills[2][s] + ((boost * tweak) / denom); 43elseif (s = skt in player.stats[1]) 44denom = (player.stats_current[2][s] + 0.1) * dilute; 45player.stats[2][s] = player.stats[2][s] + ((boost * tweak) / denom); 46player.stats_current[2][s] = player.stats_current[2][s] + ((boost * tweak) / denom); 47endif 48endfor 49else 50player.stats[2][4] = player.stats[2][4] - (sqrt(cost) * 0.025); 51player.stats_current[2][4] = player.stats_current[2][4] - (sqrt(cost) * 0.1); 52adjlist = $edu_stds.(tostr(player.stats[1][stat], "_adjust")); 53if (la = player.race in $list_utils:slice(adjlist)) 54cost = adjlist[la][2] * cost; 55endif 56player.stats[2][stat] = player.stats[2][stat] + (cost * 0.1); 57player.stats_current[2][stat] = player.stats_current[2][stat] + (cost * 0.1); 58endif
enterfunc
Referenced by
none
Source
1"WIZ PERMS...need to be able alter props on this room and player."; 2pass(@args); 3object = args[1]; 4suspend(2); 5"Test for qualifications and collect money."; 6if (player != object) 7return; 8endif 9if (this.student) 10return object:tell("The class is already in progress. Come back later."); 11endif 12if (this.level > 8) 13this.level = 8; 14endif 15if (!this.skill) 16"general intelligence"; 17under = (($edu_stds.intelligence[1] + tofloat(this.level)) > object.stats_current[2][3]) ? 1 | 0; 18over = (($edu_stds.intelligence[2] + tofloat(this.level)) < object.stats_current[2][3]) ? 1 | 0; 19elseif (si = this.skill in player.stats[1]) 20"a stat"; 21under = (($edu_stds.(this.skill)[1] + tofloat(this.level)) > object.stats_current[2][si]) ? 1 | 0; 22over = (($edu_stds.(this.skill)[2] + tofloat(this.level)) < object.stats_current[2][si]) ? 1 | 0; 23elseif ((this.skill[$] == "~") && valid(lang = this:match_lang(this.skill))) 24"a language"; 25if (!(lin = lang in object.languages[1])) 26under = ((this.level > 1) || ($math_utils:round(object.skills[2]["language" in object.skills[1]]) < (length(object.languages[1]) - 2))) ? 1 | 0; 27under && object:tell("(((Language skill too low to learn additional languages)))"); 28else 29under = (object.languages[2][lin] < ((tofloat(this.level) - 0.01) / 4.0)) ? 1 | 0; 30under && object:tell("(((", lang.lang_name, " ability too low for this class)))"); 31endif 32if (!under) 33over = (object.languages[2][lin] > ((tofloat(this.level) / 4.0) + 0.24)) ? 1 | 0; 34endif 35else 36"a skill"; 37level = (this.level + 1) / 2; 38over = (object.skills[2][this.skill in object.skills[1]] >= (tofloat(this.level) / 2.0)) ? 1 | 0; 39under = (object.skills[2][this.skill in object.skills[1]] < ((tofloat(this.level) / 2.0) - 0.5)) ? 1 | 0; 40if (!under) 41for n in [1..4] 42under = ($edu_stds.(this.skill)[level][n] > object.stats_current[2][n]) ? 1 | 0; 43if (under) 44object:tell("(((", $rpgamer.stats[1][n], " too low)))"); 45break; 46endif 47endfor 48else 49object:tell("(((", this.skill, " too low)))"); 50endif 51endif 52if (under) 53object:tell("This class seems to be too advanced for you."); 54elseif ((((this.skill && (this.skill[$] == "~")) && valid(lang = this:match_lang(this.skill))) && (s = lang in object.languages[1])) && (object.languages[2][s] >= (tofloat(this.level) * this.skill_cutoff_mod))) 55object:tell("Your ", lang.lang_name, " language skill exceeds the level of this class."); 56elseif ((s = this.skill in object.skills[1]) && (object.skills[2][s] >= (tofloat(this.level) * this.skill_cutoff_mod))) 57object:tell("Your ", object.skills[1][s], " skill exceeds the level of this class."); 58elseif (over && (!s)) 59object:tell("Unfortunately, this class can teach you nothing new."); 60elseif (object in this.alumni) 61object:tell("There's much for you to learn here, but studying has taken its toll on your health. You need to rest a couple of hours before returning."); 62else 63this:payme(); 64endif 65if (this.student) 66this.trapped = {@this.trapped, object}; 67this:learn(); 68"Do the roleplay sequence."; 69if (this.steps != $school.steps) 70steps = this.steps; 71else 72skeel = (this.skill && (this.skill[$] == "~")) ? "language" | this.skill; 73steps = (!skeel) ? this.steps | $edu_stds.(tostr(skeel, "_steps")); 74steps = ((length(steps) == 1) && (steps[1][1] == "*")) ? $edu_stds.(steps[1][2..$]) | steps; 75endif 76skeel = (this.skill && (this.skill[$] == "~")) ? tostr(this.skill[1..$ - 1], " language") | this.skill; 77skeel = skeel ? skeel | "subject"; 78for line in (steps) 79suspend(10); 80object:tell($string_utils:substitute(line, {{"%<skill>", skeel}})); 81endfor 82"unlock the door."; 83this.trapped = setremove(this.trapped, object); 84this.student = 0; 85endif
payme
Referenced by
- #129:enterfunc line 63:
this:payme
Source
1"This rate formula assumes a gold piece is worth about a dollar. Increase the last number of the next line if inflation gets out of hand."; 2skmod = (this.skill in player.stats[1]) ? $edu_stds.(this.skill)[3] | `$edu_stds.(this.skill)[5] ! ANY => $edu_stds.intelligence[3]'; 3rate = $money_utils:_from_to("gold", this.currency, $edu_stds.gold_price_basis) * skmod; 4stat = (si = this.skill in player.stats[1]) ? si | 3; 5price = (tofloat(this.level + 1) * rate) * (player.stats_current[2][stat] / 10.0); 6player:tell("It will cost ", floatstr(price, 2), " ", this.currency, " to train here."); 7if (!$command_utils:yes_or_no("Do you wish to proceed?")) 8return player:tell("You are free to leave."); 9endif 10if (!$money_utils:_has_currency(this.currency)) 11return player:tell("You don't have any ", this.currency, "."); 12endif 13left = player:_rem_money(this.currency, tofloat(price)); 14if (left != 0) 15return player:tell("You don't have enough ", this.currency, "."); 16endif 17$you:say_action("%N %<pays> %p fee and %<waits> for instruction."); 18this.student = 1; 19this.cash = this.cash + tofloat(price);
o*ut exit leave
Referenced by
none
Source
1if (player in this.trapped) 2player:tell("\"Relax...there's more to learn.\""); 3else 4this:here_huh(verb, args); 5endif
withdraw collect
Referenced by
none
Source
1if ((player in this.trustees) && (dobjstr in {"cash", "money"})) 2player:_add_money(this.currency, tofloat(this.cash)); 3player:tell("You receive ", tofloat(this.cash), " ", this.currency, " from the classroom depository."); 4this.cash = 0.0; 5else 6player:tell("I don't understand that."); 7endif
clear
Referenced by
none
Source
1p = args[1]; 2this.alumni = setremove(this.alumni, p);
match_lang
Referenced by
- #129:learn line 19:
this:match_lang - #129:enterfunc line 23:
this:match_lang - #129:enterfunc line 54:
this:match_lang - #165:dr*op line 14:
$school:match_lang - #165:dr*op line 29:
$school:match_lang
Source
1langname = args[1][1..$ - 1]; 2targets = {}; 3for l in (children($lang)) 4targets = {@targets, {l, l.lang_name}}; 5endfor 6if (x = langname in $list_utils:slice(targets, 2)) 7return targets[x][1]; 8else 9return $failed_match; 10endif