Thutmose / Pokecube

Primary Development has moved to: https://github.com/Pokecube-Development
https://github.com/Pokecube-Development
19 stars 7 forks source link

Support for TotalEconomy Jobs? #259

Open smmmadden opened 6 years ago

smmmadden commented 6 years ago

Any plans for supporting Total Economy mod with integrating the Jobs/Jobs Sets so that "catch" and "battle" type actions would be configurable so that players can advance their points and monies as they catch each mob?

So a "catch" action would be tossing the pokecube out and catching the mob in the cube would earn exp and/or money depending on what you caught. The rarer the mob, the more you earn. Starting a "battle" with a mob could work two ways. One, if you battle and win, then you earn exp and/or money. However, if you battle and lose then you lose exp and/or money.

Having an option that encourages the players to do certain quests could help keep interest in the game. What do you think? Thanks -Steve

Thutmose commented 6 years ago

that is probably best done on the side of Total Economy, if it adds support for Criteria Triggers, then it will be possible to implement on its side.

The only thing I would need to do in that case, is add a trigger for when a pokemob faints. Note that there is no easily defined "win/lose" condition for "battles", as there are no instanced battles to track, just whether a pokemob faints or not.

MarkL4YG commented 6 years ago

Hey there, I'm a TE contributor and I just wanted to drop in that TE is not a mod in classical sense but a Sponge mod which means the criteria triggers have to be available to Sponge plugins using the SpongeAPI to avoid dirty work-arounds.
Do you happen to have a little more information on that as I'm not that experienced in Forge development at the moment?

Thutmose commented 6 years ago

I have only used them for adding advancements, I haven't yet used them in the way you would need to for checking triggers, but it looks to me like the general idea would be one of the following:

1) At some point after the player has been constructed, loop over CriteriaTriggers.getAll() (all of the triggers), and add a custom listener to the criterion via

addListener(PlayerAdvancements playerAdvancementsIn, ICriterionTrigger.Listener<T> listener)

The main difficulty will be constructing the correct listener, as it seems each criteria uses a unique class for this.

2) Use ASM or Mixins to add a hook in PlayerAdvancements.grantCriterion, similar to the ForgeHooks one that sends the advancement event (it only sends on the first time the advancement it achived, not other times...)

Unfortunately neither of these are particularly easy to do, and for compatiblity with random other mods/plugins, forge or sponge should add in that hook for when a player achieves a Criterion.

MarkL4YG commented 6 years ago

That sounds rather complicated and somewhat dirty codewise. I think you're right about Sponge having to support this. I'll take a look into the jd and see if said support has been implemented (and if mod-triggered criterions even reach us).