Rectangles

This commit is contained in:
Anuken
2018-10-02 18:47:23 -04:00
parent f175bf2c82
commit 8523e5bf6b
9 changed files with 41 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ allprojects {
appName = 'Mindustry' appName = 'Mindustry'
gdxVersion = '1.9.8' gdxVersion = '1.9.8'
roboVMVersion = '2.3.0' roboVMVersion = '2.3.0'
uCoreVersion = '1b74e58413f4885f204c441f88464d8c82c5433b' uCoreVersion = 'ee0de709b7ab7bc993db42436a378ceee88c6460'
getVersionString = { getVersionString = {
String buildVersion = getBuildVersion() String buildVersion = getBuildVersion()

View File

@@ -42,6 +42,7 @@ public class Mechs implements ContentList{
{ {
drillPower = 1; drillPower = 1;
mineSpeed = 1.5f; mineSpeed = 1.5f;
mass = 1.2f;
speed = 0.5f; speed = 0.5f;
boostSpeed = 0.85f; boostSpeed = 0.85f;
weapon = Weapons.blaster; weapon = Weapons.blaster;
@@ -81,6 +82,7 @@ public class Mechs implements ContentList{
speed = 0.75f; speed = 0.75f;
boostSpeed = 0.95f; boostSpeed = 0.95f;
itemCapacity = 15; itemCapacity = 15;
mass = 0.9f;
armor = 30f; armor = 30f;
weaponOffsetX = -1; weaponOffsetX = -1;
itemCapacity = 15; itemCapacity = 15;
@@ -115,6 +117,7 @@ public class Mechs implements ContentList{
itemCapacity = 70; itemCapacity = 70;
weaponOffsetY = -1; weaponOffsetY = -1;
weaponOffsetX = 1; weaponOffsetX = 1;
mass = 1.75f;
speed = 0.44f; speed = 0.44f;
drag = 0.35f; drag = 0.35f;
boostSpeed = 0.8f; boostSpeed = 0.8f;
@@ -157,6 +160,7 @@ public class Mechs implements ContentList{
itemCapacity = 50; itemCapacity = 50;
speed = 0.36f; speed = 0.36f;
boostSpeed = 0.6f; boostSpeed = 0.6f;
mass = 4f;
shake = 4f; shake = 4f;
weaponOffsetX = 1; weaponOffsetX = 1;
weaponOffsetY = 0; weaponOffsetY = 0;
@@ -233,6 +237,7 @@ public class Mechs implements ContentList{
speed = 0.11f; speed = 0.11f;
maxSpeed = 10f; maxSpeed = 10f;
drag = 0.01f; drag = 0.01f;
mass = 2f;
armor = 5f; armor = 5f;
weapon = Weapons.missiles; weapon = Weapons.missiles;
trailColor = Color.valueOf("d3ddff"); trailColor = Color.valueOf("d3ddff");
@@ -287,6 +292,7 @@ public class Mechs implements ContentList{
speed = 0.12f; speed = 0.12f;
maxSpeed = 10f; maxSpeed = 10f;
drag = 0.035f; drag = 0.035f;
mass = 2.5f;
turnCursor = false; turnCursor = false;
armor = 20f; armor = 20f;
itemCapacity = 30; itemCapacity = 30;
@@ -309,6 +315,7 @@ public class Mechs implements ContentList{
speed = 0.32f; speed = 0.32f;
maxSpeed = 10f; maxSpeed = 10f;
drag = 0.06f; drag = 0.06f;
mass = 3f;
armor = 30f; armor = 30f;
itemCapacity = 60; itemCapacity = 60;
trailColor = Color.valueOf("feb380"); trailColor = Color.valueOf("feb380");

View File

@@ -48,6 +48,7 @@ public class UnitTypes implements ContentList{
maxVelocity = 1.1f; maxVelocity = 1.1f;
speed = 0.2f; speed = 0.2f;
drag = 0.4f; drag = 0.4f;
mass = 1.75f;
range = 40f; range = 40f;
weapon = Weapons.chainBlaster; weapon = Weapons.chainBlaster;
health = 130; health = 130;
@@ -57,7 +58,9 @@ public class UnitTypes implements ContentList{
maxVelocity = 0.8f; maxVelocity = 0.8f;
speed = 0.18f; speed = 0.18f;
drag = 0.4f; drag = 0.4f;
mass = 3f;
range = 10f; range = 10f;
hitsize = 8f;
rotatespeed = 0.1f; rotatespeed = 0.1f;
weapon = Weapons.flamethrower; weapon = Weapons.flamethrower;
health = 440; health = 440;
@@ -67,7 +70,8 @@ public class UnitTypes implements ContentList{
maxVelocity = 0.8f; maxVelocity = 0.8f;
speed = 0.15f; speed = 0.15f;
drag = 0.4f; drag = 0.4f;
mass = 4f; mass = 4.5f;
hitsize = 10f;
range = 10f; range = 10f;
rotatespeed = 0.06f; rotatespeed = 0.06f;
weaponOffsetX = 1; weaponOffsetX = 1;
@@ -89,6 +93,7 @@ public class UnitTypes implements ContentList{
health = 250; health = 250;
speed = 0.2f; speed = 0.2f;
maxVelocity = 1.4f; maxVelocity = 1.4f;
mass = 3f;
drag = 0.01f; drag = 0.01f;
isFlying = true; isFlying = true;
targetAir = false; targetAir = false;
@@ -97,7 +102,7 @@ public class UnitTypes implements ContentList{
revenant = new UnitType("revenant", Revenant.class, Revenant::new){{ revenant = new UnitType("revenant", Revenant.class, Revenant::new){{
health = 250; health = 250;
mass = 4f; mass = 5f;
hitsize = 12f; hitsize = 12f;
speed = 0.14f; speed = 0.14f;
maxVelocity = 1.4f; maxVelocity = 1.4f;
@@ -109,6 +114,7 @@ public class UnitTypes implements ContentList{
phantom = new UnitType("phantom", Phantom.class, Phantom::new){{ phantom = new UnitType("phantom", Phantom.class, Phantom::new){{
isFlying = true; isFlying = true;
drag = 0.01f; drag = 0.01f;
mass = 2f;
speed = 0.2f; speed = 0.2f;
maxVelocity = 0.9f; maxVelocity = 0.9f;
range = 70f; range = 70f;

View File

@@ -172,12 +172,13 @@ public class Logic extends Module{
EntityQuery.collideGroups(group, playerGroup); EntityQuery.collideGroups(group, playerGroup);
for(EntityGroup other : unitGroups){ for(EntityGroup other : unitGroups){
if(other == group || other.isEmpty()) continue; if(other.isEmpty()) continue;
EntityQuery.collideGroups(group, other); EntityQuery.collideGroups(group, other);
} }
} }
EntityQuery.collideGroups(bulletGroup, playerGroup); EntityQuery.collideGroups(bulletGroup, playerGroup);
EntityQuery.collideGroups(playerGroup, playerGroup);
world.pathfinder().update(); world.pathfinder().update();
} }

View File

@@ -98,7 +98,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
@Override @Override
public void getHitbox(Rectangle rectangle){ public void getHitbox(Rectangle rectangle){
rectangle.setSize(5).setCenter(x, y); rectangle.setSize(mech.hitsize).setCenter(x, y);
} }
@Override @Override

View File

@@ -16,6 +16,7 @@ import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers; import io.anuke.ucore.core.Timers;
import io.anuke.ucore.entities.impl.DestructibleEntity; import io.anuke.ucore.entities.impl.DestructibleEntity;
import io.anuke.ucore.entities.trait.DamageTrait;
import io.anuke.ucore.entities.trait.DrawTrait; import io.anuke.ucore.entities.trait.DrawTrait;
import io.anuke.ucore.entities.trait.SolidTrait; import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Draw;
@@ -49,6 +50,11 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
protected CarryTrait carrier; protected CarryTrait carrier;
protected float drownTime; protected float drownTime;
@Override
public boolean movable(){
return true;
}
@Override @Override
public UnitInventory getInventory(){ public UnitInventory getInventory(){
return inventory; return inventory;
@@ -94,8 +100,13 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
@Override @Override
public boolean collides(SolidTrait other){ public boolean collides(SolidTrait other){
return true;//other instanceof DamageTrait && other if(isDead()) return true;
// instanceof TeamTrait && state.teams.areEnemies((((TeamTrait) other).getTeam()), team) && !isDead();
if(other instanceof DamageTrait){
return other instanceof TeamTrait && state.teams.areEnemies((((TeamTrait) other).getTeam()), team);
}else{
return other instanceof Unit && ((Unit) other).isFlying() == isFlying();
}
} }
@Override @Override

View File

@@ -2,6 +2,7 @@ package io.anuke.mindustry.entities.traits;
import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Team;
import io.anuke.ucore.entities.trait.PosTrait; import io.anuke.ucore.entities.trait.PosTrait;
import io.anuke.ucore.entities.trait.SolidTrait;
import io.anuke.ucore.entities.trait.VelocityTrait; import io.anuke.ucore.entities.trait.VelocityTrait;
/** /**
@@ -14,10 +15,16 @@ public interface TargetTrait extends PosTrait, VelocityTrait{
Team getTeam(); Team getTeam();
default float getTargetVelocityX(){ default float getTargetVelocityX(){
if(this instanceof SolidTrait){
return ((SolidTrait) this).getDeltaX();
}
return getVelocity().x; return getVelocity().x;
} }
default float getTargetVelocityY(){ default float getTargetVelocityY(){
if(this instanceof SolidTrait){
return ((SolidTrait) this).getDeltaY();
}
return getVelocity().y; return getVelocity().y;
} }

View File

@@ -26,7 +26,7 @@ public class UnitType extends UnlockableContent{
public final String name; public final String name;
public final String description; public final String description;
public float health = 60; public float health = 60;
public float hitsize = 5f; public float hitsize = 7f;
public float hitsizeTile = 4f; public float hitsizeTile = 4f;
public float speed = 0.4f; public float speed = 0.4f;
public float range = 160; public float range = 160;

View File

@@ -27,6 +27,7 @@ public class Mech extends UnlockableContent{
public float shake = 0f; public float shake = 0f;
public float armor = 1f; public float armor = 1f;
public float hitsize = 6f;
public float cellTrnsY = 0f; public float cellTrnsY = 0f;
public float mineSpeed = 1f; public float mineSpeed = 1f;
public int drillPower = -1; public int drillPower = -1;