Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_DeathMusic.c
Go to the documentation of this file.
1
class
SCR_DeathMusic
:
ScriptedMusic
2
{
3
MusicManager m_MusicManager;
4
5
//~ When the player died
6
protected
void
OnPlayerDied
(notnull
SCR_InstigatorContextData
instigatorContextData)
7
{
8
if
(instigatorContextData.GetVictimPlayerID() !=
SCR_PlayerController
.
GetLocalPlayerId
())
9
return
;
10
11
m_MusicManager.Play(
SCR_SoundEvent
.SOUND_ONDEATH);
12
}
13
14
override
void
Init
()
15
{
16
ChimeraWorld
world =
GetGame
().GetWorld();
17
18
if
(!world)
19
return
;
20
21
m_MusicManager = world.GetMusicManager();
22
if
(!m_MusicManager)
23
return
;
24
25
//~ On player spawned and died register
26
SCR_BaseGameMode
gameMode =
SCR_BaseGameMode
.Cast(
GetGame
().
GetGameMode
());
27
if
(gameMode)
28
{
29
gameMode.
GetOnPlayerKilled
().Insert(
OnPlayerDied
);
30
}
31
32
}
33
34
override
void
OnDelete
()
35
{
36
SCR_BaseGameMode
gameMode =
SCR_BaseGameMode
.Cast(
GetGame
().
GetGameMode
());
37
if
(gameMode)
38
{
39
gameMode.
GetOnPlayerKilled
().Remove(
OnPlayerDied
);
40
}
41
}
42
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
ChimeraWorld
Definition
ChimeraWorld.c:13
SCR_BaseGameMode
Definition
SCR_BaseGameMode.c:139
SCR_BaseGameMode::GetOnPlayerKilled
ScriptInvokerBase< SCR_BaseGameMode_OnControllableDestroyed > GetOnPlayerKilled()
Definition
SCR_BaseGameMode.c:633
SCR_DeathMusic
Definition
SCR_DeathMusic.c:2
SCR_DeathMusic::OnDelete
override void OnDelete()
Definition
SCR_DeathMusic.c:34
SCR_DeathMusic::Init
override void Init()
Definition
SCR_DeathMusic.c:14
SCR_DeathMusic::OnPlayerDied
void OnPlayerDied(notnull SCR_InstigatorContextData instigatorContextData)
Definition
SCR_DeathMusic.c:6
SCR_InstigatorContextData
Definition
SCR_InstigatorContextData.c:2
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalPlayerId
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Definition
SCR_PlayerController.c:481
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
ScriptedMusic
Definition
ScriptedMusic.c:13
scripts
Game
Music
SCR_DeathMusic.c
Generated by
1.17.0