Merge branch 'master' into do-you-hear-the-voices-too
This commit is contained in:
@@ -59,7 +59,7 @@ public class NetServer implements ApplicationListener{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
return (float)count + Mathf.random(-0.1f, 0.1f); //if several have the same playercount pick random
|
||||
});
|
||||
return re == null ? null : re.team;
|
||||
}
|
||||
|
||||
@@ -214,6 +214,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
case ammoCapacity -> type.ammoCapacity;
|
||||
case x -> World.conv(x);
|
||||
case y -> World.conv(y);
|
||||
case velocityX -> vel.x * 60f / tilesize;
|
||||
case velocityY -> vel.y * 60f / tilesize;
|
||||
case dead -> dead || !isAdded() ? 1 : 0;
|
||||
case team -> team.id;
|
||||
case shooting -> isShooting() ? 1 : 0;
|
||||
@@ -282,6 +284,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
||||
y = World.unconv((float)value);
|
||||
if(!isLocal()) snapInterpolation();
|
||||
}
|
||||
case velocityX -> vel.x = (float)(value * tilesize / 60d);
|
||||
case velocityY -> vel.y = (float)(value * tilesize / 60d);
|
||||
case rotation -> rotation = (float)value;
|
||||
case team -> {
|
||||
if(!net.client()){
|
||||
|
||||
@@ -17,6 +17,7 @@ public enum LAccess{
|
||||
powerNetOut,
|
||||
ammo,
|
||||
ammoCapacity,
|
||||
currentAmmoType,
|
||||
health,
|
||||
maxHealth,
|
||||
heat,
|
||||
@@ -28,6 +29,8 @@ public enum LAccess{
|
||||
rotation,
|
||||
x,
|
||||
y,
|
||||
velocityX,
|
||||
velocityY,
|
||||
shootX,
|
||||
shootY,
|
||||
cameraX,
|
||||
@@ -68,7 +71,7 @@ public enum LAccess{
|
||||
all = values(),
|
||||
senseable = Seq.select(all, t -> t.params.length <= 1).toArray(LAccess.class),
|
||||
controls = Seq.select(all, t -> t.params.length > 0).toArray(LAccess.class),
|
||||
settable = {x, y, rotation, speed, armor, health, shield, team, flag, totalPower, payloadType};
|
||||
settable = {x, y, velocityX, velocityY, rotation, speed, armor, health, shield, team, flag, totalPower, payloadType};
|
||||
|
||||
LAccess(String... params){
|
||||
this.params = params;
|
||||
@@ -79,5 +82,4 @@ public enum LAccess{
|
||||
this.params = params;
|
||||
isObj = obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1498,6 +1498,7 @@ public class LExecutor{
|
||||
}
|
||||
case ambientLight -> state.rules.ambientLight.fromDouble(value.num());
|
||||
case solarMultiplier -> state.rules.solarMultiplier = Math.max(value.numf(), 0f);
|
||||
case dragMultiplier -> state.rules.dragMultiplier = Math.max(value.numf(), 0f);
|
||||
case ban -> {
|
||||
Object cont = value.obj();
|
||||
if(cont instanceof Block b){
|
||||
|
||||
@@ -15,6 +15,7 @@ public enum LogicRule{
|
||||
lighting,
|
||||
ambientLight,
|
||||
solarMultiplier,
|
||||
dragMultiplier,
|
||||
ban,
|
||||
unban,
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import arc.struct.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.consumers.*;
|
||||
import mindustry.world.meta.*;
|
||||
@@ -77,6 +78,14 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
|
||||
super.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object senseObject(LAccess sensor){
|
||||
return switch(sensor){
|
||||
case currentAmmoType -> liquids.current();
|
||||
default -> super.senseObject(sensor);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConsume(){
|
||||
return hasCorrectAmmo() && super.canConsume();
|
||||
|
||||
@@ -11,6 +11,7 @@ import mindustry.entities.bullet.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.consumers.*;
|
||||
@@ -107,6 +108,14 @@ public class ItemTurret extends Turret{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object senseObject(LAccess sensor){
|
||||
return switch(sensor){
|
||||
case currentAmmoType -> ammo.size > 0 ? ((ItemEntry)ammo.peek()).item : null;
|
||||
default -> super.senseObject(sensor);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
unit.ammo((float)unit.type().ammoCapacity * totalAmmo / maxAmmo);
|
||||
|
||||
@@ -6,6 +6,7 @@ import mindustry.core.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.consumers.*;
|
||||
@@ -72,6 +73,14 @@ public class LiquidTurret extends Turret{
|
||||
super.updateTile();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object senseObject(LAccess sensor){
|
||||
return switch(sensor){
|
||||
case currentAmmoType -> liquids.current();
|
||||
default -> super.senseObject(sensor);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void findTarget(){
|
||||
if(extinguish && liquids.current().canExtinguish()){
|
||||
|
||||
@@ -259,7 +259,8 @@ public class StackConveyor extends Block implements Autotiler{
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
float eff = enabled ? (efficiency + baseEfficiency) : 0f;
|
||||
//the item still needs to be "reeled" in when disabled
|
||||
float eff = enabled ? (efficiency + baseEfficiency) : 1f;
|
||||
|
||||
//reel in crater
|
||||
if(cooldown > 0f) cooldown = Mathf.clamp(cooldown - speed * eff * delta(), 0f, recharge);
|
||||
|
||||
Reference in New Issue
Block a user