Atrinik Server 2.5
Functions
skills/construction.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static int can_build_over (mapstruct *m, object *new_item, int x, int y)
static objectget_wall (mapstruct *m, int x, int y)
static int builder_floor (object *op, object *new_floor, int x, int y)
static int builder_item (object *op, object *new_item, int x, int y)
static int wall_split_orientation (const object *wall_ob, char *wall_name, size_t wall_name_size, char *orientation, size_t orientation_size)
static void fix_walls (mapstruct *map, int x, int y)
static int builder_wall (object *op, object *new_wall, int x, int y)
static int builder_window (object *op, int x, int y)
static void construction_builder (object *op, int x, int y)
static void construction_destroyer (object *op, int x, int y)
void construction_do (object *op, int dir)

Detailed Description

Handles code for the construction skill.

Definition in file construction.c.


Function Documentation

static int builder_floor ( object op,
object new_floor,
int  x,
int  y 
) [static]

Floor building function.

Parameters:
opPlayer building.
new_floorNew floor object
xX where to build.
yY where to build.
Returns:
1 if the floor was built, 0 otherwise.

Definition at line 105 of file construction.c.

static int builder_item ( object op,
object new_item,
int  x,
int  y 
) [static]

Build an item like sign, wall mask (fireplace), etc.

Parameters:
opPlayer building.
new_itemWhat to build.
xX where to build.
yY where to build.
Returns:
1 if the item was built, 0 otherwise.

Definition at line 146 of file construction.c.

static int builder_wall ( object op,
object new_wall,
int  x,
int  y 
) [static]

Build a wall.

Parameters:
opPlayer building.
new_wallNew wall object.
xX where to build.
yY where to build.
Returns:
1 if the wall was built, 0 otherwise.

Definition at line 391 of file construction.c.

static int builder_window ( object op,
int  x,
int  y 
) [static]

Window building function.

Parameters:
opPlayer building.
xX where to build.
yY where to build.
Returns:
1 if the window was built, 0 otherwise.

Definition at line 458 of file construction.c.

static int can_build_over ( mapstruct m,
object new_item,
int  x,
int  y 
) [static]

Check if objects on a square interfere with building.

Parameters:
mMap we're building on.
new_itemItem the player is trying to build.
xX coordinate where to build.
yY coordinate where to build.
Returns:
1 if 'new_item' can be built on the spot, 0 otherwise.

Definition at line 39 of file construction.c.

static void construction_builder ( object op,
int  x,
int  y 
) [static]

Generic function for handling the construction builder skill item.

Parameters:
opPlayer building.
xX where to build.
yY where to build.

Definition at line 528 of file construction.c.

static void construction_destroyer ( object op,
int  x,
int  y 
) [static]

Item remover.

Removes first buildable item except floor.

Parameters:
opPlayer removing an item.
xX Where to remove.
yY where to remove.

Definition at line 606 of file construction.c.

void construction_do ( object op,
int  dir 
)

Main point of construction skill. From here, we decide what to do with skill item we have equipped.

Parameters:
opPlayer.

Definition at line 662 of file construction.c.

static void fix_walls ( mapstruct map,
int  x,
int  y 
) [static]

Fixes walls around specified spot

Basically it ensures the correct wall is put where needed.

Note:
x and y must be valid map coordinates.
Parameters:
mapMap where to fix.
xX where to fix.
yY where to fix.

Definition at line 277 of file construction.c.

static object* get_wall ( mapstruct m,
int  x,
int  y 
) [static]

Find wall on the specified square.

Parameters:
mMap where to look.
xX where to look.
yY where to look.
Returns:
The wall if found, NULL otherwise.

Definition at line 83 of file construction.c.

static int wall_split_orientation ( const object wall_ob,
char *  wall_name,
size_t  wall_name_size,
char *  orientation,
size_t  orientation_size 
) [static]

Split wall's name from the orientation.

Parameters:
wallWall to get the name with orientation from.
wall_nameWhere the wall's name will go.
wall_name_sizeSize of 'wall_name'.
orientationWhere the wall's orientation will go.
orientation_sizeSize of 'orientation'.
Returns:
1 on success, 0 on failure.

Definition at line 248 of file construction.c.