Go to the documentation of this file.
53 if (strcmp(
ob->arch->name,
"rune_mark") == 0)
63 switch (new_item->
type) {
105 if (rune->type ==
SIGN && strcmp(rune->arch->name,
"rune_mark") == 0)
124 if (book->type ==
BOOK)
144 if (wall->type ==
WALL)
160 if ((rune->type ==
SIGN) && (!strcmp(rune->arch->name,
"rune_mark"))) {
192 "You need to put a book or scroll with the message.");
198 if (
tmp->invisible) {
202 snprintf(
buf,
sizeof(
buf),
"talking %s", book->
name);
209 snprintf(buf2,
sizeof(buf2),
"talking %s", book->
name_pl);
238 while (itest++ < 1000) {
278 if (!rune || !rune->
msg) {
280 "You need to put a marking rune with the group name.");
288 &&
tmp->slaying != NULL && strcmp(
tmp->slaying,
pl->map->path) == 0
289 &&
tmp->msg != NULL &&
tmp->msg == rune->
msg) {
301 "Could not create more groups.");
317 return force->path_attuned;
340 uint32_t old_flags[4];
341 struct archt *new_arch;
360 if (!strcmp(underscore+1,
"win1"))
362 else if (!strcmp(underscore+1,
"win2"))
364 else if (!isdigit(*(underscore+1)))
473 for (flag = 0; flag < 4; flag++)
474 old_flags[flag] = wall->
flags[flag];
481 for (flag = 0; flag < 4; flag++)
482 wall->
flags[flag] = old_flags[flag];
509 struct archt *new_wall;
510 int i, xt, yt, wall_removed;
513 snprintf(
message,
sizeof(
message),
"You change the floor to better suit your tastes.");
526 new_wall =
tmp->arch;
529 snprintf(
message,
sizeof(
message),
"You destroy the wall and redo the floor.");
544 if (wall_removed == 0 && floor != NULL) {
545 if (floor->
arch == new_floor->
arch) {
568 for (i = 1; i <= 8; i++) {
598 for (xt =
x-2; xt <=
x+2; xt++)
599 for (yt =
y-2; yt <=
y+2; yt++) {
627 object *current_wall;
635 char current_basename[
MAX_BUF];
640 strncpy(current_basename, current_wall->
arch->
name,
sizeof(current_basename));
641 current_basename[
sizeof(current_basename)-1] =
'\0';
642 underscore = strchr(current_basename,
'_');
643 if (underscore && isdigit(*(underscore+1))) {
647 strncpy(new_basename, new_wall->
arch->
name,
sizeof(new_basename));
648 new_basename[
sizeof(new_basename)-1] =
'\0';
649 underscore = strchr(new_basename,
'_');
650 if (underscore && isdigit(*(underscore+1))) {
654 if (!strncmp(current_basename, new_basename,
sizeof(new_basename))) {
670 snprintf(
message,
sizeof(
message),
"You redecorate the wall to better suit your tastes.");
676 for (xt =
x-1; xt <=
x+1; xt++)
677 for (yt =
y-1; yt <=
y+1; yt++) {
707 object *current_wall;
709 struct archt *new_arch;
711 uint32_t old_flags[4];
728 if (!strcmp(underscore,
"win1")
729 || !strcmp(underscore,
"win2")) {
733 if (!strcmp(underscore,
"2_1_1"))
734 strcpy(underscore,
"win1");
735 else if (!strcmp(underscore,
"2_1_2"))
736 strcpy(underscore,
"win2");
745 "There is no wall there.");
759 for (flag = 0; flag < 4; flag++)
760 old_flags[flag] = current_wall->
flags[flag];
767 for (flag = 0; flag < 4; flag++)
768 window->
flags[flag] = old_flags[flag];
817 "This square has no floor, you can't build here.");
832 switch (new_item->
type) {
862 if (con_rune != NULL) {
903 LOG(
llevError,
"apply_builder_remove: (null) square at (%d, %d, %s)\n",
x,
y,
pl->map->path);
912 "Nothing to remove.");
917 switch (
item->type) {
920 "Can't remove a wall with that, build a floor.");
969 "You can't build or destroy under yourself.");
976 if ((1 >
x) || (1 >
y)
979 "Can't build on map edge.");
993 LOG(
llevError,
"apply_map_builder: undefined square at (%d, %d, %s)\n",
x,
y,
pl->map->path);
995 "You'd better not build here, it looks weird.");
1004 && ((
tmp->type !=
SIGN) || (strcmp(
tmp->arch->name,
"rune_mark")))) {
1006 "You can't build here.");
1022 struct archt *new_arch;
1031 "You need to mark raw materials to use.");
1037 "You can't use the marked item to build.");
1051 "You can't use this strange material.");
1060 "You can't build here.");
1084 "Don't know how to apply this material, sorry.");
1095 "Don't know how to apply this tool, sorry.");
#define GET_MAP_OB(M, X, Y)
void apply_map_builder(object *pl, int dir)
sstring add_string(const char *str)
void object_remove(object *op)
#define QUERY_FLAG(xyz, p)
static int adjust_sign_msg(object *pl, short x, short y, object *tmp)
static void fix_walls(struct mapdef *map, int x, int y)
static int find_unused_connected_value(struct mapdef *map)
static int can_build_over(struct mapdef *map, object *new_item, short x, short y)
#define MSG_TYPE_APPLY_BUILD
static int apply_builder_floor(object *pl, object *new_floor, short x, short y)
#define FOR_OB_AND_ABOVE_FINISH()
void apply_builder_remove(object *pl, int dir)
short freearr_x[SIZEOFFREE]
short freearr_y[SIZEOFFREE]
#define INS_ABOVE_FLOOR_ONLY
#define FOR_OB_AND_ABOVE_PREPARE(op_)
void free_string(sstring str)
#define object_decrease_nrof_by_one(xyz)
void query_name(const object *op, char *buf, size_t size)
static object * get_msg_book(object *pl, short x, short y)
object * object_create_arch(archetype *at)
#define INS_BELOW_ORIGINATOR
static object * get_wall(struct mapdef *map, int x, int y)
object * create_archetype(const char *name)
static bool IS_PLAYER(object *op)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define OUT_OF_REAL_MAP(M, X, Y)
static int find_or_create_connection_for_map(object *pl, short x, short y, object *rune)
void object_set_msg(object *op, const char *msg)
#define FLAG_IS_BUILDABLE
void LOG(LogLevel logLevel, const char *format,...)
static int apply_builder_item(object *pl, object *new_item, short x, short y)
archetype * find_archetype(const char *name)
object * object_insert_in_ob(object *op, object *where)
void object_update_speed(object *op)
object * arch_to_object(archetype *at)
object * ranges[range_size]
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
void object_free_drop_inventory(object *ob)
archetype * try_find_archetype(const char *name)
static object * get_connection_rune(object *pl, short x, short y)
object * find_marked_object(object *op)
#define FOR_INV_PREPARE(op_, it_)
static void remove_marking_runes(struct mapdef *map, short x, short y)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
static int apply_builder_window(object *pl, object *new_wall_win, short x, short y)
static int apply_builder_wall(object *pl, object *new_wall, short x, short y)