From 849df151aadfeb7f91d027d22545e235846d4bf0 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sun, 22 Nov 2015 03:32:19 -0500 Subject: [PATCH] Removed setArmor as its a T2-script defined function; .blowup() auto-fade compatability logic was added; some audio wrapper functions for alx* --- scripts/audioFunctions.cs | 22 ++++++++++++++++++++++ scripts/playerFunctions.cs | 14 +++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 scripts/audioFunctions.cs diff --git a/scripts/audioFunctions.cs b/scripts/audioFunctions.cs new file mode 100644 index 0000000..5ed3255 --- /dev/null +++ b/scripts/audioFunctions.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// playerFunctions.cs +// +// Various helper functions that many Tribes 2 scripts expect to exist which +// can be implemented wholly in script. Those that must perform more +// sophisicated engines must be implemented as engine functions. +//------------------------------------------------------------------------------ + +function alxCreateSource(%profile, %file) +{ + %handle = sfxCreateSource(%profile, %file); +} + +function alxPlay(%handle) +{ + %handle.play(-1); +} + +function alxGetWaveLen(%file) +{ + +} diff --git a/scripts/playerFunctions.cs b/scripts/playerFunctions.cs index 80233f9..ab2a59b 100644 --- a/scripts/playerFunctions.cs +++ b/scripts/playerFunctions.cs @@ -6,7 +6,15 @@ // sophisicated engines must be implemented as engine functions. //------------------------------------------------------------------------------ -function Player::setArmor(%this, %armor) +package PlayerCompatability { - %this.setDatablock(%armor @ %this.client.sex @ this.%client.race @ "Armor"); -} + // The Tribes 2 engine behavior is to auto-fade the blown up player + // upon calling this function. + function Player::blowup(%this) + { + parent::blowup(%this); + %this.startFade(1,0,1); + } +}; + +activatePackage(PlayerCompatability);