--- deliantra/server/common/living.C 2006/12/22 16:34:00 1.19 +++ deliantra/server/common/living.C 2007/01/06 14:42:29 1.25 @@ -1,6 +1,7 @@ /* CrossFire, A Multiplayer game for X-windows + Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team Copyright (C) 2002 Mark Wedel & Crossfire Development Team Copyright (C) 1992 Frank Tore Johansen @@ -226,11 +227,11 @@ }; const char *const statname[NUM_STATS] = { - "strength", "dexterity", "constitution", "wisdom", "charisma", "intelligence", "power" + "strength", "dexterity", "constitution", "intelligence", "wisdom", "power", "charisma" }; const char *const short_stat_name[NUM_STATS] = { - "Str", "Dex", "Con", "Wis", "Cha", "Int", "Pow" + "Str", "Dex", "Con", "Int", "Wis", "Pow", "Cha" }; /* @@ -373,9 +374,9 @@ /* remember what object was like before it was changed. note that * refop is a local copy of op only to be used for detecting changes - * found by fix_player. refop is not a real object + * found by update_stats. refop is not a real object */ - object_pod refop = *op; + object_copy refop = *op; if (op->type == PLAYER) { @@ -403,6 +404,7 @@ { nstat = 20 + get_attr_value (&(op->arch->clone.stats), j); } + if (nstat != ostat) { set_attr_value (&(op->contr->orig_stats), j, nstat); @@ -414,12 +416,14 @@ potion_max = 1; } } + /* This section of code ups the characters normal stats also. I am not * sure if this is strictly necessary, being that fix_player probably * recalculates this anyway. */ for (j = 0; j < NUM_STATS; j++) change_attr_value (&(op->stats), j, flag * get_attr_value (&(tmp->stats), j)); + check_stat_bounds (&(op->stats)); } /* end of potion handling code */ } @@ -453,21 +457,25 @@ success = 1; DIFF_MSG (flag, "Your hands begin to glow red.", "Your hands stop glowing red."); } + if (QUERY_FLAG (op, FLAG_LIFESAVE) != QUERY_FLAG (&refop, FLAG_LIFESAVE)) { success = 1; DIFF_MSG (flag, "You feel very protected.", "You don't feel protected anymore."); } + if (QUERY_FLAG (op, FLAG_REFL_MISSILE) != QUERY_FLAG (&refop, FLAG_REFL_MISSILE)) { success = 1; DIFF_MSG (flag, "A magic force shimmers around you.", "The magic force fades away."); } + if (QUERY_FLAG (op, FLAG_REFL_SPELL) != QUERY_FLAG (&refop, FLAG_REFL_SPELL)) { success = 1; DIFF_MSG (flag, "You feel more safe now, somehow.", "Suddenly you feel less safe, somehow."); } + /* movement type has changed. We don't care about cases where * user has multiple items giving the same type appled like we * used to - that is more work than what we gain, plus messages @@ -525,11 +533,13 @@ success = 1; DIFF_MSG (flag, "You walk more quietly.", "You walk more noisily."); } + if (QUERY_FLAG (op, FLAG_MAKE_INVIS) != QUERY_FLAG (&refop, FLAG_MAKE_INVIS)) { success = 1; DIFF_MSG (flag, "You become transparent.", "You can see yourself."); } + /* blinded you can tell if more blinded since blinded player has minimal * vision */ @@ -657,6 +667,7 @@ } } } + return success; } @@ -824,6 +835,7 @@ 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; + float old_speed = speed; /* First task is to clear all the values back to their original values */ if (type == PLAYER) @@ -1020,7 +1032,7 @@ for (i = 0; i < NROFATTACKS; i++) { /* Potential for cursed potions, in which case we just can use - * a straight MAX, as potion_resist is initialized to zero. + * a straight MAX, as potion_resist is initialised to zero. */ if (tmp->type == POTION_EFFECT) { @@ -1494,7 +1506,8 @@ else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) move_type &= ~MOVE_WALK; - update_ob_speed (this); + if (speed != old_speed) + set_speed (speed); /* It is quite possible that a player's spell costing might have changed, * so we will check that now.