Exemple #1
0
 public static void isSlotHover(int x, int y, int i, int j, int k) {
   if (Mideas.mouseX() >= Display.getWidth() / 2 + x
       && Mideas.mouseX() <= Display.getWidth() / 2 + x + 42
       && Mideas.mouseY() >= Display.getHeight() / 2 + y + i
       && Mideas.mouseY() <= Display.getHeight() / 2 + y + j) {
     slot_hover[k] = true;
   }
 }
Exemple #2
0
 private static boolean checkInventory(Shop item) throws FileNotFoundException, SQLException {
   int i = 0;
   while (i < Mideas.bag().getBag().length) {
     if (Mideas.bag().getBag(i) == null) {
       Mideas.bag().setBag(i, StuffManager.getClone(item.getId()));
       CharacterStuff.setBagItems();
       return true;
     }
     i++;
   }
   LogChat.setStatusText3("Votre inventaire est pleins");
   return false;
 }
Exemple #3
0
 private void drawDownArrow() {
   if (this.y_ascensor == this.y_size + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor()) {
     Draw.drawQuad(Sprites.scrollbar_grey_down_arrow, this.x + 5, this.y + this.y_size);
   } else {
     Draw.drawQuad(Sprites.scrollbar_down_arrow, this.x + 5, this.y + this.y_size);
   }
 }
Exemple #4
0
 public float getScrollPercentage() {
   if (this.y_ascensor == this.Y_ASCENSOR_UP_SHIFT) {
     return 0;
   }
   if (this.y_ascensor == this.y_size + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor()) {
     return 1;
   }
   return (this.y_ascensor) / (this.y_size - Sprites.ascensor.getImageHeight());
 }
Exemple #5
0
 public static void loadStuffs() throws SQLException, CloneNotSupportedException {
   JDOStatement statement = Mideas.getJDO().prepare("SELECT id, class, price FROM shop");
   statement.execute();
   while (statement.fetch()) {
     int id = statement.getInt();
     short classeTemp = statement.getShort();
     ClassType[] classeType = StuffManager.getClasses(classeTemp);
     int sellPrice = statement.getInt();
     shopList.add(new Shop(id, classeType, sellPrice));
   }
 }
Exemple #6
0
 public void draw() {
   Draw.drawQuad(
       Sprites.scrollbar,
       this.x - 2,
       this.y + Sprites.top_button.getImageHeight() * Mideas.getDisplayXFactor(),
       Sprites.scrollbar.getImageWidth() * Mideas.getDisplayXFactor(),
       this.y_size
           + 17
           - Sprites.top_button.getImageHeight() * Mideas.getDisplayXFactor()
           - Sprites.bot_button.getImageHeight() * Mideas.getDisplayXFactor());
   Draw.drawQuad(Sprites.top_button, this.x - 2, this.y);
   Draw.drawQuad(
       Sprites.bot_button,
       this.x - 2,
       this.y
           + 19
           + this.y_size
           - Sprites.top_button.getImageHeight() * Mideas.getDisplayXFactor());
   drawUpArrow();
   drawDownArrow();
   Draw.drawQuad(Sprites.ascensor, this.x + 5, this.y + this.y_ascensor);
 }
Exemple #7
0
 public static void buyItems(boolean slot_hover, Shop stuff)
     throws FileNotFoundException, SQLException {
   if (Mouse.getEventButton() == 1 && slot_hover && stuff != null) {
     if (Mouse.getEventButtonState()) {
     } else {
       if (Mideas.getCurrentGold() >= stuff.getSellPrice()) {
         /*if(stuff.get) {
         	EndFightFrame.dropItem(stuff, 1);
         	LogChat.setStatusText3("Vous avez bien acheté "+stuff.getStuffName());
         	Mideas.setGold(-stuff.getSellPrice());
         }*/
         if (checkInventory(stuff)) {
           Mideas.setGold(-stuff.getSellPrice());
           LogChat.setStatusText3(
               "Vous avez bien acheté " + StuffManager.getStuff(stuff.getId()).getStuffName());
         }
       } else {
         LogChat.setStatusText3("Vous n'avez pas assez d'argent");
       }
     }
   }
 }
