From 91256124bfca8b3db6c011fc626b842777b5b69f Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 14 Nov 2020 00:21:31 -0500 Subject: [PATCH] Updated Mine-Disc code --- Classic/scripts/DMGame.cs | 34 ++++++++++++++-------------------- Classic/scripts/SCtFGame.cs | 34 ++++++++++++++-------------------- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/Classic/scripts/DMGame.cs b/Classic/scripts/DMGame.cs index 782a1f6..b598b38 100644 --- a/Classic/scripts/DMGame.cs +++ b/Classic/scripts/DMGame.cs @@ -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. diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index e2ec982..ff73c69 100644 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -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.