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.4 by root, Sun Sep 10 15:59:58 2006 UTC vs.
Revision 1.22 by root, Sat Nov 17 23:40:04 2018 UTC

1
2/* 1/*
3 * static char *rcsid_swamp_c = 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
4 * "$Id: swamp.C,v 1.4 2006/09/10 15:59:58 root Exp $"; 3 *
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
6 * Copyright (©) 2005 Mark Wedel & Crossfire Development Team
7 * Copyright (©) 1992 Frank Tore Johansen
8 *
9 * Deliantra is free software: you can redistribute it and/or modify it under
10 * the terms of the Affero GNU General Public License as published by the
11 * Free Software Foundation, either version 3 of the License, or (at your
12 * option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the Affero GNU General Public License
20 * and the GNU General Public License along with this program. If not, see
21 * <http://www.gnu.org/licenses/>.
22 *
23 * The authors can be reached via e-mail to <support@deliantra.net>
5 */ 24 */
6
7/*
8 CrossFire, A Multiplayer game for X-windows
9
10 Copyright (C) 2005 Mark Wedel & Crossfire Development Team
11 Copyright (C) 1992 Frank Tore Johansen
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26
27 The authors can be reached via e-mail at crossfire-devel@real-time.com
28*/
29 25
30#include <global.h> 26#include <global.h>
31#ifndef __CEXTRACT__ 27#ifndef __CEXTRACT__
32# include <sproto.h> 28# include <sproto.h>
33#endif 29#endif
54 object *nabove; 50 object *nabove;
55 51
56 while (above) 52 while (above)
57 { 53 {
58 nabove = above->above; 54 nabove = above->above;
59 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])
60 { 56 {
61 if (op->stats.food < 1) 57 if (op->stats.food < 1)
62 { 58 {
63 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);
64 op->stats.food = 1; 60 op->stats.food = 1;
78 case 2: 74 case 2:
79 if (rndm (0, 2) == 0) 75 if (rndm (0, 2) == 0)
80 { 76 {
81 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);
82 op->stats.food = 3; 78 op->stats.food = 3;
83 sprintf (above->contr->killer, "drowning in a %s", &op->name); 79 above->contr->killer = op;
84 above->stats.hp--; 80 above->stats.hp--;
85 above->speed_left -= op->move_slow_penalty; 81 above->speed_left -= op->move_slow_penalty;
86 } 82 }
87 break; 83 break;
88 84
94 /* player is ready to drown - only woodsman skill can save him */ 90 /* player is ready to drown - only woodsman skill can save him */
95 if (!woodsman) 91 if (!woodsman)
96 { 92 {
97 op->stats.food = 0; 93 op->stats.food = 0;
98 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);
99 sprintf (above->contr->killer, "drowning in a %s", &op->name); 95 above->contr->killer = op;
100 96
101 above->stats.hp = -1; 97 above->stats.hp = -1;
102 kill_player (above); /* player dies in the swamp */ 98 kill_player (above); /* player dies in the swamp */
103 } 99 }
104 else 100 else
109 } 105 }
110 } 106 }
111 break; 107 break;
112 } 108 }
113 } 109 }
114 else if (!QUERY_FLAG (above, FLAG_ALIVE) && !(above->move_type & MOVE_FLYING) && 110 else if (!above->flag [FLAG_ALIVE] && !(above->move_type & MOVE_FLYING) &&
115 !(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]))
116 { 112 {
117 if (rndm (0, 2) == 0) 113 if (rndm (0, 2) == 0)
118 decrease_ob (above); 114 above->decrease ();
119 } 115 }
116
120 above = nabove; 117 above = nabove;
121 } 118 }
122} 119}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines