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