code:
package com.lilithsthrone.game.dialogue.places.submission;

import java.util.List;

import com.lilithsthrone.game.character.GameCharacter;
import com.lilithsthrone.game.character.gender.Gender;
import com.lilithsthrone.game.character.npc.NPC;
import com.lilithsthrone.game.character.npc.misc.Elemental;
import com.lilithsthrone.game.character.npc.submission.Claire;
import com.lilithsthrone.game.character.npc.submission.DarkSiren;
import com.lilithsthrone.game.character.npc.submission.Elizabeth;
import com.lilithsthrone.game.character.npc.submission.FortressAlphaLeader;
import com.lilithsthrone.game.character.npc.submission.FortressFemalesLeader;
import com.lilithsthrone.game.character.npc.submission.FortressMalesLeader;
import com.lilithsthrone.game.character.npc.submission.GamblingDenPatron;
import com.lilithsthrone.game.character.quests.Quest;
import com.lilithsthrone.game.character.quests.QuestLine;
import com.lilithsthrone.game.dialogue.DialogueFlagValue;
import com.lilithsthrone.game.dialogue.DialogueNode;
import com.lilithsthrone.game.dialogue.places.dominion.EnforcerWarehouse;
import com.lilithsthrone.game.dialogue.places.submission.dicePoker.DicePokerTable;
import com.lilithsthrone.game.dialogue.places.submission.gamblingDen.GamblingDenDialogue;
import com.lilithsthrone.game.dialogue.places.submission.impFortress.ImpCitadelDialogue;
import com.lilithsthrone.game.dialogue.places.submission.impFortress.ImpFortressDialogue;
import com.lilithsthrone.game.dialogue.responses.Response;
import com.lilithsthrone.game.dialogue.responses.ResponseEffectsOnly;
import com.lilithsthrone.game.dialogue.responses.ResponseSex;
import com.lilithsthrone.game.dialogue.story.LyssiethReveal;
import com.lilithsthrone.game.dialogue.utils.UtilText;
import com.lilithsthrone.game.inventory.clothing.AbstractClothingType;
import com.lilithsthrone.game.inventory.clothing.ClothingType;
import com.lilithsthrone.game.inventory.item.AbstractItemType;
import com.lilithsthrone.game.inventory.item.ItemType;
import com.lilithsthrone.game.sex.managers.SexManagerDefault;
import com.lilithsthrone.game.sex.positions.SexPosition;
import com.lilithsthrone.game.sex.positions.slots.SexSlotStanding;
import com.lilithsthrone.main.Main;
import com.lilithsthrone.utils.Colour;
import com.lilithsthrone.utils.Util;
import com.lilithsthrone.utils.Util.Value;
import com.lilithsthrone.utils.Vector2i;
import com.lilithsthrone.world.WorldType;
import com.lilithsthrone.world.places.PlaceType;

/**
 * @since 0.1.0
 * @version 0.3.5
 * @author Innoxia
 */
public class SubmissionGenericPlaces {

	public static final DialogueNode WALKWAYS = new DialogueNode("Walkways", "", false) {

		@Override
		public String getAuthor() {
			return "Duner & Innoxia";
		}

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "WALKWAYS")
					+ (Math.random()<0.2f
							?UtilText.parseFromXMLFile("places/submission/submissionPlaces", "WALKWAYS_EXTRA")
							:"");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return null;
		}
	};

	public static final DialogueNode TUNNEL = new DialogueNode("Tunnels", "", false) {

		@Override
		public String getAuthor() {
			return "Duner";
		}

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "TUNNEL"));

			boolean pacified = true;
			if(Main.game.getPlayer().getLocationPlace().getPlaceType().equals(PlaceType.SUBMISSION_IMP_TUNNELS_ALPHA)) {
				pacified = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaDefeated);
			}
			if(Main.game.getPlayer().getLocationPlace().getPlaceType().equals(PlaceType.SUBMISSION_IMP_TUNNELS_DEMON)) {
				pacified = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressDemonDefeated);
			}
			if(Main.game.getPlayer().getLocationPlace().getPlaceType().equals(PlaceType.SUBMISSION_IMP_TUNNELS_FEMALES)) {
				pacified = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesDefeated);
			}
			if(Main.game.getPlayer().getLocationPlace().getPlaceType().equals(PlaceType.SUBMISSION_IMP_TUNNELS_MALES)) {
				pacified = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesDefeated);
			}

			if(!pacified) {
				UtilText.nodeContentSB.append(
						"<span color:"+Main.game.getPlayer().getLocationPlace().getPlaceType().getColourString()+";>"
						+ UtilText.parseFromXMLFile("places/submission/submissionPlaces", "TUNNEL_IMP_CONTROL")
						+"</span>");
			}

			for(GameCharacter npc : Main.game.getCharactersTreatingCellAsHome(Main.game.getPlayerCell())) {
				UtilText.nodeContentSB.append(((NPC) npc).getPresentInTileDescription(!pacified));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index == 1) {
				return new ResponseEffectsOnly(
						"Explore",
						"Explore the tunnels. Although you don't think you're any more or less likely to find anything by doing this, at least you won't have to keep travelling back and forth..."){
							@Override
							public void effects() {
								DialogueNode dn = Main.game.getActiveWorld().getCell(Main.game.getPlayer().getLocation()).getPlace().getDialogue(true, true);
								Main.game.setContent(new Response("", "", dn));
							}
						};
			} else {
				return null;
			}
		}
	};

	public static final DialogueNode BAT_CAVERNS = new DialogueNode("Bat Caverns", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "BAT_CAVERNS");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new ResponseEffectsOnly("Bat Caverns", "Enter the bat caverns.") {
					@Override
					public void effects() {
						Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "BAT_CAVERNS_ENTRY"));
						Main.mainController.moveGameWorld(WorldType.BAT_CAVERNS, PlaceType.BAT_CAVERN_ENTRANCE, true);
					}
				};

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode RAT_WARREN = new DialogueNode("Rat Warrens", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "RAT_WARREN");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new Response("Knock",
						"Knock on the door and wait to see if anyone answers. [style.italicsGood(Will be added in the next version!)]",
						null);
