Zone unlocking tweak
This commit is contained in:
@@ -1191,11 +1191,11 @@ public class Blocks implements ContentList{
|
||||
);
|
||||
size = 2;
|
||||
recoil = 0f;
|
||||
reload = 3f;
|
||||
reload = 2f;
|
||||
inaccuracy = 5f;
|
||||
shootCone = 50f;
|
||||
shootEffect = Fx.shootLiquid;
|
||||
range = 100f;
|
||||
range = 110f;
|
||||
health = 250*size*size;
|
||||
|
||||
drawer = (tile, entity) -> {
|
||||
|
||||
@@ -170,8 +170,8 @@ public class Control implements ApplicationListener{
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(ZoneCompleteEvent.class, e -> {
|
||||
ui.hudfrag.showToast(Core.bundle.format("zone.complete", e.zone.conditionWave));
|
||||
Events.on(ZoneRequireCompleteEvent.class, e -> {
|
||||
ui.hudfrag.showToast(Core.bundle.format("zone.requirement.complete", state.wave, e.zone.localizedName));
|
||||
});
|
||||
|
||||
Events.on(ZoneConfigureCompleteEvent.class, e -> {
|
||||
|
||||
@@ -20,7 +20,7 @@ public class LiquidBulletType extends BulletType{
|
||||
Liquid liquid;
|
||||
|
||||
public LiquidBulletType(Liquid liquid){
|
||||
super(2.8f, 0);
|
||||
super(3.5f, 0);
|
||||
this.liquid = liquid;
|
||||
|
||||
lifetime = 74f;
|
||||
|
||||
@@ -10,11 +10,12 @@ import io.anuke.mindustry.world.Tile;
|
||||
public class EventType{
|
||||
|
||||
/**Called when a zone's requirements are met.*/
|
||||
public static class ZoneCompleteEvent implements Event{
|
||||
public final Zone zone;
|
||||
public static class ZoneRequireCompleteEvent implements Event{
|
||||
public final Zone zone, required;
|
||||
|
||||
public ZoneCompleteEvent(Zone zone){
|
||||
public ZoneRequireCompleteEvent(Zone zone, Zone required){
|
||||
this.zone = zone;
|
||||
this.required = required;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ import io.anuke.arc.function.Consumer;
|
||||
import io.anuke.arc.function.Supplier;
|
||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.util.Structs;
|
||||
import io.anuke.mindustry.content.Loadouts;
|
||||
import io.anuke.mindustry.game.EventType.ZoneCompleteEvent;
|
||||
import io.anuke.mindustry.game.EventType.ZoneConfigureCompleteEvent;
|
||||
import io.anuke.mindustry.game.EventType.ZoneRequireCompleteEvent;
|
||||
import io.anuke.mindustry.game.Rules;
|
||||
import io.anuke.mindustry.game.UnlockableContent;
|
||||
import io.anuke.mindustry.maps.generators.Generator;
|
||||
@@ -17,8 +19,7 @@ import io.anuke.mindustry.world.Block;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static io.anuke.mindustry.Vars.data;
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Zone extends UnlockableContent{
|
||||
public final Generator generator;
|
||||
@@ -29,7 +30,7 @@ public class Zone extends UnlockableContent{
|
||||
public Supplier<Rules> rules = Rules::new;
|
||||
public boolean alwaysUnlocked;
|
||||
public int conditionWave = Integer.MAX_VALUE;
|
||||
public int configureWave = 10;
|
||||
public int configureWave = 15;
|
||||
public int launchPeriod = 10;
|
||||
public Loadout loadout = Loadouts.basicShard;
|
||||
|
||||
@@ -67,12 +68,15 @@ public class Zone extends UnlockableContent{
|
||||
Core.settings.put(name + "-wave", wave);
|
||||
data.modified();
|
||||
|
||||
if(wave == conditionWave + 1){
|
||||
Events.fire(new ZoneCompleteEvent(this));
|
||||
for(Zone zone : content.zones()){
|
||||
ZoneRequirement req = Structs.find(zone.zoneRequirements, f -> f.zone == this);
|
||||
if(req != null && wave == req.wave + 1){
|
||||
Events.fire(new ZoneRequireCompleteEvent(zone, this));
|
||||
}
|
||||
}
|
||||
|
||||
if(wave == configureWave + 1){
|
||||
// Events.fire(new ZoneConfigureCompleteEvent(this));
|
||||
Events.fire(new ZoneConfigureCompleteEvent(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,6 +455,7 @@ public class HudFragment extends Fragment{
|
||||
}else{
|
||||
builder.append(enemiesf.get(state.enemies()));
|
||||
}
|
||||
builder.append("\n");
|
||||
}
|
||||
|
||||
if(state.rules.waveTimer){
|
||||
|
||||
Reference in New Issue
Block a user