generic party #156
Aliases: generic party
9 verbs · 18 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
add_member | this none this | rxd | #156 | 11 |
remove_member | this none this | rxd | #156 | 19 |
spawn | this none this | rxd | #156 | 13 |
set_leader | this none this | rxd | #156 | 6 |
announce | this none this | rxd | #156 | 26 |
invite | this none this | rxd | #156 | 18 |
dissolve | this none this | rxd | #156 | 4 |
change_role | this none this | rxd | #156 | 17 |
add_gm | this none this | rxd | #156 | 8 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
members | #156 | rc | #361 | {} |
leader | #156 | rc | #361 | #-1 |
prefix | #156 | rc | #361 | "~1b[33m[party]" |
invited | #156 | rc | #361 | {} |
_home | #156 | rc | #361 | #6238 |
junk_ok | #156 | rc | #361 | 1 |
roles | #156 | rc | #361 | {} |
history | #156 | c | #361 | {} |
aliases | #1 | rc | #361 | {"generic party"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {6235, 1298433893} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: none
Call graph
Source
add_member
Referenced by
none
Source
1for x in (args) 2if (!(x in this.members)) 3if (is_a(x.party, $party)) 4x.party:remove_member(x); 5endif 6this.members = {@this.members, x}; 7this.roles = {@this.roles, ""}; 8x.party = this; 9this:announce(x.name, " joined the party."); 10endif 11endfor
remove_member
Referenced by
- #156:announce line 16:
this:remove_member
Source
1for x in (args) 2if (i = x in this.members) 3if (is_player(x)) 4if (x.party == this) 5x.party = #-1; 6elseif (is_a(x.party, $party)) 7x.party:remove_member(x); 8endif 9endif 10this.members = listdelete(this.members, i); 11this.roles = listdelete(this.roles, i); 12this:announce(x.name, " has left the party."); 13x:tell("You have left the party."); 14endif 15endfor 16if (length(this.members) < 2) 17this:announce("You're the last member -- dissolving the party."); 18this:dissolve(); 19endif
spawn
Referenced by
none
Source
1if (!this.f) 2return E_PERM; 3endif 4new = $rpg:spawn(this); 5if (args) 6new:set_name(args[1].name + "'s party"); 7for x in (args) 8new:add_member(x); 9endfor 10new:set_leader(args[1]); 11endif 12new:moveto(this._home); 13return new;
set_leader
Referenced by
none
Source
1who = args[1]; 2if (!(who in this.members)) 3return E_INVARG; 4endif 5this.leader = who; 6this:announce(who.name, " is now the party leader.");
announce
Referenced by
- #156:add_member line 9:
this:announce - #156:remove_member line 12:
this:announce - #156:remove_member line 17:
this:announce - #156:set_leader line 6:
this:announce - #156:invite line 6:
this:announce - #156:change_role line 11:
this:announce - #156:change_role line 13:
this:announce - #156:change_role line 15:
this:announce
Source
1if (#289912.target == this) 2#289912:announce(tostr(@args)); 3endif 4if ((history = this.history) && (length(history) >= 10)) 5history = listdelete(history, 1); 6endif 7this.history = {@history, {tostr(@args), time()}}; 8for x in (this.members) 9if (gamevalid(x) && is_player(x)) 10if (is_connected(x)) 11x:tell(this.prefix, " ", @args, $ansi.reset); 12else 13if ((time() - x.last_disconnect_time) > 600) 14fork (random(10)) 15if (!is_connected(x)) 16this:remove_member(x); 17this.invited = setremove(this.invited, x); 18endif 19endfork 20endif 21endif 22endif 23endfor 24for g in (this.gms) 25g:tell($ansi.yellow, "[", this.name, "]", " ", @args, $ansi.reset); 26endfor
invite
Referenced by
none
Source
1who = args[1]; 2if (who in this.members) 3return E_INVARG; 4endif 5this.invited = setadd(this.invited, who); 6this:announce(who.name, " has been invited to join by ", player:dname(), "."); 7who:tell($ansi.bold_on + "You've been invited to join up with ", $su:english_list($lu:map_prop(this.members, "name")), "." + $ansi.reset); 8local = {}; 9for x in (this.members) 10if (x.location == who.location) 11local = {@local, x}; 12endif 13endfor 14if (local) 15who:tell("To accept the invitation, type 'p-join ", local[1].name, "'."); 16else 17who:tell("To accept the invitation, walk to the party's current location and type 'p-join <name of any party member>'."); 18endif
dissolve
Referenced by
- #156:remove_member line 18:
this:dissolve
Source
1for x in (this.members) 2x.party = #-1; 3endfor 4$rpg:junk(this);
change_role
Referenced by
none
Source
1who = args[1]; 2role = args[2]; 3if (!(i = who in this.members)) 4return E_INVARG; 5else 6oldrole = this.roles[i]; 7this.roles[i] = role; 8arole = ($su:a_or_an(role) + " ") + role; 9aoldrole = ($su:a_or_an(oldrole) + " ") + oldrole; 10if (role && oldrole) 11this:announce(who.name, " changes from acting as ", aoldrole, " to ", arole, "."); 12elseif (role) 13this:announce(who.name, " is now acting as ", arole, "."); 14else 15this:announce(who.name, " stops acting as ", aoldrole, "."); 16endif 17endif
add_gm
Referenced by
none
Source
1if (!player.wizard) 2return; 3endif 4who = args[1]; 5this.gms = setadd(this.gms, who); 6for x in (this.gms) 7x:tell(this.prefix, " ", who.name, " joined as a GM.", $ansi.reset); 8endfor