--- deliantra/server/common/living.C 2007/04/24 12:32:14 1.36 +++ deliantra/server/common/living.C 2007/04/29 14:39:55 1.39 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -845,12 +845,13 @@ contr->encumbrance = 0; attacktype = 0; - contr->digestion = 0; - contr->gen_hp = 0; - contr->gen_sp = 0; - contr->gen_grace = 0; + + contr->digestion = 0; + contr->gen_hp = 0; + contr->gen_sp = 0; + contr->gen_grace = 0; contr->gen_sp_armour = 10; - contr->item_power = 0; + contr->item_power = 0; /* Don't clobber all the range_ values. range_golem otherwise * gets reset for no good reason, and we don't want to reset @@ -881,11 +882,12 @@ if (!QUERY_FLAG (&arch->clone, FLAG_UNDEAD )) CLEAR_FLAG (this, FLAG_UNDEAD); if (!QUERY_FLAG (&arch->clone, FLAG_SEE_IN_DARK )) CLEAR_FLAG (this, FLAG_SEE_IN_DARK); - path_attuned = arch->clone.path_attuned; + path_attuned = arch->clone.path_attuned; path_repelled = arch->clone.path_repelled; - path_denied = arch->clone.path_denied; - glow_radius = arch->clone.glow_radius; - move_type = arch->clone.move_type; + path_denied = arch->clone.path_denied; + glow_radius = arch->clone.glow_radius; + move_type = arch->clone.move_type; + chosen_skill = NULL; /* initializing resistances from the values in player/monster's @@ -971,8 +973,11 @@ * because the skill shouldn't count against body positions being used * up, etc. */ - if ((QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->type != CONTAINER && tmp->type != CLOSE_CON) || - (tmp->type == SKILL && tmp->subtype == SK_PRAYING)) + if ((QUERY_FLAG (tmp, FLAG_APPLIED) + && tmp->type != CONTAINER + && tmp->type != CLOSE_CON) + || (tmp->type == SKILL + && tmp->subtype == SK_PRAYING)) { if (type == PLAYER) { @@ -983,13 +988,13 @@ contr->ranges[range_misc] = tmp; for (i = 0; i < NUM_STATS; i++) - change_attr_value (&(stats), i, get_attr_value (&(tmp->stats), i)); + change_attr_value (&stats, i, get_attr_value (&tmp->stats, i)); /* 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) || + if ((tmp->type == WEAPON) || (tmp->type == BOW) || (tmp->type == ARMOUR) || (tmp->type == HELMET) || (tmp->type == SHIELD) || (tmp->type == RING) || (tmp->type == BOOTS) || (tmp->type == GLOVES) || @@ -1015,6 +1020,7 @@ if (tmp->type == SYMPTOM) { speed_reduce_from_disease = tmp->last_sp / 100.0; + if (speed_reduce_from_disease == 0) speed_reduce_from_disease = 1; } @@ -1049,11 +1055,11 @@ if (tmp->type != BOW && tmp->type != SYMPTOM) attacktype |= tmp->attacktype; - path_attuned |= tmp->path_attuned; + path_attuned |= tmp->path_attuned; path_repelled |= tmp->path_repelled; - path_denied |= tmp->path_denied; - stats.luck += tmp->stats.luck; - move_type |= tmp->move_type; + path_denied |= tmp->path_denied; + move_type |= tmp->move_type; + stats.luck += tmp->stats.luck; if (QUERY_FLAG (tmp, FLAG_LIFESAVE )) SET_FLAG (this, FLAG_LIFESAVE); if (QUERY_FLAG (tmp, FLAG_REFL_SPELL )) SET_FLAG (this, FLAG_REFL_SPELL); @@ -1152,23 +1158,24 @@ case GLOVES: case CLOAK: if (tmp->stats.wc) - wc -= (tmp->stats.wc + tmp->magic); + wc -= tmp->stats.wc + tmp->magic; if (tmp->stats.dam) - stats.dam += (tmp->stats.dam + tmp->magic); + stats.dam += tmp->stats.dam + tmp->magic; if (tmp->stats.ac) - ac -= (tmp->stats.ac + tmp->magic); + ac -= tmp->stats.ac + tmp->magic; break; + case BOW: case WEAPON: - wc -= (tmp->stats.wc + tmp->magic); + wc -= tmp->stats.wc + tmp->magic; if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) ac -= tmp->stats.ac + tmp->magic; - stats.dam += (tmp->stats.dam + tmp->magic); + stats.dam += tmp->stats.dam + tmp->magic; weapon_weight = tmp->weight; weapon_speed = ((int) WEAPON_SPEED (tmp) * 2 - tmp->magic) / 2; @@ -1388,19 +1395,21 @@ if (type == PLAYER && wc_obj && wc_obj->level > 1) { - wc -= (wc_obj->level + thaco_bonus[stats.Str]); + wc -= wc_obj->level + thaco_bonus[stats.Str]; + for (i = 1; i < wc_obj->level; i++) { /* addtional wc every 6 levels */ if (!(i % 6)) wc--; + /* addtional dam every 4 levels. */ - if (!(i % 4) && (dam_bonus[stats.Str] >= 0)) - stats.dam += (1 + (dam_bonus[stats.Str] / 5)); + if (!(i % 4) && dam_bonus[stats.Str] >= 0) + stats.dam += 1 + dam_bonus[stats.Str] / 5; } } else - wc -= (level + thaco_bonus[stats.Str]); + wc -= level + thaco_bonus[stats.Str]; stats.dam += dam_bonus[stats.Str]; @@ -1975,7 +1984,6 @@ void change_exp (object *op, sint64 exp, const char *skill_name, int flag) { - #ifdef EXP_DEBUG LOG (llevDebug, "change_exp() called for %s, exp = %" PRId64 "\n", query_name (op), exp); #endif @@ -2034,7 +2042,6 @@ * settings death_penalty_percentage and death_penalty_levels, and by the * amount of permenent experience, whichever gives the lowest loss. */ - void apply_death_exp_penalty (object *op) {