Go to the documentation of this file.
19 #define _GNU_SOURCE // strcasestr() is a GNU extension in string.h
27 #include <sys/types.h>
72 snprintf(
buf, size,
"%s:%s:%" FMT64 ":%s:%s:%d:%d:%d",
sc->name,
sc->
title,
sc->exp,
sc->
killer,
sc->
maplevel,
sc->maxhp,
sc->maxsp,
sc->maxgrace);
96 fprintf(fp,
"%s\n",
buf);
117 cp = strchr(bp,
'\n');
138 sscanf(
tmp[5],
"%d", &
sc->maxhp);
140 sscanf(
tmp[6],
"%d", &
sc->maxsp);
142 sscanf(
tmp[7],
"%d", &
sc->maxgrace);
165 }
else if (strcmp(
sc->
killer,
"a dungeon collapse") == 0) {
169 s1 =
"was killed by";
172 snprintf(
buf, size,
"[fixed]%3d %10" FMT64 "[print] %s%s%s %s %s on map %s <%d><%d><%d>.",
173 sc->position,
sc->exp,
sc->name,
sc->
title[0]==
',' ?
"" :
" ",
sc->
title, s1, s2,
sc->
maplevel,
sc->maxhp,
sc->maxsp,
sc->maxgrace);
192 memset(old_score, 0,
sizeof(*old_score));
198 table->
entry[i] = *new_score;
203 *old_score = table->
entry[i];
205 table->
entry[i] = *new_score;
222 table->
entry[i] = *new_score;
227 while (i > 0 && new_score->
exp >= table->
entry[i-1].
exp) {
256 fp = fopen(table->
fname,
"r");
258 if (errno == ENOENT) {
261 LOG(
llevError,
"Cannot open highscore file %s: %s\n", table->
fname, strerror(errno));
282 memset(&table->
entry[i], 0,
sizeof(table->
entry[i]));
354 if (
op->stats.exp == 0 || !
op->contr->name_changed)
360 "Since you have been in wizard mode, "
361 "you can't enter the high-score list.");
364 if (!
op->stats.exp) {
367 "You don't deserve to save your character yet.");
376 if (new_score.
killer[0] ==
'\0') {
377 strcpy(new_score.
killer,
"a dungeon collapse");
380 if (
op->map == NULL) {
387 new_score.
maxsp = (
int)
op->stats.maxsp;
391 if (!
tmp->stats.exp)
continue;
392 new_score.
exp =
tmp->stats.exp;
395 if (!quiet && new_score.
exp > old_score.
exp) {
397 "You improved your rating in %s: %" FMT64,
tmp->name, new_score.
exp);
406 new_score.
exp =
op->stats.exp;
419 message =
"You didn't enter the highscore list:";
421 message =
"You entered the highscore list:";
424 message =
"You left the highscore list:";
425 else if (new_score.
exp > old_score.
exp)
426 message =
"You beat your last score:";
428 message =
"You didn't beat your last score:";
455 int skill_min,skill_max;
459 if (strncmp(
match,
"-s", 2) == 0 ) {
463 if (strchr(
match,
' ')) {
476 "Could not match '%.*s' to a skill", len,
match);
483 if ( max < 100 && max > 10 )
max = 10;
488 skill_min = skill_max = skill_match;
489 if (skill_match == -1) {
500 if (skill < skill_min || skill > skill_max)
continue;
510 "Overall high scores:");
516 "[fixed]Rank Score [print]Who <max hp><max sp><max grace>");
static void hiscore_load(score_table *table)
static char * draw_one_high_score(const score *sc, char *buf, size_t size)
void LOG(LogLevel logLevel, const char *format,...)
int of_close(OutputFile *of)
FILE * of_open(OutputFile *of, const char *fname)
#define QUERY_FLAG(xyz, p)
int get_skill_client_code(const char *skill_name)
static event_registration c
static void add_score(score_table *table, score *new_score, score *old_score)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
#define PROFILE_BEGIN(expr)
#define MSG_TYPE_COMMAND_ERROR
static score_table hiscore_tables[MAX_SKILLS+1]
#define MSG_TYPE_ADMIN_HISCORE
Plugin animator file specs[Config] name
#define PROFILE_END(var, expr)
score entry[HIGHSCORE_LENGTH]
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 wd Fireborn sc
a copper bar weighs and has a value of
static void hiscore_save(const score_table *table)
static int get_score(char *bp, score *sc)
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
const char * skill_names[MAX_SKILLS]
void hiscore_display(object *op, int max, const char *match)
static void put_score(const score *sc, char *buf, size_t size)
size_t split_string(char *str, char *array[], size_t array_size, char sep)
void hiscore_check(object *op, int quiet)
#define MSG_TYPE_APPLY_ERROR
#define FOR_INV_PREPARE(op_, it_)
void player_get_title(const player *pl, char *buf, size_t bufsize)