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

Function _ability_damage_string

crawl-ref/source/ability.cc:1464–1557  ·  view source on GitHub ↗

XXX This is a mess, caused by abilities doing damage via various different in-house and outsourced methods.

Source from the content-addressed store, hash-verified

1462// XXX This is a mess, caused by abilities doing damage via various
1463// different in-house and outsourced methods.
1464static string _ability_damage_string(ability_type ability)
1465{
1466 // TODO The following abilities have effects that would be nice to show
1467 // but which don't fit neatly into the "Damage: dice" format.
1468 // Chei: temporal distortion, step from time
1469 // Elyvilon: heal other, heal self, divine vigour
1470 // Fedhas: ballistomycete, oklob
1471 // Hep: idealise
1472 // Ignis: fiery armour
1473 // Kiku: unearth wretches
1474 // Ru: draw out power
1475 // Yred: fathomless shackles
1476 // Zin: vitalisation
1477 // TSO: divine shield
1478
1479 dice_def dam;
1480
1481 switch (ability)
1482 {
1483 case ABIL_MAKHLEB_DESTRUCTION:
1484 return spell_damage_string(SPELL_UNLEASH_DESTRUCTION, false,
1485 _makhleb_destruction_power());
1486
1487 case ABIL_MAKHLEB_ANNIHILATION:
1488 return spell_damage_string(SPELL_UNLEASH_DESTRUCTION, false,
1489 _makhleb_annihilation_power());
1490
1491 case ABIL_YRED_HURL_TORCHLIGHT:
1492 return spell_damage_string(SPELL_HURL_TORCHLIGHT, false,
1493 _yred_hurl_torchlight_power());
1494 case ABIL_BEOGH_SMITING:
1495 dam = beogh_smiting_dice(_beogh_smiting_power(false), false);
1496 return make_stringf("6 + %dd%d", dam.num, dam.size);
1497 case ABIL_TSO_CLEANSING_FLAME:
1498 return make_stringf("2d%d*", _tso_cleansing_flame_power(false));
1499 case ABIL_CHEIBRIADOS_SLOUCH:
1500 return make_stringf("%dd3 / 2 (against normal-speed enemies)",
1501 slouch_damage_for_speed());
1502 case ABIL_IGNIS_FOXFIRE:
1503 return "1d8/foxfire"; // constant
1504 case ABIL_QAZLAL_UPHEAVAL:
1505 dam = qazlal_upheaval_damage(false);
1506 break;
1507 case ABIL_QAZLAL_DISASTER_AREA:
1508 dam = qazlal_upheaval_damage(false);
1509 return make_stringf("%dd%d/upheaval", dam.num, dam.size);
1510 case ABIL_RU_POWER_LEAP:
1511 dam = ru_power_leap_damage(false);
1512 break;
1513 case ABIL_RU_APOCALYPSE:
1514 // Apocalypse uses 4 dice, 6 dice or 8 dice depending on the effect.
1515 return make_stringf("10 + (4-8)d%d", apocalypse_die_size(false));
1516 case ABIL_JIYVA_OOZEMANCY:
1517 // per turn damage is 2d(3*#walls)
1518 return "2d(3-24)";
1519 case ABIL_USKAYAW_STOMP:
1520 dam = uskayaw_stomp_extra_damage(false);
1521 return make_stringf("%dd%d + 1/6 of current HP",

Callers 1

get_ability_descFunction · 0.85

Calls 15

spell_damage_stringFunction · 0.85
beogh_smiting_diceFunction · 0.85
_beogh_smiting_powerFunction · 0.85
make_stringfFunction · 0.85
slouch_damage_for_speedFunction · 0.85
qazlal_upheaval_damageFunction · 0.85
ru_power_leap_damageFunction · 0.85
apocalypse_die_sizeFunction · 0.85

Tested by

no test coverage detected