raid creation bugs

This commit is contained in:
Aubri Seebauer committed 2023-04-18 17:25:02 -04:00
1 parent 23f61e99a4
commit 2a733fe867
4 files changed
+28 -13

No files matched your search

@@ -103,7 +103,7 @@ public class Raid {
final boolean side1AreRaiders, final int raidTicks, Player owner) {
this.bukkitId = new int[1];
// this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
this.war = war;
this.raidTicks = raidTicks;
this.raidedTown = raidedTown;
@@ -145,7 +145,7 @@ public class Raid {
public Raid(final War war, final Town raidedTown, final Town gatherTown,
final boolean side1AreRaiders, Player owner) {
this.bukkitId = new int[1];
// this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
this.activeRaiders = activeRaiders == null ? new ArrayList<>() : activeRaiders;
this.war = war;
this.raidTicks = 0;
this.raidedTown = raidedTown;
@@ -198,6 +198,7 @@ public class Raid {
this.bukkitId[0] = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask((Plugin) Main.getInstance(),
getTickLoop(), 0L, incremental);
this.save();
}
@@ -767,6 +768,7 @@ public class Raid {
}
raidTicks += incremental;
//check for end
if (Raid.this.raidTicks >= RaidPhase.END.startTick && Raid.this.phase == RaidPhase.COMBAT) {
Raid.this.phase = RaidPhase.END;
}
@@ -781,6 +783,11 @@ public class Raid {
startCombat();
}
//check and start gather phase
if (Raid.this.raidTicks >= RaidPhase.GATHER.startTick && Raid.this.phase == RaidPhase.GATHER) {
startGather();
}
if (Raid.this.phase == RaidPhase.END) {
//TODO: fix raid scoring
//for raiders to win, they need a significant up from the defenders