drop battery on phase (ugly global function registering)

This commit is contained in:
Nathan TIEN YOU
2022-02-05 14:31:44 +01:00
parent 3b87e2f625
commit 7cd0fd8c0f
2 changed files with 2508 additions and 2 deletions
File diff suppressed because it is too large Load Diff
@@ -135,6 +135,12 @@ var function OnWeaponPrimaryAttack_holopilot( entity weapon, WeaponPrimaryAttack
weaponOwner.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(0)
}
PlayerUsesHoloRewind(weaponOwner, decoy)
if(GetCurrentPlaylistName() == "lts"){
if(PlayerHasBattery(weaponOwner)){
Rodeo_TakeBatteryAwayFromPilot(weaponOwner)
}
}
// print("teleporting to"+decoy)
// print("Origin"+decoy.GetOrigin())
// print("Angles"+decoy.GetAngles())
@@ -261,8 +267,16 @@ void function SetupDecoy_Common( entity player, entity decoy ) //functioned out
decoyChildEnt.Highlight_SetInheritHighlight( true )
decoyChildEnt.SetParent( decoy, childEnt.GetParentAttachment() )
if ( isBattery )
if ( isBattery ){
if(GetCurrentPlaylistName() == "lts"){
if(player in playerDecoyList){
thread Decoy_BatteryFX( decoy, decoyChildEnt )
}<
}else{
thread Decoy_BatteryFX( decoy, decoyChildEnt )
}
}
else
thread Decoy_FlagFX( decoy, decoyChildEnt )
}
@@ -443,4 +457,37 @@ void function PlayerUsesHoloRewindThreaded( entity player, entity decoy )
mover.NonPhysicsRotateTo( decoy.GetAngles(), PHASE_REWIND_PATH_SNAPSHOT_INTERVAL, 0, 0 )
player.SetVelocity( decoy.GetVelocity() )
}
void function Rodeo_ApplyBatteryDelayed( entity player, table<string,bool> e )
{
entity battery = Rodeo_TakeBatteryAwayFromPilot( player )
e[ "hadAmped" ] = e[ "hadAmped" ] || IsAmpedBattery( battery )
int skin = battery.GetSkin()
battery.Destroy()
entity dummyBattery = CreatePropDynamic( RODEO_BATTERY_MODEL_FOR_RODEO_ANIMS )
dummyBattery.SetSkin( skin )
dummyBattery.Hide()
entity soul = player.GetTitanSoul()
OnThreadEnd(
function() : ( dummyBattery ) {
if ( IsValid( dummyBattery ) )
dummyBattery.Destroy()
}
)
if ( !IsValid( soul ) )
return
dummyBattery.EndSignal( "OnDestroy" )
soul.EndSignal( "OnDestroy" )
soul.EndSignal( "OnTitanDeath" )
wait 0.4 // delay so that it applies the battery when the player is inside the titan, so he can see the health bar change
if ( IsValid( soul.GetTitan() ) )
Rodeo_ApplyBatteryToTitan( dummyBattery, soul.GetTitan() )
}
#endif