mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-30 20:21:45 +01:00
Finished Stage time delay
Remove system prints
This commit is contained in:
parent
028e33f7cf
commit
bcf8cee6fe
@ -101,93 +101,25 @@ public class Quester {
|
||||
|
||||
public LinkedList<String> getObjectives() {
|
||||
|
||||
LinkedList<String> unfinishedObjectives = new LinkedList<String>();
|
||||
LinkedList<String> finishedObjectives = new LinkedList<String>();
|
||||
LinkedList<String> objectives = new LinkedList<String>();
|
||||
if(delayStartTime == 0){
|
||||
|
||||
LinkedList<String> unfinishedObjectives = new LinkedList<String>();
|
||||
LinkedList<String> finishedObjectives = new LinkedList<String>();
|
||||
LinkedList<String> objectives = new LinkedList<String>();
|
||||
|
||||
for (Entry e : currentStage.blocksToDamage.entrySet()) {
|
||||
for (Entry e : currentStage.blocksToDamage.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksDamaged.entrySet()) {
|
||||
for (Entry e2 : blocksDamaged.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Damage " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + (Integer) e2.getValue() + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Damage " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.blocksToBreak.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksBroken.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Break " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Break " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.blocksToPlace.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksPlaced.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Place " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Place " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.itemsToCollect.entrySet()) {
|
||||
|
||||
Map<Material, Integer> map = (Map<Material, Integer>) e.getKey();
|
||||
|
||||
for (Entry e2 : map.entrySet()) {
|
||||
|
||||
for (Entry e3 : itemsCollected.entrySet()) {
|
||||
|
||||
if (((Material) e3.getKey()).equals((Material) e2.getKey())) {
|
||||
|
||||
if (((Integer) e3.getValue()) < ((Integer) e2.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Collect " + Quester.prettyItemString(((Material) e3.getKey()).getId()) + ": " + ((Integer) e3.getValue()) + "/" + ((Integer) e2.getValue()));
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Damage " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + (Integer) e2.getValue() + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Collect " + Quester.prettyItemString(((Material) e3.getKey()).getId()) + ": " + ((Integer) e3.getValue()) + "/" + ((Integer) e2.getValue()));
|
||||
finishedObjectives.add(ChatColor.GRAY + "Damage " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
@ -197,143 +129,20 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
for (Entry e : currentStage.blocksToBreak.entrySet()) {
|
||||
|
||||
for (Entry e : currentStage.blocksToUse.entrySet()) {
|
||||
for (Entry e2 : blocksBroken.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksUsed.entrySet()) {
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Break " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Use " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Use " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.blocksToCut.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksCut.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Cut " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Cut " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (currentStage.fishToCatch != null) {
|
||||
|
||||
if (fishCaught < currentStage.fishToCatch) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Catch Fish: " + fishCaught + "/" + currentStage.fishToCatch);
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Catch Fish: " + fishCaught + "/" + currentStage.fishToCatch);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Map set;
|
||||
Map set2;
|
||||
Set<Enchantment> enchantSet;
|
||||
Set<Enchantment> enchantSet2;
|
||||
Collection<Material> matSet;
|
||||
Enchantment enchantment = null;
|
||||
Enchantment enchantment2 = null;
|
||||
Material mat = null;
|
||||
int num1;
|
||||
int num2;
|
||||
|
||||
for (Entry e : currentStage.itemsToEnchant.entrySet()) {
|
||||
|
||||
for (Entry e2 : itemsEnchanted.entrySet()) {
|
||||
|
||||
set = (Map<Enchantment, Material>) e2.getKey();
|
||||
set2 = (Map<Enchantment, Material>) e.getKey();
|
||||
enchantSet = (Set<Enchantment>) set.keySet();
|
||||
enchantSet2 = (Set<Enchantment>) set2.keySet();
|
||||
for (Object o : enchantSet.toArray()) {
|
||||
|
||||
enchantment = (Enchantment) o;
|
||||
|
||||
}
|
||||
for (Object o : enchantSet2.toArray()) {
|
||||
|
||||
enchantment2 = (Enchantment) o;
|
||||
|
||||
}
|
||||
num1 = (Integer) e2.getValue();
|
||||
num2 = (Integer) e.getValue();
|
||||
|
||||
matSet = (Collection<Material>) set.values();
|
||||
|
||||
for (Object o : matSet.toArray()) {
|
||||
|
||||
mat = (Material) o;
|
||||
|
||||
}
|
||||
|
||||
if (enchantment2 == enchantment) {
|
||||
|
||||
if (num1 < num2) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Enchant " + Quester.prettyItemString(mat.getId()) + " with " + Quester.prettyEnchantmentString(enchantment) + ": " + num1 + "/" + num2);
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Enchant " + Quester.prettyItemString(mat.getId()) + " with " + Quester.prettyEnchantmentString(enchantment) + ": " + num1 + "/" + num2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (EntityType e : currentStage.mobsToKill) {
|
||||
|
||||
for (EntityType e2 : mobsKilled) {
|
||||
|
||||
if (e == e2) {
|
||||
|
||||
if (mobNumKilled.get(mobsKilled.indexOf(e2)) < currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))) {
|
||||
|
||||
if (currentStage.locationsToKillWithin.isEmpty()) {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + Quester.prettyMobString(e) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
} else {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + Quester.prettyMobString(e) + " at " + currentStage.areaNames.get(currentStage.mobsToKill.indexOf(e)) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
}
|
||||
} else {
|
||||
|
||||
if (currentStage.locationsToKillWithin.isEmpty()) {
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + Quester.prettyMobString(e) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
} else {
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + Quester.prettyMobString(e) + " at " + currentStage.areaNames.get(currentStage.mobsToKill.indexOf(e)) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
finishedObjectives.add(ChatColor.GRAY + "Break " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -342,35 +151,21 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
for (Entry e : currentStage.blocksToPlace.entrySet()) {
|
||||
|
||||
if (currentStage.playersToKill != null) {
|
||||
for (Entry e2 : blocksPlaced.entrySet()) {
|
||||
|
||||
if (playersKilled < currentStage.playersToKill) {
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill a Player: " + playersKilled + "/" + currentStage.playersToKill);
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
} else {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Place " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill a Player: " + playersKilled + "/" + currentStage.playersToKill);
|
||||
} else {
|
||||
|
||||
}
|
||||
finishedObjectives.add(ChatColor.GRAY + "Place " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
for (NPC n : currentStage.citizensToInteract) {
|
||||
|
||||
for (Entry e : citizensInteracted.entrySet()) {
|
||||
|
||||
if (((NPC) e.getKey()).equals(n)) {
|
||||
|
||||
if (((Boolean) e.getValue()) == false) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Talk to " + n.getFullName());
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Talk to " + n.getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -378,39 +173,143 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
for (Entry e : currentStage.itemsToCollect.entrySet()) {
|
||||
|
||||
for (NPC n : currentStage.citizensToKill) {
|
||||
Map<Material, Integer> map = (Map<Material, Integer>) e.getKey();
|
||||
|
||||
for (NPC n2 : citizensKilled) {
|
||||
for (Entry e2 : map.entrySet()) {
|
||||
|
||||
if (citizenNumKilled.get(citizensKilled.indexOf(n2)) < currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n))) {
|
||||
for (Entry e3 : itemsCollected.entrySet()) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + n.getFullName() + ChatColor.GREEN + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)) + "/" + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)));
|
||||
if (((Material) e3.getKey()).equals((Material) e2.getKey())) {
|
||||
|
||||
if (((Integer) e3.getValue()) < ((Integer) e2.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Collect " + Quester.prettyItemString(((Material) e3.getKey()).getId()) + ": " + ((Integer) e3.getValue()) + "/" + ((Integer) e2.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Collect " + Quester.prettyItemString(((Material) e3.getKey()).getId()) + ": " + ((Integer) e3.getValue()) + "/" + ((Integer) e2.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.blocksToUse.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksUsed.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Use " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Use " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.blocksToCut.entrySet()) {
|
||||
|
||||
for (Entry e2 : blocksCut.entrySet()) {
|
||||
|
||||
if (((Material) e2.getKey()).equals((Material) e.getKey())) {
|
||||
|
||||
if (((Integer) e2.getValue()) < ((Integer) e.getValue())) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Cut " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Cut " + Quester.prettyItemString(((Material) e2.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (currentStage.fishToCatch != null) {
|
||||
|
||||
if (fishCaught < currentStage.fishToCatch) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Catch Fish: " + fishCaught + "/" + currentStage.fishToCatch);
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + n.getName() + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)) + "/" + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)));
|
||||
finishedObjectives.add(ChatColor.GRAY + "Catch Fish: " + fishCaught + "/" + currentStage.fishToCatch);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Map set;
|
||||
Map set2;
|
||||
Set<Enchantment> enchantSet;
|
||||
Set<Enchantment> enchantSet2;
|
||||
Collection<Material> matSet;
|
||||
Enchantment enchantment = null;
|
||||
Enchantment enchantment2 = null;
|
||||
Material mat = null;
|
||||
int num1;
|
||||
int num2;
|
||||
|
||||
for (Entry e : currentStage.mobsToTame.entrySet()) {
|
||||
for (Entry e : currentStage.itemsToEnchant.entrySet()) {
|
||||
|
||||
for (Entry e2 : mobsTamed.entrySet()) {
|
||||
for (Entry e2 : itemsEnchanted.entrySet()) {
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
set = (Map<Enchantment, Material>) e2.getKey();
|
||||
set2 = (Map<Enchantment, Material>) e.getKey();
|
||||
enchantSet = (Set<Enchantment>) set.keySet();
|
||||
enchantSet2 = (Set<Enchantment>) set2.keySet();
|
||||
for (Object o : enchantSet.toArray()) {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
enchantment = (Enchantment) o;
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Tame " + getCapitalized(((EntityType) e.getKey()).getName()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
}
|
||||
for (Object o : enchantSet2.toArray()) {
|
||||
|
||||
} else {
|
||||
enchantment2 = (Enchantment) o;
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Tame " + getCapitalized(((EntityType) e.getKey()).getName()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
}
|
||||
num1 = (Integer) e2.getValue();
|
||||
num2 = (Integer) e.getValue();
|
||||
|
||||
matSet = (Collection<Material>) set.values();
|
||||
|
||||
for (Object o : matSet.toArray()) {
|
||||
|
||||
mat = (Material) o;
|
||||
|
||||
}
|
||||
|
||||
if (enchantment2 == enchantment) {
|
||||
|
||||
if (num1 < num2) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Enchant " + Quester.prettyItemString(mat.getId()) + " with " + Quester.prettyEnchantmentString(enchantment) + ": " + num1 + "/" + num2);
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Enchant " + Quester.prettyItemString(mat.getId()) + " with " + Quester.prettyEnchantmentString(enchantment) + ": " + num1 + "/" + num2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -418,21 +317,28 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
for (EntityType e : currentStage.mobsToKill) {
|
||||
|
||||
for (Entry e : currentStage.sheepToShear.entrySet()) {
|
||||
for (EntityType e2 : mobsKilled) {
|
||||
|
||||
for (Entry e2 : sheepSheared.entrySet()) {
|
||||
if (e == e2) {
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
if (mobNumKilled.get(mobsKilled.indexOf(e2)) < currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))) {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
if (currentStage.locationsToKillWithin.isEmpty()) {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + Quester.prettyMobString(e) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
} else {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + Quester.prettyMobString(e) + " at " + currentStage.areaNames.get(currentStage.mobsToKill.indexOf(e)) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
}
|
||||
} else {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Shear " + ((DyeColor) e.getKey()).name().toString().toLowerCase() + " sheep: " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
if (currentStage.locationsToKillWithin.isEmpty()) {
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + Quester.prettyMobString(e) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
} else {
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + Quester.prettyMobString(e) + " at " + currentStage.areaNames.get(currentStage.mobsToKill.indexOf(e)) + ": " + (mobNumKilled.get(mobsKilled.indexOf(e2))) + "/" + (currentStage.mobNumToKill.get(currentStage.mobsToKill.indexOf(e))));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Shear " + ((DyeColor) e.getKey()).name().toString().toLowerCase() + " sheep: " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -440,21 +346,35 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (currentStage.playersToKill != null) {
|
||||
|
||||
for (Entry e : currentStage.itemsToCraft.entrySet()) {
|
||||
if (playersKilled < currentStage.playersToKill) {
|
||||
|
||||
for (Entry e2 : itemsCrafted.entrySet()) {
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill a Player: " + playersKilled + "/" + currentStage.playersToKill);
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
} else {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill a Player: " + playersKilled + "/" + currentStage.playersToKill);
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Craft " + prettyItemString(((Material) e.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Craft " + prettyItemString(((Material) e.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
for (NPC n : currentStage.citizensToInteract) {
|
||||
|
||||
for (Entry e : citizensInteracted.entrySet()) {
|
||||
|
||||
if (((NPC) e.getKey()).equals(n)) {
|
||||
|
||||
if (((Boolean) e.getValue()) == false) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Talk to " + n.getFullName());
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Talk to " + n.getName());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -462,21 +382,17 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
for (NPC n : currentStage.citizensToKill) {
|
||||
|
||||
for (Location l : currentStage.locationsToReach) {
|
||||
for (NPC n2 : citizensKilled) {
|
||||
|
||||
for (Location l2 : locationsReached) {
|
||||
if (citizenNumKilled.get(citizensKilled.indexOf(n2)) < currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n))) {
|
||||
|
||||
if (l.equals(l2)) {
|
||||
|
||||
if (hasReached.get(locationsReached.indexOf(l2)) == false) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Go to " + currentStage.locationNames.get(currentStage.locationsToReach.indexOf(l)));
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Kill " + n.getFullName() + ChatColor.GREEN + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)) + "/" + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Go to " + currentStage.locationNames.get(currentStage.locationsToReach.indexOf(l)));
|
||||
finishedObjectives.add(ChatColor.GRAY + "Kill " + n.getName() + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)) + "/" + currentStage.citizenNumToKill.get(currentStage.citizensToKill.indexOf(n)));
|
||||
|
||||
}
|
||||
|
||||
@ -484,13 +400,125 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.mobsToTame.entrySet()) {
|
||||
|
||||
for (Entry e2 : mobsTamed.entrySet()) {
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Tame " + getCapitalized(((EntityType) e.getKey()).getName()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Tame " + getCapitalized(((EntityType) e.getKey()).getName()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.sheepToShear.entrySet()) {
|
||||
|
||||
for (Entry e2 : sheepSheared.entrySet()) {
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Shear " + ((DyeColor) e.getKey()).name().toString().toLowerCase() + " sheep: " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Shear " + ((DyeColor) e.getKey()).name().toString().toLowerCase() + " sheep: " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Entry e : currentStage.itemsToCraft.entrySet()) {
|
||||
|
||||
for (Entry e2 : itemsCrafted.entrySet()) {
|
||||
|
||||
if (e.getKey().equals(e2.getKey())) {
|
||||
|
||||
if ((Integer) e2.getValue() < (Integer) e.getValue()) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Craft " + prettyItemString(((Material) e.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Craft " + prettyItemString(((Material) e.getKey()).getId()) + ": " + ((Integer) e2.getValue()) + "/" + ((Integer) e.getValue()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (Location l : currentStage.locationsToReach) {
|
||||
|
||||
for (Location l2 : locationsReached) {
|
||||
|
||||
if (l.equals(l2)) {
|
||||
|
||||
if (hasReached.get(locationsReached.indexOf(l2)) == false) {
|
||||
|
||||
unfinishedObjectives.add(ChatColor.GREEN + "Go to " + currentStage.locationNames.get(currentStage.locationsToReach.indexOf(l)));
|
||||
|
||||
} else {
|
||||
|
||||
finishedObjectives.add(ChatColor.GRAY + "Go to " + currentStage.locationNames.get(currentStage.locationsToReach.indexOf(l)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
objectives.addAll(unfinishedObjectives);
|
||||
objectives.addAll(finishedObjectives);
|
||||
|
||||
return objectives;
|
||||
|
||||
}else{
|
||||
|
||||
long time;
|
||||
if(delayTimeLeft > -1)
|
||||
time = delayTimeLeft - (System.currentTimeMillis() - delayStartTime);
|
||||
else
|
||||
time = currentStage.delay - (System.currentTimeMillis() - delayStartTime);
|
||||
|
||||
LinkedList<String> obj = new LinkedList<String>();
|
||||
String s;
|
||||
|
||||
if(currentStage.delayMessage != null){
|
||||
|
||||
s = currentStage.delayMessage;
|
||||
|
||||
s = plugin.parseString(s, currentQuest);
|
||||
s = s.replaceAll("<time>", Quests.getTime(time));
|
||||
|
||||
}else
|
||||
s = ChatColor.YELLOW + "Wait " + ChatColor.DARK_PURPLE + Quests.getTime(time) + ChatColor.YELLOW + ".";
|
||||
|
||||
obj.add(s);
|
||||
return obj;
|
||||
|
||||
}
|
||||
|
||||
objectives.addAll(unfinishedObjectives);
|
||||
objectives.addAll(finishedObjectives);
|
||||
|
||||
return objectives;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public boolean hasObjective(String s) {
|
||||
@ -2571,11 +2599,14 @@ public class Quester {
|
||||
|
||||
public void startStageTimer(){
|
||||
|
||||
if(delayTimeLeft > -1)
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StageTimer(plugin, this), delayTimeLeft*50);
|
||||
else
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StageTimer(plugin, this), currentStage.delay);
|
||||
|
||||
if(delayTimeLeft > -1){
|
||||
System.out.println("Starting a new timer.");
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StageTimer(plugin, this), delayTimeLeft/50);
|
||||
}else{
|
||||
System.out.println("Resuming timer.");
|
||||
System.out.println("Delay: " + currentStage.delay/50 + " ticks. (" + (currentStage.delay/1000) + " seconds)");
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new StageTimer(plugin, this), currentStage.delay/50);
|
||||
}
|
||||
delayStartTime = System.currentTimeMillis();
|
||||
|
||||
}
|
||||
|
@ -295,7 +295,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
|
||||
if (getQuester(cs.getName()).currentQuest != null) {
|
||||
|
||||
cs.sendMessage(ChatColor.GOLD + "---(Objectives)---");
|
||||
if(getQuester(cs.getName()).delayStartTime == 0)
|
||||
cs.sendMessage(ChatColor.GOLD + "---(Objectives)---");
|
||||
|
||||
for (String s : getQuester(cs.getName()).getObjectives()) {
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class Stage {
|
||||
String script;
|
||||
Event event;
|
||||
long delay = -1;
|
||||
String delayMessage = "";
|
||||
String delayMessage = null;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
@ -238,8 +238,15 @@ public class Stage {
|
||||
if(other.delay != delay)
|
||||
return false;
|
||||
|
||||
if(other.delayMessage.equalsIgnoreCase(delayMessage) == false)
|
||||
if (other.delayMessage != null && delayMessage != null) {
|
||||
if (other.delayMessage.equals(delayMessage) == false) {
|
||||
return false;
|
||||
}
|
||||
} else if (other.delayMessage != null && delayMessage == null) {
|
||||
return false;
|
||||
} else if (other.delayMessage == null && delayMessage != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,12 +18,15 @@ public class StageTimer implements Runnable{
|
||||
@Override
|
||||
public void run(){
|
||||
|
||||
System.out.println("Running.");
|
||||
if(quester.delayOver){
|
||||
|
||||
System.out.println("Delay is over.");
|
||||
Player player = plugin.getServer().getPlayerExact(quester.name);
|
||||
|
||||
if(quester.currentQuest.stages.indexOf(quester.currentStage) == (quester.currentQuest.stages.size() - 1)){
|
||||
|
||||
System.out.println("Quester is finished Quest.");
|
||||
if(quester.currentStage.script != null)
|
||||
plugin.trigger.parseQuestTaskTrigger(quester.currentStage.script, player);
|
||||
if(quester.currentStage.event != null)
|
||||
@ -33,6 +36,7 @@ public class StageTimer implements Runnable{
|
||||
|
||||
}else {
|
||||
|
||||
System.out.println("Quester is not finished Quest.");
|
||||
quester.reset();
|
||||
player.sendMessage(plugin.parseString(quester.currentStage.finished, quester.currentQuest));
|
||||
if(quester.currentStage.script != null)
|
||||
@ -41,7 +45,9 @@ public class StageTimer implements Runnable{
|
||||
quester.currentStage.event.happen(player);
|
||||
quester.currentStage = quester.currentQuest.stages.get(quester.currentQuest.stages.indexOf(quester.currentStage) + 1);
|
||||
quester.addEmpties();
|
||||
|
||||
quester.delayStartTime = 0;
|
||||
quester.delayTimeLeft = -1;
|
||||
|
||||
player.sendMessage(ChatColor.GOLD + "---(Objectives)---");
|
||||
for(String s : quester.getObjectives()){
|
||||
|
||||
@ -51,8 +57,7 @@ public class StageTimer implements Runnable{
|
||||
|
||||
}
|
||||
|
||||
quester.delayStartTime = 0;
|
||||
quester.delayTimeLeft = -1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user