Unit tweaks

This commit is contained in:
Anuken
2020-06-08 16:33:21 -04:00
parent bb9855e830
commit 43762e82a8
46 changed files with 841 additions and 836 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

View File

@@ -242,3 +242,4 @@
63502=segment|block-segment-medium 63502=segment|block-segment-medium
63501=large-overdrive-projector|block-large-overdrive-projector-medium 63501=large-overdrive-projector|block-large-overdrive-projector-medium
63500=disassembler|block-disassembler-medium 63500=disassembler|block-disassembler-medium
63499=advanced-reconstructor|block-advanced-reconstructor-medium

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

After

Width:  |  Height:  |  Size: 763 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 856 KiB

After

Width:  |  Height:  |  Size: 851 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 124 KiB

View File

@@ -77,7 +77,7 @@ public class Blocks implements ContentList{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, segment, duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown, segment,
//units //units
groundFactory, airFactory, navalFactory, basicReconstructor, repairPoint, groundFactory, airFactory, navalFactory, basicReconstructor, advancedReconstructor, repairPoint,
//campaign //campaign
launchPad, launchPadLarge, coreSilo, dataProcessor, launchPad, launchPadLarge, coreSilo, dataProcessor,
@@ -1722,8 +1722,6 @@ public class Blocks implements ContentList{
//endregion //endregion
//region units //region units
//for testing only.
groundFactory = new UnitFactory("ground-factory"){{ groundFactory = new UnitFactory("ground-factory"){{
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70)); requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 70));
plans = new UnitPlan[]{ plans = new UnitPlan[]{
@@ -1768,12 +1766,29 @@ public class Blocks implements ContentList{
constructTime = 60f * 5f; constructTime = 60f * 5f;
upgrades = new UnitType[][]{ upgrades = new UnitType[][]{
{UnitTypes.tau, UnitTypes.oculon},
{UnitTypes.dagger, UnitTypes.titan}, {UnitTypes.dagger, UnitTypes.titan},
{UnitTypes.crawler, UnitTypes.eruptor}, {UnitTypes.crawler, UnitTypes.eruptor},
{UnitTypes.wraith, UnitTypes.ghoul}, {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"){{ repairPoint = new RepairPoint("repair-point"){{
requirements(Category.units, ItemStack.with(Items.lead, 15, Items.copper, 15, Items.silicon, 15)); requirements(Category.units, ItemStack.with(Items.lead, 15, Items.copper, 15, Items.silicon, 15));
repairSpeed = 0.5f; repairSpeed = 0.5f;

View File

@@ -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"){{ fortress = new UnitType("fortress"){{
speed = 0.38f; speed = 0.38f;
hitsize = 13f; hitsize = 13f;
@@ -252,6 +285,8 @@ public class UnitTypes implements ContentList{
legLengthScl = 1f; legLengthScl = 1f;
rippleScale = 2f; rippleScale = 2f;
legSpeed = 0.2f; legSpeed = 0.2f;
legSplashDamage = 32;
legSplashRange = 30;
for(boolean b : Mathf.booleans){ for(boolean b : Mathf.booleans){
weapons.add( weapons.add(
@@ -479,37 +514,6 @@ public class UnitTypes implements ContentList{
hitsize = 8f; 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"){{ trident = new UnitType("trident"){{
health = 500; health = 500;

View File

@@ -31,6 +31,7 @@ public class LaserBulletType extends BulletType{
despawnEffect = Fx.none; despawnEffect = Fx.none;
shootEffect = Fx.hitLancer; shootEffect = Fx.hitLancer;
smokeEffect = Fx.none; smokeEffect = Fx.none;
collides = false;
hitSize = 4; hitSize = 4;
lifetime = 16f; lifetime = 16f;
pierce = true; pierce = true;

View File

@@ -107,7 +107,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
public void update(){ public void update(){
type.update(this); type.update(this);
if(type.collidesTiles){ if(type.collidesTiles && type.collides){
world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> { world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> {
Tilec tile = world.ent(x, y); Tilec tile = world.ent(x, y);

View File

@@ -90,6 +90,10 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc, Elevatio
if(type.landShake > 0){ if(type.landShake > 0){
Effects.shake(type.landShake, type.landShake, l.base); 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; l.group = group;

View File

@@ -20,8 +20,7 @@ public class InverseKinematics{
result.set(mat2[0].dot(end), mat2[1].dot(end)); result.set(mat2[0].dot(end), mat2[1].dot(end));
float len = result.len(); float len = result.len();
float dist = Math.max(0, Math.min(lengthA, (len + (lengthA * lengthA - lengthB * lengthB) / len) / 2)); 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, Mathf.sqrt(lengthA * lengthA - dist * dist));
Vec2 src = temp.set(dist, e);
result.set(mat1[0].dot(src), mat1[1].dot(src)); result.set(mat1[0].dot(src), mat1[1].dot(src));
return dist > 0 && dist < lengthA; return dist > 0 && dist < lengthA;

View File

@@ -13,6 +13,7 @@ import arc.util.*;
import arc.util.ArcAnnotate.*; import arc.util.ArcAnnotate.*;
import mindustry.ai.types.*; import mindustry.ai.types.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.entities.units.*; import mindustry.entities.units.*;
@@ -47,6 +48,7 @@ public class UnitType extends UnlockableContent{
//TODO document //TODO document
public int legCount = 4, legGroupSize = 2; 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 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 boolean flipBackLegs = true;
public int itemCapacity = 30; public int itemCapacity = 30;
@@ -413,7 +415,7 @@ public class UnitType extends UnlockableContent{
float ft = sin*(2.5f + (unit.hitSize()-8f)/2f); float ft = sin*(2.5f + (unit.hitSize()-8f)/2f);
float boostTrns = e * 2f; float boostTrns = e * 2f;
Floor floor = unit.floorOn(); Floor floor = unit.isFlying() ? Blocks.air.asFloor() : unit.floorOn();
if(floor.isLiquid){ if(floor.isLiquid){
Draw.color(Color.white, floor.mapColor, 0.5f); Draw.color(Color.white, floor.mapColor, 0.5f);

View File

@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=ea6aad4ca7f67aa74c60dd77442197ee32fa756c archash=ceaaf0c6e4ec6659053112d1de712874c5b9c789