More components, less entities

This commit is contained in:
Anuken
2020-02-02 23:38:16 -05:00
parent f2f31120a0
commit f937cb30f0
77 changed files with 586 additions and 570 deletions

View File

@@ -431,11 +431,11 @@ public class Bullets implements ContentList{
}
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(Fx.fireballsmoke, b.x, b.y);
Fx.fireballsmoke.at(b.x, b.y);
}
if(Mathf.chance(0.1 * Time.delta())){
Effects.effect(Fx.ballfire, b.x, b.y);
Fx.ballfire.at(b.x, b.y);
}
}
};
@@ -519,7 +519,7 @@ public class Bullets implements ContentList{
@Override
public void hit(Bullet b, float hitx, float hity){
Effects.effect(hitEffect, colors[2], hitx, hity);
hitEffect.at(colors[2], hitx, hity);
if(Mathf.chance(0.4)){
Fire.create(world.tileWorld(hitx + Mathf.range(5f), hity + Mathf.range(5f)));
}

View File

@@ -6,7 +6,7 @@ import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.ctype.ContentList;
import mindustry.entities.Effects.*;
import mindustry.entities.*;
import mindustry.entities.effect.GroundEffectEntity.*;
import mindustry.entities.type.*;
import mindustry.graphics.*;

View File

@@ -75,9 +75,9 @@ public class Mechs implements ContentList{
if(player.timer.get(Player.timerAbility, healReload)){
if(indexer.eachBlock(player, healRange, other -> other.entity.damaged(), other -> {
other.entity.healBy(other.entity.maxHealth() * healPercent / 100f);
Effects.effect(Fx.healBlockFull, Pal.heal, other.drawx(), other.drawy(), other.block().size);
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
})){
Effects.effect(Fx.healWave, player);
Fx.healWave.at(player);
}
}
}
@@ -193,14 +193,14 @@ public class Mechs implements ContentList{
Units.nearby(player.getTeam(), player.x, player.y, healRange, unit -> {
if(unit.health < unit.maxHealth()){
Effects.effect(Fx.heal, unit);
Fx.heal.at(unit);
wasHealed = true;
}
unit.healBy(healAmount);
});
if(wasHealed){
Effects.effect(Fx.healWave, player);
Fx.healWave.at(player);
}
}
}
@@ -316,10 +316,10 @@ public class Mechs implements ContentList{
indexer.eachBlock(player, effectRange, other -> other.entity.damaged(), other -> {
other.entity.applyBoost(1.5f, effectDuration);
Effects.effect(Fx.healBlockFull, Pal.heal, other.drawx(), other.drawy(), other.block().size);
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
});
Effects.effect(Fx.overdriveWave, player);
Fx.overdriveWave.at(player);
}
}
};
@@ -367,7 +367,7 @@ public class Mechs implements ContentList{
public void update(Player player){
float scl = scld(player);
if(Mathf.chance(Time.delta() * (0.15 * scl))){
Effects.effect(Fx.hitLancer, Pal.lancerLaser, player.x, player.y);
Fx.hitLancer.at(Pal.lancerLaser, player.x, player.y);
Lightning.create(player.getTeam(), Pal.lancerLaser, 10f * Vars.state.rules.playerDamageMultiplier,
player.x + player.velocity().x, player.y + player.velocity().y, player.rotation, 14);
}

View File

@@ -24,7 +24,7 @@ public class StatusEffects implements ContentList{
opposite(wet,freezing);
trans(tarred, ((unit, time, newTime, result) -> {
unit.damage(1f);
Effects.effect(Fx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
Fx.burning.at(unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f));
result.set(this, Math.min(time + newTime, 300f));
}));
});