-
Notifications
You must be signed in to change notification settings - Fork 197
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
Implement monster evolutions #585
Conversation
As a bonus, I just adjusted the code to also allow a negative rather than positive level requirement: If you specify a negative number in the level field of the evolution definition, it means the tuxemon must be under rather than above that level for the evolution to work. |
A conditional has now been implemented, following the same format as the action. This allows you to check if you have monsters that can be evolved on the given path, so for instance, the game can show a "you have no tuxemon to evolve" dialog instead of needlessly presenting you with the choice. |
…s may fail when the party is full
"picking any option will cause all tuxemon in your party that have a path for the given keyword defined to morph" I'd rather do it per individual. |
Doing it like that would be a nightmare: The player could have any of 100's of monster definitions, the action chains would be colossal. I could add a monster slot filter, but what would be the benefit? Note that if you want to trigger the evolution of a specific tuxemon, you can already do this with the current implementation: Instead of calling the path "wind" you can use "fruitera:wind" which is specific. In this case the code will only only select the wind path for the fruitera if you have one. |
I made a little change based on what @kerizane mentioned still: Only one evolution will be handled per call... so instead of evolving every tuxemon at once, only the first monster in your party that can evolve will evolve. This will give the user much more control. Thanks for the suggestion! |
@MirceaKitsune looks pretty good. please take a look at my comments. |
@bitcraft Not seeing any comments anywhere. If it's another part of Github that doesn't work let me know here please. |
from tuxemon.core.components.event.eventcondition import EventCondition | ||
|
||
|
||
class EvolveMonstersCondition(EventCondition): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this condition checked anywhere? Also, please document the argument for the path in the docstring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused by which check you meant, couldn't find where the docstring is located.
@MirceaKitsune please check again |
Also, echoing Kerizane's comment, I would also like to see a way to evolve a single monster. But given that we don't have a consistent interface into selecting monsters, we can implement that in the future by refactoring this. Maybe from the monster menu, we could have an additional option called "evolve". |
Very good suggestions! Fixed all of them except the 3rd one: I'm not familiar with the docstring and couldn't find it anywhere. Also confused what you meant by whether the condition is used anywhere... it's a conditional for events actions, it can be used by maps as |
ok cool. it looks pretty good as is, ill get this merged. thanks again! |
Glad to have been part of implementing such an essential feature, and thank you too! Attending to another PR for the night, tomorrow I can hopefully look at making a new one to now implement the default evolutions as documented on the wiki. |
Thanks heaps, MirceaKitsune! Do you need the default evolutions tweaked at all in terms of how they're displayed on the wiki? For example, at the moment it just has either the level that it levels up at, the item it needs to level up with, or a description of some other condition. Ignoring the other conditions for now, is that all you need? Or would you prefer that I create, e.g., an extra field for "morphs by" (above X level, below X level, item, other). |
@Sanglorian I just need a page that displays all intended evolutions if possible. There is one for each monster on the wiki, but going through that for +100 entries is a bit more tedious. I'm happy with the technical implementation for now: It uses event actions so it's flexible and up to the map designer. Only important thing still missing in my book is a song and animation for evolutions. |
No worries - I hope this helps: https://wiki.tuxemon.org/index.php?title=Morphing#All_morphs I couldn't figure out how to only show completed monsters, but you should get a pretty close list if you exclude any monster without an "Evolution Level" specified and exclude any monster with an invalid evolution method. |
@MirceaKitsune @Sanglorian please note we already have a monster generator script which uses the wiki. Please "@" AndyMender if you want to discuss it with him. If we already have the evolutions, lets just work smart and improve the script. |
Thanks. That is quite the list... doing it manually would be a painful experience, the wiki already has them as well. @AndyMender think it would be possible to help with this task please? |
Let's move this convo to a new issue so that its not lost. |
I'm happy to announce the implementation of monster evolutions in Tuxemon! This initial code doesn't contain animations or notifications, but fully implements the ability to define an evolution for a tuxemon which replaces that monster when triggered. Branching evolutionary paths are supported using keywords... for standard evolutions just define and call the tag "default". This should fix #540
Evolutions are called by an event action and don't occur automatically, offering flexibility for game designers while allowing existing dialog choices to select a path. This model allows the following scenario: The player must interact with a device located in the healing center, upon doing so a dialog will ask if they wish to evolve their tuxemon on the "fire" "water" "air" or "ground" path... picking any option will cause all tuxemon in your party that have a path for the given keyword defined to morph into the replacement tuxemon, granted they've reached the level required for that evolution.
This only contains the feature implementation. Once it's merged I can do a separate MR implementing the default tuxemon evolutions as documented on the wiki.
Example of defining this in tuxemon/resources/db/monster/my_monster.json:
To actually carry out the evolution, use the following act on an event in your map:
act1: evolve_monsters default
If you had a Fruitera in your party which reached at least level 10, you should now see a Bursa in its place. It will have inherited the same monster slot, name, level, and HP.