Exemple #8
0
 public static boolean chatCommandManager(String message) {
   message = message.trim().toLowerCase();
   if (message.length() > 1
       && message.substring(0, 1).equals(".")
       && !message.substring(1, 2).equals(".")
       && !message.equals(".")) {
     String[] datas = message.split(" ");
     if (datas.length >= 1) {
       if (datas[0].equals(".joueur1")) {
         ChatCommandPlayer.chatCommandPlayer(Mideas.joueur1(), datas);
       } else if (datas[0].equals(".target")) {
         ChatCommandPlayer.chatCommandPlayer(Mideas.joueur1().getTarget(), datas);
       } else if (datas[0].equals(".get")) {
         ChatCommandGet.chatCommandGet(datas);
       } else {
         ChatCommandOther.chatCommandOther(datas);
       }
     }
     return true;
   }
   return false;
 }
Exemple #9
0
 private void mouseScroll() {
   if (Mideas.mouseX() >= this.x - this.x_frame_size + 25
       && Mideas.mouseX() <= this.x + 25
       && Mideas.mouseY() >= this.y - 25
       && Mideas.mouseY() <= this.y + this.y_frame_size + 25) {
     if (this.mouseWheel != 0) {
       System.out.println(this.mouseWheel);
       if (this.mouseWheel > 0 && this.y_ascensor - this.scroll_tick_size > 23) {
         this.y_ascensor -= this.scroll_tick_size;
       } else if (this.mouseWheel > 0 && this.y_ascensor - this.scroll_tick_size <= 23) {
         this.y_ascensor = this.Y_ASCENSOR_UP_SHIFT;
       } else if (this.mouseWheel < 0
           && this.y_ascensor + this.scroll_tick_size + 18 < this.y_size - 5) {
         this.y_ascensor += this.scroll_tick_size;
       } else if (this.mouseWheel < 0
           && this.y_ascensor + this.scroll_tick_size + 18 >= this.y_size - 5) {
         this.y_ascensor = this.y_size + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor();
       }
       this.y_ascensor_lastclick = this.y_ascensor;
       this.mouseWheel = 0;
     }
   }
 }
Exemple #10
0
 private void mouseDragEvent() {
   if (Mideas.mouseX() >= this.x + 4 && Mideas.mouseX() <= this.x + 24) {
     if (Mideas.mouseY() >= this.y + this.y_ascensor
         && Mideas.mouseY() <= this.y + this.y_ascensor + 16) {
       if (Mouse.getEventButton() == 0 || Mouse.getEventButton() == 1) {
         if (Mouse.getEventButtonState()) {
           this.down = true;
           this.y_ascensor_onclick = Mideas.mouseY();
         }
       }
     }
   }
   if (Mouse.getEventButton() == 0 || Mouse.getEventButton() == 1) {
     if (!Mouse.getEventButtonState()) {
       this.down = false;
       this.y_ascensor_lastclick = this.y_ascensor;
     }
   }
   if (this.down) {
     if (Mideas.mouseY() >= this.y + this.Y_ASCENSOR_UP_SHIFT + 11
         && Mideas.mouseY()
             <= this.y
                 + this.y_size
                 + 7
                 + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor()) {
       this.y_ascensor = Mideas.mouseY() - this.y_ascensor_onclick + this.y_ascensor_lastclick;
     } else if (Mideas.mouseY() <= this.y + this.Y_ASCENSOR_UP_SHIFT + 11) {
       this.y_ascensor = this.Y_ASCENSOR_UP_SHIFT;
     } else if (Mideas.mouseY()
         >= this.y + this.y_size + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor()) {
       this.y_ascensor = this.y_size + this.Y_ASCENSOR_DOWN_SHIFT * Mideas.getDisplayXFactor();
     }
   }
 }