//						RAT_WARREN_KNOCK_ON_DOOR);

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode RAT_WARREN_KNOCK_ON_DOOR = new DialogueNode("Rat Warrens", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "RAT_WARREN_KNOCK_ON_DOOR");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new Response("Step back",
						Main.game.getPlayer().hasQuest(QuestLine.SIDE_VENGAR)
							?"Decide against entering the Rat Warrens, and instead step away from the door."
							:"As you don't know the password, you're not going to be able to get in...",
						RAT_WARREN_STEP_BACK) {
					@Override
					public void effects() {
						if(Main.game.getPlayer().hasQuest(QuestLine.SIDE_VENGAR)) {
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "RAT_WARREN_ENTRY_STEP_BACK"));
						} else {
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "RAT_WARREN_STEP_BACK"));
						}
					}
				};

			} else if(index==2 && Main.game.getPlayer().hasQuest(QuestLine.SIDE_VENGAR)) {
				return new Response("Enter",
						"Push open the door and enter the Rat Warrens.",
						RatWarrensDialogue.RAT_WARREN_INITIAL_ENTRY) {
					@Override
					public void effects() {
						RatWarrensDialogue.init();
						Main.game.getPlayer().setLocation(WorldType.RAT_WARRENS, PlaceType.RAT_WARRENS_ENTRANCE);
					}
				};
			}
			return null;
		}
	};

	public static final DialogueNode RAT_WARREN_STEP_BACK = new DialogueNode("Rat Warrens", "", false) {
		@Override
		public int getSecondsPassed() {
			return 1*60;
		}
		@Override
		public String getContent() {
			return "";
		}
		@Override
		public Response getResponse(int responseTab, int index) {
			return RAT_WARREN.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode GAMBLING_DEN = new DialogueNode("Gambling Den", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "GAMBLING_DEN");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new Response("Gambling Den", "Enter the Gambling Den.", GamblingDenDialogue.ENTRANCE) {
					@Override
					public void effects() {
						List<NPC> gamblersPresent = Main.game.getCharactersPresent(Main.game.getWorlds().get(WorldType.GAMBLING_DEN).getCell(PlaceType.GAMBLING_DEN_GAMBLING));

						for(NPC npc : gamblersPresent) {
							if(npc instanceof GamblingDenPatron) {
								Main.game.removeNPC(npc);
							}
						}

						try {
							Main.game.addNPC(new GamblingDenPatron(Gender.getGenderFromUserPreferences(false, false), DicePokerTable.COPPER, false), false);
							Main.game.addNPC(new GamblingDenPatron(Gender.getGenderFromUserPreferences(false, false), DicePokerTable.COPPER, false), false);
							Main.game.addNPC(new GamblingDenPatron(Gender.getGenderFromUserPreferences(false, false), DicePokerTable.SILVER, false), false);
							Main.game.addNPC(new GamblingDenPatron(Gender.getGenderFromUserPreferences(false, false), DicePokerTable.SILVER, false), false);
							Main.game.addNPC(new GamblingDenPatron(Gender.getGenderFromUserPreferences(false, false), DicePokerTable.GOLD, false), false);
						} catch (Exception e) {
							e.printStackTrace();
						}

						Main.game.getPlayer().setLocation(WorldType.GAMBLING_DEN, PlaceType.GAMBLING_DEN_ENTRANCE);
					}
				};

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode LILIN_PALACE_CAVERN = new DialogueNode("Cavern", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);
			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_CAVERN"));

			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethIntroduced)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_CAVERN_MET_ELIZABETH"));
			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_CAVERN_NOT_MET_ELIZABETH"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return null;
		}
	};

	public static final DialogueNode LILIN_PALACE_GATE = new DialogueNode("Lyssieth's Palace Gate", "", true) {

		@Override
		public boolean isTravelDisabled() {
			return !Main.game.getPlayer().isQuestProgressGreaterThan(QuestLine.MAIN, Quest.MAIN_2_C_SIRENS_FALL);
		}

		@Override
		public int getSecondsPassed() {
			return 60;
		}

		@Override
		public String getContent() {
			Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutUniforms, false);
			Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutSurname, false);

			UtilText.nodeContentSB.setLength(0);

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE"));

			if(Main.game.getPlayer().isQuestProgressGreaterThan(QuestLine.MAIN, Quest.MAIN_2_C_SIRENS_FALL)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_ENTRY_GRANTED"));

			} else if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_C_SIRENS_FALL) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_ENTRY_BLOCKED_QUEST_COMPLETED"));

			} else if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_B_SIRENS_CALL) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_ENTRY_BLOCKED_QUEST_GAINED"));

			} else if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethIntroduced)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_ENTRY_BLOCKED_INTRODUCED"));

			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_ENTRY_BLOCKED"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {

			// First time visiting this tile:
			if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethIntroduced)) {
				if(index==1) {
					return new Response("Introductions", "Tell the succubus and her troops who you are.", LILIN_PALACE_GATE_GENERIC_TALK) {
						@Override
						public void effects() {
							Main.game.getNpc(Elizabeth.class).setPlayerKnowsName(true);
							Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethIntroduced, true);
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_INTRODUCTION"));
						}
					};
				}
				return null;
			}

			// Completed the Siren's quest:
			if(Main.game.getPlayer().isQuestProgressGreaterThan(QuestLine.MAIN, Quest.MAIN_2_C_SIRENS_FALL)) {
				if (index == 1) {
					if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethAskedAboutUniforms)) {
						return new Response("Uniforms", "You've just asked ELizabeth about her uniforms...", null);
					}
					return new Response("Uniforms", "Ask Elizabeth why she and her troops are wearing historical uniforms.", LILIN_PALACE_GATE_GENERIC_TALK) {
						@Override
						public void effects() {
							Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutUniforms, true);
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_UNIFORMS"));
						}
					};

				} else if (index == 2) {
					if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethAskedAboutSurname)) {
						return new Response("Surname", "You've just asked ELizabeth about her surname...", null);
					}
					return new Response("Surname", "Ask Elizabeth why she didn't want to be addressed by her surname.", LILIN_PALACE_GATE_GENERIC_TALK) {
						@Override
						public void effects() {
							Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutSurname, true);
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_SURNAME"));
						}
					};
				}
				return null;
			}

			// Handing in the Siren's quest:
			if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_C_SIRENS_FALL) {
				if (index == 1) {
					return new Response("Report", "Tell Elizabeth how you handled the Siren.", LILIN_PALACE_GATE_GENERIC_TALK) {
						@Override
						public void effects() {
							if(Main.game.getPlayer().hasItemType(ItemType.LYSSIETHS_RING)) {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_COMPLETED_QUEST_WITH_COMBAT"));
								Main.game.getPlayer().removeItem(AbstractItemType.generateItem(ItemType.LYSSIETHS_RING));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().removedItemFromInventoryText(ItemType.LYSSIETHS_RING));
							} else {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_COMPLETED_QUEST_WITH_TRICKERY"));
							}
							if(!Main.game.getPlayer().hasClothingType(ClothingType.FINGER_LYSSIETHS_RING, true)) {
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addClothing(AbstractClothingType.generateClothing(ClothingType.FINGER_LYSSIETHS_RING), false));
							}
							Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().setQuestProgress(QuestLine.MAIN, Quest.MAIN_2_D_MEETING_A_LILIN));
						}
					};

				}
				return null;
			}

			// Normal dialogue, for before completing the Siren's quest:
			if (index == 1) {
				return new ResponseEffectsOnly("Step back", "Decide to step away from Elizabeth and the royal guard, and head back into Submission.") {
					@Override
					public void effects() {
						Main.game.getPlayer().setLocation(new Vector2i(Main.game.getPlayer().getLocation().getX(), Main.game.getPlayer().getLocation().getY()-1));
						Main.game.setContent(new Response("", "", LILIN_PALACE_CAVERN));
					}
				};

			} else if (index == 2) {
				if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethAskedAboutUniforms)) {
					return new Response("Uniforms", "You've just asked ELizabeth about her uniforms...", null);
				}
				return new Response("Uniforms", "Ask Elizabeth why she and her troops are wearing historical uniforms.", LILIN_PALACE_GATE_GENERIC_TALK) {
					@Override
					public void effects() {
						Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutUniforms, true);
						Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_UNIFORMS"));
					}
				};

			} else if (index == 3) {
				if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.elizabethAskedAboutSurname)) {
					return new Response("Surname", "You've just asked ELizabeth about her surname...", null);
				}
				return new Response("Surname", "Ask Elizabeth why she didn't want to be addressed by her surname.", LILIN_PALACE_GATE_GENERIC_TALK) {
					@Override
					public void effects() {
						Main.game.getDialogueFlags().setFlag(DialogueFlagValue.elizabethAskedAboutSurname, true);
						Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_SURNAME"));
					}
				};
			} else if (index == 4) {
				if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_A_INTO_THE_DEPTHS) {
					if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressDemonDefeated)) {
						return new Response("Audience", "Ask Elizabeth how you can earn an audience with Lyssieth.", LILIN_PALACE_GATE_GENERIC_TALK) {
							@Override
							public void effects() {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_AUDIENCE_SKIP"));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addClothing(AbstractClothingType.generateClothing(ClothingType.FINGER_LYSSIETHS_RING), false));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().setQuestProgress(QuestLine.MAIN, Quest.MAIN_2_D_MEETING_A_LILIN));
							}
						};

					} else {
						return new Response("Audience", "Ask Elizabeth how you can earn an audience with Lyssieth.", LILIN_PALACE_GATE_GENERIC_TALK) {
							@Override
							public void effects() {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_GATE_AUDIENCE"));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addItem(AbstractItemType.generateItem(ItemType.LYSSIETHS_RING), false));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().setQuestProgress(QuestLine.MAIN, Quest.MAIN_2_B_SIRENS_CALL));
							}
						};
					}

				} else if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_B_SIRENS_CALL) {
					return new Response("Audience", "You have already asked Elizabeth how to earn an audience with Lyssieth. You need to find, and then enslave, Lyssieth's daughter; the 'dark siren'.", null);

				} else {
					return new Response("Audience",
							"Elizabeth said that Lyssieth isn't receiving visitors, and, for the moment at least, you don't have a particular reason for needing to see her."
								+ " Perhaps you'll need to ask for an audience with Lyssieth at some point in the future...",
							null);
				}
			}

			return null;
		}
	};

	public static final DialogueNode LILIN_PALACE_GATE_GENERIC_TALK = new DialogueNode("Lyssieth's Palace Gate", "", true, true) {

		@Override
		public boolean isTravelDisabled() {
			return LILIN_PALACE_GATE.isTravelDisabled();
		}

		@Override
		public int getSecondsPassed() {
			return 60;
		}

		@Override
		public String getContent() {
			return "";
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return LILIN_PALACE_GATE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode LILIN_PALACE = new DialogueNode("Lyssieth's Palace", "", false) {

		@Override
		public int getSecondsPassed() {
			return 60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);
			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE"));

			if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_D_MEETING_A_LILIN) {
				if(Main.game.getPlayer().hasCompanions()) {
					UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_ELIZABETH_LEADS_COMPANIONS", Main.game.getPlayer().getMainCompanion()));
				} else {
					UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_ELIZABETH_LEADS"));
				}
			} else if(Main.game.getPlayer().isQuestProgressGreaterThan(QuestLine.MAIN, Quest.MAIN_2_D_MEETING_A_LILIN)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "LILIN_PALACE_ELIZABETH_ESCORT"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				if(Main.game.getPlayer().getQuest(QuestLine.MAIN)==Quest.MAIN_2_D_MEETING_A_LILIN) {
					return new Response("Enter",
							"Enter the palace with Elizabeth, who will then proceed to lead you to the throne room."
									+ (Main.game.getPlayer().hasCompanions()?"<br/>[style.italicsMinorBad(This will dismiss all of your companions, who will be returned home.)]":""),
							LyssiethReveal.ENTRANCE_WITH_ELIZABETH) {
						@Override
						public void effects() {
							Main.game.getPlayer().removeAllCompanions(true);
							Main.game.getPlayer().setLocation(WorldType.LYSSIETH_PALACE, PlaceType.LYSSIETH_PALACE_ENTRANCE);
							Main.game.getNpc(Elizabeth.class).setLocation(WorldType.LYSSIETH_PALACE, PlaceType.LYSSIETH_PALACE_ENTRANCE);
							((DarkSiren)Main.game.getNpc(DarkSiren.class)).postDefeatReset();
						}
					};

				} else if(Main.game.getPlayer().isQuestProgressGreaterThan(QuestLine.MAIN, Quest.MAIN_2_D_MEETING_A_LILIN)) {
					return new Response("Enter", "Tell Elizabeth that you'd like to enter the palace, and have her unlock the doors for you.", PlaceType.LYSSIETH_PALACE_ENTRANCE.getDialogue(false)) {
						@Override
						public void effects() {
							Main.game.getPlayer().setLocation(WorldType.LYSSIETH_PALACE, PlaceType.LYSSIETH_PALACE_ENTRANCE);
							Main.game.getNpc(Elizabeth.class).setLocation(WorldType.SUBMISSION, PlaceType.SUBMISSION_LILIN_PALACE_GATE);
						}
					};

				} else {
					return new Response("Enter", "The doors are locked...", null);
				}
			}
			return null;
		}
	};

	public static final DialogueNode IMP_FORTRESS_ALPHA = new DialogueNode("Crude Fortress", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS"));

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ALPHA"));

			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaDefeated)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_DEFEATED"));
			} else if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaPacified)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_PACIFIED"));
			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			boolean canEnter = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaDefeated)
					|| Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaPacified);

			if(index==1) {
				return new Response(canEnter?"Enter":"Approach",
						canEnter?"Enter the fortress.":"Approach the guards at the entrance to the fortress.",
								PlaceType.FORTRESS_ALPHA_ENTRANCE.getDialogue(false)) {
					@Override
					public void effects() {
						if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaDefeated)) {
							if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_ALPHA, false).isEmpty()) {
								ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_ALPHA);
							} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_ALPHA, false).contains(Main.game.getNpc(FortressAlphaLeader.class))) {
								Main.game.getNpc(FortressAlphaLeader.class).setLocation(WorldType.IMP_FORTRESS_ALPHA, PlaceType.FORTRESS_ALPHA_KEEP, true);
							} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_ALPHA).isEmpty()) {
								ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_ALPHA);
							}
						}
						Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_ALPHA, PlaceType.FORTRESS_ALPHA_ENTRANCE);
					}
				};

			} else if(index==2) {
				if(Main.game.getPlayer().isPartyAbleToFly()) {
					return new Response("Fly",
							canEnter
								?"As you're able to simply walk through the front gate, there's no need to do this unless you were just trying to show off..."
								:"Fly over the wall of the fortress, thereby avoiding a confrontation with the imp guards at the gate.",
							PlaceType.FORTRESS_ALPHA_COURTYARD.getDialogue(false)) {
						@Override
						public void effects() {
							if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressAlphaDefeated)) {
								if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_ALPHA, false).isEmpty()) {
									ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_ALPHA);
								} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_ALPHA, false).contains(Main.game.getNpc(FortressAlphaLeader.class))) {
									Main.game.getNpc(FortressAlphaLeader.class).setLocation(WorldType.IMP_FORTRESS_ALPHA, PlaceType.FORTRESS_ALPHA_KEEP, true);
								} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_ALPHA).isEmpty()) {
									ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_ALPHA);
								}
							}
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_FLY_ENTRY"));
							Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_ALPHA, PlaceType.FORTRESS_ALPHA_COURTYARD);
						}
					};
				} else {
					return new Response("Fly", "Either you or a member of your party is unable to fly, so you're unable to access the fortress by flying over the walls!", null);
				}
			} else {
				return null;
			}
		}
	};

	public static final DialogueNode IMP_FORTRESS_FEMALES = new DialogueNode("Crude Fortress", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS"));

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_FEMALES"));

			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesDefeated)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_DEFEATED"));
			} else if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesPacified)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_PACIFIED"));
			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			boolean canEnter = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesDefeated)
					|| Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesPacified);

			if(index==1) {
				return new Response(canEnter?"Enter":"Approach",
						canEnter?"Enter the fortress.":"Approach the guards at the entrance to the fortress.",
								PlaceType.FORTRESS_FEMALES_ENTRANCE.getDialogue(false)) {
					@Override
					public void effects() {
						if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesDefeated)) {
							if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_FEMALES, false).isEmpty()) {
								ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_FEMALES);
							} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_FEMALES, false).contains(Main.game.getNpc(FortressFemalesLeader.class))) {
								Main.game.getNpc(FortressFemalesLeader.class).setLocation(WorldType.IMP_FORTRESS_FEMALES, PlaceType.FORTRESS_FEMALES_KEEP, true);
							} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_FEMALES).isEmpty()) {
								ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_FEMALES);
							}
						}
						Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_FEMALES, PlaceType.FORTRESS_FEMALES_ENTRANCE);
					}
				};

			} else if(index==2) {
				if(Main.game.getPlayer().isPartyAbleToFly()) {
					return new Response("Fly",
							canEnter
								?"As you're able to simply walk through the front gate, there's no need to do this unless you were just trying to show off..."
								:"Fly over the wall of the fortress, thereby avoiding a confrontation with the imp guards at the gate.",
							PlaceType.FORTRESS_FEMALES_COURTYARD.getDialogue(false)) {
						@Override
						public void effects() {
							if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressFemalesDefeated)) {
								if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_FEMALES, false).isEmpty()) {
									ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_FEMALES);
								} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_FEMALES, false).contains(Main.game.getNpc(FortressFemalesLeader.class))) {
									Main.game.getNpc(FortressFemalesLeader.class).setLocation(WorldType.IMP_FORTRESS_FEMALES, PlaceType.FORTRESS_FEMALES_KEEP, true);
								} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_FEMALES).isEmpty()) {
									ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_FEMALES);
								}
							}
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_FLY_ENTRY"));
							Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_FEMALES, PlaceType.FORTRESS_FEMALES_COURTYARD);
						}
					};
				} else {
					return new Response("Fly", "Either you or a member of your party is unable to fly, so you're unable to access the fortress by flying over the walls!", null);
				}
			} else {
				return null;
			}
		}
	};

	public static final DialogueNode IMP_FORTRESS_MALES = new DialogueNode("Crude Fortress", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			UtilText.nodeContentSB.setLength(0);

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS"));

			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_MALES"));

			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesDefeated)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_DEFEATED"));
			} else if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesPacified)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY_PACIFIED"));
			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_ENTRY"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			boolean canEnter = Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesDefeated)
					|| Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesPacified);

			if(index==1) {
				return new Response(canEnter?"Enter":"Approach",
						canEnter?"Enter the fortress.":"Approach the guards at the entrance to the fortress.",
								PlaceType.FORTRESS_MALES_ENTRANCE.getDialogue(false)) {
					@Override
					public void effects() {
						if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesDefeated)) {
							if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_MALES, false).isEmpty()) {
								ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_MALES);
							} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_MALES, false).contains(Main.game.getNpc(FortressMalesLeader.class))) {
								Main.game.getNpc(FortressMalesLeader.class).setLocation(WorldType.IMP_FORTRESS_MALES, PlaceType.FORTRESS_MALES_KEEP, true);
							} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_MALES).isEmpty()) {
								ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_MALES);
							}
						}
						Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_MALES, PlaceType.FORTRESS_MALES_ENTRANCE);
					}
				};

			} else if(index==2) {
				if(Main.game.getPlayer().isPartyAbleToFly()) {
					return new Response("Fly",
							canEnter
								?"As you're able to simply walk through the front gate, there's no need to do this unless you were just trying to show off..."
								:"Fly over the wall of the fortress, thereby avoiding a confrontation with the imp guards at the gate.",
							PlaceType.FORTRESS_MALES_COURTYARD.getDialogue(false)) {
						@Override
						public void effects() {
							if(!Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressMalesDefeated)) {
								if(ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_MALES, false).isEmpty()) {
									ImpFortressDialogue.resetFortress(WorldType.IMP_FORTRESS_MALES);
								} else if(!ImpFortressDialogue.getImpBossGroup(WorldType.IMP_FORTRESS_MALES, false).contains(Main.game.getNpc(FortressMalesLeader.class))) {
									Main.game.getNpc(FortressMalesLeader.class).setLocation(WorldType.IMP_FORTRESS_MALES, PlaceType.FORTRESS_MALES_KEEP, true);
								} else if(ImpFortressDialogue.getImpGuards(WorldType.IMP_FORTRESS_MALES).isEmpty()) {
									ImpFortressDialogue.resetGuards(WorldType.IMP_FORTRESS_MALES);
								}
							}
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_FORTRESS_FLY_ENTRY"));
							Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_MALES, PlaceType.FORTRESS_MALES_COURTYARD);
						}
					};
				} else {
					return new Response("Fly", "Either you or a member of your party is unable to fly, so you're unable to access the fortress by flying over the walls!", null);
				}
			} else {
				return null;
			}
		}
	};

	public static final DialogueNode IMP_FORTRESS_DEMON = new DialogueNode("Stone Citadel", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressDemonDefeated)) {
				return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_DEFEATED");
			}

			Main.game.getDialogueFlags().setFlag(DialogueFlagValue.impCitadelEncountered, true);

			UtilText.nodeContentSB.setLength(0);
			UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_BASE"));

			if((Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY)
							&& Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY_2)
							&& Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY_3))
						|| Main.game.getPlayer().hasClothingType(ClothingType.getClothingTypeFromId("innoxia_neck_key_chain"), true)) {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_KEYS"));

			} else {
				UtilText.nodeContentSB.append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_NO_KEYS"));
			}

			return UtilText.nodeContentSB.toString();
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressDemonDefeated)) {
					return new Response("Enter", "Enter the ruins of the Dark Siren's citadel.", PlaceType.FORTRESS_DEMON_ENTRANCE.getDialogue(false)) {
						@Override
						public void effects() {
							Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_DEMON, PlaceType.FORTRESS_DEMON_ENTRANCE);
							Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_RUINS_ENTRY"));
						}
					};

				} else if((Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY)
								&& Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY_2)
								&& Main.game.getPlayer().hasItemType(ItemType.IMP_FORTRESS_ARCANE_KEY_3))
							|| Main.game.getPlayer().hasClothingType(ClothingType.getClothingTypeFromId("innoxia_neck_key_chain"), true)) {
					return new Response("Enter", "Enter the citadel.", FORTRESS_DEMON_ENTRANCE_KEY_ENTRY) {
						@Override
						public void effects() {
							Main.game.getPlayer().setLocation(WorldType.IMP_FORTRESS_DEMON, PlaceType.FORTRESS_DEMON_ENTRANCE);
							ImpCitadelDialogue.applyEntry();

							if(!Main.game.getPlayer().hasClothingType(ClothingType.getClothingTypeFromId("innoxia_neck_key_chain"), true)) {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_KEY_ENTRY"));
								Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addClothing(AbstractClothingType.generateClothing(ClothingType.getClothingTypeFromId("innoxia_neck_key_chain")), false));
								Main.game.getPlayer().removeItem(AbstractItemType.generateItem(ItemType.IMP_FORTRESS_ARCANE_KEY));
								Main.game.getPlayer().removeItem(AbstractItemType.generateItem(ItemType.IMP_FORTRESS_ARCANE_KEY_2));
								Main.game.getPlayer().removeItem(AbstractItemType.generateItem(ItemType.IMP_FORTRESS_ARCANE_KEY_3));
							} else {
								Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_KEY_ENTRY_REPEAT"));
								if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.impFortressDemonImpsDefeated)) {
									Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_KEY_ENTRY_REPEAT_IMPS"));
								} else {
									Main.game.getTextStartStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "IMP_CITADEL_KEY_ENTRY_REPEAT_NO_IMPS"));
								}
							}
						}
					};

				} else {
					return new Response("Enter", "You don't have the three keys required to open the gates...", null);
				}

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode FORTRESS_DEMON_ENTRANCE_KEY_ENTRY = new DialogueNode("", "", false) {

		@Override
		public String getContent() {
			return "";
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return ImpCitadelDialogue.ENTRANCE.getResponse(responseTab, index);
		}
	};

	// Entrance and exits:

	public static final DialogueNode SEWER_ENTRANCE = new DialogueNode("Enforcer Checkpoint", "", false) {

		@Override
		public int getSecondsPassed() {
			return 3*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "SEWER_ENTRANCE");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new ResponseEffectsOnly("Dominion", "Head back up to Dominion."){
					@Override
					public void effects() {
						Main.mainController.moveGameWorld(WorldType.DOMINION, PlaceType.DOMINION_EXIT_TO_SUBMISSION, true);
					}
				};

			} else if (index == 2) {
				return new Response("Claire", "Approach Claire and say hello to her.", CLAIRE);

			} else {
				return null;
			}
		}
	};

	private static void applyClaireMeetingEffects() {
		if(Main.game.getNpc(Claire.class).isVisiblyPregnant()) {
			Main.game.getNpc(Claire.class).setCharacterReactedToPregnancy(Main.game.getPlayer(), true);
		}
	}

	public static final DialogueNode CLAIRE = new DialogueNode("Claire", "", true) {

		@Override
		public int getSecondsPassed() {
			return 60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 0) {
				return new Response("Back", "Tell Claire that you need to get going.", SEWER_ENTRANCE);

			} else if (index == 1) {
				if(Main.game.getCurrentDialogueNode()==CLAIRE_INFO_SUBMISSION_SOCIETY) {
					return new Response("Information", "You are already asking Claire about Submission society.", null);
				}
				return new Response("Information", "Ask Claire about Submission society.", CLAIRE_INFO_SUBMISSION_SOCIETY) {
					@Override
					public void effects() {
						applyClaireMeetingEffects();
					}
				};

			} else if (index == 2) {
				if(Main.game.getCurrentDialogueNode()==CLAIRE_INFO_LYSSIETH) {
					return new Response("Lyssieth", "You are already asking Claire about Lyssieth.", null);
				}
				return new Response("Lyssieth", "Ask Claire about Lyssieth.", CLAIRE_INFO_LYSSIETH) {
					@Override
					public void effects() {
						applyClaireMeetingEffects();
					}
				};

			} else if (index == 3) {
				if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.claireAskedTeleportation)) {
					if(Main.game.getCurrentDialogueNode()==CLAIRE_INFO_SWORD_ORICL) {
						return new Response("SWORD & ORICL", "You are already asking Claire about the Enforcer branches of 'SWORD' and 'ORICL'.", null);
					}
					return new Response("SWORD & ORICL", "Ask Claire about the Enforcer branches of 'SWORD' and 'ORICL'.", CLAIRE_INFO_SWORD_ORICL);

				} else {
					return new Response("Teleportation", "Ask Claire about teleportation.", CLAIRE_INFO_TELEPORTATION) {
						@Override
						public void effects() {
							Main.game.getDialogueFlags().setFlag(DialogueFlagValue.claireAskedTeleportation, true);
							applyClaireMeetingEffects();
						}
					};
				}

			} else if(index==4) {
				if(Main.game.getPlayer().getQuest(QuestLine.SIDE_SLIME_QUEEN)==Quest.SLIME_QUEEN_TWO) {
					return new Response("Report Back", "Report what the slime said about a 'Slime Queen'.", CLAIRE_INFO_REPORT_BACK) {
						@Override
						public void effects() {
							applyClaireMeetingEffects();
							Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().incrementMoney(5000));
							Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().setQuestProgress(QuestLine.SIDE_SLIME_QUEEN, Quest.SLIME_QUEEN_THREE));
						}
					};

				} else if(Main.game.getPlayer().getQuest(QuestLine.SIDE_SLIME_QUEEN)==Quest.SLIME_QUEEN_SIX_SUBMIT
							|| Main.game.getPlayer().getQuest(QuestLine.SIDE_SLIME_QUEEN)==Quest.SLIME_QUEEN_SIX_FORCE
							|| Main.game.getPlayer().getQuest(QuestLine.SIDE_SLIME_QUEEN)==Quest.SLIME_QUEEN_SIX_CONVINCE) {
					return new Response("Report Back", "Report to Claire that you've defeated the Slime Queen.", CLAIRE_INFO_SLIME_QUEEN_REPORT_BACK) {
						@Override
						public void effects() {
							applyClaireMeetingEffects();
							Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().incrementMoney(20000));
							Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().setQuestProgress(QuestLine.SIDE_SLIME_QUEEN, Quest.SIDE_UTIL_COMPLETE));
						}
					};

				} else {
					return null;
				}

			} else if(index==5
					&& Main.game.getPlayer().hasQuest(QuestLine.SIDE_VENGAR)
					&& !Main.game.getPlayer().isSubQuestCompleted(Quest.VENGAR_OPTIONAL_CLAIRE, QuestLine.SIDE_VENGAR)) {
				return new Response("Vengar", "Ask for Claire's help with dealing with Vengar.", CLAIRE_VENGAR_HELP) {
					@Override
					public void effects() {
						applyClaireMeetingEffects();
					}
				};

			} else if(index == 6 && Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.claireAskedTeleportation)) {
				if(!Main.game.getPlayer().hasQuest(QuestLine.SIDE_TELEPORTATION) || !Main.game.getPlayer().isQuestCompleted(QuestLine.SIDE_TELEPORTATION)) {
					return new Response("Teleportation pads",
							"Tell Claire that you'd like to see the teleportation pads now.<br/>[style.italicsQuestSide(This will start a side quest which will need to be resolved before you're able to continue with whatever it is you were doing...)]",
							CLAIRE_TELEPORTATION_PADS) {
						@Override
						public void effects() {
							applyClaireMeetingEffects();
						}
						@Override
						public Colour getHighlightColour() {
							return Colour.QUEST_SIDE;
						}
					};

				} else {
					if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.claireAskedWarehouseEscape)) {
						return new ResponseSex(
								"Risky sex",
								"From your experience in the SWORD warehouse, Claire seems to have obtained a fetish for risky sex."
										+ " You could always satisfy her craving for it if you wanted to...",
								true,
								true,
								new SexManagerDefault(
										SexPosition.STANDING,
										Util.newHashMapOfValues(new Value<>(Main.game.getPlayer(), SexSlotStanding.STANDING_DOMINANT)),
										Util.newHashMapOfValues(new Value<>(Main.game.getNpc(Claire.class), SexSlotStanding.STANDING_SUBMISSIVE))) {
									@Override
									public boolean isPublicSex() {
										return false;
									}
								},
								null,
								null,
								AFTER_CLAIRE_SEX,
								UtilText.parseFromXMLFile("places/submission/submissionPlaces", "START_CLAIRE_SEX"));
					}
					return new Response("Warehouse", "Ask Claire if she still thinks about your escape from the SWORD warehouse.", CLAIRE_WAREHOUSE) {
						@Override
						public void effects() {
							Main.game.getDialogueFlags().setFlag(DialogueFlagValue.claireAskedWarehouseEscape, true);
							applyClaireMeetingEffects();
						}
					};

				}

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode CLAIRE_INFO_REPORT_BACK = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_REPORT_BACK");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new Response("Continue", "Let Claire get back on with her work, and continue on your way.", SEWER_ENTRANCE);

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode CLAIRE_INFO_SLIME_QUEEN_REPORT_BACK = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			if(Main.game.getDialogueFlags().hasFlag(DialogueFlagValue.slimeQueenHelped)) {
				return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_SLIME_QUEEN_REPORT_BACK_LIE");
			} else {
				return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_SLIME_QUEEN_REPORT_BACK");
			}
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if (index == 1) {
				return new Response("Continue", "Let Claire get back on with her work, and continue on your way.", SEWER_ENTRANCE);

			} else {
				return null;
			}
		}
	};

	public static final DialogueNode CLAIRE_VENGAR_HELP = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_VENGAR_HELP");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Wait",
						"Do as Claire asks and wait for her to return.",
						CLAIRE_VENGAR_HELP_WAIT) {
					@Override
					public void effects() {
						Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addOptionalQuestProgress(QuestLine.SIDE_VENGAR, Quest.VENGAR_OPTIONAL_CLAIRE));
						Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().addItem(AbstractItemType.generateItem(ItemType.RESONANCE_STONE), false));
					}
				};
			}
			return null;
		}
	};

	public static final DialogueNode CLAIRE_VENGAR_HELP_WAIT = new DialogueNode("", "", true, true) {

		@Override
		public int getSecondsPassed() {
			return 10*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_VENGAR_HELP_WAIT");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_INFO_SUBMISSION_SOCIETY = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return (UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_SUBMISSION_SOCIETY"));
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_INFO_LYSSIETH = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return (UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_LYSSIETH"));
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_INFO_TELEPORTATION = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return (UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_TELEPORTATION"));
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_INFO_SWORD_ORICL = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return (UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_INFO_SWORD_ORICL"));
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_TELEPORTATION_PADS = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 2*60;
		}

		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_TELEPORTATION_PADS");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Teleported!", "The teleportation pad has activated, sending you and Claire to an unknown destination!", ENFORCER_WARHOUSE_APPEARANCE) {
					@Override
					public void effects() {
						EnforcerWarehouse.initWarehouse();
						Main.game.getPlayer().setLocation(WorldType.ENFORCER_WAREHOUSE, PlaceType.ENFORCER_WAREHOUSE_ENCLOSURE_TELEPORT_PADS, false);
						Main.game.getNpc(Claire.class).setLocation(Main.game.getPlayer(), false);

						Main.game.getTextEndStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "ENFORCER_WARHOUSE_APPEARANCE"));

						if(Main.game.getPlayer().hasCompanions()) {
							if(Main.game.getPlayer().getMainCompanion() instanceof Elemental) {
								Main.game.getTextEndStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "ENFORCER_WARHOUSE_APPEARANCE_ELEMENTAL", Main.game.getPlayer().getMainCompanion()));
							} else {
								Main.game.getTextEndStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "ENFORCER_WARHOUSE_APPEARANCE_COMPANIONS", Main.game.getPlayer().getMainCompanion()));
							}
							Main.game.getPlayer().removeAllCompanions(true);

						} else {
							Main.game.getTextEndStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "ENFORCER_WARHOUSE_APPEARANCE_SOLO"));
						}

						Main.game.getTextEndStringBuilder().append(UtilText.parseFromXMLFile("places/submission/submissionPlaces", "ENFORCER_WARHOUSE_APPEARANCE_END"));

						Main.game.getTextEndStringBuilder().append(Main.game.getPlayer().startQuest(QuestLine.SIDE_TELEPORTATION));
					}
				};
			}
			return null;
		}
	};

	public static final DialogueNode ENFORCER_WARHOUSE_APPEARANCE = new DialogueNode("", "", true) {

		@Override
		public int getSecondsPassed() {
			return 60;
		}

		@Override
		public String getContent() {
			return "";
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			return EnforcerWarehouse.ENCLOSURE_TELEPORT_PADS.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode CLAIRE_WAREHOUSE = new DialogueNode("", "", true) {
		@Override
		public int getSecondsPassed() {
			return 2*60;
		}
		@Override
		public String getContent() {
			return (UtilText.parseFromXMLFile("places/submission/submissionPlaces", "CLAIRE_WAREHOUSE"));
		}
		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

	public static final DialogueNode AFTER_CLAIRE_SEX = new DialogueNode("Finished", "You and Claire start disentangling yourselves from one another...", true) {
		@Override
		public int getSecondsPassed() {
			return 3*60;
		}
		@Override
		public String getContent() {
			return UtilText.parseFromXMLFile("places/submission/submissionPlaces", "AFTER_CLAIRE_SEX");
		}
		@Override
		public Response getResponse(int responseTab, int index) {
			return CLAIRE.getResponse(responseTab, index);
		}
	};

}


code:
package com.lilithsthrone.game.dialogue.places.submission.dicePoker;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import com.lilithsthrone.utils.Util;

/**
 * @since 0.2.6
 * @version 0.2.6
 * @author Innoxia
 */
public class Dice {

	private DiceFace face;
	private Map<DiceFace, Float> diceBias;

	public Dice() {
		face = DiceFace.SIX;
		diceBias = new HashMap<>();
		for(DiceFace face : DiceFace.values()) {
			diceBias.put(face, 1f);
		}
	}

	public Dice(Map<DiceFace, Float> diceBias) {
		this();
		for(Entry<DiceFace, Float> entry : diceBias.entrySet()) {
			this.diceBias.put(entry.getKey(), entry.getValue());
		}
	}

	public void roll() {
		face = Util.getRandomObjectFromWeightedFloatMap(diceBias);
	}

	public DiceFace getFace() {
		return face;
	}

	public void setFace(DiceFace face) {
		this.face = face;
	}

	public Map<DiceFace, Float> getDiceBias() {
		return diceBias;
	}
}

repo_name: klorpa/Pedo

license: unknown


code:
package com.lilithsthrone.game.dialogue.places.submission.dicePoker;

import com.lilithsthrone.rendering.SVGImages;

/**
 * @since 0.2.6
 * @version 0.2.6
 * @author Innoxia
 */
public enum DiceFace {

	ONE(1, "one", "⚀") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice1();
		}
	},
	TWO(2, "two", "⚁") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice2();
		}
	},
	THREE(3, "three", "⚂") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice3();
		}
	},
	FOUR(4, "four", "⚃") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice4();
		}
	},
	FIVE(5, "five", "⚄") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice5();
		}
	},
	SIX(6, "six", "⚅") {
		@Override
		public String getSVGString() {
			return SVGImages.SVG_IMAGE_PROVIDER.getDice6();
		}
	};

	private int value;
	private String name;
	private String htmlDisplay;

	private DiceFace(int value, String name, String htmlDisplay) {
		this.value = value;
		this.name = name;
		this.htmlDisplay = htmlDisplay;
	}

	public abstract String getSVGString();

	public int getValue() {
		return value;
	}

	public String getName() {
		return name;
	}

	public String getHtmlDisplay() {
		return htmlDisplay;
	}
}


