aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/gamemodes/cl_gamemode_hs.gnut
blob: 5ba571b23966be1d5df5008e52a77066618312d8 (plain)
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
87
88
89
90
91
92
93
global function ClGamemodeHideAndSeek_Init
global function ServerCallback_ShowHideAndSeekCountdown
global function ServerCallback_AnnounceHideAndSeekRole
global function ServerCallback_SeekersIncoming
global function ServerCallback_LastHiderAlive

struct {
	var countdownRui
} file

void function ClGamemodeHideAndSeek_Init()
{
	ClGameState_RegisterGameStateAsset( $"ui/gamestate_info_lts.rpak" )
	
	RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_1, "music_mp_fd_midwave", HIDEANDSEEK_TEAM_SEEKER )
	RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_1, "music_skyway_01_intro", HIDEANDSEEK_TEAM_HIDER )
	
	RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_2, "music_skyway_04_smartpistolrun", TEAM_IMC )
	RegisterLevelMusicForTeam( eMusicPieceID.GAMEMODE_2, "music_skyway_04_smartpistolrun", TEAM_MILITIA )
	
	AddCallback_GameStateEnter( eGameState.Postmatch, DisplayPostMatchTop3 )
}

void function ServerCallback_ShowHideAndSeekCountdown( float endTime )
{
	file.countdownRui = CreateCockpitRui( $"ui/dropship_intro_countdown.rpak", 0 )
	RuiSetResolutionToScreenSize( file.countdownRui )
	RuiSetGameTime( file.countdownRui, "gameStartTime", endTime )
}

void function ServerCallback_AnnounceHideAndSeekRole()
{
	if ( GetLocalViewPlayer().GetTeam() == HIDEANDSEEK_TEAM_SEEKER )
	{
		AnnouncementData announcement = Announcement_Create( "#HIDEANDSEEK_YOU_ARE_SEEKER" )
		Announcement_SetSubText( announcement, Localize( "#HIDEANDSEEK_SEEKER_DESC", GetCurrentPlaylistVarFloat( "hideandseek_hiding_time", 60.0 ).tostring() ) )
		Announcement_SetTitleColor( announcement, <0,0,1> )
		Announcement_SetPurge( announcement, true )
		Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc
		Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
		Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK )
		AnnouncementFromClass( GetLocalViewPlayer(), announcement )
	}
	else
	{
		AnnouncementData announcement = Announcement_Create( "#HIDEANDSEEK_YOU_ARE_HIDER" )
		Announcement_SetSubText( announcement, "#HIDEANDSEEK_HIDER_DESC" )
		Announcement_SetTitleColor( announcement, <0,0,1> )
		Announcement_SetPurge( announcement, true )
		Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc
		Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
		Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK )
		AnnouncementFromClass( GetLocalViewPlayer(), announcement )
	}
}

void function ServerCallback_SeekersIncoming()
{
	AnnouncementData announcement = Announcement_Create( "#HIDEANDSEEK_SEEKERS_INCOMING" )
	Announcement_SetSubText( announcement, "#HIDEANDSEEK_DONT_GET_FOUND" )
	Announcement_SetTitleColor( announcement, <1,0,0> )
	Announcement_SetPurge( announcement, true )
	Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc
	Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
	Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK )
	AnnouncementFromClass( GetLocalViewPlayer(), announcement )
}

void function ServerCallback_LastHiderAlive()
{
	if ( GetLocalViewPlayer().GetTeam() == HIDEANDSEEK_TEAM_SEEKER )
	{
		AnnouncementData announcement = Announcement_Create( Localize( "#HIDEANDSEEK_GET_LAST_HIDER", GetPlayerArrayOfTeam_Alive( HIDEANDSEEK_TEAM_HIDER )[ 0 ].GetPlayerName() ) )
		Announcement_SetTitleColor( announcement, <1,0,0> )
		Announcement_SetPurge( announcement, true )
		Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc
		Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
		Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK )
		AnnouncementFromClass( GetLocalViewPlayer(), announcement )
	}
	else
	{
		AnnouncementData announcement = Announcement_Create( "#HIDEANDSEEK_YOU_ARE_LAST_HIDER" )
		Announcement_SetSubText( announcement, "#HIDEANDSEEK_GOT_STIM" )
		Announcement_SetTitleColor( announcement, <1,0,0> )
		Announcement_SetPurge( announcement, true )
		Announcement_SetPriority( announcement, 200 ) //Be higher priority than Titanfall ready indicator etc
		Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
		Announcement_SetStyle( announcement, ANNOUNCEMENT_STYLE_QUICK )
		AnnouncementFromClass( GetLocalViewPlayer(), announcement )
	}
}