1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team |
|
|
5 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2005,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 2005 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
8 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your option) any later version. |
12 | * option) any later version. |
12 | * |
13 | * |
13 | * This program is distributed in the hope that it will be useful, |
14 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * GNU General Public License for more details. |
17 | * |
18 | * |
18 | * You should have received a copy of the GNU General Public License |
19 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * and the GNU General Public License along with this program. If not, see |
|
|
21 | * <http://www.gnu.org/licenses/>. |
20 | * |
22 | * |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | */ |
24 | */ |
23 | |
25 | |
24 | #include <global.h> |
26 | #include <global.h> |
25 | #ifndef __CEXTRACT__ |
27 | #ifndef __CEXTRACT__ |
… | |
… | |
48 | object *nabove; |
50 | object *nabove; |
49 | |
51 | |
50 | while (above) |
52 | while (above) |
51 | { |
53 | { |
52 | nabove = above->above; |
54 | nabove = above->above; |
53 | if (above->type == PLAYER && !(above->move_type & MOVE_FLYING) && above->stats.hp >= 0 && !QUERY_FLAG (above, FLAG_WIZ)) |
55 | if (above->type == PLAYER && !(above->move_type & MOVE_FLYING) && above->stats.hp >= 0 && !above->flag [FLAG_WIZ]) |
54 | { |
56 | { |
55 | if (op->stats.food < 1) |
57 | if (op->stats.food < 1) |
56 | { |
58 | { |
57 | LOG (llevDebug, "move_deep_swamp(): player is here, but state is " "%d\n", op->stats.food); |
59 | LOG (llevDebug, "move_deep_swamp(): player is here, but state is " "%d\n", op->stats.food); |
58 | op->stats.food = 1; |
60 | op->stats.food = 1; |
… | |
… | |
72 | case 2: |
74 | case 2: |
73 | if (rndm (0, 2) == 0) |
75 | if (rndm (0, 2) == 0) |
74 | { |
76 | { |
75 | new_draw_info_format (NDI_UNIQUE | NDI_RED, 0, above, "You are down to your NECK in the dangerous %s.", &op->name); |
77 | new_draw_info_format (NDI_UNIQUE | NDI_RED, 0, above, "You are down to your NECK in the dangerous %s.", &op->name); |
76 | op->stats.food = 3; |
78 | op->stats.food = 3; |
77 | sprintf (above->contr->killer, "drowning in a %s", &op->name); |
79 | above->contr->killer = op; |
78 | above->stats.hp--; |
80 | above->stats.hp--; |
79 | above->speed_left -= op->move_slow_penalty; |
81 | above->speed_left -= op->move_slow_penalty; |
80 | } |
82 | } |
81 | break; |
83 | break; |
82 | |
84 | |
… | |
… | |
88 | /* player is ready to drown - only woodsman skill can save him */ |
90 | /* player is ready to drown - only woodsman skill can save him */ |
89 | if (!woodsman) |
91 | if (!woodsman) |
90 | { |
92 | { |
91 | op->stats.food = 0; |
93 | op->stats.food = 0; |
92 | new_draw_info_format (NDI_UNIQUE | NDI_ALL, 1, NULL, "%s disappeared into a %s.", &above->name, &op->name); |
94 | new_draw_info_format (NDI_UNIQUE | NDI_ALL, 1, NULL, "%s disappeared into a %s.", &above->name, &op->name); |
93 | sprintf (above->contr->killer, "drowning in a %s", &op->name); |
95 | above->contr->killer = op; |
94 | |
96 | |
95 | above->stats.hp = -1; |
97 | above->stats.hp = -1; |
96 | kill_player (above); /* player dies in the swamp */ |
98 | kill_player (above); /* player dies in the swamp */ |
97 | } |
99 | } |
98 | else |
100 | else |
… | |
… | |
103 | } |
105 | } |
104 | } |
106 | } |
105 | break; |
107 | break; |
106 | } |
108 | } |
107 | } |
109 | } |
108 | else if (!QUERY_FLAG (above, FLAG_ALIVE) && !(above->move_type & MOVE_FLYING) && |
110 | else if (!above->flag [FLAG_ALIVE] && !(above->move_type & MOVE_FLYING) && |
109 | !(QUERY_FLAG (above, FLAG_IS_FLOOR)) && !(QUERY_FLAG (above, FLAG_OVERLAY_FLOOR)) && !(QUERY_FLAG (above, FLAG_NO_PICK))) |
111 | !(above->flag [FLAG_IS_FLOOR]) && !(above->flag [FLAG_OVERLAY_FLOOR]) && !(above->flag [FLAG_NO_PICK])) |
110 | { |
112 | { |
111 | if (rndm (0, 2) == 0) |
113 | if (rndm (0, 2) == 0) |
112 | decrease_ob (above); |
114 | above->decrease (); |
113 | } |
115 | } |
|
|
116 | |
114 | above = nabove; |
117 | above = nabove; |
115 | } |
118 | } |
116 | } |
119 | } |