public void drop(int x, int y) { if (rescuedUnit == null) return; rescuedUnit.rescued = false; rescuedUnit.setMoved(true); final OverworldStage grid = (OverworldStage) stage; grid.addUnit(rescuedUnit, x, y); rescuedUnit.rX = this.x - x * 16; rescuedUnit.rY = this.y - y * 16; rescuedUnit = null; }
@Override public ArrayList<AttackRecord> applyServer(OverworldStage stage, Unit unit) { // TODO: validate Unit rescuee = stage.getUnit(rescueeId); unit.rescue(rescuee); return null; }
public void setHp(int hp) { this.hp = Math.max(hp, 0); if (hp == 0) { ((OverworldStage) stage).removeUnit(xcoord, ycoord); if (rescuedUnit != null) { drop(xcoord, ycoord); } if (Game.glContextExists()) { ((ClientOverworldStage) stage).setControl(false); stage.addEntity(new Corpse(this)); } } }