Skip to content

Commit

Permalink
Reduced Failed Champ Damage
Browse files Browse the repository at this point in the history
  • Loading branch information
ToboterXP committed Aug 22, 2022
1 parent fe18f6f commit 7e8ac99
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
15 changes: 12 additions & 3 deletions HKSecondQuest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,19 @@ public void OnGameStart(On.HeroController.orig_Start orig, global::HeroControlle
/// </summary>
public void OnDamage(On.HeroController.orig_TakeDamage orig, global::HeroController self, GameObject go, CollisionSide damageSide, int damageAmount, int hazardType)
{
if (Enabled && ActiveRoom != null && damageAmount < ActiveRoom.MinDamage && damageAmount > 0)
if (Enabled && ActiveRoom != null)
{
damageAmount = ActiveRoom.MinDamage;
}
if (damageAmount < ActiveRoom.MinDamage && damageAmount > 0)
{
damageAmount = ActiveRoom.MinDamage;
}

if (damageAmount > ActiveRoom.MaxDamage)
{
damageAmount = ActiveRoom.MaxDamage;
}
}

orig(self, go, damageSide, damageAmount, hazardType);
}

Expand Down
2 changes: 2 additions & 0 deletions Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public abstract class Room
/// </summary>
public int MinDamage = 0;

public int MaxDamage = 100;

public int Revision = 1; //World init gets called if save from older Revision is loaded


Expand Down
13 changes: 13 additions & 0 deletions Rooms/City/FailedChamp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HKSecondQuest.Rooms.City
{
internal class FailedChamp : Room
{
public FailedChamp() : base("Dream_01_False_Knight") { MaxDamage = 1; }
}
}

0 comments on commit 7e8ac99

Please sign in to comment.