mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-16 18:58:01 +07:00
Fixed incorrect game-overs on zone attack maps
This commit is contained in:
@ -15,6 +15,7 @@ import io.anuke.mindustry.game.EventType.*;
|
|||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.game.Teams.TeamData;
|
import io.anuke.mindustry.game.Teams.TeamData;
|
||||||
import io.anuke.mindustry.gen.BrokenBlock;
|
import io.anuke.mindustry.gen.BrokenBlock;
|
||||||
|
import io.anuke.mindustry.gen.Call;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
@ -130,9 +131,14 @@ public class Logic implements ApplicationListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(alive != null && !state.gameOver){
|
if(alive != null && !state.gameOver){
|
||||||
state.gameOver = true;
|
if(world.isZone() && alive == defaultTeam){
|
||||||
|
//in attack maps, a victorious game over is equivalent to a launch
|
||||||
|
Call.launchZone();
|
||||||
|
}else{
|
||||||
Events.fire(new GameOverEvent(alive));
|
Events.fire(new GameOverEvent(alive));
|
||||||
}
|
}
|
||||||
|
state.gameOver = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,6 +160,9 @@ public class Logic implements ApplicationListener{
|
|||||||
world.removeBlock(tile);
|
world.removeBlock(tile);
|
||||||
}
|
}
|
||||||
state.launched = true;
|
state.launched = true;
|
||||||
|
state.gameOver = true;
|
||||||
|
//manually fire game over event now
|
||||||
|
Events.fire(new GameOverEvent(defaultTeam));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,8 @@ public class Zone extends UnlockableContent{
|
|||||||
|
|
||||||
/** Whether this zone has met its condition; if true, the player can leave. */
|
/** Whether this zone has met its condition; if true, the player can leave. */
|
||||||
public boolean metCondition(){
|
public boolean metCondition(){
|
||||||
return state.wave >= conditionWave;
|
//players can't leave in attack mode.
|
||||||
|
return state.wave >= conditionWave && !state.rules.attackMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canConfigure(){
|
public boolean canConfigure(){
|
||||||
|
Reference in New Issue
Block a user