Files
Mindustry/core/src/mindustry/content/StatusEffects.java
2021-08-11 09:27:06 -04:00

197 lines
5.9 KiB
Java

package mindustry.content;
import arc.*;
import arc.graphics.*;
import arc.math.*;
import mindustry.ctype.*;
import mindustry.game.EventType.*;
import mindustry.type.*;
import mindustry.graphics.*;
import static mindustry.Vars.*;
public class StatusEffects implements ContentList{
public static StatusEffect none, burning, freezing, unmoving, slow, wet, muddy, melting, sapped, tarred, overdrive, overclock, shielded, shocked, blasted, corroded, boss, sporeSlowed, disarmed, electrified, invincible;
@Override
public void load(){
none = new StatusEffect("none");
burning = new StatusEffect("burning"){{
color = Color.valueOf("ffc455");
damage = 0.167f;
effect = Fx.burning;
transitionDamage = 8f;
init(() -> {
opposite(wet, freezing);
affinity(tarred, ((unit, result, time) -> {
unit.damagePierce(transitionDamage);
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
result.set(burning, Math.min(time + result.time, 300f));
}));
});
}};
freezing = new StatusEffect("freezing"){{
color = Color.valueOf("6ecdec");
speedMultiplier = 0.6f;
healthMultiplier = 0.8f;
effect = Fx.freezing;
transitionDamage = 18f;
init(() -> {
opposite(melting, burning);
affinity(blasted, ((unit, result, time) -> {
unit.damagePierce(transitionDamage);
}));
});
}};
unmoving = new StatusEffect("unmoving"){{
color = Pal.gray;
speedMultiplier = 0.001f;
}};
slow = new StatusEffect("slow"){{
color = Pal.lightishGray;
speedMultiplier = 0.4f;
}};
wet = new StatusEffect("wet"){{
color = Color.royal;
speedMultiplier = 0.94f;
effect = Fx.wet;
effectChance = 0.09f;
transitionDamage = 14;
init(() -> {
affinity(shocked, (unit, result, time) -> {
unit.damagePierce(transitionDamage);
if(unit.team == state.rules.waveTeam){
Events.fire(Trigger.shock);
}
});
opposite(burning, melting);
});
}};
muddy = new StatusEffect("muddy"){{
color = Color.valueOf("46382a");
speedMultiplier = 0.94f;
effect = Fx.muddy;
effectChance = 0.09f;
show = false;
}};
melting = new StatusEffect("melting"){{
color = Color.valueOf("ffa166");
speedMultiplier = 0.8f;
healthMultiplier = 0.8f;
damage = 0.3f;
effect = Fx.melting;
init(() -> {
opposite(wet, freezing);
affinity(tarred, (unit, result, time) -> {
unit.damagePierce(8f);
Fx.burning.at(unit.x + Mathf.range(unit.bounds() / 2f), unit.y + Mathf.range(unit.bounds() / 2f));
result.set(melting, Math.min(time + result.time, 200f));
});
});
}};
sapped = new StatusEffect("sapped"){{
color = Pal.sap;
speedMultiplier = 0.7f;
healthMultiplier = 0.8f;
effect = Fx.sapped;
effectChance = 0.1f;
}};
electrified = new StatusEffect("electrified"){{
color = Pal.heal;
speedMultiplier = 0.7f;
reloadMultiplier = 0.6f;
effect = Fx.electrified;
effectChance = 0.1f;
}};
sporeSlowed = new StatusEffect("spore-slowed"){{
color = Pal.spore;
speedMultiplier = 0.8f;
effect = Fx.sapped;
effectChance = 0.04f;
}};
tarred = new StatusEffect("tarred"){{
color = Color.valueOf("313131");
speedMultiplier = 0.6f;
effect = Fx.oily;
init(() -> {
affinity(melting, (unit, result, time) -> result.set(melting, result.time + time));
affinity(burning, (unit, result, time) -> result.set(burning, result.time + time));
});
}};
overdrive = new StatusEffect("overdrive"){{
color = Pal.accent;
healthMultiplier = 0.95f;
speedMultiplier = 1.15f;
damageMultiplier = 1.4f;
damage = -0.01f;
effect = Fx.overdriven;
permanent = true;
}};
overclock = new StatusEffect("overclock"){{
color = Pal.accent;
speedMultiplier = 1.15f;
damageMultiplier = 1.15f;
reloadMultiplier = 1.25f;
effectChance = 0.07f;
effect = Fx.overclocked;
}};
shielded = new StatusEffect("shielded"){{
color = Pal.accent;
healthMultiplier = 3f;
}};
boss = new StatusEffect("boss"){{
color = Pal.health;
permanent = true;
damageMultiplier = 1.3f;
healthMultiplier = 1.5f;
}};
shocked = new StatusEffect("shocked"){{
color = Pal.lancerLaser;
reactive = true;
}};
blasted = new StatusEffect("blasted"){{
color = Color.valueOf("ff795e");
reactive = true;
}};
corroded = new StatusEffect("corroded"){{
color = Pal.plastanium;
damage = 0.1f;
}};
disarmed = new StatusEffect("disarmed"){{
color = Color.valueOf("e9ead3");
disarm = true;
}};
invincible = new StatusEffect("invincible"){{
healthMultiplier = Float.POSITIVE_INFINITY;
}};
}
}