Skip to content

Commit

Permalink
moved DamageBonusModifier2 into main FXOpcodes
Browse files Browse the repository at this point in the history
to be used for tobex setstat opcode and ee
  • Loading branch information
lynxlynxlynx committed Apr 15, 2018
1 parent 60d29eb commit b270e1d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 32 deletions.
31 changes: 31 additions & 0 deletions gemrb/plugins/FXOpcodes/FXOpcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ int fx_cure_nondetection_state (Scriptable* Owner, Actor* target, Effect* fx);//
int fx_sex_modifier (Scriptable* Owner, Actor* target, Effect* fx);//47
int fx_ids_modifier (Scriptable* Owner, Actor* target, Effect* fx);//48
int fx_damage_bonus_modifier (Scriptable* Owner, Actor* target, Effect* fx);//49
int fx_damage_bonus_modifier2 (Scriptable* Owner, Actor* target, Effect* fx);//49 (iwd, ee)
int fx_set_blind_state (Scriptable* Owner, Actor* target, Effect* fx);//4a
int fx_cure_blind_state (Scriptable* Owner, Actor* target, Effect* fx);//4b
int fx_set_feebleminded_state (Scriptable* Owner, Actor* target, Effect* fx);//4c
Expand Down Expand Up @@ -531,6 +532,7 @@ static EffectDesc effectnames[] = {
{ "Damage", fx_damage, EFFECT_DICED, -1 },
{ "DamageAnimation", fx_damage_animation, 0, -1 },
{ "DamageBonusModifier", fx_damage_bonus_modifier, 0, -1 },
{ "DamageBonusModifier2", fx_damage_bonus_modifier2, 0, -1 }, // override for iwd, eventually used in ees and for tobex
{ "DamageLuckModifier", fx_damageluck_modifier, 0, -1 },
{ "DamageVsCreature", fx_generic_effect, 0, -1 },
{ "Death", fx_death, 0, -1 },
Expand Down Expand Up @@ -2760,6 +2762,35 @@ int fx_damage_bonus_modifier (Scriptable* /*Owner*/, Actor* target, Effect* fx)
return FX_APPLIED;
}

// 0x49 DamageBonusModifier(2)
// iwd/iwd2 supports different damage types, but only flat and percentage boni
// only the special type of 0 means a flat bonus
int fx_damage_bonus_modifier2 (Scriptable* /*Owner*/, Actor* target, Effect* fx)
{
if(0) print("fx_damage_bonus_modifier2(%2d): Mod: %d, Type: %d", fx->Opcode, fx->Parameter1, fx->Parameter2);

switch (fx->Parameter2) {
case 0:
STAT_MOD(IE_DAMAGEBONUS);
break;
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
// no stat to save to, so we handle it when dealing damage
break;
default:
return FX_NOT_APPLIED;
}
return FX_APPLIED;
}

// 0x4a State:Blind
int fx_set_blind_state (Scriptable* /*Owner*/, Actor* target, Effect* fx)
{
Expand Down
31 changes: 0 additions & 31 deletions gemrb/plugins/IWDOpcodes/IWDOpcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ static Trigger *Enemy = NULL;
#define ES_RAPIDSHOT 7

static int fx_ac_vs_damage_type_modifier_iwd2 (Scriptable* Owner, Actor* target, Effect* fx);//0
static int fx_damage_bonus_modifier (Scriptable* Owner, Actor* target, Effect* fx);//49
static int fx_draw_upon_holy_might (Scriptable* Owner, Actor* target, Effect* fx);//84 (iwd2)
static int fx_ironskins (Scriptable* Owner, Actor* target, Effect* fx);//da (iwd2)
static int fx_fade_rgb (Scriptable* Owner, Actor* target, Effect* fx);//e8
Expand Down Expand Up @@ -247,7 +246,6 @@ static int fx_rapid_shot (Scriptable* Owner, Actor* target, Effect* fx); //457
//No need to make these ordered, they will be ordered by EffectQueue
static EffectDesc effectnames[] = {
{ "ACVsDamageTypeModifierIWD2", fx_ac_vs_damage_type_modifier_iwd2, 0, -1 }, //0
{ "DamageBonusModifier2", fx_damage_bonus_modifier, 0, -1 }, //49
{ "DrawUponHolyMight", fx_draw_upon_holy_might, 0, -1 },//84 (iwd2)
{ "IronSkins", fx_ironskins, 0, -1 }, //da (iwd2)
{ "Color:FadeRGB", fx_fade_rgb, 0, -1 }, //e8
Expand Down Expand Up @@ -696,35 +694,6 @@ int fx_ac_vs_damage_type_modifier_iwd2 (Scriptable* /*Owner*/, Actor* target, Ef
return FX_PERMANENT;
}

// 0x49 DamageBonusModifier
// iwd/iwd2 supports different damage types, but only flat and percentage boni
// only the special type of 0 means a flat bonus
int fx_damage_bonus_modifier (Scriptable* /*Owner*/, Actor* target, Effect* fx)
{
if(0) print("fx_damage_bonus_modifier(%2d): Mod: %d, Type: %d", fx->Opcode, fx->Parameter1, fx->Parameter2);

switch (fx->Parameter2) {
case 0:
STAT_MOD(IE_DAMAGEBONUS);
break;
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
// no stat to save to, so we handle it when dealing damage
break;
default:
return FX_NOT_APPLIED;
}
return FX_APPLIED;
}

// 0x84 DrawUponHolyMight
// this effect differs from bg2 because it doesn't use the actor state field
// it uses the spell state field
Expand Down
2 changes: 1 addition & 1 deletion gemrb/unhardcoded/bg2/effects.ids
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,4 @@ IDS
0x13e Stat:SetStat
0x13f Usability:ItemUsability
0x140 ChangeWeather

0x14C DamageBonusModifier2

0 comments on commit b270e1d

Please sign in to comment.