 |
Crossfire Server, Trunk
1.75.0
|
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.");
200 if (custom_name != NULL) {
201 snprintf(
buf,
sizeof(
buf),
"talking %s", custom_name);
203 snprintf(
buf,
sizeof(
buf),
"talking %s", book->
name);
210 snprintf(buf2,
sizeof(buf2),
"talking %s", book->
name_pl);
239 while (itest++ < 1000) {
240 connected = 1+rand()%20000;
279 if (!rune || !rune->
msg) {
281 "You need to put a marking rune with the group name.");
288 if (tmp->type ==
FORCE
289 && tmp->slaying != NULL && strcmp(tmp->slaying, pl->
map->
path) == 0
290 && tmp->msg != NULL && tmp->msg == rune->
msg) {
300 if (connected == -1) {
302 "Could not create more groups.");
341 uint32_t old_flags[4];
361 if (!strcmp(underscore+1,
"win1"))
363 else if (!strcmp(underscore+1,
"win2"))
365 else if (!isdigit(*(underscore+1)))
374 if ((x > 0) &&
get_wall(map, x-1, y))
378 if ((y > 0) &&
get_wall(map, x, y-1))
474 for (flag = 0; flag < 4; flag++)
475 old_flags[flag] = wall->
flags[flag];
482 for (flag = 0; flag < 4; flag++)
483 wall->
flags[flag] = old_flags[flag];
511 int i, xt, yt, wall_removed;
514 snprintf(
message,
sizeof(
message),
"You change the floor to better suit your tastes.");
525 if (
WALL == tmp->type) {
527 new_wall = tmp->arch;
530 snprintf(
message,
sizeof(
message),
"You destroy the wall and redo the floor.");
545 if (wall_removed == 0 &&
floor != NULL) {
569 for (i = 1; i <= 8; i++) {
599 for (xt = x-2; xt <= x+2; xt++)
600 for (yt = y-2; yt <= y+2; yt++) {
628 object *current_wall;
636 char current_basename[
MAX_BUF];
641 strncpy(current_basename, current_wall->
arch->
name,
sizeof(current_basename));
642 current_basename[
sizeof(current_basename)-1] =
'\0';
643 underscore = strchr(current_basename,
'_');
644 if (underscore && isdigit(*(underscore+1))) {
648 strncpy(new_basename, new_wall->
arch->
name,
sizeof(new_basename));
649 new_basename[
sizeof(new_basename)-1] =
'\0';
650 underscore = strchr(new_basename,
'_');
651 if (underscore && isdigit(*(underscore+1))) {
655 if (!strncmp(current_basename, new_basename,
sizeof(new_basename))) {
671 snprintf(
message,
sizeof(
message),
"You redecorate the wall to better suit your tastes.");
677 for (xt = x-1; xt <= x+1; xt++)
678 for (yt = y-1; yt <= y+1; yt++) {
708 object *current_wall;
712 uint32_t old_flags[4];
729 if (!strcmp(underscore,
"win1")
730 || !strcmp(underscore,
"win2")) {
734 if (!strcmp(underscore,
"2_1_1"))
735 strcpy(underscore,
"win1");
736 else if (!strcmp(underscore,
"2_1_2"))
737 strcpy(underscore,
"win2");
746 "There is no wall there.");
760 for (flag = 0; flag < 4; flag++)
761 old_flags[flag] = current_wall->
flags[flag];
768 for (flag = 0; flag < 4; flag++)
769 window->
flags[flag] = old_flags[flag];
818 "This square has no floor, you can't build here.");
833 switch (new_item->
type) {
848 if (connected == -1) {
863 if (con_rune != NULL) {
904 LOG(
llevError,
"apply_builder_remove: (null) square at (%d, %d, %s)\n", x, y, pl->
map->
path);
913 "Nothing to remove.");
918 switch (item->
type) {
921 "Can't remove a wall with that, build a floor.");
970 "You can't build or destroy under yourself.");
977 if ((1 > x) || (1 > y)
980 "Can't build on map edge.");
994 LOG(
llevError,
"apply_map_builder: undefined square at (%d, %d, %s)\n", x, y, pl->
map->
path);
996 "You'd better not build here, it looks weird.");
1007 "You can't build here.");
1032 "You need to mark raw materials to use.");
1038 "You can't use the marked item to build.");
1052 "You can't use this strange material.");
1061 "You can't build here.");
1085 "Don't know how to apply this material, sorry.");
1096 "Don't know how to apply this tool, sorry.");
sstring name_pl
The plural name of the object.
#define GET_MAP_OB(M, X, Y)
Gets the bottom object on a map.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
static int apply_builder_window(object *pl, object *new_wall_win, short x, short y)
Window building function.
@ llevError
Error, serious thing.
uint32_t path_attuned
Paths the object is attuned to.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define QUERY_FLAG(xyz, p)
oblinkpt * next
Next value in the list.
oblinkpt * buttons
Linked list of linked lists of buttons.
#define ST_MAT_ITEM
Most other items, including doors & such.
struct archetype * arch
Pointer to archetype.
#define FLAG_IS_BUILDABLE
Can build on item.
float speed
Frequency of object 'moves' relative to server tick rate.
#define FLAG_UNIQUE
Item is really unique (UNIQUE_ITEMS)
int16_t invisible
How much longer the object will be invis.
static void fix_walls(mapstruct *map, int x, int y)
Fixes walls around specified spot.
struct mapstruct * map
Pointer to the map in which this object is present.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
static int apply_builder_floor(object *pl, object *new_floor, short x, short y)
Floor building function.
void apply_builder_remove(object *pl, int dir)
Item remover.
static void remove_marking_runes(mapstruct *map, short x, short y)
Erases all marking runes at specified location (before building a wall)
#define MSG_TYPE_APPLY_BUILD
Build related actions.
Used to link together several object links.
@ FLOOR
Floor tile -> native layer 0.
#define FOR_OB_AND_ABOVE_FINISH()
Finishes FOR_OB_AND_ABOVE_PREPARE().
char path[HUGE_BUF]
Filename of the map.
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
#define ST_BD_REMOVE
Removes an item.
static int find_or_create_connection_for_map(object *pl, short x, short y, object *rune)
Helper function for door/button/connected item building.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
object * above
Pointer to the object stacked above this one.
static object * get_connection_rune(object *pl, short x, short y)
Returns the marking rune on the square, for purposes of building connections.
#define FLAG_NO_PICK
Object can't be picked up.
Plugin animator file specs[Config] name
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
@ range_builder
Map builder.
#define INS_ABOVE_FLOOR_ONLY
Put object immediatly above the floor.
void apply_map_builder(object *pl, int dir)
Global building function.
#define FOR_OB_AND_ABOVE_PREPARE(op_)
Constructs a loop iterating over an object and all objects above it in the same pile.
int16_t y
Position in the map for this object.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
struct player * contr
Pointer to the player which control this object.
#define object_decrease_nrof_by_one(xyz)
uint8_t subtype
Subtype of object.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define ST_MAT_FLOOR
Floor.
static int can_build_over(mapstruct *map, object *new_item, short x, short y)
Check if objects on a square interfere with building.
object * ranges[range_size]
Object for each range.
#define ST_BD_BUILD
Builds an item.
object clone
An object from which to do object_copy()
sstring add_string(const char *str)
This will add 'str' to the hash table.
#define HEAD(op)
Returns the head part of an object.
long value
Used as connected value in buttons/gates.
const Face * face
Face with colors.
void object_update_speed(object *op)
Updates the speed of an object.
uint8_t type
PLAYER, BULLET, etc.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
static int apply_builder_wall(object *pl, object *new_wall, short x, short y)
Wall building function.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
#define INS_BELOW_ORIGINATOR
Insert new object immediately below originator.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
#define MAP_WIDTH(m)
Map width.
#define MAX_BUF
Used for all kinds of things.
#define INS_ON_TOP
Always put object on top.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
static bool IS_PLAYER(object *op)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define OUT_OF_REAL_MAP(M, X, Y)
Checks if a square is out of the map.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
sstring name
The name of the object, obviously...
const typedef char * sstring
Magical Runes Runes are magical inscriptions on the dungeon floor
archetype * find_archetype(const char *name)
@ MATERIAL
Material for building.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
sstring msg
If this is a book/sign/magic mouth/etc.
#define MAP_HEIGHT(m)
Map height.
static int apply_builder_item(object *pl, object *new_item, short x, short y)
Generic item builder.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
ob_flags flags
Various flags.
static object * get_msg_book(object *pl, short x, short y)
Returns the book/scroll on the current square, for purposes of building.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
archetype * try_find_archetype(const char *name)
#define FLAG_UNPAID
Object hasn't been paid for yet.
sstring name
More definite name, like "generate_kobold".
#define FLAG_IS_LINKED
The object is linked with other objects.
object * more
Pointer to the rest of a large body of objects.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define MSG_TYPE_APPLY
Applying objects.
static object * get_wall(mapstruct *map, int x, int y)
Returns first item of type WALL.
static int adjust_sign_msg(object *pl, short x, short y, object *tmp)
Make the built object inherit the msg of books that are used with it.
#define CUSTOM_NAME_FIELD
Key in an object for the player-assigned custom name.
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
static int find_unused_connected_value(mapstruct *map)
Returns an unused value for 'connected'.
@ DETECTOR
peterm: detector is an object which notices the presense of another object and is triggered like butt...
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the archetype
#define ST_MAT_WINDOW
Window.