Skip to content

Commit

Permalink
Made WindScythe work better with SpellSoul. (x3 size, x2 damage)
Browse files Browse the repository at this point in the history
  • Loading branch information
BubkisLord committed Jun 27, 2022
1 parent dad6ae6 commit 215cccc
Show file tree
Hide file tree
Showing 17 changed files with 90 additions and 71 deletions.
Binary file modified .vs/CharmMod/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/CharmMod/v17/.futdcache.v1
Binary file not shown.
Binary file modified .vs/CharmMod/v17/.suo
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/charmmod.metadata.v2
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/charmmod.projects.v2
Binary file not shown.
8 changes: 7 additions & 1 deletion Abilities/WindScythe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Fyrenest {
public class WindScythe : IAbility {
public static readonly WindScythe Instance = new();
public string Name => "Wind Scythe";
public AbilityTrigger Trigger => AbilityTrigger.Fireball;

Expand All @@ -17,12 +18,17 @@ public void Load() {
damageEnemies.attackType = AttackTypes.Spell;
damageEnemies.circleDirection = true;
if (PlayerData.instance.fireballLevel == 1) damageEnemies.damageDealt = (PlayerData.instance.equippedCharm_19) ? (PlayerData.instance.GetInt(nameof(PlayerData.nailDamage)) * 2) : PlayerData.instance.GetInt(nameof(PlayerData.nailDamage));
if (PlayerData.instance.fireballLevel > 1) damageEnemies.damageDealt = (PlayerData.instance.equippedCharm_19) ? (PlayerData.instance.GetInt(nameof(PlayerData.nailDamage)) * 3) : (PlayerData.instance.GetInt(nameof(PlayerData.nailDamage)) * 2);
if (SoulSpell.Instance.Equipped()) damageEnemies.damageDealt *= 2;
damageEnemies.ignoreInvuln = false;
damageEnemies.direction = 180f;
damageEnemies.moveDirection = true;
damageEnemies.magnitudeMult = 1f;
damageEnemies.specialType = SpecialTypes.None;
if (SoulSpell.Instance.Equipped())
{
scythePreload.transform.SetScaleX(3f);
scythePreload.transform.SetScaleY(3f);
}
}

public void Perform()
Expand Down
144 changes: 77 additions & 67 deletions CharmMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
using ItemChanger;
using ItemChanger.Tags;
using ItemChanger.UIDefs;
using Modding.Menu;

using Modding.Menu;

namespace Fyrenest
{
public class Fyrenest : Mod, IMod
{
public class Fyrenest : Mod, IMod, IMenuMod, ITogglableMod
{
public override string GetVersion() => "2.10.41.38";

private static List<Charm> Charms = new()
Expand Down Expand Up @@ -55,7 +55,7 @@ public class Fyrenest : Mod, IMod
private Dictionary<string, Action<bool>> BoolSetters = new();
private Dictionary<string, Func<int, int>> IntGetters = new();
private Dictionary<(string, string), Action<PlayMakerFSM>> FSMEdits = new();
private List<(int Period, Action Func)> Tickers = new();
private List<(int Period, Action Func)> Tickers = new();
public static List<IAbility> Abilities;
public static Dictionary<string, Dictionary<string, GameObject>> Preloads;

Expand All @@ -65,28 +65,28 @@ public class Fyrenest : Mod, IMod



private void LoadAbilities()
private void LoadAbilities()
{
Abilities = new List<IAbility>();

// Find all abilities
var assembly = Assembly.GetExecutingAssembly();
foreach (var type in assembly.GetTypes())
foreach (var type in assembly.GetTypes())
{
if (type.GetInterface("IAbility") != null)
if (type.GetInterface("IAbility") != null)
{
// Type is an ability
Abilities.Add(Activator.CreateInstance(type) as IAbility);
}
}

foreach (IAbility ability in Abilities)
foreach (IAbility ability in Abilities)
{
Log($"Registered ability {ability.Name}!");
}
}
public override void Initialize(Dictionary<string, Dictionary<string, GameObject>> preloadedObjects)
{
{
Preloads = preloadedObjects;
LoadAbilities();

Expand Down Expand Up @@ -214,9 +214,9 @@ private void OnUpdate()
{
charm.Settings(Settings).Cost = charm.DefaultCost;
}
if(optionOne == true)
{
//give charms when certain things are done.
if(optionOne == true)
{
//give charms when certain things are done.
if (PlayerData.instance.colosseumBronzeCompleted) Quickfall.Instance.Settings(Settings).Got = true;
if (PlayerData.instance.colosseumSilverCompleted) Slowfall.Instance.Settings(Settings).Got = true;
if (PlayerData.instance.hasShadowDash) PowerfulDash.Instance.Settings(Settings).Got = true;
Expand All @@ -241,55 +241,65 @@ private void OnUpdate()
if (PlayerData.instance.visitedWhitePalace) ElderStone.Instance.Settings(Settings).Got = true;
if (PlayerData.instance.gaveSlykey && PlayerData.instance.slyConvoNailHoned && PlayerData.instance.completionPercentage > 100) SlyDeal.Instance.Settings(Settings).Got = true;
if (PlayerData.instance.honedNail) GiantNail.Instance.Settings(Settings).Got = true;
if (PlayerData.instance.hasAllNailArts && PlayerData.instance.hasKingsBrand) MatosBlessing.Instance.Settings(Settings).Got = true;
//end
//ik it is messy, but what else is there to do? Also, if u are seeing this code and think that there is a more appropriate time to give the charm, DM me on discord. I am BubkisLord#5187
if (PlayerData.instance.hasAllNailArts && PlayerData.instance.hasKingsBrand) MatosBlessing.Instance.Settings(Settings).Got = true;
//end
//ik it is messy, but what else is there to do? Also, if u are seeing this code and think that there is a more appropriate time to give the charm, DM me on discord. I am BubkisLord#5187
}
}
private bool optionOne = true;
private bool optionTwo = true;

public List<IMenuMod.MenuEntry> GetMenuData(IMenuMod.MenuEntry? toggleButtonEntry)
{
return new List<IMenuMod.MenuEntry>
{
new IMenuMod.MenuEntry {
Name = "Charms Enabled",
Description = "Toggle if charms are enabled.",
Values = new string[] {
"On",
"Off"
},
Saver = opt => this.optionOne = opt switch {
0 => true,
1 => false,
// This should never be called
_ => throw new InvalidOperationException()
},
Loader = () => this.optionOne switch {
true => 0,
false => 1,
}
},
new IMenuMod.MenuEntry {
Name = "Lore Enabled",
Description = "Toggle if custom text is enabled",
Values = new string[] {
"On",
"Off"
},
Saver = opt => this.optionTwo = opt switch {
0 => true,
1 => false,
// This should never be called
_ => throw new InvalidOperationException()
},
Loader = () => this.optionTwo switch {
true => 0,
false => 1,
}
}
};
}

public bool ToggleButtonInsideMenu => true;

private bool optionOne = true;
private bool optionTwo = true;

public List<IMenuMod.MenuEntry> GetMenuData(IMenuMod.MenuEntry? toggleButtonEntry)
{
IMenuMod.MenuEntry e = toggleButtonEntry.Value;
IMenuMod.MenuEntry entry = new(e.Name, e.Values, "Toggle all effects of the Fyrenest mod.", e.Saver, e.Loader);

List<IMenuMod.MenuEntry> menuEntries = new() { entry };
{
new IMenuMod.MenuEntry
{
Name = "Charms Enabled",
Description = "Toggle if charms are enabled.",
Values = new string[] {
"On",
"Off"
},
Saver = opt => this.optionOne = opt switch
{
0 => true,
1 => false,
// This should never be called
_ => throw new InvalidOperationException()
},
Loader = () => this.optionOne switch
{
true => 0,
false => 1,
}
};
new IMenuMod.MenuEntry {
Name = "Lore Enabled",
Description = "Toggle if custom text is enabled",
Values = new string[] {
"On",
"Off"
},
Saver = opt => this.optionTwo = opt switch {
0 => true,
1 => false,
// This should never be called
_ => throw new InvalidOperationException()
},
Loader = () => this.optionTwo switch {
true => 0,
false => 1,
}
};
};
return menuEntries;
}

private int charmSelect = 1;
Expand Down Expand Up @@ -695,11 +705,11 @@ public void TakeAllOurCharms()
{
charm.Settings(Settings).Got = false;
}
}

public void Unload()
{
throw new NotImplementedException();
}
}

public void Unload()
{
throw new NotImplementedException();
}
}
}
9 changes: 6 additions & 3 deletions Charms/MarkofStrength.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@ public void UpdateTriggers(PlayerData data, HeroController controller)
{
if (Equipped())
{
//ShadeSoul
//Remove ShadeSoul
FsmState castShadeSoul = HeroController.instance.spellControl.GetState("Fireball 2");
castShadeSoul.RemoveAction(3);

//Add Wind Scythe
castShadeSoul.InsertCustomAction("Fireball 2", () => HandleTrigger(AbilityTrigger.Fireball), 3);
}
if (!Equipped())
{
//Add ShadeSoul back.
FsmState castShadeSoul = HeroController.instance.spellControl.GetState("Fireball 2");
FsmStateAction action = HeroController.instance.spellControl.GetAction("Fireball 2", 0);
castShadeSoul.InsertAction(action, 0);
}
HeroController.instance.spellControl.InsertAction("Fireball 2", action, 0);
}
WindScythe.Instance.Load();
return;
}
private void HandleTrigger(AbilityTrigger trigger)
Expand Down
Binary file modified bin/Debug/net472/Fyrenest.dll
Binary file not shown.
Binary file modified bin/Debug/net472/Fyrenest.pdb
Binary file not shown.
Binary file modified obj/Debug/net472/Fyrenest.dll
Binary file not shown.
Binary file modified obj/Debug/net472/Fyrenest.pdb
Binary file not shown.

0 comments on commit 215cccc

Please sign in to comment.