Advertisement
Cicco23

nbgame.js

May 13th, 2019
1,238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** @author=Cicco23 */
  2. /*
  3. Parameters:
  4. > q = $(query)
  5. > u = $(user)
  6. > ul = $(userlevel)
  7. > uid = $(userid)
  8. */
  9. /*Clear useless spaces*/
  10. /*a fa il parseInt della stringa q. 10 -> DECIMALE*/
  11. /*var a = parseInt(""+q,10);*/
  12. var a;
  13. a = parseFloat(q);
  14. function powerup(x){
  15.     var flag = true;
  16. /*  str = "The variable is "+x+" "+str; */
  17.     if(ul=="everyone" && x<5) str = str+"\t You've used: FIRE FIST!๐Ÿ‘Š๐Ÿ”ฅ It's effective! ";
  18.     else if(ul=="owner" || (ul=="moderator" && u=="Jason Urgo")) str=str+"\t You've used: HAKAI!!!!! โšก๐Ÿ”ฅ Nightbot has been wrecked.";
  19. /* Harsh's UserID */
  20.     else if(uid=="UCZiV2lTw3mB1ldjKeqZbC7g" && x<20) str=str+"\t You've used: HARSH'S LIGHTNING SLASH! ๐Ÿ—ก๏ธโšก It's super-effective!";
  21. /* NASA's UserID */
  22.     else if(uid=="UCIcvISfbsNdcRs3QM0onerA" && x<20) str=str+"\t You've used: NASA'S CELESTIAL CANNON! ๐Ÿ”ญ ๐ŸŒƒ โšก It's super-effective!";
  23. /* Entropy's UserID */
  24.     else if(uid=="UCHx5_btVT_oroVjmAnoFKJw" && x<20) str=str+"\t You've used: ENTROPY'S PONY WAVE! ๐Ÿด๐Ÿฆ„ Nightbot has been pushed off the ring!";
  25. /* Emily Rossiter's UserID */
  26.     else if(( uid=="UCcJSrQEuebixfCG-LddcHjQ" || uid=="UC1QQ2foRoPVsz1wXdWnTIaQ" ) && x<20) str=str+"\t You've used: EMILY COOKIE CHARM! ๐Ÿช๐Ÿ’™ Nightbot is confused, and fell off the ring!";
  27. /* Enigmont's UserID */
  28.     else if(uid=="UCiF_EH32BisyKzdRXMW8lJA" && x<20) str=str+"\t You've used: ENIGMONT'S LIGHTNING FIST! ๐Ÿ‘Šโšก It's super-effective! Nightbot fainted.";
  29. /* Cicco23's UserID */
  30.     else if(uid=="UC_c5POSMvg8myR_kU_w-cZA" && x<20) str=str+"\t You've used command: /push Nightbot (Cicco23 you little cheater! ๐Ÿ˜ก)";
  31. /* gotta edit this ASAP xD */
  32.     else if(ul=="moderator" && u=="adeline") str=str+"\t Nightbot got scared by BOT-TERMINATOR A.D.E.L.I.N.E., and fell off the ring!";
  33.     else if(ul=="moderator" && x<20) str=str+"\t You've used: FINAL FLASH! โšกโšก It's super-effective!";
  34.     else if(ul=="subscriber" && x<25) str=str+"\t You've used: SB CRAB RAVE! ๐Ÿฆ€๐Ÿฆ€ Nightbot is confused, and fell off the ring!";
  35.     else if(ul=="regular" && x<10) str=str+"\t You've used: ROUNDHOUSE FIRE KICK! ๐Ÿ”ฅ๐Ÿ”ฅ It's super-effective!";
  36.     else flag = false;
  37.     return flag;
  38. }
  39. if(isNaN(a)) "@"+u+" -> ERROR!!! \" "+q+" \" is NOT a number. Please choose a number between 0 and 100, next time! ๐Ÿ‘ ";
  40. else if(Math.abs(q)>100) "@"+u+" -> ERROR. "+q+" is not a valid number. Please choose a number between 0 and 100, next time! ๐Ÿ‘ ";
  41. else{
  42.     a = Math.abs(Math.round(a));
  43.     var bound = 20+Math.random()*100;
  44.     bound = Math.ceil(bound);
  45.     if(bound>100) bound=100;
  46.     var nb = Math.random()*bound;
  47.     nb = 1+Math.floor(nb);
  48.     var str = "@"+u+" -> Here is your number: "+a+" , the bound is "+bound+" , and Nightbot choose: "+nb+".";
  49.     if(a>bound) str = str+" YOU LOSE... You fell out from the ring. Better luck next time!! ๐Ÿ‘ ";
  50.     else if(a==nb) str = str+" OMG IT'S A DRAW!!!!! ๐Ÿ”ฅ ๐Ÿ”ฅ ";
  51.         else if(a>nb) str = str+" YOU WIN!!! FLAWLESS VICTORY! ๐Ÿ˜Ž ๐Ÿ”ฅ ๐ŸŽ‰ ";
  52.         else{
  53.             var battle = (nb-a);
  54.             if(powerup(battle)) str = str+"\t YOU WIN!!! ๐ŸŽ‰ ๐ŸŽ‰ ";
  55.             else str = str+" YOU LOSE... Better luck next time!! ๐Ÿ‘ ";
  56.         }
  57.     if(!(ul=="moderator" ||ul=="owner")) str+" [PLEASE WAIT 20sec BEFORE NEXT ROUND!]";
  58.     else str;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement