Pokemon Showdown Ability Programming Issue

Status
Not open for further replies.
Hey all. So I've been teaching myself how to program in pokemon showdown, to mixed results. I've learned how to edit moves and pokemon, as well as create new pokemon. However, my first attempt at creating a custom ability hasn't gone to well.

I had an ability idea called skirmisher, which increases the priority of attacking moves with a base power of 40 or lower by 1 (don't worry, I plan to apply it discreetly). However, it came out defective and caused the game to crash every time I sent out a pokemon with the ability. The coding I used is listed below, and it would great if one of you would help me correct whatever problem may have come up.

"skirmisher": {

desc: "This Pokemon's Weaker (40 or less power) moves have their priority increased by 1 stage.",

shortDesc: "This Pokemon's Weaker moves have their priority increased by 1.",

onModifyPriority: function (priority, pokemon, target, move) {

if (basePower <= 40) {

return priority + 1;

}

},

id: "skirmisher",

name: "Skirmisher",

rating: 4.5,

num: 158

},
 

Pikachuun

the entire waruda machine
Code:
"skirmisher": {
    desc: "When this Pokemon uses an attack that has 40 Base Power or less, the move's priority is increased by 1.",
    shortDesc: "This Pokemon's attacks of 40 Base Power have their priority increased by 1."
    onModifyPriority: function (priority, pokemon, target, move) {
        if (move && move.basePower <= 40) return priority + 1;
    },
    id: "skirmisher",
    name: "skirmisher",
    rating: 4.5,
    num: 158
},
Try this code. I haven't tested it, but I'm quite sure it will work judging by how other pieces of code look (and interact with calling a move's base power). Remember to correct the indents if you feel like it.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top