 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
31 #define NUM_OF_SPECIAL_TYPES 4
33 #define SPECIAL_SUBMAP 1
34 #define SPECIAL_FOUNTAIN 2
35 #define SPECIAL_EXIT 3
45 #define NR_OF_HOLE_TYPES 3
63 for (i = xstart; i < xstart+xsize; i++)
64 for (j = ystart; j < ystart+ysize; j++) {
99 if (tmp->head != NULL) {
174 for (; tries >= 0; tries--) {
179 for (l = i; l < i+xsize; l++)
180 for (
m = j;
m < j+ysize;
m++) {
191 for (tries = 0; tries < 10; tries++) {
195 for (l = i; l < i+xsize; l++)
196 for (
m = j;
m < j+ysize;
m++)
219 int ix, iy, i = -1, tries = 0;
222 if (fountain_style == NULL || fountain == NULL) {
228 while (i < 0 && tries < 10) {
281 const char *style, *decor, *mon;
283 int g_xsize, g_ysize;
334 LOG(
llevError,
"place_special_exit: undefined hole type %d\n", hole_type);
349 memset(&hole, 0,
sizeof(hole));
350 hole.
Xsize = g_xsize;
351 hole.
Ysize = g_ysize;
403 switch (special_type) {
407 if (special_map == NULL) {
double shopgreed
How much our shopkeeper overcharges.
sstring name_pl
The plural name of the object.
uint8_t special_break_map
If set, then submaps in random maps can break the walls.
char layoutstyle[RM_SIZE]
Contains the layout type to generate, see layoutgen() for valid types.
struct Settings settings
Global settings.
#define INS_NO_WALK_ON
Don't call check_walk_on against the originator.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
@ llevError
Error, serious thing.
#define FLAG_CLIENT_ANIM_RANDOM
Client animate this, randomized.
int difficulty_given
If non zero, this means the difficulty was not zero initially.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define QUERY_FLAG(xyz, p)
uint64_t shopmin
Minimum price a shop will trade for.
float speed
Frequency of object 'moves' relative to server tick rate.
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(),...
int index
Being the size of the shopitems array.
void place_specials_in_map(mapstruct *map, char **layout, RMParms *RP)
Main function for specials.
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
mapstruct * find_style(const char *dirname, const char *stylename, int difficulty)
Loads and returns the map requested.
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
Copy an object with an inventory, duplicate the inv too.
#define OPT_WALLS_ONLY
Only walls.
int find_spot_for_submap(mapstruct *map, char **layout, int *ix, int *iy, int xsize, int ysize)
Finds a place to put a submap into.
#define FLAG_NO_PICK
Object can't be picked up.
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
struct shopitems * shopitems
List of item-types the map's shop will trade in.
static event_registration m
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,...
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
uint8_t anim_speed
Ticks between animation-frames.
char this_map[RM_SIZE]
Path of the map from which the random map(s) were created.
char decorstyle[RM_SIZE]
Name of the decor style file, in /styles/decorstyles, can be an empty string in which case a random o...
char * shoprace
The preffered race of the local shopkeeper.
object clone
An object from which to do object_copy()
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.
#define HEAD(op)
Returns the head part of an object.
const Face * face
Face with colors.
#define MIN_RANDOM_MAP_SIZE
Minimal size a random should have to actually be generated.
void object_update_speed(object *op)
Updates the speed of an object.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
#define INS_NO_MERGE
Don't try to merge with other items.
sstring materialname
Specific material name.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
void include_map_in_map(mapstruct *dest_map, const mapstruct *in_map, int x, int y)
Copy in_map into dest_map at point x,y.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
char wallstyle[RM_SIZE]
Name of the wall style file, in /styles/wallstyles, can be an empty string in which case a random one...
const Animations * animation
Animation of this item, NULL if not animated.
char doorstyle[RM_SIZE]
Name of the doors style file, in /styles/doorstyles, see put_doors().
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.
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
uint64_t shopmax
MMaximum price a shop will offer.
#define FREE_AND_CLEAR_STR(xyz)
Release the shared string, and set it to NULL.
void place_special_exit(mapstruct *map, int hole_type, const RMParms *RP)
Place an exit with a resource map.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
sstring slaying
Which race to do double damage to.
sstring name
The name of the object, obviously...
#define FREE_AND_CLEAR(xyz)
Free the pointer and then set it to NULL.
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.
char treasurestyle[RM_SIZE]
Name of the treasures style file, in /styles/treasurestyles, can be an empty string in which case a r...
Shop-related information for a map.
#define CLEAR_FLAG(xyz, p)
#define MAP_HEIGHT(m)
Map height.
char floorstyle[RM_SIZE]
Name of the floor style file, in /styles/floors, can be an empty string in which case a random one is...
#define FLAG_ANIMATE
The object looks at archetype for faces.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
char monsterstyle[RM_SIZE]
Name of the monster style directory, in /styles/monsters, can be an empty string in which case a rand...
sstring name
More definite name, like "generate_kobold".
#define FLAG_IS_LINKED
The object is linked with other objects.
void place_fountain_with_specials(mapstruct *map)
Places a special fountain on the map.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
void nuke_map_region(mapstruct *map, int xstart, int ystart, int xsize, int ysize)
Erases all objects (except floor) in the given rectangle.
char exitstyle[RM_SIZE]
Name of the exit style files, in /styles/exitstyles/{up,down}, can be an empty string in which case a...
uint16_t material
What materials this object consist of.
#define NUM_OF_SPECIAL_TYPES
StringBuffer * write_map_parameters_to_string(const RMParms *RP)
Creates a suitable message for exit from RP.
float difficulty_increase
#define FLAG_IDENTIFIED
Item is identifiable (e.g.