--- deliantra/server/common/living.C 2006/09/10 16:00:23 1.9 +++ deliantra/server/common/living.C 2006/09/12 02:06:19 1.10 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_living_c = - * "$Id: living.C,v 1.9 2006/09/10 16:00:23 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -253,27 +247,27 @@ { switch (attr) { - case STR: - stats->Str = value; - break; - case DEX: - stats->Dex = value; - break; - case CON: - stats->Con = value; - break; - case WIS: - stats->Wis = value; - break; - case POW: - stats->Pow = value; - break; - case CHA: - stats->Cha = value; - break; - case INT: - stats->Int = value; - break; + case STR: + stats->Str = value; + break; + case DEX: + stats->Dex = value; + break; + case CON: + stats->Con = value; + break; + case WIS: + stats->Wis = value; + break; + case POW: + stats->Pow = value; + break; + case CHA: + stats->Cha = value; + break; + case INT: + stats->Int = value; + break; } } @@ -289,29 +283,29 @@ return; switch (attr) { - case STR: - stats->Str += value; - break; - case DEX: - stats->Dex += value; - break; - case CON: - stats->Con += value; - break; - case WIS: - stats->Wis += value; - break; - case POW: - stats->Pow += value; - break; - case CHA: - stats->Cha += value; - break; - case INT: - stats->Int += value; - break; - default: - LOG (llevError, "Invalid attribute in change_attr_value: %d\n", attr); + case STR: + stats->Str += value; + break; + case DEX: + stats->Dex += value; + break; + case CON: + stats->Con += value; + break; + case WIS: + stats->Wis += value; + break; + case POW: + stats->Pow += value; + break; + case CHA: + stats->Cha += value; + break; + case INT: + stats->Int += value; + break; + default: + LOG (llevError, "Invalid attribute in change_attr_value: %d\n", attr); } } @@ -324,20 +318,20 @@ { switch (attr) { - case STR: - return (stats->Str); - case DEX: - return (stats->Dex); - case CON: - return (stats->Con); - case WIS: - return (stats->Wis); - case CHA: - return (stats->Cha); - case INT: - return (stats->Int); - case POW: - return (stats->Pow); + case STR: + return (stats->Str); + case DEX: + return (stats->Dex); + case CON: + return (stats->Con); + case WIS: + return (stats->Wis); + case CHA: + return (stats->Cha); + case INT: + return (stats->Int); + case POW: + return (stats->Pow); } return 0; } @@ -1105,127 +1099,128 @@ switch (tmp->type) { - /* skills modifying the character -b.t. */ - /* for all skills and skill granting objects */ - case SKILL: - if (!QUERY_FLAG (tmp, FLAG_APPLIED)) - break; - - if (IS_COMBAT_SKILL (tmp->subtype)) - wc_obj = tmp; + /* skills modifying the character -b.t. */ + /* for all skills and skill granting objects */ + case SKILL: + if (!QUERY_FLAG (tmp, FLAG_APPLIED)) + break; - if (op->chosen_skill) - { - LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &op->name); - } - op->chosen_skill = tmp; - if (tmp->stats.dam > 0) - { /* skill is a 'weapon' */ - if (!QUERY_FLAG (op, FLAG_READY_WEAPON)) - weapon_speed = (int) WEAPON_SPEED (tmp); - if (weapon_speed < 0) - weapon_speed = 0; - weapon_weight = tmp->weight; - op->stats.dam += tmp->stats.dam * (1 + (op->chosen_skill->level / 9)); - if (tmp->magic) - op->stats.dam += tmp->magic; - } - if (tmp->stats.wc) - wc -= (tmp->stats.wc + tmp->magic); + if (IS_COMBAT_SKILL (tmp->subtype)) + wc_obj = tmp; - if (tmp->slaying != NULL) - op->slaying = tmp->slaying; + if (op->chosen_skill) + LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &op->name); - if (tmp->stats.ac) - ac -= (tmp->stats.ac + tmp->magic); - if (settings.spell_encumbrance == TRUE && op->type == PLAYER) - op->contr->encumbrance += (int) 3 *tmp->weight / 1000; + op->chosen_skill = tmp; - if (op->type == PLAYER) - op->contr->ranges[range_skill] = op; - break; + if (tmp->stats.dam > 0) + { /* skill is a 'weapon' */ + if (!QUERY_FLAG (op, FLAG_READY_WEAPON)) + weapon_speed = (int) WEAPON_SPEED (tmp); + if (weapon_speed < 0) + weapon_speed = 0; + weapon_weight = tmp->weight; + op->stats.dam += tmp->stats.dam * (1 + (op->chosen_skill->level / 9)); + if (tmp->magic) + op->stats.dam += tmp->magic; + } - case SKILL_TOOL: - if (op->chosen_skill) - { - LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &op->name); - } - op->chosen_skill = tmp; - if (op->type == PLAYER) - op->contr->ranges[range_skill] = op; - break; + if (tmp->stats.wc) + wc -= (tmp->stats.wc + tmp->magic); - case SHIELD: - if (settings.spell_encumbrance == TRUE && op->type == PLAYER) - op->contr->encumbrance += (int) tmp->weight / 2000; - case RING: - case AMULET: - case GIRDLE: - case HELMET: - case BOOTS: - case GLOVES: - case CLOAK: - if (tmp->stats.wc) - wc -= (tmp->stats.wc + tmp->magic); - if (tmp->stats.dam) - op->stats.dam += (tmp->stats.dam + tmp->magic); - if (tmp->stats.ac) - ac -= (tmp->stats.ac + tmp->magic); - break; + if (tmp->slaying != NULL) + op->slaying = tmp->slaying; - case WEAPON: + if (tmp->stats.ac) + ac -= (tmp->stats.ac + tmp->magic); + if (settings.spell_encumbrance == TRUE && op->type == PLAYER) + op->contr->encumbrance += (int) 3 *tmp->weight / 1000; + + if (op->type == PLAYER) + op->contr->ranges[range_skill] = op; + break; + + case SKILL_TOOL: + if (op->chosen_skill) + { + LOG (llevDebug, "fix_player, op %s has multiple skills applied\n", &op->name); + } + op->chosen_skill = tmp; + if (op->type == PLAYER) + op->contr->ranges[range_skill] = op; + break; + + case SHIELD: + if (settings.spell_encumbrance == TRUE && op->type == PLAYER) + op->contr->encumbrance += (int) tmp->weight / 2000; + case RING: + case AMULET: + case GIRDLE: + case HELMET: + case BOOTS: + case GLOVES: + case CLOAK: + if (tmp->stats.wc) wc -= (tmp->stats.wc + tmp->magic); - if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) - ac -= tmp->stats.ac + tmp->magic; + if (tmp->stats.dam) op->stats.dam += (tmp->stats.dam + tmp->magic); - weapon_weight = tmp->weight; - weapon_speed = ((int) WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; - if (weapon_speed < 0) - weapon_speed = 0; - op->slaying = tmp->slaying; - /* If there is desire that two handed weapons should do - * extra strength damage, this is where the code should - * go. - */ - op->current_weapon = tmp; - if (settings.spell_encumbrance == TRUE && op->type == PLAYER) - op->contr->encumbrance += (int) 3 *tmp->weight / 1000; - - break; - - case ARMOUR: /* Only the best of these three are used: */ - if (settings.spell_encumbrance == TRUE && op->type == PLAYER) - op->contr->encumbrance += (int) tmp->weight / 1000; - - case BRACERS: - case FORCE: - if (tmp->stats.wc) - { - if (best_wc < tmp->stats.wc + tmp->magic) - { - wc += best_wc; - best_wc = tmp->stats.wc + tmp->magic; - } - else - wc += tmp->stats.wc + tmp->magic; - } - if (tmp->stats.ac) - { - if (best_ac < tmp->stats.ac + tmp->magic) - { - ac += best_ac; /* Remove last bonus */ - best_ac = tmp->stats.ac + tmp->magic; - } - else /* To nullify the below effect */ - ac += tmp->stats.ac + tmp->magic; - } - if (tmp->stats.wc) - wc -= (tmp->stats.wc + tmp->magic); - if (tmp->stats.ac) - ac -= (tmp->stats.ac + tmp->magic); - if (ARMOUR_SPEED (tmp) && ARMOUR_SPEED (tmp) / 10.0 < max) - max = ARMOUR_SPEED (tmp) / 10.0; - break; + if (tmp->stats.ac) + ac -= (tmp->stats.ac + tmp->magic); + break; + + case WEAPON: + wc -= (tmp->stats.wc + tmp->magic); + if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) + ac -= tmp->stats.ac + tmp->magic; + op->stats.dam += (tmp->stats.dam + tmp->magic); + weapon_weight = tmp->weight; + weapon_speed = ((int) WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; + if (weapon_speed < 0) + weapon_speed = 0; + op->slaying = tmp->slaying; + /* If there is desire that two handed weapons should do + * extra strength damage, this is where the code should + * go. + */ + op->current_weapon = tmp; + if (settings.spell_encumbrance == TRUE && op->type == PLAYER) + op->contr->encumbrance += (int) 3 *tmp->weight / 1000; + + break; + + case ARMOUR: /* Only the best of these three are used: */ + if (settings.spell_encumbrance == TRUE && op->type == PLAYER) + op->contr->encumbrance += (int) tmp->weight / 1000; + + case BRACERS: + case FORCE: + if (tmp->stats.wc) + { + if (best_wc < tmp->stats.wc + tmp->magic) + { + wc += best_wc; + best_wc = tmp->stats.wc + tmp->magic; + } + else + wc += tmp->stats.wc + tmp->magic; + } + if (tmp->stats.ac) + { + if (best_ac < tmp->stats.ac + tmp->magic) + { + ac += best_ac; /* Remove last bonus */ + best_ac = tmp->stats.ac + tmp->magic; + } + else /* To nullify the below effect */ + ac += tmp->stats.ac + tmp->magic; + } + if (tmp->stats.wc) + wc -= (tmp->stats.wc + tmp->magic); + if (tmp->stats.ac) + ac -= (tmp->stats.ac + tmp->magic); + if (ARMOUR_SPEED (tmp) && ARMOUR_SPEED (tmp) / 10.0 < max) + max = ARMOUR_SPEED (tmp) / 10.0; + break; } /* switch tmp->type */ } /* item is equipped */ } /* for loop of items */