code:
package com.lilithsthrone.game.dialogue.places.submission.dicePoker;

import java.util.ArrayList;
import java.util.List;

import com.lilithsthrone.game.character.npc.NPC;
import com.lilithsthrone.game.dialogue.DialogueNode;
import com.lilithsthrone.game.dialogue.responses.Response;
import com.lilithsthrone.game.dialogue.responses.ResponseEffectsOnly;
import com.lilithsthrone.game.dialogue.responses.ResponseSex;
import com.lilithsthrone.game.dialogue.utils.UtilText;
import com.lilithsthrone.game.sex.managers.universal.SMGeneric;
import com.lilithsthrone.main.Main;
import com.lilithsthrone.rendering.SVGImages;
import com.lilithsthrone.utils.Colour;
import com.lilithsthrone.utils.Util;

/**
 * @since 0.2.6
 * @version 0.3.5.5
 * @author Innoxia
 */
public class DicePoker {

	private static DialogueNode endingNode;
	private static int moneyPool;
	private static DicePokerTable table;
	private static NPC gambler;
	private static List<Dice> playerDice = new ArrayList<>();
	private static List<Dice> gamblerDice = new ArrayList<>();
	private static List<Dice> diceToReroll = new ArrayList<>();
	private static String[] progressDescriptions = new String[] {"Roll", "Betting", "Re-roll", "Payment"};
	public static int progress = 0;
	private static String responseContent;
	private static String buyInDescription;

