mirror of
https://github.com/haydenmc/Krypton.git
synced 2026-03-05 21:40:28 +00:00
Initial commit of Krypton Construction Mod for Tribes 2.
This commit is contained in:
commit
846a7a73ea
179 changed files with 109631 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
*.dso
|
||||
!Construction/scripts/do_not_delete/MergeToolSupport.cs.dso
|
||||
7
Construction/ConstructionPreferences.cs
Normal file
7
Construction/ConstructionPreferences.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//Construction 0.70 Server Configuration File
|
||||
|
||||
//Logging:
|
||||
$Construction::Logging::EchoChat = 1;
|
||||
$Construction::Logging::LogConnects = 1; //disconnects too
|
||||
$Construction::Logging::LogChat = 1;
|
||||
|
||||
56
Construction/Credits.txt
Normal file
56
Construction/Credits.txt
Normal 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.
|
||||
1
Construction/Saves/Saves.txt
Normal file
1
Construction/Saves/Saves.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is where player save files go. Organized by GUID.
|
||||
1108
Construction/Version-history.txt
Normal file
1108
Construction/Version-history.txt
Normal file
File diff suppressed because it is too large
Load diff
1
Construction/playerprefs/PlayerPrefs.txt
Normal file
1
Construction/playerprefs/PlayerPrefs.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is where krypton player preferences are stored, by GUID.
|
||||
1
Construction/playerprefs/undo/undo.txt
Normal file
1
Construction/playerprefs/undo/undo.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is where temporary undo files for players are stored. Organized by GUID.
|
||||
86
Construction/readme2.txt
Normal file
86
Construction/readme2.txt
Normal 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.
|
||||
114
Construction/scripts/ConstructionGame.cs
Normal file
114
Construction/scripts/ConstructionGame.cs
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
// 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',"", %game.class);
|
||||
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);
|
||||
}
|
||||
|
||||
// exec("scripts/Krypton/Theorem.cs");
|
||||
$tid.voicepitch = 1.6;
|
||||
$tid.cleartasks();
|
||||
$tid.addtask(AIEngageTask); //Kill anyone who hurts you
|
||||
$tid.addtask(AIEngageTurretTask); //Kill anyone (MTCs) who hurts you
|
||||
$tid.addtask(AIUseInventoryTask); //Get your crap
|
||||
$tid.addtask(AIPatrolTask); //Run around
|
||||
$tid.isAdmin = 1;
|
||||
$tid.isSuperAdmin = 1;
|
||||
//$tid.addTask(AIBountyPatrolTask); //Run around/look for someone to kill.
|
||||
//$tid.bountyTask = $tid.addTask(AIBountyEngageTask);
|
||||
$tid.setskilllevel(0.99); //Be smart
|
||||
|
||||
//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::vehicleDestroyed(%game, %vehicle, %destroyer) {
|
||||
}
|
||||
|
||||
138
Construction/scripts/DebriefGui.cs
Normal file
138
Construction/scripts/DebriefGui.cs
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// DebriefGui.cs
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DebriefGui::onWake( %this )
|
||||
{
|
||||
moveMap.pop();
|
||||
if ( isObject( passengerKeys ) )
|
||||
passengerKeys.pop();
|
||||
if ( isObject( observerBlockMap ) )
|
||||
observerBlockMap.pop();
|
||||
if ( isObject( observerMap ) )
|
||||
observerMap.pop();
|
||||
//flyingCameraMove.pop();
|
||||
|
||||
if ( isObject( debriefMap ) )
|
||||
{
|
||||
debriefMap.pop();
|
||||
debriefMap.delete();
|
||||
}
|
||||
new ActionMap( debriefMap );
|
||||
%bind = moveMap.getBinding( toggleMessageHud );
|
||||
debriefMap.bind( getField( %bind, 0 ), getField( %bind, 1 ), toggleDebriefChat );
|
||||
debriefMap.copyBind( moveMap, activateChatMenuHud );
|
||||
debriefMap.bindCmd( keyboard, escape, "", "debriefContinue();" );
|
||||
debriefMap.push();
|
||||
|
||||
DB_ChatVector.attach( HudMessageVector );
|
||||
DB_ChatScroll.scrollToBottom();
|
||||
DB_LoadingProgress.setValue( 0 );
|
||||
LoadingProgress.setValue( 0 );
|
||||
DB_LoadingProgressTxt.setValue( "LOADING MISSION" );
|
||||
LoadingProgressTxt.setValue( "LOADING MISSION" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DebriefGui::onSleep( %this )
|
||||
{
|
||||
debriefMap.pop();
|
||||
debriefMap.delete();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DebriefResultText::onResize( %this, %width, %height )
|
||||
{
|
||||
%fieldHeight = getWord( DB_ResultPane.getExtent(), 1 );
|
||||
%x = getWord( DB_ResultScroll.getPosition(), 0 );
|
||||
%w = getWord( DB_ResultScroll.getExtent(), 0 );
|
||||
%h = %fieldHeight - %height - 4;
|
||||
DB_ResultScroll.resize( %x, %height + 2, %w, %h );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function toggleDebriefChat()
|
||||
{
|
||||
Canvas.pushDialog( DB_ChatDlg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DB_ChatDlg::onWake( %this )
|
||||
{
|
||||
DB_ChatEntry.setValue( "" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DB_ChatEntry::onEscape( %this )
|
||||
{
|
||||
Canvas.popDialog( DB_ChatDlg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DB_ChatEntry::sendChat( %this )
|
||||
{
|
||||
%text = %this.getValue();
|
||||
if ( %text !$= "" )
|
||||
commandToServer( 'MessageSent', %text );
|
||||
|
||||
Canvas.popDialog( DB_ChatDlg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function debriefDisconnect()
|
||||
{
|
||||
MessageBoxYesNo( "DISCONNECT", "Are you sure you want to leave this game?", "Disconnect();" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function debriefContinue()
|
||||
{
|
||||
checkGotLoadInfo();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
addMessageCallback( 'MsgGameOver', handleGameOverMessage );
|
||||
addMessageCallback( 'MsgClearDebrief', handleClearDebriefMessage );
|
||||
addMessageCallback( 'MsgDebriefResult', handleDebriefResultMessage );
|
||||
addMessageCallback( 'MsgDebriefAddLine', handleDebriefLineMessage );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleGameOverMessage( %msgType, %msgString )
|
||||
{
|
||||
weaponsHud.clearAll();
|
||||
inventoryHud.clearAll();
|
||||
|
||||
// Fill the Debriefer up with stuff...
|
||||
Canvas.setContent( DebriefGui );
|
||||
}
|
||||
|
||||
function handleClearDebriefMessage( %msgType, %msgString )
|
||||
{
|
||||
DebriefResultText.setText( "" );
|
||||
DebriefText.setText( "" );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleDebriefResultMessage( %msgType, %msgString, %string )
|
||||
{
|
||||
%text = DebriefResultText.getText();
|
||||
if ( %text $= "" )
|
||||
%newText = detag( %string );
|
||||
else
|
||||
%newText = %text NL detag( %string );
|
||||
DebriefResultText.setText( %newText );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function handleDebriefLineMessage( %msgType, %msgString, %string )
|
||||
{
|
||||
%text = DebriefText.getText();
|
||||
if ( %text $= "" )
|
||||
%newText = detag( %string );
|
||||
else
|
||||
%newText = %text NL detag( %string );
|
||||
DebriefText.setText( %newText );
|
||||
}
|
||||
275
Construction/scripts/Function Library R3.txt
Normal file
275
Construction/scripts/Function Library R3.txt
Normal 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
Construction/scripts/JTLmeteorStorm.cs
Normal file
196
Construction/scripts/JTLmeteorStorm.cs
Normal 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])");
|
||||
}
|
||||
}
|
||||
726
Construction/scripts/Krypton/MergeTool.cs
Normal file
726
Construction/scripts/Krypton/MergeTool.cs
Normal file
|
|
@ -0,0 +1,726 @@
|
|||
// Merge Tool v006
|
||||
// Coded by Electricutioner
|
||||
// Last modified: 6:22 PM 5/21/2006
|
||||
// Idea by the T2 Construction Community
|
||||
|
||||
//Variables:
|
||||
$ElecMod::MergeTool::Tolerance = 0.05; //how many meters of tolerance do we give the pieces that we merge.
|
||||
$ElecMod::MergeTool::HighTolerance = 0.25; //used for "high tolerance" mode on stubborn pieces
|
||||
$ElecMod::MergeTool::Timeout = 2; //how many seconds until a selection times out when using the tool
|
||||
|
||||
//split portion
|
||||
$ElecMod::MergeTool::MinimumPieceVolume = 0.125; //50 cm cube is smallest, consider revising this to 16
|
||||
|
||||
//Functions:
|
||||
|
||||
//this function rotates and rescales pieces to create the stretch effect
|
||||
function MTIsometric(%client, %piece)
|
||||
{
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
if (%client.guid != %piece.getOwner().guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2IT: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%center = %piece.getEdge("0 0 0");
|
||||
%currentSize = %piece.getRealSize();
|
||||
|
||||
//this used to be one operation, but it ceased to work properly (?)
|
||||
%piece.setTransform(remoteRotate(%piece,"0 1 0 1.570796", %piece,"0 0 0"));
|
||||
%piece.setRealSize(getWord(%currentSize, 2) SPC getWord(%currentSize, 1) SPC getWord(%currentSize, 0));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
%currentSize = %piece.getRealSize();
|
||||
|
||||
%piece.setTransform(remoteRotate(%piece,"0 0 1 1.570796", %piece,"0 0 0"));
|
||||
%piece.setRealSize(getWord(%currentSize, 1) SPC getWord(%currentSize, 0) SPC getWord(%currentSize, 2));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
|
||||
}
|
||||
|
||||
// Function by Eolk
|
||||
function MTZAxisReverse(%client, %piece)
|
||||
{
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
if (%client.guid != %piece.getOwner().guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2IT: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%center = %piece.getEdge("0 0 0");
|
||||
%piece.setTransform(remoteRotate(%piece,"1 0 0 3.141593", %piece,"0 0 0"));
|
||||
%piece.setEdge(%center, "0 0 0");
|
||||
}
|
||||
|
||||
//This is the basic initiator function. If the piece called are compatable, nothing further needs to be called.
|
||||
function MTMerge(%client, %piece1, %piece2, %hiTol)
|
||||
{
|
||||
if (!MTCheckCompatability(%client, %piece1, %piece2, %hiTol))
|
||||
{
|
||||
%piece1.setCloaked(false);
|
||||
%piece2.setCloaked(false);
|
||||
MTClearClientSelection();
|
||||
return;
|
||||
}
|
||||
if (!%piece1.isForcefield())
|
||||
%piece1.setCloaked(true);
|
||||
if (!%piece2.isForcefield())
|
||||
%piece2.setCloaked(true);
|
||||
schedule(100, 0, "MTScaleShiftMerge", %piece1, %piece2);
|
||||
|
||||
if (isEventPending(%client.mergeschedule))
|
||||
{
|
||||
cancel(%client.mergeschedule);
|
||||
MTClearClientSelection();
|
||||
}
|
||||
}
|
||||
|
||||
//This function checks if 4 corners of the objects are compatable. If an error is encountered it returns a 0 and
|
||||
//terminates the merge. Otherwise, it returns a 1, and continues the merge process.
|
||||
function MTCheckCompatability(%client, %piece1, %piece2, %hiTol)
|
||||
{
|
||||
//do the pieces exist?
|
||||
if (!isObject(%piece1) || !isObject(%piece2))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MT: A piece appears to be missing.");
|
||||
return;
|
||||
}
|
||||
//check if the owners are the same
|
||||
if (%piece1.getOwner() != %client || %piece2.getOwner() != %client)
|
||||
{
|
||||
//with an exemption of admins
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
//fix for when players leave the server and come back
|
||||
if (%piece1.getOwner().guid != %client.guid || %piece2.getOwner().guid != %client.guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MT: One or more of those pieces do not belong to you.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//now we need to determine if at least 4 of the pieces axies match
|
||||
//get all the 8 points of both pieces
|
||||
%pos1[0] = %piece1.getEdge("1 1 -1");
|
||||
%pos1[1] = %piece1.getEdge("-1 1 -1");
|
||||
%pos1[2] = %piece1.getEdge("1 -1 -1");
|
||||
%pos1[3] = %piece1.getEdge("-1 -1 -1");
|
||||
%pos1[4] = %piece1.getEdge("1 1 1");
|
||||
%pos1[5] = %piece1.getEdge("-1 1 1");
|
||||
%pos1[6] = %piece1.getEdge("1 -1 1");
|
||||
%pos1[7] = %piece1.getEdge("-1 -1 1");
|
||||
|
||||
%pos2[0] = %piece2.getEdge("1 1 -1");
|
||||
%pos2[1] = %piece2.getEdge("-1 1 -1");
|
||||
%pos2[2] = %piece2.getEdge("1 -1 -1");
|
||||
%pos2[3] = %piece2.getEdge("-1 -1 -1");
|
||||
%pos2[4] = %piece2.getEdge("1 1 1");
|
||||
%pos2[5] = %piece2.getEdge("-1 1 1");
|
||||
%pos2[6] = %piece2.getEdge("1 -1 1");
|
||||
%pos2[7] = %piece2.getEdge("-1 -1 1");
|
||||
//then we compare them to see which ones match
|
||||
%k = 0;
|
||||
for (%i = 0; %i < 8; %i++)
|
||||
{
|
||||
for (%j = 0; %j < 8; %j++)
|
||||
{
|
||||
if (!%hiTol && $ElecMod::MergeTool::Tolerance >= vectorDist(%pos1[%i], %pos2[%j]))
|
||||
{
|
||||
%k++;
|
||||
}
|
||||
else if (%hiTol && $ElecMod::MergeTool::HighTolerance >= vectorDist(%pos1[%i], %pos2[%j]))
|
||||
{
|
||||
%k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if less then 4 match, they can't be compatable (if more then 4 match... something odd is going on)
|
||||
if (%k < 4)
|
||||
{
|
||||
if (%k == 0)
|
||||
messageClient(%client, 'MsgClient', "\c2MT: None of the corners are shared on those objects. Cannot merge.");
|
||||
else
|
||||
messageClient(%client, 'MsgClient', "\c2MT: Only " @ %k @ " corners of the required 4 are shared. Cannot merge.");
|
||||
|
||||
return;
|
||||
}
|
||||
else if (%k > 4)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MT: Warning: Detected match of over 4 corners (" @ %k @ "). Merging may fail to produce desired results.");
|
||||
}
|
||||
//if the check survived that, we continue...
|
||||
return 1;
|
||||
}
|
||||
|
||||
//this function, after the pieces are confirmed, checks to see which of the 6 sides is in contact, refers to another
|
||||
//function to find the alter side, determines distance between them to find a new "real" scale, and determines the
|
||||
//new world box center for the object. Piece 1 is resized and moved, piece 2 is deconstructed.
|
||||
function MTScaleShiftMerge(%piece1, %piece2)
|
||||
{
|
||||
//find which axis is touching for a "this is the side we scale" discovery
|
||||
//table:
|
||||
//0: X
|
||||
//1: -X
|
||||
//2: Y
|
||||
//3: -Y
|
||||
//4: Z
|
||||
//5: -Z
|
||||
|
||||
%p1S[0] = %piece1.getEdge("1 0 0");
|
||||
%p1S[1] = %piece1.getEdge("-1 0 0");
|
||||
%p1S[2] = %piece1.getEdge("0 1 0");
|
||||
%p1S[3] = %piece1.getEdge("0 -1 0");
|
||||
%p1S[4] = %piece1.getEdge("0 0 1");
|
||||
%p1S[5] = %piece1.getEdge("0 0 -1");
|
||||
|
||||
%p2S[0] = %piece2.getEdge("1 0 0");
|
||||
%p2S[1] = %piece2.getEdge("-1 0 0");
|
||||
%p2S[2] = %piece2.getEdge("0 1 0");
|
||||
%p2S[3] = %piece2.getEdge("0 -1 0");
|
||||
%p2S[4] = %piece2.getEdge("0 0 1");
|
||||
%p2S[5] = %piece2.getEdge("0 0 -1");
|
||||
|
||||
for (%i = 0; %i < 6; %i++)
|
||||
{
|
||||
for (%j = 0; %j < 8; %j++)
|
||||
{
|
||||
if ($ElecMod::MergeTool::Tolerance >= vectorDist(%p1S[%i], %p2S[%j]))
|
||||
{
|
||||
%side1 = %i;
|
||||
%side2 = %j;
|
||||
}
|
||||
}
|
||||
}
|
||||
//echo("Sides:" SPC %i SPC %j);
|
||||
//at this point %side1/2 will contain one of the numbers in the table above
|
||||
//we get the non-shared side at this point
|
||||
%ops1 = MTFindOpSide(%side1);
|
||||
%ops2 = MTFindOpSide(%side2);
|
||||
|
||||
//this variable contains the new axis length that we are scaling on...
|
||||
%newaxis = VectorDist(%p1S[%ops1], %p2S[%ops2]);
|
||||
%currsize = %piece1.getRealSize();
|
||||
|
||||
if (%side1 == 0 || %side1 == 1)
|
||||
%axis = "x";
|
||||
if (%side1 == 2 || %side1 == 3)
|
||||
%axis = "y";
|
||||
if (%side1 == 4 || %side1 == 5)
|
||||
%axis = "z";
|
||||
|
||||
//echo("Axis:" SPC %axis);
|
||||
if (%axis $= "x")
|
||||
{
|
||||
%piece1.setRealSize(%newaxis SPC getWords(%currsize, 1, 2));
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(%newaxis SPC getWords(%currsize, 1, 2));
|
||||
}
|
||||
if (%axis $= "y")
|
||||
{
|
||||
%piece1.setRealSize(getWord(%currsize, 0) SPC %newaxis SPC getWord(%currsize, 2));
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(getWord(%currsize, 0) SPC %newaxis SPC getWord(%currsize, 2));
|
||||
}
|
||||
if (%axis $= "z")
|
||||
{
|
||||
%piece1.setRealSize(getWords(%currsize, 0, 1) SPC %newaxis);
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setScale(getWords(%currsize, 0, 1) SPC %newaxis);
|
||||
}
|
||||
if (%axis !$= "x" && %axis !$= "y" && %axis !$= "z")
|
||||
{
|
||||
error("MT: A scaling error has occured.");
|
||||
return;
|
||||
}
|
||||
%newpos = VectorScale(VectorAdd(%p1S[%ops1], %p2S[%ops2]), 0.5);
|
||||
%piece1.SetWorldBoxCenter(%newpos);
|
||||
|
||||
if (isObject(%piece1.pzone))
|
||||
%piece1.pzone.setPosition(%piece1.getPosition());
|
||||
|
||||
if (!%piece1.isForcefield())
|
||||
%piece1.setCloaked(false);
|
||||
if (!%piece2.isForcefield())
|
||||
%piece2.setCloaked(false);
|
||||
|
||||
//%piece2.delete(); //deleting is bad
|
||||
//%piece2.getDataBlock().disassemble(0, %piece2.owner, %piece2); //disassemble is cleaner
|
||||
//fixed disassemble to use object specific disassemble functions
|
||||
//disassemble(0, %piece2.owner, %piece2);
|
||||
%piece2.getDatablock().disassemble(0, %piece2);
|
||||
}
|
||||
|
||||
//this function does something very simple, it finds whether a number is even or odd, and then adds or subracts
|
||||
//and returns the initial input with that modification. I can't imagine where else this could be useful.
|
||||
function MTFindOpSide(%side)
|
||||
{
|
||||
%evencheck = %side / 2;
|
||||
if (%evencheck == mFloor(%evencheck))
|
||||
%even = 1;
|
||||
else
|
||||
%even = 0;
|
||||
|
||||
if (%even)
|
||||
return (%side + 1);
|
||||
else
|
||||
return (%side - 1);
|
||||
}
|
||||
|
||||
//simply clears a client variable... woohoo...
|
||||
function MTClearClientSelection(%client)
|
||||
{
|
||||
%client.mergePiece1 = "";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//"weapon" datablocks and such
|
||||
datablock ItemData(MergeTool)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
image = MergeToolImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a MIST, by Electricutioner.";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MergeToolImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_sniper.dts";
|
||||
item = MergeTool;
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "ActivateReady";
|
||||
stateSound[0] = SniperRifleSwitchSound;
|
||||
stateTimeoutValue[0] = 0.1;
|
||||
stateSequence[0] = "Activate";
|
||||
|
||||
stateName[1] = "ActivateReady";
|
||||
stateTransitionOnLoaded[1] = "Ready";
|
||||
stateTransitionOnNoAmmo[1] = "NoAmmo";
|
||||
|
||||
stateName[2] = "Ready";
|
||||
stateTransitionOnNoAmmo[2] = "NoAmmo";
|
||||
stateTransitionOnTriggerDown[2] = "CheckWet";
|
||||
|
||||
stateName[3] = "Fire";
|
||||
stateTransitionOnTimeout[3] = "Reload";
|
||||
stateTimeoutValue[3] = 0.2; //reload timeout here
|
||||
stateFire[3] = true;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Fire";
|
||||
stateScript[3] = "onFire";
|
||||
stateSound[3] = "MergeToolFireSound";
|
||||
|
||||
stateName[4] = "Reload";
|
||||
stateTransitionOnTimeout[4] = "Ready";
|
||||
stateTimeoutValue[4] = 0.1;
|
||||
stateAllowImageChange[4] = false;
|
||||
|
||||
stateName[5] = "CheckWet";
|
||||
stateTransitionOnWet[5] = "Fire";
|
||||
stateTransitionOnNotWet[5] = "Fire";
|
||||
|
||||
stateName[6] = "NoAmmo";
|
||||
stateTransitionOnAmmo[6] = "Reload";
|
||||
stateTransitionOnTriggerDown[6] = "DryFire";
|
||||
stateSequence[6] = "NoAmmo";
|
||||
|
||||
stateName[7] = "DryFire";
|
||||
stateSound[7] = SniperRifleDryFireSound;
|
||||
stateTimeoutValue[7] = 0.1;
|
||||
stateTransitionOnTimeout[7] = "Ready";
|
||||
};
|
||||
|
||||
function MergeToolImage::onFire(%data,%obj,%slot)
|
||||
{
|
||||
serverPlay3D(SniperRifleFireSound, %obj.getTransform());
|
||||
%client = %obj.client;
|
||||
|
||||
%pos = getWords(%obj.getEyeTransform(), 0, 2);
|
||||
%vec = %obj.getEyeVector();
|
||||
%targetpos = VectorAdd(%pos, VectorScale(%vec, 2000));
|
||||
%piece = containerRaycast(%pos, %targetpos, $TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType, %obj);
|
||||
%cast = %piece;
|
||||
%piece = getWord(%piece, 0);
|
||||
|
||||
if (!isObject(%piece))
|
||||
return;
|
||||
|
||||
if (!Deployables.isMember(%piece))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece is part of the map and cannot be manipulated.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!%client.isAdmin)
|
||||
{
|
||||
if (%piece.getOwner().guid != %client.guid)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MIST: That piece isn't yours.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (%client.MTMode == 0)
|
||||
{
|
||||
if (!isObject(%client.mergePiece1))
|
||||
{
|
||||
%client.mergePiece1 = %piece;
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
}
|
||||
|
||||
%client.mergeschedule = schedule($ElecMod::MergeTool::Timeout * 1000, 0, "MTClearClientSelection", %client);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (%piece != %client.mergePiece1)
|
||||
{
|
||||
if (%client.MTSubMode == 1)
|
||||
{
|
||||
MTMerge(%client, %client.mergePiece1, %piece, 1);
|
||||
%client.MTSubMode = 0;
|
||||
MTShowStatus(%client);
|
||||
}
|
||||
else
|
||||
{
|
||||
MTMerge(%client, %client.mergePiece1, %piece, 0);
|
||||
}
|
||||
MTClearClientSelection(%client);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2MT: You cannot merge a piece with itself.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (%client.MTMode == 1)
|
||||
{
|
||||
if (%client.MTSubMode == 1)
|
||||
MTZAxisReverse(%client, %piece);
|
||||
else
|
||||
MTIsometric(%client, %piece);
|
||||
}
|
||||
if (%client.MTMode == 2)
|
||||
{
|
||||
if (%client.MTSubMode > 4 || %client.MTSubMode == 1)
|
||||
{
|
||||
%client.MTSplitMode = 1; //crosshair split
|
||||
}
|
||||
else
|
||||
{
|
||||
%client.MTSplitMode = 0; //half split
|
||||
}
|
||||
if (%client.MTSubMode == 0)
|
||||
%axis = "a";
|
||||
if (%client.MTSubMode == 1)
|
||||
%axis = "a";
|
||||
if (%client.MTSubMode == 2)
|
||||
%axis = "x";
|
||||
if (%client.MTSubMode == 3)
|
||||
%axis = "y";
|
||||
if (%client.MTSubMode == 4)
|
||||
%axis = "z";
|
||||
if (%client.MTSubMode == 5)
|
||||
%axis = "x";
|
||||
if (%client.MTSubMode == 6)
|
||||
%axis = "y";
|
||||
if (%client.MTSubMode == 7)
|
||||
%axis = "z";
|
||||
|
||||
MTSplit(%client, %cast, %axis);
|
||||
}
|
||||
}
|
||||
|
||||
function MergeToolImage::onMount(%this,%obj,%slot)
|
||||
{
|
||||
Parent::onMount(%this, %obj, %slot);
|
||||
%obj.mountImage(MergeToolImage, 0);
|
||||
MTShowStatus(%obj.client);
|
||||
}
|
||||
|
||||
function MTShowStatus(%client)
|
||||
{
|
||||
if (%client.MTMode $= "")
|
||||
%client.MTMode = 0;
|
||||
if (%client.MTSubMode $= "")
|
||||
%client.MTSubMode = 0;
|
||||
|
||||
switch (%client.MTMode)
|
||||
{
|
||||
case 0:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Merge. Fire the tool at two pieces. If possible, they will merge. Tolerance: " @ $ElecMod::MergeTool::Tolerance @ " meters.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Merge. Fire the tool at two pieces. If possible, they will merge. Tolerance: " @ $ElecMod::MergeTool::HighTolerance @ " meters.";
|
||||
}
|
||||
case 1:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<spop><font:Arial:14>Mode: Isometric. Fire at a piece. It will be rotated isometrically.";
|
||||
case 1:
|
||||
%status = "<spop><font:Arial:14>Mode: Isometric Z-axis Reversal. Fire at a piece. It's Z Axis will be reversed.";
|
||||
}
|
||||
case 2:
|
||||
switch (%client.MTSubMode)
|
||||
{
|
||||
case 0:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Automatic.";
|
||||
case 1:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Automatic.";
|
||||
case 2:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: X.";
|
||||
case 3:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Y.";
|
||||
case 4:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it in half. Axis: Z.";
|
||||
case 5:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: X.";
|
||||
case 6:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Y.";
|
||||
case 7:
|
||||
%status = "<font:Arial:14>Mode: Split. Fire at a piece to split it on crosshair. Axis: Z.";
|
||||
}
|
||||
}
|
||||
CommandToClient(%client, 'BottomPrint', "<font:Sui Generis:14>>>>M/I/S Tool<<<\n<font:Arial:14>" @ %status @ "\nCoded by Electricutioner.", 3, 3 );
|
||||
}
|
||||
|
||||
//Split code begins here.
|
||||
//The goal of this is to be a semi-inverse of the merge...
|
||||
//The tool will be set to split mode, and aimed at an object. The object axies are checked, and if there is one that is
|
||||
//disproportionally larger then the rest, it will be split on that axis. If two or more axies are similar, it does
|
||||
//a check to determine the face where the raycast hits (reducing split possibilities by one axis) and either
|
||||
//spliting on the remaining axis or using position points to find out in which quadrant of the face, the raycast hit.
|
||||
//Once the axis is determined, the split axis has the difference halved, a "dominant" piece rescaled and repositioned
|
||||
//in steps similar to the merge, and a new (nearly-identical) piece is created in the resulting void.
|
||||
|
||||
//startup function, the calling client, and the raycasted piece. Note: %piece contains all raycast operations.
|
||||
function MTSplit(%client, %piece, %axis)
|
||||
{
|
||||
if(!MTSplitValidate(%client, %piece, %axis)) //validates the client selected piece as valid
|
||||
return;
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
getWord(%piece, 0).setCloaked(true);
|
||||
|
||||
MTSplitScaleShift(%client, %piece, %axis); //split it up
|
||||
}
|
||||
|
||||
//makes sure that the object can be split
|
||||
function MTSplitValidate(%client, %piece, %axis)
|
||||
{
|
||||
if (!isObject(getWord(%piece, 0)))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2ST: The piece to split is missing. You should not see this error.");
|
||||
return;
|
||||
}
|
||||
|
||||
//restricting to cubics and forcefields.
|
||||
if (!isCubic(%piece) && !%piece.isForceField())
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2ST: That object is not cubic and it cannot be split.");
|
||||
return;
|
||||
}
|
||||
|
||||
%size = %piece.getRealSize();
|
||||
%volume = 2 * getWord(%size, 0) * 2 * getWord(%size, 1) * 2 * getWord(%size, 2);
|
||||
if (%client.MTSplitMode == 0) //half split
|
||||
{
|
||||
if ((%volume / 2) < ($ElecMod::MergeTool::MinimumPieceVolume))
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2ST: That piece is too small to split.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%hitPos = getWord(%piece, 1) SPC getWord(%piece, 2) SPC getWord(%piece, 3);
|
||||
%edge = PointToEdge(getWord(%piece, 0), %hitPos);
|
||||
|
||||
//auto-axis determiner
|
||||
if (%axis $= "a")
|
||||
%axis = CalculateSplitAxis(PointToEdge(%piece, %hitPos));
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%ratio = getWord(%edge, 0);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
case "y":
|
||||
%ratio = getWord(%edge, 1);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
case "z":
|
||||
%ratio = getWord(%edge, 2);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
}
|
||||
|
||||
%masterSize = %volume * %ratio;
|
||||
%slaveSize = %volume * (1 - %ratio);
|
||||
|
||||
//echo(%ratio SPC %axis SPC %masterSize SPC %slaveSize);
|
||||
|
||||
if (%masterSize < $ElecMod::MergeTool::MinimumPieceVolume || %slaveSize < $ElecMod::MergeTool::MinimumPieceVolume)
|
||||
{
|
||||
messageClient(%client, 'MsgClient', "\c2ST: A resultant piece from that split is too small. Aborting.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return 1; //we survived, thus we continue
|
||||
}
|
||||
|
||||
//does the actual splitting
|
||||
function MTSplitScaleShift(%client, %cast, %axis)
|
||||
{
|
||||
%piece = getWord(%cast, 0);
|
||||
%copy = MTCarbonCopy(%piece); //Merge Tool Support functions
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.setCloaked(true);
|
||||
%copy.setCloaked(true);
|
||||
}
|
||||
|
||||
%hitPos = getWord(%cast, 1) SPC getWord(%cast, 2) SPC getWord(%cast, 3);
|
||||
|
||||
%size = %piece.getRealSize();
|
||||
|
||||
//auto axis determiner
|
||||
if (%axis $= "a")
|
||||
{
|
||||
%axis = CalculateSplitAxis(PointToEdge(%piece, %hitPos));
|
||||
//echo(%hitPos);
|
||||
}
|
||||
|
||||
if (%client.MTSplitMode == 0) //split in half
|
||||
{
|
||||
%center = %piece.getWorldBoxCenter();
|
||||
%sizeFactorMaster = 2;
|
||||
%sizeFactorSlave = 2;
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%piece.setRealSize((getWord(%size, 0) / %sizeFactorMaster) SPC getWords(%size, 1, 2));
|
||||
%copy.setRealSize((getWord(%size, 0) / %sizeFactorSlave) SPC getWords(%size, 1, 2));
|
||||
%piece.setEdge(%center, "1 0 0");
|
||||
%copy.setEdge(%center, "-1 0 0");
|
||||
case "y":
|
||||
%piece.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) / %sizeFactorMaster SPC getWord(%size, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) / %sizeFactorSlave SPC getWord(%size, 2));
|
||||
%piece.setEdge(%center, "0 1 0");
|
||||
%copy.setEdge(%center, "0 -1 0");
|
||||
case "z":
|
||||
%piece.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) / %sizeFactorMaster);
|
||||
%copy.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) / %sizeFactorSlave);
|
||||
%piece.setEdge(%center, "0 0 1");
|
||||
%copy.setEdge(%center, "0 0 -1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%edge = PointToEdge(%piece, %hitPos); //PointToEdge is in the Merge Tool support functions
|
||||
|
||||
switch$ (%axis)
|
||||
{
|
||||
case "x":
|
||||
%ratio = getWord(%edge, 0);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("-1 0 0");
|
||||
%piece.setRealSize(getWord(%size, 0) * %ratio SPC getWords(%size, 1, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) * (1 - %ratio) SPC getWords(%size, 1, 2));
|
||||
%piece.setEdge(%center, "-1 0 0");
|
||||
%copy.setEdge(%piece.getEdge("1 0 0"), "-1 0 0");
|
||||
case "y":
|
||||
%ratio = getWord(%edge, 1);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("0 -1 0");
|
||||
%piece.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) * %ratio SPC getWord(%size, 2));
|
||||
%copy.setRealSize(getWord(%size, 0) SPC getWord(%size, 1) * (1 - %ratio) SPC getWord(%size, 2));
|
||||
%piece.setEdge(%center, "0 -1 0");
|
||||
%copy.setEdge(%piece.getEdge("0 1 0"), "0 -1 0");
|
||||
case "z":
|
||||
%ratio = getWord(%edge, 2);
|
||||
%ratio = (%ratio + 1) / 2;
|
||||
%center = %piece.getEdge("0 0 -1");
|
||||
%piece.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) * %ratio);
|
||||
%copy.setRealSize(getWords(%size, 0, 1) SPC getWord(%size, 2) * (1 - %ratio));
|
||||
%piece.setEdge(%center, "0 0 -1");
|
||||
%copy.setEdge(%piece.getEdge("0 0 1"), "0 0 -1");
|
||||
}
|
||||
}
|
||||
|
||||
if (isObject(%piece.pzone))
|
||||
{
|
||||
%piece.pzone.setScale(%piece.getScale());
|
||||
%piece.pzone.setPosition(%piece.getPosition());
|
||||
}
|
||||
if (isObject(%copy.pzone))
|
||||
{
|
||||
%copy.pzone.setScale(%copy.getScale());
|
||||
%copy.pzone.setPosition(%copy.getPosition());
|
||||
}
|
||||
|
||||
if (!%piece.isForcefield())
|
||||
{
|
||||
%piece.schedule(290, "setCloaked", false);
|
||||
%copy.schedule(290, "setCloaked", false);
|
||||
}
|
||||
}
|
||||
|
||||
function CalculateSplitAxis(%edge)
|
||||
{
|
||||
//echo("Calculating split axis from edge: " @ %edge);
|
||||
%edge = mAbs(getWord(%edge, 0)) SPC mAbs(getWord(%edge, 1)) SPC mAbs(getWord(%edge, 2));
|
||||
if (getWord(%edge, 0) < getWord(%edge, 1) && getWord(%edge, 0) < getWord(%edge, 2))
|
||||
return "x";
|
||||
if (getWord(%edge, 1) < getWord(%edge, 0) && getWord(%edge, 1) < getWord(%edge, 2))
|
||||
return "y";
|
||||
if (getWord(%edge, 2) < getWord(%edge, 0) && getWord(%edge, 2) < getWord(%edge, 1))
|
||||
return "z";
|
||||
}
|
||||
|
||||
exec("scripts/do_not_delete/MergeToolSupport.cs");
|
||||
815
Construction/scripts/Krypton/PermissionSphere.cs
Normal file
815
Construction/scripts/Krypton/PermissionSphere.cs
Normal file
|
|
@ -0,0 +1,815 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// Deployable Permission Sphere
|
||||
//--------------------------------------
|
||||
|
||||
datablock ItemData(PermSphereDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "deploy_sensor_pulse.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 = "PermSphereDeployableImage";
|
||||
pickUpName = "a Permissions Sphere pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
|
||||
datablock StaticShapeData(DeployedOOSphere) : StaticShapeDamageProfile { //Deployed owner-only sphere
|
||||
className = "oosphere";
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
disabledLevel = 1.0;
|
||||
|
||||
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 = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
// humSound = GeneratorHumSound;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Permission Sphere';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedPeaceSphere) : StaticShapeDamageProfile { //Deployed Peace sphere
|
||||
className = "oosphere";
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
disabledLevel = 1.0;
|
||||
|
||||
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 = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
// humSound = GeneratorHumSound;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Permission Sphere';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedCombatSphere) : StaticShapeDamageProfile { //Deployed Combat sphere
|
||||
className = "oosphere";
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
disabledLevel = 1.0;
|
||||
|
||||
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 = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
// humSound = GeneratorHumSound;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Permission Sphere';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedSpawnSphere) : StaticShapeDamageProfile { //Deployed Spawn sphere
|
||||
className = "oosphere";
|
||||
shapeFile = "turret_Muzzlepoint.dts";
|
||||
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
disabledLevel = 1.0;
|
||||
|
||||
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 = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
// humSound = GeneratorHumSound;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Spawn Sphere';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(PermSphereDeployableImage) {
|
||||
mass = 1;
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
scale = 2.5 / 3.85 @ " " @ 2.5 / 3.1 @ " " @ 5 / 3.1;
|
||||
item = PermSphereDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = PermSphereDeployed;
|
||||
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;
|
||||
};
|
||||
|
||||
function PermSphereDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasPermSphere = true; // set for PermSpherecheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function PermSphereDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasPermSphere = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function PermSphereDeployableImage::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 = "2 2 2";
|
||||
|
||||
|
||||
if (%plyr.packSet == 0) { //Owner-Only Construct Zone Sphere!
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = "DeployedOOSphere";
|
||||
scale = %scale;
|
||||
};
|
||||
}
|
||||
|
||||
if (%plyr.packSet == 1) { //Peace Zone Sphere!
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = "DeployedPeaceSphere";
|
||||
scale = %scale;
|
||||
};
|
||||
}
|
||||
|
||||
if (%plyr.packSet == 2) { //Combat Zone Sphere!
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = "DeployedCombatSphere";
|
||||
scale = %scale;
|
||||
};
|
||||
}
|
||||
|
||||
//Set the range on this baby
|
||||
if (%plyr.expertSet == 0)
|
||||
%deplObj.range = 50; //50 meter range
|
||||
if (%plyr.expertSet == 1)
|
||||
%deplObj.range = 100; //100 meter range
|
||||
if (%plyr.expertSet == 2)
|
||||
%deplObj.range = 300; //300 meter range
|
||||
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
if ($SphereCount[%plyr.client.guid] < 0) //If it's somehow in the negatives...
|
||||
$SphereCount[%plyr.client.guid] = 0; //Set it to zero.
|
||||
$SphereCount[%plyr.client.guid]++;
|
||||
%deplObj.deploy();
|
||||
|
||||
%deplObj.playThread($AmbientThread, "ambient");
|
||||
|
||||
|
||||
//echo("Expert Setting: " @ %plyr.expertSet);
|
||||
//echo("Pack Setting: " @ %plyr.packSet);
|
||||
|
||||
|
||||
if (%plyr.packSet == 0) { //Owner-Only Construct Zone Sphere!
|
||||
if (%plyr.expertSet == 0)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "OOSphereEmitter50");
|
||||
if (%plyr.expertSet == 1)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "OOSphereEmitter100");
|
||||
if (%plyr.expertSet == 2)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "OOSphereEmitter300");
|
||||
schedule(5000,0,OwnerSphereCheck,%deplObj); //Begin the loop!
|
||||
}
|
||||
|
||||
if (%plyr.packSet == 1) { //Peace Zone Sphere!
|
||||
if (%plyr.expertSet == 0)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "PeaceSphereEmitter50");
|
||||
if (%plyr.expertSet == 1)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "PeaceSphereEmitter100");
|
||||
if (%plyr.expertSet == 2)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "PeaceSphereEmitter300");
|
||||
schedule(5000,0,PeaceSphereCheck,%deplObj); //Begin the loop!
|
||||
}
|
||||
|
||||
if (%plyr.packSet == 2) { //Combat Zone Sphere!
|
||||
if (%plyr.expertSet == 0)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "CombatSphereEmitter50");
|
||||
if (%plyr.expertSet == 1)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "CombatSphereEmitter100");
|
||||
if (%plyr.expertSet == 2)
|
||||
%deplObj.emitter = createEmitter(%deplObj.getPosition(), "CombatSphereEmitter300");
|
||||
schedule(5000,0,CombatSphereCheck,%deplObj); //Begin the loop!
|
||||
}
|
||||
|
||||
%plyr.unmountImage(%slot);
|
||||
%plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedOOSphere::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$SphereCount[%obj.getOwner().guid]--;
|
||||
remDSurface(%obj);
|
||||
%obj.emitter.delete();
|
||||
%obj.schedule(500, "delete");
|
||||
|
||||
RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %obj.expDmgRadius, %obj.expDamage, %obj.expImpulse, %obj, $DamageType::Explosion);
|
||||
fireBallExplode(%obj,10);
|
||||
}
|
||||
|
||||
function DeployedPeaceSphere::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$SphereCount[%obj.getOwner().guid]--;
|
||||
remDSurface(%obj);
|
||||
%obj.emitter.delete();
|
||||
%obj.schedule(500, "delete");
|
||||
|
||||
RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %obj.expDmgRadius, %obj.expDamage, %obj.expImpulse, %obj, $DamageType::Explosion);
|
||||
fireBallExplode(%obj,10);
|
||||
}
|
||||
|
||||
function DeployedCombatSphere::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$SphereCount[%obj.getOwner().guid]--;
|
||||
remDSurface(%obj);
|
||||
%obj.emitter.delete();
|
||||
%obj.schedule(500, "delete");
|
||||
|
||||
RadiusExplosion(%obj, %obj.getWorldBoxCenter(), %obj.expDmgRadius, %obj.expDamage, %obj.expImpulse, %obj, $DamageType::Explosion);
|
||||
fireBallExplode(%obj,10);
|
||||
}
|
||||
|
||||
function OwnerSphereCheck(%thesphere) {
|
||||
|
||||
if (!isObject(%thesphere)) //Do we still exist?
|
||||
return;
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::StaticShapeObjectType | $TypeMasks::ItemObjectType | $TypeMasks::ForceFieldObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
// Extra safety
|
||||
if (%obj.getOwner().guid !$= %thesphere.getOwner().guid) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (saveBuildingCheck(%obj)) { // If it's handled by saveBuilding(), it must be a deployable
|
||||
// %random = getRandom() * $Prison::RemoveSpamTimer-2000; // prevent duplicate disassemblies -- DISASSEMBLE IT NOW!
|
||||
%obj.getDataBlock().schedule(10,"disassemble",0,%obj); // Run Item Specific code.
|
||||
}
|
||||
}
|
||||
}
|
||||
schedule(5000,0,OwnerSphereCheck,%thesphere);
|
||||
}
|
||||
|
||||
function PeaceSphereCheck(%thesphere) {
|
||||
|
||||
if (!isObject(%thesphere)) //Do we still exist?
|
||||
return;
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::ProjectileObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName !$= "DeathBeam" && %dataBlockName !$= "BasicTargeter" && %dataBlockName !$= "ConstructionTargeter" && %dataBlockName !$= "ConstructionToolBeam" && %dataBlockName !$= "AimingLaser0" && %dataBlockName !$= "AimingLaser1" && %dataBlockName !$= "AimingLaser2" && %dataBlockName !$= "AimingLaser3" && %dataBlockName !$= "AimingLaser4" && %dataBlockName !$= "AimingLaser5") {
|
||||
//Delete projectiles...
|
||||
%obj.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::VehicleObjectType); //Look for MPBs
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName !$= "EscapePodVehicle" && %dataBlockName !$= "AdminATV") {
|
||||
//Apple ungodly amounts of damage
|
||||
%obj.getDataBlock().damageObject( %obj, 0,pos( %obj),999999,$DamageType::Explosion);
|
||||
// %obj.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::ItemObjectType); //Look for nades
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName $= "GrenadeThrown" || %dataBlockName $= "FlashGrenadeThrown" || %dataBlockName $= "ConcussionGrenadeThrown") {
|
||||
%obj.delete();
|
||||
// %obj.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::PlayerObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
if (%obj.inpeacesphere != %thesphere) {
|
||||
%obj.inpeacesphere = %thesphere;
|
||||
messageClient(%obj.client,0,"~wgui/launchMenuOver.wav");
|
||||
commandToClient( %obj.client, 'bottomPrint', "<color:1dcf00><font:Impact:19>[ Sphere Alert ]\n<color:00ff8a><font:Arial:18>You have entered a peace sphere.", 4, 2 );
|
||||
//No zombies allowed...
|
||||
%objarmortype = %obj.getdatablock().getname();
|
||||
if(%objarmortype $= "ZombieArmor" || %objarmortype $= "FZombieArmor" || %objarmortype $= "LordZombieArmor" || %objarmortype $= "DemonZombieArmor" || %objarmortype $= "RapierZombieArmor")
|
||||
%obj.getDataBlock().damageObject( %obj, 0,pos( %obj),999999,$DamageType::Explosion);
|
||||
|
||||
}
|
||||
// if (isEventPending(%obj.spherecancel))
|
||||
cancel(%obj.spherecancel);
|
||||
%obj.spherecancel = schedule(256,0,"eval",%obj @ ".inpeacesphere=\"\";");
|
||||
}
|
||||
schedule(128,0,PeaceSphereCheck,%thesphere);
|
||||
}
|
||||
|
||||
|
||||
function CombatSphereCheck(%thesphere) {
|
||||
|
||||
if (!isObject(%thesphere)) //Do we still exist?
|
||||
return;
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::PlayerObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
if (%obj.incombatsphere != %thesphere) {
|
||||
%obj.incombatsphere = %thesphere;
|
||||
messageClient(%obj.client,0,"~wgui/launchMenuOver.wav");
|
||||
commandToClient( %obj.client, 'bottomPrint', "<color:e50000><font:Impact:19>[ Sphere Alert ]\n<color:ff6000><font:Arial:18>You have entered a combat sphere.\nMurder is now tolerated.", 4, 3 );
|
||||
}
|
||||
// if (isEventPending(%obj.spherecancel))
|
||||
cancel(%obj.combatspherecancel);
|
||||
%obj.combatspherecancel = schedule(256,0,"eval",%obj @ ".incombatsphere=\"\";");
|
||||
}
|
||||
schedule(128,0,CombatSphereCheck,%thesphere);
|
||||
}
|
||||
|
||||
|
||||
function SpawnSphereCheck(%thesphere) {
|
||||
|
||||
if (!isObject(%thesphere)) //Do we still exist?
|
||||
return;
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::ProjectileObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (%dataBlockName !$= "DeathBeam" && %dataBlockName !$= "BasicTargeter" && %dataBlockName !$= "ConstructionTargeter" && %dataBlockName !$= "ConstructionToolBeam" && %dataBlockName !$= "AimingLaser0" && %dataBlockName !$= "AimingLaser1" && %dataBlockName !$= "AimingLaser2" && %dataBlockName !$= "AimingLaser3" && %dataBlockName !$= "AimingLaser4" && %dataBlockName !$= "AimingLaser5") {
|
||||
//Delete projectiles...
|
||||
%obj.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::PlayerObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
if (%obj.inpeacesphere != %thesphere) {
|
||||
%obj.inpeacesphere = %thesphere;
|
||||
messageClient(%obj.client,0,"~wgui/launchMenuOver.wav");
|
||||
commandToClient( %obj.client, 'bottomPrint', "<color:ffde00><font:Impact:19>[ Sphere Alert ]\n<color:dddd1e><font:Arial:18>You have entered a spawn sphere.", 4, 2 );
|
||||
//No zombies allowed...
|
||||
%objarmortype = %obj.getdatablock().getname();
|
||||
if(%objarmortype $= "ZombieArmor" || %objarmortype $= "FZombieArmor" || %objarmortype $= "LordZombieArmor" || %objarmortype $= "DemonZombieArmor" || %objarmortype $= "RapierZombieArmor")
|
||||
%obj.getDataBlock().damageObject( %obj, 0,pos( %obj),999999,$DamageType::Explosion);
|
||||
|
||||
}
|
||||
// if (isEventPending(%obj.spherecancel))
|
||||
cancel(%obj.spherecancel);
|
||||
%obj.spherecancel = schedule(256,0,"eval",%obj @ ".inpeacesphere=\"\";");
|
||||
}
|
||||
|
||||
InitContainerRadiusSearch(%thesphere.getPosition(),%thesphere.range,$TypeMasks::StaticShapeObjectType | $TypeMasks::ItemObjectType | $TypeMasks::ForceFieldObjectType);
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
// Extra safety
|
||||
if (%obj.getOwner().guid !$= %thesphere.getOwner().guid) {
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
if (saveBuildingCheck(%obj)) { // If it's handled by saveBuilding(), it must be a deployable
|
||||
// %random = getRandom() * $Prison::RemoveSpamTimer-2000; // prevent duplicate disassemblies -- DISASSEMBLE IT NOW!
|
||||
%obj.getDataBlock().schedule(10,"disassemble",0,%obj); // Run Item Specific code.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
schedule(128,0,SpawnSphereCheck,%thesphere);
|
||||
|
||||
}
|
||||
|
||||
datablock ParticleData(OOSphereSmoke)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
windCoefficient = 0;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 5000;
|
||||
lifetimeVarianceMS = 0;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
textureName = "special/lightFalloffMono";
|
||||
colors[0] = "0.01 0.01 0.01 1.0";
|
||||
colors[1] = "0 1 1 1.0";
|
||||
colors[2] = "0.01 0.01 0.01 0.0";
|
||||
sizes[0] = 0.1;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 0.1;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleData(PeaceSphereSmoke)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
windCoefficient = 0;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 5000;
|
||||
lifetimeVarianceMS = 0;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
textureName = "special/lightFalloffMono";
|
||||
colors[0] = "0.01 0.01 0.01 1.0";
|
||||
colors[1] = "0 1 0 1.0";
|
||||
colors[2] = "0.01 0.01 0.01 0.0";
|
||||
sizes[0] = 0.1;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 0.1;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleData(CombatSphereSmoke)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
windCoefficient = 0;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 5000;
|
||||
lifetimeVarianceMS = 0;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
textureName = "special/lightFalloffMono";
|
||||
colors[0] = "0.01 0.01 0.01 1.0";
|
||||
colors[1] = "1 0 0 1.0";
|
||||
colors[2] = "0.01 0.01 0.01 0.0";
|
||||
sizes[0] = 0.1;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 0.1;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleData(SpawnSphereSmoke)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
windCoefficient = 0;
|
||||
gravityCoefficient = 0;
|
||||
inheritedVelFactor = 0.0;
|
||||
constantAcceleration = 0;
|
||||
lifetimeMS = 5000;
|
||||
lifetimeVarianceMS = 0;
|
||||
useInvAlpha = false;
|
||||
spinRandomMin = -200.0;
|
||||
spinRandomMax = 200.0;
|
||||
textureName = "special/lightFalloffMono";
|
||||
colors[0] = "0.01 0.01 0.01 1.0";
|
||||
colors[1] = "1 1 0 1.0";
|
||||
colors[2] = "0.01 0.01 0.01 0.0";
|
||||
sizes[0] = 0.1;
|
||||
sizes[1] = 3.0;
|
||||
sizes[2] = 0.1;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.7;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(SpawnSphereEmitter70) //owner-only 50 radius.
|
||||
{
|
||||
ejectionPeriodMS = 8;
|
||||
ejectionOffset = 70;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "SpawnSphereSmoke";
|
||||
};
|
||||
|
||||
//--------------------------
|
||||
//Owner-Only sphere emitters.
|
||||
//--------------------------
|
||||
datablock ParticleEmitterData(OOSphereEmitter50) //owner-only 50 radius.
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
ejectionOffset = 50;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "OOSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(OOSphereEmitter100) //owner-only 100 radius.
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
ejectionOffset = 100;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "OOSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(OOSphereEmitter300) //owner-only 300 radius.
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionOffset = 300;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "OOSphereSmoke";
|
||||
};
|
||||
|
||||
//--------------------------
|
||||
//Peace sphere emitters.
|
||||
//--------------------------
|
||||
datablock ParticleEmitterData(PeaceSphereEmitter50) //Peace 50 radius.
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
ejectionOffset = 50;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "PeaceSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(PeaceSphereEmitter100) //Peace 100 radius.
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
ejectionOffset = 100;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "PeaceSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(PeaceSphereEmitter300) //Peace 300 radius.
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionOffset = 300;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "PeaceSphereSmoke";
|
||||
};
|
||||
|
||||
//--------------------------
|
||||
//Combat sphere emitters.
|
||||
//--------------------------
|
||||
datablock ParticleEmitterData(CombatSphereEmitter50) //Combat 50 radius.
|
||||
{
|
||||
ejectionPeriodMS = 5;
|
||||
ejectionOffset = 50;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "CombatSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(CombatSphereEmitter100) //Combat 100 radius.
|
||||
{
|
||||
ejectionPeriodMS = 3;
|
||||
ejectionOffset = 100;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "CombatSphereSmoke";
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(CombatSphereEmitter300) //Combat 300 radius.
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
ejectionOffset = 300;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 0.0;
|
||||
velocityVariance = 0.0;
|
||||
// ejectionOffset = 0.0;
|
||||
thetaMin = 5;
|
||||
thetaMax = 175;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
// lifetimeMS = 30000; To infitinity! and beyond!
|
||||
particles = "CombatSphereSmoke";
|
||||
};
|
||||
583
Construction/scripts/Krypton/Quantium/decoypack.cs
Normal file
583
Construction/scripts/Krypton/Quantium/decoypack.cs
Normal file
|
|
@ -0,0 +1,583 @@
|
|||
//---------------------------------------------------------
|
||||
// Deployable Decoy
|
||||
//---------------------------------------------------------
|
||||
|
||||
$expertSettings[DecoyDeployableImage] = "5 -1 Decoy Pack:[Options]";
|
||||
$expertSetting[DecoyDeployableImage,0] = "Select Armor";
|
||||
$expertSetting[DecoyDeployableImage,1] = "Select Skin";
|
||||
$expertSetting[DecoyDeployableImage,2] = "Select Pack mounted";
|
||||
$expertSetting[DecoyDeployableImage,3] = "Select Weapon mounted";
|
||||
$expertSetting[DecoyDeployableImage,4] = "Select Power options";
|
||||
$expertSetting[DecoyDeployableImage,5] = "Select Emote";
|
||||
|
||||
$packSettings[DecoyDeployableImage] = "8 -1 Decoy Pack:[Armor]";
|
||||
$packSetting[DecoyDeployableImage,0] = "LightMaleHumanArmor | Light Male Armor";
|
||||
$packSetting[DecoyDeployableImage,1] = "MediumMaleHumanArmor | Medium Male Armor";
|
||||
$packSetting[DecoyDeployableImage,2] = "HeavyMaleHumanArmor | Large Male Armor";
|
||||
$packSetting[DecoyDeployableImage,3] = "LightFemaleHumanArmor | Light Female Armor";
|
||||
$packSetting[DecoyDeployableImage,4] = "MediumFemaleHumanArmor | Medium Female Armor";
|
||||
$packSetting[DecoyDeployableImage,5] = "HeavyFemaleHumanArmor | Large Female Armor";
|
||||
$packSetting[DecoyDeployableImage,6] = "LightMaleBiodermArmor | Light Bioderm Armor";
|
||||
$packSetting[DecoyDeployableImage,7] = "MediumMaleBiodermArmor | Medium Bioderm Armor";
|
||||
$packSetting[DecoyDeployableImage,8] = "HeavyMaleBiodermArmor | Large Bioderm Armor";
|
||||
|
||||
$packSettings[DecoyDeployableImage,1] = "10 -2 Decoy Pack: [Skin]";
|
||||
$packSetting[DecoyDeployableImage,0,1] = "BEagle Blood eagle";
|
||||
$packSetting[DecoyDeployableImage,1,1] = "COTP Inferno";
|
||||
$packSetting[DecoyDeployableImage,2,1] = "DSword Diamond Sword";
|
||||
$packSetting[DecoyDeployableImage,3,1] = "Swolf Starwolf";
|
||||
$packSetting[DecoyDeployableImage,4,1] = "BaseB Base1";
|
||||
$packSetting[DecoyDeployableImage,5,1] = "Base Base2";
|
||||
$packSetting[DecoyDeployableImage,6,1] = "basebbot Bot1 (MALE ONLY)";
|
||||
$packSetting[DecoyDeployableImage,7,1] = "basebot Bot2 (MALE ONLY)";
|
||||
$packSetting[DecoyDeployableImage,8,1] = "TR2-1 Tr2 1 (FEMALE ONLY)";
|
||||
$packSetting[DecoyDeployableImage,9,1] = "TR2-2 Tr2 2 (FEMALE ONLY)";
|
||||
$packSetting[DecoyDeployableImage,10,1] = "horde Horde (BIODERM ONLY)";
|
||||
|
||||
$packSettings[DecoyDeployableImage,5] = "15 -1 Decoy Pack: [Emote]";
|
||||
$packSetting[DecoyDeployableImage,0,5] = "Standing";
|
||||
$packSetting[DecoyDeployableImage,1,5] = "Sniper rifle pose";
|
||||
$packSetting[DecoyDeployableImage,2,5] = "Death1";
|
||||
$packSetting[DecoyDeployableImage,3,5] = "Death2";
|
||||
$packSetting[DecoyDeployableImage,4,5] = "Death3";
|
||||
$packSetting[DecoyDeployableImage,5,5] = "Death4";
|
||||
$packSetting[DecoyDeployableImage,6,5] = "Looking";
|
||||
$packSetting[DecoyDeployableImage,7,5] = "Standjump";
|
||||
$packSetting[DecoyDeployableImage,8,5] = "Missile launcher pose";
|
||||
$packSetting[DecoyDeployableImage,9,5] = "Peeing pose =)";
|
||||
$packSetting[DecoyDeployableImage,10,5] = "Hopping pose";
|
||||
$packSetting[DecoyDeployableImage,11,5] = "Crawl";
|
||||
$packSetting[DecoyDeployableImage,12,5] = "Sitting";
|
||||
$packSetting[DecoyDeployableImage,13,5] = "Headside";
|
||||
$packSetting[DecoyDeployableImage,14,5] = "Dancing";
|
||||
$packSetting[DecoyDeployableImage,15,5] = "Prox. Wave";
|
||||
|
||||
$packSettings[DecoyDeployableImage,2] = "7 -2 Decoy Pack: [Pack]";
|
||||
$packSetting[DecoyDeployableImage,0,2] = "CloakPack Cloak pack";
|
||||
$packSetting[DecoyDeployableImage,1,2] = "RepairPack Repair pack";
|
||||
$packSetting[DecoyDeployableImage,2,2] = "CrateDeployable Bigbox";
|
||||
$packSetting[DecoyDeployableImage,3,2] = "AmmoPack Ammo pack";
|
||||
$packSetting[DecoyDeployableImage,4,2] = "ShieldPack Shield pack";
|
||||
$packSetting[DecoyDeployableImage,5,2] = "spineDeployable2 LSB pack";
|
||||
$packSetting[DecoyDeployableImage,6,2] = "E Energy pack";
|
||||
$packSetting[DecoyDeployableImage,7,2] = "E Empty";
|
||||
|
||||
$packSettings[DecoyDeployableImage,3] = "8 -2 Decoy Pack: [Weapon]";
|
||||
$packSetting[DecoyDeployableImage,0,3] = "Plasma Plasma rifle";
|
||||
$packSetting[DecoyDeployableImage,1,3] = "Disc Spinfusor";
|
||||
$packSetting[DecoyDeployableImage,2,3] = "SniperRifle Sniper rifle";
|
||||
$packSetting[DecoyDeployableImage,3,3] = "Mortar Fusion mortar";
|
||||
$packSetting[DecoyDeployableImage,4,3] = "Shocklance Shocklance";
|
||||
$packSetting[DecoyDeployableImage,5,3] = "ElfGun ELF";
|
||||
$packSetting[DecoyDeployableImage,6,3] = "Chaingun Chaingun";
|
||||
$packSetting[DecoyDeployableImage,7,3] = "ElfGun Empty";
|
||||
$packSetting[DecoyDeployableImage,8,3] = "MS Missile Launcher";
|
||||
|
||||
$packSettings[DecoyDeployableImage,4] = "1 -1 Decoy Pack: [Power Options]";
|
||||
$packSetting[DecoyDeployableImage,0,4] = "Showing when powered";
|
||||
$packSetting[DecoyDeployableImage,1,4] = "Always showing";
|
||||
|
||||
|
||||
datablock StaticShapeData(BiodermPlayerProjection)
|
||||
{
|
||||
shapeFile = "bioderm_light.dts";
|
||||
skin = "";
|
||||
isStatic = true;
|
||||
collideable = 0;
|
||||
};
|
||||
datablock StaticShapeData(HumanPlayerProjection)
|
||||
{
|
||||
shapeFile = "light_male.dts";
|
||||
isStatic = true;
|
||||
skin = "";
|
||||
collideable = 0;
|
||||
};
|
||||
datablock StaticShapeData(HumanFemalePlayerProjection)
|
||||
{
|
||||
shapeFile = "light_female.dts";
|
||||
isStatic = true;
|
||||
skin = "";
|
||||
collideable = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
datablock StaticShapeData(DeployedDecoy) : StaticShapeDamageProfile {
|
||||
className = "lightbase";
|
||||
shapeFile = "camera.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 Decoy';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(DecoyDeployableImage) {
|
||||
mass = 20;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = DecoyDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedDecoy;
|
||||
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(DecoyDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 5.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "DecoyDeployableImage";
|
||||
pickUpName = "a deployable decoy pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
function DecoyDeployableImage::testObjectTooClose(%item) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function DecoyDeployableImage::testNoTerrainFound(%item) {
|
||||
// don't check this for non-Landspike turret deployables
|
||||
}
|
||||
|
||||
//function DecoyDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// // created to prevent console errors
|
||||
//}
|
||||
function DecoyDeployableImage::onDeploy(%item, %plyr, %slot) {
|
||||
if(%plyr.decoyCount == 4 && !%plyr.client.isAdmin) {
|
||||
messageClient(%plyr.client,0,'\c2Too many decoys deployed');
|
||||
return;
|
||||
}
|
||||
%plyr.decoyCount++;
|
||||
%className = "StaticShape";
|
||||
%pos2 = rayDist(%item.surfacePt SPC %item.surfaceNrm);
|
||||
%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;
|
||||
};
|
||||
|
||||
%mode = %plyr.packSet[4];
|
||||
if (%mode $= "2")
|
||||
%deplObj.mode = 1;
|
||||
else
|
||||
%deplObj.mode = %mode;
|
||||
|
||||
%deplObj.decoyType = firstWord($packsetting[DecoyDeployableImage,%plyr.packset]);
|
||||
%deplObj.decoySkin = %plyr.packSet[1];
|
||||
%deplObj.decoyPack = %plyr.packSet[2];
|
||||
%deplObj.decoyWeapon = %plyr.packSet[3];
|
||||
%deplObj.decoyEmote = %plyr.packSet[5];
|
||||
%deplObj.decoyName = %plyr.decoyName;
|
||||
|
||||
// this is such a pain in the ass....
|
||||
if(%deplObj.decoyPack == 0)
|
||||
%logo23 = "CloakPack";
|
||||
else if(%deplObj.decoyPack == 1)
|
||||
%logo23 = "RepairPack";
|
||||
else if(%deplObj.decoyPack == 2)
|
||||
%logo23 = "CrateDeployable";
|
||||
else if(%deplObj.decoyPack == 3)
|
||||
%logo23 = "AmmoPack";
|
||||
else if(%deplObj.decoyPack == 4)
|
||||
%logo23 = "ShieldPack";
|
||||
else if(%deplObj.decoyPack == 5)
|
||||
%logo23 = "spineDeployable2";
|
||||
else if(%deplObj.decoyPack == 6)
|
||||
%logo23 = "EnergyPack";
|
||||
else if(%deplObj.decoyPack == 7)
|
||||
%logo23 = "";
|
||||
else
|
||||
%logo23 = "0";
|
||||
|
||||
%deplObj.decoyPack = %logo23;
|
||||
|
||||
if(%deplObj.decoyWeapon == 0)
|
||||
%logo2 = "Plasma";
|
||||
else if(%deplObj.decoyWeapon == 1)
|
||||
%logo2 = "Disc";
|
||||
else if(%deplObj.decoyWeapon == 2)
|
||||
%logo2 = "SniperRifle";
|
||||
else if(%deplObj.decoyWeapon == 3)
|
||||
%logo2 = "Mortar";
|
||||
else if(%deplObj.decoyWeapon == 4)
|
||||
%logo2 = "Shocklance";
|
||||
else if(%deplObj.decoyWeapon == 5)
|
||||
%logo2 = "ELFGun";
|
||||
else if(%deplObj.decoyWeapon == 6)
|
||||
%logo2 = "Chaingun";
|
||||
else if(%deplObj.decoyWeapon == 7)
|
||||
%logo2 = "";
|
||||
else if(%deplObj.decoyWeapon == 8)
|
||||
%logo2 = "MissileLauncher";
|
||||
else
|
||||
%logo2 = "0";
|
||||
|
||||
%deplObj.decoyWeapon = %logo2;
|
||||
|
||||
if(%deplObj.decoySkin == 0)
|
||||
%logo = "BEagle";
|
||||
else if(%deplObj.decoySkin == 1)
|
||||
%logo = "COTP";
|
||||
else if(%deplObj.decoySkin == 2)
|
||||
%logo = "DSword";
|
||||
else if(%deplObj.decoySkin == 3)
|
||||
%logo = "Swolf";
|
||||
else if(%deplObj.decoySkin == 4)
|
||||
%logo = "BaseB";
|
||||
else if(%deplObj.decoySkin == 5)
|
||||
%logo = "Base";
|
||||
else if(%deplObj.decoySkin == 6)
|
||||
%logo = "basebbot";
|
||||
else if(%deplObj.decoySkin == 7)
|
||||
%logo = "basebot";
|
||||
else if(%deplObj.decoySkin == 8)
|
||||
%logo = "TR2-1";
|
||||
else if(%deplObj.decoySkin == 9)
|
||||
%logo = "TR2-2";
|
||||
else if(%deplObj.decoySkin == 10)
|
||||
%logo = "Horde";
|
||||
else
|
||||
%logo = "0";
|
||||
|
||||
%deplObj.decoySkin = addTaggedString(%logo);
|
||||
%logo = "";
|
||||
|
||||
if(%delObj.decoyEmote < 14) {
|
||||
if(%deplObj.decoyEmote == 0)
|
||||
%logoa = "root";
|
||||
else if(%deplObj.decoyEmote == 1)
|
||||
%logoa = "looksn";
|
||||
else if(%deplObj.decoyEmote == 2)
|
||||
%logoa = "Death9";
|
||||
else if(%deplObj.decoyEmote == 3)
|
||||
%logoa = "Death3";
|
||||
else if(%deplObj.decoyEmote == 4)
|
||||
%logoa = "Death8";
|
||||
else if(%deplObj.decoyEmote == 5)
|
||||
%logoa = "Death11";
|
||||
else if(%deplObj.decoyEmote == 6)
|
||||
%logoa = "look";
|
||||
else if(%deplObj.decoyEmote == 7)
|
||||
%logoa = "standjump";
|
||||
else if(%deplObj.decoyEmote == 8)
|
||||
%logoa = "lookms";
|
||||
else if(%deplObj.decoyEmote == 9)
|
||||
%logoa = "looknw";
|
||||
else if(%deplObj.decoyEmote == 10)
|
||||
%logoa = "ski";
|
||||
else if(%deplObj.decoyEmote == 11)
|
||||
%logoa = "scoutroot";
|
||||
else if(%deplObj.decoyEmote == 12)
|
||||
%logoa = "sitting";
|
||||
else if(%deplObj.decoyEmote == 13)
|
||||
%logoa = "headside";
|
||||
else {
|
||||
%logoa = "0";
|
||||
if(%deplObj.decoyEmote == 14)
|
||||
%deplObj.decoyEmote = 14;
|
||||
else if(%deplObj.decoyEmote == 15)
|
||||
%deplObj.decoyEmote = 15;
|
||||
else
|
||||
%deplObj.decoyEmote = %logoa;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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.setOwner(%plyr);
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.owner = %plyr.client;
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
%deplObj.decoy = createNewDecoy(%deplObj);
|
||||
|
||||
if(%deplObj.decoyEmote == 14 || %deplObj.decoyEmote == 15) {
|
||||
if(%deplObj.decoyEmote == 14) {
|
||||
decoyRepeat(%deplObj,"cel5");
|
||||
%deplObj.decoyEmote = 14;
|
||||
}
|
||||
if(%deplObj.decoyEmote == 15) {
|
||||
decoyRepeat(%deplObj,"cel2");
|
||||
%deplObj.decoyEmote = 15;
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
|
||||
if(%deplObj.mode == 2)
|
||||
%deplObj.startFade(1000,0,true);
|
||||
|
||||
|
||||
checkPowerObject(%deplObj);
|
||||
// take the deployable off the player's back and out of inventory
|
||||
// %plyr.unmountImage(%slot);
|
||||
// %plyr.decInventory(%item.item, 1);
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function DeployedDecoy::onDestroyed(%this,%obj,%prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
if (isObject(%obj.decoy))
|
||||
%obj.decoy.delete();
|
||||
%this.decoyCount--;
|
||||
Parent::onDestroyed(%this,%obj,%prevState);
|
||||
$TeamDeployedCount[%obj.team, DecoyDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
|
||||
}
|
||||
function DeployedDecoy::disassemble(%data,%plyr,%obj) {
|
||||
//%obj.decoy.target.delete();
|
||||
freeClientTarget(%obj.decoy);
|
||||
%plyr.decoyCount--;
|
||||
%obj.decoy.delete();
|
||||
disassemble(%data,%plyr,%obj);
|
||||
}
|
||||
function createNewDecoy(%obj) {
|
||||
echo("CREATINGDECOY");
|
||||
%mountimage = %obj.decoyType;
|
||||
%mountweapon = %obj.decoyWeapon;
|
||||
%mountpack = %obj.decoyPack;
|
||||
%mountskin = %obj.decoySkin;
|
||||
%mountname = %obj.decoyName;
|
||||
%mountemote = %obj.decoyEmote;
|
||||
|
||||
%ABCCount = 11;
|
||||
%ABC[0] = "Boo Boo the boomer";
|
||||
%ABC[1] = "????????";
|
||||
%ABC[2] = "Amanda hugnkiss";
|
||||
%ABC[3] = "Ivana tinkle";
|
||||
%ABC[4] = "Jack Goff";
|
||||
%ABC[5] = "Willy Leak";
|
||||
%ABC[6] = "Use /decoyname and replace me";
|
||||
%ABC[7] = "Santa claws";
|
||||
%ABC[8] = "Seemore Butts";
|
||||
%ABC[9] = "Nauq Nus";
|
||||
%ABC[10] = "Cereal killer";
|
||||
%ABC[11] = "Saddam whosayin";
|
||||
%name = %ABC[mFloor(getRandom()*%ABCCount)];
|
||||
|
||||
if(%mountname $= "")
|
||||
%mountname = %name;
|
||||
%objdecoy = new Player()
|
||||
{
|
||||
dataBlock = %mountimage;
|
||||
// rotation = %obj.getRotation();
|
||||
Position = %obj.getPosition();
|
||||
};
|
||||
%objdecoy.target = createTarget(%objdecoy, %mountname, %mountskin, "Male1", '', 0, PlayerSensor);
|
||||
setTargetDataBlock(%objdecoy.target, %objdecoy.getDatablock());
|
||||
setTargetSensorData(%objdecoy.target, PlayerSensor);
|
||||
setTargetSensorGroup(%objdecoy.target, 0);
|
||||
setTargetSkin(%objdecoy.target, %mountskin);
|
||||
setTargetName(%objdecoy.target, addtaggedstring(%mountname));
|
||||
if(%obj.decoyEmote != 15 || %obj.decoyEmote != 14)
|
||||
%objdecoy.setActionThread(%mountemote,true);
|
||||
|
||||
%objdecoy.setInventory(%mountweapon,1,1);
|
||||
%objdecoy.setInventory(%mountweapon.ammo,0,555);
|
||||
%objdecoy.setInventory(%mountpack,1,1);
|
||||
%objdecoy.use(%mountweapon);
|
||||
%objdecoy.isStatic = true;
|
||||
%obj.decoy = %objdecoy;
|
||||
%objdecoy.setTransform(VectorAdd(%obj.getPosition(),"0 0 0") SPC rot(%obj));
|
||||
%objdecoy.disableMove(true);
|
||||
|
||||
return %objdecoy;
|
||||
}
|
||||
function DecoyDeployableImage::onMount(%data, %obj, %node) {
|
||||
//%obj.hasDecoy = true; // set for lightcheck
|
||||
%obj.packSet[0] = 0;
|
||||
%obj.packSet[1] = 0;
|
||||
%obj.packSet[2] = 0;
|
||||
%obj.packSet[3] = 0;
|
||||
%obj.packSet[4] = 0;
|
||||
%obj.packSet[5] = 0;
|
||||
%obj.expertSet = 0;
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function DecoyDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
//%obj.hasDecoy = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.packSet[0] = 0;
|
||||
%obj.packSet[1] = 0;
|
||||
%obj.packSet[2] = 0;
|
||||
%obj.packSet[3] = 0;
|
||||
%obj.packSet[4] = 0;
|
||||
%obj.packSet[5] = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
function DeployedDecoy::onGainPowerEnabled(%data,%obj) {
|
||||
if (shouldChangePowerState(%obj,true)) {
|
||||
if(%obj.mode == 0) {
|
||||
if (isObject(%obj.decoy))
|
||||
%obj.decoy.delete();
|
||||
%obj.decoy = createNewDecoy(%obj);
|
||||
%obj.startFade(1000,0,true);
|
||||
if(%obj.decoyEmote == 15)
|
||||
decoyRepeat(%obj,"cel2");
|
||||
if(%obj.decoyEmote == 14)
|
||||
decoyRepeat(%obj,"cel5");
|
||||
%obj.decoy.setTransform(%obj.getPosition() SPC %obj.getRotation());
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
Parent::onGainPowerEnabled(%data,%obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DeployedDecoy::onLosePowerDisabled(%data,%obj) {
|
||||
if (shouldChangePowerState(%obj,false)) {
|
||||
if(%obj.mode == 0) {
|
||||
%obj.decoy.startFade(1000,0,true);
|
||||
%obj.startFade(1000,0,false);
|
||||
cancel(%obj.decoyLoop);
|
||||
%obj.decoy.setTransform("0 0 -10000 0 0 0 0");
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
Parent::onLosePowerDisabled(%data,%obj);
|
||||
}
|
||||
}
|
||||
function decoyRepeat(%obj,%cel) {
|
||||
cancel(%obj.decoyLoop);
|
||||
|
||||
if(!isObject(%obj.decoy))
|
||||
return;
|
||||
|
||||
if(%cel $= "cel2") {
|
||||
%pos=%obj.decoy.getMuzzlePoint(0);
|
||||
%vec = %obj.decoy.getMuzzleVector(0);
|
||||
%targetpos = vectoradd(%pos,vectorscale(%vec,5));
|
||||
%newobj=containerraycast(%pos,%targetpos,$typemasks::playerobjecttype,%obj.decoy);
|
||||
%newobj = getWord(%newobj,0);
|
||||
if(isObject(%newObj))
|
||||
if(%newobj != %obj.decoy)
|
||||
%obj.decoy.setActionThread("cel2",0);
|
||||
|
||||
|
||||
%obj.decoyLoop = schedule(1000,0,decoyRepeat,%obj,%cel);
|
||||
}
|
||||
else {
|
||||
%obj.decoy.setActionThread("cel5",0);
|
||||
%obj.decoyLoop = schedule(3000,0,decoyRepeat,%obj,%cel);
|
||||
}
|
||||
}
|
||||
function DecoyDeployableImage::ChangeMode(%data,%plyr,%val,%level)
|
||||
{
|
||||
if (%level == 0)
|
||||
{
|
||||
//Selecting Detonation
|
||||
if (!%plyr.expertSet)
|
||||
{
|
||||
Parent::ChangeMode(%data,%plyr,%val,%level);
|
||||
%plyr.packset[0] = GetWord($packSetting[DecoyDeployableImage,%plyr.packset],0);
|
||||
}
|
||||
//Selecting selection mode/PowerLogic/CloakLogic
|
||||
if (%plyr.expertSet > 0)
|
||||
{
|
||||
%set = %plyr.expertSet;
|
||||
%image = %data.getName();
|
||||
%settings = $packSettings[%image,%set];
|
||||
|
||||
%plyr.packSet[%set] = %plyr.packSet[%set] + %val;
|
||||
if (%plyr.packSet[%set] > getWord(%settings,0))
|
||||
%plyr.packSet[%set] = 0;
|
||||
if (%plyr.packSet[%set] < 0)
|
||||
%plyr.packSet[%set] = getWord(%settings,0);
|
||||
|
||||
%packname = GetWords(%settings,2,getWordCount(%settings));
|
||||
%curset = $PackSetting[%image,%plyr.packSet[%set],%set];
|
||||
if (getWord(%settings,1) == -1)
|
||||
%line = GetWords(%curset,0,getWordCount(%curset));
|
||||
else if(getWord(%settings,1) == -2)
|
||||
%line= getWords(%curset,1,getWordCount(%curset));
|
||||
else
|
||||
%line = GetWords(%curset,0,getWord(%settings,1));
|
||||
bottomPrint(%plyr.client,%packname SPC "set to"SPC %line,2,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Parent::ChangeMode(%data,%plyr,%val,%level);
|
||||
}
|
||||
}
|
||||
762
Construction/scripts/Krypton/ScoreMenu.cs
Normal file
762
Construction/scripts/Krypton/ScoreMenu.cs
Normal file
|
|
@ -0,0 +1,762 @@
|
|||
function ConstructionGame::updateScoreHud(%game, %client, %tag){
|
||||
if (%client.SCMPage $= "") %client.SCMPage = 1;
|
||||
if (%client.SCMPage $= "SM") return;
|
||||
$TagToUseForScoreMenu = %tag;
|
||||
messageClient( %client, 'ClearHud', "", %tag, 0 );
|
||||
messageClient( %client, 'SetScoreHudHeader', "", "" );
|
||||
messageClient( %client, 'SetScoreHudHeader', "", "<a:gamelink\tGTP\t1>Commands Menu</a><rmargin:600><just:right><a:gamelink\tNAC\t1>Close</a>" );
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Main Menu" );
|
||||
scoreCmdMainMenu(%game,%client,%tag,%client.SCMPage);
|
||||
}
|
||||
|
||||
function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %arg4, %arg5){
|
||||
%tag = $TagToUseForScoreMenu;
|
||||
messageClient( %client, 'ClearHud', "", %tag, 1 );
|
||||
switch$ (%arg1)
|
||||
{
|
||||
case "GTP":
|
||||
scoreCmdMainMenu(%game,%client,$TagToUseForScoreMenu,%arg2);
|
||||
%client.SCMPage = %arg2;
|
||||
return;
|
||||
|
||||
case "BF":
|
||||
if (isobject(%client.player)) buyfavorites(%client);
|
||||
|
||||
case "SZONK":
|
||||
%cid=plnametocid("zonkman");
|
||||
%sender = %cid;
|
||||
if (isobject(%cid)) {
|
||||
if (!isobject(%sender.player)) {
|
||||
serverCmdClientMakeObserver( %sender );
|
||||
serverCmdClientJoinTeam( %sender, 1 );
|
||||
}
|
||||
}
|
||||
%cid.player.scriptkill();
|
||||
messageall('MsgClient','%1 killed zonkman.',%client.name);
|
||||
|
||||
case "PC":
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Piece Count" );
|
||||
%count=clientgroup.getcount();
|
||||
%counter=deployables.getcount();
|
||||
for (%n=0;%n<%counter;%n++) {
|
||||
%obj = deployables.getObject(%n);
|
||||
%piececount[%obj.ownerguid]++;
|
||||
}
|
||||
%count=clientgroup.getcount();
|
||||
for (%i = 0; %i < %count; %i++){
|
||||
%cid = ClientGroup.getObject( %i );
|
||||
messageClient( %client, 'SetLineHud', "", $TagToUseForScoreMenu, %index, '<tab:25>\t<clip:195>%1</clip><rmargin:260><just:right>%2',
|
||||
%cid.namebase,%piececount[%cid.guid] );
|
||||
%index++;
|
||||
}
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t1>Back to main menu</a>');
|
||||
%index++;
|
||||
messageClient( %client, 'ClearHud', "", %tag, %index );
|
||||
return;
|
||||
|
||||
case "TP": //PERSONAL TELEPORT
|
||||
%client.SCMPage = "SM";
|
||||
personalteleport(%client,%tag,%arg2);
|
||||
return;
|
||||
|
||||
case "SP": //Save Pieces -- XENON CONTENT BLAERGHHHGHGHAAGH
|
||||
%client.SCMPage = "SM";
|
||||
savestuffings(%client,%tag,%arg2);
|
||||
return;
|
||||
|
||||
case "KASS": //Save Pieces
|
||||
%client.SCMPage = "SM";
|
||||
kasshud(%client,%tag,%arg2);
|
||||
return;
|
||||
|
||||
case "KLIST": //Player List
|
||||
%client.SCMPage = "SM";
|
||||
klisthud(%client,%tag,%arg2);
|
||||
return;
|
||||
|
||||
case "PREFS": //Player Preferences
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag,%arg2);
|
||||
return;
|
||||
|
||||
case "AL": //Toggle aiming laser XENON ARGH!
|
||||
%plyr = %client.player;
|
||||
if (isObject(%plyr))
|
||||
mountLaser(%plyr);
|
||||
closeScoreHudFSERV(%client);
|
||||
return;
|
||||
|
||||
case "HV": //Toggle hover mode XENON ARGH!
|
||||
%plyr = %client.player;
|
||||
if(%client.player.on)
|
||||
hoverPackOff(%client.player);
|
||||
else
|
||||
hoverPackOn(%client.player);
|
||||
closeScoreHudFSERV(%client);
|
||||
return;
|
||||
|
||||
case "RO": //READ ONLY just incase
|
||||
return;
|
||||
|
||||
case "CH": //ARMOR
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/togglegender -- Toggles the player's gender.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/togglerace -- Toggles the player's race.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/togglearmor -- Toggles the player's armor.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/voicepitch -- Changes the player's voice pitch.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "BL": //DEPLOYABLE
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/setsize <X> <Y> <Z> -- Scales the object to X, Y, and Z parameters.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/getsize -- Tells you the object's X, Y, and Z scaling parameters.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/objectname <name> -- Sets the name of an object.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "/giveto -- Gives all current pieces to defined player.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "DC": //DOOR
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Under Construction.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "VM": //ELEVATOR
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Elevators currently unavailable.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "RC": //MISC
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Under Construction");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "AC": //PROJECTILE TURRET
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Projectile Turrets currently unavailable.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "WC": //VEHICLE
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Theorem, get weather <zipcode> -- Theorem will give you the current weather for this zip code.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Theorem, let's talk/chat. -- Initiate a conversation with Theorem.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Theorem, stop talking. -- Stop a conversation with Theorem.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "What time is it?. -- Theorem will give you the current time.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
case "WG": // WARPGATE
|
||||
%client.SCMPage = "SM";
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "Warpgates Currently Unavailable.");
|
||||
%index++;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
return;
|
||||
|
||||
// case "GC": //GHOST
|
||||
// %client.SCMPage = "SM";
|
||||
// helps(%client,%tag,%arg,"GC");
|
||||
// return;
|
||||
//
|
||||
// case "ZDS": //ZDS
|
||||
// %client.SCMPage = "SM";
|
||||
// helps(%client,%tag,%arg,"ZDS");
|
||||
// return;
|
||||
//
|
||||
// case "AC": //Admin
|
||||
// %client.SCMPage = "SM";
|
||||
// helps(%client,%tag,%arg,"AC");
|
||||
// return;
|
||||
//
|
||||
// case "STUFF": //STUFF
|
||||
// %client.SCMPage = "SM";
|
||||
// helps(%client,%tag,%arg,"STUFF");
|
||||
// return;
|
||||
//
|
||||
case "DISCON":
|
||||
schedule(2500,0,deleteClientPieces,%client); //Kill them pieces!
|
||||
//schedule(3500,0,deleteClientPieces,%client); //Kill them pieces!
|
||||
closeScoreHudFSERV(%client);
|
||||
return;
|
||||
}
|
||||
closeScoreHudFSERV(%client);
|
||||
}
|
||||
|
||||
function closeScoreHudFSERV(%client) {
|
||||
serverCmdHideHud(%client, 'scoreScreen');
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
%client.SCMPage = 1;
|
||||
}
|
||||
|
||||
$ScoreHudMaxVisible = 16; //maybe 16 for low end people?
|
||||
|
||||
function scoreCmdMainMenu(%game,%client,%tag,%page) {
|
||||
messageClient( %client, 'ClearHud', "", %tag, 1 );
|
||||
if (!isobject(cmdobject)) generateCMDObj();
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Main Menu Page " @ %page);
|
||||
if (%page > 1) {
|
||||
%pgToGo = %page - 1;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Previous Page</a>',%pgToGo);
|
||||
%index++;
|
||||
}
|
||||
%cmdsToDisp = 15 * %page;
|
||||
%start = (%page - 1) * 15;
|
||||
for (%i=%start; %i < %cmdsToDisp;%i++) {
|
||||
%line = CmdObject.cmd[%i];
|
||||
if (%line !$= "") {
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\t%1>%2</a>',getword(%line,0),getwords(%line,1));
|
||||
%index++;
|
||||
}
|
||||
}
|
||||
if (%cmdsToDisp < (CmdObject.commands + 1)) {
|
||||
%pgToGo = %page + 1;
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, '<a:gamelink\tGTP\t%1>Next Page</a>',%pgToGo);
|
||||
%index++;
|
||||
}
|
||||
if (%page > 1) {
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>First Page</a>");
|
||||
%index++;
|
||||
}
|
||||
messageClient( %client, 'ClearHud', "", %tag, %index );
|
||||
}
|
||||
|
||||
|
||||
//format
|
||||
//CMD indentifier displayname
|
||||
//CMDHELP identifier help message for cmd gonna implement it
|
||||
//after noobs get their hands on the base script first
|
||||
|
||||
function GenerateCMDObj() {
|
||||
new fileobject("fIn");
|
||||
fIn.openforread("scripts/Krypton/cmddisplaylist.txt");
|
||||
if (isobject(cmdobject)) cmdobject.delete();
|
||||
new scriptObject("CmdObject") {commands=0;};
|
||||
while (!fIn.iseof()) {
|
||||
%line = fIn.readline();
|
||||
if (getword(%line,0) $= "CMD") {
|
||||
CmdObject.cmd[CmdObject.commands] = getwords(%line,1);
|
||||
CmdObject.commands++;
|
||||
}
|
||||
}
|
||||
|
||||
fIn.close();
|
||||
fIn.delete();
|
||||
}
|
||||
|
||||
function klisthud(%client,%tag,%arg)
|
||||
{
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Krypton Player List" );
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Krypton Player List");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"-----------------------------------------------------");
|
||||
%index++;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%subject = ClientGroup.getObject( %cl );
|
||||
if (%subject == $tid)
|
||||
continue;
|
||||
|
||||
%prelimline = %subject.nameBase @ " : <a:gamelink\tKLIST\tgivepieces" @ %subject @ ">[Give Pieces]</a> ";
|
||||
|
||||
if (isbuddy(%client,%subject))
|
||||
%prelimline = %prelimline @ " <a:gamelink\tKLIST\tdelbuddy" @ %subject @ ">[Remove Buddy]</a> ";
|
||||
else
|
||||
%prelimline = %prelimline @ " <a:gamelink\tKLIST\taddbuddy" @ %subject @ ">[Add Buddy]</a> ";
|
||||
|
||||
if (isenemy(%client,%subject))
|
||||
%prelimline = %prelimline @ " <a:gamelink\tKLIST\tdelenemy" @ %subject @ ">[Remove Enemy]</a>";
|
||||
else
|
||||
%prelimline = %prelimline @ " <a:gamelink\tKLIST\taddenemy" @ %subject @ ">[Add Enemy]</a>";
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,%prelimline);
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," Give Door Access Card: <a:gamelink\tKLIST\tgivecard1" @ %subject @ ">[Level 1]</a> <a:gamelink\tKLIST\tgivecard2" @ %subject @ ">[Level 2]</a> <a:gamelink\tKLIST\tgivecard3" @ %subject @ ">[Level 3]</a>");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," Take Door Access Card: <a:gamelink\tKLIST\ttakecard1" @ %subject @ ">[Level 1]</a> <a:gamelink\tKLIST\ttakecard2" @ %subject @ ">[Level 2]</a> <a:gamelink\tKLIST\ttakecard3" @ %subject @ ">[Level 3]</a>");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "addbuddy") { //Function for adding buddies...
|
||||
%cid = getSubStr(%arg, 8, strlen(%arg) - 8);
|
||||
%success = addbuddy(%client,%cid); //Adds a buddy to %client's buddy list.
|
||||
|
||||
if (%success) {
|
||||
messageclient(%client, 'MsgClient', "\c2You added \c3"@%cid.namebase@" \c2to your buddy list.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You have been added to \c3"@%client.nameBase@"'s\c2 buddy list.");
|
||||
} else {
|
||||
messageclient(%client, 'MsgClient', "\c2Error whilst adding buddy list entry!");
|
||||
}
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "delbuddy") { //Function for deleting buddies...
|
||||
%cid = getSubStr(%arg, 8, strlen(%arg) - 8);
|
||||
%success = delbuddy(%client,%cid); //Adds a buddy to %client's buddy list.
|
||||
|
||||
if (%success) {
|
||||
messageclient(%client, 'MsgClient', "\c2You removed \c3"@%cid.namebase@" \c2to your buddy list.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You have been removed from \c3"@%client.nameBase@"'s\c2 buddy list.");
|
||||
} else {
|
||||
messageclient(%client, 'MsgClient', "\c2Error whilst removing buddy list entry!");
|
||||
}
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//Enemy list shtuff
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "addenemy") { //Function for giving players access cards.
|
||||
%cid = getSubStr(%arg, 8, strlen(%arg) - 8);
|
||||
%success = addenemy(%client,%cid); //Adds a buddy to %client's buddy list.
|
||||
|
||||
if (%success) {
|
||||
messageclient(%client, 'MsgClient', "\c2You added \c3"@%cid.namebase@" \c2to your enemy list.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You have been added to \c3"@%client.nameBase@"'s\c2 enemy list.");
|
||||
} else {
|
||||
messageclient(%client, 'MsgClient', "\c2Error whilst adding enemy list entry!");
|
||||
}
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "delenemy") { //Function for giving players access cards.
|
||||
%cid = getSubStr(%arg, 8, strlen(%arg) - 8);
|
||||
%success = delenemy(%client,%cid); //Adds a buddy to %client's buddy list.
|
||||
|
||||
if (%success) {
|
||||
messageclient(%client, 'MsgClient', "\c2You removed \c3"@%cid.namebase@" \c2to your enemy list.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You have been removed from \c3"@%client.nameBase@"'s\c2 enemy list.");
|
||||
} else {
|
||||
messageclient(%client, 'MsgClient', "\c2Error whilst removing enemy list entry!");
|
||||
}
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "givecard") { //Function for giving players access cards.
|
||||
//--
|
||||
%cid = getSubStr(getword(%arg,0), 9, strlen(%arg) - 9);
|
||||
%lv = getSubStr(getword(%arg,0), 8, 1);
|
||||
|
||||
if (%lv == 1)
|
||||
%lvlist = %cid.lv1;
|
||||
else if (%lv == 2)
|
||||
%lvlist = %cid.lv2;
|
||||
else
|
||||
%lvlist = %cid.lv3;
|
||||
|
||||
%loc = findWord(%lvlist,%client);
|
||||
|
||||
if (%loc !$= ""){
|
||||
messageclient(%client, 'MsgClient', "\c3"@%cid.namebase@"\c2 already has level-"@%lv@" access.");
|
||||
return;
|
||||
}
|
||||
else{
|
||||
if (%lv == 1)
|
||||
%cid.lv1 = %lvlist SPC %client;
|
||||
else if (%lv == 2)
|
||||
%cid.lv2 = %lvlist SPC %client;
|
||||
else
|
||||
%cid.lv3 = %lvlist SPC %client;
|
||||
|
||||
messageclient(%client, 'MsgClient', "\c2You gave \c3"@%cid.namebase@" \c2A Level-"@%lv@" keycard.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You received a Level "@%lv@" keycard from \c3"@%client.namebase @ ".");
|
||||
}
|
||||
//--
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 10) $= "givepieces") { //Function for giving players pieces.
|
||||
%to = getSubStr(getword(%arg,0), 10, strlen(%arg) - 10);
|
||||
%from = %client;
|
||||
|
||||
messageclient(%client, 'MsgClient', "\c2A request has been sent to " @ %to.nameBase @ ", asking to accept your pieces.");
|
||||
|
||||
%to.giverequest = %client;
|
||||
commandToClient( %to, 'bottomPrint', "<color:ffa800><font:Impact:19>[ Piece Request ]\n<color:00d914><font:Arial:17>" @ %from.nameBase @ "<color:00ccff><font:Arial:18> has attempted to give you his/her pieces. Type /accept in the chat to accept. Wait 20 seconds to decline.", 10 , 3 );
|
||||
messageclient( %to, 'MsgClient', "\c2" @ %from.nameBase @ " has attempted to give you his/her pieces. Type /accept in the chat to accept. Wait 20 seconds to decline.");
|
||||
messageclient(%to, 'MsgClient', "~wgui/launchMenuOver.wav");
|
||||
schedule(20000,0,ccdecline,%to);
|
||||
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "takecard") { //Function for taking players' access cards.
|
||||
|
||||
//--
|
||||
%cid = getSubStr(getword(%arg,0), 9, strlen(%arg) - 9);
|
||||
%lv = getSubStr(getword(%arg,0), 8, 1);
|
||||
|
||||
if (%lv == 1)
|
||||
%lvlist = %cid.lv1;
|
||||
else if (%lv == 2)
|
||||
%lvlist = %cid.lv2;
|
||||
else
|
||||
%lvlist = %cid.lv3;
|
||||
|
||||
%loc = findWord(%lvlist,%client);
|
||||
|
||||
if (%loc !$= ""){
|
||||
if (%lv == 1)
|
||||
%cid.lv3 = listDel(%lvlist,%loc);//%cid.lv1 = %lvlist SPC %sender;
|
||||
else if (%lv == 2)
|
||||
%cid.lv2 = listDel(%lvlist,%loc);//%cid.lv2 = %lvlist SPC %sender;
|
||||
else
|
||||
%cid.lv3 = listDel(%lvlist,%loc);//%cid.lv3 = %lvlist SPC %sender;
|
||||
messageclient(%client, 'MsgClient', "\c2You stripped \c3"@%cid.namebase@"'s\c2 Level-"@%lv@" keycard.");
|
||||
messageclient(%cid, 'MsgClient', "\c2You lost your Level-"@%lv@" keycard from \c3"@%client.namebase @ ".");
|
||||
}
|
||||
else{
|
||||
messageclient(%client, 'MsgClient', "\c3"@%cid.namebase@"\c2 doesn't have a Level-"@%lv@" keycard.");
|
||||
}
|
||||
//--
|
||||
closescorehudfserv(%client);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function kpphud(%client,%tag,%arg)
|
||||
{
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Krypton Player Preferences" );
|
||||
|
||||
//messageclient(%client,'SetLineHud',"",%tag,%index,"Krypton Player Preferences System");
|
||||
// %index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"-----------------------------------------------------");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"The preferences listed below will be saved server-side,");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"And will be loaded each time you join this server.");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"-----------------------------------------------------");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Total Krypton Play Time: Approx. " @ mFloor(%client.totalplaytime/60) @ " minutes.");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
|
||||
if (%client.afkenabled == 1)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"AFK System: <a:gamelink\tPREFS\tafkenabled1>[Enabled]</a> <a:gamelink\tPREFS\tafkenabled0>Disabled</a>");
|
||||
if (%client.afkenabled == 0)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"AFK System: <a:gamelink\tPREFS\tafkenabled1>Enabled</a> <a:gamelink\tPREFS\tafkenabled0>[Disabled]</a>");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
|
||||
if (%client.namehilite == 1)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Name Highlighting/Sound: <a:gamelink\tPREFS\thiliteenabled1>[Enabled]</a> <a:gamelink\tPREFS\thiliteenabled0>Disabled</a>");
|
||||
if (%client.namehilite == 0)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Name Highlighting/Sound: <a:gamelink\tPREFS\thiliteenabled1>Enabled</a> <a:gamelink\tPREFS\thiliteenabled0>[Disabled]</a>");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
|
||||
if (%client.lasermode == 1)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Aiming Laser: [Enabled] <a:gamelink\tPREFS\tlasermode0>Disabled</a>");
|
||||
if (%client.lasermode == 0)
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Aiming Laser: <a:gamelink\tPREFS\tlasermode1>Enabled</a> [Disabled]");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
|
||||
//A really inefficient way to display the aiming laser color status....
|
||||
if (%client.lasercolor == 0) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>[Red]</a> <a:gamelink\tPREFS\tlasercolor1>Orange</a> <a:gamelink\tPREFS\tlasercolor2>Yellow</a> <a:gamelink\tPREFS\tlasercolor3>Green</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>Blue</a> <a:gamelink\tPREFS\tlasercolor5>Pink</a>";
|
||||
}
|
||||
if (%client.lasercolor == 1) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>Red</a> <a:gamelink\tPREFS\tlasercolor1>[Orange]</a> <a:gamelink\tPREFS\tlasercolor2>Yellow</a> <a:gamelink\tPREFS\tlasercolor3>Green</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>Blue</a> <a:gamelink\tPREFS\tlasercolor5>Pink</a>";
|
||||
}
|
||||
if (%client.lasercolor == 2) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>Red</a> <a:gamelink\tPREFS\tlasercolor1>Orange</a> <a:gamelink\tPREFS\tlasercolor2>[Yellow]</a> <a:gamelink\tPREFS\tlasercolor3>Green</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>Blue</a> <a:gamelink\tPREFS\tlasercolor5>Pink</a>";
|
||||
}
|
||||
if (%client.lasercolor == 3) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>Red</a> <a:gamelink\tPREFS\tlasercolor1>Orange</a> <a:gamelink\tPREFS\tlasercolor2>Yellow</a> <a:gamelink\tPREFS\tlasercolor3>[Green]</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>Blue</a> <a:gamelink\tPREFS\tlasercolor5>Pink</a>";
|
||||
}
|
||||
if (%client.lasercolor == 4) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>Red</a> <a:gamelink\tPREFS\tlasercolor1>Orange</a> <a:gamelink\tPREFS\tlasercolor2>Yellow</a> <a:gamelink\tPREFS\tlasercolor3>Green</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>[Blue]</a> <a:gamelink\tPREFS\tlasercolor5>Pink</a>";
|
||||
}
|
||||
if (%client.lasercolor == 5) {
|
||||
%lazline = "Aiming Laser Color: <a:gamelink\tPREFS\tlasercolor0>Red</a> <a:gamelink\tPREFS\tlasercolor1>Orange</a> <a:gamelink\tPREFS\tlasercolor2>Yellow</a> <a:gamelink\tPREFS\tlasercolor3>Green</a>";
|
||||
%lazline2 = " <a:gamelink\tPREFS\tlasercolor4>Blue</a> <a:gamelink\tPREFS\tlasercolor5>[Pink]</a>";
|
||||
}
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,%lazline);
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,%lazline2);
|
||||
%index++;
|
||||
|
||||
//End aiming laser status.
|
||||
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"");
|
||||
%index++;
|
||||
|
||||
//Begin spawn position
|
||||
if (%client.spawnposition !$= "")
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Spawn Position: [Position Set] <a:gamelink\tPREFS\tresetspawn>Clear</a>");
|
||||
else
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Spawn Position: [Not Set] <a:gamelink\tPREFS\tsetspawn>Set Position</a>");
|
||||
%index++;
|
||||
//End spawn position
|
||||
|
||||
//End menu display
|
||||
|
||||
//Begin preferences functions
|
||||
if (getSubStr(getword(%arg,0), 0, 13) $= "hiliteenabled") { //Function for changing name highlighting preference.
|
||||
%client.namehilite = getSubStr(getword(%arg,0), 13, 1);
|
||||
if (%client.namehilite)
|
||||
messageClient(%client,0,'\c2Name highlighting enabled.');
|
||||
else
|
||||
messageClient(%client,0,'\c2Name highlighting disabled.');
|
||||
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 9) $= "lasermode") { //Function for changing laser mode.
|
||||
%client.lasermode = getSubStr(getword(%arg,0), 9, 1);
|
||||
%plyr = %client.player;
|
||||
if(%client.laserMode == 1 && isPlayer(%plyr)) {
|
||||
messageClient(%client,0,'\c2Laser set to : Full-On.');
|
||||
%p = new TargetProjectile(){
|
||||
dataBlock = "AimingLaser" @ %client.lasercolor;
|
||||
initialDirection = %plyr.getMuzzleVector($WeaponSlot);
|
||||
initialPosition = %plyr.getMuzzlePoint($WeaponSlot);
|
||||
sourceObject = %plyr;
|
||||
sourceSlot = $WeaponSlot;
|
||||
vehicleObject = %vehicle;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
%plyr.attachedLaser = %p;
|
||||
%plyr.laserActive = 1;
|
||||
}
|
||||
if (%client.laserMode == 0 && isPlayer(%plyr)) {
|
||||
messageClient(%client,0,'\c2Laser set to : Off.');
|
||||
if(isObject(%plyr.attachedLaser))
|
||||
%plyr.attachedLaser.delete();
|
||||
%plyr.laserActive = 0;
|
||||
}
|
||||
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 10) $= "lasercolor") { //Function for changing laser color.
|
||||
%client.lasercolor = getSubStr(getword(%arg,0), 10, 1);
|
||||
|
||||
if(isObject(%client.player.attachedLaser))
|
||||
%client.player.attachedLaser.delete();
|
||||
%client.laserActive = 0;
|
||||
|
||||
if(%client.laserMode == 1 && isPlayer(%client.player)) {
|
||||
%p = new TargetProjectile(){
|
||||
dataBlock = "AimingLaser" @ %client.lasercolor;
|
||||
initialDirection = %client.player.getMuzzleVector($WeaponSlot);
|
||||
initialPosition = %client.player.getMuzzlePoint($WeaponSlot);
|
||||
sourceObject = %client.player;
|
||||
sourceSlot = $WeaponSlot;
|
||||
vehicleObject = %vehicle;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
%client.player.attachedLaser = %p;
|
||||
%client.player.laserActive = 1;
|
||||
}
|
||||
|
||||
messageclient(%client,'MsgClient',"\c2Laser color changed.");
|
||||
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 10) $= "afkenabled") { //Function for changing laser color.
|
||||
%client.afkenabled = getSubStr(getword(%arg,0), 10, 1);
|
||||
if (%client.afkenabled == 1)
|
||||
messageclient(%client,'MsgClient',"\c2Auto away mode enabled.");
|
||||
if (%client.afkenabled == 0)
|
||||
messageclient(%client,'MsgClient',"\c2Auto away mode disabled.");
|
||||
|
||||
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "setspawn") { //Function for changing laser color.
|
||||
%client.spawnposition = %client.player.getPosition();
|
||||
messageclient(%client,'MsgClient',"\c2Spawn Position set to current player position.");
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 10) $= "resetspawn") { //Function for changing laser color.
|
||||
%client.spawnposition = "";
|
||||
messageclient(%client,'MsgClient',"\c2Spawn Position reset to default.");
|
||||
updateprefs(%client);
|
||||
%client.SCMPage = "SM";
|
||||
kpphud(%client,%tag);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function kasshud(%client,%tag,%arg)
|
||||
{
|
||||
if (%arg $= "") { //Display current saves.
|
||||
messageClient( %client, 'SetScoreHudSubheader', "", "Krypton Advanced Save System" );
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Use the /save <name> command to save your buildings.");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Saved buildings will appear in the menu below.");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"----------------------------------------------");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"[ Automagic Backup Save ] --- <a:gamelink\tKASS\tkassloadbackup>Load</a>");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,""); //Line break
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Quick Saves:");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," Quick Slot 1 || <a:gamelink\tKASS\tquickload1>Load</a> || <a:gamelink\tKASS\tquicksave1>Save</a> || <a:gamelink\tKASS\tkassdeletequicksave1>Clear</a>");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," Quick Slot 2 || <a:gamelink\tKASS\tquickload2>Load</a> || <a:gamelink\tKASS\tquicksave2>Save</a> || <a:gamelink\tKASS\tkassdeletequicksave2>Clear</a>");
|
||||
%index++;
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," Quick Slot 3 || <a:gamelink\tKASS\tquickload3>Load</a> || <a:gamelink\tKASS\tquicksave3>Save</a> || <a:gamelink\tKASS\tkassdeletequicksave3>Clear</a>");
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,""); //Line break
|
||||
%index++;
|
||||
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index,"Save Files:");
|
||||
%index++;
|
||||
|
||||
for(%file = findFirstFile("Saves/" @ %client.guid @ "/*.cs"); %file !$= ""; %file = findNextFile("Saves/" @ %client.guid @ "/*.cs")) { //List custom save names.
|
||||
%thename = strreplace( %file, "Saves/" @ %client.guid @ "/", "" );
|
||||
%thename = strreplace( %thename, ".cs", "" );
|
||||
if (getSubStr(getword(%thename,0), 0, 9) $= "quicksave" || getSubStr(getword(strlwr(%thename),0), 0, 6) $= "backup")
|
||||
continue; //Ignore quicksave files.
|
||||
messageclient(%client,'SetLineHud',"",%tag,%index," [ " @ %thename @ " ] --- <a:gamelink\tKASS\tkassload" @ %thename @ ">Load</a> || <a:gamelink\tKASS\tkasssave" @ %thename @ ">Save</a> || <a:gamelink\tKASS\tkassdelete" @ %thename @ ">Delete</a>");
|
||||
%index++;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 9) $= "quicksave") { //Function for saving pieces
|
||||
KryptonClientSave(%client,"quicksave" @ getSubStr(getword(%arg,0), 9, 1));
|
||||
closescorehudfserv(%client);
|
||||
messageclient(%client,'MsgClient',"\c2Saved pieces in Slot " @ getSubStr(getword(%arg,0), 9, 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 9) $= "quickload") { //Function for saving pieces
|
||||
exec("Saves" @ "/" @ %client.guid @ "/quicksave" @ getSubStr(getword(%arg,0), 9, 1) @ ".cs");
|
||||
schedule(10000,0,delDupPieces,0,0,true);
|
||||
schedule(10000,0,clientPowerCheck,%client);
|
||||
messageAll(0, "\c2" @ %client.nameBase @ " has loaded a building file.");
|
||||
closescorehudfserv(%client);
|
||||
messageclient(%client,'MsgClient',"\c2Loaded pieces in Slot " @ getSubStr(getword(%arg,0), 9, 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "kassload") { //Function for loading
|
||||
exec("Saves" @ "/" @ %client.guid @ "/" @ getSubStr(getword(%arg,0), 8, strlen(getword(%arg,0)) - 8) @ ".cs");
|
||||
schedule(10000,0,delDupPieces,0,0,true);
|
||||
schedule(10000,0,clientPowerCheck,%client);
|
||||
messageAll(0, "\c2" @ %client.nameBase @ " has loaded a building file.");
|
||||
closescorehudfserv(%client);
|
||||
messageclient(%client,'MsgClient',"\c2Loaded pieces from save " @ getSubStr(getword(%arg,0), 8, strlen(getword(%arg,0)) - 8));
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 8) $= "kasssave") { //Function for loading
|
||||
KryptonClientSave(%client,getSubStr(getword(%arg,0), 8, strlen(getword(%arg,0)) - 8));
|
||||
closescorehudfserv(%client);
|
||||
messageclient(%client,'MsgClient',"\c2Saved pieces as " @ getSubStr(getword(%arg,0), 8, strlen(getword(%arg,0)) - 8));
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(getword(%arg,0), 0, 10) $= "kassdelete") { //Function for deleting
|
||||
deleteFile("Saves" @ "/" @ %client.guid @ "/" @ getSubStr(getword(%arg,0), 10, strlen(getword(%arg,0)) - 10) @ ".cs");
|
||||
deleteFile("Saves" @ "/" @ %client.guid @ "/" @ getSubStr(getword(%arg,0), 10, strlen(getword(%arg,0)) - 10) @ ".cs.dso");
|
||||
closescorehudfserv(%client);
|
||||
messageclient(%client,'MsgClient',"\c2Deleted save " @ getSubStr(getword(%arg,0), 10, strlen(getword(%arg,0)) - 10));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function helps(%client,%tag,%arg,%type) {
|
||||
%i=0;
|
||||
while (%i< $Metallic[%type]){
|
||||
%cnt=getwordcount($Metallic[%type,%i]);
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\t"@getWord($Metallic[%type,%i],0)@"\t1>"@getWords($Metallic[%type,%i],1,%cnt)@"</a>");
|
||||
%index++;
|
||||
%i++;
|
||||
}
|
||||
messageClient( %client, 'SetLineHud', "", %tag, %index, "<a:gamelink\tGTP\t1>Back to main menu</a>");
|
||||
%index++;
|
||||
messageClient( %client, 'ClearHud', "", %tag, %index );
|
||||
return;
|
||||
}
|
||||
1000
Construction/scripts/Krypton/Theorem.cs
Normal file
1000
Construction/scripts/Krypton/Theorem.cs
Normal file
File diff suppressed because it is too large
Load diff
152
Construction/scripts/Krypton/buddysystem.cs
Normal file
152
Construction/scripts/Krypton/buddysystem.cs
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
function addbuddy(%client,%buddy) //Adds a buddy to %client's buddy list.
|
||||
{
|
||||
if (!isObject(%client) || !isObject(%buddy))
|
||||
return false;
|
||||
|
||||
%count = getFieldCount( %client.buddyguids );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%id = getField( %client.buddyguids, %i );
|
||||
if ( %id == %buddy.guid )
|
||||
{
|
||||
return false; // They're already there!
|
||||
}
|
||||
}
|
||||
|
||||
if ( %count == 0 ) {
|
||||
%client.buddyguids = %buddy.guid;
|
||||
%client.buddynames = %buddy.nameBase;
|
||||
} else {
|
||||
%client.buddyguids = %client.buddyguids TAB %buddy.guid;
|
||||
%client.buddynames = %client.buddynames TAB %buddy.nameBase;
|
||||
}
|
||||
|
||||
updateprefs(%client);
|
||||
return true;
|
||||
}
|
||||
|
||||
function delbuddy(%client,%buddy) //Removes a buddy from %client's buddy list.
|
||||
{
|
||||
if (!isObject(%client) || !isObject(%buddy))
|
||||
return false;
|
||||
|
||||
%index = findWord(%client.buddyguids,%buddy.guid);
|
||||
|
||||
if (%index < 0) //Can't find 'em
|
||||
return false;
|
||||
|
||||
%client.buddyguids = removeWord(%client.buddyguids, %index);
|
||||
%client.buddynames = removeWord(%client.buddynames, %index);
|
||||
|
||||
updateprefs(%client);
|
||||
return true;
|
||||
}
|
||||
|
||||
function isbuddy(%client,%buddy)
|
||||
{
|
||||
|
||||
if ( !%totalRecords = getFieldCount( %client.buddyguids ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(%i = 0; %i < %totalRecords; %i++)
|
||||
{
|
||||
%record = getField( getRecord( %client.buddyguids, 0 ), %i);
|
||||
if (%record == %buddy.guid)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Same thing below, except an ENEMY LIST -- Primarily for turret targeting systems
|
||||
function addenemy(%client,%buddy) //Adds a buddy to %client's buddy list.
|
||||
{
|
||||
if (!isObject(%client) || !isObject(%buddy))
|
||||
return false;
|
||||
|
||||
|
||||
if (!isObject(%client) || !isObject(%buddy))
|
||||
return false;
|
||||
|
||||
%count = getFieldCount( %client.enemyguids );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%id = getField( %client.enemyguids, %i );
|
||||
if ( %id == %buddy.guid )
|
||||
{
|
||||
return false; // They're already there!
|
||||
}
|
||||
}
|
||||
|
||||
if ( %count == 0 ) {
|
||||
%client.enemyguids = %buddy.guid;
|
||||
%client.enemynames = %buddy.nameBase;
|
||||
} else {
|
||||
%client.enemyguids = %client.enemyguids TAB %buddy.guid;
|
||||
%client.enemynames = %client.enemynames TAB %buddy.nameBase;
|
||||
}
|
||||
|
||||
updateprefs(%client);
|
||||
return true;
|
||||
}
|
||||
|
||||
function delenemy(%client,%buddy) //Removes a buddy from %client's buddy list.
|
||||
{
|
||||
if (!isObject(%client) || !isObject(%buddy))
|
||||
return false;
|
||||
|
||||
%index = findWord(%client.buddyguids,%buddy.guid);
|
||||
|
||||
if (%index < 0) //Can't find 'em
|
||||
return false;
|
||||
|
||||
%client.enemyguids = removeWord(%client.enemyguids, %index);
|
||||
%client.enemynames = removeWord(%client.enemynames, %index);
|
||||
|
||||
updateprefs(%client);
|
||||
return true;
|
||||
}
|
||||
|
||||
function isenemy(%client,%buddy)
|
||||
{
|
||||
|
||||
if ( !%totalRecords = getFieldCount( %client.enemyguids ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for(%i = 0; %i < %totalRecords; %i++)
|
||||
{
|
||||
%record = getField( getRecord( %client.enemyguids, 0 ), %i);
|
||||
if (%record == %buddy.guid)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function ServerCmdAddToAdminList( %admin, %client )
|
||||
{
|
||||
if ( !%admin.isSuperAdmin )
|
||||
return;
|
||||
|
||||
%count = getFieldCount( $Host::AdminList );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%id = getField( $Host::AdminList, %i );
|
||||
if ( %id == %client.guid )
|
||||
{
|
||||
return; // They're already there!
|
||||
}
|
||||
}
|
||||
|
||||
if ( %count == 0 )
|
||||
$Host::AdminList = %client.guid;
|
||||
else
|
||||
$Host::AdminList = $Host::AdminList TAB %client.guid;
|
||||
}
|
||||
37
Construction/scripts/Krypton/cmddisplaylist.txt
Normal file
37
Construction/scripts/Krypton/cmddisplaylist.txt
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
This is the command display list
|
||||
format for this goes like so: CMD identifier display name
|
||||
any lines that does not start with a reserved word such as CMD is ignored.
|
||||
|
||||
CMD BF Buy Favorites
|
||||
CMD PC Piece Count
|
||||
CMD HV Toggle Hover Mode
|
||||
CMD RO
|
||||
CMD KASS Krypton Advanced Save System
|
||||
CMD KLIST Krypton Player List
|
||||
CMD PREFS Krypton Player Preferences
|
||||
CMD RO
|
||||
CMD DISCON Delete My Pieces
|
||||
CMD RO
|
||||
CMD RO ------- Help -------
|
||||
|
||||
CMD CH Armor Commands
|
||||
|
||||
CMDHELP ch /togglegender -- Toggles the player's gender.
|
||||
CMDHELP ch /togglerace -- Toggles the player's race.
|
||||
CMDHELP ch /togglearmor -- Toggles the player's armor.
|
||||
CMDHELP ch /voicepitch -- Changes the player's voice pitch.
|
||||
|
||||
CMD BL Deployable Commands
|
||||
|
||||
CMDHELP BL /setsize <X> <Y> <Z> -- Scales the object to X, Y, and Z parameters.
|
||||
CMDHELP BL /getsize -- Tells you the object's X, Y, and Z scaling parameters.
|
||||
CMDHELP BL /objectname <name> -- Sets the name of an object.
|
||||
CMDHELP BL /giveto -- Gives all current pieces to defined player.
|
||||
|
||||
CMD WC Theorem Commands
|
||||
|
||||
CMDHELP WC Theorem, get weather <zipcode> -- Theorem will give you the current weather for this zip code.
|
||||
CMDHELP WC Theorem, define <word> -- Theorem will give you the definition for this word.
|
||||
CMDHELP WC Theorem, talk/chat. -- Initiate a conversation with Theorem.
|
||||
CMDHELP WC Theorem, stop talking. -- Stop a conversation with Theorem.
|
||||
CMDHELP WC What time is it?. -- Theorem will give you the current time.
|
||||
465
Construction/scripts/Krypton/dayshift.cs
Normal file
465
Construction/scripts/Krypton/dayshift.cs
Normal file
|
|
@ -0,0 +1,465 @@
|
|||
//Dayshift script... basically changes the sky every so often... like a real day, in game!
|
||||
//Created for Krypton by Sloik. Hoorah!
|
||||
|
||||
|
||||
//The following functions copied from Quantium
|
||||
datablock PrecipitationData(MyReign) // =)
|
||||
{
|
||||
type = 0;
|
||||
soundProfile = "";
|
||||
materialList = "raindrops.dml";
|
||||
sizeX = 0.2;
|
||||
sizeY = 0.45;
|
||||
|
||||
movingBoxPer = 0.35;
|
||||
divHeightVal = 1.5;
|
||||
sizeBigBox = 1;
|
||||
topBoxSpeed = 20;
|
||||
frontBoxSpeed = 30;
|
||||
topBoxDrawPer = 0.5;
|
||||
bottomDrawHeight = 40;
|
||||
skipIfPer = -0.3;
|
||||
bottomSpeedPer = 1.0;
|
||||
frontSpeedPer = 1.5;
|
||||
frontRadiusPer = 0.5;
|
||||
|
||||
};
|
||||
|
||||
function skyDusk()
|
||||
{
|
||||
MessageAll('Msg', "\c2And the day went to dusk....");
|
||||
Sky.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.5 0.2 0.00 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "SOM_TR2_Armageddon.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
function skyCloudy()
|
||||
{
|
||||
// MessageAll('Msg', "\c2And the day went cloudy....");
|
||||
Sky.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.3 0.3 0.3 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_badlands_cloudy.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
function skyThunderStorm()
|
||||
{
|
||||
//MessageAll('Msg', "\c2And the thunder rolled in....");
|
||||
Sky.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.2 0.2 0.2 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_badlands_cloudy.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
new Lightning(Lightning)
|
||||
{
|
||||
position = "0 0 0";
|
||||
rotation = "1 1 0 0";
|
||||
scale = "9999 9999 160";
|
||||
dataBlock = "DefaultStorm";
|
||||
strikesPerMinute = 30;
|
||||
strikeWidth = 1 + getrandom() * 3;
|
||||
chanceToHitTarget = 0.0;
|
||||
strikeRadius = 1000;
|
||||
boltStartRadius = 1000;
|
||||
color = "1 1 1";
|
||||
fadeColor = "1 1 1";
|
||||
useFog = "0";
|
||||
};
|
||||
new Precipitation(Precipitation)
|
||||
{
|
||||
position = "-225.463 143.423 202.782";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "5 5 5";
|
||||
dataBlock = "MyReign";
|
||||
percentage = "1";
|
||||
color1 = "0.8 0.8 0.8 1";
|
||||
color2 = "0.6 0.6 0.6 1";
|
||||
color3 = "0.4 0.4 0.4 1";
|
||||
offsetSpeed = "0.25";
|
||||
minVelocity = "1";
|
||||
maxVelocity = "2";
|
||||
maxNumDrops = "2000";
|
||||
maxRadius = "100";
|
||||
};
|
||||
}
|
||||
function skyRain()
|
||||
{
|
||||
// MessageAll('Msg', "\c2And the rain came....");
|
||||
Sky.delete();
|
||||
// Precipitation.audioProfile.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.3 0.3 0.3 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_desert_brown.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
new Precipitation(Precipitation)
|
||||
{
|
||||
position = "-225.463 143.423 202.782";
|
||||
rotation = "1 0 0 0";
|
||||
scale = "5 5 5";
|
||||
dataBlock = "MyReign";
|
||||
percentage = "1";
|
||||
color1 = "0.8 0.8 0.8 1";
|
||||
color2 = "0.6 0.6 0.6 1";
|
||||
color3 = "0.4 0.4 0.4 1";
|
||||
offsetSpeed = "0.25";
|
||||
minVelocity = "1";
|
||||
maxVelocity = "2";
|
||||
maxNumDrops = "2000";
|
||||
maxRadius = "100";
|
||||
};
|
||||
}
|
||||
function skyVeryDark()
|
||||
{
|
||||
//MessageAll('Msg', "\c2And night was pitch black....");
|
||||
Sky.delete();
|
||||
//Sun.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "0";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.0 0.0 0.0 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_desert_starrynight.dml";
|
||||
windVelocity = "1 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
function skyDaylight()
|
||||
{
|
||||
// MessageAll('Msg', "\c2And daylight had come....");
|
||||
Sky.delete();
|
||||
// Precipitation.audioProfile.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.5 0.5 0.5 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_lush_blue.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
function skyNight()
|
||||
{
|
||||
//MessageAll('Msg', "\c2And night came.....");
|
||||
Sky.delete();
|
||||
// Precipitation.audioProfile.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.0 0.0 0.00 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_lava_starrynight.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
|
||||
function skySunny()
|
||||
{
|
||||
//MessageAll('Msg', "\c2And the day was sunny....");
|
||||
Sky.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
// Precipitation.audioProfile.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.650000 0.650000 0.500000 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "SOM_TR2_WinterBlue.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
|
||||
function skyMorning()
|
||||
{
|
||||
//MessageAll('Msg', "\c2And the morning awakes....");
|
||||
Sky.delete();
|
||||
// Precipitation.audioProfile.delete();
|
||||
Precipitation.delete();
|
||||
Lightning.delete();
|
||||
new Sky(Sky)
|
||||
{
|
||||
position = "-1024 -1584 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 = "5000";
|
||||
useSkyTextures = "1";
|
||||
renderBottomTexture = "0";
|
||||
SkySolidColor = "0.000000 0.000000 0.000000 0.000000";
|
||||
fogDistance = "4500";
|
||||
fogColor = "0.6 0.6 0.7 1";
|
||||
fogVolume1 = "0 0 0";
|
||||
fogVolume2 = "0 0 0";
|
||||
fogVolume3 = "0 0 0";
|
||||
materialList = "sky_lush_blue.dml";
|
||||
windVelocity = "0 0 0";
|
||||
windEffectPrecipitation = "0";
|
||||
fogVolumeColor1 = "128.000000 128.000000 128.000000 1";
|
||||
fogVolumeColor2 = "128.000000 128.000000 128.000000 0.000000";
|
||||
fogVolumeColor3 = "128.000000 128.000000 128.000000 0.000000";
|
||||
cloudSpeed0 = "0.000000 0.000000";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
//End of Quantium Functions.
|
||||
|
||||
//Time for the actual dayshift.
|
||||
$DayshiftDelay = 6; //6 minutes b/t changes.
|
||||
//schedule(10000,0,skyMorning);
|
||||
cancel($DayCycle);
|
||||
//$DayCycle = schedule($DayshiftDelay*60*1000,0,dayshift,0); //Start the dayshift at morning.
|
||||
//Dayshift cycles...
|
||||
// 0 -- Morning
|
||||
// 1 -- Daylight
|
||||
// 2 -- Sunny
|
||||
// 3 -- Cloudy
|
||||
// 4 -- Rainy
|
||||
// 5 -- Thunderstorm
|
||||
// 6 -- Dusk
|
||||
// 7 -- Night --- ZOMBIES!
|
||||
|
||||
|
||||
|
||||
//Don't use the following... it disconnects peoples.
|
||||
|
||||
function dayshift(%cycle) //Cycle being what we're at currently.
|
||||
{
|
||||
if (%cycle == 7) {
|
||||
skyMorning(); //We always move from night straight to morning...
|
||||
//And disable zombies.
|
||||
EndZombies();
|
||||
%current = 0;
|
||||
}
|
||||
if (%cycle == 0) {
|
||||
skyDaylight(); //We always move from morning straight to daylight...
|
||||
%current = 1;
|
||||
}
|
||||
if (%cycle == 1) { //Move from daylight to a random weather change.
|
||||
%wrnd = (getRandom(0,3) + 2); //2, 3, 4, or 5?
|
||||
if (%wrnd == 2) {
|
||||
skySunny(); //It's nice and sunny... we move straight to dusk from here.
|
||||
%current = 2;
|
||||
}
|
||||
if (%wrnd == 3) {
|
||||
skyCloudy(); //It's nice and cloudy... we move straight to dusk from here.
|
||||
%current = 3;
|
||||
}
|
||||
if (%wrnd == 4) {
|
||||
skyRain(); //It's nice and rainy... we move straight to dusk from here.
|
||||
%current = 4;
|
||||
}
|
||||
if (%wrnd == 5) {
|
||||
skyThunderstorm(); //It's nice and THUNDERSTORMY... we move straight to dusk from here.
|
||||
%current = 5;
|
||||
}
|
||||
}
|
||||
if (%cycle == 2 || %cycle == 3 || %cycle == 4 || %cycle == 5) {
|
||||
skyDusk(); //We move straight to dusk from here.
|
||||
%current = 6;
|
||||
}
|
||||
if (%cycle == 6) {
|
||||
skyNight(); //From Dusk, we go to night...
|
||||
//AND ENABLE ZOMBIEZ
|
||||
$ZombiesEnabled = 1;
|
||||
ZombieLoop();
|
||||
%current = 7;
|
||||
}
|
||||
cancel($DayCycle); //Already a daycycle going?
|
||||
$DayCycle = schedule($DayshiftDelay*60*1000,0,dayshift,%current);
|
||||
}
|
||||
47
Construction/scripts/Krypton/deployablelimits.cs
Normal file
47
Construction/scripts/Krypton/deployablelimits.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//Player Specific deployable limitations.
|
||||
|
||||
//Defintions for deployable "groups" or "types". Just increment by 1 to add more.
|
||||
$DeployableGroup::LargeTurret = 0;
|
||||
$DeployableGroup::PermissionSphere = 1;
|
||||
$DeployableGroup::SmallTurret = 2;
|
||||
$DeployableGroup::Energizers = 3;
|
||||
$DeployableGroup::EnergizerLights = 4;
|
||||
|
||||
//Names for deployable groups.
|
||||
$DeployableGroupName[$DeployableGroup::LargeTurret] = "Deployable Base Turret";
|
||||
$DeployableGroupName[$DeployableGroup::PermissionSphere] = "Permission Sphere";
|
||||
$DeployableGroupName[$DeployableGroup::SmallTurret] = "Small Turret";
|
||||
$DeployableGroupName[$DeployableGroup::Energizers] = "Freaking Energizer";
|
||||
|
||||
//Limits for each group.
|
||||
$PlayerDeployableMax[$DeployableGroup::LargeTurret] = 6;
|
||||
$PlayerDeployableMax[$DeployableGroup::PermissionSphere] = 2;
|
||||
$PlayerDeployableMax[$DeployableGroup::SmallTurret] = 12;
|
||||
$PlayerDeployableMax[$DeployableGroup::Energizers] = 1;
|
||||
$PlayerDeployableMax[$DeployableGroup::EnergizerLights] = 4;
|
||||
|
||||
|
||||
|
||||
|
||||
//Define which deployables belong to each group...
|
||||
|
||||
//Base turrets...
|
||||
$DeployableGroup[TurretDeployedBase] = $DeployableGroup::LargeTurret;
|
||||
|
||||
//Small turrets...
|
||||
$DeployableGroup[TurretDeployedCeilingIndoor] = $DeployableGroup::SmallTurret; //Clamp turret
|
||||
$DeployableGroup[TurretDeployedWallIndoor] = $DeployableGroup::SmallTurret; //Clamp turret
|
||||
$DeployableGroup[TurretDeployedFloorIndoor] = $DeployableGroup::SmallTurret; //Clamp turret
|
||||
$DeployableGroup[TurretDeployedOutdoor] = $DeployableGroup::SmallTurret; //Spike turret
|
||||
$DeployableGroup[DiscTurretDeployed] = $DeployableGroup::SmallTurret; //Disc turret
|
||||
$DeployableGroup[Mpm_Anti_TurretDeployed] = $DeployableGroup::SmallTurret; //Anti turret
|
||||
$DeployableGroup[LaserDeployed] = $DeployableGroup::SmallTurret; //Laser turret
|
||||
|
||||
//Permission Spheres...
|
||||
$DeployableGroup[DeployedOOSphere] = $DeployableGroup::PermissionSphere;
|
||||
$DeployableGroup[DeployedPeaceSphere] = $DeployableGroup::PermissionSphere;
|
||||
$DeployableGroup[DeployedCombatSphere] = $DeployableGroup::PermissionSphere;
|
||||
|
||||
//Energizers
|
||||
$DeployableGroup[EnergizerLight] = $DeployableGroup::EnergizerLights;
|
||||
$DeployableGroup[DeployedEnergizer] = $DeployableGroup::Energizers;
|
||||
78
Construction/scripts/Krypton/downloadsystem.cs
Normal file
78
Construction/scripts/Krypton/downloadsystem.cs
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
// Krypton Unified Download System
|
||||
// Based on a script by Electricutioner, modified (heavily) by Sloik.
|
||||
|
||||
|
||||
function KryptonWebConnection::onLine(%this, %line)
|
||||
{
|
||||
if ((getSubStr(%line,0,1) !$="#") && (trim(%line) $= "" || getSubStr(%line,0,1) !$= "$"))
|
||||
{
|
||||
//echo("Trimline");
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 1;
|
||||
return;
|
||||
}
|
||||
if (getSubStr(%line, 0, 1) $= "#")
|
||||
{
|
||||
//echo("EOF");
|
||||
%line = trim(getSubStr(%line, 1, strLen(%line) - 1));
|
||||
if (getWord(%line, 0) $= "EOF")
|
||||
{
|
||||
KryptonWebConnection.disconnect();
|
||||
exec($GetTheorem::AutoUpdate::Destination);
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 0;
|
||||
$alreadydownloading = 0; //Free our download space.
|
||||
$dlsuccess[$GetTheorem::AutoUpdate::DLid] = 1; //Success!
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ($GetTheorem::AutoUpdate::BeginWriting)
|
||||
{
|
||||
//echo("Autoupdatebeginwriting");
|
||||
new FileObject("File");
|
||||
File.openForAppend($GetTheorem::AutoUpdate::Destination);
|
||||
File.writeLine(%line);
|
||||
File.close();
|
||||
File.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function GetTheorem_autoUpdate(%theid,%thetxt,%thedlid)
|
||||
{
|
||||
//echo("Autoupdate");
|
||||
%path = "/~hayden/Theorem/src/theorem.php?id=" @ %theid @ "&input=" @ %thetxt;
|
||||
|
||||
// form the HTTP request
|
||||
%data = "GET" SPC %path SPC "HTTP/1.1\x0aHost: mcafeeweb.webhop.net";
|
||||
|
||||
//complete the connection
|
||||
if (!isObject(GetTheoremConnection))
|
||||
new TCPObject(GetTheoremConnection);
|
||||
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 0;
|
||||
$GetTheorem::AutoUpdate::Destination = "scripts/chat/theoremchat" @ %theid @ ".cs";
|
||||
$GetTheorem::AutoUpdate::DLid = %thedlid;
|
||||
deleteFile("scripts/chat/theoremchat" @ %theid @ ".cs");
|
||||
deleteFile("scripts/chat/theoremchat" @ %theid @ ".cs.dso");
|
||||
|
||||
KryptonWebConnection.connect("mcafeeweb.webhop.net:80");
|
||||
//echo("Connect");
|
||||
KryptonWebConnection.schedule(750, send, %data, "\x0A", "\x0A");
|
||||
schedule(5000, 0, checkdownloadsuccess , %thedlid); //In five seconds, we give up. Theorem should try and reconnect on his own.
|
||||
KryptonWebConnection.schedule(5000, disconnect);
|
||||
}
|
||||
|
||||
function GetTheorem_doAutoUpdate(%theid,%thetxt)
|
||||
{
|
||||
if ($alreadydownloading == 0 || $alreadydownloading $= "") { //Make sure nobody else is downloading.
|
||||
$alreadydownloading = 1; //Reserve our download space.
|
||||
$theoremresponse[%theid] = "";
|
||||
echo("Downloading Theorem response");
|
||||
%thetxt = strreplace(%thetxt, " ", "%20");
|
||||
GetTheorem_autoUpdate(%theid,%thetxt,$DLid);
|
||||
$dlsuccess[$DLid] = 0;
|
||||
$DLid += 1; //More IDs!
|
||||
} else { //Someone else is downloading... try again in a few seconds.
|
||||
schedule(3000, 0, GetTheorem_doAutoUpdate,%theid,%thetxt); //Try again in 3-5 seconds.
|
||||
echo("Waiting our turn...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
162
Construction/scripts/Krypton/getweather.cs
Normal file
162
Construction/scripts/Krypton/getweather.cs
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
// Weather Getter For Theorem, using accuweather.com RSS feeds.
|
||||
// Originally written by Electricutioner, modified by Sloik.
|
||||
// 2/11/2008
|
||||
|
||||
// Structural Infinity enabled clients are able to see over 1024
|
||||
// objects. Don't sweat the details, little monkey.
|
||||
|
||||
|
||||
function GetWeatherConnection::onLine(%this, %line)
|
||||
{
|
||||
if (trim(%line) $= "")
|
||||
{
|
||||
$GetWeather::AutoUpdate::BeginWriting = 1;
|
||||
return;
|
||||
}
|
||||
if (getSubStr(%line, 0, 1) $= "#")
|
||||
{
|
||||
%line = trim(getSubStr(%line, 1, strLen(%line) - 1));
|
||||
if (getWord(%line, 0) $= "EOF")
|
||||
{
|
||||
GetWeatherConnection.disconnect();
|
||||
exec($GetWeather::AutoUpdate::Destination);
|
||||
$GetWeather::AutoUpdate::BeginWriting = 0;
|
||||
$alreadydownloading = 0; //Free our download space.
|
||||
$dlsuccess[$GetWeather::AutoUpdate::DLid] = 1; //Success!
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ($GetWeather::AutoUpdate::BeginWriting)
|
||||
{
|
||||
new FileObject("File");
|
||||
File.openForAppend($GetWeather::AutoUpdate::Destination);
|
||||
File.writeLine(%line);
|
||||
File.close();
|
||||
File.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function GetWeather_autoUpdate(%thezip,%theid)
|
||||
{
|
||||
%path = "/~hayden/getweather.php?zip=" @ %thezip;
|
||||
|
||||
// form the HTTP request
|
||||
%data = "GET" SPC %path SPC "HTTP/1.1\x0aHost: mcafeeweb.webhop.net";
|
||||
|
||||
//complete the connection
|
||||
if (!isObject(GetWeatherConnection))
|
||||
new TCPObject(GetWeatherConnection);
|
||||
|
||||
$GetWeather::AutoUpdate::BeginWriting = 0;
|
||||
$GetWeather::AutoUpdate::Destination = "scripts/Krypton/currentweather.cs";
|
||||
$GetWeather::AutoUpdate::DLid = %theid;
|
||||
deleteFile("scripts/Krypton/currentweather.cs");
|
||||
deleteFile("scripts/Krypton/currentweather.cs.dso");
|
||||
|
||||
GetWeatherConnection.connect("mcafeeweb.webhop.net:80");
|
||||
GetWeatherConnection.schedule(500, send, %data, "\x0A", "\x0A");
|
||||
schedule(5000, 0, checkdownloadsuccess , %theid); //In five seconds, we give up. Theorem should try and reconnect on his own.
|
||||
GetWeatherConnection.schedule(5000, disconnect);
|
||||
//echo("HUR");
|
||||
}
|
||||
|
||||
function checkdownloadsuccess(%theid,%thezip)
|
||||
{
|
||||
echo("Checking...");
|
||||
if ($dlsuccess[%theid] == 0) { //This is taking far too long.
|
||||
echo("Download failed.");
|
||||
$alreadydownloading = 0; //Don't want to change this variable unless we're sure our download failed.
|
||||
}
|
||||
}
|
||||
|
||||
function GetWeather_doAutoUpdate(%zipcode)
|
||||
{
|
||||
if ($alreadydownloading == 0 || $alreadydownloading $= "") { //Make sure nobody else is downloading.
|
||||
$alreadydownloading = 1; //Reserve our download space.
|
||||
//$weatherrequest = "";
|
||||
//echo("Getting weather information...");
|
||||
$GetWeather::AutoUpdate::UpdateFile = %zipcode;
|
||||
GetWeather_autoUpdate(%zipcode,$DLid);
|
||||
$dlsuccess[$DLid] = 0;
|
||||
$DLid += 1; //More IDs!
|
||||
} else {
|
||||
schedule(3000, 0, GetWeather_doAutoUpdate,%zipcode,$DLid); //Try again in 3 seconds.
|
||||
echo("Waiting our turn...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//------------Dictionary
|
||||
|
||||
function GetWordConnection::onLine(%this, %line)
|
||||
{
|
||||
if (trim(%line) $= "")
|
||||
{
|
||||
$GetWord::AutoUpdate::BeginWriting = 1;
|
||||
return;
|
||||
}
|
||||
if (getSubStr(%line, 0, 1) $= "#")
|
||||
{
|
||||
%line = trim(getSubStr(%line, 1, strLen(%line) - 1));
|
||||
if (getWord(%line, 0) $= "EOF")
|
||||
{
|
||||
GetWordConnection.disconnect();
|
||||
exec($GetWord::AutoUpdate::Destination);
|
||||
$GetWord::AutoUpdate::BeginWriting = 0;
|
||||
$alreadydownloading = 0; //Free our download space.
|
||||
$dlsuccess[$GetWord::AutoUpdate::DLid] = 1; //Success!
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ($GetWord::AutoUpdate::BeginWriting)
|
||||
{
|
||||
new FileObject("File");
|
||||
File.openForAppend($GetWord::AutoUpdate::Destination);
|
||||
File.writeLine(%line);
|
||||
File.close();
|
||||
File.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function GetWord_autoUpdate(%theword,%theid)
|
||||
{
|
||||
%path = "/~hayden/getdefinition.php?word=" @ %theword;
|
||||
|
||||
// form the HTTP request
|
||||
%data = "GET" SPC %path SPC "HTTP/1.1\x0aHost: mcafeeweb.webhop.net";
|
||||
|
||||
//complete the connection
|
||||
if (!isObject(GetWordConnection))
|
||||
new TCPObject(GetWordConnection);
|
||||
|
||||
$GetWord::AutoUpdate::BeginWriting = 0;
|
||||
$GetWord::AutoUpdate::Destination = "scripts/Krypton/currentword.cs";
|
||||
$GetWord::AutoUpdate::DLid = %theid;
|
||||
deleteFile("scripts/Krypton/currentword.cs");
|
||||
deleteFile("scripts/Krypton/currentword.cs.dso");
|
||||
|
||||
GetWordConnection.connect("mcafeeweb.webhop.net:80");
|
||||
GetWordConnection.schedule(500, send, %data, "\x0A", "\x0A");
|
||||
schedule(5000, 0, checkdownloadsuccess , %theid); //In five seconds, we give up. Theorem should try and reconnect on his own.
|
||||
GetWordConnection.schedule(5000, disconnect);
|
||||
//echo("HUR");
|
||||
}
|
||||
|
||||
function GetWord_doAutoUpdate(%word)
|
||||
{
|
||||
if ($alreadydownloading == 0 || $alreadydownloading $= "") { //Make sure nobody else is downloading.
|
||||
$alreadydownloading = 1; //Reserve our download space.
|
||||
echo("Getting word information for " @ %word);
|
||||
$GetWord::AutoUpdate::UpdateFile = %word;
|
||||
GetWord_autoUpdate(%word,$DLid);
|
||||
$dlsuccess[$DLid] = 0;
|
||||
$DLid += 1; //More IDs!
|
||||
} else {
|
||||
schedule(3000, 0, GetWord_doAutoUpdate,%word); //Try again in 3 seconds.
|
||||
echo("Waiting our turn...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
87
Construction/scripts/Krypton/hoverpack.cs
Normal file
87
Construction/scripts/Krypton/hoverpack.cs
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
//Taken from Quantium for use in Krypton Construct.
|
||||
|
||||
|
||||
// orgianly BadShots but converted to with a key
|
||||
|
||||
datablock StaticShapeData(PlayerPlatform) : StaticShapeDamageProfile
|
||||
{
|
||||
shapeFile = "Pmiscf.dts";
|
||||
isInvincible = true;
|
||||
};
|
||||
|
||||
function CreateHoverPackData(%obj)
|
||||
{
|
||||
%obj.platform = new StaticShape()
|
||||
{
|
||||
dataBlock = PlayerPlatform;
|
||||
Position = "0 0 -1000";
|
||||
Scale = "0.3 0.3 0.1";
|
||||
};
|
||||
%obj.platform.startfade(200,0,true);
|
||||
%obj.platform.setTransform("0 0 -1000 0 0 0 1");
|
||||
%obj.platform.team = 0;
|
||||
if(%obj.platform.getTarget() != -1)
|
||||
setTargetSensorGroup(%obj.platform.getTarget(), %obj.team);
|
||||
MissionCleanup.add(%obj.platform);
|
||||
|
||||
}
|
||||
function KillHoverPackData(%obj)
|
||||
{
|
||||
%obj.setMoveState(false);
|
||||
if (isObject(%obj.platform))
|
||||
%obj.platform.schedule(100, "delete");
|
||||
}
|
||||
function hoverPackOn(%obj)
|
||||
{
|
||||
if(%obj.client.player.isFrozen)
|
||||
return;
|
||||
if (%obj.on != 0)
|
||||
return;
|
||||
//%obj.setMoveState(true);
|
||||
%obj.client.player.setVelocity("0 0 1");
|
||||
CreateHoverPackData(%obj);
|
||||
%obj.platform.setPosition(VectorAdd(%obj.client.player.getPosition(),"0 0 -2"));
|
||||
|
||||
%obj.client.player.applyImpulse(%obj.client.player.getPosition(),VectorScale("0 0 1",2000));
|
||||
schedule(32,0,updateHover,%obj);
|
||||
%obj.on = 1;
|
||||
}
|
||||
|
||||
function updateHover(%obj)
|
||||
{
|
||||
if (isObject(%obj.client.player)) {
|
||||
%px = getWord(%obj.client.player.getPosition(),0);
|
||||
%py = getWord(%obj.client.player.getPosition(),1);
|
||||
%pz = getWord(%obj.platform.getPosition(),2);
|
||||
%playaz = getWord(%obj.client.player.getPosition(),2);
|
||||
if (mAbs(%pz - %playaz) > 5) {
|
||||
%obj.platform.setPosition(%px SPC %py SPC (%playaz-1.5));
|
||||
} else {
|
||||
%obj.platform.setPosition(%px SPC %py SPC %pz);
|
||||
}
|
||||
%lateralSpeed = VectorLen(getWords(%obj.client.player.getVelocity(),0,1) SPC 0);
|
||||
%thesize = (%lateralSpeed/(1000/32))*5;
|
||||
if (%thesize < 0.7)
|
||||
%thesize = 0.7;
|
||||
%obj.platform.setRealSize(%thesize SPC %thesize SPC 0.1);
|
||||
//divide by cycles per second and multiply by two.
|
||||
//Thanks Electricutioner!!
|
||||
if (%obj.on == 1)
|
||||
schedule(32,0,updateHover,%obj);
|
||||
} else {
|
||||
hoverPackOff(%obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function hoverPackOff(%obj)
|
||||
{
|
||||
if(%obj.client.player.isFrozen)
|
||||
return;
|
||||
|
||||
%obj.on = "";
|
||||
%obj.setMoveState(false);
|
||||
if (isObject(%obj.platform))
|
||||
%obj.platform.setTransform("0 0 -1000 0 0 0 1");
|
||||
KillHoverPackData(%obj);
|
||||
}
|
||||
127
Construction/scripts/Krypton/loadscreen.cs
Normal file
127
Construction/scripts/Krypton/loadscreen.cs
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
//-------------------------------------------
|
||||
// Mod information load screen - ZOD. z0ddm0d
|
||||
// and Modified later by the T2CC
|
||||
// Modified for Krypton Construction by Sloik
|
||||
//-------------------------------------------
|
||||
|
||||
package loadmodinfo
|
||||
{
|
||||
function sendLoadInfoToClient( %client )
|
||||
{
|
||||
Parent::sendLoadInfoToClient(%client);
|
||||
// Change the schedule to load the messages faster or slower...
|
||||
schedule(8000, 0, "ModInfoLoad", %client);
|
||||
}
|
||||
|
||||
function ModInfoLoad(%client)
|
||||
{
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%client = ClientGroup.getObject( %cl );
|
||||
if (!%client.isAIControlled())
|
||||
sendModInfoToClient(%client);
|
||||
}
|
||||
}
|
||||
|
||||
function sendModInfoToClient(%client)
|
||||
{
|
||||
%on = "On";
|
||||
%off = "Off";
|
||||
|
||||
messageClient( %client, 'MsgLoadInfo', "", $CurrentMission, $MissionDisplayName, $Host::GameName );
|
||||
|
||||
// Send mod details:
|
||||
%ModLine = "\n<color:dc2be2><font:arial italic:24>Krypton Construction Mod" @
|
||||
"\n<color:792be2><font:Arial:16>Developed by Sloik" @
|
||||
"\n<color:792be2><font:Arial:16>Based on Construction 0.70a\n";
|
||||
messageClient( %client, 'MsgLoadQuoteLine', "", %ModLine );
|
||||
|
||||
// I made this one line because sending multiple lines causes flashing with scripts
|
||||
// that run on ModInfoLoad. There's a maxium # of characters that can be printed
|
||||
// with MsgLoadRulesLine. We're at that now.
|
||||
//
|
||||
// Send server information:
|
||||
%ServerText = "\nSERVER OPTIONS:" @
|
||||
//"\n Time limit: " @ $Host::TimeLimit @ //There's usually no need to display the time limit.
|
||||
"\n Max players: " @ $Host::MaxPlayers @
|
||||
"\n Team damage: " @ ($Host::TeamDamageOn ? %on : %off) @
|
||||
"\n Combat: " @ "Enabled" @
|
||||
"\n" @
|
||||
"\n <color:139a3d><font:Arial:16>Press F2 for additional functions and information";
|
||||
//"\n CRC checking: " @ ($Host::CRCTextures ? %on : %off) @
|
||||
//"\n Pure server: " @ ($Host::PureServer ? %on : %off) @
|
||||
//"\n Refuse smurfs: " @ ($Host::NoSmurfs ? %on : %off) @
|
||||
//"\n Next Mission: " @ findNextCycleMission();
|
||||
|
||||
messageClient( %client, 'MsgLoadRulesLine', "", %ServerText, false );
|
||||
messageClient( %client, 'MsgLoadInfoDone' );
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
activatepackage(loadmodinfo);
|
||||
|
||||
|
||||
|
||||
function debriefLoad( %client )
|
||||
{
|
||||
%kryptonquotenumber = 11;
|
||||
%kryptonquote[0] = "You can use permission spheres to prevent weapon fire near your buildings.";
|
||||
%kryptonquote[1] = "You can change personal player preferences in the F2 menu.";
|
||||
%kryptonquote[2] = "The /away command will let players know you're away when your name is mentioned.";
|
||||
%kryptonquote[3] = "You can save buildings using the Advanced Save System in the F2 menu.";
|
||||
%kryptonquote[4] = "You will be sent to jail if you kill a fellow player outside of a combat sphere.";
|
||||
%kryptonquote[5] = "If you'd like to fight without being sent to jail, deploy a combat permission sphere under packs.";
|
||||
%kryptonquote[6] = "Don't be a jerk.";
|
||||
%kryptonquote[7] = "Theorem will warn you for cursing, typing in all capital letters, or repeating yourself. You will be kicked on the third warning.";
|
||||
%kryptonquote[8] = "Don't ask for admin.";
|
||||
%kryptonquote[9] = "Owner-only permission spheres will keep others from deploying near you. You can find the permission sphere under packs.";
|
||||
%kryptonquote[10] = "You can give other players access cards to your level doors through the player list in the F2 menu.";
|
||||
%kryptonquote[11] = "You can give other players your deployables through the player list in the F2 menu.";
|
||||
|
||||
if (isObject(Game))
|
||||
%game = Game.getId();
|
||||
else
|
||||
return;
|
||||
messageClient(%client, 'MsgDebriefResult', "", '<just:center>Krypton Construction Mod');//Top of the debrief screen
|
||||
|
||||
//messageClient( %client, 'MsgDebriefAddLine', "", '<spush><color:dc2be2><font:arial italic:24>Krypton Construction Mod<spop>' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<just:center><color:ff00ba><font:Impact:18>Developed by Sloik' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<just:center><color:ff00ba><font:Impact:18>Based on Construction 0.70a' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:005aff><font:Arial:32>Kr' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:005aff><font:Arial:19>Krypton Construction Mod' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:00ffc6><font:Arial:32>Taking Suggestions!' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:00a37f><font:Arial:16>See a feature in some other mod that isn\'t here? Type /submit with your suggestion and it will be considered for Krypton 2. Your GUIDs are recorded with submission.' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:aae8ff><font:Impact:20>Server Options:' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<color:00baff><font:Arial:18>Max players: " @ $Host::MaxPlayers );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<color:00baff><font:Arial:18>Combat: Enabled" );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:ffffff><font:Impact:20>Credits:' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:c1c1c1><font:Impact:19> Construction Development Team' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:adadad><font:Arial:16> Mostlikely, JackTL, Construct, Tessio, Lucid, Badshot, Dynablade, Child_Killer' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:c1c1c1><font:Impact:19> Metallic Development Team' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:adadad><font:Arial:16> Captn Power, BlackFire, SUSaiyn, Kamikaze, Krash123, Dricon' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:c1c1c1><font:Impact:19> Quantium Development Team' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:adadad><font:Arial:16> Sun Quan.... etc?' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:c1c1c1><font:Impact:19> {NOS} Clan' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:adadad><font:Arial:16> Electricutioner, Naosyth, Ronnies, Mazo, etc.' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:c1c1c1><font:Impact:19> Other Peoples' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:adadad><font:Arial:16> Dark Dragon DX, Netherdark, Blnukem' );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<color:aae8ff><font:Impact:20>Random Tip:" );
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", "<color:aae8ff><font:Impact:17>" @ %kryptonquote[getrandom(0,%kryptonquotenumber)] );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '' );//Newline
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<color:139a3d><font:Arial:18>Press F2 after loading for additional functions and information' );//Newline
|
||||
|
||||
messageClient( %client, 'MsgGameOver', "\c1The Map IS LOADING, despite the blank progress bar. Do not fret!" );
|
||||
// %game.sendDebriefing( %client );
|
||||
|
||||
}
|
||||
661
Construction/scripts/Krypton/misc.cs
Normal file
661
Construction/scripts/Krypton/misc.cs
Normal file
|
|
@ -0,0 +1,661 @@
|
|||
$Host::NoAnnoyingVoiceChatSpam = 0; //Tracer DX, you suck.
|
||||
setlogmode(1); //Console logging ON
|
||||
$logechoenabled = 1; //Detailed.
|
||||
$statstracking = 1; //Write stats to a log every so often...
|
||||
|
||||
function serverCmdcheckHtilt()
|
||||
{
|
||||
//Some weird client thing...
|
||||
}
|
||||
|
||||
function serverCmdcheckendtilt()
|
||||
{
|
||||
//Some weird client thing...
|
||||
}
|
||||
|
||||
function createtheatv(%client)
|
||||
{
|
||||
%client.theatv = new HoverVehicle()
|
||||
{
|
||||
dataBlock = AdminATV;
|
||||
teamBought = %client.team;
|
||||
team = %client.team;
|
||||
mountable = true;
|
||||
disableMove = false;
|
||||
};
|
||||
%client.theatv.setTransform(%client.player.getTransform());
|
||||
MissionCleanup.Add(%client.theatv);
|
||||
}
|
||||
|
||||
function displaywepstat(%client,%wepname,%mode1,%mode2,%credits) //Just a simple way to display the weapon status.
|
||||
{
|
||||
if (%mode1 $= "")
|
||||
%mode1 = "";
|
||||
if (%mode2 $= "")
|
||||
%mode2 = "";
|
||||
if (%credits $= "")
|
||||
%credits = "Krypton Construction";
|
||||
if (%wepname $= "")
|
||||
%wepname = "Unknown Weapon";
|
||||
if (%mode1 !$= "")
|
||||
bottomPrint(%client,"<font:Sui Generis:14>>>>" @ %wepname @ "<<<\n<font:Arial:14>Set to " @ %mode1 @ " --> " @ %mode2 @ "\n" @ %credits,3,3);
|
||||
else
|
||||
bottomPrint(%client,"<font:Sui Generis:14>>>>" @ %wepname @ "<<<\n<font:Arial:14>" @ %credits,3,3);
|
||||
messageclient(%client,'MsgSPCurrentObjective1',"",%wepname @ " | " @ %mode1 @ " | " @ %mode2);
|
||||
}
|
||||
|
||||
function SimObject::getUpVector(%obj){
|
||||
%vec = vectorNormalize(vectorsub(%obj.getEdge("0 0 1"),%obj.getEdge("0 0 -1")));
|
||||
return %vec;
|
||||
}
|
||||
|
||||
|
||||
function checkafk() {
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%client = ClientGroup.getObject( %cl );
|
||||
|
||||
|
||||
//Away system stuff.
|
||||
if (%client.afkenabled == 1) {
|
||||
|
||||
if (%client == $tid)
|
||||
continue;
|
||||
|
||||
if (%client.isaway $= "")
|
||||
%client.isaway = false;
|
||||
|
||||
|
||||
if (%client.awaytime $= "")
|
||||
%client.awaytime = 0;
|
||||
|
||||
//Are they inactive for more than 5 minutes?
|
||||
%client.awaytime += 1;
|
||||
if (%client.awaytime == 300 && !%client.isaway) {
|
||||
%which = getRandom(0,3);
|
||||
if (%which == 0)
|
||||
schedule(2000,0,TheoremMsg,"You still with us, " @ %client.namebase @ "?");
|
||||
if (%which == 1)
|
||||
schedule(2000,0,TheoremMsg,"It seems as if " @ %client.namebase @ " has stepped away from the keyboard.");
|
||||
if (%which == 2)
|
||||
schedule(2000,0,TheoremMsg,"I'm marking you idle, " @ %client.namebase @ ".");
|
||||
if (%which == 3)
|
||||
schedule(2000,0,TheoremMsg,%client.namebase @ " has been marked as away.");
|
||||
|
||||
%client.isaway = true; //They're away.
|
||||
}
|
||||
|
||||
|
||||
if (!isObject(%client.player)) { //Not spawned? Add away time.
|
||||
%client.awaytime += 1;
|
||||
//continue;
|
||||
} else { //They are spawned.
|
||||
|
||||
if (%client.lastpos $= "") //No position for comparison?
|
||||
%client.lastpos = %client.player.getPosition(); //Grab one real quick.
|
||||
|
||||
//Compare their position to their last one.
|
||||
%diffx = mabs(getword(%client.lastpos,0) - getword(%client.player.getPosition(),0));
|
||||
%diffy = mabs(getword(%client.lastpos,1) - getword(%client.player.getPosition(),1));
|
||||
%diffz = mabs(getword(%client.lastpos,2) - getword(%client.player.getPosition(),2));
|
||||
|
||||
if ((%diffx+%diffy+%diffz)/3 > 0.3) { //Have they moved?
|
||||
endaway(%client); //They're here.
|
||||
}
|
||||
%client.lastpos = %client.player.getPosition(); //Update their current position for comparison.
|
||||
}
|
||||
|
||||
} //End away system stuff.
|
||||
|
||||
|
||||
//Total time spent calculation
|
||||
if (%client.totalplaytime $= "")
|
||||
%client.totalplaytime = 0;
|
||||
|
||||
%client.totalplaytime++; //add 1 more second to their total play time...
|
||||
|
||||
if (%client.totalplaytime > 172800 && !%client.viparmorenabled) { //Over 48 hours -- VIP Armor Enabled
|
||||
TheoremMsg(%client.nameBase @ " has now played in Krypton for over 48 hours, and has gained VIP armor!", "gui/command_on.wav");
|
||||
%client.viparmorenabled = 1;
|
||||
updateprefs(%client);
|
||||
}
|
||||
|
||||
}
|
||||
$awaysched = schedule(1000,0,checkafk);
|
||||
}
|
||||
|
||||
cancel($awaysched);
|
||||
checkafk();
|
||||
|
||||
function setaway(%client)
|
||||
{
|
||||
if (%client.afkenabled == 0) {
|
||||
schedule(1000,0,messageclient,%client,'msgclient',"\c2Your away system is disabled in player preferences; you will not be set as away.");
|
||||
return;
|
||||
}
|
||||
|
||||
%which = getRandom(0,1);
|
||||
if (%which == 0)
|
||||
schedule(2000,0,TheoremMsg,"I'm marking you as away, " @ %client.namebase @ ".");
|
||||
if (%which == 1)
|
||||
schedule(2000,0,TheoremMsg,%client.namebase @ " has been marked as away.");
|
||||
|
||||
%client.isaway = true; //They're away.
|
||||
}
|
||||
|
||||
function endaway(%client)
|
||||
{
|
||||
if (%client.isaway) {
|
||||
%which = getRandom(0,3);
|
||||
if (%which == 0)
|
||||
schedule(2000,0,TheoremMsg,"Welcome back, " @ %client.namebase @ ". You were away for approx. " @ mFloor(%client.awaytime/60) @ " minutes.");
|
||||
if (%which == 1)
|
||||
schedule(2000,0,TheoremMsg,%client.namebase @ " has returned. You were away for approx. " @ mFloor(%client.awaytime/60) @ " minutes.");
|
||||
if (%which == 2)
|
||||
schedule(2000,0,TheoremMsg,%client.namebase @ " is back in action. You were away for approx. " @ mFloor(%client.awaytime/60) @ " minutes.");
|
||||
if (%which == 3)
|
||||
schedule(2000,0,TheoremMsg,%client.namebase @ " has been marked as present. You were away for approx. " @ mFloor(%client.awaytime/60) @ " minutes.");
|
||||
}
|
||||
%client.isaway = false; //They've returned.
|
||||
%client.awaytime = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
datablock TargetProjectileData(AimingLaser0)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "0.9 0.0 0.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(AimingLaser1)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "1.0 0.5 0.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(AimingLaser2)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "1.0 1.0 0.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(AimingLaser3)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "0.0 0.9 0.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(AimingLaser4)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "0.0 0.24 1.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
datablock TargetProjectileData(AimingLaser5)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "1.0 0.0 1.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
|
||||
|
||||
function givestuff(%from,%to)
|
||||
{
|
||||
%group = nameToID("MissionCleanup/Deployables");
|
||||
%count = %group.getCount();
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%obj = %group.getObject(%i);
|
||||
if (%obj.getOwner() == %from) {
|
||||
%obj.setOwner(%to.player);
|
||||
%obj.setOwnerClient(%to);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function makeblankfile(%file)
|
||||
{
|
||||
new FileObject("SaveFile"); //create file object (player's save file)
|
||||
SaveFile.openForWrite(%file); //open it up, and create it if it isn't there
|
||||
SaveFile.writeLine("");
|
||||
SaveFile.close(); //close the file
|
||||
SaveFile.delete(); //delete the object (not the file)
|
||||
}
|
||||
|
||||
|
||||
function uberzHash(%str) {
|
||||
%hash = 7;
|
||||
%len = strlen(%str);
|
||||
for (%i = 0; %i <%len; %i++){ %hash = mmod(%hash,131072); %hash *= strCmp(getSubStr(%str, %i, 1), ""); }
|
||||
return mAbs(%hash % 1000000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updatestats() {
|
||||
new FileObject("StatFile"); //Create stat file
|
||||
StatFile.openForWrite("logs/currentstats.php");
|
||||
StatFile.writeLine("<?php");
|
||||
%playersline = "$players = \"";
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%subject = ClientGroup.getObject( %cl );
|
||||
%playersline = %playersline @ %subject.nameBase @ "||";
|
||||
}
|
||||
%playersline = %playersline @ "\";";
|
||||
StatFile.writeLine(%playersline);
|
||||
StatFile.writeLine("$uptime = " @ getsimtime() @ ";");
|
||||
StatFile.writeLine("?>");
|
||||
StatFile.close();
|
||||
StatFile.delete();
|
||||
|
||||
if ($statstracking)
|
||||
schedule(5000,0,updatestats);
|
||||
}
|
||||
|
||||
if ($statstracking)
|
||||
schedule(5000,0,updatestats);
|
||||
|
||||
|
||||
function limitloop() {
|
||||
//Make sure we're not already over the vis limit. Check sphere count while we're at it.
|
||||
%count=clientgroup.getcount();
|
||||
for (%i = 0; %i < %count; %i++){
|
||||
%client = clientgroup.getObject(%i);
|
||||
%client.piececount = 0;
|
||||
%client.spherecount = 0;
|
||||
}
|
||||
|
||||
%group = nameToID("MissionCleanup/Deployables");
|
||||
%count = %group.getCount();
|
||||
|
||||
for (%i=0;%i<%count;%i++) { //Reset all dep. specific counts to zero.
|
||||
%obj = %group.getObject(%i);
|
||||
%owner = %obj.getOwner();
|
||||
if ($DeployableGroup[%obj.getdatablock().getName()] !$= "")
|
||||
%owner.deployablecount[$DeployableGroup[%obj.getdatablock().getName()]] = "";
|
||||
}
|
||||
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%obj = %group.getObject(%i);
|
||||
%owner = %obj.getOwner();
|
||||
|
||||
if ($DeployableGroup[%obj.getdatablock().getName()] !$= "")
|
||||
%owner.deployablecount[$DeployableGroup[%obj.getdatablock().getName()]]++;
|
||||
|
||||
%maxamt = $PlayerDeployableMax[$DeployableGroup[%obj.getdatablock().getName()]];
|
||||
if (%maxamt !$= "" && (%owner.deployablecount[$DeployableGroup[%obj.getdatablock().getName()]] > %maxamt)) {
|
||||
%obj.getDataBlock().disassemble(%owner.player,%obj);
|
||||
messageclient(%owner, 'MsgClient', "\c2You have exceeded the " @ $DeployableGroupName[$DeployableGroup[%obj.getdatablock().getName()]] @ " limit of " @ %maxamt @ ". Deleting excess objects...");
|
||||
} else {
|
||||
%owner.piececount++;
|
||||
%piececount++;
|
||||
}
|
||||
}
|
||||
|
||||
$PieceCount = %piececount;
|
||||
cancel($limitloop);
|
||||
$limitloop = schedule(5000,0,limitloop);
|
||||
}
|
||||
$limitloop = schedule(5000,0,limitloop);
|
||||
|
||||
|
||||
function UpdatePlayerCount()
|
||||
{
|
||||
|
||||
$ActivePlayerCount = 0;
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%subject = ClientGroup.getObject( %cl );
|
||||
if (!%subject.isAIControlled())
|
||||
$ActivePlayerCount++;
|
||||
}
|
||||
|
||||
echo("Currently Active Players: " @ $ActivePlayerCount);
|
||||
}
|
||||
|
||||
|
||||
function IPRenew() //The stability restart seems to make the server confused about its own IP. This should keep it in line...
|
||||
{
|
||||
// if ($IPv4::InetAddress !$= "") //I don't care what it is now... we need to renew it!
|
||||
// return;
|
||||
|
||||
if (isObject(IPv4Connection))
|
||||
{
|
||||
IPv4Connection.disconnect();
|
||||
IPv4Connection.delete();
|
||||
}
|
||||
new TCPObject(IPv4Connection);
|
||||
IPV4Connection.data = "GET " @ $IPv4::AutomationURL @ " HTTP/1.1\r\nHost: www.tribesnext.com\r\nUser-Agent: Tribes 2\r\nConnection: close\r\n\r\n";
|
||||
IPv4Connection.connect("www.tribesnext.com:80");
|
||||
|
||||
$Krypton::IPRenewSchedule.cancel();
|
||||
$Krypton::IPRenewSchedule = schedule(1000*60*2,0,IPRenew); //Renew every 2 minutes.
|
||||
}
|
||||
|
||||
//$Krypton::IPRenewSchedule = schedule(1000*60*2,0,IPRenew); //Renew every 2 minutes.
|
||||
|
||||
|
||||
|
||||
function serverCmdMetallic(%client,%metallic) {
|
||||
%plyr = %client.player;
|
||||
if (isObject(%plyr)) {
|
||||
switch$ (%metallic) {
|
||||
case "BuyFavs":
|
||||
schedule(10,0,"ccbf",%client);
|
||||
case "GetSize":
|
||||
schedule(10,0,"ccgetsize",%client);
|
||||
case "MoveDown":
|
||||
schedule(10,0,"ccmoveme",%client,"0 0 -1");
|
||||
// case "sizecopy":
|
||||
// schedule(10,0,"ccsetsize",%client,"copy",0);
|
||||
// case "sizeoriginal":
|
||||
// schedule(10,0,"ccsetsize",%client,"original",0);
|
||||
// case "sizeundo":
|
||||
// schedule(10,0,"ccsetsize",%client,"undo",0);
|
||||
// case "ActivateGate":
|
||||
// schedule(10,0,"ccActivate",%client);
|
||||
case "Help":
|
||||
schedule(10,0,"cchelp",%client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function javaURLencode(%string) {
|
||||
%string = strreplace(%string,";","%3B");
|
||||
%string = strreplace(%string,"?","%3F");
|
||||
%string = strreplace(%string,"/","%2F");
|
||||
%string = strreplace(%string,":","%3A");
|
||||
%string = strreplace(%string,"#","%23");
|
||||
%string = strreplace(%string,"&","%24");
|
||||
%string = strreplace(%string,"=","%3D");
|
||||
%string = strreplace(%string,"+","%2B");
|
||||
%string = strreplace(%string,"$","%26");
|
||||
%string = strreplace(%string,",","%2C");
|
||||
%string = strreplace(%string," ","%20");
|
||||
%string = strreplace(%string,"%","%25");
|
||||
%string = strreplace(%string,"<","%3C");
|
||||
%string = strreplace(%string,">","%3E");
|
||||
%string = strreplace(%string,"~","%7E");
|
||||
%string = strreplace(%string,"'","%27");
|
||||
%string = strreplace(%string,"\"","%22");
|
||||
|
||||
return %string;
|
||||
}
|
||||
|
||||
|
||||
function wget(%URL,%outputfile)
|
||||
{
|
||||
makeblankfile(%outputfile); //Make sure torque can see the file.
|
||||
//%command = "start Z:\home\mcafeenet\ServerApps\Games\Tribes2\GameData\wget.exe --output-document=Construction/"@%outputfile@" "@%URL;
|
||||
%command = "wget --output-document=Construction/"@%outputfile@" "@%URL;
|
||||
//%command = "start notepad";
|
||||
rubyEval("system('"@%command@"');");
|
||||
}
|
||||
|
||||
$LyricsNumSongs = 1;
|
||||
$LyricsLineCount[0] = 63;
|
||||
$LyricsPunishment[0] = "Mother We Just Can't Get Enough - New Radicals";
|
||||
$LyricsPunishment[0,0] = "There's something about you";
|
||||
$LyricsPunishment[0,1] = "Tears me inside out whenever you're around";
|
||||
$LyricsPunishment[0,2] = "There's something about you";
|
||||
$LyricsPunishment[0,3] = "Spin through my veins, then we hit the ground";
|
||||
$LyricsPunishment[0,4] = "There's something about this rush";
|
||||
$LyricsPunishment[0,5] = "Take it away";
|
||||
$LyricsPunishment[0,6] = "It made me feel so good";
|
||||
$LyricsPunishment[0,7] = "I got a feeling";
|
||||
$LyricsPunishment[0,8] = "You got a feeling";
|
||||
$LyricsPunishment[0,9] = "We got a feeling";
|
||||
$LyricsPunishment[0,10] = "Like we could die";
|
||||
|
||||
$LyricsPunishment[0,11] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,12] = "We just can't get enough";
|
||||
$LyricsPunishment[0,13] = "Just can't get enough";
|
||||
$LyricsPunishment[0,14] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,15] = "We just gotta get it up";
|
||||
$LyricsPunishment[0,16] = "Just gotta get it up";
|
||||
|
||||
$LyricsPunishment[0,17] = "There's something about you";
|
||||
$LyricsPunishment[0,18] = "Tears me inside out whenever you're around";
|
||||
$LyricsPunishment[0,19] = "There's something about you";
|
||||
$LyricsPunishment[0,20] = "That makes me fly";
|
||||
$LyricsPunishment[0,21] = "You're a heart attack";
|
||||
$LyricsPunishment[0,22] = "Just the kind I like";
|
||||
$LyricsPunishment[0,23] = "There's something about your kiss";
|
||||
$LyricsPunishment[0,24] = "Haunting and strange";
|
||||
$LyricsPunishment[0,25] = "That makes me feel so good";
|
||||
$LyricsPunishment[0,26] = "I got a feeling";
|
||||
$LyricsPunishment[0,27] = "You got a feeling";
|
||||
$LyricsPunishment[0,28] = "We got a feeling";
|
||||
$LyricsPunishment[0,29] = "Like we're alive";
|
||||
|
||||
$LyricsPunishment[0,30] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,31] = "We just can't get enough";
|
||||
$LyricsPunishment[0,32] = "Just can't get enough";
|
||||
$LyricsPunishment[0,33] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,34] = "We just gotta get it up";
|
||||
$LyricsPunishment[0,35] = "Just gotta get it up";
|
||||
|
||||
$LyricsPunishment[0,36] = "This world ain't got too much time";
|
||||
$LyricsPunishment[0,37] = "But baby I'm fine";
|
||||
$LyricsPunishment[0,38] = "'Cause maybe you're mine";
|
||||
$LyricsPunishment[0,39] = "We just can't get enough";
|
||||
$LyricsPunishment[0,40] = "You better give up";
|
||||
$LyricsPunishment[0,41] = "Come on, give up";
|
||||
$LyricsPunishment[0,42] = "You better give up";
|
||||
$LyricsPunishment[0,43] = "Give up your life";
|
||||
|
||||
$LyricsPunishment[0,44] = "It's you for me, and me for you";
|
||||
$LyricsPunishment[0,45] = "You make my dreams come true";
|
||||
$LyricsPunishment[0,46] = "Off the wall, I wanna say,";
|
||||
$LyricsPunishment[0,47] = "I gotta be with you, now, baby";
|
||||
$LyricsPunishment[0,48] = "You're on my mind all the time";
|
||||
$LyricsPunishment[0,49] = "We found a million diamonds";
|
||||
$LyricsPunishment[0,50] = "I rolled the dice, lost 'em all";
|
||||
$LyricsPunishment[0,51] = "But baby I just don't mind";
|
||||
|
||||
$LyricsPunishment[0,52] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,53] = "We just can't get enough";
|
||||
$LyricsPunishment[0,54] = "Just can't get enough";
|
||||
$LyricsPunishment[0,55] = "Woooooooooooooah, woooah-ho";
|
||||
$LyricsPunishment[0,56] = "We just gotta get it up";
|
||||
$LyricsPunishment[0,57] = "Just gotta get it up";
|
||||
|
||||
$LyricsPunishment[0,58] = "This world ain't got too much time";
|
||||
$LyricsPunishment[0,59] = "But baby I'm fine";
|
||||
$LyricsPunishment[0,60] = "'Cause maybe you're mine";
|
||||
$LyricsPunishment[0,61] = "We just can't get enough";
|
||||
$LyricsPunishment[0,62] = "Woooooooooooooah, woooah-ho";
|
||||
|
||||
// VISUAL RICKROLL'D!!1
|
||||
$LyricsNumSongs++;
|
||||
$LyricsLineCount[1] = 54;
|
||||
$LyricsPunishment[1] = "Never Gonna Give You Up - Rick Astley";
|
||||
|
||||
$LyricsPunishment[1, 0] = "We're no strangers to love";
|
||||
$LyricsPunishment[1, 1] = "You know the rules and so do I";
|
||||
$LyricsPunishment[1, 2] = "A full commitment's what I'm thinking of";
|
||||
$LyricsPunishment[1, 3] = "You wouldn't get this from any other guy";
|
||||
$LyricsPunishment[1, 4] = "I just wanna tell you how I'm feeling";
|
||||
$LyricsPunishment[1, 5] = "Gotta make you understand";
|
||||
|
||||
$LyricsPunishment[1, 6] = "Never gonna give you up,";
|
||||
$LyricsPunishment[1, 7] = "Never gonna let you down,";
|
||||
$LyricsPunishment[1, 8] = "Never gonna run around and desert you,";
|
||||
$LyricsPunishment[1, 9] = "Never gonna make you cry,";
|
||||
$LyricsPunishment[1, 10] = "Never gonna say goodbye,";
|
||||
$LyricsPunishment[1, 11] = "Never gonna tell a lie and hurt you";
|
||||
|
||||
$LyricsPunishment[1, 12] = "We've known each other for so long";
|
||||
$LyricsPunishment[1, 13] = "Your heart's been aching but you're too shy to say it";
|
||||
$LyricsPunishment[1, 14] = "Inside we both know what's been going on";
|
||||
$LyricsPunishment[1, 15] = "We know the game and we're gonna play it";
|
||||
$LyricsPunishment[1, 16] = "And if you ask me how I'm feeling";
|
||||
$LyricsPunishment[1, 17] = "Don't tell me you're too blind to see";
|
||||
|
||||
$LyricsPunishment[1, 18] = "Never gonna give you up,";
|
||||
$LyricsPunishment[1, 19] = "Never gonna let you down,";
|
||||
$LyricsPunishment[1, 20] = "Never gonna run around and desert you,";
|
||||
$LyricsPunishment[1, 21] = "Never gonna make you cry,";
|
||||
$LyricsPunishment[1, 22] = "Never gonna say goodbye,";
|
||||
$LyricsPunishment[1, 23] = "Never gonna tell a lie and hurt you";
|
||||
|
||||
$LyricsPunishment[1, 24] = "Never gonna give you up,";
|
||||
$LyricsPunishment[1, 25] = "Never gonna let you down,";
|
||||
$LyricsPunishment[1, 26] = "Never gonna run around and desert you,";
|
||||
$LyricsPunishment[1, 27] = "Never gonna make you cry,";
|
||||
$LyricsPunishment[1, 28] = "Never gonna say goodbye,";
|
||||
$LyricsPunishment[1, 29] = "Never gonna tell a lie and hurt you";
|
||||
|
||||
$LyricsPunishment[1, 30] = "Ooooooooh give you up";
|
||||
$LyricsPunishment[1, 31] = "Ooooooooh give you up";
|
||||
$LyricsPunishment[1, 32] = "(Ooh) never gonna give, never gonna give";
|
||||
$LyricsPunishment[1, 33] = "give you up";
|
||||
$LyricsPunishment[1, 34] = "(Ooh) never gonna give, never gonna give";
|
||||
$LyricsPunishment[1, 35] = "give you up";
|
||||
|
||||
$LyricsPunishment[1, 36] = "We've known each other for so long";
|
||||
$LyricsPunishment[1, 37] = "Your heart's been aching but you're too shy to say it";
|
||||
$LyricsPunishment[1, 38] = "Inside we both know what's been going on";
|
||||
$LyricsPunishment[1, 39] = "We know the game and we're gonna play it";
|
||||
|
||||
$LyricsPunishment[1, 40] = "I just wanna tell you how I'm feeling";
|
||||
$LyricsPunishment[1, 41] = "Gotta make you understand";
|
||||
|
||||
$LyricsPunishment[1, 42] = "Never gonna give you up,";
|
||||
$LyricsPunishment[1, 43] = "Never gonna let you down,";
|
||||
$LyricsPunishment[1, 44] = "Never gonna run around and desert you,";
|
||||
$LyricsPunishment[1, 45] = "Never gonna make you cry,";
|
||||
$LyricsPunishment[1, 46] = "Never gonna say goodbye,";
|
||||
$LyricsPunishment[1, 47] = "Never gonna tell a lie and hurt you";
|
||||
|
||||
$LyricsPunishment[1, 48] = "Never gonna give you up,";
|
||||
$LyricsPunishment[1, 49] = "Never gonna let you down,";
|
||||
$LyricsPunishment[1, 50] = "Never gonna run around and desert you,";
|
||||
$LyricsPunishment[1, 51] = "Never gonna make you cry,";
|
||||
$LyricsPunishment[1, 52] = "Never gonna say goodbye,";
|
||||
$LyricsPunishment[1, 53] = "Never gonna tell a lie and hurt you";
|
||||
77
Construction/scripts/Krypton/modHud.cs
Normal file
77
Construction/scripts/Krypton/modHud.cs
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
function DefaultGame::InitModHud(%game, %client, %value)
|
||||
{
|
||||
// Clear out any previous settings
|
||||
commandToClient(%client, 'InitializeModHud', "ModName");
|
||||
|
||||
// Send the hud labels | Hud Label | | Option label | | Setting label |
|
||||
commandToClient(%client, 'ModHudHead', "Piece Configuration", "Option:", "Setting:");
|
||||
|
||||
%pack = %client.player.getMountedImage($BackpackSlot);
|
||||
|
||||
// Send the Option list and settings per option | Option | | Setting |
|
||||
//commandToClient(%client, 'ModHudPopulate', "Example1", "Empty");
|
||||
//commandToClient(%client, 'ModHudPopulate', "Example2", "Setting1", "Setting2", "Setting3", "Setting4", "Setting5", "Setting6", "Setting7", "Setting8", "Setting9", "Setting10");
|
||||
if (%pack.modhudenabled)
|
||||
%pack.setModHud(%client);
|
||||
|
||||
// Send the button labels and visual settings | Button | | Label | | Visible | | Active |
|
||||
commandToClient(%client, 'ModHudBtn1', "BUTTON1", 0, 0);
|
||||
commandToClient(%client, 'ModHudBtn2', "BUTTON2", 0, 0);
|
||||
commandToClient(%client, 'ModHudBtn3', "BUTTON3", 0, 0);
|
||||
commandToClient(%client, 'ModHudBtn4', "BUTTON4", 0, 0);
|
||||
|
||||
|
||||
|
||||
// We're done!
|
||||
commandToClient(%client, 'ModHudDone');
|
||||
}
|
||||
|
||||
function DefaultGame::UpdateModHudSet(%game, %client, %option, %value)
|
||||
{
|
||||
// 1 = Example1
|
||||
// 2 = Example2
|
||||
|
||||
// switch$ ( %option )
|
||||
// {
|
||||
// case 1:
|
||||
// %msg = '\c2Something set to: %2.';
|
||||
//
|
||||
// case 2:
|
||||
// %msg = '\c2Something set to: %2.';
|
||||
//
|
||||
// default:
|
||||
// %msg = '\c2Invalid setting.';
|
||||
// }
|
||||
// messageClient( %client, 'MsgModHud', %msg, %option, %value );
|
||||
if (%client.modhuddone) {
|
||||
%pack = %client.player.getMountedImage($BackpackSlot);
|
||||
%pack.getModHud(%client,%option,%value);
|
||||
}
|
||||
}
|
||||
|
||||
function DefaultGame::ModButtonCmd(%game, %client, %button, %value)
|
||||
{
|
||||
// 11 = Button 1
|
||||
// 12 = Button 2
|
||||
// 13 = Button 3
|
||||
// 14 = Button 4
|
||||
|
||||
switch ( %button )
|
||||
{
|
||||
case 11:
|
||||
%msg = '\c2Something set to: %2.';
|
||||
|
||||
case 12:
|
||||
%msg = '\c2Something set to: %2.';
|
||||
|
||||
case 13:
|
||||
%msg = '\c2Something set to: %2.';
|
||||
|
||||
case 14:
|
||||
%msg = '\c2Something set to: %2.';
|
||||
|
||||
default:
|
||||
%msg = '\c2Invalid setting.';
|
||||
}
|
||||
messageClient( %client, 'MsgModHud', %msg, %button, %value );
|
||||
}
|
||||
379
Construction/scripts/Krypton/multitool.cs
Normal file
379
Construction/scripts/Krypton/multitool.cs
Normal file
|
|
@ -0,0 +1,379 @@
|
|||
//--------------------------------------
|
||||
// Krypton Multi-Tool
|
||||
// Coded by Sloik for Krypton Construct
|
||||
// Puh-LEEZE don't just steal this -- It shall remain associated with Krypton.
|
||||
//--------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sounds
|
||||
//--------------------------------------
|
||||
datablock AudioProfile(MultiToolSwitchSound)
|
||||
{
|
||||
filename = "fx/powered/turret_light_reload.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MultiToolFireSound)
|
||||
{
|
||||
filename = "fx/weapons/cg_hard3.wav";
|
||||
description = AudioDefault3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
datablock AudioProfile(MultiToolDryFireSound)
|
||||
{
|
||||
filename = "fx/weapons/plasma_dryfire.wav";
|
||||
description = AudioClose3d;
|
||||
preload = true;
|
||||
};
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Weapon
|
||||
//--------------------------------------
|
||||
datablock ShapeBaseImageData(MultiToolSecondImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
|
||||
shapeFile = "weapon_targeting.dts";
|
||||
offset = "0.0 0.0 0.1";
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(MultiTool)
|
||||
{
|
||||
className = Weapon;
|
||||
catagory = "Spawn Items";
|
||||
shapeFile = "weapon_energy.dts";
|
||||
image = MultiToolImage;
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
pickUpName = "a Krypton multi tool";
|
||||
computeCRC = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(MultiToolImage)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "weapon_energy.dts";
|
||||
item = MultiTool;
|
||||
offset = "0 0 0";
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 0;
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateTransitionOnTimeout[0] = "Ready";
|
||||
stateTimeoutValue[0] = 0.5;
|
||||
stateSequence[0] = "Activate";
|
||||
stateSound[0] = MultiToolSwitchSound;
|
||||
|
||||
stateName[1] = "Ready";
|
||||
stateTransitionOnTriggerDown[1] = "Fire";
|
||||
|
||||
stateName[2] = "Fire";
|
||||
stateTransitionOnTimeout[2] = "Reload";
|
||||
stateEjectShell[2] = false;
|
||||
stateTimeoutValue[2] = 0.5;
|
||||
stateFire[2] = true;
|
||||
stateAllowImageChange[2] = true;
|
||||
stateSequence[2] = "Fire";
|
||||
stateScript[2] = "onFire";
|
||||
stateEmitterTime[2] = 0.1;
|
||||
stateSound[2] = MultiToolFireSound;
|
||||
|
||||
stateName[3] = "Reload";
|
||||
stateTransitionOnTimeout[3] = "Ready";
|
||||
stateTimeoutValue[3] = 0.05;
|
||||
stateAllowImageChange[3] = false;
|
||||
stateSequence[3] = "Reload";
|
||||
|
||||
};
|
||||
|
||||
function MultiToolImage::onMount(%this,%obj,%slot)
|
||||
{
|
||||
%obj.mountImage(MultiToolSecondImage, 4);
|
||||
Parent::onMount(%this,%obj,%slot);
|
||||
%obj.multitoolon = 1;
|
||||
%obj.multiobj = "";
|
||||
%obj.multighost = "";
|
||||
%obj.multivecref = "";
|
||||
%obj.multivec = "";
|
||||
|
||||
if (%obj.multimode $= "")
|
||||
%obj.multimode = 1;
|
||||
if (%obj.multisubmode $= "")
|
||||
%obj.multisubmode = 0;
|
||||
|
||||
|
||||
displaywepstat(%obj.client,"Krypton Multi-Tool",$WeaponSetting["MultiTool",%obj.multimode],$WeaponSetting["MultiTool" @ %obj.multimode,%obj.multisubmode],"Property of Krypton Construction");
|
||||
}
|
||||
|
||||
function MultiToolImage::onFire(%data,%obj,%slot)
|
||||
{
|
||||
|
||||
%pos = %obj.getMuzzlePoint($WeaponSlot);
|
||||
%vec = %obj.getMuzzleVector($WeaponSlot);
|
||||
%targetpos = VectorAdd(%pos, VectorScale(%vec, 200));
|
||||
|
||||
if (%obj.multiobj $= "") { //Don't have a piece selected?
|
||||
|
||||
%scanTarg = containerRaycast(%pos, %targetpos, $TypeMasks::StaticShapeObjectType, %obj);
|
||||
%piece = getWord(%scanTarg, 0);
|
||||
%dataBlockName = %piece.getDataBlock().getName();
|
||||
%obj.multivec1 = posFromRaycast(%scanTarg);
|
||||
%obj.multivec2 = normalFromRaycast(%scanTarg);
|
||||
|
||||
if (!isObject(%piece)) {
|
||||
messageclient(%obj.client,0,"\c2No object found.");
|
||||
return;
|
||||
}
|
||||
if (%piece.getOwner() != %obj.client) {
|
||||
messageclient(%obj.client,0,"\c2This piece is not yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
%obj.multiobj = %piece;
|
||||
|
||||
%piece.startFade(1000,0,true);
|
||||
|
||||
%obj.multivecref = VectorScale(VectorNormalize(%obj.getMuzzleVector($WeaponSlot)),VectorLen(%obj.getMuzzleVector($WeaponSlot))); //Store the player vector for reference.
|
||||
|
||||
messageclient(%obj.client,0,"\c2Object " @ %dataBlockName @ " selected.");
|
||||
|
||||
%obj.duplicate = createduplicate(%piece);
|
||||
multiloop(%obj.duplicate,%obj);
|
||||
cloakingloop(%obj.duplicate,true);
|
||||
|
||||
} else { //We've already got a piece selected.
|
||||
|
||||
if (%obj.multimode == 0) { // Mode 1 -- Moving Objects.
|
||||
%surface = Deployables::searchView(%obj,
|
||||
400,
|
||||
($TypeMasks::TerrainObjectType |
|
||||
$TypeMasks::InteriorObjectType |
|
||||
$TypeMasks::StaticShapeObjectType));
|
||||
%surfacePt = posFromRaycast(%surface);
|
||||
%surfaceNrm = normalFromRaycast(%surface);
|
||||
|
||||
//%playerVector = vectorNormalize(-1 * getWord(%obj.getEyeVector(),1) SPC getWord(%obj.getEyeVector(),0) SPC "0");
|
||||
//%surfaceNrm2 = %playerVector;
|
||||
//%surfaceNrm2 = vectorNormalize(vectorCross(%surfaceNrm,"0 0 1"));
|
||||
%mask = invFace(%surfaceNrm);
|
||||
%narrower = vectorMultiply(%mask,%surface.getRealSize());
|
||||
%subject = vectorNormalize(topVec(%narrower));
|
||||
%surfaceNrm2 = realVec(%surface,%subject);
|
||||
%rot = fullRot(%surfaceNrm,%surfaceNrm2);
|
||||
|
||||
%obj.multiobj.setTransform(%surfacePt SPC %rot);
|
||||
%obj.scale = vectorMultiply(%obj.scale,1/4 SPC 1/3 SPC 2);
|
||||
messageclient(%obj.client,0,"\c2Object moved.");
|
||||
|
||||
} else if (%obj.multimode == 1) { //Mode 2 -- Axis Move
|
||||
|
||||
%obj.multivec = VectorScale(VectorNormalize(%obj.getMuzzleVector($WeaponSlot)),VectorLen(%obj.getMuzzleVector($WeaponSlot))); //Store the player vector for reference.
|
||||
|
||||
%xval = mAbs(getWord(%obj.multivecref, 0) - getWord(%obj.multivec, 0));
|
||||
%yval = mAbs(getWord(%obj.multivecref, 1) - getWord(%obj.multivec, 1));
|
||||
%zval = mAbs(getWord(%obj.multivecref, 2) - getWord(%obj.multivec, 2));
|
||||
%globalval = ((%xval+%yval+%zval)/3)*vectorDist(%obj.multiobj.getPosition(),%obj.getPosition());
|
||||
|
||||
if (%obj.multisubmode)
|
||||
%globalval *= -1;
|
||||
|
||||
//Save to undo file...
|
||||
addUndoPiece(%obj.client,%obj.multiobj);
|
||||
saveundofile(%obj.client);
|
||||
|
||||
moveobject(%obj.multiobj,%obj.multivec1,%obj.multivec2,%obj,%globalval*2);
|
||||
messageclient(%obj.client,0,"\c2Object moved.");
|
||||
|
||||
|
||||
} else if (%obj.multimode == 2) { // Mode 3 -- Scaling Objects.
|
||||
|
||||
%obj.multivec = VectorScale(VectorNormalize(%obj.getMuzzleVector($WeaponSlot)),VectorLen(%obj.getMuzzleVector($WeaponSlot))); //Store the player vector for reference.
|
||||
|
||||
%xval = mAbs(getWord(%obj.multivecref, 0) - getWord(%obj.multivec, 0));
|
||||
%yval = mAbs(getWord(%obj.multivecref, 1) - getWord(%obj.multivec, 1));
|
||||
%zval = mAbs(getWord(%obj.multivecref, 2) - getWord(%obj.multivec, 2));
|
||||
%globalval = ((%xval+%yval+%zval)/3)*vectorDist(%obj.multiobj.getPosition(),%obj.getPosition());
|
||||
|
||||
|
||||
%vec = VectorNormalize(%obj.multivec2);
|
||||
%vec = vectorScale(%vec,%globalval);
|
||||
|
||||
%vec = mAbs(getword(%vec,0)) SPC mAbs(getword(%vec,1)) SPC mAbs(getword(%vec,2));
|
||||
|
||||
if (%obj.multisubmode)
|
||||
%vec=VectorScale(%vec,-1); //invert
|
||||
|
||||
%size=Vectoradd(%obj.multiobj.getScale(),%vec);
|
||||
|
||||
//Save to undo file...
|
||||
addUndoPiece(%obj.client,%obj.multiobj);
|
||||
saveundofile(%obj.client);
|
||||
|
||||
|
||||
%obj.multiobj.setScale(mAbs(getword(%size,0)) SPC mAbs(getword(%size,1)) SPC mAbs(getword(%size,2)));
|
||||
|
||||
messageclient(%obj.client,0,"\c2Object scaled.");
|
||||
|
||||
} else {
|
||||
messageclient(%obj.client,0,"\c2Mode error. Mode set to " @ %obj.multimode);
|
||||
}
|
||||
|
||||
%obj.multiobj.startFade(1000,0,false);
|
||||
%obj.duplicate.delete();
|
||||
%obj.multiobj = "";
|
||||
%obj.multivecref = "";
|
||||
%obj.multivec = "";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function moveobject(%obj,%vec1,%vec2,%plyr,%scale) { //Special thanks to Quantium for this.
|
||||
if (!isObject(%obj)) {
|
||||
error("No object selected to move.");
|
||||
return;
|
||||
}
|
||||
%pos = %obj.getPosition();
|
||||
%rot = %obj.getRotation();
|
||||
%vec = realVec(%obj,%vec2);
|
||||
if (%obj.getType() & $TypeMasks::ForceFieldObjectType)
|
||||
return;
|
||||
%dir = 1;
|
||||
%vec = vectorScale(%vec,%scale * %dir);
|
||||
%newpos = vectorAdd(%pos,%vec);
|
||||
%obj.setPosition(%newpos);
|
||||
checkAfterRot(%obj);
|
||||
|
||||
%dataBlockName = %obj.getDataBlock().getName();
|
||||
echo("Moved the " @ %dataBlockName);
|
||||
}
|
||||
|
||||
function relmoveobject(%obj,%vec1,%vec2,%plyr,%scale,%movobj) { //Special thanks to Quantium for this.
|
||||
if (!isObject(%obj)) {
|
||||
error("No object selected to move.");
|
||||
return;
|
||||
}
|
||||
%pos = %obj.getPosition();
|
||||
%rot = %obj.getRotation();
|
||||
%vec = realVec(%obj,%vec2);
|
||||
if (%obj.getType() & $TypeMasks::ForceFieldObjectType)
|
||||
return;
|
||||
%dir = 1;
|
||||
%vec = vectorScale(%vec,%scale * %dir);
|
||||
%newpos = vectorAdd(%pos,%vec);
|
||||
%movobj.setPosition(%newpos);
|
||||
checkAfterRot(%movobj);
|
||||
|
||||
}
|
||||
|
||||
function MultiToolImage::onUnmount(%this, %obj, %slot)
|
||||
{
|
||||
%obj.unmountImage(4);
|
||||
Parent::onUnmount(%this,%obj,%slot);
|
||||
if (isObject(%obj.duplicate)) {
|
||||
%obj.duplicate.delete();
|
||||
}
|
||||
if (isObject(%obj.multiobj)) {
|
||||
%obj.multiobj.startFade(1000,0,false);
|
||||
}
|
||||
%obj.multitoolon = 0;
|
||||
%obj.multiobj = "";
|
||||
%obj.multighost = "";
|
||||
%obj.multivecref = "";
|
||||
%obj.multivec = "";
|
||||
}
|
||||
|
||||
|
||||
function createduplicate(%obj) {
|
||||
new FileObject("MultiFile"); //create file object (player's save file)
|
||||
MultiFile.openForWrite("multifile.cs"); //open it up, and create it if it isn't there
|
||||
MultiFile.writeLine("// Krypton Multi-tool temporary save file.");
|
||||
|
||||
%obj.save("multitemp.txt"); //Save the piece to a temporary file...
|
||||
|
||||
new FileObject("MultiTemp"); //Open the temporary save file..
|
||||
MultiTemp.openForRead("MultiTemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!MultiTemp.isEOF()) {
|
||||
%currentline = MultiTemp.readLine();
|
||||
if (getSubStr( %currentline, 0, 3 ) $= "new")
|
||||
%currentline = "%thedup = " @ %currentline; //Make sure we can run stuff on this deployable later.
|
||||
MultiFile.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
MultiTemp.close(); //close the file
|
||||
MultiTemp.delete(); //delete the object (not the file)
|
||||
|
||||
MultiFile.close(); //close the file
|
||||
MultiFile.delete(); //delete the object (not the file)
|
||||
compile("multifile.cs");
|
||||
exec("multifile.cs");
|
||||
|
||||
return %thedup;
|
||||
}
|
||||
|
||||
function multiloop(%obj,%plyr) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
|
||||
if (!isObject(%plyr.multiobj))
|
||||
return;
|
||||
|
||||
if (%plyr.multimode == 1) { //Mode 2 -- Axis Move
|
||||
%plyr.multivec = VectorScale(VectorNormalize(%plyr.getMuzzleVector($WeaponSlot)),VectorLen(%plyr.getMuzzleVector($WeaponSlot))); //Store the player vector for reference.
|
||||
|
||||
%xval = mAbs(getWord(%plyr.multivecref, 0) - getWord(%plyr.multivec, 0));
|
||||
%yval = mAbs(getWord(%plyr.multivecref, 1) - getWord(%plyr.multivec, 1));
|
||||
%zval = mAbs(getWord(%plyr.multivecref, 2) - getWord(%plyr.multivec, 2));
|
||||
%globalval = ((%xval+%yval+%zval)/3)*vectorDist(%plyr.multiobj.getPosition(),%plyr.getPosition());
|
||||
|
||||
if (%plyr.multisubmode)
|
||||
%globalval *= -1;
|
||||
|
||||
|
||||
%obj.setPosition(%plyr.multiobj.getPosition());
|
||||
relmoveobject(%plyr.multiobj,%plyr.multivec1,%plyr.multivec2,%plyr,%globalval*2,%obj);
|
||||
}
|
||||
|
||||
|
||||
if (%plyr.multimode == 2) { //Mode 3 -- Axis Scale
|
||||
%plyr.multivec = VectorScale(VectorNormalize(%plyr.getMuzzleVector($WeaponSlot)),VectorLen(%plyr.getMuzzleVector($WeaponSlot))); //Store the player vector for reference.
|
||||
|
||||
%xval = mAbs(getWord(%plyr.multivecref, 0) - getWord(%plyr.multivec, 0));
|
||||
%yval = mAbs(getWord(%plyr.multivecref, 1) - getWord(%plyr.multivec, 1));
|
||||
%zval = mAbs(getWord(%plyr.multivecref, 2) - getWord(%plyr.multivec, 2));
|
||||
%globalval = ((%xval+%yval+%zval)/3)*vectorDist(%plyr.multiobj.getPosition(),%plyr.getPosition());
|
||||
|
||||
//%vec = realVec(%plyr.multiobj,%plyr.multivec2);
|
||||
%vec = VectorNormalize(%plyr.multivec2);
|
||||
%vec = vectorScale(%vec,%globalval);
|
||||
|
||||
%vec = mAbs(getword(%vec,0)) SPC mAbs(getword(%vec,1)) SPC mAbs(getword(%vec,2));
|
||||
|
||||
if (%plyr.multisubmode)
|
||||
%vec=VectorScale(%vec,-1); //invert
|
||||
|
||||
//messageclient(%plyr.client,0,%vec);
|
||||
%size=Vectoradd(%plyr.multiobj.getScale(),%vec);
|
||||
%obj.setScale(mAbs(getword(%size,0)) SPC mAbs(getword(%size,1)) SPC mAbs(getword(%size,2)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
schedule(128,0,multiloop,%obj,%plyr);
|
||||
}
|
||||
|
||||
function cloakingloop(%obj,%stat) {
|
||||
if (!isObject(%obj))
|
||||
return;
|
||||
|
||||
%obj.setcloaked(%stat);
|
||||
|
||||
schedule(500,0,cloakingloop,%obj,!%stat);
|
||||
}
|
||||
71
Construction/scripts/Krypton/playerprefs.cs
Normal file
71
Construction/scripts/Krypton/playerprefs.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
function setdefaultprefs(%client)
|
||||
{
|
||||
if (%client.lasercolor $= "")
|
||||
%client.lasercolor = 3;
|
||||
if (%client.laserMode $= "")
|
||||
%client.laserMode = 0;
|
||||
if (%client.afkenabled $= "")
|
||||
%client.afkenabled = 1;
|
||||
if (%client.namehilite $= "")
|
||||
%client.namehilite = 1;
|
||||
|
||||
if (%client.buddyguids $= "")
|
||||
%client.buddyguids = "";
|
||||
if (%client.buddynames $= "")
|
||||
%client.buddynames = "";
|
||||
|
||||
if (%client.enemyguids $= "")
|
||||
%client.enemyguids = "";
|
||||
if (%client.enemynames $= "")
|
||||
%client.enemynames = "";
|
||||
|
||||
if (%client.spawnposition $= "")
|
||||
%client.spawnposition = "";
|
||||
|
||||
if (%client.totalplaytime $= "")
|
||||
%client.totalplaytime = 0;
|
||||
|
||||
if (%client.viparmorenabled $= "")
|
||||
%client.viparmorenabled = 0;
|
||||
|
||||
}
|
||||
|
||||
function updateprefs(%client)
|
||||
{
|
||||
if (!isObject(%client) || %client < 1)
|
||||
return false;
|
||||
|
||||
setdefaultprefs(%client);
|
||||
|
||||
new FileObject("PrefsFile"); //create file object (player's save file)
|
||||
PrefsFile.openForWrite("playerprefs/" @ %client.guid @ ".cs"); //open it up, and create it if it isn't there
|
||||
PrefsFile.writeLine("// KRYPTON MOD PLAYER PREFERENCES FILE");
|
||||
PrefsFile.writeLine("// " @ %client.nameBase @ "'s Preferences.");
|
||||
|
||||
PrefsFile.writeLine("%client.lasercolor = \"" @ %client.lasercolor @ "\";");
|
||||
PrefsFile.writeLine("%client.laserMode = \"" @ %client.laserMode @ "\";");
|
||||
PrefsFile.writeLine("%client.AFKEnabled = \"" @ %client.AFKEnabled @ "\";");
|
||||
PrefsFile.writeLine("%client.namehilite = \"" @ %client.namehilite @ "\";");
|
||||
|
||||
PrefsFile.writeLine("%client.buddyguids = \"" @ %client.buddyguids @ "\";");
|
||||
PrefsFile.writeLine("%client.buddynames = \"" @ %client.buddynames @ "\";");
|
||||
|
||||
PrefsFile.writeLine("%client.enemyguids = \"" @ %client.enemyguids @ "\";");
|
||||
PrefsFile.writeLine("%client.enemynames = \"" @ %client.enemynames @ "\";");
|
||||
|
||||
PrefsFile.writeLine("%client.spawnposition = \"" @ %client.spawnposition @ "\";");
|
||||
|
||||
PrefsFile.writeLine("%client.totalplaytime = \"" @ %client.totalplaytime @ "\";");
|
||||
|
||||
PrefsFile.writeLine("%client.viparmorenabled = \"" @ %client.viparmorenabled @ "\";");
|
||||
|
||||
PrefsFile.close(); //close the file
|
||||
PrefsFile.delete(); //delete the object (not the file)
|
||||
|
||||
compile("playerprefs/" @ %client.guid @ ".cs"); //compile it. No old DSOs!
|
||||
}
|
||||
|
||||
function loadprefs(%client)
|
||||
{
|
||||
exec("playerprefs/" @ %client.guid @ ".cs");
|
||||
}
|
||||
329
Construction/scripts/Krypton/proximityswitch.cs
Normal file
329
Construction/scripts/Krypton/proximityswitch.cs
Normal file
|
|
@ -0,0 +1,329 @@
|
|||
//Promixity Switch
|
||||
//Coded for Krypton Construct by Sloik
|
||||
|
||||
datablock ItemData(ProximitySwitch) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
scale = 2.5 / 3.85 @ " " @ 2.5 / 3.1 @ " " @ 5 / 3.1;
|
||||
mass = 1;
|
||||
|
||||
hasLight = false;
|
||||
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = "ProximitySwitchDeployableImage";
|
||||
pickUpName = "a Proximity Switch pack";
|
||||
emap = true;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedProximitySwitch) : StaticShapeDamageProfile { //Deployed owner-only sphere
|
||||
className = "proxswitch";
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
|
||||
maxDamage = 1.0;
|
||||
destroyedLevel = 1.0;
|
||||
disabledLevel = 1.0;
|
||||
|
||||
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 = true;
|
||||
|
||||
hasLight = true;
|
||||
lightType = "PulsingLight";
|
||||
lightColor = "0.1 0.1 0.8 1.0";
|
||||
lightTime = "100";
|
||||
lightRadius = "3";
|
||||
|
||||
// humSound = GeneratorHumSound;
|
||||
|
||||
dynamicType = $TypeMasks::StaticShapeObjectType;
|
||||
deployedObject = true;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSwitchIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_switch_grey";
|
||||
targetNameTag = 'Deployed';
|
||||
targetTypeTag = 'Proximity Switch';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(ProximitySwitchDeployableImage) {
|
||||
mass = 1;
|
||||
shapeFile = "deploy_sensor_pulse.dts";
|
||||
scale = 2.5 / 3.85 @ " " @ 2.5 / 3.1 @ " " @ 5 / 3.1;
|
||||
item = ProximitySwitch;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedProximitySwitch;
|
||||
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;
|
||||
};
|
||||
|
||||
function ProximitySwitchDeployableImage::onMount(%data, %obj, %node) {
|
||||
%obj.hasProxSwitch = true; // set for PermSpherecheck
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function ProximitySwitchDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
%obj.hasProxSwitch = "";
|
||||
%obj.packSet = 0;
|
||||
%obj.expertSet = 0;
|
||||
}
|
||||
|
||||
function ProximitySwitchDeployableImage::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 = "1 1 1";
|
||||
|
||||
%deplObj = new (%className)() {
|
||||
dataBlock = "DeployedProximitySwitch";
|
||||
scale = %scale;
|
||||
};
|
||||
|
||||
//Set the range on this baby
|
||||
if (%plyr.packSet == 0)
|
||||
%deplObj.range = 2; //2 meter range
|
||||
if (%plyr.packSet == 1)
|
||||
%deplObj.range = 5; //5 meter range
|
||||
if (%plyr.packSet == 2)
|
||||
%deplObj.range = 10; //10 meter range
|
||||
if (%plyr.packSet == 3)
|
||||
%deplObj.range = 20; //20 meter range
|
||||
if (%plyr.packSet == 4)
|
||||
%deplObj.range = 40; //40 meter range
|
||||
if (%plyr.packSet == 5)
|
||||
%deplObj.range = 80; //80 meter range
|
||||
if (%plyr.packSet == 6)
|
||||
%deplObj.range = 160; //160 meter range
|
||||
|
||||
//Set the mode -- On or off?
|
||||
if (%plyr.expertSet == 0) {
|
||||
%deplObj.pwrmode = 0; //Turn generator on on entry
|
||||
%deplObj.buddyonly = 0;
|
||||
}
|
||||
if (%plyr.expertSet == 1) {
|
||||
%deplObj.pwrmode = 1; //Turn generator off on entry
|
||||
%deplObj.buddyonly = 0;
|
||||
}
|
||||
if (%plyr.expertSet == 2) {
|
||||
%deplObj.pwrmode = 0; //Turn generator on on entry
|
||||
%deplObj.buddyonly = 1;
|
||||
}
|
||||
if (%plyr.expertSet == 3) {
|
||||
%deplObj.pwrmode = 1; //Turn generator off on entry
|
||||
%deplObj.buddyonly = 1;
|
||||
}
|
||||
|
||||
if (%plyr.expertSet == 4) {
|
||||
%deplObj.pwrmode = 0; //Turn generator on on entry
|
||||
%deplObj.enemyonly = 1;
|
||||
}
|
||||
if (%plyr.expertSet == 5) {
|
||||
%deplObj.pwrmode = 1; //Turn generator off on entry
|
||||
%deplObj.enemyonly = 1;
|
||||
}
|
||||
|
||||
%deplObj.powerrange = 100;
|
||||
%deplObj.triggered = 0; //Nobody's in range.
|
||||
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
|
||||
// set power frequency
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
setTargetName(%deplObj.target,addTaggedString("Frequency" SPC %deplObj.powerFreq));
|
||||
|
||||
%deplObj.team = %plyr.client.team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
addDSurface(%item.surface,%deplObj);
|
||||
|
||||
if (%deplObj.getTarget() != -1)
|
||||
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
||||
|
||||
addToDeployGroup(%deplObj);
|
||||
|
||||
AIDeployObject(%plyr.client, %deplObj);
|
||||
|
||||
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
||||
|
||||
%deplObj.deploy();
|
||||
|
||||
%deplObj.playThread($AmbientThread, "ambient");
|
||||
|
||||
// %plyr.unmountImage(%slot);
|
||||
// %plyr.decInventory(%item.item, 1);
|
||||
schedule(128,0,ProximityCheck,%deplObj);
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function ProximityCheck(%theswitch) {
|
||||
//echo("TEST");
|
||||
if (!isObject(%theswitch)) //Do we still exist?
|
||||
return;
|
||||
|
||||
InitContainerRadiusSearch(%theswitch.getPosition(),%theswitch.range,$TypeMasks::PlayerObjectType);
|
||||
if (%theswitch.buddyonly == 1) {
|
||||
//echo("TEST");
|
||||
//OWNER ONLY
|
||||
%personcount = 0;
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
// Extra safety
|
||||
if (isbuddy(%theswitch.getOwner(),%obj.client) || %theswitch.getOwner() == %obj.client) {
|
||||
%personcount += 1;
|
||||
}
|
||||
}
|
||||
//echo(%personcount);
|
||||
|
||||
if (%personcount > 0 && !%theswitch.triggered) { //We have an owner here... (and we haven't already been triggered)
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,!%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 1;
|
||||
} else if (%personcount <= 0 && %theswitch.triggered) { //No owners around... and we're still triggered.
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (!isObject(%powerObj))
|
||||
continue;
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 0;
|
||||
}
|
||||
|
||||
} else if (%theswitch.enemyonly == 1) {
|
||||
|
||||
|
||||
//echo("TEST");
|
||||
//OWNER ONLY
|
||||
%personcount = 0;
|
||||
while((%obj = ContainerSearchNext()) != 0) {
|
||||
// Extra safety
|
||||
if (isenemy(%theswitch.getOwner(),%obj.client)) {
|
||||
%personcount += 1;
|
||||
}
|
||||
}
|
||||
//echo(%personcount);
|
||||
|
||||
if (%personcount > 0 && !%theswitch.triggered) { //We have an enemy here... and we're not triggered.
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,!%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 1;
|
||||
} else if (%personcount <= 0 && %theswitch.triggered) { //No owners around... but we're still triggered.
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (!isObject(%powerObj))
|
||||
continue;
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
//NON OWNER ONLY
|
||||
%containersearch = ContainerSearchNext();
|
||||
if (%containersearch != 0 && !%theswitch.triggered) { //There's at least one person within range and we haven't been triggered... no need to loop with non-owneronly.
|
||||
// if (%theswitch.triggered != 1) { //If we're not already active....
|
||||
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,!%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 1;
|
||||
|
||||
// }
|
||||
} else if (%containersearch == 0 && %theswitch.triggered) { //Nobody's around, but we're still triggered.
|
||||
// if (%theswitch.triggered != 0) { //If we're not already deactivated...
|
||||
|
||||
%count = getWordCount($PowerList);
|
||||
for(%i=0;%i<%count;%i++) {
|
||||
%powerObj = getWord($PowerList,%i);
|
||||
if (!isObject(%powerObj))
|
||||
continue;
|
||||
if (vectorDist(%theswitch.getPosition(),%powerObj.getPosition()) < %theswitch.powerrange
|
||||
&& !%powerObj.isRemoved && %theswitch.powerFreq == %powerObj.powerFreq
|
||||
&& %theswitch.team == %powerObj.team) {
|
||||
%r = forcePower(%powerObj,%theswitch.pwrmode);
|
||||
}
|
||||
}
|
||||
%theswitch.triggered = 0;
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
schedule(128,0,ProximityCheck,%theswitch);
|
||||
}
|
||||
594
Construction/scripts/Krypton/repairturret.cs
Normal file
594
Construction/scripts/Krypton/repairturret.cs
Normal file
|
|
@ -0,0 +1,594 @@
|
|||
// --------------------------------------------------------------
|
||||
// Repair Deployable Turret barrel
|
||||
// --------------------------------------------------------------
|
||||
|
||||
datablock AudioProfile(LifeTakerSwitchSound)
|
||||
{
|
||||
filename = "fx/weapons/generic_switch.wav";
|
||||
description = AudioClosest3d;
|
||||
preload = true;
|
||||
effect = LifeTakerSwitchEffect;
|
||||
};
|
||||
|
||||
datablock AudioProfile(LifeTakerFireSound)
|
||||
{
|
||||
filename = "fx/packs/repair_use.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
effect = LifeTakerFireEffect;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Projectile
|
||||
//--------------------------------------
|
||||
$TeamDeployableMax[repairTurretDeployable] = 100;
|
||||
|
||||
datablock ELFProjectileData(repairTurretBolt)
|
||||
{
|
||||
beamRange = 25; // z0dd - ZOD, 5/18/02. WHAT?? INCREASE ELF RANGE?!!? was 37
|
||||
numControlPoints = 8;
|
||||
restorativeFactor = 3.75;
|
||||
dragFactor = 4.5;
|
||||
endFactor = 2.25;
|
||||
randForceFactor = 2;
|
||||
randForceTime = 0.125;
|
||||
drainEnergy = 1.0;
|
||||
drainHealth = 0;
|
||||
directDamageType = $DamageType::repair;
|
||||
radiusDamageType = $DamageType::repair;
|
||||
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 = 1.1;
|
||||
lightningDist = 0.1; // distance of lightning from main beam
|
||||
|
||||
fireSound = LifeTakerFireSound;
|
||||
wetFireSound = LifeTakerFireSound;
|
||||
|
||||
textures[0] = "special/redbump2";
|
||||
textures[1] = "special/flare3";
|
||||
textures[2] = "special/BlueImpact";
|
||||
|
||||
emitter = TakerSparksEmitter;
|
||||
};
|
||||
|
||||
datablock TurretData(TurretDeployedrepair) : TurretDamageProfile
|
||||
{
|
||||
className = DeployedTurret;
|
||||
shapeFile = "turret_outdoor_deploy.dts";
|
||||
|
||||
rechargeRate = 0.15;
|
||||
|
||||
mass = 5.0;
|
||||
maxDamage = 3;
|
||||
destroyedLevel = 3;
|
||||
disabledLevel = 2.8;
|
||||
explosion = HandGrenadeExplosion;
|
||||
expDmgRadius = 5.0;
|
||||
expDamage = 0.3;
|
||||
expImpulse = 500.0;
|
||||
repairRate = 10;
|
||||
|
||||
deployedObject = true;
|
||||
|
||||
thetaMin = 0;
|
||||
thetaMax = 145;
|
||||
thetaNull = 90;
|
||||
|
||||
yawVariance = 30.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 30.0; // more or less just tolerances
|
||||
|
||||
isShielded = true;
|
||||
energyPerDamagePoint = 110;
|
||||
maxEnergy = 60;
|
||||
renderWhenDestroyed = true;
|
||||
barrel = repairBarrelLarge;
|
||||
heatSignature = 0;
|
||||
|
||||
canControl = true;
|
||||
cmdCategory = "DTactical";
|
||||
cmdIcon = CMDTurretIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_turret_grey";
|
||||
targetNameTag = 'repair';
|
||||
targetTypeTag = 'Turret';
|
||||
sensorData = DeployedOutdoorTurretSensor;
|
||||
sensorRadius = DeployedOutdoorTurretSensor.detectRadius;
|
||||
sensorColor = "191 0 226";
|
||||
|
||||
firstPersonOnly = true;
|
||||
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = TurretDebrisSmall;
|
||||
};
|
||||
//--------------------------------------------------------------------------
|
||||
// ELF Turret Image
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock TurretImageData(repairBarrelLarge){
|
||||
shapeFile = "turret_elf_large.dts";//"weapon_elf.dts";
|
||||
// ---------------------------------------------
|
||||
// z0dd - ZOD, 5/8/02. Incorrect parameter value
|
||||
//item = ELFBarrelLargePack;
|
||||
offset = "-0.1 -0.5 0";
|
||||
rotation = "0 1 0 90";
|
||||
item = TurretDeployedrepair;
|
||||
|
||||
projectile = BasicSniperShot;
|
||||
projectileType = SniperProjectile;
|
||||
deleteLastProjectile = true;
|
||||
usesEnergy = true;
|
||||
fireEnergy = 0.000001;
|
||||
minEnergy = 0.0000001;
|
||||
|
||||
// Turret parameters
|
||||
activationMS = 100;
|
||||
deactivateDelayMS = 100;
|
||||
thinkTimeMS = 100;
|
||||
degPerSecTheta = 580;
|
||||
degPerSecPhi = 960;
|
||||
attackRadius = 50;
|
||||
|
||||
yawVariance = 50.0; // these will smooth out the elf tracking code.
|
||||
pitchVariance = 50.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] = LifeTakerSwitchSound;
|
||||
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] = LifeTakerFireSound;
|
||||
stateScript[3] = "";
|
||||
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;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
datablock ShapeBaseImageData(repairTurretDeployableImage){
|
||||
mass = 15;
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
item = repairTurretDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = TurretDeployedrepair;
|
||||
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(repairTurretDeployable){
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "pack_deploy_turreti.dts";
|
||||
mass = 3.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = false;
|
||||
image = "repairTurretDeployableImage";
|
||||
pickUpName = "a repair turret pack";
|
||||
emap = true;
|
||||
};
|
||||
//////extra images
|
||||
datablock TurretImageData(repairBarrelLarge2) {
|
||||
shapeFile = "pack_upgrade_repair.dts";
|
||||
rotation = "0 1 0 90";
|
||||
offset = "-0.05 -0.95 0";
|
||||
|
||||
// State transiltions
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnNotLoaded[0] = "Dead";
|
||||
stateTransitionOnLoaded[0] = "ActivateReady";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateSequence[1] = "fire";
|
||||
stateSound[1] = RepairPackActivateSound;
|
||||
stateTransitionOnTriggerUp[1] = "Deactivate";
|
||||
|
||||
stateName[2] = "Deactivate";
|
||||
stateScript[2] = "onDeactivate";
|
||||
stateTransitionOnTimeout[2] = "Idle";
|
||||
};
|
||||
|
||||
datablock TurretImageData(repairBarrelLarge3) {
|
||||
shapeFile = "repair_kit.dts";
|
||||
rotation = "1 0 0 90";
|
||||
offset = "-0.26 -0.25 0.23";
|
||||
};
|
||||
|
||||
datablock TurretImageData(repairBarrelLarge4) {
|
||||
shapeFile = "repair_kit.dts";
|
||||
rotation = "1 0 0 90";
|
||||
offset = "-0.26 -0.25 -0.23";
|
||||
};
|
||||
datablock TurretImageData(repairBarrelLarge5) {
|
||||
shapeFile = "repair_patch.dts";
|
||||
rotation = "0 0 0";
|
||||
offset = "0.2 0.50 -0.185";
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
//functions
|
||||
////////////////////////////////////////////////////////////////
|
||||
function repairBarrelLarge::onMount(%this,%obj,%slot) {
|
||||
%obj.currentMuzzleSlot = 0;
|
||||
%obj.schedule(100,"mountImage",repairBarrelLarge2,1,true);
|
||||
%obj.schedule(100,"mountImage",repairBarrelLarge3,2,true);
|
||||
%obj.schedule(100,"mountImage",repairBarrelLarge4,3,true);
|
||||
%obj.schedule(100,"mountImage",repairBarrelLarge5,4,true);
|
||||
}
|
||||
function repairTurretDeployableImage::testNoTerrainFound(%item){
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function repairTurretDeployableImage::testNoInteriorFound(%item){
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function repairTurretDeployableImage::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.isrepair =1; //this is used whit the chek for target in turret.cs
|
||||
//to look for damaged stuf instead of enemy
|
||||
|
||||
%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 TurretDeployedrepair::onPickup(%this, %obj, %shape, %amount){
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function TurretDeployedrepair::onDestroyed(%this, %obj, %prevState) {
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
stopRepairing(%obj);
|
||||
%obj.errMsgSent = false;
|
||||
%obj.selfRepairing = false;
|
||||
%obj.repairing = 0;
|
||||
%obj.setImageLoaded(%slot, false);
|
||||
if (isobject(%obj.repairProjectile)){
|
||||
%obj.repairProjectile.schedule(100, "delete");
|
||||
%obj.repairProjectile=0;
|
||||
}
|
||||
if ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon) {
|
||||
%obj.isRemoved = true;
|
||||
$TeamDeployedCount[%obj.team, DiscTurretDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
}
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
}
|
||||
//function Deployedwaypoint::disassemble(%data, %plyr, %obj){ //What in the HELL is this doing here?
|
||||
// if (%obj.isRemoved)
|
||||
// return;
|
||||
//stopRepairing(%obj);
|
||||
// %obj.errMsgSent = false;
|
||||
// %obj.selfRepairing = false;
|
||||
// %obj.repairing = 0;
|
||||
// %obj.setImageLoaded(%slot, false);
|
||||
//if (isobject(%obj.repairProjectile)){
|
||||
// %obj.repairProjectile.schedule(100, "delete");
|
||||
// %obj.repairProjectile=0;
|
||||
// }
|
||||
// if ($Host::InvincibleDeployables != 1 || %obj.damageFailedDecon) {
|
||||
// %obj.isRemoved = true;
|
||||
// $TeamDeployedCount[%obj.team, DiscTurretDeployable]--;
|
||||
// remDSurface(%obj);
|
||||
// %obj.schedule(500, "delete");
|
||||
// }
|
||||
// Parent::onDestroyed(%this, %obj, %prevState);
|
||||
//}
|
||||
function validatetarget(%obj,%slot,%target){
|
||||
//used to make shure thers a clean line of sight betwin the object adn the target
|
||||
%muzVec = %obj.getMuzzleVector(%slot);
|
||||
%muzNVec = VectorNormalize(%muzVec);
|
||||
%repairRange = 30;
|
||||
%muzScaled = VectorScale(%muzNVec, %repairRange);
|
||||
%muzPoint = %obj.getMuzzlePoint(%slot);
|
||||
%rangeEnd = VectorAdd(%muzPoint, %muzScaled);
|
||||
|
||||
%searchMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType |
|
||||
$TypeMasks::StaticShapeObjectType | $TypeMasks::TurretObjectType |
|
||||
$TypeMasks::ItemObjectType | $TypeMasks::ForceFieldObjectType;
|
||||
|
||||
//AI hack to help "fudge" the repairing stuff...
|
||||
%scanTarg = ContainerRayCast(%muzPoint, %target.getposition(), %searchMasks, %obj);
|
||||
if (%scanTarg == %target ||%scanTarg ==0)
|
||||
return 1;
|
||||
else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
function startRepairing1(%obj,%slot)
|
||||
{
|
||||
// this = repairgunimage datablock
|
||||
// obj = player wielding the repair gun
|
||||
// slot = weapon slot
|
||||
|
||||
if(%obj.getEnergyLevel() <= 0)
|
||||
{
|
||||
stopRepairing(%obj);
|
||||
%obj.repairing="";
|
||||
return;
|
||||
}
|
||||
// reset the flag that indicates an error message has been sent
|
||||
%obj.errMsgSent = false;
|
||||
%target = %obj.repairing;
|
||||
if(!%target)
|
||||
{
|
||||
// no target -- whoops! never mind
|
||||
stopRepairing(%obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
//%target.repairedBy = %obj.client; //keep track of who last repaired this item
|
||||
if(%obj.repairing == %obj)
|
||||
{
|
||||
// player is self-repairing
|
||||
if(%obj.getDamageLevel())
|
||||
{
|
||||
if(!%obj.selfRepairing)
|
||||
{
|
||||
// no need for a projectile, just send a message and up the repair rate
|
||||
%obj.selfRepairing = true;
|
||||
startRepairing3(%obj, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stopRepairing(%obj);
|
||||
%obj.errMsgSent = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// make sure we still have a target -- more vector fun!!!
|
||||
%muzVec = %obj.getMuzzleVector(%slot);
|
||||
%muzNVec = VectorNormalize(%muzVec);
|
||||
%repairRange = 30;
|
||||
%muzScaled = VectorScale(%muzNVec, %repairRange);
|
||||
%muzPoint = %obj.getMuzzlePoint(%slot);
|
||||
%rangeEnd = VectorAdd(%muzPoint, %muzScaled);
|
||||
|
||||
%searchMasks = $TypeMasks::PlayerObjectType | $TypeMasks::VehicleObjectType |
|
||||
$TypeMasks::StaticShapeObjectType | $TypeMasks::TurretObjectType |
|
||||
$TypeMasks::ItemObjectType | $TypeMasks::ForceFieldObjectType;
|
||||
|
||||
//AI hack to help "fudge" the repairing stuff...
|
||||
%scanTarg = ContainerRayCast(%muzPoint, %rangeEnd, %searchMasks, %obj);
|
||||
if (%scanTarg)
|
||||
{
|
||||
if (%scanTarg.getType() & $TypeMasks::ForceFieldObjectType)
|
||||
{
|
||||
if (%scanTarg.getDataBlock().getName() $= "DeployedForceField2")
|
||||
{
|
||||
%pos = getWords(%scanTarg, 1, 3);
|
||||
%scanTarg = %scanTarg.parent SPC %pos;
|
||||
}
|
||||
else
|
||||
%scanTarg = "0";
|
||||
}
|
||||
}
|
||||
if (%scanTarg)
|
||||
{
|
||||
%pos = getWords(%scanTarg, 1, 3);
|
||||
%obstructMask = $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
||||
%obstruction = ContainerRayCast(%muzPoint, %pos, %obstructMask, %obj);
|
||||
if (%obstruction)
|
||||
%scanTarg = "0";
|
||||
}
|
||||
if (%scanTarg && %scanTarg2)
|
||||
%scanTarg = %scanTarg2;
|
||||
|
||||
if(%scanTarg)
|
||||
{
|
||||
// there's still a target out there
|
||||
%repTgt = firstWord(%scanTarg);
|
||||
// is the target damaged?
|
||||
if(%repTgt.getDamageLevel())
|
||||
{
|
||||
if(%repTgt != %obj.repairing)
|
||||
{
|
||||
// the target is not the same as the one we were just repairing
|
||||
// stop repairing old target, start repairing new target
|
||||
stopRepairing(%obj);
|
||||
if(isObject(%obj.repairing))
|
||||
stopRepairing(%obj);
|
||||
%obj.repairing = %repTgt;
|
||||
// extract the name of what player is repairing based on what it is
|
||||
// if it's a player, it's the player's name (duh)
|
||||
// if it's an object, look for a nametag
|
||||
// if object has no nametag, just say what it is (e.g. generatorLarge)
|
||||
if(%repTgt.getClassName() $= Player)
|
||||
%tgtName = getTaggedString(%repTgt.client.name);
|
||||
else if(%repTgt.getGameName() !$= "")
|
||||
%tgtName = %repTgt.getGameName();
|
||||
else
|
||||
%tgtName = %repTgt.getDatablock().getName();
|
||||
startRepairing3(%obj, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// it's the same target as last time
|
||||
// changed to fix "2 players can't repair same object" bug
|
||||
if (%obj.repairProjectile!=0){
|
||||
if (isobject(%obj.repairProjectile))
|
||||
%obj.repairProjectile.schedule(100, "delete");
|
||||
%obj.repairProjectile=0;
|
||||
}
|
||||
if(%obj.repairProjectile == 0)
|
||||
{
|
||||
if(%repTgt.getClassName() $= Player)
|
||||
%tgtName = getTaggedString(%repTgt.client.name);
|
||||
else if(%repTgt.getGameName() !$= "")
|
||||
%tgtName = %repTgt.getGameName();
|
||||
else
|
||||
%tgtName = %repTgt.getDatablock().getName();
|
||||
startRepairing3(%obj, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%rateOfRepair = %this.repairFactorObject;
|
||||
if(%repTgt.getClassName() $= Player)
|
||||
{
|
||||
%tgtName = getTaggedString(%repTgt.client.name);
|
||||
%rateOfRepair = %this.repairFactorPlayer;
|
||||
}
|
||||
else if(%repTgt.getGameName() !$= "")
|
||||
%tgtName = %repTgt.getGameName();
|
||||
else
|
||||
%tgtName = %repTgt.getDatablock().getName();
|
||||
if(%repTgt == %obj.repairing)
|
||||
{
|
||||
// same target, but not damaged -- we must be done
|
||||
Game.objectRepaired(%repTgt, %tgtName);
|
||||
}
|
||||
%obj.errMsgSent = true;
|
||||
stopRepairing(%obj);
|
||||
}
|
||||
}
|
||||
else
|
||||
stopRepairing(%obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function startRepairing3(%player, %self)
|
||||
{
|
||||
// %player = the player who was using the repair pack
|
||||
// %self = boolean -- is player repairing him/herself?
|
||||
|
||||
if(%self)
|
||||
{
|
||||
// one repair, hold the projectile
|
||||
%player.setRepairRate(%player.getRepairRate() + 0.0025);
|
||||
%player.selfRepairing = true;
|
||||
%player.repairingRate = 0.0025;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
%initialDirection = %player.getMuzzleVector(0);
|
||||
%initialPosition = %player.getMuzzlePoint(0);
|
||||
|
||||
%repRate = 0.005;
|
||||
%player.repairing.setRepairRate(%repRate);
|
||||
|
||||
%player.repairingRate = %repRate;
|
||||
|
||||
if (%player.repairing.getDataBlock().getName() $= "DeployedForceField")
|
||||
%targetObject = %player.repairing.field;
|
||||
else
|
||||
%targetObject = %player.repairing;
|
||||
%player.repairProjectile = new RepairProjectile() {
|
||||
dataBlock = DefaultRepairBeam;
|
||||
initialDirection = %initialDirection;
|
||||
initialPosition = %initialPosition;
|
||||
sourceObject = %player;
|
||||
sourceSlot = 0;
|
||||
targetObject = %targetObject;
|
||||
};
|
||||
MissionCleanup.add(%player.repairProjectile);
|
||||
}
|
||||
}
|
||||
198
Construction/scripts/Krypton/savesystem.cs
Normal file
198
Construction/scripts/Krypton/savesystem.cs
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
function KryptonClientSave(%cl,%name) {
|
||||
|
||||
if (%name $= "")
|
||||
%name = "default";
|
||||
|
||||
echo("Krypton Save System -- Saving for GUID: " @ %cl.guid);
|
||||
|
||||
%origCl = %cl;
|
||||
if (!isObject(%cl)) {
|
||||
if (isObject(nameToID(LocalClientConnection))) {
|
||||
%cl = nameToID(LocalClientConnection);
|
||||
}
|
||||
else {
|
||||
if ($CurrentClientId) {
|
||||
%cl = $CurrentClientId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//There has to be a better way to get all pieces than to have a huge radius....
|
||||
%rad = 99999999;
|
||||
|
||||
%buildingCount = 0;
|
||||
|
||||
//Is the client alive? Save relative to their position.
|
||||
if (isObject(%cl.getControlObject())) {
|
||||
%pos = %cl.getControlObject().getPosition();
|
||||
}
|
||||
|
||||
//No? Just use the center of the map.
|
||||
if (!%pos) {
|
||||
%pos = "0 0 0";
|
||||
}
|
||||
%filepath = "Saves" @ "/" @ %cl.guid @ "/" @ %name @ ".cs";
|
||||
new FileObject("SaveFile"); //create file object (player's save file)
|
||||
SaveFile.openForWrite(%filepath); //open it up, and create it if it isn't there
|
||||
SaveFile.writeLine("// KRYPTON MOD SAVE FILE -- This probably isn't compatible with other mods without intense modification.");
|
||||
SaveFile.writeLine("// Saved by \"" @ getField(%cl.nameBase,0) @ "\"");
|
||||
SaveFile.writeLine("// Created in mission \"" @ $MissionName @ "\"");
|
||||
SaveFile.writeLine("// Krypton Advanced Save System");
|
||||
SaveFile.writeLine("");
|
||||
|
||||
initContainerRadiusSearch(%pos,%rad,$TypeMasks::StaticShapeObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::ItemObjectType);
|
||||
while((%obj = containerSearchNext()) != 0) {
|
||||
if (%obj.getowner() != %cl) //We only want THIS guy's pieces.
|
||||
continue;
|
||||
|
||||
// echo("DEBUG: Saving " @ %obj.getDatablock().getName());
|
||||
if (SavePiece(%obj)) {
|
||||
|
||||
new FileObject("SaveTemp2"); //Open the temporary save file..
|
||||
SaveTemp2.openForRead("piecetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!SaveTemp2.isEOF()) {
|
||||
%currentline = SaveTemp2.readLine();
|
||||
SaveFile.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
SaveTemp2.close(); //close the file
|
||||
SaveTemp2.delete(); //delete the object (not the file)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SaveFile.close(); //close the file
|
||||
SaveFile.delete(); //delete the object (not the file)
|
||||
|
||||
compile(%filepath);
|
||||
return %file;
|
||||
}
|
||||
|
||||
function SavePiece(%obj) //Code for saving a specific piece to a temporary location.
|
||||
{
|
||||
new FileObject("PieceTemp"); //create file object (player's save file)
|
||||
PieceTemp.openForWrite("piecetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
%datablockname = %obj.getDatablock().getName();
|
||||
if (%datablockname $= "TelePadBeam" || %datablockname $= "DeployedLTarget" || %datablockname $= "DeployedOOSphere" || %datablockname $= "DeployedPeaceSphere" || %datablockname $= "DeployedCombatSphere" || %datablockname $= "DeployableVehiclePadBottom" || %datablockname $= "DeployableVehiclePad" || %datablockname $= "DeployableVehiclePad2" || %datablockname $= "EnergizerLight" || %datablockname $= "DeployedEnergizer" || %datablockname $= "Mpm_Beacon_Ghost" || %datablockname $= "Mpm_Beacon") { //The ignore list.
|
||||
PieceTemp.close(); //close the file
|
||||
PieceTemp.delete(); //delete the object (not the file)
|
||||
return false; //We don't save these.
|
||||
}
|
||||
|
||||
%obj.nameTag = ""; //This variable causes problems... so we just remove it.
|
||||
%obj.save("savetemp.txt"); //Save the piece to a temporary file...
|
||||
|
||||
new FileObject("SaveTemp"); //Open the temporary save file..
|
||||
SaveTemp.openForRead("savetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!SaveTemp.isEOF()) {
|
||||
%currentline = SaveTemp.readLine();
|
||||
if (getSubStr( %currentline, 0, 3 ) $= "new")
|
||||
%currentline = "%piece = " @ %currentline; //Make sure we can run stuff on this deployable later.
|
||||
if (getSubStr( %currentline, 0, 2 ) $= "//")
|
||||
%currentline = "//-----------------"; //Change comments into lines...
|
||||
if (strstr(strlwr(%currentline),"tagged") >= 0)
|
||||
%currentline = ""; //Remove these weird "tagged" variables that break things.
|
||||
PieceTemp.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
PieceTemp.writeLine("%piece.onLoad();"); //Read and copy to player save.
|
||||
SaveTemp.close(); //close the file
|
||||
SaveTemp.delete(); //delete the object (not the file)
|
||||
|
||||
//TIME FOR SOME EXCEPTIONS!
|
||||
if (%datablockname $= "DeployableVehicleStation") {
|
||||
//Save the pad
|
||||
%obj.pad.nameTag = ""; //This variable causes problems... so we just remove it.
|
||||
%obj.pad.save("savetemp.txt"); //Save the piece to a temporary file...
|
||||
new FileObject("SaveTemp"); //Open the temporary save file..
|
||||
SaveTemp.openForRead("savetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!SaveTemp.isEOF()) {
|
||||
%currentline = SaveTemp.readLine();
|
||||
if (getSubStr( %currentline, 0, 3 ) $= "new")
|
||||
%currentline = "%piece.pad = " @ %currentline; //Make sure we can run stuff on this deployable later.
|
||||
if (getSubStr( %currentline, 0, 2 ) $= "//")
|
||||
%currentline = "//-----------------"; //Change comments into lines...
|
||||
PieceTemp.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
PieceTemp.writeLine("%piece.pad.onLoad();"); //Read and copy to player save.
|
||||
PieceTemp.writeLine("%piece.pad.station = %piece;"); //Associate the pad with the station.
|
||||
PieceTemp.writeLine("%piece.trigger.mainObj = %piece.pad;"); //Associate the pad with the station.
|
||||
PieceTemp.writeLine("%piece.trigger.disableObj = %piece;"); //Associate the pad with the station.
|
||||
|
||||
|
||||
SaveTemp.close(); //close the file
|
||||
SaveTemp.delete(); //delete the object (not the file)
|
||||
|
||||
//Save the main pad... "back"
|
||||
%obj.pad.back.nameTag = ""; //This variable causes problems... so we just remove it.
|
||||
%obj.pad.back.save("savetemp.txt"); //Save the piece to a temporary file...
|
||||
new FileObject("SaveTemp"); //Open the temporary save file..
|
||||
SaveTemp.openForRead("savetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!SaveTemp.isEOF()) {
|
||||
%currentline = SaveTemp.readLine();
|
||||
if (getSubStr( %currentline, 0, 3 ) $= "new")
|
||||
%currentline = "%piece.pad.back = " @ %currentline; //Make sure we can run stuff on this deployable later.
|
||||
if (getSubStr( %currentline, 0, 2 ) $= "//")
|
||||
%currentline = "//-----------------"; //Change comments into lines...
|
||||
PieceTemp.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
PieceTemp.writeLine("%piece.pad.back.onLoad();"); //Read and copy to player save.
|
||||
PieceTemp.writeLine("%piece.pad.back.station = %piece;"); //Associate the pad with the station.
|
||||
PieceTemp.writeLine("adjustTrigger(%sv);");
|
||||
SaveTemp.close(); //close the file
|
||||
SaveTemp.delete(); //delete the object (not the file)
|
||||
}
|
||||
|
||||
//Target thing, too? Decoration packs should work with this...
|
||||
if (isobject(%obj.lTarget) && %datablockname !$= "DeployedEscapePod") {
|
||||
//Save the target pad
|
||||
%obj.lTarget.nameTag = ""; //This variable causes problems... so we just remove it.
|
||||
%obj.lTarget.save("savetemp.txt"); //Save the piece to a temporary file...
|
||||
new FileObject("SaveTemp"); //Open the temporary save file..
|
||||
SaveTemp.openForRead("savetemp.txt"); //open it up, and create it if it isn't there
|
||||
|
||||
while (!SaveTemp.isEOF()) {
|
||||
%currentline = SaveTemp.readLine();
|
||||
if (getSubStr( %currentline, 0, 3 ) $= "new")
|
||||
%currentline = "%piece.lTarget = " @ %currentline; //Make sure we can run stuff on this deployable later.
|
||||
if (getSubStr( %currentline, 0, 2 ) $= "//")
|
||||
%currentline = "//-----------------"; //Change comments into lines...
|
||||
PieceTemp.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
PieceTemp.writeLine("%piece.lTarget.onLoad();"); //Read and copy to player save.
|
||||
PieceTemp.writeLine("%piece.lTarget.lMain = %piece;"); //Associate the pad with the deployable.
|
||||
|
||||
SaveTemp.close(); //close the file
|
||||
SaveTemp.delete(); //delete the object (not the file)
|
||||
|
||||
|
||||
}
|
||||
|
||||
PieceTemp.close(); //close the file
|
||||
PieceTemp.delete(); //delete the object (not the file)
|
||||
return true;
|
||||
} //End function
|
||||
|
||||
|
||||
function automagicBackup(%client)
|
||||
{
|
||||
|
||||
%counter=deployables.getcount();
|
||||
for (%n=0;%n<%counter;%n++) {
|
||||
%obj = deployables.getObject(%n);
|
||||
if (%obj.getOwner() == %client)
|
||||
%piececount++;
|
||||
}
|
||||
|
||||
if (%piececount > 1) {
|
||||
KryptonClientSave(%client,"backup");
|
||||
messageclient(%client,'MsgClient',"Automagic backup file saved.");
|
||||
}
|
||||
|
||||
cancel(%client.automagicschedule);
|
||||
%client.automagicschedule = schedule(3*60*1000,0,automagicBackup,%client);
|
||||
}
|
||||
82
Construction/scripts/Krypton/theoremchat.cs
Normal file
82
Construction/scripts/Krypton/theoremchat.cs
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
// Weather Getter For Theorem, using accuweather.com RSS feeds.
|
||||
// Originally written by Electricutioner, modified by Sloik.
|
||||
// 2/11/2008
|
||||
|
||||
// Structural Infinity enabled clients are able to see over 1024
|
||||
// objects. Don't sweat the details, little monkey.
|
||||
|
||||
|
||||
function GetTheoremConnection::onLine(%this, %line)
|
||||
{
|
||||
if ((getSubStr(%line,0,1) !$="#") && (trim(%line) $= "" || getSubStr(%line,0,1) !$= "$"))
|
||||
{
|
||||
//echo("Trimline");
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 1;
|
||||
return;
|
||||
}
|
||||
if (getSubStr(%line, 0, 1) $= "#")
|
||||
{
|
||||
//echo("EOF");
|
||||
%line = trim(getSubStr(%line, 1, strLen(%line) - 1));
|
||||
if (getWord(%line, 0) $= "EOF")
|
||||
{
|
||||
GetTheoremConnection.disconnect();
|
||||
exec($GetTheorem::AutoUpdate::Destination);
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 0;
|
||||
$alreadydownloading = 0; //Free our download space.
|
||||
$dlsuccess[$GetTheorem::AutoUpdate::DLid] = 1; //Success!
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ($GetTheorem::AutoUpdate::BeginWriting)
|
||||
{
|
||||
//echo("Autoupdatebeginwriting");
|
||||
new FileObject("File");
|
||||
File.openForAppend($GetTheorem::AutoUpdate::Destination);
|
||||
File.writeLine(%line);
|
||||
File.close();
|
||||
File.delete();
|
||||
}
|
||||
}
|
||||
|
||||
function GetTheorem_autoUpdate(%theid,%thetxt,%thedlid)
|
||||
{
|
||||
//echo("Autoupdate");
|
||||
%path = "/~hayden/Theorem/src/theorem.php?id=" @ %theid @ "&input=" @ %thetxt;
|
||||
|
||||
// form the HTTP request
|
||||
%data = "GET" SPC %path SPC "HTTP/1.1\x0aHost: mcafeeweb.webhop.net";
|
||||
|
||||
//complete the connection
|
||||
if (!isObject(GetTheoremConnection))
|
||||
new TCPObject(GetTheoremConnection);
|
||||
|
||||
$GetTheorem::AutoUpdate::BeginWriting = 0;
|
||||
$GetTheorem::AutoUpdate::Destination = "scripts/chat/theoremchat" @ %theid @ ".cs";
|
||||
$GetTheorem::AutoUpdate::DLid = %thedlid;
|
||||
deleteFile("scripts/chat/theoremchat" @ %theid @ ".cs");
|
||||
deleteFile("scripts/chat/theoremchat" @ %theid @ ".cs.dso");
|
||||
|
||||
GetTheoremConnection.connect("mcafeeweb.webhop.net:80");
|
||||
//echo("Connect");
|
||||
GetTheoremConnection.schedule(750, send, %data, "\x0A", "\x0A");
|
||||
schedule(5000, 0, checkdownloadsuccess , %thedlid); //In five seconds, we give up. Theorem should try and reconnect on his own.
|
||||
GetTheoremConnection.schedule(5000, disconnect);
|
||||
}
|
||||
|
||||
function GetTheorem_doAutoUpdate(%theid,%thetxt)
|
||||
{
|
||||
if ($alreadydownloading == 0 || $alreadydownloading $= "") { //Make sure nobody else is downloading.
|
||||
$alreadydownloading = 1; //Reserve our download space.
|
||||
$theoremresponse[%theid] = "";
|
||||
echo("Downloading Theorem response");
|
||||
%thetxt = strreplace(%thetxt, " ", "%20");
|
||||
GetTheorem_autoUpdate(%theid,%thetxt,$DLid);
|
||||
$dlsuccess[$DLid] = 0;
|
||||
$DLid += 1; //More IDs!
|
||||
} else { //Someone else is downloading... try again in a few seconds.
|
||||
schedule(3000, 0, GetTheorem_doAutoUpdate); //Try again in 3-5 seconds.
|
||||
echo("Waiting our turn...");
|
||||
}
|
||||
return;
|
||||
}
|
||||
90
Construction/scripts/Krypton/undosystem.cs
Normal file
90
Construction/scripts/Krypton/undosystem.cs
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
function saveundofile(%client)
|
||||
{
|
||||
if (!isObject(%client)) //Client doesn't exist?
|
||||
return;
|
||||
|
||||
%client.undodelpieces = ""; //Reset delete file
|
||||
|
||||
//echo("DEBUG: Saving undo file for " @ %client.nameBase);
|
||||
//Create the undo save file
|
||||
%filepath = "playerprefs/undo/" @ %client.guid @ ".cs";
|
||||
new FileObject("UndoFile"); //create file object (player's save file)
|
||||
UndoFile.openForWrite(%filepath); //open it up, and create it if it isn't there
|
||||
UndoFile.writeLine("// KRYPTON MOD UNDO FILE -- Last pieces modified by this user that can be undone.");
|
||||
UndoFile.writeLine("// Saved by \"" @ getField(%client.nameBase,0) @ "\"");
|
||||
UndoFile.writeLine("");
|
||||
|
||||
%count = getFieldCount( %client.undopieces );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%piece = getField( %client.undopieces, %i );
|
||||
// echo("DEBUG: Saving a piece..." @ %piece.getDatablock().getName());
|
||||
if (SavePiece(%piece)) {
|
||||
new FileObject("UndoTemp"); //Open the temporary save file..
|
||||
UndoTemp.openForRead("piecetemp.txt"); //open it up, and create it if it isn't there
|
||||
while (!UndoTemp.isEOF()) {
|
||||
%currentline = UndoTemp.readLine();
|
||||
UndoFile.writeLine(%currentline); //Read and copy to player save.
|
||||
}
|
||||
UndoTemp.close(); //close the file
|
||||
UndoTemp.delete(); //delete the object (not the file)
|
||||
|
||||
addDeletePiece(%client,%piece);
|
||||
|
||||
} else {
|
||||
// echo("DEBUG: Piece rejected.");
|
||||
}
|
||||
}
|
||||
|
||||
UndoFile.close(); //Close file
|
||||
UndoFile.delete(); //Delete object.
|
||||
|
||||
|
||||
%client.undopieces = ""; //Reset client's undo piece list.
|
||||
}
|
||||
|
||||
function addUndoPiece(%client,%obj)
|
||||
{
|
||||
%count = getFieldCount( %client.undopieces );
|
||||
|
||||
if ( %count == 0 )
|
||||
%client.undopieces = %obj;
|
||||
else
|
||||
%client.undopieces = %client.undopieces TAB %obj;
|
||||
|
||||
}
|
||||
|
||||
function addDeletePiece(%client,%obj)
|
||||
{
|
||||
%count = getFieldCount( %client.undodelpieces );
|
||||
|
||||
if ( %count == 0 )
|
||||
%client.undodelpieces = %obj;
|
||||
else
|
||||
%client.undodelpieces = %client.undodelpieces TAB %obj;
|
||||
|
||||
}
|
||||
|
||||
function loadUndoFile(%client)
|
||||
{
|
||||
%filepath = "playerprefs/undo/" @ %client.guid @ ".cs";
|
||||
exec(%filepath);
|
||||
schedule(10000,0,delDupPieces,0,0,true);
|
||||
schedule(10000,0,clientPowerCheck,%client);
|
||||
|
||||
|
||||
%count = getFieldCount( %client.undodelpieces );
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%piece = getField( %client.undodelpieces, %i );
|
||||
if (isObject(%piece))
|
||||
%piece.getDataBlock().disassemble(%client.player,%piece);
|
||||
}
|
||||
%client.undodelpieces = "";
|
||||
//Clear the undo file
|
||||
new FileObject("UndoDelCheck"); //create file object
|
||||
UndoDelCheck.openForWrite(%filepath); //open it up, and create it if it isn't there
|
||||
UndoDelCheck.close(); //Close file
|
||||
UndoDelCheck.delete(); //Delete object.
|
||||
}
|
||||
133
Construction/scripts/Krypton/vehiclewarp.cs
Normal file
133
Construction/scripts/Krypton/vehiclewarp.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
//Particle Effects and crap like that
|
||||
datablock ParticleData(WarpParticle)
|
||||
{
|
||||
dragCoeffiecient = 0.0;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.0;
|
||||
|
||||
lifetimeMS = 3000;
|
||||
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] = "1.0 0.3 0.3 1";
|
||||
colors[3] = "1.0 0.3 0.3 0.1";
|
||||
|
||||
sizes[0] = 5;
|
||||
sizes[1] = 6;
|
||||
sizes[2] = 8;
|
||||
sizes[3] = 15;
|
||||
|
||||
times[0] = 0.25;
|
||||
times[1] = 0.5;
|
||||
times[2] = 0.75;
|
||||
times[3] = 1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
datablock ParticleEmitterData(WarpEmitter)
|
||||
{
|
||||
// lifetimeMS = 10;
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
|
||||
ejectionVelocity = 0.01;
|
||||
velocityVariance = 0.0;
|
||||
ejectionoffset = 5;
|
||||
thetaMin = 80.0;
|
||||
thetaMax = 100.0;
|
||||
|
||||
phiReferenceVel = "180";
|
||||
phiVariance = "5";
|
||||
orientParticles = false;
|
||||
orientOnVelocity = true;
|
||||
|
||||
particles = "WarpParticle";
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(WarpEmitMount)
|
||||
{
|
||||
className = WeaponImage;
|
||||
shapeFile = "turret_Muzzlepoint.dts";
|
||||
offset = "0.0 4.0 0.0 ";
|
||||
rotation = "0 0 0 1";
|
||||
|
||||
stateName[0] = "Activate";
|
||||
stateEmitter[0] = WarpEmitter; // Particle Emitter
|
||||
stateEmitterNode[0] = Muzzlepoint1; // Just keep this the same
|
||||
stateEmitterTime[0] = 99999; // Time in seconds (forever?)
|
||||
};
|
||||
|
||||
|
||||
//Now for the solid code...
|
||||
|
||||
function toggleSuperWarp(%obj)
|
||||
{
|
||||
if (%obj.warping $= "" || %obj.warping == 0) {
|
||||
%obj.player = %obj.getMountedObject(0);
|
||||
%obj.client = %obj.player.client;
|
||||
schedule(3000,0,SuperWarpLoop,%obj);
|
||||
%obj.warping = 0.5;
|
||||
|
||||
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
|
||||
if (%obj.getMountNodeObject(%i)) {
|
||||
%passenger = %obj.getMountNodeObject(%i);
|
||||
commandToClient(%passenger.client, 'BottomPrint', "Initiating Slipstream Warp in 3 Seconds...", 2, 3);
|
||||
}
|
||||
|
||||
serverPlay3D(SatchelChargeActivateSound, %obj.getTransform());
|
||||
} else if (%obj.warping == 1) {
|
||||
|
||||
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
|
||||
if (%obj.getMountNodeObject(%i)) {
|
||||
%passenger = %obj.getMountNodeObject(%i);
|
||||
commandToClient(%passenger.client, 'BottomPrint', "Slipstream Warp Disabling...", 2, 3);
|
||||
}
|
||||
|
||||
%obj.warping = 2;
|
||||
}
|
||||
}
|
||||
|
||||
function SuperWarpLoop(%obj)
|
||||
{
|
||||
%vec = vectorNormalize(%obj.getForwardVector());
|
||||
if (%obj.warping == 0)
|
||||
return;
|
||||
|
||||
if (%obj.warping == 2) {
|
||||
if (%obj.warpdistance $= "")
|
||||
%obj.warpdistance = 150;
|
||||
|
||||
%obj.warpdistance -= 2;
|
||||
%newposition = Vectoradd(%obj.getPosition(),VectorScale(%vec,%obj.warpdistance));
|
||||
%obj.setPosition(%newposition);
|
||||
if (%obj.warpdistance <= 2) {
|
||||
%obj.unmountImage(7);
|
||||
%obj.warping = 0;
|
||||
%obj.warpdistance = "";
|
||||
} else {
|
||||
schedule(50,0,SuperWarpLoop,%obj);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (%obj.warping == 0.5)
|
||||
%obj.mountImage(WarpEmitMount, 7);
|
||||
|
||||
%obj.warping = 1;
|
||||
%newposition = Vectoradd(%obj.getPosition(),VectorScale(%vec,150));
|
||||
%obj.setPosition(%newposition);
|
||||
schedule(50,0,SuperWarpLoop,%obj);
|
||||
|
||||
for(%i = 0; %i < %obj.getDatablock().numMountPoints; %i++)
|
||||
if (%obj.getMountNodeObject(%i)) {
|
||||
%passenger = %obj.getMountNodeObject(%i);
|
||||
%passenger.setWhiteOut(0.8);
|
||||
}
|
||||
|
||||
}
|
||||
2072
Construction/scripts/Krypton/zombies.cs
Normal file
2072
Construction/scripts/Krypton/zombies.cs
Normal file
File diff suppressed because it is too large
Load diff
795
Construction/scripts/MPM/MPM.cs
Normal file
795
Construction/scripts/MPM/MPM.cs
Normal 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
Construction/scripts/MPM/MPM_AE.cs
Normal file
705
Construction/scripts/MPM/MPM_AE.cs
Normal 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;
|
||||
}
|
||||
1639
Construction/scripts/MPM/MPM_Blast.cs
Normal file
1639
Construction/scripts/MPM/MPM_Blast.cs
Normal file
File diff suppressed because it is too large
Load diff
185
Construction/scripts/MPM/MPM_Launch.cs
Normal file
185
Construction/scripts/MPM/MPM_Launch.cs
Normal 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
Construction/scripts/MPM/MPM_base.cs
Normal file
2320
Construction/scripts/MPM/MPM_base.cs
Normal file
File diff suppressed because it is too large
Load diff
272
Construction/scripts/MPM/Mpm_BE.cs
Normal file
272
Construction/scripts/MPM/Mpm_BE.cs
Normal 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
Construction/scripts/MPM/Mpm_SE.cs
Normal file
766
Construction/scripts/MPM/Mpm_SE.cs
Normal 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
Construction/scripts/MPM/Mpm_TE.cs
Normal file
193
Construction/scripts/MPM/Mpm_TE.cs
Normal 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
Construction/scripts/MPM/Mpm_VE.cs
Normal file
205
Construction/scripts/MPM/Mpm_VE.cs
Normal 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
Construction/scripts/MPM/Nuclear_blast.cs
Normal file
1356
Construction/scripts/MPM/Nuclear_blast.cs
Normal file
File diff suppressed because it is too large
Load diff
2587
Construction/scripts/MPM/Nuke_Cannon.cs
Normal file
2587
Construction/scripts/MPM/Nuke_Cannon.cs
Normal file
File diff suppressed because it is too large
Load diff
1227
Construction/scripts/MTC_ai.cs
Normal file
1227
Construction/scripts/MTC_ai.cs
Normal file
File diff suppressed because it is too large
Load diff
1482
Construction/scripts/MTC_core.cs
Normal file
1482
Construction/scripts/MTC_core.cs
Normal file
File diff suppressed because it is too large
Load diff
531
Construction/scripts/MTC_eWeap.cs
Normal file
531
Construction/scripts/MTC_eWeap.cs
Normal 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
Construction/scripts/MTC_level.cs
Normal file
41
Construction/scripts/MTC_level.cs
Normal 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
Construction/scripts/MTC_weap.cs
Normal file
1334
Construction/scripts/MTC_weap.cs
Normal file
File diff suppressed because it is too large
Load diff
2763
Construction/scripts/OptionsDlg.cs
Normal file
2763
Construction/scripts/OptionsDlg.cs
Normal file
File diff suppressed because it is too large
Load diff
70
Construction/scripts/QuanFuncs.cs
Normal file
70
Construction/scripts/QuanFuncs.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//These functions brought to you by Quantium X
|
||||
|
||||
function mountLaser(%client)
|
||||
{
|
||||
%plyr = %client.client.player;
|
||||
%client = %client.client;
|
||||
if(%client.laserMode != 1)
|
||||
%client.laserMode++;
|
||||
else
|
||||
%client.laserMode = 0;
|
||||
|
||||
valLaser(%client);
|
||||
}
|
||||
function valLaser(%client) {
|
||||
%plyr = %client.player;
|
||||
if(%client.laserMode == 1 && isPlayer(%plyr)) {
|
||||
messageClient(%client,0,'\c2Laser set to : Full-On.');
|
||||
%p = new TargetProjectile(){
|
||||
dataBlock = "AimingLaser" @ %client.lasercolor;
|
||||
initialDirection = %plyr.getMuzzleVector($WeaponSlot);
|
||||
initialPosition = %plyr.getMuzzlePoint($WeaponSlot);
|
||||
sourceObject = %plyr;
|
||||
sourceSlot = $WeaponSlot;
|
||||
vehicleObject = %vehicle;
|
||||
};
|
||||
MissionCleanup.add(%p);
|
||||
%plyr.attachedLaser = %p;
|
||||
%plyr.laserActive = 1;
|
||||
}
|
||||
else if(%client.laserMode == 2) {
|
||||
messageClient(%client,0,'\c2Laser set to : Auto.');
|
||||
if(isObject(%plyr.attachedLaser))
|
||||
%plyr.attachedLaser.delete();
|
||||
%plyr.laserActive = 0;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
messageClient(%client,0,'\c2Laser set to : Off.');
|
||||
if(isObject(%plyr.attachedLaser))
|
||||
%plyr.attachedLaser.delete();
|
||||
%plyr.laserActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
datablock TargetProjectileData(DeathBeam)
|
||||
{
|
||||
directDamage = 0.0;
|
||||
hasDamageRadius = false;
|
||||
indirectDamage = 0.0;
|
||||
damageRadius = 0.0;
|
||||
velInheritFactor = 1.0;
|
||||
|
||||
maxRifleRange = 1000;
|
||||
beamColor = "0.0 0.9 0.0";
|
||||
|
||||
startBeamWidth = 0.04;
|
||||
pulseBeamWidth = 0.04;
|
||||
beamFlareAngle = 3.0;
|
||||
minFlareSize = 0.0;
|
||||
maxFlareSize = 200.0;
|
||||
pulseSpeed = 6.0;
|
||||
pulseLength = 0.150;
|
||||
|
||||
textureName[0] = "special/nonlingradient";
|
||||
textureName[1] = "special/flare";
|
||||
textureName[2] = "special/pulse";
|
||||
textureName[3] = "skins/glow_red";
|
||||
beacon = true;
|
||||
};
|
||||
31
Construction/scripts/TR2Game.cs
Normal file
31
Construction/scripts/TR2Game.cs
Normal 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
Construction/scripts/admin.cs
Normal file
612
Construction/scripts/admin.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
1073
Construction/scripts/aiDefaultTasks.cs
Normal file
1073
Construction/scripts/aiDefaultTasks.cs
Normal file
File diff suppressed because it is too large
Load diff
1502
Construction/scripts/aiInventory.cs
Normal file
1502
Construction/scripts/aiInventory.cs
Normal file
File diff suppressed because it is too large
Load diff
1
Construction/scripts/chat/chat.txt
Normal file
1
Construction/scripts/chat/chat.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
This is where Theorem's chat responses would go.
|
||||
966
Construction/scripts/chatCommands.cs
Normal file
966
Construction/scripts/chatCommands.cs
Normal file
|
|
@ -0,0 +1,966 @@
|
|||
function chatcommands(%sender, %message) {
|
||||
%cmd=getWord(%message,0);
|
||||
%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";
|
||||
call(%cmd,%sender,%args);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
//Krypton Armor Commands
|
||||
//----------------------------------------
|
||||
function ccvoicepitch(%sender,%args) { //voicepitch command -- Changes sender's voice pitch.
|
||||
%sender.voicePitch = %args;
|
||||
}
|
||||
|
||||
function cctogglerace(%sender,%args) { //togglerace command -- Changes sender's race.
|
||||
serverCmdToggleRace(%sender);
|
||||
}
|
||||
|
||||
function cctogglearmor(%sender,%args) { //togglearmor command -- Changes sender's armor.
|
||||
serverCmdToggleArmor(%sender);
|
||||
}
|
||||
|
||||
function cctogglegender(%sender,%args) { //Togglegender command -- Changes sender's gender.
|
||||
serverCmdToggleGender(%sender);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
//Krypton Deployable Commands
|
||||
//----------------------------------------
|
||||
function ccobjectscale(%sender,%args) { //Setsize function located in metalfuncs.cs
|
||||
%cmd2="ccsetsize";
|
||||
call(%cmd2,%sender,%args,2);
|
||||
}
|
||||
|
||||
function ccobjectname(%sender,%args) { //name function located in metalfuncs.cs
|
||||
%cmd2="ccname";
|
||||
call(%cmd2,%sender,%args);
|
||||
}
|
||||
//GIVE ORPHAN FUNCTION in METALFUNCS.CS
|
||||
function ccdelpieces(%sender,%args) { //Delete somebody's pieces. Main function in metalfuncs.cs.
|
||||
%cmd2="ccgiveorphan";
|
||||
call(%cmd2,%sender,%args,1);
|
||||
}
|
||||
function ccgivepieces(%sender,%args) { //Give your pieces to somebody. Main function in metalfuncs.cs.
|
||||
messageClient(%sender,0,'\c2Press F2 and select Krypton Player List to give pieces.');
|
||||
}
|
||||
function ccdelmypieces(%sender,%args) { //Delete my pieces. Main function in metalfuncs.cs
|
||||
schedule(2500,0,deleteClientPieces,%sender); //Kill them pieces!
|
||||
}
|
||||
function ccpower(%sender,%args) { //Set power frequency.
|
||||
if(%args <= 0)
|
||||
return true;
|
||||
|
||||
%sender.player.powerFreq = %args;
|
||||
messageClient(%sender,0,'\c2Power frequency is now set to %1 .',%args);
|
||||
return true;
|
||||
}
|
||||
function ccpwr(%sender,%args) { //Set power frequency.
|
||||
%cmd2="ccpower";
|
||||
call(%cmd2,%sender,%args);
|
||||
}
|
||||
function ccpowerradius(%sender,%args) { //Set generator power radius
|
||||
if (%args > 1000 || %args < 1) {
|
||||
messageClient(%sender,0,'\c2You have specified an invalid power range. Must be below 1000.');
|
||||
return;
|
||||
}
|
||||
%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);
|
||||
|
||||
%obj.powerRadius = %args;
|
||||
%obj.powerrange = %args;
|
||||
clientPowerCheck(%sender);
|
||||
messageClient(%sender,0,'\c2Power radius is now set to %1 .',%args);
|
||||
}
|
||||
|
||||
function ccswitchrange(%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);
|
||||
%obj.switchRadius = %args;
|
||||
|
||||
messageClient(%sender,0,'\c2Switch radius is now set to %1 .',%args);
|
||||
}
|
||||
|
||||
function ccproximityrange(%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);
|
||||
%obj.range = %args;
|
||||
|
||||
messageClient(%sender,0,'\c2Proximity radius is now set to %1 .',%args);
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
//Krypton Administrator Commands
|
||||
//-------------------------------------
|
||||
function ccgoto(%sender,%args) { //Goto other player's location -- Adminstrator only
|
||||
if(!%sender.isAdmin) {
|
||||
messageClient(%sender,0,'\c2Admin only!!');
|
||||
return true;
|
||||
}
|
||||
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++) //Run through player list....
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if (strstr(strlwr(%args),strlwr(%cl.nameBase)) >= 0) {
|
||||
if (strlen(%thevictim) < strlen(%cl)) { //Longest name I can find
|
||||
%thevictim = %cl; //See if this guy's name was mentioned.
|
||||
}
|
||||
}
|
||||
}
|
||||
%sendname = %thevictim;
|
||||
if(!isObject(%sendname)) {
|
||||
messageClient(%sender,0,'\c2Player %1 not found!',%name);
|
||||
return true;
|
||||
}
|
||||
// if (getDistance3D(%sender.player.getPosition(), %sendname.player.getPosition()) >= 600) {
|
||||
// messageClient(%sender,0,'\c2Player %1 is too far away.',%sendname.nameBase);
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
%sender.player.setPosition(VectorAdd(%sendname.player.getPosition(),"0 2 0"));
|
||||
return true;
|
||||
}
|
||||
|
||||
function ccgivevip(%sender,%args)
|
||||
{
|
||||
if (!%sender.isSuperAdmin) {
|
||||
messageClient(%sender,0,'\c2Admin only command.');
|
||||
return true;
|
||||
}
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++) //Run through player list....
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if (strstr(strlwr(%args),strlwr(%cl.nameBase)) >= 0) {
|
||||
if (strlen(%thevictim) < strlen(%cl)) { //Longest name I can find
|
||||
%thevictim = %cl; //See if this guy's name was mentioned.
|
||||
}
|
||||
}
|
||||
}
|
||||
%sendname = %thevictim;
|
||||
if(!isObject(%sendname)) {
|
||||
messageClient(%sender,0,'\c2Player %1 not found!',%name);
|
||||
return true;
|
||||
}
|
||||
TheoremMsg(%sendname.nameBase @ " has gained VIP armor!", "gui/command_on.wav");
|
||||
%sendname.viparmorenabled = 1;
|
||||
updateprefs(%sendname);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
|
||||
function ccsummon(%sender,%args) { //Summon other players to current location -- Administrator Only
|
||||
if(!%sender.isAdmin) {
|
||||
messageClient(%sender,0,'\c2Admin only!!');
|
||||
return true;
|
||||
}
|
||||
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++) //Run through player list....
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if (strstr(strlwr(%args),strlwr(%cl.nameBase)) >= 0) {
|
||||
if (strlen(%thevictim) < strlen(%cl)) { //Longest name I can find
|
||||
%thevictim = %cl; //See if this guy's name was mentioned.
|
||||
}
|
||||
}
|
||||
}
|
||||
%sendname = %thevictim;
|
||||
|
||||
if(!isObject(%sendname)) {
|
||||
messageClient(%sender,0,'\c2Player %1 not found!',%name);
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------
|
||||
|
||||
// if (getDistance3D(%sender.player.getPosition(), %sendname.player.getPosition()) >= 600) {
|
||||
//messageClient(%sender,0,'\c2Player %1 is too far away.',%sendname.nameBase);
|
||||
//return true;
|
||||
//}
|
||||
|
||||
%sendname.player.setPosition(VectorAdd(%sender.player.getPosition(),"0 2 0"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
function cctrans(%sender,%args) {
|
||||
if (%sender.isAdmin)
|
||||
%sender.player.setTransform(%args);
|
||||
return true;
|
||||
}
|
||||
|
||||
function ccjointeam(%sender,%args) {
|
||||
if (isObject(%sender.player) && (%args > 0 && %args < 6)) {
|
||||
Game.clientChangeTeam( %sender, %args );
|
||||
%group = nameToID("MissionCleanup/Deployables");
|
||||
%count = %group.getCount();
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%obj = %group.getObject(%i);
|
||||
if (%obj.getOwner() == %sender) {
|
||||
%obj.team = %args;
|
||||
setTargetSensorGroup(%obj.getTarget(),%args);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
messageclient(%sender, 'MsgClient', "\c2Invalid team, or attempted to switch while in observer mode.");
|
||||
}
|
||||
}
|
||||
|
||||
function ccshowowner(%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.getOwner();
|
||||
messageclient(%sender, 'MsgClient', "\c2This object belongs to " @ %owner.nameBase);
|
||||
if (%sender.isAdmin) {
|
||||
messageclient(%sender, 'MsgClient', "\c2ClientID #: " @ %owner);
|
||||
messageclient(%sender, 'MsgClient', "\c2GUID #: " @ %owner.guid);
|
||||
messageclient(%sender, 'MsgClient', "\c2Team #: " @ %obj.team);
|
||||
}
|
||||
}
|
||||
|
||||
function ccsetteam(%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.getOwner();
|
||||
if (%sender.isAdmin) {
|
||||
%obj.team = %args;
|
||||
setTargetSensorGroup(%obj.getTarget(),%args);
|
||||
messageclient(%sender, 'MsgClient', "\c2Team #: " @ %obj.team);
|
||||
}
|
||||
}
|
||||
|
||||
function ccadminatv(%sender,%args) {
|
||||
if(!%sender.isAdmin)
|
||||
return;
|
||||
|
||||
createtheatv(%sender);
|
||||
}
|
||||
|
||||
function ccpm(%sender,%args) {
|
||||
echo("PM!");
|
||||
%themsg = %args;
|
||||
if (getSubStr(%args,0,1) $= "!")
|
||||
%themsg = strreplace(%args,"!",""); //Remove the !
|
||||
|
||||
%recep = getWord(%themsg, 0); //Get the intended recipient
|
||||
echo(%themsg);
|
||||
|
||||
//for(%i = 0; %i < ClientGroup.getCount(); %i++) //Run through player list....
|
||||
// {
|
||||
//%cl = ClientGroup.getObject(%i);
|
||||
//if (strstr(strlwr(%recep),strlwr(%cl.nameBase)) >= 0) {
|
||||
//if (%cl != $tid) //If it's not theorem...
|
||||
//if (strlen(%thevictim.nameBase) < strlen(%cl.nameBase)) { //Longest name I can find
|
||||
//%thevictim = %cl; //See if this guy's name was mentioned.
|
||||
//}
|
||||
//}
|
||||
//}
|
||||
%thevictim = plnametocid(%recep);
|
||||
|
||||
if (%thevictim != 0) { //Did we find a victim?
|
||||
%finalmsg = getSubStr(%themsg,strlen(getWord(%themsg, 0)),strlen(%themsg) - strlen(getWord(%themsg, 0)));
|
||||
messageClient(%sender,0,"\c4To \c1" @ %thevictim.nameBase @ "\c4: " @ %finalmsg);
|
||||
messageClient(%thevictim,0,"\c4From \c1" @ %sender.nameBase @ "\c4: " @ %finalmsg);
|
||||
} else {
|
||||
messageClient(%sender,0,"\c2Could not find player " @ %recep @ ". Make sure you type the FULL name, not including clan tags.");
|
||||
}
|
||||
}
|
||||
|
||||
function ccdelete(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return;
|
||||
|
||||
%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);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%className = %dataBlock.className;
|
||||
%cash = %obj.amount;
|
||||
%owner = %obj.getOwner();
|
||||
|
||||
%obj.mountable = 0;
|
||||
%obj.startFade( 1000, 0, true );
|
||||
%obj.schedule(1001, "delete");
|
||||
}
|
||||
|
||||
function ccMe(%sender, %args)
|
||||
{
|
||||
SwearFilter(%sender,%args);
|
||||
RepeatFilter(%sender,%args);
|
||||
CapsFilter(%sender,%args);
|
||||
messageAll('MsgClient', getTaggedString(%sender.name) SPC %args);
|
||||
}
|
||||
|
||||
function ccaidpulse(%sender,%args)
|
||||
{
|
||||
if (%sender.pulselimit == 0) {
|
||||
%plyr = %sender.player;
|
||||
Aidpulse(%plyr.getPosition(),%plyr,RepairPulseProjectile,%plyr.getRotation());
|
||||
if (!%sender.isAdmin) {
|
||||
%sender.pulselimit = 1;
|
||||
schedule(30*1000,0,resetpulse,%sender);
|
||||
}
|
||||
} else {
|
||||
messageclient(%sender,'MsgClient',"\c3Aid pulses can only be used every 30 seconds.");
|
||||
}
|
||||
}
|
||||
|
||||
function resetpulse(%sender)
|
||||
{
|
||||
%sender.pulselimit = 0;
|
||||
}
|
||||
|
||||
function cchover(%sender)
|
||||
{
|
||||
%plyr = %sender.player;
|
||||
if(%sender.player.on)
|
||||
hoverPackOff(%sender.player);
|
||||
else
|
||||
hoverPackOn(%sender.player);
|
||||
}
|
||||
|
||||
function cczombieattack(%sender,%args)
|
||||
{
|
||||
if (%sender.isAdmin)
|
||||
{
|
||||
if ($ZombiesEnabled == 0) {
|
||||
$ZombiesEnabled = 1;
|
||||
ZombieLoop();
|
||||
$endzombietimer = schedule(1000*60*%args,0,EndZombies);
|
||||
messageclient(%sender,'msgclient',"\c2" @ %args @ " minute zombie attack started.");
|
||||
} else {
|
||||
messageclient(%sender,'msgclient',"\c2Zombies are already enabled.");
|
||||
}
|
||||
} else {
|
||||
messageclient(%sender,'msgclient',"\c2You must be an admin to use this command.");
|
||||
}
|
||||
}
|
||||
|
||||
function ccswitchdelay(%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);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%className = %dataBlock.className;
|
||||
%cash = %obj.amount;
|
||||
%owner = %obj.getOwner();
|
||||
if (%obj.getowner() == %sender){
|
||||
%obj.switchTimedDelay = %args;
|
||||
}
|
||||
}
|
||||
|
||||
function cca(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
if (%obj.isAdmin) {
|
||||
//messageClient(%sender,0,"\c4Admin Message- \c1" @ %sender.nameBase @ "\c4: " @ %args);
|
||||
messageClient(%obj,0,"\c2[ADMIN] \c1" @ %sender.nameBase @ "\c4: " @ %args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ccann( %sender,%args )
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return;
|
||||
%lines = 3;
|
||||
%time = getWordcount(%args) + 3;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if( !%cl.isAIControlled() ) {
|
||||
messageClient(%cl,0,"\c2[Announcement] \c1" @ %sender.nameBase @ "\c4: " @ %args);
|
||||
commandToClient( %cl, 'bottomPrint', "<color:ffa800><font:Impact:19>[ Announcement ]\n<color:00d914><font:Arial:17>" @ %sender.nameBase @ ":<color:00ccff><font:Arial:18> " @ %args, %time, %lines );
|
||||
}
|
||||
}
|
||||
messageAll("snd","~wgui/launchMenuOver.wav");
|
||||
}
|
||||
|
||||
function ccwarn(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return;
|
||||
%cl = plnametocid(getword(%args,0));
|
||||
if (!isObject(%cl))
|
||||
return;
|
||||
commandToClient( %cl, 'centerPrint', "<color:ff0000><font:Impact:19>[ ! You Have Been Warned For Inappropriate Behavior ! ]\n<color:ffa800><font:Impact:16>Cease immediately or consequences will follow.", 10, 2 );
|
||||
messageClient(%cl,"snd","~wfx/Bonuses/Nouns/shark.wav");
|
||||
messageAll("snd","\c2" @ %cl.nameBase @ " has been warned for inapropriate behavior.~wfx/Bonuses/Nouns/shark.wav");
|
||||
}
|
||||
|
||||
function ccexecute(%sender,%args)
|
||||
{
|
||||
if (!%sender.isSuperAdmin)
|
||||
return;
|
||||
|
||||
%themsg = %args;
|
||||
if (getSubStr(%args,0,1) $= "@")
|
||||
%themsg = strreplace(%args,"@",""); //Remove the !
|
||||
%themsg = strreplace(%themsg,"%sender",%sender); //Replace %sender with client ID.
|
||||
echo("Command executed by client " @ %sender);
|
||||
echo("Command: " @ %themsg);
|
||||
eval(%themsg);
|
||||
}
|
||||
|
||||
function cczombiespeed(%sender,%args)
|
||||
{
|
||||
if (%sender.isAdmin) {
|
||||
$Zombie::ForwardSpeed = %args;
|
||||
}
|
||||
}
|
||||
|
||||
function cczombiedelay(%sender,%args)
|
||||
{
|
||||
if (%sender.isAdmin) {
|
||||
$ZombieDelay = %args*1000;
|
||||
}
|
||||
}
|
||||
|
||||
function ccendzombies(%sender)
|
||||
{
|
||||
if (%sender.isAdmin) {
|
||||
cancel($endzombietimer);
|
||||
EndZombies();
|
||||
}
|
||||
}
|
||||
|
||||
function ccsave(%sender,%args)
|
||||
{
|
||||
%args = strreplace( %args, " ", "_" );
|
||||
%args = strreplace( %args, "/", "" );
|
||||
%args = strreplace( %args, "\\", "" );
|
||||
KryptonClientSave(%sender,%args);
|
||||
|
||||
messageclient(%sender,0,"\c2Pieces Saved As: " @ %args);
|
||||
}
|
||||
|
||||
//function ccload(%sender,%args)
|
||||
//{
|
||||
//exec("Saves" @ "/" @ %sender.guid @ "/" @ %args @ ".cs");
|
||||
//}
|
||||
|
||||
function ccaway(%sender)
|
||||
{
|
||||
setaway(%sender);
|
||||
}
|
||||
|
||||
function ccgetposition(%sender)
|
||||
{
|
||||
%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);
|
||||
|
||||
messageclient(%sender,0,"\c2Object position: " @ %obj.getPosition());
|
||||
}
|
||||
|
||||
function ccmove(%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 (!isObject(%obj)) {
|
||||
messageclient(%sender,0,"\c2No object found. Operation cancelled.");
|
||||
return;
|
||||
}
|
||||
|
||||
%datablockname = %obj.getDatablock().getName();
|
||||
if (%datablockname $= "DeployedOOSphere" || %datablockname $= "DeployedPeaceSphere" || %datablockname $= "DeployedCombatSphere") {
|
||||
messageclient(%sender,0,"\c2Nice try, anus.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%obj.getOwner() != %sender && !%sender.isAdmin) {
|
||||
messageclient(%sender,0,"\c2This piece is not yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
%objpos = %obj.getPosition();
|
||||
|
||||
%origx = getWord(%objpos,0);
|
||||
%origy = getWord(%objpos,1);
|
||||
%origz = getWord(%objpos,2);
|
||||
|
||||
//if ((getWord(%args,0) < -1000 || getWord(%args,0) > 1000) || (getWord(%args,1) < -1000 || getWord(%args,1) > 1000) || (getWord(%args,2) < -1000 || getWord(%args,2) > 1000)) {
|
||||
//messageclient(%sender,0,"\c2Invalid size specified. Max movement distance is 1000 meters. Syntax: /move X Y Z");
|
||||
//return;
|
||||
//}
|
||||
|
||||
%newx = %origx + getWord(%args,0);
|
||||
%newy = %origy + getWord(%args,1);
|
||||
%newz = %origz + getWord(%args,2);
|
||||
|
||||
//Save to undo file...
|
||||
addUndoPiece(%sender,%obj);
|
||||
saveundofile(%sender);
|
||||
|
||||
%obj.setPosition(%newx SPC %newy SPC %newz);
|
||||
|
||||
messageclient(%sender,0,"\c2Object has been repositioned.");
|
||||
}
|
||||
|
||||
|
||||
function cccloak(%sender)
|
||||
{
|
||||
%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 (!isObject(%obj)) {
|
||||
messageclient(%sender,0,"\c2No object found. Operation cancelled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%obj.getOwner() != %sender) {
|
||||
messageclient(%sender,0,"\c2This piece is not yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
//if (%obj.isCloaked $= "")
|
||||
|
||||
if (%obj.isCloaked) {
|
||||
%obj.setcloaked(0);
|
||||
%obj.isCloaked = 0;
|
||||
} else {
|
||||
%obj.setcloaked(1);
|
||||
%obj.isCloaked = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function ccmoveall(%sender,%args)
|
||||
{
|
||||
%xamt = GetWord(%args,0);
|
||||
%yamt = GetWord(%args,1);
|
||||
%zamt = GetWord(%args,2);
|
||||
|
||||
//if (%xamt > 1000 || %yamt > 1000 || %zamt > 1000 || %xamt < -1000 || %yamt < -1000 || %zamt < -1000) {
|
||||
//messageclient(%sender,0,"\c2Invalid size specified. Max movement distance is 1000 meters. Syntax: /moveall X Y Z");
|
||||
//return;
|
||||
//}
|
||||
|
||||
%group = nameToID("MissionCleanup/Deployables");
|
||||
%count = %group.getCount();
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%obj = %group.getObject(%i);
|
||||
if (%obj.getOwner() == %sender) {
|
||||
%datablockname = %obj.getDatablock().getName();
|
||||
if (%datablockname $= "DeployedOOSphere" || %datablockname $= "DeployedPeaceSphere" || %datablockname $= "DeployedCombatSphere")
|
||||
continue;
|
||||
%objpos = %obj.getPosition();
|
||||
%currentx = getWord(%objpos,0);
|
||||
%currenty = getWord(%objpos,1);
|
||||
%currentz = getWord(%objpos,2);
|
||||
%obj.setPosition((%currentx + %xamt) SPC (%currenty + %yamt) SPC (%currentz + %zamt));
|
||||
}
|
||||
}
|
||||
|
||||
messageclient(%sender,0,"\c2All deployables moved.");
|
||||
}
|
||||
|
||||
function ccundo(%sender)
|
||||
{
|
||||
//Load the UNDO file.
|
||||
loadUndoFile(%sender);
|
||||
}
|
||||
|
||||
|
||||
/////// RESIZING FUNCTION
|
||||
function ccsetsize(%sender, %args, %special) {
|
||||
/////////
|
||||
%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 (%obj <1)
|
||||
return;
|
||||
%objScale = getwords(%obj.getScale(),0,2);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%name = %dataBlock.getname();
|
||||
%className = %dataBlock.className;
|
||||
|
||||
|
||||
if (!isObject(%obj)) {
|
||||
messageclient(%sender,'MsgClient',"\c2No object specified.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%sender != %obj.getOwner()) {
|
||||
messageclient(%sender,'MsgClient',"\c2This object isn't yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
//if ((getword(%args,0) > 0.01 && getword(%args,0) < 500) && (getword(%args,1) > 0.01 && getword(%args,1) < 500) && (getword(%args,2) > 0.01 && getword(%args,2) < 500)) {
|
||||
//Save to undo file...
|
||||
addUndoPiece(%sender,%obj);
|
||||
saveundofile(%sender);
|
||||
|
||||
%obj.setrealsize(%args);
|
||||
//}
|
||||
//else
|
||||
//messageclient(%sender,'MsgClient',"\c2Invalid setsize proportions specified.");
|
||||
}
|
||||
|
||||
function ccgetsize(%sender)
|
||||
{
|
||||
%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 (%obj <1)
|
||||
return;
|
||||
%objScale = getwords(%obj.getScale(),0,2);
|
||||
%dataBlock = %obj.getDataBlock();
|
||||
%name = %dataBlock.getname();
|
||||
%className = %dataBlock.className;
|
||||
|
||||
if (!isObject(%obj)) {
|
||||
messageclient(%sender,'MsgClient',"\c2No object specified.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%sender != %obj.getOwner()) {
|
||||
messageclient(%sender,'MsgClient',"\c2This object isn't yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
messageclient(%sender,'MsgClient',"\c2Size: " @ %obj.getrealsize());
|
||||
}
|
||||
|
||||
//NAMING FUNCTION
|
||||
function ccname(%sender,%args, %special) {
|
||||
%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 (%obj.getowner() != %sender){
|
||||
messageclient(%sender, 'MsgClient', "\c2You do not own this.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%obj.dassembling == 1) {
|
||||
messageclient(%sender, 'MsgClient', "\c2Cannot name objects that are disassembling.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%className $= "Generator" || %className $= "Switch"){
|
||||
%obj.nametag = %args;
|
||||
%freq = %obj.powerfreq;
|
||||
if (%obj.getPoweredState() == 1 && %obj.isSwitchedOff != 1)
|
||||
setTargetName(%obj.target,addTaggedString("\c8"@%args@"\c6"));
|
||||
else if (%obj.getPoweredState() == 0 || %obj.isSwitchedOff == 1)
|
||||
setTargetName(%obj.target,addTaggedString("\c6Disabled \c8"@%args@"\c6"));
|
||||
|
||||
%obj.label = %args;
|
||||
return;
|
||||
}
|
||||
|
||||
else if (%className $= "teleport"){
|
||||
%freq = %obj.Frequency;
|
||||
%obj.nametag = %args;
|
||||
setTargetName(%wp.target,"\c8"@%args);
|
||||
return;
|
||||
}
|
||||
else if (%className $= "waypoint"){
|
||||
%obj.wp.schedule(10, "delete");
|
||||
%wp = new (WayPoint)(){
|
||||
dataBlock = WayPointMarker;
|
||||
position = %obj.getPosition();
|
||||
name = %args;
|
||||
scale = "0.1 0.1 0.1";
|
||||
team = getRandom(0,2);
|
||||
};
|
||||
MissionCleanup.add(%wp);
|
||||
%obj.wp=%wp;
|
||||
%obj.wpname = %args;
|
||||
return;
|
||||
}
|
||||
else
|
||||
setTargetName(%obj.target,addTaggedString("\c8"@%args@"\c6"));
|
||||
%obj.label = %args;
|
||||
}
|
||||
|
||||
|
||||
function ccwhois(%sender,%args)
|
||||
{
|
||||
if (!%sender.isAdmin)
|
||||
return;
|
||||
|
||||
%thevictim = plnametocid(%args);
|
||||
|
||||
if (!isObject(%thevictim)) {
|
||||
messageclient(%sender, 'MsgClient', "\c2Could not find player " @ %args @ ".");
|
||||
return;
|
||||
}
|
||||
|
||||
messageclient(%sender, 'MsgClient', "\c2Name: " @ %thevictim.nameBase);
|
||||
messageclient(%sender, 'MsgClient', "\c2Client ID: " @ %thevictim);
|
||||
messageclient(%sender, 'MsgClient', "\c2GUID: " @ %thevictim.guid);
|
||||
messageclient(%sender, 'MsgClient', "\c2IP Address: " @ %thevictim.getAddress());
|
||||
|
||||
}
|
||||
|
||||
function ccaccept(%client)
|
||||
{
|
||||
if (%client.giverequest !$= "" && isObject(%client.giverequest)) { //Giver is alive and well.
|
||||
givethepieces(%client.giverequest,%client);
|
||||
|
||||
%client.giverequest = "";
|
||||
} else {
|
||||
messageclient(%client, 'MsgClient', "\c2Error whilst accepting pieces. Either you did not recieve a request, or the giver is not present.");
|
||||
%client.giverequest = "";
|
||||
}
|
||||
}
|
||||
|
||||
function ccdecline(%client)
|
||||
{
|
||||
if (%client.giverequest !$= "") {
|
||||
messageclient(%client, 'MsgClient', "\c2The piece transfer request has been declined.");
|
||||
messageclient(%client.giverequest, 'MsgClient', "\c2The piece transfer request has been declined.");
|
||||
%client.giverequest = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function givethepieces(%from,%to)
|
||||
{
|
||||
//--
|
||||
%group = nameToID("MissionCleanup/Deployables");
|
||||
%count = %group.getCount();
|
||||
for (%i=0;%i<%count;%i++) {
|
||||
%obj = %group.getObject(%i);
|
||||
if (%obj.getOwner() == %from) {
|
||||
%obj.setOwner(%to.player);
|
||||
%obj.setOwnerClient(%to);
|
||||
}
|
||||
}
|
||||
//--
|
||||
messageclient(%from, 'MsgClient', "\c2You gave "@%to.nameBase@" all of your deployables.");
|
||||
messageclient(%to, 'MsgClient', "\c2You received all of " @ %from.nameBase @ "'s deployables.");
|
||||
}
|
||||
|
||||
|
||||
function ccsettargetingmode(%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);
|
||||
|
||||
%obj.firemode = %args;
|
||||
}
|
||||
|
||||
|
||||
function ccinspect(%sender)
|
||||
{
|
||||
%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);
|
||||
messageclient(%sender, 'MsgClient', "\c2Object ID: " @ %obj);
|
||||
}
|
||||
|
||||
|
||||
function ccmoveme(%sender,%args) {
|
||||
if (!%sender.isAdmin)
|
||||
return false;
|
||||
|
||||
|
||||
%objpos = %sender.player.getPosition();
|
||||
|
||||
%origx = getWord(%objpos,0);
|
||||
%origy = getWord(%objpos,1);
|
||||
%origz = getWord(%objpos,2);
|
||||
|
||||
%newx = %origx + getWord(%args,0);
|
||||
%newy = %origy + getWord(%args,1);
|
||||
%newz = %origz + getWord(%args,2);
|
||||
|
||||
|
||||
%sender.player.setPosition(%newx SPC %newy SPC %newz);
|
||||
}
|
||||
|
||||
function ccfade(%sender) { //Base code contributed by retribution
|
||||
%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 (!isObject(%obj)) {
|
||||
messageclient(%sender,0,"\c2No object found. Operation cancelled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%obj.getOwner() != %sender) {
|
||||
messageclient(%sender,0,"\c2This piece is not yours.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (%obj.isFaded) {
|
||||
%obj.startfade(1000,0,0);
|
||||
%obj.isFaded = 0;
|
||||
} else {
|
||||
%obj.startfade(1000,0,1);
|
||||
%obj.isFaded = 1;
|
||||
}
|
||||
}
|
||||
|
||||
function ccrot(%sender,%args)
|
||||
{
|
||||
%sender.player.rotationamount = %args;
|
||||
messageclient(%sender,0,"\c2Rotation angle set to: " @ %args @ " degrees.");
|
||||
}
|
||||
|
||||
function ccsubmit(%sender,%args)
|
||||
{
|
||||
wget("http://mcafeeweb.webhop.net/~hayden/Theorem/submitidea.php?guid="@%sender.guid@"&msg="@javaURLencode(%args),"submission.cs");
|
||||
echo("http://mcafeeweb.webhop.net/~hayden/Theorem/submitidea.php?guid="@%sender.guid@"&msg="@javaURLencode(%args));
|
||||
deleteFile("submission.cs");
|
||||
messageclient(%sender,0,"\c2Submission sent.");
|
||||
}
|
||||
2132
Construction/scripts/client.cs
Normal file
2132
Construction/scripts/client.cs
Normal file
File diff suppressed because it is too large
Load diff
1606
Construction/scripts/controlDefaults.cs
Normal file
1606
Construction/scripts/controlDefaults.cs
Normal file
File diff suppressed because it is too large
Load diff
291
Construction/scripts/dEffects.cs
Normal file
291
Construction/scripts/dEffects.cs
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
// 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 AudioProfile(SingeTargetSound)
|
||||
{
|
||||
filename = "fx/misc/nexus_idle.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
effect = ELFGunFireEffect;
|
||||
};
|
||||
|
||||
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 = "SingeTargetSound";
|
||||
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 = "SingeTargetSound";
|
||||
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);
|
||||
}
|
||||
}
|
||||
756
Construction/scripts/damageTypes.cs
Normal file
756
Construction/scripts/damageTypes.cs
Normal file
|
|
@ -0,0 +1,756 @@
|
|||
//--------------------------------------------------------------------------
|
||||
// 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;
|
||||
|
||||
$DamageType::Zombie = 55;
|
||||
|
||||
// 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
Construction/scripts/deathMessages.cs
Normal file
420
Construction/scripts/deathMessages.cs
Normal 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.';
|
||||
5208
Construction/scripts/defaultGame.cs
Normal file
5208
Construction/scripts/defaultGame.cs
Normal file
File diff suppressed because it is too large
Load diff
2263
Construction/scripts/deployables.cs
Normal file
2263
Construction/scripts/deployables.cs
Normal file
File diff suppressed because it is too large
Load diff
1437
Construction/scripts/do_not_delete/Dfunctions.cs
Normal file
1437
Construction/scripts/do_not_delete/Dfunctions.cs
Normal file
File diff suppressed because it is too large
Load diff
BIN
Construction/scripts/do_not_delete/MergeToolSupport.cs.dso
Normal file
BIN
Construction/scripts/do_not_delete/MergeToolSupport.cs.dso
Normal file
Binary file not shown.
113
Construction/scripts/editor.cs
Normal file
113
Construction/scripts/editor.cs
Normal 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
Construction/scripts/expertLibraries.cs
Normal file
148
Construction/scripts/expertLibraries.cs
Normal 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
Construction/scripts/forceField.cs
Normal file
290
Construction/scripts/forceField.cs
Normal 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
Construction/scripts/functions.cs
Normal file
1034
Construction/scripts/functions.cs
Normal file
File diff suppressed because it is too large
Load diff
147
Construction/scripts/gameBase.cs
Normal file
147
Construction/scripts/gameBase.cs
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
|
||||
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 InteriorInstance::damage()
|
||||
{
|
||||
}
|
||||
|
||||
function TerrainBlock::damage()
|
||||
{
|
||||
}
|
||||
|
||||
function WaterBlock::damage() {
|
||||
}
|
||||
|
||||
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
Construction/scripts/hazard.cs
Normal file
134
Construction/scripts/hazard.cs
Normal 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
Construction/scripts/hfunctions.cs
Normal file
106
Construction/scripts/hfunctions.cs
Normal 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;
|
||||
};
|
||||
1933
Construction/scripts/hud.cs
Normal file
1933
Construction/scripts/hud.cs
Normal file
File diff suppressed because it is too large
Load diff
1019
Construction/scripts/inventory.cs
Normal file
1019
Construction/scripts/inventory.cs
Normal file
File diff suppressed because it is too large
Load diff
1578
Construction/scripts/inventoryHud.cs
Normal file
1578
Construction/scripts/inventoryHud.cs
Normal file
File diff suppressed because it is too large
Load diff
1012
Construction/scripts/ion.cs
Normal file
1012
Construction/scripts/ion.cs
Normal file
File diff suppressed because it is too large
Load diff
1117
Construction/scripts/item.cs
Normal file
1117
Construction/scripts/item.cs
Normal file
File diff suppressed because it is too large
Load diff
484
Construction/scripts/libraries.cs
Normal file
484
Construction/scripts/libraries.cs
Normal file
|
|
@ -0,0 +1,484 @@
|
|||
//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"] = 38;
|
||||
$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";
|
||||
//ADDITIONAL XENON FORCE FIELDS
|
||||
$packSetting["forcefield",21] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> glass";
|
||||
$packSetting["forcefield",22] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> picture tube";
|
||||
$packSetting["forcefield",23] = "0.5 8 160 Force field set to <color:ff4444>all-pass <color:44ffff> targeting reticles";
|
||||
$packSetting["forcefield",24] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> static wall";
|
||||
$packSetting["forcefield",25] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> lightning wall";
|
||||
$packSetting["forcefield",26] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> fake cloak";
|
||||
$packSetting["forcefield",27] = "0.5 8 160 Force field set to <color:ff4444>all-pass <color:44ffff> lava wall";
|
||||
$packSetting["forcefield",28] = "0.5 8 160 Force field set to <color:ff4444>all-pass <color:44ffff> nasty water";
|
||||
$packSetting["forcefield",29] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> inviso-field";
|
||||
$packSetting["forcefield",30] = "0.5 8 160 Force field set to <color:44ff44>team-pass <color:44ffff> nasty water";
|
||||
$packSetting["forcefield",31] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> laser beams";
|
||||
$packSetting["forcefield",32] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> energy beams";
|
||||
$packSetting["forcefield",33] = "0.5 8 160 Force field set to <color:ff4444>all-pass <color:44ffff> water";
|
||||
$packSetting["forcefield",34] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> ionic field";
|
||||
$packSetting["forcefield",35] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> fire wall";
|
||||
$packSetting["forcefield",36] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> ice wall";
|
||||
$packSetting["forcefield",37] = "0.5 8 160 Force field set to <color:ff4444>all-pass <color:44ffff> Out of Bounds Field";
|
||||
$packSetting["forcefield",38] = "0.5 8 160 Force field set to <color:ffffff>solid <color:44ffff> matrix grid";
|
||||
|
||||
|
||||
|
||||
|
||||
$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"] = 2;
|
||||
$expertSetting["switch",0] = "Normal switch";
|
||||
$expertSetting["switch",1] = "Timed switch on";
|
||||
$expertSetting["switch",2] = "Timed switch off";
|
||||
|
||||
$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";
|
||||
|
||||
//METALLIC DOOR OPTIONS
|
||||
$packSettings["Door"] = 10; //<color:RRGGBB>
|
||||
$packSetting["Door",0] = "<color:ff0000>Normal Door";
|
||||
$packSetting["Door",1] = "<color:ff0000>Toggle Door";
|
||||
$packSetting["Door",2] = "<color:00ff00>Power Change Normal Door";
|
||||
$packSetting["Door",3] = "<color:00ff00>Power Change <color:ffff88>Closed when powered";
|
||||
$packSetting["Door",4] = "<color:00ff00>Power Change <color:ffff55>Opened when powered";
|
||||
$packSetting["Door",5] = "<color:9999ff>Contact door";
|
||||
$packSetting["Door",6] = "<color:9999ff>Contact door <color:ff0000>Level-1 acces door";
|
||||
$packSetting["Door",7] = "<color:9999ff>Contact door <color:ff3300>Level-2 acces door";
|
||||
$packSetting["Door",8] = "<color:9999ff>Contact door <color:ff6600>Level-3 acces door";
|
||||
$packSetting["Door",9] = "<color:9999ff>Contact door <color:ff9900>Owner door";
|
||||
$packSetting["Door",10] = "<color:9999ff>Contact door <color:ffbb00>Admin door";
|
||||
$packSetting["Door",11] = "<color:9999ff>Contact door <colorffee00:>Super admin door";
|
||||
|
||||
$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";
|
||||
|
||||
$packSettings["permsphere"] = 2;
|
||||
$packSetting["permsphere",0] = "Owner Only Construct Zone";
|
||||
$packSetting["permsphere",1] = "Peace Zone";
|
||||
$packSetting["permsphere",2] = "Combat Zone";
|
||||
|
||||
$expertSettings["permsphere"] = 2;
|
||||
$expertSetting["permsphere",0] = "50 meters.";
|
||||
$expertSetting["permsphere",1] = "100 meters.";
|
||||
$expertSetting["permsphere",2] = "300 meters.";
|
||||
|
||||
$packSettings["proxswitch"] = 6;
|
||||
$packSetting["proxswitch",0] = "2 meter range.";
|
||||
$packSetting["proxswitch",1] = "5 meter range.";
|
||||
$packSetting["proxswitch",2] = "10 meter range.";
|
||||
$packSetting["proxswitch",3] = "20 meter range.";
|
||||
$packSetting["proxswitch",4] = "40 meter range.";
|
||||
$packSetting["proxswitch",5] = "80 meter range.";
|
||||
$packSetting["proxswitch",6] = "160 meter range.";
|
||||
|
||||
$expertSettings["proxswitch"] = 5;
|
||||
$expertSetting["proxswitch",0] = "Power On.";
|
||||
$expertSetting["proxswitch",1] = "Power Off.";
|
||||
$expertSetting["proxswitch",2] = "Buddies/Owner Power On.";
|
||||
$expertSetting["proxswitch",3] = "Buddies/Owner Power Off.";
|
||||
$expertSetting["proxswitch",4] = "Enemy Only Power On.";
|
||||
$expertSetting["proxswitch",5] = "Enemy Only Power Off.";
|
||||
|
||||
$packSettings["baseturret"] = 2;
|
||||
$packSetting["baseturret",0] = "Normal Mode";
|
||||
$packSetting["baseturret",1] = "Engage All Except Buddies";
|
||||
$packSetting["baseturret",2] = "Engage Enemy List Only";
|
||||
|
||||
//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";
|
||||
|
||||
//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";
|
||||
|
||||
//Construction Tool
|
||||
$WeaponSettings["ConstructionTool"] = 3;
|
||||
$WeaponSetting["ConstructionTool",0] = "Deconstruct";
|
||||
$WeaponSetting["ConstructionTool",1] = "Rotate";
|
||||
$WeaponSetting["ConstructionTool",2] = "Advanced Rotate";
|
||||
$WeaponSetting["ConstructionTool",3] = "Power Management";
|
||||
|
||||
//Deconstruct Options
|
||||
$WeaponSettings["ConstructionTool0"] = 1;
|
||||
$WeaponSetting["ConstructionTool0",0] = "Normal Deconstruct";
|
||||
$WeaponSetting["ConstructionTool0",1] = "Cascading Deconstruct";
|
||||
|
||||
//Rotate Options
|
||||
$WeaponSettings["ConstructionTool1"] = 1;
|
||||
$WeaponSetting["ConstructionTool1",0] = "Rotate Push";
|
||||
$WeaponSetting["ConstructionTool1",1] = "Rotate Pull";
|
||||
|
||||
//Advanced Rotate Options
|
||||
$WeaponSettings["ConstructionTool2"] = 5;
|
||||
$WeaponSetting["ConstructionTool2",0] = "Select target as center of rotation";
|
||||
$WeaponSetting["ConstructionTool2",1] = "Select objects to rotate";
|
||||
$WeaponSetting["ConstructionTool2",2] = "Select rotation speed";
|
||||
$WeaponSetting["ConstructionTool2",3] = "Apply rotation";
|
||||
$WeaponSetting["ConstructionTool2",4] = "Display selection";
|
||||
$WeaponSetting["ConstructionTool2",5] = "Clear list";
|
||||
|
||||
//Power Management Options
|
||||
$WeaponSettings["ConstructionTool3"] = 3;
|
||||
$WeaponSetting["ConstructionTool3",0] = "Toggle generator power state";
|
||||
$WeaponSetting["ConstructionTool3",1] = "Increase current frequency";
|
||||
$WeaponSetting["ConstructionTool3",2] = "Decrease current frequency";
|
||||
$WeaponSetting["ConstructionTool3",3] = "Read power state";
|
||||
|
||||
//Krypton Multi-Tool
|
||||
$WeaponSettings["MultiTool"] = 2;
|
||||
$WeaponSetting["MultiTool",0] = "Move";
|
||||
$WeaponSetting["MultiTool",1] = "Axis Move";
|
||||
$WeaponSetting["MultiTool",2] = "Axis Scale";
|
||||
|
||||
$WeaponSettings["MultiTool1"] = 1;
|
||||
$WeaponSetting["MultiTool1",0] = "Pull";
|
||||
$WeaponSetting["MultiTool1",1] = "Push";
|
||||
|
||||
$WeaponSettings["MultiTool2"] = 1;
|
||||
$WeaponSetting["MultiTool2",0] = "Grow";
|
||||
$WeaponSetting["MultiTool2",1] = "Shrink";
|
||||
648
Construction/scripts/message.cs
Normal file
648
Construction/scripts/message.cs
Normal file
|
|
@ -0,0 +1,648 @@
|
|||
$MaxMessageWavLength = 5200;
|
||||
|
||||
function asay(%msg) //Publish a message as "console"
|
||||
{
|
||||
MessageAll("","\c4Console: " @ %msg);
|
||||
echo("\c4Console: " @ %msg);
|
||||
}
|
||||
|
||||
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 = 6;
|
||||
$SPAM_PENALTY_PERIOD = 10000;
|
||||
$SPAM_MESSAGE = '\c3FLOOD PROTECTION:\cr You must wait another %1 seconds. Stop spamming, lardo.';
|
||||
|
||||
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.isAdmin)
|
||||
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 ($Host::NoAnnoyingVoiceChatSpam) {
|
||||
//Let those tracer DX people chat....
|
||||
%a2 = strreplace(%a2,"voice/Male1/","");
|
||||
%a2 = strreplace(%a2,"voice/Male2/","");
|
||||
%a2 = strreplace(%a2,"voice/Male3/","");
|
||||
%a2 = strreplace(%a2,"voice/Male4/","");
|
||||
%a2 = strreplace(%a2,"voice/Male5/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm1/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm2/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm3/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem1/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem2/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem3/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem4/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem5/","");
|
||||
%a2 = strreplace(%a2,"voice/Bot1/","");
|
||||
%a2 = strreplace(%a2,"~wavo.deathcry_01","");
|
||||
%a2 = strreplace(%a2,"~wavo.deathcry_02","");
|
||||
%a2 = strreplace(%a2,"~wavo.grunt","");
|
||||
%a2 = strreplace(%a2,"~wavo.pain","");
|
||||
%a2 = strreplace(%a2,".wav","");
|
||||
//---------
|
||||
}
|
||||
|
||||
//chat Echoing and logging
|
||||
%echoStr = %a2;
|
||||
%echoStr=strreplace(%echoStr,"\c5","");
|
||||
%echoStr=strreplace(%echoStr,"\c4","");
|
||||
%echoStr=strreplace(%echoStr,"\c3","");
|
||||
%echoStr=strreplace(%echoStr,"\c2","");
|
||||
%echoStr=strreplace(%echoStr,"\c1","");
|
||||
// if ($Construction::Logging::EchoChat)
|
||||
// echo(getTaggedString(%sender.name) @ ":" SPC %echoStr);
|
||||
// if ($Construction::Logging::LogChat)
|
||||
serverChatLog(%sender, %echoStr); //Log the chat message
|
||||
echo(%sender.nameBase @ ": " @ %echoStr); //Echo the chat message in console
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
//Swear filter... Don't need a Theorem check
|
||||
SwearFilter(%sender,%a2);
|
||||
CapsFilter(%sender,%a2);
|
||||
RepeatFilter(%sender,%a2);
|
||||
|
||||
|
||||
endaway(%sender);
|
||||
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
|
||||
if (namecheck(%a2) == %obj && %obj.namehilite) {
|
||||
if ( %obj.team == %sender.team ) { //This be team-chat
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, "\c1" @ %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
if (%obj.notificationoff == 0 || %obj.notificationoff $= "") {
|
||||
MessageClient(%obj,"snd","~wgui/youvegotmail.wav");
|
||||
%obj.notificationoff = 1;
|
||||
cancel(%obj.notschedule);
|
||||
%obj.notschedule = schedule(20000,0,"eval",%obj @ ".notificationoff=\"\";");
|
||||
}
|
||||
if (%obj.isaway && (%sender != $tid))
|
||||
schedule(2000,0,TheoremMsg,%obj.nameBase @ " has been away for approx. " @ mFloor(%obj.awaytime/60) @ " minutes.");
|
||||
}
|
||||
} else {
|
||||
//if(%sender.team != 0)
|
||||
if ( %obj.team == %sender.team ) //This be team-chat
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
//else
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function namecheck(%msg) //Looks for fragments of a player name in the message.
|
||||
{
|
||||
%match = "";
|
||||
%matchclient = "";
|
||||
%count = getwordcount(%msg);
|
||||
%msg = strreplace( %msg, ".", "" );
|
||||
%msg = strreplace( %msg, "'s", "" );
|
||||
%msg = strreplace( %msg, ",", "" );
|
||||
%msg = strreplace( %msg, "?", "" );
|
||||
%msg = strreplace( %msg, "!", "" );
|
||||
%msg = strreplace( %msg, ":", "" );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ ) {
|
||||
if (strlen(getword(%msg,%i)) < 4) //Don't match for words over 4 characters.
|
||||
continue;
|
||||
|
||||
if (plnametocid(getword(%msg,%i)) < 2) //No match?
|
||||
continue;
|
||||
|
||||
//We have a match.
|
||||
if (strlen(getword(%msg,%i)) > strlen(%match)) {
|
||||
%match = getword(%msg,%i);
|
||||
%matchclient = plnametocid(getword(%msg,%i));
|
||||
}
|
||||
}
|
||||
|
||||
if (%matchclient $= "") {
|
||||
return false;
|
||||
} else {
|
||||
return %matchclient;
|
||||
}
|
||||
}
|
||||
|
||||
function cannedChatMessageTeam( %sender, %team, %msgString, %name, %string, %keys )
|
||||
{
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
//chat Echoing and logging
|
||||
%echoStr = %string;
|
||||
%echoStr=strreplace(%echoStr,"\c5","");
|
||||
%echoStr=strreplace(%echoStr,"\c4","");
|
||||
%echoStr=strreplace(%echoStr,"\c3","");
|
||||
%echoStr=strreplace(%echoStr,"\c2","");
|
||||
%echoStr=strreplace(%echoStr,"\c1","");
|
||||
serverChatLog(%sender, %echoStr); //Log the chat message
|
||||
echo(%sender.nameBase @ ": " @ %echoStr); //Echo the chat message in console
|
||||
|
||||
|
||||
SwearFilter(%sender,%string);
|
||||
CapsFilter(%sender,%string);
|
||||
RepeatFilter(%sender,%string);
|
||||
|
||||
endaway(%sender);
|
||||
|
||||
%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 (getSubStr(%a2,0,1) $= "!") {
|
||||
ccpm(%sender,%a2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (getSubStr(%a2,0,1) $= "@") {
|
||||
ccexecute(%sender,%a2);
|
||||
return;
|
||||
}
|
||||
|
||||
if(getSubStr(%a2, 0, 1) $= "/") {
|
||||
chatcommands(%sender,%a2);
|
||||
return;
|
||||
}
|
||||
if ($Host::NoAnnoyingVoiceChatSpam) {
|
||||
//Let those tracer DX people chat....
|
||||
%a2 = strreplace(%a2,"voice/Male1/","");
|
||||
%a2 = strreplace(%a2,"voice/Male2/","");
|
||||
%a2 = strreplace(%a2,"voice/Male3/","");
|
||||
%a2 = strreplace(%a2,"voice/Male4/","");
|
||||
%a2 = strreplace(%a2,"voice/Male5/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm1/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm2/","");
|
||||
%a2 = strreplace(%a2,"voice/Derm3/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem1/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem2/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem3/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem4/","");
|
||||
%a2 = strreplace(%a2,"voice/Fem5/","");
|
||||
%a2 = strreplace(%a2,"voice/Bot1/","");
|
||||
%a2 = strreplace(%a2,"~wavo.deathcry_01","");
|
||||
%a2 = strreplace(%a2,"~wavo.deathcry_02","");
|
||||
%a2 = strreplace(%a2,"~wavo.grunt","");
|
||||
%a2 = strreplace(%a2,"~wavo.pain","");
|
||||
%a2 = strreplace(%a2,".wav","");
|
||||
//---------
|
||||
}
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
checkAgainstTheorem(%sender,%a2); //Check it against Theorem.
|
||||
|
||||
|
||||
//chat Echoing and logging
|
||||
%echoStr = %a2;
|
||||
%echoStr=strreplace(%echoStr,"\c5","");
|
||||
%echoStr=strreplace(%echoStr,"\c4","");
|
||||
%echoStr=strreplace(%echoStr,"\c3","");
|
||||
%echoStr=strreplace(%echoStr,"\c2","");
|
||||
%echoStr=strreplace(%echoStr,"\c1","");
|
||||
serverChatLog(%sender, %echoStr); //Log the chat message
|
||||
echo(%sender.nameBase @ ": " @ %echoStr); //Echo the chat message in console
|
||||
|
||||
endaway(%sender);
|
||||
|
||||
if (strlwr(getSubStr(%a2,0,3)) $= "afk" || strlwr(getSubStr(%a2,0,3)) $= "brb") {
|
||||
setaway(%sender);
|
||||
}
|
||||
|
||||
if (%sender.singSong !$= "")
|
||||
{
|
||||
if (%sender.lyricLine $= "")
|
||||
%sender.lyricLine = 0;
|
||||
if (%sender.lyricLine > $LyricsLineCount[%sender.singSong]-1)
|
||||
%sender.singSong = "";
|
||||
else
|
||||
{
|
||||
%a2 = $LyricsPunishment[%sender.singSong,%sender.lyricLine];
|
||||
%sender.lyricLine++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
|
||||
if (getSubStr(%a2, 0, 1) !$= "/") {
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%obj = ClientGroup.getObject( %i );
|
||||
|
||||
if (namecheck(%a2) == %obj && %obj.namehilite) {
|
||||
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, "\c1" @ %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
|
||||
if (%obj.notificationoff == 0 || %obj.notificationoff $= "") {
|
||||
MessageClient(%obj,"snd","~wgui/youvegotmail.wav");
|
||||
%obj.notificationoff = 1;
|
||||
cancel(%obj.notschedule);
|
||||
%obj.notschedule = schedule(20000,0,"eval",%obj @ ".notificationoff=\"\";");
|
||||
}
|
||||
if (%obj.isaway && (%sender != $tid))
|
||||
schedule(2000,0,TheoremMsg,%obj.nameBase @ " has been away for approx. " @ mFloor(%obj.awaytime/60) @ " minutes.");
|
||||
} else {
|
||||
//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 );
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cannedChatMessageAll( %sender, %msgString, %name, %string, %keys )
|
||||
{
|
||||
//echo("%sender = " @ %sender);
|
||||
//echo("%msgString = " @ %msgString);
|
||||
//echo("%name = " @ %name);
|
||||
//echo("%string = " @ %string);
|
||||
//echo("%keys = " @ %keys);
|
||||
//backtrace();
|
||||
if ( ( %msgString $= "" ) || spamAlert( %sender ) )
|
||||
return;
|
||||
|
||||
checkCannedAgainstTheorem(%sender,%string); //Check this against Theorem.
|
||||
|
||||
endaway(%sender);
|
||||
|
||||
//chat Echoing and logging
|
||||
%echoStr = %string;
|
||||
%echoStr=strreplace(%echoStr,"\c5","");
|
||||
%echoStr=strreplace(%echoStr,"\c4","");
|
||||
%echoStr=strreplace(%echoStr,"\c3","");
|
||||
%echoStr=strreplace(%echoStr,"\c2","");
|
||||
%echoStr=strreplace(%echoStr,"\c1","");
|
||||
serverChatLog(%sender, %echoStr); //Log the chat message
|
||||
echo(%sender.nameBase @ ": " @ %echoStr); //Echo the chat message in console
|
||||
|
||||
if (%sender.singSong !$= "")
|
||||
{
|
||||
if (%sender.lyricLine $= "")
|
||||
%sender.lyricLine = 0;
|
||||
if (%sender.lyricLine > $LyricsLineCount[%sender.singSong]-1)
|
||||
%sender.singSong = "";
|
||||
else
|
||||
{
|
||||
%string = $LyricsPunishment[%sender.singSong,%sender.lyricLine];
|
||||
%sender.lyricLine++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%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");
|
||||
}
|
||||
0
Construction/scripts/metalfuncs.cs
Normal file
0
Construction/scripts/metalfuncs.cs
Normal file
121
Construction/scripts/nerf.cs
Normal file
121
Construction/scripts/nerf.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
1528
Construction/scripts/objectiveHud.cs
Normal file
1528
Construction/scripts/objectiveHud.cs
Normal file
File diff suppressed because it is too large
Load diff
133
Construction/scripts/pack.cs
Normal file
133
Construction/scripts/pack.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
//----------------------------------------------------------------------------
|
||||
|
||||
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/testdoor.cs");
|
||||
|
||||
//Krypton Packs
|
||||
exec("scripts/packs/editorpack.cs");
|
||||
exec("scripts/Krypton/proximityswitch.cs");
|
||||
|
||||
//Quantium Packs
|
||||
//exec("scripts/Krypton/Quantium/decoypack.cs");
|
||||
|
||||
//Metallic Packs
|
||||
exec("scripts/packs/waypointpack.cs");
|
||||
|
||||
// --- Turret barrel packs
|
||||
exec("scripts/packs/aabarrelpack.cs");
|
||||
exec("scripts/packs/chaingunbarrelPack.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
Construction/scripts/packs/AntiNuketurret.cs
Normal file
724
Construction/scripts/packs/AntiNuketurret.cs
Normal 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.
|
||||
}
|
||||
}
|
||||
|
||||
819
Construction/scripts/packs/EditorPack.cs
Normal file
819
Construction/scripts/packs/EditorPack.cs
Normal file
|
|
@ -0,0 +1,819 @@
|
|||
//The Code Is Quite Messy.
|
||||
|
||||
//Datablocks
|
||||
datablock StaticShapeData(DeployedEditorPack) : StaticShapeDamageProfile {
|
||||
className = "EditorPack";
|
||||
shapeFile = "stackable2s.dts";
|
||||
maxDamage = 2.0;
|
||||
destroyedLevel = 2.0;
|
||||
disabledLevel = 2.0;
|
||||
mass = 1.2;
|
||||
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;
|
||||
cmdCategory = "DSupport";
|
||||
cmdIcon = CMDSensorIcon;
|
||||
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
|
||||
|
||||
targetNameTag = 'Editor';
|
||||
targetTypeTag = 'Pack';
|
||||
deployAmbientThread = true;
|
||||
debrisShapeName = "debris_generic_small.dts";
|
||||
debris = DeployableDebris;
|
||||
heatSignature = 0;
|
||||
needsPower = true;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(EditorPackDeployableImage) {
|
||||
mass = 10;
|
||||
emap = true;
|
||||
shapeFile = "stackable1s.dts";
|
||||
item = EditorPackDeployable;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
deployed = DeployedEditorPack;
|
||||
heatSignature = 0;
|
||||
collideable = 1;
|
||||
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(EditorPackDeployable) {
|
||||
className = Pack;
|
||||
catagory = "Deployables";
|
||||
shapeFile = "stackable1s.dts";
|
||||
mass = 5.0;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 1;
|
||||
rotate = true;
|
||||
image = "EditorPackDeployableImage";
|
||||
pickUpName = "an editor pack";
|
||||
heatSignature = 0;
|
||||
emap = true;
|
||||
};
|
||||
|
||||
//Code
|
||||
$TeamDeployableMax[EditorPackDeployable] = 9999; //Change To Your Desire
|
||||
|
||||
function EditorPackDeployableImage::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 = %item.deployed;
|
||||
scale = "1 1 1";
|
||||
};
|
||||
|
||||
// set orientation
|
||||
%deplObj.setTransform(%item.surfacePt SPC %rot);
|
||||
%deplObj.deploy();
|
||||
// set team, owner, and handle
|
||||
%deplObj.team = %plyr.client.Team;
|
||||
%deplObj.setOwner(%plyr);
|
||||
%deplObj.paded=1;
|
||||
//Msg Client
|
||||
messageclient(%plyr.client, 'MsgClient', "\c2Type /editor CMDs for a list of Editor Pack CMDs.");
|
||||
// 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);
|
||||
|
||||
//
|
||||
%deplObj.powerFreq = %plyr.powerFreq;
|
||||
checkPowerObject(%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);
|
||||
//Do Some Stuff
|
||||
%deplobj.slotcount = 1; //For /editor addobj
|
||||
|
||||
return %deplObj;
|
||||
}
|
||||
|
||||
function EditorPack::onCollision(%data,%obj,%col) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function EditorPackDeployable::onPickup(%this, %obj, %shape, %amount) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function EditorPackDeployableImage::onMount(%data, %obj, %node) {
|
||||
displayPowerFreq(%obj);
|
||||
}
|
||||
|
||||
function EditorPackDeployableImage::onUnmount(%data, %obj, %node) {
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function DeployedEditorPack::gainPower(%data, %obj)
|
||||
{
|
||||
PerformCloak(%obj);
|
||||
PerformFade(%obj);
|
||||
PerformScale(%obj);
|
||||
PerformHide(%obj);
|
||||
PerformName(%obj);
|
||||
%obj.edited = false;
|
||||
}
|
||||
|
||||
function DeployedEditorPack::losePower(%data, %obj)
|
||||
{
|
||||
EditorPerform(%obj);
|
||||
%obj.edited = true;
|
||||
}
|
||||
|
||||
function DeployedEditorPack::OnDestroyed(%data, %obj)
|
||||
{
|
||||
if (%obj.edited)
|
||||
EditorPerform(%obj);
|
||||
}
|
||||
|
||||
function EditorPerform(%obj)
|
||||
{
|
||||
PerformCloak(%obj);
|
||||
PerformFade(%obj);
|
||||
PerformScale(%obj);
|
||||
PerformHide(%obj);
|
||||
PerformName(%obj);
|
||||
}
|
||||
|
||||
|
||||
function DeployedEditorPack::onDestroyed(%this, %obj, %prevState) {
|
||||
// dismountPlayers();
|
||||
if (%obj.isRemoved)
|
||||
return;
|
||||
%obj.isRemoved = true;
|
||||
Parent::onDestroyed(%this, %obj, %prevState);
|
||||
$TeamDeployedCount[%obj.team, bogypackDeployable]--;
|
||||
remDSurface(%obj);
|
||||
%obj.schedule(500, "delete");
|
||||
fireBallExplode(%obj,1);
|
||||
}
|
||||
|
||||
function ccEditor(%sender,%args)
|
||||
{
|
||||
%f = getword(%args,0);
|
||||
%f = StrLwr(%f);
|
||||
|
||||
%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);
|
||||
%className = %classname;
|
||||
|
||||
if (EvaluateFunction(%f) == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unknown command: \'"@%f@"\'.");
|
||||
return;
|
||||
}
|
||||
else if (%f $="help" || %f $="cmds")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2/editor select - Selects the editor you\'re looking at.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor addobj - Adds the object you\'re looking at to the editor you\'ve selected.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor cloak - Adds the object you\'re looking at to you\'r editor\'s cloak list.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor fade - Adds the object you\'re looking at to you\'r editor\'s fade list.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor name <New Name> - Adds the object you\'re looking at to you\'r editor\'s fade list.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor scale <New Scale> - Adds the object you\'re looking at to you\'r editor\'s scale list.");
|
||||
messageclient(%sender,'msgclient',"\c2/editor hide - Adds the object you\'re looking at to you\'r editor\'s fade list..");
|
||||
return;
|
||||
}
|
||||
else if (%f $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No command specified, please use \'/editor help\'.");
|
||||
return;
|
||||
}
|
||||
else if (%f $="delobj")
|
||||
{
|
||||
ProcessDelObj(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else if (%f $="addobj")
|
||||
{
|
||||
ProcessAddObj(%sender,%obj);
|
||||
return;
|
||||
}
|
||||
else if (!%obj){
|
||||
messageclient(%sender,'msgclient',"\c2Unable to find an object.");
|
||||
return;
|
||||
}
|
||||
else if (%f $="getid" && %obj.owner $=%sender)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2The ID of this object is \'"@%obj@"\'.");
|
||||
return;
|
||||
}
|
||||
else if (%f $="fade")
|
||||
{
|
||||
ProcessFade(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else if (%f $="cloak")
|
||||
{
|
||||
ProcessCloak(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else if (%f $="scale")
|
||||
{
|
||||
ProcessScale(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else if (%f $="name")
|
||||
{
|
||||
ProcessName(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else if (%f $="hide")
|
||||
{
|
||||
ProcessHide(%sender,%obj,%args);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%dataBlock = %obj.getDataBlock(); //To Prevent Errors
|
||||
if (!IsMatch(%obj.getdatablock().getname(),"DeployedEditorPack")){
|
||||
messageclient(%sender,'msgclient',"\c2Not an editor pack!");
|
||||
return;
|
||||
}
|
||||
ProcessEditorRequest(%sender,%obj,%f);
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessEditorRequest(%sender,%obj,%f)
|
||||
{
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This editor pack is not yours!");
|
||||
return;
|
||||
}
|
||||
if (%f $="select" || %f $="selecteditor" || %f = "seledit")
|
||||
{
|
||||
%sender.currentedit = %obj;
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
messageclient(%sender,'msgclient',"\c2Current editor set.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessAddObj(%sender,%obj)
|
||||
{
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This object is not yours!");
|
||||
return;
|
||||
}
|
||||
if (!IsObject(%Sender.CurrentEdit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected! You can use \'/editor select\' while pointing at an editor to select it.");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to edit editor packs!");
|
||||
return;
|
||||
}
|
||||
%Slots = %sender.currentedit.slotcount;
|
||||
%edit = %sender.currentedit;
|
||||
for (%i=0;%i<%slots;%i++)
|
||||
{
|
||||
if (%edit.slot[%i] $="")
|
||||
{
|
||||
%edit.slot[%i] = %obj;
|
||||
%edit.slotcount++;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your current editor. ("@%i@")");
|
||||
%obj.slot = %i;
|
||||
%obj.editor = %edit;
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessDelObj(%sender,%obj,%args)
|
||||
{
|
||||
%edit = %sender.currentedit;
|
||||
|
||||
if (!IsObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2Not your object!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
messageclient(%sender,'msgclient',"\c2Object deleted from your current editor.");
|
||||
%edit.slot[%obj.slot] = "";
|
||||
%obj.slot = "A";
|
||||
%obj.editor = "";
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
if (%edit.slotcount > 1)
|
||||
%edit.slotcount--;
|
||||
}
|
||||
|
||||
function ProcessScale(%sender,%obj,%args)
|
||||
{
|
||||
%scale = getwords(%args,1);
|
||||
%edit = %sender.currentedit;
|
||||
|
||||
if (!IsObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2Not your object!");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to scale editor packs!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
%obj.slot = "A";
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
if (%scale $="" && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No scale specified.");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,0) > $Editor::MaxScale["X"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The X axis is too big. Max: "@$Editor::MaxScale["X"]@"");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,1) > $Editor::MaxScale["Y"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The Y axis is too big. Max: "@$Editor::MaxScale["Y"]@"");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,2) > $Editor::MaxScale["Z"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The Z axis is too big. Max: "@$Editor::MaxScale["Z"]@"");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,0) < $Editor::MinScale["X"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The X axis is too small. Min: "@$Editor::MinScale["X"]@"");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,1) < $Editor::MinScale["Y"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The Y axis is too small. Min: "@$Editor::MinScale["Y"]@"");
|
||||
return;
|
||||
}
|
||||
if (getword(%scale,2) < $Editor::MinScale["Z"] && %obj.istscale == false)
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2\'"@%scale@"\' is invalid. The Z axis is too small. Min: "@$Editor::MinScale["Z"]@"");
|
||||
return;
|
||||
}
|
||||
%scale = CheckScale(%scale);
|
||||
if (!%obj.istscale)
|
||||
{
|
||||
%obj.istscale = true;
|
||||
%obj.isescaled = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your currently selected editor\'s scale list. This object will be scaled to \'"@%scale@"\'.");
|
||||
%obj.escale = %scale;
|
||||
%obj.oldscale = %obj.getscale();
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.istscale = false;
|
||||
%obj.isescaled = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been removed from your currently selected editor\'s scale list. Original scale restored.");
|
||||
%obj.setscale(%obj.oldscale);
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessFade(%sender,%obj,%args)
|
||||
{
|
||||
%edit = %sender.currentedit;
|
||||
if (!isObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This object is not yours!");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to fade editor packs!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
if (!%obj.istfade)
|
||||
{
|
||||
%obj.istfade = true;
|
||||
%obj.isefaded = false;
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj, false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your currently selected editor\'s fade list.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.istfade = false;
|
||||
%obj.isefaded = false;
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
messageclient(%sender,'msgclient',"\c2Object has been removed from your currently selected editor\'s fade list.");
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessHide(%sender,%obj,%args)
|
||||
{
|
||||
%edit = %sender.currentedit;
|
||||
|
||||
if (!isObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This object is not yours!");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to fade editor packs!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
if (!%obj.isthide)
|
||||
{
|
||||
%obj.isthide = true;
|
||||
%obj.isehidden = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your editor\'s hide list.");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.isthide = false;
|
||||
%obj.isehidden = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been removed from your current editor\'s hide list.");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessCloak(%sender,%obj,%args)
|
||||
{
|
||||
%edit = %sender.currentedit;
|
||||
if (!isObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This object is not yours!");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to cloak editor packs!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
if (!%obj.istcloak)
|
||||
{
|
||||
%obj.istcloak = true;
|
||||
%obj.isecloaked = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your current editor\'s cloak list.");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.istcloak = false;
|
||||
%obj.isecloaked = false;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been removed from your current editor\'s cloak list.");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
}
|
||||
}
|
||||
|
||||
function ProcessName(%sender,%obj,%args)
|
||||
{
|
||||
%edit = %sender.currentedit;
|
||||
%name = getwords(%args,1);
|
||||
if (!isObject(%edit))
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2No editor selected!");
|
||||
return;
|
||||
}
|
||||
if (%obj.owner!=%sender && %obj.owner !$=""){
|
||||
messageclient(%sender,'msgclient',"\c2This object is not yours!");
|
||||
return;
|
||||
}
|
||||
if (%obj.getdatablock().getname() $= "DeployedEditorPack")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2Unable to name editor packs!");
|
||||
return;
|
||||
}
|
||||
if (%obj.slot $="A" || %obj.editor $="")
|
||||
{
|
||||
messageclient(%sender,'msgclient',"\c2This object is not bound to an editor!");
|
||||
return;
|
||||
}
|
||||
if (!%obj.istname)
|
||||
{
|
||||
%obj.istname = true;
|
||||
%obj.isenamed = false;
|
||||
%obj.oldname = %obj.nametag;
|
||||
%obj.ename = %name;
|
||||
messageclient(%sender,'msgclient',"\c2Object has been added to your current editor\'s name list. This object will be named to: "@%name@"");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
%obj.istname = false;
|
||||
%obj.isename = false;
|
||||
%obj.nametag = %obj.oldname;
|
||||
setTargetName(%obj.target,addTaggedString("\c6"@%obj.oldname@""));
|
||||
%obj.oldname = "";
|
||||
messageclient(%sender,'msgclient',"\c2Object has been removed from your current editor\'s cloak list. Old name restored.");
|
||||
%obj.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
}
|
||||
}
|
||||
|
||||
//Performance Functions
|
||||
function PerformCloak(%obj)
|
||||
{
|
||||
if (!IsObject(%obj))
|
||||
return;
|
||||
%c = %obj.slotcount;
|
||||
%c++;
|
||||
for (%i=0;%i<%c;%i++)
|
||||
{
|
||||
%object = %obj.slot[%i];
|
||||
if (!IsObject(%Object))
|
||||
return;
|
||||
if (!%object.istcloak) //IsTFade = Is To Fade
|
||||
%object.isecloaked = true; //To Make The System Think It's Already Cloaked
|
||||
if (%object.isecloaked)
|
||||
{
|
||||
%object.setcloaked(false);
|
||||
%object.isecloaked = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
schedule(510,0,"SetCloaked",%object,true); //Somehow Fixed The Cloaking Problem
|
||||
%object.isecloaked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setcloaked(%obj,%bool)
|
||||
{
|
||||
%obj.setcloaked(%bool);
|
||||
}
|
||||
|
||||
function PerformFade(%obj)
|
||||
{
|
||||
if (!IsObject(%obj))
|
||||
return;
|
||||
%c = %obj.slotcount;
|
||||
%c = %c++;
|
||||
for (%i=0;%i<%c;%i++)
|
||||
{
|
||||
%object = %obj.slot[%i];
|
||||
if (!IsObject(%Object))
|
||||
return;
|
||||
if (!%object.istfade) //IsTFade = Is To Fade
|
||||
%object.isefaded = true; //To Make The System Think It's Already Faded
|
||||
if (%object.isefaded)
|
||||
{
|
||||
%object.startfade(1,0,0);
|
||||
%object.isefaded= false;
|
||||
}
|
||||
else
|
||||
{
|
||||
%object.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%object,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
schedule(510,0,"fade",%object);
|
||||
%object.isefaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fade(%obj)
|
||||
{
|
||||
%obj.startfade(1,0,1);
|
||||
}
|
||||
|
||||
function PerformHide(%obj)
|
||||
{
|
||||
if (!IsObject(%obj))
|
||||
return;
|
||||
for (%i=0;%i<%obj.slotcount;%i++)
|
||||
{
|
||||
%object = %obj.slot[%i];
|
||||
if (!IsObject(%Object))
|
||||
return;
|
||||
if (!%object.isthide) //IsTFade = Is To Fade
|
||||
%object.isehidden = true; //To Make The System Think It's Already Hidden
|
||||
if (%object.isehidden)
|
||||
{
|
||||
%object.hide(0);
|
||||
%object.isehidden= false;
|
||||
}
|
||||
else
|
||||
{
|
||||
%object.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%obj.slot[%slot],false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
schedule(510,0,"Hide",%object);
|
||||
%object.isehidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Hide(%obj)
|
||||
{
|
||||
%obj.hide(1);
|
||||
}
|
||||
|
||||
function PerformScale(%obj)
|
||||
{
|
||||
if (!IsObject(%obj))
|
||||
return;
|
||||
%c = %obj.slotcount;
|
||||
%c = %c++;
|
||||
for (%i=0;%i<%c;%i++)
|
||||
{
|
||||
%object = %obj.slot[%i];
|
||||
if (!IsObject(%Object))
|
||||
return;
|
||||
if (!%object.istscale){ //IsTFade = Is To Fade
|
||||
%object.isescaled = true; //To Make The System Think It's Already Scaled
|
||||
%object.oldscale = %object.getscale();
|
||||
}
|
||||
if (%object.isescaled)
|
||||
{
|
||||
%object.setscale(%object.oldscale);
|
||||
%object.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%object,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
%object.isescaled= false;
|
||||
}
|
||||
else
|
||||
{
|
||||
%object.setscale(%object.escale);
|
||||
%object.setcloaked(true);
|
||||
schedule(500,0,"SetCloaked",%object,false); //Couldn't Get It To Work With schedule(1000,0,"SetCloaked",%obj,true);
|
||||
%object.isescaled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function PerformName(%obj)
|
||||
{
|
||||
if (!IsObject(%obj))
|
||||
return;
|
||||
%c = %obj.slotcount;
|
||||
%c = %c++;
|
||||
for (%i=0;%i<%c;%i++)
|
||||
{
|
||||
%object = %obj.slot[%i];
|
||||
if (!IsObject(%Object))
|
||||
return;
|
||||
if (!%object.istname){ //IsTFade = Is To Fade
|
||||
%object.isenamed = true; //To Make The System Think It's Already Scaled
|
||||
if (%object.nametag !$="")
|
||||
%object.oldname = %object.nametag;
|
||||
else
|
||||
%object.oldname = %object.getdatablock().targetNameTag;
|
||||
}
|
||||
if (%object.isenamed)
|
||||
{
|
||||
%object.nametag = %obj.oldname;
|
||||
setTargetName(%object.target,addTaggedString("\c6"@%object.oldname@""));
|
||||
%object.isenamed = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
%object.nametag = %object.ename;
|
||||
setTargetName(%object.target,addTaggedString("\c6"@%object.ename@""));
|
||||
%object.isenamed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Support Functions
|
||||
function EvaluateFunction(%f) //To Eval The Command
|
||||
{
|
||||
if (%f $="addobj" || %f $= "selecteditor" || %f $="selecteditor" || %f $="seledit" || %f $="select" || %f $="delobj" || %f $="help" || %f $="cmds" || %f $="fade" || %f $="cloak" || %f $="scale" || %f $="getid" || %f $="hide" || %f $="name")
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function IsMatch(%string1,%string2)
|
||||
{
|
||||
%string1 = StrLwr(%string1);
|
||||
%string2 = StrLwr(%string2);
|
||||
|
||||
if (%string1 $=%string2)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function CheckScale(%scale) //Evals The Scale For Any Missing Args, If So, Puts A 1 In The Blank Slot
|
||||
{
|
||||
if (getword(%scale,0) $="")
|
||||
%scale = "1" SPC getword(%scale,1) SPC getword(%scale,2);
|
||||
if (getword(%scale,1) $="")
|
||||
%scale = getword(%scale,0) SPC "1" SPC getword(%scale,2);
|
||||
if (getword(%scale,2) $="")
|
||||
%scale = getword(%scale,0) SPC getword(%scale,1) SPC "1";
|
||||
return %scale;
|
||||
}
|
||||
|
||||
//Variables
|
||||
$Editor::MaxScale["X"] = 20;
|
||||
$Editor::MaxScale["Y"] = 20;
|
||||
$Editor::MaxScale["Z"] = 20;
|
||||
$Editor::MinScale["X"] = -20;
|
||||
$Editor::MinScale["Y"] = -20;
|
||||
$Editor::MinScale["Z"] = -20;
|
||||
|
||||
1806
Construction/scripts/packs/Effectpacks.cs
Normal file
1806
Construction/scripts/packs/Effectpacks.cs
Normal file
File diff suppressed because it is too large
Load diff
277
Construction/scripts/packs/blastfloor.cs
Normal file
277
Construction/scripts/packs/blastfloor.cs
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
//---------------------------------------------------------
|
||||
// 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;
|
||||
}
|
||||
|
||||
function FloorDeployableImage::setModHud(%data,%client) {
|
||||
%heightlist = "";
|
||||
%currentsetting = 0;
|
||||
%totalsettings = $packSettings["floor"];
|
||||
%loopnum = 0;
|
||||
%maxreached = 0;
|
||||
%currentsetting = 0;
|
||||
|
||||
while (!%maxreached) {
|
||||
%heightlist = "";
|
||||
for (%x=0;%x<10;%x++) {
|
||||
if (%currentsetting > %totalsettings) {
|
||||
%maxreached = true;
|
||||
break;
|
||||
}
|
||||
|
||||
%setting = $packSetting["floor",%currentsetting];
|
||||
%setting = getWords(%setting,6,getWordCount(%setting));
|
||||
%heightlist = %heightlist @ "\"" @ %setting @ "\",";
|
||||
%currentsetting++;
|
||||
}
|
||||
%heightlist = getSubStr(%heightlist, 0, strlen(%heightlist)-1); //Remove the last comma.
|
||||
%thecommand = "commandToClient(" @ %client @ ", 'ModHudPopulate', " @ "\"Floor Width-" @ %loopnum @ "\", " @ %heightlist @ ");";
|
||||
eval(%thecommand);
|
||||
echo(%thecommand);
|
||||
%loopnum++;
|
||||
}
|
||||
}
|
||||
|
||||
function FloorDeployableImage::getModHud(%data,%client,%option,%value) {
|
||||
|
||||
%packset = ((%option-1)*10)+%value-1;
|
||||
%client.player.packSet = %packset;
|
||||
}
|
||||
271
Construction/scripts/packs/blastwall.cs
Normal file
271
Construction/scripts/packs/blastwall.cs
Normal 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
Construction/scripts/packs/blastwwall.cs
Normal file
225
Construction/scripts/packs/blastwwall.cs
Normal 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 = "";
|
||||
}
|
||||
61
Construction/scripts/packs/chaingunbarrelPack.cs
Normal file
61
Construction/scripts/packs/chaingunbarrelPack.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
//--------------------------------------------------------------------------
|
||||
//
|
||||
// Chaingun barrel pack
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
datablock ShapeBaseImageData(ChaingunBarrelPackImage)
|
||||
{
|
||||
mass = 15;
|
||||
|
||||
shapeFile = "pack_barrel_fusion.dts";
|
||||
item = ChaingunBarrelPack;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
turretBarrel = "ChaingunBarrelLarge";
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateTransitionOnTriggerUp[1] = "Deactivate";
|
||||
|
||||
stateName[2] = "Deactivate";
|
||||
stateScript[2] = "onDeactivate";
|
||||
stateTransitionOnTimeOut[2] = "Idle";
|
||||
|
||||
isLarge = true;
|
||||
};
|
||||
|
||||
datablock ItemData(ChaingunBarrelPack)
|
||||
{
|
||||
className = Pack;
|
||||
catagory = "Packs";
|
||||
shapeFile = "pack_barrel_fusion.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
rotate = true;
|
||||
image = "ChaingunBarrelPackImage";
|
||||
pickUpName = "a heavy chaingun barrel pack";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
function ChaingunBarrelPackImage::onActivate(%data, %obj, %slot)
|
||||
{
|
||||
checkTurretMount(%data, %obj, %slot); // This cheks if there is a turret where the player is aiming.
|
||||
}
|
||||
|
||||
function ChaingunBarrelPackImage::onDeactivate(%data, %obj, %slot)
|
||||
{
|
||||
%obj.setImageTrigger($BackpackSlot, false);
|
||||
}
|
||||
|
||||
function ChaingunBarrelPack::onPickup(%this, %obj, %shape, %amount)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
166
Construction/scripts/packs/cloakingpack.cs
Normal file
166
Construction/scripts/packs/cloakingpack.cs
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
// ------------------------------------------------------------------
|
||||
// CLOAKING PACK
|
||||
//
|
||||
// When activated, this pack cloaks the user from all visual detection
|
||||
// by other players and cameras. This is a local effect only (someone standing
|
||||
// next to the cloaked player will still be visible). Motion sensors will
|
||||
// still detect a (moving) cloaked player.
|
||||
//
|
||||
// When not activated, the pack creates a localized passive sensor dampening
|
||||
// field. The user will not be visible to any non-motion-detecting sensor.
|
||||
//
|
||||
//Only light armors may equip with this item.
|
||||
|
||||
datablock EffectProfile(CloakingPackActivateEffect)
|
||||
{
|
||||
effectname = "packs/cloak_on";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 2.5;
|
||||
};
|
||||
|
||||
datablock AudioProfile(CloakingPackActivateSound)
|
||||
{
|
||||
filename = "fx/packs/cloak_on.wav";
|
||||
description = CloseLooping3d;
|
||||
preload = true;
|
||||
effect = CloakingPackActivateEffect;
|
||||
};
|
||||
|
||||
datablock ShapeBaseImageData(CloakingPackImage)
|
||||
{
|
||||
shapeFile = "pack_upgrade_cloaking.dts";
|
||||
item = CloakingPack;
|
||||
mountPoint = 1;
|
||||
offset = "0 0 0";
|
||||
|
||||
usesEnergy = true;
|
||||
minEnergy = 3;
|
||||
|
||||
stateName[0] = "Idle";
|
||||
stateTransitionOnTriggerDown[0] = "Activate";
|
||||
|
||||
stateName[1] = "Activate";
|
||||
stateScript[1] = "onActivate";
|
||||
stateSequence[1] = "fire";
|
||||
stateSound[1] = CloakingPackActivateSound;
|
||||
stateEnergyDrain[1] = 12;
|
||||
stateTransitionOnTriggerUp[1] = "Deactivate";
|
||||
stateTransitionOnNoAmmo[1] = "Deactivate";
|
||||
|
||||
stateName[2] = "Deactivate";
|
||||
stateScript[2] = "onDeactivate";
|
||||
stateTransitionOnTimeout[2] = "Idle";
|
||||
};
|
||||
|
||||
datablock ItemData(CloakingPack)
|
||||
{
|
||||
className = Pack;
|
||||
catagory = "Packs";
|
||||
shapeFile = "pack_upgrade_cloaking.dts";
|
||||
mass = 1;
|
||||
elasticity = 0.2;
|
||||
friction = 0.6;
|
||||
pickupRadius = 2;
|
||||
rotate = true;
|
||||
image = "CloakingPackImage";
|
||||
pickUpName = "a cloaking pack";
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
function CloakingPackImage::onMount(%data, %obj, %node)
|
||||
{
|
||||
// player is sensor-invisible while wearing pack (except to motion sensors)
|
||||
%obj.setPassiveJammed(true);
|
||||
}
|
||||
|
||||
function CloakingPackImage::onUnmount(%data, %obj, %node)
|
||||
{
|
||||
%obj.setPassiveJammed(false);
|
||||
%obj.setCloaked(false);
|
||||
%obj.setImageTrigger(%node, false);
|
||||
}
|
||||
|
||||
// make player completely invisible to all players/sensors (except motion)
|
||||
function CloakingPackImage::onActivate(%data, %obj, %slot)
|
||||
{
|
||||
if(%obj.reCloak !$= "")
|
||||
{
|
||||
Cancel(%obj.reCloak);
|
||||
%obj.reCloak = "";
|
||||
}
|
||||
|
||||
if(%obj.client.armor $= "Light" || %obj.client.armor $= "Pure")
|
||||
{
|
||||
// can the player currently cloak (function returns "true" or reason for failure)?
|
||||
if(%obj.canCloak() $= "true")
|
||||
{
|
||||
messageClient(%obj.client, 'MsgCloakingPackOn', '\c2Cloaking pack on.');
|
||||
%obj.setCloaked(true);
|
||||
if ( !isDemo() )
|
||||
commandToClient( %obj.client, 'setCloakIconOn' );
|
||||
}
|
||||
else
|
||||
{
|
||||
// notify player that they cannot cloak
|
||||
messageClient(%obj.client, 'MsgCloakingPackFailed', '\c2Jamming field prevents cloaking.');
|
||||
%obj.setImageTrigger(%slot, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// hopefully avoid some loopholes
|
||||
messageClient(%obj.client, 'MsgCloakingPackInvalid', '\c2Cloaking available for light armors only.');
|
||||
%obj.setImageTrigger(%slot, false);
|
||||
}
|
||||
}
|
||||
|
||||
function CloakingPackImage::onDeactivate(%data, %obj, %slot)
|
||||
{
|
||||
if(%obj.reCloak !$= "")
|
||||
{
|
||||
Cancel(%obj.reCloak);
|
||||
%obj.reCloak = "";
|
||||
}
|
||||
|
||||
// if pack is not on then dont bother...
|
||||
if(%obj.getImageState($BackpackSlot) $= "activate")
|
||||
messageClient(%obj.client, 'MsgCloakingPackOff', '\c2Cloaking pack off.');
|
||||
|
||||
%obj.setCloaked(false);
|
||||
%obj.setImageTrigger(%slot, false);
|
||||
if ( !isDemo() )
|
||||
commandToClient( %obj.client, 'setCloakIconOff' );
|
||||
}
|
||||
|
||||
function CloakingPack::onPickup(%this, %obj, %shape, %amount)
|
||||
{
|
||||
// created to prevent console errors
|
||||
}
|
||||
|
||||
function ShapeBaseData::onForceUncloak(%this, %obj, %reason)
|
||||
{
|
||||
// dummy
|
||||
}
|
||||
|
||||
function Armor::onForceUncloak(%this, %obj, %reason)
|
||||
{
|
||||
%pack = %obj.getMountedImage($BackpackSlot);
|
||||
if((%pack <= 0) || (%pack.item !$= "CloakingPack"))
|
||||
return;
|
||||
|
||||
if(%obj.getImageState($BackpackSlot) $= "activate")
|
||||
{
|
||||
// cancel recloak thread
|
||||
if(%obj.reCloak !$= "")
|
||||
{
|
||||
Cancel(%obj.reCloak);
|
||||
%obj.reCloak = "";
|
||||
}
|
||||
|
||||
messageClient(%obj.client, 'MsgCloakingPackOff', '\c2Cloaking pack off. Jammed.');
|
||||
%obj.setCloaked(false);
|
||||
%obj.setImageTrigger($BackpackSlot, false);
|
||||
}
|
||||
}
|
||||
248
Construction/scripts/packs/cratepack.cs
Normal file
248
Construction/scripts/packs/cratepack.cs
Normal 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
Construction/scripts/packs/deconExamples.cs
Normal file
51
Construction/scripts/packs/deconExamples.cs
Normal 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
Construction/scripts/packs/decorationpack.cs
Normal file
376
Construction/scripts/packs/decorationpack.cs
Normal 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
Construction/scripts/packs/discturret.cs
Normal file
257
Construction/scripts/packs/discturret.cs
Normal 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);
|
||||
}
|
||||
|
||||
322
Construction/scripts/packs/doorbu.cs
Normal file
322
Construction/scripts/packs/doorbu.cs
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
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