76
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
function GameConnection::spawnPlayer(%this) {
[irrelevant code]
$LoadingBricks_BrickGroup = %this.brickgroup;
$LoadingBricks_Client = %this;
$LoadingBricks_ColorMethod = 3;
$LoadingBricks_DoOwnership = false;
$LoadingBricks_FileName = "Add-Ons/Gamemode_Numb3rs/bls/station.bls";
$LoadingBricks_Silent = true;
$LoadingBricks_StartTime = getSimTime();
$loadOffset = %xpos SPC %ypos SPC %zpos;
ServerLoadSaveFile_Start($LoadingBricks_FileName);
return parent::spawnPlayer(%this);
}
function fxDTSBrick::onLoadPlant(%this) {
parent::onLoadPlant(%this);
// not everything is set automatically
%this.schedule(50,renameNumbersBrick);
}
function fxDTSBrick::renameNumbersBrick(%this) {
//only works on SP for whatever reason
//%client = %this.client;
if(%client $= "") {
%group_name = %this.getGroup().getName();
%client = findClientByBL_ID(getSubStr(%group_name,stripos(%group_name,"_")+1,strLen(%group_name)));
}
[irrelevant code]
function takeGameProjProjectileClass::onExplode(%this,%obj) {
%client = %obj.client;
if(%obj.markedForExplosion) {
%client.play2D(takeProjExplode);
if(%obj.combo > %client.highestCombo) {
%client.highestCombo = %obj.combo;
}
if(%obj.combo >= 20) {
%color = "<color:" @ RGBToHex(getColorIDTable(%client.color)) @ ">";
$DefaultMinigame.messageAll('',%color @ %client.name SPC "\c6obtained a\c3 x" @ %obj.combo SPC "combo!");
}
cancel(%obj.positionLoop);
Sky.flashColor(%client,1);
%client.saveTakeGame();
return parent::onExplode(%this,%obj);
}
%proj = new Projectile(TempProjectile) {
dataBlock = %obj.dataBlock;
initialPosition = %obj.getPosition();
initialVelocity = %obj.getVelocity();
position = %obj.getPosition();
rotation = %obj.rotation;
scale = "1 1 1";
sourceObject = %obj.sourceObject;
sourceSlot = %obj.sourceSlot;
client = %obj.client;
originPoint = %obj.getPosition();
sourceClient = %obj.sourceClient;
combo = %obj.combo;
};
MissionCleanup.add(%proj);
%proj.setName("Laser" @ %proj.getID());
%client.projectile = %proj;
%proj.checkPosition();
%obj.delete();
}
//COMMAND dfg
//AUTHOR TheBlackParrot 18701
//INFO Randomizes all of your bricks' color
//LIMIT none
//enabled
$Pref::CSCS::DFGLimit = 10000; // extra prefs CAN be defined and exported, the CSCS core takes care of exporting
function serverCmdDFG(%this) {
if(!%this.isCSCSAllowed($Pref::CSCS::AllowDFGCommand)) {
// this if statement will check to see if the player is allowed to use the command
// $Pref::CSCS::Allow[command]Command is the syntax
%this.logCSCSCommand("dfg","",0);
return;
}
if(!%this.checkCSCSCommandSpam()) {
// built in spam checker, this applies to all commands that have this if statement
return;
}
// logs that the user could use the command
%this.logCSCSCommand("dfg","",1);
%group = "BrickGroup_" @ %this.bl_id;
if(%this.isAdmin || %group.getCount < $Pref::CSCS::DFGLimit) {
%count = %group.getCount();
} else {
%count = $Pref::CSCS::DFGLimit;
}
for(%i=0;%i<%count;%i++) {
%brick = %group.getObject(%i);
if(%brick.originColor $= "") {
%brick.originColor = %brick.colorID;
}
%brick.setColor(getRandom(0,4));
}
}
//COMMAND cmds
//AUTHOR TheBlackParrot 18701
//INFO Lists all available CSCS commands
//LIMIT none
//enabled
function serverCmdCmds(%this) {
if(!%this.isCSCSAllowed($Pref::CSCS::AllowResetCommand)) {
%this.logCSCSCommand("cmds","",0);
return;
}
if(!%this.checkCSCSCommandSpam()) {
return;
}
%this.logCSCSCommand("cmds","",1);
messageClient(%this,'',"\c4Command list:");
for(%i=0;%i<$CSCS::CommandCount;%i++) {
%args = "";
%arg = "";
%argstr = "";
%name = $CSCS::Command[%i,name] @ "Command";
%val = $Pref::CSCS::Allow[%name];
if(%this.isCSCSAllowed(%val,1)) {
%c++;
%args = $CSCS::Command[%i,args];
while(strLen(%args)) {
if(stripos(%args,";") != -1) {
%arg = getSubStr(%args,0,stripos(%args,";"));
} else {
%arg = %args;
}
if(%argstr $= "") {
%argstr = "[" @ %arg @ "]";
} else {
%argstr = %argstr SPC "[" @ %arg @ "]";
}
if(stripos(%args,";") != -1) {
%args = getSubStr(%args,stripos(%args,";")+1,strLen(%args));
} else {
%args = "";
}
}
%argstr = "\c5" @ %argstr @ " ";
switch(%val) {
case 0:
%limitstr = "";
case 1:
%limitstr = "<color:aaaaaa>(Admin)";
case 2:
%limitstr = "<color:ffbb00>(Super Admin)";
case 3:
%limitstr = "<color:00ffff>(Host)";
}
messageClient(%this,'',"\c2" @ %c @ ". \c3/" @ $CSCS::Command[%i,name] SPC %argstr @ "\c7--\c6" SPC $CSCS::Command[%i,desc] SPC %limitstr);
}
}
}
function serverCmdCommands(%this) { serverCmdCmds(%this); }
function serverCmdCSCS(%this) { serverCmdCmds(%this); }
function serverCmdCmdList(%this) { serverCmdCmds(%this); }
//COMMAND slap player or id
//AUTHOR TheBlackParrot 18701
//INFO Moves players out of the way
//LIMIT admin
//enabled
function serverCmdSlap(%this,%target) {
if(!%this.isCSCSAllowed($Pref::CSCS::AllowSlapCommand)) {
%this.logCSCSCommand("slap",%target,0);
return;
}
if(!%this.checkCSCSCommandSpam()) {
return;
}
%targetObject = findClientByName(%target);
if(!isObject(%targetObject)) {
%targetObject = findClientByBL_ID(%targetObject);
if(!isObject(%targetObject)) {
%this.CSCSError(%target SPC "does not exist!");
return;
}
}
if(!isObject(%targetObject.player)) {
%this.CSCSError(%targetObject.name SPC "has not spawned!");
return;
}
%this.logCSCSCommand("slap",%target,1);
messageClient(%targetObject,'',"\c3" @ %this.name SPC "\c6slapped you!");
%targetObject.play2D(CSCS_slap);
messageClient(%this,'',"\c6You have slapped\c3" SPC %targetObject.name);
%targetObject.player.addVelocity(getRandom(-20,20) SPC getRandom(-20,20) SPC getRandom(0,20));
}
//explosion
datablock AudioProfile(combo1)
{
filename = "./sounds/combo1.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(combo2:combo1) { filename = "./sounds/combo2.wav"; };
datablock AudioProfile(combo3:combo1) { filename = "./sounds/combo3.wav"; };
datablock AudioProfile(combo4:combo1) { filename = "./sounds/combo4.wav"; };
datablock AudioProfile(combo5:combo1) { filename = "./sounds/combo5.wav"; };
datablock AudioProfile(takeProjExplode:combo1) { filename = "./sounds/explode.wav"; };
datablock AudioProfile(takeProjHit:combo1) { filename = "./sounds/hit.wav"; };
datablock AudioProfile(takeProjFire:combo1) { filename = "./sounds/fire.wav"; };
datablock ParticleData(takeGameProjExplosionParticle)
{
dragCoefficient = 3;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 700;
lifetimeVarianceMS = 300;
textureName = "base/data/particles/dot";
spinSpeed = 0;
spinRandomMin = 0;
spinRandomMax = 0;
colors[0] = "1 1 1 0.1";
colors[1] = "1 1 1 0.5";
colors[2] = "1 1 1 1";
sizes[0] = 2;
sizes[1] = 2;
sizes[2] = 2;
times[0] = 0;
times[1] = 0.1;
times[2] = 0.2;
useInvAlpha = false;
};
datablock ParticleEmitterData(takeGameProjExplosionEmitter)
{
lifeTimeMS = 500;
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 15;
velocityVariance = 8.0;
ejectionOffset = 1.25;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "takeGameProjExplosionParticle";
uiName = "takeGameProj Explosion";
};
datablock ExplosionData(takeGameProjExplosion)
{
//explosionShape = "";
lifeTimeMS = 500;
emitter[0] = takeGameProjExplosionEmitter;
soundProfile = takeProjExplode;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = true;
camShakeFreq = "2.0 2.0 2.0";
camShakeAmp = "1.0 1.0 1.0";
camShakeDuration = 0.5;
camShakeRadius = 10.0;
// Dynamic light
lightStartRadius = 3;
lightEndRadius = 1;
lightStartColor = "00.0 0.6 0.9";
lightEndColor = "0 0 0";
};
//bullet trail effects
datablock ParticleData(takeGameProjTrailParticle)
{
dragCoefficient = 3;
gravityCoefficient = -0.0;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 15000;
lifetimeVarianceMS = 0;
textureName = "base/data/particles/dot";
spinSpeed = 0;
spinRandomMin = 0;
spinRandomMax = 0;
colors[0] = "1 1 1 1";
colors[1] = "1 1 1 1";
colors[2] = "1 1 1 1";
sizes[0] = 4;
sizes[1] = 4;
sizes[2] = 4;
times[0] = 0;
times[1] = 0;
times[2] = 0;
useInvAlpha = false;
};
datablock ParticleEmitterData(takeGameProjTrailEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 90;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "takeGameProjTrailParticle";
uiName = "takeGameProj Trail";
};
datablock ProjectileData(takeGameProjProjectile)
{
projectileShapeName = "base/data/shapes/empty.dts";
directDamage = 0;
directDamageType = $DamageType::Default;
radiusDamageType = $DamageType::Default;
classname = "takeGameProjProjectileClass";
impactImpulse = 0;
verticalImpulse = 0;
explosion = takeGameProjExplosion;
bloodExplosion = takeGameProjExplosion;
particleEmitter = takeGameProjTrailEmitter;
explodeOnPlayerImpact = false;
explodeOnDeath = true;
brickExplosionRadius = 0;
brickExplosionImpact = 0; //destroy a brick if we hit it directly?
brickExplosionForce = 0;
brickExplosionMaxVolume = 0; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 0; //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
sound = "";
muzzleVelocity = 65;
velInheritFactor = 1.0;
armingDelay = 15000;
lifetime = 15000;
fadeDelay = 14500;
bounceElasticity = 0.99;
bounceFriction = 0.00;
isBallistic = true;
gravityMod = 0.0;
hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";
uiName = "takeGameProj";
};
function createDynamicTGProjectiles() {
for(%i=1;%i<64;%i++) {
%string[0] = "datablock ParticleData(takeGameProjTrailParticle" @ %i @ " : takeGameProjTrailParticle) { colors[0] = colors[1] = colors[2] = \"" @ getColorIDTable(%i) @ "\"; };";
%string[1] = "datablock ParticleEmitterData(takeGameProjTrailEmitter" @ %i @ " : takeGameProjTrailEmitter) { particles = \"takeGameProjTrailParticle" @ %i @ "\"; };";
%string[2] = "datablock ProjectileData(takeGameProjProjectile" @ %i @ " : takeGameProjProjectile) { particleEmitter = \"takeGameProjTrailEmitter" @ %i @ "\"; };";
for(%j=0;%j<3;%j++) {
echo(%string[%j]);
}
//eval()
}
//datablock ParticleData("takeGameProjTrailParticle" @ %i : takeGameProjTrailParticle) {
// colors[0] = colors[1] = colors[2] = getColorIDTable(%i);
//};
//datablock ParticleEmitterData("takeGameProjTrailEmitter" @ %i : takeGameProjTrailEmitter) {
// particles = "takeGameProjTrailParticle" @ %i;
//};
//datablock ProjectileData("takeGameProjProjectile" @ %i : takeGameProjProjectile) {
// particleEmitter = "takeGameProjTrailEmitter" @ %i;
//};
}
createDynamicTGProjectiles();
package takeGameProjPackage {
function Projectile::onAdd(%this,%obj) {
%obj.client.projectile = %obj;
return parent::onAdd(%this,%obj);
}
};
activatePackage(takeGameProjPackage);
function takeGameProjProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%col.getType() & $TypeMasks::FXBrickObjectType) {
if(!isObject(%obj.client)) {
return;
}
if(!isObject(%obj.client.minigame)) {
return;
}
%client = %obj.client;
if(%col.takenBy != %client) {
%obj.combo++;
if(%obj.combo >= 5) {
$DefaultMinigame.messageAll('',"\c4" @ %client.name SPC "\c6obtained a\c3 x" @ %obj.combo SPC "combo!");
%sound = "combo" @ %obj.combo-4;
if(!isObject(%sound)) {
%sound = "combo5";
}
$DefaultMinigame.playSound(%sound);
}
%client.play2D(takeProjHit);
%col.playSound(takeProjHit);
}
%col.takenBy = %client;
%col.setColor(%client.color);
}
}
function takeGameProjProjectile::onExplode(%this,%obj) {
%obj.client.play2D(takeProjExplode);
}