Merge remote-tracking branch 'origin/master'
# Conflicts: # core/src/mindustry/entities/Damage.java
This commit is contained in:
@@ -196,6 +196,7 @@ public class WaveSpawner{
|
||||
unit.apply(StatusEffects.invincible, 60f);
|
||||
unit.add();
|
||||
|
||||
Events.fire(new UnitSpawnEvent(unit));
|
||||
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
||||
}
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ public class Damage{
|
||||
for(int dy = -trad; dy <= trad; dy++){
|
||||
Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy);
|
||||
if(tile != null && tile.build != null && (team == null ||team.isEnemy(tile.team())) && dx*dx + dy*dy <= trad){
|
||||
tile.build.damage(damage);
|
||||
tile.build.damage(team, damage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,6 +428,15 @@ public class EventType{
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a unit is spawned by wave. */
|
||||
public static class UnitSpawnEvent{
|
||||
public final Unit unit;
|
||||
|
||||
public UnitSpawnEvent(Unit unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
|
||||
/** Called when a unit is dumped from any payload block. */
|
||||
public static class UnitUnloadEvent{
|
||||
public final Unit unit;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class UnitPayload implements Payload{
|
||||
if(solid.solid(tx, ty)) return false;
|
||||
}
|
||||
|
||||
//cannnot dump when there's a lot of overlap going on
|
||||
//cannot dump when there's a lot of overlap going on
|
||||
if(!unit.type.flying && Units.count(unit.x, unit.y, unit.physicSize(), o -> o.isGrounded() && (o.type.allowLegStep == unit.type.allowLegStep)) > 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -9,14 +9,15 @@ import mindustry.world.blocks.production.GenericCrafter.*;
|
||||
public class DrawRotator extends DrawBlock{
|
||||
public TextureRegion rotator, top;
|
||||
public boolean drawSpinSprite = false;
|
||||
public float spinSpeed = 2f;
|
||||
|
||||
@Override
|
||||
public void draw(GenericCrafterBuild build){
|
||||
Draw.rect(build.block.region, build.x, build.y);
|
||||
if(drawSpinSprite){
|
||||
Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * 2f);
|
||||
Drawf.spinSprite(rotator, build.x, build.y, build.totalProgress * spinSpeed);
|
||||
}else{
|
||||
Draw.rect(rotator, build.x, build.y, build.totalProgress * 2f);
|
||||
Draw.rect(rotator, build.x, build.y, build.totalProgress * spinSpeed);
|
||||
}
|
||||
if(top.found()) Draw.rect(top, build.x, build.y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user