More components, less entities
This commit is contained in:
@@ -21,8 +21,8 @@ import mindustry.ctype.*;
|
||||
import mindustry.ctype.ContentType;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.effect.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.graphics.MultiPacker.*;
|
||||
|
||||
@@ -169,12 +169,12 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
tile.entity.damage(1 * Time.delta());
|
||||
next.entity.damage(1 * Time.delta());
|
||||
if(Mathf.chance(0.1 * Time.delta())){
|
||||
Effects.effect(Fx.fire, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
|
||||
Fx.fire.at((tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
|
||||
}
|
||||
}else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){
|
||||
tile.entity.liquids.remove(liquid, Math.min(tile.entity.liquids.get(liquid), 0.7f * Time.delta()));
|
||||
if(Mathf.chance(0.2f * Time.delta())){
|
||||
Effects.effect(Fx.steam, (tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
|
||||
Fx.steam.at((tile.worldx() + next.worldx()) / 2f, (tile.worldy() + next.worldy()) / 2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -9,10 +9,9 @@ import arc.math.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.entities.effect.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -56,7 +55,7 @@ public class BuildBlock extends Block{
|
||||
@Remote(called = Loc.server)
|
||||
public static void onDeconstructFinish(Tile tile, Block block, int builderID){
|
||||
Team team = tile.getTeam();
|
||||
Effects.effect(Fx.breakBlock, tile.drawx(), tile.drawy(), block.size);
|
||||
Fx.breakBlock.at(tile.drawx(), tile.drawy(), block.size);
|
||||
Events.fire(new BlockBuildEndEvent(tile, playerGroup.getByID(builderID), team, true));
|
||||
tile.remove();
|
||||
if(shouldPlay()) Sounds.breaks.at(tile, calcPitch(false));
|
||||
@@ -76,7 +75,7 @@ public class BuildBlock extends Block{
|
||||
tile.block().playerPlaced(tile);
|
||||
}
|
||||
}
|
||||
Effects.effect(Fx.placeBlock, tile.drawx(), tile.drawy(), block.size);
|
||||
Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size);
|
||||
}
|
||||
|
||||
static boolean shouldPlay(){
|
||||
@@ -155,7 +154,7 @@ public class BuildBlock extends Block{
|
||||
|
||||
@Override
|
||||
public void onDestroyed(Tile tile){
|
||||
Effects.effect(Fx.blockExplosionSmoke, tile);
|
||||
Fx.blockExplosionSmoke.at(tile);
|
||||
|
||||
if(!tile.floor().solid && !tile.floor().isLiquid){
|
||||
RubbleDecal.create(tile.drawx(), tile.drawy(), size);
|
||||
|
||||
@@ -43,9 +43,9 @@ public class Door extends Wall{
|
||||
|
||||
pathfinder.updateTile(tile);
|
||||
if(!entity.open){
|
||||
Effects.effect(door.openfx, tile.drawx(), tile.drawy());
|
||||
door.openfx.at(tile.drawx(), tile.drawy());
|
||||
}else{
|
||||
Effects.effect(door.closefx, tile.drawx(), tile.drawy());
|
||||
door.closefx.at(tile.drawx(), tile.drawy());
|
||||
}
|
||||
Sounds.door.at(tile);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ForceProjector extends Block{
|
||||
private static Cons<AbsorbTrait> shieldConsumer = trait -> {
|
||||
if(trait.canBeAbsorbed() && trait.getTeam() != paramTile.getTeam() && Intersector.isInsideHexagon(trait.getX(), trait.getY(), paramBlock.realRadius(paramEntity) * 2f, paramTile.drawx(), paramTile.drawy())){
|
||||
trait.absorb();
|
||||
Effects.effect(Fx.absorb, trait);
|
||||
Fx.absorb.at(trait);
|
||||
paramEntity.hit = 1f;
|
||||
paramEntity.buildup += trait.getShieldDamage() * paramEntity.warmup;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public class ForceProjector extends Block{
|
||||
entity.radscl = Mathf.lerpDelta(entity.radscl, entity.broken ? 0f : entity.warmup, 0.05f);
|
||||
|
||||
if(Mathf.chance(Time.delta() * entity.buildup / breakage * 0.1f)){
|
||||
Effects.effect(Fx.reactorsmoke, tile.drawx() + Mathf.range(tilesize / 2f), tile.drawy() + Mathf.range(tilesize / 2f));
|
||||
Fx.reactorsmoke.at(tile.drawx() + Mathf.range(tilesize / 2f), tile.drawy() + Mathf.range(tilesize / 2f));
|
||||
}
|
||||
|
||||
entity.warmup = Mathf.lerpDelta(entity.warmup, entity.efficiency(), 0.1f);
|
||||
@@ -130,7 +130,7 @@ public class ForceProjector extends Block{
|
||||
if(entity.buildup >= breakage && !entity.broken){
|
||||
entity.broken = true;
|
||||
entity.buildup = breakage;
|
||||
Effects.effect(Fx.shieldBreak, tile.drawx(), tile.drawy(), radius);
|
||||
Fx.shieldBreak.at(tile.drawx(), tile.drawy(), radius);
|
||||
}
|
||||
|
||||
if(entity.hit > 0f){
|
||||
|
||||
@@ -7,7 +7,6 @@ import arc.graphics.g2d.*;
|
||||
import arc.math.Mathf;
|
||||
import arc.util.*;
|
||||
import mindustry.content.Fx;
|
||||
import mindustry.entities.Effects;
|
||||
import mindustry.entities.type.TileEntity;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
@@ -80,7 +79,7 @@ public class MendProjector extends Block{
|
||||
|
||||
indexer.eachBlock(entity, realRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.healBy(other.entity.maxHealth() * (healPercent + entity.phaseHeat * phaseBoost) / 100f * entity.efficiency());
|
||||
Effects.effect(Fx.healBlockFull, Tmp.c1.set(baseColor).lerp(phaseColor, entity.phaseHeat), other.drawx(), other.drawy(), other.block().size);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Tmp.c1.set(baseColor).lerp(phaseColor, entity.phaseHeat));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@ public class ChargeTurret extends PowerTurret{
|
||||
useAmmo(tile);
|
||||
|
||||
tr.trns(entity.rotation, size * tilesize / 2);
|
||||
Effects.effect(chargeBeginEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
chargeBeginEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
|
||||
for(int i = 0; i < chargeEffects; i++){
|
||||
Time.run(Mathf.random(chargeMaxDelay), () -> {
|
||||
if(!isTurret(tile)) return;
|
||||
tr.trns(entity.rotation, size * tilesize / 2);
|
||||
Effects.effect(chargeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
chargeEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CooledTurret extends Turret{
|
||||
entity.liquids.remove(liquid, used);
|
||||
|
||||
if(Mathf.chance(0.06 * used)){
|
||||
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||
coolEffect.at(tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class LaserTurret extends PowerTurret{
|
||||
entity.liquids.remove(liquid, used);
|
||||
|
||||
if(Mathf.chance(0.06 * used)){
|
||||
Effects.effect(coolEffect, tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||
coolEffect.at(tile.drawx() + Mathf.range(size * tilesize / 2f), tile.drawy() + Mathf.range(size * tilesize / 2f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,8 +102,8 @@ public class LiquidTurret extends Turret{
|
||||
|
||||
TurretEntity entity = tile.ent();
|
||||
|
||||
Effects.effect(type.shootEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
Effects.effect(type.smokeEffect, entity.liquids.current().color, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
type.shootEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation, entity.liquids.current().color);
|
||||
type.smokeEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation, entity.liquids.current().color);
|
||||
//shootSound.at(tile);
|
||||
|
||||
if(shootShake > 0){
|
||||
|
||||
@@ -279,8 +279,8 @@ public abstract class Turret extends Block{
|
||||
|
||||
TurretEntity entity = tile.ent();
|
||||
|
||||
Effects.effect(shootEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
Effects.effect(smokeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
shootEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
smokeEffect.at(tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
shootSound.at(tile, Mathf.random(0.9f, 1.1f));
|
||||
|
||||
if(shootShake > 0){
|
||||
@@ -294,7 +294,7 @@ public abstract class Turret extends Block{
|
||||
if(!isTurret(tile)) return;
|
||||
TurretEntity entity = tile.ent();
|
||||
|
||||
Effects.effect(ammoUseEffect, tile.drawx() - Angles.trnsx(entity.rotation, ammoEjectBack),
|
||||
ammoUseEffect.at(tile.drawx() - Angles.trnsx(entity.rotation, ammoEjectBack),
|
||||
tile.drawy() - Angles.trnsy(entity.rotation, ammoEjectBack), entity.rotation);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
|
||||
@@ -8,8 +8,8 @@ import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
@@ -253,10 +253,10 @@ public class MassDriver extends Block{
|
||||
tile.drawx() + Angles.trnsx(angle, translation), tile.drawy() + Angles.trnsy(angle, translation),
|
||||
angle, 1f, 1f, data);
|
||||
|
||||
Effects.effect(shootEffect, tile.drawx() + Angles.trnsx(angle, translation),
|
||||
shootEffect.at(tile.drawx() + Angles.trnsx(angle, translation),
|
||||
tile.drawy() + Angles.trnsy(angle, translation), angle);
|
||||
|
||||
Effects.effect(smokeEffect, tile.drawx() + Angles.trnsx(angle, translation),
|
||||
smokeEffect.at(tile.drawx() + Angles.trnsx(angle, translation),
|
||||
tile.drawy() + Angles.trnsy(angle, translation), angle);
|
||||
|
||||
Effects.shake(shake, shake, entity);
|
||||
@@ -278,7 +278,7 @@ public class MassDriver extends Block{
|
||||
}
|
||||
|
||||
Effects.shake(shake, shake, entity);
|
||||
Effects.effect(recieveEffect, bullet);
|
||||
recieveEffect.at(bullet);
|
||||
|
||||
entity.reload = 1f;
|
||||
bullet.remove();
|
||||
|
||||
@@ -5,8 +5,8 @@ import arc.math.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
@@ -8,8 +8,8 @@ import arc.math.geom.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
@@ -138,9 +138,9 @@ public class ImpactReactor extends PowerGenerator{
|
||||
Sounds.explosionbig.at(tile);
|
||||
|
||||
Effects.shake(6f, 16f, tile.worldx(), tile.worldy());
|
||||
Effects.effect(Fx.impactShockwave, tile.worldx(), tile.worldy());
|
||||
Fx.impactShockwave.at(tile.worldx(), tile.worldy());
|
||||
for(int i = 0; i < 6; i++){
|
||||
Time.run(Mathf.random(80), () -> Effects.effect(Fx.impactcloud, tile.worldx(), tile.worldy()));
|
||||
Time.run(Mathf.random(80), () -> Fx.impactcloud.at(tile.worldx(), tile.worldy()));
|
||||
}
|
||||
|
||||
Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4);
|
||||
@@ -149,14 +149,14 @@ public class ImpactReactor extends PowerGenerator{
|
||||
for(int i = 0; i < 20; i++){
|
||||
Time.run(Mathf.random(80), () -> {
|
||||
Tmp.v1.rnd(Mathf.random(40f));
|
||||
Effects.effect(Fx.explosion, Tmp.v1.x + tile.worldx(), Tmp.v1.y + tile.worldy());
|
||||
Fx.explosion.at(Tmp.v1.x + tile.worldx(), Tmp.v1.y + tile.worldy());
|
||||
});
|
||||
}
|
||||
|
||||
for(int i = 0; i < 70; i++){
|
||||
Time.run(Mathf.random(90), () -> {
|
||||
Tmp.v1.rnd(Mathf.random(120f));
|
||||
Effects.effect(Fx.impactsmoke, Tmp.v1.x + tile.worldx(), Tmp.v1.y + tile.worldy());
|
||||
Fx.impactsmoke.at(Tmp.v1.x + tile.worldx(), Tmp.v1.y + tile.worldy());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,12 +124,12 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
entity.productionEfficiency = baseLiquidEfficiency * used / maximumPossible;
|
||||
|
||||
if(used > 0.001f && Mathf.chance(0.05 * entity.delta())){
|
||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||
generateEffect.at(tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||
}
|
||||
}else if(hasItems){
|
||||
// No liquids accepted or none supplied, try using items if accepted
|
||||
if(entity.generateTime <= 0f && entity.items.total() > 0){
|
||||
Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
|
||||
generateEffect.at(tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f));
|
||||
Item item = entity.items.take();
|
||||
entity.productionEfficiency = getItemEfficiency(item);
|
||||
entity.explosiveness = item.explosiveness;
|
||||
@@ -143,7 +143,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
//this block is run last so that in the event of a block destruction, no code relies on the block type
|
||||
Core.app.post(() -> {
|
||||
entity.damage(Mathf.random(11f));
|
||||
Effects.effect(explodeEffect, tile.worldx() + Mathf.range(size * tilesize / 2f), tile.worldy() + Mathf.range(size * tilesize / 2f));
|
||||
explodeEffect.at(tile.worldx() + Mathf.range(size * tilesize / 2f), tile.worldy() + Mathf.range(size * tilesize / 2f));
|
||||
});
|
||||
}
|
||||
}else{
|
||||
|
||||
@@ -102,7 +102,7 @@ public class NuclearReactor extends PowerGenerator{
|
||||
if(entity.heat > smokeThreshold){
|
||||
float smoke = 1.0f + (entity.heat - smokeThreshold) / (1f - smokeThreshold); //ranges from 1.0 to 2.0
|
||||
if(Mathf.chance(smoke / 20.0 * entity.delta())){
|
||||
Effects.effect(Fx.reactorsmoke, tile.worldx() + Mathf.range(size * tilesize / 2f),
|
||||
Fx.reactorsmoke.at(tile.worldx() + Mathf.range(size * tilesize / 2f),
|
||||
tile.worldy() + Mathf.random(size * tilesize / 2f));
|
||||
}
|
||||
}
|
||||
@@ -128,9 +128,9 @@ public class NuclearReactor extends PowerGenerator{
|
||||
if((fuel < 5 && entity.heat < 0.5f) || !state.rules.reactorExplosions) return;
|
||||
|
||||
Effects.shake(6f, 16f, tile.worldx(), tile.worldy());
|
||||
Effects.effect(Fx.nuclearShockwave, tile.worldx(), tile.worldy());
|
||||
Fx.nuclearShockwave.at(tile.worldx(), tile.worldy());
|
||||
for(int i = 0; i < 6; i++){
|
||||
Time.run(Mathf.random(40), () -> Effects.effect(Fx.nuclearcloud, tile.worldx(), tile.worldy()));
|
||||
Time.run(Mathf.random(40), () -> Fx.nuclearcloud.at(tile.worldx(), tile.worldy()));
|
||||
}
|
||||
|
||||
Damage.damage(tile.worldx(), tile.worldy(), explosionRadius * tilesize, explosionDamage * 4);
|
||||
@@ -138,14 +138,14 @@ public class NuclearReactor extends PowerGenerator{
|
||||
for(int i = 0; i < 20; i++){
|
||||
Time.run(Mathf.random(50), () -> {
|
||||
tr.rnd(Mathf.random(40f));
|
||||
Effects.effect(Fx.explosion, tr.x + tile.worldx(), tr.y + tile.worldy());
|
||||
Fx.explosion.at(tr.x + tile.worldx(), tr.y + tile.worldy());
|
||||
});
|
||||
}
|
||||
|
||||
for(int i = 0; i < 70; i++){
|
||||
Time.run(Mathf.random(80), () -> {
|
||||
tr.rnd(Mathf.random(120f));
|
||||
Effects.effect(Fx.nuclearsmoke, tr.x + tile.worldx(), tr.y + tile.worldy());
|
||||
Fx.nuclearsmoke.at(tr.x + tile.worldx(), tr.y + tile.worldy());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package mindustry.world.blocks.power;
|
||||
|
||||
import arc.Core;
|
||||
import arc.math.Mathf;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.ui.Bar;
|
||||
import arc.util.Eachable;
|
||||
import mindustry.ui.Cicon;
|
||||
@@ -10,7 +11,6 @@ import mindustry.world.Block;
|
||||
import arc.graphics.g2d.Draw;
|
||||
import mindustry.graphics.Pal;
|
||||
import arc.graphics.g2d.TextureRegion;
|
||||
import mindustry.entities.traits.BuilderTrait;
|
||||
|
||||
public class PowerDiode extends Block{
|
||||
public TextureRegion arrow;
|
||||
@@ -75,7 +75,7 @@ public class PowerDiode extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawRequestRegion(BuilderTrait.BuildRequest req, Eachable<BuilderTrait.BuildRequest> list) {
|
||||
public void drawRequestRegion(BuildRequest req, Eachable<BuildRequest> list) {
|
||||
TextureRegion reg = icon(Cicon.full);
|
||||
Draw.rect(icon(Cicon.full), req.drawx(), req.drawy(),
|
||||
reg.getWidth() * req.animScale * Draw.scl,
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ThermalGenerator extends PowerGenerator{
|
||||
GeneratorEntity entity = tile.ent();
|
||||
|
||||
if(entity.productionEfficiency > 0.1f && Mathf.chance(0.05 * entity.delta())){
|
||||
Effects.effect(generateEffect, tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||
generateEffect.at(tile.drawx() + Mathf.range(3f), tile.drawy() + Mathf.range(3f));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ public class Drill extends Block{
|
||||
* entity.dominantItems * speed * entity.warmup;
|
||||
|
||||
if(Mathf.chance(Time.delta() * updateEffectChance * entity.warmup))
|
||||
Effects.effect(updateEffect, entity.x + Mathf.range(size * 2f), entity.y + Mathf.range(size * 2f));
|
||||
updateEffect.at(entity.x + Mathf.range(size * 2f), entity.y + Mathf.range(size * 2f));
|
||||
}else{
|
||||
entity.lastDrillSpeed = 0f;
|
||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, warmupSpeed);
|
||||
@@ -285,7 +285,7 @@ public class Drill extends Block{
|
||||
entity.index++;
|
||||
entity.progress = 0f;
|
||||
|
||||
Effects.effect(drillEffect, entity.dominantItem.color,
|
||||
drillEffect.at(entity.dominantItem.color,
|
||||
entity.x + Mathf.range(size), entity.y + Mathf.range(size));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class GenericCrafter extends Block{
|
||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
||||
|
||||
if(Mathf.chance(Time.delta() * updateEffectChance)){
|
||||
Effects.effect(updateEffect, entity.x + Mathf.range(size * 4f), entity.y + Mathf.range(size * 4));
|
||||
updateEffect.at(entity.x + Mathf.range(size * 4f), entity.y + Mathf.range(size * 4));
|
||||
}
|
||||
}else{
|
||||
entity.warmup = Mathf.lerp(entity.warmup, 0f, 0.02f);
|
||||
@@ -116,7 +116,7 @@ public class GenericCrafter extends Block{
|
||||
handleLiquid(tile, tile, outputLiquid.liquid, outputLiquid.amount);
|
||||
}
|
||||
|
||||
Effects.effect(craftEffect, tile.drawx(), tile.drawy());
|
||||
craftEffect.at(tile.drawx(), tile.drawy());
|
||||
entity.progress = 0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Incinerator extends Block{
|
||||
@Override
|
||||
public void handleItem(Item item, Tile tile, Tile source){
|
||||
if(Mathf.chance(0.3)){
|
||||
Effects.effect(effect, tile.drawx(), tile.drawy());
|
||||
effect.at(tile.drawx(), tile.drawy());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class Incinerator extends Block{
|
||||
@Override
|
||||
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||
if(Mathf.chance(0.02)){
|
||||
Effects.effect(effect, tile.drawx(), tile.drawy());
|
||||
effect.at(tile.drawx(), tile.drawy());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public class SolidPump extends Pump{
|
||||
entity.lastPump = maxPump;
|
||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 1f, 0.02f);
|
||||
if(Mathf.chance(entity.delta() * updateEffectChance))
|
||||
Effects.effect(updateEffect, entity.x + Mathf.range(size * 2f), entity.y + Mathf.range(size * 2f));
|
||||
updateEffect.at(entity.x + Mathf.range(size * 2f), entity.y + Mathf.range(size * 2f));
|
||||
}else{
|
||||
entity.warmup = Mathf.lerpDelta(entity.warmup, 0f, 0.02f);
|
||||
entity.lastPump = 0f;
|
||||
|
||||
@@ -4,8 +4,8 @@ import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
@@ -8,8 +8,8 @@ import arc.scene.ui.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CoreBlock extends StorageBlock{
|
||||
if(player == null || tile.entity == null) return;
|
||||
|
||||
CoreEntity entity = tile.ent();
|
||||
Effects.effect(Fx.spawn, entity);
|
||||
Fx.spawn.at(entity);
|
||||
entity.progress = 0;
|
||||
entity.spawnPlayer = player;
|
||||
entity.spawnPlayer.onRespawn(tile);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class LaunchPad extends StorageBlock{
|
||||
if(world.isZone() && entity.cons.valid() && entity.items.total() >= itemCapacity && entity.timer.get(timerLaunch, launchTime / entity.timeScale)){
|
||||
for(Item item : Vars.content.items()){
|
||||
Events.fire(Trigger.itemLaunch);
|
||||
Effects.effect(Fx.padlaunch, tile);
|
||||
Fx.padlaunch.at(tile);
|
||||
int used = Math.min(entity.items.get(item), itemCapacity);
|
||||
data.addItem(item, used);
|
||||
entity.items.remove(item, used);
|
||||
|
||||
@@ -4,8 +4,8 @@ import arc.graphics.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.*;
|
||||
import mindustry.entities.traits.BuilderTrait.*;
|
||||
import mindustry.entities.type.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class CommandCenter extends Block{
|
||||
@Override
|
||||
public void configured(Tile tile, Player player, int value){
|
||||
UnitCommand command = UnitCommand.all[value];
|
||||
Effects.effect(((CommandCenter)tile.block()).effect, tile);
|
||||
((CommandCenter)tile.block()).effect.at(tile);
|
||||
|
||||
for(Tile center : indexer.getAllied(tile.getTeam(), BlockFlag.comandCenter)){
|
||||
if(center.block() instanceof CommandCenter){
|
||||
|
||||
@@ -62,7 +62,7 @@ public class MechPad extends Block{
|
||||
|
||||
MechFactoryEntity entity = tile.ent();
|
||||
|
||||
Effects.effect(Fx.spawn, entity);
|
||||
Fx.spawn.at(entity);
|
||||
|
||||
if(entity.player == null) return;
|
||||
Mech mech = ((MechPad)tile.block()).mech;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class UnitFactory extends Block{
|
||||
entity.spawned = spawns;
|
||||
|
||||
Effects.shake(2f, 3f, entity);
|
||||
Effects.effect(Fx.producesmoke, tile.drawx(), tile.drawy());
|
||||
Fx.producesmoke.at(tile.drawx(), tile.drawy());
|
||||
|
||||
if(!net.client()){
|
||||
BaseUnit unit = factory.unitType.create(tile.getTeam());
|
||||
|
||||
Reference in New Issue
Block a user