you #35

Parent #94Owner #36Flags readSource RPG Core/rpgcore-patched.db

Aliases: you

4 verbs · 25 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
verb_subthis none thisrxd#3518
say_actionthis none thisrx#3533
fixposthis none thisrxd#356
say_action2this none thisrx#3514

Properties

PropertyDefinerFlagsOwnerValue
conjugations#35r#36{{"is", "are"}, {"was", "were"}, {"does", "do"}, {"has", "have"}}
help_msg#35rc#36
list of 18{"This object is useful for announcing messages that switch between third and second person when addressed to the appropriate parties in a room.", "", "Verbs:", "", " :verb_sub(STR verbspec) -> conjugates the given verb into singular form", " :say_action(message [,who [,thing, [,where]]]) -> appropriately pronoun ", " substituted message announced to where, which defaults to who.location", " where who defaults to player.", " Ex: if player=#123 (Munchkin), dobj=#456 (Frebblebit), and iobj=#789", " (Bob) and they are all in the same room,", " $you:say_action(\"%N %<waves> happily to %d and %i.\") would do this:", "", "Munchkin sees: You wave happily to Frebblebit and Bob.", "Frebblebit sees: Munchkin waves happily to you and Bob.", "Bob sees: Munchkin waves happily to Frebblebit and you.", "Everyone else sees: Munchkin waves happily to Frebblebit and Bob.", "", " :say_action2(actor, recipient, message) -> Like :say_action, but preparses cases where the actor is not player, or actor==dobj (the recipient)"}
gender#94rc#36"2nd"
pqc#94rc#36"Yours"
pq#94rc#36"yours"
ppc#94rc#36"Your"
pp#94rc#36"your"
prc#94rc#36"Yourself"
pr#94rc#36"yourself"
poc#94rc#36"You"
po#94rc#36"you"
psc#94rc#36"You"
ps#94rc#36"you"
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#36<clear>
key#1c#36<clear>
aliases#1rc#36{"you"}
description#1rc#36{"An object useful for pronoun substitution for switching between third and second person. See `help $you' for details."}
object_size#1r#36{6514, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #94 Generic Gendered Object#102 subthing#1 Root Class

Children: none

Call graph

calls n35_0 #35:verb_sub n35_0->n35_0 n35_1 #35:say_action n20_34 #20:pronoun_sub n35_1->n20_34 n35_2 #35:fixpos n35_1->n35_2 n52_3 #52:has_callable_verb n35_1->n52_3 n20_14 #20:uppercase n35_2->n20_14 n35_3 #35:say_action2 n35_3->n35_1 n35_3->n20_34

Source

verb_sub

Spec this none thisFlags rxdOwner #36Definer #35

Referenced by

Source

1"$you:verb_sub(STR verbspec) -> returns verbspec conjugated for singular use as if `you' were saying it.";
2return $gender_utils:get_conj(args[1], this);
3x = args[1];
4len = length(x);
5if ((len > 3) && (rindex(x, "n't") == (len - 3)))
6return this:verb_sub(x[1..len - 3]) + "n't";
7endif
8for y in (this.conjugations)
9if (x == y[1])
10return y[2];
11endif
12endfor
13for y in ({{"ches", "ch"}, {"ies", "y"}, {"sses", "ss"}, {"shes", "sh"}, {"s", ""}})
14if ((len > length(y[1])) && (rindex(x, y[1]) == ((len - length(y[1])) + 1)))
15return x[1..len - length(y[1])] + y[2];
16endif
17endfor
18return x;

say_action

Spec this none thisFlags rxOwner #36Definer #35

Referenced by

Source

1"$you:say_action(message [,who [,thing, [,where]]]).";
2"announce 'message' with pronoun substitution as if it were just ";
3"  where:announce_all($string_utils:pronoun_sub(message, who, thing, where)); ";
4"except that who (player), dobj, and iobj get modified messages, with the appropriate use of 'you' instead of their name.";
5"who   default player";
6"thing default object that called this verb";
7"where default who.location";
8{msg, ?who = player, ?thing = caller, ?where = who.location} = args;
9you = this;
10if (typeof(msg) == LIST)
11tell = "";
12for x in (msg)
13tell = tell + ((typeof(x) == STR) ? x | x[random(length(x))]);
14endfor
15else
16tell = msg;
17endif
18who:tell($string_utils:pronoun_sub(this:fixpos(tell, "%n"), you, thing, where));
19if ($object_utils:has_callable_verb(where, "announce_all_but"))
20where:announce_all_but({dobj, who, iobj}, $string_utils:pronoun_sub(tell, who, thing, where));
21endif
22if (valid(dobj) && (dobj != who))
23x = dobj;
24dobj = you;
25x:tell($string_utils:pronoun_sub(this:fixpos(tell, "%d"), who, thing, where));
26dobj = x;
27endif
28if (valid(iobj) && (!(iobj in {who, dobj})))
29x = iobj;
30iobj = you;
31x:tell($string_utils:pronoun_sub(this:fixpos(tell, "%i"), who, thing, where));
32iobj = x;
33endif

fixpos

Spec this none thisFlags rxdOwner #36Definer #35

Referenced by

Source

1"This is horribly dwimmy.  E.g. %x's gets turned into your, %X's gets turned into Your, and %X'S gets turned into YOUR. --Nosredna";
2upper = $string_utils:uppercase(args[2]);
3allupper = upper + "'S";
4upper = upper + "'s";
5lower = $string_utils:lowercase(args[2]) + "'s";
6return strsub(strsub(strsub(args[1], lower, "your", 1), upper, "Your", 1), allupper, "YOUR", 1);

say_action2

Spec this none thisFlags rxOwner #36Definer #35

Referenced by

Source

1"USAGE: $you:say_action2(doer, doee, STRING)";
2attacker = args[1];
3dobj = victim = args[2];
4blurb = args[3];
5if (player == attacker)
6if (victim == attacker)
7blurb = $string_utils:subst(args[3], {{"%d", "%r"}, {"%d's", "%p"}});
8endif
9this:say_action(blurb);
10else
11blurb = $string_utils:subst(args[3], {{"%d", "you"}, {"%d's", "your"}});
12attacker.location:announce_all_but({victim}, $string_utils:pronoun_sub(args[3], attacker));
13victim:tell($string_utils:pronoun_sub(blurb, attacker));
14endif