| 193 | } |
| 194 | |
| 195 | string 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 " |
no test coverage detected