-
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.
- Loading branch information
Showing
6 changed files
with
103 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Bindings = BossSequenceController.ChallengeBindings; | ||
|
||
namespace GodSeekerPlus.Modules.Visual; | ||
|
||
[Category(nameof(Visual))] | ||
[ToggleableLevel(ToggleableLevel.ChangeScene)] | ||
[DefaultEnabled] | ||
internal sealed class MorePantheonCaps : Module { | ||
private static readonly Dictionary<string, int> doorPDDict = new() { | ||
{ "bossDoorStateTier1", 1 }, | ||
{ "bossDoorStateTier2", 2 }, | ||
{ "bossDoorStateTier3", 3 }, | ||
{ "bossDoorStateTier4", 4 }, | ||
{ "bossDoorStateTier5", 5 } | ||
}; | ||
|
||
private protected override void Load() { | ||
On.BossSequenceDoor.Start += SetupCaps; | ||
On.BossDoorChallengeCompleteUI.Start += RecordRAB; | ||
} | ||
|
||
private protected override void Unload() { | ||
On.BossSequenceDoor.Start -= SetupCaps; | ||
On.BossDoorChallengeCompleteUI.Start -= RecordRAB; | ||
} | ||
|
||
private void SetupCaps(On.BossSequenceDoor.orig_Start orig, BossSequenceDoor self) { | ||
if (self.bossSequence != null) { | ||
if ( | ||
self.completedNoHitsDisplay == null | ||
&& self.gameObject.Child("Main Caps", "GG_door_cap_complete_nohits") is GameObject go | ||
) { | ||
self.completedNoHitsDisplay = go; | ||
Logger.LogDebug($"Radiant cap enabled for {self.bossSequence.name}"); | ||
} | ||
|
||
if (Ref.LS.GetRABCompletion(doorPDDict[self.playerDataString]) | ||
&& self.completedNoHitsDisplay?.GetComponent<SpriteRenderer>() is SpriteRenderer sr | ||
) { | ||
sr.transform.Translate(0, 0, -0.0801f); | ||
sr.color = Color.black; | ||
|
||
Logger.LogDebug($"Radiant AB effect enabled for {self.bossSequence.name}"); | ||
} | ||
} | ||
|
||
orig(self); | ||
} | ||
|
||
private void RecordRAB(On.BossDoorChallengeCompleteUI.orig_Start orig, BossDoorChallengeCompleteUI self) { | ||
var currentData = (BossSequenceController.BossSequenceData) ReflectionHelper | ||
.GetFieldInfo(typeof(BossSequenceController), "currentData", false) | ||
.GetValue(null); | ||
|
||
int num = doorPDDict[currentData.playerData]; | ||
bool rab = !currentData.knightDamaged | ||
&& currentData.bindings == (Bindings.Nail | Bindings.Shell | Bindings.Charms | Bindings.Soul); | ||
bool rabPrev = Ref.LS.GetRABCompletion(num); | ||
|
||
if (rab && !rabPrev) { | ||
Ref.LS.SetRABCompletion(num, true); | ||
Logger.LogDebug($"Radiant AB in Pantheon #{num} recorded"); | ||
} | ||
|
||
orig(self); | ||
} | ||
|
||
} |
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
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