--- deliantra/server/common/living.C 2009/11/29 17:41:07 1.105 +++ deliantra/server/common/living.C 2010/03/28 02:53:45 1.109 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -264,7 +264,7 @@ * function since some of the values passed to new_draw_info are hardcoded. */ #define DIFF_MSG(flag, msg1, msg2) \ - new_draw_info(NDI_UNIQUE, 0, op, (flag>0)?msg1:msg2); + new_draw_info (NDI_UNIQUE, 0, op, (flag > 0) ? msg1 : msg2); /* return 1 if we sucessfully changed a stat, 0 if nothing was changed. */ @@ -417,9 +417,6 @@ if (tmp->move_type & MOVE_SWIM) DIFF_MSG (flag, "You feel ready for a swim", "You no longer feel like swimming"); - - /* Changing move status may mean you are affected by things you weren't before */ - check_move_on (op, op); } /* becoming UNDEAD... a special treatment for this flag. Only those not @@ -766,6 +763,8 @@ float old_speed = speed; int stat_sum [NUM_STATS]; + MoveType move_type; // we use change_move_type to change it, so use a local copy + /* First task is to clear all the values back to their original values */ if (type == PLAYER) { @@ -813,7 +812,7 @@ glow_radius = arch->glow_radius; move_type = arch->move_type; - chosen_skill = 0; + object *chosen_skill = 0; /* initializing resistances from the values in player/monster's * archetype clone @@ -898,8 +897,7 @@ if ((tmp->flag [FLAG_APPLIED] && tmp->type != CONTAINER && tmp->type != CLOSE_CON) - || (tmp->type == SKILL - && tmp->subtype == SK_PRAYING)) + || (tmp->type == SKILL && tmp->subtype == SK_PRAYING)) { if (type == PLAYER) { @@ -1001,15 +999,6 @@ switch (tmp->type) { -#if 0 - case WAND: - case ROD: - case HORN: - if (type != PLAYER || current_weapon == tmp) - chosen_skill = tmp; - break; -#endif - /* skills modifying the character -b.t. */ /* for all skills and skill granting objects */ case SKILL: @@ -1080,10 +1069,20 @@ break; + case WAND: + case ROD: + case HORN: + case SKILL_TOOL: + if (type != PLAYER) + chosen_skill = find_skill_by_name (this, tmp->skill); + break; + case BOW: case WEAPON: if (type != PLAYER || current_weapon == tmp) { + chosen_skill = find_skill_by_name (this, tmp->skill); + wc -= tmp->stats.wc + tmp->magic; if (tmp->stats.ac && tmp->stats.ac + tmp->magic > 0) @@ -1152,6 +1151,9 @@ } /* item is equipped */ } /* for loop of items */ + if (type != PLAYER) + this->chosen_skill = chosen_skill; + glow_radius = min (glow_radius, MAX_LIGHT_RADIUS); /* We've gone through all the objects the player has equipped. For many things, we @@ -1403,6 +1405,10 @@ else if (move_type & (MOVE_FLY_LOW | MOVE_FLY_HIGH)) move_type &= ~MOVE_WALK; + // now apply the new move_type + if (this->move_type != move_type) + change_move_type (move_type); + /* It is quite possible that a player's spell costing might have changed, * so we will check that now. */ @@ -1607,7 +1613,7 @@ op->level++; - if (op && op == who && op->stats.exp > 1 && is_dragon_pl (who)) + if (op && op == who && op->stats.exp > 1 && who->is_dragon ()) dragon_level_gain (who); /* Only roll these if it is the player (who) that gained the level */