… | |
… | |
46 | is_dragon_pl (const object *op) |
46 | is_dragon_pl (const object *op) |
47 | { |
47 | { |
48 | if (op |
48 | if (op |
49 | && op->type == PLAYER |
49 | && op->type == PLAYER |
50 | && op->arch |
50 | && op->arch |
51 | && op->arch->race |
51 | && op->arch->race == shstr_dragon) |
52 | && !strcmp (op->arch->race, "dragon")) |
|
|
53 | return 1; |
52 | return 1; |
54 | |
53 | |
55 | return 0; |
54 | return 0; |
56 | } |
55 | } |
57 | |
56 | |
… | |
… | |
338 | buf << "<"; |
337 | buf << "<"; |
339 | break; |
338 | break; |
340 | |
339 | |
341 | case '\r': |
340 | case '\r': |
342 | buf << '\n'; |
341 | buf << '\n'; |
|
|
342 | /* \r\n+ becomes one or more newlines */ |
|
|
343 | while (*cfpod == '\n') |
|
|
344 | buf << *cfpod++; |
343 | break; |
345 | break; |
344 | |
346 | |
345 | case '\n': |
347 | case '\n': |
346 | if (end == -2) |
348 | if (end == -2) |
347 | return cfpod; |
349 | return cfpod; |
… | |
… | |
356 | --cfpod; |
358 | --cfpod; |
357 | do |
359 | do |
358 | buf << *cfpod++; |
360 | buf << *cfpod++; |
359 | while (*cfpod == '\n'); |
361 | while (*cfpod == '\n'); |
360 | } |
362 | } |
361 | else if (*cfpod != ' ') |
363 | else if (*cfpod == ' ') |
|
|
364 | buf << '\n'; |
|
|
365 | else |
362 | buf << ' '; |
366 | buf << ' '; |
363 | |
367 | |
364 | // verbatim block? |
368 | // verbatim block? |
365 | if (*cfpod == ' ') |
369 | if (*cfpod == ' ') |
366 | goto verbatim; |
370 | goto verbatim; |
… | |
… | |
395 | case 'C': pfx = "<tt>" ; sfx = "</tt>" ; break; |
399 | case 'C': pfx = "<tt>" ; sfx = "</tt>" ; break; |
396 | case 'E': pfx = "&" ; sfx = ";" ; break; |
400 | case 'E': pfx = "&" ; sfx = ";" ; break; |
397 | case 'I': pfx = "<i>" ; sfx = "</i>" ; break; |
401 | case 'I': pfx = "<i>" ; sfx = "</i>" ; break; |
398 | case 'U': pfx = "<u>" ; sfx = "</u>" ; break; |
402 | case 'U': pfx = "<u>" ; sfx = "</u>" ; break; |
399 | case 'T': pfx = "<big><b>"; sfx = "</b></big>"; break; |
403 | case 'T': pfx = "<big><b>"; sfx = "</b></big>"; break; |
|
|
404 | case 'Z': pfx = "" ; sfx = "" ; break; |
400 | |
405 | |
401 | case 'H': // hint |
406 | case 'H': // hint |
402 | { |
407 | { |
403 | if (pl->hintmode) |
408 | if (pl->hintmode) |
404 | { |
409 | { |
405 | cfpod = expand_cfpod (pl, nest, cfpod, end); |
410 | cfpod = expand_cfpod (pl, nest, cfpod, end); |
406 | nest.clear (); |
411 | nest.clear (); |
407 | |
412 | |
408 | if (pl->hintmode == 1) |
413 | if (pl->hintmode == 1) |
409 | buf << "<fg name=\"lightblue\">[Hint suppressed, see hintmode]</fg>"; |
414 | buf << "<fg name=\"lightblue\">[Hint available]</fg>"; |
410 | else |
415 | else |
411 | while (*cfpod == ' ') // eat trailing whitespace |
416 | while (*cfpod <= ' '&& *cfpod) // eat trailing whitespace |
412 | ++cfpod; |
417 | ++cfpod; |
413 | |
418 | |
414 | goto skip; |
419 | goto skip; |
415 | } |
420 | } |
416 | else |
421 | else |
417 | { |
422 | { |
418 | pfx = "<fg name=\"lightblue\">["; |
423 | pfx = "<fg name=\"lightblue\">[Hint: "; |
419 | sfx = " (Use hintmode to suppress hints)]</fg>"; |
424 | sfx = "]</fg>"; |
420 | } |
425 | } |
421 | } |
426 | } |
422 | break; |
427 | break; |
423 | |
428 | |
424 | case 'G': // gender |
429 | case 'G': // gender |
… | |
… | |
461 | do |
466 | do |
462 | { |
467 | { |
463 | buf << "<tt>"; |
468 | buf << "<tt>"; |
464 | cfpod = expand_cfpod (pl, buf, cfpod, -2); |
469 | cfpod = expand_cfpod (pl, buf, cfpod, -2); |
465 | buf << "</tt>\n"; |
470 | buf << "</tt>\n"; |
|
|
471 | |
|
|
472 | while (*cfpod == '\n') |
|
|
473 | buf << *cfpod++; |
466 | } |
474 | } |
467 | while (*cfpod == ' '); |
475 | while (*cfpod == ' '); |
468 | |
476 | |
469 | while (*cfpod == '\n') |
|
|
470 | buf << *cfpod++; |
|
|
471 | |
|
|
472 | break; |
477 | break; |
473 | } |
478 | } |
474 | } |
479 | } |
475 | |
480 | |
476 | dynbuf_text * |
481 | dynbuf_text * |