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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 331 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 373 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 415 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

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

Before After
Before After

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
63501=large-overdrive-projector|block-large-overdrive-projector-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

Before After
Before After

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Before After
Before After

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,
//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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

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