diff --git a/CheatHotkeys.cs b/CheatHotkeys.cs index 0b8f0f2..b6a9254 100644 --- a/CheatHotkeys.cs +++ b/CheatHotkeys.cs @@ -7,20 +7,6 @@ namespace CheatHotkeys { public class CheatHotkeys : Mod { - private static int[] debuffs = new int[] { - BuffID.Poisoned, BuffID.PotionSickness, BuffID.Darkness, - BuffID.Cursed, BuffID.OnFire, BuffID.Tipsy, BuffID.Bleeding, - BuffID.Confused, BuffID.Slow, BuffID.Weak, - BuffID.Silenced, BuffID.BrokenArmor, BuffID.CursedInferno, - BuffID.Chilled, BuffID.Frozen, BuffID.Ichor, - BuffID.Venom, BuffID.Midas, BuffID.Blackout, - BuffID.ChaosState, BuffID.ManaSickness, BuffID.Wet, - BuffID.Stinky, BuffID.Slimed, BuffID.Electrified, - BuffID.MoonLeech, BuffID.Rabies, BuffID.Webbed, - BuffID.ShadowFlame, BuffID.Stoned, BuffID.Dazed, - BuffID.VortexDebuff, BuffID.BoneJavelin, BuffID.Daybreak, - BuffID.StardustMinionBleed - }; private bool godMode = false; private bool unlimitedAmmo = false; @@ -39,11 +25,7 @@ public class CheatHotkeys : Mod { get { return unlimitedAmmo; } set { unlimitedAmmo = value; } } - - public static int[] Debuffs { - get { return debuffs; } - } - + public override void Load() { Properties = new ModProperties() { Autoload = true @@ -92,13 +74,23 @@ public class CheatHotkeys : Mod { player.statMana = player.statManaMax; player.ManaEffect(player.statManaMax); } - + public void RemoveDebuffs() { Player player = Main.player[Main.myPlayer]; - foreach(int debuff in debuffs) { - if(player.HasBuff(debuff) > -1) { - player.ClearBuff(debuff); + for(int i = 0; i < Main.debuff.Length; i++) { + switch(i) { + case BuffID.Horrified: // fighting Wall of Flesh + case BuffID.TheTongue: // in contact with Wall of Flesh tongue + case BuffID.Obstructed: // attacked by a Brain Suckler + case BuffID.Suffocation: // in contact with silt/sand/slush + case BuffID.Burning: // in contact with hot blocks + case BuffID.WaterCandle: // around a water candle + break; + default: + if(Main.debuff[i]) + player.ClearBuff(i); + break; } } } diff --git a/MPlayer.cs b/CheatHotkeysPlayer.cs similarity index 97% rename from MPlayer.cs rename to CheatHotkeysPlayer.cs index f9fd798..11e067b 100644 --- a/MPlayer.cs +++ b/CheatHotkeysPlayer.cs @@ -3,7 +3,7 @@ using Terraria.ModLoader; namespace CheatHotkeys { - internal class MPlayer : ModPlayer { + internal class CheatHotkeysPlayer : ModPlayer { public override bool Autoload(ref string name) { return true; } diff --git a/build.txt b/build.txt index 572af90..41443b7 100644 --- a/build.txt +++ b/build.txt @@ -1,6 +1,6 @@ displayName=Cheat Hotkeys author=abluescarab -version=1.2.0 +version=1.2.1 dllReferences= modReferences= noCompile=false diff --git a/description.txt b/description.txt index 3a0113f..72bc139 100644 --- a/description.txt +++ b/description.txt @@ -6,15 +6,21 @@ F: Toggle god mode G: Toggle unlimited ammo [Changelog] -2016-08-12 v1.2.0 +v1.2.1 2016-08-14 +* Remove debuffs hotkey should now work for mod debuffs + +v1.2.0 2016-08-12 * Player cannot be affected by debuffs when god mode is enabled * Mana is automatically refilled when god mode is enabled * No longer displays "mana refilled" and "life refilled" messages when god mode is enabled -2016-08-02 v1.1.0 +v1.1.0 2016-08-02 - Added "remove debuffs" hotkey - Enabling god mode refills life and removes debuffs - Fix: player can no longer be hit by projectiles with god mode on -2016-08-01 v1.0.1 -- Added homepage \ No newline at end of file +v1.0.1 2016-08-01 +- Added homepage + +[Credits] +* Boffin for recommending the mod debuff solution \ No newline at end of file