-
Notifications
You must be signed in to change notification settings - Fork 13
#9 conditions: add hp.can_explode_pct #34
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
base: master
Are you sure you want to change the base?
Conversation
70d13e1 to
726e438
Compare
|
What would be the effort involved in |
Currently, only the first part can have an argument, i.e.
There can be exactly one argument, and it can only be in the first/middle part of a condition. This is before we even talk about overloading the function to optionally have an argument rather than requiring it. If one wants changes like this, I'd highly recommend redoing the parser/evaluation completely to have the math expressions and alike and have this as a side effect. Doing it just for this seems very not worth it. |
|
I noticed that the condition needs an opts.pet = false. It's always the active pets that are affected.
|
### `hp.can_explode_pct`
If the damage from a pet self-destructing would kill the opponent.
**Return**: `bool`
**Examples**: `self.hp.can_explode_pct(16)` (Can the explode damage of the current player pet kill the enemy pet, assuming it does 16% damage?) |
|
After trying this again, it seems that I did a bad PR here. This adds |
It actually always is the selected pet vs the opponent active pet, i.e. This entire condition is confusing as hell, especially with the inverse nature and the horrible name. My desire to not touch this at all is rising every minute. |
|
Technically it works. but this can lead to unexpected behavior. here is an example: What the user want is: ´[enemy(#2).active & enemy.hp.can_explode]´ |
I'm not saying it is the most useful thing, but I don't think there needs to be a restriction here. There could be a pet with both explode, force-swap-enemy and backline-damage. That pet could It doesn't exist and it likely never will, but hey, why not support it? |
|
Indeed, that's a creative way of using it :D |


The
hp.can_explodecondition assumes 40%, but there is at least Corpse Explosion having the same semantics but using 15% instead. Future abilities might be added with yet another percentage but scripts already can't handle Corpse Explosion, so adding support for this would be good.I don't want to break existing scripts, so there are two approaches here:
hp.can_explode(40%), addhp.can_explode_15(15%) andhp.can_explode_40(40%) (orhp.can_explode15,hp.can_explode40)hp.can_explode(40%), addhp.can_explode_pct(x)and thushp.can_explode_pct(15)to have full flexibility.I don't like the first solution since it requires a hard list of percentages (then again, there are only two). I don't like the second solution because the name is ugly. Sadly,
hp.can_explode(15)isn't possible that easily and I don't want to do bigger changes just for this feature.