faction #216
Aliases: faction
11 verbs · 27 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
check_align | this none this | rxd | #216 | 11 |
add_member | this none this | rxd | #216 | 7 |
rm_member | this none this | rxd | #216 | 7 |
change_reputation reputation | this none this | rxd | #216 | 29 |
_tell_standings | this none this | rxd | #216 | 26 |
heartbeat | this none this | rxd | #216 | 25 |
tree_tag | this none this | rxd | #216 | 6 |
add_rep_item | this none this | rxd | #216 | 5 |
add_rep_reward | this none this | rxd | #216 | 3 |
set_max_standing | this none this | rxd | #216 | 3 |
set_rep_decay | this none this | rxd | #216 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
alignment | #216 | r | #29 | {} |
members | #216 | r | #29 | {} |
sphere_of_influence | #216 | r | #29 | {} |
standings | #216 | r | #29 | {} |
reputation_items | #216 | r | #29 | {} |
reputation_rewards | #216 | r | #29 | {} |
max_standing | #216 | r | #29 | 500 |
reaction_comments | #216 | r | #29 | {"Murderer!", "Killer!", "Assassin!", "SHIT!", "OHSHI-", "Run!"} |
heart_tick | #216 | r | #29 | 0 |
negative_rep_decay | #216 | r | #29 | 5.0 |
positive_rep_decay | #216 | r | #29 | -1.0 |
decay_interval | #216 | r | #29 | 86400 |
last_decay_time | #216 | r | #29 | 0 |
heart | #216 | r | #29 | 0 |
last_heartbeat | #216 | r | #29 | 0 |
positive_rep_decay_chance | #216 | r | #29 | 10 |
clone_rep_min | #216 | r | #29 | 0 |
aliases | #1 | rc | #29 | {"faction"} |
description | #1 | rc | #29 | <clear> |
object_size | #1 | r | #29 | {7371, 1298433821} |
hidden_verbs | #1 | rc | #29 | <clear> |
phelp_msg | #1 | rc | #29 | <clear> |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: none
Call graph
Source
check_align
Referenced by
none
Source
1which = args[1]; 2if (which == this) 3return 10; 4else 5for x in (this.alignment) 6if (x[1] == which) 7return x[2]; 8endif 9endfor 10return 0; 11endif
add_member
Referenced by
none
Source
1who = args[1]; 2if (!(who in this.members)) 3this.members = setadd(this.members, who); 4endif 5if (!(this in who.factions)) 6who.factions = setadd(who.factions, this); 7endif
rm_member
Referenced by
none
Source
1who = args[1]; 2if (who in this.members) 3this.members = setremove(this.members, who); 4endif 5if (this in who.factions) 6who.factions = setremove(who.factions, this); 7endif
change_reputation reputation
Referenced by
none
Source
1who = toobj(args[1]); 2if (length(args) > 1) 3amount = tofloat(args[2]); 4endif 5if (!is_a(who, $creature)) 6return E_INVARG; 7endif 8idx = who in $lu:slice(this.standings, 1); 9if (idx == 0) 10if (verb == "change_reputation") 11this.standings = setadd(this.standings, {who, amount}); 12return amount; 13endif 14return 0.0; 15else 16if (verb == "change_reputation") 17if ((amount > 0.0) && (this.standings[idx][2] >= tofloat(this.max_standing))) 18who:tell($ansi.bold_on, "You already have the maximum reputation with ", this:dnamec(), ".", $ansi.bold_off); 19return; 20endif 21this.standings[idx][2] = this.standings[idx][2] + amount; 22color = $ansi.green + $ansi.bold_on; 23if (amount < 0.0) 24color = $ansi.red + $ansi.bold_on; 25endif 26who:tell((((((color + this:dnamec()) + " reputation: ") + tostr(amount)) + "/") + tostr(this.standings[idx][2])) + $ansi.reset); 27endif 28return this.standings[idx][2]; 29endif
_tell_standings
Referenced by
none
Source
1if (length(args) > 0) 2who = args[1]; 3idx = who in $lu:slice(this.standings, 1); 4if (idx == 0) 5return tofloat(idx); 6endif 7return this.standings[idx][2]; 8endif 9data = this.standings; 10order = $Lu:slice(data, 2); 11data = $lu:sort(data, order); 12order = {}; 13for a in (data) 14order = {@order, parent(a[1])}; 15endfor 16data = $lu:sort(data, order); 17prev_parent = parent(data[1][1]); 18player:tell((($ansi.bold_on + $ansi.yellow) + "--------------------------") + $ansi.reset); 19for a in (data) 20if (parent(a[1]) != prev_parent) 21player:tell((($ansi.bold_on + $ansi.yellow) + "--------------------------") + $ansi.reset); 22endif 23player:tell($su:left($su:nn(a[1]), 30), " ", $su:right(tostr(tofloat(a[2])), 7)); 24prev_parent = parent(a[1]); 25yield; 26endfor
heartbeat
Referenced by
none
Source
1if ((time() - this.last_decay_time) > this.decay_interval) 2this.last_decay_time = time(); 3count = 1; 4for a in (this.standings) 5yield; 6if (tofloat(a[2]) < 0.0) 7if (abs(tofloat(a[2])) < this.negative_rep_decay) 8this.standings[count][2] = 0.0; 9else 10this.standings[count][2] = tofloat(this.standings[count][2]) + this.negative_rep_decay; 11endif 12endif 13if (tofloat(a[2]) > 0.0) 14if (random(100) > this.positive_rep_decay_chance) 15if (abs(tofloat(a[2])) < this.positive_rep_decay) 16this.standings[count][2] = 0.0; 17else 18this.standings[count][2] = tofloat(this.standings[count][2]) + this.positive_rep_decay; 19endif 20endif 21endif 22count = count + 1; 23yield; 24endfor 25endif
tree_tag
Referenced by
none
Source
1tag = $su:right(tostr(this.positive_rep_decay), -5); 2tag = ((tag + ", ") + $su:right(tostr(this.positive_rep_decay_chance), -5)) + "%"; 3tag = (tag + ", ") + $su:right(tostr(this.negative_rep_decay), -5); 4tag = ((tag + ", ") + $su:right(tostr(this.decay_interval / 3600), -3)) + "h"; 5tag = (tag + ", ") + $su:right(tostr(this.max_standing), -8); 6return $su:right(tag, 30);
add_rep_item
Referenced by
none
Source
1"Copied from Cybus Technology (#547474):add_rep_item by Hawgpadre (#538008) Fri Feb 11 15:47:45 2011 CST"; 2what = args[1]; 3if (valid(what)) 4this.reputation_items = setadd(this.reputation_items, what); 5endif
add_rep_reward
Referenced by
none
Source
1"Copied from Cybus Technology (#547474):add_rep_reward by Hawgpadre (#538008) Fri Feb 11 15:47:45 2011 CST"; 2what = args[1]; 3this.reputation_rewards = setadd(this.reputation_rewards, what);
set_max_standing
Referenced by
none
Source
1"Copied from Cybus Technology (#547474):set_max_standing by Hawgpadre (#538008) Fri Feb 11 15:47:45 2011 CST"; 2max_standing = toint(args[1]); 3this.max_standing = max_standing;
set_rep_decay
Referenced by
none
Source
1"Copied from Cybus Technology (#547474):set_rep_decay by Hawgpadre (#538008) Fri Feb 11 15:47:45 2011 CST"; 2this.negative_rep_decay = tofloat(args[1]); 3this.positive_rep_decay = tofloat(args[2]); 4this.decay_interval = toint(args[3]); 5this.positive_rep_decay_chance = toint(args[4]);