aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod
diff options
context:
space:
mode:
authorJMM889901 <41163714+JMM889901@users.noreply.github.com>2022-11-12 14:15:03 +0000
committerGeckoEidechse <gecko.eidechse+git@pm.me>2022-11-12 23:12:24 +0100
commit74f0ee8b5807e2c46541cdbc3460165200051b07 (patch)
treefdc5751265d40aa12cc3974d33509936fcafa513 /Northstar.Client/mod
parent7c30c44d2bfea9cf64a374f690a23a6e6eb1165b (diff)
downloadNorthstarMods-temp/respawn-test.tar.gz
NorthstarMods-temp/respawn-test.zip
Add eject quotes (#527)temp/respawn-test
* Upload cl_titan_cockpit.nut * Add eject string in script * Moved to client * index issue + removed else so always returns * Apply suggestions from code review Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> * Rest of the suggestions because github makes me want to cry * Commit suggestions from review GitHub really hates batching suggestions Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com>
Diffstat (limited to 'Northstar.Client/mod')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/client/cl_titan_cockpit.nut35
1 files changed, 29 insertions, 6 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/client/cl_titan_cockpit.nut b/Northstar.Client/mod/scripts/vscripts/client/cl_titan_cockpit.nut
index 828f3056..4df1af42 100644
--- a/Northstar.Client/mod/scripts/vscripts/client/cl_titan_cockpit.nut
+++ b/Northstar.Client/mod/scripts/vscripts/client/cl_titan_cockpit.nut
@@ -36,6 +36,11 @@ global function UpdateEjectHud_SetButtonPressTime
global function UpdateEjectHud_SetButtonPressCount
global function SetUnlimitedDash
+
+// Added by northstar
+global function AddCommonEjectMessage
+global function AddRareEjectMessage
+
#if MP
global function NetworkedVarChangedCallback_UpdateVanguardRUICoreStatus
global function DisplayFrontierRank
@@ -71,6 +76,9 @@ struct
bool isFirstBoot = true
var scorchHotstreakRui
+ // Added by northstar
+ array<string> moddedRareEjectMessages
+ array<string> moddedCommonEjectMessages
} file
function ClTitanCockpit_Init()
@@ -1007,6 +1015,16 @@ void function PlayerPressed_Eject( entity player )
PlayerEjects( player, cockpit )
}
+void function AddCommonEjectMessage( string message )
+{
+ file.moddedCommonEjectMessages.append( message )
+}
+
+void function AddRareEjectMessage( string message )
+{
+ file.moddedRareEjectMessages.append( message )
+}
+
string function RollRandomEjectString()
{
const int COCKPIT_EJECT_COMMON_COUNT = 6
@@ -1016,14 +1034,19 @@ string function RollRandomEjectString()
float randForType = RandomFloat( 1.0 )
if ( randForType < CHANCE_FOR_RARE )
{
- int index = RandomInt( COCKPIT_EJECT_RARE_COUNT )
- string result = "#COCKPIT_EJECT_RARE_" + index
- return result
+ int index = RandomInt( COCKPIT_EJECT_RARE_COUNT + file.moddedRareEjectMessages.len() )
+ if ( index < COCKPIT_EJECT_RARE_COUNT )
+ return "#COCKPIT_EJECT_RARE_" + index
+ else
+ return file.moddedRareEjectMessages[index - COCKPIT_EJECT_RARE_COUNT]
}
- int index = RandomInt( COCKPIT_EJECT_COMMON_COUNT )
- string result = "#COCKPIT_EJECT_COMMON_" + index
- return result
+ int index = RandomInt( COCKPIT_EJECT_COMMON_COUNT + file.moddedCommonEjectMessages.len() )
+ if ( index < COCKPIT_EJECT_COMMON_COUNT )
+ return "#COCKPIT_EJECT_COMMON_" + index
+ else
+ return file.moddedCommonEjectMessages[index - COCKPIT_EJECT_COMMON_COUNT]
+
}
void function PlayerEjects( entity player, entity cockpit ) //Note that this can be run multiple times in a frame, e.g. get damaged by 4 pellets of a shotgun that brings the Titan into a doomed state with auto eject. Not ideal