mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-14 15:44:34 +00:00
Merge branch 'Dev' into Stable
This commit is contained in:
commit
bddef9489c
2 changed files with 100 additions and 104 deletions
|
|
@ -457,17 +457,64 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%sound = %defaultSound;
|
%sound = %defaultSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(%targetObject.holdingFlag)
|
||||||
|
{
|
||||||
%tgPos = %targetObject.getPosition();
|
%tgPos = %targetObject.getPosition();
|
||||||
%terrHeight = getTerrainHeight(getWords(%tgPos,0,1));
|
%terrHeight = getTerrainHeight(getWords(%tgPos,0,1));
|
||||||
%playerHeight = mAbs(getWord(%tgPos,2) - %terrHeight);
|
%playerHeight = mAbs(getWord(%tgPos,2) - %terrHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(%targetObject.holdingFlag && %playerHeight >= 100)
|
||||||
|
{
|
||||||
|
// tr2 style flag drop.. it does kill the rabbit
|
||||||
|
|
||||||
|
%chance = mFloor(20 - %distance/%playerHeight);
|
||||||
|
if(%chance <= 0) %chance = 1;
|
||||||
|
|
||||||
|
if(%ma && getRandom(1,100) <= %chance)
|
||||||
|
{
|
||||||
|
Game.playerDroppedFlag(%targetObject);
|
||||||
|
|
||||||
|
%position = %targetObject.getPosition();
|
||||||
|
%count = 40;
|
||||||
|
%ttl = 60000;
|
||||||
|
%player = %targetObject;
|
||||||
|
if( %position $= "" )
|
||||||
|
{
|
||||||
|
error("No position passed!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if( %count <= 0 )
|
||||||
|
{
|
||||||
|
error("Number of flags to spew must be greater than 0!");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
%flagArr[0] = LakFakeFlag8;
|
||||||
|
%flagArr[1] = LakFakeFlag2;
|
||||||
|
%flagArr[2] = LakFakeFlag4;
|
||||||
|
|
||||||
|
while( %count > 0 )
|
||||||
|
{
|
||||||
|
%index = mFloor(getRandom() * 3);
|
||||||
|
// throwDummyFlag(location, Datablock);
|
||||||
|
LakRabbitGame::throwDummyFlag(%position, %flagArr[%index], %player, %ttl);
|
||||||
|
%count--;
|
||||||
|
}
|
||||||
|
|
||||||
|
%targetObject.blowup();
|
||||||
|
%targetObject.scriptKill($DamageType::Explosion);
|
||||||
|
%sound = '~wfx/misc/MA1.wav';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// special knockback if you hit too close, max 15% chance (point blank).. 5% at 30meters, 1% chance for any MA
|
// special knockback if you hit too close, max 15% chance (point blank).. 5% at 30meters, 1% chance for any MA
|
||||||
|
|
||||||
// Slap based on a Disc headshot
|
// Slap based on a Disc headshot
|
||||||
//%chance = mFloor(25 - %distance/3);
|
//%chance = mFloor(25 - %distance/3);
|
||||||
//if(%ma && getRandom(1,50) <= %chance && %targetObject.client.headshot)
|
//if(%ma && getRandom(1,50) <= %chance && %targetObject.client.headshot)
|
||||||
|
|
||||||
|
|
||||||
//Normal Slap
|
//Normal Slap
|
||||||
%chance = mFloor(15 - %distance/3);
|
%chance = mFloor(15 - %distance/3);
|
||||||
if(%chance <= 0) %chance = 1;
|
if(%chance <= 0) %chance = 1;
|
||||||
|
|
@ -509,41 +556,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
messageAll('msgSlapmessage','\c0%1 is taking a short tour around the map.', %targetObject.client.name );
|
messageAll('msgSlapmessage','\c0%1 is taking a short tour around the map.', %targetObject.client.name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(%ma && getRandom(1,35) <= %chance && %playerHeight >= 100 && %targetObject.holdingFlag)
|
|
||||||
{
|
|
||||||
|
|
||||||
Game.playerDroppedFlag(%targetObject);
|
|
||||||
|
|
||||||
%position = %targetObject.getPosition();
|
|
||||||
%count = 40;
|
|
||||||
%ttl = 60000;
|
|
||||||
%player = %targetObject;
|
|
||||||
if( %position $= "" )
|
|
||||||
{
|
|
||||||
error("No position passed!");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if( %count <= 0 )
|
|
||||||
{
|
|
||||||
error("Number of flags to spew must be greater than 0!");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
%flagArr[0] = LakFakeFlag8;
|
|
||||||
%flagArr[1] = LakFakeFlag2;
|
|
||||||
%flagArr[2] = LakFakeFlag4;
|
|
||||||
|
|
||||||
while( %count > 0 )
|
|
||||||
{
|
|
||||||
%index = mFloor(getRandom() * 3);
|
|
||||||
// throwDummyFlag(location, Datablock);
|
|
||||||
LakRabbitGame::throwDummyFlag(%position, %flagArr[%index], %player, %ttl);
|
|
||||||
%count--;
|
|
||||||
}
|
|
||||||
|
|
||||||
%targetObject.blowup();
|
|
||||||
%targetObject.scriptKill($DamageType::Explosion);
|
|
||||||
%sound = '~wfx/misc/MA1.wav';
|
|
||||||
}
|
}
|
||||||
%weapon = "Disc";
|
%weapon = "Disc";
|
||||||
case $DamageType::Grenade:
|
case $DamageType::Grenade:
|
||||||
|
|
@ -2757,7 +2769,7 @@ function LakRabbitGame::throwDummyFlag(%position, %datablock, %player, %ttl)
|
||||||
|
|
||||||
%droppedflag.applyImpulse(%pos, %vec);
|
%droppedflag.applyImpulse(%pos, %vec);
|
||||||
|
|
||||||
%droppedFlag.die = schedule(getrandom(1500,3500), 0, "removeLakFakeFlag", %droppedflag);
|
%droppedFlag.die = schedule(getrandom(1500,5500), 0, "removeLakFakeFlag", %droppedflag);
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeLakFakeFlag(%flag)
|
function removeLakFakeFlag(%flag)
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ function VehicleData::onDestroyed(%data, %obj, %prevState)
|
||||||
%zVel = (getRandom() * 100.0) + 50.0;
|
%zVel = (getRandom() * 100.0) + 50.0;
|
||||||
%flingVel = %xVel @ " " @ %yVel @ " " @ %zVel;
|
%flingVel = %xVel @ " " @ %yVel @ " " @ %zVel;
|
||||||
%flingee.applyImpulse(%flingee.getTransform(), %flingVel);
|
%flingee.applyImpulse(%flingee.getTransform(), %flingVel);
|
||||||
echo("got player..." @ %flingee.getClassName());
|
//echo("got player..." @ %flingee.getClassName());
|
||||||
%flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Crash);
|
%flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Crash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -70,29 +70,13 @@ function VehicleData::onDestroyed(%data, %obj, %prevState)
|
||||||
%data.deleteAllMounted(%obj);
|
%data.deleteAllMounted(%obj);
|
||||||
// -----------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------
|
||||||
// z0dd - ZOD - Czar, 6/24/02. Move this vehicle out of the way so nothing collides with it.
|
// z0dd - ZOD - Czar, 6/24/02. Move this vehicle out of the way so nothing collides with it.
|
||||||
if(%data.getName() $="AssaultVehicle")
|
|
||||||
{
|
|
||||||
// %obj.setFrozenState(true);
|
|
||||||
%obj.schedule(500, "delete"); //was 2000
|
|
||||||
//%data.schedule(500, 'onAvoidCollisions', %obj);
|
|
||||||
|
|
||||||
//Transfer the vehicle far away
|
|
||||||
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
|
||||||
}
|
|
||||||
else if(%data.getName() $="BomberFlyer" || %data.getName() $="MobileBaseVehicle")
|
|
||||||
{
|
|
||||||
// %obj.setFrozenState(true);
|
|
||||||
%obj.schedule(2000, "delete"); //was 2000
|
|
||||||
//%data.schedule(500, 'onAvoidCollisions', %obj);
|
|
||||||
|
|
||||||
//Transfer the vehicle far away
|
|
||||||
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%obj.setFrozenState(true);
|
%obj.setFrozenState(true);
|
||||||
%obj.schedule(500, "delete"); //was 500
|
%obj.schedule(2000, "delete"); //was 500
|
||||||
}
|
%data.schedule(500, 'onAvoidCollisions', %obj);
|
||||||
|
|
||||||
|
//Transfer the vehicle far away
|
||||||
|
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue