Targeting bugfixes
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 739 KiB After Width: | Height: | Size: 730 KiB |
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 129 KiB |
@@ -174,12 +174,14 @@ public class UnitTypes implements ContentList{
|
|||||||
|
|
||||||
reaper = new UnitType("reaper"){{
|
reaper = new UnitType("reaper"){{
|
||||||
speed = 1.1f;
|
speed = 1.1f;
|
||||||
accel = 0.08f;
|
accel = 0.02f;
|
||||||
drag = 0.05f;
|
drag = 0.05f;
|
||||||
mass = 30f;
|
mass = 30f;
|
||||||
|
rotateSpeed = 0.5f;
|
||||||
flying = true;
|
flying = true;
|
||||||
|
lowAltitude = true;
|
||||||
health = 75000;
|
health = 75000;
|
||||||
engineOffset = 40;
|
engineOffset = 38;
|
||||||
engineSize = 7.3f;
|
engineSize = 7.3f;
|
||||||
hitsize = 58f;
|
hitsize = 58f;
|
||||||
|
|
||||||
|
|||||||
@@ -51,15 +51,15 @@ public class Predict{
|
|||||||
return sol;
|
return sol;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vec2 intercept(Position src, Hitboxc dst, float v){
|
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.deltaX(), dst.deltaY(), v);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Vec2 intercept(Position src, Position dst, float v){
|
public static Vec2 intercept(Position src, Position dst, float v){
|
||||||
float ddx = 0, ddy = 0;
|
float ddx = 0, ddy = 0;
|
||||||
if(dst instanceof Hitboxc){
|
if(dst instanceof Hitboxc){
|
||||||
ddx = ((Hitboxc)dst).deltaX();
|
ddx += ((Hitboxc)dst).deltaX();
|
||||||
ddy = ((Hitboxc)dst).deltaY();
|
ddy += ((Hitboxc)dst).deltaY();
|
||||||
|
}
|
||||||
|
if(src instanceof Hitboxc){
|
||||||
|
ddx -= ((Hitboxc)src).deltaX()/(Time.delta());
|
||||||
|
ddy -= ((Hitboxc)src).deltaY()/(Time.delta());
|
||||||
}
|
}
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class Units{
|
|||||||
* @return whether the target is invalid
|
* @return whether the target is invalid
|
||||||
*/
|
*/
|
||||||
public static boolean invalidateTarget(Posc target, Team team, float x, float y, float range){
|
public static boolean invalidateTarget(Posc target, Team team, float x, float y, float range){
|
||||||
return target == null || !target.isAdded() || (range != Float.MAX_VALUE && !target.within(x, y, range)) || (target instanceof Teamc && ((Teamc)target).team() == team) || (target instanceof Healthc && !((Healthc)target).isValid());
|
return target == null || (range != Float.MAX_VALUE && !target.within(x, y, range)) || (target instanceof Teamc && ((Teamc)target).team() == team) || (target instanceof Healthc && !((Healthc)target).isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** See {@link #invalidateTarget(Posc, Team, float, float, float)} */
|
/** See {@link #invalidateTarget(Posc, Team, float, float, float)} */
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ public abstract class BulletType extends Content{
|
|||||||
bullet.damage(damage < 0 ? this.damage : damage);
|
bullet.damage(damage < 0 ? this.damage : damage);
|
||||||
bullet.add();
|
bullet.add();
|
||||||
|
|
||||||
if(keepVelocity && owner instanceof Velc) bullet.vel().add(((Velc)owner).vel());
|
if(keepVelocity && owner instanceof Hitboxc) bullet.vel().add(((Hitboxc)owner).deltaX(), ((Hitboxc)owner).deltaY());
|
||||||
return bullet;
|
return bullet;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ public class Layer{
|
|||||||
//building plans
|
//building plans
|
||||||
plans = 85,
|
plans = 85,
|
||||||
|
|
||||||
//flying units
|
//flying units (low altitude)
|
||||||
flyingUnit = 115,
|
flyingUnitLow = 90,
|
||||||
|
|
||||||
//bullets *bloom begin*
|
//bullets *bloom begin*
|
||||||
bullet = 100,
|
bullet = 100,
|
||||||
@@ -50,6 +50,9 @@ public class Layer{
|
|||||||
//effects *bloom end*
|
//effects *bloom end*
|
||||||
effect = 110,
|
effect = 110,
|
||||||
|
|
||||||
|
//flying units
|
||||||
|
flyingUnit = 115,
|
||||||
|
|
||||||
//overlaied UI, like block config guides
|
//overlaied UI, like block config guides
|
||||||
overlayUI = 120,
|
overlayUI = 120,
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ public class MultiPacker implements Disposable{
|
|||||||
main,
|
main,
|
||||||
environment,
|
environment,
|
||||||
editor,
|
editor,
|
||||||
zone,
|
|
||||||
ui;
|
ui;
|
||||||
|
|
||||||
public static final PageType[] all = values();
|
public static final PageType[] all = values();
|
||||||
|
|||||||
@@ -195,7 +195,6 @@ public class Mods implements Loadable{
|
|||||||
region.getTexture() == Core.atlas.find("white").getTexture() ? PageType.main :
|
region.getTexture() == Core.atlas.find("white").getTexture() ? PageType.main :
|
||||||
region.getTexture() == Core.atlas.find("stone1").getTexture() ? PageType.environment :
|
region.getTexture() == Core.atlas.find("stone1").getTexture() ? PageType.environment :
|
||||||
region.getTexture() == Core.atlas.find("clear-editor").getTexture() ? PageType.editor :
|
region.getTexture() == Core.atlas.find("clear-editor").getTexture() ? PageType.editor :
|
||||||
region.getTexture() == Core.atlas.find("zone-groundZero").getTexture() ? PageType.zone :
|
|
||||||
region.getTexture() == Core.atlas.find("whiteui").getTexture() ? PageType.ui :
|
region.getTexture() == Core.atlas.find("whiteui").getTexture() ? PageType.ui :
|
||||||
PageType.main;
|
PageType.main;
|
||||||
}
|
}
|
||||||
@@ -205,7 +204,6 @@ public class Mods implements Loadable{
|
|||||||
return
|
return
|
||||||
parent.equals("environment") ? PageType.environment :
|
parent.equals("environment") ? PageType.environment :
|
||||||
parent.equals("editor") ? PageType.editor :
|
parent.equals("editor") ? PageType.editor :
|
||||||
parent.equals("zones") ? PageType.zone :
|
|
||||||
parent.equals("ui") || file.parent().parent().name().equals("ui") ? PageType.ui :
|
parent.equals("ui") || file.parent().parent().name().equals("ui") ? PageType.ui :
|
||||||
PageType.main;
|
PageType.main;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public float drag = 0.3f, mass = 1f, accel = 0.5f;
|
public float drag = 0.3f, mass = 1f, accel = 0.5f;
|
||||||
public float health = 200f, range = -1;
|
public float health = 200f, range = -1;
|
||||||
public boolean targetAir = true, targetGround = true;
|
public boolean targetAir = true, targetGround = true;
|
||||||
public boolean faceTarget = true, isCounted = true;
|
public boolean faceTarget = true, isCounted = true, lowAltitude = false;
|
||||||
public float sway = 1f;
|
public float sway = 1f;
|
||||||
|
|
||||||
public int itemCapacity = 30;
|
public int itemCapacity = 30;
|
||||||
@@ -129,7 +129,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
drawShadow(unit);
|
drawShadow(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
float z = Mathf.lerp(Layer.groundUnit, Layer.flyingUnit, unit.elevation());
|
float z = unit.elevation() > 0.5f ? (lowAltitude ? Layer.flyingUnitLow : Layer.flyingUnit) : Layer.groundUnit;
|
||||||
|
|
||||||
Draw.z(z - 0.02f);
|
Draw.z(z - 0.02f);
|
||||||
|
|
||||||
|
|||||||