Generic Lycanthropic Thespian PC (#1223)

(an instance of Generic Scorpion Player Class made by Marcus)

     The Lycanthrope, prone to changing in the weather, phasing with the moon.
      rainingit
      It has a wolvish touch, under a crescent moon, and growing more so.
     This is a modification of the Scorpion pc. As a lycanthrope,
     its description and that of its worn objects can phase with the
     moon, as well as with daytime and weather.

Go to location of this object, wooden box.


HELP MANUAL:
     #1223, the Generic Lycanthropic Thespian PC, is a child of #153, the themely Scorpion 
PC, with a couple of added capabilities.
     
     As a lycanthropic descendent of #1223, you may include markup strings in your description 
which will cycle or phase:
     
       time of day        it
       MOO-weather        raining
       phase of the moon  It has a wolvish touch, under a crescent moon,
       waxing or waning?   and growing more so.
     
     If included in your description, these strings will be substituted with appropriate 
messages.
     Type @messages me to see the current settings for messages (the default messages 
@day, @full_moon etc. describe the parent lycanthrope).
     (The same set of messages, when found on a worn object or on a costume, will also 
substitute into the @worn message or @role_desc to appear in your description. Make 
yourself a wearable with a full set of weather messages and you can have that wet 
hat.)
     
     As thespians, descendents of #1223 may wear costumes.
     Costumes are descendents of #1226 (the Generic Costume, q.v.) which will alter your 
appearance while you are dressed in them.



VERB SOURCE CODE:

description:
if (valid(costume = this.costume))
    if (costume.location == this)
        desc = costume.role_desc_msg;
    else
        this.costume = $nothing;
        desc = this.description;
    endif
else
    desc = this.description;
endif
costume ? referend = costume | (referend = this);
if (typeof(desc) == STR)
    desc = this:phase_sub(desc, referend);
elseif (typeof(desc) == LIST)
    for l in [1..length(desc)]
        desc[l] = this:phase_sub(desc[l], referend);
    endfor
endif
if (worn = this:get_worn())
    if (typeof(desc) == STR)
        wmsgs = "";
        for w in (worn)
            wmsgs = (wmsgs + " ") + this:phase_sub(this:is_wearable(w), w);
        endfor
        return desc + wmsgs;
    elseif (typeof(desc) == LIST)
        wmsgs = {};
        for w in (worn)
            wmsgs = {@wmsgs, this:phase_sub(this:is_wearable(w), w)};
        endfor
        if (wmsgs)
            return $list_utils:append(desc, wmsgs);
        else
            return desc;
        endif
    else
        return desc;
    endif
else
    return desc;
endif
.


phase_sub:
" Performs a string substitution on a line from the description. ";
" args[2], the referend, is either the player, eir costume, or a worn object";
" The routine presumes that the existence of @day and @full_moon messages indicate 
full sets of corresponding sub properties on referend. ";
line = args[1];
referend = args[2];
if ($object_utils:has_property(referend, "day_msg"))
    line = #1000:weather_daytime(line, referend);
endif
if ($object_utils:has_property(referend, "full_moon_msg"))
    line = #932:moon_phase(line, referend);
endif
return $string_utils:pronoun_sub(line, this, referend);
.


costume:
costume = args[1];
if (costume.location == this)
    if ($object_utils:has_property(costume, "role_msg") && $object_utils:has_property(costume, 
"role_desc_msg"))
        this.costume = costume;
        this:tell(costume:dress_msg(this));
        this.location:announce(costume:odress_msg(this));
    else
        player:tell("The costume keeps slipping off. Forget it.");
    endif
else
    player:tell("You have to be holding the costume to wear it.");
endif
.


uncostume:
costume = args[1];
player:tell(costume:remove_msg());
player.location:announce(costume:oremove_msg());
this.costume = $nothing;
.


titlec:
costumed = pass(@args);
if (valid(costume = this.costume))
    if ((costume.location == this) && costume.role_msg)
        costumed = ((costumed + " [") + costume.role_msg) + "]";
    endif
else
    this.costume = $nothing;
endif
return costumed;
.


remove:
target = player:my_match_object(dobjstr);
if (target == this.costume)
    this:uncostume(target);
else
    pass(@args);
endif
.


wear:
target = player:my_match_object(dobjstr);
if ($object_utils:has_property(target, "role_desc_msg"))
    this:costume(target);
else
    pass(@args);
endif
.



PROPERTY DATA:
      day_msg
      night_msg
      morning_msg
      evening_msg
      warm_msg
      raining_msg
      cool_msg
      snowing_msg
      new_moon_msg
      full_moon_msg
      half_moon_msg
      crescent_moon_msg
      gibbous_moon_msg
      moon_waxing_msg
      moon_waning_msg
      costume

CHILDREN:
Zenith Symantica Nausea Marcus V.Dentata Trismegistos Kalessin Dragonfly Corwin Gaijin Avon Steelgrave Silvia aghari Sweetheart Lachesis Boudicea Puzur Stoan Uptown donnelly Caesar Cleo