Crossfire Server, Trunk
MessageWriter.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2020 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "MessageWriter.h"
14 
16  if (message->identifier[0] == '\n') {
18  } else {
19  stringbuffer_append_printf(buf, "MSG %s\n", message->identifier);
20  }
21  if (message->title) {
23  }
24  if (message->chance) {
25  stringbuffer_append_printf(buf, "CHANCE %d\n", message->chance);
26  }
27  if (message->quest_code) {
28  stringbuffer_append_printf(buf, "QUEST %s\n", message->quest_code);
29  }
30  if (message->face) {
31  stringbuffer_append_printf(buf, "FACE %s\n", message->face->name);
32  }
33  if (message->message) {
36  }
37  stringbuffer_append_string(buf, "ENDMSG\n");
38 }
stringbuffer_append_printf
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Definition: stringbuffer.cpp:138
MessageWriter.h
buf
StringBuffer * buf
Definition: readable.cpp:1552
GeneralMessage
Definition: book.h:44
message
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
Definition: survival-guide.txt:34
stringbuffer_append_string
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Definition: stringbuffer.cpp:95
MessageWriter::write
virtual void write(const GeneralMessage *message, StringBuffer *buf)
Definition: MessageWriter.cpp:15
player::title
char title[BIG_NAME]
Definition: player.h:184
StringBuffer
Definition: stringbuffer.cpp:25