From afa281d47abb69ef57e85a087b08a7d0444b773b Mon Sep 17 00:00:00 2001
From: Evan Debenham <Evan@ShatteredPixel.com>
Date: Wed, 16 Sep 2020 19:08:14 -0400
Subject: [PATCH] v0.9.0: adjusted frost/chill/burning when the hero is immune
 to them

---
 .../shatteredpixeldungeon/actors/buffs/Burning.java    |  7 +++++++
 .../shatteredpixeldungeon/actors/buffs/Chill.java      | 10 ++--------
 .../shatteredpixeldungeon/actors/buffs/Frost.java      |  8 +++++++-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java
index d05afe61f..3b9220d19 100644
--- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java
+++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java
@@ -75,6 +75,13 @@ public class Burning extends Buff implements Hero.Doom {
 		burnIncrement = bundle.getInt( BURN );
 	}
 
+	@Override
+	public boolean attachTo(Char target) {
+		Buff.detach( target, Chill.class);
+
+		return super.attachTo(target);
+	}
+
 	@Override
 	public boolean act() {
 		
diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java
index 54e9db7e6..2fbfe3324 100644
--- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java
+++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Chill.java
@@ -39,15 +39,9 @@ public class Chill extends FlavourBuff {
 
 	@Override
 	public boolean attachTo(Char target) {
-		//can't chill what's frozen!
-		if (target.buff(Frost.class) != null) return false;
+		Buff.detach( target, Burning.class );
 
-		if (super.attachTo(target)){
-			Buff.detach( target, Burning.class );
-			return true;
-		} else {
-			return false;
-		}
+		return super.attachTo(target);
 	}
 
 	//reduces speed by 10% for every turn remaining, capping at 50%
diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java
index 620d1ca34..7ea661af1 100644
--- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java
+++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Frost.java
@@ -49,10 +49,11 @@ public class Frost extends FlavourBuff {
 	
 	@Override
 	public boolean attachTo( Char target ) {
+		Buff.detach( target, Burning.class );
+
 		if (super.attachTo( target )) {
 			
 			target.paralysed++;
-			Buff.detach( target, Burning.class );
 			Buff.detach( target, Chill.class );
 
 			if (target instanceof Hero) {
@@ -138,4 +139,9 @@ public class Frost extends FlavourBuff {
 		return Messages.get(this, "desc", dispTurns());
 	}
 
+	{
+		//can't chill what's frozen!
+		immunities.add( Chill.class );
+	}
+
 }