From: Laszlo T. <ave...@us...> - 2010-10-15 21:03:59
|
gemrb: Infinity Engine emulator The branch master has been updated via 5dfe2b8a25c45e6b5914bf22b795164c7f821954 (commit) via 3d605c4dbcad0045225a0097d70bf2f4417c7b8f (commit) Summary of changes: gemrb/core/Scriptable/Actor.cpp | 20 +++++++++++++++----- gemrb/plugins/FXOpcodes/FXOpcodes.cpp | 27 +++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) from 4e59b70fb1647f3c19d3cd56ba778fa3b7f2389d (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=5dfe2b8a25c45e6b5914bf22b795164c7f821954 commit 5dfe2b8a25c45e6b5914bf22b795164c7f821954 Author: Avenger <ave...@so...> Date: Fri Oct 15 23:03:14 2010 +0200 pst: alternative state flags diff --git a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp index c73d3de..cb3cebc 100644 --- a/gemrb/plugins/FXOpcodes/FXOpcodes.cpp +++ b/gemrb/plugins/FXOpcodes/FXOpcodes.cpp @@ -80,6 +80,7 @@ static int *spell_abilities = NULL; static ieDword splabcount = 0; static int *polymorph_stats = NULL; static int polystatcount = 0; +static bool pstflags = false; //the original engine stores the colors in sprklclr.2da in a different order @@ -768,6 +769,7 @@ void RegisterCoreOpcodes() { core->RegisterOpcodes( sizeof( effectnames ) / sizeof( EffectRef ) - 1, effectnames ); enhanced_effects=!!core->HasFeature(GF_ENHANCED_EFFECTS); + pstflags=!!core->HasFeature(GF_PST_STATE_FLAGS); default_spell_hit.SequenceFlags|=IE_VVC_BAM; } @@ -1445,7 +1447,11 @@ int fx_set_invisible_state (Scriptable* /*Owner*/, Actor* target, Effect* fx) { switch (fx->Parameter2) { case 0: - STATE_SET( STATE_INVISIBLE ); + if (pstflags) { + STATE_SET( STATE_PST_INVIS ); + } else { + STATE_SET( STATE_INVISIBLE ); + } STAT_ADD(IE_TOHIT, 4); break; case 1: @@ -1923,7 +1929,11 @@ int fx_cure_invisible_state (Scriptable* /*Owner*/, Actor* target, Effect* fx) { if (0) printf( "fx_cure_invisible_state (%2d): Mod: %d, Type: %d\n", fx->Opcode, fx->Parameter1, fx->Parameter2 ); if (!STATE_GET(STATE_NONDET)) { - BASE_STATE_CURE( STATE_INVISIBLE | STATE_INVIS2 ); + if (pstflags) { + BASE_STATE_CURE( STATE_PST_INVIS ); + } else { + BASE_STATE_CURE( STATE_INVISIBLE | STATE_INVIS2 ); + } target->fxqueue.RemoveAllEffects(fx_set_invisible_state_ref); } return FX_NOT_APPLIED; @@ -3557,7 +3567,11 @@ int fx_force_visible (Scriptable* /*Owner*/, Actor* target, Effect* fx) { if (0) printf( "fx_force_visible (%2d): Mod: %d, Type: %d\n", fx->Opcode, fx->Parameter1, fx->Parameter2 ); - BASE_STATE_CURE(STATE_INVISIBLE); + if (pstflags) { + BASE_STATE_CURE(STATE_PST_INVIS); + } else { + BASE_STATE_CURE(STATE_INVISIBLE); + } target->fxqueue.RemoveAllEffectsWithParam(fx_set_invisible_state_ref,0); target->fxqueue.RemoveAllEffectsWithParam(fx_set_invisible_state_ref,2); return FX_NOT_APPLIED; @@ -4032,7 +4046,12 @@ int fx_mirror_image_modifier (Scriptable* /*Owner*/, Actor* target, Effect* fx) if (!fx->Parameter1) { return FX_NOT_APPLIED; } - STATE_SET( STATE_MIRROR ); + if (pstflags) { + STATE_SET( STATE_PST_MIRROR ); + } + else { + STATE_SET( STATE_MIRROR ); + } if (fx->Parameter2) { target->SetSpellState(SS_REFLECTION); } else { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=3d605c4dbcad0045225a0097d70bf2f4417c7b8f commit 3d605c4dbcad0045225a0097d70bf2f4417c7b8f Author: Avenger <ave...@so...> Date: Fri Oct 15 00:37:03 2010 +0200 pst:implemented special critical features diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index afd9f72..afa2d06 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -110,6 +110,7 @@ struct ItemUseType { static ItemUseType *itemuse = NULL; static int usecount = -1; +static bool pstflags = false; //item animation override array struct ItemAnimType { @@ -1338,9 +1339,7 @@ static void InitActorTables() { int i, j; - //if (core->HasFeature(GF_IWD_DEATHVARFORMAT)) { - // memcpy(DeathVarFormat, IWDDeathVarFormat, sizeof(ieVariable)); - //} + pstflags = core->HasFeature(GF_PST_STATE_FLAGS); if (core->HasFeature(GF_CHALLENGERATING)) { sharexp=SX_DIVIDE|SX_CR; @@ -4225,6 +4224,11 @@ bool Actor::GetCombatDetails(int &tohit, bool leftorright, WeaponInfo& wi, ITMEx //second parameter is left or right hand flag tohit = GetToHit(THAC0Bonus, Flags); + + //pst increased critical hits + if (pstflags && (Modified[IE_STATE_ID]&STATE_CRIT_ENH)) { + CriticalBonus++; + } return true; } @@ -4641,13 +4645,19 @@ void Actor::ModifyDamage(Actor *target, Scriptable *hitter, int &damage, int &re return; } + //critical protection a la PST + if (pstflags && (Modified[IE_STATE_ID] & (ieDword) STATE_CRIT_PROT )) { + critical = 0; + } + if (critical) { - //a critical surely raises the morale? - NewBase(IE_MORALE, 1, MOD_ADDITIVE); if (target->inventory.ProvidesCriticalAversion()) { //critical hit is averted by helmet displaymsg->DisplayConstantStringName(STR_NO_CRITICAL, 0xffffff, target); } else { + //a critical surely raises the morale? + //only if it is successful + NewBase(IE_MORALE, 1, MOD_ADDITIVE); damage <<=1; //critical damage is always double? core->timer->SetScreenShake(16,16,8); } ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |