-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: no nail attack, no nail damage and no spell damage
- Loading branch information
Showing
8 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace GodSeekerPlus.Modules.Restrictions; | ||
|
||
[Category(nameof(Restrictions))] | ||
internal sealed class NoNailAttack : Module { | ||
private protected override void Load() => | ||
On.HeroController.CanAttack += SuppressAttack; | ||
|
||
private protected override void Unload() => | ||
On.HeroController.CanAttack -= SuppressAttack; | ||
|
||
private bool SuppressAttack(On.HeroController.orig_CanAttack orig, HeroController self) => false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace GodSeekerPlus.Modules.Restrictions; | ||
|
||
[Category(nameof(Restrictions))] | ||
internal sealed class NoNailDamage : Module { | ||
private protected override void Load() => | ||
On.HealthManager.TakeDamage += AddHealth; | ||
|
||
private protected override void Unload() => | ||
On.HealthManager.TakeDamage -= AddHealth; | ||
|
||
private void AddHealth(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { | ||
if (hitInstance.AttackType == AttackTypes.Nail) { | ||
self.hp += hitInstance.DamageDealt; | ||
} | ||
|
||
orig(self, hitInstance); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace GodSeekerPlus.Modules.Restrictions; | ||
|
||
[Category(nameof(Restrictions))] | ||
internal sealed class NoSpellDamage : Module { | ||
private protected override void Load() => | ||
On.HealthManager.TakeDamage += AddHealth; | ||
|
||
private protected override void Unload() => | ||
On.HealthManager.TakeDamage -= AddHealth; | ||
|
||
private void AddHealth(On.HealthManager.orig_TakeDamage orig, HealthManager self, HitInstance hitInstance) { | ||
AttackTypes type = hitInstance.AttackType; | ||
if (type == AttackTypes.Spell || type == AttackTypes.SharpShadow) { | ||
self.hp += hitInstance.DamageDealt; | ||
} | ||
|
||
orig(self, hitInstance); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters