Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FXOpcodes: use HandleBonus for saving throws

fixes both effects doing the reverse and enables use in iwd2
(in adnd the stat is the DC, not something you add to the roll)
  • Loading branch information...
commit c0c01f3d37ae1907f72637ecaee2dc776b6934e8 1 parent ffb4c1d
@lynxlynxlynx lynxlynxlynx authored
Showing with 12 additions and 10 deletions.
  1. +12 −10 gemrb/plugins/FXOpcodes/FXOpcodes.cpp
View
22 gemrb/plugins/FXOpcodes/FXOpcodes.cpp
@@ -3811,11 +3811,12 @@ int fx_set_aid_state (Scriptable* /*Owner*/, Actor* target, Effect* fx)
if (fx->FirstApply) {
BASE_ADD( IE_HITPOINTS, fx->Parameter1);
}
- STAT_ADD( IE_SAVEVSDEATH, fx->Parameter1);
- STAT_ADD( IE_SAVEVSWANDS, fx->Parameter1);
- STAT_ADD( IE_SAVEVSPOLY, fx->Parameter1);
- STAT_ADD( IE_SAVEVSBREATH, fx->Parameter1);
- STAT_ADD( IE_SAVEVSSPELL, fx->Parameter1);
+ HandleBonus(target, IE_SAVEVSDEATH, fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSWANDS, fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSPOLY, fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSBREATH, fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSSPELL, fx->Parameter1, fx->TimingMode);
+
//bless effect too?
target->ToHit.HandleFxBonus(fx->Parameter1, fx->TimingMode==FX_DURATION_INSTANT_PERMANENT);
STAT_ADD( IE_DAMAGEBONUS, fx->Parameter1);
@@ -5562,11 +5563,12 @@ int fx_leveldrain_modifier (Scriptable* /*Owner*/, Actor* target, Effect* fx)
}
STAT_ADD(IE_LEVELDRAIN, fx->Parameter1);
STAT_SUB(IE_MAXHITPOINTS, x);
- STAT_SUB(IE_SAVEVSDEATH, fx->Parameter1);
- STAT_SUB(IE_SAVEVSWANDS, fx->Parameter1);
- STAT_SUB(IE_SAVEVSPOLY, fx->Parameter1);
- STAT_SUB(IE_SAVEVSBREATH, fx->Parameter1);
- STAT_SUB(IE_SAVEVSSPELL, fx->Parameter1);
+ HandleBonus(target, IE_SAVEVSDEATH, -fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSWANDS, -fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSPOLY, -fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSBREATH, -fx->Parameter1, fx->TimingMode);
+ HandleBonus(target, IE_SAVEVSSPELL, -fx->Parameter1, fx->TimingMode);
+
target->AddPortraitIcon(PI_LEVELDRAIN);
//decrease current hitpoints on first apply
if (fx->FirstApply) {
Please sign in to comment.
Something went wrong with that request. Please try again.