Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -2329,11 +2329,15 @@ public class Blocks implements ContentList{
|
||||
payloadSource = new PayloadSource("payload-source"){{
|
||||
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
||||
size = 5;
|
||||
alwaysUnlocked = true;
|
||||
group = BlockGroup.units;
|
||||
}};
|
||||
|
||||
payloadVoid = new PayloadVoid("payload-void"){{
|
||||
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
||||
size = 5;
|
||||
alwaysUnlocked = true;
|
||||
group = BlockGroup.units;
|
||||
}};
|
||||
|
||||
//TODO move
|
||||
|
||||
@@ -135,7 +135,7 @@ public class EntityCollisions{
|
||||
|
||||
public static boolean waterSolid(int x, int y){
|
||||
Tile tile = world.tile(x, y);
|
||||
return tile == null || (tile.solid() || !tile.floor().isLiquid);
|
||||
return tile == null || tile.solid() || !tile.floor().isLiquid;
|
||||
}
|
||||
|
||||
public static boolean solid(int x, int y){
|
||||
|
||||
@@ -27,13 +27,14 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
boolean flying = isFlying();
|
||||
for(int i = 0; i < 2; i++){
|
||||
Trail t = i == 0 ? tleft : tright;
|
||||
t.length = type.trailLength;
|
||||
|
||||
int sign = i == 0 ? -1 : 1;
|
||||
float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y;
|
||||
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid ? 1 : 0);
|
||||
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid && !flying ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,6 +72,12 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
||||
return isFlying() ? null : EntityCollisions::waterSolid;
|
||||
}
|
||||
|
||||
@Replace
|
||||
@Override
|
||||
public boolean onSolid(){
|
||||
return EntityCollisions.waterSolid(tileX(), tileY());
|
||||
}
|
||||
|
||||
@Replace
|
||||
public float floorSpeedMultiplier(){
|
||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
||||
|
||||
@@ -605,7 +605,7 @@ public class SettingsMenuDialog extends Dialog{
|
||||
rebuild();
|
||||
}
|
||||
|
||||
void rebuild(){
|
||||
public void rebuild(){
|
||||
clearChildren();
|
||||
|
||||
for(Setting setting : list){
|
||||
@@ -626,7 +626,7 @@ public class SettingsMenuDialog extends Dialog{
|
||||
public String title;
|
||||
public @Nullable String description;
|
||||
|
||||
Setting(String name){
|
||||
public Setting(String name){
|
||||
this.name = name;
|
||||
String winkey = "setting." + name + ".name.windows";
|
||||
title = OS.isWindows && bundle.has(winkey) ? bundle.get(winkey) : bundle.get("setting." + name + ".name");
|
||||
@@ -658,7 +658,7 @@ public class SettingsMenuDialog extends Dialog{
|
||||
boolean def;
|
||||
Boolc changed;
|
||||
|
||||
CheckSetting(String name, boolean def, Boolc changed){
|
||||
public CheckSetting(String name, boolean def, Boolc changed){
|
||||
super(name);
|
||||
this.def = def;
|
||||
this.changed = changed;
|
||||
@@ -687,7 +687,7 @@ public class SettingsMenuDialog extends Dialog{
|
||||
int def, min, max, step;
|
||||
StringProcessor sp;
|
||||
|
||||
SliderSetting(String name, int def, int min, int max, int step, StringProcessor s){
|
||||
public SliderSetting(String name, int def, int min, int max, int step, StringProcessor s){
|
||||
super(name);
|
||||
this.def = def;
|
||||
this.min = min;
|
||||
|
||||
@@ -443,7 +443,7 @@ public class PlacementFragment extends Fragment{
|
||||
}
|
||||
|
||||
boolean unlocked(Block block){
|
||||
return block.unlockedNow();
|
||||
return block.unlockedNow() && block.placeablePlayer;
|
||||
}
|
||||
|
||||
boolean hasInfoBox(){
|
||||
|
||||
@@ -101,6 +101,8 @@ public class Block extends UnlockableContent{
|
||||
public boolean requiresWater = false;
|
||||
/** whether this block can be placed on any liquids, anywhere */
|
||||
public boolean placeableLiquid = false;
|
||||
/** whether this block can be placed directly by the player via PlacementFragment */
|
||||
public boolean placeablePlayer = true;
|
||||
/** whether this floor can be placed on. */
|
||||
public boolean placeableOn = true;
|
||||
/** whether this block has insulating properties. */
|
||||
|
||||
@@ -16,6 +16,7 @@ import mindustry.core.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.Units.*;
|
||||
import mindustry.entities.bullet.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
@@ -64,6 +65,7 @@ public class Turret extends ReloadTurret{
|
||||
public boolean accurateDelay = false;
|
||||
public boolean targetAir = true;
|
||||
public boolean targetGround = true;
|
||||
public boolean targetHealing = false;
|
||||
|
||||
//charging
|
||||
public float chargeTime = -1f;
|
||||
@@ -320,7 +322,11 @@ public class Turret extends ReloadTurret{
|
||||
}
|
||||
|
||||
protected boolean validateTarget(){
|
||||
return !Units.invalidateTarget(target, team, x, y) || isControlled() || logicControlled();
|
||||
return !Units.invalidateTarget(target, canHeal() ? Team.derelict : team, x, y) || isControlled() || logicControlled();
|
||||
}
|
||||
|
||||
protected boolean canHeal(){
|
||||
return targetHealing && hasAmmo() && peekAmmo().collidesTeam && peekAmmo().healPercent > 0;
|
||||
}
|
||||
|
||||
protected void findTarget(){
|
||||
@@ -328,6 +334,10 @@ public class Turret extends ReloadTurret{
|
||||
target = Units.bestEnemy(team, x, y, range, e -> !e.dead() && !e.isGrounded(), unitSort);
|
||||
}else{
|
||||
target = Units.bestTarget(team, x, y, range, e -> !e.dead() && (e.isGrounded() || targetAir) && (!e.isGrounded() || targetGround), b -> true, unitSort);
|
||||
|
||||
if(target == null && canHeal()){
|
||||
target = Units.findAllyTile(team, x, y, range, b -> b.damaged() && b != this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ public class CoreBlock extends StorageBlock{
|
||||
envEnabled = Env.any;
|
||||
drawDisabled = false;
|
||||
replaceable = false;
|
||||
rebuildable = false;
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
|
||||
Reference in New Issue
Block a user