Skip to content

Commit

Permalink
Changed completion milestones.
Browse files Browse the repository at this point in the history
  • Loading branch information
BubkisLord committed Mar 7, 2023
1 parent 23b5068 commit 4b5f82f
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 45 deletions.
Binary file modified .vs/CharmMod/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/CharmMod/v17/.suo
Binary file not shown.
60 changes: 27 additions & 33 deletions CharmMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public override void Initialize(Dictionary<string, Dictionary<string, GameObject
ModHooks.SavegameLoadHook += ModHooks_SavegameLoadHook;
On.PlayerData.CountGameCompletion += SetGameCompletion;
Events.OnEnterGame += GiveStartingItemsAndSetEnabled;
On.UIManager.StartNewGame += PlaceItems;
//On.UIManager.StartNewGame += PlaceItems;

//intialize the Prefabs
PrefabMan.InitializePrefabs(preloadedObjects);
Expand Down Expand Up @@ -491,37 +491,20 @@ private void SetGameCompletion(On.PlayerData.orig_CountGameCompletion orig, glob

float Completion = 0;

// 35% Max
Completion += Charms.Count(c => c.Settings(Settings).Got);
// 50% Max
int CharmMultiplier = 50/Charms.Count();
Completion += CharmMultiplier * Charms.Count(c => c.Settings(Settings).Got);

// 36% Max
if (PlayerData.instance.metIselda) Completion++;

// 37% Max
if (PlayerData.instance.iseldaConvoGrimm) Completion++;

// 42% Max
// 55% Max
if (PlayerData.instance.elderbugGaveFlower) Completion += 5;

// 43% Max
if (PlayerData.instance.tisoDead) Completion++;

// 45% Max
// 57% Max
if (PlayerData.instance.dreamNailUpgraded) Completion += 2;

// 69% Max
Completion += Mathf.Clamp(PlayerData.instance.dreamOrbs, 0, 2400) / 100;

// 79% Max
Completion += Mathf.Clamp(PlayerData.instance.rancidEggs, 0, 10);

// 83% Max
Completion += Mathf.Clamp(PlayerData.instance.royalCharmState, 0, 4);

// 84% Max
if (PlayerData.instance.salubraBlessing) Completion++;
Completion += Mathf.Clamp(PlayerData.instance.dreamOrbs, 0, 2400) / 200;

// 93% Max
// 78% Max
if (PlayerData.instance.notchFogCanyon) Completion++;
if (PlayerData.instance.notchShroomOgres) Completion++;
if (PlayerData.instance.gotGrimmNotch) Completion++;
Expand All @@ -532,14 +515,26 @@ private void SetGameCompletion(On.PlayerData.orig_CountGameCompletion orig, glob
if (PlayerData.instance.slyNotch1) Completion++;
if (PlayerData.instance.slyNotch2) Completion++;

// 97% Max
// 82% Max
Completion += Mathf.Clamp(PlayerData.instance.maxHealth, 5, 9) - 5;

// 100% Max
if (PlayerData.instance.metBanker) Completion++;
if (PlayerData.instance.metCornifer) Completion++;
// 85% Max
if (PlayerData.instance.metMoth) Completion += 3;

// 86% Max
if (PlayerData.instance.metGiraffe) Completion++;

// 100% Max
if (PlayerData.instance.dreamReward1) Completion++;
if (PlayerData.instance.dreamReward2) Completion++;
if (PlayerData.instance.dreamReward3) Completion++;
if (PlayerData.instance.dreamReward4) Completion++;
if (PlayerData.instance.dreamReward5) Completion += 2;
if (PlayerData.instance.dreamReward6) Completion += 2;
if (PlayerData.instance.dreamReward7) Completion += 2;
if (PlayerData.instance.dreamReward8) Completion += 2;
if (PlayerData.instance.dreamReward9) Completion += 2;

Completion = Mathf.Clamp(Completion, 0, 100);

self.completionPercentage = Completion;
Expand Down Expand Up @@ -711,6 +706,7 @@ private void OnUpdate()
if (PlayerData.instance.gaveSlykey && PlayerData.instance.slyConvoNailHoned && PlayerData.instance.completionPercentage > 100) SlyDeal.instance.Settings(Settings).Got = true; LocalSaveData.SlyDealGot = true;
if (PlayerData.instance.honedNail) GiantNail.instance.Settings(Settings).Got = true; LocalSaveData.GiantNailGot = true;
if (PlayerData.instance.hasAllNailArts && PlayerData.instance.hasKingsBrand) MatosBlessing.instance.Settings(Settings).Got = true; LocalSaveData.MatosBlessingGot = true;

if (!LocalSaveData.SturdyNailGot && SturdyNail.instance.Settings(Settings).Got) LocalSaveData.SturdyNailGot = true;
if (!LocalSaveData.BetterCDashGot && BetterCDash.instance.Settings(Settings).Got) LocalSaveData.BetterCDashGot = true;
if (!LocalSaveData.GlassCannonGot && GlassCannon.instance.Settings(Settings).Got) LocalSaveData.GlassCannonGot = true;
Expand All @@ -736,7 +732,7 @@ private void OnUpdate()
if (!LocalSaveData.ShellShieldGot && ShellShield.instance.Settings(Settings).Got) LocalSaveData.ShellShieldGot = true;
if (!LocalSaveData.GravityCharmGot && GravityCharm.instance.Settings(Settings).Got) LocalSaveData.GravityCharmGot = true;
if (!LocalSaveData.BulbousInfectionGot && BulbousInfection.instance.Settings(Settings).Got) LocalSaveData.BulbousInfectionGot = true;
//if (!LocalSaveData.FyreChildGot && Fyrechild.instance.Settings(Settings).Got) LocalSaveData.FyreChildGot = true;
if (!LocalSaveData.FyreChildGot && Fyrechild.instance.Settings(Settings).Got) LocalSaveData.FyreChildGot = true;
if (!LocalSaveData.WyrmFormGot && WyrmForm.instance.Settings(Settings).Got) LocalSaveData.WyrmFormGot = true;
if (!LocalSaveData.VoidSoulGot && VoidSoul.instance.Settings(Settings).Got) LocalSaveData.WyrmFormGot = true;
#endregion
Expand Down Expand Up @@ -1196,8 +1192,6 @@ private void CheckCharmPopup()
if (PlayerData.instance.hasAllNailArts && PlayerData.instance.hasKingsBrand && !LocalSaveData.MatosBlessingDonePopup) MessageController.Enqueue(EmbeddedSprite.Get("MatosBlessing.png"), "Gained Charm"); LocalSaveData.MatosBlessingDonePopup = true;
if (PlayerData.instance.honedNail && !LocalSaveData.ShellShieldDonePopup) MessageController.Enqueue(EmbeddedSprite.Get("ShellShield.png"), "Gained Charm"); LocalSaveData.ShellShieldDonePopup = true;
if (PlayerData.instance.honedNail && !LocalSaveData.VoidSoulDonePopup) MessageController.Enqueue(EmbeddedSprite.Get("VoidSoulPopup.png"), "Gained Charm"); LocalSaveData.VoidSoulDonePopup = true;

// make it buy from salubra
if (PlayerData.instance.geo > 100 && PlayerData.instance.hasCityKey && !LocalSaveData.QuickjumpDonePopup) MessageController.Enqueue(EmbeddedSprite.Get("Quickjump.png"), "Gained Charm"); LocalSaveData.QuickjumpDonePopup = true;
if (PlayerData.instance.killedJellyfish && PlayerData.instance.killsJellyCrawler > 20 && !LocalSaveData.SlowjumpDonePopup) MessageController.Enqueue(EmbeddedSprite.Get("Slowjump.png"), "Gained Charm"); LocalSaveData.SlowjumpDonePopup = true;
#endregion
Expand Down Expand Up @@ -1315,7 +1309,7 @@ public void OnSaveLoad()
if (LocalSaveData.WealthyAmuletGot) WealthyAmulet.instance.Settings(Settings).Got = true;
if (LocalSaveData.ZoteBornGot) ZoteBorn.instance.Settings(Settings).Got = true;
if (LocalSaveData.WyrmFormGot) WyrmForm.instance.Settings(Settings).Got = true;
//if (LocalSaveData.FyreChildGot) Fyrechild.instance.Settings(Settings).Got = true;
if (LocalSaveData.FyreChildGot) Fyrechild.instance.Settings(Settings).Got = true;
if (LocalSaveData.GravityCharmGot) GravityCharm.instance.Settings(Settings).Got = true;
if (LocalSaveData.BulbousInfectionGot) BulbousInfection.instance.Settings(Settings).Got = true;

Expand Down
13 changes: 3 additions & 10 deletions Charms/FyreChild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,9 @@ private void UpdateHook()
{
foreach (GameObject companion in foundCompanions)
{
PlayMakerFSM companionFsm = FSMUtility.LocateMyFSM(companion, "Control");
FsmState fsmState = companionFsm.GetState("Antic");
bool flag4 = companion.tag.Equals("Grimmchild");
if (flag4)
{
companionFsm = FSMUtility.LocateMyFSM(companion, "Control");
fsmState = companionFsm.GetState("Antic");
companion.gameObject.transform.SetScaleX(2f);
companion.gameObject.transform.SetScaleY(2f);
}
//PlayMakerFSM companionFsm = FSMUtility.LocateMyFSM(companion, "Control");
companion.gameObject.transform.SetScaleX(2f);
companion.gameObject.transform.SetScaleY(2f);
this._companions.Add(companion);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Charms/GiantsNail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ namespace Fyrenest
internal class GiantNail : Charm
{
public static readonly GiantNail instance = new();
public override bool Placeable => false;
public override bool Placeable => true;
public override string Sprite => "GiantNail.png";
public override string Name => "Giant's Nail";
public override string Description => "This charm enlarges your nail dramatically.\n\nYou gain an extraordinary amount of power, having the your nail transformed into a giant's.";
public override int DefaultCost => 4;
public override string Scene => "Room_Charm_Shop";
public override float X => 23.1f;
public override float Y => 6.4f;
public override float Y => 6.5f;
private GiantNail() { }

public override CharmSettings Settings(SaveSettings s) => s.GiantNail;
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 4b5f82f

Please sign in to comment.