Special Devastation Sigil behavior for Mortal Rifle damage.

This commit is contained in:
Mari the Deer 2022-09-15 01:59:10 +02:00
commit 186229c421
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r458 \cu(Thu 15 Sep 01:28:07 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r458 \cu(2022-09-15 01:28:07)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r459 \cu(Thu 15 Sep 01:59:10 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r459 \cu(2022-09-15 01:59:10)\c-";

View file

@ -3303,9 +3303,18 @@ Class AngeryPower : Powerup
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
if ( passive || (damage <= 0) ) return;
// (2^31-1)/25 : guarantee that it caps rather than overflowing
if ( damage > 85899345 ) newdamage = int.max;
else newdamage = damage*25;
if ( damageType == 'Mortal' ) // can only be in 4s
{
// max cap is the closest combination of 4s smaller than (2^31-1)
if ( damage > 44444444 ) newdamage = 444444444;
else newdamage = damage*10+4;
}
else
{
// (2^31-1)/25 : guarantee that it caps rather than overflowing
if ( damage > 85899345 ) newdamage = int.max;
else newdamage = damage*25;
}
// don't play hit fx for wall busting, as it'll be done manually if the bust goes through
if ( damageType != 'Wallbust' ) DoHitFX();
}