diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-06-22 14:30:49 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-06-22 14:30:49 +0100 |
commit | 207facbc402f5639cbcd31f079214351ef605cf2 (patch) | |
tree | 4710b2a88dd64f3dfea1609d31a5de9141640951 /Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut | |
parent | c2d438568df6d98cf731807e30eaa7da31e5ea52 (diff) | |
download | NorthstarMods-207facbc402f5639cbcd31f079214351ef605cf2.tar.gz NorthstarMods-207facbc402f5639cbcd31f079214351ef605cf2.zip |
initial commit after moving to new repo
Diffstat (limited to 'Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut')
-rw-r--r-- | Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut b/Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut new file mode 100644 index 00000000..5f72385e --- /dev/null +++ b/Northstar.CustomServers/scripts/vscripts/titan/class_titan.gnut @@ -0,0 +1,77 @@ +untyped + +global function ClassTitan_Init + +global function Titan_AddPlayer +global function Titan_OnPlayerDeath +global function ClientCommand_TitanEject +global function ApplyTitanLoadoutModifiers + + +const TITAN_HATCHCOMMANDANIMTIME = 1.5 // cooldown time between toggling the cockpit state. Will be needed when we have animations to play + +const COCKPIT_JOLT_DAMAGE_MIN = 1 +const COCKPIT_JOLT_DAMAGE_MAX = 200 +const TITAN_STUMBLE_HEALTH_PERCENTAGE = 0.5 + +string thisClassName = "titan" + +function ClassTitan_Init() +{ + + AddClientCommandCallback( "TitanEject", ClientCommand_TitanEject ) // +} + +function Titan_AddPlayer( player ) +{ + player.playerClassData[thisClassName] <- {} + player.s.lastStaggerTime <- 0 +} + + +// TODO: There should be an equivalent function for pilots +TitanLoadoutDef function ApplyTitanLoadoutModifiers( entity player, TitanLoadoutDef loadout ) +{ + return loadout +} + +void function Titan_OnPlayerDeath( entity player, var damageInfo ) +{ + player.p.storedWeapons.clear() +} + +bool function PlayerCanEject( entity player ) +{ + if ( !IsAlive( player ) ) + return false + + if ( !player.IsTitan() ) + return false + + if ( Riff_TitanExitEnabled() == eTitanExitEnabled.Never ) + return false + + //if ( !CanDisembark( player ) ) + // return false + + if ( IsPlayerDisembarking( player ) ) + return false + + if ( TitanEjectIsDisabled() ) + return false + + return true +} + +bool function ClientCommand_TitanEject( entity player, array<string> args ) +{ + if ( !PlayerCanEject( player ) ) + return true + + int ejectPressCount = args[ 0 ].tointeger() + if ( ejectPressCount < 3 ) + return true + + thread TitanEjectPlayer( player ) + return true +} |