Recently I’ve been trying to grow my skills by modding an open source game called shattered pixel dungeon and I’ve run Into a problem I don’t quite understand (public int talentPointsAvailable(int tier){ if (lvl < (Talent.tierLevelThresholds[tier] - 1) || (tier == 3 && subClass == HeroSubClass.NONE) || (tier == 4 && armorAbility == null)) { return 0; ) ((https://github.com/00-Evan/shattered-pixel-dungeon/blob/master/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java) (line 372)) This right here, especially (public int talentPointsAvailable(int tier)) I don’t quite understand It seems Its getting a returned 0 but If you look through the code this isn’t exactly defined anywhere doesn’t say where the values going or what It’s affecting but seems to mysteriously be effecting the amount of talent points (amount of stars I have In img above) when I change the returned value. initially I just wanted to challenge myself by giving myself as many talent points as I could but now I just want to know what’s causing that to change the default amount of talent points I have and how you figured It out?

  • KoboldCoterie@pawb.social
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    It looks like this one:

    shattered-pixel-dungeon/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui /TalentButton.java

    is what affects whether you can upgrade your ability or not. The TalentsPane one governs what displays on the panel you pasted the screenshot of, and this one governs what happens when you click the button to upgrade a thing. The onClick method at line 110, In pseudocode:

    When you click the upgrade button:

    • If you’re in upgrade mode,
    • And the hero exists,
    • And the hero is alive,
    • And you have at least 1 talent point available,
    • And the talent you clicked is not maxed,

    Add a point to that talent.

    Bolded line being the one that’s influenced by the method you’re asking about.

    • Noneo@lemmy.worldOP
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      1 year ago

      Thank you I looked at that one I guess my brain kept skipping over It cause I dismissed it before I could even get the chance to see what I missed before thanks