Go to the documentation of this file.
33 #define CONV_FROM(xyz) xyz->slaying
34 #define CONV_TO(xyz) xyz->other_arch
35 #define CONV_NR(xyz) (unsigned char)xyz->stats.sp
36 #define CONV_LIMIT(xyz) ((xyz->stats.wc > 0) ? ((unsigned long)xyz->stats.wc) : INT32_MAX)
37 #define CONV_NEED(xyz) (unsigned long)xyz->stats.food
38 #define CONV_FROM_MATCH(xyz,_match) (CONV_FROM(xyz) == (_match) || ((strchr(CONV_FROM(xyz),'*')) && wildcard_match(CONV_FROM(xyz),(_match))))
52 if (
string[0]==
'*' &&
string[1]==0 )
return 1;
53 if (
string[0] ==
'*' ) head=
TRUE;
54 if (
string[strlen(
string)-1] ==
'*' ) tail=
TRUE;
55 str=strdup(&
string[head?1:0]);
57 if ( tail )
str[strlen(
str)-1]=0;
61 m=strstr(
str,candidate);
64 if ( strncmp(
str,candidate,strlen(
str)) == 0 ) ret=
TRUE;
66 if ( strlen(candidate) >= strlen(
str) &&
67 strcmp(&candidate[strlen(candidate)-strlen(
str)],
str) == 0 ) ret=
TRUE;
99 if (!strcmp(
CONV_FROM(converter),
"money")) {
137 price_in =
item->value;
143 if (converter->
inv != NULL) {
148 ob_to_copy = converter->
inv;
160 LOG(
llevError,
"move_creator: Converter doesn't have other arch set: %s (%s, %d, %d)\n", converter->
name ? converter->
name :
"(null)", converter->
map->
path, converter->
x, converter->
y);
174 LOG(
llevError,
"Broken converter %s at %s (%d, %d) in value %d, out value %d for %s\n", converter->
name, converter->
map->
path, converter->
x, converter->
y, price_in,
item->nrof*
item->value,
item->name);
198 "The %s seems to be broken!",
name);
void object_remove(object *op)
int allow_broken_converters
object * object_create_clone(object *asrc)
#define QUERY_FLAG(xyz, p)
#define FOR_BELOW_PREPARE(op_, it_)
#define FOR_BELOW_FINISH()
#define FLAG_IS_A_TEMPLATE
static event_registration m
void init_type_converter(void)
void object_unset_flag_inv(object *op, int flag)
void query_name(const object *op, char *buf, size_t size)
method_ret common_pre_ob_move_on(object *trap, object *victim, object *originator)
object * object_create_arch(archetype *at)
#define CONV_FROM_MATCH(xyz, _match)
void register_move_on(int ob_type, move_on_func method)
struct archt * other_arch
int rndm(int min, int max)
static int convert_item(object *item, object *converter)
static int wildcard_match(const char *string, const char *candidate)
static method_ret converter_type_move_on(object *trap, object *victim, object *originator)
void fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags)
object * create_archetype(const char *name)
void LOG(LogLevel logLevel, const char *format,...)
#define CLEAR_FLAG(xyz, p)
#define MSG_TYPE_APPLY_FAILURE
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void object_free_drop_inventory(object *ob)
object * object_decrease_nrof(object *op, uint32_t i)
bool shop_contains(object *ob)
void common_post_ob_move_on(object *trap, object *victim, object *originator)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)