From 4ffa9249290fd8d8782d4da28f90864922fc4027 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 12 Sep 2008 01:12:40 +0000 Subject: [PATCH] - Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, and when they were fully assembled, they did not play the sound across the entire level. SVN r1213 (trunk) --- docs/rh-log.txt | 3 +++ src/g_shared/a_pickups.cpp | 22 +++++++++++++++---- src/g_shared/a_pickups.h | 1 + src/g_shared/a_weaponpiece.cpp | 10 +++++++-- src/thingdef/thingdef_properties.cpp | 1 + wadsrc/static/actors/hexen/clericholy.txt | 13 +++++------ wadsrc/static/actors/hexen/fighterquietus.txt | 14 ++++++------ wadsrc/static/actors/hexen/magestaff.txt | 14 ++++++------ 8 files changed, 51 insertions(+), 27 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index c5fb39422..e11b64b36 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ September 11, 2008 +- Fixed: Hexen's fourth weapon pieces did not play the correct pickup sound, + and when they were fully assembled, they did not play the sound across the + entire level. - Antialiasing of lines is now controlled solely by the vid_hwaalines cvar, ignoring what the driver reports, since ATI is apparently just as bad as NVidia. diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 3724be6ef..e555bd394 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -981,10 +981,24 @@ const char *AInventory::PickupMessage () void AInventory::PlayPickupSound (AActor *toucher) { - S_Sound (toucher, CHAN_PICKUP, PickupSound, 1, - (ItemFlags & IF_FANCYPICKUPSOUND) && - (toucher == NULL || toucher->CheckLocalView (consoleplayer)) - ? ATTN_NONE : ATTN_NORM); + float atten; + + if (ItemFlags & IF_NOATTENPICKUPSOUND) + { + atten = ATTN_NONE; + } +#if 0 + else if ((ItemFlags & IF_FANCYPICKUPSOUND) && + (toucher == NULL || toucher->CheckLocalView(consoeplayer))) + { + atten = ATTN_NONE; + } +#endif + else + { + atten = ATTN_NORM; + } + S_Sound (toucher, CHAN_PICKUP, PickupSound, 1, atten); } //=========================================================================== diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index a9e2254f8..e97d792bb 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -99,6 +99,7 @@ enum IF_IGNORESKILL = 1<<14, // Ignores any skill related multiplicators when giving this item. IF_CREATECOPYMOVED = 1<<15, // CreateCopy changed the owner (copy's Owner field holds new owner). IF_INITEFFECTFAILED = 1<<16, // CreateCopy tried to activate a powerup and activation failed (can happen with PowerMorph) + IF_NOATTENPICKUPSOUND = 1<<17, // Play pickup sound with ATTN_NONE }; struct vissprite_t; diff --git a/src/g_shared/a_weaponpiece.cpp b/src/g_shared/a_weaponpiece.cpp index a2934cfa0..6167b40f4 100644 --- a/src/g_shared/a_weaponpiece.cpp +++ b/src/g_shared/a_weaponpiece.cpp @@ -146,7 +146,13 @@ const char *AWeaponPiece::PickupMessage () void AWeaponPiece::PlayPickupSound (AActor *toucher) { - if (FullWeapon) FullWeapon->PlayPickupSound(toucher); - else Super::PlayPickupSound(toucher); + if (FullWeapon) + { + FullWeapon->PlayPickupSound(toucher); + } + else + { + Super::PlayPickupSound(toucher); + } } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index ce06ef020..4d88de35c 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -284,6 +284,7 @@ static flagdef InventoryFlags[] = DEFINE_FLAG(IF, KEEPDEPLETED, AInventory, ItemFlags), DEFINE_FLAG(IF, IGNORESKILL, AInventory, ItemFlags), DEFINE_FLAG(IF, ADDITIVETIME, AInventory, ItemFlags), + DEFINE_FLAG(IF, NOATTENPICKUPSOUND, AInventory, ItemFlags), DEFINE_DEPRECATED_FLAG(PICKUPFLASH), diff --git a/wadsrc/static/actors/hexen/clericholy.txt b/wadsrc/static/actors/hexen/clericholy.txt index a717c0cd3..41224024a 100644 --- a/wadsrc/static/actors/hexen/clericholy.txt +++ b/wadsrc/static/actors/hexen/clericholy.txt @@ -3,7 +3,10 @@ ACTOR ClericWeaponPiece : WeaponPiece native { + Inventory.PickupSound "misc/w_pkup" Inventory.PickupMessage "$TXT_WRAITHVERGE_PIECE" + WeaponPiece.Weapon CWeapWraithverge + +FLOATBOB } // Cleric Weapon Piece 1 ---------------------------------------------------- @@ -12,10 +15,7 @@ ACTOR CWeaponPiece1 : ClericWeaponPiece 18 { Game Hexen SpawnID 33 - +FLOATBOB - Inventory.PickupMessage "$TXT_WRAITHVERGE_PIECE" WeaponPiece.Number 1 - WeaponPiece.Weapon CWeapWraithverge States { Spawn: @@ -26,11 +26,10 @@ ACTOR CWeaponPiece1 : ClericWeaponPiece 18 // Cleric Weapon Piece 2 ---------------------------------------------------- -ACTOR CWeaponPiece2 : CWeaponPiece1 19 +ACTOR CWeaponPiece2 : ClericWeaponPiece 19 { Game Hexen SpawnID 34 - +FLOATBOB WeaponPiece.Number 2 States { @@ -42,11 +41,10 @@ ACTOR CWeaponPiece2 : CWeaponPiece1 19 // Cleric Weapon Piece 3 ---------------------------------------------------- -ACTOR CWeaponPiece3 : CWeaponPiece1 20 +ACTOR CWeaponPiece3 : ClericWeaponPiece 20 { Game Hexen SpawnID 35 - +FLOATBOB WeaponPiece.Number 3 States { @@ -76,6 +74,7 @@ ACTOR CWeapWraithverge : ClericWeapon native Health 3 Weapon.SelectionOrder 3000 +WEAPON.PRIMARY_USES_BOTH + +Inventory.NoAttenPickupSound Weapon.AmmoUse1 18 Weapon.AmmoUse2 18 Weapon.AmmoGive1 20 diff --git a/wadsrc/static/actors/hexen/fighterquietus.txt b/wadsrc/static/actors/hexen/fighterquietus.txt index 7f64cca28..176796219 100644 --- a/wadsrc/static/actors/hexen/fighterquietus.txt +++ b/wadsrc/static/actors/hexen/fighterquietus.txt @@ -3,6 +3,10 @@ ACTOR FighterWeaponPiece : WeaponPiece native { + Inventory.PickupSound "misc/w_pkup" + Inventory.PickupMessage "$TXT_QUIETUS_PIECE" + WeaponPiece.Weapon FWeapQuietus + +FLOATBOB } // Fighter Weapon Piece 1 --------------------------------------------------- @@ -11,10 +15,7 @@ ACTOR FWeaponPiece1 : FighterWeaponPiece 12 { Game Hexen SpawnID 29 - Inventory.PickupMessage "$TXT_QUIETUS_PIECE" WeaponPiece.Number 1 - WeaponPiece.Weapon FWeapQuietus - +FLOATBOB States { Spawn: @@ -25,12 +26,11 @@ ACTOR FWeaponPiece1 : FighterWeaponPiece 12 // Fighter Weapon Piece 2 --------------------------------------------------- -ACTOR FWeaponPiece2 : FWeaponPiece1 13 +ACTOR FWeaponPiece2 : FighterWeaponPiece 13 { Game Hexen SpawnID 30 WeaponPiece.Number 2 - +FLOATBOB States { Spawn: @@ -41,12 +41,11 @@ ACTOR FWeaponPiece2 : FWeaponPiece1 13 // Fighter Weapon Piece 3 --------------------------------------------------- -ACTOR FWeaponPiece3 : FWeaponPiece1 16 +ACTOR FWeaponPiece3 : FighterWeaponPiece 16 { Game Hexen SpawnID 31 WeaponPiece.Number 3 - +FLOATBOB States { Spawn: @@ -75,6 +74,7 @@ ACTOR FWeapQuietus : FighterWeapon Health 3 Weapon.SelectionOrder 2900 +WEAPON.PRIMARY_USES_BOTH + +Inventory.NoAttenPickupSound Weapon.AmmoUse1 14 Weapon.AmmoUse2 14 Weapon.AmmoGive1 20 diff --git a/wadsrc/static/actors/hexen/magestaff.txt b/wadsrc/static/actors/hexen/magestaff.txt index 5a288f45d..52a18d09b 100644 --- a/wadsrc/static/actors/hexen/magestaff.txt +++ b/wadsrc/static/actors/hexen/magestaff.txt @@ -3,6 +3,10 @@ ACTOR MageWeaponPiece : WeaponPiece native { + Inventory.PickupSound "misc/w_pkup" + Inventory.PickupMessage "$TXT_BLOODSCOURGE_PIECE" + WeaponPiece.Weapon MWeapBloodscourge + +FLOATBOB } // Mage Weapon Piece 1 ------------------------------------------------------ @@ -11,10 +15,7 @@ ACTOR MWeaponPiece1 : MageWeaponPiece 21 { Game Hexen SpawnID 37 - +FLOATBOB - Inventory.PickupMessage "$TXT_BLOODSCOURGE_PIECE" WeaponPiece.Number 1 - WeaponPiece.Weapon MWeapBloodscourge States { Spawn: @@ -25,11 +26,10 @@ ACTOR MWeaponPiece1 : MageWeaponPiece 21 // Mage Weapon Piece 2 ------------------------------------------------------ -ACTOR MWeaponPiece2 : MWeaponPiece1 22 +ACTOR MWeaponPiece2 : MageWeaponPiece 22 { Game Hexen SpawnID 38 - +FLOATBOB WeaponPiece.Number 2 States { @@ -41,11 +41,10 @@ ACTOR MWeaponPiece2 : MWeaponPiece1 22 // Mage Weapon Piece 3 ------------------------------------------------------ -ACTOR MWeaponPiece3 : MWeaponPiece1 23 +ACTOR MWeaponPiece3 : MageWeaponPiece 23 { Game Hexen SpawnID 39 - +FLOATBOB WeaponPiece.Number 3 States { @@ -83,6 +82,7 @@ ACTOR MWeapBloodscourge : MageWeapon native Weapon.AmmoType1 "Mana1" Weapon.AmmoType2 "Mana2" +WEAPON.PRIMARY_USES_BOTH + +Inventory.NoAttenPickupSound Inventory.PickupMessage "$TXT_WEAPON_M4" Inventory.PickupSound "WeaponBuild"