Atrinik Server 2.5
Defines | Functions
types/altar.c File Reference
#include <global.h>

Go to the source code of this file.

Defines

#define ARCH_SACRIFICE(xyz)   ((xyz)->slaying)
#define NROF_SACRIFICE(xyz)   ((xyz)->stats.food)

Functions

int apply_altar (object *altar, object *sacrifice, object *originator)
int check_altar_sacrifice (object *altar, object *sacrifice)
int operate_altar (object *altar, object **sacrifice)

Detailed Description

Handles code related to altars.

Definition in file altar.c.


Function Documentation

int apply_altar ( object altar,
object sacrifice,
object originator 
)

Operate an altar.

Parameters:
altarThe altar object.
sacrificeSacrifice object for the altar.
originatorOriginator object who put the sacrifice on the altar.
Returns:
1 if the sacrifice was accepted, 0 otherwise.

Definition at line 42 of file altar.c.

int check_altar_sacrifice ( object altar,
object sacrifice 
)

Check if the sacrifice meets the needs of the altar.

Identify altars won't grab money unnecessarily - we can see if there is sufficient money, see if something needs to be identified, and then remove money if needed.

Linked objects (ie, objects that are connected) can not be sacrificed. This fixes a bug of trying to put multiple altars/related objects on the same space that take the same sacrifice.

Parameters:
altarThe altar object
sacrificeThe sacrifice
Returns:
1 if it meets the needs, 0 otherwise

Definition at line 89 of file altar.c.

int operate_altar ( object altar,
object **  sacrifice 
)

Checks if sacrifice was accepted and removes sacrificed objects. Might be better to call check_altar_sacrifice (above) than depend on the return value, since operate_altar will remove the sacrifice also.

If this function returns 1, '*sacrifice' is modified to point to the remaining sacrifice, or is set to NULL if the sacrifice was used up.

Parameters:
altarThe altar object
sacrificeThe object to be sacrificed
Returns:
1 if sacrifice was succeed, 0 otherwise

Definition at line 118 of file altar.c.