From 4e83b351a8581ec04cd7ecd54588514eb6207ba6 Mon Sep 17 00:00:00 2001 From: DBmaoha <56738369+DBmaoha@users.noreply.github.com> Date: Sat, 7 Jan 2023 04:42:13 +0800 Subject: [GAMEMODE] Add gamemode_fw (#545) * Initial commit Co-Authored-By: Ghroth-follower <45908037+Ghroth-follower@users.noreply.github.com> Co-Authored-By: zxcPandora <81985226+zxcPandora@users.noreply.github.com> * add customized scripts Co-Authored-By: Ghroth-follower <45908037+Ghroth-follower@users.noreply.github.com> Co-Authored-By: zxcPandora <81985226+zxcPandora@users.noreply.github.com> * add royal as co-worker Co-Authored-By: Maya <11448698+RoyalBlue1@users.noreply.github.com> * reset harvester.gnut * Update _gamemode_fw.nut * no need to update alertLevel right after clear * hacked natural turret receives less health * change consts name * update HACK_ForceDestroyNPCs() * update battery port's usePrompts * batteryPort useHint update * should do a check for titans * disable cloak while applying battery * add debounce for turret notifications * fix escalate * fix complex crash * late spawn camp trackers * defensive fix after havester destroyed * nerf salvo core and titan's earn meter * edit rodeo_titan in Northstar.Custom * make settings controllable by playlistvars * use tabs for indenting use tabs for indenting * Move game mode specific behaviour to callback use post damage callback * Move FW specific code out of _battery_port.gnut Also Split Damage Callbacks to onDamage and onPostDamage * Fix globalizing same function twice * Adding vars back to HarvesterStruct * use tabs for indenting use tabs for indenting Co-authored-by: Ghroth-follower <45908037+Ghroth-follower@users.noreply.github.com> Co-authored-by: zxcPandora <81985226+zxcPandora@users.noreply.github.com> Co-authored-by: Maya <11448698+RoyalBlue1@users.noreply.github.com> Co-authored-by: zxcPandora <1158500986@qq.com> --- .../vscripts/gamemodes/sh_gamemode_fw_custom.nut | 56 ++++++++++++++++++---- 1 file changed, 47 insertions(+), 9 deletions(-) (limited to 'Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut') diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut index e2cdc1a3d..0cd2fd624 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/sh_gamemode_fw_custom.nut @@ -5,8 +5,35 @@ global function SHCreateGamemodeFW_Init +// object settings, changable through playlist vars +// default havester settings +global const int FW_DEFAULT_HARVESTER_HEALTH = 25000 +global const int FW_DEFAULT_HARVESTER_SHIELD = 5000 +// default turret settings +global const int FW_DEFAULT_TURRET_HEALTH = 12500 +global const int FW_DEFAULT_TURRET_SHIELD = 4000 + +// fix a turret +global const float TURRET_FIXED_HEALTH_PERCENTAGE = 0.33 +global const float TURRET_FIXED_SHIELD_PERCENTAGE = 1.0 // default is regen all shield +// hack a turret +global const float TURRET_HACKED_HEALTH_PERCENTAGE = 0.5 +global const float TURRET_HACKED_SHIELD_PERCENTAGE = 0.5 + void function SHCreateGamemodeFW_Init() { + // harvester playlistvar + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_harvester_health", FW_DEFAULT_HARVESTER_HEALTH.tostring() ) + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_harvester_shield", FW_DEFAULT_HARVESTER_SHIELD.tostring() ) + // turret playlistvar + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_health", FW_DEFAULT_TURRET_HEALTH.tostring() ) + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_shield", FW_DEFAULT_TURRET_SHIELD.tostring() ) + // battery port playlistvar + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_fixed_health", TURRET_FIXED_HEALTH_PERCENTAGE.tostring() ) + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_fixed_shield", TURRET_FIXED_SHIELD_PERCENTAGE.tostring() ) + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_hacked_health", TURRET_HACKED_HEALTH_PERCENTAGE.tostring() ) + AddPrivateMatchModeSettingArbitrary( "#PL_fw", "fw_turret_hacked_shield", TURRET_HACKED_SHIELD_PERCENTAGE.tostring() ) + AddCallback_OnCustomGamemodesInit( CreateGamemodeFW ) AddCallback_OnRegisteringCustomNetworkVars( FWOnRegisteringNetworkVars ) } @@ -19,16 +46,27 @@ void function CreateGamemodeFW() GameMode_Create( FORT_WAR ) GameMode_SetName( FORT_WAR, "#GAMEMODE_fw" ) GameMode_SetDesc( FORT_WAR, "#PL_fw_desc" ) - GameMode_SetGameModeAnnouncement( FORT_WAR, "ffa_modeDesc" ) // fw lines are unfortunately not registered to faction dialogue + + // fw lines are unfortunately not registered to faction dialogue, maybe do it in gamemode script manually, current using it's modeName + GameMode_SetGameModeAnnouncement( FORT_WAR, "fortwar_modeName" ) - #if SERVER - //GameMode_AddServerInit( FORT_WAR, GamemodeFW_Init ) // doesn't exist yet lol - #elseif CLIENT - GameMode_AddClientInit( FORT_WAR, CLGamemodeFW_Init ) - #endif - #if !UI - GameMode_AddSharedInit( FORT_WAR, SHGamemodeFW_Init ) - #endif + // waiting to be synced with client + GameMode_AddScoreboardColumnData( FORT_WAR, "#SCOREBOARD_KILLS", PGS_KILLS, 2 ) + GameMode_AddScoreboardColumnData( FORT_WAR, "#SCOREBOARD_SUPPORT_SCORE", PGS_DEFENSE_SCORE, 4 ) + GameMode_AddScoreboardColumnData( FORT_WAR, "#SCOREBOARD_COOP_POINTS", PGS_ASSAULT_SCORE, 6 ) + + AddPrivateMatchMode( FORT_WAR ) + + #if SERVER + GameMode_AddServerInit( FORT_WAR, GamemodeFW_Init ) + GameMode_SetPilotSpawnpointsRatingFunc( FORT_WAR, RateSpawnpoints_FW ) + GameMode_SetTitanSpawnpointsRatingFunc( FORT_WAR, RateSpawnpoints_FW ) + #elseif CLIENT + GameMode_AddClientInit( FORT_WAR, CLGamemodeFW_Init ) + #endif + #if !UI + GameMode_AddSharedInit( FORT_WAR, SHGamemodeFW_Init ) + #endif } void function FWOnRegisteringNetworkVars() -- cgit v1.2.3