Rename and clean up MapleCoconuts
This commit is contained in:
@@ -26,7 +26,7 @@ import client.Client;
|
|||||||
import net.AbstractPacketHandler;
|
import net.AbstractPacketHandler;
|
||||||
import net.packet.InPacket;
|
import net.packet.InPacket;
|
||||||
import server.events.gm.Coconut;
|
import server.events.gm.Coconut;
|
||||||
import server.events.gm.MapleCoconuts;
|
import server.events.gm.Coconuts;
|
||||||
import server.maps.MapleMap;
|
import server.maps.MapleMap;
|
||||||
import tools.PacketCreator;
|
import tools.PacketCreator;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public final class CoconutHandler extends AbstractPacketHandler {
|
|||||||
int id = p.readShort();
|
int id = p.readShort();
|
||||||
MapleMap map = c.getPlayer().getMap();
|
MapleMap map = c.getPlayer().getMap();
|
||||||
Coconut event = map.getCoconut();
|
Coconut event = map.getCoconut();
|
||||||
MapleCoconuts nut = event.getCoconut(id);
|
Coconuts nut = event.getCoconut(id);
|
||||||
if (!nut.isHittable()){
|
if (!nut.isHittable()){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class Coconut extends MapleEvent {
|
|||||||
private int countBombing = 80;
|
private int countBombing = 80;
|
||||||
private int countFalling = 401;
|
private int countFalling = 401;
|
||||||
private int countStopped = 20;
|
private int countStopped = 20;
|
||||||
private final List<MapleCoconuts> coconuts = new LinkedList<>();
|
private final List<Coconuts> coconuts = new LinkedList<>();
|
||||||
|
|
||||||
public Coconut(MapleMap map) {
|
public Coconut(MapleMap map) {
|
||||||
super(1, 50);
|
super(1, 50);
|
||||||
@@ -52,7 +52,7 @@ public class Coconut extends MapleEvent {
|
|||||||
public void startEvent() {
|
public void startEvent() {
|
||||||
map.startEvent();
|
map.startEvent();
|
||||||
for (int i = 0; i < 506; i++) {
|
for (int i = 0; i < 506; i++) {
|
||||||
coconuts.add(new MapleCoconuts(i));
|
coconuts.add(new Coconuts(i));
|
||||||
}
|
}
|
||||||
map.broadcastMessage(PacketCreator.hitCoconut(true, 0, 0));
|
map.broadcastMessage(PacketCreator.hitCoconut(true, 0, 0));
|
||||||
setCoconutsHittable(true);
|
setCoconutsHittable(true);
|
||||||
@@ -181,16 +181,16 @@ public class Coconut extends MapleEvent {
|
|||||||
countStopped--;
|
countStopped--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MapleCoconuts getCoconut(int id) {
|
public Coconuts getCoconut(int id) {
|
||||||
return coconuts.get(id);
|
return coconuts.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MapleCoconuts> getAllCoconuts() {
|
public List<Coconuts> getAllCoconuts() {
|
||||||
return coconuts;
|
return coconuts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCoconutsHittable(boolean hittable) {
|
public void setCoconutsHittable(boolean hittable) {
|
||||||
for (MapleCoconuts nut : coconuts) {
|
for (Coconuts nut : coconuts) {
|
||||||
nut.setHittable(hittable);
|
nut.setHittable(hittable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,17 +22,15 @@
|
|||||||
package server.events.gm;
|
package server.events.gm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author kevintjuh93
|
* @author kevintjuh93
|
||||||
*/
|
*/
|
||||||
public class MapleCoconuts {
|
public class Coconuts {
|
||||||
|
private final int id;
|
||||||
private int id;
|
|
||||||
private int hits = 0;
|
private int hits = 0;
|
||||||
private boolean hittable = false;
|
private boolean hittable = false;
|
||||||
private long hittime = System.currentTimeMillis();
|
private long hittime = System.currentTimeMillis();
|
||||||
|
|
||||||
public MapleCoconuts(int id) {
|
public Coconuts(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user