Browse Source

Broken Item Sounds

pull/8392/head
Eric Robinson 3 months ago
parent
commit
85332b07d6
  1. 9
      Source/player.cpp
  2. 4
      Source/sound_effect_enums.h
  3. 4
      assets/txtdata/sound/effects.tsv

9
Source/player.cpp

@ -449,6 +449,7 @@ bool WeaponDecay(Player &player, int ii)
if (player.InvBody[ii]._iPLDam <= -100) {
RemoveEquipment(player, static_cast<inv_body_loc>(ii), true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeWeapon, player.position.tile);
return true;
}
CalcPlrInv(player, true);
@ -480,6 +481,7 @@ bool DamageWeapon(Player &player, unsigned damageFrequency)
if (player.InvBody[INVLOC_HAND_LEFT]._iDurability <= 0) {
RemoveEquipment(player, INVLOC_HAND_LEFT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeWeapon, player.position.tile);
return true;
}
}
@ -493,6 +495,7 @@ bool DamageWeapon(Player &player, unsigned damageFrequency)
if (player.InvBody[INVLOC_HAND_RIGHT]._iDurability == 0) {
RemoveEquipment(player, INVLOC_HAND_RIGHT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeWeapon, player.position.tile);
return true;
}
}
@ -506,6 +509,7 @@ bool DamageWeapon(Player &player, unsigned damageFrequency)
if (player.InvBody[INVLOC_HAND_RIGHT]._iDurability == 0) {
RemoveEquipment(player, INVLOC_HAND_RIGHT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeWeapon, player.position.tile);
return true;
}
}
@ -519,6 +523,7 @@ bool DamageWeapon(Player &player, unsigned damageFrequency)
if (player.InvBody[INVLOC_HAND_LEFT]._iDurability == 0) {
RemoveEquipment(player, INVLOC_HAND_LEFT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeWeapon, player.position.tile);
return true;
}
}
@ -932,6 +937,7 @@ void DamageParryItem(Player &player)
if (player.InvBody[INVLOC_HAND_LEFT]._iDurability == 0) {
RemoveEquipment(player, INVLOC_HAND_LEFT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeShield, player.position.tile);
}
}
@ -941,6 +947,7 @@ void DamageParryItem(Player &player)
if (player.InvBody[INVLOC_HAND_RIGHT]._iDurability == 0) {
RemoveEquipment(player, INVLOC_HAND_RIGHT, true);
CalcPlrInv(player, true);
PlaySfxLoc(SfxID::BrokeShield, player.position.tile);
}
}
}
@ -996,8 +1003,10 @@ void DamageArmor(Player &player)
if (targetHead) {
RemoveEquipment(player, INVLOC_HEAD, true);
PlaySfxLoc(SfxID::BrokeHelmet, player.position.tile);
} else {
RemoveEquipment(player, INVLOC_CHEST, true);
PlaySfxLoc(SfxID::BrokeArmor, player.position.tile);
}
CalcPlrInv(player, true);
}

4
Source/sound_effect_enums.h

@ -122,6 +122,7 @@ enum class SfxID : int16_t {
Swing2,
WarriorDeath,
QuestDone,
BrokeArmor,
BarrelExpload,
BarrelBreak,
ChestOpen,
@ -146,6 +147,7 @@ enum class SfxID : int16_t {
ItemStaffFlip,
ItemSwordFlip,
ItemGold,
BrokeHelmet,
ItemAnvil,
ItemAxe,
ItemBloodStone,
@ -170,6 +172,8 @@ enum class SfxID : int16_t {
OperateShrine1,
ReadBook,
Sarcophagus,
BrokeShield,
BrokeWeapon,
MenuMove,
MenuSelect,
TriggerTrap,

4
assets/txtdata/sound/effects.tsv

@ -6,6 +6,7 @@ Swing Misc sfx\misc\swing.wav
Swing2 Misc sfx\misc\swing2.wav
WarriorDeath Misc sfx\misc\dead.wav
QuestDone Stream sfx\misc\questdon.wav
BrokeArmor Misc sfx\items\armrfkd.wav
BarrelExpload Misc sfx\items\barlfire.wav
BarrelBreak Misc sfx\items\barrel.wav
ChestOpen Misc sfx\items\chest.wav
@ -30,6 +31,7 @@ ItemSignFlip Misc sfx\items\flipsign.wav
ItemStaffFlip Misc sfx\items\flipstaf.wav
ItemSwordFlip Misc sfx\items\flipswor.wav
ItemGold Misc sfx\items\gold.wav
BrokeHelmet Misc sfx\items\hlmtfkd.wav
ItemAnvil Misc sfx\items\invanvl.wav
ItemAxe Misc sfx\items\invaxe.wav
ItemBloodStone Misc sfx\items\invblst.wav
@ -54,6 +56,8 @@ OperateShrine Misc sfx\items\magic.wav
OperateShrine1 Misc sfx\items\magic1.wav
ReadBook Misc sfx\items\readbook.wav
Sarcophagus Misc sfx\items\sarc.wav
BrokeShield Misc sfx\items\shielfkd.wav
BrokeWeapon Misc sfx\items\Swrdfkd.wav
MenuMove Ui sfx\items\titlemov.wav
MenuSelect Ui sfx\items\titlslct.wav
TriggerTrap Misc sfx\items\trap.wav

1 id flags path
6 Swing2 Misc sfx\misc\swing2.wav
7 WarriorDeath Misc sfx\misc\dead.wav
8 QuestDone Stream sfx\misc\questdon.wav
9 BrokeArmor Misc sfx\items\armrfkd.wav
10 BarrelExpload Misc sfx\items\barlfire.wav
11 BarrelBreak Misc sfx\items\barrel.wav
12 ChestOpen Misc sfx\items\chest.wav
31 ItemStaffFlip Misc sfx\items\flipstaf.wav
32 ItemSwordFlip Misc sfx\items\flipswor.wav
33 ItemGold Misc sfx\items\gold.wav
34 BrokeHelmet Misc sfx\items\hlmtfkd.wav
35 ItemAnvil Misc sfx\items\invanvl.wav
36 ItemAxe Misc sfx\items\invaxe.wav
37 ItemBloodStone Misc sfx\items\invblst.wav
56 OperateShrine1 Misc sfx\items\magic1.wav
57 ReadBook Misc sfx\items\readbook.wav
58 Sarcophagus Misc sfx\items\sarc.wav
59 BrokeShield Misc sfx\items\shielfkd.wav
60 BrokeWeapon Misc sfx\items\Swrdfkd.wav
61 MenuMove Ui sfx\items\titlemov.wav
62 MenuSelect Ui sfx\items\titlslct.wav
63 TriggerTrap Misc sfx\items\trap.wav
Loading…
Cancel
Save