Exemplo n.º 1
0
  @Override
  public void end(GameActionData<Player> data, boolean success, String[] args) {
    Loggin.debug(
        "IOAction sur la map (cell = %s, action = %s)", data.getArgument(0), data.getArgument(1));
    short cellID = Short.parseShort(data.getArgument(0));
    int action = Integer.parseInt(data.getArgument(1));

    if (!MapUtils.isAdjacentCells(data.getPerformer().getCell().getID(), cellID)) {
      Loggin.debug("Personnage trop loin pour effectuer l'action !");
    }

    MapCell cell = data.getPerformer().getMap().getCellById(cellID);

    if (cell == null) {
      return;
    }

    InteractiveObject IO = cell.getObj();

    if (IO == null) {
      return;
    }

    IO.startAction(data.getPerformer(), action);
  }
Exemplo n.º 2
0
 @Override
 public void start(GameActionData<Player> data) {
   if (data.getPerformer().getActionsManager().isWalking()) {
     data.getPerformer().getActionsManager().addPendingAction(data);
   } else {
     end(data, true, null);
   }
 }