mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-19 20:27:44 +07:00
Fixed ship flight targeting / Fixed unit weapon sprite offset
This commit is contained in:
@ -26,7 +26,7 @@ allprojects {
|
|||||||
appName = 'Mindustry'
|
appName = 'Mindustry'
|
||||||
gdxVersion = '1.9.8'
|
gdxVersion = '1.9.8'
|
||||||
roboVMVersion = '2.3.0'
|
roboVMVersion = '2.3.0'
|
||||||
uCoreVersion = '3d515618feeb9d05fd2727320be7e612e0b8c859'
|
uCoreVersion = 'b6c84cdaad80c58267bdb0fc91d7197bb2252247'
|
||||||
|
|
||||||
getVersionString = {
|
getVersionString = {
|
||||||
String buildVersion = getBuildVersion()
|
String buildVersion = getBuildVersion()
|
||||||
|
@ -609,7 +609,7 @@ block.thermal-pump.name=Thermal Pump
|
|||||||
block.dagger-pad.name=Dagger Pad
|
block.dagger-pad.name=Dagger Pad
|
||||||
block.titan-pad.name=Titan Pad
|
block.titan-pad.name=Titan Pad
|
||||||
block.thermal-generator.name=Thermal Generator
|
block.thermal-generator.name=Thermal Generator
|
||||||
block.alloy-smelter.name=Alloy Smtler
|
block.alloy-smelter.name=Alloy Smelter
|
||||||
block.mend-projector.name=Mend Projector
|
block.mend-projector.name=Mend Projector
|
||||||
block.surge-wall.name=Surge Wall
|
block.surge-wall.name=Surge Wall
|
||||||
block.surge-wall-large.name=Large Surge Wall
|
block.surge-wall-large.name=Large Surge Wall
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
@ -155,12 +155,10 @@ public class Renderer extends RendererModule{
|
|||||||
}else{
|
}else{
|
||||||
Vector2 position = averagePosition();
|
Vector2 position = averagePosition();
|
||||||
|
|
||||||
if(!mobile){
|
if(players[0].isDead()){
|
||||||
if(players[0].isDead()){
|
smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f);
|
||||||
smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f);
|
}else if(!mobile){
|
||||||
}else{
|
setCamera(position.x + 0.0001f, position.y + 0.0001f);
|
||||||
setCamera(position.x + 0.0001f, position.y + 0.0001f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(world.getSector() == null){
|
if(world.getSector() == null){
|
||||||
|
@ -27,7 +27,6 @@ import io.anuke.mindustry.world.Block;
|
|||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.Floor;
|
import io.anuke.mindustry.world.blocks.Floor;
|
||||||
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
|
import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity;
|
||||||
import io.anuke.mindustry.world.blocks.units.MechFactory;
|
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.entities.trait.SolidTrait;
|
import io.anuke.ucore.entities.trait.SolidTrait;
|
||||||
@ -227,10 +226,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
public void set(float x, float y){
|
public void set(float x, float y){
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
|
|
||||||
if(isFlying() && isLocal){
|
|
||||||
Core.camera.position.set(x, y, 0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -612,12 +607,17 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
|||||||
if(moveTarget != null && !moveTarget.isDead()){
|
if(moveTarget != null && !moveTarget.isDead()){
|
||||||
targetX = moveTarget.getX();
|
targetX = moveTarget.getX();
|
||||||
targetY = moveTarget.getY();
|
targetY = moveTarget.getY();
|
||||||
|
boolean tapping = moveTarget instanceof TileEntity && moveTarget.getTeam() == team;
|
||||||
attractDst = 0f;
|
attractDst = 0f;
|
||||||
|
|
||||||
|
if(tapping){
|
||||||
|
velocity.setAngle(Mathf.slerpDelta(velocity.angle(), angleTo(moveTarget), 0.1f));
|
||||||
|
}
|
||||||
|
|
||||||
if(distanceTo(moveTarget) < 2f){
|
if(distanceTo(moveTarget) < 2f){
|
||||||
if(moveTarget instanceof CarriableTrait){
|
if(moveTarget instanceof CarriableTrait){
|
||||||
carry((CarriableTrait) moveTarget);
|
carry((CarriableTrait) moveTarget);
|
||||||
}else if(moveTarget instanceof TileEntity && ((TileEntity) moveTarget).tile.block() instanceof MechFactory){
|
}else if(tapping){
|
||||||
Tile tile = ((TileEntity) moveTarget).tile;
|
Tile tile = ((TileEntity) moveTarget).tile;
|
||||||
tile.block().tapped(tile, this);
|
tile.block().tapped(tile, this);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDead(){
|
public boolean isDead(){
|
||||||
return dead;
|
return dead || tile.entity != this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(DataOutputStream stream) throws IOException{
|
public void write(DataOutputStream stream) throws IOException{
|
||||||
|
@ -111,11 +111,11 @@ public class Generators {
|
|||||||
|
|
||||||
image.draw(type.weapon.equipRegion,
|
image.draw(type.weapon.equipRegion,
|
||||||
-(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
-(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
||||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2,
|
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
|
||||||
false, false);
|
false, false);
|
||||||
image.draw(type.weapon.equipRegion,
|
image.draw(type.weapon.equipRegion,
|
||||||
(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
(int)type.weaponOffsetX + (image.width() - type.weapon.equipRegion.getRegionWidth())/2,
|
||||||
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2,
|
(int)type.weaponOffsetY - (image.height() - type.weapon.equipRegion.getRegionHeight())/2 + 1,
|
||||||
true, false);
|
true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user