generic skill #96

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

Aliases: generic skill

31 verbs · 31 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
@initializethis none nonerxd#9623
totalthis none thisrxd#9624
checkthis none thisrxd#9624
level_stringthis none thisrxd#9611
level_namesthis none thisrxd#961
improvethis none thisrxd#9655
maybe_improvethis none thisrxd#9649
base_levelthis none thisrxd#964
rawthis none thisrxd#961
setthis none thisrxd#967
learn_cost_for learn_cost_for_fullthis none thisrxd#9625
learnthis none thisrxd#9611
calc_bestthis none thisrxd#9610
level_desc_forthis none thisrxd#9613
tree_tagthis none thisrxd#9610
age_modthis none thisrxd#967
track_daily_gainthis none thisrxd#9616
report_daily_gainthis none thisrxd#9633
ip_cost_forthis none thisrxd#9614
is_bestablethis none thisrxd#9629
modifierthis none thisrxd#962
flushthis none thisrxd#964
check_bakthis none thisrxd#9636
lose_rawthis none thisrxd#965
possibly_improvethis none thisrxd#9627
gain_rawthis none thisrxd#964
gain_ipthis none thisrxd#9616
can_improvethis none thisrxd#9619
last_improvethis none thisrxd#963
descriptionthis none thisrxd#969
ipthis none thisrxd#961

Properties

