Crossfire Server, Branches 1.12
R18729
|
#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sounds.h>
#include <sproto.h>
Go to the source code of this file.
Macros | |
#define | CONV_FROM(xyz) xyz->slaying |
#define | CONV_NEED(xyz) (unsigned long)xyz->stats.food |
#define | CONV_NR(xyz) (unsigned char)xyz->stats.sp |
#define | CONV_TO(xyz) xyz->other_arch |
Functions | |
static int | convert_item (object *item, object *converter) |
static method_ret | converter_type_move_on (ob_methods *context, object *trap, object *victim, object *originator) |
void | init_type_converter (void) |
The implementation of the Converter class of objects.
Definition in file converter.c.
#define CONV_FROM | ( | xyz | ) | xyz->slaying |
Definition at line 37 of file converter.c.
Referenced by convert_item().
#define CONV_NEED | ( | xyz | ) | (unsigned long)xyz->stats.food |
Definition at line 40 of file converter.c.
Referenced by convert_item().
#define CONV_NR | ( | xyz | ) | (unsigned char)xyz->stats.sp |
Definition at line 39 of file converter.c.
Referenced by convert_item().
#define CONV_TO | ( | xyz | ) | xyz->other_arch |
Definition at line 38 of file converter.c.
Transforms an item into another item.
item | The object that triggered the converter - if it isn't of a type accepted by the converter, nothing will happen |
converter | The object that is doing the conversion |
-1 | If something went wrong when attempting the conversion |
0 | If the item was not converted |
1 | If the item got converted |
Definition at line 62 of file converter.c.
References Settings::allow_broken_converters, obj::arch, obj::below, CLEAR_FLAG, CONV_FROM, CONV_NEED, CONV_NR, create_archetype(), decrease_ob_nr(), FALSE, fix_generated_item(), FLAG_IS_A_TEMPLATE, FLAG_UNPAID, free_object(), GT_MINIMAL, insert_ob_in_map_at(), obj::inv, is_in_shop(), llevError, LOG(), obj::map, MONEY, obj::name, archt::name, obj::nrof, object_create_arch(), object_create_clone(), obj::other_arch, mapdef::path, PLAYER, QUERY_FLAG, remove_ob(), rndm(), SET_FLAG, settings, obj::type, unflag_inv(), obj::value, obj::x, and obj::y.
Referenced by converter_type_move_on().
|
static |
Move on this Converter object.
context | The method context |
trap | The Converter we're moving on |
victim | The object moving over this one |
originator | The object that caused the move_on event |
Definition at line 160 of file converter.c.
References common_post_ob_move_on(), common_pre_ob_move_on(), convert_item(), create_archetype(), draw_ext_info_format(), insert_ob_in_map(), obj::map, MAX_BUF, METHOD_ERROR, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, NDI_UNIQUE, query_name(), obj::x, and obj::y.
Referenced by init_type_converter().
void init_type_converter | ( | void | ) |
Initializer for the CONVERTER object type.
Definition at line 49 of file converter.c.
References CONVERTER, converter_type_move_on(), and register_move_on().
Referenced by register_all_ob_types().