diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index f7c5ee2d1..4c64a3e09 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt @@ -56,6 +56,7 @@ Press Yes if you agree to this. This choice can be changed in the mods menu at a "timelimit" "Time Limit" "roundtimelimit" "Time Limit (round-based)" "respawnprotection" "Respawn Protection Time" + "late_join_respawn" "Enable late join respawn" "pilot_health_multiplier" "Health multiplier" "respawn_delay" "Respawn Delay" diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt b/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt index fd649cdb6..b53c7a1b2 100644 --- a/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt +++ b/Northstar.Client/mod/resource/northstar_client_localisation_tchinese.txt @@ -56,6 +56,7 @@ "timelimit" "時間限制" "roundtimelimit" "時間限制(回合制)" "respawnprotection" "重生保護時間" + "late_join_respawn" "中途加入復活" "pilot_health_multiplier" "生命值加成" "respawn_delay" "重生延遲" diff --git a/Northstar.Custom/mod/resource/northstar_custom_english.txt b/Northstar.Custom/mod/resource/northstar_custom_english.txt index 56f56e8df..93e45ff03 100644 Binary files a/Northstar.Custom/mod/resource/northstar_custom_english.txt and b/Northstar.Custom/mod/resource/northstar_custom_english.txt differ diff --git a/Northstar.Custom/mod/resource/northstar_custom_tchinese.txt b/Northstar.Custom/mod/resource/northstar_custom_tchinese.txt new file mode 100644 index 000000000..ee650ed99 Binary files /dev/null and b/Northstar.Custom/mod/resource/northstar_custom_tchinese.txt differ diff --git a/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut b/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut index 9aa86a437..f1b3e8d76 100644 --- a/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/rodeo/_rodeo_titan.gnut @@ -613,14 +613,22 @@ function PlayerBeginsTitanRodeo( entity player, RodeoPackageStruct rodeoPackage, if ( IsAlive( player ) ) { - int attachIndex = newRodeoTitan.LookupAttachment( rodeoPackage.attachPoint ) - vector startPos = newRodeoTitan.GetAttachmentOrigin( attachIndex ) - - if ( !PlayerCanTeleportHere( player, startPos, newRodeoTitan ) ) + vector startPos + if( IsValid( newRodeoTitan ) ) { - startPos = newRodeoTitan.GetOrigin() + int attachIndex = newRodeoTitan.LookupAttachment( rodeoPackage.attachPoint ) + startPos = newRodeoTitan.GetAttachmentOrigin( attachIndex ) + if ( !PlayerCanTeleportHere( player, startPos, newRodeoTitan ) ) - startPos = player.GetOrigin() + { + startPos = newRodeoTitan.GetOrigin() + if ( !PlayerCanTeleportHere( player, startPos, newRodeoTitan ) ) + startPos = player.GetOrigin() + } + } + else + { + startPos = player.GetOrigin() } thread PlayerJumpsOffRodeoTarget( player, newRodeoTitan, startPos ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut index 2fb177677..bcee92d9e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_respawn_protection.gnut @@ -1,12 +1,44 @@ global function RespawnProtection_Init +global function IsRespawnProtectionActive + +struct +{ + array< entity > players +} file void function RespawnProtection_Init(){ + RegisterSignal( "StopProtection" ) AddCallback_OnPlayerRespawned( OnPlayerRespawned ) } void function OnPlayerRespawned( entity player ) { - thread RespawnProtection(player,GetCurrentPlaylistVarFloat("respawnprotection",0.0)) + float time = GetCurrentPlaylistVarFloat( "respawnprotection", 0.0 ) + if( time > 0.0 ) + { + AddButtonPressedPlayerInputCallback( player, IN_ATTACK, ForceStopProtection ) + AddButtonPressedPlayerInputCallback( player, IN_OFFHAND0, ForceStopProtection ) + AddButtonPressedPlayerInputCallback( player, IN_OFFHAND2, ForceStopProtection ) + AddButtonPressedPlayerInputCallback( player, IN_OFFHAND4, ForceStopProtection ) + AddButtonPressedPlayerInputCallback( player, IN_MELEE, ForceStopProtection ) + AddButtonPressedPlayerInputCallback( player, IN_USE, ForceStopProtection ) + thread RespawnProtection( player, time ) + } +} + +void function ForceStopProtection( entity player ) +{ + player.Signal( "StopProtection" ) +} + +bool function IsRespawnProtectionActive( entity player ) +{ + if ( player == null ) + return false + if ( !IsValid( player ) ) + return false + + return file.players.contains( player ) } void function RespawnProtection( entity player , float time ){ @@ -14,9 +46,20 @@ void function RespawnProtection( entity player , float time ){ function() : ( player ) { //cancel protect if player attack - if( IsDemigod( player ) ) + if( IsValid( player ) ) { + ForceStopProtection( player ) + if( file.players.contains( player ) ) + file.players.fastremovebyvalue( player ) + RemoveButtonPressedPlayerInputCallback( player, IN_ATTACK, ForceStopProtection ) + RemoveButtonPressedPlayerInputCallback( player, IN_OFFHAND0, ForceStopProtection ) + RemoveButtonPressedPlayerInputCallback( player, IN_OFFHAND2, ForceStopProtection ) + RemoveButtonPressedPlayerInputCallback( player, IN_OFFHAND4, ForceStopProtection ) + RemoveButtonPressedPlayerInputCallback( player, IN_MELEE, ForceStopProtection ) + RemoveButtonPressedPlayerInputCallback( player, IN_USE, ForceStopProtection ) + SetDefaultMPEnemyHighlight( player ) DisableDemigod( player ); + player.ClearInvulnerable() } } ) @@ -24,16 +67,47 @@ void function RespawnProtection( entity player , float time ){ player.EndSignal( "OnDeath" ) player.EndSignal( "OnDestroy" ) player.EndSignal( "OnPrimaryAttack" ) + player.EndSignal( "RodeoStarted" ) + player.EndSignal( "StopProtection" ) - if( IsDemigod( player ) ) + if( IsValid( player ) ) { - DisableDemigod( player ); - } - else{ //start protect - EnableDemigod( player ) - wait time - //cancel protect - DisableDemigod( player ); + if( player.GetPersistentVar( "spawnAsTitan" ) || Riff_SpawnAsTitan() ) + { + player.WaitSignal( "PlayerEmbarkedTitan" ) + player.SetInvulnerable() + } + else if( player.IsTitan() ) + { + player.SetInvulnerable() + } + else + { + EnableDemigod( player ) + } + + //start a highlight + waitthread ProtectionHighlightThink( player, time ) + } +} + +void function ProtectionHighlightThink( entity player, float time ) +{ + player.EndSignal( "OnDeath" ) + player.EndSignal( "OnDestroy" ) + player.EndSignal( "OnPrimaryAttack" ) + player.EndSignal( "RodeoStarted" ) + player.EndSignal( "StopProtection" ) + + float startTime = Time() + while( Time() - startTime <= time ) + { + if( IsValid( player ) ) + { + Highlight_SetEnemyHighlight( player, "sp_enemy_pilot" ) + player.Highlight_SetParam( 2, 0, < 255,215,0 > ) + } + WaitFrame() } } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut index d2be2ab41..6de5cc22a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/sh_private_lobby_modes_init.gnut @@ -11,6 +11,7 @@ void function PrivateMatchModesInit() AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "timelimit", "12" ) //, "Time Limit" ) AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "roundtimelimit", "0" ) //, "Time Limit (round-based modes)" ) AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_MATCH", "respawnprotection", "0.0" ) //, "Player Respawn Protection Time" ) + AddPrivateMatchModeSettingEnum( "#MODE_SETTING_CATEGORY_MATCH", "late_join_respawn", [ "#SETTING_DISABLED", "#SETTING_ENABLED" ], "1" ) AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "pilot_health_multiplier", "1.0" ) AddPrivateMatchModeSettingArbitrary( "#MODE_SETTING_CATEGORY_PILOT", "respawn_delay", "0.0" ) @@ -58,4 +59,4 @@ void function PrivateMatchModesInit() // maps AddPrivateMatchMap( "mp_coliseum" ) AddPrivateMatchMap( "mp_coliseum_column" ) -} \ No newline at end of file +} diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index b77a37b2a..c706e4c5c 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -9,6 +9,7 @@ global function DecideRespawnPlayer global function RespawnAsPilot global function RespawnAsTitan global function TryGameModeAnnouncement +global function SetLateJoinRespawnEnabled global function SetKillcamsEnabled global function KillcamsEnabled @@ -24,6 +25,7 @@ global function SetRecalculateRespawnAsTitanStartPointCallback struct { bool killcamsEnabled = true bool playerDeathsHidden = false + bool shouldDoRespawnForLatePlayer = true int titanDamageGameStat = -1 entity intermissionCamera @@ -44,6 +46,7 @@ void function BaseGametype_Init_MPSP() RegisterSignal( "PlayerRespawnStarted" ) RegisterSignal( "KillCamOver" ) + file.shouldDoRespawnForLatePlayer = GetCurrentPlaylistVarInt( "late_join_respawn", 1 ) == 1 FlagInit( "WeaponDropsAllowed", true ) } @@ -185,6 +188,12 @@ void function CodeCallback_OnClientConnectionCompleted( entity player ) player.SetPersistentVar( "privateMatchState", 0 ) // handle spawning late joiners + if( file.shouldDoRespawnForLatePlayer ) + HandleRespawnForLateJoiner( player ) +} + +void function HandleRespawnForLateJoiner( entity player ) +{ if ( GetGameState() == eGameState.Playing ) { if ( RespawnsEnabled() ) @@ -362,7 +371,8 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga { player.SetObserverModeStaticPosition( file.intermissionCamera.GetOrigin() ) player.SetObserverModeStaticAngles( file.intermissionCamera.GetAngles() ) - player.StartObserverMode( OBS_MODE_STATIC_LOCKED ) + if( !IsValid( player.GetParent() ) ) + player.StartObserverMode( OBS_MODE_STATIC_LOCKED ) player.SetObserverTarget( null ) } @@ -574,6 +584,11 @@ void function TryGameModeAnnouncement( entity player ) // only putting this here PlayFactionDialogueToPlayer( GameMode_GetGameModeAnnouncement( GAMETYPE ), player ) } +void function SetLateJoinRespawnEnabled( bool enabled ) +{ + file.shouldDoRespawnForLatePlayer = enabled +} + void function SetKillcamsEnabled( bool enabled ) { file.killcamsEnabled = enabled diff --git a/Northstar.CustomServers/mod/scripts/vscripts/rodeo/_rodeo.gnut b/Northstar.CustomServers/mod/scripts/vscripts/rodeo/_rodeo.gnut index 72ff58b78..42897a569 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/rodeo/_rodeo.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/rodeo/_rodeo.gnut @@ -180,14 +180,22 @@ function PlayerBeginsNPCRodeo( entity player, RodeoPackageStruct rodeoPackage, e if ( IsAlive( player ) ) { - int attachIndex = newRodeoTarget.LookupAttachment( rodeoPackage.attachPoint ) - vector startPos = newRodeoTarget.GetAttachmentOrigin( attachIndex ) - - if ( !PlayerCanTeleportHere( player, startPos, newRodeoTarget ) ) + vector startPos + if( IsValid( newRodeoTarget ) ) { - startPos = newRodeoTarget.GetOrigin() + int attachIndex = newRodeoTarget.LookupAttachment( rodeoPackage.attachPoint ) + startPos = newRodeoTarget.GetAttachmentOrigin( attachIndex ) + if ( !PlayerCanTeleportHere( player, startPos, newRodeoTarget ) ) - startPos = player.GetOrigin() + { + startPos = newRodeoTarget.GetOrigin() + if ( !PlayerCanTeleportHere( player, startPos, newRodeoTarget ) ) + startPos = player.GetOrigin() + } + } + else + { + startPos = player.GetOrigin() } thread PlayerJumpsOffRodeoTarget( player, newRodeoTarget, startPos ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/weapons/mp_titancore_upgrade.nut b/Northstar.CustomServers/mod/scripts/vscripts/weapons/mp_titancore_upgrade.nut new file mode 100644 index 000000000..6c4b488b3 --- /dev/null +++ b/Northstar.CustomServers/mod/scripts/vscripts/weapons/mp_titancore_upgrade.nut @@ -0,0 +1,373 @@ +global function UpgradeCore_Init +global function OnWeaponPrimaryAttack_UpgradeCore +#if SERVER +global function OnWeaponNpcPrimaryAttack_UpgradeCore +#endif +#if CLIENT +global function ServerCallback_VanguardUpgradeMessage +#endif + +const LASER_CHAGE_FX_1P = $"P_handlaser_charge" +const LASER_CHAGE_FX_3P = $"P_handlaser_charge" +const FX_SHIELD_GAIN_SCREEN = $"P_xo_shield_up" + +void function UpgradeCore_Init() +{ + RegisterSignal( "OnSustainedDischargeEnd" ) + + PrecacheParticleSystem( FX_SHIELD_GAIN_SCREEN ) + PrecacheParticleSystem( LASER_CHAGE_FX_1P ) + PrecacheParticleSystem( LASER_CHAGE_FX_3P ) +} + +#if SERVER +var function OnWeaponNpcPrimaryAttack_UpgradeCore( entity weapon, WeaponPrimaryAttackParams attackParams ) +{ + OnWeaponPrimaryAttack_UpgradeCore( weapon, attackParams ) + return 1 +} +#endif + +var function OnWeaponPrimaryAttack_UpgradeCore( entity weapon, WeaponPrimaryAttackParams attackParams ) +{ + if ( !CheckCoreAvailable( weapon ) ) + return false + + entity owner = weapon.GetWeaponOwner() + entity soul = owner.GetTitanSoul() + #if SERVER + float coreDuration = weapon.GetCoreDuration() + thread UpgradeCoreThink( weapon, coreDuration ) + int currentUpgradeCount = soul.GetTitanSoulNetInt( "upgradeCount" ) + if ( currentUpgradeCount == 0 ) + { + if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE1 ) ) // Arc Rounds + { + array weapons = GetPrimaryWeapons( owner ) + if ( weapons.len() > 0 ) + { + entity primaryWeapon = weapons[0] + if ( IsValid( primaryWeapon ) ) + { + array mods = primaryWeapon.GetMods() + mods.append( "arc_rounds" ) + primaryWeapon.SetMods( mods ) + primaryWeapon.SetWeaponPrimaryClipCount( min( primaryWeapon.GetWeaponPrimaryClipCountMax(), primaryWeapon.GetWeaponPrimaryClipCount() + 10 ) ) + } + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo1" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 1 ) + } + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE2 ) ) //Missile Racks + { + entity offhandWeapon = owner.GetOffhandWeapon( OFFHAND_RIGHT ) + if ( IsValid( offhandWeapon ) ) + { + array mods = offhandWeapon.GetMods() + mods.append( "missile_racks" ) + offhandWeapon.SetMods( mods ) + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo1" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 2 ) + } + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE3 ) ) //Energy Transfer + { + entity offhandWeapon = owner.GetOffhandWeapon( OFFHAND_LEFT ) + if ( IsValid( offhandWeapon ) ) + { + array mods = offhandWeapon.GetMods() + mods.append( "energy_transfer" ) + offhandWeapon.SetMods( mods ) + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo1" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 3 ) + } + } + } + else if ( currentUpgradeCount == 1 ) + { + if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE4 ) ) // Rapid Rearm + { + entity offhandWeapon = owner.GetOffhandWeapon( OFFHAND_ANTIRODEO ) + if ( IsValid( offhandWeapon ) ) + { + array mods = offhandWeapon.GetMods() + mods.append( "rapid_rearm" ) + offhandWeapon.SetMods( mods ) + } + array weapons = GetPrimaryWeapons( owner ) + if ( weapons.len() > 0 ) + { + entity primaryWeapon = weapons[0] + if ( IsValid( primaryWeapon ) ) + { + array mods = primaryWeapon.GetMods() + mods.append( "rapid_reload" ) + primaryWeapon.SetMods( mods ) + } + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo2" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 4 ) + } + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE5 ) ) //Maelstrom + { + entity offhandWeapon = owner.GetOffhandWeapon( OFFHAND_INVENTORY ) + if ( IsValid( offhandWeapon ) ) + { + array mods = offhandWeapon.GetMods() + mods.append( "maelstrom" ) + offhandWeapon.SetMods( mods ) + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo2" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 5 ) + } + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE6 ) ) //Energy Field + { + entity offhandWeapon = owner.GetOffhandWeapon( OFFHAND_LEFT ) + if ( IsValid( offhandWeapon ) ) + { + array mods = offhandWeapon.GetMods() + if ( mods.contains( "energy_transfer" ) ) + { + array mods = offhandWeapon.GetMods() + mods.fastremovebyvalue( "energy_transfer" ) + mods.append( "energy_field_energy_transfer" ) + offhandWeapon.SetMods( mods ) + } + else + { + array mods = offhandWeapon.GetMods() + mods.append( "energy_field" ) + offhandWeapon.SetMods( mods ) + } + } + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeTo2" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 6 ) + } + } + } + else if ( currentUpgradeCount == 2 ) + { + if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE7 ) ) // Multi-Target Missiles + { + if ( owner.IsPlayer() ) + { + array conversations = [ "upgradeTo3", "upgradeToFin" ] + int conversationID = GetConversationIndex( conversations.getrandom() ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 7 ) + } + + entity ordnance = owner.GetOffhandWeapon( OFFHAND_RIGHT ) + array mods + if ( ordnance.HasMod( "missile_racks") ) + mods = [ "upgradeCore_MissileRack_Vanguard" ] + else + mods = [ "upgradeCore_Vanguard" ] + + if ( ordnance.HasMod( "fd_balance" ) ) + mods.append( "fd_balance" ) + + float ammoFrac = float( ordnance.GetWeaponPrimaryClipCount() ) / float( ordnance.GetWeaponPrimaryClipCountMax() ) + owner.TakeWeaponNow( ordnance.GetWeaponClassName() ) + owner.GiveOffhandWeapon( "mp_titanweapon_shoulder_rockets", OFFHAND_RIGHT, mods ) + ordnance = owner.GetOffhandWeapon( OFFHAND_RIGHT ) + ordnance.SetWeaponChargeFractionForced( 1 - ammoFrac ) + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE8 ) ) //Superior Chassis + { + if ( owner.IsPlayer() ) + { + array conversations = [ "upgradeTo3", "upgradeToFin" ] + int conversationID = GetConversationIndex( conversations.getrandom() ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 8 ) + + if ( !GetDoomedState( owner ) ) + { + int missingHealth = owner.GetMaxHealth() - owner.GetHealth() + array settingMods = owner.GetPlayerSettingsMods() + settingMods.append( "core_health_upgrade" ) + owner.SetPlayerSettingsWithMods( owner.GetPlayerSettings(), settingMods ) + owner.SetHealth( max( owner.GetMaxHealth() - missingHealth, VANGUARD_CORE8_HEALTH_AMOUNT ) ) + + //Hacky Hack - Append core_health_upgrade to setFileMods so that we have a way to check that this upgrade is active. + soul.soul.titanLoadout.setFileMods.append( "core_health_upgrade" ) + } + else + { + owner.SetHealth( owner.GetMaxHealth() ) + } + } + else + { + if ( !GetDoomedState( owner ) ) + { + owner.SetMaxHealth( owner.GetMaxHealth() + VANGUARD_CORE8_HEALTH_AMOUNT ) + owner.SetHealth( owner.GetHealth() + VANGUARD_CORE8_HEALTH_AMOUNT ) + } + } + entity soul = owner.GetTitanSoul() + soul.SetPreventCrits( true ) + } + else if ( SoulHasPassive( soul, ePassives.PAS_VANGUARD_CORE9 ) ) //XO-16 Battle Rifle + { + array weapons = GetPrimaryWeapons( owner ) + if ( weapons.len() > 0 ) + { + entity primaryWeapon = weapons[0] + if ( IsValid( primaryWeapon ) ) + { + if ( primaryWeapon.HasMod( "arc_rounds" ) ) + { + primaryWeapon.RemoveMod( "arc_rounds" ) + array mods = primaryWeapon.GetMods() + mods.append( "arc_rounds_with_battle_rifle" ) + primaryWeapon.SetMods( mods ) + } + else + { + array mods = primaryWeapon.GetMods() + mods.append( "battle_rifle" ) + mods.append( "battle_rifle_icon" ) + primaryWeapon.SetMods( mods ) + } + } + } + + if ( owner.IsPlayer() ) + { + array conversations = [ "upgradeTo3", "upgradeToFin" ] + int conversationID = GetConversationIndex( conversations.getrandom() ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + Remote_CallFunction_NonReplay( owner, "ServerCallback_VanguardUpgradeMessage", 9 ) + } + } + } + else + { + if ( owner.IsPlayer() ) + { + int conversationID = GetConversationIndex( "upgradeShieldReplenish" ) + Remote_CallFunction_Replay( owner, "ServerCallback_PlayTitanConversation", conversationID ) + } + } + soul.SetTitanSoulNetInt( "upgradeCount", currentUpgradeCount + 1 ) + int statesIndex = owner.FindBodyGroup( "states" ) + owner.SetBodygroup( statesIndex, 1 ) + #endif + + #if CLIENT + if ( owner.IsPlayer() ) + { + entity cockpit = owner.GetCockpit() + if ( IsValid( cockpit ) ) + StartParticleEffectOnEntity( cockpit, GetParticleSystemIndex( FX_SHIELD_GAIN_SCREEN ), FX_PATTACH_ABSORIGIN_FOLLOW, -1 ) + } + #endif + OnAbilityCharge_TitanCore( weapon ) + OnAbilityStart_TitanCore( weapon ) + + return 1 +} + +#if SERVER +void function UpgradeCoreThink( entity weapon, float coreDuration ) +{ + weapon.EndSignal( "OnDestroy" ) + entity owner = weapon.GetWeaponOwner() + owner.EndSignal( "OnDestroy" ) + owner.EndSignal( "OnDeath" ) + owner.EndSignal( "DisembarkingTitan" ) + owner.EndSignal( "TitanEjectionStarted" ) + + EmitSoundOnEntityOnlyToPlayer( owner, owner, "Titan_Monarch_Smart_Core_Activated_1P" ) + EmitSoundOnEntityOnlyToPlayer( owner, owner, "Titan_Monarch_Smart_Core_ActiveLoop_1P" ) + EmitSoundOnEntityExceptToPlayer( owner, owner, "Titan_Monarch_Smart_Core_Activated_3P" ) + entity soul = owner.GetTitanSoul() + soul.SetShieldHealth( soul.GetShieldHealthMax() ) + + OnThreadEnd( + function() : ( weapon, owner, soul ) + { + if ( IsValid( owner ) ) + { + StopSoundOnEntity( owner, "Titan_Monarch_Smart_Core_ActiveLoop_1P" ) + //EmitSoundOnEntityOnlyToPlayer( owner, owner, "Titan_Monarch_Smart_Core_Activated_1P" ) + } + + if ( IsValid( weapon ) ) + { + OnAbilityChargeEnd_TitanCore( weapon ) + OnAbilityEnd_TitanCore( weapon ) + } + + if ( IsValid( soul ) ) + { + CleanupCoreEffect( soul ) + } + } + ) + + wait coreDuration +} +#endif + + +#if CLIENT +void function ServerCallback_VanguardUpgradeMessage( int upgradeID ) +{ + switch ( upgradeID ) + { + case 1: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE1" ), Localize( "#GEAR_VANGUARD_CORE1_UPGRADEDESC" ), <255, 135, 10> ) + break + case 2: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE2" ), Localize( "#GEAR_VANGUARD_CORE2_UPGRADEDESC" ), <255, 135, 10> ) + break + case 3: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE3" ), Localize( "#GEAR_VANGUARD_CORE3_UPGRADEDESC" ), <255, 135, 10> ) + break + case 4: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE4" ), Localize( "#GEAR_VANGUARD_CORE4_UPGRADEDESC" ), <255, 135, 10> ) + break + case 5: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE5" ), Localize( "#GEAR_VANGUARD_CORE5_UPGRADEDESC" ), <255, 135, 10> ) + break + case 6: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE6" ), Localize( "#GEAR_VANGUARD_CORE6_UPGRADEDESC" ), <255, 135, 10> ) + break + case 7: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE7" ), Localize( "#GEAR_VANGUARD_CORE7_UPGRADEDESC" ), <255, 135, 10> ) + break + case 8: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE8" ), Localize( "#GEAR_VANGUARD_CORE8_UPGRADEDESC" ), <255, 135, 10> ) + break + case 9: + AnnouncementMessageSweep( GetLocalClientPlayer(), Localize( "#GEAR_VANGUARD_CORE9" ), Localize( "#GEAR_VANGUARD_CORE9_UPGRADEDESC" ), <255, 135, 10> ) + break + } +} +#endif \ No newline at end of file