Pet Battle Scripts

Pet Battle Scripts

265k Downloads

customizable can_explode condition

patf0rd opened this issue · 5 comments

commented

We have hp.can_explode to return true when the target's actual Health is lower than 40% of the source pet's MaxHealth.

Would like to see a customizable version being added, where we add a value for this Maximum Health (percent), i.E. 40 for Explode/Burst or 15 for Corpse Explosion (and whatever numbers new abilities might bring).

commented

Would #13 solve this for you?

commented

Honestly. I have no idea what all the stuff there is about. I only know/use test["text"] to return text strings, when I wanna make sure the people don't use incorrect breeds, or when I suggest finishing a fight with a standard attack that I can't predict (whether ID or ability slot).

commented

No: it doesn’t make sense in the current state: you can only write math expressions on one side with no variables inside. This would need [ enemy.hp <= self.hp * 0.15 ], which is not possible.

In fact that’s a limitation making the entire #13 essentially pointless. You don’t want to calculate with constants only. I’m not sure why I never noticed/mentioned that in #13. The thing making this feature useful is having an environment with variables.

commented

~~#34 adds hp.can_explode_pct(15). ~~

commented

I don't mean to tack on here but if we are adding conditionals, would a hp.can_explode_(+xxx) damage or something like that be possible for calculating when there is also a DOT as well or if they have some sort of defensive blocking damage

I've done a few work arounds when doing scripts like using self power and speed to calculate but something like that would save me a bit of script smoke and mirrors