Unstable commit

This commit is contained in:
Blackvein 2012-10-16 12:31:21 -07:00
parent 67f01ce4b6
commit c211496a2b
2 changed files with 49 additions and 23 deletions

View File

@ -102,7 +102,7 @@ public class QuestFactory implements ConversationAbandonedListener {
public CreateMenuPrompt(){
super("1", "2", "3", "4", "5", "6");
super("1", "2", "3", "4", "5", "6", "7", "8", "9");
}
@ -125,50 +125,50 @@ public class QuestFactory implements ConversationAbandonedListener {
text += BLUE + "" + BOLD + "3" + RESET + YELLOW + " - Set finish message (\"" + context.getSessionData("finishMessage") + "\")\n";
if(context.getSessionData("redoDelay") == null)
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (None set)";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (None set)\n";
else
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (" + Quests.getTime((Long)context.getSessionData("redoDelay")) + ")";
text += BLUE + "" + BOLD + "4" + RESET + YELLOW + " - Set redo delay (" + Quests.getTime((Long)context.getSessionData("redoDelay")) + ")\n";
if(context.getSessionData("npcStart") == null && quests.citizens != null)
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (None set)";
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (None set)\n";
else if(quests.citizens != null)
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (" + quests.citizens.getNPCRegistry().getById((Integer)context.getSessionData("npcStart")).getName() + ")";
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set NPC start (" + quests.citizens.getNPCRegistry().getById((Integer)context.getSessionData("npcStart")).getName() + ")\n";
if(context.getSessionData("blockStart") == null){
if(quests.citizens != null)
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (None set)";
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (None set)\n";
else
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Block start (None set)";
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Block start (None set)\n";
}else{
if(quests.citizens != null){
Location l = (Location) context.getSessionData("blockStart");
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")";
text += BLUE + "" + BOLD + "6" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
}else{
Location l = (Location) context.getSessionData("blockStart");
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")";
text += BLUE + "" + BOLD + "5" + RESET + YELLOW + " - Set Block start (" + l.getWorld().getName() + ", " + l.getBlockX() + ", " + l.getBlockY() + ", " + l.getBlockZ() + ")\n";
}
}
if(quests.citizens != null){
text += BLUE + "" + BOLD + "7" + RESET + DARKAQUA + " - Edit Requirements";
text += BLUE + "" + BOLD + "7" + RESET + DARKAQUA + " - Edit Requirements\n";
}else{
text += BLUE + "" + BOLD + "6" + RESET + DARKAQUA + " - Edit Requirements";
text += BLUE + "" + BOLD + "6" + RESET + DARKAQUA + " - Edit Requirements\n";
}
if(quests.citizens != null){
text += BLUE + "" + BOLD + "8" + RESET + PINK + " - Edit Stages";
text += BLUE + "" + BOLD + "8" + RESET + PINK + " - Edit Stages\n";
}else{
text += BLUE + "" + BOLD + "7" + RESET + PINK + " - Edit Stages";
text += BLUE + "" + BOLD + "7" + RESET + PINK + " - Edit Stages\n";
}
if(quests.citizens != null){
text += BLUE + "" + BOLD + "9" + RESET + GREEN + " - Edit Rewards";
text += BLUE + "" + BOLD + "9" + RESET + GREEN + " - Edit Rewards\n";
}else{
text += BLUE + "" + BOLD + "8" + RESET + GREEN + " - Edit Rewards";
text += BLUE + "" + BOLD + "8" + RESET + GREEN + " - Edit Rewards\n";
}
return text;
@ -204,7 +204,9 @@ public class QuestFactory implements ConversationAbandonedListener {
}else if(input.equalsIgnoreCase("6")){
if(quests.citizens == null){
if(quests.citizens != null){
return new BlockStartPrompt();
}else{
return new RequirementPrompt(quests);
}
@ -212,6 +214,24 @@ public class QuestFactory implements ConversationAbandonedListener {
if(quests.citizens != null){
return new RequirementPrompt(quests);
}else{
//Stage Prompt
}
}else if(input.equalsIgnoreCase("8")){
if(quests.citizens != null){
//Stage Prompt
}else{
//Rewards Prompt
}
}else if(input.equalsIgnoreCase("9")){
if(quests.citizens != null){
//Rewards Prompt
}else{
return new CreateMenuPrompt();
}
}

View File

@ -44,7 +44,7 @@ public class RequirementPrompt extends FixedSetPrompt{
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money requirement (None set)\n";
else{
int moneyReq = (Integer) context.getSessionData("moneyReq");
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money requirement (" + context.getSessionData("moneyReq") + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + " )\n";
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set money requirement (" + context.getSessionData("moneyReq") + " " + (moneyReq > 1 ? Quests.getCurrency(true) : Quests.getCurrency(false)) + ")\n";
}
if(context.getSessionData("questPointsReq") == null)
@ -62,7 +62,7 @@ public class RequirementPrompt extends FixedSetPrompt{
for(int i : ids){
text += GRAY + "\t- " + AQUA + Quester.prettyItemString(i) + YELLOW + " x " + AQUA + amounts.get(ids.indexOf(i));
text += GRAY + " - " + AQUA + Quester.prettyItemString(i) + YELLOW + " x " + AQUA + amounts.get(ids.indexOf(i));
}
}
@ -124,7 +124,7 @@ public class RequirementPrompt extends FixedSetPrompt{
if(input.intValue() < 1){
context.getForWhom().sendRawMessage(RED + "Amount must be greater than 0!");
return new MoneyPrompt();
return new QuestPointsPrompt();
}
context.setSessionData("questPointsReq", input.intValue());
@ -138,7 +138,7 @@ public class RequirementPrompt extends FixedSetPrompt{
public ItemListPrompt(){
super("1", "2", "3", "4");
super("1", "2", "3", "4", "5");
}
@ -156,7 +156,7 @@ public class RequirementPrompt extends FixedSetPrompt{
text += BLUE + "" + BOLD + "1" + RESET + YELLOW + " - Set item IDs\n";
for(Integer i : getItemIds(context)){
text += GRAY + "\t- " + AQUA + Quester.prettyItemString(i);
text += GRAY + " - " + AQUA + Quester.prettyItemString(i) + "\n";
}
@ -167,7 +167,7 @@ public class RequirementPrompt extends FixedSetPrompt{
text += BLUE + "" + BOLD + "2" + RESET + YELLOW + " - Set item amounts\n";
for(Integer i : getItemAmounts(context)){
text += GRAY + "\t- " + AQUA + i;
text += GRAY + " - " + AQUA + i + "\n";
}
@ -194,13 +194,19 @@ public class RequirementPrompt extends FixedSetPrompt{
}else{
return new ItemAmountsPrompt();
}
}else if(input.equalsIgnoreCase("3")){
context.getForWhom().sendRawMessage(YELLOW + "Item requirements cleared.");
context.setSessionData("itemIdReqs", null);
context.setSessionData("itemAmountReqs", null);
return new ItemListPrompt();
}else if(input.equalsIgnoreCase("4")){
return new RequirementPrompt(quests);
if( ((List<Integer>) context.getSessionData("itemIdReqs")).size() == (((List<Integer>) context.getSessionData("itemAmountReqs")).size()) )
return new RequirementPrompt(quests);
else{
context.getForWhom().sendRawMessage(RED + "The item IDs list and item amounts list are not the same size!");
return new ItemListPrompt();
}
}
return null;