Skip to content

Commit

Permalink
fx_bleeding_wounds: fixed, it's not a copy of the poison opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxlynxlynx committed Jan 12, 2014
1 parent fe62c9d commit 99110f1
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions gemrb/plugins/IWDOpcodes/IWDOpcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2795,30 +2795,28 @@ int fx_bleeding_wounds (Scriptable* Owner, Actor* target, Effect* fx)
if(0) print("fx_bleeding_wounds(%2d): Damage: %d, Type: %d", fx->Opcode, fx->Parameter1, fx->Parameter2);

//also this effect is executed every update
ieDword damage;
int tmp = fx->Parameter1;
ieDword damage = fx->Parameter1;
int tmp;

// a bit different than the poison opcodes
switch(fx->Parameter2) {
case RPD_PERCENT:
damage = STAT_GET(IE_MAXHITPOINTS) * fx->Parameter1 / 100;
break;
case RPD_ROUNDS:
tmp *= 6;
case 0: // Parameter1 per round
tmp = core->Time.round_sec;
goto seconds;
case RPD_TURNS:
tmp *= 30;
case RPD_SECONDS:
seconds:
case 1: // Parameter1 per second
tmp = 1;
goto seconds;
case 2: // 1 hitpoint each Parameter1 seconds
tmp = fx->Parameter1;
damage = 1;
seconds:
tmp *= AI_UPDATE_TIME;
if (tmp && (core->GetGame()->GameTime%tmp)) {
return FX_APPLIED;
}
break;
case RPD_POINTS:
damage = fx->Parameter1;
break;
default:
damage = 1;
Log(GemRB::ERROR, "IWDOpcodes", "Unknown type in fx_bleeding_wounds: %d!", fx->Parameter2);
break;
}
//percent
Expand Down

0 comments on commit 99110f1

Please sign in to comment.