Exemple #11
0
 public static boolean mouseEvent() {
   hoverLeft1 = false;
   hoverLeft2 = false;
   hoverLeft3 = false;
   hoverLeft4 = false;
   hoverLeft5 = false;
   hoverLeft6 = false;
   hoverLeft7 = false;
   hoverLeft8 = false;
   hoverLeft9 = false;
   hoverLeft10 = false;
   if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 48) {
     hoverLeft1 = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24 + 66
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47 + 66
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 48) {
     hoverLeft2 = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24 + 132
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47 + 132
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 48) {
     hoverLeft3 = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12 + 65
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12 + 65
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 65 + 48) {
     hoverLeft4 = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24 + 66
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47 + 66
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12 + 65
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 65 + 48) {
     hoverLeft5 = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + Talent.getX() + 24 + 132
       && Mideas.mouseX() <= Display.getWidth() / 2 + Talent.getX() + 24 + 47 + 132
       && Mideas.mouseY() >= Display.getHeight() / 2 + Talent.getY() + 12 + 65
       && Mideas.mouseY() <= Display.getHeight() / 2 + Talent.getY() + 12 + 65 + 48) {
     hoverLeft6 = true;
   }
   if (Mouse.getEventButtonState()) {
     if (Mouse.getEventButton() == 0) {
       if (numberTalent < Mideas.joueur1().getLevel() + 1) {
         if (hoverLeft1 && heroicStrikeTalent < 3) {
           heroicStrikeTalent++;
           numberArmsTalent++;
           numberFirstArms++;
           numberTalent++;
           // ((SpellShortcut)Mideas.joueur1().getSpells(0)).getSpell().setDamage(((SpellShortcut)Mideas.joueur1().getSpells(0)).getSpell().getDefaultDamage()*0.05f);
           Talent.setTalent();
         } else if (hoverLeft2 && deflectionTalent < 5) {
           deflectionTalent++;
           numberArmsTalent++;
           numberFirstArms++;
           numberTalent++;
           Mideas.joueur1().setStuffArmor(5);
           Talent.setTalent();
         } else if (hoverLeft3 && improvedRend < 3) {
           improvedRend++;
           numberArmsTalent++;
           numberFirstArms++;
           numberTalent++;
           Talent.setTalent();
         } else if (hoverLeft4 && improvedCharge < 2 && numberFirstArms >= 5) {
           improvedCharge++;
           numberArmsTalent++;
           numberTalent++;
           Talent.setTalent();
         } else if (hoverLeft5 && ironWill < 5 && numberFirstArms >= 5) {
           ironWill++;
           numberArmsTalent++;
           numberTalent++;
           Talent.setTalent();
         } else if (hoverLeft6 && improvedThunderClap < 3 && numberFirstArms >= 5) {
           improvedThunderClap++;
           numberArmsTalent++;
           numberTalent++;
           Talent.setTalent();
         }
       }
     }
     if (Mouse.getEventButton() == 1) {
       if (hoverLeft1
           && heroicStrikeTalent > 0
           && checkLine(numberFirstArms, improvedCharge, ironWill, improvedThunderClap)) {
         heroicStrikeTalent--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         // ((SpellShortcut)Mideas.joueur1().getSpells(0)).getSpell().setDamage(-((SpellShortcut)Mideas.joueur1().getSpells(0)).getSpell().getDefaultDamage()*0.05f);
         Talent.setTalent();
       } else if (hoverLeft2
           && deflectionTalent > 0
           && checkLine(numberFirstArms, improvedCharge, ironWill, improvedThunderClap)) {
         deflectionTalent--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         Mideas.joueur1().setStuffArmor(-5);
         Talent.setTalent();
       } else if (hoverLeft3
           && improvedRend > 0
           && checkLine(numberFirstArms, improvedCharge, ironWill, improvedThunderClap)) {
         improvedRend--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         Talent.setTalent();
       } else if (hoverLeft4 && improvedCharge > 0) {
         improvedCharge--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         Talent.setTalent();
       } else if (hoverLeft5 && ironWill > 0) {
         ironWill--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         Talent.setTalent();
       } else if (hoverLeft6 && improvedThunderClap > 0) {
         improvedThunderClap--;
         numberArmsTalent--;
         numberFirstArms--;
         numberTalent--;
         Talent.setTalent();
       }
     }
   }
   return false;
 }
