0.5.0
Start of dungeon work, custom item/mobs/gates not needed, gate and dungeons wil be made automatically.
This commit is contained in:
parent
ce3c1d547c
commit
10c66d6fa4
13 changed files with 231 additions and 70 deletions
|
@ -0,0 +1,46 @@
|
|||
package gq.unurled.raxen.components.dungeons;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import static gq.unurled.raxen.utils.DungeonUtils.getRadiusFromRank;
|
||||
|
||||
public class Dungeon {
|
||||
|
||||
private UUID uuid;
|
||||
|
||||
private Rank rank;
|
||||
|
||||
private Gate gate;
|
||||
|
||||
/**
|
||||
* The Type of the Dungeon
|
||||
*/
|
||||
private Type type;
|
||||
|
||||
private Location location;
|
||||
private Integer radius;
|
||||
|
||||
public Dungeon(UUID uuid, Rank rank, Type type) {
|
||||
this.uuid = uuid;
|
||||
this.rank = rank;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the Gate and make it available to players in the world.
|
||||
* TODO: Place the gate at a random place.
|
||||
*/
|
||||
public void generateGate() {
|
||||
// -281.50 36.00 187.50 0.90 10.80
|
||||
Location loc = new Location(Bukkit.getWorld("Liberty_City"), -284.0, 36.00, 187.50);
|
||||
Integer radius = getRadiusFromRank(this.rank);
|
||||
this.gate = new Gate(uuid, loc, radius);
|
||||
}
|
||||
|
||||
public void generate() {
|
||||
|
||||
}
|
||||
}
|
38
src/main/java/gq/unurled/raxen/components/dungeons/Gate.java
Normal file
38
src/main/java/gq/unurled/raxen/components/dungeons/Gate.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package gq.unurled.raxen.components.dungeons;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class Gate {
|
||||
|
||||
private UUID uuid;
|
||||
|
||||
|
||||
private Location loc;
|
||||
private Integer portalRadius;
|
||||
|
||||
|
||||
public Gate(UUID uuid, Location loc, Integer portalRadius) {
|
||||
this.loc = loc;
|
||||
this.portalRadius = portalRadius;
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public void teleport() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Location getLoc() {
|
||||
return loc;
|
||||
}
|
||||
|
||||
public Integer getPortalRadius() {
|
||||
return portalRadius;
|
||||
}
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
}
|
16
src/main/java/gq/unurled/raxen/components/dungeons/Rank.java
Normal file
16
src/main/java/gq/unurled/raxen/components/dungeons/Rank.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package gq.unurled.raxen.components.dungeons;
|
||||
|
||||
public enum Rank {
|
||||
F,
|
||||
E,
|
||||
D,
|
||||
C,
|
||||
B,
|
||||
A,
|
||||
S,
|
||||
SS,
|
||||
SSS,
|
||||
WORLD,
|
||||
UNBEATABLE,
|
||||
NOT_DEFINED
|
||||
}
|
20
src/main/java/gq/unurled/raxen/components/dungeons/Type.java
Normal file
20
src/main/java/gq/unurled/raxen/components/dungeons/Type.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package gq.unurled.raxen.components.dungeons;
|
||||
|
||||
public enum Type {
|
||||
JUNGLE,
|
||||
TROPICAL_JUNGLE,
|
||||
PLAINS,
|
||||
GRAVES,
|
||||
CASTLE,
|
||||
ABANDONED_CASTLE,
|
||||
FIELD,
|
||||
ICE_FOREST,
|
||||
FOREST,
|
||||
VOLCANO,
|
||||
MOUNTAINS,
|
||||
HIGH_MOUNTAINS,
|
||||
CAVES,
|
||||
LABYRINTH,
|
||||
UNDERGROUND_LABYRINTH,
|
||||
FOREST_LABYRINTH
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package gq.unurled.raxen.manager.server;
|
||||
|
||||
import gq.unurled.raxen.components.dungeons.Gate;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DungeonsManager {
|
||||
|
||||
private HashMap<UUID, Gate> gates = new HashMap<>();
|
||||
}
|
37
src/main/java/gq/unurled/raxen/utils/DungeonUtils.java
Normal file
37
src/main/java/gq/unurled/raxen/utils/DungeonUtils.java
Normal file
|
@ -0,0 +1,37 @@
|
|||
package gq.unurled.raxen.utils;
|
||||
|
||||
import gq.unurled.raxen.components.dungeons.Rank;
|
||||
|
||||
public class DungeonUtils {
|
||||
|
||||
public static Integer getRadiusFromRank(Rank rank) {
|
||||
Integer radius = 1;
|
||||
switch (rank) {
|
||||
case F:
|
||||
radius = 4;
|
||||
case E:
|
||||
radius = 5;
|
||||
case D:
|
||||
radius = 8;
|
||||
case C:
|
||||
radius = 10;
|
||||
case B:
|
||||
radius = 15;
|
||||
case A:
|
||||
radius = 20;
|
||||
case S:
|
||||
radius = 30;
|
||||
case SS:
|
||||
radius = 40;
|
||||
case SSS:
|
||||
radius = 50;
|
||||
case WORLD:
|
||||
radius = 100;
|
||||
case UNBEATABLE:
|
||||
radius = 200;
|
||||
case NOT_DEFINED:
|
||||
radius = 1000;
|
||||
}
|
||||
return radius;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue