mirror of
https://github.com/Ragora/T2-ACCM.git
synced 2026-01-20 19:34:45 +00:00
278 lines
6.8 KiB
PHP
278 lines
6.8 KiB
PHP
//---------------------------------------------------------
|
|
// Zombie Spawn Point
|
|
//---------------------------------------------------------
|
|
|
|
$zombie::detectDist = 500;
|
|
$zombie::lungDist = 10;
|
|
$zombie::LKillDist = 5;
|
|
$zombie::Rupvec = 750;
|
|
$zombie::killpoints = 2;
|
|
|
|
datablock AudioProfile(ZombieMoan)
|
|
{
|
|
filename = "fx/environment/growl3.wav";
|
|
description = AudioClose3d;
|
|
preload = true;
|
|
};
|
|
|
|
datablock AudioProfile(ZombieHOWL)
|
|
{
|
|
filename = "fx/environment/Yeti_Howl1.wav";
|
|
description = AudioBomb3d;
|
|
preload = true;
|
|
};
|
|
|
|
datablock StaticShapeData(DeployedZSpawnBase) : StaticShapeDamageProfile {
|
|
className = "lightbase";
|
|
shapeFile = "pack_deploy_sensor_motion.dts";
|
|
|
|
maxDamage = 2.5;
|
|
destroyedLevel = 2.5;
|
|
disabledLevel = 2.0;
|
|
|
|
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 Zombie Spawner';
|
|
deployAmbientThread = true;
|
|
debrisShapeName = "debris_generic_small.dts";
|
|
debris = DeployableDebris;
|
|
heatSignature = 0;
|
|
needsPower = true;
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZSpawnDeployableImage) {
|
|
mass = 20;
|
|
emap = true;
|
|
shapeFile = "stackable1s.dts";
|
|
item = ZSpawnDeployable;
|
|
mountPoint = 1;
|
|
offset = "0 0 0";
|
|
deployed = DeployedZSpawnBase;
|
|
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(ZSpawnDeployable) {
|
|
className = Pack;
|
|
catagory = "Deployables";
|
|
shapeFile = "stackable1s.dts";
|
|
mass = 5.0;
|
|
elasticity = 0.2;
|
|
friction = 0.6;
|
|
pickupRadius = 1;
|
|
rotate = true;
|
|
image = "ZSpawnDeployableImage";
|
|
pickUpName = "a Zombie Spawn pack";
|
|
heatSignature = 0;
|
|
emap = true;
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZHead)
|
|
{
|
|
shapeFile = "bioderm_heavy.dts";
|
|
emap = false;
|
|
mountPoint = 1;
|
|
offset = "0 0.25 -1.5";
|
|
rotation = "1 0 0 15";
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZBack)
|
|
{
|
|
shapeFile = "bioderm_medium.dts";
|
|
emap = false;
|
|
mountPoint = 1;
|
|
offset = "0 0.25 -1.25";
|
|
rotation = "-1 0 0 10";
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZDummyslotImg)
|
|
{
|
|
shapeFile = "turret_muzzlepoint.dts";
|
|
emap = false;
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZDummyslotImg2)
|
|
{
|
|
shapeFile = "turret_muzzlepoint.dts";
|
|
emap = false;
|
|
offset = "-1.5 0 0";
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZWingImage)
|
|
{
|
|
shapeFile = "flag.dts";
|
|
mountPoint = 1;
|
|
|
|
offset = "0 0 0"; // L/R - F/B - T/B
|
|
rotation = "0 1 0 90"; // L/R - F/B - T/B
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZWingImage2)
|
|
{
|
|
shapeFile = "flag.dts";
|
|
mountPoint = 1;
|
|
|
|
offset = "0 0 0"; // L/R - F/B - T/B
|
|
rotation = "0 -1 0 90"; // L/R - F/B - T/B
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZWingAltImage)
|
|
{
|
|
shapeFile = "flag.dts";
|
|
mountPoint = 1;
|
|
|
|
offset = "0 0 0"; // L/R - F/B - T/B
|
|
rotation = "-0.5 2 0 35"; // L/R - F/B - T/B
|
|
};
|
|
|
|
datablock ShapeBaseImageData(ZWingAltImage2)
|
|
{
|
|
shapeFile = "flag.dts";
|
|
mountPoint = 1;
|
|
|
|
offset = "0 0 0"; // L/R - F/B - T/B
|
|
rotation = "-0.5 -2 0 35"; // L/R - F/B - T/B
|
|
};
|
|
|
|
function ZSpawnDeployableImage::testObjectTooClose(%item) {
|
|
return "";
|
|
}
|
|
function ZSpawnDeployableImage::testNoTerrainFound(%item) {}
|
|
function ZSpawnDeployable::onPickup(%this, %obj, %shape, %amount) {}
|
|
|
|
function ZSpawnDeployableImage::onDeploy(%item, %plyr, %slot) {
|
|
%className = "StaticShape";
|
|
|
|
%playerVector = vectorNormalize(-1 * getWord(%plyr.getEyeVector(),1) SPC getWord(%plyr.getEyeVector(),0) SPC "0");
|
|
|
|
if (vAbs(floorVec(%item.surfaceNrm,100)) $= "0 0 1")
|
|
%item.surfaceNrm2 = %playerVector;
|
|
else
|
|
%item.surfaceNrm2 = vectorNormalize(vectorCross(%item.surfaceNrm,"0 0 -1"));
|
|
|
|
%rot = fullRot(%item.surfaceNrm,%item.surfaceNrm2);
|
|
|
|
%deplObj = new (%className)() {
|
|
dataBlock = %item.deployed;
|
|
};
|
|
|
|
// 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);
|
|
%deplObj.light.lightBase = %deplObj;
|
|
|
|
// set the sensor group if it needs one
|
|
if (%deplObj.getTarget() != -1)
|
|
setTargetSensorGroup(%deplObj.getTarget(), %plyr.client.team);
|
|
|
|
// place the deployable in the MissionCleanup/Deployables group (AI reasons)
|
|
addToDeployGroup(%deplObj);
|
|
|
|
//let the AI know as well...
|
|
AIDeployObject(%plyr.client, %deplObj);
|
|
|
|
// play the deploy sound
|
|
serverPlay3D(%item.deploySound, %deplObj.getTransform());
|
|
|
|
// increment the team count for this deployed object
|
|
$TeamDeployedCount[%plyr.team, %item.item]++;
|
|
|
|
addDSurface(%item.surface,%deplObj);
|
|
|
|
%deplObj.playThread($PowerThread,"Power");
|
|
%deplObj.playThread($AmbientThread,"ambient");
|
|
|
|
// take the deployable off the player's back and out of inventory
|
|
%plyr.unmountImage(%slot);
|
|
%plyr.decInventory(%item.item, 1);
|
|
|
|
// set power frequency
|
|
%deplObj.powerFreq = %plyr.powerFreq;
|
|
|
|
// Power object
|
|
checkPowerObject(%deplObj);
|
|
|
|
%deplObj.Ztype = %plyr.packSet + 1;
|
|
if(%deplObj.Ztype == 3) // Lord Zombie
|
|
%deplObj.numZ = 2;
|
|
if(%deplObj.Ztype == 6) // Demon Mother
|
|
%deplObj.numZ = 2;
|
|
|
|
%deplobj.spawnTypeSet = %plyr.expertset;
|
|
|
|
return %deplObj;
|
|
}
|
|
|
|
function DeployedZSpawnBase::onDestroyed(%this,%obj,%prevState) {
|
|
if (%obj.isRemoved)
|
|
return;
|
|
%obj.isRemoved = true;
|
|
Parent::onDestroyed(%this,%obj,%prevState);
|
|
$TeamDeployedCount[%obj.team, ZSpawnDeployable]--;
|
|
remDSurface(%obj);
|
|
%obj.schedule(500, "delete");
|
|
if (%obj.ZCloop !$= "")
|
|
Cancel(%obj.ZCLoop);
|
|
}
|
|
|
|
function DeployedZSpawnBase::disassemble(%data,%plyr,%obj) {
|
|
if (%obj.ZCloop !$= "")
|
|
Cancel(%obj.ZCLoop);
|
|
disassemble(%data,%plyr,%obj);
|
|
}
|
|
|
|
function ZSpawnDeployableImage::onMount(%data, %obj, %node) {
|
|
%obj.hasZSpawn = true;
|
|
%obj.expertset = 0;
|
|
}
|
|
|
|
function ZSpawnDeployableImage::onUnmount(%data, %obj, %node) {
|
|
%obj.hasZSpawn = "";
|
|
}
|
|
|
|
function DeployedZSpawnBase::onGainPowerEnabled(%data,%obj) {
|
|
if(%obj.spawnTypeSet == 1)
|
|
%obj.numz = 0;
|
|
if (%obj.ZCloop !$= "")
|
|
Cancel(%obj.ZCLoop);
|
|
%obj.ZCLoop = schedule(1000, 0, "ZcreateLoop", %obj);
|
|
Parent::onGainPowerEnabled(%data,%obj);
|
|
}
|
|
|
|
function DeployedZSpawnBase::onLosePowerDisabled(%data,%obj) {
|
|
if (%obj.ZCloop !$= "")
|
|
Cancel(%obj.ZCLoop);
|
|
Parent::onLosePowerDisabled(%data,%obj);
|
|
}
|