Refactored item bonuses to utilize C++ features (#3235)

* Fixes #996 and fixes #3152.
* Refactored MAX_PC_BONUS item bonuses from static arrays to vectors.
* Increased MAX_PC_BONUS to 50.
* Frees up memory from players that may not ever utilize all their static MAX_PC_BONUS item bonuses.
* Expanded bonus ResEff to not be restricted to SC_COMMON* statuses.
* Removed old ERS usages.
* Removed code redundancy and general cleanups.
Thanks to @Angelic234, @Atemo, @Lemongrass3110, and @Everade!
This commit is contained in:
Aleos
2018-11-28 21:50:43 -05:00
committed by GitHub
parent eafb1cb7f9
commit c71ef92fb0
8 changed files with 787 additions and 888 deletions

View File

@@ -9268,8 +9268,7 @@ BUILDIN_FUNC(autobonus)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
if( pc_addautobonus(sd->autobonus,ARRAYLENGTH(sd->autobonus),
bonus_script,rate,dur,atk_type,other_script,pos,false) )
if( pc_addautobonus(sd->autobonus, bonus_script, rate, dur, atk_type, other_script, pos, false) )
{
script_add_autobonus(bonus_script);
if( other_script )
@@ -9309,8 +9308,7 @@ BUILDIN_FUNC(autobonus2)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
if( pc_addautobonus(sd->autobonus2,ARRAYLENGTH(sd->autobonus2),
bonus_script,rate,dur,atk_type,other_script,pos,false) )
if( pc_addautobonus(sd->autobonus2, bonus_script, rate,dur, atk_type, other_script, pos, false) )
{
script_add_autobonus(bonus_script);
if( other_script )
@@ -9351,8 +9349,7 @@ BUILDIN_FUNC(autobonus3)
if( script_hasdata(st,6) )
other_script = script_getstr(st,6);
if( pc_addautobonus(sd->autobonus3,ARRAYLENGTH(sd->autobonus3),
bonus_script,rate,dur,atk_type,other_script,pos,true) )
if( pc_addautobonus(sd->autobonus3, bonus_script, rate, dur, atk_type, other_script, pos, true) )
{
script_add_autobonus(bonus_script);
if( other_script )