Core incineration tweaks

This commit is contained in:
Anuken 2021-01-03 16:52:54 -05:00
parent 0cfdacdd28
commit af636f74fc
2 changed files with 5 additions and 6 deletions

View File

@ -57,6 +57,8 @@ public class Logic implements ApplicationListener{
//when loading a 'damaged' sector, propagate the damage
Events.on(SaveLoadEvent.class, e -> {
if(state.isCampaign()){
state.rules.coreIncinerates = true;
SectorInfo info = state.rules.sector.info;
info.write();
@ -107,6 +109,7 @@ public class Logic implements ApplicationListener{
if(!(state.getSector().preset != null && !state.getSector().preset.useAI)){
state.rules.waveTeam.rules().ai = true;
}
state.rules.coreIncinerates = true;
state.rules.waveTeam.rules().aiTier = state.getSector().threat * 0.8f;
state.rules.waveTeam.rules().infiniteResources = true;

View File

@ -233,7 +233,7 @@ public class CoreBlock extends StorageBlock{
@Override
public int getMaximumAccepted(Item item){
return incinerate() ? storageCapacity * 2 : storageCapacity;
return state.rules.coreIncinerates ? storageCapacity * 2 : storageCapacity;
}
@Override
@ -318,10 +318,6 @@ public class CoreBlock extends StorageBlock{
return tile instanceof StorageBuild b && (b.linkedCore == core || b.linkedCore == null);
}
public boolean incinerate(){
return state.isCampaign() || state.rules.coreIncinerates;
}
@Override
public float handleDamage(float amount){
if(player != null && team == player.team()){
@ -386,7 +382,7 @@ public class CoreBlock extends StorageBlock{
}else{
super.handleItem(source, item);
}
}else if(incinerate()){
}else if(state.rules.coreIncinerates){
if(items.get(item) >= storageCapacity){
//create item incineration effect at random intervals
if(!noEffect){