--- deliantra/server/common/living.C 2007/05/17 00:33:29 1.59 +++ deliantra/server/common/living.C 2007/05/22 10:49:57 1.63 @@ -996,40 +996,49 @@ /* skills modifying the character -b.t. */ /* for all skills and skill granting objects */ case SKILL: - if (!QUERY_FLAG (tmp, FLAG_APPLIED)) - break; + { + 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 (%s and %s)\n", + &name, &chosen_skill->name, &tmp->name); + + tmp->flag [FLAG_APPLIED] = false; + update_stats (); + return; + } + else + chosen_skill = tmp; + + if (tmp->stats.dam > 0) + { /* skill is a 'weapon' */ + if (!QUERY_FLAG (this, FLAG_READY_WEAPON)) + weapon_speed = WEAPON_SPEED (tmp); + + if (weapon_speed < 0) + weapon_speed = 0; + + weapon_weight = tmp->weight; + stats.dam += 1 + chosen_skill->level * tmp->stats.dam / 9; + + if (tmp->magic) + stats.dam += tmp->magic; + } - if (chosen_skill) - LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &name); - - chosen_skill = tmp; - - if (tmp->stats.dam > 0) - { /* skill is a 'weapon' */ - if (!QUERY_FLAG (this, FLAG_READY_WEAPON)) - weapon_speed = WEAPON_SPEED (tmp); - - if (weapon_speed < 0) - weapon_speed = 0; - - weapon_weight = tmp->weight; - stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9); - - if (tmp->magic) - stats.dam += tmp->magic; - } + if (tmp->stats.wc) + wc -= tmp->stats.wc + tmp->magic; - if (tmp->stats.wc) - wc -= tmp->stats.wc + tmp->magic; + if (tmp->slaying) + slaying = tmp->slaying; - if (tmp->slaying) - slaying = tmp->slaying; + if (tmp->stats.ac) + ac -= tmp->stats.ac + tmp->magic; - if (tmp->stats.ac) - ac -= tmp->stats.ac + tmp->magic; - - if (settings.spell_encumbrance == TRUE && type == PLAYER) - contr->encumbrance += (int) 3 *tmp->weight / 1000; + if (settings.spell_encumbrance == TRUE && type == PLAYER) + contr->encumbrance += (int) 3 *tmp->weight / 1000; + } break; @@ -1367,9 +1376,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: */