This commit is contained in:
Anuken
2020-10-16 15:27:30 -04:00
parent 1fbced0433
commit e00daffe6d
14 changed files with 63 additions and 48 deletions

View File

@@ -39,6 +39,11 @@ public class LaserBulletType extends BulletType{
this(1f);
}
@Override
public float estimateDPS(){
return super.estimateDPS() * 2f;
}
@Override
public void init(){
super.init();

View File

@@ -22,6 +22,8 @@ public class LiquidBulletType extends BulletType{
if(liquid != null){
this.liquid = liquid;
this.status = liquid.effect;
lightColor = liquid.lightColor;
lightOpacity = liquid.lightColor.a;
}
ammoMultiplier = 1f;

View File

@@ -21,12 +21,14 @@ import mindustry.ctype.*;
import mindustry.entities.*;
import mindustry.game.EventType.*;
import mindustry.game.*;
import mindustry.game.Teams.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.logic.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.ConstructBlock.*;
import mindustry.world.blocks.environment.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.blocks.power.*;
@@ -191,6 +193,36 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
//endregion
//region utility methods
public void addPlan(boolean checkPrevious){
if(!block.rebuildable) return;
if(self() instanceof ConstructBuild entity){
//update block to reflect the fact that something was being constructed
if(entity.cblock != null && entity.cblock.synthetic()){
block = entity.cblock;
}else{
//otherwise this was a deconstruction that was interrupted, don't want to rebuild that
return;
}
}
TeamData data = state.teams.get(team);
if(checkPrevious){
//remove existing blocks that have been placed here.
//painful O(n) iteration + copy
for(int i = 0; i < data.blocks.size; i++){
BlockPlan b = data.blocks.get(i);
if(b.x == tile.x && b.y == tile.y){
data.blocks.removeIndex(i);
break;
}
}
}
data.blocks.addFirst(new BlockPlan(tile.x, tile.y, (short)rotation, block.id, config()));
}
/** Configure with the current, local player. */
public void configure(Object value){
//save last used config