feat: killer/survivor win conditions with title announcements, fix forcestart reset bug
This commit is contained in:
parent
78fc8bfb55
commit
d59b965407
4 changed files with 95 additions and 24 deletions
|
|
@ -10,20 +10,34 @@ public class RoleAssignPhase implements Phase {
|
|||
private final RoleAssigner assigner;
|
||||
private int ticksLeft;
|
||||
private boolean complete;
|
||||
private final boolean skipDelay;
|
||||
|
||||
public RoleAssignPhase(RoleAssigner assigner) {
|
||||
this(assigner, false);
|
||||
}
|
||||
|
||||
public RoleAssignPhase(RoleAssigner assigner, boolean skipDelay) {
|
||||
this.assigner = assigner;
|
||||
this.complete = false;
|
||||
this.skipDelay = skipDelay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enter(GameSession session) {
|
||||
ticksLeft = session.getConfig().getRoleAssignDelay() * 20;
|
||||
if (skipDelay) {
|
||||
ticksLeft = 0;
|
||||
} else {
|
||||
ticksLeft = session.getConfig().getRoleAssignDelay() * 20;
|
||||
}
|
||||
assigner.assignRoles(session);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(GameSession session) {
|
||||
if (skipDelay) {
|
||||
complete = true;
|
||||
return;
|
||||
}
|
||||
ticksLeft--;
|
||||
if (ticksLeft <= 0) {
|
||||
complete = true;
|
||||
|
|
@ -39,4 +53,4 @@ public class RoleAssignPhase implements Phase {
|
|||
public boolean isComplete() {
|
||||
return complete;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue