Update LakRabbitGame.cs

This commit is contained in:
ChocoTaco1 2025-11-23 13:14:18 -05:00
parent 6075098d79
commit 97c9bf7270

View file

@ -457,17 +457,64 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%sound = %defaultSound;
}
if(%targetObject.holdingFlag)
{
%tgPos = %targetObject.getPosition();
%terrHeight = getTerrainHeight(getWords(%tgPos,0,1));
%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
// 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;
@ -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 );
}
}
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";
case $DamageType::Grenade:
@ -2757,7 +2769,7 @@ function LakRabbitGame::throwDummyFlag(%position, %datablock, %player, %ttl)
%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)