From: Laszlo T. <ave...@us...> - 2011-12-30 14:28:45
|
gemrb: Infinity Engine emulator The branch master has been updated via fa55c90d23710321ad4a2dd0b7d0716fba3f0083 (commit) Summary of changes: gemrb/core/Scriptable/Actor.cpp | 49 ++++++++++++++++++++++++++------------ gemrb/core/damages.h | 3 +- 2 files changed, 35 insertions(+), 17 deletions(-) from 412a4864dd1634818c8e5053d4ab5cec12f07afc (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=fa55c90d23710321ad4a2dd0b7d0716fba3f0083 commit fa55c90d23710321ad4a2dd0b7d0716fba3f0083 Author: Avenger <ave...@so...> Date: Fri Dec 30 15:27:58 2011 +0100 hit sounds for all games, not just PST diff --git a/gemrb/core/Scriptable/Actor.cpp b/gemrb/core/Scriptable/Actor.cpp index 42c6852..8f4d582 100644 --- a/gemrb/core/Scriptable/Actor.cpp +++ b/gemrb/core/Scriptable/Actor.cpp @@ -3385,11 +3385,9 @@ void Actor::DisplayCombatFeedback (unsigned int damage, int resisted, int damage } } - //PST hit sounds + //Play hit sounds, for pst, resdata contains the armor level DataFileMgr *resdata = core->GetResDataINI(); - if (resdata) { - PlayHitSound(resdata, damagetype, false); - } + PlayHitSound(resdata, damagetype, false); } void Actor::PlayWalkSound() @@ -3416,33 +3414,52 @@ void Actor::PlayWalkSound() nextWalk = thisTime + len; } -//Play PST specific hit sounds (HIT_0<dtype><armor>) +//Play hit sounds (HIT_0<dtype><armor>) void Actor::PlayHitSound(DataFileMgr *resdata, int damagetype, bool suffix) { int type; + bool levels = true; switch(damagetype) { - case DAMAGE_SLASHING: type = 1; break; //slashing - case DAMAGE_PIERCING: type = 2; break; //piercing + case DAMAGE_PIERCING: type = 1; break; //piercing + case DAMAGE_SLASHING: type = 2; break; //slashing case DAMAGE_CRUSHING: type = 3; break; //crushing case DAMAGE_MISSILE: type = 4; break; //missile + case DAMAGE_ELECTRICITY: type = 5; levels = false; break; //electricity + case DAMAGE_COLD: type = 6; levels = false; break; //cold + case DAMAGE_MAGIC: type = 7; levels = false; break; + case DAMAGE_STUNNING: type = -3; break; default: return; //other } ieResRef Sound; - char section[12]; - unsigned int animid=BaseStats[IE_ANIMATION_ID]; - if(core->HasFeature(GF_ONE_BYTE_ANIMID)) { - animid&=0xff; - } + int armor = 0; - snprintf(section,10,"%d", animid); + if (resdata) { + char section[12]; + unsigned int animid=BaseStats[IE_ANIMATION_ID]; + if(core->HasFeature(GF_ONE_BYTE_ANIMID)) { + animid&=0xff; + } - int armor = resdata->GetKeyAsInt(section, "armor",0); - if (armor<0 || armor>35) return; + snprintf(section,10,"%d", animid); - snprintf(Sound,8,"HIT_0%d%c%c",type, armor+'A', suffix?'1':0); + armor = resdata->GetKeyAsInt(section, "armor",0); + if (armor<0 || armor>35) return; + } else { + //hack for stun (always first armortype) + if (type<0) { + type = -type; + } else { + armor = Modified[IE_ARMOR_TYPE]; + } + } + if (levels) { + snprintf(Sound,8,"HIT_0%d%c%c",type, armor+'A', suffix?'1':0); + } else { + snprintf(Sound,8,"HIT_0%d%c",type, suffix?'1':0); + } core->GetAudioDrv()->Play( Sound,Pos.x,Pos.y ); } diff --git a/gemrb/core/damages.h b/gemrb/core/damages.h index adb20cc..b778616 100644 --- a/gemrb/core/damages.h +++ b/gemrb/core/damages.h @@ -33,11 +33,12 @@ #define DAMAGE_MISSILE 0x80 #define DAMAGE_SLASHING 0x100 #define DAMAGE_MAGICFIRE 0x200 -#define DAMAGE_PIERCINGMISSILE 0x400 //iwd2 +#define DAMAGE_PIERCINGMISSILE 0x200 //iwd2 #define DAMAGE_MAGICCOLD 0x400 #define DAMAGE_CRUSHINGMISSILE 0x400 //iwd2 #define DAMAGE_STUNNING 0x800 #define DAMAGE_SOULEATER 0x1000 //iwd2 +#define DAMAGE_BLEEDING 0x2000 //iwd2 #define DAMAGE_DISEASE 0x4000 //iwd2 #define DAMAGE_CHUNKING 0x8000 ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |