78 lines
1.7 KiB
Java
78 lines
1.7 KiB
Java
package me.unurled.raxen.components.dungeons;
|
|
|
|
import static me.unurled.raxen.utils.DungeonUtils.getRadiusFromRank;
|
|
|
|
import java.util.HashMap;
|
|
import lombok.Getter;
|
|
import me.unurled.raxen.Raxen;
|
|
import me.unurled.raxen.components.dungeons.types.MonsterType;
|
|
import me.unurled.raxen.components.entity.other.RaxenEntity;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.Location;
|
|
|
|
public class Dungeon {
|
|
|
|
@Getter
|
|
private String name;
|
|
|
|
@Getter
|
|
private Rank rank;
|
|
|
|
@Getter
|
|
private Gate gate;
|
|
|
|
//String, RaxenEntity
|
|
@Getter
|
|
private HashMap<String, RaxenEntity> monster = new HashMap<>();
|
|
|
|
/**
|
|
* The Type of the Dungeon
|
|
*/
|
|
@Getter
|
|
private Types types;
|
|
|
|
/**
|
|
* Monster Types
|
|
*/
|
|
@Getter
|
|
private MonsterType monsterType;
|
|
|
|
@Getter
|
|
private Location location;
|
|
|
|
@Getter
|
|
private Integer radius;
|
|
|
|
public Dungeon(String name, Rank rank, Types types, MonsterType mType) {
|
|
this.name = name;
|
|
this.rank = rank;
|
|
this.types = types;
|
|
this.monsterType = mType;
|
|
generateGate();
|
|
}
|
|
|
|
/**
|
|
* 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
|
|
Location loc = new Location(
|
|
Bukkit.getWorld("Liberty_City"),
|
|
-284.0,
|
|
45.00,
|
|
187.50
|
|
);
|
|
Integer radius = getRadiusFromRank(this.rank);
|
|
this.gate = new Gate(name, loc, radius);
|
|
}
|
|
|
|
/**
|
|
* //TODO: Terrain Generation of the inside of the Dungeons
|
|
*/
|
|
public void generate() {
|
|
Raxen main = (Raxen) Bukkit.getPluginManager().getPlugin("Raxen");
|
|
main.getManager().getWorldManager().loadWorld(name);
|
|
monsterType.genMonster(Bukkit.getWorld(name), rank);
|
|
}
|
|
}
|