--- deliantra/server/common/living.C 2007/05/17 00:33:29 1.59 +++ deliantra/server/common/living.C 2007/05/28 21:21:40 1.65 @@ -1,25 +1,25 @@ /* - * CrossFire, A Multiplayer game + * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. * - * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team - * Copyright (C) 2002 Mark Wedel & Crossfire Development Team - * Copyright (C) 1992 Frank Tore Johansen + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * Crossfire TRT is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * The authors can be reached via e-mail at + * You should have received a copy of the GNU General Public License along + * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The authors can be reached via e-mail to */ #include @@ -816,12 +816,6 @@ */ for (tmp = inv; tmp; tmp = tmp->below) { - /* See note in map.c:update_position about making this additive - * since light sources are never applied, need to put check here. - */ - if (tmp->glow_radius > glow_radius) - glow_radius = tmp->glow_radius; - /* This happens because apply_potion calls change_abil with the potion * applied so we can tell the player what changed. But change_abil * then calls this function. @@ -829,6 +823,12 @@ if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->type == POTION) continue; + /* See note in map.c:update_position about making this additive + * since light sources are never applied, need to put check here. + */ + if (tmp->glow_radius > glow_radius) + glow_radius = tmp->glow_radius; + /* For some things, we don't care what is equipped */ if (tmp->type == SKILL) { @@ -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\n", &name); + if (chosen_skill) + { + LOG (llevDebug, "fix_player, op %s has multiple skills applied (%s and %s)\n", + &name, &chosen_skill->name, &tmp->name); - chosen_skill = tmp; + 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 (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; + if (weapon_speed < 0) + weapon_speed = 0; - weapon_weight = tmp->weight; - stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9); + weapon_weight = tmp->weight; + stats.dam += 1 + chosen_skill->level * tmp->stats.dam / 9; - if (tmp->magic) - stats.dam += tmp->magic; - } + 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: */