aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut
diff options
context:
space:
mode:
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut24
1 files changed, 22 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut
index 961816c7c..0fee4f2ce 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/conversation/_battle_chatter.gnut
@@ -4,14 +4,16 @@ global function TryPlayWeaponBattleChatterLine
void function BattleChatter_Init()
{
- //ShBattleChatter_Init()
+ AddCallback_OnPlayerGetsNewPilotLoadout( UpdatePlayerVoiceIndex )
}
void function PlayBattleChatterLine( entity player, string conversationType )
{
+ int conversationIndex = GetConversationIndex( conversationType )
+
foreach( entity otherPlayer in GetPlayerArray() )
if ( ShouldPlayBattleChatter( conversationType, otherPlayer, player ) && player != otherPlayer )
- Remote_CallFunction_NonReplay( otherPlayer, "ServerCallback_PlayBattleChatter", GetConversationIndex( conversationType ), player.GetEncodedEHandle() )
+ Remote_CallFunction_Replay( otherPlayer, "ServerCallback_PlayBattleChatter", conversationIndex, player.GetEncodedEHandle() )
}
void function TryPlayWeaponBattleChatterLine( entity player, entity weapon )
@@ -22,4 +24,22 @@ void function TryPlayWeaponBattleChatterLine( entity player, entity weapon )
expect string( chatterEvent )
PlayBattleChatterLine( player, chatterEvent )
+}
+
+void function UpdatePlayerVoiceIndex( entity player, PilotLoadoutDef voiceIndex )
+{
+ if ( IsPlayerFemale( player ) )
+ {
+ if ( player.IsMechanical() )
+ player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidFemaleBattleChatterVoice() )
+ else
+ player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomFemaleBattleChatterVoice() )
+ }
+ else
+ {
+ if ( player.IsMechanical() )
+ player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomAndroidMaleBattleChatterVoice() )
+ else
+ player.SetPlayerNetInt( "battleChatterVoiceIndex", SelectRandomMaleBattleChatterVoice() )
+ }
} \ No newline at end of file