	static {
		for(int i=0; i<5; i++) {
			playerDice.add(new Dice());
			gamblerDice.add(new Dice());
		}
	}

	public static DialogueNode initDicePoker(NPC gambler, DicePokerTable table, DialogueNode endingNode) {
		DicePoker.endingNode = endingNode;
		DicePoker.table = table;

		progress = 0;
		moneyPool = table.getInitialBet()*2;

		buyInDescription = Main.game.getPlayer().incrementMoney(-table.getInitialBet());

		DicePoker.gambler = gambler;

		for(Dice d : playerDice) {
			d.setFace(DiceFace.ONE);
		}

		for(Dice d : gamblerDice) {
			d.setFace(DiceFace.ONE);
		}

		diceToReroll.clear();
		diceToReroll.addAll(playerDice);
		diceToReroll.addAll(gamblerDice);

		return START;
	}

	public static List<Dice> getPlayerDice() {
		return playerDice;
	}

	public static boolean isAbleToSelectReroll() {
		return !Main.game.getCurrentDialogueNode().equals(START)
				&& !Main.game.getCurrentDialogueNode().equals(END_WIN)
				&& !Main.game.getCurrentDialogueNode().equals(END_DRAW)
				&& !Main.game.getCurrentDialogueNode().equals(END_LOSS);
	}

