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,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * 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 Affero GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * and the GNU General Public License along with this program. If not, see |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * <http://www.gnu.org/licenses/>. |
20 | * <http://www.gnu.org/licenses/>. |
21 | * |
21 | * |
22 | * 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> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
26 | |
26 | |
… | |
… | |
236 | |
236 | |
237 | object *tmp = ol->ob; |
237 | object *tmp = ol->ob; |
238 | |
238 | |
239 | if (tmp->type == BUTTON) |
239 | if (tmp->type == BUTTON) |
240 | { |
240 | { |
241 | sint32 total = 0; |
241 | weight_t total = 0; |
242 | |
242 | |
243 | for (object *ab = tmp->above; ab; ab = ab->above) |
243 | for (object *ab = tmp->above; ab; ab = ab->above) |
244 | /* Basically, if the move_type matches that on what the |
244 | /* Basically, if the move_type matches that on what the |
245 | * button wants, we count it. The second check is so that |
245 | * button wants, we count it. The second check is so that |
246 | * objects who don't move (swords, etc) will count. Note that |
246 | * objects who don't move (swords, etc) will count. Note that |
… | |
… | |
349 | * objects on the same space that take the same sacrifice. |
349 | * objects on the same space that take the same sacrifice. |
350 | */ |
350 | */ |
351 | int |
351 | int |
352 | check_altar_sacrifice (object *altar, object *sacrifice, object *originator) |
352 | check_altar_sacrifice (object *altar, object *sacrifice, object *originator) |
353 | { |
353 | { |
354 | if (sacrifice->flag [FLAG_UNPAID]) |
354 | if (sacrifice->flag [FLAG_UNPAID] |
|
|
355 | || sacrifice->flag [FLAG_IS_LINKED] |
|
|
356 | || sacrifice->is_player ()) |
355 | return 0; |
357 | return 0; |
356 | |
358 | |
357 | if (is_match_expr (ARCH_SACRIFICE (altar))) |
359 | if (is_match_expr (ARCH_SACRIFICE (altar))) |
358 | return match (ARCH_SACRIFICE (altar), altar, originator); |
360 | return match (ARCH_SACRIFICE (altar), sacrifice, altar, originator); |
359 | |
361 | |
360 | if (!sacrifice->flag [FLAG_ALIVE] |
362 | if (!sacrifice->flag [FLAG_ALIVE]) |
361 | && !sacrifice->flag [FLAG_IS_LINKED] |
|
|
362 | && sacrifice->type != PLAYER) |
|
|
363 | { |
363 | { |
364 | if (ARCH_SACRIFICE (altar) == shstr_money |
364 | if (ARCH_SACRIFICE (altar) == shstr_money |
365 | && sacrifice->type == MONEY |
365 | && sacrifice->type == MONEY |
366 | && sacrifice->nrof * sacrifice->value >= NROF_SACRIFICE (altar)) |
366 | && sacrifice->nrof * sacrifice->value >= NROF_SACRIFICE (altar)) |
367 | return 1; |
367 | return 1; |