mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60a84fdb35 | ||
|
|
74ed8c8cde | ||
|
|
47e1932279 | ||
|
|
bddef9489c | ||
|
|
e99b013183 | ||
|
|
97c9bf7270 |
|
|
@ -457,94 +457,106 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%sound = %defaultSound;
|
%sound = %defaultSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
%tgPos = %targetObject.getPosition();
|
if(%targetObject.holdingFlag)
|
||||||
%terrHeight = getTerrainHeight(getWords(%tgPos,0,1));
|
{
|
||||||
%playerHeight = mAbs(getWord(%tgPos,2) - %terrHeight);
|
%tgPos = %targetObject.getPosition();
|
||||||
|
%terrHeight = getTerrainHeight(getWords(%tgPos,0,1));
|
||||||
|
%playerHeight = mAbs(getWord(%tgPos,2) - %terrHeight);
|
||||||
|
}
|
||||||
|
|
||||||
// special knockback if you hit too close, max 15% chance (point blank).. 5% at 30meters, 1% chance for any MA
|
if(%targetObject.holdingFlag && %playerHeight >= 100)
|
||||||
|
{
|
||||||
|
// tr2 style flag drop.. it does kill the rabbit
|
||||||
|
|
||||||
// Slap based on a Disc headshot
|
%chance = mFloor(20 - %distance/%playerHeight);
|
||||||
//%chance = mFloor(25 - %distance/3);
|
if(%chance <= 0) %chance = 1;
|
||||||
//if(%ma && getRandom(1,50) <= %chance && %targetObject.client.headshot)
|
|
||||||
|
|
||||||
|
if(%ma && getRandom(1,100) <= %chance)
|
||||||
|
{
|
||||||
|
Game.playerDroppedFlag(%targetObject);
|
||||||
|
|
||||||
//Normal Slap
|
%position = %targetObject.getPosition();
|
||||||
%chance = mFloor(15 - %distance/3);
|
%count = 40;
|
||||||
if(%chance <= 0) %chance = 1;
|
%ttl = 60000;
|
||||||
|
%player = %targetObject;
|
||||||
if(%ma && getRandom(1,100) <= %chance)
|
if( %position $= "" )
|
||||||
{
|
{
|
||||||
if(%targetObject.holdingFlag)
|
error("No position passed!");
|
||||||
{
|
return 0;
|
||||||
Game.playerDroppedFlag(%targetObject);
|
|
||||||
//Added so cloak is turned off when slapped.
|
|
||||||
%targetObject.setCloaked(false);
|
|
||||||
%targetObject.freeDJ = 1;
|
|
||||||
}
|
|
||||||
if(%sourceObject.holdingFlag && Game.duelMode)
|
|
||||||
{
|
|
||||||
duelBonus(%sourceObject.client);
|
|
||||||
$LakDamaged[%targetObject.client] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// lower damage and make invincible to ground damage to make it a little more fun
|
|
||||||
%amount = 0.01;
|
|
||||||
%targetObject.setKnockback(true);
|
|
||||||
%targetObject.schedule(15000, "setKnockback", false);
|
|
||||||
|
|
||||||
%p = %targetObject.getWorldBoxCenter();
|
|
||||||
%muzzleVec = %sourceObject.getMuzzleVector(0);
|
|
||||||
%impulseVec = VectorScale(%muzzleVec, 25000);
|
|
||||||
%targetObject.applyImpulse(%p, %impulseVec);
|
|
||||||
%sound = '~wfx/misc/slapshot.wav';
|
|
||||||
|
|
||||||
%slapmsg = getRandom(1,3);
|
|
||||||
switch$(%slapmsg)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
messageAll('msgSlapmessage','\c0%1 wonders what the five fingers said to the face.', %targetObject.client.name );
|
|
||||||
case 2:
|
|
||||||
messageAll('msgSlapmessage','\c0%1 gets slapped the heck out!', %targetObject.client.name );
|
|
||||||
case 3:
|
|
||||||
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)
|
if( %count <= 0 )
|
||||||
{
|
{
|
||||||
|
error("Number of flags to spew must be greater than 0!");
|
||||||
Game.playerDroppedFlag(%targetObject);
|
return 0;
|
||||||
|
|
||||||
%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';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%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
|
||||||
|
|
||||||
|
// Slap based on a Disc headshot
|
||||||
|
//%chance = mFloor(25 - %distance/3);
|
||||||
|
//if(%ma && getRandom(1,50) <= %chance && %targetObject.client.headshot)
|
||||||
|
|
||||||
|
//Normal Slap
|
||||||
|
%chance = mFloor(15 - %distance/3);
|
||||||
|
if(%chance <= 0) %chance = 1;
|
||||||
|
|
||||||
|
if(%ma && getRandom(1,100) <= %chance)
|
||||||
|
{
|
||||||
|
if(%targetObject.holdingFlag)
|
||||||
|
{
|
||||||
|
Game.playerDroppedFlag(%targetObject);
|
||||||
|
//Added so cloak is turned off when slapped.
|
||||||
|
%targetObject.setCloaked(false);
|
||||||
|
%targetObject.freeDJ = 1;
|
||||||
|
}
|
||||||
|
if(%sourceObject.holdingFlag && Game.duelMode)
|
||||||
|
{
|
||||||
|
duelBonus(%sourceObject.client);
|
||||||
|
$LakDamaged[%targetObject.client] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// lower damage and make invincible to ground damage to make it a little more fun
|
||||||
|
%amount = 0.01;
|
||||||
|
%targetObject.setKnockback(true);
|
||||||
|
%targetObject.schedule(15000, "setKnockback", false);
|
||||||
|
|
||||||
|
%p = %targetObject.getWorldBoxCenter();
|
||||||
|
%muzzleVec = %sourceObject.getMuzzleVector(0);
|
||||||
|
%impulseVec = VectorScale(%muzzleVec, 25000);
|
||||||
|
%targetObject.applyImpulse(%p, %impulseVec);
|
||||||
|
%sound = '~wfx/misc/slapshot.wav';
|
||||||
|
|
||||||
|
%slapmsg = getRandom(1,3);
|
||||||
|
switch$(%slapmsg)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
messageAll('msgSlapmessage','\c0%1 wonders what the five fingers said to the face.', %targetObject.client.name );
|
||||||
|
case 2:
|
||||||
|
messageAll('msgSlapmessage','\c0%1 gets slapped the heck out!', %targetObject.client.name );
|
||||||
|
case 3:
|
||||||
|
messageAll('msgSlapmessage','\c0%1 is taking a short tour around the map.', %targetObject.client.name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
%weapon = "Disc";
|
%weapon = "Disc";
|
||||||
case $DamageType::Grenade:
|
case $DamageType::Grenade:
|
||||||
if($lastObjExplode.isHandNade) //Hand grenades
|
if($lastObjExplode.isHandNade) //Hand grenades
|
||||||
|
|
@ -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(2000, "delete"); //was 500
|
||||||
// %obj.setFrozenState(true);
|
%data.schedule(500, 'onAvoidCollisions', %obj);
|
||||||
%obj.schedule(500, "delete"); //was 2000
|
|
||||||
//%data.schedule(500, 'onAvoidCollisions', %obj);
|
|
||||||
|
|
||||||
//Transfer the vehicle far away
|
//Transfer the vehicle far away
|
||||||
%obj.schedule(128, "setPosition", vectorAdd(%obj.getPosition(), "40 -27 10000")); //Lowered: was 500
|
%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.schedule(500, "delete"); //was 500
|
|
||||||
}
|
|
||||||
// -----------------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function GetTeamCounts(%game)
|
||||||
if($countdownStarted && $MatchStarted)
|
if($countdownStarted && $MatchStarted)
|
||||||
{
|
{
|
||||||
//Variables
|
//Variables
|
||||||
$TotalTeamPlayerCount = $TeamRank[1, count] + $TeamRank[2, count];
|
$TotalTeamPlayerCount = (Game.class $= "LakRabbitGame") ? $TeamRank[0, count] : ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||||
$AllPlayerCount = $HostGamePlayerCount;
|
$AllPlayerCount = $HostGamePlayerCount;
|
||||||
|
|
||||||
//Observers
|
//Observers
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ function ShapeBase::throwObject(%this,%obj)
|
||||||
{
|
{
|
||||||
%obj.static = false;
|
%obj.static = false;
|
||||||
// z0dd - ZOD - SquirrelOfDeath, 10/02/02. Hack for flag collision bug.
|
// z0dd - ZOD - SquirrelOfDeath, 10/02/02. Hack for flag collision bug.
|
||||||
if(Game.Class $= CTFGame || Game.Class $= PracticeCTFGame || Game.Class $= SCtFGame)
|
if(Game.Class $= CTFGame || Game.Class $= PracticeCTFGame || Game.Class $= SCtFGame || Game.Class $= LCTFGame)
|
||||||
%obj.searchSchedule = Game.schedule(10, "startFlagCollisionSearch", %obj);
|
%obj.searchSchedule = Game.schedule(10, "startFlagCollisionSearch", %obj);
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue