Atrinik Server 2.5
Functions
server/button.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void animate_turning (object *op)
static void trigger_move (object *op, int state)
static objectlinkget_button_links (object *button)
void push_button (object *op)
void update_button (object *op)
void update_buttons (mapstruct *m)
void use_trigger (object *op)
int check_trigger (object *op, object *cause)
void add_button_link (object *button, mapstruct *map, int connected)
void remove_button_link (object *op)
int get_button_value (object *button)
void do_mood_floor (object *op)
objectcheck_inv_recursive (object *op, const object *trig)
void check_inv (object *op, object *trig)

Detailed Description

Buttons, gates, handles, etc related code.

Definition in file button.c.


Function Documentation

void add_button_link ( object button,
mapstruct map,
int  connected 
)

Links specified object in the map.

Parameters:
buttonObject to link. Must not be NULL.
mapMap we are on. Should not be NULL.
connectedConnection value for the item.

Definition at line 555 of file button.c.

static void animate_turning ( object op) [static]

Animates one step of object.

Parameters:
opObject to animate.

Definition at line 347 of file button.c.

void check_inv ( object op,
object trig 
)

Function to search the inventory of a player and then based on a set of conditions, the square will activate connected items.

Monsters can't trigger this square (for now) Values are: last_sp = 1/0 obj/no obj triggers last_heal = 1/0 remove/don't remove obj if triggered

Parameters:
opObject to check. Must be a player.
trigTrigger object that may be activated.

Definition at line 805 of file button.c.

object* check_inv_recursive ( object op,
const object trig 
)

Checks object and its inventory for specific item.

It will descend through containers to find the object.

  • slaying = match object slaying
  • race = match object archetype name
  • hp = match object type
    Parameters:
    opObject of which to search inventory
    trigWhat to search
    Returns:
    Object that matches, or NULL if none matched.

Definition at line 772 of file button.c.

void do_mood_floor ( object op)

This routine makes monsters who are standing on the 'mood floor' change their disposition if it is different.

If floor is set to be triggered must have a speed of zero (default is 1 for all but the charm floor type).

Author:
b.t. thomas@nomad.astro.psu.edu
Parameters:
opThe mood floor object.

Definition at line 692 of file button.c.

static objectlink * get_button_links ( object button) [static]

Return the first objectlink in the objects linked to this one.

Parameters:
buttonObject to check. Must not be NULL.
Returns:
objectlink for this object, or NULL.

Definition at line 631 of file button.c.

int get_button_value ( object button)

Returns the first value linked to this button. Made as a separate function to increase efficiency.

Parameters:
buttonObject to check. Must not be NULL.
Returns:
Connection value, or 0 if not connected.

Definition at line 659 of file button.c.

void push_button ( object op)

Push the specified object. This can affect other buttons/gates/handles altars/pedestals/holes on the whole map.

Parameters:
opThe object to push

Definition at line 40 of file button.c.

void remove_button_link ( object op)

Remove the object from the linked lists of buttons in the map.

Parameters:
opObject to remove. Must be on a map, and linked.

Definition at line 594 of file button.c.

void update_button ( object op)

Updates everything connected with the button object. After changing the state of a button, this function must be called to make sure that all gates and other buttons connected to the button react to the (eventual) change of state.

Parameters:
opThe button object

Definition at line 195 of file button.c.

void update_buttons ( mapstruct m)

Updates every button on the map by calling update_button() for them.

Parameters:
mThe map to update buttons for

Definition at line 290 of file button.c.

void use_trigger ( object op)

Toggles the state of specified button.

Parameters:
opObject to toggle.

Definition at line 337 of file button.c.