Naval unit tweaks

This commit is contained in:
Anuken
2020-07-17 11:15:07 -04:00
parent b2b6ddb5b2
commit 1bb621bbd5
22 changed files with 2008 additions and 1829 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 187 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 188 KiB

View File

@@ -48,7 +48,7 @@ public class Bullets implements ContentList{
artilleryDense = new ArtilleryBulletType(3f, 12, "shell"){{ artilleryDense = new ArtilleryBulletType(3f, 12, "shell"){{
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 50f; lifetime = 80f;
width = height = 11f; width = height = 11f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f; splashDamageRadius = 25f;
@@ -69,7 +69,7 @@ public class Bullets implements ContentList{
artilleryPlastic = new ArtilleryBulletType(3.4f, 12, "shell"){{ artilleryPlastic = new ArtilleryBulletType(3.4f, 12, "shell"){{
hitEffect = Fx.plasticExplosion; hitEffect = Fx.plasticExplosion;
knockback = 1f; knockback = 1f;
lifetime = 55f; lifetime = 80f;
width = height = 13f; width = height = 13f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 35f; splashDamageRadius = 35f;
@@ -83,7 +83,7 @@ public class Bullets implements ContentList{
artilleryHoming = new ArtilleryBulletType(3f, 12, "shell"){{ artilleryHoming = new ArtilleryBulletType(3f, 12, "shell"){{
hitEffect = Fx.flakExplosion; hitEffect = Fx.flakExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 45f; lifetime = 80f;
width = height = 11f; width = height = 11f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f; splashDamageRadius = 25f;
@@ -97,7 +97,7 @@ public class Bullets implements ContentList{
artilleryIncendiary = new ArtilleryBulletType(3f, 12, "shell"){{ artilleryIncendiary = new ArtilleryBulletType(3f, 12, "shell"){{
hitEffect = Fx.blastExplosion; hitEffect = Fx.blastExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 60f; lifetime = 80f;
width = height = 13f; width = height = 13f;
collidesTiles = false; collidesTiles = false;
splashDamageRadius = 25f; splashDamageRadius = 25f;
@@ -111,7 +111,7 @@ public class Bullets implements ContentList{
artilleryExplosive = new ArtilleryBulletType(2f, 12, "shell"){{ artilleryExplosive = new ArtilleryBulletType(2f, 12, "shell"){{
hitEffect = Fx.blastExplosion; hitEffect = Fx.blastExplosion;
knockback = 0.8f; knockback = 0.8f;
lifetime = 70f; lifetime = 80f;
width = height = 14f; width = height = 14f;
collidesTiles = false; collidesTiles = false;
ammoMultiplier = 4f; ammoMultiplier = 4f;

View File

@@ -659,6 +659,12 @@ public class Fx{
}), }),
overclocked = new Effect(50f, e -> {
color(Pal.accent);
Fill.square(e.x, e.y, e.fslope() * 2f, 45f);
}),
dropItem = new Effect(20f, e -> { dropItem = new Effect(20f, e -> {
float length = 20f * e.finpow(); float length = 20f * e.finpow();
float size = 7f * e.fout(); float size = 7f * e.fout();

View File

@@ -9,7 +9,7 @@ import mindustry.type.StatusEffect;
import static mindustry.Vars.*; import static mindustry.Vars.*;
public class StatusEffects implements ContentList{ public class StatusEffects implements ContentList{
public static StatusEffect none, burning, freezing, wet, melting, sapped, tarred, overdrive, shielded, shocked, blasted, corroded, boss; public static StatusEffect none, burning, freezing, wet, melting, sapped, tarred, overdrive, overclock, shielded, shocked, blasted, corroded, boss;
@Override @Override
public void load(){ public void load(){
@@ -100,6 +100,14 @@ public class StatusEffects implements ContentList{
permanent = true; permanent = true;
}}; }};
overclock = new StatusEffect("overclock"){{
speedMultiplier = 1.15f;
damageMultiplier = 1.15f;
reloadMultiplier = 1.25f;
effectChance = 0.07f;
effect = Fx.overclocked;
}};
shielded = new StatusEffect("shielded"){{ shielded = new StatusEffect("shielded"){{
armorMultiplier = 3f; armorMultiplier = 3f;
}}; }};

View File

@@ -674,6 +674,8 @@ public class UnitTypes implements ContentList{
hitsize = 9f; hitsize = 9f;
health = 220; health = 220;
immunities = ObjectSet.with(StatusEffects.wet); immunities = ObjectSet.with(StatusEffects.wet);
trailLength = 20;
weapons.add(new Weapon("mount-weapon"){{ weapons.add(new Weapon("mount-weapon"){{
reload = 12f; reload = 12f;
x = 4f; x = 4f;
@@ -700,7 +702,7 @@ public class UnitTypes implements ContentList{
keepVelocity = false; keepVelocity = false;
splashDamageRadius = 25f; splashDamageRadius = 25f;
splashDamage = 10f; splashDamage = 10f;
lifetime = 120f; lifetime = 80f;
trailColor = Color.gray; trailColor = Color.gray;
backColor = Pal.bulletYellowBack; backColor = Pal.bulletYellowBack;
frontColor = Pal.bulletYellow; frontColor = Pal.bulletYellow;
@@ -713,17 +715,40 @@ public class UnitTypes implements ContentList{
}}; }};
minke = new UnitType("minke"){{ minke = new UnitType("minke"){{
speed = 1.3f; speed = 0.9f;
drag = 0.1f; drag = 0.15f;
hitsize = 8f; hitsize = 11f;
health = 400; health = 430;
armor = 4f;
immunities = ObjectSet.with(StatusEffects.wet); immunities = ObjectSet.with(StatusEffects.wet);
trailLength = 20;
trailX = 5.5f;
trailY = -4f;
trailScl = 2f;
abilities.add(new StatusFieldAbility(StatusEffects.overclock, 60f * 10, 60f * 10f, 60f));
weapons.add(new Weapon("mount-weapon"){{ weapons.add(new Weapon("mount-weapon"){{
reload = 10f; reload = 15f;
x = 1.25f; x = 5f;
y = 3.5f;
rotate = true; rotate = true;
rotateSpeed = 5f;
inaccuracy = 10f;
ejectEffect = Fx.shellEjectSmall; ejectEffect = Fx.shellEjectSmall;
bullet = Bullets.standardCopper; bullet = Bullets.flakLead;
}});
weapons.add(new Weapon("artillery-mount"){{
reload = 30f;
x = 5f;
y = -5f;
rotate = true;
inaccuracy = 2f;
rotateSpeed = 2f;
shake = 1.5f;
ejectEffect = Fx.shellEjectMedium;
bullet = Bullets.artilleryIncendiary;
}}); }});
}}; }};

View File

@@ -11,7 +11,7 @@ public class StatusFieldAbility implements Ability{
public @NonNull StatusEffect effect; public @NonNull StatusEffect effect;
public float duration = 60, reload = 100, range = 20; public float duration = 60, reload = 100, range = 20;
public Effect applyEffect = Fx.heal; public Effect applyEffect = Fx.heal;
public Effect activeEffect = Fx.healWave; public Effect activeEffect = Fx.overdriveWave;
StatusFieldAbility(){} StatusFieldAbility(){}

View File

@@ -15,6 +15,7 @@ public class ArtilleryBulletType extends BasicBulletType{
scaleVelocity = true; scaleVelocity = true;
hitShake = 1f; hitShake = 1f;
hitSound = Sounds.explosion; hitSound = Sounds.explosion;
shootEffect = Fx.shootBig;
trailEffect = Fx.artilleryTrail; trailEffect = Fx.artilleryTrail;
} }

View File

@@ -75,7 +75,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
if(!hovering && isGrounded() && floor.isLiquid){ if(!hovering && isGrounded() && floor.isLiquid){
if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= 7f){ if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= 7f){
floor.walkEffect.at(x, y, 1f, floor.mapColor); floor.walkEffect.at(x, y, hitSize() / 8f, floor.mapColor);
splashTimer = 0f; splashTimer = 0f;
} }
} }

View File

@@ -73,8 +73,8 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
if(rect.overlaps(rect2)){ if(rect.overlaps(rect2)){
unit.apply(liquid.effect, 60 * 2); unit.apply(liquid.effect, 60 * 2);
if(unit.vel().len() > 0.1){ if(unit.vel.len() > 0.1){
Fx.ripple.at(unit.x(), unit.y(), unit.type().rippleScale, liquid.color); Fx.ripple.at(unit.x, unit.y, unit.type().rippleScale, liquid.color);
} }
} }
} }

View File

@@ -20,7 +20,7 @@ abstract class StatusComp implements Posc, Flyingc{
private Seq<StatusEntry> statuses = new Seq<>(); private Seq<StatusEntry> statuses = new Seq<>();
private transient Bits applied = new Bits(content.getBy(ContentType.status).size); private transient Bits applied = new Bits(content.getBy(ContentType.status).size);
@ReadOnly transient float speedMultiplier, damageMultiplier, armorMultiplier; @ReadOnly transient float speedMultiplier = 1, damageMultiplier = 1, armorMultiplier = 1, reloadMultiplier = 1;
/** @return damage taken based on status armor multipliers */ /** @return damage taken based on status armor multipliers */
float getShieldDamage(float amount){ float getShieldDamage(float amount){
@@ -108,7 +108,7 @@ abstract class StatusComp implements Posc, Flyingc{
} }
applied.clear(); applied.clear();
speedMultiplier = damageMultiplier = armorMultiplier = 1f; speedMultiplier = damageMultiplier = armorMultiplier = reloadMultiplier = 1f;
if(statuses.isEmpty()) return; if(statuses.isEmpty()) return;
@@ -128,6 +128,7 @@ abstract class StatusComp implements Posc, Flyingc{
speedMultiplier *= entry.effect.speedMultiplier; speedMultiplier *= entry.effect.speedMultiplier;
armorMultiplier *= entry.effect.armorMultiplier; armorMultiplier *= entry.effect.armorMultiplier;
damageMultiplier *= entry.effect.damageMultiplier; damageMultiplier *= entry.effect.damageMultiplier;
reloadMultiplier *= entry.effect.reloadMultiplier;
entry.effect.update(base(), entry.time); entry.effect.update(base(), entry.time);
} }
} }

View File

@@ -1,17 +1,54 @@
package mindustry.entities.comp; package mindustry.entities.comp;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.world.blocks.environment.*; import mindustry.world.blocks.environment.*;
import static mindustry.Vars.collisions; import static mindustry.Vars.*;
//just a proof of concept //just a proof of concept
@Component @Component
abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc{ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
@Import float x, y; @Import float x, y, rotation;
@Import UnitType type;
private transient Trail tleft = new Trail(1), tright = new Trail(1);
private transient Color trailColor = Blocks.water.mapColor.cpy().mul(1.5f);
@Override
public void update(){
for(int i = 0; i < 2; i++){
Trail t = i == 0 ? tleft : tright;
t.length = type.trailLength;
int sign = i == 0 ? -1 : 1;
float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y;
t.update(cx, cy);
}
}
public void draw(){
float z = Draw.z();
Draw.z(Layer.debris);
Floor floor = floorOn();
Color color = Tmp.c1.set(floor.mapColor).mul(1.7f);
trailColor.lerp(color, Mathf.clamp(Time.delta() * 0.04f));
tleft.draw(trailColor, type.trailScl);
tright.draw(trailColor, type.trailScl);
Draw.z(z);
}
@Replace @Replace
@Override @Override

View File

@@ -14,7 +14,7 @@ import static mindustry.Vars.*;
@Component @Component
abstract class WeaponsComp implements Teamc, Posc, Rotc{ abstract class WeaponsComp implements Teamc, Posc, Rotc{
@Import float x, y, rotation; @Import float x, y, rotation, reloadMultiplier;
/** minimum cursor distance from unit, fixes 'cross-eyed' shooting */ /** minimum cursor distance from unit, fixes 'cross-eyed' shooting */
static final float minAimDst = 18f; static final float minAimDst = 18f;
@@ -82,7 +82,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
public void update(){ public void update(){
for(WeaponMount mount : mounts){ for(WeaponMount mount : mounts){
Weapon weapon = mount.weapon; Weapon weapon = mount.weapon;
mount.reload = Math.max(mount.reload - Time.delta(), 0); mount.reload = Math.max(mount.reload - Time.delta() * reloadMultiplier, 0);
//flip weapon shoot side for alternating weapons at half reload //flip weapon shoot side for alternating weapons at half reload
if(weapon.otherSide != -1 && weapon.alternate && mount.side == weapon.flipSprite && if(weapon.otherSide != -1 && weapon.alternate && mount.side == weapon.flipSprite &&

View File

@@ -15,8 +15,10 @@ public class StatusEffect extends MappableContent{
public float damageMultiplier = 1f; public float damageMultiplier = 1f;
/** Unit armor multiplier. */ /** Unit armor multiplier. */
public float armorMultiplier = 1f; public float armorMultiplier = 1f;
/** Unit speed multiplier (buggy) */ /** Unit speed multiplier */
public float speedMultiplier = 1f; public float speedMultiplier = 1f;
/** Unit speed multiplier */
public float reloadMultiplier = 1f;
/** Damage per frame. */ /** Damage per frame. */
public float damage; public float damage;
/** Chance of effect appearing. */ /** Chance of effect appearing. */

View File

@@ -74,6 +74,7 @@ public class UnitType extends UnlockableContent{
public boolean drawCell = true, drawItems = true, drawShields = true; public boolean drawCell = true, drawItems = true, drawShields = true;
public int parts = 0; public int parts = 0;
public int trailLength = 3; public int trailLength = 3;
public float trailX = 4f, trailY = -3f, trailScl = 1f;
public ObjectSet<StatusEffect> immunities = new ObjectSet<>(); public ObjectSet<StatusEffect> immunities = new ObjectSet<>();
public Sound deathSound = Sounds.bang; public Sound deathSound = Sounds.bang;
@@ -352,7 +353,7 @@ public class UnitType extends UnlockableContent{
if(unit instanceof Trailc){ if(unit instanceof Trailc){
Trail trail = ((Trailc)unit).trail(); Trail trail = ((Trailc)unit).trail();
trail.draw(unit.team.color, (engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f) * scale)); trail.draw(unit.team.color, (engineSize + Mathf.absin(Time.time(), 2f, engineSize / 4f) * scale) * trailScl);
} }
Draw.color(unit.team.color); Draw.color(unit.team.color);