Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***********************************
- * TobiObito's *
- * Pokemon Trades Scripts *
- ***********************************/
- // >>>>>>>>>>>>>>>>>>>> Hidden Power Functions <<<<<<<<<<<<<<<<<<<
- var HPType = ['Fighting', 'Flying', 'Poison', 'Ground', 'Rock', 'Bug', 'Ghost', 'Steel', 'Fire', 'Water', 'Grass', 'Electric', 'Psychic', 'Ice', 'Dragon', 'Dark'];
- // a To f to follow Bulbapedia formating
- // Function to get the HP Typing
- function getHiddenPowerType(a, b, c, e, f, d){
- var HPValue
- 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 !== "") {
- // Checks for odds and evens
- a = getTypeValue(a);
- b = getTypeValue(b);
- c = getTypeValue(c);
- d = getTypeValue(d);
- e = getTypeValue(e);
- f = getTypeValue(f);
- // Gets HP Value
- HPValue = Math.floor(((a+2*b+4*c+8*d+16*e+32*f)*15)/63);
- // Displays Proper HP Type
- return HPType[HPValue]
- }
- }
- // u To z to follow Bulbapedia formating
- // Function to get HP Damage
- function getHiddenPowerDamage(u, v, w, y, z, x){
- var HPValue
- 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 !== "") {
- // Checks if value/4 has a remainder of 2 or 3 to obtain Power Value
- u = getPowerValue(u);
- v = getPowerValue(v);
- w = getPowerValue(w);
- x = getPowerValue(x);
- y = getPowerValue(y);
- z = getPowerValue(z);
- // Gets HP Value
- HPValue = Math.floor(((u+2*v+4*w+8*x+16*y+32*z)*40)/63 + 30);
- return HPValue
- }
- }
- // Needed for Hidden Power Typing Function
- function getTypeValue(value){
- if (value%2 == 0 || value == 0)
- return 0;
- else
- return 1;
- }
- // Needed for Hiden Power Damage Function
- function getPowerValue(value){
- if (value%4 == 2 || value%4 == 3)
- return 1;
- else
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment