- 151
- Posts
- 6
- Years
- Seen Feb 4, 2020
Hello guys,
So I thought I was understanding this script but it proved me wrong, I tried this for a super long time and I can't manage to make it work.
My idea is if the dmg are more than the remaining hps of the target then the target should recover and change form except if the form is the last one.
I want the player to face a wild boss which would be really hard and this I make with a hypothetical ditto who would have learned the shape of different strong pokes.
When I copied this code once and had only 2 different forms I managed to make it work and the poke was indeed changing from 1 to 2 and 2 to 1 each time but I had to use the same poke (in my tests 2 pichus, because I was affraid ditto's ability and move would create problems)
if anyone has ideas it would be awesome
thank you
Edit: I'll add some precision, with the above code, the variable seems to get implemented because the condition is verified 6 times and the pokemon is healed 6 times, however the form is never changing. I replaced "target" by "self" and it now works with my own poke. What is the word to talk about the opposite poke?
So I thought I was understanding this script but it proved me wrong, I tried this for a super long time and I can't manage to make it work.
My idea is if the dmg are more than the remaining hps of the target then the target should recover and change form except if the form is the last one.
I want the player to face a wild boss which would be really hard and this I make with a hypothetical ditto who would have learned the shape of different strong pokes.
Code:
if damage>target.hp
if target.form!=6
target.form=(target.form+1)
user.form=(target.form+1) #I also put this line because with all the tests I made I had the feeling that in some situations user works as target and the opposite.
target.hp=1
@battle.pbDisplay(_INTL("DITTO cures itself"))
target.hp=target.totalhp
pbUpdate(true)
#without these below lines nothing is changing even with the above lines so I guess I need them but I don't understand what @pokemon refers at.
@battle.scene.pbChangePokemon(target,@pokemon)
@battle.pbDisplay(_INTL("{1} changed to another Form!",pbThis))
PBDebug.log("[Form changed] #{pbThis} changed to another Form!")
end
end
When I copied this code once and had only 2 different forms I managed to make it work and the poke was indeed changing from 1 to 2 and 2 to 1 each time but I had to use the same poke (in my tests 2 pichus, because I was affraid ditto's ability and move would create problems)
if anyone has ideas it would be awesome
thank you
Edit: I'll add some precision, with the above code, the variable seems to get implemented because the condition is verified 6 times and the pokemon is healed 6 times, however the form is never changing. I replaced "target" by "self" and it now works with my own poke. What is the word to talk about the opposite poke?
Last edited: