-
Notifications
You must be signed in to change notification settings - Fork 1
/
ME5_KillSounds.lua
86 lines (75 loc) · 2.68 KB
/
ME5_KillSounds.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
-----------------------------------------------------------------
-----------------------------------------------------------------
-- MASS EFFECT: UNIFICATION Kill Sounds Script by Aaron Gilbert
-- Build 31205/06
-- Screen Names: Marth8880, GT-Marth8880, [GT] Marth8880, [GT] Bran
-- E-Mail: [email protected]
-- Dec 5, 2016
-- Copyright (c) 2017, Aaron Gilbert All rights reserved.
--
-- About:
-- This script contains various functions regarding kill sounds.
--
--
-- Usage:
-- Simply call Init_HealthFunc() anywhere in ScriptInit().
--
--
-- Legal:
-- This script is licensed under the BSD 3-Clause License. A copy of this license (as LICENSE.md) should have been included
-- with this script. If it wasn't, it can also be found here: https://www.w3.org/Consortium/Legal/2008/03-bsd-license.html
--
-- THIS SCRIPT IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY LUCASARTS, A DIVISION OF LUCASFILM ENTERTAINMENT COMPANY LTD.
-----------------------------------------------------------------
-----------------------------------------------------------------
local __SCRIPT_NAME = "ME5_KillSounds";
local debug = true
local function PrintLog(...)
if debug == true then
print("["..__SCRIPT_NAME.."]", unpack(arg));
end
end
PrintLog("Entered")
---
-- Sets up the event responses for kill sounds.
--
function Init_KillSounds()
PrintLog("Init_KillSounds(): Entered")
if not ScriptCB_InMultiplayer() then
if ME5_KillSound == 0 then
PrintLog("Init_KillSounds(): Initializing kill sound setting for DISABLED...")
else
PrintLog("Init_KillSounds(): Initializing kill sound setting for ENABLED...")
local enemydeath = OnCharacterDeath(
function(player, killer)
-- Exit immediately if there are incorrect values
if not player then return end
if not killer then return end
if killer and IsCharacterHuman(killer) then
local playerTeam = GetCharacterTeam(player)
local killerTeam = GetCharacterTeam(killer)
-- Was the killed unit's team different from the killer's?
if playerTeam ~= killerTeam then
-- Is this not a campaign?
if not IsCampaign() then
ScriptCB_SndPlaySound("hud_player_kill")
else
local world = string.lower(GetWorldFilename())
-- Are we on Europa?
if world == "eur" then
-- Is the victim team not the squad team?
if playerTeam ~= 3 then
ScriptCB_SndPlaySound("hud_player_kill")
end
end
end
end
end
end
)
end
else
PrintLog("Init_KillSounds(): Initializing kill sound setting for DISABLED...")
end
end
PrintLog("Exited")