Exemple #12
0
public class SocialFrame {

  static SocialFrameMenu selectedMenu = SocialFrameMenu.GUILD_FRAME;
  static Friend selectedFriend;
  private static int Y_SOCIAL_FRAME_DEFAULT = 115;
  static float Y_SOCIAL_FRAME = Y_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayYFactor();
  private static int X_SOCIAL_FRAME_DEFAULT = 5;
  static float X_SOCIAL_FRAME = X_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayXFactor();
  private static final float BUTTON_MENU_Y = 461;
  private static final float BUTTON_MENU_Y_SIZE = 33;
  private static ButtonMenu friendButtonMenu =
      new ButtonMenu(
          X_SOCIAL_FRAME + 20 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
          54 * Mideas.getDisplayXFactor(),
          BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor(),
          "Friends",
          10,
          1,
          true) {

        @Override
        public void eventButtonClick() {
          unselectAllButton();
          this.setIsSelected(true);
          selectedMenu = SocialFrameMenu.FRIEND_FRAME;
        }
      };
  private static ButtonMenu whoButtonMenu =
      new ButtonMenu(
          X_SOCIAL_FRAME + 80 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
          44 * Mideas.getDisplayXFactor(),
          BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor(),
          "Who",
          10,
          1,
          false) {

        @Override
        public void eventButtonClick() {
          unselectAllButton();
          this.setIsSelected(true);
          // selectedMenu = SocialFrameMenu.WHO_FRAME;
        }
      };
  private static ButtonMenu guildButtonMenu =
      new ButtonMenu(
          X_SOCIAL_FRAME + 130 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
          60 * Mideas.getDisplayXFactor(),
          BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor(),
          "Guild",
          10,
          1,
          false) {

        @Override
        public void eventButtonClick() {
          unselectAllButton();
          this.setIsSelected(true);
          selectedMenu = SocialFrameMenu.GUILD_FRAME;
        }

        @Override
        public boolean activateCondition() {
          return Mideas.joueur1().getGuild() != null;
        }
      };
  private static ButtonMenu discussionButtonMenu =
      new ButtonMenu(
          X_SOCIAL_FRAME + 194 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
          85 * Mideas.getDisplayXFactor(),
          BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor(),
          "Discussion",
          10,
          1,
          false) {

        @Override
        public void eventButtonClick() {
          unselectAllButton();
          this.setIsSelected(true);
          // selectedMenu = SocialFrameMenu.DISCUSSION_FRAME;
        }
      };
  private static ButtonMenu raidButtonMenu =
      new ButtonMenu(
          X_SOCIAL_FRAME + 285 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
          49 * Mideas.getDisplayXFactor(),
          BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor(),
          "Raid",
          10,
          1,
          false) {

        @Override
        public void eventButtonClick() {
          unselectAllButton();
          this.setIsSelected(true);
          // selectedMenu = SocialFrameMenu.RAID_FRAME;
        }
      };
  private static CrossButton closeFrame =
      new CrossButton(
          X_SOCIAL_FRAME + 370 * Mideas.getDisplayXFactor(),
          Y_SOCIAL_FRAME + 14 * Mideas.getDisplayYFactor()) {

        @Override
        public void eventButtonClick() {
          Interface.setSocialFrameStatus(false);
          this.reset();
        }
      };
  private static boolean draw = true;

