1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | * CrossFire, A Multiplayer game |
3 | |
3 | * |
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (C) 1992 Frank Tore Johansen |
7 | |
7 | * |
8 | This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | (at your option) any later version. |
11 | * (at your option) any later version. |
12 | |
12 | * |
13 | This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | |
17 | * |
18 | You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
19 | * along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | |
21 | * |
22 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | /* |
25 | /* |
26 | * Routines that is executed from objects based on their speed have been |
26 | * Routines that is executed from objects based on their speed have been |
27 | * collected in this file. |
27 | * collected in this file. |
28 | */ |
28 | */ |
29 | |
|
|
30 | #include <global.h> |
29 | #include <global.h> |
31 | #include <spells.h> |
30 | #include <spells.h> |
32 | #include <sproto.h> |
31 | #include <sproto.h> |
33 | |
32 | |
34 | /* The following removes doors. The functions check to see if similar |
33 | /* The following removes doors. The functions check to see if similar |
35 | * doors are next to the one that is being removed, and if so, set it |
34 | * doors are next to the one that is being removed, and if so, set it |
36 | * so those will be removed shortly (in a cascade like fashion.) |
35 | * so those will be removed shortly (in a cascade like fashion.) |
37 | */ |
36 | */ |
38 | |
|
|
39 | void |
37 | void |
40 | remove_door (object *op) |
38 | remove_door (object *op) |
41 | { |
39 | { |
42 | int i; |
40 | int i; |
43 | object *tmp; |
41 | object *tmp; |
… | |
… | |
1037 | * needs to be on top. |
1035 | * needs to be on top. |
1038 | */ |
1036 | */ |
1039 | if (op->above->type == PLAYER) |
1037 | if (op->above->type == PLAYER) |
1040 | { |
1038 | { |
1041 | if (INVOKE_OBJECT (TRIGGER, op, ARG_OBJECT (player))) |
1039 | if (INVOKE_OBJECT (TRIGGER, op, ARG_OBJECT (player))) |
1042 | return; |
1040 | return; |
|
|
1041 | |
1043 | player = op->above; |
1042 | player = op->above; |
1044 | |
1043 | |
1045 | for (walk = op->inv; walk != NULL; walk = walk->below) |
1044 | for (walk = op->inv; walk != NULL; walk = walk->below) |
1046 | apply_changes_to_player (player, walk); |
1045 | apply_changes_to_player (player, walk); |
1047 | |
1046 | |
… | |
… | |
1060 | } |
1059 | } |
1061 | else |
1060 | else |
1062 | LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op)); |
1061 | LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op)); |
1063 | |
1062 | |
1064 | op->above->enter_exit (op); |
1063 | op->above->enter_exit (op); |
1065 | player->contr->save (); |
|
|
1066 | } |
1064 | } |
1067 | } |
1065 | } |
1068 | |
1066 | |
1069 | /* firewalls fire other spells. |
1067 | /* firewalls fire other spells. |
1070 | * The direction of the wall is stored in op->stats.sp. |
1068 | * The direction of the wall is stored in op->stats.sp. |