--- deliantra/server/common/living.C 2007/05/12 18:23:51 1.51 +++ deliantra/server/common/living.C 2007/05/12 19:30:18 1.54 @@ -244,44 +244,6 @@ stats->stat (attr) += value; } -sint8 & -living::stat (int index) -{ - switch (index) - { - case STR: return Str; - case DEX: return Dex; - case CON: return Con; - case INT: return Int; - case WIS: return Wis; - case POW: return Pow; - case CHA: return Cha; - } - - LOG (llevError | logBacktrace, "living.stat() called with out-of-range stat index"); - static sint8 dummy; - return dummy; -} - -sint8 -living::stat (int index) const -{ - switch (index) - { - case STR: return Str; - case DEX: return Dex; - case CON: return Con; - case INT: return Int; - case WIS: return Wis; - case POW: return Pow; - case CHA: return Cha; - } - - LOG (llevError | logBacktrace, "living.stat() called with out-of-range stat index"); - static sint8 dummy; - return dummy; -} - /* * Ensures that all stats (str/dex/con/wis/cha/int) are within the * 1-30 stat limit. @@ -979,8 +941,7 @@ } /* There may be other things that should not adjust the attacktype */ - if ((tmp->type != WEAPON && tmp->type != BOW && tmp->type != SYMPTOM) - || current_weapon == tmp) + if (tmp->type != SYMPTOM) { attacktype |= tmp->attacktype; path_attuned |= tmp->path_attuned; @@ -1052,7 +1013,7 @@ weapon_speed = 0; weapon_weight = tmp->weight; - stats.dam += tmp->stats.dam * (1 + (chosen_skill->level / 9)); + stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9); if (tmp->magic) stats.dam += tmp->magic; @@ -1266,6 +1227,7 @@ for (i = 11; i <= mana_obj->level; i++) stats.maxsp += 2; } + /* Characters can get their sp supercharged via rune of transferrance */ if (stats.sp > stats.maxsp * 2) stats.sp = stats.maxsp * 2; @@ -1306,6 +1268,7 @@ for (i = 11; i <= grace_obj->level; i++) stats.maxgrace += 2; } + /* No limit on grace vs maxgrace */ if (contr->braced) @@ -1328,17 +1291,17 @@ * monster bonus the same as before. -b.t. */ - if (type == PLAYER && wc_obj && wc_obj->level > 1) + if (contr && wc_obj && wc_obj->level > 1) { wc -= wc_obj->level + thaco_bonus[stats.Str]; for (i = 1; i < wc_obj->level; i++) { - /* addtional wc every 6 levels */ + /* additional wc every 6 levels */ if (!(i % 6)) wc--; - /* addtional dam every 4 levels. */ + /* additional dam every 4 levels. */ if (!(i % 4) && dam_bonus[stats.Str] >= 0) stats.dam += 1 + dam_bonus[stats.Str] / 5; } @@ -1644,7 +1607,6 @@ return skill_obj; } - /* player_lvl_adj() - for the new exp system. we are concerned with * whether the player gets more hp, sp and new levels. * Note this this function should only be called for players. Monstes @@ -1664,7 +1626,7 @@ { op->level++; - if (op != NULL && op == who && op->stats.exp > 1 && is_dragon_pl (who)) + if (op && op == who && op->stats.exp > 1 && is_dragon_pl (who)) dragon_level_gain (who); /* Only roll these if it is the player (who) that gained the level */ @@ -1682,20 +1644,24 @@ sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); else sprintf (buf, "You are now level %d.", op->level); + if (who) new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); } + player_lvl_adj (who, op); /* To increase more levels */ } else if (op->level > 1 && op->stats.exp < level_exp (op->level, who->expmul)) { op->level--; who->update_stats (); + if (op->type != PLAYER) { sprintf (buf, "You are now level %d in the %s skill.", op->level, &op->name); new_draw_info (NDI_UNIQUE | NDI_RED, 0, who, buf); } + player_lvl_adj (who, op); /* To decrease more levels */ }