Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spacecore] Skill books transpiler request for custom skills #475

Open
Pet-Slime opened this issue Aug 31, 2024 · 2 comments
Open

[Spacecore] Skill books transpiler request for custom skills #475

Pet-Slime opened this issue Aug 31, 2024 · 2 comments

Comments

@Pet-Slime
Copy link
Contributor

Pet-Slime commented Aug 31, 2024

I am not good with transpilers, else I would make the pull request / feature myself.

That said, skillbooks are hardcoded in their drops. I would like to make a request for someone to make a transplier so skillbooks are not hardcoded in their drops.

Places a transpiler is needed...

An example in the fishingRod code...

 public void openTreasureMenuEndFunction(int remainingFish)
  {
      Farmer farmer = lastUser;
      farmer.gainExperience(5, 10 * (clearWaterDistance + 1));
      farmer.UsingTool = false;
      farmer.completelyStopAnimatingOrDoingAction();
      bool num = treasureCaught;
      doneFishing(farmer, consumeBaitAndTackle: true);
      List<Item> list = new List<Item>();
      if (remainingFish == 1)
      {
          list.Add(CreateFish());
      }
      float num2 = 1f;
      if (num)
      {
          Game1.player.stats.Increment("FishingTreasures", 1);
          while (Game1.random.NextDouble() <= (double)num2)
          {
              num2 *= (goldenTreasure ? 0.6f : 0.4f);
              if (Game1.IsSpring && !(farmer.currentLocation is Beach) && Game1.random.NextDouble() < 0.1)
              {
                  list.Add(ItemRegistry.Create("(O)273", Game1.random.Next(2, 6) + ((Game1.random.NextDouble() < 0.25) ? 5 : 0)));
              }
              if (numberOfFishCaught > 1 && farmer.craftingRecipes.ContainsKey("Wild Bait") && Game1.random.NextBool())
              {
                  list.Add(ItemRegistry.Create("(O)774", 2 + ((Game1.random.NextDouble() < 0.25) ? 2 : 0)));
              }
              if (Game1.random.NextDouble() <= 0.33 && farmer.team.SpecialOrderRuleActive("DROP_QI_BEANS"))
              {
                  list.Add(ItemRegistry.Create("(O)890", Game1.random.Next(1, 3) + ((Game1.random.NextDouble() < 0.25) ? 2 : 0)));
              }
              while (Utility.tryRollMysteryBox(0.08 + Game1.player.team.AverageDailyLuck() / 5.0))
              {
                  list.Add(ItemRegistry.Create((Game1.player.stats.Get(StatKeys.Mastery(2)) != 0) ? "(O)GoldenMysteryBox" : "(O)MysteryBox"));
              }
              if (Game1.player.stats.Get(StatKeys.Mastery(0)) != 0 && Game1.random.NextDouble() < 0.05)
              {
                  list.Add(ItemRegistry.Create("(O)GoldenAnimalCracker"));
              }
              if (goldenTreasure && Game1.random.NextDouble() < 0.5)
              {
                  switch (Game1.random.Next(13))
                  {
                      case 0:
                          list.Add(ItemRegistry.Create("(O)337", Game1.random.Next(1, 6)));
                          break;
                      case 1:
                          list.Add(ItemRegistry.Create("(O)SkillBook_" + Game1.random.Next(5)));
                          break;
@spacechase0
Copy link
Owner

When I do this I'll probably make it opt-in, since you might not want your skills droppable from vanilla sources (or at all if it's a story locked skill like with S&S)

@Pet-Slime
Copy link
Contributor Author

Pet-Slime commented Aug 31, 2024

When I do this I'll probably make it opt-in, since you might not want your skills droppable from vanilla sources (or at all if it's a story locked skill like with S&S)

That's 100% fair. Maybe have it be a context tag on the skill book which is turn added to a list during load. The transpiler would then pull from that list.

Going even farther: could have a context tag for each drop. Like "skillbook_drop_fishing" to add it to the fishing list. That way it could be added to each drop source separately.

That would turn allow story locked skills to then add the context tag and update the list once unlocked, or any skill once special conditions are met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants