@create #258 named generic Academy room:a,room
@prop #146."coursedesc" {} rc
@prop #146."course_text" {} rc
@prop #146."course_atts" {} rc
@prop #146."courses" {} rc
@prop #146."sign_msg" "A sign on the wall announces that members may enroll in the following courses here:" rc
"#146.("misc_notes") => E_PERM (Permission denied)
"#146.("magic_effects") => E_PERM (Permission denied)
"#146.("combat_effects") => E_PERM (Permission denied)
"#146.("unannounced") => E_PERM (Permission denied)
"#146.("allowed_exits") => E_PERM (Permission denied)
;;#146.("dawn_msg") = ""
;;#146.("night_msg") = ""
;;#146.("dusk_msg") = ""
;;#146.("day_msg") = ""
;;#146.("free_entry") = 0
"#146.("entrances") => E_PERM (Permission denied)
"#146.("exits") => E_PERM (Permission denied)
;;#146.("ctype") = 0
"#146.("key") => E_PERM (Permission denied)
;;#146.("aliases") = {"a", "room"}
;;#146.("object_size") = {5101, 1141286558}

@verb #146:"enrol*l" any none none rxd
@program #146:enroll
"enrol <coursename>";
"Enrol in a course to improve all or some of the attributes in the appropriate 'course_atts' index.";
rpg = $local.rpg;
if (!(cnum = dobjstr in this.courses))
  rpg:playertell(player, "Sorry, that course isn't available here.");
  return;
endif
total = rpg:train(player, atts = this.course_atts[cnum]);
if (total == E_NONE)
  rpg:playertell(player, "You have no idea what's going on.  Embarrassed, you try to sneak out un-noticed.");
  this:announce($string_utils:pronoun_sub("%N %<edges> towards the exit, looking very out of place.  Could %s be a spy?"));
  return total;
elseif (total == E_QUOTA)
  rpg:playertell(player, "Your body and mind are unfocused; you couldn't possibly pass a course now.  Maybe you should go out and work off the tension.");
  this:announce($string_utils:pronoun_sub("%N %<mopes> aimlessly around %l."));
  return total;
endif
"Should probably add 'ocourse_msgs' or something here.";
this:announce($string_utils:pronoun_sub(("%N %<fills> out the enrollment forms for " + dobjstr) + ".  %S %<is> led away to begin %p training."));
player:tell_lines(this.course_text[cnum]);
if (!total)
  rpg:playertell(player, "You just can't seem to grasp what this course is trying to teach you.");
  this:announce($string_utils:pronoun_sub("%N %<returns>, looking somewhat disappointed."));
elseif (total == length(atts))
  rpg:playertell(player, "You feel a great sense of accomplishment as you complete the course.");
  this:announce($string_utils:pronoun_sub("Someone appears from the training area, a glow of accomplishment on %p face.  You recognise %o as a new, enlightened %n."));
else
  rpg:playertell(player, "You have now reached your full potential in this area.");
  rpg:playertell(player, "You are obviously running low on potential, but may be able to improve another ability.");
  this:announce($string_utils:pronoun_sub("%N returns from %p training, looking somewhat more than what %s was before."));
endif
"Quinn 11-AUG-93 0648: Re-written; added more verbose result messages; added omessages for the room.";
.

@verb #146:"look_self" this any none rxd
@program #146:look_self
"Show the courses available, and their brief descriptions.";
pass(@args);
if (nc = length(this.courses))
  player:tell_lines(this.sign_msg);
  for k in [1..nc]
    player:tell(this.courses[k], " : ", this.coursedesc[k]);
  endfor
else
  player:tell("No courses seem to be available here.");
endif
.

@verb #146:"add_course" this none this
@program #146:add_course
":add_course(name, desc, text, atts)";
"Add a course with the given attributes.";
"name -- What coursename the student should request.";
"desc -- A one-liner describing the course.";
"text -- Text displayed to student when course is taken.";
"atts -- Attributes to be increased, in order.";
if (!$local.rpg:is_grandmaster(caller_perms()))
  return E_PERM;
elseif (length(args) < 4)
  return E_ARGS;
endif
this.courses = listappend(this.courses, args[1]);
this.coursedesc = listappend(this.coursedesc, args[2]);
this.course_text = listappend(this.course_text, args[3]);
this.course_atts = listappend(this.course_atts, args[4]);
return this.courses;
.

"***finished***