From: Laszlo T. <ave...@us...> - 2011-08-06 15:50:45
|
gemrb: Infinity Engine emulator The branch master has been updated via 9f54b997a631d24d5c1f14e7289d6a74d2f71806 (commit) via ba2b78146241a793923e4baae7432bb46dbf56cb (commit) Summary of changes: gemrb/core/EffectQueue.cpp | 5 ++- gemrb/core/Scriptable/Actor.cpp | 6 +-- gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp | 69 ++++++++++++------------------ 3 files changed, 34 insertions(+), 46 deletions(-) from c9daef02886971fb23a47ea16668fb63b0bf582f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=9f54b997a631d24d5c1f14e7289d6a74d2f71806 commit 9f54b997a631d24d5c1f14e7289d6a74d2f71806 Author: Avenger <ave...@so...> Date: Sat Aug 6 17:50:00 2011 +0200 fixed overlay effect timing diff --git a/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp b/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp index d53c66d..87b35b5 100644 --- a/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp +++ b/gemrb/plugins/PSTOpcodes/PSTOpcodes.cpp @@ -505,7 +505,7 @@ static EffectRef fx_dispel_ref = { "DispelEffects", -1 }; static EffectRef fx_miscast_ref = { "MiscastMagicModifier", -1 }; static EffectRef fx_set_state_ref = { "SetStatus", -1 }; -int DamageLastHitter(Effect *fx, Actor *target, int param1, int param2) +static inline int DamageLastHitter(Effect *fx, Actor *target, int param1, int param2) { if (fx->Parameter3) { Map *map = target->GetCurrentArea(); @@ -531,6 +531,14 @@ int DamageLastHitter(Effect *fx, Actor *target, int param1, int param2) return FX_APPLIED; } +static inline void ConvertTiming(Effect *fx, int Duration) +{ + fx->Duration = Duration; + fx->TimingMode = FX_DURATION_INSTANT_LIMITED; + ieDword GameTime = core->GetGame()->GameTime; + PrepareDuration(fx); +} + int fx_overlay (Scriptable* Owner, Actor* target, Effect* fx) { if (0) print( "fx_overlay (%2d): Par2: %d\n", fx->Opcode, fx->Parameter2 ); @@ -540,58 +548,52 @@ int fx_overlay (Scriptable* Owner, Actor* target, Effect* fx) int terminate = FX_APPLIED; bool playonce = false; ieDword tint = 0; - int Duration = 0; Effect *newfx; //special effects based on fx_param2 if (fx->FirstApply) { - ieDword GameTime = core->GetGame()->GameTime; switch(fx->Parameter2) { case 0: //cloak of warding - Duration = 5 * fx->CasterLevel; + ConvertTiming (fx, 5 * fx->CasterLevel); fx->Parameter3 = core->Roll(3,4,fx->CasterLevel); break; case 1: //shield - Duration = 25 * fx->CasterLevel; + ConvertTiming(fx, 25 * fx->CasterLevel); + newfx = EffectQueue::CreateEffectCopy(fx, fx_armor_ref, 3, 16); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_breath_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_death_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_poly_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_spell_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_wands_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); break; case 2: //black barbed shield - Duration = core->Roll(10,3,0); + ConvertTiming (fx, core->Roll(10,3,0)); + newfx = EffectQueue::CreateEffectCopy(fx, fx_armor_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); fx->Parameter3=0xffffffff; break; case 3: //pain mirror fx->Parameter3 = 1; - Duration = 5 * fx->CasterLevel; + ConvertTiming (fx, 5 * fx->CasterLevel); + newfx = EffectQueue::CreateEffectCopy(fx, fx_colorpulse_ref, 0xFAFF7000, 0x30000C); core->ApplyEffect(newfx, target, Owner); break; case 4: //guardian mantle - Duration = 50 + 5 * fx->CasterLevel; + ConvertTiming (fx, 50 + 5 * fx->CasterLevel); break; case 5: //shroud of shadows @@ -634,10 +636,9 @@ int fx_overlay (Scriptable* Owner, Actor* target, Effect* fx) default: break; case 11: //flame walk - Duration = 10 * fx->CasterLevel; + ConvertTiming (fx, 10 * fx->CasterLevel); newfx = EffectQueue::CreateEffectCopy(fx, fx_single_color_pulse_ref, 0xFF00, 0x400040); - //wtf is this core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_colorchange_ref, 0x64FA00, 0x50005); @@ -652,88 +653,74 @@ int fx_overlay (Scriptable* Owner, Actor* target, Effect* fx) core->ApplyEffect(newfx, target, Owner); break; case 12: //protection from evil - Duration = 10 * fx->CasterLevel; + ConvertTiming (fx, 10 * fx->CasterLevel); + newfx = EffectQueue::CreateEffectCopy(fx, fx_armor_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_breath_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_death_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_poly_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_spell_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_wands_ref, 2, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); //terminate = FX_NOT_APPLIED; break; case 13: //conflagration - Duration = 50; + ConvertTiming (fx, 50); playonce = true; break; case 14: //infernal shield tint = 0x5EC2FE; - Duration = 5 * fx->CasterLevel; + ConvertTiming (fx, 5 * fx->CasterLevel); + newfx = EffectQueue::CreateEffectCopy(fx, fx_resistfire_ref, 150, 1); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_resistmfire_ref, 150, 1); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); break; case 15: //submerge the will tint = 0x538D90; - Duration = 12 * fx->CasterLevel; + ConvertTiming (fx, 12 * fx->CasterLevel); + newfx = EffectQueue::CreateEffectCopy(fx, fx_armor_ref, 2, 16); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_breath_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_death_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_poly_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_spell_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); newfx = EffectQueue::CreateEffectCopy(fx, fx_wands_ref, 1, 0); - newfx->Duration = Duration; core->ApplyEffect(newfx, target, Owner); break; case 16: //balance in all things tint = 0x615AB4; fx->Parameter3 = fx->CasterLevel/4; + ConvertTiming (fx, 5 * fx->CasterLevel); - Duration = 5 * fx->CasterLevel; newfx = EffectQueue::CreateEffectCopy(fx, fx_colorpulse_ref, 0x615AB400, 0x30000C); core->ApplyEffect(newfx, target, Owner); + playonce = true; break; } - if (Duration) { - fx->Duration = Duration; - fx->TimingMode = FX_DURATION_INSTANT_LIMITED; - PrepareDuration(fx); - } + if (!target->HasVVCCell(fx->Resource)) { ScriptedAnimation *sca = gamedata->GetScriptedAnimation(fx->Resource, true); if (sca) { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=ba2b78146241a793923e4baae7432bb46dbf56cb commit ba2b78146241a793923e4baae7432bb46dbf56cb Author: Avenger <ave...@so...> Date: Sat Aug 6 17:49:25 2011 +0200 fixed cloak of warding diff --git a/gemrb/core/EffectQueue.cpp b/gemrb/core/EffectQueue.cpp index 8a7bbaf..d18b8b5 100644 --- a/gemrb/core/EffectQueue.cpp +++ b/gemrb/core/EffectQueue.cpp @@ -1555,6 +1555,7 @@ void EffectQueue::DecreaseParam1OfEffect(EffectRef &effect_reference, ieDword am } //this is only used for Cloak of Warding Overlay in PST +//returns the damage amount NOT soaked int EffectQueue::DecreaseParam3OfEffect(ieDword opcode, ieDword amount, ieDword param2) const { std::list< Effect* >::const_iterator f; @@ -1578,11 +1579,13 @@ int EffectQueue::DecreaseParam3OfEffect(ieDword opcode, ieDword amount, ieDword return amount; } +//this is only used for Cloak of Warding Overlay in PST +//returns the damage amount NOT soaked int EffectQueue::DecreaseParam3OfEffect(EffectRef &effect_reference, ieDword amount, ieDword param2) const { ResolveEffectRef(effect_reference); if( effect_reference.opcode<0) { - return 0; + return amount; } return DecreaseParam3OfEffect(effect_reference.opcode, amount, param2); } diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 3c4cd9a..4dcb531 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -5165,12 +5165,10 @@ void Actor::ModifyDamage(Actor *target, Scriptable *hitter, int &damage, int &re int stoneskins = target->Modified[IE_STONESKINS]; if (stoneskins) { //pst style damage soaking from cloak of warding - int tmp = target->fxqueue.DecreaseParam3OfEffect(fx_cloak_ref, damage, 0); - if (tmp>damage) { - damage = 0; + damage = target->fxqueue.DecreaseParam3OfEffect(fx_cloak_ref, damage, 0); + if (!damage) { return; } - damage -= tmp; target->fxqueue.DecreaseParam1OfEffect(fx_stoneskin_ref, 1); target->fxqueue.DecreaseParam1OfEffect(fx_aegis_ref, 1); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |