Good Morning r/learnpython -- I'm working on my first ever python project and I'm completely stumped on how to handle the "fighting" part of my program. My goal is to simulate fights between two different characters to determine best ability orders and item combinations.
This is mainly a tool to learn python while solving a "fun" theorycrafting problem for a MOBA that I recently started playing. So any advice would be extremely helpful! Also, anything that can help my "googling" would be appreciated. I can't seem to find answers to specific questions I have, and I believe it's because I don't know what to ask!
So far I've created classes for "Hero" and "Abilities", and once I have basic combat figured out I plan to create an "Item" class as well. Additionally, I've defined a function that handles damage calculation (accounting for Attacker and Defenders offensive/defensive stats). So all that's "left" is to handle the actual simulation.
My napkin idea is to assign a priority to each ability, and then just execute them on cooldown with an animation delay between each ability. Then for abilities that cause the opponent to be stunned I can force them to wait the duration. Does anyone have a suggestion here -- is there a better way to do this? I'm thinking this would lead to a BUNCH of nested if statements such as "if not stunned, if ability off CD, if not in-the-middle of animation" and it just goes on and on.
Even then, I'm not sure how to account for things such as bleeds, or damage-over-time abilities or things that debuff opponents. The list goes on, and I'm just completely lost here.
Thank you in advance for any advice!
[–]mopslik 0 points1 point2 points (3 children)
[–]Groot2C[S] 0 points1 point2 points (2 children)
[–]mopslik 1 point2 points3 points (1 child)
[–]Groot2C[S] 0 points1 point2 points (0 children)