KHD

Untitled

KHD
Aug 4th, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     sashclause: {
  2.         effectType: 'Rule',
  3.         onStart: function() {
  4.             this.add('rule', 'Sash Clause: Limit one '+"+this.getItem(focussash).name);
  5.         },
  6.         validateTeam: function(team, format) {
  7.             var hasFocusSash = 0;
  8.             for (var i=0; i<team.length; i++) { // Check each pokemon
  9.                 var item = toId(team[i].item); // Get it's item
  10.                 if (item === 'focussash') hasFocusSash++; // If it's an item add 1 to the counter
  11.                 if (hasFocusSash > 1) { // If the counter is more than 1 return the error
  12.                     return ["You are limited to only one "+this.getItem(focussash).name+" by Sash Clause.","(You have more than one Pokemon with "+this.getItem(focussash).name+")"];
  13.                 }
  14.             }
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment