Skip to content

Commit

Permalink
Simplify GDR
Browse files Browse the repository at this point in the history
Guaranteed damage reduction is intended to smooth out some of the
nastiness in Crawl combat. It guarantees that your AC will never
roll below some % of its max value when defending against melee attacks
and mundane projectiles (not against spells, etc).

This is a mostly reasonable idea, but it's implemented bafflingly: it
uses your base AC OR a hodge-podge of special cases based on your species
and/or form, meaning that it's both spoilery and weird. Some AC is
effectively worth more than others. Not great!

Instead, simplify it to be based purely on the player's current AC.
(Specifically, AC^(1/4) * 16.)

Previous example values:

Robe:                 0%
Scale mail (ie Fi):  28%
Plate:               39%

New values:

AC 6 (ie Fi):        25%
AC 20:		     34%
AC 50:               43%

This is a buff to some things (anything that didn't have GDR before) and a
nerf to other things (early plate). It's all over the place. Chaos reigns.
(But in practice I suspect the difference will be mostly unnoticable.)
  • Loading branch information
PleasingFungus committed May 14, 2021
1 parent fdeffcb commit ff078d5
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions crawl-ref/source/player.cc
Expand Up @@ -5937,36 +5937,13 @@ int player::armour_class_with_specific_items(vector<const item_def *> items) con
* useful when the AC roll is inferior to it. Therefore a higher GDR means
* more damage reduced, but also more often.
*
* \f[ GDR = 14 \times (base\_AC - 2)^\frac{1}{2} \f]
* \f[ GDR = 16 \times (AC)^\frac{1}{2} \f]
*
* \return GDR as a percentage.
**/
int player::gdr_perc() const
{
switch (form)
{
case transformation::dragon:
return 34; // base AC 8
case transformation::statue:
return 39; // like plate (AC 10)
case transformation::tree:
return 48;
default:
break;
}

const item_def *body_armour = slot_item(EQ_BODY_ARMOUR, false);

int body_base_AC = (species == SP_GARGOYLE ? 5 : 0);
if (body_armour)
body_base_AC += property(*body_armour, PARM_AC);

// We take a sqrt here because damage prevented by GDR is
// actually proportional to the square of the GDR percentage
// (assuming you have enough AC).
int gdr = 14 * sqrt(max(body_base_AC - 2, 0));

return gdr;
return 16 * sqrt(sqrt(you.armour_class()));
}

/**
Expand Down

0 comments on commit ff078d5

Please sign in to comment.