Updated Mine-Disc code

This commit is contained in:
ChocoTaco1 2020-11-14 00:21:31 -05:00
parent a2a55694b6
commit 91256124bf
2 changed files with 28 additions and 40 deletions

View file

@ -763,27 +763,21 @@ package DMGame
%flash = 0.75;
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
// client.mineDisc = [true|false]
// 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.
// No Schedules by DarkTiger Ver.2
%targetClient.mineDisc = false;
if(%damageType == $DamageType::Disc) {
%client = %targetClient; // Oops
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
%client.minediscCheck = 1;
schedule(300, 0, "resetMineDiscCheck", %client);
} else if(%client.minediscCheck == 2) { // Recent Mine damage
%client.mineDisc = true;
}
} else if (%damageType == $DamageType::Mine) {
%client = %targetClient; // Oops
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
%client.minediscCheck = 2;
schedule(300, 0, "resetMineDiscCheck", %client);
} else if(%client.minediscCheck == 1) { // Recent Disc damage
%client.mineDisc = true;
}
switch$(%damageType)
{
case $DamageType::Disc:
if((getSimTime() - %targetClient.mdcTime1) < 256)
%targetClient.mineDisc = true;
%targetClient.mdcTime2 = getSimTime();
case $DamageType::Mine:
if((getSimTime() - %targetClient.mdcTime2) < 256)
%targetClient.mineDisc = true;
%targetClient.mdcTime1 = getSimTime();
}
// -- End Mine+Disc insert.

View file

@ -365,27 +365,21 @@ package SCtFGame
%flash = 0.75;
// Teratos: Originally from Eolk? Mine+Disc tracking/death message support.
// client.mineDisc = [true|false]
// 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.
// No Schedules by DarkTiger Ver.2
%targetClient.mineDisc = false;
if(%damageType == $DamageType::Disc) {
%client = %targetClient; // Oops
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
%client.minediscCheck = 1;
schedule(300, 0, "resetMineDiscCheck", %client);
} else if(%client.minediscCheck == 2) { // Recent Mine damage
%client.mineDisc = true;
}
} else if (%damageType == $DamageType::Mine) {
%client = %targetClient; // Oops
if(%client.minediscCheck == 0) { // No Mine or Disc damage recently
%client.minediscCheck = 2;
schedule(300, 0, "resetMineDiscCheck", %client);
} else if(%client.minediscCheck == 1) { // Recent Disc damage
%client.mineDisc = true;
}
switch$(%damageType)
{
case $DamageType::Disc:
if((getSimTime() - %targetClient.mdcTime1) < 256)
%targetClient.mineDisc = true;
%targetClient.mdcTime2 = getSimTime();
case $DamageType::Mine:
if((getSimTime() - %targetClient.mdcTime2) < 256)
%targetClient.mineDisc = true;
%targetClient.mdcTime1 = getSimTime();
}
// -- End Mine+Disc insert.