Fix sound not played when being attacked by non-capture attacks.
Wrong assumptions on reviewing2627714c07
and7f7a3edfae
made it such that non-capture attacks did not play a being-attacked sound anymore. We only want a different sound when being captured. Differential revision: D3408 Tested by: @Stan This was SVN commit r24694.
This commit is contained in:
parent
214299b6c1
commit
f1de414a6d
@ -7,7 +7,6 @@ class AttackEffects
|
||||
{
|
||||
let effectsDataObj = {};
|
||||
this.effectReceivers = [];
|
||||
this.effectSounds = {};
|
||||
|
||||
for (let filename of Engine.ListDirectoryFiles("simulation/data/attack_effects", "*.json", false))
|
||||
{
|
||||
@ -28,7 +27,6 @@ class AttackEffects
|
||||
"IID": data.IID,
|
||||
"method": data.method
|
||||
});
|
||||
this.effectSounds[data.code] = data.sound || "";
|
||||
}
|
||||
|
||||
let effDataSort = (a, b) => a.order < b.order ? -1 : a.order > b.order ? 1 : 0;
|
||||
@ -39,7 +37,6 @@ class AttackEffects
|
||||
this.effectReceivers.sort(effSort);
|
||||
|
||||
deepfreeze(this.effectReceivers);
|
||||
deepfreeze(this.effectSounds);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -49,13 +46,4 @@ class AttackEffects
|
||||
{
|
||||
return this.effectReceivers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} type - The type of effect to get the receiving sound for.
|
||||
* @return {string} - The name of the soundgroup to play.
|
||||
*/
|
||||
GetSound(type)
|
||||
{
|
||||
return this.effectSounds[type] || "";
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,10 @@ AttackDetection.prototype.AttackAlert = function(target, attacker, type, attacke
|
||||
"targetIsDomesticAnimal": targetIsDomesticAnimal
|
||||
});
|
||||
|
||||
let soundGroup = g_AttackEffects.GetSound(type);
|
||||
let soundGroup = "attacked";
|
||||
if (type == "capture")
|
||||
soundGroup += "_capture";
|
||||
|
||||
if (attackerOwner === 0)
|
||||
soundGroup += "_gaia";
|
||||
|
||||
|
@ -4,6 +4,5 @@
|
||||
"IID": "IID_StatusEffectsReceiver",
|
||||
"method": "ApplyStatus",
|
||||
"name": "Apply Status",
|
||||
"order": 3,
|
||||
"sound": "attacked"
|
||||
"order": 3
|
||||
}
|
||||
|
@ -4,6 +4,5 @@
|
||||
"IID": "IID_Capturable",
|
||||
"method": "Capture",
|
||||
"name": "Capture",
|
||||
"order": 2,
|
||||
"sound": "attacked_capture"
|
||||
"order": 2
|
||||
}
|
||||
|
@ -4,6 +4,5 @@
|
||||
"IID": "IID_Health",
|
||||
"method": "TakeDamage",
|
||||
"name": "Damage",
|
||||
"order": 1,
|
||||
"sound": "attacked"
|
||||
"order": 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user