mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-21 05:07:41 +07:00
Bugfixes
This commit is contained in:
@ -755,6 +755,7 @@ rules.enemyCheat = Infinite AI (Red Team) Resources
|
||||
rules.unitdrops = Unit Drops
|
||||
rules.unitbuildspeedmultiplier = Unit Production Speed Multiplier
|
||||
rules.unithealthmultiplier = Unit Health Multiplier
|
||||
rules.blockhealthmultiplier = Block Health Multiplier
|
||||
rules.playerhealthmultiplier = Player Health Multiplier
|
||||
rules.playerdamagemultiplier = Player Damage Multiplier
|
||||
rules.unitdamagemultiplier = Unit Damage Multiplier
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mindustry.entities.type;
|
||||
|
||||
import arc.math.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import arc.Events;
|
||||
import arc.struct.Array;
|
||||
@ -165,9 +166,16 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
||||
Call.onTileDestroyed(tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damage(float damage){
|
||||
if(dead) return;
|
||||
|
||||
if(Mathf.zero(state.rules.blockHealthMultiplier)){
|
||||
damage = health + 1;
|
||||
}else{
|
||||
damage /= state.rules.blockHealthMultiplier;
|
||||
}
|
||||
|
||||
float preHealth = health;
|
||||
|
||||
Call.onTileDamage(tile, health - block.handleDamage(tile, damage));
|
||||
|
@ -34,6 +34,8 @@ public class Rules{
|
||||
public float unitHealthMultiplier = 1f;
|
||||
/** How much health players start with. */
|
||||
public float playerHealthMultiplier = 1f;
|
||||
/** How much health blocks start with. */
|
||||
public float blockHealthMultiplier = 1f;
|
||||
/** How much damage player mechs deal. */
|
||||
public float playerDamageMultiplier = 1f;
|
||||
/** How much damage any other units deal. */
|
||||
|
@ -136,7 +136,7 @@ public class DesktopInput extends InputHandler{
|
||||
ui.listfrag.toggle();
|
||||
}
|
||||
|
||||
if(player.getClosestCore() == null){
|
||||
if(player.getClosestCore() == null && !ui.chatfrag.shown()){
|
||||
//move camera around
|
||||
float camSpeed = 6f;
|
||||
Core.camera.position.add(Tmp.v1.setZero().add(Core.input.axis(Binding.move_x), Core.input.axis(Binding.move_y)).nor().scl(Time.delta() * camSpeed));
|
||||
@ -157,7 +157,7 @@ public class DesktopInput extends InputHandler{
|
||||
if(state.is(State.menu) || Core.scene.hasDialog()) return;
|
||||
|
||||
//zoom camera
|
||||
if(!Core.scene.hasScroll() && !ui.chatfrag.shown() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||
if((!Core.scene.hasScroll() || Core.input.keyDown(Binding.diagonal_placement)) && !ui.chatfrag.shown() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && !Core.input.keyDown(Binding.rotateplaced) && (Core.input.keyDown(Binding.diagonal_placement) || ((!isPlacing() || !block.rotate) && selectRequests.isEmpty()))){
|
||||
renderer.scaleCamera(Core.input.axisTap(Binding.zoom));
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
|
||||
@Remote(targets = Loc.both, forward = true, called = Loc.server)
|
||||
public static void transferInventory(Player player, Tile tile){
|
||||
if(player == null || player.timer == null || !player.timer.get(Player.timerTransfer, 40)) return;
|
||||
if(player == null || player.timer == null) return;
|
||||
if(net.server() && (player.item().amount <= 0 || player.isTransferring|| !Units.canInteract(player, tile))){
|
||||
throw new ValidateException(player, "Player cannot transfer an item.");
|
||||
}
|
||||
@ -725,7 +725,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
||||
}
|
||||
|
||||
public void tryDropItems(Tile tile, float x, float y){
|
||||
if(!droppingItem || player.item().amount <= 0 || canTapPlayer(x, y) || state.isPaused() || !player.timer.check(Player.timerTransfer, 40)){
|
||||
if(!droppingItem || player.item().amount <= 0 || canTapPlayer(x, y) || state.isPaused() ){
|
||||
droppingItem = false;
|
||||
return;
|
||||
}
|
||||
|
@ -142,6 +142,7 @@ public class CustomRulesDialog extends FloatingDialog{
|
||||
check("$rules.reactorexplosions", b -> rules.reactorExplosions = b, () -> rules.reactorExplosions);
|
||||
number("$rules.buildcostmultiplier", false, f -> rules.buildCostMultiplier = f, () -> rules.buildCostMultiplier, () -> !rules.infiniteResources);
|
||||
number("$rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
||||
number("$rules.blockhealthmultiplier", f -> rules.blockHealthMultiplier = f, () -> rules.blockHealthMultiplier);
|
||||
|
||||
main.addButton("$configure",
|
||||
() -> loadoutDialog.show(Blocks.coreShard.itemCapacity, rules.loadout,
|
||||
|
@ -36,7 +36,7 @@ public class BlockInventoryFragment extends Fragment{
|
||||
|
||||
@Remote(called = Loc.server, targets = Loc.both, forward = true)
|
||||
public static void requestItem(Player player, Tile tile, Item item, int amount){
|
||||
if(player == null || tile == null || !player.timer.get(Player.timerTransfer, 20) || !tile.interactable(player.getTeam())) return;
|
||||
if(player == null || tile == null || !tile.interactable(player.getTeam())) return;
|
||||
if(!Units.canInteract(player, tile)) return;
|
||||
|
||||
int removed = tile.block().removeStack(tile, item, amount);
|
||||
|
@ -45,7 +45,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
font = Fonts.def;
|
||||
|
||||
visible(() -> {
|
||||
if(input.keyTap(Binding.console) && !Vars.net.client() && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||
if(input.keyTap(Binding.console) && (scene.getKeyboardFocus() == chatfield || scene.getKeyboardFocus() == null)){
|
||||
shown = !shown;
|
||||
if(shown && !open && enableConsole){
|
||||
toggle();
|
||||
@ -53,7 +53,7 @@ public class ScriptConsoleFragment extends Table{
|
||||
clearChatInput();
|
||||
}
|
||||
|
||||
return shown && !Vars.net.active();
|
||||
return shown;
|
||||
});
|
||||
|
||||
update(() -> {
|
||||
|
@ -58,7 +58,7 @@ public class Junction extends Block{
|
||||
if(dest != null) dest = dest.link();
|
||||
|
||||
//skip blocks that don't want the item, keep waiting until they do
|
||||
if(dest == null || !dest.block().acceptItem(item, dest, tile)){
|
||||
if(dest == null || !dest.block().acceptItem(item, dest, tile) || dest.getTeam() != tile.getTeam()){
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -82,10 +82,9 @@ public class Junction extends Block{
|
||||
JunctionEntity entity = tile.ent();
|
||||
int relative = source.relativeTo(tile.x, tile.y);
|
||||
|
||||
if(entity == null || relative == -1 || !entity.buffer.accepts(relative))
|
||||
return false;
|
||||
if(entity == null || relative == -1 || !entity.buffer.accepts(relative)) return false;
|
||||
Tile to = tile.getNearby(relative);
|
||||
return to != null && to.link().entity != null;
|
||||
return to != null && to.link().entity != null && to.getTeam() == tile.getTeam();
|
||||
}
|
||||
|
||||
class JunctionEntity extends TileEntity{
|
||||
|
@ -74,7 +74,7 @@ public class Sorter extends Block{
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||
Tile to = getTileTarget(item, tile, source, false);
|
||||
|
||||
return to != null && to.block().acceptItem(item, to, tile);
|
||||
return to != null && to.block().acceptItem(item, to, tile) && to.getTeam() == tile.getTeam();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user