--- deliantra/server/common/living.C 2007/05/12 18:34:19 1.52 +++ deliantra/server/common/living.C 2007/05/12 19:41:02 1.55 @@ -725,7 +725,7 @@ int weapon_weight = 0, weapon_speed = 0; int best_wc = 0, best_ac = 0, wc = 0, ac = 0; int prot[NROFATTACKS], vuln[NROFATTACKS], potion_resist[NROFATTACKS]; - object *grace_obj = NULL, *mana_obj = NULL, *wc_obj = NULL, *tmp; + object *grace_obj = NULL, *mana_obj = NULL, *tmp; float old_speed = speed; /* First task is to clear all the values back to their original values */ @@ -941,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; @@ -997,9 +996,6 @@ if (!QUERY_FLAG (tmp, FLAG_APPLIED)) break; - if (IS_COMBAT_SKILL (tmp->subtype)) - wc_obj = tmp; - if (chosen_skill) LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name); @@ -1014,7 +1010,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; @@ -1228,6 +1224,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; @@ -1268,6 +1265,7 @@ for (i = 11; i <= grace_obj->level; i++) stats.maxgrace += 2; } + /* No limit on grace vs maxgrace */ if (contr->braced) @@ -1289,18 +1287,19 @@ * to make up for the change. Note that I left the * monster bonus the same as before. -b.t. */ + object *wc_obj = chosen_skill; - 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; } @@ -1320,7 +1319,6 @@ if (attacktype == 0) attacktype = arch->clone.attacktype; - } /* End if player */ if (added_speed >= 0) @@ -1588,6 +1586,7 @@ LOG (llevError, "add_player_exp: couldn't find skill %s\n", skill_name); return NULL; } + /* clear the flag - exp goes into this bucket, but player * still doesn't know it. */ @@ -1606,7 +1605,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 @@ -1626,7 +1624,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 */ @@ -1644,20 +1642,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 */ } @@ -1978,6 +1980,7 @@ percentage_loss = op->stats.exp * settings.death_penalty_ratio / 100; level_loss = op->stats.exp - levels[MAX (0, op->level - settings.death_penalty_level)]; + if (level_loss < 0) level_loss = 0; loss = check_exp_loss (op, MIN (level_loss, percentage_loss));