 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
56 if (mode < 1 || mode > 4) {
67 for (i = 1; i < RP->
Xsize; i++)
68 for (j = 1; j < RP->
Ysize; j++) {
69 if (
layout[i][j] == target) {
79 for (i = RP->
Xsize-2; i > 0; i--)
80 for (j = 1; j < RP->
Ysize-1; j++) {
81 if (
layout[i][j] == target) {
91 for (i = 1; i < RP->
Xsize-1; i++)
92 for (j = RP->
Ysize-2; j > 0; j--) {
93 if (
layout[i][j] == target) {
103 for (i = RP->
Xsize-2; i > 0; i--)
104 for (j = RP->
Ysize-2; j > 0; j--) {
105 if (
layout[i][j] == target) {
146 char styledirname[256];
149 object *the_exit_down;
153 int cx = -1, cy = -1;
154 int upx = -1, upy = -1;
155 int downx = -1, downy = -1;
156 int final_map_exit = 1;
163 if (orientation == 0) {
164 orientation =
RANDOM()%6+1;
167 switch (orientation) {
169 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/up");
170 style_map_up =
find_style(styledirname, exitstyle, -1);
171 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/down");
172 style_map_down =
find_style(styledirname, exitstyle, -1);
177 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/down");
178 style_map_up =
find_style(styledirname, exitstyle, -1);
179 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/up");
180 style_map_down =
find_style(styledirname, exitstyle, -1);
185 snprintf(styledirname,
sizeof(styledirname),
"/styles/exitstyles/generic");
186 style_map_up =
find_style(styledirname, exitstyle, -1);
187 style_map_down = style_map_up;
192 if (style_map_up == NULL) {
194 if (exit_arch == NULL) {
213 }
else if (style_map_down == NULL) {
226 the_exit_down = NULL;
242 if (upx == -1 && cx != -1) {
243 if (cx > RP->
Xsize/2) {
248 if (cy > RP->
Ysize/2) {
255 if (upx == 1 && upy == 1) {
257 }
else if (upx == 1 && upy > 1) {
259 }
else if (upx > 1 && upy == 1) {
261 }
else if (upx > 1 && upy > 1) {
272 for (j = 1; j < 9; j++) {
285 maze[upx][upy] =
'<';
302 if (upx > RP->
Xsize/2) {
307 if (upy > RP->
Ysize/2) {
314 if (downx == 1 && downy == 1) {
316 }
else if (downx == 1 && downy > 1) {
318 }
else if (downx > 1 && downy == 1) {
320 }
else if (downx > 1 && downy > 1) {
366 if (final_map_exit == 1) {
386 maze[the_exit_down->
x][the_exit_down->
y] =
'>';
405 for (i = 0; i < RP->
Xsize; i++)
406 for (j = 0; j < RP->
Ysize; j++)
407 if (maze[i][j] ==
'>' || maze[i][j] ==
'<') {
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
#define MOVE_BLOCK_DEFAULT
The normal assumption is that objects are walking/flying.
char origin_map[RM_SIZE]
Path to the map this random map is generated from, to make an exit back.
#define MOVE_ALL
Mask of all movement types.
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
struct archetype * arch
Pointer to archetype.
void set_map_timeout(mapstruct *oldmap)
Enable swapping for the given map.
int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
object_find_first_free_spot(archetype, mapstruct, x, y) works like object_find_free_spot(),...
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters as well as how often the character can attack this affects the prices when buying and selling items if this drops the player will start losing hit points wd Cleric or Dwarf sm Elf M
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
Loads and returns the map requested.
char path[HUGE_BUF]
Filename of the map.
int16_t y
Position in the map for this object.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void object_update(object *op, int action)
object_update() updates the array which represents the map.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
void place_exits(mapstruct *map, char **maze, char *exitstyle, int orientation, RMParms *RP)
Place exits in the map.
char final_map[RM_SIZE]
If not empty, the path of the final map this whole maze leads to.
sstring add_string(const char *str)
This will add 'str' to the hash table.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
sstring reset_group
For reset purpose, all maps in the same group reset at the same time.
void unblock_exits(mapstruct *map, char **maze, RMParms *RP)
This function unblocks the exits.
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...
void find_in_layout(int mode, char target, int *fx, int *fy, char **layout, RMParms *RP)
Find a character in the layout.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
char final_exit_archetype[RM_SIZE]
If not empty, the archetype name of the exit leading to the final map.
sstring slaying
Which race to do double damage to.
archetype * find_archetype(const char *name)
char exit_on_final_map[RM_SIZE]
If this is "no", then no exit will be made to the final map from the previous random map.
object * pick_random_object(mapstruct *style)
Picks a random object from a style map.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
#define MAP_ENTER_Y(m)
Default Y coordinate for map enter.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
#define MAP_ENTER_X(m)
Default X coordinate for map enter.
int wall_blocked(mapstruct *m, int x, int y)
Returns true if square x,y has P_NO_PASS set, which is true for walls and doors but not monsters.
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 UP_OBJ_CHANGE
Object changed.
living stats
Str, Con, Dex, etc.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
MoveType move_block
What movement types this blocks.
StringBuffer * write_map_parameters_to_string(const RMParms *RP)
Creates a suitable message for exit from RP.