Advertisement
Guest User

box.js

a guest
Apr 19th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Box extends Movable {
  2.     constructor(x, y, hash, type) {
  3.         super(x, y);
  4.         this.hash = hash;
  5.         this.type = type;
  6.         this.tries = 0;
  7.     }
  8.  
  9.     toString() {
  10.         return JSON.parse(this);
  11.     }
  12.  
  13.     isResource() {
  14.         let type = this.type;
  15.         return (type == "0" || type == "1" || type == "2"); //Prometium - 0 | Endurium - 1 | Terbium - 2
  16.     }
  17.  
  18.     isPalladium() {
  19.         let type = this.type;
  20.         return (type == "8"); // Palladium - 8
  21.     }
  22.  
  23.     isGreenOrGoldBooty() {
  24.         let type = this.type;
  25.         return (type == "PIRATE_BOOTY" || type == "PIRATE_BOOTY_GOLD");
  26.     }
  27.  
  28.     isMasqueBooty() {
  29.         let type = this.type;
  30.         return (type == "MASQUE_BOOTY_BOX");
  31.     }
  32.  
  33.     isBlueBooty() {
  34.         let type = this.type;
  35.         return (type == "PIRATE_BOOTY_BLUE");
  36.     }
  37.  
  38.     isRedBooty() {
  39.         let type = this.type;
  40.         return (type == "PIRATE_BOOTY_RED");
  41.     }
  42.  
  43.     isCargoBox() {
  44.         let type = this.type;
  45.         return (type == "FROM_SHIP" || type == "CANDY_CARGO");
  46.     }
  47.  
  48.     isDropRes() {
  49.         let type = this.type;
  50.         return (type == "AURUS_BOX" || type == "BIFENON" || type == "HYBRID_ALLOY_BOX" || type == "DEMANER_INVADER_BOX");
  51.     }
  52.  
  53.     isCollectable() {
  54.         let type = this.type;
  55.         return (type == "ALIEN_EGG" || type == "BEACON_LOW_RISK_BOX_1" || type == "BEACON_LOW_RISK_BOX_2" || type == "BEACON_LOW_RISK_BOX_3" || type == "BEACON_MED_RISK_BOX_1" || type == "BEACON_MED_RISK_BOX_2" ||type == "BEACON_MED_RISK_BOX_3" || type == "BEACON_MED_RISK_BOX_4" ||/*type == "BONUS_BOX" ||*/ type == "MINI_PUMPKIN" || type == "TURKISH_FLAG" || type == "GIFT_BOXES" || type == "ICY_BOX" || type == "YURIS_BONUS_BOX" || type == "ID_MEXICO" || type == "USA_FLAG" || type == "MAYHEM_BOX" || type == "DEMANER_BOX" || type == "DEMANER_INVADER_BOX" || type == "DEMON_BOX");
  56.     }
  57.  
  58.     isMaterial() {
  59.         let type = this.type;
  60.         return (type == "MUCOSUM" || type == "PRISMATIUM" || type == "SCRAPIUM" || type == "BOLTRUM");
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement