Update LakRabbitGame.cs

Added Laser and Chain Damage back
Merged hand grenade code with grenade launcher switch code.
This commit is contained in:
ChocoTaco1 2020-04-14 15:15:54 -04:00
parent 40834b1599
commit ddae237096

View file

@ -355,8 +355,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
if(%damageType == $DamageType::Grenade && !$lastObjExplode.isHandNade) if(%damageType == $DamageType::Grenade && !$lastObjExplode.isHandNade)
%targetPosition = setWord(%targetPosition, 2, getWord(%targetPosition,2) - getHeight(%targetObject)); %targetPosition = setWord(%targetPosition, 2, getWord(%targetPosition,2) - getHeight(%targetObject));
//if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser) if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
if(%damageType == $DamageType::ShockLance)
{ {
$lastObjExplode = 0; $lastObjExplode = 0;
%distance = VectorDist(%targetPosition, %sourceObject.getWorldBoxCenter()); %distance = VectorDist(%targetPosition, %sourceObject.getWorldBoxCenter());
@ -380,8 +379,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%velBonus = (mPow(%vel,1.125)/10)+1; %velBonus = (mPow(%vel,1.125)/10)+1;
// for shock and laser, you get MA points if -you- are in the air not the opponent // for shock and laser, you get MA points if -you- are in the air not the opponent
//if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser) if(%damageType == $DamageType::ShockLance || %damageType == $DamageType::Laser)
if(%damageType == $DamageType::ShockLance)
%ma = TestForMA(%sourceObject, 6); %ma = TestForMA(%sourceObject, 6);
else else
%ma = TestForMA(%targetObject, 6); %ma = TestForMA(%targetObject, 6);
@ -400,45 +398,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
if(Game.noSplashDamage && %percentDam < 98 && $lastObjExplode && !$lastObjExplode.isHandNade && %damageType != $DamageType::Mine) if(Game.noSplashDamage && %percentDam < 98 && $lastObjExplode && !$lastObjExplode.isHandNade && %damageType != $DamageType::Mine)
%amount = 0.0; %amount = 0.0;
//if(%damageType == $DamageType::Laser && (%energy > 0.5 || %players > 7))
//{
// %players = (ClientGroup.getCount()-1)/1.5;
// %points = (%distance/75)+1;
//
// if(%ma)
// %points *= 1.75;
//
// if(%targetObject.client.headshot)
// {
// %sound = %defaultSound;
// %special = " Headshot";
// %points *= 1.75;
// }
// %sourceObject.client.totalSnipeHits++;
// %weapon = "Snipe";
//}
//else if(%damageType == $DamageType::Bullet)
//{
// // doesn't matter if it's MA
// %ma = 0;
//
// %players = (ClientGroup.getCount()-1)/1.75;
//
// $LakFired[%sourceObject, ChaingunBullet, 1]++;
//
// if($LakFired[%sourceObject, ChaingunBullet, 1] % 5 == 0)
// {
// %accamount = mFloor(($LakFired[%sourceObject, ChaingunBullet, 1] / $LakFired[%sourceObject, ChaingunBullet, 0])*100);
// %velBonus = 0;
// %points = (%accamount/3)+1;
// %accuracy = " [Accuracy:" @ %accamount @ "%]";
//
// %sourceObject.client.totalChainAccuracy += %accamount;
// %sourceObject.client.totalChainHits++;
// }
// %weapon = "Chaingun";
//}
switch$(%damageType) switch$(%damageType)
{ {
case $DamageType::Disc: case $DamageType::Disc:
@ -505,37 +464,60 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
} }
%weapon = "Disc"; %weapon = "Disc";
case $DamageType::Grenade: case $DamageType::Grenade:
if(Game.PubPro) if($lastObjExplode.isHandNade) //Hand grenades
{ {
if(%ma && %percentDam >= 98) if(%percentDam > 20)
{ {
%points = %distanceBonus; %accuracy = " [Accuracy:" @ %percentDam @ "%]";
%sound = %defaultSound; %points = (%percentDam/10)+1;
%velBonus = 0;
%sound = '~wfx/misc/coin.wav';
} }
if(%percentDam >= 25 && !%ma && %distance >= 80 && %velTarget > 20) if(%percentDam >= 99)
{ {
%points = %longDistanceBonus; %sound = '~wfx/misc/Cheer.wav';
%velBonus /= 2; %points *= 2.0;
%long = 1;
%sound = %defaultSound;
} }
if(%ma)
%points *= 1.5;
%weapon = "Hand-Nade";
} }
else else
{ {
if(%ma && %percentDam >= 98) if(Game.PubPro)
{ {
%points = %distanceBonus/1.85; if(%ma && %percentDam >= 98)
%sound = %defaultSound; {
%points = %distanceBonus;
%sound = %defaultSound;
}
if(%percentDam >= 25 && !%ma && %distance >= 80 && %velTarget > 20)
{
%points = %longDistanceBonus;
%velBonus /= 2;
%long = 1;
%sound = %defaultSound;
}
} }
if(%percentDam >= 25 && !%ma && %distance >= 100 && %velTarget > 30) else
{ {
%points = %longDistanceBonus/1.85; if(%ma && %percentDam >= 98)
%velBonus /= 4; {
%long = 1; %points = %distanceBonus/1.85;
%sound = %defaultSound; %sound = %defaultSound;
}
if(%percentDam >= 25 && !%ma && %distance >= 100 && %velTarget > 30)
{
%points = %longDistanceBonus/1.85;
%velBonus /= 4;
%long = 1;
%sound = %defaultSound;
}
} }
%weapon = "Grenade-Launcher";
} }
%weapon = "Grenade-Launcher";
case $DamageType::Mortar: case $DamageType::Mortar:
if(%ma && %percentDam >= 98) if(%ma && %percentDam >= 98)
{ {
@ -588,7 +570,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%dif = VectorNormalize(%dif); %dif = VectorNormalize(%dif);
%dot = VectorDot(%dif, %objDir2D); %dot = VectorDot(%dif, %objDir2D);
if(%dot >= mCos(1.05)) if(%dot >= mCos(1.05))
{ {
if(%sourceObject.holdingFlag && TestForMA(%targetObject, 6)) if(%sourceObject.holdingFlag && TestForMA(%targetObject, 6))
{ {
@ -602,9 +584,12 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
} }
if(%ma) if(%ma)
%points += 3; %points += 3;
%sound = %defaultSound;
%sourceObject.client.totalShockHits++; //not a bug. sl gets points ma or not
%weapon = "ShockLance"; %sound = %defaultSound;
%sourceObject.client.totalShockHits++;
%weapon = "ShockLance";
case $DamageType::Blaster: case $DamageType::Blaster:
if(%ma) if(%ma)
{ {
@ -630,29 +615,42 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
%sound = %defaultSound; %sound = %defaultSound;
} }
%weapon = "Plasma"; %weapon = "Plasma";
} case $DamageType::Laser:
} if(%energy > 0.5 || %players > 7)
{
%players = (ClientGroup.getCount()-1)/1.5;
%points = (%distance/75)+1;
//Hand grenades if(%ma)
if(%damageType == $DamageType::Grenade && $lastObjExplode.isHandNade) %points *= 1.75;
{
if(%percentDam > 20)
{
%accuracy = " [Accuracy:" @ %percentDam @ "%]";
%points = (%percentDam/10)+1;
%velBonus = 0;
%sound = '~wfx/misc/coin.wav';
} if(%targetObject.client.headshot)
if(%percentDam >= 99) {
{ %sound = %defaultSound;
%sound = '~wfx/misc/Cheer.wav'; %special = " Headshot";
%points *= 2.0; %points *= 1.75;
} }
if(%ma) %sourceObject.client.totalSnipeHits++;
%points *= 1.5; %weapon = "Snipe";
}
case $DamageType::Bullet:
// doesn't matter if it's MA
%ma = 0;
%players = (ClientGroup.getCount()-1)/1.75;
$LakFired[%sourceObject, ChaingunBullet, 1]++;
%weapon = "Hand-Nade"; if($LakFired[%sourceObject, ChaingunBullet, 1] % 5 == 0)
{
%accamount = mFloor(($LakFired[%sourceObject, ChaingunBullet, 1] / $LakFired[%sourceObject, ChaingunBullet, 0])*100);
%velBonus = 0;
%points = (%accamount/3)+1;
%accuracy = " [Accuracy:" @ %accamount @ "%]";
%sourceObject.client.totalChainAccuracy += %accamount;
%sourceObject.client.totalChainHits++;
}
%weapon = "Chaingun";
}
} }
// borlak -- recalc score for hits // borlak -- recalc score for hits