  public static void draw() {
    if (selectedMenu == SocialFrameMenu.FRIEND_FRAME) {
      FriendsFrame.draw();
    } else if (selectedMenu == SocialFrameMenu.WHO_FRAME) {
      drawWhoFrame();
    } else if (selectedMenu == SocialFrameMenu.GUILD_FRAME) {
      GuildFrame.draw();
    } else if (selectedMenu == SocialFrameMenu.DISCUSSION_FRAME) {
      drawDiscussionFrame();
    } else if (selectedMenu == SocialFrameMenu.RAID_FRAME) {
      drawRaidFrame();
    }
    if (draw) {
      friendButtonMenu.draw();
      whoButtonMenu.draw();
      guildButtonMenu.draw();
      discussionButtonMenu.draw();
      raidButtonMenu.draw();
      closeFrame.draw();
    }
  }

  public static boolean mouseEvent() {
    if (friendButtonMenu.event()) return true;
    if (whoButtonMenu.event()) return true;
    if (guildButtonMenu.event()) return true;
    if (discussionButtonMenu.event()) return true;
    if (raidButtonMenu.event()) return true;
    if (closeFrame.event()) return true;
    if (selectedMenu == SocialFrameMenu.FRIEND_FRAME) {
      return FriendsFrame.mouseEvent();
    } else if (selectedMenu == SocialFrameMenu.WHO_FRAME) {
      return mouseEventWhoFrame();
    } else if (selectedMenu == SocialFrameMenu.GUILD_FRAME) {
      return GuildFrame.mouseEvent();
    } else if (selectedMenu == SocialFrameMenu.DISCUSSION_FRAME) {
      return mouseEventDiscussionFrame();
    } else if (selectedMenu == SocialFrameMenu.RAID_FRAME) {
      return mouseEventRaidFrame();
    }
    return false;
  }

  private static void drawWhoFrame() {}

  private static void drawDiscussionFrame() {}

  private static void drawRaidFrame() {}

  private static boolean mouseEventWhoFrame() {

    return false;
  }

  private static boolean mouseEventDiscussionFrame() {

    return false;
  }

  private static boolean mouseEventRaidFrame() {

    return false;
  }

  static void unselectAllButton() {
    friendButtonMenu.setIsSelected(false);
    whoButtonMenu.setIsSelected(false);
    guildButtonMenu.setIsSelected(false);
    discussionButtonMenu.setIsSelected(false);
    raidButtonMenu.setIsSelected(false);
  }

  public static void updateSize() {
    Y_SOCIAL_FRAME = Y_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayYFactor();
    X_SOCIAL_FRAME = X_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayXFactor();
    friendButtonMenu.update(
        X_SOCIAL_FRAME + 20 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
        54 * Mideas.getDisplayXFactor(),
        BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
    whoButtonMenu.update(
        X_SOCIAL_FRAME + 80 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
        44 * Mideas.getDisplayXFactor(),
        BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
    guildButtonMenu.update(
        X_SOCIAL_FRAME + 130 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
        60 * Mideas.getDisplayXFactor(),
        BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
    discussionButtonMenu.update(
        X_SOCIAL_FRAME + 194 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
        85 * Mideas.getDisplayXFactor(),
        BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
    raidButtonMenu.update(
        X_SOCIAL_FRAME + 285 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
        49 * Mideas.getDisplayXFactor(),
        BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
    closeFrame.update(
        X_SOCIAL_FRAME + 370 * Mideas.getDisplayXFactor(),
        Y_SOCIAL_FRAME + 14 * Mideas.getDisplayYFactor());
  }

  public static void test() {
    friendButtonMenu.setIsSelected(!friendButtonMenu.isSelected());
    whoButtonMenu.setIsSelected(!whoButtonMenu.isSelected());
    guildButtonMenu.setIsSelected(!guildButtonMenu.isSelected());
    draw = !draw;
  }
}
Exemple #13
0
 public static void updateSize() {
   Y_SOCIAL_FRAME = Y_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayYFactor();
   X_SOCIAL_FRAME = X_SOCIAL_FRAME_DEFAULT * Mideas.getDisplayXFactor();
   friendButtonMenu.update(
       X_SOCIAL_FRAME + 20 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
       54 * Mideas.getDisplayXFactor(),
       BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
   whoButtonMenu.update(
       X_SOCIAL_FRAME + 80 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
       44 * Mideas.getDisplayXFactor(),
       BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
   guildButtonMenu.update(
       X_SOCIAL_FRAME + 130 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
       60 * Mideas.getDisplayXFactor(),
       BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
   discussionButtonMenu.update(
       X_SOCIAL_FRAME + 194 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
       85 * Mideas.getDisplayXFactor(),
       BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
   raidButtonMenu.update(
       X_SOCIAL_FRAME + 285 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + BUTTON_MENU_Y * Mideas.getDisplayYFactor(),
       49 * Mideas.getDisplayXFactor(),
       BUTTON_MENU_Y_SIZE * Mideas.getDisplayYFactor());
   closeFrame.update(
       X_SOCIAL_FRAME + 370 * Mideas.getDisplayXFactor(),
       Y_SOCIAL_FRAME + 14 * Mideas.getDisplayYFactor());
 }
Exemple #14
0
 public static void draw() throws LWJGLException, IOException {
   int xLeft = -279;
   int xRight = -114;
   int y = -275;
   int yShift = 52;
   Draw.drawQuad(Sprites.shop_frame, Display.getWidth() / 2 - 300, Display.getHeight() / 2 - 350);
   drawShopItem(0, xLeft, y);
   drawShopItem(1, xLeft, y + yShift);
   drawShopItem(2, xLeft, y + 2 * yShift);
   drawShopItem(3, xLeft, y + 3 * yShift);
   drawShopItem(4, xLeft, y + 4 * yShift);
   drawShopItem(5, xRight, y);
   drawShopItem(6, xRight, y + yShift);
   drawShopItem(7, xRight, y + 2 * yShift);
   drawShopItem(8, xRight, y + 3 * yShift);
   drawShopItem(9, xRight, y + 4 * yShift);
   shopHover(0, xLeft, y);
   shopHover(1, xLeft, y + yShift);
   shopHover(2, xLeft, y + 2 * yShift);
   shopHover(3, xLeft, y + 3 * yShift);
   shopHover(4, xLeft, y + 4 * yShift);
   shopHover(5, xRight, y);
   shopHover(6, xRight, y + yShift);
   shopHover(7, xRight, y + 2 * yShift);
   shopHover(8, xRight, y + 3 * yShift);
   shopHover(9, xRight, y + 4 * yShift);
   drawGoldCoin(0, xLeft, y);
   drawGoldCoin(1, xLeft, y + yShift);
   drawGoldCoin(2, xLeft, y + 2 * yShift);
   drawGoldCoin(3, xLeft, y + 3 * yShift);
   drawGoldCoin(4, xLeft, y + 4 * yShift);
   drawGoldCoin(5, xRight, y);
   drawGoldCoin(6, xRight, y + yShift);
   drawGoldCoin(7, xRight, y + 2 * yShift);
   drawGoldCoin(8, xRight, y + 3 * yShift);
   drawGoldCoin(9, xRight, y + 4 * yShift);
   calcCoin(Mideas.joueur1().getGold(), xRight, y + 250);
   if (hover_button) {
     Draw.drawQuad(
         Sprites.close_shop_hover, Display.getWidth() / 2 + 27, Display.getHeight() / 2 - 337);
   }
   if (page != 0) {
     Draw.drawQuad(
         Sprites.left_colored_arrow,
         Display.getWidth() / 2 + xLeft + 3,
         Display.getHeight() / 2 + y + 268);
   }
   if (page != 2) {
     Draw.drawQuad(
         Sprites.right_colored_arrow,
         Display.getWidth() / 2 + xRight + 125,
         Display.getHeight() / 2 + y + 268);
   }
   if (right_arrow && page != 2) {
     Draw.drawQuad(
         Sprites.right_arrow_hover,
         Display.getWidth() / 2 + xRight + 125,
         Display.getHeight() / 2 + y + 268);
   }
   if (left_arrow && page != 0) {
     Draw.drawQuad(
         Sprites.left_arrow_hover,
         Display.getWidth() / 2 + xLeft + 3,
         Display.getHeight() / 2 + y + 268);
   }
   if (page == 2) {
     Draw.drawQuad(
         Sprites.right_uncolored_arrow,
         Display.getWidth() / 2 + xRight + 125,
         Display.getHeight() / 2 + y + 268);
   }
 }
Exemple #15
0
 public static boolean calcCoin(int cost, int x, int y) throws FileNotFoundException {
   if (Mideas.calcGoldCoinCost(cost) > 0
       && Mideas.calcSilverCoinCost(cost) > 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           > 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcGoldCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.gold_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y);
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2
             + x
             + 20
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcSilverCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.silver_coin,
         Display.getWidth() / 2
             + x
             + 21
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcGoldCoinCost(cost))
                     + String.valueOf(Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y);
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2
             + x
             + 48
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcGoldCoinCost(cost) + Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y,
         String.valueOf(
             cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.copper_coin,
         Display.getWidth() / 2
             + x
             + 38
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcGoldCoinCost(cost))
                     + String.valueOf(Mideas.calcSilverCoinCost(cost))
                     + String.valueOf(
                         cost
                             - Mideas.calcGoldCoinCost(cost) * 10000
                             - Mideas.calcSilverCoinCost(cost) * 100)),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) > 0
       && Mideas.calcSilverCoinCost(cost) > 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           <= 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcGoldCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.gold_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y);
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2
             + x
             + 20
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcSilverCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.silver_coin,
         Display.getWidth() / 2
             + x
             + 21
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcGoldCoinCost(cost))
                     + String.valueOf(Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) > 0
       && Mideas.calcSilverCoinCost(cost) <= 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           > 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcGoldCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.gold_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y);
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2
             + x
             + 20
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y,
         String.valueOf(
             cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.copper_coin,
         Display.getWidth() / 2
             + x
             + 21
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcGoldCoinCost(cost))
                     + String.valueOf(
                         cost
                             - Mideas.calcGoldCoinCost(cost) * 10000
                             - Mideas.calcSilverCoinCost(cost) * 100)),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) <= 0
       && Mideas.calcSilverCoinCost(cost) > 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           > 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcSilverCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.silver_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y);
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2
             + x
             + 20
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y,
         String.valueOf(
             cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.copper_coin,
         Display.getWidth() / 2
             + x
             + 21
             + TTF2.coin.getWidth(
                 String.valueOf(Mideas.calcSilverCoinCost(cost))
                     + String.valueOf(
                         cost
                             - Mideas.calcGoldCoinCost(cost) * 10000
                             - Mideas.calcSilverCoinCost(cost) * 100)),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) > 0
       && Mideas.calcSilverCoinCost(cost) <= 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           <= 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcGoldCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.gold_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcGoldCoinCost(cost))),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) <= 0
       && Mideas.calcSilverCoinCost(cost) > 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           <= 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(Mideas.calcSilverCoinCost(cost)),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.silver_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(String.valueOf(Mideas.calcSilverCoinCost(cost))),
         Display.getHeight() / 2 + y);
     return true;
   }
   if (Mideas.calcGoldCoinCost(cost) <= 0
       && Mideas.calcSilverCoinCost(cost) <= 0
       && cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100
           > 0) {
     TTF2.coin.drawStringShadow(
         Display.getWidth() / 2 + x,
         Display.getHeight() / 2 + y,
         String.valueOf(
             cost - Mideas.calcGoldCoinCost(cost) * 10000 - Mideas.calcSilverCoinCost(cost) * 100),
         Color.white,
         Color.black,
         1,
         1,
         1);
     Draw.drawQuad(
         Sprites.copper_coin,
         Display.getWidth() / 2
             + x
             + 1
             + TTF2.coin.getWidth(
                 String.valueOf(
                     cost
                         - Mideas.calcGoldCoinCost(cost) * 10000
                         - Mideas.calcSilverCoinCost(cost) * 100)),
         Display.getHeight() / 2 + y);
     return true;
   }
   return true;
 }
Exemple #16
0
 @Override
 public boolean activateCondition() {
   return Mideas.joueur1().getGuild() != null;
 }
Exemple #17
0
 public static boolean mouseEvent() throws FileNotFoundException, SQLException {
   Arrays.fill(slot_hover, false);
   right_arrow = false;
   left_arrow = false;
   hover_button = false;
   int xLeft = -279;
   int xRight = -114;
   int y = -275;
   if (Mideas.mouseX() >= Display.getWidth() / 2 + xRight + 126
       && Mideas.mouseX() <= Display.getWidth() / 2 + xRight + 151
       && Mideas.mouseY() >= Display.getHeight() / 2 + y + 266
       && Mideas.mouseY() <= Display.getHeight() / 2 + y + 292) {
     right_arrow = true;
   } else if (Mideas.mouseX() >= Display.getWidth() / 2 + xRight - 161
       && Mideas.mouseX() <= Display.getWidth() / 2 + xRight - 136
       && Mideas.mouseY() >= Display.getHeight() / 2 + y + 266
       && Mideas.mouseY() <= Display.getHeight() / 2 + y + 292) {
     left_arrow = true;
   }
   if (Mideas.mouseX() >= Display.getWidth() / 2 + 27
       && Mideas.mouseX() <= Display.getWidth() / 2 + 46
       && Mideas.mouseY() >= Display.getHeight() / 2 - 337
       && Mideas.mouseY() <= Display.getHeight() / 2 - 319) {
     hover_button = true;
   }
   if (Mouse.getEventButtonState()) {
     if (Mideas.mouseX() >= Display.getWidth() / 2 + 27
         && Mideas.mouseX() <= Display.getWidth() / 2 + 46
         && Mideas.mouseY() >= Display.getHeight() / 2 - 337
         && Mideas.mouseY() <= Display.getHeight() / 2 - 319) {
       Interface.closeShopFrame();
       return true;
     } else if (page == 0 && right_arrow) {
       page++;
       Interface.setIsShopLoaded(false);
     } else if (page == 1 && right_arrow) {
       page++;
       Interface.setIsShopLoaded(false);
     } else if (page == 1 && left_arrow) {
       page--;
       Interface.setIsShopLoaded(false);
     } else if (page == 2 && left_arrow) {
       page--;
       Interface.setIsShopLoaded(false);
     }
   }
   isSlotHover(xLeft, y, 0, 41, 0);
   isSlotHover(xLeft, y, 52, 93, 1);
   isSlotHover(xLeft, y, 104, 145, 2);
   isSlotHover(xLeft, y, 156, 197, 3);
   isSlotHover(xLeft, y, 208, 249, 4);
   isSlotHover(xRight, y, 0, 41, 5);
   isSlotHover(xRight, y, 52, 93, 6);
   isSlotHover(xRight, y, 104, 145, 7);
   isSlotHover(xRight, y, 156, 197, 8);
   isSlotHover(xRight, y, 208, 249, 9);
   int i = 0;
   while (i < 10 && i + 10 * page < shopList.size()) {
     buyItems(slot_hover[i], shopList.get(i + 10 * page));
     i++;
   }
   return false;
 }