This commit is contained in:
Anuken
2019-12-28 11:16:35 -05:00
parent 186a2aaa45
commit c250b1d24a
7 changed files with 45 additions and 39 deletions
+1 -1
View File
@@ -16,5 +16,5 @@ const boolp = method => new Boolp(){get: method}
const cons = method => new Cons(){get: method} const cons = method => new Cons(){get: method}
const prov = method => new Prov(){get: method} const prov = method => new Prov(){get: method}
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer})) const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
Call = Packages.io.anuke.mindustry.gen.Call Call = Packages.mindustry.gen.Call
const Calls = Call //backwards compat const Calls = Call //backwards compat
+1 -1
View File
@@ -18,7 +18,7 @@ const boolp = method => new Boolp(){get: method}
const cons = method => new Cons(){get: method} const cons = method => new Cons(){get: method}
const prov = method => new Prov(){get: method} const prov = method => new Prov(){get: method}
const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer})) const newEffect = (lifetime, renderer) => new Effects.Effect(lifetime, new Effects.EffectRenderer({render: renderer}))
Call = Packages.io.anuke.mindustry.gen.Call Call = Packages.mindustry.gen.Call
const Calls = Call //backwards compat const Calls = Call //backwards compat
importPackage(Packages.arc) importPackage(Packages.arc)
importPackage(Packages.arc.func) importPackage(Packages.arc.func)
+1 -4
View File
@@ -307,10 +307,9 @@ public class Mechs implements ContentList{
super.updateAlt(player); super.updateAlt(player);
if(player.timer.get(Player.timerAbility, effectReload)){ if(player.timer.get(Player.timerAbility, effectReload)){
//wasHealed = false;
Units.nearby(player.getTeam(), player.x, player.y, effectRange, unit -> { Units.nearby(player.getTeam(), player.x, player.y, effectRange, unit -> {
unit.applyEffect(StatusEffects.overdrive, effectDuration); //unit.applyEffect(StatusEffects.overdrive, effectDuration);
}); });
indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> { indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> {
@@ -318,9 +317,7 @@ public class Mechs implements ContentList{
Effects.effect(Fx.healBlockFull, Pal.heal, other.drawx(), other.drawy(), other.block().size); Effects.effect(Fx.healBlockFull, Pal.heal, other.drawx(), other.drawy(), other.block().size);
}); });
//if(wasHealed){
Effects.effect(Fx.overdriveWave, player); Effects.effect(Fx.overdriveWave, player);
//}
} }
} }
}; };
+1 -1
View File
@@ -385,7 +385,7 @@ public class NetClient implements ApplicationListener{
netClient.byteStream.setBytes(net.decompressSnapshot(coreData, coreDataLen)); netClient.byteStream.setBytes(net.decompressSnapshot(coreData, coreDataLen));
DataInputStream input = netClient.dataStream; DataInputStream input = netClient.dataStream;
byte cores = input.readByte(); int cores = input.readInt();
for(int i = 0; i < cores; i++){ for(int i = 0; i < cores; i++){
int pos = input.readInt(); int pos = input.readInt();
Tile tile = world.tile(pos); Tile tile = world.tile(pos);
+5 -3
View File
@@ -1,14 +1,14 @@
package mindustry.core; package mindustry.core;
import arc.*; import arc.*;
import mindustry.annotations.Annotations.*;
import arc.struct.*;
import arc.graphics.*; import arc.graphics.*;
import arc.math.*; import arc.math.*;
import arc.math.geom.*; import arc.math.geom.*;
import arc.struct.*;
import arc.util.*; import arc.util.*;
import arc.util.CommandHandler.*; import arc.util.CommandHandler.*;
import arc.util.io.*; import arc.util.io.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.core.GameState.*; import mindustry.core.GameState.*;
import mindustry.entities.*; import mindustry.entities.*;
@@ -296,9 +296,11 @@ public class NetServer implements ApplicationListener{
votes += d; votes += d;
voted.addAll(player.uuid, admins.getInfo(player.uuid).lastIP); voted.addAll(player.uuid, admins.getInfo(player.uuid).lastIP);
if(!checkPass()){
Call.sendMessage(Strings.format("[orange]{0}[lightgray] has voted to kick[orange] {1}[].[accent] ({2}/{3})\n[lightgray]Type[orange] /vote <y/n>[] to agree.", Call.sendMessage(Strings.format("[orange]{0}[lightgray] has voted to kick[orange] {1}[].[accent] ({2}/{3})\n[lightgray]Type[orange] /vote <y/n>[] to agree.",
player.name, target.name, votes, votesRequired())); player.name, target.name, votes, votesRequired()));
} }
}
boolean checkPass(){ boolean checkPass(){
if(votes >= votesRequired()){ if(votes >= votesRequired()){
@@ -654,7 +656,7 @@ public class NetServer implements ApplicationListener{
syncStream.reset(); syncStream.reset();
Array<CoreEntity> cores = state.teams.cores(player.getTeam()); Array<CoreEntity> cores = state.teams.cores(player.getTeam());
dataStream.writeByte(cores.size); dataStream.writeInt(cores.size);
for(CoreEntity entity : cores){ for(CoreEntity entity : cores){
dataStream.writeInt(entity.tile.pos()); dataStream.writeInt(entity.tile.pos());
+10 -1
View File
@@ -166,7 +166,8 @@ public enum EditorTool{
stack.clear(); stack.clear();
stack.add(Pos.get(x, y)); stack.add(Pos.get(x, y));
while(stack.size > 0){ try{
while(stack.size > 0 && stack.size < width*height){
int popped = stack.pop(); int popped = stack.pop();
x = Pos.x(popped); x = Pos.x(popped);
y = Pos.y(popped); y = Pos.y(popped);
@@ -194,6 +195,14 @@ public enum EditorTool{
x1++; x1++;
} }
} }
stack.clear();
}catch(OutOfMemoryError e){
//hack
stack = null;
System.gc();
e.printStackTrace();
stack = new IntArray();
}
} }
} }
}, },
@@ -107,9 +107,7 @@ public class MendProjector extends Block{
Draw.color(baseColor, phaseColor, entity.phaseHeat); Draw.color(baseColor, phaseColor, entity.phaseHeat);
Draw.alpha(entity.heat * Mathf.absin(Time.time(), 10f, 1f) * 0.5f); Draw.alpha(entity.heat * Mathf.absin(Time.time(), 10f, 1f) * 0.5f);
//Draw.blend(Blending.additive);
Draw.rect(topRegion, tile.drawx(), tile.drawy()); Draw.rect(topRegion, tile.drawx(), tile.drawy());
//Draw.blend();
Draw.alpha(1f); Draw.alpha(1f);
Lines.stroke((2f * f + 0.2f) * entity.heat); Lines.stroke((2f * f + 0.2f) * entity.heat);