--- deliantra/server/server/move.C 2007/01/15 21:06:20 1.15 +++ deliantra/server/server/move.C 2007/05/28 21:28:36 1.19 @@ -1,25 +1,25 @@ /* - * CrossFire, A Multiplayer game for X-windows + * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. * - * 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 author can be reached via e-mail to + * 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 @@ -27,11 +27,6 @@ # include #endif -#ifdef COZY_SERVER -// use a ptotoype -extern int same_party (partylist *a, partylist *b); -#endif - /* * move_object() tries to move object op in the direction "dir". * If it fails (something blocks the passage), it returns 0, @@ -46,7 +41,6 @@ return move_ob (op, dir, op); } - /* object op is trying to move in direction dir. * originator is typically the same as op, but * can be different if originator is causing op to @@ -430,11 +424,8 @@ /* player change place with his pets or summoned creature */ /* TODO: allow multi arch pushing. Can't be very difficult */ if (who->more == NULL -#ifdef COZY_SERVER - && ((owner && owner->contr && pusher->contr && same_party (owner->contr->party, pusher->contr->party)) || owner == pusher) -#else - && owner == pusher -#endif + && ((owner && owner->contr && pusher->contr && same_party (owner->contr->party, pusher->contr->party)) + || owner == pusher) ) { int temp; @@ -459,26 +450,22 @@ return 0; } - /* We want ONLY become enemy of evil, unaggressive monster. We must RUN in them */ /* In original we have here a unaggressive check only - that was the reason why */ /* we so often become an enemy of friendly monsters... */ /* funny: was they set to unaggressive 0 (= not so nice) they don't attack */ - if (owner != pusher && pusher->type == PLAYER && who->type != PLAYER && !QUERY_FLAG (who, FLAG_FRIENDLY) && !QUERY_FLAG (who, FLAG_NEUTRAL)) { if (pusher->contr->run_on) /* only when we run */ { - new_draw_info_format (NDI_UNIQUE, 0, pusher, "You start to attack %s !!", &who->name); + new_draw_info_format (NDI_UNIQUE, 0, pusher, "You start to attack %s!!", &who->name); CLEAR_FLAG (who, FLAG_UNAGGRESSIVE); /* the sucker don't like you anymore */ who->enemy = pusher; return 1; } else - { - new_draw_info_format (NDI_UNIQUE, 0, pusher, "You avoid attacking %s.", &who->name); - } + new_draw_info_format (NDI_UNIQUE, 0, pusher, "You avoid attacking %s.", &who->name); } /* now, lets test stand still. we NEVER can push stand_still monsters. */ @@ -498,13 +485,12 @@ str1 = (who->stats.Str > 0 ? who->stats.Str : who->level); str2 = (pusher->stats.Str > 0 ? pusher->stats.Str : pusher->level); if (QUERY_FLAG (who, FLAG_WIZ) || - random_roll (str1, str1 / 2 + str1 * 2, who, PREFER_HIGH) >= - random_roll (str2, str2 / 2 + str2 * 2, pusher, PREFER_HIGH) || !move_object (who, dir)) + random_roll (str1, str1 * 5 / 2, who, PREFER_HIGH) >= + random_roll (str2, str2 * 5 / 2, pusher, PREFER_HIGH) || !move_object (who, dir)) { if (who->type == PLAYER) - { - new_draw_info_format (NDI_UNIQUE, 0, who, "%s tried to push you.", &pusher->name); - } + new_draw_info_format (NDI_UNIQUE, 0, who, "%s tried to push you.", &pusher->name); + return 0; }