ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/swamp.C
(Generate patch)

Comparing deliantra/server/server/swamp.C (file contents):
Revision 1.8 by root, Mon May 28 21:28:36 2007 UTC vs.
Revision 1.22 by root, Sat Nov 17 23:40:04 2018 UTC

1/* 1/*
2 * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT 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 * Crossfire TRT is free software; you can redistribute it and/or modify it 9 * Deliantra is free software: you can redistribute it and/or modify it under
9 * under the terms of the GNU General Public License as published by the Free 10 * the terms of the Affero GNU General Public License as published by the
10 * Software Foundation; either version 2 of the License, or (at your option) 11 * Free Software Foundation, either version 3 of the License, or (at your
11 * any later version. 12 * option) any later version.
12 * 13 *
13 * This program is distributed in the hope that it will be useful, but 14 * This program is distributed in the hope that it will be useful,
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * 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 along 19 * You should have received a copy of the Affero GNU General Public License
19 * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 20 * and the GNU General Public License along with this program. If not, see
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 * <http://www.gnu.org/licenses/>.
21 * 22 *
22 * The authors can be reached via e-mail to <crossfire@schmorp.de> 23 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 24 */
24 25
25#include <global.h> 26#include <global.h>
26#ifndef __CEXTRACT__ 27#ifndef __CEXTRACT__
27# include <sproto.h> 28# include <sproto.h>
49 object *nabove; 50 object *nabove;
50 51
51 while (above) 52 while (above)
52 { 53 {
53 nabove = above->above; 54 nabove = above->above;
54 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])
55 { 56 {
56 if (op->stats.food < 1) 57 if (op->stats.food < 1)
57 { 58 {
58 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);
59 op->stats.food = 1; 60 op->stats.food = 1;
73 case 2: 74 case 2:
74 if (rndm (0, 2) == 0) 75 if (rndm (0, 2) == 0)
75 { 76 {
76 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);
77 op->stats.food = 3; 78 op->stats.food = 3;
78 sprintf (above->contr->killer, "drowning in a %s", &op->name); 79 above->contr->killer = op;
79 above->stats.hp--; 80 above->stats.hp--;
80 above->speed_left -= op->move_slow_penalty; 81 above->speed_left -= op->move_slow_penalty;
81 } 82 }
82 break; 83 break;
83 84
89 /* player is ready to drown - only woodsman skill can save him */ 90 /* player is ready to drown - only woodsman skill can save him */
90 if (!woodsman) 91 if (!woodsman)
91 { 92 {
92 op->stats.food = 0; 93 op->stats.food = 0;
93 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);
94 sprintf (above->contr->killer, "drowning in a %s", &op->name); 95 above->contr->killer = op;
95 96
96 above->stats.hp = -1; 97 above->stats.hp = -1;
97 kill_player (above); /* player dies in the swamp */ 98 kill_player (above); /* player dies in the swamp */
98 } 99 }
99 else 100 else
104 } 105 }
105 } 106 }
106 break; 107 break;
107 } 108 }
108 } 109 }
109 else if (!QUERY_FLAG (above, FLAG_ALIVE) && !(above->move_type & MOVE_FLYING) && 110 else if (!above->flag [FLAG_ALIVE] && !(above->move_type & MOVE_FLYING) &&
110 !(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]))
111 { 112 {
112 if (rndm (0, 2) == 0) 113 if (rndm (0, 2) == 0)
113 decrease_ob (above); 114 above->decrease ();
114 } 115 }
116
115 above = nabove; 117 above = nabove;
116 } 118 }
117} 119}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines