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"){{
|
payloadSource = new PayloadSource("payload-source"){{
|
||||||
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
||||||
size = 5;
|
size = 5;
|
||||||
|
alwaysUnlocked = true;
|
||||||
|
group = BlockGroup.units;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
payloadVoid = new PayloadVoid("payload-void"){{
|
payloadVoid = new PayloadVoid("payload-void"){{
|
||||||
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
requirements(Category.units, BuildVisibility.sandboxOnly, with());
|
||||||
size = 5;
|
size = 5;
|
||||||
|
alwaysUnlocked = true;
|
||||||
|
group = BlockGroup.units;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO move
|
//TODO move
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class EntityCollisions{
|
|||||||
|
|
||||||
public static boolean waterSolid(int x, int y){
|
public static boolean waterSolid(int x, int y){
|
||||||
Tile tile = world.tile(x, 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){
|
public static boolean solid(int x, int y){
|
||||||
|
|||||||
@@ -27,13 +27,14 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
|
boolean flying = isFlying();
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
Trail t = i == 0 ? tleft : tright;
|
Trail t = i == 0 ? tleft : tright;
|
||||||
t.length = type.trailLength;
|
t.length = type.trailLength;
|
||||||
|
|
||||||
int sign = i == 0 ? -1 : 1;
|
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;
|
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;
|
return isFlying() ? null : EntityCollisions::waterSolid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Replace
|
||||||
|
@Override
|
||||||
|
public boolean onSolid(){
|
||||||
|
return EntityCollisions.waterSolid(tileX(), tileY());
|
||||||
|
}
|
||||||
|
|
||||||
@Replace
|
@Replace
|
||||||
public float floorSpeedMultiplier(){
|
public float floorSpeedMultiplier(){
|
||||||
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ public class SettingsMenuDialog extends Dialog{
|
|||||||
rebuild();
|
rebuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
void rebuild(){
|
public void rebuild(){
|
||||||
clearChildren();
|
clearChildren();
|
||||||
|
|
||||||
for(Setting setting : list){
|
for(Setting setting : list){
|
||||||
@@ -626,7 +626,7 @@ public class SettingsMenuDialog extends Dialog{
|
|||||||
public String title;
|
public String title;
|
||||||
public @Nullable String description;
|
public @Nullable String description;
|
||||||
|
|
||||||
Setting(String name){
|
public Setting(String name){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
String winkey = "setting." + name + ".name.windows";
|
String winkey = "setting." + name + ".name.windows";
|
||||||
title = OS.isWindows && bundle.has(winkey) ? bundle.get(winkey) : bundle.get("setting." + name + ".name");
|
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;
|
boolean def;
|
||||||
Boolc changed;
|
Boolc changed;
|
||||||
|
|
||||||
CheckSetting(String name, boolean def, Boolc changed){
|
public CheckSetting(String name, boolean def, Boolc changed){
|
||||||
super(name);
|
super(name);
|
||||||
this.def = def;
|
this.def = def;
|
||||||
this.changed = changed;
|
this.changed = changed;
|
||||||
@@ -687,7 +687,7 @@ public class SettingsMenuDialog extends Dialog{
|
|||||||
int def, min, max, step;
|
int def, min, max, step;
|
||||||
StringProcessor sp;
|
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);
|
super(name);
|
||||||
this.def = def;
|
this.def = def;
|
||||||
this.min = min;
|
this.min = min;
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
boolean unlocked(Block block){
|
boolean unlocked(Block block){
|
||||||
return block.unlockedNow();
|
return block.unlockedNow() && block.placeablePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasInfoBox(){
|
boolean hasInfoBox(){
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ public class Block extends UnlockableContent{
|
|||||||
public boolean requiresWater = false;
|
public boolean requiresWater = false;
|
||||||
/** whether this block can be placed on any liquids, anywhere */
|
/** whether this block can be placed on any liquids, anywhere */
|
||||||
public boolean placeableLiquid = false;
|
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. */
|
/** whether this floor can be placed on. */
|
||||||
public boolean placeableOn = true;
|
public boolean placeableOn = true;
|
||||||
/** whether this block has insulating properties. */
|
/** whether this block has insulating properties. */
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import mindustry.core.*;
|
|||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.entities.Units.*;
|
import mindustry.entities.Units.*;
|
||||||
import mindustry.entities.bullet.*;
|
import mindustry.entities.bullet.*;
|
||||||
|
import mindustry.game.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.graphics.*;
|
import mindustry.graphics.*;
|
||||||
@@ -64,6 +65,7 @@ public class Turret extends ReloadTurret{
|
|||||||
public boolean accurateDelay = false;
|
public boolean accurateDelay = false;
|
||||||
public boolean targetAir = true;
|
public boolean targetAir = true;
|
||||||
public boolean targetGround = true;
|
public boolean targetGround = true;
|
||||||
|
public boolean targetHealing = false;
|
||||||
|
|
||||||
//charging
|
//charging
|
||||||
public float chargeTime = -1f;
|
public float chargeTime = -1f;
|
||||||
@@ -320,7 +322,11 @@ public class Turret extends ReloadTurret{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected boolean validateTarget(){
|
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(){
|
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);
|
target = Units.bestEnemy(team, x, y, range, e -> !e.dead() && !e.isGrounded(), unitSort);
|
||||||
}else{
|
}else{
|
||||||
target = Units.bestTarget(team, x, y, range, e -> !e.dead() && (e.isGrounded() || targetAir) && (!e.isGrounded() || targetGround), b -> true, unitSort);
|
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;
|
envEnabled = Env.any;
|
||||||
drawDisabled = false;
|
drawDisabled = false;
|
||||||
replaceable = false;
|
replaceable = false;
|
||||||
|
rebuildable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server)
|
@Remote(called = Loc.server)
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "[cyan]DarkDustry",
|
"name": "[cyan]DarkDustry",
|
||||||
"address": ["darkdustry.ml", "darkdustry.ml:7000", "darkdustry.ml:8000"]
|
"address": ["darkdustry.ml", "darkdustry.ml:3000", "darkdustry.ml:7000", "darkdustry.ml:8000"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Chaotic Neutral",
|
"name": "Chaotic Neutral",
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "io",
|
"name": "io",
|
||||||
"address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000"]
|
"address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000", "mindustry.io.community:4000", "mindustry.io.community:5000"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Korea",
|
"name": "Korea",
|
||||||
|
|||||||
Reference in New Issue
Block a user