@@ -10,20 +10,20 @@ g_bool_TechKill <- false; // Not actually being used 没有实际用处
1010IncludeScript (" challenge_traitors_enums.nut" ); // Enum types 枚举类型
1111IncludeScript (" challenge_traitors_random.nut" ); // Random number lib 随机数相关函数
1212IncludeScript (" challenge_traitors_localize.nut" ); // Localization related 本地化函数
13- IncludeScript (" traitors_challenge_translations_all .nut" ); // Localization strings 翻译文本
14- IncludeScript (" traitors_client_shared .nut" ); // Shared functions for client side UI UI公用函数
13+ IncludeScript (" challenge_traitors_translations_all .nut" ); // Localization strings 翻译文本
14+ IncludeScript (" challenge_traitors_client_shared .nut" ); // Shared functions for client side UI UI公用函数
1515IncludeScript (" challenge_traitors_map_handler.nut" ); // Handles edge cases of different maps处理地图的特殊情况
1616// Events 事件
17- IncludeScript (" traitors_events /ongameevent_heal_beacon_placed.nut" );
18- IncludeScript (" traitors_events /ongameevent_entity_killed.nut" );
19- IncludeScript (" traitors_events /ongameevent_flare_placed.nut" );
20- IncludeScript (" traitors_events /ongameevent_marine_selected.nut" );
21- IncludeScript (" traitors_events /ongameevent_mission_success_or_fail.nut" );
22- IncludeScript (" traitors_events /ongameevent_player_fullyjoined.nut" );
23- IncludeScript (" traitors_events /ongameevent_weapon_fire.nut" );
24- IncludeScript (" traitors_events /ongameevent_weapon_reload.nut" );
25- IncludeScript (" traitors_events /OnReceivedTextMessage.nut" );
26- IncludeScript (" traitors_events /OnTakeDamage_Alive_Any.nut" );
17+ IncludeScript (" challenge_traitors_events /ongameevent_heal_beacon_placed.nut" );
18+ IncludeScript (" challenge_traitors_events /ongameevent_entity_killed.nut" );
19+ IncludeScript (" challenge_traitors_events /ongameevent_flare_placed.nut" );
20+ IncludeScript (" challenge_traitors_events /ongameevent_marine_selected.nut" );
21+ IncludeScript (" challenge_traitors_events /ongameevent_mission_success_or_fail.nut" );
22+ IncludeScript (" challenge_traitors_events /ongameevent_player_fullyjoined.nut" );
23+ IncludeScript (" challenge_traitors_events /ongameevent_weapon_fire.nut" );
24+ IncludeScript (" challenge_traitors_events /ongameevent_weapon_reload.nut" );
25+ IncludeScript (" challenge_traitors_events /OnReceivedTextMessage.nut" );
26+ IncludeScript (" challenge_traitors_events /OnTakeDamage_Alive_Any.nut" );
2727
2828
2929// Role variables / arrays / tables 角色相关的变量等
@@ -300,10 +300,14 @@ function DropWeapon() {
300300 default :
301301 }
302302 if (veryHighDamageWeaponCount >= 2 || highFiringRateWeaponCount >= 2 || accurateWeaponCount >= 2 ) {
303- hMarine. DropWeapon (1 );
304- local hPlayer = hMarine. GetCommander ();
305- local strLanguage = GetClientLanguage (hPlayer. entindex ());
306- LocalizedClientPrint (hPlayer, 3 , GetLocalizedString (" #challenge_traitors_drop_weapon_notify" , strLanguage));
303+ if (hMarine != null && hMarine. IsValid ()) {
304+ hMarine. DropWeapon (1 );
305+ local hPlayer = hMarine. GetCommander ();
306+ if (hPlayer != null && hPlayer. IsValid ()) {
307+ local strLanguage = GetClientLanguage (hPlayer. entindex ());
308+ LocalizedClientPrint (hPlayer, 3 , GetLocalizedString (" #challenge_traitors_drop_weapon_notify" , strLanguage));
309+ }
310+ }
307311 }
308312 }
309313 }
@@ -409,7 +413,7 @@ function RefreshMenu(hMarine) {
409413 hVGuiRefresh. Destroy ();
410414 }
411415 hVGuiRefresh = Entities. CreateByClassname (" rd_vgui_vscript" );
412- hVGuiRefresh. __KeyValueFromString (" client_vscript" , " traitors_client_refresh_menu .nut" );
416+ hVGuiRefresh. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_refresh_menu .nut" );
413417 hVGuiRefresh. ValidateScriptScope ();
414418 hVGuiRefresh. GetScriptScope (). Input <- Input;
415419 hVGuiRefresh. Spawn ();
@@ -1572,7 +1576,7 @@ function CreateScannerVGui(hMarine) {
15721576 local strLanguage = GetClientLanguage (hMarine. GetCommander (). entindex ());
15731577 local hVGuiBackground = Entities. CreateByClassname (" rd_vgui_vscript" );
15741578 g_ent_HudAndVGui. append (hVGuiBackground);
1575- hVGuiBackground. __KeyValueFromString (" client_vscript" , " traitors_client_scanner_background .nut" );
1579+ hVGuiBackground. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_scanner_background .nut" );
15761580 hVGuiBackground. ValidateScriptScope ();
15771581 hVGuiBackground. GetScriptScope (). Input <- Input;
15781582 hVGuiBackground. Spawn ();
@@ -1599,7 +1603,7 @@ function CreateScannerVGui(hMarine) {
15991603 foreach (tempMarine in g_marine_Total_Unshuffled) {
16001604 local hVGuiButton = Entities. CreateByClassname (" rd_vgui_vscript" );
16011605 g_ent_HudAndVGui. append (hVGuiButton);
1602- hVGuiButton. __KeyValueFromString (" client_vscript" , " traitors_client_scanner_button .nut" );
1606+ hVGuiButton. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_scanner_button .nut" );
16031607 hVGuiButton. ValidateScriptScope ();
16041608 hVGuiButton. GetScriptScope (). Input <- Input;
16051609 hVGuiButton. Spawn ();
@@ -1643,7 +1647,7 @@ function CreateSilencerVGui(hMarine) {
16431647 local strLanguage = GetClientLanguage (hMarine. GetCommander (). entindex ());
16441648 local hVGuiBackground = Entities. CreateByClassname (" rd_vgui_vscript" );
16451649 g_ent_HudAndVGui. append (hVGuiBackground);
1646- hVGuiBackground. __KeyValueFromString (" client_vscript" , " traitors_client_silencer_background .nut" );
1650+ hVGuiBackground. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_silencer_background .nut" );
16471651 hVGuiBackground. ValidateScriptScope ();
16481652 hVGuiBackground. GetScriptScope (). Input <- Input;
16491653 hVGuiBackground. Spawn ();
@@ -1669,7 +1673,7 @@ function CreateSilencerVGui(hMarine) {
16691673 foreach (tempMarine in g_marine_Total_Unshuffled) {
16701674 local hVGuiButton = Entities. CreateByClassname (" rd_vgui_vscript" );
16711675 g_ent_HudAndVGui. append (hVGuiButton);
1672- hVGuiButton. __KeyValueFromString (" client_vscript" , " traitors_client_silencer_button .nut" );
1676+ hVGuiButton. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_silencer_button .nut" );
16731677 hVGuiButton. ValidateScriptScope ();
16741678 hVGuiButton. GetScriptScope (). Input <- Input;
16751679 hVGuiButton. Spawn ();
@@ -1711,7 +1715,7 @@ function CreateShieldVGui(hMarine) {
17111715 local strLanguage = GetClientLanguage (hMarine. GetCommander (). entindex ());
17121716 local hVGuiBackground = Entities. CreateByClassname (" rd_vgui_vscript" );
17131717 g_ent_HudAndVGui. append (hVGuiBackground);
1714- hVGuiBackground. __KeyValueFromString (" client_vscript" , " traitors_client_shield_background .nut" );
1718+ hVGuiBackground. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_shield_background .nut" );
17151719 hVGuiBackground. ValidateScriptScope ();
17161720 hVGuiBackground. GetScriptScope (). Input <- Input;
17171721 hVGuiBackground. Spawn ();
@@ -1737,7 +1741,7 @@ function CreateShieldVGui(hMarine) {
17371741 foreach (tempMarine in g_marine_Total_Unshuffled) {
17381742 local hVGuiButton = Entities. CreateByClassname (" rd_vgui_vscript" );
17391743 g_ent_HudAndVGui. append (hVGuiButton);
1740- hVGuiButton. __KeyValueFromString (" client_vscript" , " traitors_client_shield_button .nut" );
1744+ hVGuiButton. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_shield_button .nut" );
17411745 hVGuiButton. ValidateScriptScope ();
17421746 hVGuiButton. GetScriptScope (). Input <- Input;
17431747 hVGuiButton. Spawn ();
@@ -1780,7 +1784,7 @@ function CreateBiochemistVGui(hMarine) {
17801784 local strLanguage = GetClientLanguage (hMarine. GetCommander (). entindex ());
17811785 local hVGuiBackground = Entities. CreateByClassname (" rd_vgui_vscript" );
17821786 g_ent_HudAndVGui. append (hVGuiBackground);
1783- hVGuiBackground. __KeyValueFromString (" client_vscript" , " traitors_client_biochemist_background .nut" );
1787+ hVGuiBackground. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_biochemist_background .nut" );
17841788 hVGuiBackground. ValidateScriptScope ();
17851789 hVGuiBackground. GetScriptScope (). Input <- Input;
17861790 hVGuiBackground. Spawn ();
@@ -1808,7 +1812,7 @@ function CreateBiochemistVGui(hMarine) {
18081812 foreach (tempMarine in g_marine_Total_Unshuffled) {
18091813 local hVGuiButton = Entities. CreateByClassname (" rd_vgui_vscript" );
18101814 g_ent_HudAndVGui. append (hVGuiButton);
1811- hVGuiButton. __KeyValueFromString (" client_vscript" , " traitors_client_biochemist_button .nut" );
1815+ hVGuiButton. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_biochemist_button .nut" );
18121816 hVGuiButton. ValidateScriptScope ();
18131817 hVGuiButton. GetScriptScope (). Input <- Input;
18141818 hVGuiButton. Spawn ();
@@ -1850,7 +1854,7 @@ function CreateInfectorVGui(hMarine) {
18501854 local strLanguage = GetClientLanguage (hMarine. GetCommander (). entindex ());
18511855 local hVGuiBackground = Entities. CreateByClassname (" rd_vgui_vscript" );
18521856 g_ent_HudAndVGui. append (hVGuiBackground);
1853- hVGuiBackground. __KeyValueFromString (" client_vscript" , " traitors_client_infector_background .nut" );
1857+ hVGuiBackground. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_infector_background .nut" );
18541858 hVGuiBackground. ValidateScriptScope ();
18551859 hVGuiBackground. GetScriptScope (). Input <- Input;
18561860 hVGuiBackground. Spawn ();
@@ -1881,7 +1885,7 @@ function CreateInfectorVGui(hMarine) {
18811885 }
18821886 local hVGuiButton = Entities. CreateByClassname (" rd_vgui_vscript" );
18831887 g_ent_HudAndVGui. append (hVGuiButton);
1884- hVGuiButton. __KeyValueFromString (" client_vscript" , " traitors_client_infector_button .nut" );
1888+ hVGuiButton. __KeyValueFromString (" client_vscript" , " challenge_traitors_client_infector_button .nut" );
18851889 hVGuiButton. ValidateScriptScope ();
18861890 hVGuiButton. GetScriptScope (). Input <- Input;
18871891 hVGuiButton. Spawn ();
0 commit comments