diff --git a/keyvalues/scripts/weapons/mp_ability_holopilot.txt b/keyvalues/scripts/weapons/mp_ability_holopilot.txt index 8639434..56a8c5f 100644 --- a/keyvalues/scripts/weapons/mp_ability_holopilot.txt +++ b/keyvalues/scripts/weapons/mp_ability_holopilot.txt @@ -32,5 +32,9 @@ WeaponData "ammo_stockpile_max" "300" "regen_ammo_refill_rate" "*1.5" } + mode_holoshift + { + "hud_icon" "rui/menu/boosts/boost_icon_holopilot" + } } } \ No newline at end of file diff --git a/mod.json b/mod.json index bf85496..9d2cdab 100644 --- a/mod.json +++ b/mod.json @@ -1,7 +1,7 @@ { "Name": "Legonzaur.HoloShift", - "Description": "Swap positions with your beloved decoy", - "Version": "1.0.8", + "Description": "Swap positions with your beloved decoy. Compatible with HoloTracker.", + "Version": "1.0.9", "LoadPriority": 2, "Scripts": [ { @@ -9,7 +9,14 @@ "RunOn": "MP", "ServerCallback": { "After": "HoloShift_Init" - } - } + }, + }, + { + "Path": "HolopilotIconChange.nut", + "RunOn": "MP", + "ServerCallback": { + "After": "HolopilotIconChangeInit" + }, + } ] } diff --git a/mod/scripts/vscripts/HolopilotIconChange.nut b/mod/scripts/vscripts/HolopilotIconChange.nut new file mode 100644 index 0000000..3d52de7 --- /dev/null +++ b/mod/scripts/vscripts/HolopilotIconChange.nut @@ -0,0 +1,26 @@ +untyped +global function HolopilotIconChangeInit + + +void function HolopilotIconChangeInit() +{ + #if SERVER + AddCallback_OnPlayerRespawned( HolopilotIconChange ) + //AddCallback_PlayerClassChanged( HolopilotIconChange ) + //AddCallback_OnPlayerLifeStateChanged( HolopilotIconChange ) + #endif +} + +#if SERVER + +void function HolopilotIconChange(entity player){ +//void function HolopilotIconChange(entity player, int oldState, int newState){ + Assert( IsAlive( player ) ) + if(player.GetOffhandWeapons().len() > 1 && player.GetOffhandWeapons()[1].GetWeaponClassName() == "mp_ability_holopilot"){ + array offhandMods = player.GetOffhandWeapons()[1].GetMods() + offhandMods.append("mode_holoshift") + player.GetOffhandWeapons()[1].SetMods(offhandMods) + } + +} +#endif \ No newline at end of file diff --git a/mod/scripts/vscripts/weapons/mp_ability_holopilot.nut b/mod/scripts/vscripts/weapons/mp_ability_holopilot.nut index e7e4538..9cfe586 100644 --- a/mod/scripts/vscripts/weapons/mp_ability_holopilot.nut +++ b/mod/scripts/vscripts/weapons/mp_ability_holopilot.nut @@ -46,6 +46,10 @@ void function CleanupExistingDecoy( entity decoy ) { if ( IsValid( decoy ) ) //This cleanup function is called from multiple places, so check that decoy is still valid before we try to clean it up again { + //COMMUNICATION WITH HOLOTRACKER + int eHandle = decoy.GetEncodedEHandle() + ServerToClientStringCommand( decoy.GetBossPlayer(), "StopDecoyTracking " + eHandle.tostring()) + //END OF COMMUNICATION decoy.Decoy_Dissolve() CleanupFXAndSoundsForDecoy( decoy ) } @@ -158,6 +162,11 @@ var function OnWeaponPrimaryAttack_holopilot( entity weapon, WeaponPrimaryAttack }else{ entity decoy = CreateHoloPilotDecoys( weaponOwner, 1 ) playerDecoyList[ weaponOwner ] <- decoy + + //COMMUNICATION WITH HOLOTRACKER + int eHandle = decoy.GetEncodedEHandle() + ServerToClientStringCommand( weaponOwner, "ActivateDecoyTracking " + eHandle.tostring()) + //END OF COMMUNICATION } #else Rumble_Play( "rumble_holopilot_activate", {} )