mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-15 16:14:35 +00:00
Updated Mine-Disc code (Lak)
This commit is contained in:
parent
91256124bf
commit
36dc2a2c7a
1 changed files with 15 additions and 21 deletions
|
|
@ -771,27 +771,21 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
||||||
%flash = 0.75;
|
%flash = 0.75;
|
||||||
|
|
||||||
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
|
||||||
// client.mineDisc = [true|false]
|
// No Schedules by DarkTiger Ver.2
|
||||||
// client.mineDiscCheck [0-None|1-Disc Damage|2-Mine Damage]
|
|
||||||
// Teratos: Don't understand why "%client = %targetClient;" -- possibly to avoid carrying .minediscCheck field?
|
|
||||||
// Teratos: A little more redundant code and less readable for a few less comparisons.
|
|
||||||
%targetClient.mineDisc = false;
|
%targetClient.mineDisc = false;
|
||||||
if(%damageType == $DamageType::Disc) {
|
switch$(%damageType)
|
||||||
%client = %targetClient; // Oops
|
{
|
||||||
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
case $DamageType::Disc:
|
||||||
%client.minediscCheck = 1;
|
if((getSimTime() - %targetClient.mdcTime1) < 256)
|
||||||
schedule(300, 0, "resetMineDiscCheck", %client);
|
%targetClient.mineDisc = true;
|
||||||
} else if(%client.minediscCheck == 2) { // Recent Mine damage
|
|
||||||
%client.mineDisc = true;
|
%targetClient.mdcTime2 = getSimTime();
|
||||||
}
|
|
||||||
} else if (%damageType == $DamageType::Mine) {
|
case $DamageType::Mine:
|
||||||
%client = %targetClient; // Oops
|
if((getSimTime() - %targetClient.mdcTime2) < 256)
|
||||||
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
|
%targetClient.mineDisc = true;
|
||||||
%client.minediscCheck = 2;
|
|
||||||
schedule(300, 0, "resetMineDiscCheck", %client);
|
%targetClient.mdcTime1 = getSimTime();
|
||||||
} else if(%client.minediscCheck == 1) { // Recent Disc damage
|
|
||||||
%client.mineDisc = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// -- End Mine+Disc insert.
|
// -- End Mine+Disc insert.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue