--- deliantra/server/common/button.C 2007/07/01 05:00:17 1.36
+++ deliantra/server/common/button.C 2007/11/08 19:43:23 1.40
@@ -1,11 +1,11 @@
/*
- * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
+ * This file is part of Deliantra, the Roguelike Realtime MMORPG.
*
- * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
+ * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
* Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
* Copyright (©) 1992,2007 Frank Tore Johansen
*
- * Crossfire TRT is free software: you can redistribute it and/or modify
+ * Deliantra is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
- * The authors can be reached via e-mail to
+ * The authors can be reached via e-mail to
*/
#include
@@ -61,6 +61,7 @@
/* if the criteria isn't appropriate, don't do anything */
if (state && !QUERY_FLAG (tmp, FLAG_ACTIVATE_ON_PUSH))
continue;
+
if (!state && !QUERY_FLAG (tmp, FLAG_ACTIVATE_ON_RELEASE))
continue;
@@ -68,6 +69,10 @@
{
case GATE:
case HOLE:
+ if (!tmp->active)
+ tmp->play_sound (tmp->sound
+ ? tmp->sound
+ : sound_find (tmp->type == GATE ? "trigger_gate" : "trigger_hole"));
tmp->value = tmp->stats.maxsp ? !state : state;
tmp->set_speed (0.5);
break;
@@ -80,6 +85,7 @@
case SIGN:
if (!tmp->stats.food || tmp->last_eat < tmp->stats.food)
{
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_sign"));
new_info_map (NDI_UNIQUE | NDI_NAVY, tmp->map, tmp->msg);
if (tmp->stats.food)
tmp->last_eat++;
@@ -87,6 +93,7 @@
break;
case ALTAR:
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_altar"));
tmp->value = 1;
SET_ANIMATION (tmp, tmp->value);
update_object (tmp, UP_OBJ_FACE);
@@ -94,6 +101,7 @@
case BUTTON:
case PEDESTAL:
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_button"));
tmp->value = state;
SET_ANIMATION (tmp, tmp->value);
update_object (tmp, UP_OBJ_FACE);
@@ -104,6 +112,8 @@
break;
case TIMED_GATE:
+ if (!tmp->active)
+ tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_gate"));
tmp->set_speed (tmp->arch->speed);
tmp->value = tmp->arch->value;
tmp->stats.sp = 1;
@@ -142,6 +152,7 @@
break;
case TRIGGER_MARKER:
+ //tmp->play_sound (tmp->sound ? tmp->sound : sound_find ("trigger_marker"));
move_marker (tmp);
break;
@@ -315,18 +326,21 @@
int
check_altar_sacrifice (const object *altar, const object *sacrifice)
{
- if (!QUERY_FLAG (sacrifice, FLAG_ALIVE) && !QUERY_FLAG (sacrifice, FLAG_IS_LINKED) && sacrifice->type != PLAYER)
+ if (!QUERY_FLAG (sacrifice, FLAG_ALIVE)
+ && !QUERY_FLAG (sacrifice, FLAG_IS_LINKED)
+ && sacrifice->type != PLAYER)
{
+ if (strcmp (ARCH_SACRIFICE (altar), "money") == 0
+ && sacrifice->type == MONEY
+ && sacrifice->nrof * sacrifice->value >= NROF_SACRIFICE (altar))
+ return 1;
+
if ((ARCH_SACRIFICE (altar) == sacrifice->arch->archname
|| ARCH_SACRIFICE (altar) == sacrifice->name
|| ARCH_SACRIFICE (altar) == sacrifice->slaying
- || (!strcmp (ARCH_SACRIFICE (altar), query_base_name (sacrifice, 0))))
+ || strstr (query_base_name (sacrifice, 0), ARCH_SACRIFICE (altar)))
&& NROF_SACRIFICE (altar) <= (sacrifice->nrof ? sacrifice->nrof : 1))
return 1;
-
- if (strcmp (ARCH_SACRIFICE (altar), "money") == 0
- && sacrifice->type == MONEY && sacrifice->nrof * sacrifice->value >= NROF_SACRIFICE (altar))
- return 1;
}
return 0;