diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-31 23:14:58 +0100 |
commit | 9a96d0bff56f1969c68bb52a2f33296095bdc67d (patch) | |
tree | 4175928e488632705692e3cccafa1a38dd854615 /Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut | |
parent | 27bd240871b7c0f2f49fef137718b2e3c208e3b4 (diff) | |
download | NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.tar.gz NorthstarMods-9a96d0bff56f1969c68bb52a2f33296095bdc67d.zip |
move to new mod format
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut b/Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut new file mode 100644 index 000000000..06232c08b --- /dev/null +++ b/Northstar.CustomServers/mod/scripts/vscripts/titan/_titan_commands.gnut @@ -0,0 +1,49 @@ +untyped + +global function TitanCommands_Init + + +function TitanCommands_Init() +{ + if ( GetCurrentPlaylistVarInt( "titan_move_command_enabled", 0 ) == 0 ) + return + + AddClientCommandCallback( "PrototypeOrderTitanMove", Prototype_OrderTitanMove ) + RegisterSignal( "Prototype_TitanMove" ) +} + +bool function Prototype_OrderTitanMove( entity player, array<string> args ) +{ + Assert( args.len() == 3 ) + vector pos = Vector( args[0].tofloat(), args[1].tofloat(), args[2].tofloat() ) + + DebugDrawLine( pos, pos + Vector(0,0,500), 255, 0, 0, true, 5.0 ) + entity titan = player.GetPetTitan() + if ( !IsAlive( titan ) ) + return true + + thread Prototype_TitanMove( player, titan, pos ) + + return true +} + +void function Prototype_TitanMove( entity player, entity titan, vector origin ) +{ + titan.Signal( "Prototype_TitanMove" ) + titan.EndSignal( "Prototype_TitanMove" ) + titan.EndSignal( "ChangedTitanMode" ) + titan.EndSignal( "OnDeath" ) + local mode = player.GetPetTitanMode() + if ( mode != eNPCTitanMode.STAY ) // assuming there are only 2 modes + { + player.SetPetTitanMode( eNPCTitanMode.STAY ) + titan.DisableBehavior( "Follow" ) + #if R1_VGUI_MINIMAP + titan.Minimap_SetBossPlayerMaterial( $"vgui/HUD/threathud_titan_friendlyself_guard" ) + #endif + + titan.AssaultSetOrigin( origin ) + } + + AssaultOrigin( titan, origin, 100 ) +}
\ No newline at end of file |