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

Comparing deliantra/server/server/rune.C (file contents):
Revision 1.39 by root, Sun Jan 4 22:39:59 2009 UTC vs.
Revision 1.44 by root, Fri Nov 6 13:03:34 2009 UTC

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,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2003,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2003,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * 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 9 * 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 10 * Free Software Foundation, either version 3 of the License, or (at your
11 * (at your option) any later version. 11 * 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 Affero GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
20 * 21 *
21 * The authors can be reached via e-mail to <support@deliantra.net> 22 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 23 */
23 24
24#include <global.h> 25#include <global.h>
195} 196}
196 197
197/* peterm: rune_attack 198/* peterm: rune_attack
198 * function handles those runes which detonate but do not cast spells. 199 * function handles those runes which detonate but do not cast spells.
199 */ 200 */
200void 201static void
201rune_attack (object *op, object *victim) 202rune_attack (object *op, object *victim)
202{ 203{
203 if (victim) 204 if (victim)
204 { 205 {
205 hit_player (victim, op->stats.dam, op, op->attacktype, 1); 206 hit_player (victim, op->stats.dam, op, op->attacktype, 1);
237 /* Prevent recursion */ 238 /* Prevent recursion */
238 if (trap->stats.hp <= 0) 239 if (trap->stats.hp <= 0)
239 return; 240 return;
240 241
241 if (QUERY_FLAG (trap, FLAG_IS_LINKED)) 242 if (QUERY_FLAG (trap, FLAG_IS_LINKED))
242 use_trigger (trap); 243 use_trigger (trap, victim);
243 244
244 /* Only living objects can trigger runes that don't cast spells, as 245 /* Only living objects can trigger runes that don't cast spells, as
245 * doing direct damage to a non-living object doesn't work anyway. 246 * doing direct damage to a non-living object doesn't work anyway.
246 * Typical example is an arrow attacking a door. 247 * Typical example is an arrow attacking a door.
247 */ 248 */
254 new_draw_info (NDI_UNIQUE, 0, victim, trap->msg); 255 new_draw_info (NDI_UNIQUE, 0, victim, trap->msg);
255 256
256 /* Flash an image of the trap on the map so the poor sod 257 /* Flash an image of the trap on the map so the poor sod
257 * knows what hit him. 258 * knows what hit him.
258 */ 259 */
259 env = trap->outer_env (); 260 env = trap->outer_env_or_self ();
260 261
261 /* If the victim is not next to this trap, don't set it off. 262 /* If the victim is not next to this trap, don't set it off.
262 * players shouldn't get hit by firing arrows at a door for example. 263 * players shouldn't get hit by firing arrows at a door for example.
263 * At the same time, the trap will stick around until detonated 264 * At the same time, the trap will stick around until detonated
264 */ 265 */
409{ 410{
410 if (where == NULL) 411 if (where == NULL)
411 return 0; 412 return 0;
412 413
413 object *tmp = get_archetype ("runedet"); 414 object *tmp = get_archetype ("runedet");
414 tmp->face = GET_ANIMATION (trap, 0); 415 tmp->face = trap->get_anim_frame (0);
415 tmp->insert_at (where, 0); 416 tmp->insert_at (where, 0);
416 417
417 return 1; 418 return 1;
418} 419}
419 420

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines