From: Jaka K. <lyn...@us...> - 2012-12-24 21:41:36
|
gemrb: Infinity Engine emulator The branch master has been updated via 90030a3f4547619d18aa6d2defc3a030e998c9ac (commit) via 90504b383f305cb82c3d6157adb6f3a67e9c57b0 (commit) via 74a41af4d6c3b83ce47ac9141d4b91e2ceb190bc (commit) via af429de0b73bdefacf3924e84460789655c15c39 (commit) via 47b53fd0227322281e76220bc165d6ba9bc09a3c (commit) via 35e04cbc0a3a7f85106146d0079445d0e4eab1ec (commit) via 3766b75f95d944db65f9ca00082815435122086e (commit) Summary of changes: gemrb/core/CombatInfo.cpp | 88 +++++++++++++++++++++---------------- gemrb/core/Item.h | 2 +- gemrb/core/Projectile.cpp | 4 +- gemrb/core/Scriptable/Actor.cpp | 28 ++++++++++-- gemrb/core/Scriptable/Actor.h | 1 + gemrb/unhardcoded/bg1/avatars.2da | 78 ++++++++++++++++---------------- 6 files changed, 117 insertions(+), 84 deletions(-) from 3f07da9718179d9cc7c9c98ce060bf2425b86bae (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=90030a3f4547619d18aa6d2defc3a030e998c9ac commit 90030a3f4547619d18aa6d2defc3a030e998c9ac Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 22:30:32 2012 +0100 bg1: fixed some more avatars by cheating from 31b207f5481 diff --git a/gemrb/unhardcoded/bg1/avatars.2da b/gemrb/unhardcoded/bg1/avatars.2da index 02eaf20..8e6bf6d 100644 --- a/gemrb/unhardcoded/bg1/avatars.2da +++ b/gemrb/unhardcoded/bg1/avatars.2da @@ -129,9 +129,9 @@ 0x6500 CHMM1 CHMC2 CHMC3 CHMC4 0 2 0 * 0x6510 CHFM1 CHFC2 CHFC3 CHFC4 0 2 0 * 0x7000 MOGH MOGH MOGH MOGH 14 2 0 * -0x7001 MOGN MOGN MOGN MOGN 2 2 0 * -0x7100 MBAS MBAS MBAS MBAS 2 2 1 * -0x7101 MBAS MBAS MBAS MBAS 2 2 GR * +0x7001 MOGN MOGN MOGN MOGN 14 2 0 * +0x7100 MBAS MBAS MBAS MBAS 14 2 1 * +0x7101 MBAS MBAS MBAS MBAS 14 2 GR * 0x7200 MBER MBER MBER MBER 14 2 BL * 0x7201 MBER MBER MBER MBER 14 2 1 * 0x7202 MBER MBER MBER MBER 14 2 CA * @@ -146,36 +146,36 @@ 0x7400 MDOG MDOG MDOG MDOG 14 2 WI * 0x7401 MDOG MDOG MDOG MDOG 14 2 WA * 0x7402 MDOG MDOG MDOG MDOG 14 2 MO * -0x7500 MDOP MDOP MDOP MDOP 2 2 1 * -0x7501 MDOP MDOP MDOP MDOP 2 2 GR * +0x7500 MDOP MDOP MDOP MDOP 14 2 1 * +0x7501 MDOP MDOP MDOP MDOP 14 2 GR * 0x7600 METT METT METT METT 14 2 1 * 0x7701 MGHL MGHL MGHL MGHL 14 2 1 * 0x7702 MGHL MGHL MGHL MGHL 14 2 RE * 0x7703 MGHL MGHL MGHL MGHL 14 2 GA * 0x7704 MSHD MSHD MSHD MSHD 4 2 1 * 0x7800 MGIB MGIB MGIB MGIB 14 2 1 * -0x7900 MSLI MSLI MSLI MSLI 3 3 GR * -0x7901 MSLI MSLI MSLI MSLI 3 3 OL * -0x7902 MSLI MSLI MSLI MSLI 3 3 MU * -0x7903 MSLI MSLI MSLI MSLI 3 3 OC * -0x7904 MSLI MSLI MSLI MSLI 3 3 1 * -0x7A00 MSPI MSPI MSPI MSPI 2 2 GI * -0x7A01 MSPI MSPI MSPI MSPI 3 2 HU * -0x7A02 MSPI MSPI MSPI MSPI 3 2 PH * -0x7A03 MSPI MSPI MSPI MSPI 3 2 SW * -0x7A04 MSPI MSPI MSPI MSPI 3 2 WR * -0x7B00 MWLF MWLF MWLF MWLF 2 2 1 * -0x7B01 MWLF MWLF MWLF MWLF 2 2 WO * -0x7B02 MWLF MWLF MWLF MWLF 2 2 DI * -0x7B03 MWLF MWLF MWLF MWLF 2 2 WI * -0x7B04 MWLF MWLF MWLF MWLF 2 2 VA * -0x7B05 MWLF MWLF MWLF MWLF 2 2 DR * -0x7B06 MWLS MWLS MWLS MWLS 2 2 1 * +0x7900 MSLI MSLI MSLI MSLI 14 3 GR * +0x7901 MSLI MSLI MSLI MSLI 14 3 OL * +0x7902 MSLI MSLI MSLI MSLI 14 3 MU * +0x7903 MSLI MSLI MSLI MSLI 14 3 OC * +0x7904 MSLI MSLI MSLI MSLI 14 3 1 * +0x7A00 MSPI MSPI MSPI MSPI 14 2 GI * +0x7A01 MSPI MSPI MSPI MSPI 14 2 HU * +0x7A02 MSPI MSPI MSPI MSPI 14 2 PH * +0x7A03 MSPI MSPI MSPI MSPI 14 2 SW * +0x7A04 MSPI MSPI MSPI MSPI 14 2 WR * +0x7B00 MWLF MWLF MWLF MWLF 14 2 1 * +0x7B01 MWLF MWLF MWLF MWLF 14 2 WO * +0x7B02 MWLF MWLF MWLF MWLF 14 2 DI * +0x7B03 MWLF MWLF MWLF MWLF 14 2 WI * +0x7B04 MWLF MWLF MWLF MWLF 14 2 VA * +0x7B05 MWLF MWLF MWLF MWLF 14 2 DR * +0x7B06 MWLS MWLS MWLS MWLS 14 2 1 * 0x7C00 MXVT MXVT MXVT MXVT 14 2 0 * 0x7C01 MTAS MTAS MTAS MTAS 14 2 1 * 0x7D00 MZOM MZOM MZOM MZOM 14 2 0 * -0x7E00 MWER MWER MWER MWER 2 2 1 * -0x7E01 MGWE MGWE MGWE MGWE 2 2 1 * +0x7E00 MWER MWER MWER MWER 14 2 1 * +0x7E01 MGWE MGWE MGWE MGWE 14 2 1 * 0x7F00 MTRO MTRO MTRO MTRO 4 2 1 * 0x7F01 MMIN MMIN MMIN MMIN 4 2 1 * 0x7F02 MBEH MBEH MBEH MBEH 4 3 1 * http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=90504b383f305cb82c3d6157adb6f3a67e9c57b0 commit 90504b383f305cb82c3d6157adb6f3a67e9c57b0 Author: Jens Granseuer <je...@gm...> Date: Fri Dec 21 20:31:48 2012 +0100 use IE_ANI_FOUR_FILES_2 for a couple of monsters with only 16 frames This keeps those monsters from going invisible due to missing animations. diff --git a/gemrb/unhardcoded/bg1/avatars.2da b/gemrb/unhardcoded/bg1/avatars.2da index 937913c..02eaf20 100644 --- a/gemrb/unhardcoded/bg1/avatars.2da +++ b/gemrb/unhardcoded/bg1/avatars.2da @@ -128,14 +128,14 @@ 0x6406 MDGU1 MDGU1 MDGU1 MDGU1 6 2 0 L 0x6500 CHMM1 CHMC2 CHMC3 CHMC4 0 2 0 * 0x6510 CHFM1 CHFC2 CHFC3 CHFC4 0 2 0 * -0x7000 MOGH MOGH MOGH MOGH 2 2 0 * +0x7000 MOGH MOGH MOGH MOGH 14 2 0 * 0x7001 MOGN MOGN MOGN MOGN 2 2 0 * 0x7100 MBAS MBAS MBAS MBAS 2 2 1 * 0x7101 MBAS MBAS MBAS MBAS 2 2 GR * -0x7200 MBER MBER MBER MBER 2 2 BL * -0x7201 MBER MBER MBER MBER 2 2 1 * -0x7202 MBER MBER MBER MBER 2 2 CA * -0x7203 MBER MBER MBER MBER 2 2 PO * +0x7200 MBER MBER MBER MBER 14 2 BL * +0x7201 MBER MBER MBER MBER 14 2 1 * +0x7202 MBER MBER MBER MBER 14 2 CA * +0x7203 MBER MBER MBER MBER 14 2 PO * 0x7300 MEAE MEAE MEAE MEAE 4 2 1 * 0x7301 MEAS MEAS MEAS MEAS 4 2 1 * 0x7302 MEAE MEAE MEAE MEAE 4 2 SH * @@ -143,15 +143,15 @@ 0x7311 MFIS MFIS MFIS MFIS 4 2 1 * 0x7320 MAIR MAIR MAIR MAIR 4 2 1 * 0x7321 MAIS MAIS MAIS MAIS 4 2 1 * -0x7400 MDOG MDOG MDOG MDOG 2 2 WI * -0x7401 MDOG MDOG MDOG MDOG 2 2 WA * -0x7402 MDOG MDOG MDOG MDOG 2 2 MO * +0x7400 MDOG MDOG MDOG MDOG 14 2 WI * +0x7401 MDOG MDOG MDOG MDOG 14 2 WA * +0x7402 MDOG MDOG MDOG MDOG 14 2 MO * 0x7500 MDOP MDOP MDOP MDOP 2 2 1 * 0x7501 MDOP MDOP MDOP MDOP 2 2 GR * -0x7600 METT METT METT METT 2 2 1 * -0x7701 MGHL MGHL MGHL MGHL 2 2 1 * -0x7702 MGHL MGHL MGHL MGHL 2 2 RE * -0x7703 MGHL MGHL MGHL MGHL 2 2 GA * +0x7600 METT METT METT METT 14 2 1 * +0x7701 MGHL MGHL MGHL MGHL 14 2 1 * +0x7702 MGHL MGHL MGHL MGHL 14 2 RE * +0x7703 MGHL MGHL MGHL MGHL 14 2 GA * 0x7704 MSHD MSHD MSHD MSHD 4 2 1 * 0x7800 MGIB MGIB MGIB MGIB 14 2 1 * 0x7900 MSLI MSLI MSLI MSLI 3 3 GR * @@ -171,9 +171,9 @@ 0x7B04 MWLF MWLF MWLF MWLF 2 2 VA * 0x7B05 MWLF MWLF MWLF MWLF 2 2 DR * 0x7B06 MWLS MWLS MWLS MWLS 2 2 1 * -0x7C00 MXVT MXVT MXVT MXVT 2 2 0 * -0x7C01 MTAS MTAS MTAS MTAS 2 2 1 * -0x7D00 MZOM MZOM MZOM MZOM 2 2 0 * +0x7C00 MXVT MXVT MXVT MXVT 14 2 0 * +0x7C01 MTAS MTAS MTAS MTAS 14 2 1 * +0x7D00 MZOM MZOM MZOM MZOM 14 2 0 * 0x7E00 MWER MWER MWER MWER 2 2 1 * 0x7E01 MGWE MGWE MGWE MGWE 2 2 1 * 0x7F00 MTRO MTRO MTRO MTRO 4 2 1 * http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=74a41af4d6c3b83ce47ac9141d4b91e2ceb190bc commit 74a41af4d6c3b83ce47ac9141d4b91e2ceb190bc Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 22:01:43 2012 +0100 renamed IE_ITEM_IGNORESHIELD to be clearer - it matches WEAPON_BYPASS diff --git a/gemrb/core/Item.h b/gemrb/core/Item.h index ec7fb68..e36726d 100644 --- a/gemrb/core/Item.h +++ b/gemrb/core/Item.h @@ -65,7 +65,7 @@ class Projectile; #define IE_ITEM_USEDEXTERITY 4 //gemrb weapon (move this if tobex implements it elsewhere) #define IE_ITEM_HOSTILE 0x400 //equipment #define IE_ITEM_RECHARGE 0x800 //equipment -#define IE_ITEM_IGNORESHIELD 0x10000 //weapon +#define IE_ITEM_BYPASS 0x10000 //weapon (bypass shield and armor bonus) #define IE_ITEM_KEEN 0x20000 //weapon //modder extensions diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index cdd0940..ca3c7c8 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -5651,8 +5651,8 @@ bool Actor::GetCombatDetails(int &tohit, bool leftorright, WeaponInfo& wi, ITMEx if (header->RechargeFlags&IE_ITEM_USESTRENGTH) wi.wflags|=WEAPON_USESTRENGTH; // this flag is set in dagger/shortsword by the loader if (header->RechargeFlags&IE_ITEM_USEDEXTERITY) wi.wflags|=WEAPON_FINESSE; - //also copy these flags - wi.wflags|=header->RechargeFlags&(IE_ITEM_KEEN|IE_ITEM_IGNORESHIELD); + //also copy these flags (they match their WEAPON_ counterparts) + wi.wflags|=header->RechargeFlags&(IE_ITEM_KEEN|IE_ITEM_BYPASS); // get our dual wielding modifier if (dualwielding) { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=af429de0b73bdefacf3924e84460789655c15c39 commit af429de0b73bdefacf3924e84460789655c15c39 Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 21:54:34 2012 +0100 ignore armor for spell touch attacks diff --git a/gemrb/core/Projectile.cpp b/gemrb/core/Projectile.cpp index 3aa7d04..5fe3ec0 100644 --- a/gemrb/core/Projectile.cpp +++ b/gemrb/core/Projectile.cpp @@ -479,6 +479,7 @@ void Projectile::SetDelay(int delay) //copied from Actor.cpp #define ATTACKROLL 20 #define WEAPON_FIST 0 +#define WEAPON_BYPASS 0x10000 bool Projectile::FailedIDS(Actor *target) const { @@ -525,7 +526,8 @@ bool Projectile::FailedIDS(Actor *target) const //handle attack type here, weapon depends on it too? int tohit = caster->GetToHit(0, WEAPON_FIST, target); //damage type, should be generic? - int defense = target->GetDefense(0, 0, caster); + // ignore the armor bonus + int defense = target->GetDefense(0, WEAPON_BYPASS, caster); if(target->IsReverseToHit()) { fail = roll + defense < tohit; } else { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=47b53fd0227322281e76220bc165d6ba9bc09a3c commit 47b53fd0227322281e76220bc165d6ba9bc09a3c Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 21:52:17 2012 +0100 Actor::GetDefense: fixed brilliant (bypass) weapon handling diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 2d4a3ff..cdd0940 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -5921,7 +5921,14 @@ int Actor::GetDefense(int DamageType, ieDword wflags, Actor *attacker) } } - if (! (wflags&WEAPON_BYPASS)) { + if (wflags&WEAPON_BYPASS) { + if (ReverseToHit) { + // deflection is used to store the armor value in adnd + defense = AC.GetTotal() - AC.GetDeflectionBonus() - defense; + } else { + defense += AC.GetTotal() - AC.GetArmorBonus() - AC.GetShieldBonus(); + } + } else { if (ReverseToHit) { defense = AC.GetTotal()-defense; } else { http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=35e04cbc0a3a7f85106146d0079445d0e4eab1ec commit 35e04cbc0a3a7f85106146d0079445d0e4eab1ec Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 19:37:09 2012 +0100 overloaded Actor::GetArmorFailure to be able to set the two failure values diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 1777678..2d4a3ff 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -8915,6 +8915,13 @@ void Actor::ResetCommentTime() nextComment = game->GameTime + core->Roll(5, 1000, bored_time/2); } +// this one is just a hack, so we can keep a bunch of other functions const +int Actor::GetArmorFailure(int profcheck) const +{ + int tmp1, tmp2; + return GetArmorFailure(profcheck, tmp1, tmp2); +} + // Returns the armor check penalty. // used for mapping the iwd2 armor feat to the equipped armor's weight class // the armor weight class is roughly deduced from the penalty as following: @@ -8924,7 +8931,7 @@ void Actor::ResetCommentTime() // 7-, heavy: splint, plate, full plate // the values are taken from our dehardcoded itemdata.2da // FIXME: the penalites are too high, the items use a different value! -int Actor::GetArmorFailure(int profcheck) const +int Actor::GetArmorFailure(int profcheck, int &armor, int &shield) const { if (!third) return 0; @@ -8944,17 +8951,21 @@ int Actor::GetArmorFailure(int profcheck) const if (profcheck && GetFeat(FEAT_ARMOUR_PROFICIENCY) >= weightClass) { penalty = 0; } + armor = penalty; // check also the shield penalty armorType = inventory.GetShieldItemType(); int shieldPenalty = core->GetShieldPenalty(armorType); if (profcheck) { - if (!HasFeat(FEAT_SHIELD_PROF)) { + if (HasFeat(FEAT_SHIELD_PROF)) { + shieldPenalty = 0; + } else { penalty += shieldPenalty; } } else { penalty += shieldPenalty; } + shield = shieldPenalty; return -penalty; } diff --git a/gemrb/core/Scriptable/Actor.h b/gemrb/core/Scriptable/Actor.h index 8e3da19..4f3fdc9 100644 --- a/gemrb/core/Scriptable/Actor.h +++ b/gemrb/core/Scriptable/Actor.h @@ -833,6 +833,7 @@ public: void ResetCommentTime(); /* returns the armor check penalty */ int GetArmorFailure(int profcheck=1) const; + int GetArmorFailure(int profcheck, int &armor, int &shield) const; bool IsDead() const; bool IsInvisibleTo(Scriptable *checker) const; int UpdateAnimationID(bool derived); http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=3766b75f95d944db65f9ca00082815435122086e commit 3766b75f95d944db65f9ca00082815435122086e Author: Jaka Kranjc <lyn...@us...> Date: Mon Dec 24 19:25:54 2012 +0100 CombatInfo: disown the bonus application routine diff --git a/gemrb/core/CombatInfo.cpp b/gemrb/core/CombatInfo.cpp index 0fce366..b75cd25 100644 --- a/gemrb/core/CombatInfo.cpp +++ b/gemrb/core/CombatInfo.cpp @@ -28,6 +28,55 @@ namespace GemRB { static bool third = false; +/* + * Shared code between the classes + */ +static void SetBonusInternal(int& current, int bonus, int mod) +{ + int newBonus = current; + + switch (mod) { + case 0: // cummulative modifier + if (third) { + // 3ed boni don't stack + // but, use some extra logic so any negative boni first try to cancel out + int tmp = bonus; + if ((current < 0) ^ (bonus < 0)) { + tmp = current + bonus; + } + if (tmp != bonus) { + // we just summed the boni, so we need to be careful about the resulting sign, since (-2+3)>(-2), but abs(-2+3)<abs(-2) + if (tmp > current) { + newBonus = tmp; + } // else leave it be at the current value + } else { + if (abs(tmp) > abs(current)) { + newBonus = tmp; + } // else leave it be at the current value + } + } else { + newBonus += bonus; + } + break; + // like with other effects, the following options have chicked-and-egg problems and the result depends on the order of application + case 1: // flat modifier + newBonus = bonus; + break; + case 2: // percent modifier + newBonus = current * bonus / 100; + break; + default: + error("CombatInfo", "Bad bonus mod type: %d", mod); + break; + } + + current = newBonus; +} + + +/* + * Class holding the main armor class stat and general boni + */ ArmorClass::ArmorClass() { natural = 0; @@ -110,44 +159,7 @@ void ArmorClass::SetGenericBonus(int bonus, int mod) void ArmorClass::SetBonus(int& current, int bonus, int mod) { - int newBonus = current; - - switch (mod) { - case 0: // cummulative modifier - if (third) { - // 3ed boni don't stack - // but, use some extra logic so any negative boni first try to cancel out - int tmp = bonus; - if ((current < 0) ^ (bonus < 0)) { - tmp = current + bonus; - } - if (tmp != bonus) { - // we just summed the boni, so we need to be careful about the resulting sign, since (-2+3)>(-2), but abs(-2+3)<abs(-2) - if (tmp > current) { - newBonus = tmp; - } // else leave it be at the current value - } else { - if (abs(tmp) > abs(current)) { - newBonus = tmp; - } // else leave it be at the current value - } - } else { - newBonus += bonus; - } - break; - // like with other effects, the following options have chicked-and-egg problems and the result depends on the order of application - case 1: // flat modifier - newBonus = bonus; - break; - case 2: // percent modifier - newBonus = current * bonus / 100; - break; - default: - error("ArmorClass", "Bad bonus mod type: %d", mod); - break; - } - - current = newBonus; + SetBonusInternal(current, bonus, mod); RefreshTotal(); } ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |