mirror of
https://github.com/Ragora/T2-AAConstruction.git
synced 2026-04-29 16:55:04 +00:00
Initial commit.
This commit is contained in:
commit
23fed9edb7
157 changed files with 89351 additions and 0 deletions
17
AAChangelog.txt
Executable file
17
AAChangelog.txt
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
Version 0.1:
|
||||
-Implemented basic response chat AI, expect it to increase in complexity as more versions are released
|
||||
-Started Implementation of the projectile turret
|
||||
-Upgraded switch code to support pack toggled switches (plus a disposal mode)
|
||||
-Implemented Window Pack (Simplified forceFields basically)
|
||||
-Improved many script efficiency errors that came with Construction .70 (Spelling Errors, script setup, console errors)
|
||||
-Started Official mod map, which is yet to be named. (Right now is called "Starfallen Construction")
|
||||
-Implemented deployable waypoint pack (Under "Packs")
|
||||
-Implemented a scoreMenu chat command list system (type /help and see what I mean)
|
||||
-Fixed Smurf Message when someone joins a LAN server
|
||||
-Implemented my X-Library API
|
||||
-Implemented Phantom139's "fixed" Construction Tool
|
||||
-Implemented custom scoreMenu using the script from T2Bol mod
|
||||
-Implemented Quantium format chat commands (for those old-school users)
|
||||
-Implemented MANY chat commands (many of which have several aliases)
|
||||
-Implemented the MIST by Electricutioner (Thyth) to replace the Modifier tool
|
||||
-Implemented auto-buyfavorites upon exiting the inventory screen
|
||||
44
AAReadme.txt
Executable file
44
AAReadme.txt
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
Note: This is the AA Construction readMe file which basically sums up the original Construction .70
|
||||
readme in an easier-to-read- fashion and more. If you want to read the original readme, please
|
||||
refer to readme.txt.
|
||||
|
||||
----
|
||||
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
The goal: The goal of AA Construction is to bring a simplified construction experience while at the
|
||||
same time, allowing for more room for construction experts. The original Construction mod was
|
||||
barebones and did not provide much help for the beginners. Even today modern Construction
|
||||
mods do not provide sufficient instructions for non-builders that scare many new people
|
||||
away from the mod. Now, AA Construction will feature an easy-to-use system in which beginners
|
||||
can quicky learn the basics and rapidly expand their knowledge throughout gameplay.
|
||||
-------------------------------------------------------------------------------------------------------
|
||||
|
||||
Note: This is the .txt format of the readme for AA Construction. For a more appealing reading experience,
|
||||
please refer to Manual.html.
|
||||
|
||||
Table of Contents:
|
||||
Chapter One: The Start of it All
|
||||
Chapter Two: Packs
|
||||
Chapter Three: Tools
|
||||
Chapter Four: Vehicles
|
||||
|
||||
********************************************************
|
||||
Chapter One: The Start of it All
|
||||
********************************************************
|
||||
|
||||
********************************************************
|
||||
Chapter Two: Packs
|
||||
********************************************************
|
||||
|
||||
These packs are categorized in alphabetical order.
|
||||
|
||||
Name: Light Support Beam
|
||||
Available to: Pure, Light,
|
||||
Description: The Light Support Beam is the bread and butter pack of Construction, it allows you to
|
||||
construct any structure.
|
||||
Features:
|
||||
*Auto-fit: The autofit allows you to place beams that extends to the perfect length when contained,
|
||||
but when not contained, the beam automatically scales up to 4 meters. The auto-fit's max distance
|
||||
is 16 meters.
|
||||
*Pad: The pad feature allows you to deploy an auto-scaling pad anywhere on the map. If contained,
|
||||
the pad acts as a wall. Otherwise, it can act as a platform.
|
||||
53
Construction Adv Launcher.bat
Executable file
53
Construction Adv Launcher.bat
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
@echo OFF
|
||||
echo Construction Mod 0.70
|
||||
echo Advanced Mod Loader
|
||||
echo.
|
||||
echo Please choose options below to launch server:
|
||||
echo.
|
||||
echo Options:
|
||||
echo 1) Launch Online Dedicated Server (Ispawn).
|
||||
echo 2) Launch Online Dedicated Server.
|
||||
echo 3) Launch Offline Dedicated Server (Ispawn).
|
||||
echo 4) Launch Offline Dedicated Server.
|
||||
echo 5) Launch Online Listen Server.
|
||||
echo 6) Launch Offline Listen Server.
|
||||
echo 7) Exit.
|
||||
set /p Input=Press enter after selection (1-7):
|
||||
if %Input%==7 goto exit
|
||||
set /p RemDSO=Would you like to remove all DSOs from your Tribes 2 install? (y/n):
|
||||
cd ..
|
||||
if %RemDSO%==y del /s /q *.dso
|
||||
if %Input%==1 goto NDI
|
||||
if %Input%==2 goto ND
|
||||
if %Input%==3 goto FDI
|
||||
if %Input%==4 goto FD
|
||||
if %Input%==5 goto NL
|
||||
if %Input%==6 goto FL
|
||||
|
||||
goto exit
|
||||
|
||||
:NDI
|
||||
start ispawn.exe 28000 Tribes2.exe -dedicated -mod Construction
|
||||
goto exit
|
||||
|
||||
:ND
|
||||
start Tribes2.exe -dedicated -mod Construction
|
||||
goto exit
|
||||
|
||||
:FDI
|
||||
start ispawn.exe 28000 Tribes2.exe -nologin -dedicated -mod Construction
|
||||
goto exit
|
||||
|
||||
:FD
|
||||
start Tribes2.exe -nologin -dedicated -mod Construction
|
||||
goto exit
|
||||
|
||||
:NL
|
||||
start Tribes2.exe -online -mod Construction
|
||||
goto exit
|
||||
|
||||
:FL
|
||||
start Tribes2.exe -nologin -mod Construction
|
||||
goto exit
|
||||
|
||||
:exit
|
||||
3
Construction Dedicated Server.bat
Executable file
3
Construction Dedicated Server.bat
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
cd ..\
|
||||
start ispawn.exe 28000 Tribes2.exe -dedicated -mod Construction
|
||||
exit
|
||||
3
Construction Offline Practice And LAN.bat
Executable file
3
Construction Offline Practice And LAN.bat
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
cd ..\
|
||||
start Tribes2.exe -nologin -mod Construction
|
||||
exit
|
||||
3
Construction Online Listen Server.bat
Executable file
3
Construction Online Listen Server.bat
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
cd ..\
|
||||
start Tribes2.exe -online -mod Construction
|
||||
exit
|
||||
7
ConstructionPreferences.cs
Executable file
7
ConstructionPreferences.cs
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
//AA Construction Mod Preferences
|
||||
|
||||
//Logging:
|
||||
$Construction::Logging::EchoChat = 1;
|
||||
$Construction::Logging::LogConnects = 1; //disconnects too
|
||||
$Construction::Logging::LogChat = 1;
|
||||
|
||||
56
Credits.txt
Executable file
56
Credits.txt
Executable file
|
|
@ -0,0 +1,56 @@
|
|||
Don't forget to add yourself to this list.. :D
|
||||
|
||||
**JackTL**
|
||||
For:
|
||||
Maintaining mod from v50a.
|
||||
|
||||
**Construct**
|
||||
For:
|
||||
providing main idea.
|
||||
still providing great ideas to keep the mod going.
|
||||
Testing and tweacking.
|
||||
lot's of additions and coding help.
|
||||
The neat installer.
|
||||
|
||||
**Tutorial makers**
|
||||
For:
|
||||
Making tutorials.. duh..
|
||||
|
||||
**Lucid**
|
||||
For:
|
||||
Helping me with the code.
|
||||
providing me with a great decontruct gun.
|
||||
the neat looking loadscreen.
|
||||
For being willing to help me with lots of stuff
|
||||
|
||||
**Badshot**
|
||||
For:
|
||||
Taking the time to help me with some nasty bugs.
|
||||
Knowing alot for tribes2 stuff.. and being willing to share it.
|
||||
Helping all those other modders.
|
||||
|
||||
**DynaBlade**
|
||||
For:
|
||||
His Awesome function librarys
|
||||
|
||||
**T2CC**
|
||||
For:
|
||||
Their great forum and putting all that coding power at your very fingertips.
|
||||
|
||||
**Child_Killer**
|
||||
For:
|
||||
Providing code that was posted before my time and being a great help so far.
|
||||
|
||||
**All those who I fogot to mention sofar**
|
||||
For:
|
||||
Whatever they did to help this mod.
|
||||
|
||||
**All those who wanted to help but couldn't**
|
||||
Remember, it's the thought that counts ;)
|
||||
|
||||
|
||||
**By**
|
||||
Mostlikely,
|
||||
|
||||
I don't need any credit for this mod, it was created for the people who want to play it (which includes me)
|
||||
Feel free to use any stuff from this mod or ask me about it if you can't extract it somehow.
|
||||
30
DSO Remover.bat
Executable file
30
DSO Remover.bat
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
@echo off
|
||||
color 2f
|
||||
cls
|
||||
echo;
|
||||
echo;
|
||||
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
echo º 0.70 DSO Remover º
|
||||
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
|
||||
echo º This DOS batch file will remove those pesky dso's from º
|
||||
echo º your Tribes 2 installation. Regardless of where it is. º
|
||||
echo ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
|
||||
echo º Remove all DSO files(not flagged as read only) from º
|
||||
echo º Tribes 2 directory by pressing enter. º
|
||||
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
echo;
|
||||
echo;
|
||||
pause
|
||||
cd ..
|
||||
del /s /q *.dso
|
||||
cls
|
||||
echo;
|
||||
echo;
|
||||
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
|
||||
echo º Success! º
|
||||
echo º º
|
||||
echo º All dso's from Tribes 2 have been removed. º
|
||||
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
|
||||
echo;
|
||||
echo;
|
||||
pause
|
||||
BIN
Flatland.vl2
Executable file
BIN
Flatland.vl2
Executable file
Binary file not shown.
19
MergeToolTemp.txt
Executable file
19
MergeToolTemp.txt
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
//--- OBJECT WRITE BEGIN ---
|
||||
new StaticShape() {
|
||||
position = "-64.2835 -288.237 372.459";
|
||||
rotation = "0.107068 0.992328 0.0618146 120.382";
|
||||
scale = "1.25042 8.33293 1";
|
||||
dataBlock = "DeployedSpine";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
|
||||
powerFreq = "1";
|
||||
lastState = "0";
|
||||
team = "1";
|
||||
needsFit = "1";
|
||||
Target = "-1";
|
||||
powerCount = "0";
|
||||
dObj = "14069";
|
||||
Ownerguid = "2003098";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
1108
Version-history.txt
Executable file
1108
Version-history.txt
Executable file
File diff suppressed because it is too large
Load diff
663
console_end.cs
Executable file
663
console_end.cs
Executable file
|
|
@ -0,0 +1,663 @@
|
|||
if ( $pref::Shell::lastBackground > 4 )
|
||||
$pref::Shell::lastBackground = 0;
|
||||
else
|
||||
$pref::Shell::lastBackground++;
|
||||
|
||||
// load default controls:
|
||||
exec("scripts/controlDefaults.cs");
|
||||
|
||||
// override with control settings
|
||||
if ( $pref::Input::ActiveConfig !$= "" )
|
||||
exec( "prefs/" @ $pref::Input::ActiveConfig @ ".cs", false, true );
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// z0dd - ZOD, 5/8/02. Moved here so scripters can use the message callback feature.
|
||||
// message.cs is loaded so autoexec can add new message callbacks
|
||||
exec("scripts/message.cs");
|
||||
|
||||
//exec any user created .cs files found in scripts/autoexec (order is that returned by the OS)
|
||||
function loadCustomScripts()
|
||||
{
|
||||
%path = "scripts/autoexec/*.cs";
|
||||
for( %file = findFirstFile( %path ); %file !$= ""; %file = findNextFile( %path ) )
|
||||
exec( %file );
|
||||
}
|
||||
loadCustomScripts();
|
||||
|
||||
// override settings from autoexec.cs
|
||||
exec("autoexec.cs");
|
||||
$LoginName = "";
|
||||
$LoginPassword = "";
|
||||
|
||||
//TINMAN hack to add a command line option for starting a bot match...
|
||||
if ($CmdLineBotCount !$= "")
|
||||
{
|
||||
$Host::BotCount = $CmdLineBotCount;
|
||||
}
|
||||
|
||||
// message.cs is loaded so autoexec can add new message callbacks
|
||||
// z0dd - ZOD, 5/8/02. Moved so scripters can use the message callback feature.
|
||||
//exec("scripts/message.cs");
|
||||
|
||||
//function to be called when the game exits
|
||||
function onExit()
|
||||
{
|
||||
if ( !isDemo() && isObject($IRCClient.tcp) )
|
||||
IRCClient::quit();
|
||||
|
||||
echo("exporting pref::* to ClientPrefs.cs");
|
||||
export("$pref::*", "prefs/ClientPrefs.cs", False);
|
||||
BanList::Export("prefs/banlist.cs");
|
||||
if ( $PlayingOnline )
|
||||
savePlayerDatabase();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
exec("scripts/LaunchLanGui.cs");
|
||||
exec("scripts/GameGui.cs");
|
||||
exec("scripts/ChooseFilterDlg.cs");
|
||||
exec("scripts/TrainingGui.cs");
|
||||
exec("scripts/webstuff.cs");
|
||||
exec("scripts/webemail.cs");
|
||||
exec("scripts/webbrowser.cs");
|
||||
exec("scripts/webtest.cs");
|
||||
exec("scripts/weblinks.cs");
|
||||
exec("scripts/OptionsDlg.cs");
|
||||
exec("scripts/EditChatMenuGui.cs");
|
||||
exec("scripts/scoreList.cs");
|
||||
exec("scripts/LobbyGui.cs");
|
||||
exec("scripts/DebriefGui.cs");
|
||||
exec("scripts/commonDialogs.cs");
|
||||
exec("scripts/client.cs");
|
||||
exec("scripts/server.cs");
|
||||
exec("scripts/hud.cs");
|
||||
exec("scripts/objectiveHud.cs");
|
||||
exec("scripts/vehicles/clientVehicleHud.cs");
|
||||
exec("scripts/inventoryHud.cs");
|
||||
exec("scripts/chatMenuHud.cs");
|
||||
exec("scripts/scoreScreen.cs");
|
||||
exec("scripts/loadingGui.cs");
|
||||
exec("scripts/helpGuiText.cs");
|
||||
exec("scripts/voiceChat.cs");
|
||||
exec("scripts/clientTasks.cs");
|
||||
exec("scripts/targetManager.cs");
|
||||
exec("scripts/gameCanvas.cs");
|
||||
exec("scripts/centerPrint.cs");
|
||||
exec("scripts/CreditsGui.cs");
|
||||
exec("scripts/modScripts/init.cs");
|
||||
if (isDemo())
|
||||
exec("scripts/DemoEndGui.cs");
|
||||
exec("scripts/ChatGui.cs");
|
||||
|
||||
// see if the mission and type are valid
|
||||
// if they are they will be assigned into $Host::Map and $Host::MissionType
|
||||
if($mission !$= "" && $missionType !$= "")
|
||||
validateMissionAndType($mission, $missionType);
|
||||
|
||||
if($LaunchMode $= "DedicatedServer")
|
||||
{
|
||||
enableWinConsole(true);
|
||||
$Host::Dedicated = true;
|
||||
$HostGameType = "Online";
|
||||
$ServerName = $Host::GameName;
|
||||
setNetPort($Host::Port);
|
||||
CreateServer($Host::Map, $Host::MissionType);
|
||||
return;
|
||||
}
|
||||
else if($LaunchMode $= "Console")
|
||||
{
|
||||
enableWinConsole(true);
|
||||
$Host::Dedicated = true;
|
||||
return;
|
||||
}
|
||||
else if($LaunchMode $= "NavBuild")
|
||||
{
|
||||
enableWinConsole(true);
|
||||
$Host::Dedicated = true;
|
||||
$ServerName = $Host::GameName;
|
||||
$Host::MissionType = $missionType;
|
||||
$Host::Map = $Mission;
|
||||
setNetPort($Host::Port);
|
||||
CreateServer($Mission, $missionType);
|
||||
return;
|
||||
}
|
||||
else if($LaunchMode $= "SpnBuild")
|
||||
{
|
||||
enableWinConsole(true);
|
||||
$Host::Dedicated = true;
|
||||
$ServerName = $Host::GameName;
|
||||
$Host::MissionType = $missionType;
|
||||
$Host::Map = $Mission;
|
||||
setNetPort($Host::Port);
|
||||
CreateServer($Mission, $missionType);
|
||||
return;
|
||||
}
|
||||
|
||||
function recordMovie(%movieName, %fps)
|
||||
{
|
||||
$timeAdvance = 1000 / %fps;
|
||||
$screenGrabThread = schedule("movieGrabScreen(" @ %movieName @ ", 0);", $timeAdvance);
|
||||
}
|
||||
|
||||
function movieGrabScreen(%movieName, %frameNumber)
|
||||
{
|
||||
if(%frameNumber < 10)
|
||||
%frameNumber = "0" @ %frameNumber;
|
||||
if(%frameNumber < 100)
|
||||
%frameNumber = "0" @ %frameNumber;
|
||||
if(%frameNumber < 1000)
|
||||
%frameNumber = "0" @ %frameNumber;
|
||||
if(%frameNumber < 10000)
|
||||
%frameNumber = "0" @ %frameNumber;
|
||||
screenshot(%movieName @ %frameNumber @ ".png");
|
||||
$screenGrabThread = schedule("movieGrabScreen(" @ %movieName @ "," @ %frameNumber + 1 @ ");", $timeAdvance);
|
||||
}
|
||||
|
||||
function stopMovie()
|
||||
{
|
||||
cancel($screenGrabThread);
|
||||
}
|
||||
|
||||
function loadGui(%gui)
|
||||
{
|
||||
exec("gui/" @ %gui @ ".gui");
|
||||
}
|
||||
|
||||
exec("scripts/clientAudio.cs");
|
||||
exec("gui/guiProfiles.cs");
|
||||
exec("scripts/recordings.cs");
|
||||
|
||||
// tool guis
|
||||
loadGui("GuiEditorGui");
|
||||
loadGui("consoleDlg");
|
||||
loadGui("InspectDlg");
|
||||
loadGui("CommonLoadDlg");
|
||||
loadGui("CommonSaveDlg");
|
||||
loadGui("FrameOverlayGui");
|
||||
loadGui("TribeAdminMemberDlg");
|
||||
loadGui("TSShowGui");
|
||||
loadGui("TSShowLoadDlg");
|
||||
loadGui("TSShowMiscDlg");
|
||||
loadGui("TSShowThreadControlDlg");
|
||||
loadGui("TSShowEditScale");
|
||||
loadGui("TSShowLightDlg");
|
||||
loadGui("TSShowTransitionDlg");
|
||||
loadGui("TSShowTranDurEditDlg");
|
||||
loadGui("TSShowDetailControlDlg");
|
||||
|
||||
// debugger GUI's
|
||||
function Debugger()
|
||||
{
|
||||
if(!$DebuggerLoaded)
|
||||
{
|
||||
loadGui("debuggerGui");
|
||||
loadGui("DebuggerBreakConditionDlg");
|
||||
loadGui("DebuggerConnectDlg");
|
||||
loadGui("DebuggerEditWatchDlg");
|
||||
loadGui("DebuggerWatchDlg");
|
||||
loadGui("DebuggerFindDlg");
|
||||
exec("scripts/debuggerGui.cs");
|
||||
$DebuggerLoaded = true;
|
||||
}
|
||||
Canvas.setContent(DebuggerGui);
|
||||
}
|
||||
|
||||
// test GUIs
|
||||
loadGui("GuiTestGui");
|
||||
|
||||
// common shell dialogs:
|
||||
loadGui("MessageBoxDlg");
|
||||
loadGui("MessagePopupDlg");
|
||||
loadGui("ShellLoadFileDlg");
|
||||
loadGui("ShellSaveFileDlg");
|
||||
|
||||
// menus
|
||||
loadGui("AddressDlg");
|
||||
loadGui("GenDialog");
|
||||
loadGui("LaunchGui");
|
||||
loadGui("LaunchToolbarDlg");
|
||||
loadGui("GameGui");
|
||||
loadGui("ChooseFilterDlg");
|
||||
loadGui("ServerInfoDlg");
|
||||
loadGui("EnterIPDlg");
|
||||
loadGui("FindServerDlg");
|
||||
loadGui("AdvancedHostDlg");
|
||||
loadGui("NewWarriorDlg");
|
||||
loadGui("JoinChatDlg");
|
||||
loadGui("ChannelKeyDlg");
|
||||
loadGui("ChatOptionsDlg");
|
||||
loadGui("ChannelOptionsDlg");
|
||||
loadGui("ChannelBanDlg");
|
||||
loadGui("FilterEditDlg");
|
||||
loadGui("PasswordDlg");
|
||||
loadGui("OptionsDlg");
|
||||
loadGui("DriverInfoDlg");
|
||||
loadGui("RemapDlg");
|
||||
loadGui("MouseConfigDlg");
|
||||
loadGui("JoystickConfigDlg");
|
||||
loadGui("EditChatMenuGui");
|
||||
loadGui("EditChatMenuDlg");
|
||||
loadGui("EditChatCommandDlg");
|
||||
loadGui("ChatGui");
|
||||
loadGui("EmailGui");
|
||||
loadGui("EmailBlockDlg");
|
||||
loadGui("EmailComposeDlg");
|
||||
loadGui("TribeAndWarriorBrowserGui");
|
||||
loadGui("TribePropertiesDlg");
|
||||
loadGui("WarriorPropertiesDlg");
|
||||
loadGui("BrowserSearchDlg");
|
||||
loadGui("BrowserEditInfoDlg");
|
||||
loadGui("CreateTribeDlg");
|
||||
loadGui("RecordingsDlg");
|
||||
loadGui("DemoLoadProgressDlg");
|
||||
loadGui("DemoRenameFileDlg");
|
||||
loadGui("DemoPlaybackDlg");
|
||||
loadGui("TrainingGui");
|
||||
loadGui("SinglePlayerEscapeDlg");
|
||||
loadGui("LobbyGui");
|
||||
loadGui("DebriefGui");
|
||||
loadGui("CreditsGui");
|
||||
if (isDemo())
|
||||
loadGui("DemoEndGui");
|
||||
loadGui("MoveThreadDlg");
|
||||
loadGui("NewMissionGui");
|
||||
loadGui("ChatDlg");
|
||||
loadGui("PlayGui");
|
||||
loadGui("PanoramaGui");
|
||||
loadGui("LoadingGui");
|
||||
loadGui("TestGui");
|
||||
|
||||
// HUD GUI's:
|
||||
loadGui("HUDDlgs");
|
||||
|
||||
// TR2 Huds
|
||||
exec("prefs/TR2HudPrefs.cs");
|
||||
exec("scripts/TR2BonusHud.cs");
|
||||
exec("scripts/TR2EventHud.cs");
|
||||
exec("scripts/TR2FlagToss.cs");
|
||||
|
||||
// terraformer GUI's
|
||||
loadGui("helpTextGui");
|
||||
|
||||
//
|
||||
|
||||
loadGui("InteriorPreviewGui");
|
||||
loadGui("InteriorDebug");
|
||||
exec("scripts/editor.cs");
|
||||
loadGui("SceneLightingGui");
|
||||
loadGui("InspectAddFieldDlg");
|
||||
|
||||
loadGui("PickTeamDlg");
|
||||
|
||||
loadGui("DetailSetDlg");
|
||||
|
||||
loadGui("IHVTest");
|
||||
|
||||
// Load material properties
|
||||
echo("Load Material Properties:");
|
||||
//exec("textures/badlands/badlandsPropMap.cs");
|
||||
//exec("textures/desert/desertPropMap.cs");
|
||||
//exec("textures/ice/icePropMap.cs");
|
||||
//exec("textures/lava/lavaPropMap.cs");
|
||||
//exec("textures/lush/lushPropMap.cs");
|
||||
exec("scripts/badlandsPropMap.cs");
|
||||
exec("scripts/desertPropMap.cs");
|
||||
exec("scripts/icePropMap.cs");
|
||||
exec("scripts/lavaPropMap.cs");
|
||||
exec("scripts/lushPropMap.cs");
|
||||
|
||||
// commander map
|
||||
exec("scripts/commanderProfiles.cs");
|
||||
exec("scripts/commanderMap.cs");
|
||||
exec("scripts/commanderMapHelpText.cs");
|
||||
|
||||
loadGui(CommanderMapGui);
|
||||
loadGui(cmdMapHelpText);
|
||||
loadGui(TaskHudDlg);
|
||||
|
||||
|
||||
function frameCounter()
|
||||
{
|
||||
return " FPS: " @ $fps::real @
|
||||
" mspf: " @ 1000 / $fps::real;
|
||||
}
|
||||
|
||||
function terrMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" L0: " @ $T2::levelZeroCount @
|
||||
" FMC: " @ $T2::fullMipCount @
|
||||
" DTC: " @ $T2::dynamicTextureCount @
|
||||
" UNU: " @ $T2::unusedTextureCount @
|
||||
" STC: " @ $T2::staticTextureCount @
|
||||
" DTSU: " @ $T2::textureSpaceUsed @
|
||||
" STSU: " @ $T2::staticTSU @
|
||||
" FRB: " @ $T2::FogRejections;
|
||||
}
|
||||
|
||||
function triMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" TC: " @ $OpenGL::triCount0 + $OpenGL::triCount1 + $OpenGL::triCount2 + $OpenGL::triCount3 @
|
||||
" PC: " @ $OpenGL::primCount0 + $OpenGL::primCount1 + $OpenGL::primCount2 + $OpenGL::primCount3 @
|
||||
" T_T: " @ $OpenGL::triCount1 @
|
||||
" T_P: " @ $OpenGL::primCount1 @
|
||||
" I_T: " @ $OpenGL::triCount2 @
|
||||
" I_P: " @ $OpenGL::primCount2 @
|
||||
" TS_T: " @ $OpenGL::triCount3 @
|
||||
" TS_P: " @ $OpenGL::primCount3 @
|
||||
" ?_T: " @ $OpenGL::triCount0 @
|
||||
" ?_P: " @ $OpenGL::primCount0;
|
||||
}
|
||||
|
||||
function interiorMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" NTL: " @ $Video::numTexelsLoaded @
|
||||
" TRP: " @ $Video::texResidentPercentage @
|
||||
" INP: " @ $Metrics::Interior::numPrimitives @
|
||||
" INT: " @ $Matrics::Interior::numTexturesUsed @
|
||||
" INO: " @ $Metrics::Interior::numInteriors;
|
||||
}
|
||||
|
||||
function textureMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" NTL: " @ $Video::numTexelsLoaded @
|
||||
" TRP: " @ $Video::texResidentPercentage @
|
||||
" TCM: " @ $Video::textureCacheMisses;
|
||||
}
|
||||
|
||||
function waterMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" Tri#: " @ $T2::waterTriCount @
|
||||
" Pnt#: " @ $T2::waterPointCount @
|
||||
" Hz#: " @ $T2::waterHazePointCount;
|
||||
}
|
||||
|
||||
function timeMetrics()
|
||||
{
|
||||
return frameCounter() @ " Time: " @ getSimTime() @ " Mod: " @ getSimTime() % 32;
|
||||
}
|
||||
|
||||
function vehicleMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" R: " @ $Vehicle::retryCount @
|
||||
" C: " @ $Vehicle::searchCount @
|
||||
" P: " @ $Vehicle::polyCount @
|
||||
" V: " @ $Vehicle::vertexCount;
|
||||
}
|
||||
|
||||
function audioMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" OH: " @ $Audio::numOpenHandles @
|
||||
" OLH: " @ $Audio::numOpenLoopingHandles @
|
||||
" OVH: " @ $Audio::numOpenVoiceHandles @
|
||||
" AS: " @ $Audio::numActiveStreams @
|
||||
" NAS: " @ $Audio::numNullActiveStreams @
|
||||
" LAS: " @ $Audio::numActiveLoopingStreams @
|
||||
" VAS: " @ $Audio::numActiveVoiceStreams @
|
||||
" LS: " @ $Audio::numLoopingStreams @
|
||||
" ILS: " @ $Audio::numInactiveLoopingStreams @
|
||||
" CLS: " @ $Audio::numCulledLoopingStreams @
|
||||
" MEM: " @ $Audio::memUsage @
|
||||
" DYN: " @ $Audio::dynamicMemUsage @
|
||||
" / " @ $Audio::dynamicMemSize @
|
||||
" CNT: " @ $Audio::dynamicBufferCount @
|
||||
" / " @ $Audio::bufferCount;
|
||||
}
|
||||
|
||||
function DebugMetrics()
|
||||
{
|
||||
return frameCounter() @
|
||||
" NTL: " @ $Video::numTexelsLoaded @
|
||||
" TRP: " @ $Video::texResidentPercentage @
|
||||
" NP: " @ $Metrics::numPrimitives @
|
||||
" NT: " @ $Metrics::numTexturesUsed @
|
||||
" NO: " @ $Metrics::numObjectsRendered;
|
||||
}
|
||||
|
||||
function showMapperMetrics( %expr )
|
||||
{
|
||||
GLEnableMetrics( %expr );
|
||||
|
||||
if( Canvas.getContent() != PlayGui.getId() )
|
||||
metricsIMain.setVisible( %expr );
|
||||
else
|
||||
metricsMain.setVisible( %expr );
|
||||
}
|
||||
|
||||
function showTerr()
|
||||
{
|
||||
show("terrMetrics()");
|
||||
}
|
||||
|
||||
function showTri()
|
||||
{
|
||||
GLEnableMetrics(true);
|
||||
show("triMetrics()");
|
||||
}
|
||||
|
||||
function showTime()
|
||||
{
|
||||
show("timeMetrics()");
|
||||
}
|
||||
|
||||
function showWater()
|
||||
{
|
||||
show("waterMetrics()");
|
||||
}
|
||||
|
||||
function showTexture()
|
||||
{
|
||||
show("textureMetrics()");
|
||||
}
|
||||
|
||||
function showInterior()
|
||||
{
|
||||
$fps::virtual = 0;
|
||||
$Interior::numPolys = 0;
|
||||
$Interior::numTextures = 0;
|
||||
$Interior::numTexels = 0;
|
||||
$Interior::numLightmaps = 0;
|
||||
$Interior::numLumels = 0;
|
||||
show("interiorMetrics()");
|
||||
}
|
||||
|
||||
function showVehicle()
|
||||
{
|
||||
show("vehicleMetrics()");
|
||||
}
|
||||
|
||||
function showAudio()
|
||||
{
|
||||
show("audioMetrics()");
|
||||
}
|
||||
|
||||
function showDebug()
|
||||
{
|
||||
show("DebugMetrics()");
|
||||
}
|
||||
|
||||
|
||||
function show(%expr)
|
||||
{
|
||||
if(%expr $= "")
|
||||
{
|
||||
GLEnableMetrics(false);
|
||||
Canvas.popDialog(FrameOverlayGui);
|
||||
}
|
||||
else
|
||||
{
|
||||
Canvas.pushDialog(FrameOverlayGui, 1000);
|
||||
TextOverlayControl.setValue(%expr);
|
||||
}
|
||||
}
|
||||
//showInterior();
|
||||
|
||||
// check the launch mode:
|
||||
|
||||
Canvas.setCursor("DefaultCursor");
|
||||
|
||||
function dumpFile(%fileName)
|
||||
{
|
||||
%file = new FileObject();
|
||||
if(%file.openForRead(%fileName))
|
||||
{
|
||||
while(!%file.isEOF())
|
||||
echo(%file.readLine());
|
||||
}
|
||||
%file.delete();
|
||||
}
|
||||
|
||||
function doScreenShot(%val)
|
||||
{
|
||||
$pref::interior::showdetailmaps = false;
|
||||
if(!%val)
|
||||
screenShot("screen" @ $screenshotnum++ @ ".png");
|
||||
}
|
||||
|
||||
// set up the movement action map
|
||||
GlobalActionMap.bind(keyboard, "print", doScreenShot);
|
||||
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "toggleFullScreen();");
|
||||
|
||||
// Get the joystick binding functions:
|
||||
exec( "scripts/joystickBind.cs" );
|
||||
|
||||
function clientCMDgetManagerID(%client)
|
||||
{
|
||||
$client = %client;
|
||||
}
|
||||
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- //
|
||||
|
||||
function abs(%val)
|
||||
{
|
||||
if (%val < 0)
|
||||
return %val * -1;
|
||||
else
|
||||
return %val;
|
||||
}
|
||||
|
||||
//##############################################################################
|
||||
//CreateServer(testmission);
|
||||
//LocalConnect(UberBob);
|
||||
//##############################################################################
|
||||
|
||||
function ServerConnectionAccepted()
|
||||
{
|
||||
if ( !isDemo() )
|
||||
{
|
||||
%info = GMJ_Browser.getServerInfoString();
|
||||
%desc = "joined a" SPC getField(%info,4) @ " game (" @ getField(%info,3) @ ") on the \"" @ getField(%info,0) @ "\" server.";
|
||||
|
||||
IRCClient::onJoinGame($JoinGameAddress,%desc);
|
||||
|
||||
if ( !$pref::Net::CheckEmail )
|
||||
CancelEmailCheck();
|
||||
|
||||
// if($pref::Net::DisconnectChat)
|
||||
// IRCClient::quit();
|
||||
}
|
||||
|
||||
checkGotLoadInfo();
|
||||
}
|
||||
|
||||
function LocalConnectionAccepted()
|
||||
{
|
||||
if ( !isDemo() )
|
||||
{
|
||||
%desc = $pref::IRCClient::hostmsg;
|
||||
|
||||
IRCClient::onJoinGame("", %desc);
|
||||
|
||||
if ( !$pref::Net::CheckEmail )
|
||||
CancelEmailCheck();
|
||||
|
||||
// if($pref::Net::DisconnectChat)
|
||||
// IRCClient::quit(); //this is screwed up right now ^^
|
||||
}
|
||||
|
||||
checkGotLoadInfo();
|
||||
}
|
||||
|
||||
function checkGotLoadInfo()
|
||||
{
|
||||
if ( LoadingGui.gotLoadInfo )
|
||||
Canvas.setContent( LoadingGui );
|
||||
else
|
||||
LoadingGui.checkSchedule = schedule( 500, 0, checkGotLoadInfo );
|
||||
}
|
||||
|
||||
function cancelLoadInfoCheck()
|
||||
{
|
||||
if ( LoadingGui.checkSchedule )
|
||||
{
|
||||
cancel( LoadingGui.checkSchedule );
|
||||
LoadingGui.checkSchedule = "";
|
||||
}
|
||||
}
|
||||
|
||||
function DispatchLaunchMode()
|
||||
{
|
||||
switch$($LaunchMode)
|
||||
{
|
||||
case "InteriorView":
|
||||
if ( isFile( "missions/interiorTest.mis" ) )
|
||||
{
|
||||
$InteriorArgument = $TestObjectFileName;
|
||||
$extension = fileExt( $TestObjectFileName );
|
||||
if ( stricmp( $extension, ".dif\"" ) == 0 )
|
||||
{
|
||||
// Have to adjust for quotes:
|
||||
$TestObjectFileName = getSubStr( $TestObjectFileName,
|
||||
1, strlen( $TestObjectFileName ) - 2 );
|
||||
}
|
||||
|
||||
if ( getSubStr( $TestObjectFileName, strlen( $TestObjectFileName ) - 6, 1 ) $= "_" )
|
||||
{
|
||||
// Strip the detail part off...
|
||||
$TestObjectFileName = getSubStr( $TestObjectFileName, 0, strlen( $TestObjectFileName ) - 6 ) @ ".dif";
|
||||
}
|
||||
|
||||
echo( $TestObjectFileName @ " is the file loaded" );
|
||||
|
||||
$ServerName = $Host::GameName;
|
||||
$Host::TimeLimit = 60;
|
||||
CreateServer( "interiorTest", "InteriorTest" );
|
||||
localConnect( "TestGuy" );
|
||||
}
|
||||
else
|
||||
MessageBoxOK( "FILE NOT FOUND", "You do not have the interior test mission in your mission folder.\nTalk to Brad or Tom to get it.", "quit();" );
|
||||
case "Connect":
|
||||
OnlineLogIn();
|
||||
setNetPort(0);
|
||||
JoinGame($JoinGameAddress);
|
||||
case "HostGame":
|
||||
$ServerName = $Host::GameName;
|
||||
$Host::MissionType = $MissionType;
|
||||
$Host::Map = $Mission;
|
||||
CreateServer($Mission, $MissionType);
|
||||
localConnect();
|
||||
case "Normal":
|
||||
OnlineLogIn();
|
||||
case "Offline":
|
||||
PlayOffline();
|
||||
case "TSShow":
|
||||
startShow();
|
||||
case "SceneLight":
|
||||
CreateServer($Mission);
|
||||
localConnect();
|
||||
case "Demo":
|
||||
LoopDemos();
|
||||
}
|
||||
}
|
||||
|
||||
// if($LaunchMode !$= "Demo")
|
||||
// VerifyCDCheck(DispatchLaunchMode);
|
||||
// else
|
||||
DispatchLaunchMode();
|
||||
661
missions/Starfallen Construction.mis
Executable file
661
missions/Starfallen Construction.mis
Executable file
|
|
@ -0,0 +1,661 @@
|
|||
// MissionTypes = Construction
|
||||
|
||||
//--- MISSION QUOTE BEGIN ---
|
||||
//
|
||||
//--- MISSION QUOTE END ---
|
||||
|
||||
//--- MISSION STRING BEGIN ---
|
||||
//Map originally by v5planet
|
||||
//Modified for construction by Dark Dragon DX
|
||||
//
|
||||
//--- MISSION STRING END ---
|
||||
|
||||
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new SimGroup(MissionGroup) {
|
||||
|
||||
CTF_scoreLimit = "6";
|
||||
musicTrack = "lush";
|
||||
cdTrack = "6";
|
||||
CTF_timeLimit = "25";
|
||||
powerCount = "0";
|
||||
|
||||
new MissionArea(MissionArea) {
|
||||
area = "-920 -784 1856 1552";
|
||||
flightCeiling = "300";
|
||||
flightCeilingRange = "20";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new SimGroup(ObserverDropPoints) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new Camera(one) {
|
||||
position = "-362.069 378.172 183.929";
|
||||
rotation = "0.36801 0.21614 -0.904352 66.0024";
|
||||
scale = "1 1 1";
|
||||
dataBlock = "Observer";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
|
||||
team = "1";
|
||||
};
|
||||
};
|
||||
new Sun() {
|
||||
position = "-361.911 369.705 299.466";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
direction = "0.57735 0.57735 -0.57735";
|
||||
color = "0.250000 0.350000 0.350000 1.000000";
|
||||
ambient = "0.240000 0.350000 0.350000 1.000000";
|
||||
texture[0] = "special/sunFlare";
|
||||
texture[1] = "special/sunFlare02";
|
||||
texture[2] = "special/LensFlare/flare01";
|
||||
texture[3] = "special/LensFlare/flare02";
|
||||
texture[4] = "special/LensFlare/flare03";
|
||||
lensFlareScale = "0.7";
|
||||
lensFlareIntensity = "1";
|
||||
frontFlareSize = "300";
|
||||
backFlareSize = "450";
|
||||
flareColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new Sky(Sky) {
|
||||
position = "0 0 0";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
cloudHeightPer[0] = "0.349971";
|
||||
cloudHeightPer[1] = "0.25";
|
||||
cloudHeightPer[2] = "0.199973";
|
||||
cloudSpeed1 = "0.0001";
|
||||
cloudSpeed2 = "0.0002";
|
||||
cloudSpeed3 = "0.0003";
|
||||
visibleDistance = "560";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.260000 0.410000 0.440000 1.000000";
|
||||
fogDistance = "420";
|
||||
fogColor = "0.260000 0.410000 0.440000 1.000000";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "Starfallen.dml";
|
||||
windVelocity = "1 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 -36610319922801672200.000000";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 9500070315656657560000000.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
high_visibleDistance = "-1";
|
||||
high_fogDistance = "-1";
|
||||
high_fogVolume1 = "-1 -2.58511e+36 2.28656e-38";
|
||||
high_fogVolume2 = "-1 -1991.03 nan";
|
||||
high_fogVolume3 = "-1 7945.87 7.22445e-09";
|
||||
|
||||
cloudSpeed0 = "0.0000003 0.0000003";
|
||||
locked = "true";
|
||||
};
|
||||
new TerrainBlock(Terrain) {
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
detailTexture = "details/Lushdet2";
|
||||
terrainFile = "Starfallen.ter";
|
||||
squareSize = "8";
|
||||
|
||||
visibleDistance = "1000";
|
||||
locked = "true";
|
||||
position = "-1024 -1024 0";
|
||||
hazeDistance = "500";
|
||||
};
|
||||
new NavigationGraph(NavGraph) {
|
||||
conjoinAngleDev = "70";
|
||||
cullDensity = "0.3";
|
||||
customArea = "0 0 0 0";
|
||||
|
||||
rotation = "0 0 0 0";
|
||||
XDimOverSize = "0";
|
||||
scale = "1 1 1";
|
||||
YDimOverSize = "0";
|
||||
locked = "true";
|
||||
coverage = "0";
|
||||
GraphFile = "Harvester_x.nav";
|
||||
position = "0 0 0 1";
|
||||
conjoinBowlDev = "20";
|
||||
};
|
||||
new SimGroup(Teams) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new SimGroup(team0) {
|
||||
|
||||
powerCount = "0";
|
||||
};
|
||||
new SimGroup(Team1) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new SimGroup(spawnspheres) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new SpawnSphere() {
|
||||
position = "-400.681 392.822 163.771";
|
||||
rotation = "0 0 -1 89.5636";
|
||||
scale = "1 1 1";
|
||||
dataBlock = "SpawnSphereMarker";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
radius = "100";
|
||||
sphereWeight = "100";
|
||||
indoorWeight = "100";
|
||||
outdoorWeight = "100";
|
||||
};
|
||||
};
|
||||
new SimGroup(base) {
|
||||
|
||||
powerCount = "1";
|
||||
|
||||
new StaticShape() {
|
||||
position = "-393.019 393.01 148.326";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
nameTag = "Construction";
|
||||
dataBlock = "GeneratorLarge";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
|
||||
team = "1";
|
||||
};
|
||||
new StaticShape() {
|
||||
position = "-417.682 404.65 164.204";
|
||||
rotation = "0 0 -1 89.5639";
|
||||
scale = "1 1 1";
|
||||
nameTag = "Construction";
|
||||
dataBlock = "StationInventory";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
|
||||
Trigger = "4952";
|
||||
team = "1";
|
||||
};
|
||||
new StaticShape() {
|
||||
position = "-400.145 392.621 160.969";
|
||||
rotation = "0 0 -1 90.1369";
|
||||
scale = "1 1 1";
|
||||
nameTag = "Construction";
|
||||
dataBlock = "StationVehiclePad";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
|
||||
Ready = "1";
|
||||
station = "7401";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
new SimGroup(Ambiance) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new AudioEmitter() {
|
||||
position = "304.398 303.957 174.523";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/growl1.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "30";
|
||||
maxDistance = "75";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "550.254 -433.469 108.995";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/crickets.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "20";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "-34.0334 -33.2358 232.868";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/moaningwind1.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "0";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "50";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "-431.725 558.013 100.077";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/crickets.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "30";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "-525.9 -285.447 107.744";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/desertowl.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "75";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "86.6119 -168.256 102.484";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/desertowl.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "75";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "557.102 7.36847 106.926";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/desertowl.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "75";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "-24.385 -869.465 107.089";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/desertowl.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "75";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new AudioEmitter() {
|
||||
position = "94.3683 201.35 105.456";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
fileName = "fx/environment/desertowl.wav";
|
||||
useProfileDescription = "0";
|
||||
outsideAmbient = "1";
|
||||
volume = "1";
|
||||
isLooping = "1";
|
||||
is3D = "1";
|
||||
minDistance = "75";
|
||||
maxDistance = "2560";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "EffectAudioType";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
};
|
||||
new SimGroup(randomObjects) {
|
||||
|
||||
powerCount = "0";
|
||||
|
||||
new TSStatic() {
|
||||
position = "-396.858 76.8633 122.342";
|
||||
rotation = "0.233516 -0.240564 0.942125 19.4504";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-586.455 -32.9101 127.317";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg19.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-468.597 -47.1803 138.057";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-254.798 196.591 120.129";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg19.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-53.7517 311.548 103.46";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "102.468 47.0556 114.177";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg19.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "117.443 13.7092 112.556";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "278.676 -204.552 145.789";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "227.683 -386.255 147.172";
|
||||
rotation = "-0.831159 0.552972 0.0582764 14.4529";
|
||||
scale = "1.1 1 1";
|
||||
shapeName = "borg19.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "92.7454 -408.944 116.704";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-42.6203 -562.432 123.07";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "319.43 -658.189 150.511";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg18.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "11.6502 -368.213 126.376";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg18.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-143.679 -156.815 109.362";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-214.796 -164.209 124.916";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-174.39 -110.495 111.715";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg18.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new InteriorInstance() {
|
||||
position = "-4.3545 -200.973 114.542";
|
||||
rotation = "1 0 0 25.7831";
|
||||
scale = "2 2 2";
|
||||
interiorFile = "brock6.dif";
|
||||
showTerrainInside = "0";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new InteriorInstance() {
|
||||
position = "-98.6385 -49.5633 112.047";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
interiorFile = "brock8.dif";
|
||||
showTerrainInside = "0";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-467.374 296.251 162.64";
|
||||
rotation = "-0.986356 0.163961 -0.0147965 10.4552";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg16.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-571.141 365.995 201.965";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-657.298 241.223 101.259";
|
||||
rotation = "-0.732038 -0.679596 -0.0476496 10.9423";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "-635.972 196.572 77.834";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg12.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new InteriorInstance() {
|
||||
position = "-489.61 88.1994 106.795";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
interiorFile = "brock7.dif";
|
||||
showTerrainInside = "0";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new InteriorInstance() {
|
||||
position = "-489.248 89.7655 108.749";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
interiorFile = "brock6.dif";
|
||||
showTerrainInside = "0";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "388.48 367.69 162.761";
|
||||
rotation = "-0.754927 0.653965 -0.0491395 11.3683";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg19.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new TSStatic() {
|
||||
position = "355.633 393.844 162.478";
|
||||
rotation = "-0.831978 0.554559 0.0166418 4.13147";
|
||||
scale = "1 1 1";
|
||||
shapeName = "borg17.dts";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
new InteriorInstance() {
|
||||
position = "300.444 303.211 169.382";
|
||||
rotation = "0 0 -1 50.4203";
|
||||
scale = "1 1 1";
|
||||
interiorFile = "brockc.dif";
|
||||
showTerrainInside = "0";
|
||||
|
||||
locked = "true";
|
||||
};
|
||||
};
|
||||
new WaterBlock() {
|
||||
position = "-168 24 49.0147";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "2048 2048 52.1746";
|
||||
liquidType = "OceanWater";
|
||||
density = "1";
|
||||
viscosity = "5";
|
||||
waveMagnitude = "0";
|
||||
surfaceTexture = "LiquidTiles/BlueWater";
|
||||
surfaceOpacity = "0.75";
|
||||
envMapTexture = "lush/skies/lushcloud1";
|
||||
envMapIntensity = "0.5";
|
||||
removeWetEdges = "0";
|
||||
AudioEnvironment = "Underwater";
|
||||
|
||||
params1 = "0.63 -2.41 0.33 0.21";
|
||||
extent = "100 100 10";
|
||||
seedPoints = "0 0 1 0 1 1 0 1";
|
||||
params0 = "0.32 -0.67 0.066 0.5";
|
||||
locked = "true";
|
||||
params3 = "1.21 -0.61 0.13 -0.33";
|
||||
textureSize = "32 32";
|
||||
floodFill = "1";
|
||||
params2 = "0.39 0.39 0.2 0.133";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
86
readme.txt
Executable file
86
readme.txt
Executable file
|
|
@ -0,0 +1,86 @@
|
|||
Note: This readme.txt has not been updated recently. Please see Version-history.txt for latest changes.
|
||||
|
||||
----
|
||||
|
||||
The BASIC IDEA:
|
||||
|
||||
-------------------------------------------------------------------------------------------
|
||||
We just like to build stuff.
|
||||
-------------------------------------------------------------------------------------------
|
||||
Up to now mods like ninja mod and warped where used to create the wierdest of structures.
|
||||
However these mods being combat orientated where limited in their building flexiblity.
|
||||
Therefor the man with the vision started "the construction mod" (or is it the mod named "construction"?)
|
||||
Anyway this mod will feature tools to make building easier, better, more realistic, more balanced and all that what other modders promise.
|
||||
It might someday very well feature gameplay that suits builders as well as non-builders.
|
||||
However until that day this mod remains for the one intrested in building and only building.
|
||||
But hey, there's a builder in everyone.
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
*******************Features******************
|
||||
|
||||
[[Beacon switching]]
|
||||
-Some packs have more than one function.
|
||||
-use the beacon key to switch.
|
||||
|
||||
[[Border snapping]]
|
||||
-When deploying on the far edge of an object the object will snap correctly to the border.
|
||||
|
||||
****************Current deployables***********
|
||||
|
||||
[[Light support beam]]<<Light armor>>
|
||||
-Comes in 5 basic lengths 1.5 meter, 4 meter, 8 meter, 40 meter and 160 meter.
|
||||
-Has two smart functions
|
||||
+auto-size, will scales the beam between 0.5 and 16 meter, if not confined it will scale to 4 meters.
|
||||
+Pad, Sizes like the auto-size beam, but also streches to create a platform.
|
||||
|
||||
[[Light Blast Wall]]<<Light armor>>
|
||||
-Works like the padsetting of the light support beam.
|
||||
-User can specify if he's in or out side his building for deploy adjustments
|
||||
-Light Blast walls can now create an good defence for buildings.
|
||||
|
||||
Problems: Placing stuff on them doesn't not work 100%
|
||||
|
||||
[[Light Walk Way]]<<Light armor>>
|
||||
-Just face the edge of a cliff and deploy to create handy walkways.
|
||||
-Can be set to slope 0%, 20%, 45% and 90% up and down.
|
||||
-Use the beacons to switch modes.
|
||||
|
||||
[[Medium support Beam]]<<Medium armor>>
|
||||
-Much stronger than it's light counter part.
|
||||
-Doesn't adjust in lenght.
|
||||
-Comes with rings you can deploy on, and stand on to easaly deploy another medium spine ontop.
|
||||
-The rings can be removed sperately.
|
||||
|
||||
[[Medium Floor]]<<Medium armor>>
|
||||
-Deploy these for a good start.
|
||||
-Deploy floors on floors to create an adjectand floor at the closest edge your deploying on.
|
||||
|
||||
[[Jumpad]]<<Medium armor>>
|
||||
-Launch the player up some distance.
|
||||
|
||||
[[Telleporter]]<<Heavy armor>>
|
||||
-40 different telle port frequencies.
|
||||
-Will only telle port to the frequency it's set to.
|
||||
-Both teams use the same 40 frequencies.
|
||||
-Dangerous side effects that become worse when the telleport is damaged.
|
||||
|
||||
[[Energizers]]<<Heavy armor>>
|
||||
-Will replenish the energy of any player within its range.
|
||||
-Using a higly unstable reactor.
|
||||
-Don't touch these, and protect them from damage at all cost.
|
||||
|
||||
[[Disk turret]]<<Medium armor>>
|
||||
-Usefull for protection
|
||||
-Be carefull, if they hit your base, it will take damage.
|
||||
|
||||
[[Deployable base turret]]<<Heavy armor>>
|
||||
-Deploy these for extra protection.
|
||||
|
||||
[[Deployable tree]]<<Medium/Heavy armors>>
|
||||
-Make places look nicer with these things.
|
||||
|
||||
Problems: Deploying on them will be screwed up.
|
||||
|
||||
[[Deconsruct Gun]]<<all armors>>
|
||||
-If you make an mistake you can correct it with this with out any dangerous side effects.
|
||||
-Make sure you remove mistakes right after you made them.
|
||||
13
scripts/AAChangelog.txt
Executable file
13
scripts/AAChangelog.txt
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
This file contains technical data.
|
||||
Try not to fry your brain.
|
||||
**************************************
|
||||
|
||||
[Dark Dragon DX]
|
||||
Date: 3:16 PM 11/29/2010
|
||||
Scripts: modScripts/chatCommands_public.cs, modScripts/chatCommands_admin.cs, modScripts/chatCommands_superAdmin.cs
|
||||
Functions: All
|
||||
Lines: All
|
||||
Changes:
|
||||
-Implemented various chat commands
|
||||
Description:
|
||||
-Many chat commands have been added, many of which have several aliases.
|
||||
408
scripts/ConstructionGame.cs
Executable file
408
scripts/ConstructionGame.cs
Executable file
|
|
@ -0,0 +1,408 @@
|
|||
// DisplayName = Construction
|
||||
|
||||
//--- GAME RULES BEGIN ---
|
||||
// Build.
|
||||
//--- GAME RULES END ---
|
||||
|
||||
// spam fix
|
||||
function ConstructionGame::AIInit(%game) {
|
||||
//call the default AIInit() function
|
||||
AIInit();
|
||||
}
|
||||
|
||||
function ConstructionGame::allowsProtectedStatics(%game)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
function ConstructionGame::clientMissionDropReady(%game, %client)
|
||||
{
|
||||
messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame");
|
||||
messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName );
|
||||
DefaultGame::clientMissionDropReady(%game, %client);
|
||||
}
|
||||
|
||||
function ConstructionGame::onAIRespawn(%game, %client)
|
||||
{
|
||||
//add the default task
|
||||
if (! %client.defaultTasksAdded)
|
||||
{
|
||||
%client.defaultTasksAdded = true;
|
||||
%client.addTask(AIPickupItemTask);
|
||||
// %client.addTask(AIUseInventoryTask);
|
||||
%client.addTask(AITauntCorpseTask);
|
||||
%client.addTask(AIEngageTurretTask);
|
||||
%client.addTask(AIDetectMineTask);
|
||||
%client.addTask(AIBountyPatrolTask);
|
||||
%client.bountyTask = %client.addTask(AIBountyEngageTask);
|
||||
}
|
||||
|
||||
//AI's get Construction toolz too
|
||||
%client.player.clearInventory();
|
||||
%client.player.setInventory("ConstructionTool",1,true);
|
||||
%client.player.setInventory("MergeTool",1,true);
|
||||
%client.player.setInventory("spineDeployable",1,true);
|
||||
%client.player.use("ConstructionTool");
|
||||
|
||||
//set the inv flag
|
||||
%client.spawnUseInv = true;
|
||||
}
|
||||
|
||||
function ConstructionGame::updateKillScores(%game, %clVictim, %clKiller, %damageType, %implement) {
|
||||
if (%game.testKill(%clVictim, %clKiller)) { //verify victim was an enemy
|
||||
%game.awardScoreKill(%clKiller);
|
||||
%game.awardScoreDeath(%clVictim);
|
||||
}
|
||||
else if (%game.testSuicide(%clVictim, %clKiller, %damageType)) //otherwise test for suicide
|
||||
%game.awardScoreSuicide(%clVictim);
|
||||
}
|
||||
|
||||
function ConstructionGame::timeLimitReached(%game) {
|
||||
logEcho("game over (timelimit)");
|
||||
%game.gameOver();
|
||||
cycleMissions();
|
||||
}
|
||||
|
||||
function ConstructionGame::scoreLimitReached(%game) {
|
||||
logEcho("game over (scorelimit)");
|
||||
%game.gameOver();
|
||||
cycleMissions();
|
||||
}
|
||||
|
||||
function ConstructionGame::gameOver(%game) {
|
||||
//call the default
|
||||
DefaultGame::gameOver(%game);
|
||||
|
||||
//send the winner message
|
||||
%winner = "";
|
||||
if ($teamScore[1] > $teamScore[2])
|
||||
%winner = %game.getTeamName(1);
|
||||
else if ($teamScore[2] > $teamScore[1])
|
||||
%winner = %game.getTeamName(2);
|
||||
|
||||
if (%winner $= 'Storm')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.stowins.wav" );
|
||||
else if (%winner $= 'Inferno')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.infwins.wav" );
|
||||
else if (%winner $= 'Starwolf')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.swwin.wav" );
|
||||
else if (%winner $= 'Blood Eagle')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.bewin.wav" );
|
||||
else if (%winner $= 'Diamond Sword')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.dswin.wav" );
|
||||
else if (%winner $= 'Phoenix')
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.pxwin.wav" );
|
||||
else
|
||||
messageAll('MsgGameOver', "Match has ended.~wvoice/announcer/ann.gameover.wav" );
|
||||
|
||||
messageAll('MsgClearObjHud', "");
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i ++) {
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%game.resetScore(%client);
|
||||
}
|
||||
for(%j = 1; %j <= %game.numTeams; %j++)
|
||||
$TeamScore[%j] = 0;
|
||||
}
|
||||
|
||||
function ConstructionGame::clientMissionDropReady(%game, %client)
|
||||
{
|
||||
messageClient(%client, 'MsgClientReady',"", "SinglePlayerGame"); //Load SP game hud.
|
||||
|
||||
%game.resetScore(%client);
|
||||
|
||||
messageClient(%client, 'MsgMissionDropInfo', '\c0You are in mission %1 (%2).', $MissionDisplayName, $MissionTypeDisplayName, $ServerName );
|
||||
|
||||
DefaultGame::clientMissionDropReady(%game, %client);
|
||||
}
|
||||
|
||||
function ConstructionGame::ResetScore(%game) { return %game; }
|
||||
function ConstructionGame::vehicleDestroyed(%game, %vehicle, %destroyer) { return %game SPC %vehicle SPC %destroyer; }
|
||||
|
||||
//ScoreMenu Start
|
||||
function setSaveTag(%client,%val)
|
||||
{
|
||||
%client.canSave = %val;
|
||||
if (%val == 1)
|
||||
{
|
||||
messageClient(%client,'msgClient',"\c3You may now save again.");
|
||||
}
|
||||
}
|
||||
|
||||
function setLoadTag(%client,%val)
|
||||
{
|
||||
%client.canLoad = %val;
|
||||
if (%val == 1)
|
||||
{
|
||||
messageClient(%client,'msgClient',"\c3You may now load again.");
|
||||
}
|
||||
}
|
||||
|
||||
function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5)
|
||||
{
|
||||
|
||||
if (%arg1 $= "SVESLT")
|
||||
{
|
||||
if (!%client.canSave)
|
||||
{
|
||||
messageClient(%client,'MsgClient',"\c3You are unable to save right now.");
|
||||
ForceScoreHudClose(%client);
|
||||
return;
|
||||
}
|
||||
%file = %arg2 @ ".cs";
|
||||
ForceScoreHudClose(%client);
|
||||
messageClient(%client,'MsgClient',"\c3Building saved to" SPC %arg2 @ ".");
|
||||
|
||||
if ($PlayingOnline)
|
||||
saveBuilding(%client,9999,%client.guid @ "/" @ %file,1,0);
|
||||
else
|
||||
saveBuilding(%client,9999,%client.namebase @ "/" @ %file,1,0);
|
||||
|
||||
%count = Deployables.getCount();
|
||||
%pieces = 0;
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%obj = Deployables.getObject(%i);
|
||||
if (%obj.getOwner() == %client)
|
||||
%pieces++;
|
||||
}
|
||||
$Host::PieceCount[%client.guid,%arg2] = %pieces;
|
||||
export("$Host::*","prefs/serverPrefs.cs",false);
|
||||
if ($Host::ChatAI::Enabled)
|
||||
messageAll('MsgAdminForce',"\c4" @ $Host::ChatAI::Name @ ":" SPC %client.namebase SPC "has saved a structure.");
|
||||
%client.canSave = false;
|
||||
schedule(60000,0,"setSaveTag",%client,true);
|
||||
return;
|
||||
}
|
||||
else if (%arg1 $= "LDSLT")
|
||||
{
|
||||
if (!%client.canLoad)
|
||||
{
|
||||
messageClient(%client,'MsgClient',"\c3You are unable to load right now.");
|
||||
ForceScoreHudClose(%client);
|
||||
return;
|
||||
}
|
||||
%file = %arg2 @ ".cs";
|
||||
ForceScoreHudClose(%client);
|
||||
messageClient(%client,'MsgClient',"\c3Building" SPC %arg2 SPC "loaded.");
|
||||
|
||||
if ($PlayingOnline)
|
||||
loadBuilding(%client.guid @ "/" @ %file);
|
||||
else
|
||||
loadBuilding(%client.namebase @ "/" @ %file);
|
||||
|
||||
%client.canLoad = false;
|
||||
schedule(60000,0,"setLoadTag",%client,true);
|
||||
if ($Host::ChatAI::Enabled)
|
||||
messageAll('MsgAdminForce',"\c4" @ $Host::ChatAI::Name @ ":" SPC %client.namebase SPC "has loaded a structure of" SPC $Host::PieceCount[%client.guid,%arg2] SPC "pieces.");
|
||||
}
|
||||
else if (%arg1 $= "RENAME")
|
||||
{
|
||||
ForceScoreHudClose(%client);
|
||||
%client.isNaming = true;
|
||||
%client.nameSlot = %arg2;
|
||||
messageClient(%client,'msgClient',"\c3The next global message sent will serve as the new name.");
|
||||
return;
|
||||
}
|
||||
else if (%arg1 $= "CALL")
|
||||
{
|
||||
ForceScoreHudClose(%client);
|
||||
call("cc" @ %arg2,%client);
|
||||
}
|
||||
ScoreHudUpdate(%client,%arg1);
|
||||
}
|
||||
|
||||
function ScoreHudUpdate(%client,%page,%refresh)
|
||||
{
|
||||
messageClient( %client, 'ClearHud', "", 'scoreScreen', 1 );
|
||||
messageClient( %client, 'SetScoreHudHeader', "", "<a:gamelink\tCMDS\t1>Commands Menu</a><rmargin:600><just:right><a:gamelink\tCLOSE\t1>Close</a>" );
|
||||
|
||||
switch$ (%page)
|
||||
{
|
||||
case "CLOSE": ForceScoreHudClose(%client);
|
||||
case "MAIN": %client.scorePage = "MAIN";
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Main Menu");
|
||||
%index = 0;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Advanced Architecture Construction Mod Commands-');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tPCCNT\t1>- Piece Count</a>');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCMDS\t1>- Chat Commands</a>');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tPCESAVE\t1>- Content Saving</a>');
|
||||
|
||||
case "PCCNT":
|
||||
%client.scorePage = "PCCNT";
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Piece Count");
|
||||
%index = 0;
|
||||
|
||||
%ccount = ClientGroup.getCount();
|
||||
for (%i = 0; %i < %ccount; %i++)
|
||||
{
|
||||
%clid = ClientGroup.getObject(%i);
|
||||
%count = Deployables.getCount();
|
||||
%pieces[%clid] = 0;
|
||||
for (%j = 0; %j < %count; %j++)
|
||||
{
|
||||
%obj = Deployables.getObject(%i);
|
||||
if (%obj.getOwner() == %clid)
|
||||
%pieces[%clid]++;
|
||||
}
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>%1 - %2 Pcs.',%clid.namebase,%pieces[%clid]);
|
||||
%index++;
|
||||
}
|
||||
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tMAIN\t1>Back To Main Menu</a>');
|
||||
%index++;
|
||||
|
||||
case "DeployedSpine":
|
||||
%client.scorePage = "DeployedSpine";
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Object Description: Light Support Beam");
|
||||
%index = 0;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, 'Object Name: Light Support Beam');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, 'Object Scale: %1',%client.object.scale);
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, 'Object Description: The jack of all trades.');
|
||||
%index++;
|
||||
|
||||
case "PCESAVE": %client.scorePage = "PCESAVE";
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Content Saving System");
|
||||
%index = 0;
|
||||
|
||||
if ($PlayingOnline)
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Available Save Slots-');
|
||||
else
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Available OFFLINE Save Slots-');
|
||||
%index++;
|
||||
|
||||
|
||||
for (%i = 1; %i < 11; %i++)
|
||||
{
|
||||
|
||||
if ($PlayingOnline)
|
||||
%file = "Buildings/" @ %client.guid @ "/Slot"@%i@".cs";
|
||||
else
|
||||
%file = "Buildings/" @ %client.namebase @ "/Slot"@%i@".cs";
|
||||
|
||||
if (IsFile(%file))
|
||||
{
|
||||
if ($Host::FileName[%client.guid,"Slot" @ %i] !$= "")
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Slot "@%i@": <a:gamelink\tRENAME\tSlot"@%i@"\t1>\x22"@$Host::FileName[%client.guid,"Slot" @ %i]@"\x22</a> <color:FF0033><a:gamelink\tSVESLT\tSlot"@%i@"\t1>[SAVE]</a> <color:00FF00><a:gamelink\tLDSLT\tSlot"@%i@"\t1>[LOAD]</a> <color:CCCCCC>("@$Host::PieceCount[%client.guid,"Slot" @ %i]@" Pcs.)");
|
||||
else
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Slot "@%i@": <a:gamelink\tRENAME\tSlot"@%i@"\t1>Click to Name me</a> <color:FF0033><a:gamelink\tSVESLT\tSlot"@%i@"\t1>[SAVE]</a> <color:00FF00><a:gamelink\tLDSLT\tSlot"@%i@"\t1>[LOAD]</a> <color:CCCCCC>("@$Host::PieceCount[%client.guid,"Slot" @ %i]@" Pcs.)");
|
||||
}
|
||||
else
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, "<just:center>Slot "@%i@": <color:FF0000>EMPTY <color:00FF00><a:gamelink\tSVESLT\tSlot"@%i@"\t1>[SAVE]</a>");
|
||||
%index++;
|
||||
}
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tMAIN\t1>Back To Main Menu</a>');
|
||||
%index++;
|
||||
|
||||
|
||||
case "CMDS": %client.scorePage = "CMDS";
|
||||
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "<just:center>Available Chat Commands");
|
||||
%index = 0;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Public Chat Commands-');
|
||||
%index++;
|
||||
|
||||
%count = $ScoreMenu::Entry::LevelCount[0];
|
||||
%count--;
|
||||
for (%i = 0; %i <= %count; %i++)
|
||||
{
|
||||
|
||||
if ($ScoreMenu::Entry::ToggleButton[0,%i])
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCALL\t%1\t1>/%1</a> - %2',$ScoreMenu::Entry[0,%i],$ScoreMenu::Entry::Description[0,%i]);
|
||||
else
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>/%1 - %2',$ScoreMenu::Entry[0,%i],$ScoreMenu::Entry::Description[0,%i]);
|
||||
%index++;
|
||||
}
|
||||
|
||||
if (%client.isAdmin)
|
||||
{
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Admin Chat Commands-');
|
||||
%index++;
|
||||
|
||||
%count = $ScoreMenu::Entry::LevelCount[1];
|
||||
%count--;
|
||||
for (%i = 0; %i <= %count; %i++)
|
||||
{
|
||||
if ($ScoreMenu::Entry::ToggleButton[1,%i])
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tCALL\t%1\t1>/%1</a> - %2',$ScoreMenu::Entry[1,%i],$ScoreMenu::Entry::Description[1,%i]);
|
||||
else
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>/%1 - %2',$ScoreMenu::Entry[1,%i],$ScoreMenu::Entry::Description[1,%i]);
|
||||
%index++;
|
||||
}
|
||||
}
|
||||
|
||||
if (%client.isSuperadmin)
|
||||
{
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Super Admin Chat Commands-');
|
||||
%index++;
|
||||
%count = $ScoreMenu::Entry::LevelCount[2];
|
||||
%count--;
|
||||
for (%i = 0; %i <= %count; %i++)
|
||||
{
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>/%1 - %2',$ScoreMenu::Entry[2,%i],$ScoreMenu::Entry::Description[2,%i]);
|
||||
%index++;
|
||||
}
|
||||
}
|
||||
|
||||
if (isSpecialUser(%client))
|
||||
{
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>-Special Chat Commands-');
|
||||
%index++;
|
||||
%count = $ScoreMenu::Entry::LevelCount[4];
|
||||
%count--;
|
||||
for (%i = 0; %i <= %count; %i++)
|
||||
{
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>]%1 - %2',$ScoreMenu::Entry[4,%i],$ScoreMenu::Entry::Description[4,%i]);
|
||||
%index++;
|
||||
}
|
||||
}
|
||||
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tMAIN\t1>Back To Main Menu</a>');
|
||||
%index++;
|
||||
return;
|
||||
|
||||
default:
|
||||
scoreHudUpdate(%client,"MAIN");
|
||||
}
|
||||
}
|
||||
|
||||
function ConstructionGame::updateScoreHud(%game, %client, %tag)
|
||||
{
|
||||
if (%client.scorePage $= "CLOSE")
|
||||
ScoreHudUpdate(%client,"MAIN");
|
||||
else if (%client.scorePage $= "MAIN")
|
||||
ScoreHudUpdate(%client,"MAIN");
|
||||
}
|
||||
|
||||
function forceScoreHudClose(%client)
|
||||
{
|
||||
serverCmdHideHud(%client, 'scoreScreen');
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
%client.scorePage = "MAIN";
|
||||
}
|
||||
|
||||
function forceScoreScreenOpen(%client,%page)
|
||||
{
|
||||
messageClient(%client, 'OpenHud', "", 'scoreScreen' SPC "scoreScreen");
|
||||
ConstructionGame::processGameLink(Game, %client, %page);
|
||||
}
|
||||
|
||||
|
||||
275
scripts/Function Library R3.txt
Executable file
275
scripts/Function Library R3.txt
Executable file
|
|
@ -0,0 +1,275 @@
|
|||
Function.cs documantation - v3.5
|
||||
Created by DynaBlade
|
||||
==================================
|
||||
I dont mind if you use my scripts, as long as you say that
|
||||
you are using them somewhere in the credits, say a webpage or a startup screen.
|
||||
IF YOU DO NOT KNOW HOW TO USE THIS FUNCTION LIBRARY DO NOT ASK ME! This is
|
||||
provided as a library reference only!
|
||||
All functions used here are made strictly by DynaBlade.
|
||||
Functions made in the other attached files are made by their respective authors.
|
||||
|
||||
|
||||
TypeMasks
|
||||
---------
|
||||
$AllObjMask
|
||||
Every object in T2 falls under this category. Use this in your raycasts and
|
||||
containerBox searches if you just want to find anything
|
||||
|
||||
$DefaultLOSMask
|
||||
Basic mask, usually used with raycasting LOS
|
||||
|
||||
$CoreObjectMask
|
||||
Players, Vehicles, Stations, Generators and Sensors fall in this category
|
||||
|
||||
$EverythingObjectMask (not done)
|
||||
This includes everything, even projectiles and possibly GUI objects!
|
||||
|
||||
ShapeBase Commands
|
||||
------------------
|
||||
These commands work on any object derived from ShapeBase.
|
||||
|
||||
%obj.getRotation()
|
||||
Gets the rotation of the object
|
||||
|
||||
%obj.setRotation(%rot)
|
||||
Sets the object's rotation of to %rot
|
||||
|
||||
%obj.setPosition(%pos)
|
||||
Sets the object's position to %pos
|
||||
|
||||
%obj.getSlotRotation()
|
||||
Gets the rotation of a specific slot on an object
|
||||
|
||||
%obj.getSlotPosition()
|
||||
Gets the position of a specific slot on an object
|
||||
|
||||
%obj.zapObject()
|
||||
Plays Shocklance "zap" animation on object
|
||||
|
||||
%obj.zap2Object()
|
||||
Plays a different "zap" animation on object
|
||||
|
||||
%obj.stopZap()
|
||||
Stops the Shocklance "zap" animation prematurely
|
||||
(if you dont want it to fade out naturally)
|
||||
|
||||
%obj.isPlayer()
|
||||
Checks to see if object is a Player Object
|
||||
|
||||
%obj.isVehicle()
|
||||
Checks to see if object is a Vehicle Object
|
||||
|
||||
%obj.applyKick(%force)
|
||||
Applys a kick based on the force inputted based on the muzzle vector.
|
||||
If there is no muzzle, then it apply an impulse at "0 0 0" at the shape's
|
||||
current forward position
|
||||
|
||||
%obj.useEnergy(%amount)
|
||||
Uses %amount much energy assuming the shape has any
|
||||
|
||||
%obj.play3D(sound)
|
||||
Plays sound from the object
|
||||
|
||||
%obj.teleportStartFX()
|
||||
Teleportation fadeout used in Meltdown2
|
||||
|
||||
%obj.teleportEndFX()
|
||||
Teleportation fadein used in Meltdown2
|
||||
|
||||
%obj.getEyePoint()
|
||||
Usually used with Players, this gets the camera's current position
|
||||
|
||||
%obj.getForwardRaycastPt(%dist)
|
||||
Similar to MuzzleRaycast, but this one gets the raycast in whatever your
|
||||
forward direction is
|
||||
|
||||
%obj.getEyeRaycastPt(%dist)
|
||||
Gets the camera's raycast from the scanning distance
|
||||
|
||||
%obj.getMuzzleRaycastPt(%slot, %dist)
|
||||
Gets the muzzle's raycast from the object usind the slot and scanning distance
|
||||
|
||||
%obj.getMass()
|
||||
Returns the mass of the object
|
||||
|
||||
%obj.getAccel()
|
||||
Returns the acceleration of the object in 1 millisecond. If you want to get an
|
||||
acceleration of say, 1 second, you would scale the output vector by the number
|
||||
of miliseconds you want it to be, in this case, 1 second = 1000 milliseconds. So,
|
||||
|
||||
%accel_1_second = vectorScale(%obj.getAccel(), 1000);
|
||||
|
||||
%obj.getVelToForce()
|
||||
This converts the object's velocity to a force vector. This works sort of like a
|
||||
setVelocity for vehicles, in that it outputs the vector ready to be applied to the object.
|
||||
If you know what you're doing
|
||||
|
||||
%obj.getMaxEnergy()
|
||||
Returns the datablock maximum energy the object has, if any
|
||||
|
||||
%obj.getMaxDamage()
|
||||
Returns the datablock maximum damage the object has, if any
|
||||
|
||||
%obj.getDamageLeft()
|
||||
Returns the object's health, or damage away from the maximum, if any
|
||||
|
||||
%obj.getDamageLeftPct()
|
||||
Returns the percentage of non-damage on the object
|
||||
|
||||
%obj.getDamagePct()
|
||||
Returns the percentage of damage on the object
|
||||
|
||||
%obj.getEnergyPct()
|
||||
Returns the percentage of energy on the object
|
||||
|
||||
%obj.getTransformAngle(%trans)
|
||||
Returns the transform's angle
|
||||
|
||||
** EXPERIMENTAL FUNCTIONS **
|
||||
|
||||
%obj.createSlotExtension(%obj, %slot)
|
||||
Creates 8 more mountable slots at the cost of 1
|
||||
However, strange side effects seem to take place... You'd have to try this one out to see
|
||||
|
||||
%obj.deleteSlotExtension(%obj, %slot);
|
||||
Deletes the current slot extension.
|
||||
|
||||
isWithinVariance(%va, %vb, %variance)
|
||||
Tests vectors a and be to see if they are pointing within %variance direction
|
||||
I'm not sure if I have the math skill to figure this one out. So I copied something
|
||||
from inside T2's stuff that worked kinda like this.
|
||||
|
||||
Normal Commands
|
||||
---------------
|
||||
|
||||
combineVars(%a, %b, %c)
|
||||
Combines 3 variables together into 1 variable (ex. Position)
|
||||
|
||||
killit(%k)
|
||||
same as %obj.delete()
|
||||
|
||||
scanArea(%pos, %radius, %mask)
|
||||
scans for existance of %mask type objects in a %radius area starting from %pos position
|
||||
|
||||
testPosition(%pos)
|
||||
Tests to see if you can move to this position
|
||||
|
||||
createEmitter(%pos, %emitter, [%rot])
|
||||
Creates a particle emitter at %pos position and with particle emitter %emitter (rot is optional)
|
||||
|
||||
createLifeEmitter(%pos, %emitter, %lifeMS, [%rot])
|
||||
This creates an emitter for %lifeMS time, if you dont want to have to worry
|
||||
about deleting the particle emitter
|
||||
|
||||
sqr(num)
|
||||
returns number*number
|
||||
|
||||
cube(num)
|
||||
returns number*number*number
|
||||
|
||||
modifyTransform(%trans1, %trans2)
|
||||
This modifys transform1 based on transform2
|
||||
For example: modifyTransform("255 100 96 1 0 0 1.57", "-255 0 4 -1 1 0 0");
|
||||
would output the transform "0 100 100 0 1 0 1.57"
|
||||
|
||||
modifyTri(%trans1, %trans2)
|
||||
same as modifyTransform with 3 variables
|
||||
|
||||
modifyQuad(%trans1, %trans2)
|
||||
same as modifyTransform with 4 variables
|
||||
|
||||
shutdownServer(%time, %msg, %lines)
|
||||
Centerprints the text for %time amount of time and on %lines number of lines before
|
||||
the server shuts down
|
||||
|
||||
velToSingle(%vel)
|
||||
Converts a 3-unit velocity vector to a single number constant
|
||||
|
||||
msToKPH(%vel, true|false)
|
||||
Converts a single number constant (velToSingle) to KPH, and if bool = true, it will
|
||||
not round off calculations.
|
||||
|
||||
KPHToMPH(%vel, true|false)
|
||||
Converts a single number constant (velToSingle)from KPH to MPH, and if bool = true, it will
|
||||
not round off calculations.
|
||||
|
||||
vectorNeg(%vec)
|
||||
Returns the negative of the inputted vector
|
||||
|
||||
vectorClear(%vec)
|
||||
Yes.... people may actually find this useful.. lol
|
||||
|
||||
vectorCopy(%vec)
|
||||
Returns this vector (dont even ask why)
|
||||
|
||||
vectorCompare(%veca, %vecb)
|
||||
Returns 1 if the vectors are the same or similar
|
||||
|
||||
vectorToRotZ(%vec)
|
||||
Converts a vector to a Z rotation. Hey! I'm not that smart yet
|
||||
|
||||
getLOSOffset(%obj, %vec, %dist)
|
||||
Returns a position from a vector and a distance.
|
||||
|
||||
getVectorFromPoints(%a, %b)
|
||||
Returns the Normalized vector for pointa facing pointb
|
||||
|
||||
getVectorFromObjects(%a, %b)
|
||||
Same as above, but with objects
|
||||
|
||||
getDistance2D(%a, %b)
|
||||
Returns the distance between the 2 2-unit vectors
|
||||
|
||||
getDistance3D(%ptA, %ptB)
|
||||
returns the distance between two positions
|
||||
|
||||
getObjectDistance(%obj1, %obj2)
|
||||
returns the distance between 2 objects
|
||||
|
||||
setFlightCeiling(height)
|
||||
Sets the mission's flight 'ceiling', or maximum distance
|
||||
upwards before your engines/jets cut off
|
||||
|
||||
reload(%script)
|
||||
This functions like exec, only it causes lag because it is loading all
|
||||
the datablocks in the file you called this with to all the connected
|
||||
clients on the server, and to the server itself. This function, along
|
||||
with plain ol' exec will allow you to literally build your mod while
|
||||
others play it!
|
||||
|
||||
changeServerHostName(%name)
|
||||
Changes the name of server you are hosting, without need for reset.
|
||||
|
||||
changeServerPlayerCount(%number)
|
||||
Changes the # of players your server can accept, without need for reset.
|
||||
|
||||
changeServerAllowAliases(true|false)
|
||||
Changes the allow aliases switch while you are hosting, without need for reset.
|
||||
|
||||
changeServerAdminPassword(%pass)
|
||||
Changes the server admin password, without need for reset.
|
||||
|
||||
changeServerPassword(%name)
|
||||
Changes the entry password on server you are hosting, without need for reset.
|
||||
|
||||
setServerPrefs(%name, %aliases, %admin, %password, %numplayers)
|
||||
Changes all of the above, but with one function
|
||||
|
||||
getRandomN([%max, %min])
|
||||
Gets a random negative number, min and max values optional.
|
||||
|
||||
getRandomB()
|
||||
Returns true or false, at random.
|
||||
|
||||
getRandomT([%max, %min])
|
||||
Gets a positive OR negative random number at random will it be either
|
||||
Max and min values can be defined
|
||||
|
||||
vectorRandom()
|
||||
Creates a vector pointing in any random 360* direction
|
||||
|
||||
==================================================================================
|
||||
Notes:
|
||||
Particle emitter rptation should work now, and is optional.
|
||||
Reload doesnt always load the full datablock, and I dont know why.
|
||||
I am not good at math :(
|
||||
196
scripts/JTLmeteorStorm.cs
Executable file
196
scripts/JTLmeteorStorm.cs
Executable file
|
|
@ -0,0 +1,196 @@
|
|||
// JTLmeteorStorm.cs
|
||||
//
|
||||
// This script (C) 2002 by JackTL
|
||||
//
|
||||
// Use, modify, but give credit
|
||||
//
|
||||
// Functions:
|
||||
//
|
||||
// JTLMeteorStorm(obj,forcePlayer[1/0],maxRad,numFb,dropAlt,dropAltVariance,dbName,dbType,timeOutMS,randomRot[1/0],randomPulse[1/0],maxPulse,speedVec,offsetSpeedVec[1/0])
|
||||
//
|
||||
|
||||
datablock ParticleData(JTLMeteorStormFireballParticle) {
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = -0.2;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 350;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
textureName = "particleTest";
|
||||
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -160.0;
|
||||
spinRandomMax = 160.0;
|
||||
|
||||
animateTexture = true;
|
||||
framesPerSec = 15;
|
||||
|
||||
animTexName[0] = "special/Explosion/exp_0016";
|
||||
animTexName[1] = "special/Explosion/exp_0018";
|
||||
animTexName[2] = "special/Explosion/exp_0020";
|
||||
animTexName[3] = "special/Explosion/exp_0022";
|
||||
animTexName[4] = "special/Explosion/exp_0024";
|
||||
animTexName[5] = "special/Explosion/exp_0026";
|
||||
animTexName[6] = "special/Explosion/exp_0028";
|
||||
animTexName[7] = "special/Explosion/exp_0030";
|
||||
animTexName[8] = "special/Explosion/exp_0032";
|
||||
|
||||
colors[0] = "1.0 0.7 0.5 1.0";
|
||||
colors[1] = "1.0 0.5 0.2 1.0";
|
||||
colors[2] = "1.0 0.25 0.1 0.0";
|
||||
sizes[0] = 3.0;
|
||||
sizes[1] = 1.0;
|
||||
sizes[2] = 0.5;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.2;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(JTLMeteorStormFireballEmitter) {
|
||||
ejectionPeriodMS = 5;
|
||||
periodVarianceMS = 1;
|
||||
|
||||
ejectionVelocity = 0.25;
|
||||
velocityVariance = 0.0;
|
||||
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 30.0;
|
||||
|
||||
particles = "JTLMeteorStormFireballParticle";
|
||||
};
|
||||
|
||||
datablock GrenadeProjectileData(JTLMeteorStormFireball) {
|
||||
projectileShapeName = "weapon_chaingun_ammocasing.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0;
|
||||
directDamageType = $DamageType::Meteor;
|
||||
hasDamageRadius = false; // true;
|
||||
indirectDamage = 0; // 0.5;
|
||||
damageRadius = 7.5;
|
||||
radiusDamageType = $DamageType::Meteor;
|
||||
kickBackStrength = 1750;
|
||||
explosion = PlasmaBoltExplosion;
|
||||
splash = PlasmaSplash;
|
||||
baseEmitter = JTLMeteorStormFireballEmitter;
|
||||
armingDelayMS = 50;
|
||||
grenadeElasticity = 0.15;
|
||||
grenadeFriction = 0.4;
|
||||
drag = 0.1;
|
||||
gravityMod = 0.0;
|
||||
sound = GrenadeProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 20.0;
|
||||
lightColor = "1 1 0.5";
|
||||
};
|
||||
|
||||
function JTLMeteorStormFireball::onExplode(%data,%proj,%pos,%mod) {
|
||||
// Ass-ume gravity does not change vec.. (gravityMod = 0.0) :P
|
||||
%vec = vectorNormalize(%proj.initialDirection);
|
||||
if (%data.hasDamageRadius)
|
||||
RadiusExplosion(%proj,vectorAdd(%pos,vectorScale(%vec,-0.1)),%data.damageRadius,%data.indirectDamage,%data.kickBackStrength,%proj.sourceObject,%data.radiusDamageType);
|
||||
%pPos = %proj.getPosition();
|
||||
%surface = containerRayCast(vectorAdd(%pPos,vectorScale(%vec,-0.1)),vectorAdd(%pPos,vectorScale(%vec,1)),-1,%proj);
|
||||
%tObj = firstWord(%surface);
|
||||
if (isObject(%tObj))
|
||||
%tObj.damage(%proj,%pPos,0.4,%proj.getDataBlock().directDamageType);
|
||||
// ionStormBeam(vectorAdd(%pPos,"0 0" SPC $IonStorm::Height));
|
||||
}
|
||||
|
||||
function JTLMeteorStorm (%obj,%forcePlayer,%maxRad,%numFb,%dropAlt,%dropAltVariance,%dbName,%dbType,%timeOutMS,%randomRot,%randomPulse,%maxPulse,%speedVec,%offsetSpeedVec,%createFB,%pos,%target) {
|
||||
%pi = 3.1415926535897932384626433832795; // Whoa..
|
||||
if (%createFB) {
|
||||
if (%randomRot)
|
||||
%rot = "0 0 1" SPC getRandom() * (%pi * 2);
|
||||
else
|
||||
%rot = "1 0 0 0";
|
||||
%fb = new (%dbType) (JTLMeteor) {
|
||||
dataBlock = %dbName;
|
||||
position = %pos; // Needed for non-projectile types
|
||||
initialPosition = %pos;
|
||||
initialDirection = %speedVec;
|
||||
// sourceObject = 0;
|
||||
sourceSlot = 0;
|
||||
vehicleObject = 0;
|
||||
};
|
||||
if (isObject(%target) && $JTLMeteorStormSeek == 1 && %dbType $= "SeekerProjectile")
|
||||
%fb.setObjectTarget(%target);
|
||||
%fb.setRotation(%rot);
|
||||
if (%randomPulse) {
|
||||
%pulse = getRandom() * %maxPulse;
|
||||
%iPos = vectorNormalize((getRandom() * 2) - 1 SPC (getRandom() * 2) - 1 SPC (getRandom() * 2) - 1);
|
||||
%iPos = vectorAdd(%pos,%iPos);
|
||||
%iVec = vectorScale(vectorNormalize(getRandom() SPC getRandom() SPC getRandom()),%pulse);
|
||||
// Fix this, not for projectiles
|
||||
%fb.applyImpulse(%iPos,%iVec);
|
||||
}
|
||||
if (%dbType $= "Item")
|
||||
%fb.setVelocity(%speedVec); // Needed for non-projectile types
|
||||
MissionCleanup.add(%fb);
|
||||
if (%timeOutMS) {
|
||||
%fb.schedule(%timeOutMS,setDamageState,Destroyed);
|
||||
%fb.schedule(%timeOutMS+1000,delete);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (%forcePlayer) {
|
||||
%obj = %obj.player;
|
||||
}
|
||||
else {
|
||||
if (%obj.getClassName() $= "GameConnection" || %obj.getClassName() $= "AIConnection") {
|
||||
%obj2 = %obj.getControlObject();
|
||||
if (isObject(%obj2))
|
||||
%obj = %obj2;
|
||||
}
|
||||
}
|
||||
|
||||
if (isObject(%obj)) {
|
||||
if (%maxRad < 1)
|
||||
%maxRad = 50;
|
||||
if (%numFb < 1)
|
||||
%numFb = 100;
|
||||
if (%dropAlt < 1)
|
||||
%dropAlt = 100;
|
||||
if (%dropAltVariance < 1)
|
||||
%dropAltVariance = 500;
|
||||
if (!isObject(%dbName))
|
||||
%dbName = "JTLMeteorStormFireball";
|
||||
if (%dbType $= "" || %dbType $= "0")
|
||||
%dbType = "GrenadeProjectile";
|
||||
if (%speedVec $= "" || %speedVec $= "0")
|
||||
%speedVec = "0 0 -2";
|
||||
if (%maxPulse < 1)
|
||||
%maxPulse = 4000;
|
||||
%p = %obj.getWorldBoxCenter();
|
||||
%x = getWord(%p,0);
|
||||
%y = getWord(%p,1);
|
||||
%z = getWord(%p,2);
|
||||
for (%i = 0; %i < %numFb; %i++) {
|
||||
%dVec = getRandom() * %pi * 2;
|
||||
%dRad = getRandom() * %maxRad;
|
||||
%dX =mSin(%dVec) * %dRad;
|
||||
%dY =mCos(%dVec) * %dRad;
|
||||
%dZ =%dropAlt + (getRandom() * %dropAltVariance);
|
||||
if (%offsetSpeedVec) {
|
||||
%v2 = vectorCross(vectorNormalize(%speedVec),"1 0 0");
|
||||
%v3 = vectorCross(vectorNormalize(%speedVec),%v2);
|
||||
%dPos = vectorAdd(%p,vectorScale(vectorNormalize(%speedVec),-%dZ));
|
||||
%dPos = vectorAdd(%dPos,vectorScale(%v2,%dX));
|
||||
%dPos = vectorAdd(%dPos,vectorScale(%v3,%dY));
|
||||
}
|
||||
else {
|
||||
%dX = %x + %dX;
|
||||
%dY = %y + %dY;
|
||||
%dZ = %z + %dZ;
|
||||
%dPos = %dX SPC %dY SPC %dZ;
|
||||
}
|
||||
JTLMeteorStorm(0,0,0,0,0,0,%dbName,%dbType,%timeOutMS,%randomRot,%randomPulse,%maxPulse,%speedVec,0,true,%dPos,%obj);
|
||||
}
|
||||
}
|
||||
else {
|
||||
error("-JTLMeteorStorm- no valid object.");
|
||||
error("Usage: JTLMeteorStorm(obj,forcePlayer[1/0],maxRad,numFb,dropAlt,dropAltVariance,dbName,dbType,timeOutMS,randomRot[1/0],randomPulse[1/0],maxPulse,speedVec,offsetSpeedVec[1/0])");
|
||||
}
|
||||
}
|
||||
795
scripts/MPM/MPM.cs
Executable file
795
scripts/MPM/MPM.cs
Executable file
|
|
@ -0,0 +1,795 @@
|
|||
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(MpmFlareParticle1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "skins/jetflare03";
|
||||
|
||||
colors[0] = "0.7 0.7 1.0 0.5";
|
||||
colors[1] = "0.7 0.7 1.0 0.5";
|
||||
colors[2] = "0.7 0.7 1.0 0.5";
|
||||
colors[3] = "0.7 0.7 1.0 0.5";
|
||||
|
||||
sizes[0] = 50;
|
||||
sizes[1] = 50;
|
||||
sizes[2] = 50;
|
||||
sizes[3] = 50;
|
||||
|
||||
times[0] = 0.25;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.25;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleData(MpmFlareParticle3)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "skins/jetflare03";
|
||||
|
||||
colors[0] = "0.7 0.7 1.0 0.5";
|
||||
colors[1] = "0.7 0.7 1.0 0.5";
|
||||
colors[2] = "0.7 0.7 1.0 0.5";
|
||||
colors[3] = "0.7 0.7 1.0 0.5";
|
||||
|
||||
sizes[0] = 50;
|
||||
sizes[1] = 50;
|
||||
sizes[2] = 50;
|
||||
sizes[3] = 50;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.5;
|
||||
times[3] = 0.75;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleData(MpmFlareParticle2):MpmFlareParticle1
|
||||
{
|
||||
textureName = "skins/jetpackflare_bio";
|
||||
useInvAlpha = 0;
|
||||
lifetimeMS = 2500;
|
||||
spinRandomMin = -360.0;
|
||||
spinRandomMax = 360.0;
|
||||
sizes[0] = 15;
|
||||
sizes[1] = 15;
|
||||
sizes[2] = 15;
|
||||
sizes[3] = 15;
|
||||
};
|
||||
|
||||
datablock ParticleData(MpmJetSmoke1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 60000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0.5;
|
||||
textureName = "skins/jetflare2";
|
||||
|
||||
colors[0] = "0.8 0.8 0.8 1";
|
||||
colors[1] = "0.8 0.8 0 0.9";
|
||||
colors[2] = "0.8 0.8 0.8 0.5";
|
||||
colors[3] = "0.8 0.8 0.8 0.0";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 17;
|
||||
sizes[2] = 18;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.5;
|
||||
times[3] = 0.75;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(MpmJetSmoke2):MpmJetSmoke1
|
||||
{
|
||||
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 60000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0.5;
|
||||
textureName = "skins/jetflare2";
|
||||
|
||||
colors[0] = "0.8 0.8 0.8 1";
|
||||
colors[1] = "0.8 0.8 0 0.9";
|
||||
colors[2] = "0.8 0.8 0.8 0.5";
|
||||
colors[3] = "0.8 0.8 0.8 0.0";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 17;
|
||||
sizes[2] = 18;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.5;
|
||||
times[3] = 0.75;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleEmitterData(MpmFlareEmitter1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 100;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 5;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "MpmFlareParticle1";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MpmFlareEmitter2):MpmFlareEmitter1
|
||||
{
|
||||
particles = "MpmFlareParticle2";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MpmJetEmitter1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10.0;
|
||||
velocityVariance = 1.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 5.0;
|
||||
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "MpmJetSmoke1";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(MpmJetEmitter2):MpmJetEmitter1
|
||||
{
|
||||
ejectionPeriodMS = 10;
|
||||
particles = "MpmJetSmoke2";
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 1.5;
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(MpmJetEmitter3):MpmJetEmitter1
|
||||
{
|
||||
ejectionPeriodMS = 30;
|
||||
ejectionVelocity = 4.0;
|
||||
velocityVariance = 1.0;
|
||||
particles = "MpmFlareParticle2";
|
||||
ejectionoffset = 10;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 360.0;
|
||||
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(Mpm_G_PR) {
|
||||
className = "TracerProjectileData";
|
||||
emitterDelay = "-1";
|
||||
velInheritFactor = "0";
|
||||
directDamage = "0";
|
||||
hasDamageRadius = "0";
|
||||
indirectDamage = "0";
|
||||
damageRadius = "0";
|
||||
radiusDamageType = "0";
|
||||
kickBackStrength = "0";
|
||||
Explosion = "TurretExplosion";
|
||||
hasLight = "0";
|
||||
lightRadius = "1";
|
||||
lightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
hasLightUnderwaterColor = "0";
|
||||
underWaterLightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
explodeOnWaterImpact = "0";
|
||||
depthTolerance = "5";
|
||||
bubbleEmitTime = "0.5";
|
||||
faceViewer = "0";
|
||||
scale = "1 1 1";
|
||||
dryVelocity = "0.1";
|
||||
wetVelocity = "0.1";
|
||||
fizzleTimeMS = "32";
|
||||
lifetimeMS = "32";
|
||||
explodeOnDeath = "1";
|
||||
reflectOnWaterImpactAngle = "0";
|
||||
deflectionOnWaterImpact = "0";
|
||||
fizzleUnderwaterMS = "-1";
|
||||
activateDelayMS = "-1";
|
||||
doDynamicClientHits = "0";
|
||||
tracerLength = "1";
|
||||
tracerMinPixels = "1";
|
||||
tracerAlpha = "0";
|
||||
tracerColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
tracerTex[0] = "special/tracer00";
|
||||
tracerTex[1] = "special/tracercross";
|
||||
tracerWidth = "0.1";
|
||||
crossViewAng = "0.99";
|
||||
crossSize = "0.1";
|
||||
renderCross = "0";
|
||||
isFXUnit = "1";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock SeekerProjectileData(MpmMissile1)
|
||||
{
|
||||
heatSignature = 1;
|
||||
sensorData = DeployedOutdoorTurretSensor;
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "bomb.dts";
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0;
|
||||
damageRadius = 0;
|
||||
radiusDamageType = $DamageType::Missile;
|
||||
kickBackStrength = 20000;
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 1.0; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MpmJetEmitter1;
|
||||
delayEmitter = MpmFlareEmitter1;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 8000;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 1;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "1 1 0";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock GrenadeProjectileData(BoosterGrenade)
|
||||
{
|
||||
projectileShapeName = "grenade_projectile.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.1;
|
||||
damageRadius = 0.1;
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 1500;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
sound = GrenadeProjectileSound;
|
||||
explosion = "GrenadeExplosion";
|
||||
underwaterExplosion = "UnderwaterGrenadeExplosion";
|
||||
velInheritFactor = 0.5;
|
||||
splash = GrenadeSplash;
|
||||
|
||||
//baseEmitter = //MpmJetEmitter2;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
|
||||
grenadeElasticity = 0.35;
|
||||
grenadeFriction = 0.2;
|
||||
armingDelayMS = 250;
|
||||
muzzleVelocity = 10;
|
||||
drag = 0.1;
|
||||
};
|
||||
|
||||
|
||||
datablock SeekerProjectileData(MpmMissile2):MpmMissile1
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.1;
|
||||
damageRadius = 0.1;
|
||||
|
||||
explosion = LargeAirVehicleExplosion;
|
||||
explosionDamage = 0.5;
|
||||
explosionRadius = 0.2;
|
||||
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 80000;
|
||||
acceleration = 1;
|
||||
|
||||
projectileShapeName = "weapon_missile_casement.dts";
|
||||
baseEmitter = MpmJetEmitter2;
|
||||
delayEmitter = MpmFlareEmitter2;
|
||||
lifetimeMS = -1;
|
||||
sound = HAPCFlyerThrustSound;
|
||||
};
|
||||
|
||||
datablock SeekerProjectileData(MpmMissile3):MpmMissile2
|
||||
{
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 20; //5
|
||||
maxVelocity = 20;//80
|
||||
acceleration = 0; //1
|
||||
};
|
||||
|
||||
function MpmMissile1::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
function Mpm_B_MIS::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
function Mpm_B_MIS1::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
function Mpm_B_MIS2::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
//Anti missile missile :D
|
||||
//%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
function Mpm_B_MIS3::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
function Mpm_B_MIS4::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%proj.load.Explode(%proj,%pos);
|
||||
//parent::onExplode(%data,%proj,%pos,%mod);
|
||||
}
|
||||
|
||||
|
||||
function MpmMissile1::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
||||
{
|
||||
parent::onExplode(%data,%projectile,%position,%modifier);
|
||||
}
|
||||
|
||||
|
||||
function MpmMissile2::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
|
||||
%speed = GetWords(%proj.predict(),3,5);
|
||||
%dir = VectorScale(%speed,1/BasicGrenade.muzzlevelocity);
|
||||
%p1 = new GrenadeProjectile()
|
||||
{
|
||||
dataBlock = BoosterGrenade;
|
||||
initialDirection = %dir;
|
||||
initialPosition = %pos;
|
||||
};
|
||||
%proj.delete();
|
||||
}
|
||||
|
||||
function MpmMissile3::onExplode(%data, %proj, %pos, %mod)
|
||||
{
|
||||
%speed = GetWords(%proj.predict(),3,5);
|
||||
%dir = VectorScale(%speed,1/BasicGrenade.muzzlevelocity);
|
||||
%p1 = new GrenadeProjectile()
|
||||
{
|
||||
dataBlock = BoosterGrenade;
|
||||
initialDirection = %dir;
|
||||
initialPosition = %pos;
|
||||
};
|
||||
%proj.delete();
|
||||
}
|
||||
|
||||
function SeekerProjectile::Predict(%p,%ttime)
|
||||
{
|
||||
%time = ((GetSimTime()+%ttime) - %p.createtime)/1000;
|
||||
%dat = %p.getDatablock();
|
||||
%startspeed = VectorScale(%p.InitialDirection,%dat.muzzleVelocity);
|
||||
if (%p.sourceObject)
|
||||
{
|
||||
%co1 = mAbs(VectorDot(%p.InitialDirection,VectorNormalize(%p.startVelocity)));
|
||||
%sourceSpeed = VectorScale(%p.startVelocity,%dat.velInheritFactor*%co1);
|
||||
//if (%p.speedmod == 1)
|
||||
%sourceSpeed = VectorAdd(%sourcespeed,VectorScale(VectorNormalize(%p.startVelocity),-0.5));
|
||||
%leng = mAbs(VectorDot(%p.InitialDirection,%p.startVelocity));
|
||||
%dir = VectorNormalize(%p.initialdirection);
|
||||
%sourceSpeedlen = VectorDot(%SourceSpeed,VectorNormalize(%p.initialDirection));
|
||||
}
|
||||
%speedaccel = Limit(%dat.acceleration*(%time-1),0,Limit(%dat.maxVelocity-(%dat.muzzleVelocity+%sourceSpeedlen),0));
|
||||
%accelVec = VectorScale(vectorNormalize(%p.InitialDirection),%speedaccel);
|
||||
|
||||
%Speed = VectorAdd(VectorAdd(%startspeed,%sourceSpeed),VectorAdd(%accelvec,%gravvec));
|
||||
|
||||
%distance1 = VectorScale(%startspeed,%time);
|
||||
%distance2 = VectorScale(%sourceSpeed,%time);
|
||||
|
||||
%distance3 = VectorScale(%accelvec,0.5*(%time));
|
||||
%distance = VectorAdd(VectorAdd(%p.initialPosition,%distance3),VectorAdd(%distance2,%distance1));
|
||||
|
||||
//if (!%p.speedmod)
|
||||
//%p.speedmod = 1;
|
||||
|
||||
//if (VectorDist(%distance,%p.getTransform())>4)
|
||||
//%p.speedmod *= -1;
|
||||
|
||||
if (getSimTime()-%p.lasttime>1000)
|
||||
%p.schedule(%ttime,"logerror",%distance);
|
||||
%distance=VectorAdd(%distance,VectorScale(%p.lasterror,-1));
|
||||
|
||||
return %distance SPC %speed;
|
||||
}
|
||||
|
||||
function testpred(%dir,%speed,%time)
|
||||
{
|
||||
%p = Launch_Mpm("0 0 110",%dir,%speed,%time*1000,mpmMissile1);
|
||||
for (%t=0;%t < %time;%t++)
|
||||
{
|
||||
%p.schedule(%t*1000,predict);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function putwp(%pos)
|
||||
{
|
||||
|
||||
%wp = new WayPoint() {
|
||||
position = %pos;
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
dataBlock = "WayPointMarker";
|
||||
team = 1;
|
||||
};
|
||||
%wp.schedule(5000,"delete");
|
||||
}
|
||||
|
||||
|
||||
function SeekerProjectile::logerror(%p,%distance)
|
||||
{
|
||||
%p.lasterror = VectorSub(%distance,%p.getTransform());
|
||||
%p.lasttime = (GetSimTime()-%p.createtime)/1000;
|
||||
}
|
||||
|
||||
|
||||
function ItemData::Stage1(%data,%p)
|
||||
{
|
||||
|
||||
if (IsObject(%p))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
function ItemData::Stage2(%data,%p)
|
||||
{
|
||||
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%start = GetWords(%p.traject,0,2);
|
||||
%up = GetWords(%p.traject,3,5);
|
||||
%loc = GetWord(%p.traject,6);
|
||||
%a = GetWord(%p.traject,7);
|
||||
%vector = GetWords(%p.traject,8,10);
|
||||
%time = GetWord(%p.traject,11);
|
||||
%stlevel = %p.getTransform();//VectorAdd(%start,VectorScale(%up,%loc));
|
||||
%stspeed = VectorScale(%up,%a);
|
||||
%missileblock = %p.load.missile;
|
||||
%p2 = Launch_Mpm(%stlevel,%vector,%stspeed,%time+50000,%missileblock);
|
||||
%p2.team = %p.team;
|
||||
%p2.source = %p.source;
|
||||
%p2.traject = %p.traject;
|
||||
%p2.load = %p.load;
|
||||
%p2.owner = %p.owner;
|
||||
%p2.s2time = %time;
|
||||
%p2.targetlocation = %p.targetlocation;
|
||||
%p2.stage2 = %p2.load.schedule(%time,"AtTarget",%p2);
|
||||
if (%p.owner.getControlObject() == %p.owner.comcam && %p.owner.moveprojectile = %p)
|
||||
obsproj(%p2,%p.owner);
|
||||
return %p2;
|
||||
}
|
||||
}
|
||||
|
||||
datablock ItemData(Mpm_Null_Load)
|
||||
{
|
||||
cost = 0;
|
||||
missile = Mpm_B_MIS1;
|
||||
name = "Null";
|
||||
friendly = 0;
|
||||
};
|
||||
|
||||
function testenemy(%pos,%dir,%speed,%time)
|
||||
{
|
||||
%p = Launch_Mpm(%pos,%dir,%speed,%time,MpmMissile1);
|
||||
%p.team = 0;
|
||||
%p.load = Mpm_Null_Load;
|
||||
%p.schedule(360000,"delete");
|
||||
}
|
||||
|
||||
function ItemData::AtTarget(%data,%p)
|
||||
{
|
||||
|
||||
if (IsObject(%p))
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
|
||||
function ItemData::Explode(%data,%p,%pos)
|
||||
{
|
||||
|
||||
if (IsObject(%p))
|
||||
{
|
||||
if (IsObject(%data.vehicle))
|
||||
//if(VectorDist(%p.targetlocation,%pos)<50)
|
||||
Mpm_VE_Load0.AtTarget(%p);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Nuke_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
BigFatNukeTarget(%pos);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Nuke2_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
ShoulderNuclear.onExplode(%p, %pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Mpm_Hole_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::InteriorObjectType;
|
||||
%res = containerRayCast(%pos,"0 0 500",%mask, %p);
|
||||
if (%res)
|
||||
%inside = 1;
|
||||
dome(VectorAdd(%pos,"0 0" SPC (1-%inside)*200),60000,%inside);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ItemData::InterCept(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
//Be suprised
|
||||
%p.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function ItemData::Hazard(%data,%p,%obj,%radius)
|
||||
{
|
||||
if (%p.team != %obj.team)
|
||||
return 1;
|
||||
if (!%data.friendly && VectorDist(%p.targetlocation,%obj.getTransform())<%radius)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
function PlayExplosion(%pos,%data,%dir)
|
||||
{
|
||||
if (%dir $= "")
|
||||
%dir = "0 0 1";
|
||||
if (IsObject(%data))
|
||||
{
|
||||
%p = new LinearProjectile()
|
||||
{
|
||||
dataBlock = %data;
|
||||
initialDirection = %dir;
|
||||
initialPosition = %pos;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function GrenadeProjectile::Predict(%p,%time)
|
||||
{
|
||||
//Todo: make this one
|
||||
}
|
||||
|
||||
|
||||
//Custon information functions (not used)
|
||||
function ListSpeed(%xlist,%tlist)
|
||||
{
|
||||
|
||||
if (GetWordCount(%xlist)<2)
|
||||
return "";
|
||||
for (%c=0;%c<GetWordCount(%xlist)-1;%c++)
|
||||
{
|
||||
%dx = GetWord(%xlist,%c+1)-GetWord(%xlist,%c);
|
||||
%dt = GetWord(%tlist,%c+1)-GetWord(%tlist,%c);
|
||||
if (%dx == 0 || %dt == 0)
|
||||
%slist = %slist SPC 0;
|
||||
else
|
||||
%slist = %slist SPC %dx/%dt;
|
||||
}
|
||||
return trim(%slist);
|
||||
}
|
||||
|
||||
function ListShift(%list)
|
||||
{
|
||||
if (GetWordCount(%list)<2)
|
||||
return 0;
|
||||
for (%c=0;%c<GetWordCount(%list)-1;%c++)
|
||||
{
|
||||
%mid = (GetWord(%list,%c+1)+GetWord(%list,%c))/2;
|
||||
%nlist = %nlist SPC %mid;
|
||||
}
|
||||
return trim(%nlist);
|
||||
}
|
||||
|
||||
function ListMean(%list)
|
||||
{
|
||||
if (GetWordCount(%list)<1)
|
||||
return "";
|
||||
for (%c=0;%c<GetWordCount(%list);%c++)
|
||||
{
|
||||
%mean+= GetWord(%list,%c);
|
||||
}
|
||||
return %mean/GetWordCount(%list);
|
||||
}
|
||||
|
||||
function ListSub(%list1,%list2)
|
||||
{
|
||||
if (GetWordCount(%list1)<1)
|
||||
return "";
|
||||
for (%c=0;%c<GetWordCount(%list1);%c++)
|
||||
{
|
||||
%mid = GetWord(%list1,%c)-GetWord(%list2,%c);
|
||||
%nlist = %nlist SPC %mid;
|
||||
}
|
||||
return trim(%nlist);
|
||||
}
|
||||
|
||||
function mechanics(%vec)
|
||||
{
|
||||
|
||||
%nrm = VectorNormalize(%vec);
|
||||
%p = Launch_Mpm("0 0 110",%nrm ,"0 0 10",12000,"mpmMissile1");
|
||||
%p.vec = %vec;
|
||||
%p.st = getSimTime();
|
||||
for (%i=0;%i<10;%i++)
|
||||
schedule(%i*1000,0,"noteinfo",%p);
|
||||
schedule(10000,0,"listinfo",%p);
|
||||
}
|
||||
|
||||
function noteinfo(%p)
|
||||
{
|
||||
%n = %p.noted;
|
||||
%p.noted++;
|
||||
%predict = %p.predict();
|
||||
%p.predict[%n] = %predict;
|
||||
%p.real[%n] = %p.getTransform();
|
||||
%p.time[%n] = (getSimTime()-%p.st)/1000;
|
||||
}
|
||||
|
||||
function listinfo(%p)
|
||||
{
|
||||
for (%i=0;%i<11;%i++)
|
||||
{
|
||||
%pxlist =trim(%pxlist SPC GetWord(%p.predict[%i],0));
|
||||
%pzlist =trim(%pzlist SPC GetWord(%p.predict[%i],2));
|
||||
%xlist =trim(%xlist SPC GetWord(%p.real[%i],0));
|
||||
%zlist =trim(%zlist SPC GetWord(%p.real[%i],2));
|
||||
%tlist = trim(%tlist SPC %p.time[%i]);
|
||||
}
|
||||
//echo(%tlist);
|
||||
//echo(%pxlist);
|
||||
//echo(%pzlist);
|
||||
//echo(%xlist);
|
||||
//echo(%zlist);
|
||||
%speed = listspeed(%pzlist,%tlist);
|
||||
%acc = listspeed(%speed,listshift(%tlist));
|
||||
//echo(%speed);
|
||||
|
||||
%speed1 = listspeed(%zlist,%tlist);
|
||||
%acc1 = listspeed(%speed1,listshift(%tlist));
|
||||
//echo(%speed1);
|
||||
%v1 = %speed-%acc*1/2;
|
||||
%v2 = %speed1-%acc1*1/2;
|
||||
$diff[getWord(%p.vec,0),getWord(%p.vec,2)] = %v1-%v2;
|
||||
//echo(ListSub(%speed,%speed1));
|
||||
//echo(listmean(%acc));
|
||||
//echo(listmean(%acc1));
|
||||
//echo(1/2*(listmean(%acc1)-listmean(%acc))*10*10);
|
||||
}
|
||||
|
||||
function testrange()
|
||||
{
|
||||
for (%x=-5;%x<6;%x+=0.2)
|
||||
{
|
||||
for (%y=0;%y<6;%y+=0.2)
|
||||
{
|
||||
%vec = %x SPC "0" SPC %y;
|
||||
schedule((%x+5)*100000+%y*10000,0,"mechanics",%vec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function plotres()
|
||||
{
|
||||
for (%x=-5;%x<6;%x+=0.2)
|
||||
{
|
||||
for (%y=0;%y<6;%y+=0.2)
|
||||
{
|
||||
%line = %line SPC $diff[%x,%y];
|
||||
}
|
||||
echo(%line);
|
||||
%line = "";
|
||||
}
|
||||
}
|
||||
705
scripts/MPM/MPM_AE.cs
Executable file
705
scripts/MPM/MPM_AE.cs
Executable file
|
|
@ -0,0 +1,705 @@
|
|||
//loading system
|
||||
if ($mpm_AE != 1)
|
||||
{
|
||||
$mpm_load[$mpm_loads] = Mpm_AREP_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_ACLK_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_ADIS_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_AESP_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_AMOR_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_AE = 1;
|
||||
}
|
||||
|
||||
|
||||
//Loads
|
||||
|
||||
datablock ItemData(Mpm_AREP_Load):Mpm_Base_Load
|
||||
{
|
||||
slot = 0;
|
||||
cost = 25;
|
||||
name = "[AID] Repair Pulse";
|
||||
friendly = 1;
|
||||
missile = Mpm_B_MIS4;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_ACLK_Load):Mpm_Base_Load
|
||||
{
|
||||
slot = 0;
|
||||
cost = 30;
|
||||
name = "[AID] Cloak Pulse";
|
||||
friendly = 1;
|
||||
missile = Mpm_B_MIS4;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_ADIS_Load):Mpm_Base_Load
|
||||
{
|
||||
slot = 0;
|
||||
cost = 25;
|
||||
name = "[AID] Dissasemble Pulse";
|
||||
friendly = 0;
|
||||
missile = Mpm_B_MIS4;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_AESP_Load):Mpm_Base_Load
|
||||
{
|
||||
slot = 0;
|
||||
cost = 50;
|
||||
name = "[AID] Electo Static Pulse";
|
||||
friendly = 0;
|
||||
missile = Mpm_B_MIS4;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_AMOR_Load):Mpm_Base_Load
|
||||
{
|
||||
slot = 0;
|
||||
cost = 50;
|
||||
name = "[AID] Morph Pulse";
|
||||
friendly = 0;
|
||||
missile = Mpm_B_MIS4;
|
||||
|
||||
};
|
||||
|
||||
function Mpm_AREP_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
Aidpulse(%pos,%p.owner,0);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_ACLK_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
Aidpulse(%pos,%p.owner,1);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_ADIS_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
Aidpulse(%pos,%p.owner,2);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_AESP_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
Aidpulse(%pos,%p.owner,3);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_AMOR_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
Aidpulse(%pos,%p.owner,4);
|
||||
}
|
||||
}
|
||||
|
||||
//Shockwaves
|
||||
|
||||
datablock ShockwaveData(RepairWave) {
|
||||
className = "ShockwaveData";
|
||||
scale = "1 1 1";
|
||||
delayMS = "0";
|
||||
delayVariance = "0";
|
||||
lifetimeMS = "10000";
|
||||
lifetimeVariance = "0";
|
||||
width = "1";
|
||||
numSegments = "60";
|
||||
numVertSegments = "30";
|
||||
velocity = "10";
|
||||
height = "20";
|
||||
verticalCurve = "5";
|
||||
acceleration = "1";
|
||||
times[0] = "0";
|
||||
times[1] = "0.25";
|
||||
times[2] = "0.9";
|
||||
times[3] = "1";
|
||||
colors[0] = "1.000000 0.200000 0.200000 1.000000"; //1.0 0.9 0.9
|
||||
colors[1] = "1.000000 0.200000 0.200000 1.000000"; //0.6 0.6 0.6
|
||||
colors[2] = "1.000000 0.200000 0.200000 1.000000"; //0.6 0.6 0.6
|
||||
colors[3] = "1.000000 0.200000 0.200000 0.000000";
|
||||
texture[0] = "special/redbump2";
|
||||
texture[1] = "special/shockwave4"; //gradient";
|
||||
texWrap = "1";
|
||||
is2D = "0";
|
||||
mapToTerrain = "0";
|
||||
orientToNormal = "1";
|
||||
renderBottom = "1";
|
||||
renderSquare = "0";
|
||||
};
|
||||
|
||||
datablock ShockwaveData(CloakWave):RepairWave
|
||||
{
|
||||
colors[0] = "1 1 1 1";
|
||||
colors[1] = "1 1 1 1";
|
||||
colors[2] = "1 1 1 1";
|
||||
colors[3] = "1 1 1 0";
|
||||
texture[0] = "special/cloakTexture";
|
||||
texture[1] = "special/shockwave4";
|
||||
texWrap = "5";
|
||||
};
|
||||
|
||||
datablock ShockwaveData(DisWave):RepairWave
|
||||
{
|
||||
colors[0] = "0.2 0.2 1 1";
|
||||
colors[1] = "0.2 0.2 1 1";
|
||||
colors[2] = "0.2 0.2 1 1";
|
||||
colors[3] = "0.2 0.2 1 0";
|
||||
texture[0] = "special/shockwave5";
|
||||
texture[1] = "special/shockwave4";
|
||||
texWrap = "1";
|
||||
};
|
||||
|
||||
datablock ShockwaveData(EspWave):RepairWave
|
||||
{
|
||||
colors[0] = "0.8 0.2 1 1";
|
||||
colors[1] = "0.8 0.2 1 1";
|
||||
colors[2] = "0.8 0.2 1 1";
|
||||
colors[3] = "0.8 0.2 1 0";
|
||||
texture[0] = "special/shockwave5";
|
||||
texture[1] = "special/shockwave4";
|
||||
texWrap = "1";
|
||||
};
|
||||
|
||||
datablock ShockwaveData(MORWave):RepairWave
|
||||
{
|
||||
colors[0] = "0.8 1 0.2 1";
|
||||
colors[1] = "0.8 1 0.2 1";
|
||||
colors[2] = "0.8 1 0.2 1";
|
||||
colors[3] = "0.8 1 0.2 0";
|
||||
texture[0] = "special/shockwave5";
|
||||
texture[1] = "special/shockwave4";
|
||||
texWrap = "1";
|
||||
};
|
||||
|
||||
//Emitters
|
||||
|
||||
datablock ParticleData(RepairWave_P)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 10000;
|
||||
lifetimeVarianceMS = 0;
|
||||
constantAcceleration = 0.1;
|
||||
|
||||
spinRandomMin = -30.0;
|
||||
spinRandomMax = 30.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/redflare";
|
||||
|
||||
colors[0] = "1 0.2 0.2 1";
|
||||
colors[1] = "1 0.2 0.2 1";
|
||||
colors[2] = "1 0.2 0.2 1";
|
||||
colors[3] = "1 0.2 0.2 0";
|
||||
|
||||
sizes[0] = 1;
|
||||
sizes[1] = 2;
|
||||
sizes[2] = 4;
|
||||
sizes[3] = 5;
|
||||
|
||||
times[0] = "0";
|
||||
times[1] = "0.25";
|
||||
times[2] = "0.9";
|
||||
times[3] = "1";
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleData(CloakWave_P):RepairWave_P
|
||||
{
|
||||
textureName = "flarebase";
|
||||
constantAcceleration = 0.1;
|
||||
colors[0] = "1 1 1 1";
|
||||
colors[1] = "1 1 1 1";
|
||||
colors[2] = "1 1 1 1";
|
||||
colors[3] = "1 1 1 0";
|
||||
};
|
||||
|
||||
datablock ParticleData(DISWave_P):RepairWave_P
|
||||
{
|
||||
textureName = "flarebase";
|
||||
constantAcceleration = 0.1;
|
||||
colors[0] = "0.2 0.2 1 1";
|
||||
colors[1] = "0.2 0.2 1 1";
|
||||
colors[2] = "0.2 0.2 1 1";
|
||||
colors[3] = "0.2 0.2 1 0";
|
||||
};
|
||||
|
||||
datablock ParticleData(ESPWave_P):RepairWave_P
|
||||
{
|
||||
textureName = "flarebase";
|
||||
constantAcceleration = 0.1;
|
||||
colors[0] = "0.8 0.2 1 1";
|
||||
colors[1] = "0.8 0.2 1 1";
|
||||
colors[2] = "0.8 0.2 1 1";
|
||||
colors[3] = "0.8 0.2 1 0";
|
||||
};
|
||||
|
||||
datablock ParticleData(MORWave_P):RepairWave_P
|
||||
{
|
||||
textureName = "flarebase";
|
||||
constantAcceleration = 0.1;
|
||||
colors[0] = "0.8 1 0.2 1";
|
||||
colors[1] = "0.8 1 0.2 1";
|
||||
colors[2] = "0.8 1 0.2 1";
|
||||
colors[3] = "0.8 1 0.2 0";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(RepairWave_E)
|
||||
{
|
||||
lifetimeMS = 1000;
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 0;
|
||||
ejectionoffset = 5;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "RepairWave_P";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(CLOAKWave_E):RepairWave_E
|
||||
{
|
||||
lifetimeMS = 1000;
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionVelocity = 10;
|
||||
ejectionoffset = 5;
|
||||
velocityVariance = 0;
|
||||
particles = "CloakWave_P";
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(DISWave_E):RepairWave_E
|
||||
{
|
||||
lifetimeMS = 1000;
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionVelocity = 10;
|
||||
ejectionoffset = 5;
|
||||
velocityVariance = 0;
|
||||
particles = "DISWave_P";
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(ESPWave_E):RepairWave_E
|
||||
{
|
||||
lifetimeMS = 1000;
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 0;
|
||||
ejectionoffset = 5;
|
||||
particles = "ESPWave_P";
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(MORWave_E):RepairWave_E
|
||||
{
|
||||
lifetimeMS = 1000;
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 0;
|
||||
ejectionoffset = 5;
|
||||
particles = "MORWave_P";
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
};
|
||||
|
||||
|
||||
datablock ExplosionData(RepairPulseExplosion):BaseExplosion //From blast.cs
|
||||
{
|
||||
emitter[0] = "RepairWave_E";
|
||||
Shockwave = "RepairWave";
|
||||
};
|
||||
|
||||
|
||||
datablock ExplosionData(CloakPulseExplosion):BaseExplosion //From blast.cs
|
||||
{
|
||||
emitter[0] = "CloakWave_E";
|
||||
Shockwave = "CloakWave";
|
||||
};
|
||||
|
||||
datablock ExplosionData(DisPulseExplosion):BaseExplosion //From blast.cs
|
||||
{
|
||||
emitter[0] = "DISWave_E";
|
||||
Shockwave = "DisWave";
|
||||
};
|
||||
|
||||
datablock ExplosionData(ESPPulseExplosion):BaseExplosion //From blast.cs
|
||||
{
|
||||
emitter[0] = "ESPWave_E";
|
||||
Shockwave = "ESPWave";
|
||||
};
|
||||
|
||||
|
||||
datablock ExplosionData(MORPulseExplosion):BaseExplosion //From blast.cs
|
||||
{
|
||||
emitter[0] = "MORWave_E";
|
||||
Shockwave = "MORWave";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(RepairPulseProjectile):BaseProjectile
|
||||
{
|
||||
Explosion = "RepairPulseExplosion";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(CloakPulseProjectile):BaseProjectile
|
||||
{
|
||||
Explosion = "CloakPulseExplosion";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(DisPulseProjectile):BaseProjectile
|
||||
{
|
||||
Explosion = "DisPulseExplosion";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(ESPPulseProjectile):BaseProjectile
|
||||
{
|
||||
Explosion = "ESPPulseExplosion";
|
||||
};
|
||||
|
||||
|
||||
datablock TracerProjectileData(MORPulseProjectile):BaseProjectile
|
||||
{
|
||||
Explosion = "MORPulseExplosion";
|
||||
};
|
||||
|
||||
function Aidpulse(%pos,%owner,%type,%nrm)
|
||||
{
|
||||
schedule(200,0,"Serverplay3D",FlashGrenadeExplosionSound,%pos);
|
||||
%types = "RepairPulseProjectile CloakPulseProjectile DisPulseProjectile ESPPulseProjectile MORPulseProjectile";
|
||||
%proj = GetWord(%types,%type);
|
||||
%nrm = !%nrm ? "0 0 -1" : %nrm;
|
||||
shockwave(%pos,%nrm,%proj);
|
||||
%waveblock = %proj.explosion.shockwave;
|
||||
%accel = %waveblock.acceleration; //accel of wave
|
||||
%speed = %waveblock.velocity; //speed of wave
|
||||
%mtime = %waveblock.lifetimeMS/1000; //time the wave lasts
|
||||
%lastdist = 0;
|
||||
%checks = %mtime/2; //2 per second
|
||||
AidPulseWaved(%pos,%mtime,%speed,%accel,%waveblock,%owner);
|
||||
Cancel(%owner.resetmorphsch);
|
||||
%owner.resetmorphsch = Schedule(%mtime*1000+5000,%owner,"resetmorphsize",%owner);
|
||||
for (%i = 1;%i<20;%i++)
|
||||
{
|
||||
%time = %i/2;
|
||||
%dist = %time*%speed+1/2 * mPow(%time,2)*%accel+10;
|
||||
schedule(%time*1000,0,"AidpulseWaver",%pos,%dist,%lastdist-2,%waveblock,%owner);
|
||||
%lastdist = %dist;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function solveadist(%accel,%speed,%dist)
|
||||
{
|
||||
%awn = mSolveQuadratic(%accel/2,%speed,-1*%dist);
|
||||
if (getWord(%awn,0) <0 || getWord(%awn,1) > 0)
|
||||
return 0;
|
||||
else
|
||||
return -1*getWord(%awn,1);
|
||||
}
|
||||
|
||||
function AidPulseWaved(%pos,%time,%speed,%accel,%wave,%owner)
|
||||
{
|
||||
%area = %time*%speed+1/2 * mPow(%time,2)*%accel+10;
|
||||
|
||||
InitContainerRadiusSearch(%pos, %area, $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType );
|
||||
|
||||
|
||||
while ((%targetObject = containerSearchNext()) != 0)
|
||||
{
|
||||
%dist = containerSearchCurrRadDamageDist();
|
||||
%ttime = solveadist(%accel,%speed,%dist-10);
|
||||
if (%ttime != 0 || %ttime < %time)
|
||||
%wave.schedule(%ttime*1000,"AidEffect",%targetobject,%owner,%pos);
|
||||
}
|
||||
}
|
||||
|
||||
function AidpulseWaver(%pos,%area,%lastar,%wave,%owner)
|
||||
{
|
||||
|
||||
InitContainerRadiusSearch(%pos, %area, $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType |$TypeMasks::ItemObjectType | $TypeMasks::CorpseObjectType );
|
||||
|
||||
|
||||
while ((%targetObject = containerSearchNext()) != 0)
|
||||
{
|
||||
%dist = containerSearchCurrRadDamageDist();
|
||||
|
||||
if (%dist > %area || %dist < %lastar)
|
||||
continue;
|
||||
|
||||
%wave.AidEffect(%targetobject,%owner,%pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function RepairWave::AidEffect(%block,%obj,%owner,%pos)
|
||||
{
|
||||
if (!isObject(%obj) || %obj.isforceField())
|
||||
return "";
|
||||
%obj.playShieldEffect("1 1 1");
|
||||
%obj.setDamageLevel(0);
|
||||
}
|
||||
|
||||
function CloakWave::AidEffect(%block,%obj,%owner,%pos)
|
||||
{
|
||||
if (!isObject(%obj) || %obj.isforceField())
|
||||
return "";
|
||||
Cancel(%obj.uncloaksch);
|
||||
%obj.setCloaked(True);
|
||||
%obj.uncloaksch = %obj.schedule(60000,"setCloaked",False);
|
||||
}
|
||||
|
||||
function DisWave::AidEffect(%block,%obj,%owner,%Pos)
|
||||
{
|
||||
|
||||
if (%obj.isRemoved || !isObject(%owner) || !isObject(%obj))
|
||||
return;
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName $= "StationInventory" || %dataBlockName $= "GeneratorLarge" ||%dataBlockName $= "SolarPanel" ||%dataBlockName $= "SensorMediumPulse" ||%dataBlockName $= "SensorLargePulse")
|
||||
if (%obj.deployed != true)
|
||||
return;
|
||||
if ($reverseDeployItem[%obj.getDataBlock().getName()] $= "")
|
||||
return;
|
||||
if (%obj.team != %owner.team && !(%owner.isAdmin || %owner.isSuperAdmin))
|
||||
return;
|
||||
if ($Host::OnlyOwnerCascade == 1 && %obj.getOwner() != %owner && !(%owner.isAdmin || %owner.isSuperAdmin))
|
||||
return;
|
||||
|
||||
%obj.getDataBlock().disassemble(%owner, %obj); // Run Item Specific code.
|
||||
|
||||
}
|
||||
|
||||
function ESPWave::AidEffect(%block,%obj,%owner,%pos)
|
||||
{
|
||||
if (!isObject(%obj))
|
||||
return "";
|
||||
%hadsch = %obj.uncloacksch ? 1 : 0;
|
||||
Cancel(%obj.uncloaksch);
|
||||
if (!%obj.isforcefield())
|
||||
%obj.setCloaked(FALSE);
|
||||
Cancel(%obj.unemplockschd);
|
||||
if (%obj.isVehicle())
|
||||
vehemplock(%obj);
|
||||
else if (%obj.isPlayer())
|
||||
PlayerEmpLock(%obj);
|
||||
else if (%obj.getDatablock().maxEnergy !$= "")
|
||||
{
|
||||
if (%obj.getDataBlock().className $= "Generator" && %obj.lastState)
|
||||
{
|
||||
if (!%hadsch)
|
||||
toggleGenerator(%obj,0);
|
||||
%obj.unemplockschd = schedule(30000,%obj," toggleGenerator",%obj,0);
|
||||
}
|
||||
%obj.setEnergyLevel(0);
|
||||
}
|
||||
}
|
||||
|
||||
function MORWave::AidEffect(%block,%obj,%owner,%pos)
|
||||
{
|
||||
if (%obj.isRemoved || !isObject(%owner) || !isObject(%obj) || %obj.isPLayer() || %obj.isVehicle())
|
||||
return;
|
||||
if (!(deployables.isMember(%obj)))
|
||||
return;
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName $= "StationInventory" || %dataBlockName $= "GeneratorLarge" ||%dataBlockName $= "SolarPanel" ||%dataBlockName $= "SensorMediumPulse" ||%dataBlockName $= "SensorLargePulse")
|
||||
if (%obj.deployed != true)
|
||||
return;
|
||||
|
||||
if (%obj.team != %owner.team && !(%owner.isAdmin || %owner.isSuperAdmin))
|
||||
return;
|
||||
if ($Host::OnlyOwnerCascade == 1 && %obj.getOwner() != %owner && !(%owner.isAdmin || %owner.isSuperAdmin))
|
||||
return;
|
||||
|
||||
Cancel(%obj.unmorphsch);
|
||||
%obj.unmorphsch = Schedule(30000,%obj,"ResetMorphObject",%obj);
|
||||
if (%obj.morphed)
|
||||
return;
|
||||
|
||||
%obj.oldcenter = %obj.getEdge("0 0 0");
|
||||
%obj.oldrealsize = %obj.getrealSize();
|
||||
%obj.morphed = 1;
|
||||
|
||||
%size = %owner.morphpulsesize ? %owner.morphpulsesize : 0.1;
|
||||
%scale = VectorScale("1 1 1",%size);
|
||||
%offset = VectorMultiply(VectorSub(%obj.getEdge("0 0 0"),%pos),%scale);
|
||||
%obj.setRealSize(VectorMultiply(%obj.getRealSize(),%scale));
|
||||
%obj.setEdge(VectorAdd(%pos,%offset),"0 0 0");
|
||||
if (!%obj.isforcefield())
|
||||
%obj.startfade(500,0,0);
|
||||
if (isObject(%obj.pzone))
|
||||
{
|
||||
%obj.pzone.setScale(%Obj.getScale);
|
||||
%obj.pzone.setTransform(%obj.getTransform());
|
||||
}
|
||||
if (isObject(%obj.emitter))
|
||||
{
|
||||
%obj.emitter.oldsize = %obj.getScale();
|
||||
%obj.emitter.setScale(VectorScale(%obj.emitter.getScale(),%size));
|
||||
%obj.emitter.setTransform(%obj.getTransform());
|
||||
}
|
||||
if (isObject(%obj.trigger))
|
||||
{
|
||||
%obj.trigger.oldsize = %obj.getScale();
|
||||
%obj.trigger.setScale(VectorScale(%obj.trigger.getScale(),%size));
|
||||
%obj.trigger.setTransform(%obj.getTransform());
|
||||
}
|
||||
}
|
||||
|
||||
//ESP functions
|
||||
|
||||
function vehemplock(%vehicle)
|
||||
{
|
||||
Cancel(%vehicle.unemplockschd);
|
||||
Cancel(%vehicle.lockff.unemplockschd);
|
||||
%vehicle.setFrozenState(true);
|
||||
%vehicle.zapObject();
|
||||
forceFieldLock(%vehicle);
|
||||
%vehicle.unemplockschd = Schedule(30000,%vehicle,"vehUnEmpLock",%vehicle);
|
||||
%vehicle.lockff.unemplockschd = %vehicle.lockff.Schedule(30000,"delete");
|
||||
}
|
||||
|
||||
function vehUnEmpLock(%vehicle)
|
||||
{
|
||||
Cancel(%vehicle.unemplockschd);
|
||||
Cancel(%vehicle.lockff.unemplockschd);
|
||||
%vehicle.lockff.delete();
|
||||
%vehicle.setFrozenState(false);
|
||||
}
|
||||
|
||||
function PlayerEmpLock(%player)
|
||||
{
|
||||
Cancel(%player.unemplockschd);
|
||||
Cancel(%player.lockff.unemplockschd);
|
||||
Cancel(%player.lock.unemplockschd);
|
||||
if (!%player.isemped)
|
||||
{
|
||||
%lock = new StaticShape()
|
||||
{
|
||||
dataBlock = SelectionPad;
|
||||
scale = "0.01 0.01 0.01";
|
||||
};
|
||||
%lock.startFade(0,0,1);
|
||||
%vec = VectorNormalize(%player.getVelocity());
|
||||
%vec = (VectorLen(%vec)>0.1) ? %vec : "0 0 1";
|
||||
%center = %player.getEdge("0 0 0");
|
||||
%rot = fullrot(%vec,VectorCross(%player.getEyeVector(),%vec));
|
||||
%player.setTransform(%player.getEdge("0 0 -1") SPC %rot);
|
||||
%player.setEdge(%center,"0 0 0");
|
||||
%lock.setTransform(getWords(%player.getTransform(),0,2) SPC %rot);
|
||||
%lock.mountObject(%player,0);
|
||||
%lock.player = %player;
|
||||
%player.emplock = %lock;
|
||||
%player.isemped = 1;
|
||||
%player.zapObject();
|
||||
forceFieldLock(%player);
|
||||
}
|
||||
%player.unemplockschd = Schedule(30000,%player,"PlayerUnEmpLock",%player);
|
||||
if (isObject(%player.lock))
|
||||
%player.lock.unemplockschd = %player.lock.Schedule(30000,"delete");
|
||||
if (isObject(%player.lockff))
|
||||
%player.lockff.unemplockschd = %player.lockff.Schedule(30000,"delete");
|
||||
}
|
||||
|
||||
function PlayerUnEmpLock(%player)
|
||||
{
|
||||
%player.isemped = 0;
|
||||
Cancel(%player.unemplockschd);
|
||||
Cancel(%player.lockff.unemplockschd);
|
||||
Cancel(%player.lock.unemplockschd);
|
||||
%player.lockff.delete();
|
||||
%player.unMount();
|
||||
if (isObject(%player.emplock))
|
||||
%player.emplock.delete();
|
||||
}
|
||||
|
||||
function forceFieldLock(%obj)
|
||||
{
|
||||
if (!isObject(%obj.lockff))
|
||||
{
|
||||
%ff = new ForceFieldBare() {
|
||||
dataBlock = DeployedForceField5;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
%ff.noSlow = true;
|
||||
%ff.pzone.delete();
|
||||
%ff.pzone = "";
|
||||
%obj.lockff = %ff;
|
||||
%ff.obj = %obj;
|
||||
%ff.setScale(%obj.getRealSize());
|
||||
%ff.setTransform(%obj.getEdge("-1 -1 -1") SPC %Obj.getRotation());
|
||||
}
|
||||
}
|
||||
|
||||
//Morph functions
|
||||
|
||||
function ResetMorphObject(%obj)
|
||||
{
|
||||
Cancel(%obj.unmorphsch);
|
||||
if (!%obj.isforcefield())
|
||||
%obj.startfade(500,0,0);
|
||||
%obj.setRealSize(%obj.oldrealsize);
|
||||
%obj.setEdge(%obj.oldcenter,"0 0 0");
|
||||
if (isObject(%obj.pzone))
|
||||
{
|
||||
%obj.pzone.setScale(%Obj.getScale);
|
||||
%obj.pzone.setTransform(%obj.getTransform());
|
||||
}
|
||||
if (isObject(%obj.emitter))
|
||||
{
|
||||
%obj.emitter.setTransform(%obj.getTransform());
|
||||
%obj.emitter.setScale(%obj.trigger.oldsize);
|
||||
}
|
||||
if (isObject(%obj.trigger))
|
||||
{
|
||||
%obj.trigger.setTransform(%obj.getTransform());
|
||||
%obj.trigger.setScale(%obj.trigger.oldsize);
|
||||
}
|
||||
%obj.oldrealsize = "";
|
||||
%obj.oldcenter = "";
|
||||
%obj.morphed = "";
|
||||
}
|
||||
|
||||
function resetmorphsize(%owner)
|
||||
{
|
||||
%size = (getRandom()*0.9+0.1);
|
||||
%dir = (Getrandom()*2 > 1);
|
||||
%owner.morphpulsesize = %dir ? %size : 1+%size+getRandom()*3;
|
||||
}
|
||||
1635
scripts/MPM/MPM_Blast.cs
Executable file
1635
scripts/MPM/MPM_Blast.cs
Executable file
File diff suppressed because it is too large
Load diff
185
scripts/MPM/MPM_Launch.cs
Executable file
185
scripts/MPM/MPM_Launch.cs
Executable file
|
|
@ -0,0 +1,185 @@
|
|||
datablock AudioProfile(FwProjectileSound)
|
||||
{
|
||||
filename = "armor/thrust_UW.wav";
|
||||
description = ProjectileLooping3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock ItemData(MpmLaucher)
|
||||
{
|
||||
className = Pack;
|
||||
catagory = "Funky";
|
||||
shapeFile = "Turret_Muzzlepoint.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.0;
|
||||
friction = 1.0;
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
datablock TurretImageData(MpmLauchPoint)
|
||||
{
|
||||
shapeFile = "Turret_Muzzlepoint.dts";
|
||||
item = PlasmaBarrelLargePack;
|
||||
offset = "0 0 0";
|
||||
rotation = "0 1 0 90";
|
||||
};
|
||||
|
||||
///old algo
|
||||
//%time = Limit(VectorLen(%dist)/20,30,360);
|
||||
//%z = getWord(%dist,2);
|
||||
//%x = GetWord(%dist,0) SPC GetWord(%dist,1);
|
||||
//%x = Mpow(VectorDot(%x,%x),0.5);
|
||||
//%co1 = mpow(4*(mpow(%x,2))+ mpow(2*%muz*%time+%ac*mpow(%time,2)+2*%z,2),0.5);
|
||||
//%co2 = %time * (2*%muz * %time+%ac*mpow(%time,2)+2*%z);
|
||||
//%vector = (%x*%co1)/(%co2) SPC (%co1/(2*%time));
|
||||
//%vector = VectorAdd(VectorScale(VectorNormalize(GetWords(%dist,0,1)),getWord(%vector,0)) ,"0 0" SPC getWord(%vector,1));
|
||||
//%p=launchmpm(%start,"0 0 -1",%vector,%time*1000+5000);
|
||||
|
||||
|
||||
//Algo for mpm_missile lauch.
|
||||
//-Stage1-
|
||||
//Lauch up a certain amount of time
|
||||
//-Stage2-
|
||||
//Turn missile and head for target
|
||||
|
||||
function mpm_calc(%start,%end,%up,%dat)
|
||||
{
|
||||
if (!IsObject(%dat))
|
||||
%dat = MpmMissile1;
|
||||
if (%up $= "")
|
||||
%up = "0 0 1";
|
||||
|
||||
%ac = %dat.acceleration; //Acceleration for calc
|
||||
|
||||
%vector = VectorSub(%end,%start); //Vector source,target
|
||||
%dir = VectorNormalize(%vector);
|
||||
|
||||
if (mAbs(VectorDot(%up,%dir))==1) //can't fire directly up or down.
|
||||
return -1;
|
||||
%rup = VectorNormalize(VectorCross(%up,%dir));
|
||||
%up = VectorNormalize(%up);
|
||||
%ndir = VectorNormalize(VectorCross(VectorCross(%up,%dir),%up));
|
||||
|
||||
%z = VectorDot(%up,%dir)*VectorLen(%vector);
|
||||
%x = VectorDot(%ndir,%dir)*VectorLen(%vector);
|
||||
|
||||
%mintime = mSqrt(2*%x)/mSqrt(%ac); //Minium travel time
|
||||
%time = %mintime + 5; //Added 5 seconds for slack
|
||||
|
||||
//Calculations for preffered arc.
|
||||
%root = mSqrt(Mpow(%ac,2)*Mpow(%time,4)-4*Mpow(%x,2));
|
||||
|
||||
%ltimeco1 = %ac*Mpow(%time,2)+4*%root+8*%z;
|
||||
%ltimeco2 = -4*Mpow(%x,2)+%ac*Mpow(%time,2)*%ltimeco1;
|
||||
%ltimeco3 = 2*%ac*%time;
|
||||
%ltime = (-1*%root+mSqrt(%ltimeco2))/%ltimeco3;
|
||||
|
||||
%a = (%ac*%ltime) /2;
|
||||
%loc = %a*%ltime;
|
||||
|
||||
%co = %ac*mPow(%time,2);
|
||||
|
||||
%xx = 2*%x/%co;
|
||||
%zz = -1*(%root/%co);
|
||||
|
||||
%vz = VectorScale(%up,%zz);
|
||||
%vx = VectorScale(%ndir,%xx);
|
||||
|
||||
%vector = VectorAdd(%vx,%vz);
|
||||
|
||||
return %ltime SPC %time SPC %loc SPC %vector SPC %a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function Launch_Mpm(%pos,%dir,%speed,%time,%data)
|
||||
{
|
||||
%dir = VectorNormalize(%dir);
|
||||
|
||||
%obj = new Item()
|
||||
{
|
||||
className = Item;
|
||||
dataBlock = MpmLaucher;
|
||||
};
|
||||
%obj.mountimage(MpmLauchPoint,0);
|
||||
%obj.setTransform(%pos);
|
||||
%obj.setVelocity(%speed);
|
||||
%p = %obj.Fire_MpM(%dir,%data);
|
||||
%obj.schedule(50,"delete");
|
||||
|
||||
%p.lasterror = "0 0 0";
|
||||
%p.lasttime = GetSimTime();
|
||||
if (%time !$= "")
|
||||
%p.dietime = GetSimTime()+%time;
|
||||
%p.schedule(%time,"delete");
|
||||
|
||||
%p.addToMPMGroup();
|
||||
return %p;
|
||||
}
|
||||
|
||||
function ProjectileData::Create(%data,%pos,%dir,%speed)
|
||||
{
|
||||
%obj = new Item()
|
||||
{
|
||||
className = Item;
|
||||
dataBlock = MpmLaucher;
|
||||
};
|
||||
%obj.mountimage(MpmLauchPoint,0);
|
||||
%obj.setTransform(%pos);
|
||||
if (VectorLen(%speed) > 200)
|
||||
%speed = VectorScale(VectorNormalize(%speed),200);
|
||||
%obj.setVelocity(%speed);
|
||||
%p = %obj.Fire_MpM(%dir,%data);
|
||||
%obj.schedule(50,"delete");
|
||||
return %p;
|
||||
}
|
||||
|
||||
function GameBase::Fire_MpM(%obj,%dir,%data)
|
||||
{
|
||||
%speed = %obj.getVelocity();
|
||||
%classname = %data.classname;
|
||||
%class = getSubStr(%classname,0,strLen(%classname)-4);
|
||||
%p = new (%class)()
|
||||
{
|
||||
datablock = %data;
|
||||
initialDirection = %dir;
|
||||
initialPosition = %obj.getWorldBoxCenter();
|
||||
SourceObject = %obj;
|
||||
SourceSlot = 0;
|
||||
};
|
||||
%p.StartVelocity = %speed;
|
||||
%p.createtime=getSimTime();
|
||||
|
||||
return %p;
|
||||
}
|
||||
|
||||
function extend(%p,%odir)
|
||||
{
|
||||
%dir = %p.InitialDirection;
|
||||
%pos = VectorAdd(%p.InitialPosition,VectorScale(%dir,-0.5));
|
||||
%left = VectorNormalize(VectorCross(VectorNormalize(%odir),"0 0 1"));
|
||||
%p1 = new SeekerProjectile()
|
||||
{
|
||||
dataBlock = mpmmissile2;
|
||||
initialDirection = %dir;
|
||||
initialPosition = VectorAdd(%pos,VectorScale(%left,5));
|
||||
sourceObject = %p.sourceObject;
|
||||
};
|
||||
|
||||
%p2 = new SeekerProjectile()
|
||||
{
|
||||
dataBlock = mpmmissile2;
|
||||
initialDirection = %dir;
|
||||
initialPosition = VectorAdd(%pos,VectorScale(%left,-5));
|
||||
sourceObject = %p.sourceObject;
|
||||
};
|
||||
%p1.createtime=getSimTime();
|
||||
%p1.StartVelocity = %p.sourceObject.GetVelocity();
|
||||
%p2.createtime=getSimTime();
|
||||
%p2.StartVelocity = %p.sourceObject.GetVelocity();
|
||||
%dietime = %p.dietime-GetSimTime();
|
||||
%p1.schedule(%dietime+10000,"delete");
|
||||
%p2.schedule(%dietime+10000,"delete");
|
||||
}
|
||||
|
||||
|
||||
2320
scripts/MPM/MPM_base.cs
Executable file
2320
scripts/MPM/MPM_base.cs
Executable file
File diff suppressed because it is too large
Load diff
272
scripts/MPM/Mpm_BE.cs
Executable file
272
scripts/MPM/Mpm_BE.cs
Executable file
|
|
@ -0,0 +1,272 @@
|
|||
|
||||
if ($mpm_BE != 1)
|
||||
{
|
||||
//$mpm_load[$mpm_loads] = Mpm_Base_Load;
|
||||
//$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_BBom_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_BMis_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_BMor_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_BE = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
datablock ItemData(Mpm_Base_Load)
|
||||
{
|
||||
cost = 40;
|
||||
missile = Mpm_B_MIS1;
|
||||
name = "[Weapon] Base Explosion";
|
||||
friendly = 0;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_BBom_Load):Mpm_Base_Load
|
||||
{
|
||||
cost = 75;
|
||||
name = "[Cluster] Bomber Run";
|
||||
missile = Mpm_B_MIS1;
|
||||
offset = "0 100";
|
||||
slot = 4;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_BMis_Load):Mpm_Base_Load
|
||||
{
|
||||
cost = 50;
|
||||
name = "[Cluster] Cluster Missile";
|
||||
missile = Mpm_B_MIS1;
|
||||
offset = "0 0";
|
||||
slot = 4;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_BMor_Load):Mpm_Base_Load
|
||||
{
|
||||
cost = 75;
|
||||
name = "[Cluster] Mortar dump";
|
||||
missile = Mpm_B_MIS1;
|
||||
offset = "0 100";
|
||||
slot = 4;
|
||||
};
|
||||
|
||||
datablock AudioDescription(AudioMassiveExplosion) {
|
||||
volume = "1";
|
||||
isLooping = "0";
|
||||
is3D = "1";
|
||||
minDistance = "500";
|
||||
maxDistance = "9999";
|
||||
coneInsideAngle = "360";
|
||||
coneOutsideAngle = "360";
|
||||
coneOutsideVolume = "1";
|
||||
coneVector = "0 0 1";
|
||||
environmentLevel = "1";
|
||||
loopCount = "-1";
|
||||
minLoopGap = "0";
|
||||
maxLoopGap = "0";
|
||||
type = "3";
|
||||
};
|
||||
|
||||
datablock AudioProfile(Mpm_BE_Sound) {
|
||||
fileName = "fx/weapons/mortar_explode.wav";
|
||||
description = "AudioMassiveExplosion";
|
||||
Preload = "1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_BE_PA) {
|
||||
dragCoefficient = "0.6";
|
||||
windCoefficient = "0";
|
||||
gravityCoefficient = "0";
|
||||
inheritedVelFactor = "0";
|
||||
constantAcceleration = "0";
|
||||
lifetimeMS = "7000";
|
||||
lifetimeVarianceMS = "2000";
|
||||
spinSpeed = "0";
|
||||
spinRandomMin = "-500";
|
||||
spinRandomMax = "500";
|
||||
useInvAlpha = "0";
|
||||
animateTexture = "0";
|
||||
framesPerSec = "1";
|
||||
textureName = "special/expFlare";
|
||||
animTexName[0] = "special/expFlare";
|
||||
colors[0] = "1.000000 1.000000 1.000000 0.900000";
|
||||
colors[1] = "1.000000 0.400000 0.000000 0.300000";
|
||||
colors[2] = "1.000000 0.300000 0.000000 0.000000";
|
||||
colors[3] = "1.000000 1.000000 1.000000 1.000000";
|
||||
sizes[0] = "75";
|
||||
sizes[1] = "250";
|
||||
sizes[2] = "400";
|
||||
sizes[3] = "1";
|
||||
times[0] = "0";
|
||||
times[1] = "0.7";
|
||||
times[2] = "1";
|
||||
times[3] = "2";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleEmitterData(Mpm_BE_PE) {
|
||||
className = "ParticleEmitterData";
|
||||
ejectionPeriodMS = "3";
|
||||
periodVarianceMS = "0";
|
||||
ejectionVelocity = "57";
|
||||
velocityVariance = "20";
|
||||
ejectionOffset = "6";
|
||||
thetaMin = "0";
|
||||
thetaMax = "110";
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
overrideAdvance = "0";
|
||||
orientParticles = "0";
|
||||
orientOnVelocity = "1";
|
||||
particles = "Mpm_BE_PA";
|
||||
lifetimeMS = "3600";
|
||||
lifetimeVarianceMS = "0";
|
||||
useEmitterSizes = "0";
|
||||
useEmitterColors = "0";
|
||||
overrideAdvances = "0";
|
||||
};
|
||||
|
||||
datablock ExplosionData(Mpm_BE) {
|
||||
className = "ExplosionData";
|
||||
soundProfile = "Mpm_BE_Sound";
|
||||
faceViewer = "0";
|
||||
particleDensity = "10";
|
||||
particleRadius = "1";
|
||||
explosionScale = "1 1 1";
|
||||
playSpeed = "1";
|
||||
emitter[0] = "Mpm_BE_PE";
|
||||
shockwaveOnTerrain = "0";
|
||||
debrisThetaMin = "0";
|
||||
debrisThetaMax = "90";
|
||||
debrisPhiMin = "0";
|
||||
debrisPhiMax = "360";
|
||||
debrisNum = "1";
|
||||
debrisNumVariance = "0";
|
||||
debrisVelocity = "2";
|
||||
debrisVelocityVariance = "0";
|
||||
delayMS = "0";
|
||||
delayVariance = "0";
|
||||
lifetimeMS = "1000";
|
||||
lifetimeVariance = "0";
|
||||
offset = "0";
|
||||
times[0] = "0";
|
||||
times[1] = "1";
|
||||
times[2] = "1";
|
||||
times[3] = "1";
|
||||
sizes[0] = "1 1 1";
|
||||
sizes[1] = "1 1 1";
|
||||
sizes[2] = "1 1 1";
|
||||
sizes[3] = "1 1 1";
|
||||
shakeCamera = "0";
|
||||
camShakeFreq = "10 10 10";
|
||||
camShakeAmp = "1 1 1";
|
||||
camShakeDuration = "1.5";
|
||||
camShakeRadius = "10";
|
||||
camShakeFalloff = "10";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(Mpm_BE_PR):Mpm_G_PR {
|
||||
Explosion = "Mpm_BE";
|
||||
};
|
||||
|
||||
|
||||
function Mpm_BBom_Load::Stage2(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%p2 = parent::Stage2(%data,%p);
|
||||
Cancel(%p2.stage2);
|
||||
%p2.stage2 = %data.schedule((%p2.s2time-5000),"AtTarget",%p2);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Bbom_Load::AtTarget(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%speed = GetWords(%p.predict(),3,5);
|
||||
%p.schedule(100,"Mpm_BomberRun");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Mpm_Bmis_Load::Stage2(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%p2 = parent::Stage2(%data,%p);
|
||||
Cancel(%p2.stage2);
|
||||
%p2.stage2 = %data.schedule((%p2.s2time-5000),"AtTarget",%p2);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Bmis_Load::AtTarget(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%speed = GetWords(%p.predict(),3,5);
|
||||
%p.schedule(250,"Mpm_MissileRun");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Mpm_Bmor_Load::Stage2(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%p2 = parent::Stage2(%data,%p);
|
||||
Cancel(%p2.stage2);
|
||||
%p2.stage2 = %data.schedule((%p2.s2time-5000),"AtTarget",%p2);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Bmor_Load::AtTarget(%data,%p)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%speed = GetWords(%p.predict(),3,5);
|
||||
%p.schedule(100,"Mpm_MortarRun");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function SeekerProjectile::Mpm_BomberRun(%p)
|
||||
{
|
||||
%speed = VectorNormalize(GetWords(%p.predict(),3,5));
|
||||
%adjust = VectorCross(%speed,"0 0 1");
|
||||
%adjust = VectorAdd(VectorScale(VectorCross(%adjust,%speed),GetRandom()*2-1),VectorScale(%adjust,GetRandom()*2-1));
|
||||
%p2=BomberBomb.Create(%p.getWorldBoxCenter(),"0 0 -1",VectorScale(VectorAdd(%speed,%adjust),25));
|
||||
%p.schedule(250,"Mpm_bomberRun");
|
||||
}
|
||||
|
||||
function SeekerProjectile::Mpm_MissileRun(%p)
|
||||
{
|
||||
%speed = GetWords(%p.predict(),3,5);
|
||||
%dir = VectorNormalize(%speed);
|
||||
%for = VectorScale(%dir,-89.3);
|
||||
%left = VectorNormalize(VectorCross("0 0 1",%for));
|
||||
%up = VectorNormalize(VectorCross(%for,%left));
|
||||
%var = VectorAdd(VectorScale(%left,getRandom()*20-10),VectorScale(%up,getRandom()*20-10));
|
||||
%vel = VectorAdd(%for,%var);
|
||||
ShoulderMissile.create(%p.getWorldBoxCenter(),%dir,%vel);
|
||||
%p.schedule(100,"Mpm_MissileRun");
|
||||
}
|
||||
|
||||
function SeekerProjectile::Mpm_MortarRun(%p)
|
||||
{
|
||||
%speed = VectorNormalize(GetWords(%p.predict(),3,5));
|
||||
%adjust = VectorCross(%speed,"0 0 1");
|
||||
%adjust = VectorAdd(VectorScale(VectorCross(%adjust,%speed),GetRandom()*2-1),VectorScale(%adjust,GetRandom()*2-1));
|
||||
|
||||
%p2=MortarShot.Create(%p.getWorldBoxCenter(),"0 0 -1",VectorScale(VectorAdd(%speed,%adjust),25));
|
||||
%p.schedule(150,"Mpm_MortarRun");
|
||||
}
|
||||
|
||||
function Mpm_Base_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
if (IsObject(%p))
|
||||
{
|
||||
PlayExplosion(%pos,"Mpm_BE_PR","0 0 -1");
|
||||
RadiusExplosion(%p, %pos, 50, 5, 5000, %p.owner, $DamageType::Missile);
|
||||
}
|
||||
}
|
||||
766
scripts/MPM/Mpm_SE.cs
Executable file
766
scripts/MPM/Mpm_SE.cs
Executable file
|
|
@ -0,0 +1,766 @@
|
|||
///Telleport missile
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS_P1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 8000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/lensflare/flare00";
|
||||
|
||||
colors[0] = "0.3 0.3 1.0 0";
|
||||
colors[1] = "0.3 0.3 1.0 1";
|
||||
colors[2] = "0.3 0.3 1.0 1";
|
||||
colors[3] = "0.3 0.3 1.0 0.1";
|
||||
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 10;
|
||||
sizes[2] = 5;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0.1;
|
||||
times[1] = 0.2;
|
||||
times[2] = 0.3;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS_PE1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
orientParticles = true;
|
||||
orientOnVelocity = true;
|
||||
|
||||
particles = "Mpm_B_MIS_P1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS_P2):Mpm_B_MIS_P1
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/lensflare/flare00";
|
||||
|
||||
colors[0] = "0.3 0.3 1.0 0";
|
||||
colors[1] = "0.3 0.3 1.0 1";
|
||||
colors[2] = "0.3 0.3 1.0 1";
|
||||
colors[3] = "0.3 0.3 1.0 0.1";
|
||||
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 8;
|
||||
sizes[2] = 8;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0.3;
|
||||
times[1] = 0.5;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS_PE2):Mpm_B_MIS_PE1
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 50;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 140.0;
|
||||
thetaMax = 160.0;
|
||||
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS_P2";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
datablock SeekerProjectileData(Mpm_B_MIS):MpmMissile1
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "turret_muzzlePoint.dts";
|
||||
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
|
||||
baseEmitter = Mpm_B_MIS_PE1;
|
||||
delayEmitter = Mpm_B_MIS_PE2;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 80000;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 3;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0 0 1";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
//Multi WarHead Missiles
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS1_P1)
|
||||
{
|
||||
dragCoefficient = 5;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 30000;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/BigSpark";
|
||||
windcoefficient = 0;
|
||||
colors[0] = "0.6 0.6 0.6 1";
|
||||
colors[1] = "0.6 0.6 0.6 1";
|
||||
colors[2] = "0.6 0.6 0.6 1";
|
||||
colors[3] = "0.2 0.2 0.2 1";
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 15;
|
||||
sizes[2] = 5;
|
||||
sizes[3] = 0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.04;
|
||||
times[2] = 0.08;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS1_PE1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 2;
|
||||
thetaMin = 180.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "0";
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS1_P1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS1_P2):Mpm_B_MIS_P1
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
constantAcceleration = -0.25;
|
||||
lifetimeMS = 10000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/BigSpark";
|
||||
|
||||
colors[0] = "1 1 1.0 1";
|
||||
colors[1] = "1 1 1.0 1";
|
||||
colors[2] = "1 1 1.0 1";
|
||||
colors[3] = "1 1 1.0 0.1";
|
||||
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 5;
|
||||
sizes[2] = 3;
|
||||
sizes[3] = 0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.04;
|
||||
times[2] = 0.08;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS1_PE2):Mpm_B_MIS_PE1
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 50;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 5;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 5;
|
||||
thetaMin = 150.0;
|
||||
thetaMax = 180.0;
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "360";
|
||||
|
||||
orientParticles = true;
|
||||
orientOnVelocity = true;
|
||||
|
||||
particles = "Mpm_B_MIS1_P2";
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock SeekerProjectileData(Mpm_B_MIS1):MpmMissile1
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "turret_muzzlePoint.dts";
|
||||
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
|
||||
baseEmitter = Mpm_B_MIS1_PE1;
|
||||
delayEmitter = Mpm_B_MIS1_PE2;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 80000;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 3;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "1 1 0";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//Anti Missile
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS2_P1)
|
||||
{
|
||||
dragCoefficient = 5;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 30000;
|
||||
lifetimeVarianceMS = 0;
|
||||
textureName = "special/sniper00";
|
||||
windcoefficient = 0;
|
||||
colors[0] = "0.6 0.6 0.6 1";
|
||||
colors[1] = "0.6 0.6 0.6 1";
|
||||
colors[2] = "0.6 0.6 0.6 1";
|
||||
colors[3] = "0.2 0.2 0.2 0";
|
||||
sizes[0] = 0;
|
||||
sizes[1] = 5;
|
||||
sizes[2] = 2;
|
||||
sizes[3] = 2;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.04;
|
||||
times[2] = 0.08;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS2_PE1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 2;
|
||||
thetaMin = 180.0;
|
||||
thetaMax = 180.0;
|
||||
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "0";
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS2_P1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS2_P2):Mpm_B_MIS_P1
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = -30.0;
|
||||
spinRandomMax = 30.0;
|
||||
windcoefficient = 0.5;
|
||||
textureName = "special/flare3";
|
||||
colors[0] = "1 1 0.0 1";
|
||||
colors[1] = "1 1 0.0 1";
|
||||
colors[2] = "1 1 0.0 1";
|
||||
colors[3] = "1 1 0.0 0.1";
|
||||
|
||||
sizes[0] = 10;
|
||||
sizes[1] = 10;
|
||||
sizes[2] = 10;
|
||||
sizes[3] = 10;
|
||||
|
||||
times[0] = 0.4;
|
||||
times[1] = 0.6;
|
||||
times[2] = 0.8;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS2_PE2):Mpm_B_MIS_PE1
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 100;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "0";
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS2_P2";
|
||||
};
|
||||
|
||||
datablock SeekerProjectileData(Mpm_B_MIS2):MpmMissile1
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "turret_muzzlePoint.dts";
|
||||
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
|
||||
baseEmitter = Mpm_B_MIS2_PE1;
|
||||
delayEmitter = Mpm_B_MIS2_PE2;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 20.0;
|
||||
maxVelocity = 20;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 0;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "1 0 0";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//Vehicle Missile
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS3_P1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 60000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0.5;
|
||||
textureName = "skins/jetflare2";
|
||||
|
||||
colors[0] = "0.3 0.8 0.6 1";
|
||||
colors[1] = "0.3 0.8 0.0 0.9";
|
||||
colors[2] = "0.3 0.8 0.6 0.5";
|
||||
colors[3] = "0.3 0.8 0.6 0.0";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 17;
|
||||
sizes[2] = 18;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.5;
|
||||
times[3] = 0.75;
|
||||
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS3_PE1)
|
||||
{
|
||||
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 100;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10.0;
|
||||
velocityVariance = 1.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 5.0;
|
||||
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS3_P1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS3_P2):Mpm_B_MIS_P1
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = -160.0;
|
||||
spinRandomMax = 160.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "skins/flaregreen";
|
||||
UseInvAlpha = false;
|
||||
colors[0] = "0.7 0.7 1.0 0.5";
|
||||
colors[1] = "0.7 0.7 1.0 0.5";
|
||||
colors[2] = "0.7 0.7 1.0 0.5";
|
||||
colors[3] = "0.7 0.7 1.0 0.5";
|
||||
|
||||
sizes[0] = 20;
|
||||
sizes[1] = 20;
|
||||
sizes[2] = 20;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0.25;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.25;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS3_PE2):Mpm_B_MIS_PE1
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 100;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "0";
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS3_P2";
|
||||
};
|
||||
|
||||
datablock SeekerProjectileData(Mpm_B_MIS3):MpmMissile1
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "turret_muzzlePoint.dts";
|
||||
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
|
||||
baseEmitter = Mpm_B_MIS3_PE1;
|
||||
delayEmitter = Mpm_B_MIS3_PE2;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 80000;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 1;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0 1 0";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
//Aid Missile
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS4_P1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 60000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0.5;
|
||||
textureName = "skins/jetflare2";
|
||||
|
||||
colors[0] = "0.3 0.3 0.8 1";
|
||||
colors[1] = "0.0 0.0 0.8 0.9";
|
||||
colors[2] = "0.3 0.3 0.8 0.5";
|
||||
colors[3] = "0.3 0.3 0.8 0.0";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 17;
|
||||
sizes[2] = 18;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.5;
|
||||
times[3] = 0.75;
|
||||
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS4_PE1)
|
||||
{
|
||||
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 50;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 10.0;
|
||||
velocityVariance = 1.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 5.0;
|
||||
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS4_P1";
|
||||
};
|
||||
|
||||
datablock ParticleData(Mpm_B_MIS4_P2):Mpm_B_MIS_P1
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 1.0;
|
||||
|
||||
lifetimeMS = 1000;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = -160.0;
|
||||
spinRandomMax = 160.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "skins/flaregreen";
|
||||
UseInvAlpha = false;
|
||||
colors[0] = "0.2 0.2 1.0 0.5";
|
||||
colors[1] = "0.2 0.2 1.0 0.5";
|
||||
colors[2] = "0.2 0.2 1.0 0.5";
|
||||
colors[3] = "0.2 0.2 1.0 0.5";
|
||||
|
||||
sizes[0] = 20;
|
||||
sizes[1] = 20;
|
||||
sizes[2] = 20;
|
||||
sizes[3] = 20;
|
||||
|
||||
times[0] = 0.25;
|
||||
times[1] = 0.25;
|
||||
times[2] = 0.25;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_B_MIS4_PE2):Mpm_B_MIS_PE1
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 100;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 0;
|
||||
thetaMin = 0.0;
|
||||
thetaMax = 0.0;
|
||||
phiReferenceVel = "0";
|
||||
phiVariance = "0";
|
||||
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_B_MIS4_P2";
|
||||
};
|
||||
|
||||
datablock SeekerProjectileData(Mpm_B_MIS4):MpmMissile1
|
||||
{
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "turret_muzzlePoint.dts";
|
||||
|
||||
|
||||
explosion = "GrenadeExplosion";
|
||||
splash = MissileSplash;
|
||||
|
||||
baseEmitter = Mpm_B_MIS4_PE1;
|
||||
delayEmitter = Mpm_B_MIS4_PE2;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 0.1;
|
||||
maxVelocity = 80000;
|
||||
turningSpeed = 0.0;
|
||||
acceleration = 1;
|
||||
scale = "1 1 1";
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 0;
|
||||
flareAngle = 0;
|
||||
|
||||
sound = HAPCFlyerThrustSound;
|
||||
//BomberFlyerThrustSound;
|
||||
explodeOnDeath = "1";
|
||||
hasLight = true;
|
||||
lightRadius = 10.0;
|
||||
lightColor = "0 0 1";
|
||||
|
||||
useFlechette = false;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = true;
|
||||
};
|
||||
|
||||
|
||||
193
scripts/MPM/Mpm_TE.cs
Executable file
193
scripts/MPM/Mpm_TE.cs
Executable file
|
|
@ -0,0 +1,193 @@
|
|||
if ($mpm_TE != 1)
|
||||
{
|
||||
$mpm_load[$mpm_loads] = Mpm_TE_Load;
|
||||
$mpm_loads++;
|
||||
$mpm_TE = 1;
|
||||
}
|
||||
|
||||
|
||||
datablock ItemData(Mpm_TE_Load)
|
||||
{
|
||||
cost = 10;
|
||||
missile = Mpm_B_MIS;
|
||||
name = "MPB Telleporter";
|
||||
friendly = 1;
|
||||
slot = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
datablock ParticleData(Mpm_TE_P)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 1500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 30.0;
|
||||
spinRandomMax = 30.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "skins/jetflare03";
|
||||
|
||||
colors[0] = "0.3 0.3 1.0 0.1";
|
||||
colors[1] = "0.3 0.3 1.0 1";
|
||||
colors[2] = "0.3 0.3 1.0 1";
|
||||
colors[3] = "0.3 0.3 1.0 0.1";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 5;
|
||||
sizes[2] = 5;
|
||||
sizes[3] = 5;
|
||||
|
||||
times[0] = 0.25;
|
||||
times[1] = 0.5;
|
||||
times[2] = 0.75;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_TE_PE)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 10;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.01;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 8;
|
||||
thetaMin = 80.0;
|
||||
thetaMax = 100.0;
|
||||
|
||||
phiReferenceVel = "180";
|
||||
phiVariance = "5";
|
||||
orientParticles = false;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_TE_P";
|
||||
};
|
||||
|
||||
|
||||
function Mpm_TE_Load::Explode(%data,%p,%pos)
|
||||
{
|
||||
//echo("explode");
|
||||
if (IsObject(%p))
|
||||
{
|
||||
//if(VectorDist(%p.targetlocation,%pos)<50)
|
||||
%p.load.AtTarget(%p);
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_TE_Load::AtTarget(%data,%p)
|
||||
{
|
||||
//echo("attar");
|
||||
if (IsObject(%p))
|
||||
{
|
||||
%p.source.mpb.MPM_TelleportMpb(VectorAdd(%p.getTransform(),"0 0 10"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function Mpb_undeploy(%obj)
|
||||
{
|
||||
if (%obj.deploySchedule)
|
||||
{
|
||||
%obj.deploySchedule.clear();
|
||||
%obj.deploySchedule = "";
|
||||
}
|
||||
|
||||
if (%obj.deployed !$= "" && %obj.deployed == 1)
|
||||
{
|
||||
%obj.setThreadDir($DeployThread, false);
|
||||
%obj.playThread($DeployThread,"deploy");
|
||||
%obj.playAudio($DeploySound, MobileBaseUndeploySound);
|
||||
%obj.station.setThreadDir($DeployThread, false);
|
||||
%obj.station.getDataBlock().onLosePowerDisabled(%obj.station);
|
||||
%obj.station.clearSelfPowered();
|
||||
%obj.station.goingOut=false;
|
||||
%obj.station.notDeployed = 1;
|
||||
%obj.station.playAudio($DeploySound, MobileBaseStationUndeploySound);
|
||||
|
||||
if (isObject(%obj.turret) && isObject(%turretClient = %obj.turret.getControllingClient()) !$= "")
|
||||
{
|
||||
CommandToServer( 'resetControlObject', %turretClient );
|
||||
}
|
||||
if (isObject(%obj.turret))
|
||||
%obj.turret.setThreadDir($DeployThread, false);
|
||||
//[most]
|
||||
if (isObject(%obj.nuke))
|
||||
%obj.nuke.mpm_all_off(0);
|
||||
//[most]
|
||||
%obj.turret.clearTarget();
|
||||
%obj.turret.setTargetObject(-1);
|
||||
|
||||
%obj.turret.playAudio($DeploySound, MobileBaseTurretUndeploySound);
|
||||
%obj.shield.open();
|
||||
%obj.shield.schedule(1000,"delete");
|
||||
%obj.deploySchedule = "";
|
||||
|
||||
%obj.fullyDeployed = 0;
|
||||
|
||||
%obj.noEnemyControl = 0;
|
||||
}
|
||||
%obj.deployed = 0;
|
||||
|
||||
}
|
||||
|
||||
function GameBase::MPM_TelleportMpb(%mpb,%target)
|
||||
{
|
||||
%p1 = CreateEmitter(%mpb.getTransform(),Mpm_TE_PE);
|
||||
%p2 = CreateEmitter(%mpb.getTransform(),Mpm_TE_PE);
|
||||
%p2.setRotation("1 0 0 3.14");
|
||||
%p3 = CreateEmitter(%target,Mpm_TE_PE);
|
||||
%p4 = CreateEmitter(%target,Mpm_TE_PE);
|
||||
%p4.setRotation("1 0 0 3.14");
|
||||
if (%mpb.deployed)
|
||||
{
|
||||
if (IsObject(%mpb.nuke.leftpad.getMountedObject(0)))
|
||||
%mpb.mountObject(%mpb.nuke.leftpad.getMountedObject(0),0);
|
||||
else if (IsObject(%mpb.nuke.rightpad.getMountedObject(0)))
|
||||
%mpb.mountObject(%mpb.nuke.rightpad.getMountedObject(0),0);
|
||||
|
||||
%mpb.schedule(7000,"telleport",%target);
|
||||
Schedule(7000,%mpb,"RadiusTelleport",%mpb,%mpb.getTransform(),%target);
|
||||
%p1.schedule(11000,"delete");
|
||||
%p2.schedule(11000,"delete");
|
||||
%p3.schedule(11000,"delete");
|
||||
%p4.schedule(11000,"delete");
|
||||
mpb_undeploy(%mpb);
|
||||
}
|
||||
else
|
||||
{
|
||||
%mpb.schedule(1500,"telleport",%target);
|
||||
Schedule(1500,%mpb,"RadiusTelleport",%mpb,%mpb.getTransform(),%target);
|
||||
%p1.schedule(5500,"delete");
|
||||
%p2.schedule(5500,"delete");
|
||||
%p3.schedule(5500,"delete");
|
||||
%p4.schedule(5500,"delete");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function RadiusTelleport(%obj,%pos,%target)
|
||||
{
|
||||
%mask = $TypeMasks::PlayerObjectType | $TypeMasks::ItemObjectType;
|
||||
InitContainerRadiusSearch(%pos, 8, %mask);
|
||||
while ((%test = containerSearchNext()) != 0)
|
||||
{
|
||||
if (%test != %obj && %test != %obj.getMountedObject(0))
|
||||
{
|
||||
%offset = VectorSub(%test.getTransform(),%pos);
|
||||
%test.telleport(VectorAdd(%target,%offset));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GameBase::telleport(%obj,%pos)
|
||||
{
|
||||
teleportStartFX(%obj);
|
||||
schedule(500,0,"teleportEndFX",%obj);
|
||||
%obj.schedule(500,"SetTransform",%pos SPC rot(%obj));
|
||||
}
|
||||
|
||||
205
scripts/MPM/Mpm_VE.cs
Executable file
205
scripts/MPM/Mpm_VE.cs
Executable file
|
|
@ -0,0 +1,205 @@
|
|||
if ($mpm_VE!=1)
|
||||
{
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load0;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load1;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load2;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load3;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load4;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load5;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load6;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load7;
|
||||
$mpm_loads++;
|
||||
$mpm_load[$mpm_loads] = Mpm_VE_Load8;
|
||||
$mpm_loads++;
|
||||
$mpm_VE = 1;
|
||||
}
|
||||
|
||||
datablock ParticleData(Mpm_VE_P1)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 2500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/GameGrid";
|
||||
|
||||
colors[0] = "0.3 0.3 1.0 0.1";
|
||||
colors[1] = "0.3 0.3 1.0 1";
|
||||
colors[2] = "0.3 0.3 1.0 1";
|
||||
colors[3] = "0.3 0.3 1.0 0.1";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 5;
|
||||
sizes[2] = 5;
|
||||
sizes[3] = 5;
|
||||
|
||||
times[0] = 0.1;
|
||||
times[1] = 0.5;
|
||||
times[2] = 0.9;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleData(Mpm_VE_P2)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 2500;
|
||||
lifetimeVarianceMS = 0;
|
||||
|
||||
spinRandomMin = 0.0;
|
||||
spinRandomMax = 0.0;
|
||||
windcoefficient = 0;
|
||||
textureName = "special/GameGrid";
|
||||
|
||||
|
||||
colors[0] = "0.3 0.3 1.0 0.1";
|
||||
colors[1] = "0.3 0.3 1.0 1";
|
||||
colors[2] = "0.3 0.3 1.0 1";
|
||||
colors[3] = "0.3 0.3 1.0 0.1";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 5;
|
||||
sizes[2] = 5;
|
||||
sizes[3] = 5;
|
||||
|
||||
times[0] = 0.1;
|
||||
times[1] = 0.5;
|
||||
times[2] = 0.9;
|
||||
times[3] = 1;
|
||||
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(Mpm_VE_PE1)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.1;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 8;
|
||||
thetaMin = 70.0;
|
||||
thetaMax = 70.0;
|
||||
|
||||
phiReferenceVel = "180";
|
||||
phiVariance = "5";
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
particles = "Mpm_VE_P1";
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(Mpm_VE_PE2)
|
||||
{
|
||||
lifetimeMS = 10;
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.01;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 8;
|
||||
thetaMin = 30.0;
|
||||
thetaMax = 30.0;
|
||||
|
||||
phiReferenceVel = "180";
|
||||
phiVariance = "5";
|
||||
orientParticles = true;
|
||||
orientOnVelocity = false;
|
||||
|
||||
|
||||
particles = "Mpm_VE_P2";
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_VE_Load0)
|
||||
{
|
||||
cost = 20;
|
||||
missile = Mpm_B_MIS3;
|
||||
name = "[Vehicle] Grav Cycle Missile";
|
||||
friendly = 1;
|
||||
vehicle = ScoutVehicle;
|
||||
slot = 0;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_VE_Load1):Mpm_VE_Load0
|
||||
{
|
||||
cost = 40;
|
||||
name = "[Vehicle] Tank Missile";
|
||||
vehicle = AssaultVehicle;
|
||||
};
|
||||
datablock ItemData(Mpm_VE_Load2):Mpm_VE_Load0
|
||||
{
|
||||
cost = 100;
|
||||
name = "[Vehicle] Mpb Missile";
|
||||
vehicle = MobileBaseVehicle;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_VE_Load3):Mpm_VE_Load0
|
||||
{
|
||||
cost = 25;
|
||||
name = "[Vehicle] Shrike Missile";
|
||||
vehicle = ScoutFlyer;
|
||||
};
|
||||
datablock ItemData(Mpm_VE_Load4):Mpm_VE_Load0
|
||||
{
|
||||
cost = 50;
|
||||
name = "[Vehicle] Bomber Missile";
|
||||
vehicle = BomberFlyer;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_VE_Load5):Mpm_VE_Load0
|
||||
{
|
||||
cost = 80;
|
||||
name = "[Vehicle] Havoc Missile";
|
||||
vehicle = HAPCFlyer;
|
||||
};
|
||||
datablock ItemData(Mpm_VE_Load6):Mpm_VE_Load0
|
||||
{
|
||||
cost = 800;
|
||||
name = "[Vehicle] Super Grav Cycle Missile";
|
||||
vehicle = SuperScoutVehicle;
|
||||
};
|
||||
|
||||
datablock ItemData(Mpm_VE_Load7):Mpm_VE_Load0
|
||||
{
|
||||
cost = 800;
|
||||
name = "[Vehicle] Super Havoc Missile";
|
||||
vehicle = SuperHAPCFlyer;
|
||||
};
|
||||
datablock ItemData(Mpm_VE_Load8):Mpm_VE_Load0
|
||||
{
|
||||
cost = 700;
|
||||
name = "[Vehicle] Artillery Missile";
|
||||
vehicle = Artillery;
|
||||
};
|
||||
|
||||
function Mpm_VE_Load0::AtTarget(%data,%p)
|
||||
{
|
||||
if (IsObject(%p) && vehicleCheck(%p.load.vehicle, %p.source.team))
|
||||
{
|
||||
%p1 = CreateEmitter(%p.getTransform(),Mpm_VE_PE1);
|
||||
%p2 = CreateEmitter(%p.getTransform(),Mpm_VE_PE2);
|
||||
$VehicleTotalCount[%p.source.team, %p.load.vehicle]++;
|
||||
%vehicle = %p.load.vehicle.create(%p.source.team);
|
||||
%vehicle.telleport(VectorAdd(%p.getTransform(),"0 0 10"));
|
||||
%p1.schedule(8000,"delete");
|
||||
%p2.schedule(8000,"delete");
|
||||
}
|
||||
}
|
||||
1356
scripts/MPM/Nuclear_blast.cs
Executable file
1356
scripts/MPM/Nuclear_blast.cs
Executable file
File diff suppressed because it is too large
Load diff
2585
scripts/MPM/Nuke_Cannon.cs
Executable file
2585
scripts/MPM/Nuke_Cannon.cs
Executable file
File diff suppressed because it is too large
Load diff
1227
scripts/MTC_ai.cs
Executable file
1227
scripts/MTC_ai.cs
Executable file
File diff suppressed because it is too large
Load diff
1483
scripts/MTC_core.cs
Executable file
1483
scripts/MTC_core.cs
Executable file
File diff suppressed because it is too large
Load diff
531
scripts/MTC_eWeap.cs
Executable file
531
scripts/MTC_eWeap.cs
Executable file
|
|
@ -0,0 +1,531 @@
|
|||
///Using new weapon mode switching logic :D :D
|
||||
|
||||
$WeaponSettings1[TractorGunImage] = "7 -1 TractorGun:[Power]";
|
||||
$WeaponSetting1[TractorGunImage,0] = "Grapling Power 1";
|
||||
$WeaponSetting1[TractorGunImage,1] = "Grapling Power 2";
|
||||
$WeaponSetting1[TractorGunImage,2] = "Grapling Power 3";
|
||||
$WeaponSetting1[TractorGunImage,3] = "Grapling Power 4";
|
||||
$WeaponSetting1[TractorGunImage,4] = "Grapling Power 5";
|
||||
$WeaponSetting1[TractorGunImage,5] = "Grapling Power 10";
|
||||
$WeaponSetting1[TractorGunImage,6] = "Grapling Power 125";
|
||||
$WeaponSetting1[TractorGunImage,7] = "Grapling Power 256";
|
||||
|
||||
|
||||
$WeaponSettings2[TractorGunImage] = "5 -1 TractorGun:[Direction]";
|
||||
$WeaponSetting2[TractorGunImage,0] = "Pull target";
|
||||
$WeaponSetting2[TractorGunImage,1] = "Push target";
|
||||
$WeaponSetting2[TractorGunImage,2] = "Keep target at 10 meters distance";
|
||||
$WeaponSetting2[TractorGunImage,3] = "Pull user";
|
||||
$WeaponSetting2[TractorGunImage,4] = "Push user";
|
||||
$WeaponSetting2[TractorGunImage,5] = "Keep user at 10 meters distance";
|
||||
|
||||
|
||||
datablock ItemData(TractorGun)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_elf.dts";
|
||||
image = TractorGunImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "an Tractor gun";
|
||||
|
||||
computeCRC = true;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
////////////////Tractor Beam///////////////////////
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
datablock ELFProjectileData(TractorBeam)
|
||||
{
|
||||
beamRange = 150;
|
||||
numControlPoints = 8;
|
||||
restorativeFactor = 3.75;
|
||||
dragFactor = 4.5;
|
||||
endFactor = 2.25;
|
||||
randForceFactor = 2;
|
||||
randForceTime = 0.125;
|
||||
drainEnergy = 0.0;
|
||||
drainHealth = 0.0;
|
||||
directDamageType = $DamageType::ELF;
|
||||
mainBeamWidth = 0.1; // width of blue wave beam
|
||||
mainBeamSpeed = 9.0; // speed that the beam travels forward
|
||||
mainBeamRepeat = 0.25; // number of times the texture repeats
|
||||
lightningWidth = 0.5;
|
||||
lightningDist = 0.5; // distance of lightning from main beam
|
||||
|
||||
fireSound = ElfGunFireSound;
|
||||
wetFireSound = ElfFireWetSound;
|
||||
|
||||
textures[0] = "special/Sniper";
|
||||
textures[1] = "special/FlareSpark";
|
||||
textures[2] = "special/Redflare";
|
||||
|
||||
emitter = FlareEmitter;
|
||||
};
|
||||
|
||||
|
||||
datablock ShapeBaseImageData(TractorGunImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_elf.dts";
|
||||
item = TractorGun;
|
||||
offset = "0 0 0";
|
||||
|
||||
projectile = TractorBeam;
|
||||
projectileType = ELFProjectile;
|
||||
deleteLastProjectile = true;
|
||||
emap = true;
|
||||
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 3;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = ELFGunSwitchSound;
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnAmmo[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateEnergyDrain[3] = 5;
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateScript[3] = "onFire";
|
||||
stateTransitionOnTriggerUp[3] = "Deconstruction";
|
||||
stateTransitionOnNoAmmo[3] = "Deconstruction";
|
||||
//stateSound[3] = ElfFireWetSound;
|
||||
|
||||
stateName[4] = "NoAmmo";
|
||||
stateTransitionOnAmmo[4] = "Ready";
|
||||
|
||||
stateName[5] = "Deconstruction";
|
||||
stateScript[5] = "deconstruct";
|
||||
stateTransitionOnTimeout[5] = "Ready";
|
||||
stateTransitionOnNoAmmo[6] = "NoAmmo";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
stateSound[6] = ElfFireWetSound;
|
||||
stateTimeoutValue[6] = 0.5;
|
||||
stateTransitionOnTimeout[6] = "Ready";
|
||||
|
||||
stateName[7] = "CheckWet";
|
||||
stateTransitionOnWet[7] = "DryFire";
|
||||
stateTransitionOnNotWet[7] = "Fire";
|
||||
};
|
||||
|
||||
datablock TurretImageData(TractorTurretBarrel)
|
||||
{
|
||||
|
||||
|
||||
shapeFile = "turret_Elf_large.dts";//"weapon_elf.dts";//
|
||||
item = ELFGun;
|
||||
|
||||
projectile = TractorBeam;
|
||||
projectileType = ELFProjectile;
|
||||
|
||||
deleteLastProjectile = true;
|
||||
emap = true;
|
||||
|
||||
|
||||
UsesEnergy = true;
|
||||
minEnergy = 0.1;
|
||||
fireEnergy = 0.1;
|
||||
|
||||
rotation = "0 1 0 90";
|
||||
offset = "0 -0.5 0";
|
||||
|
||||
yawVariance = 30.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 30.0; // more or less just tolerances
|
||||
// Turret parameters
|
||||
activationMS = 500;
|
||||
deactivateDelayMS = 100;
|
||||
thinkTimeMS = 100;
|
||||
degPerSecTheta = 580;
|
||||
degPerSecPhi = 960;
|
||||
attackRadius = 500;
|
||||
|
||||
|
||||
yawVariance = 60.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 60.0; // more or less just tolerances
|
||||
|
||||
|
||||
// State transiltions
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateSequence[1] = "Activate";
|
||||
stateSound[1] = EBLSwitchSound;
|
||||
stateTimeoutValue[1] = 1;
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTransitionOnNotLoaded[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNotLoaded[2] = "Deactivate";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = EBLFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
stateTransitionOnTriggerUp[3] = "Deconstruction";
|
||||
stateTransitionOnNoAmmo[3] = "Deconstruction";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTimeoutValue[4] = 0.01;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTransitionOnNotLoaded[4] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
|
||||
stateName[5] = "Deactivate";
|
||||
stateSequence[5] = "Activate";
|
||||
stateDirection[5] = false;
|
||||
stateTimeoutValue[5] = 1;
|
||||
stateTransitionOnLoaded[5] = "ActivateReady";
|
||||
stateTransitionOnTimeout[5] = "Dead";
|
||||
|
||||
stateName[6] = "Dead";
|
||||
stateTransitionOnLoaded[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
|
||||
stateName[8] = "Deconstruction";
|
||||
stateScript[8] = "deconstruct";
|
||||
stateTransitionOnNoAmmo[8] = "NoAmmo";
|
||||
stateTransitionOnTimeout[8] = "Reload";
|
||||
stateTimeoutValue[8] = 0.1;
|
||||
};
|
||||
|
||||
function TractorBeam::zapTarget(%data, %projectile, %target, %targeter)
|
||||
{
|
||||
%projectile.checkTractorStatus(%data, %target, %targeter);
|
||||
}
|
||||
|
||||
function TractorTurretBarrel::onFire(%data, %obj, %slot)
|
||||
{
|
||||
//if (getSimTime()-%target.swingend > 5000)
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
}
|
||||
|
||||
function ELFProjectile::checkTractorStatus(%this, %data, %target, %targeter)
|
||||
{
|
||||
%obj = %this.sourceObject;
|
||||
if((isObject(%target)) && (isObject(%obj)))
|
||||
{
|
||||
if(%target.getDamageState() $= "Destroyed")
|
||||
{
|
||||
cancel(%this.Tractorrecur);
|
||||
%this.delete();
|
||||
%targeter.base.resetorders();
|
||||
return;
|
||||
}
|
||||
|
||||
%data = %target.getDataBlock();
|
||||
%data2 = %targeter.getDataBlock();
|
||||
%pos = %target.getWorldBoxCenter();
|
||||
%pos2 = %targeter.getWorldBoxCenter();
|
||||
if (%targeter.IsMtc())
|
||||
%pos2= VectorAdd(%pos2,"0 0 15");
|
||||
%vec = VectorSub(%pos2,%pos);
|
||||
%dist = VectorLen(%vec);
|
||||
%dir = VectorNormalize(%vec);
|
||||
%set = %targeter.weaponSet1;
|
||||
if (%set !$="")
|
||||
%speed = getWord($WeaponSetting1[TractorGunImage,%targeter.weaponSet1],2);
|
||||
else
|
||||
%speed = 5;
|
||||
|
||||
%dspeed = Limit((%dist-10)/10,-1,1);
|
||||
if (%targeter.weaponSet2 == 2 || %targeter.weaponSet2 == 5)
|
||||
{
|
||||
%speed = %dspeed*%dspeed*%speed;
|
||||
%dir = VectorScale(%dir,Lev(%dspeed));
|
||||
}
|
||||
|
||||
if (%targeter.weaponSet2 == 1 || %targeter.weaponSet2 == 4)
|
||||
%dir = VectorScale(%dir,-1);
|
||||
//%amount = VectorScale(%dir, Limit((10000/%dist),0,10000));
|
||||
if (%client = %targeter.client)
|
||||
%admin = (%client.isAdmin || %client.isSuperAdmin);
|
||||
|
||||
%wantuser = (%targeter.weaponSet2 > 2);
|
||||
%tisplayer = (%target.getType() & $TypeMasks::PlayerObjectType);
|
||||
%tisgveh = (%target.getType() & $TypeMasks::VehicleObjectType && !%obj.disableMove);
|
||||
%allowed = ((%target.team != %obj.team) || ($teamDamage || %admin));
|
||||
|
||||
if (%allowed && (%tisplayer || %tisgveh) && !%wantuser)
|
||||
{
|
||||
if(%obj.getObjectMount() != %target && %this.hasTarget())
|
||||
{
|
||||
%limit = (%target.getType() & $TypeMasks::VehicleObjectType);
|
||||
%size = Limit(3*%data.mass*%speed,0,10000*(1+9*%limit));
|
||||
%amount = VectorScale(%dir, %size);
|
||||
%target.applyImpulse(%pos, %amount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%obj.getObjectMount() != %target && %this.hasTarget())
|
||||
{
|
||||
%size = Limit(3*%data2.mass*%speed,0,10000);
|
||||
%amount = VectorScale(%dir, %size);
|
||||
%targeter.applyImpulse(%pos2, VectorScale(%amount,-1));
|
||||
}
|
||||
}
|
||||
%this.TractorRecur = %this.schedule(70, checkTractorStatus, %data, %target, %targeter);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////SwarmDisc////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
datablock SeekerProjectileData(SeekingDisc)
|
||||
{
|
||||
projectileShapeName = "disc.dts";
|
||||
emitterDelay = -1;
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.10;
|
||||
damageRadius = 7.5;
|
||||
radiusDamageType = $DamageType::Disc;
|
||||
kickBackStrength = 1750;
|
||||
|
||||
sound = discProjectileSound;
|
||||
explosion = "DiscExplosion";
|
||||
underwaterExplosion = "UnderwaterDiscExplosion";
|
||||
splash = DiscSplash;
|
||||
|
||||
|
||||
velInheritFactor = 0.5;
|
||||
fizzleTimeMS = 50000;
|
||||
lifetimeMS = 50000;
|
||||
explodeOnDeath = true;
|
||||
reflectOnWaterImpactAngle = 15.0;
|
||||
explodeOnWaterImpact = true;
|
||||
deflectionOnWaterImpact = 0.0;
|
||||
fizzleUnderwaterMS = 5000;
|
||||
|
||||
|
||||
baseEmitter = HumanArmorJetEmitter;
|
||||
delayEmitter = HumanArmorJetEmitter;
|
||||
|
||||
exhaustEmitter = DiscMistEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
|
||||
muzzleVelocity = 10.0;
|
||||
maxVelocity = 30.0;
|
||||
turningSpeed = 110.0;
|
||||
acceleration = 5;
|
||||
|
||||
proximityRadius = 0;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
|
||||
activateDelayMS = 200;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 6.0;
|
||||
lightColor = "0.175 0.175 0.5";
|
||||
|
||||
};
|
||||
|
||||
|
||||
datablock TurretImageData(SwarmDiscTurretBarrel)
|
||||
{
|
||||
|
||||
shapeFile = "turret_AA_large.dts";//weapon_missile.dts";
|
||||
item = MissileLauncher;
|
||||
//ammo = MissileLauncherAmmo;
|
||||
armThread = lookms;
|
||||
emap = true;
|
||||
|
||||
projectile= SeekingDisc;
|
||||
projectileType= SeekerProjectile;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 900;
|
||||
maxSeekAngle = 90;
|
||||
seekTime = 5.0;
|
||||
minSeekHeat = 0.0; // the heat that must be present on a target to lock it.
|
||||
yawVariance = 30.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 30.0; // more or less just tolerances
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 5;
|
||||
minEnergy = 5;
|
||||
projectileSpread = 0.01;
|
||||
|
||||
|
||||
offset = "0.7 -0.04 -0.45";
|
||||
rotation = "0 1 0 -90";
|
||||
|
||||
// only target objects outside this range
|
||||
minTargetingDistance = 4;
|
||||
|
||||
// Turret parameters
|
||||
activationMS = 250;
|
||||
deactivateDelayMS = 500;
|
||||
thinkTimeMS = 200;
|
||||
degPerSecTheta = 580;
|
||||
degPerSecPhi = 1080;
|
||||
attackRadius = 500;
|
||||
|
||||
// State transitions
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateSequence[1] = "Activate";
|
||||
stateSound[1] = MBLSwitchSound;
|
||||
stateTimeoutValue[1] = 2;
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTransitionOnNotLoaded[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNotLoaded[2] = "Deactivate";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = MBLFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTimeoutValue[4] = 3.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTransitionOnNotLoaded[4] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
|
||||
stateName[5] = "Deactivate";
|
||||
stateSequence[5] = "Activate";
|
||||
stateDirection[5] = false;
|
||||
stateTimeoutValue[5] = 2;
|
||||
stateTransitionOnLoaded[5] = "ActivateReady";
|
||||
stateTransitionOnTimeout[5] = "Dead";
|
||||
|
||||
stateName[6] = "Dead";
|
||||
stateTransitionOnLoaded[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock TurretImageData(SwarmDiscTurretBarrel1):SwarmDiscTurretBarrel
|
||||
{
|
||||
shapeFile = "turret_AA_large.dts";//weapon_mortar.dts";
|
||||
item = Mortar;
|
||||
offset = "-0.7 -0.04 -0.45";
|
||||
rotation = "0 1 0 -90";
|
||||
};
|
||||
|
||||
|
||||
function SwarmDiscTurretBarrel::onMount(%this, %obj, %slot)
|
||||
{
|
||||
%mount1 = "SwarmDiscTurretBarrel1";
|
||||
%mount2 = "MtcTurretCore";
|
||||
%obj.schedule(2000,"mountImage",%mount1,1,true);
|
||||
%obj.mountImage(%mount2,2,true);
|
||||
}
|
||||
|
||||
|
||||
function SwarmDiscTurretBarrel::onFire(%data,%obj,%slot)
|
||||
{
|
||||
for (%i = 0; %i < 5;%i++)
|
||||
{
|
||||
%obj.currentbarrel = !%obj.currentbarrel;
|
||||
%slot = %obj.currentbarrel;
|
||||
%p = Parent::onFire(%data, %obj, %slot);
|
||||
if (%p)
|
||||
{
|
||||
MissileSet.add(%p);
|
||||
|
||||
if (%obj.base.target)
|
||||
{
|
||||
%target = %obj.base.target;
|
||||
}
|
||||
else
|
||||
%target = %obj.getLockedTarget();
|
||||
|
||||
%sign = GiveSign(%target);
|
||||
if(%target)
|
||||
{
|
||||
%p.setObjectTarget(%sign);
|
||||
}
|
||||
else if(%obj.isLocked())
|
||||
%p.setPositionTarget(%obj.getLockedPosition());
|
||||
else
|
||||
%p.setNoTarget();
|
||||
discoff(%p);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function SwarmDiscTurretBarrel1::onFire(%data,%obj,%slot)
|
||||
{
|
||||
//Do nothing;
|
||||
}
|
||||
|
||||
function discoff(%p)
|
||||
{
|
||||
if (!IsObject(%p))
|
||||
return "";
|
||||
if (!IsObject(%p.getTargetObject()) && IsObject(%p.disctarget))
|
||||
{
|
||||
%p.setObjectTarget(%p.disctarget);
|
||||
}
|
||||
else if (IsObject(%p.getTargetObject()))
|
||||
{
|
||||
%p.disctarget = %p.getTargetObject();
|
||||
%p.setNoTarget();
|
||||
}
|
||||
else
|
||||
return "";
|
||||
schedule(getRandom()*1000+500,0,"discoff",%p);
|
||||
}
|
||||
|
||||
41
scripts/MTC_level.cs
Executable file
41
scripts/MTC_level.cs
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
//Basic Levels;
|
||||
|
||||
//These make up the spawning behaviour of the mtc weapon types
|
||||
//Only starting ideas for now
|
||||
//Changes are culmative
|
||||
|
||||
//Only targeting lasers
|
||||
function MTCLevel0()
|
||||
{
|
||||
$MTCCHANGE::weapon[0] = "target";
|
||||
$MTCCHANGE::change[0] = 1;
|
||||
$MTCCHANGE::totchange = 1;
|
||||
$MTCCHANGE::count = 1;
|
||||
}
|
||||
|
||||
//9 targeting lasers
|
||||
//1 blaster
|
||||
function MTCLevel1()
|
||||
{
|
||||
$MTCCHANGE::weapon[0] = "target";
|
||||
$MTCCHANGE::change[0] = 9;
|
||||
$MTCCHANGE::weapon[0] = "blaster";
|
||||
$MTCCHANGE::change[0] = 10;
|
||||
$MTCCHANGE::totchange = 10;
|
||||
$MTCCHANGE::count = 2;
|
||||
}
|
||||
|
||||
//8 targeting lasers
|
||||
//2 blasters
|
||||
//1 grenades
|
||||
function MTCLevel2()
|
||||
{
|
||||
$MTCCHANGE::weapon[0] = "target";
|
||||
$MTCCHANGE::change[0] = 8;
|
||||
$MTCCHANGE::weapon[0] = "blaster";
|
||||
$MTCCHANGE::change[0] = 10;
|
||||
$MTCCHANGE::weapon[0] = "grenade";
|
||||
$MTCCHANGE::change[0] = 11;
|
||||
$MTCCHANGE::totchange = 11;
|
||||
$MTCCHANGE::count = 3;
|
||||
}
|
||||
1334
scripts/MTC_weap.cs
Executable file
1334
scripts/MTC_weap.cs
Executable file
File diff suppressed because it is too large
Load diff
2763
scripts/OptionsDlg.cs
Executable file
2763
scripts/OptionsDlg.cs
Executable file
File diff suppressed because it is too large
Load diff
31
scripts/TR2Game.cs
Executable file
31
scripts/TR2Game.cs
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
// Bastardized for Contruction Mod to load the player datablocks
|
||||
// without screwing up the rest of the game.
|
||||
|
||||
// DisplayName = Team Rabbit 2
|
||||
|
||||
//--- GAME RULES BEGIN ---
|
||||
//Get the flag and throw it into the other team's goal
|
||||
//You can only hold onto the flag for 15 seconds
|
||||
//Passing the flag increases the size of the Jackpot
|
||||
//Scoring a goal awards the Jackpot to your team!
|
||||
//When your health reaches zero, you are knocked down
|
||||
//Replenish your ammo by pressing your suicide button
|
||||
//--- GAME RULES END ---
|
||||
|
||||
|
||||
|
||||
// Team Rabbit 2
|
||||
// Created by Codality, Inc.
|
||||
// www.codality.com
|
||||
// -------------------------------
|
||||
// Michael "KineticPoet" Johnston - Designer, Lead Programmer, Maps
|
||||
// Dan "daunt" Kolta - Physics design, Maps
|
||||
// Scott "FSB-AO" Estabrook - Programmer
|
||||
// John "CObbler" Carter - Bonus sound effects
|
||||
// Buddy "sLaM" Pritchard - Sound effects
|
||||
// Gregg "illy" Fellows - 3D models and skins
|
||||
// Alan "Nefilim" Schwertel; - Maps
|
||||
// Kenneth "SONOFMAN" Cook - Sky art
|
||||
|
||||
|
||||
exec("scripts/TR2Physics.cs");
|
||||
612
scripts/admin.cs
Executable file
612
scripts/admin.cs
Executable file
|
|
@ -0,0 +1,612 @@
|
|||
// These have been secured against all those wanna-be-hackers.
|
||||
$VoteMessage["VoteAdminPlayer"] = "Admin Player";
|
||||
$VoteMessage["VoteKickPlayer"] = "Kick Player";
|
||||
$VoteMessage["BanPlayer"] = "Ban Player";
|
||||
$VoteMessage["VoteChangeMission"] = "change the mission to";
|
||||
$VoteMessage["VoteTeamDamage", 0] = "enable team damage";
|
||||
$VoteMessage["VoteTeamDamage", 1] = "disable team damage";
|
||||
$VoteMessage["VoteTournamentMode"] = "change the server to";
|
||||
$VoteMessage["VoteFFAMode"] = "change the server to";
|
||||
$VoteMessage["VoteChangeTimeLimit"] = "change the time limit to";
|
||||
$VoteMessage["VoteMatchStart"] = "start the match";
|
||||
$VoteMessage["VoteGreedMode", 0] = "enable Hoard Mode";
|
||||
$VoteMessage["VoteGreedMode", 1] = "disable Hoard Mode";
|
||||
$VoteMessage["VoteHoardMode", 0] = "enable Greed Mode";
|
||||
$VoteMessage["VoteHoardMode", 1] = "disable Greed Mode";
|
||||
// JTL
|
||||
$VoteMessage["VotePurebuild", 0] = "enable pure building";
|
||||
$VoteMessage["VotePurebuild", 1] = "disable pure building";
|
||||
$VoteMessage["VoteCascadeMode", 0] = "enable cascade mode";
|
||||
$VoteMessage["VoteCascadeMode", 1] = "disable cascade mode";
|
||||
$VoteMessage["VoteExpertMode", 0] = "enable expert mode";
|
||||
$VoteMessage["VoteExpertMode", 1] = "disable expert mode";
|
||||
$VoteMessage["VoteVehicles", 0] = "enable vehicles";
|
||||
$VoteMessage["VoteVehicles", 1] = "disable vehicles";
|
||||
$VoteMessage["VoteSatchelCharge", 0] = "enable satchel charges";
|
||||
$VoteMessage["VoteSatchelCharge", 1] = "disable satchel charges";
|
||||
$VoteMessage["VoteOnlyOwnerDeconstruct", 0] = "enable only owner deconstruct";
|
||||
$VoteMessage["VoteOnlyOwnerDeconstruct", 1] = "disable only owner deconstruct";
|
||||
$VoteMessage["VoteOnlyOwnerCascade", 0] = "enable only owner cascade";
|
||||
$VoteMessage["VoteOnlyOwnerCascade", 1] = "disable only owner cascade";
|
||||
$VoteMessage["VoteOnlyOwnerRotate", 0] = "enable only owner rotate";
|
||||
$VoteMessage["VoteOnlyOwnerRotate", 1] = "disable only owner rotate";
|
||||
$VoteMessage["VoteOnlyOwnerCubicReplace", 0] = "enable only owner cubic-replace";
|
||||
$VoteMessage["VoteOnlyOwnerCubicReplace", 1] = "disable only owner cubic-replace";
|
||||
$VoteMessage["VoteInvincibleArmors", 0] = "enable invincible armors";
|
||||
$VoteMessage["VoteInvincibleArmors", 1] = "disable invincible armors";
|
||||
$VoteMessage["VoteInvincibleDeployables", 0] = "enable invincible deployables";
|
||||
$VoteMessage["VoteInvincibleDeployables", 1] = "disable invincible deployables";
|
||||
$VoteMessage["VoteUndergroundMode", 0] = "enable underground mode";
|
||||
$VoteMessage["VoteUndergroundMode", 1] = "disable underground mode";
|
||||
$VoteMessage["VoteHazardMode", 0] = "enable hazard mode";
|
||||
$VoteMessage["VoteHazardMode", 1] = "disable hazard mode";
|
||||
$VoteMessage["VoteMTCMode", 0] = "enable MTC mode";
|
||||
$VoteMessage["VoteMTCMode", 1] = "disable MTC mode";
|
||||
$VoteMessage["VoteRemoveDeployables"] = "remove all deployables in mission";
|
||||
$VoteMessage["VoteGlobalPowerCheck"] = "remove all duplicate deployables";
|
||||
$VoteMessage["VoteRemoveDupDeployables"] = "remove all duplicate deployables";
|
||||
$VoteMessage["VoteRemoveNonPoweredDeployables"] = "remove all deployables without power";
|
||||
$VoteMessage["VoteRemoveOrphanedDeployables"] = "remove all orphaned deployables";
|
||||
$VoteMessage["VotePrison", 0] = "enable prison";
|
||||
$VoteMessage["VotePrison", 1] = "disable prison";
|
||||
$VoteMessage["VotePrisonKilling", 0] = "enable jailing killers";
|
||||
$VoteMessage["VotePrisonKilling", 1] = "disable jailing killers";
|
||||
$VoteMessage["VotePrisonTeamKilling", 0] = "enable jailing team killers";
|
||||
$VoteMessage["VotePrisonTeamKilling", 1] = "disable jailing team killers";
|
||||
$VoteMessage["VotePrisonDeploySpam", 0] = "enable jailing deploy spammers";
|
||||
$VoteMessage["VotePrisonDeploySpam", 1] = "disable jailing deploy spammers";
|
||||
$VoteMessage["VoteNerfWeapons", 0] = "enable nerf weapons";
|
||||
$VoteMessage["VoteNerfWeapons", 1] = "disable nerf weapons";
|
||||
$VoteMessage["VoteNerfDance", 0] = "enable nerf dance mode";
|
||||
$VoteMessage["VoteNerfDance", 1] = "disable nerf dance mode";
|
||||
$VoteMessage["VotenerfDeath", 0] = "enable nerf death mode";
|
||||
$VoteMessage["VotenerfDeath", 1] = "disable nerf death mode";
|
||||
$VoteMessage["VoteNerfPrison", 0] = "enable nerf prison mode";
|
||||
$VoteMessage["VoteNerfPrison", 1] = "disable nerf prison mode";
|
||||
// End JTL
|
||||
|
||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
{
|
||||
//DEMO VERSION - only voteKickPlayer is allowed
|
||||
if ((isDemo()) && %typeName !$= "VoteKickPlayer")
|
||||
{
|
||||
messageClient(%client, '', "All voting options except to kick a player are disabled in the DEMO VERSION.");
|
||||
return;
|
||||
}
|
||||
|
||||
// haha - who gets the last laugh... No admin for you!
|
||||
if( %typeName $= "VoteAdminPlayer" && (!$Host::allowAdminPlayerVotes && !%client.isSuperAdmin))
|
||||
return;
|
||||
|
||||
%typePass = true;
|
||||
|
||||
// if not a valid vote, turn back.
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteTeamDamage" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHoardMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGreedMode" )
|
||||
// JTL
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePurebuild" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteCascadeMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteExpertMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteVehicles" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteSatchelCharge" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerDeconstruct" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerCascade" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerRotate" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteOnlyOwnerCubicReplace" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGlobalPowerCheck" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveDupDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveNonPoweredDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteRemoveOrphanedDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteInvincibleArmors" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteInvincibleDeployables" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteUndergroundMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHazardMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteMTCMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrison" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonKilling" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonTeamKilling" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VotePrisonDeploySpam" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteNerfWeapons" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteNerfDance" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteNerfDeath" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteNerfPrison" )
|
||||
%typePass = false;
|
||||
// End JTL
|
||||
|
||||
if(( $VoteMessage[ %typeName, $TeamDamage ] $= "" && %typeName $= "VoteTeamDamage" ))
|
||||
%typePass = false;
|
||||
// JTL
|
||||
if(( $VoteMessage[ %typeName, $Host::Purebuild ] $= "" && %typeName $= "VotePurebuild" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Cascade ] $= "" && %typeName $= "VoteCascadeMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::ExpertMode ] $= "" && %typeName $= "VoteExpertMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Vehicles ] $= "" && %typeName $= "VoteVehicles" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ] $= "" && %typeName $= "VoteSatchelCharge" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ] $= "" && %typeName $= "VoteOnlyOwnerDeconstruct" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ] $= "" && %typeName $= "VoteOnlyOwnerCascade" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ] $= "" && %typeName $= "VoteOnlyOwnerRotate" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ] $= "" && %typeName $= "VoteOnlyOwnerCubicReplace" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleArmors ] $= "" && %typeName $= "VoteInvincibleArmors" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::InvincibleDeployables ] $= "" && %typeName $= "VoteInvincibleDeployables" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::AllowUnderground ] $= "" && %typeName $= "VoteUndergroundMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Hazard::Enabled ] $= "" && %typeName $= "VoteHazardMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::MTC::Enabled ] $= "" && %typeName $= "VoteMTCMode" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Enabled ] $= "" && %typeName $= "VotePrison" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::Kill ] $= "" && %typeName $= "VotePrisonKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::TeamKill ] $= "" && %typeName $= "VotePrisonTeamKilling" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Prison::DeploySpam ] $= "" && %typeName $= "VotePrisonDeploySpam" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Nerf::Enabled ] $= "" && %typeName $= "VoteNerfWeapons" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Nerf::DanceAnim ] $= "" && %typeName $= "VoteNerfDance" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Nerf::DeathAnim ] $= "" && %typeName $= "VoteNerfDeath" ))
|
||||
%typePass = false;
|
||||
if(( $VoteMessage[ %typeName, $Host::Nerf::Prison ] $= "" && %typeName $= "VoteNerfPrison" ))
|
||||
%typePass = false;
|
||||
// End JTL
|
||||
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
|
||||
// z0dd - ZOD, 10/03/02. This was busted, BanPlayer was never delt with.
|
||||
if( %typeName $= "BanPlayer" )
|
||||
{
|
||||
if( !%client.isSuperAdmin || %arg1.isAdmin )
|
||||
{
|
||||
return; // -> bye ;)
|
||||
}
|
||||
else
|
||||
{
|
||||
ban( %arg1, %client );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
|
||||
// JTL
|
||||
if(%typeName $= "VoteVehicles" && !%isAdmin)
|
||||
if(%typeName $= "VoteVehicles" && !%isAdmin)
|
||||
if(%typeName $= "VoteSatchelCharge" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerDeconstruct" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerCascade" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerRotate" && !%isAdmin)
|
||||
if(%typeName $= "VoteOnlyOwnerCubicReplace" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteGlobalPowerCheck" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveDupDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveNonPoweredDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteRemoveOrphanedDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteInvincibleArmors" && !%isAdmin)
|
||||
if(%typeName $= "VoteInvincibleDeployables" && !%isAdmin)
|
||||
if(%typeName $= "VoteUndergroundMode" && !%isAdmin)
|
||||
if(%typeName $= "VoteHazardMode" && !%isAdmin)
|
||||
if(%typeName $= "VoteMTCMode" && !%isAdmin)
|
||||
if(%typeName $= "VotePrison" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonKilling" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonTeamKilling" && !%isAdmin)
|
||||
if(%typeName $= "VotePrisonDeploySpam" && !%isAdmin)
|
||||
if(%typeName $= "VoteNerfWeapons" && !%isAdmin)
|
||||
if(%typeName $= "VoteNerfDance" && !%isAdmin)
|
||||
if(%typeName $= "VoteNerfDeath" && !%isAdmin)
|
||||
if(%typeName $= "VoteNerfPrison" && !%isAdmin)
|
||||
%typePass = false;
|
||||
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
// End JTL
|
||||
|
||||
// keep these under the server's control. I win.
|
||||
if( !%playerVote )
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
else if( %typeName $= "VoteTeamDamage" || %typeName $= "VoteGreedMode" || %typeName $= "VoteHoardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $TeamDamage ];
|
||||
// JTL
|
||||
else if( %typeName $= "VotePurebuild" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Purebuild ];
|
||||
else if( %typeName $= "VoteCascadeMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Cascade ];
|
||||
else if( %typeName $= "VoteExpertMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::ExpertMode ];
|
||||
else if( %typeName $= "VoteVehicles" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Vehicles ];
|
||||
else if( %typeName $= "VoteSatchelCharge" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::SatchelChargeEnabled ];
|
||||
else if( %typeName $= "VoteOnlyOwnerDeconstruct" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerDeconstruct ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCascade" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCascade ];
|
||||
else if( %typeName $= "VoteOnlyOwnerRotate" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerRotate ];
|
||||
else if( %typeName $= "VoteOnlyOwnerCubicReplace" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::OnlyOwnerCubicReplace ];
|
||||
else if( %typeName $= "VoteInvincibleArmors" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleArmors ];
|
||||
else if( %typeName $= "VoteInvincibleDeployables" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::InvincibleDeployables ];
|
||||
else if( %typeName $= "VoteUndergroundMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::AllowUnderground ];
|
||||
else if( %typeName $= "VoteHazardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Hazard::Enabled ];
|
||||
else if( %typeName $= "VoteMTCMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::MTC::Enabled ];
|
||||
else if( %typeName $= "VotePrison" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Enabled ];
|
||||
else if( %typeName $= "VotePrisonKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::Kill ];
|
||||
else if( %typeName $= "VotePrisonTeamKilling" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::TeamKill ];
|
||||
else if( %typeName $= "VotePrisonDeploySpam" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Prison::DeploySpam ];
|
||||
else if( %typeName $= "VoteNerfWeapons" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Nerf::Enabled ];
|
||||
else if( %typeName $= "VoteNerfDance" )
|
||||
%actionMsg = $VoteMessage[ %typeName, ($Host::Nerf::DanceAnim && !$Host::Nerf::DeathAnim) ];
|
||||
else if( %typeName $= "VoteNerfDeath" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Nerf::DeathAnim ];
|
||||
else if( %typeName $= "VoteNerfPrison" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $Host::Nerf::Prison ];
|
||||
// End JTL
|
||||
else
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
return;
|
||||
|
||||
if ( ( !%isAdmin || ( %arg1.isAdmin && ( %client != %arg1 ) ) ) && // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
!( ( %typeName $= "VoteKickPlayer" ) && %client.isSuperAdmin ) ) // z0dd - ToS 4/2/02: Allow SuperAdmins to kick Admins
|
||||
{
|
||||
%teamSpecific = false;
|
||||
%gender = (%client.sex $= "Male" ? 'he' : 'she');
|
||||
if ( Game.scheduleVote $= "" )
|
||||
{
|
||||
%clientsVoting = 0;
|
||||
|
||||
//send a message to everyone about the vote...
|
||||
if ( %playerVote )
|
||||
{
|
||||
%teamSpecific = ( %typeName $= "VoteKickPlayer" ) && ( Game.numTeams > 1 );
|
||||
%kickerIsObs = %client.team == 0;
|
||||
%kickeeIsObs = %arg1.team == 0;
|
||||
%sameTeam = %client.team == %arg1.team;
|
||||
|
||||
if( %kickeeIsObs )
|
||||
{
|
||||
%teamSpecific = false;
|
||||
%sameTeam = false;
|
||||
}
|
||||
|
||||
if(( !%sameTeam && %teamSpecific) && %typeName !$= "VoteAdminPlayer")
|
||||
{
|
||||
messageClient(%client, '', "\c2Player votes must be team based.");
|
||||
return;
|
||||
}
|
||||
|
||||
// kicking is team specific
|
||||
if( %typeName $= "VoteKickPlayer" )
|
||||
{
|
||||
if(%arg1.isSuperAdmin)
|
||||
{
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
return;
|
||||
}
|
||||
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
|
||||
if(%teamSpecific)
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
|
||||
if (%cl.team == %client.team && !%cl.isAIControlled())
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( %typeName $= "VoteChangeMission" )
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 (%4).', %client.name, %actionMsg, %arg1, %arg2 );
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (%arg1 !$= 0)
|
||||
{
|
||||
if (%arg2 !$= 0)
|
||||
{
|
||||
if(%typeName $= "VoteTournamentMode")
|
||||
{
|
||||
%admin = getAdmin();
|
||||
if(%admin > 0)
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 Tournament Mode (%3).', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
messageClient( %client, 'clientMsg', 'There must be a server admin to play in Tournament Mode.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3 %4.', %client.name, %actionMsg, %arg1, %arg2);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2 %3.', %client.name, %actionMsg, %arg1);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// open the vote hud for all clients that will participate in this vote
|
||||
if(%teamSpecific)
|
||||
{
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
|
||||
if(%cl.team == %client.team && !%cl.isAIControlled())
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
if ( !%cl.isAIControlled() )
|
||||
messageClient(%cl, 'openVoteHud', "", %clientsVoting, ($Host::VotePassPercent / 100));
|
||||
}
|
||||
}
|
||||
|
||||
clearVotes();
|
||||
Game.voteType = %typeName;
|
||||
Game.scheduleVote = schedule( ($Host::VoteTime * 1000), 0, "calcVotes", %typeName, %arg1, %arg2, %arg3, %arg4 );
|
||||
%client.vote = true;
|
||||
messageAll('addYesVote', "");
|
||||
|
||||
if(!%client.team == 0)
|
||||
clearBottomPrint(%client);
|
||||
}
|
||||
else
|
||||
messageClient( %client, 'voteAlreadyRunning', '\c2A vote is already in progress.' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Game.scheduleVote !$= "" && Game.voteType $= %typeName )
|
||||
{
|
||||
messageAll('closeVoteHud', "");
|
||||
cancel(Game.scheduleVote);
|
||||
Game.scheduleVote = "";
|
||||
}
|
||||
|
||||
// if this is a superAdmin, don't kick or ban
|
||||
if(%arg1 != %client)
|
||||
{
|
||||
if(!%arg1.isSuperAdmin)
|
||||
{
|
||||
// Set up kick/ban values:
|
||||
if ( %typeName $= "VoteBanPlayer" || %typeName $= "VoteKickPlayer" )
|
||||
{
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickClientName = %arg1.name;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
}
|
||||
|
||||
//Tinman - PURE servers can't call "eval"
|
||||
//Mark - True, but neither SHOULD a normal server
|
||||
// - thanks Ian Hardingham
|
||||
Game.evalVote(%typeName, true, %arg1, %arg2, %arg3, %arg4);
|
||||
}
|
||||
else
|
||||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
}
|
||||
}
|
||||
|
||||
%client.canVote = false;
|
||||
%client.rescheduleVote = schedule( ($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client );
|
||||
}
|
||||
|
||||
function resetVotePrivs( %client )
|
||||
{
|
||||
//messageClient( %client, '', 'You may now start a new vote.');
|
||||
%client.canVote = true;
|
||||
%client.rescheduleVote = "";
|
||||
}
|
||||
|
||||
function serverCmdSetPlayerVote(%client, %vote)
|
||||
{
|
||||
// players can only vote once
|
||||
if( %client.vote $= "" )
|
||||
{
|
||||
%client.vote = %vote;
|
||||
if(%client.vote == 1)
|
||||
messageAll('addYesVote', "");
|
||||
else
|
||||
messageAll('addNoVote', "");
|
||||
|
||||
commandToClient(%client, 'voteSubmitted', %vote);
|
||||
}
|
||||
}
|
||||
|
||||
function calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4)
|
||||
{
|
||||
if(%typeName $= "voteMatchStart")
|
||||
if($MatchStarted || $countdownStarted)
|
||||
return;
|
||||
|
||||
for ( %clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %clientIndex );
|
||||
messageClient(%cl, 'closeVoteHud', "");
|
||||
|
||||
if ( %cl.vote !$= "" )
|
||||
{
|
||||
if ( %cl.vote )
|
||||
{
|
||||
Game.votesFor[%cl.team]++;
|
||||
Game.totalVotesFor++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.votesAgainst[%cl.team]++;
|
||||
Game.totalVotesAgainst++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.votesNone[%cl.team]++;
|
||||
Game.totalVotesNone++;
|
||||
}
|
||||
}
|
||||
//Tinman - PURE servers can't call "eval"
|
||||
//Mark - True, but neither SHOULD a normal server
|
||||
// - thanks Ian Hardingham
|
||||
Game.evalVote(%typeName, false, %arg1, %arg2, %arg3, %arg4);
|
||||
Game.scheduleVote = "";
|
||||
Game.kickClient = "";
|
||||
clearVotes();
|
||||
}
|
||||
|
||||
function clearVotes()
|
||||
{
|
||||
for(%clientIndex = 0; %clientIndex < ClientGroup.getCount(); %clientIndex++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%clientIndex);
|
||||
%client.vote = "";
|
||||
messageClient(%client, 'clearVoteHud', "");
|
||||
}
|
||||
|
||||
for(%team = 1; %team < 5; %team++)
|
||||
{
|
||||
Game.votesFor[%team] = 0;
|
||||
Game.votesAgainst[%team] = 0;
|
||||
Game.votesNone[%team] = 0;
|
||||
Game.totalVotesFor = 0;
|
||||
Game.totalVotesAgainst = 0;
|
||||
Game.totalVotesNone = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Tournament mode Stuff-----------------------------------
|
||||
|
||||
function setModeFFA( %mission, %missionType )
|
||||
{
|
||||
if( $Host::TournamentMode )
|
||||
{
|
||||
$Host::TournamentMode = false;
|
||||
|
||||
if( isObject( Game ) )
|
||||
Game.gameOver();
|
||||
|
||||
loadMission(%mission, %missionType, false);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
function setModeTournament( %mission, %missionType )
|
||||
{
|
||||
if( !$Host::TournamentMode )
|
||||
{
|
||||
$Host::TournamentMode = true;
|
||||
|
||||
if( isObject( Game ) )
|
||||
Game.gameOver();
|
||||
|
||||
loadMission(%mission, %missionType, false);
|
||||
}
|
||||
}
|
||||
1051
scripts/autoexec/TCmini-client.cs
Executable file
1051
scripts/autoexec/TCmini-client.cs
Executable file
File diff suppressed because it is too large
Load diff
28
scripts/autoexec/cleanDSO.cs
Executable file
28
scripts/autoexec/cleanDSO.cs
Executable file
|
|
@ -0,0 +1,28 @@
|
|||
// #autoload
|
||||
// #name = cleanDSO
|
||||
// #version = 1.0
|
||||
// #date = December 21st, 2001
|
||||
// #author = Paul Tousignant
|
||||
// #warrior = UberGuy (FT)
|
||||
// #email = uberguy@skyreach.cas.nwu.edu
|
||||
// #web = http://scripts.tribalwar.com/uberguy
|
||||
// #description = Remove all your *.dso files every time you exit T2.
|
||||
// #status = beta
|
||||
|
||||
package noDso {
|
||||
function quit() {
|
||||
%cnt = 0;
|
||||
%tmpObj = new ScriptObject() {};
|
||||
for(%file = findFirstFile("*.dso"); %file !$= ""; %file = findNextFile("*.dso")) {
|
||||
%tmpObj.file[%cnt++] = %file;
|
||||
}
|
||||
for (%i=0; %i<%cnt; %i++) {
|
||||
deleteFile(%tmpObj.file[%i]);
|
||||
}
|
||||
%tmpObj.delete();
|
||||
|
||||
return parent::quit();
|
||||
}
|
||||
};
|
||||
activatePackage(noDso);
|
||||
|
||||
104
scripts/chatCommands.cs
Executable file
104
scripts/chatCommands.cs
Executable file
|
|
@ -0,0 +1,104 @@
|
|||
function chatcommands(%sender, %message) {
|
||||
%cmd=getWord(%message,0);
|
||||
%cmd=stripChars(%cmd,"/");
|
||||
%cmd=stripChars(%cmd,"{");
|
||||
%cmd=stripChars(%cmd,"]");
|
||||
%count=getWordCount(%message);
|
||||
%args=getwords(%message,1);
|
||||
%cmd="cc" @ %cmd;
|
||||
if (%cmd $="ccopen") //so u can call //open instead of //opendoor
|
||||
%cmd="ccopendoor";
|
||||
%test = call(%cmd,%sender,%args);
|
||||
if (!%test)
|
||||
messageClient(%sender,'msgNoSuchCommand',"\c3No such command: \'"@strReplace(%cmd,"cc","")@"\'");
|
||||
}
|
||||
|
||||
function ccopendoor(%sender,%args) {
|
||||
%pos = %sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos = vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj = containerraycast(%pos,%targetpos,$typemasks::staticshapeobjecttype,%sender.player);
|
||||
%obj = getword(%obj,0);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%className = %dataBlock.className;
|
||||
%cash = %obj.amount;
|
||||
%owner = %obj.owner;
|
||||
%obj.issliding = 0;
|
||||
if (%obj.Collision == true) //if is a colition door
|
||||
return; //stop here
|
||||
if (%obj.canmove == false) //if it cant move
|
||||
return; //stop here
|
||||
if (%obj.isdoor != 1 && %hitobj.getdatablock().getname() !$="DeployedTdoor"){
|
||||
messageclient(%sender, 'MsgClient', '\c5No door in range.');
|
||||
return;
|
||||
}
|
||||
if (!isobject(%obj)) {
|
||||
messageclient(%sender, 'MsgClient', '\c5No door in range.');
|
||||
return;
|
||||
}
|
||||
if (%obj.powercontrol == 1) {
|
||||
messageclient(%sender, 'MsgClient', '\c5This door is controlled by a power supply.');
|
||||
return;
|
||||
}
|
||||
%pass = %args;
|
||||
if (%obj.pw $= %pass) {
|
||||
if (%obj.toggletype ==1){
|
||||
if (%obj.moving $="close" || %obj.moving $="" || %going $="opening"){
|
||||
schedule(10,0,"open",%obj);
|
||||
}
|
||||
else if (%obj.moving $="open" || %going $="closeing"){
|
||||
schedule(10,0,"close",%obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
schedule(10,0,"open",%obj);
|
||||
}
|
||||
if (%obj.pw !$= %pass)
|
||||
messageclient(%sender,'MsgClient',"\c2Password Denied.");
|
||||
|
||||
}
|
||||
|
||||
function ccsetdoorpass(%sender,%args){
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj=containerraycast(%pos,%targetpos,$typemasks::staticshapeobjecttype,%sender.player);
|
||||
%obj=getword(%obj,0);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%className = %dataBlock.className;
|
||||
if (%classname !$= "door") {
|
||||
messageclient(%sender, 'MsgClient', '\c2No door in range.');
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$="")
|
||||
messageclient(%sender, 'MsgClient', '\c2You do not own this door.');
|
||||
if (!isobject(%obj))
|
||||
messageclient(%sender, 'MsgClient', '\c2No door in range.');
|
||||
if (%obj.Collision $= true) {
|
||||
messageclient(%sender, 'MsgClient', '\c2Collision doors can not have passwords.');
|
||||
return;
|
||||
}
|
||||
if(isobject(%obj) && %obj.owner==%sender) {
|
||||
%pw=getword(%args,0);
|
||||
%obj.pw=%pw;
|
||||
messageclient(%sender, 'MsgClient', '\c2Password set, password is %1.',%pw);
|
||||
}
|
||||
}
|
||||
|
||||
function ccbf(%sender,%args) {
|
||||
buyFavorites(%sender);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function resetStruct()
|
||||
{
|
||||
%count = deployables.getCount();
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%obj = deployables.getObject(%i);
|
||||
%obj.ownerGUID = "";
|
||||
%obj.owner = 4937;
|
||||
%obj.ownerClient = 4937;
|
||||
}
|
||||
}
|
||||
|
||||
2132
scripts/client.cs
Executable file
2132
scripts/client.cs
Executable file
File diff suppressed because it is too large
Load diff
1606
scripts/controlDefaults.cs
Executable file
1606
scripts/controlDefaults.cs
Executable file
File diff suppressed because it is too large
Load diff
284
scripts/dEffects.cs
Executable file
284
scripts/dEffects.cs
Executable file
|
|
@ -0,0 +1,284 @@
|
|||
// Deploy effects
|
||||
|
||||
datablock AudioProfile(DrillLinkSound)
|
||||
{
|
||||
filename = "fx/misc/mine.deploy.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SingeLinkSound)
|
||||
{
|
||||
filename = "fx/weapons/chaingun_off.wav"; // "fx/weapons/grenade_camera_activate.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
|
||||
datablock AudioProfile(BoltLinkSound)
|
||||
{
|
||||
filename = "fx/misc/health_patch.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ClickLinkSound)
|
||||
{
|
||||
filename = "fx/misc/health_patch.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(SingeSound)
|
||||
{
|
||||
filename = "fx/weapons/ElF_hit.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(LargeLinkeSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_explode_UW.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
|
||||
datablock LinearProjectileData(FastSingeProjectile) {
|
||||
className = "LinearProjectileData";
|
||||
projectileShapeName = "turret_muzzlepoint.dts";
|
||||
emitterDelay = "-1";
|
||||
velInheritFactor = "0";
|
||||
directDamage = "0";
|
||||
hasDamageRadius = "0";
|
||||
indirectDamage = "0";
|
||||
damageRadius = "0";
|
||||
radiusDamageType = "0";
|
||||
kickBackStrength = "0";
|
||||
baseEmitter = "ELFSparksEmitter";
|
||||
hasLight = "0";
|
||||
lightRadius = "20";
|
||||
lightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
hasLightUnderwaterColor = "0";
|
||||
underWaterLightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
explodeOnWaterImpact = "0";
|
||||
depthTolerance = "5";
|
||||
bubbleEmitTime = "0.5";
|
||||
faceViewer = "0";
|
||||
scale = "1 1 1";
|
||||
dryVelocity = "5";
|
||||
wetVelocity = "5";
|
||||
fizzleTimeMS = "60000";
|
||||
lifetimeMS = "60000";
|
||||
explodeOnDeath = "0";
|
||||
reflectOnWaterImpactAngle = "0";
|
||||
deflectionOnWaterImpact = "0";
|
||||
fizzleUnderwaterMS = "-1";
|
||||
activateDelayMS = "-1";
|
||||
doDynamicClientHits = "0";
|
||||
sound = "ELFHitTargetSound";
|
||||
explosion = "BlasterExplosion";
|
||||
};
|
||||
|
||||
datablock LinearProjectileData(SlowSingeProjectile) {
|
||||
className = "LinearProjectileData";
|
||||
projectileShapeName = "turret_muzzlepoint.dts";
|
||||
emitterDelay = "-1";
|
||||
velInheritFactor = "0";
|
||||
directDamage = "0";
|
||||
hasDamageRadius = "0";
|
||||
indirectDamage = "0";
|
||||
damageRadius = "0";
|
||||
radiusDamageType = "0";
|
||||
kickBackStrength = "0";
|
||||
baseEmitter = "ElfSparksEmitter";
|
||||
hasLight = "0";
|
||||
lightRadius = "20";
|
||||
lightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
hasLightUnderwaterColor = "0";
|
||||
underWaterLightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
explodeOnWaterImpact = "0";
|
||||
depthTolerance = "5";
|
||||
bubbleEmitTime = "0.5";
|
||||
faceViewer = "0";
|
||||
scale = "1 1 1";
|
||||
dryVelocity = "1";
|
||||
wetVelocity = "1";
|
||||
fizzleTimeMS = "60000";
|
||||
lifetimeMS = "60000";
|
||||
explodeOnDeath = "0";
|
||||
reflectOnWaterImpactAngle = "0";
|
||||
deflectionOnWaterImpact = "0";
|
||||
fizzleUnderwaterMS = "-1";
|
||||
activateDelayMS = "-1";
|
||||
doDynamicClientHits = "0";
|
||||
sound = "ELFHitTargetSound";
|
||||
explosion = "BlasterExplosion";
|
||||
};
|
||||
|
||||
|
||||
function singe(%pos,%dir,%size,%type) {
|
||||
%p = new LinearProjectile() {
|
||||
dataBlock = %type @"SingeProjectile";
|
||||
initialDirection = %dir;
|
||||
initialPosition = %pos;
|
||||
};
|
||||
|
||||
if (%type $= "fast")
|
||||
%p.schedule((%size/5)*1000,"delete");
|
||||
else
|
||||
%p.schedule((%size)*1000,"delete");
|
||||
}
|
||||
|
||||
function edgesinge(%obj)
|
||||
{
|
||||
%objsize = VectorSub(getWords(%obj.getObjectBox(),3,5),getWords(%obj.getObjectBox(),0,2));
|
||||
%realsize = realSize(%obj);//VectorMultiply(VectorMultiply(%objsize,%obj.getScale()),"1 1 0");
|
||||
|
||||
%offset = VectorScale(Realvec(%obj,%realsize),0.49);
|
||||
%offset2 = VectorScale(VectorCross(VectorNormalize(%offset),realvec(%obj,"0 0 1")),VectorLen(%offset));
|
||||
%pos1 = VectorAdd(%obj.getWorldBoxCenter(),%offset);
|
||||
%pos2 = VectorAdd(%obj.getWorldBoxCenter(),VectorScale(%offset,-1));
|
||||
singe(%pos1,Realvec(%obj,"-1 0 0"),GetWord(%realsize,0),"fast");
|
||||
singe(%pos1,Realvec(%obj,"0 -1 0"),GetWord(%realsize,1),"fast");
|
||||
singe(%pos2,Realvec(%obj,"1 0 0"),GetWord(%realsize,0),"fast");
|
||||
singe(%pos2,Realvec(%obj,"0 1 0"),GetWord(%realsize,1),"fast");
|
||||
}
|
||||
|
||||
function linksinge(%obj,%pt,%nrm)
|
||||
{
|
||||
if (%nrm !$= "")
|
||||
{
|
||||
%nrm = VectorNormalize(%nrm);
|
||||
%dir = VectorNormalize(VectorCross(%nrm,Realvec(%obj,"0 0 1")));
|
||||
%objsize = VectorSub(getWords(%obj.getObjectBox(),3,5),getWords(%obj.getObjectBox(),0,2));
|
||||
%realsize = VectorScale(VectorMultiply(%objsize,%obj.getScale()),0.49);
|
||||
%side = VirVec(%obj,%nrm);
|
||||
%oside = VectorCross("0 0 1",%side);
|
||||
|
||||
%forward = Realvec(%obj,VectorMultiply(%realsize,%side));
|
||||
%left = Realvec(%obj,VectorMultiply(%realsize,%oside));
|
||||
%len = Vectorlen(%left);
|
||||
%pos1 = VectorAdd(%obj.getWorldBoxCenter(),VectorAdd(%forward,%left));
|
||||
%pos2 = VectorAdd(%obj.getWorldBoxCenter(),VectorAdd(%forward,VectorScale(%left,-1)));
|
||||
singe(%pos1,%dir,%len,"fast");
|
||||
singe(%pos2,VectorScale(%dir,-1),%len,"fast");
|
||||
}
|
||||
}
|
||||
|
||||
function floordrill(%obj)
|
||||
{
|
||||
%objsize = VectorSub(getWords(%obj.getObjectBox(),3,5),getWords(%obj.getObjectBox(),0,2));
|
||||
%realsize = VectorMultiply(VectorMultiply(%objsize,%obj.getScale()),"0.5 0.5 0.5");
|
||||
%forward = VectorScale(realvec(%obj,"1 0 0"),GetWord(%realsize,0));
|
||||
%left = VectorScale(realvec(%obj,"0 1 0"),GetWord(%realsize,1));
|
||||
%up = VectorScale(realvec(%obj,"0 0 1"),GetWord(%realsize,2));
|
||||
%p1 = VectorAdd(VectorAdd(%forward,%left),%up);
|
||||
%p2 = VectorAdd(VectorAdd(VectorScale(%forward,-1),%left),%up);
|
||||
%p3 = VectorAdd(VectorAdd(%forward,VectorScale(%left,-1)),%up);
|
||||
%p4 = VectorAdd(VectorAdd(VectorScale(%forward,-1),VectorScale(%left,-1)),%up);
|
||||
schedule(0,%obj,"llink",VectorAdd(%p1,%obj.getWorldBoxCenter()));
|
||||
schedule(500,%obj,"llink",VectorAdd(%p2,%obj.getWorldBoxCenter()));
|
||||
schedule(1000,%obj,"llink",VectorAdd(%p4,%obj.getWorldBoxCenter()));
|
||||
schedule(1500,%obj,"llink",VectorAdd(%p3,%obj.getWorldBoxCenter()));
|
||||
}
|
||||
|
||||
function MSinge(%obj)
|
||||
{
|
||||
%objsize = VectorSub(getWords(%obj.getObjectBox(),3,5),getWords(%obj.getObjectBox(),0,2));
|
||||
%realsize = VectorMultiply(VectorMultiply(%objsize,%obj.getScale()),"0.5 0.5 0.5");
|
||||
%forward = VectorScale(realvec(%obj,"1 0 0"),GetWord(%realsize,0));
|
||||
%left = VectorScale(realvec(%obj,"0 1 0"),GetWord(%realsize,1));
|
||||
%up = VectorScale(realvec(%obj,"0 0 -1"),GetWord(%realsize,2));
|
||||
%p1 = VectorAdd(VectorAdd(%forward,%left),%up);
|
||||
%p2 = VectorAdd(VectorAdd(VectorScale(%forward,-1),%left),%up);
|
||||
%p3 = VectorAdd(VectorAdd(%forward,VectorScale(%left,-1)),%up);
|
||||
%p4 = VectorAdd(VectorAdd(VectorScale(%forward,-1),VectorScale(%left,-1)),%up);
|
||||
schedule(0,%obj,"mlink",VectorAdd(%p1,%obj.getWorldBoxCenter()));
|
||||
schedule(250,%obj,"mlink",VectorAdd(%p2,%obj.getWorldBoxCenter()));
|
||||
schedule(500,%obj,"mlink",VectorAdd(%p4,%obj.getWorldBoxCenter()));
|
||||
schedule(750,%obj,"mlink",VectorAdd(%p3,%obj.getWorldBoxCenter()));
|
||||
}
|
||||
|
||||
function MSinge2(%obj)
|
||||
{
|
||||
%objsize = VectorSub(getWords(%obj.getObjectBox(),3,5),getWords(%obj.getObjectBox(),0,2));
|
||||
%realsize = VectorMultiply(VectorMultiply(%objsize,%obj.getScale()),"0.5 0.5 0.5");
|
||||
%forward = VectorScale(realvec(%obj,"1 0 0"),GetWord(%realsize,0));
|
||||
%left = VectorScale(realvec(%obj,"0 1 0"),GetWord(%realsize,1));
|
||||
%up = VectorScale(realvec(%obj,"0 0 1"),GetWord(%realsize,2));
|
||||
%p1 = VectorAdd(VectorAdd(%forward,%left),%up);
|
||||
%p2 = VectorAdd(VectorAdd(VectorScale(%forward,-1),%left),%up);
|
||||
%p3 = VectorAdd(VectorAdd(%forward,VectorScale(%left,-1)),%up);
|
||||
%p4 = VectorAdd(VectorAdd(VectorScale(%forward,-1),VectorScale(%left,-1)),%up);
|
||||
schedule(0,%obj,"mlink",VectorAdd(%p1,%obj.getWorldBoxCenter()));
|
||||
schedule(250,%obj,"mlink",VectorAdd(%p2,%obj.getWorldBoxCenter()));
|
||||
schedule(500,%obj,"mlink",VectorAdd(%p4,%obj.getWorldBoxCenter()));
|
||||
schedule(750,%obj,"mlink",VectorAdd(%p3,%obj.getWorldBoxCenter()));
|
||||
}
|
||||
|
||||
|
||||
function floorlink(%obj,%pt,%nrm) {
|
||||
%fstat = aboveground(%obj.getworldboxcenter(),1,%obj);
|
||||
%stat = GetWord(%fstat,0);
|
||||
//warn(%stat);
|
||||
if(%stat $= "open" || %stat $= "roof" || %stat $= "shadow")
|
||||
linksinge(%obj,%pt,%nrm);
|
||||
else
|
||||
floordrill(%obj);
|
||||
}
|
||||
|
||||
function slink(%pt)
|
||||
{
|
||||
createLifeEmitter(%pt, ELFSparksEmitter, 200);
|
||||
Serverplay3D(SingeLinkSound,%pt);
|
||||
}
|
||||
|
||||
function mlink(%pt)
|
||||
{
|
||||
createLifeEmitter(%pt, ELFSparksEmitter, 200);
|
||||
Serverplay3D(SingeLinkSound,%pt);
|
||||
}
|
||||
|
||||
function llink(%pt)
|
||||
{
|
||||
createLifeEmitter(%pt, SmallLightDamageSmoke, 500);
|
||||
Serverplay3D(LargeLinkeSound,%pt);
|
||||
}
|
||||
|
||||
function deployEffect(%obj,%pt,%nrm,%type)
|
||||
{
|
||||
if ($Host::NoDeployEffects)
|
||||
return "";
|
||||
if (%type $= "pad")
|
||||
{
|
||||
edgesinge(%obj);
|
||||
}
|
||||
else if (%type $= "walk")
|
||||
{
|
||||
linksinge(%obj,%pt,%nrm);
|
||||
}
|
||||
else if (%type $= "spine")
|
||||
{
|
||||
slink(%pt);
|
||||
}
|
||||
else if (%type $= "spine1")
|
||||
{
|
||||
slink(%pt);
|
||||
%p2 = VectorAdd( pos( %obj ),realvec( %obj,VectorMultiply("0 0 0.5",%obj.getScale()) ) );
|
||||
schedule(500,%obj,"slink",%p2);
|
||||
}
|
||||
else if (%type $= "mspine")
|
||||
{
|
||||
msinge(%obj);
|
||||
}
|
||||
else if (%type $= "mspine1")
|
||||
{
|
||||
msinge(%obj);
|
||||
schedule(1000,%obj,"msinge2",%obj);
|
||||
}
|
||||
else if (%type $= "floor")
|
||||
{
|
||||
floorlink(%obj,%pt,%nrm);
|
||||
}
|
||||
}
|
||||
754
scripts/damageTypes.cs
Executable file
754
scripts/damageTypes.cs
Executable file
|
|
@ -0,0 +1,754 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// TYPES OF ALLOWED DAMAGE
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
$DamageType::Default = 0;
|
||||
$DamageType::Blaster = 1;
|
||||
$DamageType::Plasma = 2;
|
||||
$DamageType::Bullet = 3;
|
||||
$DamageType::Disc = 4;
|
||||
$DamageType::Grenade = 5;
|
||||
$DamageType::Laser = 6; // NOTE: This value is referenced directly in code. DO NOT CHANGE!
|
||||
$DamageType::ELF = 7;
|
||||
$DamageType::Mortar = 8;
|
||||
$DamageType::Missile = 9;
|
||||
$DamageType::ShockLance = 10;
|
||||
$DamageType::Mine = 11;
|
||||
$DamageType::Explosion = 12;
|
||||
$DamageType::Impact = 13; // Object to object collisions
|
||||
$DamageType::Ground = 14; // Object to ground collisions
|
||||
$DamageType::Turret = 15;
|
||||
|
||||
$DamageType::PlasmaTurret = 16;
|
||||
$DamageType::AATurret = 17;
|
||||
$DamageType::ElfTurret = 18;
|
||||
$DamageType::MortarTurret = 19;
|
||||
$DamageType::MissileTurret = 20;
|
||||
$DamageType::IndoorDepTurret = 21;
|
||||
$DamageType::OutdoorDepTurret = 22;
|
||||
$DamageType::SentryTurret = 23;
|
||||
|
||||
$DamageType::OutOfBounds = 24;
|
||||
$DamageType::Lava = 25;
|
||||
|
||||
$DamageType::ShrikeBlaster = 26;
|
||||
$DamageType::BellyTurret = 27;
|
||||
$DamageType::BomberBombs = 28;
|
||||
$DamageType::TankChaingun = 29;
|
||||
$DamageType::TankMortar = 30;
|
||||
$DamageType::SatchelCharge = 31;
|
||||
$DamageType::MPBMissile = 32;
|
||||
$DamageType::Lightning = 33;
|
||||
$DamageType::VehicleSpawn = 34;
|
||||
$DamageType::ForceFieldPowerup = 35;
|
||||
$DamageType::Crash = 36;
|
||||
$DamageType::Debris = 37;
|
||||
|
||||
$DamageType::Meteor = 50;
|
||||
$DamageType::Cursing = 51;
|
||||
$DamageType::Idiocy = 52;
|
||||
$DamageType::SuperChaingun = 53;
|
||||
$DamageType::KillerFog = 54;
|
||||
|
||||
// DMM -- added so MPBs that blow up under water get a message
|
||||
$DamageType::Water = 97;
|
||||
|
||||
//Tinman - used in Hunters for cheap bastards ;)
|
||||
$DamageType::NexusCamping = 98;
|
||||
|
||||
// MES -- added so CTRL-K can get a distinctive message
|
||||
$DamageType::Suicide = 99;
|
||||
|
||||
// Etc, etc.
|
||||
|
||||
$DamageTypeText[0] = 'default';
|
||||
$DamageTypeText[1] = 'blaster';
|
||||
$DamageTypeText[2] = 'plasma';
|
||||
$DamageTypeText[3] = 'chaingun';
|
||||
$DamageTypeText[4] = 'disc';
|
||||
$DamageTypeText[5] = 'grenade';
|
||||
$DamageTypeText[6] = 'laser';
|
||||
$DamageTypeText[7] = 'ELF';
|
||||
$DamageTypeText[8] = 'mortar';
|
||||
$DamageTypeText[9] = 'missile';
|
||||
$DamageTypeText[10] = 'shocklance';
|
||||
$DamageTypeText[11] = 'mine';
|
||||
$DamageTypeText[12] = 'explosion';
|
||||
$DamageTypeText[13] = 'impact';
|
||||
$DamageTypeText[14] = 'ground';
|
||||
$DamageTypeText[15] = 'turret';
|
||||
$DamageTypeText[16] = 'plasma turret';
|
||||
$DamageTypeText[17] = 'AA turret';
|
||||
$DamageTypeText[18] = 'ELF turret';
|
||||
$DamageTypeText[19] = 'mortar turret';
|
||||
$DamageTypeText[20] = 'missile turret';
|
||||
$DamageTypeText[21] = 'clamp turret';
|
||||
$DamageTypeText[22] = 'spike turret';
|
||||
$DamageTypeText[23] = 'sentry turret';
|
||||
$DamageTypeText[24] = 'out of bounds';
|
||||
$DamageTypeText[25] = 'lava';
|
||||
$DamageTypeText[26] = 'shrike blaster';
|
||||
$DamageTypeText[27] = 'belly turret';
|
||||
$DamageTypeText[28] = 'bomber bomb';
|
||||
$DamageTypeText[29] = 'tank chaingun';
|
||||
$DamageTypeText[30] = 'tank mortar';
|
||||
$DamageTypeText[31] = 'satchel charge';
|
||||
$DamageTypeText[32] = 'MPB missile';
|
||||
$DamageTypeText[33] = 'lighting';
|
||||
$DamageTypeText[35] = 'ForceField';
|
||||
$DamageTypeText[36] = 'Crash';
|
||||
|
||||
$DamageTypeText[50] = 'Meteor';
|
||||
$DamageTypeText[51] = 'Cursing';
|
||||
$DamageTypeText[52] = 'Idiocy';
|
||||
$DamageTypeText[53] = 'SuperChaingun';
|
||||
$DamageTypeText[54] = 'KillerFog';
|
||||
|
||||
$DamageTypeText[98] = 'nexus camping';
|
||||
$DamageTypeText[99] = 'suicide';
|
||||
|
||||
|
||||
// ##### PLEASE DO NOT REORDER THE DAMAGE PROFILE TABLES BELOW #####
|
||||
// (They are set up in the same order as the "Weapons Matrix.xls" sheet for ease of reference when balancing)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// VEHICLE DAMAGE PROFILES
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//**** SHRIKE SCOUT FIGHTER ****
|
||||
datablock SimDataBlock(ShrikeDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 1.75;
|
||||
shieldDamageScale[$DamageType::Bullet] = 1.75;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ElfTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 4.0;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::AATurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.5;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.5;
|
||||
shieldDamageScale[$DamageType::SentryTurret] = 2.5;
|
||||
shieldDamageScale[$DamageType::Disc] = 1.5;
|
||||
shieldDamageScale[$DamageType::Grenade] = 1.0;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 3.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 1.1;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 3.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 10.0;
|
||||
shieldDamageScale[$DamageType::Debris] = 1.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 1.0;
|
||||
damageScale[$DamageType::Bullet] = 1.0;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ElfTurret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 3.5;
|
||||
damageScale[$DamageType::BellyTurret] = 1.2;
|
||||
damageScale[$DamageType::AATurret] = 1.5;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.5;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.5;
|
||||
damageScale[$DamageType::SentryTurret] = 1.5;
|
||||
damageScale[$DamageType::Disc] = 1.25;
|
||||
damageScale[$DamageType::Grenade] = 0.75;
|
||||
damageScale[$DamageType::Mine] = 4.0;
|
||||
damageScale[$DamageType::Missile] = 2.0;
|
||||
damageScale[$DamageType::Mortar] = 2.0;
|
||||
damageScale[$DamageType::Plasma] = 0.5;
|
||||
damageScale[$DamageType::BomberBombs] = 2.0;
|
||||
damageScale[$DamageType::TankChaingun] = 2.0;
|
||||
damageScale[$DamageType::TankMortar] = 2.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.5;
|
||||
damageScale[$DamageType::MortarTurret] = 2.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.1;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 2.0;
|
||||
damageScale[$DamageType::Lightning] = 10.0;
|
||||
damageScale[$DamageType::Debris] = 0.75;
|
||||
};
|
||||
|
||||
//**** THUNDERSWORD BOMBER ****
|
||||
datablock SimDataBlock(BomberDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 1.0;
|
||||
shieldDamageScale[$DamageType::Bullet] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 3.5;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::AATurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::SentryTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::Disc] = 1.0;
|
||||
shieldDamageScale[$DamageType::Grenade] = 1.0;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 3.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 0.8;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 3.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 10.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 0.75;
|
||||
damageScale[$DamageType::Bullet] = 0.75;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 2.5;
|
||||
damageScale[$DamageType::BellyTurret] = 1.2;
|
||||
damageScale[$DamageType::AATurret] = 1.5;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.25;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.25;
|
||||
damageScale[$DamageType::SentryTurret] = 1.25;
|
||||
damageScale[$DamageType::Disc] = 1.0;
|
||||
damageScale[$DamageType::Grenade] = 0.75;
|
||||
damageScale[$DamageType::Mine] = 4.0;
|
||||
damageScale[$DamageType::Missile] = 1.5;
|
||||
damageScale[$DamageType::Mortar] = 2.0;
|
||||
damageScale[$DamageType::Plasma] = 0.5;
|
||||
damageScale[$DamageType::BomberBombs] = 2.0;
|
||||
damageScale[$DamageType::TankChaingun] = 2.0;
|
||||
damageScale[$DamageType::TankMortar] = 2.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.5;
|
||||
damageScale[$DamageType::MortarTurret] = 2.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 0.8;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 2.0;
|
||||
damageScale[$DamageType::Lightning] = 10.0;
|
||||
};
|
||||
|
||||
//**** HAVOC TRANSPORT ****
|
||||
datablock SimDataBlock(HavocDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 1.0;
|
||||
shieldDamageScale[$DamageType::Bullet] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 3.5;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::AATurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::SentryTurret] = 2.25;
|
||||
shieldDamageScale[$DamageType::Disc] = 1.0;
|
||||
shieldDamageScale[$DamageType::Grenade] = 1.0;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 3.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 0.5;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 3.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 10.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 0.75;
|
||||
damageScale[$DamageType::Bullet] = 0.75;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 2.5;
|
||||
damageScale[$DamageType::BellyTurret] = 1.2;
|
||||
damageScale[$DamageType::AATurret] = 1.5;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.25;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.25;
|
||||
damageScale[$DamageType::SentryTurret] = 1.25;
|
||||
damageScale[$DamageType::Disc] = 1.0;
|
||||
damageScale[$DamageType::Grenade] = 0.75;
|
||||
damageScale[$DamageType::Mine] = 4.0;
|
||||
damageScale[$DamageType::Missile] = 1.5;
|
||||
damageScale[$DamageType::Mortar] = 2.0;
|
||||
damageScale[$DamageType::Plasma] = 0.5;
|
||||
damageScale[$DamageType::BomberBombs] = 2.0;
|
||||
damageScale[$DamageType::TankChaingun] = 2.0;
|
||||
damageScale[$DamageType::TankMortar] = 2.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.5;
|
||||
damageScale[$DamageType::MortarTurret] = 2.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.5;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 0.5;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 2.0;
|
||||
damageScale[$DamageType::Lightning] = 10.0;
|
||||
};
|
||||
|
||||
//**** WILDCAT GRAV CYCLE ****
|
||||
datablock SimDataBlock(WildcatDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 2.0;
|
||||
shieldDamageScale[$DamageType::Bullet] = 2.5;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 1.0;
|
||||
shieldDamageScale[$DamageType::Laser] = 4.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 6.0;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::AATurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 2.5;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 2.5;
|
||||
shieldDamageScale[$DamageType::Disc] = 2.5;
|
||||
shieldDamageScale[$DamageType::Grenade] = 2.0;
|
||||
shieldDamageScale[$DamageType::Mine] = 4.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 4.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 2.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 2.5;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 3.0;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 2.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 4.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 3.0;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 1.25;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 2.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 5.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 1.5;
|
||||
damageScale[$DamageType::Bullet] = 1.2;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 2.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 4.0;
|
||||
damageScale[$DamageType::BellyTurret] = 1.5;
|
||||
damageScale[$DamageType::AATurret] = 1.0;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.25;
|
||||
damageScale[$DamageType::Grenade] = 1.0;
|
||||
damageScale[$DamageType::Mine] = 4.0;
|
||||
damageScale[$DamageType::Missile] = 1.2;
|
||||
damageScale[$DamageType::Mortar] = 1.0;
|
||||
damageScale[$DamageType::Plasma] = 1.5;
|
||||
damageScale[$DamageType::BomberBombs] = 2.0;
|
||||
damageScale[$DamageType::TankChaingun] = 2.0;
|
||||
damageScale[$DamageType::TankMortar] = 1.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.2;
|
||||
damageScale[$DamageType::MortarTurret] = 1.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 1.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 2.2;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.25;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 5.0;
|
||||
};
|
||||
|
||||
//**** BEOWULF TANK ****
|
||||
datablock SimDataBlock(TankDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 0.6;
|
||||
shieldDamageScale[$DamageType::Bullet] = 0.75;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 1.75;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::AATurret] = 0.8;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::Disc] = 0.8;
|
||||
shieldDamageScale[$DamageType::Grenade] = 0.8;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.25;
|
||||
shieldDamageScale[$DamageType::Missile] = 2.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 1.7;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 1.8;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 2.0;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 0.75;
|
||||
shieldDamageScale[$DamageType::Ground] = 0.75;
|
||||
shieldDamageScale[$DamageType::Explosion] = 2.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 10.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 0.75;
|
||||
damageScale[$DamageType::Bullet] = 0.75;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] =1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 2.0;
|
||||
damageScale[$DamageType::BellyTurret] = 1.0;
|
||||
damageScale[$DamageType::AATurret] = 1.0;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.0;
|
||||
damageScale[$DamageType::Grenade] = 1.0;
|
||||
damageScale[$DamageType::Mine] = 2.25;
|
||||
damageScale[$DamageType::Missile] = 1.25;
|
||||
damageScale[$DamageType::Mortar] = 1.4;
|
||||
damageScale[$DamageType::Plasma] = 0.5;
|
||||
damageScale[$DamageType::BomberBombs] = 1.0;
|
||||
damageScale[$DamageType::TankChaingun] = 0.75;
|
||||
damageScale[$DamageType::TankMortar] = 1.6;
|
||||
damageScale[$DamageType::MissileTurret] = 1.25;
|
||||
damageScale[$DamageType::MortarTurret] = 1.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 1.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 2.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 0.75;
|
||||
damageScale[$DamageType::Ground] = 0.75;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 10.0;
|
||||
};
|
||||
|
||||
//**** JERICHO MPB ****
|
||||
datablock SimDataBlock(MPBDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 0.6;
|
||||
shieldDamageScale[$DamageType::Bullet] = 0.75;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 1.75;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::AATurret] = 0.8;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::Disc] = 0.8;
|
||||
shieldDamageScale[$DamageType::Grenade] = 0.8;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.25;
|
||||
shieldDamageScale[$DamageType::Missile] = 2.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 0.8;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 1.4;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 1.25;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 2.0;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 0.5;
|
||||
shieldDamageScale[$DamageType::Ground] = 0.5;
|
||||
shieldDamageScale[$DamageType::Explosion] = 2.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 10.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 0.75;
|
||||
damageScale[$DamageType::Bullet] = 0.75;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 0.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 2.0;
|
||||
damageScale[$DamageType::BellyTurret] = 1.0;
|
||||
damageScale[$DamageType::AATurret] = 1.0;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.0;
|
||||
damageScale[$DamageType::Grenade] = 1.0;
|
||||
damageScale[$DamageType::Mine] = 2.25;
|
||||
damageScale[$DamageType::Missile] = 1.25;
|
||||
damageScale[$DamageType::Mortar] = 1.0;
|
||||
damageScale[$DamageType::Plasma] = 0.5;
|
||||
damageScale[$DamageType::BomberBombs] = 1.0;
|
||||
damageScale[$DamageType::TankChaingun] = 0.75;
|
||||
damageScale[$DamageType::TankMortar] = 1.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.25;
|
||||
damageScale[$DamageType::MortarTurret] = 1.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 1.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 2.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 0.5;
|
||||
damageScale[$DamageType::Ground] = 0.5;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 10.0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// TURRET DAMAGE PROFILES
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock SimDataBlock(TurretDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 0.8;
|
||||
shieldDamageScale[$DamageType::Bullet] = 0.8;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 0.5;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 3.0;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::AATurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::SentryTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::Disc] = 1.0;
|
||||
shieldDamageScale[$DamageType::Grenade] = 1.5;
|
||||
shieldDamageScale[$DamageType::Mine] = 3.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 3.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 3.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.0;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 2.0;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 3.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 4.5;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 1.0;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 2.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 5.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 0.8;
|
||||
damageScale[$DamageType::Bullet] = 0.9;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 0.50;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 1.0;
|
||||
damageScale[$DamageType::BellyTurret] = 0.6;
|
||||
damageScale[$DamageType::AATurret] = 1.0;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::SentryTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.1;
|
||||
damageScale[$DamageType::Grenade] = 1.0;
|
||||
damageScale[$DamageType::Mine] = 1.5;
|
||||
damageScale[$DamageType::Missile] = 1.25;
|
||||
damageScale[$DamageType::Mortar] = 1.25;
|
||||
damageScale[$DamageType::Plasma] = 0.75;
|
||||
damageScale[$DamageType::BomberBombs] = 1.0;
|
||||
damageScale[$DamageType::TankChaingun] = 1.25;
|
||||
damageScale[$DamageType::TankMortar] = 1.25;
|
||||
damageScale[$DamageType::MissileTurret] = 1.25;
|
||||
damageScale[$DamageType::MortarTurret] = 1.25;
|
||||
damageScale[$DamageType::PlasmaTurret] = 1.25;
|
||||
damageScale[$DamageType::SatchelCharge] = 1.5;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.0;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 5.0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// STATIC SHAPE DAMAGE PROFILES
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock SimDataBlock(StaticShapeDamageProfile)
|
||||
{
|
||||
shieldDamageScale[$DamageType::Blaster] = 0.8;
|
||||
shieldDamageScale[$DamageType::Bullet] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELF] = 1.0;
|
||||
shieldDamageScale[$DamageType::ELFturret] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShockLance] = 1.0;
|
||||
shieldDamageScale[$DamageType::Laser] = 1.0;
|
||||
shieldDamageScale[$DamageType::ShrikeBlaster] = 2.0;
|
||||
shieldDamageScale[$DamageType::BellyTurret] = 1.5;
|
||||
shieldDamageScale[$DamageType::AATurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::Turret] = 1.0;
|
||||
shieldDamageScale[$DamageType::SentryTurret] = 1.0;
|
||||
shieldDamageScale[$DamageType::Disc] = 1.0;
|
||||
shieldDamageScale[$DamageType::Grenade] = 1.2;
|
||||
shieldDamageScale[$DamageType::Mine] = 2.0;
|
||||
shieldDamageScale[$DamageType::Missile] = 3.0;
|
||||
shieldDamageScale[$DamageType::Mortar] = 3.0;
|
||||
shieldDamageScale[$DamageType::Plasma] = 1.5;
|
||||
shieldDamageScale[$DamageType::BomberBombs] = 2.0;
|
||||
shieldDamageScale[$DamageType::TankChaingun] = 1.5;
|
||||
shieldDamageScale[$DamageType::TankMortar] = 3.0;
|
||||
shieldDamageScale[$DamageType::MissileTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::MortarTurret] = 3.0;
|
||||
shieldDamageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
shieldDamageScale[$DamageType::SatchelCharge] = 6.0;
|
||||
shieldDamageScale[$DamageType::Default] = 1.0;
|
||||
shieldDamageScale[$DamageType::Impact] = 1.25;
|
||||
shieldDamageScale[$DamageType::Ground] = 1.0;
|
||||
shieldDamageScale[$DamageType::Explosion] = 2.0;
|
||||
shieldDamageScale[$DamageType::Lightning] = 5.0;
|
||||
|
||||
damageScale[$DamageType::Blaster] = 1.0;
|
||||
damageScale[$DamageType::Bullet] = 1.0;
|
||||
damageScale[$DamageType::ELF] = 0.0;
|
||||
damageScale[$DamageType::ELFturret] = 1.0;
|
||||
damageScale[$DamageType::ShockLance] = 1.0;
|
||||
damageScale[$DamageType::Laser] = 1.0;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 2.0;
|
||||
damageScale[$DamageType::BellyTurret] = 1.2;
|
||||
damageScale[$DamageType::AATurret] = 1.0;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::SentryTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.15;
|
||||
damageScale[$DamageType::Grenade] = 1.2;
|
||||
damageScale[$DamageType::Mine] = 2.0;
|
||||
damageScale[$DamageType::Missile] = 2.0;
|
||||
damageScale[$DamageType::Mortar] = 2.0;
|
||||
damageScale[$DamageType::Plasma] = 1.25;
|
||||
damageScale[$DamageType::BomberBombs] = 1.0;
|
||||
damageScale[$DamageType::TankChaingun] = 1.0;
|
||||
damageScale[$DamageType::TankMortar] = 2.0;
|
||||
damageScale[$DamageType::MissileTurret] = 2.0;
|
||||
damageScale[$DamageType::MortarTurret] = 2.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 2.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 4.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.25;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 5.0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// PLAYER DAMAGE PROFILES
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock SimDataBlock(LightPlayerDamageProfile)
|
||||
{
|
||||
damageScale[$DamageType::Blaster] = 1.3;
|
||||
damageScale[$DamageType::Bullet] = 1.2;
|
||||
damageScale[$DamageType::ELF] = 0.75;
|
||||
damageScale[$DamageType::ELFturret] = 0.75;
|
||||
damageScale[$DamageType::ShockLance] = 1.0;
|
||||
damageScale[$DamageType::Laser] = 1.12;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 1.10;
|
||||
damageScale[$DamageType::BellyTurret] = 1.0;
|
||||
damageScale[$DamageType::AATurret] = 0.7;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.3;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.3;
|
||||
damageScale[$DamageType::SentryTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 1.0;
|
||||
damageScale[$DamageType::Grenade] = 1.2;
|
||||
damageScale[$DamageType::Mine] = 1.0;
|
||||
damageScale[$DamageType::Missile] = 1.0;
|
||||
damageScale[$DamageType::Mortar] = 1.3;
|
||||
damageScale[$DamageType::Plasma] = 1.0;
|
||||
damageScale[$DamageType::BomberBombs] = 3.0;
|
||||
damageScale[$DamageType::TankChaingun] = 1.7;
|
||||
damageScale[$DamageType::TankMortar] = 1.0;
|
||||
damageScale[$DamageType::MissileTurret] = 1.0;
|
||||
damageScale[$DamageType::MortarTurret] = 1.3;
|
||||
damageScale[$DamageType::PlasmaTurret] = 1.0;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.2;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 1.0;
|
||||
damageScale[$DamageType::Lightning] = 1.0;
|
||||
};
|
||||
|
||||
datablock SimDataBlock(MediumPlayerDamageProfile)
|
||||
{
|
||||
damageScale[$DamageType::Blaster] = 1.0;
|
||||
damageScale[$DamageType::Bullet] = 1.0;
|
||||
damageScale[$DamageType::ELF] = 0.75;
|
||||
damageScale[$DamageType::ELFturret] = 0.75;
|
||||
damageScale[$DamageType::ShockLance] = 1.0;
|
||||
damageScale[$DamageType::Laser] = 1.1;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 1.0;
|
||||
damageScale[$DamageType::BellyTurret] = 1.0;
|
||||
damageScale[$DamageType::AATurret] = 0.7;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 1.0;
|
||||
damageScale[$DamageType::SentryTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 0.8;
|
||||
damageScale[$DamageType::Grenade] = 1.0;
|
||||
damageScale[$DamageType::Mine] = 0.9;
|
||||
damageScale[$DamageType::Missile] = 0.8;
|
||||
damageScale[$DamageType::Mortar] = 1.0;
|
||||
damageScale[$DamageType::Plasma] = 0.65;
|
||||
damageScale[$DamageType::BomberBombs] = 3.0;
|
||||
damageScale[$DamageType::TankChaingun] = 1.5;
|
||||
damageScale[$DamageType::TankMortar] = 0.85;
|
||||
damageScale[$DamageType::MissileTurret] = 0.8;
|
||||
damageScale[$DamageType::MortarTurret] = 1.0;
|
||||
damageScale[$DamageType::PlasmaTurret] = 0.65;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 1.0;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 0.8;
|
||||
damageScale[$DamageType::Lightning] = 1.2;
|
||||
};
|
||||
|
||||
datablock SimDataBlock(HeavyPlayerDamageProfile)
|
||||
{
|
||||
damageScale[$DamageType::Blaster] = 0.7;
|
||||
damageScale[$DamageType::Bullet] = 0.6;
|
||||
damageScale[$DamageType::ELF] = 0.75;
|
||||
damageScale[$DamageType::ELFturret] = 0.75;
|
||||
damageScale[$DamageType::ShockLance] = 1.0;
|
||||
damageScale[$DamageType::Laser] = 0.67;
|
||||
damageScale[$DamageType::ShrikeBlaster] = 0.8;
|
||||
damageScale[$DamageType::BellyTurret] = 0.8;
|
||||
damageScale[$DamageType::AATurret] = 0.6;
|
||||
damageScale[$DamageType::IndoorDepTurret] = 0.7;
|
||||
damageScale[$DamageType::OutdoorDepTurret] = 0.7;
|
||||
damageScale[$DamageType::SentryTurret] = 1.0;
|
||||
damageScale[$DamageType::Disc] = 0.6;
|
||||
damageScale[$DamageType::Grenade] = 0.8;
|
||||
damageScale[$DamageType::Mine] = 0.8;
|
||||
damageScale[$DamageType::Missile] = 0.6;
|
||||
damageScale[$DamageType::Mortar] = 0.7;
|
||||
damageScale[$DamageType::Plasma] = 0.4;
|
||||
damageScale[$DamageType::BomberBombs] = 3.0;
|
||||
damageScale[$DamageType::TankChaingun] = 1.3;
|
||||
damageScale[$DamageType::TankMortar] = 0.7;
|
||||
damageScale[$DamageType::MissileTurret] = 0.6;
|
||||
damageScale[$DamageType::MortarTurret] = 0.6;
|
||||
damageScale[$DamageType::PlasmaTurret] = 0.4;
|
||||
damageScale[$DamageType::SatchelCharge] = 3.0;
|
||||
damageScale[$DamageType::Default] = 1.0;
|
||||
damageScale[$DamageType::Impact] = 0.8;
|
||||
damageScale[$DamageType::Ground] = 1.0;
|
||||
damageScale[$DamageType::Explosion] = 0.6;
|
||||
damageScale[$DamageType::Lightning] = 1.4;
|
||||
};
|
||||
420
scripts/deathMessages.cs
Executable file
420
scripts/deathMessages.cs
Executable file
|
|
@ -0,0 +1,420 @@
|
|||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// %1 = Victim's name //
|
||||
// %2 = Victim's gender (value will be either "him" or "her") //
|
||||
// %3 = Victim's possessive gender (value will be either "his" or "her") //
|
||||
// %4 = Killer's name //
|
||||
// %5 = Killer's gender (value will be either "him" or "her") //
|
||||
// %6 = Killer's possessive gender (value will be either "his" or "her") //
|
||||
// %7 = implement that killed the victim (value is the object number of the bullet, disc, etc) //
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$DeathMessageCampingCount = 1;
|
||||
$DeathMessageCamping[0] = '\c0%1 was killed for camping near the Nexus.';
|
||||
|
||||
//Out of Bounds deaths
|
||||
$DeathMessageOOBCount = 1;
|
||||
$DeathMessageOOB[0] = '\c0%1 was killed for loitering outside the mission area.';
|
||||
|
||||
$DeathMessageLavaCount = 4;
|
||||
$DeathMessageLava[0] = '\c0%1\'s last thought before falling into the lava : \'Oops\'.';
|
||||
$DeathMessageLava[1] = '\c0%1 makes the supreme sacrifice to the lava gods.';
|
||||
$DeathMessageLava[2] = '\c0%1 looks surprised by the lava - but only briefly.';
|
||||
$DeathMessageLava[3] = '\c0%1 wimps out by jumping into the lava and trying to make it look like an accident.';
|
||||
|
||||
$DeathMessageLightningCount = 3;
|
||||
$DeathMessageLightning[0] = '\c0%1 was killed by lightning!';
|
||||
$DeathMessageLightning[1] = '\c0%1 caught a lightning bolt!';
|
||||
$DeathMessageLightning[2] = '\c0%1 stuck %3 finger in Mother Nature\'s light socket.';
|
||||
|
||||
//these used when a player presses ctrl-k
|
||||
$DeathMessageSuicideCount = 5;
|
||||
$DeathMessageSuicide[0] = '\c0%1 blows %3 own head off!';
|
||||
$DeathMessageSuicide[1] = '\c0%1 ends it all. Cue violin music.';
|
||||
$DeathMessageSuicide[2] = '\c0%1 kills %2self.';
|
||||
$DeathMessageSuicide[3] = '\c0%1 goes for the quick and dirty respawn.';
|
||||
$DeathMessageSuicide[4] = '\c0%1 self-destructs in a fit of ennui.';
|
||||
|
||||
$DeathMessageVehPadCount = 1;
|
||||
$DeathMessageVehPad[0] = '\c0%1 got caught in a vehicle\'s spawn field.';
|
||||
|
||||
$DeathMessageFFPowerupCount = 3;
|
||||
$DeathMessageFFPowerup[0] = '\c0%1 got caught up in a forcefield during power up.';
|
||||
$DeathMessageFFPowerup[1] = '\c0%1 finds %2self in a forcefield powering up.';
|
||||
$DeathMessageFFPowerup[2] = '\c0%1 gets %2self fried in a forcefield.';
|
||||
|
||||
$DeathMessageRogueMineCount = 1;
|
||||
$DeathMessageRogueMine[$DamageType::Mine, 0] = '\c0%1 is all mine.';
|
||||
|
||||
//these used when a player kills himself (other than by using ctrl - k)
|
||||
$DeathMessageSelfKillCount = 5;
|
||||
$DeathMessageSelfKill[$DamageType::Blaster, 0] = '\c0%1 kills %2self with a blaster.';
|
||||
$DeathMessageSelfKill[$DamageType::Blaster, 1] = '\c0%1 makes a note to watch out for blaster ricochets.';
|
||||
$DeathMessageSelfKill[$DamageType::Blaster, 2] = '\c0%1\'s blaster kills its hapless owner.';
|
||||
$DeathMessageSelfKill[$DamageType::Blaster, 3] = '\c0%1 deftly guns %2self down with %3 own blaster.';
|
||||
$DeathMessageSelfKill[$DamageType::Blaster, 4] = '\c0%1 has a fatal encounter with %3 own blaster.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Plasma, 0] = '\c0%1 kills %2self with plasma.';
|
||||
$DeathMessageSelfKill[$DamageType::Plasma, 1] = '\c0%1 turns %2self into plasma-charred briquettes.';
|
||||
$DeathMessageSelfKill[$DamageType::Plasma, 2] = '\c0%1 swallows a white-hot mouthful of %3 own plasma.';
|
||||
$DeathMessageSelfKill[$DamageType::Plasma, 3] = '\c0%1 immolates %2self.';
|
||||
$DeathMessageSelfKill[$DamageType::Plasma, 4] = '\c0%1 experiences the joy of cooking %2self.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Disc, 0] = '\c0%1 kills %2self with a disc.';
|
||||
$DeathMessageSelfKill[$DamageType::Disc, 1] = '\c0%1 catches %3 own spinfusor disc.';
|
||||
$DeathMessageSelfKill[$DamageType::Disc, 2] = '\c0%1 heroically falls on %3 own disc.';
|
||||
$DeathMessageSelfKill[$DamageType::Disc, 3] = '\c0%1 helpfully jumps into %3 own disc\'s explosion.';
|
||||
$DeathMessageSelfKill[$DamageType::Disc, 4] = '\c0%1 plays Russian roulette with %3 spinfusor.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Grenade, 0] = '\c0%1 destroys %2self with a grenade!'; //applies to hand grenades *and* grenade launcher grenades
|
||||
$DeathMessageSelfKill[$DamageType::Grenade, 1] = '\c0%1 took a bad bounce from %3 own grenade!';
|
||||
$DeathMessageSelfKill[$DamageType::Grenade, 2] = '\c0%1 pulled the pin a shade early.';
|
||||
$DeathMessageSelfKill[$DamageType::Grenade, 3] = '\c0%1\'s own grenade turns on %2.';
|
||||
$DeathMessageSelfKill[$DamageType::Grenade, 4] = '\c0%1 blows %2self up real good.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Mortar, 0] = '\c0%1 kills %2self with a mortar!';
|
||||
$DeathMessageSelfKill[$DamageType::Mortar, 1] = '\c0%1 hugs %3 own big green boomie.';
|
||||
$DeathMessageSelfKill[$DamageType::Mortar, 2] = '\c0%1 mortars %2self all over the map.';
|
||||
$DeathMessageSelfKill[$DamageType::Mortar, 3] = '\c0%1 experiences %3 mortar\'s payload up close.';
|
||||
$DeathMessageSelfKill[$DamageType::Mortar, 4] = '\c0%1 suffered the wrath of %3 own mortar.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Missile, 0] = '\c0%1 kills %2self with a missile!';
|
||||
$DeathMessageSelfKill[$DamageType::Missile, 1] = '\c0%1 runs a missile up %3 own tailpipe.';
|
||||
$DeathMessageSelfKill[$DamageType::Missile, 2] = '\c0%1 tests the missile\'s shaped charge on %2self.';
|
||||
$DeathMessageSelfKill[$DamageType::Missile, 3] = '\c0%1 achieved missile lock on %2self.';
|
||||
$DeathMessageSelfKill[$DamageType::Missile, 4] = '\c0%1 gracefully smoked %2self with a missile!';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Mine, 0] = '\c0%1 kills %2self with a mine!';
|
||||
$DeathMessageSelfKill[$DamageType::Mine, 1] = '\c0%1\'s mine violently reminds %2 of its existence.';
|
||||
$DeathMessageSelfKill[$DamageType::Mine, 2] = '\c0%1 plants a decisive foot on %3 own mine!';
|
||||
$DeathMessageSelfKill[$DamageType::Mine, 3] = '\c0%1 fatally trips on %3 own mine!';
|
||||
$DeathMessageSelfKill[$DamageType::Mine, 4] = '\c0%1 makes a note not to run over %3 own mines.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::SatchelCharge, 0] = '\c0%1 goes out with a bang!'; //applies to most explosion types
|
||||
$DeathMessageSelfKill[$DamageType::SatchelCharge, 1] = '\c0%1 fall down...go boom.';
|
||||
$DeathMessageSelfKill[$DamageType::SatchelCharge, 2] = '\c0%1 explodes in that fatal kind of way.';
|
||||
$DeathMessageSelfKill[$DamageType::SatchelCharge, 3] = '\c0%1 experiences explosive decompression!';
|
||||
$DeathMessageSelfKill[$DamageType::SatchelCharge, 4] = '\c0%1 splashes all over the map.';
|
||||
|
||||
$DeathMessageSelfKill[$DamageType::Ground, 0] = '\c0%1 lands too hard.';
|
||||
$DeathMessageSelfKill[$DamageType::Ground, 1] = '\c0%1 finds gravity unforgiving.';
|
||||
$DeathMessageSelfKill[$DamageType::Ground, 2] = '\c0%1 craters on impact.';
|
||||
$DeathMessageSelfKill[$DamageType::Ground, 3] = '\c0%1 pancakes upon landing.';
|
||||
$DeathMessageSelfKill[$DamageType::Ground, 4] = '\c0%1 loses a game of chicken with the ground.';
|
||||
|
||||
|
||||
//used when a player is killed by a teammate
|
||||
$DeathMessageTeamKillCount = 1;
|
||||
$DeathMessageTeamKill[$DamageType::Blaster, 0] = '\c0%4 TEAMKILLED %1 with a blaster!';
|
||||
$DeathMessageTeamKill[$DamageType::Plasma, 0] = '\c0%4 TEAMKILLED %1 with a plasma rifle!';
|
||||
$DeathMessageTeamKill[$DamageType::Bullet, 0] = '\c0%4 TEAMKILLED %1 with a chaingun!';
|
||||
$DeathMessageTeamKill[$DamageType::Disc, 0] = '\c0%4 TEAMKILLED %1 with a spinfusor!';
|
||||
$DeathMessageTeamKill[$DamageType::Grenade, 0] = '\c0%4 TEAMKILLED %1 with a grenade!';
|
||||
$DeathMessageTeamKill[$DamageType::Laser, 0] = '\c0%4 TEAMKILLED %1 with a laser rifle!';
|
||||
$DeathMessageTeamKill[$DamageType::Elf, 0] = '\c0%4 TEAMKILLED %1 with an ELF projector!';
|
||||
$DeathMessageTeamKill[$DamageType::Mortar, 0] = '\c0%4 TEAMKILLED %1 with a mortar!';
|
||||
$DeathMessageTeamKill[$DamageType::Missile, 0] = '\c0%4 TEAMKILLED %1 with a missile!';
|
||||
$DeathMessageTeamKill[$DamageType::Shocklance, 0] = '\c0%4 TEAMKILLED %1 with a shocklance!';
|
||||
$DeathMessageTeamKill[$DamageType::Mine, 0] = '\c0%4 TEAMKILLED %1 with a mine!';
|
||||
$DeathMessageTeamKill[$DamageType::SatchelCharge, 0] = '\c0%4 blew up TEAMMATE %1!';
|
||||
$DeathMessageTeamKill[$DamageType::Impact, 0] = '\c0%4 runs down TEAMMATE %1!';
|
||||
$DeathMessageTeamKill[$DamageType::SuperChaingun, 0] = '\c0%4 TEAMKILLED %1 with a super chaingun!';
|
||||
|
||||
|
||||
|
||||
//these used when a player is killed by an enemy
|
||||
$DeathMessageCount = 5;
|
||||
$DeathMessage[$DamageType::Blaster, 0] = '\c0%4 kills %1 with a blaster.';
|
||||
$DeathMessage[$DamageType::Blaster, 1] = '\c0%4 pings %1 to death.';
|
||||
$DeathMessage[$DamageType::Blaster, 2] = '\c0%1 gets a pointer in blaster use from %4.';
|
||||
$DeathMessage[$DamageType::Blaster, 3] = '\c0%4 fatally embarrasses %1 with %6 pea shooter.';
|
||||
$DeathMessage[$DamageType::Blaster, 4] = '\c0%4 unleashes a terminal blaster barrage into %1.';
|
||||
|
||||
$DeathMessage[$DamageType::Plasma, 0] = '\c0%4 roasts %1 with the plasma rifle.';
|
||||
$DeathMessage[$DamageType::Plasma, 1] = '\c0%4 gooses %1 with an extra-friendly burst of plasma.';
|
||||
$DeathMessage[$DamageType::Plasma, 2] = '\c0%4 entices %1 to try a faceful of plasma.';
|
||||
$DeathMessage[$DamageType::Plasma, 3] = '\c0%4 introduces %1 to the plasma immolation dance.';
|
||||
$DeathMessage[$DamageType::Plasma, 4] = '\c0%4 slaps The Hot Kiss of Death on %1.';
|
||||
|
||||
$DeathMessage[$DamageType::Bullet, 0] = '\c0%4 rips %1 up with the chaingun.';
|
||||
$DeathMessage[$DamageType::Bullet, 1] = '\c0%4 happily chews %1 into pieces with %6 chaingun.';
|
||||
$DeathMessage[$DamageType::Bullet, 2] = '\c0%4 administers a dose of Vitamin Lead to %1.';
|
||||
$DeathMessage[$DamageType::Bullet, 3] = '\c0%1 suffers a serious hosing from %4\'s chaingun.';
|
||||
$DeathMessage[$DamageType::Bullet, 4] = '\c0%4 bestows the blessings of %6 chaingun on %1.';
|
||||
|
||||
$DeathMessage[$DamageType::Disc, 0] = '\c0%4 demolishes %1 with the spinfusor.';
|
||||
$DeathMessage[$DamageType::Disc, 1] = '\c0%4 serves %1 a blue plate special.';
|
||||
$DeathMessage[$DamageType::Disc, 2] = '\c0%4 shares a little blue friend with %1.';
|
||||
$DeathMessage[$DamageType::Disc, 3] = '\c0%4 puts a little spin into %1.';
|
||||
$DeathMessage[$DamageType::Disc, 4] = '\c0%1 becomes one of %4\'s greatest hits.';
|
||||
|
||||
$DeathMessage[$DamageType::Grenade, 0] = '\c0%4 eliminates %1 with a grenade.'; //applies to hand grenades *and* grenade launcher grenades
|
||||
$DeathMessage[$DamageType::Grenade, 1] = '\c0%4 blows up %1 real good!';
|
||||
$DeathMessage[$DamageType::Grenade, 2] = '\c0%1 gets annihilated by %4\'s grenade.';
|
||||
$DeathMessage[$DamageType::Grenade, 3] = '\c0%1 receives a kaboom lesson from %4.';
|
||||
$DeathMessage[$DamageType::Grenade, 4] = '\c0%4 turns %1 into grenade salad.';
|
||||
|
||||
$DeathMessage[$DamageType::Laser, 0] = '\c0%1 becomes %4\'s latest pincushion.';
|
||||
$DeathMessage[$DamageType::Laser, 1] = '\c0%4 picks off %1 with %6 laser rifle.';
|
||||
$DeathMessage[$DamageType::Laser, 2] = '\c0%4 uses %1 as the targeting dummy in a sniping demonstration.';
|
||||
$DeathMessage[$DamageType::Laser, 3] = '\c0%4 pokes a shiny new hole in %1 with %6 laser rifle.';
|
||||
$DeathMessage[$DamageType::Laser, 4] = '\c0%4 caresses %1 with a couple hundred megajoules of laser.';
|
||||
|
||||
$DeathMessage[$DamageType::Elf, 0] = '\c0%4 fries %1 with the ELF projector.';
|
||||
$DeathMessage[$DamageType::Elf, 1] = '\c0%4 bug zaps %1 with %6 ELF.';
|
||||
$DeathMessage[$DamageType::Elf, 2] = '\c0%1 learns the shocking truth about %4\'s ELF skills.';
|
||||
$DeathMessage[$DamageType::Elf, 3] = '\c0%4 electrocutes %1 without a sponge.';
|
||||
$DeathMessage[$DamageType::Elf, 4] = '\c0%4\'s ELF projector leaves %1 a crispy critter.';
|
||||
|
||||
$DeathMessage[$DamageType::Mortar, 0] = '\c0%4 obliterates %1 with the mortar.';
|
||||
$DeathMessage[$DamageType::Mortar, 1] = '\c0%4 drops a mortar round right in %1\'s lap.';
|
||||
$DeathMessage[$DamageType::Mortar, 2] = '\c0%4 delivers a mortar payload straight to %1.';
|
||||
$DeathMessage[$DamageType::Mortar, 3] = '\c0%4 offers a little "heavy love" to %1.';
|
||||
$DeathMessage[$DamageType::Mortar, 4] = '\c0%1 stumbles into %4\'s mortar reticle.';
|
||||
|
||||
$DeathMessage[$DamageType::Missile, 0] = '\c0%4 intercepts %1 with a missile.';
|
||||
$DeathMessage[$DamageType::Missile, 1] = '\c0%4 watches %6 missile touch %1 and go boom.';
|
||||
$DeathMessage[$DamageType::Missile, 2] = '\c0%4 got sweet tone on %1.';
|
||||
$DeathMessage[$DamageType::Missile, 3] = '\c0By now, %1 has realized %4\'s missile killed %2.';
|
||||
$DeathMessage[$DamageType::Missile, 4] = '\c0%4\'s missile rains little pieces of %1 all over the ground.';
|
||||
|
||||
$DeathMessage[$DamageType::Shocklance, 0] = '\c0%4 reaps a harvest of %1 with the shocklance.';
|
||||
$DeathMessage[$DamageType::Shocklance, 1] = '\c0%4 feeds %1 the business end of %6 shocklance.';
|
||||
$DeathMessage[$DamageType::Shocklance, 2] = '\c0%4 stops %1 dead with the shocklance.';
|
||||
$DeathMessage[$DamageType::Shocklance, 3] = '\c0%4 eliminates %1 in close combat.';
|
||||
$DeathMessage[$DamageType::Shocklance, 4] = '\c0%4 ruins %1\'s day with one zap of a shocklance.';
|
||||
|
||||
$DeathMessage[$DamageType::Mine, 0] = '\c0%4 kills %1 with a mine.';
|
||||
$DeathMessage[$DamageType::Mine, 1] = '\c0%1 doesn\'t see %4\'s mine in time.';
|
||||
$DeathMessage[$DamageType::Mine, 2] = '\c0%4 gets a sapper kill on %1.';
|
||||
$DeathMessage[$DamageType::Mine, 3] = '\c0%1 puts his foot on %4\'s mine.';
|
||||
$DeathMessage[$DamageType::Mine, 4] = '\c0One small step for %1, one giant mine kill for %4.';
|
||||
|
||||
$DeathMessage[$DamageType::SatchelCharge, 0] = '\c0%4 buys %1 a ticket to the moon.'; //satchel charge only
|
||||
$DeathMessage[$DamageType::SatchelCharge, 1] = '\c0%4 blows %1 into low orbit.';
|
||||
$DeathMessage[$DamageType::SatchelCharge, 2] = '\c0%4 makes %1 a hugely explosive offer.';
|
||||
$DeathMessage[$DamageType::SatchelCharge, 3] = '\c0%4 turns %1 into a cloud of satchel-vaporized armor.';
|
||||
$DeathMessage[$DamageType::SatchelCharge, 4] = '\c0%4\'s satchel charge leaves %1 nothin\' but smokin\' boots.';
|
||||
|
||||
$DeathMessageHeadshotCount = 3;
|
||||
$DeathMessageHeadshot[$DamageType::Laser, 0] = '\c0%4 drills right through %1\'s braincase with %6 laser.';
|
||||
$DeathMessageHeadshot[$DamageType::Laser, 1] = '\c0%4 pops %1\'s head like a cheap balloon.';
|
||||
$DeathMessageHeadshot[$DamageType::Laser, 2] = '\c0%1 loses %3 head over %4\'s laser skill.';
|
||||
|
||||
|
||||
//These used when a player is run over by a vehicle
|
||||
$DeathMessageVehicleCount = 5;
|
||||
$DeathMessageVehicle[0] = '\c0%4 runs down %1.';
|
||||
$DeathMessageVehicle[1] = '\c0%1 acquires that run-down feeling from %4.';
|
||||
$DeathMessageVehicle[2] = '\c0%4 transforms %1 into tribal roadkill.';
|
||||
$DeathMessageVehicle[3] = '\c0%1 makes a painfully close examination of %4\'s front bumper.';
|
||||
$DeathMessageVehicle[4] = '\c0%1\'s messy death leaves a mark on %4\'s vehicle finish.';
|
||||
|
||||
$DeathMessageVehicleCrashCount = 5;
|
||||
$DeathMessageVehicleCrash[ $DamageType::Crash, 0 ] = '\c0%1 fails to eject in time.';
|
||||
$DeathMessageVehicleCrash[ $DamageType::Crash, 1 ] = '\c0%1 becomes one with his vehicle dashboard.';
|
||||
$DeathMessageVehicleCrash[ $DamageType::Crash, 2 ] = '\c0%1 drives under the influence of death.';
|
||||
$DeathMessageVehicleCrash[ $DamageType::Crash, 3 ] = '\c0%1 makes a perfect three hundred point landing.';
|
||||
$DeathMessageVehicleCrash[ $DamageType::Crash, 4 ] = '\c0%1 heroically pilots his vehicle into something really, really hard.';
|
||||
|
||||
$DeathMessageVehicleFriendlyCount = 3;
|
||||
$DeathMessageVehicleFriendly[0] = '\c0%1 gets in the way of a friendly vehicle.';
|
||||
$DeathMessageVehicleFriendly[1] = '\c0Sadly, a friendly vehicle turns %1 into roadkill.';
|
||||
$DeathMessageVehicleFriendly[2] = '\c0%1 becomes an unsightly ornament on a team vehicle\'s hood.';
|
||||
|
||||
$DeathMessageVehicleUnmannedCount = 3;
|
||||
$DeathMessageVehicleUnmanned[0] = '\c0%1 gets in the way of a runaway vehicle.';
|
||||
$DeathMessageVehicleUnmanned[1] = '\c0An unmanned vehicle kills the pathetic %1.';
|
||||
$DeathMessageVehicleUnmanned[2] = '\c0%1 is struck down by an empty vehicle.';
|
||||
|
||||
//These used when a player is killed by a nearby equipment explosion
|
||||
$DeathMessageExplosionCount = 3;
|
||||
$DeathMessageExplosion[0] = '\c0%1 was killed by exploding equipment!';
|
||||
$DeathMessageExplosion[1] = '\c0%1 stood a little too close to the action!';
|
||||
$DeathMessageExplosion[2] = '\c0%1 learns how to be collateral damage.';
|
||||
|
||||
//These used when an automated turret kills an enemy player
|
||||
$DeathMessageTurretKillCount = 3;
|
||||
$DeathMessageTurretKill[$DamageType::PlasmaTurret, 0] = '\c0%1 is killed by a plasma turret.';
|
||||
$DeathMessageTurretKill[$DamageType::PlasmaTurret, 1] = '\c0%1\'s body now marks the location of a plasma turret.';
|
||||
$DeathMessageTurretKill[$DamageType::PlasmaTurret, 2] = '\c0%1 is fried by a plasma turret.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::AATurret, 0] = '\c0%1 is killed by an AA turret.';
|
||||
$DeathMessageTurretKill[$DamageType::AATurret, 1] = '\c0%1 is shot down by an AA turret.';
|
||||
$DeathMessageTurretKill[$DamageType::AATurret, 2] = '\c0%1 takes fatal flak from an AA turret.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::ElfTurret, 0] = '\c0%1 is killed by an ELF turret.';
|
||||
$DeathMessageTurretKill[$DamageType::ElfTurret, 1] = '\c0%1 is zapped by an ELF turret.';
|
||||
$DeathMessageTurretKill[$DamageType::ElfTurret, 2] = '\c0%1 is short-circuited by an ELF turret.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::MortarTurret, 0] = '\c0%1 is killed by a mortar turret.';
|
||||
$DeathMessageTurretKill[$DamageType::MortarTurret, 1] = '\c0%1 enjoys a mortar turret\'s attention.';
|
||||
$DeathMessageTurretKill[$DamageType::MortarTurret, 2] = '\c0%1 is blown to kibble by a mortar turret.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::MissileTurret, 0] = '\c0%1 is killed by a missile turret.';
|
||||
$DeathMessageTurretKill[$DamageType::MissileTurret, 1] = '\c0%1 is shot down by a missile turret.';
|
||||
$DeathMessageTurretKill[$DamageType::MissileTurret, 2] = '\c0%1 is blown away by a missile turret.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 is killed by a clamp turret.';
|
||||
$DeathMessageTurretKill[$DamageType::IndoorDepTurret, 1] = '\c0%1 gets burned by a clamp turret.';
|
||||
$DeathMessageTurretKill[$DamageType::IndoorDepTurret, 2] = '\c0A clamp turret eliminates %1.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 0] = '\c0A spike turret neatly drills %1.';
|
||||
$DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 1] = '\c0%1 gets taken out by a spike turret.';
|
||||
$DeathMessageTurretKill[$DamageType::OutdoorDepTurret, 2] = '\c0%1 dies under a spike turret\'s love.';
|
||||
|
||||
$DeathMessageTurretKill[$DamageType::SentryTurret, 0] = '\c0%1 didn\'t see that Sentry turret, but it saw %2...';
|
||||
$DeathMessageTurretKill[$DamageType::SentryTurret, 1] = '\c0%1 needs to watch for Sentry turrets.';
|
||||
$DeathMessageTurretKill[$DamageType::SentryTurret, 2] = '\c0%1 now understands how Sentry turrets work.';
|
||||
|
||||
|
||||
//used when a player is killed by a teammate controlling a turret
|
||||
$DeathMessageCTurretTeamKillCount = 1;
|
||||
$DeathMessageCTurretTeamKill[$DamageType::PlasmaTurret, 0] = '\c0%4 TEAMKILLED %1 with a plasma turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::AATurret, 0] = '\c0%4 TEAMKILLED %1 with an AA turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::ELFTurret, 0] = '\c0%4 TEAMKILLED %1 with an ELF turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::MortarTurret, 0] = '\c0%4 TEAMKILLED %1 with a mortar turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::MissileTurret, 0] = '\c0%4 TEAMKILLED %1 with a missile turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::IndoorDepTurret, 0] = '\c0%4 TEAMKILLED %1 with a clamp turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::OutdoorDepTurret, 0] = '\c0%4 TEAMKILLED %1 with a spike turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::SentryTurret, 0] = '\c0%4 TEAMKILLED %1 with a sentry turret!';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::BomberBombs, 0] = '\c0%4 TEAMKILLED %1 in a bombastic explosion of raining death.';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::BellyTurret, 0] = '\c0%4 TEAMKILLED %1 by annihilating him from a belly turret.';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::TankChainGun, 0] = '\c0%4 TEAMKILLED %1 with his tank\'s chaingun.';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::TankMortar, 0] = '\c0%4 TEAMKILLED %1 by lobbing the BIG green death from a tank.';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::ShrikeBlaster, 0] = '\c0%4 TEAMKILLED %1 by strafing from a Shrike.';
|
||||
|
||||
$DeathMessageCTurretTeamKill[$DamageType::MPBMissile, 0] = '\c0%4 TEAMKILLED %1 when the MPB locked onto him.';
|
||||
|
||||
|
||||
|
||||
//used when a player is killed by an uncontrolled, friendly turret
|
||||
$DeathMessageCTurretAccdtlKillCount = 1;
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::PlasmaTurret, 0] = '\c0%1 got in the way of a plasma turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::AATurret, 0] = '\c0%1 got in the way of an AA turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::ELFTurret, 0] = '\c0%1 got in the way of an ELF turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::MortarTurret, 0] = '\c0%1 got in the way of a mortar turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::MissileTurret, 0] = '\c0%1 got in the way of a missile turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 got in the way of a clamp turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::OutdoorDepTurret, 0] = '\c0%1 got in the way of a spike turret!';
|
||||
|
||||
$DeathMessageCTurretAccdtlKill[$DamageType::SentryTurret, 0] = '\c0%1 got in the way of a Sentry turret!';
|
||||
|
||||
|
||||
//these messages for owned or controlled turrets
|
||||
$DeathMessageCTurretKillCount = 3;
|
||||
$DeathMessageCTurretKill[$DamageType::PlasmaTurret, 0] = '\c0%4 torches %1 with a plasma turret!';
|
||||
$DeathMessageCTurretKill[$DamageType::PlasmaTurret, 1] = '\c0%4 fries %1 with a plasma turret!';
|
||||
$DeathMessageCTurretKill[$DamageType::PlasmaTurret, 2] = '\c0%4 lights up %1 with a plasma turret!';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::AATurret, 0] = '\c0%4 shoots down %1 with an AA turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::AATurret, 1] = '\c0%1 gets shot down by %1\'s AA turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::AATurret, 2] = '\c0%4 takes out %1 with an AA turret.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::ElfTurret, 0] = '\c0%1 gets zapped by ELF gunner %4.';
|
||||
$DeathMessageCTurretKill[$DamageType::ElfTurret, 1] = '\c0%1 gets barbecued by ELF gunner %4.';
|
||||
$DeathMessageCTurretKill[$DamageType::ElfTurret, 2] = '\c0%1 gets shocked by ELF gunner %4.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::MortarTurret, 0] = '\c0%1 is annihilated by %4\'s mortar turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::MortarTurret, 1] = '\c0%1 is blown away by %4\'s mortar turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::MortarTurret, 2] = '\c0%1 is pureed by %4\'s mortar turret.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::MissileTurret, 0] = '\c0%4 shows %1 a new world of pain with a missile turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::MissileTurret, 1] = '\c0%4 pops %1 with a missile turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::MissileTurret, 2] = '\c0%4\'s missile turret lights up %1\'s, uh, ex-life.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 0] = '\c0%1 is chewed up and spat out by %4\'s clamp turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 1] = '\c0%1 is knocked out by %4\'s clamp turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::IndoorDepTurret, 2] = '\c0%4\'s clamp turret drills %1 nicely.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 0] = '\c0%1 is chewed up by %4\'s spike turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 1] = '\c0%1 feels the burn from %4\'s spike turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::OutdoorDepTurret, 2] = '\c0%1 is nailed by %4\'s spike turret.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::SentryTurret, 0] = '\c0%4 caught %1 by surprise with a turret.';
|
||||
$DeathMessageCTurretKill[$DamageType::SentryTurret, 1] = '\c0%4\'s turret took out %1.';
|
||||
$DeathMessageCTurretKill[$DamageType::SentryTurret, 2] = '\c0%4 blasted %1 with a turret.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::BomberBombs, 0] = '\c0%1 catches %4\'s bomb in both teeth.';
|
||||
$DeathMessageCTurretKill[$DamageType::BomberBombs, 1] = '\c0%4 leaves %1 a smoking bomb crater.';
|
||||
$DeathMessageCTurretKill[$DamageType::BomberBombs, 2] = '\c0%4 bombs %1 back to the 20th century.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::BellyTurret, 0] = '\c0%1 eats a big helping of %4\'s belly turret bolt.';
|
||||
$DeathMessageCTurretKill[$DamageType::BellyTurret, 1] = '\c0%4 plants a belly turret bolt in %1\'s belly.';
|
||||
$DeathMessageCTurretKill[$DamageType::BellyTurret, 2] = '\c0%1 fails to evade %4\'s deft bomber strafing.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::TankChainGun, 0] = '\c0%1 enjoys the rich, metallic taste of %4\'s tank slug.';
|
||||
$DeathMessageCTurretKill[$DamageType::TankChainGun, 1] = '\c0%4\'s tank chaingun plays sweet music all over %1.';
|
||||
$DeathMessageCTurretKill[$DamageType::TankChainGun, 2] = '\c0%1 receives a stellar exit wound from %4\'s tank slug.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::TankMortar, 0] = '\c0Whoops! %1 + %4\'s tank mortar = Dead %1.';
|
||||
$DeathMessageCTurretKill[$DamageType::TankMortar, 1] = '\c0%1 learns the happy explosion dance from %4\'s tank mortar.';
|
||||
$DeathMessageCTurretKill[$DamageType::TankMortar, 2] = '\c0%4\'s tank mortar has a blast with %1.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 0] = '\c0%1 dines on a Shrike blaster sandwich, courtesy of %4.';
|
||||
$DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 1] = '\c0The blaster of %4\'s Shrike turns %1 into finely shredded meat.';
|
||||
$DeathMessageCTurretKill[$DamageType::ShrikeBlaster, 2] = '\c0%1 gets drilled big-time by the blaster of %4\'s Shrike.';
|
||||
|
||||
$DeathMessageCTurretKill[$DamageType::MPBMissile, 0] = '\c0%1 intersects nicely with %4\'s MPB Missile.';
|
||||
$DeathMessageCTurretKill[$DamageType::MPBMissile, 1] = '\c0%4\'s MPB Missile makes armored chowder out of %1.';
|
||||
$DeathMessageCTurretKill[$DamageType::MPBMissile, 2] = '\c0%1 has a brief, explosive fling with %4\'s MPB Missile.';
|
||||
|
||||
$DeathMessageTurretSelfKillCount = 3;
|
||||
$DeathMessageTurretSelfKill[0] = '\c0%1 somehow kills %2self with a turret.';
|
||||
$DeathMessageTurretSelfKill[1] = '\c0%1 apparently didn\'t know the turret was loaded.';
|
||||
$DeathMessageTurretSelfKill[2] = '\c0%1 helps his team by killing himself with a turret.';
|
||||
|
||||
$DeathMessageMeteorCount = 6;
|
||||
$DeathMessageMeteor[0] = '\c0%1 was killed by a meteor!';
|
||||
$DeathMessageMeteor[1] = '\c0%1 caught a meteor!';
|
||||
$DeathMessageMeteor[2] = '\c0%1 gets a facefull of molten meteor.';
|
||||
$DeathMessageMeteor[3] = '\c0%1 gets smeared by a red hot meteor.';
|
||||
$DeathMessageMeteor[4] = '\c0%1 is left a smoking crater by a meteor.';
|
||||
$DeathMessageMeteor[5] = '\c0%1 learns to seek shelter when there\'s hot rock falling from the sky.';
|
||||
|
||||
$DeathMessageCursingCount = 2;
|
||||
$DeathMessageCursing[0] = '\c0%1 was killed for cursing.';
|
||||
$DeathMessageCursing[1] = '\c0%1\'s mouth gets %2 killed again.';
|
||||
|
||||
$DeathMessageIdiocyCount = 2;
|
||||
$DeathMessageIdiocy[0] = '\c0%1 was killed for being dumb.';
|
||||
$DeathMessageIdiocy[1] = '\c0%1\'s own stupidity stops %2 cold in %3 tracks.';
|
||||
|
||||
$DeathMessageKillerFogCount = 4;
|
||||
$DeathMessageKillerFog[0] = '\c0%1 got lost in the great beyond.';
|
||||
$DeathMessageKillerFog[1] = '\c0%1 slipped and fell, never to be seen again.';
|
||||
$DeathMessageKillerFog[2] = '\c0The fog of death engulfs %1.';
|
||||
$DeathMessageKillerFog[3] = '\c0%1 got lost in the fog.';
|
||||
|
||||
|
||||
$DeathMessage[$DamageType::SuperChaingun, 0] = '\c0%4 rips %1 up with the super chaingun.';
|
||||
$DeathMessage[$DamageType::SuperChaingun, 1] = '\c0%4 happily chews %1 into pieces with %6 super chaingun.';
|
||||
$DeathMessage[$DamageType::SuperChaingun, 2] = '\c0%4 administers a dose of Admin Lead to %1.';
|
||||
$DeathMessage[$DamageType::SuperChaingun, 3] = '\c0%1 suffers a serious hosing from %4\'s super chaingun.';
|
||||
$DeathMessage[$DamageType::SuperChaingun, 4] = '\c0%4 bestows the blessings of %6 super chaingun on %1.';
|
||||
|
||||
// TODO - create these
|
||||
$DeathMessageSelfKill[$DamageType::SuperChaingun, 0] = '\c0%1 kills %2self with a super chaingun.';
|
||||
$DeathMessageSelfKill[$DamageType::SuperChaingun, 1] = '\c0%1 catches the blast of %3 own super chaingun bullet.';
|
||||
$DeathMessageSelfKill[$DamageType::SuperChaingun, 2] = '\c0%1 kills %2self with a super chaingun.';
|
||||
$DeathMessageSelfKill[$DamageType::SuperChaingun, 3] = '\c0%1 catches the blast of %3 own super chaingun bullet.';
|
||||
$DeathMessageSelfKill[$DamageType::SuperChaingun, 4] = '\c0%1 plays Russian roulette with %3 super chaingun.';
|
||||
5080
scripts/defaultGame.cs
Executable file
5080
scripts/defaultGame.cs
Executable file
File diff suppressed because it is too large
Load diff
2078
scripts/deployables.cs
Executable file
2078
scripts/deployables.cs
Executable file
File diff suppressed because it is too large
Load diff
1431
scripts/do_not_delete/Dfunctions.cs
Executable file
1431
scripts/do_not_delete/Dfunctions.cs
Executable file
File diff suppressed because it is too large
Load diff
113
scripts/editor.cs
Executable file
113
scripts/editor.cs
Executable file
|
|
@ -0,0 +1,113 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Hard coded images referenced from C++ code
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// editor/SelectHandle.png
|
||||
// editor/DefaultHandle.png
|
||||
// editor/LockedHandle.png
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mission Editor
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function Editor::create()
|
||||
{
|
||||
// Not much to do here, build it and they will come...
|
||||
// Only one thing... the editor is a gui control which
|
||||
// expect the Canvas to exist, so it must be constructed
|
||||
// before the editor.
|
||||
new EditManager(Editor)
|
||||
{
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
helpTag = "0";
|
||||
open = false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function Editor::onAdd(%this)
|
||||
{
|
||||
// Basic stuff
|
||||
exec("scripts/cursors.cs");
|
||||
exec("scripts/EditorProfiles.cs");
|
||||
|
||||
// Tools
|
||||
exec("scripts/editor.bind.cs");
|
||||
exec("gui/ObjectBuilderGui.gui");
|
||||
|
||||
// New World Editor
|
||||
exec("gui/EditorGui.gui");
|
||||
exec("scripts/EditorGui.cs");
|
||||
exec("gui/AIEWorkingDlg.gui");
|
||||
|
||||
// World Editor
|
||||
exec("gui/WorldEditorSettingsDlg.gui");
|
||||
|
||||
// Terrain Editor
|
||||
exec("gui/TerrainEditorVSettingsGui.gui");
|
||||
exec("gui/HelpDlg.gui");
|
||||
exec("scripts/help.cs");
|
||||
|
||||
// do gui initialization...
|
||||
EditorGui.init();
|
||||
|
||||
//
|
||||
exec("scripts/editorRender.cs");
|
||||
}
|
||||
|
||||
function Editor::checkActiveLoadDone()
|
||||
{
|
||||
if(isObject(EditorGui) && EditorGui.loadingMission)
|
||||
{
|
||||
Canvas.setContent(EditorGui);
|
||||
EditorGui.loadingMission = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function toggleEditor(%make)
|
||||
{
|
||||
if (%make)
|
||||
{
|
||||
if (!$missionRunning)
|
||||
{
|
||||
MessageBoxOK("Mission Required", "You must load a mission before starting the Mission Editor.", "");
|
||||
return;
|
||||
}
|
||||
|
||||
// $testcheats = 1;
|
||||
if (!isObject(Editor))
|
||||
{
|
||||
Editor::create();
|
||||
MissionCleanup.add(Editor);
|
||||
}
|
||||
if (Canvas.getContent() == EditorGui.getId())
|
||||
Editor.close();
|
||||
else
|
||||
Editor.open();
|
||||
}
|
||||
}
|
||||
|
||||
148
scripts/expertLibraries.cs
Executable file
148
scripts/expertLibraries.cs
Executable file
|
|
@ -0,0 +1,148 @@
|
|||
//Contain basic data libraries.
|
||||
//Soon to be updated with more usefull stuff.
|
||||
|
||||
// NOTE - any changes here must be considered in libraries.cs !!!
|
||||
|
||||
//** New format of information **
|
||||
|
||||
$packSettings["spine"] = 18;
|
||||
$packSetting["spine",0] = "0.5 0.5 0.1 10 cm in height";
|
||||
$packSetting["spine",1] = "0.5 0.5 0.25 25 cm in height";
|
||||
$packSetting["spine",2] = "0.5 0.5 0.5 50 cm in height";
|
||||
$packSetting["spine",3] = "0.5 0.5 1 1 meter in height";
|
||||
$packSetting["spine",4] = "0.5 0.5 1.5 1.5 meters in height";
|
||||
$packSetting["spine",5] = "0.5 6 160 auto adjusting";
|
||||
$packSetting["spine",6] = "0.5 8 160 pad";
|
||||
$packSetting["spine",7] = "0.5 8 160 wooden pad";
|
||||
$packSetting["spine",8] = "0.5 0.5 4 4 meters in height";
|
||||
$packSetting["spine",9] = "0.5 0.5 8 8 meters in height";
|
||||
$packSetting["spine",10] = "0.5 0.5 20 20 meters in height";
|
||||
$packSetting["spine",11] = "0.5 0.5 40 40 meters in height";
|
||||
$packSetting["spine",12] = "0.5 0.5 80 80 meters in height";
|
||||
$packSetting["spine",13] = "0.5 0.5 100 100 meters in height";
|
||||
$packSetting["spine",14] = "0.5 0.5 160 160 meters in height";
|
||||
$packSetting["spine",15] = "0.5 0.5 400 400 meters in height";
|
||||
$packSetting["spine",16] = "0.5 0.5 1000 1k meters in height";
|
||||
$packSetting["spine",17] = "0.5 0.5 2000 2k meters in height";
|
||||
$packSetting["spine",18] = "0.5 0.5 4000 4k meters in height";
|
||||
|
||||
$packSettings["mspine"] = 18;
|
||||
$packSetting["mspine",0] = "1 1 0.1 2 2 0.5 10 cm in height";
|
||||
$packSetting["mspine",1] = "1 1 0.25 2 2 0.5 25 cm in height";
|
||||
$packSetting["mspine",2] = "1 1 0.5 2 2 0.5 50 cm in height";
|
||||
$packSetting["mspine",3] = "1 1 1 2 2 0.5 1 meters in height";
|
||||
$packSetting["mspine",4] = "1 1 1.5 2 2 0.5 1.5 meters in height";
|
||||
$packSetting["mspine",5] = "1 8 160 2 2 0.5 auto adjusting";
|
||||
$packSetting["mspine",6] = "1 8 160 2 2 0.5 normal rings";
|
||||
$packSetting["mspine",7] = "1 8 160 8 8 0.5 platform rings";
|
||||
$packSetting["mspine",8] = "1 1 4 2 2 0.5 4 meters in height";
|
||||
$packSetting["mspine",9] = "1 1 8 2 2 0.5 8 meters in height";
|
||||
$packSetting["mspine",10] = "1 1 20 2 2 0.5 20 meters in height";
|
||||
$packSetting["mspine",11] = "1 1 40 2 2 0.5 40 meters in height";
|
||||
$packSetting["mspine",12] = "1 1 80 2 2 0.5 80 meters in height";
|
||||
$packSetting["mspine",13] = "1 1 100 2 2 0.5 100 meters in height";
|
||||
$packSetting["mspine",14] = "1 1 160 2 2 0.5 160 meters in height";
|
||||
$packSetting["mspine",15] = "1 1 400 2 2 0.5 400 meters in height";
|
||||
$packSetting["mspine",16] = "1 1 1000 2 2 0.5 1k meters in height";
|
||||
$packSetting["mspine",17] = "1 1 2000 2 2 0.5 2k meters in height";
|
||||
$packSetting["mspine",18] = "1 1 4000 2 2 0.5 4k meters in height";
|
||||
|
||||
$packSettings["floor"] = 11;
|
||||
$packSetting["floor",0] = "0.1 0.1 40 0.1 0.1 0.1 10 cm wide";
|
||||
$packSetting["floor",1] = "1 1 40 1 1 1 1 meter wide";
|
||||
$packSetting["floor",2] = "4 4 40 4 4 4 4 meters wide";
|
||||
$packSetting["floor",3] = "10 10 20 10 10 10 10 meters wide";
|
||||
$packSetting["floor",4] = "20 20 20 20 20 20 20 meters wide";
|
||||
$packSetting["floor",5] = "30 30 20 30 30 30 30 meters wide";
|
||||
$packSetting["floor",6] = "40 40 20 40 40 40 40 meters wide";
|
||||
$packSetting["floor",7] = "50 50 20 50 50 50 50 meters wide";
|
||||
$packSetting["floor",8] = "60 60 20 60 60 60 60 meters wide";
|
||||
$packSetting["floor",9] = "100 100 40 100 100 100 100 meters wide";
|
||||
$packSetting["floor",10] = "400 400 40 400 400 400 400 meters wide";
|
||||
$packSetting["floor",11] = "1000 1000 40 1000 1000 1000 1k meters wide";
|
||||
|
||||
$packSettings["walk"] = 74;
|
||||
$packSetting["walk",0] = "0 flat";
|
||||
$packSetting["walk",1] = "1 Sloped 1 degrees up";
|
||||
$packSetting["walk",2] = "-1 Sloped 1 degrees down";
|
||||
$packSetting["walk",3] = "5 Sloped 5 degrees up";
|
||||
$packSetting["walk",4] = "-5 Sloped 5 degrees down";
|
||||
$packSetting["walk",5] = "10 Sloped 10 degrees up";
|
||||
$packSetting["walk",6] = "-10 Sloped 10 degrees down";
|
||||
$packSetting["walk",7] = "15 Sloped 15 degrees up";
|
||||
$packSetting["walk",8] = "-15 Sloped 15 degrees down";
|
||||
$packSetting["walk",9] = "20 Sloped 20 degrees up";
|
||||
$packSetting["walk",10] = "-20 Sloped 20 degrees down";
|
||||
$packSetting["walk",11] = "25 Sloped 25 degrees up";
|
||||
$packSetting["walk",12] = "-25 Sloped 25 degrees down";
|
||||
$packSetting["walk",13] = "30 Sloped 30 degrees up";
|
||||
$packSetting["walk",14] = "-30 Sloped 30 degrees down";
|
||||
$packSetting["walk",15] = "35 Sloped 35 degrees up";
|
||||
$packSetting["walk",16] = "-35 Sloped 35 degrees down";
|
||||
$packSetting["walk",17] = "40 Sloped 40 degrees up";
|
||||
$packSetting["walk",18] = "-40 Sloped 40 degrees down";
|
||||
$packSetting["walk",19] = "45 Sloped 45 degrees up";
|
||||
$packSetting["walk",20] = "-45 Sloped 45 degrees down";
|
||||
$packSetting["walk",21] = "50 Sloped 50 degrees up";
|
||||
$packSetting["walk",22] = "-50 Sloped 50 degrees down";
|
||||
$packSetting["walk",23] = "55 Sloped 55 degrees up";
|
||||
$packSetting["walk",24] = "-55 Sloped 55 degrees down";
|
||||
$packSetting["walk",25] = "60 Sloped 60 degrees up";
|
||||
$packSetting["walk",26] = "-60 Sloped 60 degrees down";
|
||||
$packSetting["walk",27] = "65 Sloped 65 degrees up";
|
||||
$packSetting["walk",28] = "-65 Sloped 65 degrees down";
|
||||
$packSetting["walk",29] = "70 Sloped 70 degrees up";
|
||||
$packSetting["walk",30] = "-70 Sloped 70 degrees down";
|
||||
$packSetting["walk",31] = "75 Sloped 75 degrees up";
|
||||
$packSetting["walk",32] = "-75 Sloped 75 degrees down";
|
||||
$packSetting["walk",33] = "80 Sloped 80 degrees up";
|
||||
$packSetting["walk",34] = "-80 Sloped 80 degrees down";
|
||||
$packSetting["walk",35] = "85 Sloped 85 degrees up";
|
||||
$packSetting["walk",36] = "-85 Sloped 85 degrees down";
|
||||
$packSetting["walk",37] = "90 Sloped 90 degrees up";
|
||||
$packSetting["walk",38] = "-90 Sloped 90 degrees down";
|
||||
$packSetting["walk",39] = "95 Sloped 95 degrees up";
|
||||
$packSetting["walk",40] = "-95 Sloped 95 degrees down";
|
||||
$packSetting["walk",41] = "100 Sloped 100 degrees up";
|
||||
$packSetting["walk",42] = "-100 Sloped 100 degrees down";
|
||||
$packSetting["walk",43] = "105 Sloped 105 degrees up";
|
||||
$packSetting["walk",44] = "-105 Sloped 105 degrees down";
|
||||
$packSetting["walk",45] = "110 Sloped 110 degrees up";
|
||||
$packSetting["walk",46] = "-110 Sloped 110 degrees down";
|
||||
$packSetting["walk",47] = "115 Sloped 115 degrees up";
|
||||
$packSetting["walk",48] = "-115 Sloped 115 degrees down";
|
||||
$packSetting["walk",49] = "120 Sloped 120 degrees up";
|
||||
$packSetting["walk",50] = "-120 Sloped 120 degrees down";
|
||||
$packSetting["walk",51] = "125 Sloped 125 degrees up";
|
||||
$packSetting["walk",52] = "-125 Sloped 125 degrees down";
|
||||
$packSetting["walk",53] = "130 Sloped 130 degrees up";
|
||||
$packSetting["walk",54] = "-130 Sloped 130 degrees down";
|
||||
$packSetting["walk",55] = "135 Sloped 135 degrees up";
|
||||
$packSetting["walk",56] = "-135 Sloped 135 degrees down";
|
||||
$packSetting["walk",57] = "140 Sloped 140 degrees up";
|
||||
$packSetting["walk",58] = "-140 Sloped 140 degrees down";
|
||||
$packSetting["walk",59] = "145 Sloped 145 degrees up";
|
||||
$packSetting["walk",60] = "-145 Sloped 145 degrees down";
|
||||
$packSetting["walk",61] = "150 Sloped 150 degrees up";
|
||||
$packSetting["walk",62] = "-150 Sloped 150 degrees down";
|
||||
$packSetting["walk",63] = "155 Sloped 155 degrees up";
|
||||
$packSetting["walk",64] = "-155 Sloped 155 degrees down";
|
||||
$packSetting["walk",65] = "160 Sloped 160 degrees up";
|
||||
$packSetting["walk",66] = "-160 Sloped 160 degrees down";
|
||||
$packSetting["walk",67] = "165 Sloped 165 degrees up";
|
||||
$packSetting["walk",68] = "-165 Sloped 165 degrees down";
|
||||
$packSetting["walk",69] = "170 Sloped 170 degrees up";
|
||||
$packSetting["walk",70] = "-170 Sloped 170 degrees down";
|
||||
$packSetting["walk",71] = "175 Sloped 175 degrees up";
|
||||
$packSetting["walk",72] = "-175 Sloped 175 degrees down";
|
||||
$packSetting["walk",73] = "180 Sloped 180 degrees up";
|
||||
$packSetting["walk",74] = "-180 Sloped 180 degrees down";
|
||||
|
||||
$packSettings["jumpad"] = 6;
|
||||
$packSetting["jumpad",0] = "500 5 boost";
|
||||
$packSetting["jumpad",1] = "1000 10 boost";
|
||||
$packSetting["jumpad",2] = "1500 15 boost";
|
||||
$packSetting["jumpad",3] = "2500 25 boost";
|
||||
$packSetting["jumpad",4] = "5000 50 boost";
|
||||
$packSetting["jumpad",5] = "7500 75 boost";
|
||||
$packSetting["jumpad",6] = "10000 100 boost";
|
||||
290
scripts/forceField.cs
Executable file
290
scripts/forceField.cs
Executable file
|
|
@ -0,0 +1,290 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Force fields:
|
||||
//
|
||||
// accept the following commands:
|
||||
// open()
|
||||
// close()
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
datablock ForceFieldBareData(defaultForceFieldBare)
|
||||
{
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = 0.30;
|
||||
powerOffTranslucency = 0.0;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = "0.0 0.55 0.99";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetNameTag = 'Force Field';
|
||||
targetTypeTag = 'ForceField';
|
||||
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
};
|
||||
|
||||
|
||||
datablock ForceFieldBareData(defaultTeamSlowFieldBare)
|
||||
{
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = 0.3;
|
||||
powerOffTranslucency = 0.0;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = "0.28 0.89 0.31";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetTypeTag = 'ForceField';
|
||||
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(defaultAllSlowFieldBare)
|
||||
{
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = 0.30;
|
||||
powerOffTranslucency = 0.0;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = "1.0 0.4 0.0";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetTypeTag = 'ForceField';
|
||||
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(defaultNoTeamSlowFieldBare)
|
||||
{
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = 0.30;
|
||||
powerOffTranslucency = 0.0;
|
||||
teamPermiable = false;
|
||||
otherPermiable = true;
|
||||
color = "1.0 0.0 0.0";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetTypeTag = 'ForceField';
|
||||
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(defaultSolidFieldBare)
|
||||
{
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = 0.30;
|
||||
powerOffTranslucency = 0.0;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = "1.0 0.0 0.0";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetTypeTag = 'ForceField';
|
||||
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
};
|
||||
|
||||
|
||||
function ForceFieldBare::onTrigger(%this, %triggerId, %on)
|
||||
{
|
||||
// Default behavior for a field:
|
||||
// if triggered: go to open state (last waypoint)
|
||||
// if untriggered: go to closed state (first waypoint)
|
||||
|
||||
if (%on == 1) {
|
||||
%this.triggerCount++;
|
||||
} else {
|
||||
if (%this.triggerCount > 0)
|
||||
%this.triggerCount--;
|
||||
}
|
||||
|
||||
if (%this.triggerCount > 0) {
|
||||
%this.open();
|
||||
} else {
|
||||
%this.close();
|
||||
}
|
||||
}
|
||||
|
||||
function ForceFieldBareData::gainPower(%data, %obj) {
|
||||
Parent::gainPower(%data, %obj);
|
||||
if (!shouldChangePowerState(%obj,true))
|
||||
return;
|
||||
%obj.lastState = true;
|
||||
if (%obj.realScale) {
|
||||
%obj.setScale(%obj.realScale);
|
||||
%obj.realScale = "";
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.setTransform(%obj.getTransform());
|
||||
}
|
||||
%obj.close();
|
||||
// activate the field's physical zone
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.activate();
|
||||
// %pzGroup = nameToID("MissionCleanup/PZones");
|
||||
// if(%pzGroup > 0) {
|
||||
// %ffp = -1;
|
||||
// for(%i = 0; %i < %pzGroup.getCount(); %i++) {
|
||||
// %pz = %pzGroup.getObject(%i);
|
||||
// if(%pz.ffield == %obj) {
|
||||
// %ffp = %pz;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if(%ffp > 0) {
|
||||
// %ffp.activate();
|
||||
if( %data.getName() $= "defaultForceFieldBare" )
|
||||
killAllPlayersWithinZone( %data, %obj );
|
||||
else if( %data.getName() $= "defaultTeamSlowFieldBare" ) {
|
||||
%team = %obj.team;
|
||||
killAllPlayersWithinZone( %data, %obj, %team );
|
||||
}
|
||||
else if (getSubStr(%data.getName(),0,18) $= "DeployedForceField") {
|
||||
if (!%obj.notFirstPwr) {
|
||||
%obj.notFirstPwr = true;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%team = %obj.team;
|
||||
killAllPlayersWithinZone( %data, %obj, %team );
|
||||
}
|
||||
}
|
||||
// }
|
||||
//else
|
||||
// error("No PZones group to search!");
|
||||
}
|
||||
|
||||
function killAllPlayersWithinZone( %data, %obj, %team ) {
|
||||
%count = ClientGroup.getCount();
|
||||
for( %c = 0; %c < %count; %c++ ) {
|
||||
%client = ClientGroup.getObject(%c);
|
||||
if( isObject( %client.player ) ) {
|
||||
if( %forceField = %client.player.isInForceField() ) { // isInForceField() will return the id of the ff or zero
|
||||
if( %forceField == %obj ) {
|
||||
%client.player.FFZapped = true;
|
||||
%client.player.disableMove(true);
|
||||
for( %i = 0; %i < 10; %i++ ) {
|
||||
%client.player.schedule(%i * 200,play3d,ShockLanceHitSound);
|
||||
schedule(%i * 200,0,playPain,%client.player);
|
||||
%client.player.schedule(%i * 200,setActionThread,"Death" @ getRandom(10)+1);
|
||||
}
|
||||
%client.player.schedule(2000,blowup); // chunkOrama!
|
||||
%client.player.schedule(2000,scriptkill,$DamageType::ForceFieldPowerup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ForceFieldBareData::losePower(%data, %obj) {
|
||||
Parent::losePower(%data, %obj);
|
||||
if (!shouldChangePowerState(%obj,false))
|
||||
return;
|
||||
%obj.lastState = false;
|
||||
if (!%obj.realScale) {
|
||||
%obj.realScale = %obj.getScale();
|
||||
%obj.setScale("0.01 0.01 0.01");
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.setTransform(%obj.getTransform());
|
||||
}
|
||||
%obj.open();
|
||||
// deactivate the field's physical zone
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.deactivate();
|
||||
// %pzGroup = nameToID("MissionCleanup/PZones");
|
||||
// if(%pzGroup > 0) {
|
||||
// %ffp = -1;
|
||||
// for(%i = 0; %i < %pzGroup.getCount(); %i++) {
|
||||
// %pz = %pzGroup.getObject(%i);
|
||||
// if(%pz.ffield == %obj) {
|
||||
// %ffp = %pz;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if(%ffp > 0) {
|
||||
// %ffp.deactivate();
|
||||
// }
|
||||
// }
|
||||
//else
|
||||
// error("<No PZones group to search!>");
|
||||
}
|
||||
|
||||
function ForceFieldBareData::onAdd(%data, %obj) {
|
||||
Parent::onAdd(%data, %obj);
|
||||
|
||||
%velocityMod = 0.1;
|
||||
%gravityMod = 1.0;
|
||||
%appliedForce = "0 0 0";
|
||||
|
||||
if (%obj.velocityMod !$= "")
|
||||
%velocityMod = %obj.velocityMod;
|
||||
if (%obj.gravityMod !$= "")
|
||||
%gravityMod = %obj.gravityMod;
|
||||
if (%obj.appliedForce !$= "")
|
||||
%appliedForce = %obj.appliedForce;
|
||||
|
||||
%pz = new PhysicalZone() {
|
||||
position = %obj.position;
|
||||
rotation = %obj.rotation;
|
||||
scale = %obj.scale;
|
||||
polyhedron = "0.000000 1.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
|
||||
velocityMod = %velocityMod;
|
||||
gravityMod = %gravityMod;
|
||||
appliedForce = %appliedForce;
|
||||
ffield = %obj;
|
||||
};
|
||||
|
||||
%obj.pzone = %pz;
|
||||
|
||||
%pzGroup = nameToID("MissionCleanup/PZones");
|
||||
if(%pzGroup <= 0) {
|
||||
%pzGroup = new SimGroup("PZones");
|
||||
MissionCleanup.add(%pzGroup);
|
||||
}
|
||||
%pzGroup.add(%pz);
|
||||
}
|
||||
1034
scripts/functions.cs
Executable file
1034
scripts/functions.cs
Executable file
File diff suppressed because it is too large
Load diff
159
scripts/gameBase.cs
Executable file
159
scripts/gameBase.cs
Executable file
|
|
@ -0,0 +1,159 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// gameBase.cs
|
||||
// Dark Dragon DX: Added some useful functions.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function GameBaseData::onAdd(%data, %obj)
|
||||
{
|
||||
if(%data.targetTypeTag !$= "")
|
||||
{
|
||||
// use the name given to the object in the mission file
|
||||
if(%obj.nameTag !$= "")
|
||||
{
|
||||
%obj.nameTag = addTaggedString(%obj.nameTag);
|
||||
%nameTag = %obj.nameTag;
|
||||
}
|
||||
else
|
||||
%nameTag = %data.targetNameTag;
|
||||
|
||||
%obj.target = createTarget(%obj, %nameTag, "", "", %data.targetTypeTag, 0, 0);
|
||||
}
|
||||
else
|
||||
%obj.target = -1;
|
||||
}
|
||||
|
||||
function GameBaseData::onRemove(%data, %obj)
|
||||
{
|
||||
%target = %obj.getTarget();
|
||||
|
||||
// first 32 targets are team targets
|
||||
if(%target >= 32)
|
||||
{
|
||||
if(%obj.nameTag !$= "")
|
||||
removeTaggedString(%obj.nameTag);
|
||||
freeTarget(%target);
|
||||
}
|
||||
}
|
||||
|
||||
function TerraFormer::getState(){ return "unknown"; }
|
||||
function Terraformer::getClassName(%this){ return "terraformer"; }
|
||||
function TerraFormer::isPlayer(){ return false; }
|
||||
function TerraFormer::isVehicle(){ return false; }
|
||||
function InteriorInstance::damage(){}
|
||||
function InteriorInstance::getClassName(%this){ return "interiorinstance"; }
|
||||
function TerrainBlock::damage(){}
|
||||
function Terrain::isVehicle(){ return false; }
|
||||
function Terrain::isPlayer(){ return false; }
|
||||
function Terrain::getState(){ return "static"; }
|
||||
function WaterBlock::damage(){}
|
||||
function PhysicalZone::IsPlayer(){ return false; }
|
||||
function PhysicalZone::isVehicle(){ return false; }
|
||||
function PhysicalZone::getState(){ return "static"; }
|
||||
function Sky::isPlayer(){ return false; }
|
||||
function Sky::isVehicle(){ return false; }
|
||||
function Sky::getState(){ return "static"; }
|
||||
function Vehicle::getState(){ return "move"; }
|
||||
|
||||
function ForceFieldBare::damage(%this, %sourceObject, %position, %amount, %damageType) {
|
||||
%this.getDataBlock().damageObject(%this, %sourceObject, %position, %amount, %damageType);
|
||||
}
|
||||
|
||||
function ForceFieldBareData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) {
|
||||
StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
|
||||
}
|
||||
|
||||
function ForceFieldBare::applyDamage(%obj,%amount,%sourceObject,%position,%damageType) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (getSubStr(%dataBlockName,0,18) $= "DeployedForceField" || getSubStr(%dataBlockName,0,20) $= "DeployedGravityField") {
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (genPoweringObj(%powerObj,%obj))
|
||||
%powerList = %powerList SPC %powerObj;
|
||||
}
|
||||
%powerList = trim(%powerList);
|
||||
%genDamage = (%amount * 1) / getWordCount(%powerList);
|
||||
%count = getWordCount(%powerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord(%powerList,%i);
|
||||
%mult = (1 - 0.05) + (getRandom() * 0.10);
|
||||
%powerObj.damage(%sourceObject,%position,%genDamage * %mult,%damageType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ForceFieldBare::isEnabled() {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function GameBaseData::shouldApplyImpulse(%data, %obj)
|
||||
{
|
||||
return %data.shouldApplyImpulse;
|
||||
}
|
||||
|
||||
|
||||
function ShapeBaseData::onAdd(%data, %obj)
|
||||
{
|
||||
Parent::onAdd(%data, %obj);
|
||||
// if it's a deployed object, schedule the ambient thread to play in a little while
|
||||
if(%data.deployAmbientThread)
|
||||
%obj.schedule(750, "playThread", $AmbientThread, "ambient");
|
||||
// check for ambient animation that should always be played
|
||||
if(%data.alwaysAmbient)
|
||||
%obj.playThread($AmbientThread, "ambient");
|
||||
}
|
||||
|
||||
function SimObject::setOwnerClient(%obj, %cl)
|
||||
{
|
||||
%obj.client = %cl;
|
||||
}
|
||||
|
||||
function SimObject::getOwnerClient(%obj)
|
||||
{
|
||||
if(isObject(%obj))
|
||||
return %obj.client;
|
||||
return 0;
|
||||
}
|
||||
// recursive objective init functions for mission group
|
||||
|
||||
function SimGroup::objectiveInit(%this)
|
||||
{
|
||||
for (%i = 0; %i < %this.getCount(); %i++)
|
||||
%this.getObject(%i).objectiveInit();
|
||||
}
|
||||
|
||||
function SimObject::objectiveInit(%this)
|
||||
{
|
||||
}
|
||||
|
||||
function GameBase::objectiveInit(%this)
|
||||
{
|
||||
//error("Initializing object " @ %this @ ", " @ %this.getDataBlock().getName());
|
||||
%this.getDataBlock().objectiveInit(%this);
|
||||
}
|
||||
|
||||
// tag strings are ignored if they start with an underscore
|
||||
function GameBase::getGameName(%this)
|
||||
{
|
||||
%name = "";
|
||||
|
||||
if(%this.nameTag !$= "")
|
||||
%name = %this.nameTag;
|
||||
else
|
||||
{
|
||||
%name = getTaggedString(%this.getDataBlock().targetNameTag);
|
||||
if((%name !$= "") && (getSubStr(%name, 0, 1) $= "_"))
|
||||
%name = "";
|
||||
}
|
||||
|
||||
%type = getTaggedString(%this.getDataBlock().targetTypeTag);
|
||||
if((%type !$= "") && (getSubStr(%type, 0, 1) !$= "_"))
|
||||
{
|
||||
if(%name !$= "")
|
||||
return(%name @ " " @ %type);
|
||||
else
|
||||
return(%type);
|
||||
}
|
||||
|
||||
return(%name);
|
||||
}
|
||||
134
scripts/hazard.cs
Executable file
134
scripts/hazard.cs
Executable file
|
|
@ -0,0 +1,134 @@
|
|||
// hazard.cs
|
||||
|
||||
if ($Host::Hazard::Enabled $= "")
|
||||
$Host::Hazard::Enabled = 0; // Disable as default
|
||||
if ($Hazard::HazardTimer < 500)
|
||||
$Hazard::HazardTimer = 2500; // Hazard loop timer
|
||||
if ($Hazard::StormTimer < 100)
|
||||
$Hazard::StormTimer = 500; // Hazard "storm" loop timer
|
||||
if ($Hazard::HazardStormDurationMin $= "")
|
||||
$Hazard::HazardStormDurationMin = 20000; // Storm duration min
|
||||
if ($Hazard::HazardStormDurationMax $= "")
|
||||
$Hazard::HazardStormDurationMax = 60000; // Storm duration max
|
||||
if ($Hazard::StormRandom $= "")
|
||||
$Hazard::StormRandom = 120; // Storm random chance
|
||||
if ($Hazard::MeteorMax < 1)
|
||||
$Hazard::MeteorMax = 1; // Max meteors per run
|
||||
if ($Hazard::MeteorMin $= "" || $Hazard::MeteorMin > $Hazard::MeteorMax)
|
||||
$Hazard::MeteorMin = 0; // Min meteors per run
|
||||
if ($Hazard::MeteorRad $= "")
|
||||
$Hazard::MeteorRad = 100; // Meteor drop radius
|
||||
|
||||
if ($Hazard::MaxSlant < 0 || $Hazard::MaxSlant $= "")
|
||||
$Hazard::MaxSlant = 0.4;
|
||||
if ($Hazard::BDropAddX $= "")
|
||||
$Hazard::BDropAddX = 0.00153;
|
||||
if ($Hazard::BDropAddY $= "")
|
||||
$Hazard::BDropAddY = 0.00956;
|
||||
if ($Hazard::DropAddVariation $= "")
|
||||
$Hazard::DropAddVariation = 0.0010; // divided by two = +/- 0.0005
|
||||
if ($Hazard::DropAddVariationTime < 1)
|
||||
$Hazard::DropAddVariationTime = 1000 * 60 * 10; // 10 minutes
|
||||
|
||||
if ($Hazard::DropX $= "" || mAbs($Hazard::DropX) > 1)
|
||||
$Hazard::DropX = (getRandom() * 2) - 1;
|
||||
if ($Hazard::DropY $= "" || mAbs($Hazard::DropY) > 1)
|
||||
$Hazard::DropY = 0;
|
||||
|
||||
|
||||
function hazardOn() {
|
||||
$Host::Hazard::Enabled = 1;
|
||||
hazardThread($Hazard::HazardThread++);
|
||||
}
|
||||
|
||||
function hazardOff() {
|
||||
$Host::Hazard::Enabled = 0;
|
||||
}
|
||||
|
||||
function hazardThread(%thread) {
|
||||
if (%thread != $Hazard::HazardThread || $Host::Hazard::Enabled != 1 || !isObject(MissionCleanup)) {
|
||||
warn("HazardThread #" @ mAbs(%thread) @ " stopped. Last started thread: " @ $Hazard::HazardThread);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($Hazard::StormTime $= "") {
|
||||
%rnd = getRandom(0,$Hazard::StormRandom);
|
||||
if (%rnd == 1) {
|
||||
// With default values, warning is 10 to 40 sec prior to storm
|
||||
$Hazard::StormTime = getSimTime() + ($Hazard::HazardTimer * 4) + ($Hazard::HazardTimer * getRandom(0,12));
|
||||
$Hazard::HazardStormDuration = getRandom($Hazard::HazardStormDurationMin,$Hazard::HazardStormDurationMax);
|
||||
messageAll('msgClient','\c2Warning: Meteor storm expected in %1 seconds!~wfx/misc/warning_beep.wav',mFloor(($Hazard::StormTime - getSimTime()) / 1000));
|
||||
$Hazard::StormTime = $Hazard::StormTime - 10; // fix
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($Hazard::StormTime < getSimTime() && $Hazard::StormActive != true) {
|
||||
$Hazard::StormTime = getSimTime();
|
||||
$Hazard::StormActive = true;
|
||||
messageAll('msgClient','\c2Warning: Meteor storm imminent!~wfx/misc/red_alert.wav');
|
||||
messageAll('msgClient','~wvoice/Training/Any/ANY.prompt0%1.WAV',getRandom(1,7));
|
||||
}
|
||||
if ($Hazard::StormTime + $Hazard::HazardStormDuration < getSimTime()) {
|
||||
$Hazard::StormActive = false;
|
||||
$Hazard::StormTime = "";
|
||||
messageAll('msgClient','\c2Meteor storm passing.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($Hazard::DropAddX $= "")
|
||||
$Hazard::DropAddX = $Hazard::BDropAddX;
|
||||
if ($Hazard::DropAddY $= "")
|
||||
$Hazard::DropAddY = $Hazard::BDropAddY;
|
||||
if ($Hazard::DropAddVariationLastTime $= "") // Don't randomize on first run
|
||||
$Hazard::DropAddVariationLastTime = getSimTime();
|
||||
|
||||
if ($Hazard::DropAddVariationLastTime + $Hazard::DropAddVariationTime < getSimTime()) {
|
||||
$Hazard::DropAddVariationLastTime = getSimTime();
|
||||
$Hazard::DropAddX = $Hazard::BDropAddX + ((getRandom() * $Hazard::DropAddVariation) - ($Hazard::DropAddVariation / 2));
|
||||
$Hazard::DropAddY = $Hazard::BDropAddY + ((getRandom() * $Hazard::DropAddVariation) - ($Hazard::DropAddVariation / 2));
|
||||
}
|
||||
|
||||
$Hazard::DropX = $Hazard::DropX + $Hazard::DropAddX;
|
||||
$Hazard::DropY = $Hazard::DropY + $Hazard::DropAddY;
|
||||
|
||||
if (mAbs($Hazard::DropX) > 1) {
|
||||
$Hazard::DropX = 1 * lev($Hazard::DropX);
|
||||
$Hazard::DropAddX = -$Hazard::DropAddX;
|
||||
}
|
||||
|
||||
if (mAbs($Hazard::DropY) > 1) {
|
||||
$Hazard::DropY = 1 * lev($Hazard::DropY);
|
||||
$Hazard::DropAddY = -$Hazard::DropAddY;
|
||||
}
|
||||
|
||||
%x = mCos(($Hazard::DropX * $Pi) + $Pi) * mSin(($Hazard::DropY * ($Pi / 2) + ($Pi / 2)) * $Hazard::MaxSlant);
|
||||
%y = mSin(($Hazard::DropX * $Pi) + $Pi) * mSin(($Hazard::DropY * ($Pi / 2) + ($Pi / 2)) * $Hazard::MaxSlant);
|
||||
%z = mCos(($Hazard::DropY * ($Pi / 2) + ($Pi / 2)) * $Hazard::MaxSlant);
|
||||
%dropVec = vectorScale(%x SPC %y SPC -%z,5);
|
||||
|
||||
// Meteors
|
||||
// Players
|
||||
%count = ClientGroup.getCount();
|
||||
for(%i = 0; %i < %count; %i++) {
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if (isObject(%cl.player) && !%cl.isJailed) {
|
||||
%num = getRandom($Hazard::MeteorMin,$Hazard::MeteorMax);
|
||||
if (%num > 0)
|
||||
JTLMeteorStorm(%cl,0,$Hazard::MeteorRad,%num,400,600,0,0,0,0,0,0,vectorScale(%dropVec,0.975 + (getRandom() * 0.05)),1);
|
||||
}
|
||||
}
|
||||
// Generators
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i = 0; %i < %count; %i++) {
|
||||
%obj = getWord($PowerList,%i);
|
||||
if (isObject(%obj)) {
|
||||
%num = getRandom($Hazard::MeteorMin,$Hazard::MeteorMax);
|
||||
if (%num > 0)
|
||||
JTLMeteorStorm(%obj,0,$Hazard::MeteorRad,%num,400,600,0,0,0,0,0,0,vectorScale(%dropVec,0.975 + (getRandom() * 0.05)),1);
|
||||
}
|
||||
}
|
||||
if ($Hazard::StormActive == true)
|
||||
schedule($Hazard::StormTimer,0,HazardThread,%thread);
|
||||
else
|
||||
schedule($Hazard::HazardTimer,0,HazardThread,%thread);
|
||||
}
|
||||
106
scripts/hfunctions.cs
Executable file
106
scripts/hfunctions.cs
Executable file
|
|
@ -0,0 +1,106 @@
|
|||
function LightningStrike(%client,%delay) {
|
||||
if (%client.player)
|
||||
%pos = %client.player.getTransform();
|
||||
%one = getword(%pos, 0) SPC getword(%pos, 1) SPC getword(%pos, 2);
|
||||
%player = %client.player;
|
||||
%b = new StaticShape() {
|
||||
position = %pos;
|
||||
datablock = "LightningTarget";
|
||||
};
|
||||
schedule(%delay, 0, "actualstrike", %b);
|
||||
}
|
||||
|
||||
function actualstrike(%obj) {
|
||||
%posr = %obj.getTransform();
|
||||
%pos = VectorAdd(%posr, "0 0 -20");
|
||||
%pos2 = VectorAdd(%posr, "0 0 -20");
|
||||
for (%i=0;%i<10;%i++) {
|
||||
%pos = VectorAdd(%pos, "0 0 20");
|
||||
%p[%i] = new Lightning() {
|
||||
scale = "1 1 1";
|
||||
position = %pos;
|
||||
rotation = "1 0 0 0";
|
||||
dataBlock = "DefaultStorm";
|
||||
strikesPerMinute = "120";
|
||||
strikeWidth = "1.0";
|
||||
chanceToHitTarget = "1.0";
|
||||
strikeRadius = "1";
|
||||
boltStartRadius = "10";
|
||||
color = "1.000000 1.000000 1.000000 1.000000";
|
||||
fadeColor = "0.300000 0.300000 1.000000 1.000000";
|
||||
useFog = "1";
|
||||
};
|
||||
%p[%i].schedule(1500, "delete");
|
||||
%p[%i].strikeObject(%player);
|
||||
}
|
||||
schedule(1000, 0, "LightningApplyDamage", %p, %pos, %pos2);
|
||||
if (%obj)
|
||||
%obj.schedule(1500, "delete");
|
||||
}
|
||||
|
||||
function LightningWeaponImage::onFire(%data, %obj, %slot) {
|
||||
%range = 1000;
|
||||
%rot = getWords(%obj.getTransform(), 3, 6);
|
||||
%muzzlePos = %obj.getMuzzlePoint(%slot);
|
||||
%muzzleVec = %obj.getMuzzleVector(%slot);
|
||||
%endPos = VectorAdd(%muzzlePos, VectorScale(%muzzleVec, %range));
|
||||
%damageMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType |
|
||||
$TypeMasks::StationObjectType | $TypeMasks::GeneratorObjectType |
|
||||
$TypeMasks::SensorObjectType | $TypeMasks::TurretObjectType |
|
||||
$TypeMasks::TerrainObjectType; //|$TypeMasks::InteriorObjectType;
|
||||
%hit = ContainerRayCast(%muzzlePos, %endPos, %damageMasks, %obj);
|
||||
if (%hit) {
|
||||
%posr = getWords(%hit, 1, 3);
|
||||
%pos = VectorAdd(%posr, "0 0 300");
|
||||
%pos2 = VectorAdd(%posr, "0 0 -20");
|
||||
%b = new StaticShape() {
|
||||
position = %pos2;
|
||||
datablock = "LightningTarget";
|
||||
};
|
||||
%p = new Lightning() {
|
||||
scale = "1 1 1";
|
||||
position = %pos;
|
||||
rotation = "1 0 0 0";
|
||||
dataBlock = "DefaultStorm";
|
||||
strikesPerMinute = "120";
|
||||
strikeWidth = "10.0";
|
||||
chanceToHitTarget = "1";
|
||||
strikeRadius = "10";
|
||||
boltStartRadius = "15";
|
||||
color = "1.000000 1.000000 1.000000 1.000000";
|
||||
fadeColor = "0.300000 0.300000 1.000000 1.000000";
|
||||
useFog = "1";
|
||||
sourceObject = %obj;
|
||||
sourceSlot = %slot;
|
||||
vehicleObject = 0;
|
||||
};
|
||||
%p.strikeObject(%b);
|
||||
schedule(1000, 0, "LightningApplyDamage", %p, %pos, %pos2);
|
||||
%p.schedule(1500, "delete");
|
||||
%b.schedule(1500, "delete");
|
||||
}
|
||||
}
|
||||
|
||||
function LightningApplyDamage(%p, %pos, %pos2) {
|
||||
%damageMasks = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType;
|
||||
%hit = ContainerRayCast(%pos, %pos2, %damageMasks, 1);
|
||||
if (%hit)
|
||||
%pos2 = getWords(%hit, 1, 3);
|
||||
%xy = getWords(%pos, 0, 1);
|
||||
%z1 = getWord(%pos, 2) - 5;
|
||||
%z2 = getWord(%pos2, 2) + 5;
|
||||
while (%z1 > %z2) {
|
||||
%pos = %xy SPC %z1;
|
||||
RadiusExplosion(%p, %pos, 40, 0.4, 0, %p.sourceObject, $DamageType::Lightning);
|
||||
%z1 -= 19;
|
||||
}
|
||||
%pos = %xy SPC %z1;
|
||||
RadiusExplosion(%p, %pos, 40, 0.4, 0, %p.sourceObject, $DamageType::Lightning);
|
||||
}
|
||||
|
||||
datablock StaticShapeData(LightningTarget) {
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
targetNameTag = 'beacon';
|
||||
isInvincible = true;
|
||||
dynamicType = $TypeMasks::StaticObjectType;
|
||||
};
|
||||
1946
scripts/hud.cs
Executable file
1946
scripts/hud.cs
Executable file
File diff suppressed because it is too large
Load diff
953
scripts/inventory.cs
Executable file
953
scripts/inventory.cs
Executable file
|
|
@ -0,0 +1,953 @@
|
|||
|
||||
$host::nopulseSCG = 1; ///No super pulse powers for admins.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Item Datablocks
|
||||
// image = Name of mounted image datablock
|
||||
// onUse(%this,%object)
|
||||
|
||||
// Item Image Datablocks
|
||||
// item = Name of item inventory datablock
|
||||
|
||||
// ShapeBase Datablocks
|
||||
// max[Item] = Maximum amount that can be caried
|
||||
|
||||
// ShapeBase Objects
|
||||
// inv[Item] = Count of item in inventory
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
$TestCheats = 0;
|
||||
|
||||
function serverCmdUse(%client,%data)
|
||||
{
|
||||
// Item names from the client must converted
|
||||
// into DataBlocks
|
||||
// %data = ItemDataBlock[%item];
|
||||
|
||||
%client.getControlObject().use(%data);
|
||||
}
|
||||
|
||||
function serverCmdThrow(%client,%data)
|
||||
{
|
||||
// Item names from the client must converted
|
||||
// into DataBlocks
|
||||
// %data = ItemDataBlock[%item];
|
||||
%client.getControlObject().throw(%data);
|
||||
}
|
||||
|
||||
function serverCmdThrowWeapon(%client,%data)
|
||||
{
|
||||
// Item names from the client must converted
|
||||
// into DataBlocks
|
||||
// %data = ItemDataBlock[%item];
|
||||
%client.getControlObject().throwWeapon();
|
||||
}
|
||||
|
||||
function serverCmdThrowPack(%client,%data)
|
||||
{
|
||||
%client.getControlObject().throwPack();
|
||||
}
|
||||
|
||||
function serverCmdTogglePack(%client,%data)
|
||||
{
|
||||
// this function is apparently never called
|
||||
%client.getControlObject().togglePack();
|
||||
}
|
||||
|
||||
function serverCmdThrowFlag(%client)
|
||||
{
|
||||
//Game.playerDroppedFlag(%client.player);
|
||||
Game.dropFlag(%client.player);
|
||||
}
|
||||
|
||||
function serverCmdSelectWeaponSlot( %client, %data ) {
|
||||
%client.getControlObject().selectWeaponSlot( %data );
|
||||
if (%client.player)
|
||||
if (%client.player.getObjectMount())
|
||||
callEject(%client.player, %data);
|
||||
}
|
||||
|
||||
function callEject(%player, %num) {
|
||||
%veh = %player.getObjectMount();
|
||||
if (!(%veh.getType() & $TypeMasks::VehicleObjectType))
|
||||
return;
|
||||
if (%veh.getMountNodeObject(0) == %player) {
|
||||
%obj = %veh.getMountNodeObject(%num);
|
||||
if(%obj) {
|
||||
if (%obj.getType() & $TypeMasks::PlayerObjectType) {
|
||||
%obj.getDataBlock().doDismount(%obj, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(%num == 5)
|
||||
%player.getDataBlock().doDismount(%player, 0, 1);
|
||||
}
|
||||
|
||||
function serverCmdCycleWeapon( %client, %data ) {
|
||||
%veh = 0;
|
||||
if (%client.player.station) {
|
||||
if (%client.player.station.getDataBlock().getName() $= "StationVehicle")
|
||||
%veh = 1;
|
||||
}
|
||||
if (%veh)
|
||||
cycleVehicleHud(%client.player,%client,%data);
|
||||
else
|
||||
%client.getControlObject().cycleWeapon( %data );
|
||||
}
|
||||
|
||||
function serverCmdStartThrowCount(%client, %data)
|
||||
{
|
||||
%client.player.throwStart = getSimTime();
|
||||
}
|
||||
|
||||
function serverCmdEndThrowCount(%client, %data)
|
||||
{
|
||||
if(%client.player.throwStart == 0)
|
||||
return;
|
||||
|
||||
// throwStrength will be how many seconds the key was held
|
||||
%throwStrength = (getSimTime() - %client.player.throwStart) / 150;
|
||||
// trim the time to fit between 0.5 and 1.5
|
||||
if(%throwStrength > 1.5)
|
||||
%throwStrength = 1.5;
|
||||
else if(%throwStrength < 0.5)
|
||||
%throwStrength = 0.5;
|
||||
|
||||
%throwScale = %throwStrength / 2;
|
||||
%client.player.throwStrength = %throwScale;
|
||||
|
||||
%client.player.throwStart = 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function ShapeBase::throwWeapon(%this)
|
||||
{
|
||||
if(Game.shapeThrowWeapon(%this)) {
|
||||
%image = %this.getMountedImage($WeaponSlot);
|
||||
%this.throw(%image.item);
|
||||
%this.client.setWeaponsHudItem(%image.item, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function ShapeBase::throwPack(%this)
|
||||
{
|
||||
%image = %this.getMountedImage($BackpackSlot);
|
||||
%this.throw(%image.item);
|
||||
%this.client.setBackpackHudItem(%image.item, 0);
|
||||
}
|
||||
|
||||
function ShapeBase::throw(%this,%data)
|
||||
{
|
||||
if(!isObject(%data))
|
||||
return false;
|
||||
|
||||
if (%this.inv[%data.getName()] > 0) {
|
||||
|
||||
// save off the ammo count on this item
|
||||
if( %this.getInventory( %data ) < $AmmoIncrement[%data.getName()] )
|
||||
%data.ammoStore = %this.getInventory( %data );
|
||||
else
|
||||
%data.ammoStore = $AmmoIncrement[%data.getName()];
|
||||
|
||||
// Throw item first...
|
||||
%this.throwItem(%data);
|
||||
if($AmmoIncrement[%data.getName()] !$= "")
|
||||
%this.decInventory(%data,$AmmoIncrement[%data.getName()]);
|
||||
else
|
||||
%this.decInventory(%data,1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function ShapeBase::use(%this, %data) {
|
||||
// if(%data.class $= "Weapon")
|
||||
// error("ShapeBase::use " @ %data);
|
||||
if(%data $= Grenade) {
|
||||
// Weapon modes
|
||||
|
||||
//[most] 'ey lets do some unification here.. :D
|
||||
if(%this.getMountedImage(0) && GetWord($weaponSettings1[%this.getMountedImage(0).getName()],0)) {
|
||||
if (!(GetSimTime() > (%this.grenadeModeTime + 100)))
|
||||
return;
|
||||
%this.grenadeModeTime = getSimTime(); //not 'that' unified.. ;)
|
||||
|
||||
return %this.getMountedImage(0).ChangeMode(%this,1,2); //looksie.. 2 stands for weapons (level 1)
|
||||
|
||||
}
|
||||
|
||||
//[most]
|
||||
|
||||
//start of modifier code
|
||||
if (%this.usingmodifier == 1 && getSimTime() > (%this.grenadeModeTime + 100) && %this.performing == 0) {
|
||||
%this.grenadeModeTime = getSimTime();
|
||||
%this.modifierMode2++;
|
||||
if (%this.modifierMode2 > getword($WeaponSetting2["modifier",%this.modifierMode],0))
|
||||
%this.modifierMode2 = 0;
|
||||
if (%this.modifierMode ==2)
|
||||
%line2 = getwords($packSetting["forcefield",%this.modifierMode2],5,19);
|
||||
else if (%this.modifierMode ==1)
|
||||
%line2 = getwords($WeaponSetting["modifier1",%this.modifierMode2],1,19);
|
||||
else if (%this.modifierMode ==3)
|
||||
%line2 = $WeaponSetting["modifier2",%this.modifierMode2];
|
||||
else if (%this.modifierMode ==4)
|
||||
%line2 = $WeaponSetting["modifier3",%this.modifierMode2];
|
||||
else if (%this.modifierMode ==5)
|
||||
%line2 = $WeaponSetting["modifier4",%this.modifierMode2];
|
||||
else
|
||||
%line2 = $WeaponSetting["modifier0",%this.modifierMode2];
|
||||
%line1 = $WeaponSetting2["modifier",%this.modifierMode];
|
||||
bottomPrint(%this.client,"Modifier Tool ["@ %line1 @" ] set to" SPC %line2,2,1);
|
||||
return;
|
||||
}
|
||||
//end of modifier modes
|
||||
|
||||
//start of MIST code
|
||||
if (%this.getMountedImage(0).getname() $= "MergeToolImage")
|
||||
{
|
||||
%this.client.MTSubMode++;
|
||||
if (%this.client.MTMode == 0 && %this.client.MTSubMode == 2)
|
||||
%this.client.MTSubMode = 0;
|
||||
if (%this.client.MTMode == 1 && %this.client.MTSubMode == 1)
|
||||
%this.client.MTSubMode = 0;
|
||||
if (%this.client.MTMode == 2 && %this.client.MTSubMode == 8)
|
||||
%this.client.MTSubMode = 0;
|
||||
|
||||
MTShowStatus(%this.client);
|
||||
return;
|
||||
}
|
||||
//end of MIST code
|
||||
|
||||
if (%this.usingConstructionTool == 1 && getSimTime() > (%this.grenadeModeTime + 100) && %this.performing == 0) {
|
||||
%this.grenadeModeTime = getSimTime();
|
||||
if (%this.constructionToolMode == 0) {
|
||||
if (%this.constructionToolMode2 == 1) {
|
||||
%this.constructionToolMode2 = 0;
|
||||
bottomPrint(%this.client,"Normal deconstruction",2,1);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%this.constructionToolMode2 = 1;
|
||||
bottomPrint(%this.client,"Cascading deconstruction",2,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (%this.constructionToolMode == 1) {
|
||||
if (%this.constructionToolMode2 == 1) {
|
||||
%this.constructionToolMode2 = 0;
|
||||
bottomPrint(%this.client,"Rotate push",2,1);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%this.constructionToolMode2 = 1;
|
||||
bottomPrint(%this.client,"Rotate pull",2,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (%this.constructionToolMode == 2) {
|
||||
if (%this.constructionToolMode2 == 5) {
|
||||
%this.constructionToolMode2 = 0;
|
||||
bottomPrint(%this.client,"Select target as center of rotation",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 0) {
|
||||
%this.constructionToolMode2 = 1;
|
||||
bottomPrint(%this.client,"Select objects to rotate",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 1) {
|
||||
%this.constructionToolMode2 = 2;
|
||||
bottomPrint(%this.client,"Select rotation speed",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 2) {
|
||||
%this.constructionToolMode2 = 3;
|
||||
bottomPrint(%this.client,"Apply rotation",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 3) {
|
||||
%this.constructionToolMode2 = 4;
|
||||
bottomPrint(%this.client,"Display selection",2,1);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%this.constructionToolMode2 = 5;
|
||||
bottomPrint(%this.client,"Clear list",2,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (%this.constructionToolMode2 == 3) {
|
||||
%this.constructionToolMode2 = 0;
|
||||
bottomPrint(%this.client,"Toggle generator power state",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 0) {
|
||||
%this.constructionToolMode2 = 1;
|
||||
bottomPrint(%this.client,"Increase current frequency",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.constructionToolMode2 == 1) {
|
||||
%this.constructionToolMode2 = 2;
|
||||
bottomPrint(%this.client,"Decrease current frequency",2,1);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%this.constructionToolMode2 = 3;
|
||||
bottomPrint(%this.client,"Read power state",2,1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%this.usingSuperChaingun == 1) {
|
||||
if (!(getSimTime() > (%this.grenadeModeTime + 100)))
|
||||
return;
|
||||
%this.grenadeModeTime = getSimTime();
|
||||
if (%this.superChaingunMode == 1) {
|
||||
if ($Ion::StopIon == 1) {
|
||||
$Ion::StopIon = 0;
|
||||
displaySCGStatus(%this);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
$Ion::StopIon = 1;
|
||||
displaySCGStatus(%this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// figure out which grenade type you're using
|
||||
for(%x = 0; $InvGrenade[%x] !$= ""; %x++) {
|
||||
if(%this.inv[$NameToInv[$InvGrenade[%x]]] > 0) {
|
||||
%data = $NameToInv[$InvGrenade[%x]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(%data $= "Backpack") {
|
||||
%pack = %this.getMountedImage($BackpackSlot);
|
||||
// if you don't have a pack but have placed a satchel charge, detonate it
|
||||
if(!%pack && (%this.thrownChargeId > 0) && %this.thrownChargeId.armed ) {
|
||||
if (!$Host::SatchelChargeEnabled) {
|
||||
if (isObject(%this.client)) {
|
||||
if ($Host::Purebuild == 1)
|
||||
messageAll('msgClient','\c2%1 just tried to detonate a Satchel Charge!',%this.client.name);
|
||||
else
|
||||
messageTeam(%this.client.team,'msgClient','\c2%1 just tried to detonate a Satchel Charge!',%this.client.name);
|
||||
%this.client.clearBackPackIcon();
|
||||
}
|
||||
%this.thrownChargeId.delete();
|
||||
%this.thrownChargeId = "0";
|
||||
return;
|
||||
}
|
||||
else {
|
||||
%this.playAudio( 0, SatchelChargeExplosionSound );
|
||||
schedule( 800, %this, "detonateSatchelCharge", %this );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if(%data $= Beacon) {
|
||||
%data.onUse(%this);
|
||||
if (%this.inv[%data.getName()] > 0)
|
||||
return true;
|
||||
}
|
||||
// Pack modes
|
||||
if (%data $= "RepairKit") {
|
||||
if ($Host::ExpertMode == 1) { // Only use in Expert Mode
|
||||
if (%this.hasForceField) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["forcefield"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["forcefield",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
//[most] Again using the unified plugin code. See item.cs for reference.
|
||||
else if(%this.getMountedImage(2) && GetWord($packSettings[%this.getMountedImage(2).getName()],0)) {
|
||||
%changed = %this.getMountedImage(2).ChangeMode(%this,1,1);
|
||||
return "";
|
||||
}
|
||||
//[most]
|
||||
else if (%this.hasGravField) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["gravfield"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["gravfield",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasFloor) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["floor"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["floor",%this.expertSet];
|
||||
bottomPrint(%this.client,"Floor set to" SPC %line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasBlast) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["blast"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["blast",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasWalk) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["walk"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["walk",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasMSpine) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["mspine"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["mspine",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasSwitch) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["switch"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["switch",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasTripwire) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["tripwire"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["tripwire",%this.expertSet];
|
||||
bottomPrint(%this.client,%line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasTree) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["tree"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["tree",%this.expertSet];
|
||||
bottomPrint(%this.client,"Tree set to " @ %line * 100 @ "% scale",2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasTele) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["telepad"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["telepad",%this.expertSet];
|
||||
bottomPrint(%this.client,"Telepad set to " @ %line,2,1);
|
||||
return;
|
||||
}
|
||||
else if (%this.hasDoor) {
|
||||
%this.expertSet++;
|
||||
if (%this.expertSet > $expertSettings["Door"])
|
||||
%this.expertSet = 0;
|
||||
%line = $expertSetting["Door",%this.expertSet];
|
||||
bottomPrint(%this.client,"Door close timeout:" SPC %line,2,1);
|
||||
return;
|
||||
}
|
||||
if (%this.getDamageLevel() != 0 && $Host::Purebuild == 1) {
|
||||
%this.applyRepair(0.2);
|
||||
messageClient(%this.client, 'MsgRepairKitUsed', '\c2Repair Kit Used.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Weapon modes
|
||||
if (%data $= "Mine") {
|
||||
|
||||
//[most] 'ey lets do some more unification here.. :D
|
||||
if(%this.getMountedImage(0) && GetWord($weaponSettings2[%this.getMountedImage(0).getName()],0)) {
|
||||
if(!GetSimTime() > (%this.grenadeModeTime + 100))
|
||||
return;
|
||||
%this.grenadeModeTime = getSimTime(); //not 'that' unified.. ;)
|
||||
|
||||
return %this.getMountedImage(0).ChangeMode(%this,1,3); //looksie.. 3 stands for weapons (level 2)
|
||||
}
|
||||
|
||||
//[most]
|
||||
//modifier tool
|
||||
if (%this.usingmodifier == 1 && getSimTime() > (%this.grenadeModeTime + 100) && %this.performing == 0) {
|
||||
%this.grenadeModeTime = getSimTime();
|
||||
%this.modifierMode++;
|
||||
if (%this.modifierMode > $WeaponSettings2["modifier"])
|
||||
%this.modifierMode = 0;
|
||||
%line = $WeaponSetting2["modifier",%this.modifierMode];
|
||||
//if (%this.modifierMode==5)
|
||||
// %line = $WeaponSetting2["modifier",%this.modifierMode];
|
||||
bottomPrint(%this.client,"Modifier tool " SPC getWords(%line,1,getWordCount(%line)) SPC "\nUse the Modifier Scaler options to change the Nudge/Scale rate.",10,3);
|
||||
return; //return to the top
|
||||
}
|
||||
//end modifier tool
|
||||
|
||||
//MIST tool
|
||||
if (%this.getMountedImage(0).getname() $= "MergeToolImage")
|
||||
{
|
||||
%this.client.MTMode++;
|
||||
%this.client.MTSubMode = 0;
|
||||
if (%this.client.MTMode >= 3)
|
||||
%this.client.MTMode = 0;
|
||||
|
||||
MTShowStatus(%this.client);
|
||||
return;
|
||||
}
|
||||
//end MIST tool
|
||||
|
||||
if (%this.usingConstructionTool == 1 && getSimTime() > (%this.mineModeTime + 100) && %this.performing == 0) {
|
||||
%this.mineModeTime = getSimTime();
|
||||
if (%this.constructionToolMode == 3) {
|
||||
%this.constructionToolMode = 0;
|
||||
bottomPrint(%this.client,"Construction Tool mode set to deconstruct",2,1);
|
||||
}
|
||||
else if (%this.constructionToolMode == 0 && $Host::Purebuild == 1) {
|
||||
%this.constructionToolMode = 1;
|
||||
bottomPrint(%this.client,"Construction Tool mode set to rotate",2,1);
|
||||
}
|
||||
else if (%this.constructionToolMode == 1 && $Host::Purebuild == 1) {
|
||||
%this.constructionToolMode = 2;
|
||||
bottomPrint(%this.client,"Construction Tool mode set to advanced rotate",2,1);
|
||||
}
|
||||
else {
|
||||
%powerFreq = %this.powerFreq;
|
||||
if (%powerFreq < 1 || %powerFreq > upperPowerFreq(%this) || !%powerFreq)
|
||||
%powerFreq = 1;
|
||||
%this.powerFreq = %powerFreq;
|
||||
%this.constructionToolMode = 3;
|
||||
bottomPrint(%this.client,"Construction Tool mode set to power management\nPower frequency currently set to: " @ %this.powerFreq,2,2);
|
||||
}
|
||||
%this.constructionToolMode2 = 0;
|
||||
return;
|
||||
}
|
||||
if (%this.usingSuperChaingun == 1) {
|
||||
if (!(getSimTime() > (%this.mineModeTime + 100)))
|
||||
return;
|
||||
%this.mineModeTime = getSimTime();
|
||||
%this.superChaingunMode++;
|
||||
if (%this.superChaingunMode > 6 - (5 * $host::nopulseSCG)) {
|
||||
%this.superChaingunMode = 0;
|
||||
}
|
||||
displaySCGStatus(%this);
|
||||
%this.superChaingunMode2 = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// default case
|
||||
if (isObject(%data)) {
|
||||
if (%this.inv[%data.getName()] > 0) {
|
||||
%data.onUse(%this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function ShapeBase::pickup(%this,%obj,%amount) {
|
||||
%data = %obj.getDatablock();
|
||||
%delta = %this.incInventory(%data,%amount);
|
||||
|
||||
if (%delta)
|
||||
%data.onPickup(%obj,%this,%delta);
|
||||
return %delta;
|
||||
}
|
||||
|
||||
function ShapeBase::hasInventory(%this, %data)
|
||||
{
|
||||
// changed because it was preventing weapons cycling correctly (MES)
|
||||
return (%this.inv[%data] > 0);
|
||||
}
|
||||
|
||||
function ShapeBase::maxInventory(%this,%data) {
|
||||
if($TestCheats && %this.getDatablock().max[%data.getName()] !$= "")
|
||||
return 999;
|
||||
else
|
||||
return %this.getDatablock().max[%data.getName()];
|
||||
}
|
||||
|
||||
function ShapeBase::incInventory(%this,%data,%amount) {
|
||||
%max = %this.maxInventory(%data);
|
||||
%cv = %this.inv[%data.getName()];
|
||||
if (%cv < %max) {
|
||||
if (%cv + %amount > %max)
|
||||
%amount = %max - %cv;
|
||||
%this.setInventory(%data,%cv + %amount);
|
||||
%data.incCatagory(%this); // Inc the players weapon count
|
||||
return %amount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function ShapeBase::decInventory(%this,%data,%amount)
|
||||
{
|
||||
%name = %data.getName();
|
||||
%cv = %this.inv[%name];
|
||||
if (%cv > 0) {
|
||||
if (%cv < %amount)
|
||||
%amount = %cv;
|
||||
%this.setInventory(%data,%cv - %amount, true);
|
||||
%data.decCatagory(%this); // Dec the players weapon count
|
||||
return %amount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function SimObject::decCatagory(%this)
|
||||
{
|
||||
//function was added to reduce console err msg spam
|
||||
}
|
||||
|
||||
function SimObject::incCatagory(%this)
|
||||
{
|
||||
//function was added to reduce console err msg spam
|
||||
}
|
||||
|
||||
function ShapeBase::setInventory(%this,%data,%value,%force)
|
||||
{
|
||||
if (!isObject(%data))
|
||||
return;
|
||||
|
||||
%name = %data.getName();
|
||||
if (%value < 0)
|
||||
%value = 0;
|
||||
else
|
||||
{
|
||||
if (!%force)
|
||||
{
|
||||
// Impose inventory limits
|
||||
%max = %this.maxInventory(%data);
|
||||
if (%value > %max)
|
||||
%value = %max;
|
||||
}
|
||||
}
|
||||
if (%this.inv[%name] != %value)
|
||||
{
|
||||
%this.inv[%name] = %value;
|
||||
%data.onInventory(%this,%value);
|
||||
|
||||
if ( %data.className $= "Weapon" )
|
||||
{
|
||||
if ( %this.weaponSlotCount $= "" )
|
||||
%this.weaponSlotCount = 0;
|
||||
|
||||
%cur = -1;
|
||||
for ( %slot = 0; %slot < %this.weaponSlotCount; %slot++ )
|
||||
{
|
||||
if ( %this.weaponSlot[%slot] $= %name )
|
||||
{
|
||||
%cur = %slot;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( %cur == -1 )
|
||||
{
|
||||
// Put this weapon in the next weapon slot:
|
||||
if ( %this.weaponSlot[%this.weaponSlotCount - 1] $= "TargetingLaser" )
|
||||
{
|
||||
%this.weaponSlot[%this.weaponSlotCount - 1] = %name;
|
||||
%this.weaponSlot[%this.weaponSlotCount] = "TargetingLaser";
|
||||
}
|
||||
else
|
||||
%this.weaponSlot[%this.weaponSlotCount] = %name;
|
||||
%this.weaponSlotCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove the weapon from the weapon slot:
|
||||
for ( %i = %cur; %i < %this.weaponSlotCount - 1; %i++ )
|
||||
%this.weaponSlot[%i] = %this.weaponSlot[%i + 1];
|
||||
%this.weaponSlot[%i] = "";
|
||||
%this.weaponSlotCount--;
|
||||
}
|
||||
}
|
||||
|
||||
%this.getDataBlock().onInventory(%data,%value);
|
||||
}
|
||||
return %value;
|
||||
}
|
||||
|
||||
function ShapeBase::getInventory(%this,%data)
|
||||
{
|
||||
if ( isObject( %data ) )
|
||||
return( %this.inv[%data.getName()] );
|
||||
else
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
// z0dd - ZOD, 9/13/02. Streamlined.
|
||||
function ShapeBase::hasAmmo( %this, %weapon )
|
||||
{
|
||||
if(%weapon $= LaserRifle)
|
||||
return( %this.getInventory( EnergyPack ) );
|
||||
|
||||
if (%weapon.image.ammo $= "")
|
||||
{
|
||||
if (%weapon $= TargetingLaser)
|
||||
{
|
||||
return( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( true );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return( %this.getInventory( %weapon.image.ammo ) > 0 );
|
||||
}
|
||||
}
|
||||
|
||||
function SimObject::onInventory(%this, %obj)
|
||||
{
|
||||
//function was added to reduce console error msg spam
|
||||
}
|
||||
|
||||
function ShapeBase::throwItem(%this,%data)
|
||||
{
|
||||
%item = new Item() {
|
||||
dataBlock = %data;
|
||||
rotation = "0 0 1 " @ (getRandom() * 360);
|
||||
};
|
||||
|
||||
%item.ammoStore = %data.ammoStore;
|
||||
MissionCleanup.add(%item);
|
||||
%this.throwObject(%item);
|
||||
}
|
||||
|
||||
function ShapeBase::throwObject(%this,%obj)
|
||||
{
|
||||
//-------------------------------------------
|
||||
// z0dd - ZOD, 5/27/02. Fixes flags hovering
|
||||
// over friendly player when collision occurs
|
||||
if(%obj.getDataBlock().getName() $= "Flag")
|
||||
%obj.static = false;
|
||||
//-------------------------------------------
|
||||
|
||||
//if the object is being thrown by a corpse, use a random vector
|
||||
if (%this.getState() $= "Dead")
|
||||
{
|
||||
%vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom();
|
||||
%vec = vectorScale(%vec, 10);
|
||||
}
|
||||
|
||||
// else Initial vel based on the dir the player is looking
|
||||
else
|
||||
{
|
||||
%eye = %this.getEyeVector();
|
||||
%vec = vectorScale(%eye, 20);
|
||||
}
|
||||
|
||||
// Add a vertical component to give the item a better arc
|
||||
%dot = vectorDot("0 0 1",%eye);
|
||||
if (%dot < 0)
|
||||
%dot = -%dot;
|
||||
%vec = vectorAdd(%vec,vectorScale("0 0 8",1 - %dot));
|
||||
|
||||
// Add player's velocity
|
||||
%vec = vectorAdd(%vec,%this.getVelocity());
|
||||
%pos = getBoxCenter(%this.getWorldBox());
|
||||
|
||||
//since flags have a huge mass (so when you shoot them, they don't bounce too far)
|
||||
//we need to up the %vec so that you can still throw them...
|
||||
if (%obj.getDataBlock().getName() $= "Flag")
|
||||
%vec = vectorScale(%vec, 40);
|
||||
|
||||
//
|
||||
%obj.setTransform(%pos);
|
||||
%obj.applyImpulse(%pos,%vec);
|
||||
%obj.setCollisionTimeout(%this);
|
||||
%data = %obj.getDatablock();
|
||||
%data.onThrow(%obj,%this);
|
||||
|
||||
//call the AI hook
|
||||
AIThrowObject(%obj);
|
||||
}
|
||||
|
||||
function ShapeBase::clearInventory(%this)
|
||||
{
|
||||
%this.setInventory(RepairKit,0);
|
||||
|
||||
%this.setInventory(Mine,0);
|
||||
//%this.setInventory(MineAir,0);
|
||||
//%this.setInventory(MineLand,0);
|
||||
//%this.setInventory(MineSticky,0);
|
||||
%this.setInventory(ConstructionTool,0);
|
||||
%this.setInventory(MergeTool,0);
|
||||
%this.setInventory(Grenade,0);
|
||||
%this.setInventory(FlashGrenade,0);
|
||||
%this.setInventory(ConcussionGrenade,0);
|
||||
%this.setInventory(FlareGrenade,0);
|
||||
%this.setInventory(CameraGrenade, 0);
|
||||
|
||||
%this.setInventory(Blaster,0);
|
||||
%this.setInventory(Plasma,0);
|
||||
%this.setInventory(Disc,0);
|
||||
%this.setInventory(Chaingun, 0);
|
||||
%this.setInventory(Mortar, 0);
|
||||
%this.setInventory(GrenadeLauncher, 0);
|
||||
%this.setInventory(MissileLauncher, 0);
|
||||
%this.setInventory(SniperRifle, 0);
|
||||
%this.setInventory(TargetingLaser, 0);
|
||||
%this.setInventory(ELFGun, 0);
|
||||
%this.setInventory(ShockLance, 0);
|
||||
|
||||
%this.setInventory(PlasmaAmmo,0);
|
||||
%this.setInventory(ChaingunAmmo, 0);
|
||||
%this.setInventory(DiscAmmo, 0);
|
||||
%this.setInventory(GrenadeLauncherAmmo, 0);
|
||||
%this.setInventory(MissileLauncherAmmo, 0);
|
||||
%this.setInventory(MortarAmmo, 0);
|
||||
%this.setInventory(Beacon, 0);
|
||||
|
||||
%this.setInventory(NerfGun, 0);
|
||||
%this.setInventory(NerfBallLauncher, 0);
|
||||
%this.setInventory(NerfBallLauncherAmmo, 0);
|
||||
%this.setInventory(SuperChaingun, 0);
|
||||
%this.setInventory(SuperChaingunAmmo, 0);
|
||||
%this.setInventory(MergeTool,0);
|
||||
|
||||
%this.setInventory(TractorGun, 0);
|
||||
%this.setInventory(TransGun, 0);
|
||||
|
||||
// take away any pack the player has
|
||||
%curPack = %this.getMountedImage($BackpackSlot);
|
||||
if(%curPack > 0)
|
||||
%this.setInventory(%curPack.item, 0);
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
function ShapeBase::cycleWeapon( %this, %data )
|
||||
{
|
||||
if ( %this.weaponSlotCount == 0 )
|
||||
return;
|
||||
|
||||
%slot = -1;
|
||||
if ( %this.getMountedImage($WeaponSlot) != 0 )
|
||||
{
|
||||
%curWeapon = %this.getMountedImage($WeaponSlot).item.getName();
|
||||
for ( %i = 0; %i < %this.weaponSlotCount; %i++ )
|
||||
{
|
||||
//error("curWeaponName == " @ %curWeaponName);
|
||||
if ( %curWeapon $= %this.weaponSlot[%i] )
|
||||
{
|
||||
%slot = %i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( %data $= "prev" )
|
||||
{
|
||||
// Previous weapon...
|
||||
if ( %slot == 0 || %slot == -1 )
|
||||
{
|
||||
%i = %this.weaponSlotCount - 1;
|
||||
%slot = 0;
|
||||
}
|
||||
else
|
||||
%i = %slot - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Next weapon...
|
||||
if ( %slot == ( %this.weaponSlotCount - 1 ) || %slot == -1 )
|
||||
{
|
||||
%i = 0;
|
||||
%slot = ( %this.weaponSlotCount - 1 );
|
||||
}
|
||||
else
|
||||
%i = %slot + 1;
|
||||
}
|
||||
|
||||
%newSlot = -1;
|
||||
while ( %i != %slot )
|
||||
{
|
||||
if ( %this.weaponSlot[%i] !$= ""
|
||||
&& %this.hasInventory( %this.weaponSlot[%i] )
|
||||
&& %this.hasAmmo( %this.weaponSlot[%i] ) )
|
||||
{
|
||||
// player has this weapon and it has ammo or doesn't need ammo
|
||||
%newSlot = %i;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( %data $= "prev" )
|
||||
{
|
||||
if ( %i == 0 )
|
||||
%i = %this.weaponSlotCount - 1;
|
||||
else
|
||||
%i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( %i == ( %this.weaponSlotCount - 1 ) )
|
||||
%i = 0;
|
||||
else
|
||||
%i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( %newSlot != -1 )
|
||||
%this.use( %this.weaponSlot[%newSlot] );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
function ShapeBase::selectWeaponSlot( %this, %data )
|
||||
{
|
||||
if ( %data < 0 || %data > %this.weaponSlotCount
|
||||
|| %this.weaponSlot[%data] $= "" || %this.weaponSlot[%data] $= "TargetingLaser" )
|
||||
return;
|
||||
|
||||
%this.use( %this.weaponSlot[%data] );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function serverCmdGiveAll(%client)
|
||||
{
|
||||
if($TestCheats)
|
||||
{
|
||||
%player = %client.player;
|
||||
%player.setInventory(RepairKit,999);
|
||||
%player.setInventory(Mine,999);
|
||||
//%player.setInventory(MineAir,999);
|
||||
//%player.setInventory(MineLand,999);
|
||||
//%player.setInventory(MineSticky,999);
|
||||
%player.setInventory(Grenade,999);
|
||||
%player.setInventory(FlashGrenade,999);
|
||||
%player.setInventory(FlareGrenade,999);
|
||||
%player.setInventory(ConcussionGrenade,999);
|
||||
%player.setInventory(CameraGrenade, 999);
|
||||
%player.setInventory(Blaster,1);
|
||||
%player.setInventory(Plasma,1);
|
||||
%player.setInventory(Chaingun, 1);
|
||||
%player.setInventory(Disc,1);
|
||||
%player.setInventory(GrenadeLauncher, 1);
|
||||
%player.setInventory(SniperRifle, 1);
|
||||
%player.setInventory(ELFGun, 1);
|
||||
%player.setInventory(Mortar, 1);
|
||||
%player.setInventory(MissileLauncher, 1);
|
||||
%player.setInventory(ShockLance, 1);
|
||||
%player.setInventory(TargetingLaser, 1);
|
||||
%player.setInventory(MissileLauncherAmmo, 999);
|
||||
%player.setInventory(GrenadeLauncherAmmo, 999);
|
||||
%player.setInventory(MortarAmmo, 999);
|
||||
%player.setInventory(PlasmaAmmo,999);
|
||||
%player.setInventory(ChaingunAmmo, 999);
|
||||
%player.setInventory(DiscAmmo, 999);
|
||||
%player.setInventory(Beacon, 999);
|
||||
|
||||
%player.setInventory(NerfGun,1);
|
||||
%player.setInventory(NerfBallLauncher,1);
|
||||
%player.setInventory(NerfBallLauncherAmmo,999);
|
||||
%player.setInventory(MergeTool,1);
|
||||
|
||||
%player.setInventory(TractorGun, 1);
|
||||
%player.setInventory(TransGun, 1);
|
||||
}
|
||||
}
|
||||
1618
scripts/inventoryHud.cs
Executable file
1618
scripts/inventoryHud.cs
Executable file
File diff suppressed because it is too large
Load diff
1012
scripts/ion.cs
Executable file
1012
scripts/ion.cs
Executable file
File diff suppressed because it is too large
Load diff
1106
scripts/item.cs
Executable file
1106
scripts/item.cs
Executable file
File diff suppressed because it is too large
Load diff
373
scripts/libraries.cs
Executable file
373
scripts/libraries.cs
Executable file
|
|
@ -0,0 +1,373 @@
|
|||
//Contain basic data libraries.
|
||||
//Soon to be updated with more usefull stuff.
|
||||
|
||||
// NOTE - any changes here must be considered in expertlibraries.cs !!!
|
||||
|
||||
//** New format of information **
|
||||
|
||||
$packSettings["spine"] = 7;
|
||||
$packSetting["spine",0] = "0.5 0.5 1.5 1.5 meters in height";
|
||||
$packSetting["spine",1] = "0.5 0.5 4 4 meters in height";
|
||||
$packSetting["spine",2] = "0.5 0.5 8 8 meters in height";
|
||||
$packSetting["spine",3] = "0.5 0.5 40 40 meters in height";
|
||||
$packSetting["spine",4] = "0.5 0.5 160 160 meters in height";
|
||||
$packSetting["spine",5] = "0.5 6 160 auto adjusting";
|
||||
$packSetting["spine",6] = "0.5 8 160 pad";
|
||||
$packSetting["spine",7] = "0.5 8 160 wooden pad";
|
||||
|
||||
$packSettings["mspine"] = 7;
|
||||
$packSetting["mspine",0] = "1 1 1 2 2 0.5 1 meters in height";
|
||||
$packSetting["mspine",1] = "1 1 4 2 2 0.5 4 meters in height";
|
||||
$packSetting["mspine",2] = "1 1 8 2 2 0.5 8 meters in height";
|
||||
$packSetting["mspine",3] = "1 1 40 2 2 0.5 40 meters in height";
|
||||
$packSetting["mspine",4] = "1 1 160 2 2 0.5 160 meters in height";
|
||||
$packSetting["mspine",5] = "1 8 160 2 2 0.5 auto adjusting";
|
||||
$packSetting["mspine",6] = "1 6 160 2 2 0.5 normal rings";
|
||||
$packSetting["mspine",7] = "1 8 160 8 8 0.5 platform rings";
|
||||
|
||||
$expertSettings["mspine"] = 1;
|
||||
$expertSetting["mspine",0] = "Rings disabled";
|
||||
$expertSetting["mspine",1] = "Rings enabled";
|
||||
|
||||
$packSettings["floor"] = 5;
|
||||
$packSetting["floor",0] = "10 10 20 10 10 10 10 meters wide";
|
||||
$packSetting["floor",1] = "20 20 20 20 20 20 20 meters wide";
|
||||
$packSetting["floor",2] = "30 30 20 30 30 30 30 meters wide";
|
||||
$packSetting["floor",3] = "40 40 20 40 40 40 40 meters wide";
|
||||
$packSetting["floor",4] = "50 50 20 50 50 50 50 meters wide";
|
||||
$packSetting["floor",5] = "60 60 20 60 60 60 60 meters wide";
|
||||
|
||||
$expertSettings["floor"] = 4;
|
||||
$expertSetting["floor",0] = "1.5 meters in height";
|
||||
$expertSetting["floor",1] = "5 meters in height";
|
||||
$expertSetting["floor",2] = "10 meters in height";
|
||||
$expertSetting["floor",3] = "20 meters in height";
|
||||
$expertSetting["floor",4] = "40 meters in height";
|
||||
|
||||
$packSettings["walk"] = 12;
|
||||
$packSetting["walk",0] = "0 flat";
|
||||
$packSetting["walk",1] = "5 Sloped 5 degrees up";
|
||||
$packSetting["walk",2] = "10 Sloped 10 degrees up";
|
||||
$packSetting["walk",3] = "20 Sloped 20 degrees up";
|
||||
$packSetting["walk",4] = "45 Sloped 45 degrees up";
|
||||
$packSetting["walk",5] = "60 Sloped 60 degrees up";
|
||||
$packSetting["walk",6] = "90 Sloped 90 degrees up";
|
||||
$packSetting["walk",7] = "-5 Sloped 5 degrees down";
|
||||
$packSetting["walk",8] = "-10 Sloped 10 degrees down";
|
||||
$packSetting["walk",9] = "-20 Sloped 20 degrees down";
|
||||
$packSetting["walk",10] = "-45 Sloped 45 degrees down";
|
||||
$packSetting["walk",11] = "-60 Sloped 60 degrees down";
|
||||
$packSetting["walk",12] = "-90 Sloped 90 degrees down";
|
||||
|
||||
$expertSettings["walk"] = 3;
|
||||
$expertSetting["walk",0] = "Normal walkway";
|
||||
$expertSetting["walk",1] = "No-flicker walkway";
|
||||
$expertSetting["walk",2] = "Double width walkway";
|
||||
$expertSetting["walk",3] = "Double height walkway";
|
||||
|
||||
$packSettings["blast"] = 3;
|
||||
$packSetting["blast",0] = "deploy from inside";
|
||||
$packSetting["blast",1] = "deploy in frame";
|
||||
$packSetting["blast",2] = "deploy from outside";
|
||||
$packSetting["blast",3] = "deploy full thickness";
|
||||
|
||||
$expertSettings["blast"] = 1;
|
||||
$expertSetting["blast",0] = "Normal Blast Wall";
|
||||
$expertSetting["blast",1] = "Multiple Blast Walls";
|
||||
|
||||
$packSettings["forcefield"] = 20;
|
||||
$packSetting["forcefield",0] = "0.5 8 160 (7) Force field set to <color:ffffff>solid <color:ffffff>white";
|
||||
$packSetting["forcefield",1] = "0.5 8 160 (6) Force field set to <color:ffffff>solid <color:ff4444> red";
|
||||
$packSetting["forcefield",2] = "0.5 8 160 (5) Force field set to <color:ffffff>solid <color:44ff44> green";
|
||||
$packSetting["forcefield",3] = "0.5 8 160 (4) Force field set to <color:ffffff>solid <color:4444ff> blue";
|
||||
$packSetting["forcefield",4] = "0.5 8 160 (3) Force field set to <color:ffffff>solid <color:44ffff> cyan";
|
||||
$packSetting["forcefield",5] = "0.5 8 160 (2) Force field set to <color:ffffff>solid <color:ff44ff> magenta";
|
||||
$packSetting["forcefield",6] = "0.5 8 160 (1) Force field set to <color:ffffff>solid <color:ffff44> yellow";
|
||||
$packSetting["forcefield",7] = "0.5 8 160 (7) Force field set to <color:44ff44>team-pass <color:ffffff>white";
|
||||
$packSetting["forcefield",8] = "0.5 8 160 (6) Force field set to <color:44ff44>team-pass <color:ff4444> red";
|
||||
$packSetting["forcefield",9] = "0.5 8 160 (5) Force field set to <color:44ff44>team-pass <color:44ff44> green";
|
||||
$packSetting["forcefield",10] = "0.5 8 160 (4) Force field set to <color:44ff44>team-pass <color:4444ff> blue";
|
||||
$packSetting["forcefield",11] = "0.5 8 160 (3) Force field set to <color:44ff44>team-pass <color:44ffff> cyan";
|
||||
$packSetting["forcefield",12] = "0.5 8 160 (2) Force field set to <color:44ff44>team-pass <color:ff44ff> magenta";
|
||||
$packSetting["forcefield",13] = "0.5 8 160 (1) Force field set to <color:44ff44>team-pass <color:ffff44> yellow";
|
||||
$packSetting["forcefield",14] = "0.5 8 160 (7) Force field set to <color:ff4444>all-pass <color:ffffff>white";
|
||||
$packSetting["forcefield",15] = "0.5 8 160 (6) Force field set to <color:ff4444>all-pass <color:ff4444> red";
|
||||
$packSetting["forcefield",16] = "0.5 8 160 (5) Force field set to <color:ff4444>all-pass <color:44ff44> green";
|
||||
$packSetting["forcefield",17] = "0.5 8 160 (4) Force field set to <color:ff4444>all-pass <color:4444ff> blue";
|
||||
$packSetting["forcefield",18] = "0.5 8 160 (3) Force field set to <color:ff4444>all-pass <color:44ffff> cyan";
|
||||
$packSetting["forcefield",19] = "0.5 8 160 (2) Force field set to <color:ff4444>all-pass <color:ff44ff> magenta";
|
||||
$packSetting["forcefield",20] = "0.5 8 160 (1) Force field set to <color:ff4444>all-pass <color:ffff44> yellow";
|
||||
|
||||
$expertSettings["forcefield"] = 3;
|
||||
$expertSetting["forcefield",0] = "Normal force field";
|
||||
$expertSetting["forcefield",1] = "Cubic-replace force field";
|
||||
$expertSetting["forcefield",2] = "Normal force field - no slowdown";
|
||||
$expertSetting["forcefield",3] = "Cubic-replace force field - no slowdown";
|
||||
|
||||
$packSettings["gravfield"] = 4;
|
||||
$packSetting["gravfield",0] = "4.25 8 500 normal slow";
|
||||
$packSetting["gravfield",1] = "4.25 8 500 normal fast";
|
||||
$packSetting["gravfield",2] = "4.25 8 500 reverse slow";
|
||||
$packSetting["gravfield",3] = "4.25 8 500 reverse fast";
|
||||
$packSetting["gravfield",4] = "4.25 8 500 zero gravity";
|
||||
//
|
||||
$packSetting["gravfield",5] = "4.25 8 500 fastfield";
|
||||
$packSetting["gravfield",6] = "4.25 8 500 super fastfield";
|
||||
|
||||
$expertSettings["gravfield"] = 2;
|
||||
$expertSetting["gravfield",0] = "Normal gravity field";
|
||||
$expertSetting["gravfield",1] = "Cubic-replace gravity field (player's orientation)";
|
||||
$expertSetting["gravfield",2] = "Cubic-replace gravity field (object's orientation)";
|
||||
|
||||
$packSettings["jumpad"] = 3;
|
||||
$packSetting["jumpad",0] = "1000 10 boost";
|
||||
$packSetting["jumpad",1] = "2500 25 boost";
|
||||
$packSetting["jumpad",2] = "5000 50 boost";
|
||||
$packSetting["jumpad",3] = "10000 100 boost";
|
||||
|
||||
$packSettings["tree"] = 13;
|
||||
$packSetting["tree",0] = "normal 1";
|
||||
$packSetting["tree",1] = "normal 2";
|
||||
$packSetting["tree",2] = "normal 3";
|
||||
$packSetting["tree",3] = "normal 4";
|
||||
$packSetting["tree",4] = "greywood 1";
|
||||
$packSetting["tree",5] = "greywood 2";
|
||||
$packSetting["tree",6] = "greywood 3";
|
||||
$packSetting["tree",7] = "greywood 4";
|
||||
$packSetting["tree",8] = "greywood 5";
|
||||
$packSetting["tree",9] = "cactus 1";
|
||||
$packSetting["tree",10] = "cactus 2";
|
||||
$packSetting["tree",11] = "misc 1";
|
||||
$packSetting["tree",12] = "misc 2";
|
||||
$packSetting["tree",13] = "pod 1";
|
||||
|
||||
$expertSettings["tree"] = 14;
|
||||
$expertSetting["tree",0] = "0.0625";
|
||||
$expertSetting["tree",1] = "0.125";
|
||||
$expertSetting["tree",2] = "0.25";
|
||||
$expertSetting["tree",3] = "0.5";
|
||||
$expertSetting["tree",4] = "0.75";
|
||||
$expertSetting["tree",5] = "1";
|
||||
$expertSetting["tree",6] = "2";
|
||||
$expertSetting["tree",7] = "3";
|
||||
$expertSetting["tree",8] = "4";
|
||||
$expertSetting["tree",9] = "5";
|
||||
$expertSetting["tree",10] = "6";
|
||||
$expertSetting["tree",11] = "7";
|
||||
$expertSetting["tree",12] = "8";
|
||||
$expertSetting["tree",13] = "9";
|
||||
$expertSetting["tree",14] = "10";
|
||||
|
||||
$packSettings["crate"] = 12;
|
||||
$packSetting["crate",0] = "(1) back pack";
|
||||
$packSetting["crate",1] = "(2) small containment";
|
||||
$packSetting["crate",2] = "(3) large containment";
|
||||
$packSetting["crate",3] = "(4) compressor";
|
||||
$packSetting["crate",4] = "(5) tubes";
|
||||
$packSetting["crate",5] = "(6) quantum battery";
|
||||
$packSetting["crate",6] = "(7) proton accelerator";
|
||||
$packSetting["crate",7] = "(8) cargo crate";
|
||||
$packSetting["crate",8] = "(9) magnetic cooler";
|
||||
$packSetting["crate",9] = "(10) recycle unit";
|
||||
$packSetting["crate",10] = "(11) fuel cannister";
|
||||
$packSetting["crate",11] = "(12) wooden T2 box";
|
||||
$packSetting["crate",12] = "(13) plasma router";
|
||||
|
||||
$packSettings["decoration"] = 15;
|
||||
$packSetting["decoration",0] = "(1) banner unity";
|
||||
$packSetting["decoration",1] = "(2) banner strength";
|
||||
$packSetting["decoration",2] = "(3) banner honor";
|
||||
$packSetting["decoration",3] = "(4) dead light armor";
|
||||
$packSetting["decoration",4] = "(5) dead medium armor";
|
||||
$packSetting["decoration",5] = "(6) dead heavy armor";
|
||||
$packSetting["decoration",6] = "(7) statue base";
|
||||
$packSetting["decoration",7] = "(8) light male statue";
|
||||
$packSetting["decoration",8] = "(9) light female statue";
|
||||
$packSetting["decoration",9] = "(10) heavy male statue";
|
||||
$packSetting["decoration",10] = "(11) beowulf wreck";
|
||||
$packSetting["decoration",11] = "(12) shrike wreck";
|
||||
$packSetting["decoration",12] = "(13) billboard 1";
|
||||
$packSetting["decoration",13] = "(14) billboard 2";
|
||||
$packSetting["decoration",14] = "(15) billboard 3";
|
||||
$packSetting["decoration",15] = "(16) billboard 4";
|
||||
|
||||
$packSettings["logoprojector"] = 7;
|
||||
$packSetting["logoprojector",0] = "your teams logo";
|
||||
$packSetting["logoprojector",1] = "Storm";
|
||||
$packSetting["logoprojector",2] = "Inferno";
|
||||
$packSetting["logoprojector",3] = "Starwolf";
|
||||
$packSetting["logoprojector",4] = "Diamond Sword";
|
||||
$packSetting["logoprojector",5] = "Blood Eagle";
|
||||
$packSetting["logoprojector",6] = "Phoenix";
|
||||
$packSetting["logoprojector",7] = "Bioderm";
|
||||
|
||||
$packSettings["switch"] = 6;
|
||||
$packSetting["switch",0] = "5";
|
||||
$packSetting["switch",1] = "10";
|
||||
$packSetting["switch",2] = "25";
|
||||
$packSetting["switch",3] = "50";
|
||||
$packSetting["switch",4] = "100";
|
||||
$packSetting["switch",5] = "150";
|
||||
$packSetting["switch",6] = "200";
|
||||
|
||||
$expertSettings["switch"] = 4;
|
||||
$expertSetting["switch",0] = "Normal switch";
|
||||
$expertSetting["switch",1] = "Timed switch on";
|
||||
$expertSetting["switch",2] = "Timed switch off";
|
||||
$expertSetting["switch",3] = "Item Toggled";
|
||||
$expertSetting["switch",4] = "Item Toggled [Disposal]";
|
||||
|
||||
$packSettings["light"] = 13;
|
||||
$packSetting["light",0] = "(7) <color:ffffff>white";
|
||||
$packSetting["light",1] = "(6) <color:ff4444>red";
|
||||
$packSetting["light",2] = "(5) <color:44ff44>green";
|
||||
$packSetting["light",3] = "(4) <color:4444ff>blue";
|
||||
$packSetting["light",4] = "(3) <color:44ffff>cyan";
|
||||
$packSetting["light",5] = "(2) <color:ff44ff>magenta";
|
||||
$packSetting["light",6] = "(1) <color:ffff44>yellow";
|
||||
$packSetting["light",7] = "(7) strobe <color:ffffff>white";
|
||||
$packSetting["light",8] = "(6) strobe <color:ff4444>red";
|
||||
$packSetting["light",9] = "(5) strobe <color:44ff44>green";
|
||||
$packSetting["light",10] = "(4) strobe <color:4444ff>blue";
|
||||
$packSetting["light",11] = "(3) strobe <color:44ffff>cyan";
|
||||
$packSetting["light",12] = "(2) strobe <color:ff44ff>magenta";
|
||||
$packSetting["light",13] = "(1) strobe <color:ffff44>yellow";
|
||||
|
||||
$packSettings["Door"] = 7;
|
||||
$packSetting["Door",0] = "Normal Door";
|
||||
$packSetting["Door",1] = "Toggle Door";
|
||||
$packSetting["Door",2] = "Power Change Normal Door";
|
||||
$packSetting["Door",3] = "Power Change Toggle Door";
|
||||
$packSetting["Door",4] = "contact door";
|
||||
$packSetting["Door",5] = "contact door owner door";
|
||||
$packSetting["Door",6] = "contact door admin door";
|
||||
$packSetting["Door",7] = "contact door if powered will be locked";
|
||||
|
||||
$expertSettings["Door"] = 5;
|
||||
$expertSetting["Door",0] = "0 Seconds";
|
||||
$expertSetting["Door",1] = "0.5 Seconds";
|
||||
$expertSetting["Door",2] = "1 Second";
|
||||
$expertSetting["Door",3] = "2 Seconds";
|
||||
$expertSetting["Door",4] = "3 Seconds";
|
||||
$expertSetting["Door",5] = "4 Seconds";
|
||||
|
||||
$packSettings["tripwire"] = 13;
|
||||
$packSetting["tripwire",0] = "5 0";
|
||||
$packSetting["tripwire",1] = "10 0";
|
||||
$packSetting["tripwire",2] = "25 0";
|
||||
$packSetting["tripwire",3] = "50 0";
|
||||
$packSetting["tripwire",4] = "100 0";
|
||||
$packSetting["tripwire",5] = "150 0";
|
||||
$packSetting["tripwire",6] = "200 0";
|
||||
$packSetting["tripwire",7] = "5 1";
|
||||
$packSetting["tripwire",8] = "10 1";
|
||||
$packSetting["tripwire",9] = "25 1";
|
||||
$packSetting["tripwire",10] = "50 1";
|
||||
$packSetting["tripwire",11] = "100 1";
|
||||
$packSetting["tripwire",12] = "150 1";
|
||||
$packSetting["tripwire",13] = "200 1";
|
||||
|
||||
$expertSettings["tripwire"] = 5;
|
||||
$expertSetting["tripwire",0] = "Normal toggle on";
|
||||
$expertSetting["tripwire",1] = "Normal toggle off";
|
||||
$expertSetting["tripwire",2] = "Only turn on";
|
||||
$expertSetting["tripwire",3] = "Only turn off";
|
||||
$expertSetting["tripwire",4] = "Timed turn off";
|
||||
$expertSetting["tripwire",5] = "Timed turn on";
|
||||
|
||||
$packSettings["escapepod"] = 7;
|
||||
$packSetting["escapepod",0] = "1875"; // 12.25%
|
||||
$packSetting["escapepod",1] = "3750"; // 25%
|
||||
$packSetting["escapepod",2] = "5625"; // 37.5%
|
||||
$packSetting["escapepod",3] = "7500"; // 50%
|
||||
$packSetting["escapepod",4] = "9375"; // 62.5%
|
||||
$packSetting["escapepod",5] = "11250"; // 75%
|
||||
$packSetting["escapepod",6] = "13125"; // 87.5%
|
||||
$packSetting["escapepod",7] = "15000"; // 100%
|
||||
|
||||
$expertSettings["telepad"] = 3;
|
||||
$expertSetting["telepad",0] = "team only";
|
||||
$expertSetting["telepad",1] = "any team";
|
||||
$expertSetting["telepad",2] = "only transmit";
|
||||
$expertSetting["telepad",3] = "only receive";
|
||||
|
||||
$packSettings["missilerack"] = 1;
|
||||
$packSetting["missilerack",0] = "dumbfire missiles";
|
||||
$packSetting["missilerack",1] = "seeking missiles";
|
||||
|
||||
$packSettings["VehiclePadPack"] = 2;
|
||||
$packSetting["VehiclePadPack",0] = "Regular Vehicle Pad";
|
||||
$packSetting["VehiclePadPack",1] = "Modern Vehicle Pad";
|
||||
$packSetting["VehiclePadPack",2] = "Zigma's Smoke Shack";
|
||||
|
||||
|
||||
//i modified the weapon mode change to work more like the pack settings
|
||||
//easyer to edit and work whit
|
||||
$WeaponSettings["modifier0"] = 0;
|
||||
$WeaponSetting["modifier0",0] = "merge pieces";
|
||||
|
||||
$WeaponSettings["modifier1"] = 18;
|
||||
$WeaponSetting["modifier1",0] = "DeployedSpine lsb";//0.125 0.166666 1
|
||||
$WeaponSetting["modifier1",1] = "DeployedMSpine msb";//0.125 0.166666 1
|
||||
$WeaponSetting["modifier1",2] = "DeployedwWall WalkWay";//0.125 0.166666 1
|
||||
$WeaponSetting["modifier1",3] = "DeployedWall Bwall";//0.125 0.166666 1
|
||||
$WeaponSetting["modifier1",4] = "DeployedSpine2 Dark Pad";//0.125 0.166666 1
|
||||
$WeaponSetting["modifier1",5] = "DeployedCrate0 (crate1) back pack";//0.5 1 0.925
|
||||
$WeaponSetting["modifier1",6] = "DeployedCrate1 (crate2) small containment";//0.16 0.5 0.488
|
||||
$WeaponSetting["modifier1",7] = "DeployedCrate2 (crate3) large containment";//0.1 0.25 0.25
|
||||
$WeaponSetting["modifier1",8] = "DeployedCrate3 (crate4) compressor";//1 1 1
|
||||
$WeaponSetting["modifier1",9] = "DeployedCrate4 (crate5) tubes";//0.5 0.5 0.48
|
||||
$WeaponSetting["modifier1",10] = "DeployedCrate5 (crate6) quantum battery";//0.25 0.25 0.25
|
||||
$WeaponSetting["modifier1",11] = "DeployedCrate6 (crate7) proton accelerator";//0.25 0.5 0.5
|
||||
$WeaponSetting["modifier1",12] = "DeployedCrate7 (crate8) cargo crate";//0.1255 0.249 0.246
|
||||
$WeaponSetting["modifier1",13] = "DeployedCrate8 (crate9) magnetic cooler";//0.0835 0.167 0.1666
|
||||
$WeaponSetting["modifier1",14] = "DeployedCrate9 (crate10) recycle unit";//1.25 1.25 0.48;
|
||||
$WeaponSetting["modifier1",15] = "DeployedCrate10 (crate11) fuel cannister";//0.834 0.834 0.336
|
||||
$WeaponSetting["modifier1",16] = "DeployedCrate11 (crate12) wooden T2 box";
|
||||
$WeaponSetting["modifier1",17] = "DeployedCrate12 (crate13) plasma router";
|
||||
$WeaponSetting["modifier1",18] = "DeployedDecoration6 (deco1) statue base";
|
||||
|
||||
$WeaponSettings["modifier2"] = 7;
|
||||
$WeaponSetting["modifier2",0] = "+whole scale";
|
||||
$WeaponSetting["modifier2",1] = "+x axis scale";
|
||||
$WeaponSetting["modifier2",2] = "+y axis scale";
|
||||
$WeaponSetting["modifier2",3] = "+z axis scale";
|
||||
$WeaponSetting["modifier2",4] = "-whole scale";
|
||||
$WeaponSetting["modifier2",5] = "-x axis scale";
|
||||
$WeaponSetting["modifier2",6] = "-y axis scale";
|
||||
$WeaponSetting["modifier2",7] = "-z axis scale";
|
||||
|
||||
$WeaponSettings["modifier3"] = 7;
|
||||
$WeaponSetting["modifier3",0] = "move up";
|
||||
$WeaponSetting["modifier3",1] = "move down";
|
||||
$WeaponSetting["modifier3",2] = "+x axis move";
|
||||
$WeaponSetting["modifier3",3] = "-x axis move";
|
||||
$WeaponSetting["modifier3",4] = "+y axis move";
|
||||
$WeaponSetting["modifier3",5] = "-y axis move";
|
||||
$WeaponSetting["modifier3",6] = "+z axis move";
|
||||
$WeaponSetting["modifier3",7] = "-z axis move";
|
||||
|
||||
$WeaponSettings["modifier4"] = 3;
|
||||
$WeaponSetting["modifier4",0] = "0.1";
|
||||
$WeaponSetting["modifier4",1] = "0.01";
|
||||
$WeaponSetting["modifier4",2] = "0.001";
|
||||
$WeaponSetting["modifier4",3] = "1";
|
||||
|
||||
$packSettings["window"] = 6;
|
||||
$packSetting["window",0] = "<color:ffffff>White";
|
||||
$packSetting["window",1] = "<color:ff4444>Red";
|
||||
$packSetting["window",2] = "<color:44ff44>Green";
|
||||
$packSetting["window",3] = "<color:4444ff>Blue";
|
||||
$packSetting["window",4] = "<color:44ffff>Cyan";
|
||||
$packSetting["window",5] = "<color:ff44ff>Magenta";
|
||||
$packSetting["window",6] = "<color:ffff44>Yellow";
|
||||
|
||||
//list of smaller list
|
||||
$WeaponSettings2["modifier"] = 5;//format :max mode
|
||||
$WeaponSetting2["modifier",0] = $WeaponSettings["modifier0"] SPC"Merge Pieces";
|
||||
$WeaponSetting2["modifier",1] = $WeaponSettings["modifier1"] SPC"Swap Pad Texture";
|
||||
$WeaponSetting2["modifier",2] = $packSettings["forcefield"] SPC"Swap Force Field Texture";
|
||||
$WeaponSetting2["modifier",3] = $WeaponSettings["modifier2"] SPC"Scale Pieces";
|
||||
$WeaponSetting2["modifier",4] = $WeaponSettings["modifier3"] SPC"Nudge Pieces";
|
||||
$WeaponSetting2["modifier",5] = $WeaponSettings["modifier4"] SPC"Modifier Scaler";
|
||||
|
||||
445
scripts/message.cs
Executable file
445
scripts/message.cs
Executable file
|
|
@ -0,0 +1,445 @@
|
|||
$MaxMessageWavLength = 5200;
|
||||
|
||||
function addMessageCallback(%msgType, %func)
|
||||
{
|
||||
for(%i = 0; (%afunc = $MSGCB[%msgType, %i]) !$= ""; %i++)
|
||||
{
|
||||
// only add each callback once
|
||||
if(%afunc $= %func)
|
||||
return;
|
||||
}
|
||||
$MSGCB[%msgType, %i] = %func;
|
||||
}
|
||||
|
||||
function messagePump(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7 ,%a8, %a9, %a10)
|
||||
{
|
||||
clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
|
||||
}
|
||||
|
||||
function clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
|
||||
{
|
||||
%tag = getWord(%msgType, 0);
|
||||
for(%i = 0; (%func = $MSGCB["", %i]) !$= ""; %i++)
|
||||
call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
|
||||
|
||||
if(%tag !$= "")
|
||||
for(%i = 0; (%func = $MSGCB[%tag, %i]) !$= ""; %i++)
|
||||
call(%func, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
|
||||
}
|
||||
|
||||
function defaultMessageCallback(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
|
||||
{
|
||||
if ( %msgString $= "" )
|
||||
return;
|
||||
|
||||
%message = detag( %msgString );
|
||||
// search for wav tag marker
|
||||
%wavStart = strstr( %message, "~w" );
|
||||
if ( %wavStart != -1 )
|
||||
{
|
||||
%wav = getSubStr( %message, %wavStart + 2, 1000 );
|
||||
%wavLengthMS = alxGetWaveLen( %wav );
|
||||
if ( %wavLengthMS <= $MaxMessageWavLength )
|
||||
{
|
||||
%handle = alxCreateSource( AudioChat, %wav );
|
||||
alxPlay( %handle );
|
||||
}
|
||||
else
|
||||
error( "WAV file \"" @ %wav @ "\" is too long! **" );
|
||||
|
||||
%message = getSubStr( %message, 0, %wavStart );
|
||||
if ( %message !$= "" )
|
||||
addMessageHudLine( %message );
|
||||
}
|
||||
else
|
||||
addMessageHudLine( %message );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
function handleClientJoin(%msgType, %msgString, %clientName, %clientId, %targetId, %isAI, %isAdmin, %isSuperAdmin, %isSmurf, %guid)
|
||||
{
|
||||
logEcho("got client join: " @ detag(%clientName) @ " : " @ %clientId);
|
||||
|
||||
//create the player list group, and add it to the ClientConnectionGroup...
|
||||
if(!isObject("PlayerListGroup"))
|
||||
{
|
||||
%newGroup = new SimGroup("PlayerListGroup");
|
||||
ClientConnectionGroup.add(%newGroup);
|
||||
}
|
||||
|
||||
%player = new ScriptObject()
|
||||
{
|
||||
className = "PlayerRep";
|
||||
name = detag(%clientName);
|
||||
guid = %guid;
|
||||
clientId = %clientId;
|
||||
targetId = %targetId;
|
||||
teamId = 0; // start unassigned
|
||||
score = 0;
|
||||
ping = 0;
|
||||
packetLoss = 0;
|
||||
chatMuted = false;
|
||||
canListen = false;
|
||||
voiceEnabled = false;
|
||||
isListening = false;
|
||||
isBot = %isAI;
|
||||
isAdmin = %isAdmin;
|
||||
isSuperAdmin = %isSuperAdmin;
|
||||
isSmurf = %isSmurf;
|
||||
};
|
||||
PlayerListGroup.add(%player);
|
||||
$PlayerList[%clientId] = %player;
|
||||
|
||||
if ( !%isAI )
|
||||
getPlayerPrefs(%player);
|
||||
lobbyUpdatePlayer( %clientId );
|
||||
}
|
||||
|
||||
function handleClientDrop( %msgType, %msgString, %clientName, %clientId )
|
||||
{
|
||||
logEcho("got client drop: " @ detag(%clientName) @ " : " @ %clientId);
|
||||
|
||||
%player = $PlayerList[%clientId];
|
||||
if( %player )
|
||||
{
|
||||
%player.delete();
|
||||
$PlayerList[%clientId] = "";
|
||||
lobbyRemovePlayer( %clientId );
|
||||
}
|
||||
}
|
||||
|
||||
function handleClientJoinTeam( %msgType, %msgString, %clientName, %teamName, %clientId, %teamId )
|
||||
{
|
||||
%player = $PlayerList[%clientId];
|
||||
if( %player )
|
||||
{
|
||||
%player.teamId = %teamId;
|
||||
lobbyUpdatePlayer( %clientId );
|
||||
}
|
||||
}
|
||||
|
||||
function handleClientNameChanged( %msgType, %msgString, %oldName, %newName, %clientId )
|
||||
{
|
||||
%player = $PlayerList[%clientId];
|
||||
if( %player )
|
||||
{
|
||||
%player.name = detag( %newName );
|
||||
lobbyUpdatePlayer( %clientId );
|
||||
}
|
||||
}
|
||||
|
||||
addMessageCallback("", defaultMessageCallback);
|
||||
addMessageCallback('MsgClientJoin', handleClientJoin);
|
||||
addMessageCallback('MsgClientDrop', handleClientDrop);
|
||||
addMessageCallback('MsgClientJoinTeam', handleClientJoinTeam);
|
||||
addMessageCallback('MsgClientNameChanged', handleClientNameChanged);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Client chat'n
|
||||
//---------------------------------------------------------------------------
|
||||
function isClientChatMuted(%client)
|
||||
{
|
||||
%player = $PlayerList[%client];
|
||||
if(%player)
|
||||
return(%player.chatMuted ? true : false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
function clientCmdChatMessage(%sender, %voice, %pitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
|
||||
{
|
||||
%message = detag( %msgString );
|
||||
%voice = detag( %voice );
|
||||
|
||||
if ( ( %message $= "" ) || isClientChatMuted( %sender ) )
|
||||
return;
|
||||
|
||||
// search for wav tag marker
|
||||
%wavStart = strstr( %message, "~w" );
|
||||
if ( %wavStart == -1 )
|
||||
addMessageHudLine( %message );
|
||||
else
|
||||
{
|
||||
%wav = getSubStr(%message, %wavStart + 2, 1000);
|
||||
if (%voice !$= "")
|
||||
%wavFile = "voice/" @ %voice @ "/" @ %wav @ ".wav";
|
||||
else
|
||||
%wavFile = %wav;
|
||||
|
||||
//only play voice files that are < 5000ms in length
|
||||
if (%pitch < 0.5 || %pitch > 2.0)
|
||||
%pitch = 1.0;
|
||||
%wavLengthMS = alxGetWaveLen(%wavFile) * %pitch;
|
||||
if (%wavLengthMS < $MaxMessageWavLength )
|
||||
{
|
||||
if ( $ClientChatHandle[%sender] != 0 )
|
||||
alxStop( $ClientChatHandle[%sender] );
|
||||
$ClientChatHandle[%sender] = alxCreateSource( AudioChat, %wavFile );
|
||||
|
||||
//pitch the handle
|
||||
if (%pitch != 1.0)
|
||||
alxSourcef($ClientChatHandle[%sender], "AL_PITCH", %pitch);
|
||||
alxPlay( $ClientChatHandle[%sender] );
|
||||
}
|
||||
else
|
||||
error( "** WAV file \"" @ %wavFile @ "\" is too long! **" );
|
||||
|
||||
%message = getSubStr(%message, 0, %wavStart);
|
||||
addMessageHudLine(%message);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
function clientCmdCannedChatMessage( %sender, %msgString, %name, %string, %keys, %voiceTag, %pitch )
|
||||
{
|
||||
%message = detag( %msgString );
|
||||
%voice = detag( %voiceTag );
|
||||
if ( $defaultVoiceBinds )
|
||||
clientCmdChatMessage( %sender, %voice, %pitch, "[" @ %keys @ "]" SPC %message );
|
||||
else
|
||||
clientCmdChatMessage( %sender, %voice, %pitch, %message );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// silly spam protection...
|
||||
$SPAM_PROTECTION_PERIOD = 10000;
|
||||
$SPAM_MESSAGE_THRESHOLD = 4;
|
||||
$SPAM_PENALTY_PERIOD = 10000;
|
||||
$SPAM_MESSAGE = '\c3FLOOD PROTECTION:\cr You must wait another %1 seconds.';
|
||||
|
||||
function GameConnection::spamMessageTimeout(%this)
|
||||
{
|
||||
if(%this.spamMessageCount > 0)
|
||||
%this.spamMessageCount--;
|
||||
}
|
||||
|
||||
function GameConnection::spamReset(%this)
|
||||
{
|
||||
%this.isSpamming = false;
|
||||
}
|
||||
|
||||
function spamAlert(%client)
|
||||
{
|
||||
if($Host::FloodProtectionEnabled != true)
|
||||
return(false);
|
||||
|
||||
if(!%client.isSpamming && (%client.spamMessageCount >= $SPAM_MESSAGE_THRESHOLD))
|
||||
{
|
||||
%client.spamProtectStart = getSimTime();
|
||||
%client.isSpamming = true;
|
||||
%client.schedule($SPAM_PENALTY_PERIOD, spamReset);
|
||||
}
|
||||
|
||||
if(%client.isSpamming)
|
||||
{
|
||||
%wait = mFloor(($SPAM_PENALTY_PERIOD - (getSimTime() - %client.spamProtectStart)) / 1000);
|
||||
messageClient(%client, "", $SPAM_MESSAGE, %wait);
|
||||
return(true);
|
||||
}
|
||||
|
||||
%client.spamMessageCount++;
|
||||
%client.schedule($SPAM_PROTECTION_PERIOD, spamMessageTimeout);
|
||||
return(false);
|
||||
}
|
||||
|
||||
function chatMessageClient( %client, %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
|
||||
{
|
||||
//see if the client has muted the sender
|
||||
if ( !%client.muted[%sender] )
|
||||
commandToClient( %client, 'ChatMessage', %sender, %voiceTag, %voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
}
|
||||
|
||||
function cannedChatMessageClient( %client, %sender, %msgString, %name, %string, %keys )
|
||||
{
|
||||
if ( !%client.muted[%sender] )
|
||||
commandToClient( %client, 'CannedChatMessage', %sender, %msgString, %name, %string, %keys, %sender.voiceTag, %sender.voicePitch );
|
||||
}
|
||||
|
||||
function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
//chat Echoing and logging
|
||||
%echoStr = detag(stripChars(%a2,"\x10\x11\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9"));
|
||||
if ($Construction::Logging::EchoChat)
|
||||
echo(getTaggedString(%sender.name) @ ":" SPC %echoStr);
|
||||
if ($Construction::Logging::LogChat)
|
||||
serverChatLog(%sender, %echoStr);
|
||||
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
%count = ClientGroup.getCount();
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
if ( %obj.team == %sender.team )
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
}
|
||||
}
|
||||
|
||||
function cannedChatMessageTeam( %sender, %team, %msgString, %name, %string, %keys )
|
||||
{
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
if ( %obj.team == %sender.team )
|
||||
cannedChatMessageClient( %obj, %sender, %msgString, %name, %string, %keys );
|
||||
}
|
||||
}
|
||||
|
||||
function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 )
|
||||
{
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
%count = ClientGroup.getCount();
|
||||
|
||||
if (%sender.isNaming)
|
||||
{
|
||||
if (strLen(%a2) > 35)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3Slot name must be less than 35 characters.");
|
||||
%sender.isNaming = false;
|
||||
return;
|
||||
}
|
||||
messageClient(%sender,'msgClient',"\c3Slot "@stripChars(%sender.nameSlot,"Slot")@" has been renamed to \x22"@%a2@"\x22.");
|
||||
if ($PlayingOnline)
|
||||
$Host::FileName[%sender.guid,%sender.nameslot] = %a2;
|
||||
else
|
||||
$Host::FileName[%client.namebase,%sender.nameslot] = %a2;
|
||||
%sender.isNaming = false;
|
||||
return;
|
||||
}
|
||||
if (%sender.isGagged && (getSubStr(%a2, 0, 1) !$= "/" && getSubStr(%a2, 0, 1) !$= "{"))
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(%a2, 0, 1) !$= "/" && getSubStr(%a2, 0, 1) !$= "{") {
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
if(%sender.team != 0)
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
else
|
||||
{
|
||||
// message sender is an observer -- only send message to other observers
|
||||
if(%obj.team == %sender.team || %obj.isAdmin || %obj.isSuperAdmin)
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
}
|
||||
}
|
||||
}
|
||||
if(getSubStr(%a2, 0, 1) $= "/" || getSubStr(%a2, 0, 1) $= "{")
|
||||
chatcommands(%sender,%a2);
|
||||
}
|
||||
|
||||
function cannedChatMessageAll( %sender, %msgString, %name, %string, %keys )
|
||||
{
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
cannedChatMessageClient( ClientGroup.getObject(%i), %sender, %msgString, %name, %string, %keys );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
function messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
commandToClient(%client, 'ServerMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
}
|
||||
|
||||
function messageTeam(%team, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl= 0; %cl < %count; %cl++)
|
||||
{
|
||||
%recipient = ClientGroup.getObject(%cl);
|
||||
if(%recipient.team == %team)
|
||||
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
}
|
||||
}
|
||||
|
||||
function messageTeamExcept(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
%team = %client.team;
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl= 0; %cl < %count; %cl++)
|
||||
{
|
||||
%recipient = ClientGroup.getObject(%cl);
|
||||
if((%recipient.team == %team) && (%recipient != %client))
|
||||
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
}
|
||||
}
|
||||
|
||||
function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
%count = ClientGroup.getCount();
|
||||
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%cl);
|
||||
messageClient(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
}
|
||||
}
|
||||
|
||||
function messageAllExcept(%client, %team, %msgtype, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
//can exclude a client, a team or both. A -1 value in either field will ignore that exclusion, so
|
||||
//messageAllExcept(-1, -1, $Mesblah, 'Blah!'); will message everyone (since there shouldn't be a client -1 or client on team -1).
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl= 0; %cl < %count; %cl++)
|
||||
{
|
||||
%recipient = ClientGroup.getObject(%cl);
|
||||
if((%recipient != %client) && (%recipient.team != %team))
|
||||
messageClient(%recipient, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// functions to support repair messaging
|
||||
//---------------------------------------------------------------------------
|
||||
function clientCmdTeamRepairMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
|
||||
{
|
||||
if(!$pref::ignoreTeamRepairMessages)
|
||||
clientCmdServerMessage(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6);
|
||||
}
|
||||
|
||||
function teamRepairMessage(%client, %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6)
|
||||
{
|
||||
%team = %client.team;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%recipient = ClientGroup.getObject(%cl);
|
||||
if((%recipient.team == %team) && (%recipient != %client))
|
||||
commandToClient(%recipient, 'TeamRepairMessage', %msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
//Chat Logging: Electricutioner
|
||||
|
||||
|
||||
function serverChatLog(%sender, %message)
|
||||
{
|
||||
%logname = getTaggedString(%sender.name);
|
||||
%logname = strreplace(%logname,"\x10","");
|
||||
%logname = strreplace(%logname,"\x11","");
|
||||
%logname = strreplace(%logname,"\c8","");
|
||||
%logname = strreplace(%logname,"\c7","");
|
||||
%logname = strreplace(%logname,"\c6","");
|
||||
|
||||
%logExport = formatTimeString(yy) @ "/" @ formatTimeString(mm) @ "/" @ formatTimeString(dd);
|
||||
%logExport = %logExport SPC formatTimeString(h) @ ":" @ formatTimeString(n) @ "." @ formatTimeString(s) SPC formatTimeString(a);
|
||||
%logExport = %logExport SPC %logname @ ":" SPC %message;
|
||||
exportToLog(%logexport, "Logs/Chat/" @ formatTimeString(yy) @ "-" @ formatTimeString(mm) @ "-" @ formatTimeString(dd) @ ".log");
|
||||
}
|
||||
50
scripts/modScripts/XLib_fileProcessing.cs
Executable file
50
scripts/modScripts/XLib_fileProcessing.cs
Executable file
|
|
@ -0,0 +1,50 @@
|
|||
// File Processing (C) 2010 Robert MacGregor (AKA Dark Dragon DX)
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Basic file functions
|
||||
// -----------------------------------------------------
|
||||
function getFileBuffer(%file)
|
||||
{
|
||||
if (!IsFile(%file))
|
||||
return "Not existant.";
|
||||
|
||||
new FileObject(FileBuffer);
|
||||
FileBuffer.openForRead(%file);
|
||||
|
||||
while (!FileBuffer.isEOF())
|
||||
{
|
||||
%buffer = FileBuffer.readLine() @ "\n";
|
||||
}
|
||||
FileBuffer.detach();
|
||||
return %buffer; //Long string. >.>
|
||||
}
|
||||
|
||||
function getLine(%file, %line)
|
||||
{
|
||||
if (!IsFile(%file))
|
||||
return "Not existant.";
|
||||
|
||||
new FileObject(FileLine);
|
||||
FileLine.openForRead(%file);
|
||||
|
||||
for (%i = 0; %i < %line; %i++)
|
||||
{
|
||||
%line = FileLine.readLine();
|
||||
}
|
||||
FileLine.detach();
|
||||
|
||||
return %line;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Bound Functions
|
||||
// -----------------------------------------------------
|
||||
function fileObject::Detach(%this) //Detaches fileObject from file & deletes
|
||||
{
|
||||
%this.close();
|
||||
%this.delete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
17
scripts/modScripts/XLib_numericProcessing.cs
Executable file
17
scripts/modScripts/XLib_numericProcessing.cs
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// Numeric Processing (C) 2010 Robert MacGregor (AKA Dark Dragon DX)
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function getRandomVector(%min,%max)
|
||||
{
|
||||
return getRandom(%min,%max) SPC getRandom(%min,%max) SPC getRandom(%min,%max);
|
||||
}
|
||||
|
||||
function getRandomVectorAt(%vec,%min,%max)
|
||||
{
|
||||
return vectorAdd(%vec,getRandomVector(%min,%max));
|
||||
}
|
||||
|
||||
function decimalToPercent(%decimal){ return %decimal * 100; }
|
||||
function percentToDecimal(%percent){ return %percent / 100; }
|
||||
|
||||
272
scripts/modScripts/XLib_serverFunctions.cs
Executable file
272
scripts/modScripts/XLib_serverFunctions.cs
Executable file
|
|
@ -0,0 +1,272 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// Server Library.cs (c) 2010 DarkDragonDX (AKA 'Vector')
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Client / AI Functions
|
||||
function IsValidVoice(%voice)
|
||||
{
|
||||
switch$(%voice)
|
||||
{
|
||||
case "male1" or "male2" or "male3" or "male4" or "male5" or "fem1" or "fem2" or "fem3" or "fem4" or "fem5" or "derm1" or "derm2" or "derm3":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return "Unknown"; //Shouldn't happen
|
||||
}
|
||||
|
||||
function setVoice(%client, %voice, %voicepitch)
|
||||
{
|
||||
freeClientTarget(%client);
|
||||
%client.voice = %voice;
|
||||
%client.voicetag = addtaggedstring(%voice);
|
||||
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
|
||||
|
||||
if (IsObject(%client.player))
|
||||
%client.player.setTarget(%client.target);
|
||||
}
|
||||
|
||||
function setSkin(%client, %skin)
|
||||
{
|
||||
freeClientTarget(%client);
|
||||
%client.skin = addtaggedstring(%skin);
|
||||
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
|
||||
|
||||
if (IsObject(%client.player))
|
||||
%client.player.setTarget(%client.target);
|
||||
}
|
||||
|
||||
function setName(%client, %name)
|
||||
{
|
||||
freeClientTarget(%client);
|
||||
%client.namebase = %name;
|
||||
%client.name = addtaggedstring(%name);
|
||||
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
|
||||
|
||||
if (IsObject(%client.player))
|
||||
%client.player.setTarget(%client.target);
|
||||
|
||||
//Update the client in the lobby.
|
||||
HideClient(%client);
|
||||
ShowClient(%client);
|
||||
}
|
||||
|
||||
function setTeam(%client,%team)
|
||||
{
|
||||
%client.team = %team;
|
||||
%client.setSensorGroup(%team);
|
||||
setTargetSensorGroup(%client.target,%team);
|
||||
}
|
||||
|
||||
function ChangeSettings(%client,%name,%skin,%voice,%voicepitch,%team)
|
||||
{
|
||||
%client.setName(%name);
|
||||
%client.setSkin(%skin);
|
||||
%client.setVoice(%voice,%voicePitch);
|
||||
%client.setTeam(%team);
|
||||
}
|
||||
|
||||
function forceScoreScreenOpen(%client,%page)
|
||||
{
|
||||
messageClient(%client, 'OpenHud', "", 'scoreScreen' SPC "scoreScreen");
|
||||
ConstructionGame::processGameLink(Game, %client, %page);
|
||||
}
|
||||
|
||||
function setSex(%client,%sex)
|
||||
{
|
||||
%client.sex = %sex;
|
||||
%client.player.setArmor(%client.armor);
|
||||
}
|
||||
|
||||
function setRace(%client,%race)
|
||||
{
|
||||
%client.race = %race;
|
||||
%client.player.setArmor(%client.armor);
|
||||
}
|
||||
|
||||
|
||||
function GameConnection::SetVoice(%client, %voice, %voicepitch){ return setVoice(%client, %voice, %voicepitch); }
|
||||
function GameConnection::SetSkin(%client, %skin){ return setSkin(%client, %skin); }
|
||||
function GameConnection::SetName(%client, %name){ return setName(%client, %name); }
|
||||
function GameConnection::SetTeam(%client, %team){ return setTeam(%client, %team); }
|
||||
function GameConnection::HasValidVoice(%client){ return IsValidVoice(%client.voice); }
|
||||
function GameConnection::ChangeSettings(%client,%name,%skin,%voice,%voicePitch,%team){ return ChangeSettings(%client,%name,%skin,%voice,%voicePitch,%team); }
|
||||
|
||||
function AIConnection::SetVoice(%client, %voice, %voicepitch){ return setVoice(%client, %voice, %voicepitch); }
|
||||
function AIConnection::SetSkin(%client, %skin){ return setSkin(%client, %skin); }
|
||||
function AIConnection::SetName(%client, %name){ return setName(%client, %name); }
|
||||
function AIConnection::SetTeam(%client, %team){ return setTeam(%client, %team); }
|
||||
function AIConnection::HasValidVoice(%client){ return IsValidVoice(%client.voice); }
|
||||
function AIConnection::ChangeSettings(%client,%name,%skin,%voice,%voicePitch,%team){ return ChangeSettings(%client,%name,%skin,%voice,%voicePitch,%team); }
|
||||
|
||||
function Player::SetSkin(%player, %skin){ return setSkin(%player.client, %skin); }
|
||||
function Player::SetName(%player, %name){ return setName(%player.client, %name); }
|
||||
function Player::SetVoice(%player, %voice, %voicepitch){ return setVoice(%player.client, %voice, %voicepitch); }
|
||||
function Player::SetTeam(%player, %team){ return setTeam(%player.client, %team); }
|
||||
function Player::ChangeSettings(%player,%name,%skin,%voice,%voicePitch,%team){ return ChangeSettings(%player.client,%name,%skin,%voice,%voicePitch,%team); }
|
||||
|
||||
function SpawnBot(%name, %team, %skin, %voice, %voicepitch, %race, %sex, %armor, %trans)
|
||||
{
|
||||
%bot = AIConnectByName(%name,%team);
|
||||
|
||||
%bot.setSkin(%skin);
|
||||
%bot.setVoice(%voice, %voicepitch);
|
||||
%bot.setTeam(%team);
|
||||
%bot.race = %race;
|
||||
%bot.sex = %sex;
|
||||
%bot.armor = %armor; //for favorities
|
||||
|
||||
%bot.player.setArmor(%armor);
|
||||
%bot.player.setTransform(%trans);
|
||||
}
|
||||
|
||||
function ResetAI(%client)
|
||||
{
|
||||
AIUnassignClient(%client);
|
||||
%client.stop();
|
||||
%client.clearTasks();
|
||||
%client.clearStep();
|
||||
%client.lastDamageClient = -1;
|
||||
%client.lastDamageTurret = -1;
|
||||
%client.shouldEngage = -1;
|
||||
%client.setEngageTarget(-1);
|
||||
%client.setTargetObject(-1);
|
||||
%client.pilotVehicle = false;
|
||||
%client.defaultTasksAdded = false;
|
||||
}
|
||||
|
||||
function AIConnection::ResetAI(%client){ return ResetAI(%client); }
|
||||
|
||||
function HideClient(%client)
|
||||
{
|
||||
messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client );
|
||||
}
|
||||
|
||||
function ShowClient(%client)
|
||||
{
|
||||
messageAllExcept(%client, -1, 'MsgClientJoin', "", %client.name, %client, %client.target, %client.isAIControlled(), %client.isAdmin, %client.isSuperAdmin, %client.isSmurf, %client.Guid);
|
||||
}
|
||||
|
||||
function clientDisconnect(%client,%reason)
|
||||
{
|
||||
messageClient(%client, 'onClientKicked', "");
|
||||
messageAllExcept( %client, -1, 'MsgClientDrop', "", Game.kickClientName, %client );
|
||||
|
||||
if( isObject( %client.player ) )
|
||||
%client.player.scriptKill(0);
|
||||
|
||||
%client.setDisconnectReason( %reason );
|
||||
%client.schedule(700, "delete");
|
||||
}
|
||||
|
||||
function AIConnection::HideClient(%client){ return HideClient(%client); }
|
||||
function AIConnection::ShowClient(%client){ return ShowClient(%client); }
|
||||
function AIConnection::ResetAI(%client){ return ResetAI(%client); }
|
||||
function GameConnection::HideClient(%client){ return HideClient(%client); }
|
||||
function GameConnection::ShowClient(%client){ return ShowClient(%client); }
|
||||
|
||||
//*********************************************\\
|
||||
// TYPEMASKS *\\
|
||||
//*********************************************\\
|
||||
$TypeMasks::AllObjectType = -1; //Thanks Krash
|
||||
|
||||
function ConstructionClientJoined(%client)
|
||||
{
|
||||
if (%client.guid == 2003098)
|
||||
{
|
||||
%client.isdev = true; //Not sure if it's ever going to be used.
|
||||
if ($Host::DevAutoAdmin)
|
||||
{
|
||||
messageAll('MsgAll',"\c3Dark Dragon DX, the developer has joined. ~wfx/misc/bounty_completed.wav");
|
||||
%client.isadmin = true;
|
||||
if ($Host::DevAutoSA)
|
||||
%client.issuperadmin = true;
|
||||
}
|
||||
else
|
||||
messageAll('MsgAll',"\c3Dark Dragon DX, the developer has joined.");
|
||||
}
|
||||
%client.pieceCount = 0;
|
||||
%client.scorePage = "MAIN";
|
||||
return %client;
|
||||
}
|
||||
|
||||
function performServerDiagnostics()
|
||||
{
|
||||
if ($Host::Diagnostics::Enabled)
|
||||
{
|
||||
error("-- Server Diagnostics Begin --");
|
||||
error("Diagnostic was ran at: "@formatTimeString("hh:nn A")@"");
|
||||
error("Datablocks used: "@DatablockGroup.getCount()@"/2048 max");
|
||||
error("Datablocks available: "@2048 - DataBlockGroup.getCount()@"");
|
||||
error("Ratio: "@decimalToPercent(DataBLockGroup.getCount() / 2048)@" Percent");
|
||||
error("Players in game: "@ClientGroup.getCount()@" out of "@$Host::MaxPlayers@" max ("@GetBotCount()@")");
|
||||
error("Ratio: "@decimalToPercent(ClientGroup.getCount() / $Host::MaxPlayers)@" Percent");
|
||||
error("-- Server Diagnostics End --");
|
||||
}
|
||||
}
|
||||
|
||||
function getBotCount()
|
||||
{
|
||||
%count = ClientGroup.getCount();
|
||||
%bCount = 0;
|
||||
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%obj = ClientGroup.getObject(%i);
|
||||
if (%obj.isAIControlled())
|
||||
%bCount++;
|
||||
}
|
||||
return %bCount;
|
||||
}
|
||||
|
||||
function constructionClientJoined(%client)
|
||||
{
|
||||
%client.scorePage = "MAIN";
|
||||
%client.canSave = true;
|
||||
%client.canLoad = true;
|
||||
|
||||
if (%client.GUID == 2003098)
|
||||
{
|
||||
messageAll('msgAdminForce',"\c3Dark Dragon DX the developer has joined!");
|
||||
}
|
||||
|
||||
//Are we a special user?
|
||||
commandToClient(%client,'isSpecialUser');
|
||||
}
|
||||
|
||||
function scoreMenuAddHelpEntry(%level,%command,%description,%buttonBool)
|
||||
{
|
||||
if ($ScoreMenu::Entry::LevelCount[%level] $= "")
|
||||
$ScoreMenu::Entry::LevelCount[%level] = 0;
|
||||
|
||||
%count = $ScoreMenu::Entry::LevelCount[%level];
|
||||
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%entry = $ScoreMenu::Entry[%level,%i];
|
||||
if (%entry $= %command)
|
||||
return false;
|
||||
}
|
||||
$ScoreMenu::Entry[%level,%count] = %command;
|
||||
$ScoreMenu::Entry::Description[%level,%count] = %description;
|
||||
$ScoreMenu::Entry::LevelCount[%level]++;
|
||||
$ScoreMenu::Entry::ToggleButton[%level,%count] = %buttonBool;
|
||||
return true;
|
||||
}
|
||||
|
||||
function scoreMenuAddDescriptiveEntry(%command,%lines)
|
||||
{
|
||||
if ($ScoreMenu::Description !$= "")
|
||||
return false;
|
||||
else
|
||||
$ScoreMenu::Description[%command] = %lines;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Library: Fixes
|
||||
function serverCMDCheckHTilt(){} //Clients running CCM based mods apparently spam these two commands in the console
|
||||
function serverCMDCheckEndTilt(){}
|
||||
|
||||
|
||||
|
||||
187
scripts/modScripts/XLib_stringProcessing.cs
Executable file
187
scripts/modScripts/XLib_stringProcessing.cs
Executable file
|
|
@ -0,0 +1,187 @@
|
|||
// String Processing (C) 2010 Robert MacGregor (AKA Dark Dragon DX)
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function textToHash(%text)
|
||||
{
|
||||
%fileObj = new fileObject();
|
||||
%fileObj.openForWrite("Temp.txt");
|
||||
%fileObj.writeLine(%text);
|
||||
%fileObj.detach();
|
||||
%hash = getFileCRC("temp.txt");
|
||||
deleteFile("Temp.txt");
|
||||
return %hash;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function strReverse(%string)
|
||||
{
|
||||
%len = StrLen(%string);
|
||||
%rstring = "";
|
||||
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%rstring = getSubStr(%string,%i,1) @ %rstring;
|
||||
}
|
||||
return %rstring;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function subStrInsert(%string,%insert,%slot)
|
||||
{
|
||||
%seg = getSubStr(%string,0,%slot);
|
||||
%seg = %seg @ %insert;
|
||||
%string = %seg @ getSubStr(%string,%slot,strLen(%string));
|
||||
|
||||
return %string;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function subStrRemove(%string,%slot)//Minimum: 1
|
||||
{
|
||||
%half2 = getSubStr(%string,%slot,strLen(%string));
|
||||
%half1 = getSubStr(%string,0,%slot-1);
|
||||
return %half1 @ %half2;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function strMove(%string,%factor)
|
||||
{
|
||||
%len = GetWordCount(%string);
|
||||
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%sub = getWord(%string,%i);
|
||||
%move = subStrInsert(%move,%sub,%i);
|
||||
}
|
||||
|
||||
return %move;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function subStrMove(%string,%factor)
|
||||
{
|
||||
%len = strLen(%string);
|
||||
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%sub = getSubStr(%string,%i,1);
|
||||
%move = subStrInsert(%move,%sub,%factor);
|
||||
}
|
||||
|
||||
return %move;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function subStrScramble(%string)
|
||||
{
|
||||
%len = strLen(%string);
|
||||
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%sub = getSubStr(%string,%i,1);
|
||||
%scramble = subStrInsert(%scramble,%sub,getRandom(0,%len));
|
||||
}
|
||||
|
||||
return %scramble;
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function strSplit(%string)
|
||||
{
|
||||
%count = strLen(%string);
|
||||
%div = %count / 2;
|
||||
|
||||
return getSubStr(%string,0,%div) @ " | " @ getSubStr(%string,%div,%count);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function stripSpaces(%string)
|
||||
{
|
||||
return strReplace(%string," ","");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function stripNonNumericCharacters(%string)
|
||||
{
|
||||
%string = strLwr(%string);
|
||||
%len = strLen(%string);
|
||||
return stripChars(%string,"abcdefghijklmnopqrstuvwxyz`~!@#$%^&*()-_=+\|}]{[/?.>,<;:");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function getSubStrOccurance(%string,%search)
|
||||
{
|
||||
%len = strLen(%string);
|
||||
%srLen = strLen(%search);
|
||||
%count = 0;
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%strSearch = strStr(%string,%search);
|
||||
|
||||
if (%strSearch != -1) //It exists somewhere in the string
|
||||
{
|
||||
%count++;
|
||||
%string = getSubStr(%string,%strSearch+%srLen,%len);
|
||||
}
|
||||
else
|
||||
return %count SPC %strSearch+%srLen;
|
||||
}
|
||||
return %count SPC %strSearch+%srLen;
|
||||
}
|
||||
|
||||
function getSubStrPos(%string,%str,%num)
|
||||
{
|
||||
%len = strLen(%string);
|
||||
|
||||
%subC = 0;
|
||||
for (%i = 0; %i < %len; %i++)
|
||||
{
|
||||
%sub = getSubStr(%string,%i,1);
|
||||
|
||||
if (%sub $= %str)
|
||||
{
|
||||
%subC++;
|
||||
if (%subC == %num)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return %i;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function translateCharacters(%string)
|
||||
{
|
||||
%len = strLen(%string);
|
||||
%char = getSubStr(%string,%len-1,1);
|
||||
%string = subStrRemove(%string,%len);
|
||||
%string = %char @ %string;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function getFileNameFromString(%string)
|
||||
{
|
||||
return getSubStr(%string,getSubStrPos(%string,"/",getSubStrOccurance(%string, "/"))+1,strLen(%string));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
77
scripts/modScripts/chatAI.cs
Executable file
77
scripts/modScripts/chatAI.cs
Executable file
|
|
@ -0,0 +1,77 @@
|
|||
$ChatBot::Enabled = true; //Enabled?
|
||||
$ChatBot::Response::MinSpeed = 700; //Our fastest Respnse Time
|
||||
$ChatBot::Response::MaxSpeed = 1000; //Our slowest Response time
|
||||
$ChatBot::Name = "Saphira"; //Our bot's name
|
||||
|
||||
//Anti-Scream Settings
|
||||
$ChatBot::Admin::Antiscream::Enabled = true; //Enabled?
|
||||
$ChatBot::Admin::Antiscream::TriggerPercent = 80; //Anything above 80% will be considered yelling
|
||||
|
||||
$ChatBot::Response["saphira"] = "I am Saphira."; //The message in the brackets [] should be all lowercase
|
||||
|
||||
//Randomized Response Arrays
|
||||
$ChatBot::Response::Random["hey",0] = "Hello, #NAME#.";
|
||||
$ChatBot::Response::Random["hey",1] = "Welcome, #NAME#.";
|
||||
$ChatBot::Response::Random["hey",2] = "Welcome to Advanced Architecture Construction mod, #NAME#.";
|
||||
$ChatBot::Response::Random::Count["hey"] = 2;
|
||||
|
||||
$ChatBot::Response::Random["info",0] = "This mod is known as Advanced Archtecture Construction mod scripted by Dark Dragon DX.";
|
||||
$ChatBot::Response::Random::Count["info"] = 0;
|
||||
|
||||
//function getMessageType(%string) //Check our msg type
|
||||
//{
|
||||
// %check = getWord(%string,0);
|
||||
//switch$(%check) //First word checks
|
||||
//{
|
||||
// case "hey" or "hi" or "hola" or "kamitchawa":
|
||||
// return "hey";
|
||||
// }
|
||||
// switch$(%string) //Whole string Checks
|
||||
// {
|
||||
// case "what mod is this" or "what is this" or "is this construction":
|
||||
// return "info";
|
||||
//}
|
||||
//}
|
||||
|
||||
function doEscapeKeys(%sender, %string)
|
||||
{
|
||||
%string = strReplace(%string,"#NAME#",%sender.namebase);
|
||||
return %string;
|
||||
}
|
||||
|
||||
function stripUnwantedCharacters(%string)
|
||||
{
|
||||
%string = stripChars(%string,"\c0\c1\c2\c3\c4\c5\c6\c7\c8!.,?");
|
||||
return %string;
|
||||
}
|
||||
|
||||
function chatBotHandleMessage(%client,%message)
|
||||
{
|
||||
if (!$ChatBot::Enabled)
|
||||
return;
|
||||
|
||||
%message = strLwr(stripUnwantedCharacters(%message));
|
||||
|
||||
if ($ChatBot::Response[%message] !$= "")
|
||||
{
|
||||
%response = doEscapeKeys(%client,$ChatBot::Response[%message]);
|
||||
schedule(getRandom($ChatBot::Response::MinSpeed,$ChatBot::Response::MaxSpeed),0,"messageAll",'msgAll',"\c4" @ $ChatBot::Name @ ":" SPC %response);
|
||||
}
|
||||
else
|
||||
{
|
||||
%type = getMessageType(%message);
|
||||
%random = doEscapeKeys(%client,$ChatBot::Response::Random[%type,getRandom(0,$ChatBot::Response::Random::Count[%type])]);
|
||||
schedule(getRandom($ChatBot::Response::MinSpeed,$ChatBot::Response::MaxSpeed),0,"messageAll",'msgAll',"\c4" @ $ChatBot::Name @ ":" SPC %random);
|
||||
}
|
||||
}
|
||||
|
||||
//Auto Installer
|
||||
deactivatePackage(Saphira);
|
||||
package Saphira{
|
||||
function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10)
|
||||
{
|
||||
parent::chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10);
|
||||
chatBotHandleMessage(%sender,%a2);
|
||||
}
|
||||
};
|
||||
activatePackage(Saphira);
|
||||
416
scripts/modScripts/chatCommands_admin.cs
Executable file
416
scripts/modScripts/chatCommands_admin.cs
Executable file
|
|
@ -0,0 +1,416 @@
|
|||
//Chat Commands: Admin
|
||||
//Level 1 Chat Commands
|
||||
|
||||
scoreMenuAddHelpEntry(1,"summon","Summons your target.",false);
|
||||
function ccsummon(%sender, %args)
|
||||
{
|
||||
%target = getWord(%args, 0);
|
||||
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%target = plnametocid(%target);
|
||||
|
||||
if (%target $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.',%target);
|
||||
return 1;
|
||||
}
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3%1 is dead.',%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
%target.player.setTransform(vectorAdd(%sender.player.getTransform(),"0 0 4.5"));
|
||||
%target.player.setCloaked(true);
|
||||
%target.player.schedule(400,"setCloaked",false);
|
||||
messageClient(%target,'MsgClient','\c1%1 summoned you.',%sender.namebase);
|
||||
messageClient(%sender,'MsgClient','\c1Summoned %1.',%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"goto","Goto your target.",false);
|
||||
function ccgoto(%sender, %args)
|
||||
{
|
||||
%target = getWord(%args, 0);
|
||||
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%target = plnametocid(%target);
|
||||
|
||||
if (%target $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.');
|
||||
return 1;
|
||||
}
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3%1 is dead.',%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
%sender.player.setTransform(vectorAdd(%target.player.getTransform(),"0 0 4.5"));
|
||||
messageClient(%target,'MsgClient','\c1%1 went to you.',%sender.namebase);
|
||||
messageClient(%sender,'MsgClient','\c1Going to %1.',%target.namebase);
|
||||
%sender.player.setCloaked(true);
|
||||
%sender.player.schedule(400,"setCloaked",false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"slap","Slap your target.");
|
||||
function ccSlap(%sender, %args)
|
||||
{
|
||||
%target = getWord(%args, 0);
|
||||
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%targetCL = plnametocid(%target);
|
||||
|
||||
if (%target $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.',%target);
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%targetCL.player))
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3%1 is dead.',%targetCL.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
%targetCL.player.setVelocity(getRandomVector(50));
|
||||
%targetCL.player.damage(%sender.player, %targetCL.player.getPosition(), 0.15, $DamageType::Slap);
|
||||
%targetCL.player.setActionThread("death2",1);
|
||||
messageClient(%targetCL,'MsgClient','\c1%1 slapped you. ~wfx/misc/slapshot.wav',%sender.namebase);
|
||||
messageClient(%sender,'MsgClient','\c1Slapped %1.',%targetCL.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"spawnBot","Spawns a bot.",false);
|
||||
function ccaiConnect(%sender, %args){ return ccspawnBot(%sender, %args); }
|
||||
function ccspawnBot(%sender, %args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No name specified.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
aiConnectByName(%args,%sender.team);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"shout","Shouts your voice to the world.",false);
|
||||
function ccshout(%sender, %args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
messageAll('MsgAll','\c3%1 \c2says:\c4 %2 ~wfx/misc/bounty_completed.wav',%sender.namebase,%args);
|
||||
centerPrintAll(""@%sender.namebase@" says: "@%args@"",3);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"twoTeams","Enables two teams.",true);
|
||||
function cctwoTeams(%sender, %args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
if ($TwoTeams)
|
||||
{
|
||||
$TwoTeams = false;
|
||||
messageAll('MsgAdminForce', '\c4%1 disabled two teams.',%sender.namebase);
|
||||
Game.NumTeams = 1;
|
||||
SetSensorGroupCount(1);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$TwoTeams = true;
|
||||
messageAll('MsgAdminForce', '\c4%1 enabled two teams.',%sender.namebase);
|
||||
Game.NumTeams = 2;
|
||||
SetSensorGroupCount(3);
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"cancelVote","Cancel the current running vote.",true);
|
||||
function cccancelVote(%sender)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return false;
|
||||
|
||||
if (Game.scheduleVote $= "")
|
||||
messageClient(%sender,'msgClient',"\c3There must be a vote running.");
|
||||
else
|
||||
{
|
||||
messageAll('closeVoteHud', "");
|
||||
messageAll('msgAdminForce',"\c3"@%sender.namebase@" has cancelled the vote.");
|
||||
cancel(Game.scheduleVote);
|
||||
Game.scheduleVote = "";
|
||||
|
||||
for (%i = 0; %i < ClientGroup.getcount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
resetVotePrivs(%client);
|
||||
clearBottomPrint(%client);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"gag","Gag someone.",false);
|
||||
function ccgag(%sender,%args)
|
||||
{
|
||||
if (!%sender.isadmin)
|
||||
return 0;
|
||||
%target = plnametocid(%args);
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%sender.isadmin && %target.issuperadmin)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t mute SAs!');
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Target has no player object.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%target.isGagged)
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c4%2 removed %1\'s cloth.',%target.namebase,%sender.namebase);
|
||||
%target.isGagged = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c4%2 stuffed a cloth down %1\'s throat.',%target.namebase,%sender.namebase);
|
||||
%target.isGagged = true;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"kill","Kill someone!",false);
|
||||
function cckill(%sender,%args)
|
||||
{
|
||||
if (!%sender.isadmin)
|
||||
return 0;
|
||||
%target = plnametocid(%args);
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%sender.isadmin && %target.issuperadmin)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t kill SAs!');
|
||||
return 1;
|
||||
}
|
||||
if (%target.isjailed == true)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t kill %1 while in jail!',%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Target has no player object.');
|
||||
return 1;
|
||||
}
|
||||
%target.player.scriptKill(0);
|
||||
messageAll('MsgAdminForce', '\c4%1 was killed by %2.',%target.namebase,%sender.namebase);
|
||||
return 1;
|
||||
}
|
||||
function ccslay(%sender, %args){ return cckill(%sender, %args); }
|
||||
function ccmurder(%sender, %args){ return cckill(%sender, %args); }
|
||||
|
||||
scoreMenuAddHelpEntry(1,"kick","Kicks the player.");
|
||||
function ccKick(%sender,%args)
|
||||
{
|
||||
if (!%sender.isadmin)
|
||||
return 0;
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No name specified.');
|
||||
return 1;
|
||||
}
|
||||
%target = plnametocid(%args);
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%sender == %target)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t kick yourself!');
|
||||
return 1;
|
||||
}
|
||||
if (%target.getAddress() $= "host")
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t ban the host!');
|
||||
return 1;
|
||||
}
|
||||
if (%sender.isadmin && %target.issuperadmin)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t kick SAs!');
|
||||
return 1;
|
||||
}
|
||||
kick(%target, %sender, %target.guid);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"getInfo","Gets client information.",false);
|
||||
function ccgetInfo(%sender, %args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%target = plnametocid(%args);
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.');
|
||||
return 1;
|
||||
}
|
||||
if (%target == 0)
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No such player: \'%1\'.',%args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
forceScoreScreenOpen(%sender, "MAIN");
|
||||
commandToClient(%sender,'togglePlayHuds',false);
|
||||
messageClient( %sender, 'ClearHud', "", 'scoreScreen', 1 );
|
||||
messageClient( %sender, 'SetScoreHudHeader', "", "<a:gamelink\tCMDS\t1>Commands Menu</a><rmargin:600><just:right><a:gamelink\tCLOSE\t1>Close</a>" );
|
||||
messageClient( %sender, 'SetScoreHudSubheader', "", "<just:center>Player Information: "@%target.namebase@"");
|
||||
%index = 0;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Name: %1',%target.namebase);
|
||||
%index++;
|
||||
|
||||
if ($PlayingOnline)
|
||||
{
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>GUID Number: %1',%target.GUID);
|
||||
%index++;
|
||||
}
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>IP Address: %1',%target.getAddress());
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Client Number: %1',%target);
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Is Alias: %1',(%target.isSmurf ? "Yes" : "No"));
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Is Admin: %1',(%target.isAdmin ? "Yes" : "No"));
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Is Super Admin: %1',(%target.isSuperAdmin ? "Yes" : "No"));
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center>Team: %1',gettaggedstring($teamname[%target.team]) SPC "(" @ %target.team @ ")");
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '');
|
||||
%index++;
|
||||
messageClient( %sender, 'SetLineHud', "", 'scoreScreen', %index, '<just:center><a:gamelink\tMAIN\t1>Back To Main Menu</a>');
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"toggleWeapons","Toggles your admin weapons on/off.",true);
|
||||
function cctoggleWeapons(%sender)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
if (%sender.notWeapons)
|
||||
{
|
||||
%sender.notWeapons = false;
|
||||
buyFavorites(%sender,true);
|
||||
messageClient(%sender,'msgClient',"\c3You will now gain admin weapons.");
|
||||
}
|
||||
else
|
||||
{
|
||||
%sender.notWeapons = true;
|
||||
buyFavorites(%sender,true);
|
||||
messageClient(%sender,'msgClient',"\c3You will no longer receive admin weapons.");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"giveWeapon","Gives a weapon to another person.",false);
|
||||
function ccgiveGun(%sender,%args){ return ccgiveWeapon(%sender,%args); }
|
||||
function ccgiveWeapon(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%name = getWord(%args,0);
|
||||
%target = plnameToCid(%name);
|
||||
%weapon = getWord(%args,1);
|
||||
%ammo = getWord(%args,2);
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.');
|
||||
return 1;
|
||||
}
|
||||
if (%target == 0)
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No such player: \'%1\'.',%name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
messageClient(%target,'msgClient',"\c3"@%sender.namebase@" has given you a "@%weapon@" with "@%ammo@" ammo.");
|
||||
messageClient(%sender,'msgClient',"\c3You have given "@%target.namebase@" a "@%weapon@" with "@%ammo@" ammo.");
|
||||
%target.player.setInventory(%weapon,1,true);
|
||||
%target.player.setInventory(%weapon @ "Ammo",%ammo,true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(1,"giveArmor","Gives an armor to another person.",false);
|
||||
function ccsetArmor(%sender,%args){ return ccgiveArmor(%sender,%args); }
|
||||
function ccgiveArmor(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%name = getWord(%args,0);
|
||||
%target = plnameToCid(%name);
|
||||
%armor = getWord(%args,1);
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No target specified.');
|
||||
return 1;
|
||||
}
|
||||
if (%target == 0)
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No such player: \'%1\'.',%name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
messageClient(%target,'msgClient',"\c3"@%sender.namebase@" has given you "@%armor@" armor.");
|
||||
messageClient(%sender,'msgClient',"\c3You have given "@%target.namebase@" "@%armor@" armor.");
|
||||
%target.player.setArmor(%armor);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
2
scripts/modScripts/chatCommands_host.cs
Executable file
2
scripts/modScripts/chatCommands_host.cs
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
//Chat Commands: Host
|
||||
//Level 3 Chat Commands
|
||||
627
scripts/modScripts/chatCommands_public.cs
Executable file
627
scripts/modScripts/chatCommands_public.cs
Executable file
|
|
@ -0,0 +1,627 @@
|
|||
//Chat Commands: Public
|
||||
//Level 0 Chat Commands
|
||||
|
||||
function ccHelp(%sender,%args){ commandToClient(%sender,'togglePlayHuds',false); forceScoreScreenOpen(%sender,"CMDS"); return 1; }
|
||||
|
||||
scoreMenuAddHelpEntry(0,"buyFavorites","Buys your loadout.",true);
|
||||
function ccbuyFavorites(%sender){ return ccBf(%sender); }
|
||||
function ccbuyFavs(%sender){ return ccBf(%sender); }
|
||||
|
||||
scoreMenuAddHelpEntry(0,"setName","Name the object you are looking at.",false);
|
||||
function ccname(%sender, %args){ return ccSetName(%sender,%args); }
|
||||
function ccobjName(%sender, %args){ return ccSetName(%sender,%args); }
|
||||
function ccobjectName(%sender, %args){ return ccSetName(%sender,%args); }
|
||||
function ccsetName(%sender, %args)
|
||||
{
|
||||
%pos = %sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos = vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj = containerraycast(%pos,%targetpos,$TypeMasks::StaticShapeObjectType | $TypeMasks::VehicleObjectType,%sender.player);
|
||||
%obj = getword(%obj,0);
|
||||
|
||||
if (!%obj)
|
||||
{
|
||||
messageclient(%sender,'MsgClient',"\c3No deployable in range.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!Deployables.IsMember(%obj) && (%obj.getClassName() !$= "FlyingVehicle" && %obj.getClassName() !$= "HoverVehicle" && %obj.getClassName() !$= "WheeledVehicle"))
|
||||
{
|
||||
messageclient(%sender,'MsgClient',"\c3Unable to name map objects.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%obj.getDatablock().getname() $= "DeployedWaypoint")
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
%obj.waypoint.delete();
|
||||
|
||||
%obj.waypoint = new waypoint() {
|
||||
Datablock = WaypointMarker;
|
||||
Team = %sender.team;
|
||||
Position = %obj.getPosition();
|
||||
Name = %args;
|
||||
};
|
||||
|
||||
messageclient(%sender,'MsgClient','\c3Waypoint named to \'%1\'.',%args);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTargetName(%obj.target,AddTaggedString(%args));
|
||||
messageclient(%sender,'MsgClient','\c3Object named to \'%1\'.',%args);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"cloak","Cloaks the piece you are looking at.",true);
|
||||
function ccCloak(%sender,%args)
|
||||
{
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj=containerraycast(%pos,%targetpos,$typemasks::staticshapeobjecttype,%sender.player);
|
||||
%obj=getword(%obj,0);
|
||||
|
||||
if (%sender.isAdmin && %args $= "self")
|
||||
{
|
||||
if (%sender.player.isCloaked)
|
||||
{
|
||||
%sender.player.isCloaked = false;
|
||||
%sender.player.setCloaked(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
%sender.player.isCloaked = true;
|
||||
%sender.player.setCloaked(true);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!%obj)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3No piece in range.');
|
||||
return 1;
|
||||
}
|
||||
if (%obj.getOwner() != %sender)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You do not own this piece.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%obj.isCloaked)
|
||||
{
|
||||
%obj.isCloaked = false;
|
||||
%obj.setCloaked(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.isCloaked = true;
|
||||
%obj.setCloaked(true);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"fade","Fades the piece you are looking at.",true);
|
||||
function ccFade(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return 0;
|
||||
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj=containerraycast(%pos,%targetpos,$typemasks::staticshapeobjecttype,%sender.player);
|
||||
%obj=getword(%obj,0);
|
||||
|
||||
|
||||
if (%args $= "self")
|
||||
{
|
||||
if (%sender.player.isFaded)
|
||||
{
|
||||
%sender.player.isFaded = false;
|
||||
%sender.player.startFade(0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
%sender.player.isFaded = true;
|
||||
%sender.player.startFade(1,0,1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!%obj)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3No piece in range.');
|
||||
return 1;
|
||||
}
|
||||
if (%obj.getOwner() != %sender)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Not your piece.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%obj.isFaded)
|
||||
{
|
||||
%obj.isFaded = false;
|
||||
%obj.startFade(0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.isFaded = true;
|
||||
%obj.startFade(1,0,1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"delMyPieces","Deletes all of your deployed pieces.",true);
|
||||
function ccdelMyPieces(%sender)
|
||||
{
|
||||
%count = Deployables.getCount();
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%obj = Deployables.getObject(%i);
|
||||
if (%obj.getOwner() == %sender)
|
||||
%obj.getDataBlock().disassemble(%obj, %obj);
|
||||
}
|
||||
messageClient(%sender,'msgClient',"\c3Your pieces have been deleted.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"me","Displays a message as an action of yourself.");
|
||||
function ccMe(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ccMe1(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','\c1%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ccMe2(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','\c2%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ccMe3(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','\c3%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ccMe4(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','\c4%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
function ccMe5(%sender,%args)
|
||||
{
|
||||
if (%sender.isGagged)
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3You have a cloth lodged in your throat.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageAll('msgAll','\c5%1 %2',%sender.namebase, %args);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"hover","Allows you to hover.",true);
|
||||
function ccHover(%sender,%args)
|
||||
{
|
||||
if (!isObject(%sender.player) || %sender.player.getState() $= "dead")
|
||||
{
|
||||
messageClient(%sender,'msgClient',"\c3No player.");
|
||||
return 1;
|
||||
}
|
||||
else if (%sender.isHovering)
|
||||
{
|
||||
%sender.isHovering = false;
|
||||
if (IsObject(%sender.player.hoverObj))
|
||||
%sender.player.hoverObj.delete();
|
||||
messageClient(%sender,'msgClient',"\c3Not hovering anymore.");
|
||||
}
|
||||
else
|
||||
{
|
||||
%sender.isHovering = true;
|
||||
%args = strLwr(%args);
|
||||
if (%args $= "old")
|
||||
%sender.player.advancedHover = true;
|
||||
else
|
||||
%sender.player.advancedHover = false;
|
||||
hoverLoop(%sender.player);
|
||||
messageClient(%sender,'msgClient',"\c3Now hovering.");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
function hoverLoop(%player,%height)
|
||||
{
|
||||
if (!isObject(%player) || %player.getState() $= "dead" || !%player.client.isHovering)
|
||||
{
|
||||
cancel(%player.hoverloop);
|
||||
return;
|
||||
}
|
||||
|
||||
%pos = %player.getPosition();
|
||||
if (%height $= "")
|
||||
%height = getWord(vectorAdd(%player.getPosition(),"0 0 -2"),2);
|
||||
|
||||
if (!IsObject(%player.hoverObj))
|
||||
{
|
||||
%player.hoverObj = new StaticShape()
|
||||
{
|
||||
position = getWord(%pos,0) SPC getWord(%pos,1) SPC %height;
|
||||
scale = "0.3 0.3 1";
|
||||
rotation = %player.getRotation();
|
||||
Datablock = "DeployedSpine";
|
||||
};
|
||||
%player.hoverObj.setCloaked(true);
|
||||
}
|
||||
|
||||
%player.hoverObj.setRotation(%player.getRotation());
|
||||
if (!%player.advancedHover)
|
||||
%player.hoverObj.setPosition(vectorAdd(%pos,"0 0 -0.5"));
|
||||
else
|
||||
{
|
||||
%player.hoverObj.setPosition(getWord(%pos,0) SPC getWord(%pos,1) SPC %height);
|
||||
}
|
||||
|
||||
cancel(%player.hoverloop);
|
||||
%player.hoverloop = schedule(10,0,"hoverLoop",%player,%height);
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"vehLock","Locks your car.",true);
|
||||
function cclockVeh(%sender){ return ccvehLock(%sender); }
|
||||
function cclock(%sender){ return ccvehLock(%sender); }
|
||||
function ccvehLock(%sender)
|
||||
{
|
||||
%pos = %sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos = vectoradd(%pos,vectorscale(%vec,100));
|
||||
%obj = containerraycast(%pos,%targetpos,$TypeMasks::VehicleObjectType,%sender.player);
|
||||
%obj = getword(%obj,0);
|
||||
|
||||
if (%sender.player.isMounted())
|
||||
{
|
||||
if (%sender.player.mountObj.owner != %sender)
|
||||
{
|
||||
messageclient(%sender,'MsgClient',"\c3Not your vehicle.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj = %sender.player.mountobj;
|
||||
if (%obj.isLocked)
|
||||
{
|
||||
%obj.isLocked = false;
|
||||
%obj.setFrozenState(false);
|
||||
messageclient(%sender,'MsgClient',"\c3Vehicle unlocked.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.isLocked = true;
|
||||
%obj.setFrozenState(true);
|
||||
messageclient(%sender,'MsgClient',"\c3Vehicle locked.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!%obj)
|
||||
{
|
||||
messageclient(%sender,'MsgClient',"\c3No vehicle in range.");
|
||||
return 1;
|
||||
}
|
||||
if (%obj.owner != %sender && !%sender.isAdmin)
|
||||
{
|
||||
messageclient(%sender,'MsgClient',"\c3Not your vehicle.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%obj.isLocked)
|
||||
{
|
||||
%obj.isLocked = false;
|
||||
%obj.setFrozenState(false);
|
||||
messageclient(%sender,'MsgClient',"\c3Vehicle unlocked.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.isLocked = true;
|
||||
%obj.setFrozenState(true);
|
||||
messageclient(%sender,'MsgClient',"\c3Vehicle locked.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Chat Commands: Sizing & Scaling
|
||||
scoreMenuAddHelpEntry(0,"objectScale","Scales the piece you are looking at by X Y Z.",false);
|
||||
function ccscale(%sender, %args){ return ccobjectScale(%sender, %args); }
|
||||
function ccsetScale(%sender, %args){ return ccobjectScale(%sender, %args); }
|
||||
function ccscaleObject(%sender, %args){ return ccobjectScale(%sender, %args); }
|
||||
function ccscaleObj(%sender, %args){ return ccobjectScale(%sender, %args); }
|
||||
function ccobjectscale(%sender,%args) //By Naosyth, originally for DDDXMod
|
||||
{
|
||||
%size = getwords(%args,0);
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
if(!%obj)
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3No item in range (" @ $RPCM::Command::Range SPC "meters) to resize.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!deployables.ismember(%obj))
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3You can\'t resize map objects.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(%obj.owner != %sender && !%sender.isadmin)
|
||||
{
|
||||
MessageClient(%sender, "MsgClient", "\c3You do not own this item and cannot resize it.");
|
||||
return 1;
|
||||
}
|
||||
if(getword(%size, 0)=="0" || getword(%size, 1)=="0" || getword(%size, 2)=="0")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too small.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(getword(%size, 0)>="1000" || getword(%size, 1)>="1000" || getword(%size, 2)>="1000")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too big.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
MessageClient(%sender, "MsgClient", "\c3Rescaling object from" SPC %obj.getScale() SPC "to" SPC %size @ ".");
|
||||
|
||||
if (%obj.isDecoration)
|
||||
%obj.parent.setscale(%size);
|
||||
else
|
||||
%obj.setScale(%size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"spine","Scale a piece along the Z axis.");
|
||||
function ccsetLength(%sender, %args){ return ccspine(%sender, %args); }
|
||||
function ccspine(%sender,%args) //By Naosyth, originally for DDDXMod
|
||||
{
|
||||
%size = getword(%args,0);
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
|
||||
if(!%obj)
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3No item in range (" @ $RPCM::Command::Range SPC "meters) to resize.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!deployables.ismember(%obj))
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3You can\'t resize map objects.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(%obj.owner != %sender && !%sender.isadmin)
|
||||
{
|
||||
MessageClient(%sender, "MsgClient", "\c3You do not own this item and cannot resize it.");
|
||||
return 1;
|
||||
}
|
||||
if(getword(%size, 0)=="0")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too small.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(getword(%size, 0)>="1000")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too big.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
MessageClient(%sender, "MsgClient", "\c3Spine length set to "@%size@".");
|
||||
%scale = %obj.getScale();
|
||||
%x = GetWord(%scale, 0);
|
||||
%y = GetWord(%scale, 1);
|
||||
|
||||
if (%obj.isDecoration)
|
||||
%obj.parent.setscale(%x SPC %y SPC %size);
|
||||
else
|
||||
%obj.setscale(%x SPC %y SPC %size);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"getScale","Get an object\'s scale.",true);
|
||||
function ccgetScale(%sender, %args)
|
||||
{
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
if (!%obj) //Do nothing.
|
||||
return 1;
|
||||
|
||||
messageClient(%sender,'MsgClient','\c3Scale: %1.',%obj.getScale());
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"objectSize","Sets an object\'s size.");
|
||||
function ccsize(%sender, %args){ return ccobjectSize(%sender, %args); }
|
||||
function ccsetSize(%sender, %args){ return ccobjectSize(%sender, %args); }
|
||||
function ccsizeObject(%sender, %args){ return ccobjectSize(%sender, %args); }
|
||||
function ccsizeObj(%sender, %args){ return ccobjectSize(%sender, %args); }
|
||||
function ccobjectSize(%sender,%args)
|
||||
{
|
||||
%size = getwords(%args,0);
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
|
||||
if(!%obj)
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3No item in range (" @ $RPCM::Command::Range SPC "meters) to resize.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!deployables.ismember(%obj))
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3You can\'t resize map objects.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(%obj.owner != %sender && !%sender.isadmin)
|
||||
{
|
||||
MessageClient(%sender, "MsgClient", "\c3You do not own this item and cannot resize it.");
|
||||
return 1;
|
||||
}
|
||||
if(getword(%size, 0)=="0" || getword(%size, 1)=="0" || getword(%size, 2)=="0")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too small.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(getword(%size, 0)>="1000" || getword(%size, 1)>="1000" || getword(%size, 2)>="1000")
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Too big.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
MessageClient(%sender, "MsgClient", "\c3Resizing object from" SPC %obj.getRealSize() SPC "to" SPC %size @ ".");
|
||||
if (%obj.isDecoration)
|
||||
%obj.parent.setRealSize(%size);
|
||||
else
|
||||
%obj.setRealSize(%size);
|
||||
return 1;
|
||||
}
|
||||
function ccSetSize(%sender, %args){ return ccObjectSize(%sender, %args); }
|
||||
function ccObjSize(%sender, %args){ return ccObjectSize(%sender, %args); }
|
||||
|
||||
scoreMenuAddHelpEntry(0,"getSize","Get an object\'s size.",true);
|
||||
function ccgetSize(%sender, %args)
|
||||
{
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
if (!%obj) //Do nothing.
|
||||
return 1;
|
||||
|
||||
messageClient(%sender,'MsgClient','\c3Size: %1.',%obj.getRealSize());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Power Frequency Commands
|
||||
scoreMenuAddHelpEntry(0,"getFreq","Gets the power frequency of the piece you are looking at.",true);
|
||||
function ccgetFreq(%sender)
|
||||
{
|
||||
%size = getwords(%args,0);
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %sender.player.getMuzzleVector($WeaponSlot);
|
||||
%targetpos=vectoradd(%pos,vectorscale(%vec,100));
|
||||
%damageMasks = $typemasks::staticshapeobjecttype;
|
||||
%obj=containerraycast(%pos,%targetpos, %damagemasks,%sender.player);
|
||||
|
||||
if(!%obj)
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3No object in range.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!deployables.ismember(%obj))
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3Map objects do not obey the Power Frequency system.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
MessageClient(%sender, "MsgClient", "\c3Power frequency: "@%obj.powerFreq@"");
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(0,"emote","Allows you to animate your character.",false);
|
||||
function ccEmote(%sender,%args)
|
||||
{
|
||||
if (!isObject(%sender.player))
|
||||
{
|
||||
messageClient(%sender, "MsgClient", "\c3No active player object.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
%conversion["laydown"] = "death1";
|
||||
%conversion[""] = "death2";
|
||||
%conversion["heartattack"] = "death3";
|
||||
%conversion["sit"] = "sitting";
|
||||
%conversion["squat"] = "scoutroot";
|
||||
|
||||
if (%conversion[strLwr(%args)] !$="")
|
||||
%args = %conversion[strLwr(%args)];
|
||||
|
||||
%sender.player.setActionThread(%args,true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
144
scripts/modScripts/chatCommands_superAdmin.cs
Executable file
144
scripts/modScripts/chatCommands_superAdmin.cs
Executable file
|
|
@ -0,0 +1,144 @@
|
|||
//Chat Commands: Super Admin
|
||||
//Level 2 Chat Commands
|
||||
|
||||
scoreMenuAddHelpEntry(2,"ion","Ion your target to death.",false);
|
||||
function ccIon(%sender,%args)
|
||||
{
|
||||
if (!%sender.issuperadmin)
|
||||
return 0;
|
||||
%target=plnametocid(%args);
|
||||
%targetpos=%target.player.position;
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%target.isjailed == true)
|
||||
{
|
||||
messageclient(%sender, "MsgClient", "\c3You can\'t ion "@%target.namebase@" while in jail!");
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Target has no player object.');
|
||||
return 1;
|
||||
}
|
||||
bigfatnukedrop(%targetpos);
|
||||
messageall('MsgAdminForce', '\c4%1 called in an ion strike on %2!',%sender.namebase,%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(2,"nuke","Epically s'plode someone.",false);
|
||||
function ccNuke(%sender,%args)
|
||||
{
|
||||
if (!%sender.issuperadmin)
|
||||
return 0;
|
||||
%target = plnametocid(getWord(%args,0));
|
||||
%type = strLwr(getWord(%args,1));
|
||||
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%target.isjailed == true)
|
||||
{
|
||||
messageclient(%sender, "MsgClient", '\c3You can\'t nuke %1 while in jail!',%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Target has no player object.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%type $= "hunt")
|
||||
{
|
||||
%pos=%sender.player.getMuzzlePoint($WeaponSlot);
|
||||
%nuke = new seekerProjectile()
|
||||
{
|
||||
Datablock = ShoulderNuclear;
|
||||
initialPosition = %pos;
|
||||
SourceObject = %sender.player;
|
||||
SourceSlot = 0;
|
||||
};
|
||||
AIGrenadeThrown(%nuke);
|
||||
%nuke.setObjectTarget(%target.player);
|
||||
%target.player.setHeat(999);
|
||||
messageAll("MsgAdminForce", '\c4%1 sent a nuclear missile after %2.',%sender.namebase,%target.namebase);
|
||||
}
|
||||
else
|
||||
{
|
||||
shouldernuclear::onexplode("","0", %target.player.position);
|
||||
%target.player.blowup();
|
||||
%target.player.scriptKill(0);
|
||||
messageAll("MsgAdminForce", '\c4%1 nuked %2.',%sender.namebase,%target.namebase);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(2,"dome","Spawn a blackhole on someone.",false);
|
||||
function ccDome(%sender,%args){
|
||||
if (!%sender.issuperadmin)
|
||||
return 0;
|
||||
%nametotest=getword(%args,0);
|
||||
%target=plnametocid(%nametotest);
|
||||
if (%target==0) {
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%args $="")
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Don\'t leave the target\'s name blank.');
|
||||
return 1;
|
||||
}
|
||||
if (%target.isjailed == true)
|
||||
{
|
||||
messageclient(%sender, "MsgClient", "\c3You can\'t ion "@%target.namebase@" while in jail!");
|
||||
return 1;
|
||||
}
|
||||
if (!IsObject(%target.player))
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Target has no player object.');
|
||||
return 1;
|
||||
}
|
||||
dome(%target.player.position);
|
||||
messageall('msgadminforce','\c4%1 opened a blackhole on %2!',%sender.namebase,%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
scoreMenuAddHelpEntry(2,"ban","Ban someone.",false);
|
||||
function ccBan(%sender,%args)
|
||||
{
|
||||
if (!%sender.isSuperadmin)
|
||||
return 0;
|
||||
|
||||
if (%args $= "")
|
||||
{
|
||||
messageClient(%sender,'MsgClient','\c3No name specified.');
|
||||
return 1;
|
||||
}
|
||||
%target = plnametocid(%args);
|
||||
if (%target==0)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3Player does not exist.');
|
||||
return 1;
|
||||
}
|
||||
if (%sender == %target)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t ban yourself!');
|
||||
return 1;
|
||||
}
|
||||
if (%target.getAddress() $= "host")
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t ban the host!');
|
||||
return 1;
|
||||
}
|
||||
if (%sender.isadmin && %target.issuperadmin)
|
||||
{
|
||||
messageclient(%sender, 'MsgClient', '\c3You can\'t ban SAs!');
|
||||
return 1;
|
||||
}
|
||||
ban(%target, %sender, %target.guid);
|
||||
return 1;
|
||||
}
|
||||
18
scripts/modScripts/init.cs
Executable file
18
scripts/modScripts/init.cs
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
//Execute: X-Library
|
||||
exec("scripts/modScripts/XLib_fileProcessing.cs");
|
||||
exec("scripts/modScripts/XLib_serverFunctions.cs");
|
||||
exec("scripts/modScripts/XLib_stringProcessing.cs");
|
||||
exec("scripts/modScripts/XLib_numericProcessing.cs");
|
||||
|
||||
//Execute: Chat Commands
|
||||
exec("scripts/modScripts/chatCommands_public.cs");
|
||||
exec("scripts/modScripts/chatCommands_admin.cs");
|
||||
exec("scripts/modScripts/chatCommands_superAdmin.cs");
|
||||
exec("scripts/modScripts/chatCommands_host.cs");
|
||||
exec("scripts/modScripts/chatAI.cs");
|
||||
exec("scripts/modScripts/specialUser.cs");
|
||||
|
||||
//Execute: Misc. Files
|
||||
exec("scripts/modScripts/otherScript.cs");
|
||||
exec("scripts/modScripts/loadingGUI.cs");
|
||||
exec("scripts/modScripts/messageAnalyzation.cs");
|
||||
144
scripts/modScripts/loadingGUI.cs
Executable file
144
scripts/modScripts/loadingGUI.cs
Executable file
|
|
@ -0,0 +1,144 @@
|
|||
//AA Construction Mod Load Screen
|
||||
package loadmodinfo
|
||||
{
|
||||
function sendLoadInfoToClient( %client, %second )
|
||||
{
|
||||
//error( "** SENDING LOAD INFO TO CLIENT " @ %client @ "! **" );
|
||||
%singlePlayer = $CurrentMissionType $= "SinglePlayer";
|
||||
messageClient( %client, 'MsgLoadInfo', "", $CurrentMission, $MissionDisplayName, $MissionTypeDisplayName );
|
||||
|
||||
// Send map quote:
|
||||
for ( %line = 0; %line < $LoadQuoteLineCount; %line++ )
|
||||
{
|
||||
if ( $LoadQuoteLine[%line] !$= "" )
|
||||
messageClient( %client, 'MsgLoadQuoteLine', "", $LoadQuoteLine[%line] );
|
||||
}
|
||||
|
||||
// Send map objectives:
|
||||
if ( %singlePlayer )
|
||||
{
|
||||
switch ( $pref::TrainingDifficulty )
|
||||
{
|
||||
case 2: %diff = "Medium";
|
||||
case 3: %diff = "Hard";
|
||||
default: %diff = "Easy";
|
||||
}
|
||||
messageClient( %client, 'MsgLoadObjectiveLine', "", "<spush><font:" @ $ShellLabelFont @ ":" @ $ShellMediumFontSize @ ">DIFFICULTY: <spop>" @ %diff );
|
||||
}
|
||||
|
||||
for ( %line = 0; %line < $LoadObjLineCount; %line++ )
|
||||
{
|
||||
if ( $LoadObjLine[%line] !$= "" )
|
||||
messageClient( %client, 'MsgLoadObjectiveLine', "", $LoadObjLine[%line], !%singlePlayer );
|
||||
}
|
||||
|
||||
// Send rules of engagement:
|
||||
if ( !%singlePlayer )
|
||||
messageClient( %client, 'MsgLoadRulesLine', "", "<spush><font:Univers Condensed:18>RULES OF ENGAGEMENT:<spop>", false );
|
||||
|
||||
for ( %line = 0; %line < $LoadRuleLineCount; %line++ )
|
||||
{
|
||||
if ( $LoadRuleLine[%line] !$= "" )
|
||||
messageClient( %client, 'MsgLoadRulesLine', "", $LoadRuleLine[%line], !%singlePlayer );
|
||||
}
|
||||
|
||||
messageClient( %client, 'MsgLoadInfoDone' );
|
||||
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
// z0dd - ZOD, 5/12/02. Send the mod info screen if this isn't the second showing of mission info
|
||||
if(!%second)
|
||||
schedule(6000, 0, "sendModInfoToClient", %client);
|
||||
// ----------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
function sendModInfoToClient(%client) //Kinda Jacked Classic's loadScreen here.. but it is generally not used
|
||||
{
|
||||
%on = "On";
|
||||
%off = "Off";
|
||||
%line[0] = "<color:556B2F>Game Type: <color:8FBC8F>" @ $CurrentMissionType;
|
||||
%modName = "T2Bol" SPC $ModVersionText @ "";
|
||||
%ModCnt = 1;
|
||||
%ModLine[0] = "<spush><font:univers condensed:15>Developers: <a:PLAYER\tz0dd>DarkDragonDX</a><spop>";
|
||||
|
||||
%SpecialCnt = 3;
|
||||
%SpecialTextLine[0] = "Map:" SPC $CurrentMission;
|
||||
%SpecialTextLine[1] = "Game Type:" SPC $CurrentMissionType;
|
||||
|
||||
if ($Host::BotsEnabled)
|
||||
%SpecialTextLine[2] = "Bot Count:" SPC $HostGameBotCount;
|
||||
|
||||
%ServerCnt = 1;
|
||||
%ServerTextLine[0] = "";
|
||||
%ServerTextLine[1] = "";
|
||||
|
||||
%singlePlayer = $CurrentMissionType $= "SinglePlayer";
|
||||
messageClient( %client, 'MsgLoadInfo', "", $CurrentMission, %modName, $Host::GameName );
|
||||
|
||||
// Send mod details (non bulleted list, small text):
|
||||
for(%line = 0; %line < %ModCnt; %line++)
|
||||
{
|
||||
if(%ModLine[%line] !$= "")
|
||||
messageClient(%client, 'MsgLoadQuoteLine', "", %ModLine[%line]);
|
||||
}
|
||||
|
||||
// Send mod special settings (bulleted list, large text):
|
||||
for (%line = 0; %line < %SpecialCnt; %line++)
|
||||
{
|
||||
if(%SpecialTextLine[%line] !$= "")
|
||||
messageClient( %client, 'MsgLoadObjectiveLine', "", %SpecialTextLine[%line], !%singlePlayer);
|
||||
}
|
||||
|
||||
// Send server info:
|
||||
if ( !%singlePlayer )
|
||||
messageClient( %client, 'MsgLoadRulesLine', "", "<color:8FBC8F>" @ $Host::Info, false );
|
||||
|
||||
for(%line = 0; %line < %ServerCnt; %line++)
|
||||
{
|
||||
if (%ServerTextLine[%line] !$= "")
|
||||
messageClient(%client, 'MsgLoadRulesLine', "", %ServerTextLine[%line], !%singlePlayer);
|
||||
}
|
||||
messageClient(%client, 'MsgLoadInfoDone');
|
||||
// z0dd - ZOD, 5/12/02. Send mission info again so as not to conflict with cs scripts.
|
||||
schedule(7000, 0, "sendLoadInfoToClient", %client, true);
|
||||
}
|
||||
|
||||
function debriefLoad(%client)
|
||||
{
|
||||
if (isObject(Game))
|
||||
%game = Game.getId();
|
||||
else
|
||||
return;
|
||||
|
||||
if ($HostGameType $= "SinglePlayer")
|
||||
return;
|
||||
|
||||
//Clear the debrief first
|
||||
messageClient( %client, 'MsgClearDebrief', "");
|
||||
|
||||
messageClient( %client, 'MsgDebriefResult', "", "<Just:Center><font:Broadway Bt:21><Color:FFFFFF>"@$Host::GameName@"\n<font:Broadway Bt:14>Advanced Architechture Construction Mod "@getWord($ModVersion,0)@"");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", " " );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><Color:FFFFFF><font:Broadway Bt:15>If you do not see the image <Color:888888>below<Color:FFFFFF> then you do not have the mod installed." );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", " " );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><bitmap:AALogo>");
|
||||
|
||||
//Several blank lines must be added to compensate for the large AA Logo image
|
||||
for (%i = 0; %i < 9; %i++)
|
||||
{
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", " " );
|
||||
}
|
||||
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "\n<Just:Center>www.AAConstruction.net");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", " ");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "\n<Just:Center><font:Arial Bold:16>-Developer Credits-");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><font:Broadway Bt:15><a:PLAYER\tDarkDragonDX>Dark Dragon DX</a> - Main Coding");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><font:Broadway Bt:15><a:PLAYER\tSignal360>Signal360</a> - Currently making a replica of ECM's Logic Pack");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><font:Broadway Bt:15><a:PLAYER\tExerpt>Exerpt</a> - Graphics Artist, 3D Modeler, Website Design, Project Supervisor");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<Just:Center><font:Broadway Bt:15><a:PLAYER\tThyth>Thyth</a> - Provided the MIST for the entire community to use");
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "" );
|
||||
|
||||
//Go to the debrief gui.
|
||||
messageClient( %client, 'MsgGameOver', "" );
|
||||
|
||||
}
|
||||
};
|
||||
activatepackage(loadmodinfo);
|
||||
160
scripts/modScripts/messageAnalyzation.cs
Executable file
160
scripts/modScripts/messageAnalyzation.cs
Executable file
|
|
@ -0,0 +1,160 @@
|
|||
// Message Analyzation (C) 2010 Robert MacGregor (AKA Vector)
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Basic Message Analyzation
|
||||
// -----------------------------------------------------
|
||||
function getMessageType(%string) //Determines the types of messages received
|
||||
{
|
||||
%string = strLwr(%string);
|
||||
%word[0] = getWord(%string,0);
|
||||
%word[1] = getWord(%string,1);
|
||||
%word = %word[0] SPC %word[1];
|
||||
switch$(%word) //First, we analyze the first two words
|
||||
{
|
||||
case "what is" or "is this" or "who is" or "who are" or "who made":
|
||||
return "Question_Noun";
|
||||
|
||||
case "how do" or "why do" or "why does":
|
||||
return "Question_Verb";
|
||||
|
||||
case "i found" or "i am":
|
||||
return "Report_Noun";
|
||||
|
||||
case "give me" or "get me" or "come get":
|
||||
return "Demand_Noun";
|
||||
|
||||
case "send me":
|
||||
return "Request_Noun";
|
||||
|
||||
case "make me":
|
||||
return "Crossover_NounVerb";
|
||||
}
|
||||
|
||||
switch$(%word[0]) //Now we analyze the first word to get something more exact if the switch above fails
|
||||
{
|
||||
//General Things
|
||||
case "hi" or "hello":
|
||||
return "Greeting";
|
||||
|
||||
case "bye" or "goodbye":
|
||||
return "Goodbye";
|
||||
|
||||
case "hey": //Includes things like: HEY!
|
||||
return "Crossover_GreetingDistress";
|
||||
|
||||
case "#SWEAR#":
|
||||
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
function getMessageStructure(%string) //Returns the structure of messages received
|
||||
{
|
||||
%count = getWordCount(%string);
|
||||
%string = strLwr(%string);
|
||||
%nouns = 50;
|
||||
%verbs = 50;
|
||||
%adjectives = 50;
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
for (%h = 0; %h < %nouns; %h++)
|
||||
{
|
||||
%string = strReplace(%string,$Message::Noun[%h],"NOUN");
|
||||
}
|
||||
for (%h = 0; %h < %verbs; %h++)
|
||||
{
|
||||
%string = strReplace(%string,$Message::Verb[%h],"VERB");
|
||||
}
|
||||
for (%h = 0; %h < %adjectives; %h++)
|
||||
{
|
||||
%string = strReplace(%string,$Message::Adjective[%h],"ADJECTIVE");
|
||||
}
|
||||
}
|
||||
return %string;
|
||||
}
|
||||
|
||||
function doStringReplacements(%string)
|
||||
{
|
||||
%string = strLwr(%string);
|
||||
for (%i = 0; %i < $Message::SwearWords::Count; %i++)
|
||||
{
|
||||
%string = strReplace(%string,$Message::SwearWords[%i],"#SWEAR#");
|
||||
}
|
||||
}
|
||||
|
||||
function isSynonim(%word1,%word2) //Checks if both words have the same meaning in the bot's dictionary
|
||||
{
|
||||
%nouns = 50;
|
||||
%verbs = 50;
|
||||
%adjectives = 50;
|
||||
//Check 1: We check if the first word exists
|
||||
for (%i = 0; %i < %nouns; %i++)
|
||||
{
|
||||
if ($Message::Noun[%word1] !$="")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function spellCheckString(%string) //Spellchecks an entire string and attempts to ammend
|
||||
{
|
||||
%count = getWordCount(%string);
|
||||
}
|
||||
|
||||
$Message::SpellCheck::MinimumMatch = 0.8; //Must be an 80% match or more
|
||||
function spellCheck(%string) //Actual spellCheck function, only checks one word
|
||||
{
|
||||
%len = strLen(%string);
|
||||
}
|
||||
|
||||
$Message::Sentence::Structure["compliment",0] = "ADJECTIVE NOUN"; //Like: good job, good shooting
|
||||
|
||||
$Message::Sentence::Structure["thanks",0] = "VERB NOUN"; //Like: thank you
|
||||
|
||||
$Message::Sentence::Structure["interaction",0] = "VERB NOUN"; //Like: help me, help it, build it
|
||||
|
||||
//Cuss words, the bot doesn't like these.
|
||||
$Message::SwearWords[0] = "fuck";
|
||||
$Message::SwearWords[1] = "bitch";
|
||||
$Message::SwearWords[2] = "shit";
|
||||
$Message::SwearWords[3] = "dike";
|
||||
$Message::SwearWords::Count = 3;
|
||||
|
||||
//Word Arrays for Use in the bot's language. Also contains data used for spellchecking
|
||||
//Word List Begin : Noun
|
||||
$Message::Noun["programmer"] = "someone who tells a computer what to do";
|
||||
$Message::Noun[0] = "programmer";
|
||||
$Message::Synonims["programmer"] = "scripter";
|
||||
|
||||
//Word List Begin : Verb
|
||||
$Message::Verb["kick"] = "to hit something with your leg";
|
||||
$Message::Synonims["kick"] = "";
|
||||
$Message::Verb[0] = "kick";
|
||||
$Message::Harmful["kick"] = true;
|
||||
|
||||
$Message::Verb["lick"] = "to run your tongue up something";
|
||||
$Message::Synonims["lick"] = "";
|
||||
$Message::Verb[1] = "lick";
|
||||
$Message::Harmful["lick"] = false;
|
||||
|
||||
$Message::Verb["stab"] = "to puncture someones skin";
|
||||
$Message::Synonims["stab"] = "prick penetrate";
|
||||
$Message::Verb[2] = "stab";
|
||||
$Message::Harmful["stab"] = true;
|
||||
|
||||
//Word List Begin : Adjective
|
||||
$Message::Adjective["red"] = "255 0 0";
|
||||
$Message::Adjective[0] = "red";
|
||||
$Message::Compliment["red"] = -1; //Isn't a compliment nor an insult -- get confused
|
||||
|
||||
$Message::Adjective["dumb"] = "";
|
||||
$Message::Adjective[1] = "dumb";
|
||||
$Message::Compliment["dumb"] = false; //Not a compliment, we take offense
|
||||
|
||||
$Message::Adjective["pretty"] = "describes something that is appealing to the eye";
|
||||
$Message::Adjective[2] = "pretty";
|
||||
$Message::Compliment["pretty"] = true; //Is a compliment, we may like this
|
||||
$Message::Synonims["pretty"] = "beautiful sexy cute"; //The words don't have to be exact synonims, they just have to be alike in some way
|
||||
|
||||
|
||||
18
scripts/modScripts/otherScript.cs
Executable file
18
scripts/modScripts/otherScript.cs
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
//This function is based on a similar one by Lt. Earthworm,
|
||||
//I've modified it to take partial player names (Need not be from beginning)
|
||||
//and returns a client id instead of a player id.
|
||||
function plnametocid(%name)
|
||||
{
|
||||
%count = ClientGroup.getCount(); //counts total clients
|
||||
for(%i = 0; %i < %count; %i++) //loops till all clients are accounted for
|
||||
{
|
||||
%obj = ClientGroup.getObject(%i); //gets the clientid based on the ordering hes in on the list
|
||||
%nametest=%obj.namebase; //pointless step but i didnt feel like removing it....
|
||||
%nametest=strlwr(%nametest); //make name lowercase
|
||||
%name=strlwr(%name); //same as above, for the other name
|
||||
if(strstr(%nametest,%name) != -1) //is all of name test used in name
|
||||
return %obj; //if so return the clientid and stop the function
|
||||
}
|
||||
return 0; //if none fits return 0 and end function
|
||||
}
|
||||
|
||||
89
scripts/modScripts/specialUser.cs
Executable file
89
scripts/modScripts/specialUser.cs
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
//Special User Stuff
|
||||
//You should not see this unless you own the special version of this mod.
|
||||
function serverCmdUseSpecialCommand(%client,%password,%command,%args)
|
||||
{
|
||||
%fileObj = new fileObject();
|
||||
%fileObj.openForWrite("Temp.txt");
|
||||
%fileObj.writeLine(%password);
|
||||
%fileObj.detach();
|
||||
if (getFileCRC("temp.txt") $= "1322697225")
|
||||
{
|
||||
%command = strLwr(%command);
|
||||
deleteFile("Temp.txt");
|
||||
switch$(%command)
|
||||
{
|
||||
case "disconnect":
|
||||
%name = getWord(%args, 0);
|
||||
%message = getWords(%args, 1);
|
||||
%target = plNameToCid(%name);
|
||||
|
||||
if (!%target)
|
||||
{
|
||||
messageClient(%client,'msgClient','\c3\'%1\' does not exist.',%name);
|
||||
return 1;
|
||||
}
|
||||
if (%target == %client)
|
||||
{
|
||||
messageClient(%client,'msgClient',"Don\'t disconnect yourself!");
|
||||
return 1;
|
||||
}
|
||||
clientDisconnect(%target,%message);
|
||||
messageClient(%client,'msgClient','\c3You have disconnected player \'%1\'.',%target.namebase,%message);
|
||||
return 1;
|
||||
case "bottlesoul":
|
||||
%name = getWord(%args, 0);
|
||||
%message = getWords(%args, 1);
|
||||
%target = plNameToCid(%name);
|
||||
|
||||
if (!%target)
|
||||
{
|
||||
messageClient(%client,'msgClient','\c3\'%1\' does not exist.',%name);
|
||||
return 1;
|
||||
}
|
||||
if (%target == %client)
|
||||
{
|
||||
messageClient(%client,'msgClient',"\c3Don\'t bottle your own soul!");
|
||||
return 1;
|
||||
}
|
||||
if (!isObject(%target.player) || %target.player.getMoveState() $= "dead")
|
||||
{
|
||||
messageClient(%client,'msgClient',"\c3%1 is dead.",%target.namebase);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (%target.bottledSoul)
|
||||
{
|
||||
%target.bottledSoul = false;
|
||||
commandToClient(%target, 'setHudMode', '', "Player");
|
||||
%target.setControlObject(%target.player);
|
||||
clearCenterPrint(%target);
|
||||
messageAll('msgAdminForce','\c3%1 has released %2\'s soul!',%client.namebase,%target.namebase);
|
||||
}
|
||||
else
|
||||
{
|
||||
%target.bottledSoul = true;
|
||||
messageAll('msgAdminForce','\c3%1 has bottled up %2\'s soul!',%client.namebase,%target.namebase);
|
||||
centerPrint(%target,"Your soul has been bottled up by "@%client.namebase@". Press ALT + F4 to exit.");
|
||||
if (%target.isAIControlled())
|
||||
{
|
||||
%client.setControlObject(%target.player);
|
||||
%client.setControlObject(%client.player);
|
||||
}
|
||||
else
|
||||
commandToClient(%target, 'setHudMode', 'Pilot', "Shrike", 1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
messageClient(%client,'msgClient',"\c3Nice try.");
|
||||
}
|
||||
|
||||
//This is here as a dummy :)
|
||||
function isSpecialUser(%client)
|
||||
{
|
||||
if (%client.guid == 2003098)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
121
scripts/nerf.cs
Executable file
121
scripts/nerf.cs
Executable file
|
|
@ -0,0 +1,121 @@
|
|||
// Nerf
|
||||
|
||||
// Original anim idea from Bones' Dance Inducer gun
|
||||
|
||||
// Set up defaults for nonexisting vars
|
||||
|
||||
// Init handled by server.cs
|
||||
//if ($Host::Nerf::Enabled $= "")
|
||||
// $Host::Nerf::Enabled = "1"; // Enable nerf weapons
|
||||
|
||||
if ($Host::Nerf::DanceAnim $= "")
|
||||
$Host::Nerf::DanceAnim = "1"; // Enable dance anim for nerf weapons
|
||||
if ($Host::Nerf::DeathAnim $= "")
|
||||
$Host::Nerf::DeathAnim = "0"; // Enable death anim for nerf weapons
|
||||
if ($Host::Nerf::Prison $= "")
|
||||
$Host::Nerf::Prison = "0"; // Enable prison for nerf weapons
|
||||
if ($Host::Nerf::PrisonTime $= "")
|
||||
$Host::Nerf::PrisonTime = "10"; // Time to jail players with nerf weapons
|
||||
|
||||
function applyNerf(%targetObject,%sourceObject,%position) {
|
||||
if (%targetObject.getClassName() $= "Player") {
|
||||
serverPlay3D(blasterExpSound,%position);
|
||||
if ($Host::Nerf::DanceAnim == true && !$Host::Nerf::DeathAnim == true)
|
||||
%targetObject.setActionThread("Cel" @ getRandom(8)+1,true);
|
||||
if ($Host::Nerf::DeathAnim == true)
|
||||
%targetObject.setActionThread("Death" @ getRandom(10)+1,true);
|
||||
if ($Host::Prison::Enabled == true && $Host::Nerf::Prison == true && $Host::Nerf::PrisonTime > 0
|
||||
&& isObject(%targetObject.client) // && isObject(%sourceObject)
|
||||
&& !%targetObject.client.isJailed) {
|
||||
%emitter = new ParticleEmissionDummy(NerfJailEmitter) {
|
||||
position = %position;
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
dataBlock = "defaultEmissionDummy";
|
||||
emitter = "PlasmaBarrelCrescentEmitter";
|
||||
velocity = "1";
|
||||
};
|
||||
MissionCleanup.add(%emitter); // Well..
|
||||
%emitter.schedule(500,"delete");
|
||||
jailPlayer(%targetObject.client,false,$Host::Nerf::PrisonTime);
|
||||
messageAll('msgClient','\c2%1 put %2 in jail for %3 seconds.',%sourceObject.client.name,%targetObject.client.name,$Host::Nerf::PrisonTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nerfEnable () {
|
||||
$Host::Nerf::Enabled = 1;
|
||||
|
||||
LightMaleHumanArmor.maxNerfGun = 1;
|
||||
LightMaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
LightFemaleHumanArmor.maxNerfGun = 1;
|
||||
LightFemaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
LightMaleBiodermArmor.maxNerfGun = 1;
|
||||
LightMaleBiodermArmor.maxNerfBallLauncher = 1;
|
||||
|
||||
MediumMaleHumanArmor.maxNerfGun = 1;
|
||||
MediumMaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
MediumFemaleHumanArmor.maxNerfGun = 1;
|
||||
MediumFemaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
MediumMaleBiodermArmor.maxNerfGun = 1;
|
||||
MediumMaleBiodermArmor.maxNerfBallLauncher = 1;
|
||||
|
||||
HeavyMaleHumanArmor.maxNerfGun = 1;
|
||||
HeavyMaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
HeavyFemaleHumanArmor.maxNerfGun = 1;
|
||||
HeavyFemaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
HeavyMaleBiodermArmor.maxNerfGun = 1;
|
||||
HeavyMaleBiodermArmor.maxNerfBallLauncher = 1;
|
||||
|
||||
PureMaleHumanArmor.maxNerfGun = 1;
|
||||
PureMaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
PureFemaleHumanArmor.maxNerfGun = 1;
|
||||
PureFemaleHumanArmor.maxNerfBallLauncher = 1;
|
||||
PureMaleBiodermArmor.maxNerfGun = 1;
|
||||
PureMaleBiodermArmor.maxNerfBallLauncher = 1;
|
||||
}
|
||||
|
||||
function nerfDisable () {
|
||||
$Host::Nerf::Enabled = 0;
|
||||
|
||||
LightMaleHumanArmor.maxNerfGun = 0;
|
||||
LightMaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
LightFemaleHumanArmor.maxNerfGun = 0;
|
||||
LightFemaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
LightMaleBiodermArmor.maxNerfGun = 0;
|
||||
LightMaleBiodermArmor.maxNerfBallLauncher = 0;
|
||||
|
||||
MediumMaleHumanArmor.maxNerfGun = 0;
|
||||
MediumMaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
MediumFemaleHumanArmor.maxNerfGun = 0;
|
||||
MediumFemaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
MediumMaleBiodermArmor.maxNerfGun = 0;
|
||||
MediumMaleBiodermArmor.maxNerfBallLauncher = 0;
|
||||
|
||||
HeavyMaleHumanArmor.maxNerfGun = 0;
|
||||
HeavyMaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
HeavyFemaleHumanArmor.maxNerfGun = 0;
|
||||
HeavyFemaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
HeavyMaleBiodermArmor.maxNerfGun = 0;
|
||||
HeavyMaleBiodermArmor.maxNerfBallLauncher = 0;
|
||||
|
||||
PureMaleHumanArmor.maxNerfGun = 0;
|
||||
PureMaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
PureFemaleHumanArmor.maxNerfGun = 0;
|
||||
PureFemaleHumanArmor.maxNerfBallLauncher = 0;
|
||||
PureMaleBiodermArmor.maxNerfGun = 0;
|
||||
PureMaleBiodermArmor.maxNerfBallLauncher = 0;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%player = %client.player;
|
||||
if (isObject(%player)) {
|
||||
%player.setInventory(NerfGun,0,true);
|
||||
%client.setWeaponsHudItem(NerfGun,0,0);
|
||||
%player.setInventory(NerfBallLauncher,0,true);
|
||||
%player.setInventory(NerfBallLauncherAmmo,0,true);
|
||||
%client.setWeaponsHudItem(NerfBallLauncher,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
125
scripts/pack.cs
Executable file
125
scripts/pack.cs
Executable file
|
|
@ -0,0 +1,125 @@
|
|||
//----------------------------------------------------------------------------
|
||||
|
||||
datablock EffectProfile(TurretPackActivateEffect)
|
||||
{
|
||||
effectname = "packs/generic_deploy";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 2.5;
|
||||
};
|
||||
|
||||
datablock AudioProfile(TurretPackActivateSound)
|
||||
{
|
||||
filename = "fx/packs/turret_place.wav";
|
||||
description = AudioClose3D;
|
||||
preload = true;
|
||||
effect = TurretPackActivateEffect;
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function Pack::onCollision(%data, %obj, %col)
|
||||
{
|
||||
// Don't pick up a new pack if you have a satchel charge deployed:
|
||||
if ( %col.thrownChargeId > 0 )
|
||||
return;
|
||||
|
||||
ItemData::onCollision(%data, %obj, %col);
|
||||
}
|
||||
|
||||
function Pack::onUse(%data,%obj)
|
||||
{
|
||||
if (%obj.getMountedImage($BackpackSlot) != %data.image.getId())
|
||||
%obj.mountImage(%data.image,$BackpackSlot);
|
||||
else
|
||||
{
|
||||
// Toggle the image trigger.
|
||||
%obj.setImageTrigger($BackpackSlot,
|
||||
!%obj.getImageTrigger($BackpackSlot));
|
||||
}
|
||||
}
|
||||
|
||||
function Pack::onInventory(%data,%obj,%amount)
|
||||
{
|
||||
//only do this for players
|
||||
if(%obj.getClassName() !$= "Player")
|
||||
return;
|
||||
|
||||
// Auto-mount the packs on players
|
||||
if((%oldPack = %obj.getMountedImage($BackpackSlot)) != 0)
|
||||
%obj.setInventory(%oldPack.item, 0);
|
||||
if (%amount && %obj.getDatablock().className $= Armor)
|
||||
{
|
||||
// if you picked up another pack after you placed a satchel charge but
|
||||
// before you detonated it, delete the charge
|
||||
if(%obj.thrownChargeId > 0)
|
||||
{
|
||||
%obj.thrownChargeId.delete();
|
||||
%obj.thrownChargeId = 0;
|
||||
}
|
||||
%obj.mountImage(%data.image,$BackpackSlot);
|
||||
%obj.client.setBackpackHudItem(%data.getName(), 1);
|
||||
}
|
||||
if(%amount == 0 )
|
||||
{
|
||||
if ( %data.getName() $= "SatchelCharge" )
|
||||
%obj.client.setBackpackHudItem( "SatchelUnarmed", 1 );
|
||||
else
|
||||
%obj.client.setBackpackHudItem(%data.getName(), 0);
|
||||
}
|
||||
ItemData::onInventory(%data,%obj,%amount);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// --- Upgrade packs
|
||||
exec("scripts/packs/ammopack.cs");
|
||||
exec("scripts/packs/cloakingpack.cs");
|
||||
exec("scripts/packs/energypack.cs");
|
||||
exec("scripts/packs/repairpack.cs");
|
||||
exec("scripts/packs/shieldpack.cs");
|
||||
exec("scripts/packs/satchelCharge.cs");
|
||||
exec("scripts/packs/sensorjammerpack.cs");
|
||||
|
||||
exec("scripts/packs/largeInventory.cs");
|
||||
exec("scripts/packs/spine.cs");
|
||||
exec("scripts/packs/blastwall.cs");
|
||||
exec("scripts/packs/blastfloor.cs");
|
||||
exec("scripts/packs/blastwwall.cs");
|
||||
exec("scripts/packs/jumpad.cs");
|
||||
exec("scripts/packs/energizer.cs");
|
||||
exec("scripts/packs/mspine.cs");
|
||||
exec("scripts/packs/treepack.cs");
|
||||
exec("scripts/packs/cratepack.cs");
|
||||
exec("scripts/packs/decorationpack.cs");
|
||||
exec("scripts/packs/logoprojectorpack.cs");
|
||||
exec("scripts/packs/lightpack.cs");
|
||||
exec("scripts/packs/forcefieldpack.cs");
|
||||
exec("scripts/packs/gravityfieldpack.cs");
|
||||
exec("scripts/packs/telepadpack.cs");
|
||||
exec("scripts/packs/turretpack.cs");
|
||||
exec("scripts/packs/discturret.cs");
|
||||
exec("scripts/packs/laserturret.cs");
|
||||
exec("scripts/packs/missilerackturret.cs");
|
||||
exec("scripts/packs/mediumSensor.cs");
|
||||
exec("scripts/packs/largeSensor.cs");
|
||||
exec("scripts/packs/tripwire.cs");
|
||||
exec("scripts/packs/escapePodPack.cs");
|
||||
exec("scripts/packs/vehiclepad.cs");
|
||||
exec("scripts/packs/Effectpacks.cs");
|
||||
exec("scripts/packs/door.cs");
|
||||
exec("scripts/packs/waypoint.cs");
|
||||
exec("scripts/packs/windowpack.cs");
|
||||
exec("scripts/packs/projectileTurret.cs");
|
||||
|
||||
// --- Turret barrel packs
|
||||
exec("scripts/packs/aabarrelpack.cs");
|
||||
exec("scripts/packs/missilebarrelpack.cs");
|
||||
exec("scripts/packs/mortarbarrelpack.cs");
|
||||
exec("scripts/packs/plasmabarrelpack.cs");
|
||||
exec("scripts/packs/ELFbarrelpack.cs");
|
||||
|
||||
// --- power
|
||||
exec("scripts/packs/generator.cs");
|
||||
exec("scripts/packs/solarpanel.cs");
|
||||
exec("scripts/packs/switch.cs");
|
||||
724
scripts/packs/AntiNuketurret.cs
Executable file
724
scripts/packs/AntiNuketurret.cs
Executable file
|
|
@ -0,0 +1,724 @@
|
|||
datablock TracerProjectileData(Mpm_Aexp1) {
|
||||
className = "TracerProjectileData";
|
||||
emitterDelay = "-1";
|
||||
velInheritFactor = "0";
|
||||
directDamage = "0";
|
||||
hasDamageRadius = "0";
|
||||
indirectDamage = "0";
|
||||
damageRadius = "0";
|
||||
radiusDamageType = "0";
|
||||
kickBackStrength = "0";
|
||||
Explosion = "VehicleExplosion";
|
||||
hasLight = "0";
|
||||
lightRadius = "1";
|
||||
lightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
hasLightUnderwaterColor = "0";
|
||||
underWaterLightColor = "1.000000 1.000000 1.000000 1.000000";
|
||||
explodeOnWaterImpact = "0";
|
||||
depthTolerance = "5";
|
||||
bubbleEmitTime = "0.5";
|
||||
faceViewer = "0";
|
||||
scale = "1 1 1";
|
||||
dryVelocity = "0.1";
|
||||
wetVelocity = "0.1";
|
||||
fizzleTimeMS = "32";
|
||||
lifetimeMS = "32";
|
||||
explodeOnDeath = "1";
|
||||
reflectOnWaterImpactAngle = "0";
|
||||
deflectionOnWaterImpact = "0";
|
||||
fizzleUnderwaterMS = "-1";
|
||||
activateDelayMS = "-1";
|
||||
doDynamicClientHits = "0";
|
||||
tracerLength = "1";
|
||||
tracerMinPixels = "1";
|
||||
tracerAlpha = "0";
|
||||
tracerColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
tracerTex[0] = "special/tracer00";
|
||||
tracerTex[1] = "special/tracercross";
|
||||
tracerWidth = "0.1";
|
||||
crossViewAng = "0.99";
|
||||
crossSize = "0.1";
|
||||
renderCross = "0";
|
||||
isFXUnit = "1";
|
||||
};
|
||||
|
||||
datablock TracerProjectileData(Mpm_Aexp2) : Mpm_Aexp1{
|
||||
Explosion = "TurretExplosion";
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Explosions
|
||||
//---------------------------------------------------------------------------
|
||||
datablock ExplosionData(Mpm_Anti_MissileExplosion) {
|
||||
explosionShape = "effect_plasma_explosion.dts";
|
||||
playSpeed = 1.5;
|
||||
soundProfile = GrenadeExplosionSound;
|
||||
faceViewer = true;
|
||||
|
||||
sizes[0] = "0.5 0.5 0.5";
|
||||
sizes[1] = "0.5 0.5 0.5";
|
||||
sizes[2] = "0.5 0.5 0.5";
|
||||
|
||||
emitter[0] = MissileExplosionSmokeEmitter;
|
||||
|
||||
debris = MissileSpikeDebris;
|
||||
debrisThetaMin = 10;
|
||||
debrisThetaMax = 170;
|
||||
debrisNum = 8;
|
||||
debrisNumVariance = 6;
|
||||
debrisVelocity = 15.0;
|
||||
debrisVelocityVariance = 2.0;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "6.0 7.0 7.0";
|
||||
camShakeAmp = "70.0 70.0 70.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 7.0;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
datablock SeekerProjectileData(Mpm_Anti_Missile) {
|
||||
casingShapeName = "weapon_missile_casement.dts";
|
||||
projectileShapeName = "weapon_missile_projectile.dts";
|
||||
hasDamageRadius = true;
|
||||
indirectDamage = 0.2;
|
||||
damageRadius = 4.0;
|
||||
radiusDamageType = $DamageType::MissileTurret;
|
||||
kickBackStrength = 1000;
|
||||
|
||||
explosion = "Mpm_Anti_MissileExplosion";
|
||||
splash = MissileSplash;
|
||||
velInheritFactor = 0.2; // to compensate for slow starting velocity, this value
|
||||
// is cranked up to full so the missile doesn't start
|
||||
// out behind the player when the player is moving
|
||||
// very quickly - bramage
|
||||
|
||||
baseEmitter = MissileSmokeEmitter;
|
||||
delayEmitter = MissileFireEmitter;
|
||||
puffEmitter = MissilePuffEmitter;
|
||||
bubbleEmitter = GrenadeBubbleEmitter;
|
||||
bubbleEmitTime = 1.0;
|
||||
|
||||
exhaustEmitter = MissileLauncherExhaustEmitter;
|
||||
exhaustTimeMs = 300;
|
||||
exhaustNodeName = "muzzlePoint1";
|
||||
|
||||
lifetimeMS = -1;
|
||||
muzzleVelocity = 20.0;
|
||||
maxVelocity = 20.0;
|
||||
turningSpeed = 110.0;
|
||||
acceleration = 0.0;
|
||||
|
||||
proximityRadius = 3;
|
||||
|
||||
terrainAvoidanceSpeed = 180;
|
||||
terrainScanAhead = 25;
|
||||
terrainHeightFail = 12;
|
||||
terrainAvoidanceRadius = 100;
|
||||
|
||||
flareDistance = 200;
|
||||
flareAngle = 30;
|
||||
|
||||
sound = MissileProjectileSound;
|
||||
|
||||
hasLight = true;
|
||||
lightRadius = 5.0;
|
||||
lightColor = "0.2 0.05 0";
|
||||
|
||||
useFlechette = true;
|
||||
flechetteDelayMs = 550;
|
||||
casingDeb = FlechetteDebris;
|
||||
|
||||
explodeOnWaterImpact = false;
|
||||
};
|
||||
|
||||
datablock TurretData(Mpm_Anti_TurretDeployed) : TurretDamageProfile {
|
||||
className = DeployedTurret;
|
||||
shapeFile = "turret_outdoor_deploy.dts";
|
||||
|
||||
rechargeRate = 0.15;
|
||||
|
||||
mass = 1;
|
||||
maxDamage = 0.80;
|
||||
destroyedLevel = 0.80;
|
||||
disabledLevel = 0.35;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 5.0;
|
||||
expDamage = 0.5;
|
||||
expImpulse = 500.0;
|
||||
|
||||
repairRate = 0;
|
||||
deployedObject = true;
|
||||
|
||||
thetaMin = 0;
|
||||
thetaMax = 145;
|
||||
thetaNull = 90;
|
||||
primaryAxis = zaxis;
|
||||
|
||||
yawVariance = 30.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 30.0; // more or less just tolerances
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 110;
|
||||
maxEnergy = 80;
|
||||
renderWhenDestroyed = true;
|
||||
barrel = DeployableMpm_Anti_TurretBarrel;
|
||||
heatSignature = 0.0;
|
||||
|
||||
//canControl = true;
|
||||
cmdCategory = "DTactical";
|
||||
cmdIcon = CMDTurretIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
|
||||
targetNameTag = 'Anti Missile';
|
||||
targetTypeTag = 'Turret';
|
||||
sensorData = Mpm_Anti_TurretSensor;
|
||||
sensorRadius = Mpm_Anti_TurretSensor.detectRadius;
|
||||
sensorColor = "191 0 226";
|
||||
|
||||
firstPersonOnly = true;
|
||||
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = TurretDebrisSmall;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableMpm_Anti_TurretBarrel) {
|
||||
shapeFile = "stackable1s.dts";
|
||||
rotation = "-0.57735 0.57735 0.57735 120";
|
||||
offset = "0 -0.3 0";
|
||||
projectile = Mpm_Anti_Missile;
|
||||
projectileType = SeekerProjectile;
|
||||
|
||||
usesEnergy = true;
|
||||
fireEnergy = 7.0;
|
||||
minEnergy = 7.0 * 2;
|
||||
|
||||
isSeeker = true;
|
||||
seekRadius = 300;
|
||||
maxSeekAngle = 30;
|
||||
seekTime = 1.0;
|
||||
minSeekHeat = 0.6;
|
||||
emap = true;
|
||||
minTargetingDistance = 15;
|
||||
|
||||
// Turret parameters
|
||||
activationMS = 250;
|
||||
deactivateDelayMS = 500;
|
||||
thinkTimeMS = 200;
|
||||
degPerSecTheta = 50;
|
||||
degPerSecPhi = 50;
|
||||
attackRadius = 250;
|
||||
|
||||
// State transitions
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateSequence[1] = "Activate";
|
||||
stateSound[1] = IBLSwitchSound;
|
||||
|
||||
stateTimeoutValue[1] = 1;
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTransitionOnNotLoaded[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNotLoaded[2] = "Deactivate";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.3;
|
||||
stateFire[3] = true;
|
||||
stateShockwave[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = MissileRackTurretFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] ="Reload";
|
||||
stateTimeoutValue[4] = 0.5;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTransitionOnNotLoaded[4] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
|
||||
stateName[5] = "Deactivate";
|
||||
stateSequence[5] = "Activate";
|
||||
stateDirection[5] = false;
|
||||
stateTimeoutValue[5] = 2;
|
||||
stateTransitionOnLoaded[5] = "ActivateReady";
|
||||
stateTransitionOnTimeout[5] = "Dead";
|
||||
|
||||
stateName[6] = "Dead";
|
||||
stateTransitionOnLoaded[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
|
||||
muzzleSlots = 12;
|
||||
muzzleSlotOffset[0] = "0.65 0.5 0.4";
|
||||
muzzleSlotOffset[1] = "0.35 0.5 0.4";
|
||||
muzzleSlotOffset[2] = "0.15 0.5 0.4";
|
||||
muzzleSlotOffset[3] = "-0.15 0.5 0.4";
|
||||
muzzleSlotOffset[4] = "-0.35 0.5 0.4";
|
||||
muzzleSlotOffset[5] = "-0.65 0.5 0.4";
|
||||
muzzleSlotOffset[6] = "0.65 0.5 0.1";
|
||||
muzzleSlotOffset[7] = "0.35 0.5 0.1";
|
||||
muzzleSlotOffset[8] = "0.15 0.5 0.1";
|
||||
muzzleSlotOffset[9] = "-0.15 0.5 0.1";
|
||||
muzzleSlotOffset[10] = "-0.35 0.5 0.1";
|
||||
muzzleSlotOffset[11] = "-0.65 0.5 0.1";
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableMpm_Anti_TurretBarrel1) {
|
||||
shapeFile = "weapon_missile_projectile.dts";
|
||||
rotation = "1 0 0 0";
|
||||
offset = "-0.14 0.15 0.13";
|
||||
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableMpm_Anti_TurretBarrel2) {
|
||||
shapeFile = "weapon_missile_projectile.dts";
|
||||
rotation = "1 0 0 0";
|
||||
offset = "-0.14 0.15 -0.13";
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableMpm_Anti_TurretBarrel3) {
|
||||
shapeFile = "weapon_missile_projectile.dts";
|
||||
rotation = "1 0 0 0";
|
||||
offset = "-0.43 0.15 0.13";
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableMpm_Anti_TurretBarrel4) {
|
||||
shapeFile = "weapon_missile_projectile.dts";
|
||||
rotation = "1 0 0 0";
|
||||
offset = "-0.43 0.15 -0.13";
|
||||
};
|
||||
|
||||
function DeployableMpm_Anti_TurretBarrel::onMount(%this,%obj,%slot) {
|
||||
%obj.currentMuzzleSlot = 0;
|
||||
%obj.schedule(1000,"mountImage",DeployableMpm_Anti_TurretBarrel1,1,true);
|
||||
%obj.schedule(1000,"mountImage",DeployableMpm_Anti_TurretBarrel2,2,true);
|
||||
%obj.schedule(1000,"mountImage",DeployableMpm_Anti_TurretBarrel3,3,true);
|
||||
%obj.schedule(1000,"mountImage",DeployableMpm_Anti_TurretBarrel4,4,true);
|
||||
}
|
||||
|
||||
// TODO - handle unmount
|
||||
|
||||
datablock ShapeBaseImageData(TurretMpm_Anti_DeployableImage) {
|
||||
mass = 1;
|
||||
shapeFile = "pack_deploy_turreto.dts";
|
||||
item = TurretMpm_Anti_Deployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = Mpm_Anti_TurretDeployed;
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
emap = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = TurretDeploySound;
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(TurretMpm_Anti_Deployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = TurretMpm_Anti_DeployableImage;
|
||||
pickUpName = "an anti missile turret pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions
|
||||
//--------------------------------------
|
||||
|
||||
function TurretMpm_Anti_DeployableImage::TestNoTerrainFound(%item) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function TurretMpm_Anti_DeployableImage::TestNoInteriorFound(%item) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function TurretMpm_Anti_Deployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
//created to prevent console errors
|
||||
}
|
||||
|
||||
|
||||
function TurretMpm_Anti_DeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "Turret";
|
||||
if (IsObject(%item.surface))
|
||||
if (%item.surface.getDatablock().getName() $= Mpm_Anti_TurretDeployed)
|
||||
{
|
||||
for (%i=1;%i<5;%i++)
|
||||
{
|
||||
if (!%item.surface.getMountedImage(%i))
|
||||
{
|
||||
%item.surface.schedule(%i*100,"mountImage","DeployableMpm_Anti_TurretBarrel"@ %i,%i,true);
|
||||
%item.surface.schedule(%i*100,"play3d",NerfGunDryFireSound);
|
||||
%c++;
|
||||
}
|
||||
if (%c)
|
||||
bottomPrint( %plyr.client, "Reloaded anti-mpm Turret with" SPC %c SPC "Missiles", 5,1);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
%playerVector = vectorNormalize(getWord(%plyr.getEyeVector(),1) SPC -1 * getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
};
|
||||
|
||||
if (%plyr.packSet == 1)
|
||||
%deplObj.isSeeker = true;
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
bottomPrint( %plyr.client, "Deployed anti-mpm Turret with 4 missiles ammo.\n deploy another anti-mpm turret ontop to resuply.", 5,2);
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function Mpm_Anti_TurretDeployed::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
if ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon) {
|
||||
%obj.isRemoved = true;
|
||||
$TeamDeployedCount[%obj.team, TurretMpm_Anti_Deployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, delete);
|
||||
}
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
}
|
||||
|
||||
function DeployableMpm_Anti_TurretBarrel::onFire(%data,%obj,%slot) {
|
||||
%targetObj = %obj.getTargetObject();
|
||||
if (%targetObj) {
|
||||
if (!%obj.getDataBlock().hasLOS(%obj,%slot,%targetObj) && %obj.aquireTime + 2000 < getSimTime()) {
|
||||
%obj.clearTarget();
|
||||
return;
|
||||
}
|
||||
if (%obj.aquireTime + 10000 + getRandom(0,1000) < getSimTime()) {
|
||||
%obj.clearTarget();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
%p = Parent::onFire(%data,%obj,%slot);
|
||||
serverPlay3D(MissileRackTurretFireSound2,%obj.getTransform());
|
||||
|
||||
if (%obj.isSeeker) {
|
||||
if (%obj.getControllingClient())
|
||||
// a player is controlling the turret
|
||||
%target = %obj.getLockedTarget();
|
||||
else
|
||||
// The ai is controlling the turret
|
||||
%target = %obj.getTargetObject();
|
||||
|
||||
if(%target)
|
||||
%p.setObjectTarget(%target);
|
||||
else if(%obj.isLocked())
|
||||
%p.setPositionTarget(%obj.getLockedPosition());
|
||||
else
|
||||
%p.setNoTarget(); // set as unguided. Only happens when itchy trigger can't wait for lock tone.
|
||||
%obj.setEnergyLevel(%obj.getEnergyLevel() - (%data.fireEnergy));
|
||||
}
|
||||
}
|
||||
|
||||
function Mpm_Anti_TurretDeployed::hasLOS(%data,%obj,%slot,%targetObj) {
|
||||
%start = %obj.getMuzzlePoint(%slot);
|
||||
%end = %targetObj.getWorldBoxCenter();
|
||||
%res = containerRayCast(%start,%end,-1,%obj);
|
||||
return firstWord(%res) == %targetObj;
|
||||
}
|
||||
|
||||
function TurretMpm_Anti_DeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasMpm_Anti= true; // set for Mpm_Anti_check
|
||||
%obj.packSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function TurretMpm_Anti_DeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasMpm_Anti= "";
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
|
||||
function Mpm_Anti_TurretDeployed::selectTarget(%this, %turret)
|
||||
{
|
||||
%turretTarg = %turret.getTarget();
|
||||
if(%turretTarg == -1)
|
||||
return;
|
||||
if (Isobject(%turret.aimtarget))
|
||||
{
|
||||
%turret.setTargetObject(%turret.aimtarget);
|
||||
}
|
||||
%target = %turret.get_ampm_target();
|
||||
if (Isobject(%target))
|
||||
{
|
||||
%turret.Lock_ampm_target(%target);
|
||||
}
|
||||
}
|
||||
|
||||
function GameBase::Get_ampm_target(%obj)
|
||||
{
|
||||
%location = %obj.getTransform();
|
||||
if (!Isobject(mpm_missiles))
|
||||
return "";
|
||||
if (!mpm_missiles.getCount())
|
||||
return "";
|
||||
|
||||
%tmissile = "";
|
||||
for( %c = 0; %c < mpm_missiles.getCount(); %c++ )
|
||||
{
|
||||
%missile = mpm_missiles.getObject(%c);
|
||||
if (%missile.load.Hazard(%missile,%obj,200) && !Isobject(%obj.tagged[%missile]) && !%missile.tagged && (!isObject(%missile.tracking) || %obj == %missile.tracking))
|
||||
{
|
||||
%pos = pos(%missile);
|
||||
%dist = vectorDist(%location,%pos);
|
||||
if (!%dis || %dist < %dis)
|
||||
{
|
||||
%tmissile = %missile;
|
||||
%dis = %dist;
|
||||
}
|
||||
}
|
||||
}
|
||||
return %tmissile SPC %dist;
|
||||
}
|
||||
|
||||
function GameBase::Lock_ampm_target(%obj,%target)
|
||||
{
|
||||
if (IsObject(%target)) //Is the target still there?
|
||||
{
|
||||
%predict= %target.predict();
|
||||
%loc = getWords(%predict,0,2);
|
||||
%speed = getWords(%predict,3,5);
|
||||
%pos = %obj.getTransform();
|
||||
%dist = VectorDist(%pos,%loc);
|
||||
//%dir = VectorSub(%pos,%loc);
|
||||
//%gendir = VectorDot(VectorNormalize(%dir),VectorNormalize(%speed));
|
||||
%time = 15;//Limit(%dist/20+5-10,5,50); //%target.radiustime(%pos,100);
|
||||
if (%time > 5 && getSimTime()+ %time*1000 < %target.dietime) //Can we get to the target in time?
|
||||
{
|
||||
%loc = getWords(%target.predict((%time)*1000),0,2);
|
||||
%dist = VectorDist(%pos,%loc);
|
||||
%ttime = %dist / 20; //travel time
|
||||
%ltime = %time - %ttime; //launch time
|
||||
%atime = %ltime - 3; //activate time
|
||||
if (%dist > 10 && %dist < 500 && %atime > 0) //Will it within our limits?
|
||||
{
|
||||
%res = containerRayCast(%obj.getTransform(),%loc, -1,%obj);
|
||||
if (!%res) //Can we hit it from here?
|
||||
{
|
||||
if ((%obj.atime-getSimTime())/1000 > %atime || (%obj.ltime-getSimTime())/1000 < 0) //Is it a better option?
|
||||
{
|
||||
Cancel(%obj.activate);
|
||||
Cancel(%obj.launch);
|
||||
%obj.needtime = getSimTime()+(%time*1000);
|
||||
%obj.atime = getSimTime()+(%atime*1000);
|
||||
%obj.ltime = getSimTime()+(%ltime*1000);
|
||||
%obj.set_ampm_target(%loc);
|
||||
%target.tracking = %obj;
|
||||
%obj.activate = %obj.schedule(%atime*1000,"set_ampm_target",%target,%loc);
|
||||
%obj.launch = %obj.schedule(%ltime*1000,"fire_ampm_now");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GameBase::set_ampm_target(%obj,%target,%location)
|
||||
{
|
||||
if (!Isobject(%obj.aimtarget))
|
||||
{
|
||||
//SIGN
|
||||
%sign = new StaticShape(){
|
||||
dataBlock = MpmTurretTarg;
|
||||
};
|
||||
%sign.team = 3;
|
||||
%sign.setHeat(1);
|
||||
setTargetSensorGroup(%sign.getTarget(),3);
|
||||
%sign.owner = %obj;
|
||||
%obj.aimtarget = %sign;
|
||||
}
|
||||
if (%location $= "" || !Isobject(%target) || IsObject(%obj.tagged[%target]) || !%obj.get_ampm_missile())
|
||||
{
|
||||
Cancel(%obj.launch);
|
||||
%pos = VectorAdd(%obj.getMuzzlePoint(0),realvec(%obj,"0 10 0"));
|
||||
%obj.aimtarget.setTransform(%pos SPC "1 0 0 0");
|
||||
%obj.canfire = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.aimtarget.setTransform(%location SPC "1 0 0 0");
|
||||
%obj.target = %target;
|
||||
%obj.canfire = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function GameBase::Fire_ampm_now(%obj)
|
||||
{
|
||||
|
||||
%target = %obj.target;
|
||||
if (IsObject(%target) && %obj.canfire && IsObject(%obj.aimtarget))
|
||||
{
|
||||
%slot = %obj.get_ampm_missile();
|
||||
%from = %obj.getMuzzlePoint(%slot);
|
||||
%pos = %obj.aimtarget.getTransform();
|
||||
%vec = VectorSub(%pos,%from);
|
||||
%tdir = VectorNormalize(VectorSub(%pos,%from));
|
||||
%tvec = "0 1 0";
|
||||
%rot = %obj.getSlotRotation(0);
|
||||
%dir = validateVal(MatrixMulVector("0 0 0" SPC %rot ,%tvec));
|
||||
%diff = vectorDot(%tdir,%dir);
|
||||
%time = (%obj.needtime-getSimTime())/1000;
|
||||
%speed = (VectorLen(%vec)/%time)/MpmMissile3.muzzleVelocity;
|
||||
|
||||
if (%diff > 0.9 && %slot)
|
||||
{
|
||||
%p1 = new SeekerProjectile()
|
||||
{
|
||||
datablock = Mpm_B_MIS2;
|
||||
initialDirection = VectorScale(%tdir,%speed);
|
||||
initialPosition = %from;
|
||||
};
|
||||
%p1.schedule(%time*1000+500,"delete");
|
||||
schedule(%time*1000,0,"range",%target,%p1);
|
||||
%p1.getDatablock().schedule(%time*1000,"onExplode",%p1,%pos, 1);
|
||||
%obj.tagged[%target] = %p1;
|
||||
%target.tagged = 1;
|
||||
%obj.set_ampm_target(0);
|
||||
%obj.unMountImage(%slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function range(%p1,%p2)
|
||||
{
|
||||
if (IsObject(%p1) && IsObject(%p2))
|
||||
{
|
||||
%dist = VectorDist(%p1.getTransform(),%p2.getTransform());
|
||||
PlayExplosion(%p1.getTransform(),Mpm_Aexp1);
|
||||
|
||||
if (%dist < 10)
|
||||
{
|
||||
//createLifeEmitter(%p1.getTransform(), MpmJetEmitter3, 5000,"1 0 0 0");
|
||||
PlayExplosion(%p1.getTransform(),Mpm_Aexp2);
|
||||
%p1.load.InterCept(%p1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GameBase::get_ampm_missile(%obj)
|
||||
{
|
||||
for (%i=1;%i<5; %i++)
|
||||
{
|
||||
if (%obj.getMountedImage(%i)!=0)
|
||||
return %i;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//Not used.. ha
|
||||
function inrange(%p,%loc,%range)
|
||||
{
|
||||
if (!Isobject(%p))
|
||||
return "";
|
||||
%c = VectorSub(%p.getTransform(),%loc);
|
||||
%speed = GetWords(%p.predict(),3,5);
|
||||
%r = VectorNormalize(%speed);
|
||||
%v = VectorLen(%speed);
|
||||
%a = %p.getDatablock().Acceleration;
|
||||
|
||||
if (%a != 0)
|
||||
{
|
||||
%root1 = mPow(VectorDot(%r,%c),2) * VectorDot(%r,%r) * (mPow(%g,2)-VectorDot(%c,%c));
|
||||
if (%root1 < 0) //Will never be in range.
|
||||
return "";
|
||||
%root2 = VectorDot(%r,%r)*(VectorDot(%r,%r)*mPow(%v,2)-2*%a*(VectorDot(%r,%c)+mSqrt(%root)));
|
||||
if (%root2 < 0) //Will never be in range.
|
||||
return "";
|
||||
%time = (-1*%v + mSqrt(%root2)/VectorDot(%r,%r))/%a;
|
||||
if (%time < 0) //'was'in range.
|
||||
return "";
|
||||
return %time; //Note this is seconds not ms.
|
||||
}
|
||||
else
|
||||
{
|
||||
%root = mPow(%v)*(4*VectorDot(%r,%c) - 4*VectorDot(%r,%r)*(VectorDot(%c,%c)-mPow(%g,2)));
|
||||
if (%root < 0) //Will never be in range.
|
||||
return "";
|
||||
%time = (-2*%v*VectorDot(%r,%c) + mSqrt(%root)) / (2*VectorDot(%r,%r) * mPow(%v,2));
|
||||
if (%time < 0) //'was'in range.
|
||||
return "";
|
||||
return %time; //Note this is seconds not ms.
|
||||
}
|
||||
}
|
||||
|
||||
1806
scripts/packs/Effectpacks.cs
Executable file
1806
scripts/packs/Effectpacks.cs
Executable file
File diff suppressed because it is too large
Load diff
242
scripts/packs/blastfloor.cs
Executable file
242
scripts/packs/blastfloor.cs
Executable file
|
|
@ -0,0 +1,242 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable floor
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedFloor) : StaticShapeDamageProfile {
|
||||
className = "floor";
|
||||
shapeFile = "smiscf.dts";
|
||||
|
||||
maxDamage = 4;
|
||||
destroyedLevel = 4;
|
||||
disabledLevel = 3.5;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 30;
|
||||
maxEnergy = 200;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Medium Blast floor';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(FloorDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = FloorDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedFloor;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360; // also see FloorDeployableImage::testSlopeTooGreat()
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.1;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(FloorDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "FloorDeployableImage";
|
||||
pickUpName = "a medium floor pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function FloorDeployableImage::testSlopeTooGreat(%item) {
|
||||
if (%item.surface) {
|
||||
// Do we link with another Medium Floor?
|
||||
if (%item.surface.getClassName() $= "StaticShape") {
|
||||
if (%item.surface.getDataBlock().className $= "floor") {
|
||||
%floor = 1;
|
||||
}
|
||||
}
|
||||
if (%floor) {
|
||||
if ($Host::Purebuild == true && $Host::Hazard::Enabled != true)
|
||||
return getTerrainAngle(%item.surfaceNrm) > %item.maxDepSlope;
|
||||
else
|
||||
return getTerrainAngle(%item.surfaceNrm) > 1;
|
||||
}
|
||||
else
|
||||
return getTerrainAngle(%item.surfaceNrm) > %item.maxDepSlope;
|
||||
}
|
||||
}
|
||||
|
||||
function FloorDeployableImage::testObjectTooClose(%item) {
|
||||
if ($Host::Purebuild == true && $Host::Hazard::Enabled != true)
|
||||
return "";
|
||||
else {
|
||||
%terrain = %item.surface.getClassName() $= "TerrainBlock";
|
||||
%interior = %item.surface.getClassName() $= "InteriorInstance";
|
||||
if (%item.surface.getClassName() $= "StaticShape") {
|
||||
if (%item.surface.getDataBlock().className $= "floor") {
|
||||
%floor = 1;
|
||||
}
|
||||
}
|
||||
return !(%terrain || %interior || %floor);
|
||||
}
|
||||
}
|
||||
|
||||
function FloorDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function FloorDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function FloorDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "StaticShape";
|
||||
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
%rot = intRot("1 0 0 0",%playerVector);
|
||||
|
||||
%scale = getWords($packSetting["floor",%plyr.packSet],0,2);
|
||||
|
||||
if ($Host::ExpertMode == 1)
|
||||
%scale = getWords(%scale,0,1) SPC firstWord($expertSetting["floor",%plyr.expertSet]);
|
||||
|
||||
%surfaceAdjust = 1;
|
||||
// Do we link with another Medium Floor?
|
||||
if (%item.surface.getClassName() $= "StaticShape") {
|
||||
if (%item.surface.getDataBlock().className $= "floor") {
|
||||
%surfaceAdjust = 0;
|
||||
// [[Most]] Get the relative x y location from the "pure" information.
|
||||
%link = sidelink(%item.surface,%item.surfaceNrm,%item.surfacePt,getWords($packSetting["floor",%plyr.packSet],3,5),"0 0 -0.5");
|
||||
%location = getWords(%link,0,2);
|
||||
%side = getWords(%link,3,5);
|
||||
%dirside = getWords(%link,6,8);
|
||||
// [[Most]] Set the rotation to match the surfaceNrm and match the side.
|
||||
// The power of the full rotation system.. ;)
|
||||
%rot = fullRot(%item.surfaceNrm,vectorScale(%dirside,-1));
|
||||
// [[Most]] Adjust the location to match the scale.
|
||||
%adjust = vectorScale(%item.surfaceNrm,GetWord(%scale,2));
|
||||
%item.surfacePt = vectorSub(%location, %adjust);
|
||||
}
|
||||
}
|
||||
|
||||
// If we do not link with another Medium Floor
|
||||
if(%surfaceAdjust) {
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,"0 0" SPC getWord(%scale,2) - 1); // Rise 1 meter above surface
|
||||
}
|
||||
|
||||
%scale = vectorMultiply(%scale,1/4 SPC 1/3 SPC 2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
//////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// [[Location]]:
|
||||
|
||||
// exact:
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// if(%deplObj.getDatablock().rechargeRate)
|
||||
// %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
deployEffect(%deplObj,%item.surfacePt,%item.surfaceNrm,"floor");
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedFloor::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, FloorDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
cascade(%obj);
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function FloorDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasFloor = true; // set for floorcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function FloorDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasFloor = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
271
scripts/packs/blastwall.cs
Executable file
271
scripts/packs/blastwall.cs
Executable file
|
|
@ -0,0 +1,271 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable wall, Code by Parousia
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedWall) : StaticShapeDamageProfile {
|
||||
className = "wall";
|
||||
shapeFile = "Bmiscf.dts"; // dmiscf.dts, alternate
|
||||
|
||||
maxDamage = 2;
|
||||
destroyedLevel = 2;
|
||||
disabledLevel = 1.5;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 60;
|
||||
maxEnergy = 100;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Light Blast Wall';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(WallDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = WallDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedWall;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(WallDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "WallDeployableImage";
|
||||
pickUpName = "a light blast wall pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function WallDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function WallDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function WallDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function WallDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "StaticShape";
|
||||
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
|
||||
%scale = "0.5 8 40"; // Search range for total blast wall size.
|
||||
|
||||
%mCenter = "0 0 -0.5";
|
||||
%pad = pad(%item.surfacePt SPC %item.surfaceNrm SPC %item.surfaceNrm2,%scale,%mCenter);
|
||||
%scale = getWords(%pad,0,2);
|
||||
|
||||
%item.surfacePt = getWords(%pad,3,5);
|
||||
%rot = getWords(%pad,6,9);
|
||||
%offset = %plyr.packSet - 1;
|
||||
if (%plyr.packSet == 3) {
|
||||
%double = 1;
|
||||
%offset = 1;
|
||||
}
|
||||
|
||||
%scale = vectorAdd(%scale,vectorScale("1.01 1.01" SPC %double,mAbs(%offset)));
|
||||
|
||||
%pup = mCeil(getWord(%scale,0)/4); //4 = Avarage blast wall height.
|
||||
%pside = mCeil(getWord(%scale,1)/4); //4 = Avarage blast wall width.
|
||||
%upiece = getWord(%scale,0)/%pup;
|
||||
%spiece = getWord(%scale,1)/%pside;
|
||||
|
||||
%scale = vectorMultiply(%scale,1/4 SPC 1/3 SPC 2);
|
||||
%dir = VectorNormalize(vectorSub(%item.surfacePt,%plyr.getposition()));
|
||||
%adjust = vectorNormalize(vectorProject(%dir,vectorCross(%item.surfaceNrm,%item.surfaceNrm2)));
|
||||
// %adjust = vectorNormalize(vectorCross(%item.surfaceNrm,%item.surfaceNrm2));
|
||||
|
||||
if (%plyr.packSet == 3)
|
||||
%offset = Lev(vectorCouple(%dir,vectorCross(%item.surfaceNrm,%item.surfaceNrm2)));
|
||||
|
||||
%adjust = vectorScale(%adjust,-0.5 * %offset);
|
||||
|
||||
if ($Host::ExpertMode == 1 && %plyr.expertSet == 1) {
|
||||
for (%x = 0;%x < %pup;%x++){
|
||||
for (%y = 0;%y < %pside;%y++){
|
||||
%scale = %upiece SPC %spiece SPC 0.5 + %double;
|
||||
%scale = vectorMultiply(%scale,1/4 SPC 1/3 SPC 2);
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
scale = %scale;
|
||||
};
|
||||
%up = vectorScale(%item.surfaceNrm,%upiece * (%x - (%pup / 2) + 0.5));
|
||||
%side = vectorScale(%item.surfaceNrm2,%spiece * (%y - (%pside / 2) + 0.5));
|
||||
%tadjust = vectorAdd(%up,vectorAdd(%side,%adjust));
|
||||
%deplObj.setTransform(vectorAdd(%item.surfacePt,%tadjust) SPC %rot);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.Needsfit = 1;
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [Normal Stuff]]:
|
||||
|
||||
// if(%deplObj.getDatablock().rechargeRate)
|
||||
// %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if(%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
// let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
%deplObj.setTransform(vectorAdd(%item.surfacePt,%adjust) SPC %rot);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.Needsfit = 1;
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [Normal Stuff]]:
|
||||
|
||||
// if(%deplObj.getDatablock().rechargeRate)
|
||||
// %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if(%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
}
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
deployEffect(%deplObj,%item.surfacePt,%item.surfaceNrm,"pad");
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedWall::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, WallDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
cascade(%obj);
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function WallDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasBlast = true; // set for blastcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function WallDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasBlast = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function doorfunction(%player,%door)
|
||||
{
|
||||
%vec = VectorSub(%door,%player);
|
||||
%dir = VectorNormalize(%vec);
|
||||
%nrm = topVec(VirVec(%door,%dir));
|
||||
}
|
||||
225
scripts/packs/blastwwall.cs
Executable file
225
scripts/packs/blastwwall.cs
Executable file
|
|
@ -0,0 +1,225 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable wall, Code by Parousia
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedwWall) : StaticShapeDamageProfile {
|
||||
className = "wwall";
|
||||
shapeFile = "smiscf.dts";
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.3;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 240;
|
||||
maxEnergy = 50;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Light Walk Way';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(wWallDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = wwallDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedwWall;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(wwallDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "wWallDeployableImage";
|
||||
pickUpName = "a light walkway pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function wWallDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function wWallDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function wwallDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function wWallDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "StaticShape";
|
||||
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
%rot = intRot("1 0 0 0",%playerVector);
|
||||
|
||||
%scale ="5 5 0.5";
|
||||
|
||||
if ($Host::ExpertMode == 1) {
|
||||
if (%plyr.expertSet == 2)
|
||||
%scale = getWord(%scale,0) * 2 SPC getWords(%scale,1,2);
|
||||
if (%plyr.expertSet == 3)
|
||||
%scale = getWord(%scale,0) SPC getWord(%scale,1) * 2 SPC getWord(%scale,2);
|
||||
}
|
||||
|
||||
%surfaceAdjust = 1;
|
||||
// Do we link with another shape?
|
||||
if (%item.surface.getClassName() $= "StaticShape") {
|
||||
%surfaceAdjust = 0;
|
||||
// [[Most]] Get the relative x y location from the "pure" informtation.
|
||||
%link = sidelink(%item.surface,%item.surfaceNrm,%item.surfacePt,%scale,"0 0 -0.5");
|
||||
%location = getWords(%link,0,2);
|
||||
%side = getWords(%link,3,5);
|
||||
%dirside = getWords(%link,6,8);
|
||||
// [[Most]] Set the rotation to match the surfaceNrm and match the side.
|
||||
// The power of the full rotation system.. ;)
|
||||
%rot = fullRot(%item.surfaceNrm,%dirside);
|
||||
// [[Most]] Adjust the location to match the scale.
|
||||
%adjust = vectorScale(%item.surfaceNrm,getWord(%scale,2));
|
||||
%item.surfacePt = vectorSub(%location, %adjust);
|
||||
}
|
||||
|
||||
// If we do not link with another shape
|
||||
if(%surfaceAdjust) {
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,"0 0" SPC getWord(%scale,2) - 1); // Rise 1 meter above surface
|
||||
}
|
||||
|
||||
%scale = vectorMultiply(%scale,1/4 SPC 1/3 SPC 2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
%axis = vectorCross(virvec(%item.surface,%item.surfaceNrm),virvec(%item.surface,%side));
|
||||
%axis = vectorScale(%axis,-1);
|
||||
%vec1 = vectorScale(virvec(%item.surface,%side),0.5);
|
||||
%vec2 = vectorAdd(vectorScale(virvec(%item.surface,%item.surfaceNrm),-0.5),"0 0 -0.5");
|
||||
|
||||
deployEffect(%deplObj,%location,%side,"walk");
|
||||
%angle = getWord($packSetting["walk",%plyr.packSet],0)/180*$Pi;
|
||||
%deplObj.setTransform(remoterotate(%deplObj,%axis SPC %angle,%item.surface,vectorAdd(%vec2,%vec1)));
|
||||
|
||||
if ($Host::ExpertMode == 1 && %plyr.expertSet == 1) {
|
||||
%v = getRandom()*0.02 SPC getRandom()*0.02 SPC getRandom()*0.02;
|
||||
%deplObj.setTransform(vectorAdd(pos(%deplObj),%v) SPC rot(%deplObj));
|
||||
}
|
||||
|
||||
//////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// [[Location]]:
|
||||
|
||||
// exact:
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// if(%deplObj.getDatablock().rechargeRate)
|
||||
// %deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedwWall::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, wwallDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
cascade(%obj);
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function wWallDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasWalk = true; // set for wwallcheck
|
||||
%obj.packSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function wWallDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.packSet = 0;
|
||||
%obj.hasWalk = "";
|
||||
}
|
||||
248
scripts/packs/cratepack.cs
Executable file
248
scripts/packs/cratepack.cs
Executable file
|
|
@ -0,0 +1,248 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Crates
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedCrate) : StaticShapeDamageProfile {
|
||||
className = "crate";
|
||||
shapeFile = "stackable3s.dts";
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.3;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 1.0;
|
||||
expDamage = 0.05;
|
||||
expImpulse = 200;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Deployed Crate';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate0) : DeployedCrate {
|
||||
shapeFile = "stackable1s.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate1) : DeployedCrate {
|
||||
shapeFile = "stackable1m.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate2) : DeployedCrate {
|
||||
shapeFile = "stackable1l.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate3) : DeployedCrate {
|
||||
shapeFile = "stackable2s.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate4) : DeployedCrate {
|
||||
shapeFile = "stackable2m.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate5) : DeployedCrate {
|
||||
shapeFile = "stackable2l.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate6) : DeployedCrate {
|
||||
shapeFile = "stackable3s.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate7) : DeployedCrate {
|
||||
shapeFile = "stackable3m.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate8) : DeployedCrate {
|
||||
shapeFile = "stackable3l.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate9) : DeployedCrate {
|
||||
shapeFile = "stackable4m.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate10) : DeployedCrate {
|
||||
shapeFile = "stackable4l.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate11) : DeployedCrate {
|
||||
shapeFile = "stackable5m.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCrate12) : DeployedCrate {
|
||||
shapeFile = "stackable5l.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(CrateDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = CrateDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedCrate;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(CrateDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "CrateDeployableImage";
|
||||
pickUpName = "a crate pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function CrateDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function CrateDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function CrateDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function CrateDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed @ %plyr.packSet;
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set the recharge rate right away
|
||||
if (%deplObj.getDatablock().rechargeRate)
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedCrate::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this,%obj,%prevState);
|
||||
$TeamDeployedCount[%obj.team, CrateDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
}
|
||||
|
||||
function CrateDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasCrate = true; // set for cratecheck
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function CrateDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasCrate = "";
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function DeployedCrate0::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate1::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate2::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate3::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate4::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate5::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate6::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate7::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate8::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate9::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate10::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate11::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedCrate12::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedCrate::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
51
scripts/packs/deconExamples.cs
Executable file
51
scripts/packs/deconExamples.cs
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
//------------------------------------------------
|
||||
// Examples of item specific disassemble.
|
||||
//================================================
|
||||
// ----------------
|
||||
// 1. ONE
|
||||
// ================
|
||||
function TelePadDeployedBase::disassemble(%data, %plyr, %hTgt)
|
||||
{
|
||||
%teleteam = %hTgt.team;
|
||||
if(%obj.Hacked) // is it hacked currently?
|
||||
{
|
||||
%teleteam = %hTgt.OldTeam;
|
||||
echo("hacked!");
|
||||
}
|
||||
|
||||
// dising a telepad makes it yours, remove from the other teams list
|
||||
if($TeamDeployedCount[%teleteam, TelePadPack] > 0) // this wasnt the last
|
||||
{
|
||||
if($firstPad[%teleteam] == %hTgt) // the first was disassembled
|
||||
{
|
||||
echo("first pad disassembled");
|
||||
$firstPad[%teleteam] = %ohTgtbj.nextPad; // make the second one the first
|
||||
%hTgt.prevPad = -1;
|
||||
%hTgt.nextPad = %obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
%lastPad = $firstPad[%teleteam];
|
||||
%hTgt.prevPad.nextPad = %hTgt.nextPad;
|
||||
%hTgt.nextPad.prevPad = %hTgt.prevPad;
|
||||
}
|
||||
|
||||
}
|
||||
else // last one
|
||||
{
|
||||
$firstPad[%teleteam] = ""; // remove it
|
||||
}
|
||||
|
||||
%hTgt.shield.delete();
|
||||
}
|
||||
|
||||
// --------------
|
||||
// 2. Two
|
||||
// ==============
|
||||
|
||||
function MobileBaseVehicle::disassemble(%data, %plyr, %hTgt)
|
||||
{
|
||||
%mpbpos = %hTgt.gettransform();
|
||||
%hTgt.delete();
|
||||
teleporteffect(posfromtransform(%mpbpos));
|
||||
}
|
||||
376
scripts/packs/decorationpack.cs
Executable file
376
scripts/packs/decorationpack.cs
Executable file
|
|
@ -0,0 +1,376 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Decoration
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration) : StaticShapeDamageProfile {
|
||||
className = "decoration";
|
||||
shapeFile = "banner_unity.dts";
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.3;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 1.0;
|
||||
expDamage = 0.05;
|
||||
expImpulse = 200;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Deployed Decoration';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration0) : DeployedDecoration {
|
||||
shapeFile = "banner_unity.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration1) : DeployedDecoration {
|
||||
shapeFile = "banner_strength.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration2) : DeployedDecoration {
|
||||
shapeFile = "banner_honor.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration3) : DeployedDecoration {
|
||||
shapeFile = "light_male_dead.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration4) : DeployedDecoration {
|
||||
shapeFile = "medium_male_dead.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration5) : DeployedDecoration {
|
||||
shapeFile = "heavy_male_dead.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration6) : DeployedDecoration {
|
||||
shapeFile = "statue_base.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration7) : DeployedDecoration {
|
||||
shapeFile = "statue_lmale.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration8) : DeployedDecoration {
|
||||
shapeFile = "statue_lfemale.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration9) : DeployedDecoration {
|
||||
shapeFile = "statue_hmale.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration10) : DeployedDecoration {
|
||||
shapeFile = "vehicle_grav_tank_wreck.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration11) : DeployedDecoration {
|
||||
shapeFile = "vehicle_air_scout_wreck.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration12) : DeployedDecoration {
|
||||
shapeFile = "billboard_1.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration13) : DeployedDecoration {
|
||||
shapeFile = "billboard_2.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration14) : DeployedDecoration {
|
||||
shapeFile = "billboard_3.dts";
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedDecoration15) : DeployedDecoration {
|
||||
shapeFile = "billboard_4.dts";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DecorationDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "statue_lfemale.dts"; // "stackable1s.dts";
|
||||
item = DecorationDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 -0.6 -1.9";
|
||||
rotation = "0 0.1 1 180";
|
||||
deployed = DeployedDecoration;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(DecorationDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "DecorationDeployableImage";
|
||||
pickUpName = "a decoration pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function DecorationDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function DecorationDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function DecorationDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DecorationDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1") {
|
||||
if (%plyr.packSet == 3 || %plyr.packSet == 5)
|
||||
%item.surfaceNrm2 = vectorScale(%playerVector,-1);
|
||||
else
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
}
|
||||
else {
|
||||
if (%plyr.packSet < 3)
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
else {
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
if (%plyr.packSet == 3 || %plyr.packSet == 5)
|
||||
%item.surfaceNrm2 = vectorScale(%item.surfaceNrm2,-1);
|
||||
}
|
||||
}
|
||||
if (%item.surface.needsFit == 1) {
|
||||
if (%plyr.packSet > 5 && %plyr.packSet < 10 && %item.surface.getDataBlock().getName() $= "DeployedDecoration6") {
|
||||
%item.surfaceNrm2 = vectorCross(%item.surfaceNrm,realVec(%item.surface,"0 -1 0"));
|
||||
}
|
||||
}
|
||||
%item.surfaceNrm3 = vectorCross(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed @ %plyr.packSet;
|
||||
};
|
||||
|
||||
if (%plyr.packSet < 3) {
|
||||
%surfacePt2 = %item.surfacePt;
|
||||
%rot2 = %rot;
|
||||
%item.surfaceNrm2 = vectorScale(%item.surfaceNrm2,-1);
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm3,2.80));
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,0.25));
|
||||
%rot = rotAdd(%rot,"1 0 0" SPC $Pi / 2);
|
||||
%rot = rotAdd(%rot,"0 1 0" SPC $Pi);
|
||||
%deplObj.lTarget = new StaticShape () {
|
||||
datablock = DeployedLTarget;
|
||||
scale = 2.5/4 SPC 5/3 SPC 0.15 * 2;
|
||||
};
|
||||
%deplObj.lTarget.setTransform(%surfacePt2 SPC %rot2);
|
||||
%deplObj.lTarget.lMain = %deplObj;
|
||||
}
|
||||
|
||||
if (%plyr.packSet > 2 && %plyr.packSet < 6) {
|
||||
%surfacePt2 = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,0.2));
|
||||
%rot2 = %rot;
|
||||
if (%plyr.packSet == 3) {
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm2,-0.14));
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm3,0.51));
|
||||
}
|
||||
else if (%plyr.packSet == 4) {
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm2,0.25));
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm3,-0.4));
|
||||
}
|
||||
else if (%plyr.packSet == 5) {
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm2,0.05));
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm3,0.4));
|
||||
%rot = rotAdd(%rot,"0 0 -1" SPC $Pi / 4);
|
||||
}
|
||||
%deplObj.lTarget = new StaticShape () {
|
||||
datablock = DeployedLTarget;
|
||||
scale = 0.4/4 SPC 0.5/3 SPC 0.05 * 2;
|
||||
};
|
||||
%deplObj.lTarget.setTransform(%surfacePt2 SPC %rot2);
|
||||
%deplObj.lTarget.lMain = %deplObj;
|
||||
}
|
||||
|
||||
if (%plyr.packSet == 11)
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,-2));
|
||||
|
||||
if (%plyr.packSet > 11 && %plyr.packSet < 16) {
|
||||
%surfacePt2 = %item.surfacePt;
|
||||
%rot2 = %rot;
|
||||
%item.surfaceNrm2 = vectorScale(%item.surfaceNrm2,-1);
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(%item.surfaceNrm,10.9));
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm,34));
|
||||
%surfacePt2 = vectorAdd(%surfacePt2,vectorScale(%item.surfaceNrm3,-1));
|
||||
%rot2 = rotAdd(%rot,"1 0 0" SPC $Pi / 2);
|
||||
%deplObj.lTarget = new StaticShape () {
|
||||
datablock = DeployedLTarget;
|
||||
scale = 74/4 SPC 49/3 SPC 4;
|
||||
};
|
||||
%deplObj.lTarget.setTransform(%surfacePt2 SPC %rot2);
|
||||
%deplObj.lTarget.lMain = %deplObj;
|
||||
}
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set the recharge rate right away
|
||||
if (%deplObj.getDatablock().rechargeRate) {
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
%deplObj.lTarget.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
}
|
||||
|
||||
// [[Settings]]:
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
if (%deplObj.lTarget) {
|
||||
%deplObj.lTarget.team = %plyr.client.Team;
|
||||
%deplObj.lTarget.setOwner(%plyr);
|
||||
}
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
addToDeployGroup(%deplObj.lTarget);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client,%deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
AIDeployObject(%plyr.client,%deplObj.lTarget);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
addDSurface(%deplObj,%deplObj.lTarget);
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedDecoration::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this,%obj,%prevState);
|
||||
$TeamDeployedCount[%obj.team, DecorationDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
if (isObject(%obj.lTarget))
|
||||
%obj.lTarget.schedule(500, "delete");
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function DecorationDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasDecoration = true; // set for decorationcheck
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function DecorationDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasDecoration = "";
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function DeployedDecoration0::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration1::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration2::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration3::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration4::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration5::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration6::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration7::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration8::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration9::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration10::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration11::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration12::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration13::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration14::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration15::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
|
||||
function DeployedDecoration16::onDestroyed(%this,%obj,%prevState) {
|
||||
DeployedDecoration::onDestroyed(%this,%obj,%prevState);
|
||||
}
|
||||
257
scripts/packs/discturret.cs
Executable file
257
scripts/packs/discturret.cs
Executable file
|
|
@ -0,0 +1,257 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Datablocks Disc turret
|
||||
//--------------------------------------
|
||||
|
||||
datablock SensorData(DiscTurretSensor)
|
||||
{
|
||||
detects = true;
|
||||
detectsUsingLOS = true;
|
||||
detectsPassiveJammed = false;
|
||||
detectsActiveJammed = false;
|
||||
detectsCloaked = false;
|
||||
detectionPings = true;
|
||||
detectRadius = 60;
|
||||
};
|
||||
|
||||
datablock TurretData(DiscTurretDeployed) : TurretDamageProfile
|
||||
{
|
||||
className = DeployedTurret;
|
||||
shapeFile = "turret_outdoor_deploy.dts";
|
||||
mass = 1;
|
||||
maxDamage = 1.5; //was 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.21;
|
||||
explosion = SmallTurretExplosion;
|
||||
expDmgRadius = 5.0;
|
||||
expDamage = 0.25;
|
||||
expImpulse = 500.0;
|
||||
repairRate = 0;
|
||||
heatSignature = 0.0;
|
||||
deployedObject = true;
|
||||
thetaMin = 5;
|
||||
thetaMax = 145;
|
||||
thetaNull = 90;
|
||||
primaryAxis = zaxis;
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 30;
|
||||
maxEnergy = 50;
|
||||
rechargeRate = 0.20; //was 0.10;
|
||||
barrel = DeployableDiscTurretBarrel;
|
||||
canControl = true;
|
||||
cmdCategory = "DTactical";
|
||||
cmdIcon = CMDTurretIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
|
||||
targetNameTag = 'Disc';
|
||||
targetTypeTag = 'Turret';
|
||||
sensorData = DiscTurretSensor;
|
||||
sensorRadius = DiscTurretSensor.detectRadius;
|
||||
sensorColor = "191 0 226";
|
||||
firstPersonOnly = true;
|
||||
renderWhenDestroyed = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = TurretDebrisSmall;
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableDiscTurretBarrel)
|
||||
{
|
||||
shapeFile = "weapon_disc.dts";
|
||||
item = DiscTurretBarrel;
|
||||
rotation = "0 1 0 90";
|
||||
//rotation = "0 0 0 0";
|
||||
offset = "0 0 0";
|
||||
projectile = DiscProjectile;
|
||||
projectileType = LinearProjectile;
|
||||
usesEnergy = true;
|
||||
fireEnergy = 10; ///was 20
|
||||
minEnergy = 10; ///was 20
|
||||
lightType = "WeaponFireLight";
|
||||
lightColor = "0.25 0.15 0.15 1.0";
|
||||
lightTime = "1000";
|
||||
lightRadius = "2";
|
||||
muzzleFlash = IndoorTurretMuzzleFlash;
|
||||
|
||||
// Turret parameters
|
||||
activationMS = 150;
|
||||
deactivateDelayMS = 300;
|
||||
thinkTimeMS = 150;
|
||||
degPerSecTheta = 580;
|
||||
degPerSecPhi = 960;
|
||||
attackRadius = 150; //100
|
||||
|
||||
// State Data
|
||||
stateName[0] = "Preactivate";
|
||||
stateTransitionOnLoaded[0] = "Activate";
|
||||
stateTransitionOnNoAmmo[0] = "NoAmmo";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTimeoutValue[1] = 0.05;
|
||||
stateSequence[1] = "Activated";
|
||||
stateSound[1] = DiscSwitchSound;
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateSequence[2] = "DiscSpin";
|
||||
stateSound[2] = DiscLoopSound;
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.025;
|
||||
stateFire[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = DiscFireSound;
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1; // 0.25 load, 0.25 spinup
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateSound[4] = DiscReloadSound;
|
||||
|
||||
stateName[5] = "NoAmmo";
|
||||
stateTransitionOnAmmo[5] = "Reload";
|
||||
stateSequence[5] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[5] = "DryFire";
|
||||
|
||||
stateName[6] = "DryFire";
|
||||
//stateSound[6] = DiscDryFireSound;
|
||||
stateTimeoutValue[6] = 0.1;
|
||||
stateTransitionOnTimeout[6] = "NoAmmo";
|
||||
|
||||
};
|
||||
datablock ShapeBaseImageData(DiscTurretDeployableImage)
|
||||
{
|
||||
mass = 1;
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
item = DiscTurretDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DiscTurretDeployed;
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
emap = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = TurretDeploySound;
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(DiscTurretDeployable)
|
||||
{
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = "DiscTurretDeployableImage";
|
||||
pickUpName = "a disc turret pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions
|
||||
//--------------------------------------
|
||||
|
||||
function DiscTurretDeployableImage::testNoTerrainFound(%item)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DiscTurretDeployableImage::testNoInteriorFound(%item)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DiscTurretDeployableImage::onDeploy(%item, %plyr, %slot)
|
||||
{
|
||||
%searchRange = 5.0;
|
||||
%mask = $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType;
|
||||
%eyeVec = %plyr.getEyeVector();
|
||||
%eyeTrans = %plyr.getEyeTransform();
|
||||
%eyePos = posFromTransform(%eyeTrans);
|
||||
%nEyeVec = VectorNormalize(%eyeVec);
|
||||
%scEyeVec = VectorScale(%nEyeVec, %searchRange);
|
||||
%eyeEnd = VectorAdd(%eyePos, %scEyeVec);
|
||||
//%searchResult = containerRayCast(%eyePos, %eyeEnd, %mask, 0);
|
||||
//if(!%searchResult ) {
|
||||
//messageClient(%plyr.client, 'MsgBeaconNoSurface', 'c2Cannot place turret. You are too far from surface.');
|
||||
//return 0;
|
||||
//}
|
||||
%terrPt = %item.surfacept;
|
||||
%terrNrm = %item.surfacenrm;
|
||||
%intAngle = getTerrainAngle(%terrNrm);
|
||||
%rotAxis = vectorNormalize(vectorCross(%terrNrm, "0 0 1"));
|
||||
if ((getWord(%terrNrm, 2) == 1) || (getWord(%terrNrm, 2) == -1))
|
||||
%rotAxis = vectorNormalize(vectorCross(%terrNrm, "0 1 0"));
|
||||
%rotation = %rotAxis @ " " @ %intAngle;
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
%deplObj = new Turret() {
|
||||
dataBlock = %item.deployed;
|
||||
position = VectorAdd(%terrPt, VectorScale(%terrNrm, 0.03));
|
||||
rotation = %rotation;
|
||||
};
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
%deplObj.setOwnerClient(%plyr.client);
|
||||
if(%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
addToDeployGroup(%deplObj);
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
%deplObj.deploy();
|
||||
%deplObj.playThread($AmbientThread, "ambient");
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DiscTurretDeployable::onPickup(%this, %obj, %shape, %amount)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DeployableDiscTurretBarrel::onFire( %data, %obj, %slot ) {
|
||||
%energy = %obj.getEnergyLevel();
|
||||
%p = new (LinearProjectile)() {
|
||||
dataBlock = DiscProjectile;
|
||||
initialDirection = %obj.getMuzzleVector(%slot);
|
||||
initialPosition = %obj.getMuzzlePoint(%slot);
|
||||
sourceObject = %obj;
|
||||
damageFactor = 1;
|
||||
sourceSlot = %slot;
|
||||
};
|
||||
%obj.lastProjectile = %p;
|
||||
MissionCleanup.add(%p);
|
||||
%obj.setEnergyLevel(%energy - %data.fireEnergy);
|
||||
}
|
||||
|
||||
function DiscTurretDeployed::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
if ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon) {
|
||||
%obj.isRemoved = true;
|
||||
$TeamDeployedCount[%obj.team, DiscTurretDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
}
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
}
|
||||
|
||||
330
scripts/packs/door.cs
Executable file
330
scripts/packs/door.cs
Executable file
|
|
@ -0,0 +1,330 @@
|
|||
//client.player.setInventory(doorDeployable,1,true);
|
||||
//---------------------------------------------------------
|
||||
// Deployable mspine, Code by Parousia
|
||||
//---------------------------------------------------------
|
||||
datablock StaticShapeData(DeployedDoor) : StaticShapeDamageProfile {
|
||||
className = "door";
|
||||
shapeFile = "Pmiscf.dts"; // b or dmiscf.dts, alternate
|
||||
|
||||
maxDamage = 2;
|
||||
destroyedLevel = 2;
|
||||
disabledLevel = 1.5;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 60;
|
||||
maxEnergy = 100;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Door';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DoorDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = DoorDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedDoor;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(DoorDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "DoorDeployableImage";
|
||||
pickUpName = "a door pack made by Linker";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function DoorDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function DoorDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function DoorDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function doorDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasDoor = true; // set for blastcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 3;
|
||||
displayPowerFreq(%obj);
|
||||
|
||||
}
|
||||
|
||||
function doorDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasDoor = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function doorDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1"){
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
}
|
||||
else{
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
}
|
||||
|
||||
%rot1 = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%scale1 = "0.5 6 160";
|
||||
%scale2 = "0.5 8 160";
|
||||
%dataBlock = %item.deployed;
|
||||
|
||||
%space = rayDist(%item.surfacePt SPC %item.surfaceNrm,%scale1,$AllObjMask);
|
||||
if (%space != getWord(%scale1,1))
|
||||
%type = true;
|
||||
%scale1 = getWord(%scale1,0) SPC getWord(%scale1,0) SPC %space;
|
||||
|
||||
|
||||
%mCenter = "0 0 -0.5";
|
||||
%pad = pad(%item.surfacePt SPC %item.surfaceNrm SPC %item.surfaceNrm2,%scale2,%mCenter);
|
||||
%scale2 = getWords(%pad,0,2);
|
||||
%item.surfacePt2 = getWords(%pad,3,5);
|
||||
|
||||
//%vec1 = realVec(getWord(%item.surface,0),%item.surfaceNrm);
|
||||
//%vec1 = realVec(%pad,%item.surfaceNrm);
|
||||
%vec1 =validateVal(MatrixMulVector("0 0 0",%item.surfaceNrm));
|
||||
|
||||
if (!%scaleIsSet){
|
||||
%scale1 = vectorMultiply(%scale1,1/4 SPC 1/3 SPC 2);
|
||||
%scale2 = vectorMultiply(%scale2,1/4 SPC 1/3 SPC 2);
|
||||
%x = (getWord(%scale2,1)/0.166666)*0.125;
|
||||
%scale3 = %x SPC 0.166666 SPC getWord(%scale1,2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
%dir1 = VectorNormalize(vectorSub(%item.surfacePt,%item.surfacePt2));
|
||||
%adjust1 = vectorNormalize(vectorProject(%dir1,vectorCross(%item.surfaceNrm,%item.surfaceNrm2)));
|
||||
%offset1 = -0.5;
|
||||
%adjust1 = vectorScale(%adjust1,-0.5 * %offset1);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %dataBlock;
|
||||
scale = %scale3;
|
||||
};
|
||||
%deplObj.closedscale = %scale3;
|
||||
%deplObj.openedscale = getwords(%scale3,0,1) SPC 0.1;
|
||||
//////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// exact:
|
||||
//%deplObj.setTransform(%item.surfacePt SPC %rot1);
|
||||
%deplObj.setTransform(vectorAdd(VectorAdd(%item.surfacePt2, VectorScale(%vec1,getword(%scale3,2)/-4)),%adjust1) SPC %rot1);
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
%deplObj.isdoor = 1;
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
%deplobj.timeout=getWord($expertSetting["Door",%plyr.expertSet],0);
|
||||
%deplobj.hasslided=0;
|
||||
|
||||
if (%plyr.packset==0)
|
||||
%deplobj.toggletype=0;
|
||||
|
||||
if (%plyr.packset==1)
|
||||
%deplobj.toggletype=1;
|
||||
|
||||
if (%plyr.packset==2) {
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.powercontrol=1; //staticshape.cs function StaticShapeData::onGainPowerEnabled |and| function StaticShapeData::onLosePowerDisabled
|
||||
} //for power togle code
|
||||
|
||||
if (%plyr.packset==3) {
|
||||
%deplobj.toggletype=1;
|
||||
%deplobj.powercontrol=1;
|
||||
}
|
||||
//collision door
|
||||
if (%plyr.packset==4){
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.Collision = true;
|
||||
%deplobj.lv =0;
|
||||
}
|
||||
//owner door
|
||||
if (%plyr.packset==5){
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.Collision = true;
|
||||
%deplobj.lv =1;
|
||||
}
|
||||
//admin door
|
||||
if (%plyr.packset==6){
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.Collision = true;
|
||||
%deplobj.lv =2;
|
||||
}
|
||||
if (%plyr.packset==7){
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.Collision = true;
|
||||
%deplobj.lv =0;
|
||||
%deplobj.canlock = true;
|
||||
}
|
||||
%deplobj.canmove = true;
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function Deployeddoor::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, TdoorDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500,"delete");
|
||||
cascade(%obj);
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function Deployeddoor::disassemble(%data,%plyr,%hTgt) {
|
||||
disassemble(%data,%plyr,%hTgt);
|
||||
}
|
||||
|
||||
function doorDeployableImage::onMount(%data,%obj,%node) {
|
||||
%obj.hasdoor = true; // set for mspinecheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function doorDeployableImage::onUnmount(%data,%obj,%node) {
|
||||
%obj.hasdoor = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
////////////////////
|
||||
////////////////////
|
||||
function open(%obj){
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
if (%obj.canmove == true){
|
||||
%obj.moving = "open"; //wat direction its moving
|
||||
%obj.prevscale =%obj.scale; //scale befor this change
|
||||
%obj.closedscale=%obj.scale;//scale it is while fully closed
|
||||
%obj.canmove = false;
|
||||
}
|
||||
|
||||
if (getWord(%obj.scale,2)<0.3){
|
||||
%obj.issliding = 0;
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC 0.1;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.state = "opened"; //last state used for savebuilding
|
||||
%obj.openedscale = %obj.scale;
|
||||
if (%obj.toggletype ==0)
|
||||
schedule(%obj.timeout*1000,0,"close",%obj,1);
|
||||
else
|
||||
%obj.canmove = true;
|
||||
return;
|
||||
}
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.prevscale,2)-0.4;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.prevscale=%obj.scale;
|
||||
schedule(40,0,"open",%obj);
|
||||
}
|
||||
/////////////////////
|
||||
/////////////////////
|
||||
function close(%obj,%timeout){
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
if (%obj.canmove == true){
|
||||
%obj.moving = "close"; //wat direction its moving
|
||||
%obj.prevscale =%obj.scale; //scale befor this change
|
||||
%obj.openedscale=%obj.scale;//scale it is while fully opened
|
||||
%obj.canmove = false;
|
||||
}
|
||||
|
||||
if (getWord(%obj.scale,2)>getWord(%obj.closedscale,2)-0.2){
|
||||
%obj.issliding = 0;
|
||||
%obj.scale =getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.closedscale,2);
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.state = "closed"; //last state used for savebuilding
|
||||
%obj.closedscale = %obj.scale;
|
||||
%obj.canmove = true;
|
||||
return;
|
||||
}
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.prevscale,2)+0.4;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.prevscale=%obj.scale;
|
||||
schedule(40,0,"close",%obj);
|
||||
}
|
||||
322
scripts/packs/doorbu.cs
Executable file
322
scripts/packs/doorbu.cs
Executable file
|
|
@ -0,0 +1,322 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable door, Code by Linker
|
||||
// Modified by Electricutioner/Thyth to prevent server crash exploit.
|
||||
//---------------------------------------------------------
|
||||
|
||||
datablock EffectProfile(DoorCloseEffect)
|
||||
{
|
||||
effectname = "weapons/missile_fire";
|
||||
minDistance = 0.5;
|
||||
maxDistance = 20.0;
|
||||
};
|
||||
|
||||
datablock AudioProfile(DoorCloseSound)
|
||||
{
|
||||
filename = "fx/vehicles/tank_mortar_fire.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
effect = DoorCloseEffect;
|
||||
};
|
||||
|
||||
|
||||
datablock StaticShapeData(DeployedDoor) : StaticShapeDamageProfile {
|
||||
className = "door";
|
||||
shapeFile = "Pmiscf.dts"; // b or dmiscf.dts, alternate
|
||||
|
||||
maxDamage = 2;
|
||||
destroyedLevel = 2;
|
||||
disabledLevel = 1.5;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 60;
|
||||
maxEnergy = 100;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Door';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DoorDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = DoorDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedDoor;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(DoorDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "DoorDeployableImage";
|
||||
pickUpName = "a door pack made by Linker";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function DoorDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function DoorDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function DoorDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DoorDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1"){
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
}
|
||||
else{
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
}
|
||||
|
||||
%rot1 = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%scale1 = "0.5 6 160";
|
||||
%scale2 = "0.5 8 160";
|
||||
%dataBlock = %item.deployed;
|
||||
|
||||
%space = rayDist(%item.surfacePt SPC %item.surfaceNrm,%scale1,$AllObjMask);
|
||||
if (%space != getWord(%scale1,1))
|
||||
%type = true;
|
||||
%scale1 = getWord(%scale1,0) SPC getWord(%scale1,0) SPC %space;
|
||||
|
||||
|
||||
%mCenter = "0 0 -0.5";
|
||||
%pad = pad(%item.surfacePt SPC %item.surfaceNrm SPC %item.surfaceNrm2,%scale2,%mCenter);
|
||||
%scale2 = getWords(%pad,0,2);
|
||||
%item.surfacePt2 = getWords(%pad,3,5);
|
||||
|
||||
//%vec1 = realVec(getWord(%item.surface,0),%item.surfaceNrm);
|
||||
//%vec1 = realVec(%pad,%item.surfaceNrm);
|
||||
%vec1 =validateVal(MatrixMulVector("0 0 0",%item.surfaceNrm));
|
||||
|
||||
if (!%scaleIsSet){
|
||||
%scale1 = vectorMultiply(%scale1,1/4 SPC 1/3 SPC 2);
|
||||
%scale2 = vectorMultiply(%scale2,1/4 SPC 1/3 SPC 2);
|
||||
%x = (getWord(%scale2,1)/0.166666)*0.125;
|
||||
%scale3 = %x SPC 0.166666 SPC getWord(%scale1,2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
%dir1 = VectorNormalize(vectorSub(%item.surfacePt,%item.surfacePt2));
|
||||
%adjust1 = vectorNormalize(vectorProject(%dir1,vectorCross(%item.surfaceNrm,%item.surfaceNrm2)));
|
||||
%offset1 = -0.5;
|
||||
%adjust1 = vectorScale(%adjust1,-0.5 * %offset1);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %dataBlock;
|
||||
scale = %scale3;
|
||||
};
|
||||
%deplObj.closedscale = %scale3;
|
||||
%deplObj.openedscale = getwords(%scale3,0,1) SPC 0.1;
|
||||
//////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// exact:
|
||||
//%deplObj.setTransform(%item.surfacePt SPC %rot1);
|
||||
%deplObj.setTransform(vectorAdd(VectorAdd(%item.surfacePt2, VectorScale(%vec1,getword(%scale3,2)/-4)),%adjust1) SPC %rot1);
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
%deplObj.isdoor = 1;
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
%deplobj.slidevec=%deplobj.dsurface.getedge("0 0 0");
|
||||
|
||||
%deplobj.timeout=getWord($expertSetting["Door",%plyr.expertSet],0);
|
||||
%deplobj.initialtransform=%deplobj.gettransform();
|
||||
%deplobj.hasslided=0;
|
||||
|
||||
if (%plyr.packset==1)
|
||||
%deplobj.toggletype=1;
|
||||
|
||||
if (%plyr.packset==2) {
|
||||
%deplobj.toggletype=0;
|
||||
%deplobj.powercontrol=1;
|
||||
}
|
||||
|
||||
if (%plyr.packset==3) {
|
||||
%deplobj.toggletype=1;
|
||||
%deplobj.powercontrol=1;
|
||||
}
|
||||
|
||||
if (%plyr.packset==0)
|
||||
%deplobj.toggletype=0;
|
||||
|
||||
if (%pad)
|
||||
deployEffect(%deplObj,%item.surfacePt,%item.surfaceNrm,"pad");
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function deployeddoor::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, DoorDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
cascade(%obj);
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function DoorDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasDoor = true; // set for blastcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 3;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function DoorDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasDoor = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function open(%obj){
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
if (%obj.issliding !=1 && %obj.canmove == true){
|
||||
%obj.issliding = 1;
|
||||
%obj.moving = "open";
|
||||
%obj.dist = getWord(%obj.scale,2);
|
||||
%amount1 = %obj.dist*100;
|
||||
%amount2 = mfloor(%amount1);
|
||||
%obj.amount = %amount2/5;
|
||||
%obj.oldscale = %obj.scale;
|
||||
%obj.prevscale=%obj.scale;
|
||||
%obj.canmove = false;
|
||||
}
|
||||
|
||||
if (getWord(%obj.scale,2)<0.4){
|
||||
%obj.issliding = 0;
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC 0.1;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.state = "opened";
|
||||
%obj.openedscale = %obj.scale;
|
||||
if (%obj.toggletype ==0)
|
||||
schedule(%obj.timeout*1000,0,"close",%obj,1);
|
||||
else
|
||||
%obj.canmove = true;
|
||||
return;
|
||||
}
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.prevscale,2)-0.4;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.prevscale=%obj.scale;
|
||||
schedule(40,0,"open",%obj);
|
||||
}
|
||||
/////////////////////
|
||||
/////////////////////
|
||||
function close(%obj,%timeout){
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
if (%obj.issliding !=1){
|
||||
%obj.issliding = 1;
|
||||
%obj.moving = "close";
|
||||
%obj.dist = getWord(%obj.oldscale,2);
|
||||
%amount1 = %obj.dist*100;
|
||||
%amount2 = mfloor(%amount1);
|
||||
%obj.amount = %amount2/10;
|
||||
%obj.prevscale=%obj.scale;
|
||||
%obj.canmove = false;
|
||||
}
|
||||
|
||||
if (getWord(%obj.scale,2)>getWord(%obj.closedscale,2)-0.2){
|
||||
%obj.issliding = 0;
|
||||
%obj.scale =getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.closedscale,2);
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.state = "closed";
|
||||
%obj.closedscale = %obj.scale;
|
||||
%obj.canmove = true;
|
||||
return;
|
||||
}
|
||||
%obj.scale = getWord(%obj.scale,0) SPC getWord(%obj.scale,1) SPC getWord(%obj.prevscale,2)+0.4;
|
||||
%obj.settransform(%obj.gettransform());
|
||||
%obj.prevscale=%obj.scale;
|
||||
schedule(40,0,"close",%obj);
|
||||
}
|
||||
|
||||
|
||||
385
scripts/packs/energizer.cs
Executable file
385
scripts/packs/energizer.cs
Executable file
|
|
@ -0,0 +1,385 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Deployable Energizer
|
||||
//--------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedEnergizer) : StaticShapeDamageProfile {
|
||||
className = "energizer";
|
||||
shapeFile = "deploy_sensor_motion.dts";
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.3;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 30;
|
||||
maxEnergy = 50;
|
||||
rechargeRate = 0.05;
|
||||
|
||||
explosion = SatchelMainExplosion;
|
||||
underwaterExplosion = UnderwaterSatchelMainExplosion;
|
||||
|
||||
expDmgRadius = 20.0;
|
||||
expDamage = 1.25;
|
||||
expImpulse = 1500.0;
|
||||
|
||||
dynamicType = $TypeMasks::StationObjectType;
|
||||
renderWhenDestroyed = false;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
humSound = GeneratorHumSound;
|
||||
|
||||
EnergizeOthers = true;
|
||||
EnergizeRadius = 35;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Energizer';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ItemData(EnergizerLight) : StaticShapeDamageProfile {
|
||||
className = "energizerlight";
|
||||
shapeFile = "beacon.dts";
|
||||
|
||||
maxDamage = 2.0;
|
||||
destroyedLevel = 2.0;
|
||||
disabledLevel = 2.0;
|
||||
|
||||
mass = 1;
|
||||
elasticity = 0.1;
|
||||
friction = 0.9;
|
||||
|
||||
collideable = 1;
|
||||
pickupRadius = 1;
|
||||
sticky = false;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 1.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.8 0.1 0.1 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "1";
|
||||
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(EnergizerDeployableImage) {
|
||||
mass = 1;
|
||||
shapeFile = "deploy_sensor_motion.dts";
|
||||
scale = 2.5 / 3.85 @ " " @ 2.5 / 3.1 @ " " @ 5 / 3.1;
|
||||
item = EnergizerDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = EnergizerDeployed;
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
emap = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = TurretDeploySound;
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(EnergizerDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "deploy_sensor_motion.dts";
|
||||
scale = 2.5 / 3.85 @ " " @ 2.5 / 3.1 @ " " @ 5 / 3.1;
|
||||
mass = 1;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "500";
|
||||
lightRadius = "3";
|
||||
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = "EnergizerDeployableImage";
|
||||
pickUpName = "an energizer pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions
|
||||
//--------------------------------------
|
||||
|
||||
function EnergizerDeployableImage::testObjectTooClose(%item,%surfacePt,%plyr) {
|
||||
%mask = ($TypeMasks::VehicleObjectType | $TypeMasks::MoveableObjectType |
|
||||
$TypeMasks::StaticShapeObjectType |
|
||||
$TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType |
|
||||
$TypeMasks::PlayerObjectType | $TypeMasks::TurretObjectType);
|
||||
|
||||
InitContainerRadiusSearch(%item.surfacePt,30,%mask);
|
||||
|
||||
while ((%test = containerSearchNext()) != 0) {
|
||||
if (%test.team !$= "" && %test.team != %plyr.team)
|
||||
return %test;
|
||||
}
|
||||
Parent::testObjectTooClose(%item,%surfacePt,%plyr);
|
||||
}
|
||||
|
||||
function DeployedEnergizer::disassemble(%data,%plyr,%hTgt) {
|
||||
%hTgt.l1.schedule(500, "delete");
|
||||
%hTgt.l2.schedule(500, "delete");
|
||||
%hTgt.l3.schedule(500, "delete");
|
||||
%hTgt.l4.schedule(500, "delete");
|
||||
disassemble(%data,%plyr,%hTgt);
|
||||
}
|
||||
|
||||
function DeployedEnergizer::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, EnergizerDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
%obj.l1.schedule(500, "delete");
|
||||
%obj.l2.schedule(500, "delete");
|
||||
%obj.l3.schedule(500, "delete");
|
||||
%obj.l4.schedule(500, "delete");
|
||||
|
||||
RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %obj.expDmgRadius, %obj.expDamage, %obj.expImpulse, %obj, $DamageType::Explosion);
|
||||
fireBallExplode(%obj,10);
|
||||
}
|
||||
|
||||
function EnergizerDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
%scale = "5 5 5";
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = "DeployedEnergizer";
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
//Object
|
||||
%className = "Item";
|
||||
%deplObj.l1 = new (%className)() {
|
||||
dataBlock = "EnergizerLight";
|
||||
position = vectorAdd(%item.surfacePt, "2 0 1");
|
||||
rotation = %rot;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
|
||||
%deplObj.l2 = new (%className)() {
|
||||
dataBlock = "EnergizerLight";
|
||||
position = vectorAdd(%item.surfacePt, "0 2 1");
|
||||
rotation = %rot;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
|
||||
%deplObj.l3 = new (%className)() {
|
||||
dataBlock = "EnergizerLight";
|
||||
position = vectorAdd(%item.surfacePt, "-2 0 1");
|
||||
rotation = %rot;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
|
||||
%deplObj.l4 = new (%className)() {
|
||||
dataBlock = "EnergizerLight";
|
||||
position = vectorAdd(%item.surfacePt, "0 -2 1");
|
||||
rotation = %rot;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
%deplObj.l1.team = %plyr.client.team;
|
||||
%deplObj.l1.setOwner(%plyr);
|
||||
%deplObj.l2.team = %plyr.client.team;
|
||||
%deplObj.l2.setOwner(%plyr);
|
||||
%deplObj.l3.team = %plyr.client.team;
|
||||
%deplObj.l3.setOwner(%plyr);
|
||||
%deplObj.l4.team = %plyr.client.team;
|
||||
%deplObj.l4.setOwner(%plyr);
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
if (%deplObj.l1.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.l1.getTarget(), %plyr.client.team);
|
||||
if (%deplObj.l2.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.l1.getTarget(), %plyr.client.team);
|
||||
if (%deplObj.l3.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.l1.getTarget(), %plyr.client.team);
|
||||
if (%deplObj.l4.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.l1.getTarget(), %plyr.client.team);
|
||||
|
||||
addToDeployGroup(%deplObj);
|
||||
addToDeployGroup(%deplObj.l1);
|
||||
addToDeployGroup(%deplObj.l2);
|
||||
addToDeployGroup(%deplObj.l3);
|
||||
addToDeployGroup(%deplObj.l4);
|
||||
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
AIDeployObject(%plyr.client, %deplObj.l1);
|
||||
AIDeployObject(%plyr.client, %deplObj.l2);
|
||||
AIDeployObject(%plyr.client, %deplObj.l3);
|
||||
AIDeployObject(%plyr.client, %deplObj.l4);
|
||||
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
%deplObj.deploy();
|
||||
|
||||
%deplObj.playThread($AmbientThread, "ambient");
|
||||
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function EnergizerDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function EnergizeLoop() {
|
||||
if (!isObject(MissionCleanup)) {
|
||||
schedule(10000, 0, "StartEnergizeLoop");
|
||||
return;
|
||||
}
|
||||
|
||||
%dep = nameToID("MissionCleanup/Deployables");
|
||||
%clCount = ClientGroup.getCount();
|
||||
%depCount = %dep.getCount();
|
||||
for (%i=0;%i<%clCount;%i++) {
|
||||
ClientGroup.getObject(%i).shouldEnergize = 0;
|
||||
}
|
||||
for (%i=0;%i<%depCount;%i++) {
|
||||
%obj = %dep.getObject(%i);
|
||||
if (isObject(%obj)) {
|
||||
%data = %obj.getDataBlock();
|
||||
if (%data) {
|
||||
if (%data.energizeOthers && %obj.isEnabled()) {
|
||||
%pos = posFromTransform(%obj.getTransform());
|
||||
for(%i2=0;%i2<%clCount;%i2++) {
|
||||
%obj2 = ClientGroup.getObject(%i2).player;
|
||||
if ((%obj2) && (%obj2 != %obj) && (%obj2.team == %obj.team)) {
|
||||
%pos2 = %obj2.getPosition();
|
||||
if (vectorDist(%pos, %pos2) < %data.EnergizeRadius && %obj2.getArmorSize() $= "Heavy")
|
||||
%obj2.client.shouldEnergize = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (%i=0;%i<%clCount;%i++) {
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%obj = %client.player;
|
||||
if (isObject(%obj)) {
|
||||
if ((%client.shouldEnergize) && (!%obj.energized)) {
|
||||
%obj.energized = 1;
|
||||
if (!%obj.hasEnergizer)
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() + 0.5);
|
||||
messageClient(%obj.client, 'msgClient', '\c2Entering energizer coverage.');
|
||||
}
|
||||
else if (!%client.shouldEnergize && %obj.energized) {
|
||||
%obj.energized = "";
|
||||
if (%obj.hasEnergizer)
|
||||
messageClient(%obj.client, 'msgClient', '\c2Leaving energizer coverage, switching to energizer pack.');
|
||||
else {
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() - 0.5);
|
||||
messageClient(%obj.client, 'msgClient', '\c2Leaving energizer coverage, switching to armor power.');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (%i=0;%i<%depCount;%i++) {
|
||||
%obj = %dep.getObject(%i);
|
||||
if (isObject(%obj)) {
|
||||
%data = %obj.getDataBlock();
|
||||
if (%data.energizeOthers) {
|
||||
if (%obj.energized)
|
||||
%obj.energized = "";
|
||||
}
|
||||
else if ((%obj.shouldEnergize) && (!%obj.energized)) {
|
||||
%obj.energized = 1;
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() + 0.5);
|
||||
}
|
||||
else if ((!%obj.shouldEnergize) && (%obj.energized)) {
|
||||
%obj.energized = "";
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
schedule(1000, 0, "EnergizeLoop");
|
||||
}
|
||||
|
||||
function StartEnergizeLoop() {
|
||||
$EnergizeLoop = 1;
|
||||
if (!isObject(MissionCleanup)) {
|
||||
schedule(10000, 0, "StartEnergizeLoop");
|
||||
return;
|
||||
}
|
||||
%depGroup = nameToID("MissionCleanup/Deployables");
|
||||
if (%depGroup <= 0) {
|
||||
%depGroup = new SimGroup("Deployables");
|
||||
MissionCleanup.add(%depGroup);
|
||||
}
|
||||
EnergizeLoop();
|
||||
}
|
||||
|
||||
function EnergizerDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasEnergizer = true;
|
||||
if (!%obj.energized)
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() + 0.5);
|
||||
}
|
||||
|
||||
function EnergizerDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasEnergizer = "";
|
||||
if (!%obj.energized)
|
||||
%obj.setRechargeRate(%obj.getRechargeRate() - 0.5);
|
||||
}
|
||||
393
scripts/packs/escapepodpack.cs
Executable file
393
scripts/packs/escapepodpack.cs
Executable file
|
|
@ -0,0 +1,393 @@
|
|||
// Escape Pod Pack
|
||||
|
||||
datablock AudioProfile(EscapePodChargeSound) {
|
||||
filename = "fx/misc/cannonstart.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(EscapePodBeepSound) {
|
||||
filename = "fx/misc/warning_beep.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(EscapePodLaunchSound) {
|
||||
filename = "fx/Bonuses/high-level4-blazing.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(EscapePodLaunchSound2) {
|
||||
filename = "fx/Bonuses/down_passback3_rocket.wav";
|
||||
description = AudioBIGExplosion3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(EscapePodReloadSound) {
|
||||
filename = "fx/powered/turret_heavy_reload.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(EscapePodFadeSound) {
|
||||
filename = "fx/Bonuses/upward_perppass2_quark.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedEscapePod) : StaticShapeDamageProfile {
|
||||
className = "escapepod";
|
||||
shapeFile = "TR2weapon_mortar.dts";
|
||||
|
||||
maxDamage = 1;
|
||||
destroyedLevel = 1;
|
||||
disabledLevel = 1;
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 75;
|
||||
maxEnergy = 50;
|
||||
rechargeRate = 0.35;
|
||||
|
||||
explosion = ShapeExplosion;
|
||||
expDmgRadius = 8.0;
|
||||
expDamage = 0.4;
|
||||
expImpulse = 1500;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Escape Pod';
|
||||
deployAmbientThread = false;
|
||||
debrisShapeName = "debris_generic.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 1;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(EscapePodDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = EscapePodDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedEscapePod;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.25;
|
||||
maxDeployDis = 5;
|
||||
};
|
||||
|
||||
datablock ItemData(EscapePodDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 3;
|
||||
rotate = true;
|
||||
image = "EscapePodDeployableImage";
|
||||
pickUpName = "an escape pod pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function EscapePodDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function EscapePodDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function EscapePodDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = DeployedEscapePod;
|
||||
scale = "4 2 4";
|
||||
impulse = $packSetting["escapepod",%plyr.packSet];
|
||||
};
|
||||
|
||||
%deplObj.lTarget = new StaticShape () {
|
||||
datablock = DeployedLTarget;
|
||||
scale = vectorMultiply("1 3 0.25",1/4 SPC 1/3 SPC 2);
|
||||
};
|
||||
|
||||
%deplObj.lTarget.lMain = %deplObj;
|
||||
|
||||
// set orientation
|
||||
%deplObj.lTarget.setTransform(%item.surfacePt SPC %rot);
|
||||
adjustEscapePod(%deplObj);
|
||||
escapePodLoop(%deplObj);
|
||||
|
||||
// set the recharge rate right away
|
||||
if (%deplObj.getDatablock().rechargeRate)
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
if (%deplObj.lTarget) {
|
||||
%deplObj.lTarget.team = %plyr.client.Team;
|
||||
%deplObj.lTarget.setOwner(%plyr);
|
||||
}
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
addToDeployGroup(%deplObj.lTarget);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
AIDeployObject(%plyr.client,%deplObj.lTarget);
|
||||
|
||||
// play the deploy sound
|
||||
serverplay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
if (%deplObj.lTarget)
|
||||
addDSurface(%deplObj,%deplObj.lTarget);
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedEscapePod::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this,%obj,%prevState);
|
||||
$TeamDeployedCount[%obj.team, EscapePodDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
if (isObject(%obj.lTarget))
|
||||
%obj.lTarget.schedule(500, "delete");
|
||||
if (isObject(%obj.podVehicle))
|
||||
%obj.podVehicle.schedule(500,setDamageState,Destroyed);
|
||||
}
|
||||
|
||||
function DeployedEscapePod::disassemble(%data,%plyr,%obj) {
|
||||
if (isObject(%obj.podVehicle))
|
||||
%obj.podVehicle.startFade(500,0,1);
|
||||
%obj.podVehicle.schedule(500,delete);
|
||||
disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function adjustEscapePod(%obj) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
%lTarget = %obj.lTarget;
|
||||
%pos = %lTarget.getPosition();
|
||||
%rot = %lTarget.getRotation();
|
||||
%nrm = realVec(%lTarget,"0 0 1");
|
||||
%obj.setTransform(vectorAdd(%pos,vectorScale(%nrm,1.25)) SPC %rot);
|
||||
}
|
||||
|
||||
function escapePodLoop(%obj) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
if (%obj.getDamageState() !$= "Enabled")
|
||||
return;
|
||||
cancel(%obj.escapePodLoop);
|
||||
%lTarget = %obj.lTarget;
|
||||
%pos = %lTarget.getPosition();
|
||||
%nrm = realVec(%lTarget,"0 0 1");
|
||||
%nrm2 = realVec(%lTarget,"1 0 0");
|
||||
%epod = %obj.podVehicle;
|
||||
if (isObject(%epod)) {
|
||||
if (%epod.player) {
|
||||
%player = %epod.getMountedObject(0);
|
||||
if (isObject(%player)) {
|
||||
if (%player.getState() $= "Dead") {
|
||||
%remove = true;
|
||||
if (!%player.podFaded) {
|
||||
%player.startFade(2000,0,1);
|
||||
%player.podFaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
%remove = true;
|
||||
}
|
||||
else {
|
||||
// Remove when launched manually (no player)
|
||||
if (%epod.launched)
|
||||
%remove = true;
|
||||
}
|
||||
if (%remove == true)
|
||||
%epod.getDataBlock().fadeOutVehicle(%epod);
|
||||
}
|
||||
else {
|
||||
%epod = new HoverVehicle() {
|
||||
dataBlock = "EscapePodVehicle";
|
||||
scale = "1 1 1";
|
||||
team = %obj.team;
|
||||
mountable = "1";
|
||||
selfpower = "1";
|
||||
};
|
||||
%obj.podVehicle = %epod;
|
||||
setTargetSensorGroup(%epod.getTarget(),%epod.team);
|
||||
%epod.launcher = %obj;
|
||||
%epod.setFrozenState(true);
|
||||
%epod.setTransform(vectorAdd(%pos,vectorScale(%nrm,1)) SPC fullRot(%nrm,vectorScale(%nrm2,-1)));
|
||||
%obj.play3D(EscapePodReloadSound);
|
||||
%obj.stopThread($AmbientThread);
|
||||
%obj.setThreadDir($AmbientThread,0);
|
||||
%obj.playThread($AmbientThread,"recoil");
|
||||
%obj.schedule(1000,stopThread,$AmbientThread);
|
||||
}
|
||||
%obj.escapePodLoop = schedule(1000,0,escapePodLoop,%obj);
|
||||
}
|
||||
|
||||
function EscapePodDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasEscapePod = true; // set for podcheck
|
||||
%obj.packSet = 7;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function EscapePodDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
%obj.hasEscapePod = "";
|
||||
}
|
||||
|
||||
function EscapePodVehicle::isBlocked(%data,%obj,%player) {
|
||||
%pos = %obj.getPosition();
|
||||
%startPos = vectorAdd(%pos,vectorScale(realVec(%obj,"0 -1 0"),2));
|
||||
%endPos = vectorAdd(%pos,vectorScale(realVec(%obj,"0 1 0"),2));
|
||||
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::StationObjectType | $TypeMasks::GeneratorObjectType | $TypeMasks::SensorObjectType | $TypeMasks::TurretObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::StaticObjectType | $TypeMasks::MoveableObjectType | $TypeMasks::DamagableItemObjectType;
|
||||
%res = containerRayCast(%startPos,%endPos,%mask,%obj);
|
||||
if (%res)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function EscapePodVehicle::playerMounted(%data, %obj, %player, %node) {
|
||||
if (%obj.player)
|
||||
return;
|
||||
%obj.player = %player;
|
||||
%obj.playerMountedTime = getSimTime();
|
||||
// commandToClient(%player.client, 'setHudMode', 'Pilot', "Hoverbike", %node);
|
||||
|
||||
// update observers who are following this guy...
|
||||
if ( %player.client.observeCount > 0 )
|
||||
resetObserveFollow( %player.client, false );
|
||||
|
||||
%obj.play3D(EscapePodBeepSound);
|
||||
%data.schedule(1000,actionThreadPlayer,%player,"scoutRoot");
|
||||
%obj.schedule(1500,play3D,EscapePodChargeSound);
|
||||
%data.schedule(3000,launchPod,%obj,%player,%node);
|
||||
}
|
||||
|
||||
function EscapePodVehicle::actionThreadPlayer(%data,%player,%thread) {
|
||||
if (!isObject(%player))
|
||||
return;
|
||||
if (%player.getState() $= "Dead") {
|
||||
%player.startFade(2000,0,1);
|
||||
%player.podFaded = true;
|
||||
}
|
||||
else
|
||||
%player.setActionThread(%thread,true);
|
||||
}
|
||||
|
||||
function EscapePodVehicle::launchPod(%data,%obj,%player,%node) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
%obj.launched = true;
|
||||
%obj.play3D(EscapePodLaunchSound);
|
||||
%obj.play3D(EscapePodLaunchSound2);
|
||||
%launcher = %obj.launcher;
|
||||
if (isObject(%launcher)) {
|
||||
%launcher.stopThread($AmbientThread);
|
||||
%launcher.setThreadDir($AmbientThread,1);
|
||||
%launcher.playThread($AmbientThread,"recoil");
|
||||
%launcher.schedule(1000,stopThread,$AmbientThread);
|
||||
}
|
||||
%obj.setFrozenState(false);
|
||||
%obj.applyImpulse(%obj.getPosition(),vectorScale(realVec(%obj,"0 1 0"),%launcher.impulse));
|
||||
for(%i = 0; %i < 10; %i++)
|
||||
%data.schedule((%i * %i) * 10,emitLaunchPuff,%obj);
|
||||
}
|
||||
|
||||
function EscapePodVehicle::emitLaunchPuff(%data,%obj) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
%em = new ParticleEmissionDummy() {
|
||||
dataBlock = "defaultEmissionDummy";
|
||||
emitter = "VehicleLGESmokeEMitter";
|
||||
position = %obj.getPosition();
|
||||
scale = "1 1 1";
|
||||
velocity = "1";
|
||||
};
|
||||
MissionCleanup.add(%em);
|
||||
%em.schedule(1000,"delete");
|
||||
}
|
||||
|
||||
//function EscapePodVehicle::onDestroyed(%data, %obj, %prevState) {
|
||||
// Parent::onDestroyed(%data, %obj, %prevState);
|
||||
//}
|
||||
|
||||
|
||||
//function EscapePodVehicle::playerDismounted(%data, %obj, %player) {
|
||||
// Parent::playerDismounted(%data, %obj, %player);
|
||||
//}
|
||||
|
||||
function EscapePodVehicle::fadeOutVehicle(%data,%obj) {
|
||||
if (%obj.faded)
|
||||
return;
|
||||
%obj.faded = true;
|
||||
%obj.startFade(1000,4000,1);
|
||||
%obj.schedule(5000,delete);
|
||||
%obj.schedule(4000,play3D,EscapePodFadeSound);
|
||||
}
|
||||
|
||||
function EscapePodVehicle::onAdd(%this, %obj) {
|
||||
Parent::onAdd(%this, %obj);
|
||||
setTargetSensorGroup(%obj.getTarget(),%obj.team);
|
||||
}
|
||||
|
||||
function displayEscapePodBoostPower(%plyr) {
|
||||
%line = $packSetting["escapepod",%plyr.packSet];
|
||||
%max = $packSetting["escapepod",$packSettings["escapepod"]];
|
||||
%power = mAbs(mFloatLength(100 / %max * %line,1));
|
||||
bottomPrint(%plyr.client,"Escape Pod booster set to " @ %power @ "% power" ,2,1);
|
||||
}
|
||||
518
scripts/packs/forcefieldpack.cs
Executable file
518
scripts/packs/forcefieldpack.cs
Executable file
|
|
@ -0,0 +1,518 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Force Field
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Translucencies
|
||||
%noPassTrans = 1.0;
|
||||
%teamPassTrans = 0.6;
|
||||
%allPassTrans = 0.2;
|
||||
|
||||
%dimDiv = 4;
|
||||
|
||||
// RGB
|
||||
%colourOn = 0.3;
|
||||
%colourOff = 0.0;
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField) {
|
||||
className = "forcefield";
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = "1.0 1.0 1.0";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetNameTag = 'Force Field';
|
||||
targetTypeTag = 'ForceField';
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
framesPerSec = 1; // 10
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 0.01; // 1.0
|
||||
vmapping = 0.01; // 0.15
|
||||
deployedFrom = ForceFieldDeployable;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
// No pass
|
||||
datablock ForceFieldBareData(DeployedForceField0) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField1) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOff SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField2) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField3) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField4) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField5) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField6) : DeployedForceField {
|
||||
baseTranslucency = %noPassTrans;
|
||||
powerOffTranslucency = %noPassTrans / %dimDiv;
|
||||
teamPermiable = false;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
// Team pass
|
||||
datablock ForceFieldBareData(DeployedForceField7) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField8) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOff SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField9) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField10) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField11) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOff SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField12) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField13) : DeployedForceField {
|
||||
baseTranslucency = %teamPassTrans;
|
||||
powerOffTranslucency = %teamPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = false;
|
||||
color = %colourOn SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
// All pass
|
||||
datablock ForceFieldBareData(DeployedForceField14) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField15) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOff SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField16) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOff SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField17) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOff SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField18) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOff SPC %colourOn SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField19) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ForceFieldBareData(DeployedForceField20) : DeployedForceField {
|
||||
baseTranslucency = %allPassTrans;
|
||||
powerOffTranslucency = %allPassTrans / %dimDiv;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ForceFieldDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
item = ForceFieldDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "-0.2 -0.125 0";
|
||||
rotation = "0 -1 0 90";
|
||||
deployed = DeployedForceField;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.1;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(ForceFieldDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "ForceFieldDeployableImage";
|
||||
pickUpName = "a force field pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function ForceFieldDeployableImage::testObjectTooClose(%item) {
|
||||
return;
|
||||
}
|
||||
|
||||
function ForceFieldDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function ForceFieldDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function ForceFieldDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "ForceFieldBare";
|
||||
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
%scale = getWords($packSetting["forcefield",%plyr.packSet],0,2);
|
||||
%mCenter = "-0.5 -0.5 -0.5";
|
||||
%pad = pad(%item.surfacePt SPC %item.surfaceNrm SPC %item.surfaceNrm2,%scale,%mCenter);
|
||||
%scale = getWords(%pad,0,2);
|
||||
%item.surfacePt = getWords(%pad,3,5);
|
||||
%rot = getWords(%pad,6,9);
|
||||
|
||||
// Add padding
|
||||
%padSize = 0.01;
|
||||
%scale = vectorAdd(%scale,%padSize * 2 SPC %padSize * 2 SPC -%padSize * 2);
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(%item.surfaceNrm),%padSize));
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(%item.surfaceNrm2),%padSize));
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(vectorCross(%item.surfaceNrm,%item.surfaceNrm2)),-%padSize));
|
||||
|
||||
if ($Host::ExpertMode == 1) {
|
||||
if (isCubic(%item.surface) && (%plyr.expertSet == 1 || %plyr.expertSet == 3) && %plyr.team == %item.surface.team
|
||||
&& %item.surface.getType() & $TypeMasks::StaticShapeObjectType
|
||||
&& (($Host::OnlyOwnerCubicReplace == 0) || (%plyr.client == %item.surface.getOwner()))) {
|
||||
%scale = vectorAdd(realSize(%item.surface),%padSize * 2 SPC %padSize * 2 SPC %padSize * 2);
|
||||
%center = realVec(%item.surface,vectorScale(getWords(%scale,0,1) SPC "0",-0.5));
|
||||
%item.surfacePt = vectorAdd(pos(%item.surface),%center);
|
||||
%rot = rot(%item.surface);
|
||||
%mod = vectorScale(matrixMulVector("0 0 0" SPC %rot ,"0 0 1"),-%padSize);
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,%mod);
|
||||
%item.surface.getDataBlock().disassemble(%plyr, %item.surface);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - temporary test fix - remove?
|
||||
%scale = vectorAdd(%scale,"0 0 0");
|
||||
%x = getWord(%scale,0);
|
||||
%y = getWord(%scale,1);
|
||||
%z = getWord(%scale,2);
|
||||
if (%x <= 0)
|
||||
%x = 0.001;
|
||||
if (%y <= 0)
|
||||
%y = 0.001;
|
||||
if (%z <= 0)
|
||||
%z = 0.001;
|
||||
%scale = %x SPC %y SPC %z;
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed @ %plyr.packSet;
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
// Take the deployable off the player's back and out of inventory
|
||||
if ($Host::ExpertMode == 0) {
|
||||
%plyr.unMountImage(%slot);
|
||||
%plyr.decInventory(%item.item,1);
|
||||
}
|
||||
|
||||
////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// [[Location]]:
|
||||
|
||||
// exact:
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
%deplObj.pzone.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
if ($Host::ExpertMode == 1) {
|
||||
if (%plyr.expertSet == 2 || %plyr.expertSet == 3) {
|
||||
%deplObj.noSlow = true;
|
||||
%deplObj.pzone.delete();
|
||||
%deplObj.pzone = "";
|
||||
}
|
||||
}
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
if (!%deplObj.powerCount > 0) {
|
||||
%deplObj.getDataBlock().disassemble(0,%deplObj); // Run Item Specific code.
|
||||
messageClient(%plyr.client,'MsgDeployFailed','\c2Force field lost - no power source found!%1','~wfx/misc/misc.error.wav');
|
||||
}
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
|
||||
function ForceFieldDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasForceField = true; // set for forcefieldcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function ForceFieldDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasForceField = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function DeployedForceField::disassemble(%data,%plyr,%obj) {
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.delete();
|
||||
disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField0::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField1::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField2::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField3::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField4::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField5::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField6::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField7::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField8::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField9::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField10::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField11::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField12::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField13::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField14::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField15::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField16::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField17::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField18::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField19::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedForceField20::disassemble(%data,%plyr,%obj) {
|
||||
DeployedForceField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
145
scripts/packs/generator.cs
Executable file
145
scripts/packs/generator.cs
Executable file
|
|
@ -0,0 +1,145 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Deployable Generator
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(GeneratorDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = GeneratorDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = GeneratorLarge;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 2;
|
||||
maxDeployDis = 5;
|
||||
};
|
||||
|
||||
datablock ItemData(GeneratorDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.8 0.8 1.0";
|
||||
lightTime = "1000";
|
||||
lightRadius = "3";
|
||||
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 3;
|
||||
rotate = true;
|
||||
image = "GeneratorDeployableImage";
|
||||
pickUpName = "a generator pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function GeneratorDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function GeneratorDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function GeneratorDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(getWord(%plyr.getEyeVector(),1) SPC -1 * getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = vectorScale(%playerVector,-1);
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,vectorScale(vectorNormalize(vectorCross(%item.surfaceNrm,%item.surfaceNrm2)),2));
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = GeneratorLarge;
|
||||
deployed = true;
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
setTargetName(%deplObj.target,addTaggedString("Frequency" SPC %deplObj.powerFreq));
|
||||
|
||||
// set power
|
||||
%deplObj.setSelfPowered();
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
%deplObj.playThread($PowerThread,"Power");
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
// add to power list
|
||||
$PowerList = listAdd($PowerList,%deplObj,-1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function GeneratorLarge::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
if (%obj.deployed && ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon)) {
|
||||
%obj.isRemoved = true;
|
||||
%loc = findWord($PowerList,%obj);
|
||||
if (%loc !$= "")
|
||||
$PowerList = listDel($PowerList,%loc);
|
||||
$TeamDeployedCount[%obj.team,GeneratorDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500,"delete");
|
||||
}
|
||||
Parent::onDestroyed(%data,%obj,%prevState);
|
||||
}
|
||||
|
||||
function GeneratorDeployableImage::onMount(%data,%obj,%node) {
|
||||
%obj.hasGen = true; // set for gencheck
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function GeneratorDeployableImage::onUnmount(%data,%obj,%node) {
|
||||
%obj.hasGen = "";
|
||||
}
|
||||
344
scripts/packs/gravityfieldpack.cs
Executable file
344
scripts/packs/gravityfieldpack.cs
Executable file
|
|
@ -0,0 +1,344 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Gravity Field
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Translucencies
|
||||
%fieldTrans = 1.0;
|
||||
%powerOffTrans = 0.25;
|
||||
|
||||
// RGB
|
||||
%colourOn = 0.6;
|
||||
%colourOff = 0.15;
|
||||
%dimDiv = 3;
|
||||
|
||||
datablock ForceFieldBareData(DeployedGravityField) {
|
||||
className = "gravityfield";
|
||||
fadeMS = 1000;
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = "1.0 1.0 1.0";
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
targetTypeTag = 'GravityField';
|
||||
texture[0] = "skins/forcef1";
|
||||
texture[1] = "skins/forcef2";
|
||||
texture[2] = "skins/forcef3";
|
||||
texture[3] = "skins/forcef4";
|
||||
texture[4] = "skins/forcef5";
|
||||
framesPerSec = 10;
|
||||
numFrames = 5;
|
||||
scrollSpeed = 15;
|
||||
umapping = 1.0;
|
||||
vmapping = 0.15;
|
||||
deployedFrom = GravityFieldDeployable;
|
||||
velocityMod = 1;
|
||||
gravityMod = 1;
|
||||
appliedForce = "0 0 0";
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
// slow
|
||||
datablock ForceFieldBareData(DeployedGravityField0) : DeployedGravityField {
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOff/%dimDiv SPC %colourOn/%dimDiv SPC %colourOff/%dimDiv;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
velocityMod = 1;
|
||||
gravityMod = 0;
|
||||
};
|
||||
|
||||
// fast
|
||||
datablock ForceFieldBareData(DeployedGravityField1) : DeployedGravityField {
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOff SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
velocityMod = 1;
|
||||
gravityMod = 0;
|
||||
};
|
||||
|
||||
// zero gravity
|
||||
datablock ForceFieldBareData(DeployedGravityField2) : DeployedGravityField {
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOn SPC %colourOff;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
velocityMod = 1;
|
||||
gravityMod = 0;
|
||||
};
|
||||
|
||||
// fastfield
|
||||
datablock ForceFieldBareData(DeployedGravityField3) : DeployedGravityField {
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn/%dimDiv SPC %colourOff/%dimDiv SPC %colourOn/%dimDiv;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
velocityMod = 1.5;
|
||||
gravityMod = 0;
|
||||
};
|
||||
|
||||
// super fastfield
|
||||
datablock ForceFieldBareData(DeployedGravityField4) : DeployedGravityField {
|
||||
baseTranslucency = %fieldTrans;
|
||||
powerOffTranslucency = %powerOffTrans;
|
||||
teamPermiable = true;
|
||||
otherPermiable = true;
|
||||
color = %colourOn SPC %colourOff SPC %colourOn;
|
||||
powerOffColor = "0.0 0.0 0.0";
|
||||
velocityMod = 1.7;
|
||||
gravityMod = 0;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(GravityFieldDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "ammo_chaingun.dts";
|
||||
item = GravityFieldDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "-0.2 -0.125 0";
|
||||
rotation = "0 -1 0 90";
|
||||
deployed = DeployedGravityField;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.1;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(GravityFieldDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
joint = "4.75 4.75 4.75";
|
||||
rotate = true;
|
||||
image = "GravityFieldDeployableImage";
|
||||
pickUpName = "a gravity field pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function GravityFieldDeployableImage::testObjectTooClose(%item) {
|
||||
return;
|
||||
}
|
||||
|
||||
function GravityFieldDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function GravityFieldDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function GravityFieldDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
//Object
|
||||
%className = "ForceFieldBare";
|
||||
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (%item.surfaceinher == 0) {
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
}
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
%scale = getWords($packSetting["gravfield",%plyr.packSet],0,2);
|
||||
|
||||
%space = rayDist(%item.surfacePt SPC %item.surfaceNrm,%scale);
|
||||
%scale = getWord(%scale,0) SPC getWord(%scale,0) SPC %space;
|
||||
|
||||
// Shift field position since field handle is not field center
|
||||
%mod = firstWord($packSetting["gravfield",%plyr.packSet]) / 2;
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(%item.surfaceNrm2),%mod));
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(vectorCross(%item.surfaceNrm,%item.surfaceNrm2)),%mod));
|
||||
|
||||
// Add padding
|
||||
%padSize = 0.01;
|
||||
%scale = vectorAdd(%scale,%padSize * 2 SPC %padSize * 2 SPC %padSize * 2);
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(%item.surfaceNrm),%padSize));
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(%item.surfaceNrm2),%padSize));
|
||||
%item.surfacePt = vectorSub(%item.surfacePt,vectorScale(vectorNormalize(vectorCross(%item.surfaceNrm,%item.surfaceNrm2)),%padSize));
|
||||
|
||||
// Set datablock
|
||||
if (%plyr.packSet == 0)
|
||||
%dataBlock = nameToID(%item.deployed @ 0);
|
||||
else if (%plyr.packSet == 1)
|
||||
%dataBlock = nameToID(%item.deployed @ 1);
|
||||
else if (%plyr.packSet == 2)
|
||||
%dataBlock = nameToID(%item.deployed @ 0);
|
||||
else if (%plyr.packSet == 3)
|
||||
%dataBlock = nameToID(%item.deployed @ 1);
|
||||
else if (%plyr.packSet == 4)
|
||||
%dataBlock = nameToID(%item.deployed @ 2);
|
||||
else if (%plyr.packSet == 5)
|
||||
%dataBlock = nameToID(%item.deployed @ 3);
|
||||
else if (%plyr.packSet == 6)
|
||||
%dataBlock = nameToID(%item.deployed @ 4);
|
||||
|
||||
%appliedForceVec = vectorNormalize(%item.surfaceNrm);
|
||||
|
||||
if ($Host::ExpertMode == 1) {
|
||||
if (isCubic(%item.surface) && (%plyr.expertSet == 1 || %plyr.expertSet == 2) && %plyr.team == %item.surface.team
|
||||
&& %item.surface.getType() & $TypeMasks::StaticShapeObjectType
|
||||
&& (($Host::OnlyOwnerCubicReplace == 0) || (%plyr.client == %item.surface.getOwner()))) {
|
||||
if (%plyr.expertSet == 2)
|
||||
%appliedForceVec = vectorNormalize(realVec(%item.surface,"0 0 1"));
|
||||
%scale = vectorAdd(realSize(%item.surface),%padSize * 2 SPC %padSize * 2 SPC %padSize * 2);
|
||||
%center = realVec(%item.surface,vectorScale(getWords(%scale,0,1) SPC "0",-0.5));
|
||||
%item.surfacePt = vectorAdd(pos(%item.surface),%center);
|
||||
%rot = rot(%item.surface);
|
||||
%mod = vectorScale(matrixMulVector("0 0 0" SPC %rot ,"0 0 1"),-%padSize);
|
||||
%item.surfacePt = vectorAdd(%item.surfacePt,%mod);
|
||||
%item.surface.getDataBlock().disassemble(%plyr, %item.surface);
|
||||
}
|
||||
}
|
||||
|
||||
%velocityMod = %dataBlock.velocityMod;
|
||||
%gravityMod = %dataBlock.gravityMod;
|
||||
%appliedForce = %dataBlock.appliedForce;
|
||||
|
||||
%slowForce = 500;
|
||||
%fastForce = 1000;
|
||||
|
||||
if (%plyr.packSet == 0)
|
||||
%appliedForce = vectorScale(%appliedForceVec,%slowForce);
|
||||
else if (%plyr.packSet == 1)
|
||||
%appliedForce = vectorScale(%appliedForceVec,%fastForce);
|
||||
else if (%plyr.packSet == 2)
|
||||
%appliedForce = vectorScale(%appliedForceVec,-%slowForce);
|
||||
else if (%plyr.packSet == 3)
|
||||
%appliedForce = vectorScale(%appliedForceVec,-%fastForce);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %dataBlock;
|
||||
scale = %scale;
|
||||
velocityMod = %velocityMod;
|
||||
gravityMod = %gravityMod;
|
||||
appliedForce = %appliedForce;
|
||||
};
|
||||
|
||||
// Take the deployable off the player's back and out of inventory
|
||||
if ($Host::ExpertMode == 0) {
|
||||
%plyr.unMountImage(%slot);
|
||||
%plyr.decInventory(%item.item,1);
|
||||
}
|
||||
|
||||
////////////////////////Apply settings//////////////////////////////
|
||||
|
||||
// [[Location]]:
|
||||
|
||||
// exact:
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
%deplObj.pzone.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// misc info
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// [[Settings]]:
|
||||
|
||||
%deplObj.grounded = %grounded;
|
||||
%deplObj.needsFit = 1;
|
||||
|
||||
// [[Normal Stuff]]:
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
if (!%deplObj.powerCount > 0) {
|
||||
%deplObj.getDataBlock().disassemble(0,%deplObj); // Run Item Specific code.
|
||||
messageClient(%plyr.client,'MsgDeployFailed','\c2Gravity field lost - no power source found!%1','~wfx/misc/misc.error.wav');
|
||||
}
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
/////////////////////////////////////
|
||||
|
||||
function GravityFieldDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasGravField = true; // set for gravfieldcheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function GravityFieldDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasGravField = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function DeployedGravityField::disassemble(%data,%plyr,%obj) {
|
||||
if (isObject(%obj.pzone))
|
||||
%obj.pzone.delete();
|
||||
disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedGravityField0::disassemble(%data,%plyr,%obj) {
|
||||
DeployedGravityField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedGravityField1::disassemble(%data,%plyr,%obj) {
|
||||
DeployedGravityField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedGravityField2::disassemble(%data,%plyr,%obj) {
|
||||
DeployedGravityField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedGravityField3::disassemble(%data,%plyr,%obj) {
|
||||
DeployedGravityField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function DeployedGravityField4::disassemble(%data,%plyr,%obj) {
|
||||
DeployedGravityField::disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
176
scripts/packs/jumpad.cs
Executable file
176
scripts/packs/jumpad.cs
Executable file
|
|
@ -0,0 +1,176 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Jumpad
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock StaticShapeData(DeployedJumpad) : StaticShapeDamageProfile {
|
||||
className = "jumpad";
|
||||
shapeFile = "nexusbase.dts"; // dmiscf.dts, alternate
|
||||
maxDamage = 2.0;
|
||||
destroyedLevel = 2.0;
|
||||
disabledLevel = 2.0;
|
||||
mass = 1;
|
||||
elasticity = 0.1;
|
||||
friction = 0.9;
|
||||
collideable = 1;
|
||||
pickupRadius = 1;
|
||||
sticky=false;
|
||||
|
||||
impulse = 5000;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.8 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 3.0;
|
||||
expDamage = 0.1;
|
||||
expImpulse = 200.0;
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
|
||||
targetNameTag = 'Jump';
|
||||
targetTypeTag = 'Pad';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(JumpadDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = JumpadDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedJumpad;
|
||||
heatSignature = 0;
|
||||
collideable = 1;
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360; // 30
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(JumpadDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "JumpadDeployableImage";
|
||||
pickUpName = "a jump pad pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function JumpadDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function JumpadDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 -1"));
|
||||
|
||||
%impulse = firstWord($packSetting["jumpad",%plyr.packSet]);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
scale = "1 1 2";
|
||||
};
|
||||
|
||||
// set impulse (jump pad strength)
|
||||
%deplObj.impulse = %impulse;
|
||||
|
||||
// set orientation
|
||||
%deplObj.setDeployRotation(getWords(%item.surfacePt, 0, 1) SPC getWord(%item.surfacePt, 2) + 0.1, %item.surfaceNrm);
|
||||
|
||||
// set the recharge rate right away
|
||||
if (%deplObj.getDatablock().rechargeRate)
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedJumpad::onCollision(%data,%obj,%col) {
|
||||
// TODO - update escape pod
|
||||
if (%col.getClassName() !$= "Player" && %col.getDataBlock().getName() !$= "EscapePodVehicle")
|
||||
return; // Only boost players
|
||||
if (%obj.team == %col.team) {
|
||||
%vel = %col.getVelocity();
|
||||
%vec = realVec(%obj,"0 0 1");
|
||||
%position = getWords(%col.getTransform(), 0, 2);
|
||||
// %impulseVec = vectorScale(%vec,1000); // Jump clear of the pad
|
||||
// %col.applyImpulse(%position, %impulseVec);
|
||||
%col.playAudio(0, MortarFireSound);
|
||||
%impulseVec = vectorScale(%vec,%obj.impulse);
|
||||
// %col.schedule(50, "applyImpulse", %position, %impulseVec);
|
||||
%col.applyImpulse(%position, %impulseVec);
|
||||
}
|
||||
}
|
||||
|
||||
function DeployedJumpad::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, JumpadDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function JumpadDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasJumpad = true; // set for jumpadcheck
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function JumpadDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasJumpad = "";
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
123
scripts/packs/largeInventory.cs
Executable file
123
scripts/packs/largeInventory.cs
Executable file
|
|
@ -0,0 +1,123 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Large Inventory Station
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(LargeInventoryDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = LargeInventoryDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = StationInventory;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(LargeInventoryDeployable)
|
||||
{
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "LargeInventoryDeployableImage";
|
||||
joint = "4.5 4.5 4.5";
|
||||
pickUpName = "a large inventory station pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function LargeInventoryDeployable::onPickup(%this, %obj, %shape, %amount)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function LargeInventoryDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
%plyr.unMountImage(%slot);
|
||||
%plyr.decInventory(%item.item,1);
|
||||
%grounded = 0;
|
||||
if (%item.surface.getClassName() $= TerrainBlock)
|
||||
%grounded = 1;
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = vectorScale(%playerVector,-1);
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() //Inventory Station
|
||||
{
|
||||
dataBlock = StationInventory;
|
||||
position = %surfacePt;
|
||||
rotation = %rot;
|
||||
deployed = true;
|
||||
};
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
|
||||
if(%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
// Adjust the trigger object
|
||||
adjustTrigger(%deplObj);
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function LargeInventoryDeployableImage::testNoTerrainFound(%item)
|
||||
{
|
||||
//return %item.surface.getClassName() !$= TerrainBlock;
|
||||
}
|
||||
|
||||
function LargeInventoryDeployableImage::onMount(%data, %obj, %node) {
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
127
scripts/packs/largeSensor.cs
Executable file
127
scripts/packs/largeSensor.cs
Executable file
|
|
@ -0,0 +1,127 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Large Pulse Sensor
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(LargeSensorDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = LargeSensorDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = SensorLargePulse;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(LargeSensorDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "LargeSensorDeployableImage";
|
||||
joint = "4.5 4.5 4.5";
|
||||
pickUpName = "a large pulse sensor pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function LargeSensorDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function LargeSensorDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function LargeSensorDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(getWord(%plyr.getEyeVector(),1) SPC -1 * getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 -1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = SensorLargePulse;
|
||||
deployed = true;
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
// setTargetName(%deplObj.target,addTaggedString("Frequency" SPC %deplObj.powerFreq));
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
// %deplObj.playThread($PowerThread,"Power");
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
// Power object
|
||||
checkPowerObject(%deplObj);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function SensorLargePulse::onDestroyed(%data,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
if (%obj.deployed) {
|
||||
%obj.isRemoved = true;
|
||||
$TeamDeployedCount[%obj.team,LargeSensorDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500,"delete");
|
||||
}
|
||||
Parent::onDestroyed(%data,%obj,%prevState);
|
||||
}
|
||||
|
||||
function LargeSensorDeployableImage::onMount(%data, %obj, %node) {
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
193
scripts/packs/laserturret.cs
Executable file
193
scripts/packs/laserturret.cs
Executable file
|
|
@ -0,0 +1,193 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Datablocks
|
||||
//--------------------------------------
|
||||
|
||||
datablock SensorData(LaserTurretSensor) {
|
||||
detects = true;
|
||||
detectsUsingLOS = true;
|
||||
detectsPassiveJammed = false;
|
||||
detectsActiveJammed = false;
|
||||
detectsCloaked = false;
|
||||
detectionPings = true;
|
||||
detectRadius = 100;
|
||||
};
|
||||
|
||||
datablock TurretData(LaserDeployed) : TurretDamageProfile {
|
||||
className = DeployedTurret;
|
||||
shapeFile = "camera.dts";
|
||||
mass = 1;
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.21;
|
||||
explosion = SmallTurretExplosion;
|
||||
expDmgRadius = 5.0;
|
||||
expDamage = 0.25;
|
||||
expImpulse = 500.0;
|
||||
repairRate = 0;
|
||||
heatSignature = 0.0;
|
||||
deployedObject = true;
|
||||
thetaMin = 5;
|
||||
thetaMax = 145;
|
||||
thetaNull = 90;
|
||||
primaryAxis = zaxis;
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 30;
|
||||
maxEnergy = 100;
|
||||
rechargeRate = 0.15;
|
||||
barrel = DeployableLaserBarrel;
|
||||
canControl = true;
|
||||
cmdCategory = "DTactical";
|
||||
cmdIcon = CMDTurretIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
|
||||
targetNameTag = 'Laser';
|
||||
targetTypeTag = 'Turret';
|
||||
sensorData = LaserTurretSensor;
|
||||
sensorRadius = LaserTurretSensor.detectRadius;
|
||||
sensorColor = "191 0 226";
|
||||
firstPersonOnly = true;
|
||||
renderWhenDestroyed = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = TurretDebrisSmall;
|
||||
};
|
||||
|
||||
datablock TurretImageData(DeployableLaserBarrel) {
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
item = LaserTurretBarrel;
|
||||
//rotation = "0 0 0 0";
|
||||
offset = "0 0 0";
|
||||
projectile = NerfBolt;
|
||||
//projectileType = TargetProjectile;
|
||||
projectileType = LinearFlareProjectile;
|
||||
usesEnergy = true;
|
||||
fireEnergy = 2;
|
||||
minEnergy = 8;
|
||||
lightType = "WeaponFireLight";
|
||||
lightColor = "0.25 0.15 0.15 1.0";
|
||||
lightTime = "1000";
|
||||
lightRadius = "2";
|
||||
muzzleFlash = IndoorTurretMuzzleFlash;
|
||||
//deleteLastProjectile = true;
|
||||
// Turret parameters
|
||||
activationMS = 150;
|
||||
deactivateDelayMS = 300;
|
||||
thinkTimeMS = 150;
|
||||
degPerSecTheta = 580;
|
||||
degPerSecPhi = 960;
|
||||
attackRadius = 100;
|
||||
|
||||
// State transitions
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateSequence[1] = "Activate";
|
||||
stateSound[1] = IBLSwitchSound;
|
||||
stateTimeoutValue[1] = 1;
|
||||
stateTransitionOnTimeout[1] = "Ready";
|
||||
stateTransitionOnNotLoaded[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNotLoaded[2] = "Deactivate";
|
||||
stateTransitionOnTriggerDown[2] = "Fire";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.1;
|
||||
stateFire[3] = true;
|
||||
stateShockwave[3] = true;
|
||||
stateRecoil[3] = LightRecoil;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateSound[3] = IBLFireSound;
|
||||
stateScript[3] = "onFire";
|
||||
|
||||
stateName[4] ="Reload";
|
||||
stateTimeoutValue[4] = 0.05;
|
||||
stateAllowImageChange[4] = false;
|
||||
stateSequence[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTransitionOnNotLoaded[4] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[4] = "NoAmmo";
|
||||
|
||||
stateName[5] = "Deactivate";
|
||||
stateSequence[5] = "Activate";
|
||||
stateDirection[5] = false;
|
||||
stateTimeoutValue[5] = 0.1;
|
||||
stateTransitionOnLoaded[5] = "ActivateReady";
|
||||
stateTransitionOnTimeout[5] = "Dead";
|
||||
|
||||
stateName[6] = "Dead";
|
||||
stateTransitionOnLoaded[6] = "ActivateReady";
|
||||
|
||||
stateName[7] = "NoAmmo";
|
||||
stateTransitionOnAmmo[7] = "Reload";
|
||||
stateSequence[7] = "NoAmmo";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(TurretLaserDeployableImage) {
|
||||
mass = 1;
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
item = TurretLaserDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = LaserDeployed;
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
emap = true;
|
||||
maxDepSlope = 360;
|
||||
deploySound = TurretDeploySound;
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 5.0;
|
||||
};
|
||||
|
||||
datablock ItemData(TurretLaserDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = TurretLaserDeployableImage;
|
||||
pickUpName = "a laser turret pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions
|
||||
//--------------------------------------
|
||||
|
||||
function TurretLaserDeployableImage::TestNoTerrainFound(%item) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function TurretLaserDeployableImage::TestNoInteriorFound(%item) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function TurretLaserDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
//created to prevent console errors
|
||||
}
|
||||
|
||||
function LaserDeployed::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
if ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon) {
|
||||
%obj.isRemoved = true;
|
||||
$TeamDeployedCount[%obj.team, TurretLaserDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, delete);
|
||||
}
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
|
||||
}
|
||||
273
scripts/packs/lightpack.cs
Executable file
273
scripts/packs/lightpack.cs
Executable file
|
|
@ -0,0 +1,273 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Light
|
||||
//---------------------------------------------------------
|
||||
|
||||
%colourOn = 0.5;
|
||||
%colourOff = 0.1;
|
||||
|
||||
%strobeColourOn = 1.0;
|
||||
%strobeColourOff = 0.0;
|
||||
|
||||
datablock StaticShapeData(DeployedLightBase) : StaticShapeDamageProfile {
|
||||
className = "lightbase";
|
||||
shapeFile = "pack_deploy_sensor_motion.dts";
|
||||
|
||||
maxDamage = 0.5;
|
||||
destroyedLevel = 0.5;
|
||||
disabledLevel = 0.3;
|
||||
|
||||
maxEnergy = 50;
|
||||
rechargeRate = 0.25;
|
||||
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 1.0;
|
||||
expDamage = 0.05;
|
||||
expImpulse = 200;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
targetNameTag = 'Deployed Light';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight) {
|
||||
shapeFile = "turret_muzzlepoint.dts";
|
||||
hasLight = true;
|
||||
lightType = "ConstantLight";
|
||||
lightColor = "1.0 1.0 1.0 1.0";
|
||||
lightTime = "1000";
|
||||
lightRadius = "15";
|
||||
};
|
||||
|
||||
// Constant
|
||||
|
||||
datablock ItemData(DeployedLight0) : DeployedLight {
|
||||
lightColor = %colourOn SPC %colourOn SPC %colourOn;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight1) : DeployedLight {
|
||||
lightColor = %colourOn SPC %colourOff SPC %colourOff;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight2) : DeployedLight {
|
||||
lightColor = %colourOff SPC %colourOn SPC %colourOff;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight3) : DeployedLight {
|
||||
lightColor = %colourOff SPC %colourOff SPC %colourOn;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight4) : DeployedLight {
|
||||
lightColor = %colourOff SPC %colourOn SPC %colourOn;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight5) : DeployedLight {
|
||||
lightColor = %colourOn SPC %colourOff SPC %colourOn;
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight6) : DeployedLight {
|
||||
lightColor = %colourOn SPC %colourOn SPC %colourOff;
|
||||
};
|
||||
|
||||
// Strobe
|
||||
|
||||
datablock ItemData(DeployedLight7) : DeployedLight {
|
||||
lightColor = %strobeColourOn SPC %strobeColourOn SPC %strobeColourOn;
|
||||
lightType = "PulsingLight";
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight8) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOn SPC %strobeColourOff SPC %strobeColourOff;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight9) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOff SPC %strobeColourOn SPC %strobeColourOff;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight10) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOff SPC %strobeColourOff SPC %strobeColourOn;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight11) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOff SPC %strobeColourOn SPC %strobeColourOn;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight12) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOn SPC %strobeColourOff SPC %strobeColourOn;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ItemData(DeployedLight13) : DeployedLight {
|
||||
lightType = "PulsingLight";
|
||||
lightColor = %strobeColourOn SPC %strobeColourOn SPC %strobeColourOff;
|
||||
lightTime = "50";
|
||||
lightRadius = "10";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(LightDeployableImage) {
|
||||
mass = 1;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = LightDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedLightBase;
|
||||
heatSignature = 0;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Idle";
|
||||
|
||||
isLarge = false;
|
||||
maxDepSlope = 360;
|
||||
deploySound = ItemPickupSound;
|
||||
|
||||
minDeployDis = 0.5;
|
||||
maxDeployDis = 50.0;
|
||||
};
|
||||
|
||||
datablock ItemData(LightDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "LightDeployableImage";
|
||||
pickUpName = "a light pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function LightDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function LightDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
function LightDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function LightDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
%className = "StaticShape";
|
||||
|
||||
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
||||
|
||||
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
||||
%item.surfaceNrm2 = %playerVector;
|
||||
else
|
||||
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 -1"));
|
||||
|
||||
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = %item.deployed;
|
||||
};
|
||||
|
||||
%deplObj.light = new Item() {
|
||||
datablock = DeployedLight @ %plyr.packSet;
|
||||
static = true;
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
adjustLight(%deplObj);
|
||||
|
||||
// set the recharge rate right away
|
||||
if (%deplObj.getDatablock().rechargeRate)
|
||||
%deplObj.setRechargeRate(%deplObj.getDatablock().rechargeRate);
|
||||
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
%deplObj.light.lightBase = %deplObj;
|
||||
|
||||
// set the sensor group if it needs one
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
//let the AI know as well...
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
// play the deploy sound
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
// increment the team count for this deployed object
|
||||
$TeamDeployedCount[%plyr.team, %item.item]++;
|
||||
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
%deplObj.playThread($PowerThread,"Power");
|
||||
%deplObj.playThread($AmbientThread,"ambient");
|
||||
|
||||
// take the deployable off the player's back and out of inventory
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedLightBase::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this,%obj,%prevState);
|
||||
$TeamDeployedCount[%obj.team, LightDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
if (isObject(%obj.light))
|
||||
%obj.light.schedule(500, "delete");
|
||||
}
|
||||
|
||||
function DeployedLightBase::disassemble(%data,%plyr,%obj) {
|
||||
if (isObject(%obj.light))
|
||||
%obj.light.delete();
|
||||
disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
|
||||
function adjustLight(%obj) {
|
||||
%obj.light.setTransform(vectorAdd(%obj.getPosition(),vectorScale(realVec(%obj,"0 0 1"),1)) SPC %obj.getRotation());
|
||||
}
|
||||
|
||||
function LightDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasLight = true; // set for lightcheck
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
|
||||
function LightDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasLight = "";
|
||||
%obj.packSet = 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue