Guest User

TobiObito's Pokemon Scripts 1.1

a guest
May 17th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /***********************************
  2. *           TobiObito's            *
  3. *      Pokemon Trades Scripts      *
  4. ***********************************/
  5.  
  6. // >>>>>>>>>>>>>>>>>>>> Hidden Power Functions <<<<<<<<<<<<<<<<<<<
  7.   var HPType = ['Fighting', 'Flying', 'Poison', 'Ground', 'Rock', 'Bug', 'Ghost', 'Steel', 'Fire', 'Water', 'Grass', 'Electric', 'Psychic', 'Ice', 'Dragon', 'Dark'];
  8.  
  9. // a To f to follow Bulbapedia formating
  10. // Function to get the HP Typing
  11. function getHiddenPowerType(a, b, c, e, f, d){
  12.   var HPValue
  13.   if (a >= 0 && a <= 31 && a !== "" && b >= 0 && b <= 31 && b !== "" && c >= 0 && c <= 31 && c !== "" && d >= 0 && d <= 31 && d !== "" && e >= 0 && e <= 31 && e !== "" && f >= 0 && f <= 31 && f !== "") {
  14.     // Checks for odds and evens
  15.     a = getTypeValue(a);
  16.     b = getTypeValue(b);
  17.     c = getTypeValue(c);
  18.     d = getTypeValue(d);
  19.     e = getTypeValue(e);
  20.     f = getTypeValue(f);
  21.  
  22.     // Gets HP Value
  23.     HPValue = Math.floor(((a+2*b+4*c+8*d+16*e+32*f)*15)/63);
  24.  
  25.     // Displays Proper HP Type
  26.     return HPType[HPValue]
  27.   }
  28. }
  29.  
  30. // u To z  to follow Bulbapedia formating
  31. // Function to get HP Damage
  32. function getHiddenPowerDamage(u, v, w, y, z, x){
  33.   var HPValue
  34.  
  35.   if (u >= 0 && u <= 31 && u !== "" && v >= 0 && v <= 31 && v !== "" && w >= 0 && w <= 31 && w !== "" && x >= 0 && x <= 31 && x !== "" && y >= 0 && y <= 31 && y !== "" && z >= 0 && z <= 31 && z !== "") {
  36.     // Checks if value/4 has a remainder of 2 or 3 to obtain Power Value
  37.     u = getPowerValue(u);
  38.     v = getPowerValue(v);
  39.     w = getPowerValue(w);
  40.     x = getPowerValue(x);
  41.     y = getPowerValue(y);
  42.     z = getPowerValue(z);
  43.  
  44.     // Gets HP Value
  45.     HPValue = Math.floor(((u+2*v+4*w+8*x+16*y+32*z)*40)/63 + 30);
  46.  
  47.     return HPValue
  48.   }
  49. }
  50.  
  51. // Needed for Hidden Power Typing Function
  52. function getTypeValue(value){
  53.     if (value%2 == 0 || value == 0)
  54.       return 0;
  55.     else
  56.       return 1;
  57. }
  58.  
  59. // Needed for Hiden Power Damage Function
  60. function getPowerValue(value){
  61.     if (value%4 == 2 || value%4 == 3)
  62.       return 1;
  63.     else
  64.       return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment