Ejemplo n.º 1
0
 public void addMessage(String s, boolean send) {
   if (send) {
     game.addPlayerCommandChat(new PlayerCommandChat(game.getControllerPlayer(), s));
   } else {
     game.getGameApplication().getGUI().chatMessage(s);
   }
 }
Ejemplo n.º 2
0
  public void onMouseButtonEvent(MouseButtonEvent event) {
    if (event.isReleased()) {
      return;
    }
    if (mouseStatus == null) {
      return;
    }
    PlayerControler p = game.getPlayerControler();

    if (event.getButtonIndex() == 0) // links
    {
      if (mouseStatus.getModel() == null) {
        p.mouseClick(0, mouseStatus.getX(), mouseStatus.getY());
      } else {
        p.mouseClick(0, (Unit) mouseStatus.getModel().getParent());
      }
    } else if (event.getButtonIndex() == 1) // rechts
    {
      if (mouseStatus.getModel() == null) {
        p.mouseClick(1, mouseStatus.getX(), mouseStatus.getY());
      } else {
        p.mouseClick(1, (Unit) mouseStatus.getModel().getParent());
      }
    } else { // mitte

    }
  }
Ejemplo n.º 3
0
 public PlayerInput(Game game) {
   this.game = game;
   this.gameApp = game.getGameApplication();
   inputManager = gameApp.getInputManager();
   inputManager.addRawInputListener(this);
   mouseStatus = new MouseStatus(null, 0, 0);
 }
Ejemplo n.º 4
0
  public void beginInput() {
    mouseStatus = gameApp.getMouseCollision();
    PlayerControler p = game.getPlayerControler();

    if (mouseStatus != null) {
      if (mouseStatus.getModel() != null) {
        p.mouseHover((Unit) mouseStatus.getModel().getParent());
      } else {
        p.mouseHover(null);
      }
    } else {
      p.mouseHover(null);
    }
  }
Ejemplo n.º 5
0
  public Buff(Game game, String bt, Unit u) {
    this.buffType = BuffType.getBuffType(bt);

    this.owner = u;
    this.gameApp = game.getGameApplication();

    model = gameApp.getAssetManager().loadModel(buffType.getModel());

    for (int i = 0; i < buffType.getAttachmentPoints().length; i++) {
      u.getModel().addModel(model, buffType.getAttachmentPoints()[i]);
    }

    u.addBuff(this);
  }