	public static void setReroll(Dice d) {
		if(diceToReroll.contains(d)) {
			diceToReroll.remove(d);
		} else {
			diceToReroll.add(d);
		}
		Main.game.setContent(new Response("", "", Main.game.getCurrentDialogueNode()));
	}

	private static String getGamblingFormat(String turnText) {
		UtilText.nodeContentSB.setLength(0);

		int comparingHands = Hand.compareHands(playerDice, gamblerDice);

		UtilText.nodeContentSB.append("
");
			for(int i=0; i<playerDice.size(); i++) {
				UtilText.nodeContentSB.append("
"
													+(Hand.getDiceInHand(playerDice).contains(playerDice.get(i))
															?"
"
																	+SVGImages.SVG_IMAGE_PROVIDER.getDiceGlow()
																+ "
"
															:"")
													+"
"+playerDice.get(i).getFace().getSVGString()+"
"
													+ "

"
											+ "
");
			}
			Hand playerHand = Hand.getHand(playerDice);
			UtilText.nodeContentSB.append("
"
					+ ""+playerHand.getRanking()+". "+playerHand.getName()+" | [style.colourDisabled(Value: "+Hand.getValue(playerDice)+")]
"
					+(comparingHands==0
						?"[style.colourDisabled(You "+(progress==3?"have drawn":"are drawing")+"...)]"
						:(comparingHands<0
							?"[style.colourTerrible(You "+(progress==3?"have lost":"are losing")+"!)]"
							:"[style.colourExcellent(You "+(progress==3?"have won":"are winning")+"!)]"))
						+ "
");
		UtilText.nodeContentSB.append("
");

		UtilText.nodeContentSB.append("
");
			for(int i=0; i<gamblerDice.size(); i++) {
				UtilText.nodeContentSB.append("
"
													+(Hand.getDiceInHand(gamblerDice).contains(gamblerDice.get(i))
															?"
"
																	+SVGImages.SVG_IMAGE_PROVIDER.getDiceGlow()
																+ "
"
															:"")
													+"
"+gamblerDice.get(i).getFace().getSVGString()+"
"
											+ "
");
			}
			Hand gamblerHand = Hand.getHand(gamblerDice);
			UtilText.nodeContentSB.append("
"
					+ ""+gamblerHand.getRanking()+". "+gamblerHand.getName()+" | [style.colourDisabled(Value: "+Hand.getValue(gamblerDice)+")]
"
					+UtilText.parse(gambler,(comparingHands==0
						?"[style.colourDisabled([npc.Name] "+(progress==3?"has drawn":"is drawing")+"...)]"
						:(comparingHands>0
							?"[style.colourTerrible([npc.Name] "+(progress==3?"has lost":"is losing")+"!)]"
							:"[style.colourExcellent([npc.Name] "+(progress==3?"has won":"is winning")+"!)]")))
					+ "
");
		UtilText.nodeContentSB.append("
");

		UtilText.nodeContentSB.append("
");
		UtilText.nodeContentSB.append("
"
				+ "Progress:"
				+ "
");
		for(int i=0; i<progressDescriptions.length; i++) {
			UtilText.nodeContentSB.append(
					(i!=0
						?"
>
"
						:"")
					+ "
"
					+ (progress==i
						?"[style.boldGood("+progressDescriptions[i]+")]"
						:progress>i
							?progressDescriptions[i]
							:"[style.colourDisabled("+progressDescriptions[i]+")]")
					+ "
");
		}
		UtilText.nodeContentSB.append("
"
				+ "Total pot: "+UtilText.formatAsMoney(moneyPool, "span")
				+ "
");
		UtilText.nodeContentSB.append("
");

		UtilText.nodeContentSB.append(UtilText.parse(gambler,turnText));

		return UtilText.nodeContentSB.toString();
	}

	private static void rollRice() {
		for(Dice dice : diceToReroll) {
			dice.roll();
		}
		diceToReroll.clear();
	}

	private static int getRaiseAmount() {
		if(Main.game.getPlayer().getMoney()<table.getRaiseAmount()) {
			return Main.game.getPlayer().getMoney();
		} else {
			return table.getRaiseAmount();
		}
	}

	private static boolean isGamblerRaising() {
		int differenceWillingToRaiseAt = -Util.random.nextInt(3)-1;
		return Hand.getHand(playerDice)!=Hand.getHand(gamblerDice) && Hand.compareHands(playerDice, gamblerDice) < differenceWillingToRaiseAt;
	}

	private static boolean isGamblerFolding() {
		int differenceWillingToFoldAt = Util.random.nextInt(6)+4;
		return Hand.getHand(playerDice)!=Hand.getHand(gamblerDice) && Hand.compareHands(playerDice, gamblerDice) > differenceWillingToFoldAt;
	}

	private static void calculateGamblerRerolls() {
		List<Dice> rerollDice = new ArrayList<>(gamblerDice);

		if(Hand.getHand(gamblerDice)!=Hand.NINE_RUNT) {
			rerollDice.removeAll(Hand.getDiceInHand(gamblerDice));
		}

		diceToReroll.addAll(rerollDice);
	}

	private static final DialogueNode START = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getLabel() {
			return "Dice Poker - "+Util.capitaliseSentence(table.getName())+" Table";
		}

		@Override
		public String getContent() {
			return getGamblingFormat(buyInDescription
					+"
"
						+ "Walking up to one of the free tables in the "+table.getName()+" section, you sit down opposite [npc.a_race]."
					+ "
"
					+ "
"
						+ "[npc.speech(You think you can take me on, huh?)] [npc.she] taunts. [npc.speech(Don't start crying when I take all your cash!)]"
					+ "
"
					+ "
"
						+ "You place the buy-in of "+UtilText.formatAsMoney(table.getInitialBet(), "span")+" on the table, and the [npc.race] does the same."
					+ "
"
					+ "
"
						+ "[npc.speech(The name's [npc.name], by the way. Now let's play.)]"
					+ "
");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Roll", "Roll your dice.", ROLL) {
					@Override
					public void effects() {
						rollRice();
						progress++;
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode ROLL = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			if(Hand.compareHands(playerDice, gamblerDice)>0) {
				return getGamblingFormat(
						"
"
							+ "Both you and [npc.name] roll all five of your dice to get the game started."
							+ " As they clatter to a halt, your opponent lets out an annoyed sigh as [npc.she] sees that you have a better hand."
							+ " [npc.speech(Damn it... Well, this is just the start! You gonna' call, or you want to raise the stakes?)]"
						+ "
");

			} else if(Hand.compareHands(playerDice, gamblerDice)==0) {
				return getGamblingFormat(
						"
"
							+ "Both you and [npc.name] roll all five of your dice to get the game started."
							+ " As they clatter to a halt, your opponent lets out a surprised hum as [npc.she] sees that you're drawing."
							+ " [npc.speech(Well, would you look at that... You gonna' call, or you want to raise the stakes?)]"
						+ "
");

			} else {
				return getGamblingFormat(
						"
"
							+ "Both you and [npc.name] roll all five of your dice to get the game started."
							+ " As they clatter to a halt, your opponent lets out a triumphant laugh as [npc.she] sees that [npc.she] has a better hand."
							+ " [npc.speech(Hah! This is just the start, and I'm already winning! Now, you gonna' call, or you want to raise the stakes?)]"
						+ "
");
			}
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new ResponseEffectsOnly("Call", "Don't increase the bet.") {
					@Override
					public void effects() {
						if(isGamblerRaising()) {
							moneyPool+=getRaiseAmount();
							responseContent = "
"
										+ "[pc.speech(I call,)] you say, leaning back in your chair."
									+ "
"
									+ "
"
										+ "[npc.speech(Well, no surprise there,)] [npc.name] laughs. [npc.speech(We both know I'm going to win.)]"
									+ "
"
									+ "
"
										+ "Leaning forwards, [npc.name] places "+UtilText.formatAsMoney(getRaiseAmount(), "span")+" on the table, before locking [npc.her] gaze with yours and letting out another mocking laugh."
											+ " [npc.speech(Go on, just fold. You're as good as finished.)]"
									+ "
"
									+ "
"
										+ "[npc.Name] raised by "+UtilText.formatAsMoney(getRaiseAmount(), "span")+"!"
									+ "
";
							Main.game.setContent(new Response("", "", BET_NEED_REACT));

						} else {
							responseContent = "
"
									+ "[pc.speech(I call,)] you say, leaning back in your chair."
								+ "
"
								+ "
"
									+ "[npc.speech(Yeah, I'm feeling the same,)] [npc.name] sighs. [npc.speech(I call too. Now let's finish this.)]"
								+ "
"
								+ "
"
									+ "[npc.Name] called as well!
"
									+ "Click the dice you want to reroll, then press 'Roll'."
								+ "
";
							calculateGamblerRerolls();
							progress++;
							Main.game.setContent(new Response("", "", REROLL));
						}
					}
				};

			} else if(index==2) {
				return new ResponseEffectsOnly("Raise", "Increase the bet.") {
					@Override
					public void effects() {
						if(isGamblerFolding()) {
							String moneyChange = Main.game.getPlayer().incrementMoney(moneyPool);
							responseContent = "
"
												+ "[pc.speech(I think I'll raise,)] you say, placing "+UtilText.formatAsMoney(getRaiseAmount(), "span")+" on the table."
											+ "
"
											+ "
"
												+ "[npc.speech(Damn it... You got me,)] [npc.name] sighs. [npc.speech(I fold.)]"
											+ "
"
											+ "
"
												+ "[npc.Name] folded! [style.colourExcellent(You won!)]"
											+ "
"
											+moneyChange;
							progress++;
							progress++;
							Main.game.setContent(new Response("", "", END_WIN));

						} else {
							moneyPool+=getRaiseAmount()*2;
							int raise = getRaiseAmount();
							String moneyChange = Main.game.getPlayer().incrementMoney(-getRaiseAmount());
							responseContent = moneyChange
									+"
"
										+ "[pc.speech(I think I'll raise,)] you say, placing "+UtilText.formatAsMoney(raise, "span")+" on the table."
									+ "
"
									+ "
"
										+ "[npc.speech(That's fine with me,)] [npc.name] replies. [npc.speech(I'll call that.)]"
									+ "
"
									+ "
"
										+ "[npc.Name] places "+UtilText.formatAsMoney(raise, "span")+" on the table, before grinning at you. [npc.speech(Now, let's finish this!)]"
									+ "
"
									+ "
"
										+ "[npc.Name] called your raise!
"
										+ "Click the dice you want to reroll, then press 'Roll'."
									+ "
";
							calculateGamblerRerolls();
							progress++;
							Main.game.setContent(new Response("", "", REROLL));
						}
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode BET_NEED_REACT = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return getGamblingFormat(responseContent);
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new ResponseEffectsOnly("Call ("+UtilText.formatAsMoney(getRaiseAmount(), "span")+")", UtilText.parse(gambler, "Match [npc.namePos] raise of "+UtilText.formatAsMoney(getRaiseAmount(), "span")+".")) {
					@Override
					public void effects() {
						moneyPool+=getRaiseAmount();
						int raise = getRaiseAmount();
						String moneyChange = Main.game.getPlayer().incrementMoney(-getRaiseAmount());
						responseContent = moneyChange
							+"
"
								+ "[pc.speech(I'll call that,)] you say, placing "+UtilText.formatAsMoney(raise, "span")+" on the table."
							+ "
"
							+ "
"
								+ "[npc.speech(Fine,)] [npc.name] huffs, [npc.speech(that's only going to be more money for me! Now, let's finish this!)]"
							+ "
"
							+ "
"
								+ "You called [npc.namePos] raise!
"
								+ "Click the dice you want to reroll, then press 'Roll'."
							+ "
";
						calculateGamblerRerolls();
						progress++;
						Main.game.setContent(new Response("", "", REROLL));
					}
				};

			} else if(index==2) {
				return new ResponseEffectsOnly("Fold", UtilText.parse(gambler, "Surrender to [npc.namePos] and let [npc.herHim] take the pool of "+UtilText.formatAsMoney(moneyPool, "span")+".")) {
					@Override
					public void effects() {
						moneyPool+=getRaiseAmount();
						responseContent = "
"
											+ "[pc.speech(That's too steep for me,)] you sigh. [pc.speech(I fold.)]"
										+ "
"
										+ "
"
											+ "[npc.speech(Hah!)] [npc.name] laughs in triumph. [npc.speech(You never stood a chance!)]"
										+ "
"
										+ "
"
											+ "With that, [npc.she] moves to take the pool of "+UtilText.formatAsMoney(moneyPool, "span")+"."
											+ (gambler.isAttractedTo(Main.game.getPlayer())
													?" You could take your leave, or perhaps try to use your body to convince [npc.herHim] to let you keep your money..."
													:" You can tell that [npc.name] isn't attracted to you, so you should just take your leave...")
										+ "
"
										+ "
"
											+ "You folded! [style.colourTerrible(You lost!)]"
										+ "
";
						progress++;
						progress++;
						Main.game.setContent(new Response("", "", END_LOSS));
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode REROLL = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return getGamblingFormat(responseContent);
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			boolean reroll = false;
			for(Dice d : playerDice) {
				if(diceToReroll.contains(d)) {
					reroll=true;
					break;
				}
			}

			if(index==1) {
				return new ResponseEffectsOnly(reroll?"Roll":"No Roll", reroll?"Roll your dice.":"Choose not to re-roll any of your dice. (Click on your dice to select them for re-roll.)") {
					@Override
					public void effects() {
						boolean diceRerolled = !diceToReroll.isEmpty();
						rollRice();

						if(Hand.compareHands(playerDice, gamblerDice)==0) {
							String moneyChange = Main.game.getPlayer().incrementMoney(moneyPool/2);
							responseContent = "
"
												+ (diceRerolled
														?"As the dice come clattering to a halt, both you and [npc.name] sigh in unison as you see that your hands are identical in value."
														:"As both you and [npc.name] choose not to reroll any dice, you sigh in unison as you resign yourselves to having identically valued hands.")
													+ " With the game being a draw, you split the money pool in half and take your leave..."
												+ "
"
												+ "
"
													+ "You drew! You split the pool of "+UtilText.formatAsMoney(moneyPool, "span")+" 50/50."
												+ "
"
												+moneyChange;
							progress++;
							Main.game.setContent(new Response("", "", END_DRAW));

						} else if(Hand.compareHands(playerDice, gamblerDice)>0) {
							String moneyChange = Main.game.getPlayer().incrementMoney(moneyPool);
							responseContent = "
"
												+ (diceRerolled
														?"As the dice come clattering to a halt, [npc.name] lets out a defeated sigh as [npc.she] sees that you've won."
														:"As both you and [npc.name] choose not to reroll any dice, [npc.sheIs] already resigned [npc.herself] to a loss, and lets out a frustrated little sigh.")
													+ " [npc.speech(Damn it... Well, good game...)]"
												+ "
"
												+ "
"
													+ "You collect your winnings and return [npc.namePos] polite remark, before moving off and taking your leave..."
												+ "
"
												+ "
"
													+ "[style.colourExcellent(You won!)]"
												+ "
"
												+moneyChange;
							progress++;
							Main.game.setContent(new Response("", "", END_WIN));

						} else {
							responseContent =  "
"
												+ (diceRerolled
														?"As the dice come clattering to a halt, [npc.name] lets out a triumphant laugh as [npc.she] sees that [npc.sheIs] won."
														:"As both you and [npc.name] choose not to reroll any dice, you've already resigned yourself to a loss, and try not to feel too unhappy as your opponent lets out a triumphant laugh.")
													+ " [npc.speech(Hah! Good game, but you never stood a chance!)]"
												+ "
"
												+ "
"
												+ "With that, [npc.she] moves to take the pool of "+UtilText.formatAsMoney(moneyPool, "span")+"."
													+ (gambler.isAttractedTo(Main.game.getPlayer())
															?" You could take your leave, or perhaps try to use your body to convince [npc.herHim] to let you keep your money..."
															:" You can tell that [npc.name] isn't attracted to you, so you should just take your leave...")
												+ "
"
												+ "
"
													+ "[style.colourTerrible(You lost!)]"
												+ "
";
							progress++;
							Main.game.setContent(new Response("", "", END_LOSS));
						}
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode END_WIN = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return getGamblingFormat(responseContent);
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Continue", "Step away from the table.", endingNode) {
					@Override
					public void effects() {
						progress = 0;
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode END_DRAW = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return getGamblingFormat(responseContent);
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Continue", "Step away from the table.", endingNode) {
					@Override
					public void effects() {
						progress = 0;
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode END_LOSS = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return getGamblingFormat(responseContent);
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Accept loss", "Step away from the table.", endingNode) {
					@Override
					public void effects() {
						progress = 0;
					}
				};

			} else if(index==2) {
				return new Response("Offer body",
						UtilText.parse(gambler, "Offer [npc.name] use of your body if [npc.she]'ll give you your money back."),
						END_LOSS_OFFER_BODY);
			}
			return null;
		}
	};

	private static final DialogueNode END_LOSS_OFFER_BODY = new DialogueNode("Dice Poker", "", true) {

		@Override
		public String getContent() {
			return UtilText.parse(gambler,
					"
"
						+ "[pc.speech(Wait!)] you cry out, desperate not to lose your money."
					+ "
"
					+ "
"
						+ "[npc.speech(Huh? What is it?)] [npc.name] asks, narrowing [npc.her] eyes in suspicion as [npc.she] looks up from gathering the money that's on the table."
					+ "
"
					+ "
"
						+ "[pc.speech(Well... I mean... Is there no way I can get my money back?)] you ask, putting on your most innocent look as you submissively cast your eyes to the floor."
					+ "
"
					+ "
"
						+ "[npc.speech(Hmm, well, there is one way you could get your half of the pool back,)] [npc.name] replies, with an unmistakable hint of lust in [npc.her] voice."
						+ " [npc.speech(I'll give you your flames back, but only if you let me fuck you, right here, right now.)]"
					+ "
");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Decline", "Step away from the table.", endingNode) {
					@Override
					public void effects() {
						progress = 0;
						Main.game.getTextStartStringBuilder().append(
								"
"
									+ "[pc.speech(On second thoughts, I don't need my money back,)] you say, before turning around and quickly taking your leave."
								+ "
");
					}
				};

			} else if(index==2) {
				return new ResponseSex("Accept",
						UtilText.parse(gambler, "Allow [npc.name] to publicly fuck you in order to get your money back."),
						true, false,
						new SMGeneric(
								Util.newArrayListOfValues(gambler),
								Util.newArrayListOfValues(Main.game.getPlayer()),
						null,
						null),
						END_LOSS_SEX,
						UtilText.parse(gambler,"
"
							+ "[pc.speech(Ok...)] you reply. [pc.speech(You can use me however you like...)]"
						+ "
"
						+ "
"
							+ "[npc.Name] lets out a lustful [npc.moan], before stepping forwards and wrapping [npc.her] [npc.arms] around your back."
							+ " Giving you an evil grin, [npc.she] hungrily licks [npc.her] [npc.lips], before growling, [npc.speech(This is gonna' be good!)]"
						+ "
")) {
					@Override
					public void effects() {
						Main.game.getTextStartStringBuilder().append(Main.game.getPlayer().incrementMoney(moneyPool/2));
					}
				};
			}
			return null;
		}
	};

	private static final DialogueNode END_LOSS_SEX = new DialogueNode("Finished", "", true) {

		@Override
		public String getContent() {
			return UtilText.parse(gambler,
					"
"
						+ "[npc.Name] steps away from you, sighing, [npc.speech(You're a pretty good fuck. Perhaps you could make a living out of whoring yourself out? You're no good at dice poker, that's for sure.)]"
					+ "
"
					+ "
"
						+ "As the crowd laughs along with [npc.name] as [npc.she] gives you that advice, you quickly gather your things and hurry off, determined to do better at dice poker the next time you play..."
					+ "
");
		}

		@Override
		public Response getResponse(int responseTab, int index) {
			if(index==1) {
				return new Response("Continue", "Step away from the table.", endingNode) {
					@Override
					public void effects() {
						progress = 0;
					}
				};
			}
			return null;
		}
	};
}


code:
package com.lilithsthrone.game.dialogue.places.submission.dicePoker;

import com.lilithsthrone.utils.Colour;

/**
 * @since 0.2.6
 * @version 0.2.6
 * @author Innoxia
 */
public enum DicePokerTable {

	COPPER("copper", 500, 250, Colour.CLOTHING_COPPER),
	SILVER("silver", 2500, 1000, Colour.CLOTHING_SILVER),
	GOLD("gold", 10000, 5000, Colour.CLOTHING_GOLD);

	private String name;
	private Colour colour;
	private int initialBet;
	private int raiseAmount;

	private DicePokerTable(String name, int initialBet, int raiseAmount, Colour colour) {
		this.name = name;
		this.colour = colour;
		this.initialBet = initialBet;
		this.raiseAmount = raiseAmount;
	}

	public String getName() {
		return name;
	}

	public int getInitialBet() {
		return initialBet;
	}

	public int getRaiseAmount() {
		return raiseAmount;
	}

	public Colour getColour() {
		return colour;
	}
}


code:
package com.lilithsthrone.game.dialogue.places.submission.dicePoker;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

/**
 * @since 0.2.6
 * @version 0.2.6
 * @author Innoxia
 */
public enum Hand {

	ONE_FIVE_OF_A_KIND(1, "Five of a kind", "33333", "Five dice of the same value."),
	TWO_FOUR_OF_A_KIND(2, "Four of a kind", "55551", "Four dice of the same value."),
	THREE_HIGH_STRAIGHT(3, "High straight", "23456", "Consecutive numbers starting at two."),
	FOUR_FULL_HOUSE(4, "Full house", "22666", "Two dice of the same value, plus three dice of a different, same value."),
	FIVE_THREE_OF_A_KIND(5, "Three of a kind", "44415", "Three dice of the same value."),
	SIX_LOW_STRAIGHT(6, "Low straight", "12345", "Consecutive numbers starting at one."),
	SEVEN_TWO_PAIR(7, "Two pair", "55331", "Two dice of the same value, plus two dice of a different, same value."),
	EIGHT_PAIR(8, "Pair", "22415", "Two dice of the same value."),
	NINE_RUNT(9, "Runt", "13456", "All dice of different values.");

	private int ranking;
	private String name;
	private String example;
	private String exampleDescription;

	private Hand(int ranking, String name, String example, String exampleDescription) {
		this.ranking = ranking;
		this.name = name;
		this.example = example;
		this.exampleDescription = exampleDescription;
	}

	/**
	 * @return negative value for player losing, 0 for draw, positive value for player winning
	 */
	public static int compareHands(List<Dice> playerDice, List<Dice> gamblerDice) {
		Hand playerHand = getHand(playerDice);
		Hand gamblerHand = getHand(gamblerDice);

		if(playerHand.getRanking()==gamblerHand.getRanking()) {
			return  getValue(playerDice) - getValue(gamblerDice);
		}

		return gamblerHand.getRanking() - playerHand.getRanking();
	}

	public static Hand getHand(List<Dice> dice) {
		Map<DiceFace, Integer> faceCount = new HashMap<>();
		for(Dice d : dice) {
			faceCount.putIfAbsent(d.getFace(), 0);
			faceCount.put(d.getFace(), faceCount.get(d.getFace())+1);
		}

		if(faceCount.size()==1) {
			return Hand.ONE_FIVE_OF_A_KIND;

		} else if(faceCount.containsValue(4)) {
			return Hand.TWO_FOUR_OF_A_KIND;

		} else if(faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)
				&& faceCount.containsKey(DiceFace.SIX)) {
			return Hand.THREE_HIGH_STRAIGHT;

		} else if(faceCount.containsValue(2) && faceCount.containsValue(3)) {
			return Hand.FOUR_FULL_HOUSE;

		} else if(faceCount.containsValue(3)) {
			return Hand.FIVE_THREE_OF_A_KIND;

		} else if(faceCount.containsKey(DiceFace.ONE)
				&& faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)) {
			return Hand.SIX_LOW_STRAIGHT;

		} else if(faceCount.containsValue(2) && faceCount.size()==3) {
			return Hand.SEVEN_TWO_PAIR;

		} else if(faceCount.containsValue(2)) {
			return Hand.EIGHT_PAIR;
		}

		return Hand.NINE_RUNT;
	}

	public static List<Dice> getDiceInHand(List<Dice> dice) {
		List<Dice> diceInHand = new ArrayList<>(dice);
		Map<DiceFace, Integer> faceCount = new HashMap<>();
		for(Dice d : dice) {
			faceCount.putIfAbsent(d.getFace(), 0);
			faceCount.put(d.getFace(), faceCount.get(d.getFace())+1);
		}

		if(faceCount.size()==1) {

		} else if(faceCount.containsValue(4)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()!=4) {
					diceInHand.removeIf((d)->d.getFace()==entry.getKey());
				}
			}

		} else if(faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)
				&& faceCount.containsKey(DiceFace.SIX)) {

		} else if(faceCount.containsValue(2) && faceCount.containsValue(3)) {

		} else if(faceCount.containsValue(3)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()!=3) {
					diceInHand.removeIf((d)->d.getFace()==entry.getKey());
				}
			}

		} else if(faceCount.containsKey(DiceFace.ONE)
				&& faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)) {

		} else if(faceCount.containsValue(2) && faceCount.size()==3) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()!=2) {
					diceInHand.removeIf((d)->d.getFace()==entry.getKey());
				}
			}

		} else if(faceCount.containsValue(2)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()!=2) {
					diceInHand.removeIf((d)->d.getFace()==entry.getKey());
				}
			}
		}

		return diceInHand;
	}

	public static int getValue(List<Dice> dice) {
		Map<DiceFace, Integer> faceCount = new HashMap<>();
		for(Dice d : dice) {
			faceCount.putIfAbsent(d.getFace(), 0);
			faceCount.put(d.getFace(), faceCount.get(d.getFace())+1);
		}

		if(faceCount.size()==1) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				return entry.getKey().getValue()*5;
			}

		} else if(faceCount.containsValue(4)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()==4) {
					return entry.getKey().getValue()*4;
				}
			}

		} else if(faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)
				&& faceCount.containsKey(DiceFace.SIX)) {
			return 2+3+4+5+6;

		} else if(faceCount.containsValue(2) && faceCount.containsValue(3)) {
			int total=0;
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				total += entry.getKey().getValue()*entry.getValue();
			}
			return total;

		} else if(faceCount.containsValue(3)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()==3) {
					return entry.getKey().getValue()*3;
				}
			}

		} else if(faceCount.containsKey(DiceFace.ONE)
				&& faceCount.containsKey(DiceFace.TWO)
				&& faceCount.containsKey(DiceFace.THREE)
				&& faceCount.containsKey(DiceFace.FOUR)
				&& faceCount.containsKey(DiceFace.FIVE)) {
			return 1+2+3+4+5;

		} else if(faceCount.containsValue(2) && faceCount.size()==3) {
			int total=0;
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()==2) {
					total+= entry.getKey().getValue()*2;
				}
			}
			return total;

		} else if(faceCount.containsValue(2)) {
			for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
				if(entry.getValue()==2) {
					return entry.getKey().getValue()*2;
				}
			}
		}

		int total=0;
		for(Entry<DiceFace, Integer> entry : faceCount.entrySet()) {
			total += entry.getKey().getValue()*entry.getValue();
		}
		return total;
	}

	public int getRanking() {
		return ranking;
	}

	public String getName() {
		return name;
	}

	public String getExample() {
		return example;
	}

	public String getExampleDescription() {
		return exampleDescription;
	}

}