PropertyDefinerFlagsOwnerValue
depends_on#96rc#361{}
level_names#96rc#361
list of 12{"Worthless.", "You're clueless.", "Barely capable.", "Marginally competent.", "Hobbyist.", "Gifted amateur.", "Highly capable.", "Professional.", "Expert.", "Master.", "Innovator.", "Legend."}
abbrev#96rc#361""
improve_rate#96rc#3610.6
improve_msg#96rc#361"You feel your %t ability improving!"
encumbrance_penalty#96rc#3610.0
defaults_to#96rc#361-3
base#96rc#361-2
learn_cost_mod#96rc#3611.0
best#96rc#361{}
peak_age#96rc#36125
dropoff_age#96rc#3610
daily_gain_who#96rc#361{}
daily_gain_data#96rc#361{}
private_improve#96rc#3610
min_refresh#96rc#36160
cache_hit#96rc#3610
cache_miss#96rc#3611
min_time_between_ip#96rc#3615
worlds_best_msg#96rc#361"Best in the world."
teachers#96rc#361
list of 17{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
aliases#1rc#361{"generic skill"}
description#1rc#361<clear>
object_size#1r#29{27570, 1298433815}
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: #126 generic stat, #252 dodge, #314 fists

Call graph

calls n96_0 #96:@initialize n97_0 #97:match n96_0->n97_0 n6_9 #6:notify n96_0->n6_9 n20_59 #20:name_and_number n96_0->n20_59 n48_4 #48:yes_or_no n96_0->n48_4 n1_13 #1:moveto n96_0->n1_13 n118_0 #118:announce n96_0->n118_0 n96_2 #96:check n96_1 #96:total n96_2->n96_1 n96_24 #96:possibly_improve n96_2->n96_24 n45_2 #45:has_verb n96_2->n45_2 n96_8 #96:raw n96_24->n96_8 n96_6 #96:maybe_improve n96_24->n96_6 n96_5 #96:improve n96_18 #96:ip_cost_for n96_5->n96_18 n96_16 #96:track_daily_gain n96_5->n96_16 n96_30 #96:ip n96_5->n96_30 n96_5->n96_8 n20_34 #20:pronoun_sub n96_5->n20_34 n96_21 #96:flush n96_5->n96_21 n96_10 #96:learn_cost_for n96_18->n96_10 n96_6->n96_5 n96_6->n96_18 n96_6->n96_8 n96_27 #96:can_improve n96_6->n96_27 n96_27->n96_8 n96_28 #96:last_improve n96_27->n96_28 n96_7 #96:base_level n96_7->n96_8 n96_9 #96:set n96_9->n96_30 n96_10->n96_30 n96_10->n96_8 n96_11 #96:learn n96_11->n96_8 n96_11->n20_34 n96_11->n96_21 n96_11->n96_10 n96_12 #96:calc_best n96_12->n96_1 n96_12->n96_30 n96_19 #96:is_bestable n96_12->n96_19 n48_8 #48:suspend_if_needed n96_12->n48_8 n289_1 #289:topN n96_12->n289_1 n47_11 #47:reverse n96_12->n47_11 n47_23 #47:sort_alist n96_12->n47_23 n47_16 #47:slice n96_12->n47_16 n96_19->n96_8 n96_13 #96:level_desc_for n96_13->n96_1 n20_15 #20:capitalize n96_13->n20_15 n20_28 #20:english_ordinal n96_13->n20_28 n96_17 #96:report_daily_gain n96_17->n20_59 n45_26 #45:leaves_suspended n96_17->n45_26 n20_1 #20:left n96_17->n20_1 n38_2 #38:send_message n96_17->n38_2 n96_22 #96:check_bak n96_22->n96_1 n96_22->n45_2 n96_22->n96_8 n96_22->n96_6 n96_23 #96:lose_raw n96_23->n96_30 n96_23->n96_8 n96_23->n96_21 n96_25 #96:gain_raw n96_25->n96_30 n96_25->n96_8 n96_25->n96_21 n96_26 #96:gain_ip n96_26->n96_30 n96_26->n96_8 n96_26->n96_25 n96_29 #96:description n96_29->n20_15 n1_8 #1:description n96_29->n1_8 n1_30 #1:name n96_29->n1_30 n20_6 #20:english_list n96_29->n20_6

Source

@initialize

Spec this none noneFlags rxdOwner #361Definer #96

Referenced by

none

Source

1if (valid(skill = $skills:match(this.name)))
2player:notify("The skill ", $string_utils:nn(skill), " already exists with that name or alias.");
3return;
4endif
5"if (index(this.name, \" \"))";
6"  player:notify(\"You can't have a skill with a space in the name.\");";
7"  return;";
8"endif";
9if (this.location == $skills)
10player:notify($string_utils:nn(this) + " is already initialized.");
11return;
12endif
13player:notify(("Initializing " + $string_utils:nn(this)) + " as a new skill.  Proceed?");
14if ($command_utils:yes_or_no())
15initial_value = {0, 0, 0, 0};
16prop_info = {player, "rc"};
17add_property($skills, this.name, this, prop_info);
18this:moveto($skills);
19player:notify("Successfully registered the new skill ", $string_utils:nn(this), ".");
20$wiznet:announce($skills, ((player.name + " initialized a new skill '") + $string_utils:nn(this)) + "'.", 1);
21else
22player:notify("Cancelled.");
23endif

total

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":total(OBJ player)";
2"Calculate total skill level for player, taking dependent skills and status effects into account.";
3who = args[1];
4if ((time() - `who.skills[this.name][4] ! E_RANGE => 0') < this.min_refresh)
5this.cache_hit = this.cache_hit + 1;
6return `who.skills[this.name][3] ! E_RANGE => 0';
7endif
8total = `who.skills[this.name][1] ! E_RANGE => 0';
9if (total < 1)
10total = this.defaults_to;
11endif
12"total = (total ? total | this.defaults_to) + this.base;";
13total = total + this.base;
14dep = 0;
15if (this.depends_on)
16for x in (this.depends_on)
17dep = dep + x:total(who);
18endfor
19dep = dep / length(this.depends_on);
20endif
21total = (total + who:skill_modifier_for(this)) + dep;
22"who.(pname)[3..4] = {total, time()};";
23this.cache_miss = this.cache_miss + 1;
24return total;

check

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1"Copied from generic skill (#111):check_jed by Gilmore (#98) Sat Feb 21 01:37:51 2009 CST";
2":check(OBJ person, INT modifier [, INT dont-improve])";
3"Roll 2d9 check against the person's skill.  Modifier is applied to the person's skill total (high modifier == easier task).";
4"Note that a 3 or 4 roll is auto-success, and 17 or 18 is auto-failure.";
5"If the third arg is provided, no improvement can happen on this check.";
6who = args[1];
7mod = args[2];
8roll = random(9) + random(9);
9if (roll > 17)
10roll = roll + random(9);
11elseif (roll < 4)
12roll = roll - random(9);
13endif
14skill = this:total(who) + mod;
15if (this.encumbrance_penalty)
16skill = skill + toint(tofloat(who:encumbrance()) * this.encumbrance_penalty);
17endif
18result = skill - roll;
19if ((length(args) < 3) || (!args[3]))
20this:possibly_improve(who, result);
21endif
22return result;
23$ou:has_verb(who, "debug_tell_room") && who:debug_tell_room("skills", this.name, " check at ", mod, " -> ", result, " (from ", callers()[1][1], ":", callers()[1][2], ")");
24return result;

level_string

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1":level_string(INT level) => STR 'level name'";
2"Returns an english representation of a skill level for this skill.";
3level = args[1];
4if (!(typeof(level) == INT))
5return E_INVARG;
6endif
7level = max(level, 0);
8o = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11};
9level = min(level, 23);
10level = level + 1;
11return this.level_names[o[level]];

level_names

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1return this.level_names;

improve

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":improve(OBJ who)";
2"Add one IP to this skill for who.";
3"If IP > 99, up the skill by one.";
4who = args[1];
5if (is_a(this, $stat) || ((time() - who.last_improve_time) > $rpg.skill_improve_interval))
6if (is_player(who))
7if (!who.xp_total)
8return;
9endif
10cost = this:ip_cost_for(who);
11if (who.xp < cost)
12return;
13endif
14endif
15for x in (who.fighting)
16if (is_player(x))
17return;
18endif
19endfor
20this:track_daily_gain(who);
21oldip = this:ip(who);
22if ((oldip + 1) > 99)
23who.skills[this.name] = {this:raw(who) + 1, 0, 0, 0};
24who:systell($su:ps(this.improve_msg, who, this, this));
25if (this:raw(who) == 8)
26who:systell("You can no longer improve this skill through practice; you'll have to spend XP with a teacher to go higher.");
27endif
28this:flush(who);
29endif
30if (this.name in keys(who.skills))
31if (length(who.skills[this.name]) >= 5)
32who.skills[this.name][5] = time();
33else
34who.skills[this.name] = listappend(who.skills[this.name], time());
35endif
36endif
37who.last_improve_time = time();
38if (is_player(who))
39who:award_xp(1, 1);
40who.xp = who.xp - cost;
41if (cost > 1)
42who:systell("You spent ", tostr(cost - 1), " XP to earn 1 IP in ", this.name, "!");
43else
44who:systell("You earned 1 IP in ", this.name, "!");
45endif
46if (who:check_pref("showprogress"))
47ip = this:ip(who);
48ipstr = (ip < 10) ? "0" + tostr(ip) | tostr(ip);
49who:systell("Your raw ", this.name, " skill is now ", this:raw(who), ".", ipstr, "!");
50endif
51if (!is_a(this, $stat))
52who.ip_daily = max(0, who.ip_daily - 1);
53endif
54endif
55endif

maybe_improve

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":maybe_improve(OBJ who, INT chance)";
2"Possibly add 1 IP to skill for who, based on d100 chance.";
3"This improvement may cascade down to the dependent skills, at a lesser chance.";
4who = args[1];
5if (this:can_improve(who))
6chance = tofloat(args[2]) * this.improve_rate;
7if (is_player(who) && who.hardcore)
8chance = chance * 2.0;
9endif
10if (this:raw(who) < 4)
11chance = chance * (5.0 - tofloat(this:raw(who)));
12elseif (is_a(this, $stat))
13chance = chance * (4.0 / tofloat(this:raw(who)));
14endif
15if (is_player(who) && (!(this in who.focus_skills)))
16chance = chance * 0.7;
17endif
18if (0 && is_player(who))
19chance = chance * ((tofloat(who.ip_daily) / 50.0) ^ 2);
20else
21chance = chance * 0.8;
22endif
23if (is_player(who))
24if (exp = #541309:doses_for(who))
25chance = chance * (1.5 * tofloat(exp));
26endif
27for f in (who.fighting)
28if (valid(f) && is_a(f, $creature))
29if (f.xp_value)
30xr = tofloat(f:xp_value(who)) / tofloat((typeof(f.xp_value) == LIST) ? f.xp_value[1] | f.xp_value);
31if (xr > 0.0)
32chance = chance * (1.0 + (0.5 * xr));
33endif
34endif
35endif
36endfor
37endif
38chance = toint(chance);
39if (random(100) <= chance)
40if ((!is_player(who)) || (who.xp >= this:ip_cost_for(who)))
41raw = this:raw(who);
42if (((raw < 1) || this.private_improve) || (who.location.grind_ok == 1))
43if ((!is_player(who)) || (random(100) < who:xp_improve_penalty()))
44this:improve(who);
45endif
46endif
47endif
48endif
49endif

base_level

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1":base_level(OBJ who)";
2"Return the base skill level who has for this skill.  Useful in determining if someone actually HAS a skill, and not just a default level.";
3who = args[1];
4return this:raw(who);

raw

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1return `args[1].skills[this.name][1] ! E_RANGE => 0';

set

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1":set(OBJ who, INT raw [,INT clear-improve])";
2"Set who's skill to raw.  If args[3], clear the improve value.";
3who = args[1];
4raw = args[2];
5ip = ((length(args) > 2) && args[3]) ? 0 | this:ip(who);
6new_skill = {raw, ip, 0, 0};
7who.skills[this.name] = new_skill;

learn_cost_for learn_cost_for_full

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1"Copied from generic skill (#111):learn_cost_for by Gilmore (#98) Thu Aug  6 23:07:45 2009 CDT";
2{who} = args;
3yourskill = this:raw(who);
4yourip = this:ip(who);
5ip_to_go = 100 - yourip;
6newlevel = yourskill + 1;
7cost = 1000;
8"if (newlevel < 1)";
9"  cost = $rpg.learn_costs[1];";
10"elseif (newlevel <= length($rpg.learn_costs))";
11"  cost = $rpg.learn_costs[newlevel];";
12"else";
13"  cost = 49999;";
14"endif";
15if (is_a(who, $player))
16if (!(this in who.focus_skills))
17cost = toint((tofloat(cost) * 1.4) * this.learn_cost_mod);
18else
19cost = toint(tofloat(cost) * this.learn_cost_mod);
20endif
21endif
22if (yourip && (verb != "learn_cost_for_full"))
23cost = toint((tofloat(cost) * tofloat(ip_to_go)) / 100.0);
24endif
25return cost;

learn

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1{who} = args;
2cost = this:learn_cost_for(who);
3if ((!is_a(who, $player)) || (who.xp >= cost))
4`who.xp = who.xp - cost ! ANY => 0';
5who.skills[this.name] = {this:raw(who) + 1, 0, 0, 0};
6this:flush(who);
7who:tell((($ansi.bold_on + "[ You spent ") + tostr(cost)) + " XP. ]");
8who:tell(((($ansi.bold_on + "[ ") + $su:ps(this.improve_msg, who, this, this)) + " ]") + $ansi.reset);
9else
10return E_INVARG;
11endif

calc_best

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1h = [];
2for x in (players())
3if (this:is_bestable(x))
4h[x] = (this:total(x) * 100) + this:ip(x);
5endif
6$cu:sin(2);
7endfor
8topfive = $hu:topN(h, 5, 2);
9topfive = $lu:reverse($lu:sort_alist(topfive, 2));
10this.best = $lu:slice(topfive);

level_desc_for

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1who = args[1];
2if (who in this.best)
3if (who == this.best[1])
4return this.worlds_best_msg;
5else
6return $su:capitalize($su:english_ordinal(who in this.best) + "-best in the world.");
7endif
8else
9i = this:total(who) / 2;
10i = max(i, 1);
11i = min(i, length(this.level_names));
12return this.level_names[i];
13endif

tree_tag

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1tag = tostr("i", tostr(this.improve_rate), " l", this.learn_cost_mod);
2if (this.depends_on)
3depstr = "";
4for x in (this.depends_on)
5depstr = (depstr + ",") + x.abbrev;
6endfor
7depstr = depstr ? " " + depstr[2..$] | "";
8tag = tag + depstr;
9endif
10return tag;

age_mod

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1if (this.dropoff_age == 0)
2return 0;
3endif
4who = args[1];
5age = who:char_age();
6mod = -1 * toint(abs(age - this.peak_age) / this.dropoff_age);
7return mod;

track_daily_gain

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1who = args[1];
2if ((!is_a(who, $player)) || is_a(who, $builder))
3return;
4endif
5idx = who in this.daily_gain_who;
6if (idx == 0)
7this.daily_gain_who = setadd(this.daily_gain_who, who);
8idx = who in this.daily_gain_who;
9this.daily_gain_data = listappend(this.daily_gain_data, {0, {}});
10endif
11if (idx)
12this.daily_gain_data[idx][1] = this.daily_gain_data[idx][1] + 1;
13if (who.executing && (length(who.executing) >= 4))
14this.daily_gain_data[idx][2] = setadd(this.daily_gain_data[idx][2], {who.executing[1], who.executing[4]});
15endif
16endif

report_daily_gain

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1for skill in ($ou:leaves_suspended($skill))
2if (!skill.daily_gain_who)
3yield;
4continue;
5endif
6if (0)
7lines = listappend(lines, $su:left($su:nn(skill) + " ", -60, "-"));
8for i in [1..length(skill.daily_gain_who)]
9who = skill.daily_gain_who[i];
10data = skill.daily_gain_data[i];
11lines = listappend(lines, (("  " + $su:left($su:nn(who), 20)) + " +") + tostr(data[1]));
12for action in (data[2])
13if (!action[2])
14lines = listappend(lines, "    " + $su:nn(action[1]));
15else
16lines = listappend(lines, (("    " + $su:nn(action[1])) + " => ") + tostr(action[2]));
17endif
18yield;
19endfor
20yield;
21endfor
22endif
23skill.daily_gain_who = {};
24skill.daily_gain_data = {};
25if (0)
26lines = listappend(lines, "");
27endif
28yield;
29endfor
30suspend(0);
31if (0)
32$mail_agent:send_message(#2, #81273, {""}, lines);
33endif

ip_cost_for

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1return 0;
2who = args[1];
3learn = this:learn_cost_for_full(who);
4cost = toint(tofloat(learn) / 250.0) - 1;
5if (who.ip_daily <= 10)
6cost = cost + 3;
7elseif (who.ip_daily <= 20)
8cost = cost + 2;
9elseif (who.ip_daily <= 30)
10cost = cost + 1;
11endif
12cost = max(1, cost);
13cost = min(20, cost);
14return cost;

is_bestable

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1who = args[1];
2if (!is_a(who, $player))
3return 0;
4elseif (who.f)
5return 0;
6elseif (who.programmer)
7return 0;
8elseif (who in {#143513})
9return 0;
10elseif (is_a(who, #451070))
11return 0;
12elseif (is_a(who, #21279))
13return 0;
14elseif (`who.dont_rank ! E_PROPNF => 0')
15return 0;
16elseif (who in $login.newted)
17return 0;
18elseif (who.password == "scrambled")
19return 0;
20elseif (who.location in {#-1, #5215, #1438})
21return 0;
22elseif (who.xp_total < $rpg.newbie_xp)
23return 0;
24elseif ((time() - who.last_disconnect_time) > (86400 * 60))
25return 0;
26elseif (this:raw(who) <= 0)
27return 0;
28endif
29return 1;

modifier

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1":modifier(OBJ who) -> return any unique skill modifiers for this skill, as calculated for who.)";
2return 0;

flush

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1who = args[1];
2if (this.name in keys(who.skills))
3who.skills[this.name][4] = 0;
4endif

check_bak

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1"Copied from generic skill (#111):check by Gilmore (#98) Sat Feb 21 01:32:22 2009 CST";
2":check(OBJ person, INT modifier [, INT dont-improve])";
3"Roll 2d9 check against the person's skill.  Modifier is applied to the person's skill total (high modifier == easier task).";
4"Note that a 3 or 4 roll is auto-success, and 17 or 18 is auto-failure.";
5"If the third arg is provided, no improvement can happen on this check.";
6who = args[1];
7mod = args[2];
8roll = random(9) + random(9);
9if (roll > 17)
10roll = roll + random(9);
11elseif (roll < 4)
12roll = roll - random(9);
13endif
14skill = this:total(who) + mod;
15if (this.encumbrance_penalty)
16skill = skill + toint(tofloat(who:encumbrance()) * this.encumbrance_penalty);
17endif
18result = skill - roll;
19if ((length(args) < 3) || (!args[3]))
20if ((result < 5) && (result > -3))
21statgimp = 0;
22for s in (this.depends_on)
23statgimp = (statgimp + s:total(who)) - s:raw(who);
24endfor
25gimp = min(0, who:skill_modifier_for(this) + statgimp);
26chance = max(0, ((40 - ((raw = this:raw(who)) * 3)) - (result * 5)) + (gimp * 5));
27if (chance > 0)
28this:maybe_improve(who, chance);
29elseif ((result + raw) <= 15)
30this:maybe_improve(who, 1);
31endif
32endif
33endif
34return result;
35$ou:has_verb(who, "debug_tell_room") && who:debug_tell_room("skills", this.name, " check at ", mod, " -> ", result, " (from ", callers()[1][1], ":", callers()[1][2], ")");
36return result;

lose_raw

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1who = args[1];
2amount = (length(args) > 1) ? args[2] | 1;
3who.skills[this.name] = {this:raw(who) - amount, this:ip(who), 0, 0};
4this:flush(who);
5who:tell($ansi.red, $ansi.bold_on, "[ You lost ", amount, " raw in ", this.name, "! ]", $ansi.reset);

possibly_improve

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":possibly_improve(who, result) => Possibly give IP to 'who', who just made a check with the result 'result'.";
2{who, result} = args;
3dep = this.depends_on;
4gimp = 0;
5if (dep)
6for d in (dep)
7for x in (who.blood)
8gimp = gimp + x[1]:skill_mod(d, who, x[3]);
9endfor
10for x in (who.wearing)
11if (is_a(x, #270267) && (d == x.skill))
12gimp = gimp + x.mod;
13endif
14endfor
15endfor
16gimp = gimp / length(dep);
17gimp = min(0, gimp);
18endif
19unmod_result = result - gimp;
20if ((unmod_result < 5) && (unmod_result > -3))
21chance = max(0, (40 - ((raw = this:raw(who)) * 3)) - (unmod_result * 5));
22if (chance > 0)
23this:maybe_improve(who, chance);
24elseif ((unmod_result + raw) <= 15)
25this:maybe_improve(who, 1);
26endif
27endif

gain_raw

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1{who, ?amount = 1} = args;
2who.skills[this.name] = {this:raw(who) + amount, this:ip(who), 0, 0};
3this:flush(who);
4who:tell($ansi.bold_on, $ansi.cyan, "[ Your ", this.name, " increased by ", amount, "! ]", $ansi.reset);

gain_ip

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

none

Source

1{who, ip} = args;
2if (this:raw(who) >= $rpg.max_grind_raw)
3return;
4endif
5who:systell("You gained ", ip, " ip in ", this.name, "!");
6oldip = this:ip(who);
7newip = oldip + ip;
8gain = 0;
9while (newip > 99)
10newip = newip - 100;
11gain = gain + 1;
12endwhile
13if (gain)
14this:gain_raw(who, gain);
15endif
16who.skills[this.name] = {this:raw(who), newip, 0, 0};

can_improve

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":can_improve(who) => Can 'who' gain IP in this skill?";
2{who} = args;
3if (!is_a(who:area(), $real_area))
4return 0;
5elseif (!who.can_improve)
6return 0;
7elseif (is_player(who) && (!who.ip_daily))
8return 0;
9elseif (is_player(who) && (!is_connected(who)))
10return 0;
11elseif ((!is_a(this, $stat)) && (this:raw(who) >= $rpg.max_grind_raw))
12return 0;
13elseif (this:raw(who) >= 15)
14return 0;
15elseif ((time() - this:last_improve(who)) < (this.min_time_between_ip / (1 + #541309:doses_for(who))))
16return 0;
17else
18return 1;
19endif

last_improve

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1":last_improve(who) => When did 'who' last gain an IP in this skill?";
2{who} = args;
3return `who.skills[this.name][5] ! E_RANGE => 0';

description

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1d = pass(@args);
2d = (typeof(d) == LIST) ? d | {d};
3if (!is_a(this, $stat))
4if (this.depends_on)
5s = (((($su:capitalize(this:name()) + " uses the stats ") + $ansi.bold_on) + $su:english_list($lu:map_prop(this.depends_on, "name"))) + $ansi.bold_off) + ".";
6d = {@d, "", s};
7endif
8endif
9return d;

ip

Spec this none thisFlags rxdOwner #361Definer #96

Referenced by

Source

1return `args[1].skills[this.name][2] ! E_RANGE => 0';