use of com.solinia.solinia.Models.CharacterCreation in project solinia3-core by mixxit.
the class ConfigurationManager method getCharacterCreationChoices.
@Override
public CharacterCreation getCharacterCreationChoices() {
CharacterCreation characterCreation = new CharacterCreation();
List<ISoliniaClass> classes = getClasses();
for (ISoliniaRace race : this.getRaces()) {
if (race.isAdmin())
continue;
for (ISoliniaClass solclass : classes) {
if (!solclass.getValidRaceClasses().containsKey(race.getId()))
continue;
RaceChoice raceChoice = new RaceChoice(race.getId(), solclass.getId(), race.getName(), solclass.getName(), race.getShortName(), solclass.getShortName(), race.getDescription(), solclass.getDescription(), race.getStrength(), race.getStamina(), race.getAgility(), race.getDexterity(), race.getIntelligence(), race.getWisdom(), race.getCharisma(), race.getAlignment());
characterCreation.raceChoices.put(raceChoice.RaceName + "_" + raceChoice.ClassName, raceChoice);
}
}
return characterCreation;
}
use of com.solinia.solinia.Models.CharacterCreation in project solinia3-core by mixxit.
the class PlayerUtils method sendCharCreationNoMod.
private static void sendCharCreationNoMod(Player sender) {
ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
BookMeta bookMeta = (BookMeta) book.getItemMeta();
bookMeta.setTitle("Creation");
bookMeta.setAuthor("Server");
try {
CharacterCreation choices = StateManager.getInstance().getConfigurationManager().getCharacterCreationChoices();
String pageText = "";
BaseComponent[] introPage = new ComponentBuilder(ChatColor.RED + "Race/Class Selection\n" + ChatColor.RESET + "---------------\n" + "\n" + "Please cycle through\n" + "our choice of races\n" + "and classes\n" + "\n" + "When you are ready \n" + "click " + ChatColor.BLUE + "SELECT" + ChatColor.RESET + " on the page\n").create();
bookMeta.spigot().addPage(introPage);
for (String choiceKey : choices.raceChoices.keySet()) {
RaceChoice choice = choices.raceChoices.get(choiceKey);
int passiveId = StateManager.getInstance().getConfigurationManager().getRace(choice.RaceId).getPassiveAbilityId();
ISoliniaSpell passiveSpell = StateManager.getInstance().getConfigurationManager().getSpell(passiveId);
String header = ChatColor.RED + "" + choice.RaceName + " " + choice.ClassName + ChatColor.RESET + "\n";
String hover = "[" + ChatColor.RED + "Hover for More Info" + ChatColor.RESET + "]\n";
String text = "";
text += "\n";
text += "STR " + ChatColor.BLUE + choice.STR + ChatColor.RESET + " STA " + ChatColor.BLUE + choice.STA + ChatColor.RESET + " AGI " + ChatColor.BLUE + choice.AGI + ChatColor.RESET + "\n";
text += "DEX " + ChatColor.BLUE + choice.DEX + ChatColor.RESET + " INT " + ChatColor.BLUE + choice.INT + ChatColor.RESET + " WIS " + ChatColor.BLUE + choice.WIS + ChatColor.RESET + "\n";
text += "CHA " + ChatColor.BLUE + choice.CHA + ChatColor.RESET + "\n";
text += "\n";
text += "Racial Benefit: " + ChatColor.RED + passiveSpell.getName() + ChatColor.RESET + "\n";
text += "\n";
String details = ChatColor.GOLD + choice.RaceName + ChatColor.RESET + System.lineSeparator() + "Recommended Alignment: " + ChatColor.GOLD + choice.Alignment + ChatColor.RESET + System.lineSeparator() + choice.RaceDescription + System.lineSeparator() + ChatColor.GOLD + choice.ClassName + ChatColor.RESET + System.lineSeparator() + choice.ClassDescription;
String click = "\n[" + ChatColor.BLUE + "SELECT" + ChatColor.RESET + "]\n";
BaseComponent[] racePage = new ComponentBuilder(header).append(new ComponentBuilder(hover).event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(details).create())).create()).append(new ComponentBuilder(text).create()).append(new ComponentBuilder(click).event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/createcharactershort " + choice.RaceId + " " + choice.ClassId)).create()).create();
//
// )
bookMeta.spigot().addPage(racePage);
}
/* .event(new ClickEvent(ClickEvent.Action.OPEN_URL, "http://spigotmc.org"))
.event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Go to the spigot website!").create()))
.create();*/
book.setItemMeta(bookMeta);
sender.openBook(book);
} catch (CoreStateInitException e) {
}
}
Aggregations