generic party #156

Parent #1Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic party

9 verbs · 18 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
add_memberthis none thisrxd#15611
remove_memberthis none thisrxd#15619
spawnthis none thisrxd#15613
set_leaderthis none thisrxd#1566
announcethis none thisrxd#15626
invitethis none thisrxd#15618
dissolvethis none thisrxd#1564
change_rolethis none thisrxd#15617
add_gmthis none thisrxd#1568

Properties

PropertyDefinerFlagsOwnerValue
members#156rc#361{}
leader#156rc#361#-1
prefix#156rc#361"~1b[33m[party]"
invited#156rc#361{}
_home#156rc#361#6238
junk_ok#156rc#3611
roles#156rc#361{}
history#156c#361{}
aliases#1rc#361{"generic party"}
description#1rc#361<clear>
object_size#1r#29{6235, 1298433893}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: none

Call graph

calls n156_0 #156:add_member n156_4 #156:announce n156_0->n156_4 n156_1 #156:remove_member n156_4->n156_1 n156_1->n156_4 n156_6 #156:dissolve n156_1->n156_6 n103_2 #103:junk n156_6->n103_2 n156_2 #156:spawn n103_1 #103:spawn n156_2->n103_1 n156_3 #156:set_leader n156_3->n156_4 n156_5 #156:invite n156_5->n156_4 n107_9 #107:dname n156_5->n107_9 n20_6 #20:english_list n156_5->n20_6 n156_7 #156:change_role n156_7->n156_4 n20_61 #20:a_or_an n156_7->n20_61

Source

add_member

Spec this none thisFlags rxdOwner #361Definer #156

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

Spec this none thisFlags rxdOwner #361Definer #156

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #156

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

Spec this none thisFlags rxdOwner #361Definer #156

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

Spec this none thisFlags rxdOwner #361Definer #156

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #156

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

Spec this none thisFlags rxdOwner #361Definer #156

Referenced by

Source

1for x in (this.members)
2x.party = #-1;
3endfor
4$rpg:junk(this);

change_role

Spec this none thisFlags rxdOwner #361Definer #156

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

Spec this none thisFlags rxdOwner #361Definer #156

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