MCPcopy Create free account
hub / github.com/crawl/crawl / describe

Method describe

crawl-ref/source/notes.cc:195–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195string Note::describe(bool when, bool where, bool what) const
196{
197 ostringstream result;
198
199 if (when)
200 result << setw(6) << turn << " ";
201
202 if (where)
203 {
204 result << "| "
205 << chop_string(place.describe(), MAX_NOTE_PLACE_LEN)
206 << " | ";
207 }
208
209 if (what)
210 {
211 switch (type)
212 {
213 case NOTE_HP_CHANGE:
214 // [ds] Shortened HP change note from "Had X hitpoints" to
215 // accommodate the cause for the loss of hitpoints.
216 result << "HP: " << first << "/" << second
217 << " [" << name << "]";
218 break;
219 case NOTE_XOM_REVIVAL:
220 result << "Xom revived you";
221 break;
222 case NOTE_MP_CHANGE:
223 result << "Magic: " << first << "/" << second;
224 break;
225 case NOTE_MAXHP_CHANGE:
226 result << "Reached " << first << " max health";
227 break;
228 case NOTE_MAXMP_CHANGE:
229 result << "Reached " << first << " max magic points";
230 break;
231 case NOTE_XP_LEVEL_CHANGE:
232 result << "Reached XP level " << first << ". " << name;
233 break;
234 case NOTE_DUNGEON_LEVEL_CHANGE:
235 if (!desc.empty())
236 result << desc;
237 else
238 result << "Entered "
239 << place.describe(true, true);
240 break;
241 case NOTE_LEARN_SPELL:
242 result << "Learned a level "
243 << spell_difficulty(static_cast<spell_type>(first))
244 << " spell: "
245 << spell_title(static_cast<spell_type>(first));
246 break;
247 case NOTE_GET_GOD:
248 result << "Became a worshipper of "
249 << god_name(static_cast<god_type>(first), true);
250 break;
251 case NOTE_LOSE_GOD:
252 result << "Fell from the grace of "

Callers 1

check_milestoneMethod · 0.45

Calls 13

chop_stringFunction · 0.85
spell_difficultyFunction · 0.85
spell_titleFunction · 0.85
god_nameFunction · 0.85
skill_nameFunction · 0.85
uppercase_firstFunction · 0.85
mutation_descFunction · 0.85
bane_nameFunction · 0.85
hepliaklqana_ally_nameFunction · 0.85
apostrophiseFunction · 0.85
gem_adjFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected