AI Potion Flow (Patreon)
Published:
2018-01-23 10:30:20
Imported:
2026-06
Content
༼ つ ◕_◕ ༽つ GIVE FLOW ༼ つ ◕_◕ ༽つ
so like i said before, we pushed potion AI usage to E18 cuz the whole thing needs to be redone from the ground up yet. here's my draft for the outline. see anything i've forgotten that should be considered?
i'm not 100% sure it'll be able to work like this, but you know, you'll never fly if you don't fall a few times first
- score = 100
- if this item restores HP
- ---recoveramount = healing amount of this potion in % of pokeon's max health restored
- ---score * (2 - (2 * (currenthp / totalhp)))
- ---if the highest expected damage > this pokemon's current HP
- ------if the highest expected damage is greater than this pokemon's current HP + recoveramount (capped at 100)
- ---------score * 0
- ------else
- ---------score * 1.5
- ------if this pokemon has a recovery move, rest, or wish and a protect move
- ---------if the opposing pokemon is faster than this pokemon
- ------------and highest expected damage > this pokemon's HP
- ---------------score * 1.2
- ------------else
- ---------------score * 0.7
- ---------------if recoveramount < 55%
- ------------------score * 0.1
- ---else
- ------score * 0.3
- ---if highest expectedd damage > recoveryamount
- ------score * 0
- ---else
- ------if recoveryamount - highest expected damage < 10
- ---------score * 0.4
- ---if this pokemon is faster than the opponent
- ------score * 0.9
- ------if this pokemon has a move with an initial score of 110
- ---------if the opponent has a known priority move, and this pokemon does not have a move with equal or higher priority that has a score of 110
- ------------score * 1.1
- ------------if that move's expected damage would KO this pokemon
- ---------------score * 2
- ---------else
- ------------score * 0
- ------if this pokemon is full HP
- ---------score * 0
- ------if this pokemon is a sweeper
- ---------score * 1.3
- ---else
- ------score * 1.1
- ------if highest expected damage * 2 is greater than current HP + recoveramount
- ---------score * 0
- ------else
- ---------score * 1.3
- ---------if this pokemon has a move with an initial score of 110
- ------------score * 2
- ------if this pokemon is full HP
- ---------score * 0.5
- ---minipot = pokemon left on our bench
- ---minimini = number of other potions left
- ---loop
- ------if minimini =/= minipot
- ---------if minipot > minimini
- ------------score * 0.9
- ------------minipot - 1
- ---------else
- ------------score * 1.1
- ------------minimini - 1
- ---if this pokemon is a lead or screener
- ------score * 0.6
- ---if this pokemon is a tank
- ------score * 1.3
- ---if this pokemon is a second
- ------score * 1.4
- ---if this pokemon is an ace
- ------score * 1.5
- ---if this pokemon has leftovers or activated black sludge
- ------score * 0.9
- ---if this pokemon has a status and this item does not also recover status
- ------score * 0.6
- ------if that status is bad poison and this is not our last pokemon
- ---------score * 0.2
- ---if the opponent's type1 is SE vs this pokemon
- ------score * 0.7
- ---else
- ------if it's NVE
- ---------score * 1.2
- ---------if it's ineffective
- ------------score * 1.4
- ---if the opponent's type2 is SE vs this pokemon
- ------score * 0.7
- ---else
- ------if it's NVE
- ---------score * 1.2
- ---------if it's ineffective
- ------------score * 1.4
- ---if the highest expected damage is SE vs this pokemon
- ------score * 0.7
- ---else
- ------if it's NVE
- ---------score * 1.2
- ---------if it's ineffective
- ------------score * 1.4
- ---if this pokemon has regenerator and it's not the last pokemon on our team
- ------score * 0.7
- if this item cures status
- ---if this item does not also recover HP
- ------if this pokemon does not have a status
- ---------score * 0
- ------else
- ---------if highest expected damage > currentHP
- ------------if it is from wake up slap and we're asleep, smellingsalts and we're paralyzed, or hex
- ---------------if highest expected damage / 2 > current HP
- ------------------score * 0
- ---------------else
- ------------------score * 2
- ------------else
- ---------------score * 0
- ------if we're asleep
- ---------if this pokemon has sleep talk snore comatose or rest
- ------------score * 0.5
- ---------if the opponent has nightmare bad dreams or dream eater
- ------------score * 1.3
- ---------if highest expected damage is more than 20
- ------------score * 1.3
- ---------else
- ------------score * 0.7
- ------paralyzed---------
- ---------if this pokemon has quick feet or guts
- ------------score * 0.5
- ---------if this pokemon is slower than the opponent, but would be faster when not paralyzed
- ------------score * 1.5
- ---------score * 1.3
- ------burned
- ---------score * 1.2
- ---------if this pokemon has guts
- ------------score * 0.5
- ---------if this pokemon atk > sp.atk
- ------------score * 1.3
- ---------else
- ------------score * 0.8
- ---------if this pokemon has magic guard
- ------------score * 0.5
- ---------if this pokemon has flare boost
- ------------score * 0.3
- ------poisoned
- ---------score * 1.2
- ---------if this pokemon has poison heal
- ------------score * 0.2
- ---------if this pokemon has toxic boost
- ------------score * 0.3
- ---------if this pokemon has magic guard
- ------------score * 0.5
- ---------if this is bad poison
- ------------score * 1.2
- ------------if the bad poison counter is more than 3
- ---------------score * 1.3
- ------frozen
- ---------if this pokemon has a thawing move
- ------------score * 0.5
- ---------if highest expected damage is more than 15
- ------------score * 1.5
- ---if this pokemon has refresh, rest or purify
- ------score * 0.5
- ---if this pokemon has natural cure and it's not the last pokemon on our team
- ------score * 0.3
- ---if this pokemon has shed skin
- ------score * 0.3---
- if this is the last pokemon left on our team
- ---score * 1.3
- else
- ---score * 0.8---
- ---if an item has already been used on this pokemon
- ------score * 0.6
- if this pokemon is confused
- ---score * 0.8
- if this pokemon is attracted
- ---score * 0.6
- if this pokemon has a substitute
- ---score * 1.2
- if this pokemon is seeded
- ---score * 0.5
- if this pokemon is cursed
- ---score * 0.3
- if this pokemon has a perish count
- ---score * 0.1
- minipot = total of this pokemon's stages (pos or neg)
- if this pokemon is a wall
- ---minipot + pokemon's defense/sp.def stage (effecitvely doubling it)
- if this pokemon is a sweeper
- ---minipot + this pokemon's speed stage
- ---if this pokemon's atk > sp.atk
- ------minipot + this pokemon's atk stage
- ---else
- ------minipot + this pokemon's sp.atk stage
- minipot * 5
- minipot + 100
- minipot / 100
- score * minipot
- if the opponent is in the middle of a two turn attack, or is recharging
- ---score * 1.3
- if this pokemon has a move with a score of over 50
- ---score * 1.2
- else
- ---score * 1.3
- score * (2 - Field Disruption Score)
- if trick room is up on our side
- ---score * 0.9
- if tailwind is up on our side
- ---score * 0.7
- if light screen is up on our side
- ---score * 0.8
- if reflect is up on our side
- ---score * 0.8
- if aurora veil is up on our side
- ---score * 0.6
- if this is doubles
- ---score * 0.5
- if the opponent has a known set up move
- ---score * 0.8
- score - 100
- then we can compare this to move scores and switchscore.