47 if (cannon.getAmmunition() <= 0) {
48 player.send(
new SendMessage(
"Your cannon has run out of ammunition!"));
49 cannon.setFiring(
false);
54 switch (cannon.getRotation()) {
56 cannon.setRotation(Rotation.NORTH_EAST);
59 cannon.setRotation(Rotation.EAST);
62 cannon.setRotation(Rotation.SOUTH_EAST);
65 cannon.setRotation(Rotation.SOUTH);
68 cannon.setRotation(Rotation.SOUTH_WEST);
71 cannon.setRotation(Rotation.WEST);
74 cannon.setRotation(Rotation.NORTH_WEST);
77 cannon.setRotation(Rotation.NORTH);
88 int lockon = i.getIndex() + 1;
89 byte offsetX = (byte) ((i.getPosition().getY() - i.getPosition().getY()) * -1);
90 byte offsetY = (byte) ((i.getPosition().getX() - i.getPosition().getX()) * -1);
96 cannon.setAmmunition(cannon.getAmmunition() - 1);