 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
37 fprintf(stderr,
"Reading parameters from stdin...\n");
40 memset(&rp, 0,
sizeof(
RMParms));
63 for (j = 0; j < height; ++j) {
64 for (i = 0; i < width; ++i) {
66 display_char =
layout[i][j];
68 switch (display_char) {
77 putchar(display_char);
86 char **(*func)(int, int, int, int);
113 static void test_layout(
int width,
int height,
char **(*layout_func)(
int,
int,
int,
int)) {
118 if (layout_func == NULL)
121 layout = layout_func(width, height, 0, 0);
129 fprintf(stderr,
"Type 'random_map -h' for usage instructions.\n");
135 "Usage: random_map [options]\n"
138 " -h display this help message\n"
139 " -g <file> randomly generate the specified map file\n"
140 " -l <layout> layout to use. See Layouts for valid layouts.\n"
141 " (overridden by -g)\n"
142 " -t test map layout (overriden by -g)\n"
143 " -x <width> specify map width\n"
144 " -y <height> specify map height\n"
147 " rogue -- roguelike map generator\n"
148 " snake -- snake map generator\n"
149 " sspiral -- square spiral map generator\n"
150 " spiral -- spiral map generator\n"
151 " maze -- maze map generator\n"
152 " onion -- onion map generator\n"
156 int main(
int argc,
char *argv[]) {
157 int flag, mode = 0, width = 80, height = 23;
158 char *filename_out=NULL;
164 while ((flag = getopt(argc, argv,
"g:hl:tx:y:")) != -1) {
168 filename_out = optarg;
185 width = atoi(optarg);
188 height = atoi(optarg);
200 }
else if (mode == 2) {
269 while ((tmp->stats.hp--) > 0) {
276 && tmp->randomitems) {
279 while ((tmp->stats.hp--) > 0) {
309 uint8_t subtype,
const char *
message) {
319 uint8_t subtype,
const char *format, ...) {
328 va_start(ap, format);
340 fprintf(
logfile,
"ext_info_map: %s\n", str1);
char ** map_gen_onion(int xsize, int ysize, int option, int layers)
Generates an onion layout.
void init_globals(void)
Initialises all global variables.
#define HAS_RANDOM_ITEMS(op)
This return TRUE if object has still randomitems which could be expanded.
#define SAVE_MODE_INPLACE
Map is saved from where it was loaded.
char **(* func)(int, int, int, int)
int apply_auto(object *op)
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
char ** roguelike_layout_gen(int xsize, int ysize, int options, int _unused_layers)
Actually make the rogue layout.
uint16_t difficulty
What level the player should be to play here.
#define QUERY_FLAG(xyz, p)
static void print_usage(void)
Print out usage information.
struct mapstruct * map
Pointer to the map in which this object is present.
object * generate_treasure(treasurelist *t, int difficulty)
Generate a treasure from a list generating a single item.
char ** make_square_spiral_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
Generates a square-spiral layout.
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
char ** maze_gen(int xsize, int ysize, int option, int _unused_layers)
This function generates a random blocked maze with the property that there is only one path from one ...
static const flag_definition flags[]
Flag mapping.
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
Main random map routine.
static void test_layout(int width, int height, char **(*layout_func)(int, int, int, int))
Test the map layout produced by the specified generator.
char ** map_gen_spiral(int xsize, int ysize, int option, int _unused_layers)
Generates a spiral layout.
void esrv_update_spells(player *pl)
void set_map_timeout(mapstruct *oldmap)
Plugin animator file specs[Config] name
void set_darkness_map(mapstruct *m)
void esrv_del_item(player *pl, object *ob)
void init_gods(void)
This takes a look at all of the archetypes to find the objects which correspond to the GODS (type GOD...
int16_t y
Position in the map for this object.
static event_registration m
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
int load_parameters(FILE *fp, int bufstate, RMParms *RP)
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
static layout layout_list[NROFLAYOUTS]
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void rod_adjust(object *rod)
void init_readable(void)
Initialize linked lists utilized by message functions in tailor_readable_ob()
void move_firewall(object *ob)
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
void apply_auto_fix(mapstruct *m)
#define FLAG_DAMNED
The object is very cursed.
void emergency_save(int x)
FILE * logfile
Used by server/daemon.c.
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 esrv_update_item(int flags, object *pl, object *op)
#define MAP_WIDTH(m)
Map width.
void esrv_send_item(object *ob, object *obx)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
void dragon_ability_gain(object *ob, int x, int y)
static void print_map(char **layout, int width, int height)
Print the human-readable layout of a map.
void init_library(void)
It is vital that init_library() is called by any functions using this library.
object * find_skill_by_number(object *who, int skillno)
int main(int argc, char *argv[])
#define FLAG_AUTO_APPLY
Will be applied when created.
#define CLEAR_FLAG(xyz, p)
#define MAP_HEIGHT(m)
Map height.
char ** make_snake_layout(int xsize, int ysize, int _unused_options, int _unused_layers)
Generate a snake-like layout.
struct treasurelist * randomitems
Items to be generated.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
#define FLAG_UNPAID
Object hasn't been paid for yet.
void clean_tmp_files(void)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
int save_map(mapstruct *m, int flag)
Saves a map to file.
living stats
Str, Con, Dex, etc.
#define FLAG_CURSED
The object is cursed.
static void generate_map(char *OutFileName)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
This calls the appropriate treasure creation function.
static void print_quickhelp(void)
Print a message stating how to get help.
object * identify(object *op)
Identifies an item.