Unit tweaks
This commit is contained in:
@@ -77,7 +77,7 @@ public class Blocks implements ContentList{
|
||||
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, segment,
|
||||
|
||||
//units
|
||||
groundFactory, airFactory, navalFactory, basicReconstructor, repairPoint,
|
||||
groundFactory, airFactory, navalFactory, basicReconstructor, advancedReconstructor, repairPoint,
|
||||
|
||||
//campaign
|
||||
launchPad, launchPadLarge, coreSilo, dataProcessor,
|
||||
@@ -1722,8 +1722,6 @@ public class Blocks implements ContentList{
|
||||
//endregion
|
||||
//region units
|
||||
|
||||
//for testing only.
|
||||
|
||||
groundFactory = new UnitFactory("ground-factory"){{
|
||||
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70));
|
||||
plans = new UnitPlan[]{
|
||||
@@ -1768,12 +1766,29 @@ public class Blocks implements ContentList{
|
||||
constructTime = 60f * 5f;
|
||||
|
||||
upgrades = new UnitType[][]{
|
||||
{UnitTypes.tau, UnitTypes.oculon},
|
||||
{UnitTypes.dagger, UnitTypes.titan},
|
||||
{UnitTypes.crawler, UnitTypes.eruptor},
|
||||
{UnitTypes.wraith, UnitTypes.ghoul},
|
||||
};
|
||||
}};
|
||||
|
||||
advancedReconstructor = new Reconstructor("advanced-reconstructor"){{
|
||||
requirements(Category.units, ItemStack.with(Items.copper, 50, Items.lead, 120, Items.silicon, 230));
|
||||
|
||||
size = 5;
|
||||
consumes.power(6f);
|
||||
consumes.items(ItemStack.with(Items.silicon, 60, Items.titanium, 60));
|
||||
itemCapacity = 80;
|
||||
|
||||
constructTime = 60f * 15f;
|
||||
|
||||
upgrades = new UnitType[][]{
|
||||
{UnitTypes.ghoul, UnitTypes.revenant},
|
||||
{UnitTypes.titan, UnitTypes.fortress},
|
||||
};
|
||||
}};
|
||||
|
||||
repairPoint = new RepairPoint("repair-point"){{
|
||||
requirements(Category.units, ItemStack.with(Items.lead, 15, Items.copper, 15, Items.silicon, 15));
|
||||
repairSpeed = 0.5f;
|
||||
|
||||
@@ -96,26 +96,26 @@ public class UnitTypes implements ContentList{
|
||||
}};
|
||||
|
||||
tau = new UnitType("tau"){{
|
||||
itemCapacity = 60;
|
||||
canBoost = true;
|
||||
boostMultiplier = 1.5f;
|
||||
speed = 0.5f;
|
||||
hitsize = 8f;
|
||||
health = 100f;
|
||||
buildSpeed = 0.8f;
|
||||
itemCapacity = 60;
|
||||
canBoost = true;
|
||||
boostMultiplier = 1.5f;
|
||||
speed = 0.5f;
|
||||
hitsize = 8f;
|
||||
health = 100f;
|
||||
buildSpeed = 0.8f;
|
||||
|
||||
weapons.add(new Weapon("heal-weapon"){{
|
||||
shootY = 1.5f;
|
||||
reload = 24f;
|
||||
x = 1f;
|
||||
shootX = 3.5f;
|
||||
alternate = false;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBullet;
|
||||
shootSound = Sounds.pew;
|
||||
}});
|
||||
}
|
||||
weapons.add(new Weapon("heal-weapon"){{
|
||||
shootY = 1.5f;
|
||||
reload = 24f;
|
||||
x = 1f;
|
||||
shootX = 3.5f;
|
||||
alternate = false;
|
||||
ejectEffect = Fx.none;
|
||||
recoil = 2f;
|
||||
bullet = Bullets.healBullet;
|
||||
shootSound = Sounds.pew;
|
||||
}});
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -145,6 +145,39 @@ public class UnitTypes implements ContentList{
|
||||
}*/
|
||||
};
|
||||
|
||||
oculon = new UnitType("oculon"){{
|
||||
drillTier = 1;
|
||||
hitsize = 9f;
|
||||
boostMultiplier = 2f;
|
||||
itemCapacity = 20;
|
||||
health = 230f;
|
||||
buildSpeed = 1.5f;
|
||||
canBoost = true;
|
||||
|
||||
speed = 0.4f;
|
||||
hitsize = 10f;
|
||||
|
||||
weapons.add(new Weapon("beam-weapon"){{
|
||||
shake = 2f;
|
||||
shootY = 4f;
|
||||
shootX = 6f;
|
||||
x = 0.25f;
|
||||
reload = 50f;
|
||||
alternate = true;
|
||||
recoil = 4f;
|
||||
shootSound = Sounds.laser;
|
||||
|
||||
bullet = new LaserBulletType(){{
|
||||
damage = 20f;
|
||||
recoil = 1f;
|
||||
sideAngle = 45f;
|
||||
sideWidth = 1f;
|
||||
sideLength = 70f;
|
||||
colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white};
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
fortress = new UnitType("fortress"){{
|
||||
speed = 0.38f;
|
||||
hitsize = 13f;
|
||||
@@ -252,6 +285,8 @@ public class UnitTypes implements ContentList{
|
||||
legLengthScl = 1f;
|
||||
rippleScale = 2f;
|
||||
legSpeed = 0.2f;
|
||||
legSplashDamage = 32;
|
||||
legSplashRange = 30;
|
||||
|
||||
for(boolean b : Mathf.booleans){
|
||||
weapons.add(
|
||||
@@ -479,37 +514,6 @@ public class UnitTypes implements ContentList{
|
||||
hitsize = 8f;
|
||||
}};
|
||||
|
||||
oculon = new UnitType("oculon"){{
|
||||
drillTier = -1;
|
||||
speed = 0.6f;
|
||||
hitsize = 9f;
|
||||
boostMultiplier = 2f;
|
||||
itemCapacity = 15;
|
||||
health = 160f;
|
||||
buildSpeed = 0.9f;
|
||||
canBoost = true;
|
||||
|
||||
weapons.add(new Weapon("beam-weapon"){{
|
||||
shake = 2f;
|
||||
shootY = 1f;
|
||||
x = 1f;
|
||||
shootX = 3f;
|
||||
reload = 50f;
|
||||
alternate = true;
|
||||
recoil = 4f;
|
||||
shootSound = Sounds.laser;
|
||||
|
||||
bullet = new LaserBulletType(){{
|
||||
damage = 20f;
|
||||
recoil = 1f;
|
||||
sideAngle = 45f;
|
||||
sideWidth = 1f;
|
||||
sideLength = 70f;
|
||||
colors = new Color[]{Pal.heal.cpy().a(0.4f), Pal.heal, Color.white};
|
||||
}};
|
||||
}});
|
||||
}};
|
||||
|
||||
trident = new UnitType("trident"){{
|
||||
|
||||
health = 500;
|
||||
|
||||
@@ -31,6 +31,7 @@ public class LaserBulletType extends BulletType{
|
||||
despawnEffect = Fx.none;
|
||||
shootEffect = Fx.hitLancer;
|
||||
smokeEffect = Fx.none;
|
||||
collides = false;
|
||||
hitSize = 4;
|
||||
lifetime = 16f;
|
||||
pierce = true;
|
||||
|
||||
@@ -107,7 +107,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
||||
public void update(){
|
||||
type.update(this);
|
||||
|
||||
if(type.collidesTiles){
|
||||
if(type.collidesTiles && type.collides){
|
||||
world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> {
|
||||
|
||||
Tilec tile = world.ent(x, y);
|
||||
|
||||
@@ -90,6 +90,10 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc, Elevatio
|
||||
if(type.landShake > 0){
|
||||
Effects.shake(type.landShake, type.landShake, l.base);
|
||||
}
|
||||
|
||||
if(type.legSplashDamage > 0){
|
||||
Damage.damage(team(), l.base.x, l.base.y, type.legSplashRange, type.legSplashDamage, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
l.group = group;
|
||||
|
||||
@@ -20,8 +20,7 @@ public class InverseKinematics{
|
||||
result.set(mat2[0].dot(end), mat2[1].dot(end));
|
||||
float len = result.len();
|
||||
float dist = Math.max(0, Math.min(lengthA, (len + (lengthA * lengthA - lengthB * lengthB) / len) / 2));
|
||||
float e = Mathf.sqrt(lengthA * lengthA - dist * dist);
|
||||
Vec2 src = temp.set(dist, e);
|
||||
Vec2 src = temp.set(dist, Mathf.sqrt(lengthA * lengthA - dist * dist));
|
||||
result.set(mat1[0].dot(src), mat1[1].dot(src));
|
||||
|
||||
return dist > 0 && dist < lengthA;
|
||||
|
||||
@@ -13,6 +13,7 @@ import arc.util.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.ai.types.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.units.*;
|
||||
@@ -47,6 +48,7 @@ public class UnitType extends UnlockableContent{
|
||||
//TODO document
|
||||
public int legCount = 4, legGroupSize = 2;
|
||||
public float legLength = 10f, legSpeed = 0.1f, legTrns = 1f, legBaseOffset = 0f, legMoveSpace = 1f, legExtension = 0, legPairOffset = 0, legLengthScl = 1f, kinematicScl = 1f;
|
||||
public float legSplashDamage = 0f, legSplashRange = 5;
|
||||
public boolean flipBackLegs = true;
|
||||
|
||||
public int itemCapacity = 30;
|
||||
@@ -413,7 +415,7 @@ public class UnitType extends UnlockableContent{
|
||||
float ft = sin*(2.5f + (unit.hitSize()-8f)/2f);
|
||||
float boostTrns = e * 2f;
|
||||
|
||||
Floor floor = unit.floorOn();
|
||||
Floor floor = unit.isFlying() ? Blocks.air.asFloor() : unit.floorOn();
|
||||
|
||||
if(floor.isLiquid){
|
||||
Draw.color(Color.white, floor.mapColor, 0.5f);
|
||||
|
||||
Reference in New Issue
Block a user