Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alana Gilston committed Aug 15, 2016
1 parent 8570a9e commit 80994b3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 29 deletions.
38 changes: 15 additions & 23 deletions CheatHotkeys.cs
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion MPlayer.cs → CheatHotkeysPlayer.cs
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion build.txt
@@ -1,6 +1,6 @@
displayName=Cheat Hotkeys
author=abluescarab
version=1.2.0
version=1.2.1
dllReferences=
modReferences=
noCompile=false
Expand Down
14 changes: 10 additions & 4 deletions description.txt
Expand Up @@ -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
v1.0.1 2016-08-01
- Added homepage

[Credits]
* Boffin for recommending the mod debuff solution

0 comments on commit 80994b3

Please sign in to comment.