Spider Stomper
Posts: 186
Joined: Friday, 8th March 2013, 13:27
Armour GDR
The error of this method is small except for the robe and the crystal plate armour.
If it doesn't fit anywhere else, it belongs here. Also, come here if you just need to get hammered.
Spider Stomper
Posts: 186
Joined: Friday, 8th March 2013, 13:27
Pandemonium Purger
Posts: 1341
Joined: Monday, 24th October 2011, 06:13
Spider Stomper
Posts: 206
Joined: Wednesday, 12th January 2011, 15:07
duvessa wrote:imo 0.40 isn't almost four times 10
Tomb Titivator
Posts: 799
Joined: Saturday, 23rd February 2013, 22:25
Zooty wrote:duvessa wrote:imo 0.40 isn't almost four times 10
Give or take an order of magnitude or two.
Abyss Ambulator
Posts: 1205
Joined: Friday, 8th November 2013, 17:02
imo 0.40 isn't almost four times 10
Barkeep
Posts: 3890
Joined: Wednesday, 14th August 2013, 23:25
Location: USA
Abyss Ambulator
Posts: 1205
Joined: Friday, 8th November 2013, 17:02
Ziggurat Zagger
Posts: 11111
Joined: Friday, 8th February 2013, 12:00
duvessa wrote:imo 0.40 isn't almost four times 10
Ziggurat Zagger
Posts: 11111
Joined: Friday, 8th February 2013, 12:00
int actor::apply_ac(int damage, int max_damage, ac_type ac_rule,
int stab_bypass) const
{
int ac = max(armour_class() - stab_bypass, 0);
int gdr = gdr_perc();
int saved = 0;
switch (ac_rule)
{
case AC_NONE:
return damage; // no GDR, too
case AC_PROPORTIONAL:
ASSERT(stab_bypass == 0);
saved = damage - apply_chunked_AC(damage, ac);
saved = max(saved, div_rand_round(max_damage * gdr, 100));
return max(damage - saved, 0);
case AC_NORMAL:
saved = random2(1 + ac);
break;
case AC_HALF:
saved = random2(1 + ac) / 2;
ac /= 2;
gdr /= 2;
break;
case AC_TRIPLE:
saved = random2(1 + ac) + random2(1 + ac) + random2(1 + ac);
ac *= 3;
// apply GDR only twice rather than thrice, that's probably still waaay
// too good. 50% gives 75% rather than 100%, too.
gdr = 100 - gdr * gdr / 100;
break;
default:
die("invalid AC rule");
}
saved = max(saved, min(gdr * max_damage / 100, ac / 2));
return max(damage - saved, 0);
}
Pandemonium Purger
Posts: 1341
Joined: Monday, 24th October 2011, 06:13
Sandman25 wrote:It looks like GDR is 40, not 0.40.
Sandman25 wrote:saved = max(saved, div_rand_round(max_damage * gdr, 100));
Tartarus Sorceror
Posts: 1881
Joined: Saturday, 7th September 2013, 21:16
Location: Itajubá, MG, Brazil.
Users browsing this forum: No registered users and 8 guests