Snapper_Kins
Meandering Trainer
- 7
- Posts
- 14
- Years
- Seen Jul 23, 2023
Hello all, just a question I'm hoping someone can help me with.
In the game I've been working on, I want to add two abilities that work exactly like Magic Guard (damage only from damaging moves) that are more logical for Pokémon that aren't fairy/psychic. I'm using (I believe) version 16.2 still of Essentials (I accidentally completely deleted my whole game when I updated to v16 back in the day and it's serviceable enough). Full disclosure: I'm not good at coding. I can more or less follow what's happening when I look at coding but I'm not good at doing it myself. The coding I've done successfully has mostly been trial and error and luck. In trying to create duplicate Magic Guard abilities, I looked for examples of other abilities that so the same thing and so I looked to Vital Spirit/Insomnia and I found this line:
"if self.hasWorkingAbility(:VITALSPIRIT) || self.hasWorkingAbility(:INSOMNIA) "
and so, I went in and added this after every instance of "Magic Guard":
if self.hasWorkingAbility(:MAGICGUARD) || self.hasWorkingAbility(:EXOSKELETAL) || self.hasWorkingAbility(:PLUMAGE)
And adjusted "if.self" to "if.user" or whatever the currently like was using to it matched down the line. Anywhere Magic Guard was, I added the two abilities in a context -appropriate way. When I went to test this with a Pokémon with the ability holding a toxic orb, and battling a hail-setting wild Pokémon, not only did I take hail and toxic damage, somehow both my Pokémon and the wild Abomasnow were afflicted and damaged by Curse? So clearly whatever I did not only didn't replicate Magic Guard, it made it actively worse.
Is there an easy way to just have the game read "Pokémon has this ability, see instances of Magic Guard for what to do"? If not, what would be the appropriate way to go about duplicating this ability twice-over with new names? Thanks for any help in advance!
In the game I've been working on, I want to add two abilities that work exactly like Magic Guard (damage only from damaging moves) that are more logical for Pokémon that aren't fairy/psychic. I'm using (I believe) version 16.2 still of Essentials (I accidentally completely deleted my whole game when I updated to v16 back in the day and it's serviceable enough). Full disclosure: I'm not good at coding. I can more or less follow what's happening when I look at coding but I'm not good at doing it myself. The coding I've done successfully has mostly been trial and error and luck. In trying to create duplicate Magic Guard abilities, I looked for examples of other abilities that so the same thing and so I looked to Vital Spirit/Insomnia and I found this line:
"if self.hasWorkingAbility(:VITALSPIRIT) || self.hasWorkingAbility(:INSOMNIA) "
and so, I went in and added this after every instance of "Magic Guard":
if self.hasWorkingAbility(:MAGICGUARD) || self.hasWorkingAbility(:EXOSKELETAL) || self.hasWorkingAbility(:PLUMAGE)
And adjusted "if.self" to "if.user" or whatever the currently like was using to it matched down the line. Anywhere Magic Guard was, I added the two abilities in a context -appropriate way. When I went to test this with a Pokémon with the ability holding a toxic orb, and battling a hail-setting wild Pokémon, not only did I take hail and toxic damage, somehow both my Pokémon and the wild Abomasnow were afflicted and damaged by Curse? So clearly whatever I did not only didn't replicate Magic Guard, it made it actively worse.
Is there an easy way to just have the game read "Pokémon has this ability, see instances of Magic Guard for what to do"? If not, what would be the appropriate way to go about duplicating this ability twice-over with new names? Thanks for any help in advance!