 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
42 int surround_index = 0;
44 if ((i > 0) &&
layout[i-1][j] != 0) {
47 if ((i < RP->Xsize-1) &&
layout[i+1][j] != 0) {
50 if ((j > 0) &&
layout[i][j-1] != 0) {
53 if ((j < RP->Ysize-1) &&
layout[i][j+1] != 0) {
56 return surround_index;
79 int surround_index = 0;
81 if ((i > 0) &&
layout[i-1][j] ==
'#') {
84 if ((i < RP->Xsize-1) &&
layout[i+1][j] ==
'#') {
87 if ((j > 0) &&
layout[i][j-1] ==
'#') {
90 if ((j < RP->Ysize-1) &&
layout[i][j+1] ==
'#') {
93 return surround_index;
116 int surround_index = 0;
131 return surround_index;
154 int surround_index = 0;
169 return surround_index;
190 if (!strcmp(w_style,
"none")) {
193 const char *styledirname =
"/styles/wallstyles";
194 style_map =
find_style(styledirname, w_style, -1);
195 if (style_map == NULL) {
207 if ((cp = strchr(RP->
wall_name,
'_')) != NULL) {
212 for (i = 0; i < RP->
Xsize; i++)
213 for (j = 0; j < RP->
Ysize; j++) {
214 if (
layout[i][j] ==
'#') {
233 "_0",
"_1_3",
"_1_4",
"_2_1_2",
234 "_1_2",
"_2_2_4",
"_2_2_1",
"_3_1",
235 "_1_1",
"_2_2_3",
"_2_2_2",
"_3_3",
236 "_2_1_1",
"_3_4",
"_3_2",
"_4"
261 int surround_index = 0;
266 strncpy(wall_name, the_wall->
arch->
name,
sizeof(wall_name));
275 for (l = 0; l < 64; l++) {
276 if (wall_name[l] ==
'_') {
283 assert(surround_index >= 0 && surround_index < 16);
284 strcat(wall_name,
wall_join[surround_index]);
321 int surround_index = 0;
323 object *the_wall = NULL;
324 object *new_wall = NULL;
343 if (insert_flag == 0) {
346 }
else if (the_wall == NULL) {
351 for (l = 0; l < 64; l++) {
359 assert(surround_index >= 0 && surround_index < 16);
362 if (wall_arch != NULL) {
364 if (the_wall && the_wall->
map) {
#define INS_NO_WALK_ON
Don't call check_walk_on against the originator.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
#define MOVE_BLOCK_DEFAULT
The normal assumption is that objects are walking/flying.
#define MOVE_ALL
Mask of all movement types.
object * retrofit_joined_wall(mapstruct *the_map, int i, int j, int insert_flag, RMParms *RP)
this takes a map, and changes an existing wall to match what's blocked around it, counting only doors...
struct archetype * arch
Pointer to archetype.
struct mapstruct * map
Pointer to the map in which this object is present.
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
Loads and returns the map requested.
object * pick_joined_wall(object *the_wall, char **layout, int i, int j, RMParms *RP)
Picks the right wall type for this square, to make it look nice, and have everything nicely joined.
static const char * wall_join[16]
Suffix to add to a base wall archetype name to get the joined wall based on the value returned by sur...
char wall_name[RM_SIZE]
Will contain the actual wall archetype, can be an empty string in which case a random one is chosen,...
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void make_map_walls(mapstruct *map, char **layout, char *w_style, RMParms *RP)
takes a map and a layout, and puts walls in the map (picked from w_style) at '#' marks.
#define MOVE_WALK
Object walks.
uint8_t type
PLAYER, BULLET, etc.
#define INS_NO_MERGE
Don't try to merge with other items.
#define GET_MAP_MOVE_BLOCK(M, X, Y)
Gets the blocking state of a square.
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...
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
int surround_flag3(mapstruct *map, int i, int j, RMParms *RP)
Check a map for blocked spots.
int surround_flag4(mapstruct *map, int i, int j, RMParms *RP)
Check a map for spots with walls.
object * pick_random_object(mapstruct *style)
Picks a random object from a style map.
int surround_flag2(char **layout, int i, int j, RMParms *RP)
Given a layout and a coordinate, tell me which squares up/down/right/left are occupied by walls.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
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)
int surround_flag(char **layout, int i, int j, RMParms *RP)
Given a layout and a coordinate, tell me which squares up/down/right/left are occupied.
sstring name
More definite name, like "generate_kobold".
MoveType move_allow
What movement types explicitly allowed.
MoveType move_block
What movement types this blocks.