Bugfixes
This commit is contained in:
@@ -383,9 +383,8 @@ public class Bullets implements ContentList{
|
||||
fireball = new BulletType(1f, 4){
|
||||
{
|
||||
pierce = true;
|
||||
hitTiles = false;
|
||||
collides = false;
|
||||
collidesTiles = false;
|
||||
collides = false;
|
||||
drag = 0.03f;
|
||||
hitEffect = despawnEffect = Fx.none;
|
||||
}
|
||||
|
||||
@@ -76,29 +76,6 @@ public class UnitTypes implements ContentList{
|
||||
}});
|
||||
}};
|
||||
|
||||
cix = new UnitType("cix"){{
|
||||
drag = 0.1f;
|
||||
speed = 0.8f;
|
||||
hitsize = 9f;
|
||||
health = 140;
|
||||
|
||||
legCount = 6;
|
||||
rotateShooting = false;
|
||||
|
||||
for(boolean b : Mathf.booleans){
|
||||
weapons.add(
|
||||
new Weapon("missiles-mount"){{
|
||||
reload = 20f;
|
||||
x = 4f * Mathf.sign(b);
|
||||
rotate = true;
|
||||
mirror = false;
|
||||
flipSprite = !b;
|
||||
shake = 1f;
|
||||
bullet = Bullets.missileSwarm;
|
||||
}});
|
||||
}
|
||||
}};
|
||||
|
||||
titan = new UnitType("titan"){{
|
||||
speed = 0.4f;
|
||||
hitsize = 9f;
|
||||
@@ -118,33 +95,6 @@ public class UnitTypes implements ContentList{
|
||||
}});
|
||||
}};
|
||||
|
||||
crawler = new UnitType("crawler"){{
|
||||
defaultController = SuicideAI::new;
|
||||
|
||||
speed = 0.8f;
|
||||
hitsize = 8f;
|
||||
health = 140;
|
||||
sway = 0.25f;
|
||||
range = 40f;
|
||||
|
||||
weapons.add(new Weapon(){{
|
||||
reload = 12f;
|
||||
shootCone = 180f;
|
||||
ejectEffect = Fx.none;
|
||||
shootSound = Sounds.explosion;
|
||||
bullet = new BombBulletType(0f, 0f, "clear"){{
|
||||
hitEffect = Fx.pulverize;
|
||||
lifetime = 10f;
|
||||
speed = 1f;
|
||||
splashDamageRadius = 55f;
|
||||
instantDisappear = true;
|
||||
splashDamage = 30f;
|
||||
killShooter = true;
|
||||
hittable = false;
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
tau = new UnitType("tau"){{
|
||||
itemCapacity = 60;
|
||||
canBoost = true;
|
||||
@@ -225,6 +175,33 @@ public class UnitTypes implements ContentList{
|
||||
}});
|
||||
}};
|
||||
|
||||
crawler = new UnitType("crawler"){{
|
||||
defaultController = SuicideAI::new;
|
||||
|
||||
speed = 0.8f;
|
||||
hitsize = 8f;
|
||||
health = 140;
|
||||
sway = 0.25f;
|
||||
range = 40f;
|
||||
|
||||
weapons.add(new Weapon(){{
|
||||
reload = 12f;
|
||||
shootCone = 180f;
|
||||
ejectEffect = Fx.none;
|
||||
shootSound = Sounds.explosion;
|
||||
bullet = new BombBulletType(0f, 0f, "clear"){{
|
||||
hitEffect = Fx.pulverize;
|
||||
lifetime = 10f;
|
||||
speed = 1f;
|
||||
splashDamageRadius = 55f;
|
||||
instantDisappear = true;
|
||||
splashDamage = 30f;
|
||||
killShooter = true;
|
||||
hittable = false;
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
eruptor = new UnitType("eruptor"){{
|
||||
speed = 0.4f;
|
||||
drag = 0.4f;
|
||||
@@ -256,6 +233,36 @@ public class UnitTypes implements ContentList{
|
||||
}});
|
||||
}};
|
||||
|
||||
cix = new UnitType("cix"){{
|
||||
drag = 0.1f;
|
||||
speed = 0.4f;
|
||||
hitsize = 9f;
|
||||
health = 140;
|
||||
baseElevation = 0.51f;
|
||||
|
||||
legCount = 6;
|
||||
legMoveSpace = 0.9f;
|
||||
legLength = 34f;
|
||||
rotateShooting = false;
|
||||
legExtension = -15;
|
||||
legBaseOffset = 8f;
|
||||
landShake = 2f;
|
||||
legSpeed = 0.1f;
|
||||
|
||||
for(boolean b : Mathf.booleans){
|
||||
weapons.add(
|
||||
new Weapon("missiles-mount"){{
|
||||
reload = 20f;
|
||||
x = 4f * Mathf.sign(b);
|
||||
rotate = true;
|
||||
mirror = false;
|
||||
flipSprite = !b;
|
||||
shake = 1f;
|
||||
bullet = Bullets.missileSwarm;
|
||||
}});
|
||||
}
|
||||
}};
|
||||
|
||||
wraith = new UnitType("wraith"){{
|
||||
speed = 3f;
|
||||
accel = 0.08f;
|
||||
|
||||
@@ -13,6 +13,7 @@ import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
@@ -173,9 +174,37 @@ public class Damage{
|
||||
}
|
||||
|
||||
/** Damages all entities and blocks in a radius that are enemies of the team. */
|
||||
public static void damage(Team team, float x, float y, float radius, float damage, boolean complete){
|
||||
public static void damage(Team team, float x, float y, float radius, float damage, boolean air, boolean ground){
|
||||
damage(team, x, y, radius, damage, false, air, ground);
|
||||
}
|
||||
|
||||
/** Applies a status effect to all enemy units in a range. */
|
||||
public static void status(Team team, float x, float y, float radius, StatusEffect effect, float duration, boolean air, boolean ground){
|
||||
Cons<Unitc> cons = entity -> {
|
||||
if(entity.team() == team || entity.dst(x, y) > radius){
|
||||
if(entity.team() == team || !entity.within(x, y, radius) || (entity.isFlying() && !air) || (entity.isGrounded() && !ground)){
|
||||
return;
|
||||
}
|
||||
|
||||
entity.apply(effect, duration);
|
||||
};
|
||||
|
||||
rect.setSize(radius * 2).setCenter(x, y);
|
||||
if(team != null){
|
||||
Units.nearbyEnemies(team, rect, cons);
|
||||
}else{
|
||||
Units.nearby(rect, cons);
|
||||
}
|
||||
}
|
||||
|
||||
/** Damages all entities and blocks in a radius that are enemies of the team. */
|
||||
public static void damage(Team team, float x, float y, float radius, float damage, boolean complete){
|
||||
damage(team, x, y, radius, damage, complete, true, true);
|
||||
}
|
||||
|
||||
/** Damages all entities and blocks in a radius that are enemies of the team. */
|
||||
public static void damage(Team team, float x, float y, float radius, float damage, boolean complete, boolean air, boolean ground){
|
||||
Cons<Unitc> cons = entity -> {
|
||||
if(entity.team() == team || !entity.within(x, y, radius) || (entity.isFlying() && !air) || (entity.isGrounded() && !ground)){
|
||||
return;
|
||||
}
|
||||
float amount = calculateDamage(x, y, entity.getX(), entity.getY(), radius, damage);
|
||||
|
||||
@@ -48,8 +48,6 @@ public abstract class BulletType extends Content{
|
||||
public float splashDamage = 0f;
|
||||
/** Knockback in velocity. */
|
||||
public float knockback;
|
||||
/** Whether this bullet hits tiles. */
|
||||
public boolean hitTiles = true;
|
||||
/** Status effect applied on hit. */
|
||||
public StatusEffect status = StatusEffects.none;
|
||||
/** Intensity of applied status effect in terms of duration. */
|
||||
@@ -139,7 +137,11 @@ public abstract class BulletType extends Content{
|
||||
}
|
||||
|
||||
if(splashDamageRadius > 0){
|
||||
Damage.damage(b.team(), x, y, splashDamageRadius, splashDamage * b.damageMultiplier());
|
||||
Damage.damage(b.team(), x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround);
|
||||
|
||||
if(status != StatusEffects.none){
|
||||
Damage.status(b.team(), x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < lightning; i++){
|
||||
|
||||
@@ -53,7 +53,7 @@ public class LaserBulletType extends BulletType{
|
||||
furthest = null;
|
||||
|
||||
world.raycast(b.tileX(), b.tileY(), world.toTile(b.x() + Tmp.v1.x), world.toTile(b.y() + Tmp.v1.y),
|
||||
(x, y) -> (furthest = world.tile(x, y)) != null && furthest.block().absorbLasers);
|
||||
(x, y) -> (furthest = world.tile(x, y)) != null && furthest.team() != b.team() && furthest.block().absorbLasers);
|
||||
|
||||
float resultLength = furthest != null ? Math.max(6f, b.dst(furthest.worldx(), furthest.worldy())) : length;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
||||
public void update(){
|
||||
type.update(this);
|
||||
|
||||
if(type.hitTiles){
|
||||
if(type.collidesTiles){
|
||||
world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> {
|
||||
|
||||
Tilec tile = world.ent(x, y);
|
||||
|
||||
@@ -43,8 +43,9 @@ public class UnitType extends UnlockableContent{
|
||||
public int commandLimit = 24;
|
||||
public float baseElevation = 0f;
|
||||
|
||||
//TODO document
|
||||
public int legCount = 4;
|
||||
public float legLength = 24f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f;
|
||||
public float legLength = 10f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f, legExtension = 0;
|
||||
|
||||
public int itemCapacity = 30;
|
||||
public int drillTier = -1;
|
||||
@@ -62,7 +63,8 @@ public class UnitType extends UnlockableContent{
|
||||
public Sound deathSound = Sounds.bang;
|
||||
|
||||
public Array<Weapon> weapons = new Array<>();
|
||||
public TextureRegion baseRegion, legRegion, region, shadowRegion, cellRegion, occlusionRegion, jointRegion, footRegion, legBaseRegion;
|
||||
public TextureRegion baseRegion, legRegion, region, shadowRegion, cellRegion,
|
||||
occlusionRegion, jointRegion, footRegion, legBaseRegion, baseJointRegion;
|
||||
|
||||
public UnitType(String name){
|
||||
super(name);
|
||||
@@ -117,6 +119,7 @@ public class UnitType extends UnlockableContent{
|
||||
region = Core.atlas.find(name);
|
||||
legRegion = Core.atlas.find(name + "-leg");
|
||||
jointRegion = Core.atlas.find(name + "-joint");
|
||||
baseJointRegion = Core.atlas.find(name + "-joint-base");
|
||||
footRegion = Core.atlas.find(name + "-foot");
|
||||
legBaseRegion = Core.atlas.find(name + "-leg-base", name + "-leg");
|
||||
baseRegion = Core.atlas.find(name + "-base");
|
||||
@@ -356,6 +359,7 @@ public class UnitType extends UnlockableContent{
|
||||
int flips = Mathf.sign(flip);
|
||||
|
||||
Vec2 position = legOffset.trns(angle, legBaseOffset).add(unit);
|
||||
Tmp.v1.set(leg.base).sub(leg.joint).inv().setLength(legExtension);
|
||||
|
||||
Draw.color();
|
||||
|
||||
@@ -363,12 +367,19 @@ public class UnitType extends UnlockableContent{
|
||||
Lines.line(legRegion, position.x, position.y, leg.joint.x, leg.joint.y, CapStyle.none, 0);
|
||||
|
||||
Lines.stroke(legBaseRegion.getHeight() * Draw.scl * flips);
|
||||
Lines.line(legBaseRegion, leg.joint.x, leg.joint.y, leg.base.x, leg.base.y, CapStyle.none, 0);
|
||||
Lines.line(legBaseRegion, leg.joint.x + Tmp.v1.x, leg.joint.y + Tmp.v1.y, leg.base.x, leg.base.y, CapStyle.none, 0);
|
||||
|
||||
float angle2 = position.angleTo(leg.base);
|
||||
|
||||
Draw.rect(jointRegion, leg.joint.x, leg.joint.y);
|
||||
if(jointRegion.found()){
|
||||
Draw.rect(jointRegion, leg.joint.x, leg.joint.y);
|
||||
}
|
||||
|
||||
Draw.rect(footRegion, leg.base.x, leg.base.y, angle2);
|
||||
|
||||
if(baseJointRegion.found()){
|
||||
Draw.rect(baseJointRegion, position.x, position.y, rotation);
|
||||
}
|
||||
}
|
||||
|
||||
Draw.reset();
|
||||
|
||||
Reference in New Issue
Block a user