--- deliantra/server/common/living.C 2007/05/13 15:13:57 1.56 +++ deliantra/server/common/living.C 2007/05/19 00:31:08 1.62 @@ -868,14 +868,17 @@ if (type == PLAYER) { if (tmp == contr->combat_ob || tmp == contr->ranged_ob) - if (tmp != current_weapon && (tmp->type != SKILL || tmp->subtype != SK_PRAYING)) + if (tmp != current_weapon + && (tmp->type != SKILL || tmp->subtype != SK_PRAYING) + && !tmp->flag [FLAG_CURSED] + && !tmp->flag [FLAG_DAMNED]) continue; for (i = 0; i < NUM_STATS; i++) change_attr_value (&stats, i, tmp->stats.stat (i)); - /* these are the items that currently can change digestion, regeneration, - * spell point recovery and mana point recovery. Seems sort of an arbitary + /* These are the items that currently can change digestion, regeneration, + * spell point recovery and mana point recovery. Seems sort of an arbitary * list, but other items store other info into stats array. */ if (tmp->type == WEAPON || tmp->type == BOW || @@ -993,11 +996,12 @@ /* skills modifying the character -b.t. */ /* for all skills and skill granting objects */ case SKILL: - if (!QUERY_FLAG (tmp, FLAG_APPLIED)) + if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) break; if (chosen_skill) - LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name); + LOG (llevDebug, "fix_player, op %s has multiple skills applied (%s and %s)\n", + &name, &chosen_skill->name, &tmp->name); chosen_skill = tmp; @@ -1030,13 +1034,6 @@ break; - case SKILL_TOOL: - if (chosen_skill) - LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name); - - chosen_skill = tmp; - break; - case SHIELD: if (settings.spell_encumbrance == TRUE && type == PLAYER) contr->encumbrance += (int) tmp->weight / 2000; @@ -1371,9 +1368,7 @@ if (K <= 0.01f) K = 0.01f; - float S = speed / (K * s); - - contr->weapon_sp = S; + contr->weapon_sp = K * s * .5f; //TODO: balance the .5 } /* I want to limit the power of small monsters with big weapons: */ @@ -1580,11 +1575,11 @@ skill_obj->level = 1; insert_ob_in_ob (skill_obj, op); - if (op->contr) + if (player *pl = op->contr) { - op->contr->last_skill_ob [skill_obj->subtype] = skill_obj; - if (op->contr->ns) - op->contr->ns->last_skill_exp[skill_obj->subtype] = -1;//TODO: should be made superfluous + pl->last_skill_ob [skill_obj->subtype] = skill_obj; + if (pl->ns) + pl->ns->last_skill_exp[skill_obj->subtype] = -1;//TODO: should be made superfluous } return skill_obj;