Many bugfixes
This commit is contained in:
@@ -33,6 +33,7 @@ public class CoreBlock extends StorageBlock{
|
||||
public @Load(value = "@-thruster2", fallback = "clear-effect") TextureRegion thruster2; //bot left
|
||||
public float thrusterLength = 14f/4f;
|
||||
public boolean isFirstTier;
|
||||
public boolean incinerateNonBuildable = false;
|
||||
|
||||
public UnitType unitType = UnitTypes.alpha;
|
||||
|
||||
@@ -388,11 +389,14 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
@Override
|
||||
public void handleStack(Item item, int amount, Teamc source){
|
||||
int realAmount = Math.min(amount, storageCapacity - items.get(item));
|
||||
boolean incinerate = incinerateNonBuildable && !item.buildable;
|
||||
int realAmount = incinerate ? 0 : Math.min(amount, storageCapacity - items.get(item));
|
||||
super.handleStack(item, realAmount, source);
|
||||
|
||||
if(team == state.rules.defaultTeam && state.isCampaign()){
|
||||
state.rules.sector.info.handleCoreItem(item, amount);
|
||||
if(!incinerate){
|
||||
state.rules.sector.info.handleCoreItem(item, amount);
|
||||
}
|
||||
|
||||
if(realAmount == 0 && wasVisible){
|
||||
Fx.coreBurn.at(x, y);
|
||||
@@ -489,12 +493,14 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
@Override
|
||||
public void handleItem(Building source, Item item){
|
||||
boolean incinerate = incinerateNonBuildable && !item.buildable;
|
||||
|
||||
if(net.server() || !net.active()){
|
||||
if(team == state.rules.defaultTeam && state.isCampaign()){
|
||||
if(team == state.rules.defaultTeam && state.isCampaign() && !incinerate){
|
||||
state.rules.sector.info.handleCoreItem(item, 1);
|
||||
}
|
||||
|
||||
if(items.get(item) >= storageCapacity){
|
||||
if(items.get(item) >= storageCapacity || incinerate){
|
||||
//create item incineration effect at random intervals
|
||||
if(!noEffect){
|
||||
incinerateEffect(this, source);
|
||||
@@ -503,7 +509,7 @@ public class CoreBlock extends StorageBlock{
|
||||
}else{
|
||||
super.handleItem(source, item);
|
||||
}
|
||||
}else if(state.rules.coreIncinerates && items.get(item) >= storageCapacity && !noEffect){
|
||||
}else if(((state.rules.coreIncinerates && items.get(item) >= storageCapacity) || incinerate) && !noEffect){
|
||||
//create item incineration effect at random intervals
|
||||
incinerateEffect(this, source);
|
||||
noEffect = false;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class Reconstructor extends UnitBlock{
|
||||
var upgrade = upgrade(pay.unit.type);
|
||||
|
||||
if(upgrade != null){
|
||||
if(!upgrade.unlockedNowHost()){
|
||||
if(!upgrade.unlockedNowHost() && !team.isAI()){
|
||||
//flash "not researched"
|
||||
pay.showOverlay(Icon.tree);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public class Reconstructor extends UnitBlock{
|
||||
}
|
||||
}
|
||||
|
||||
return upgrade != null && upgrade.unlockedNowHost() && !upgrade.isBanned();
|
||||
return upgrade != null && (team.isAI() || upgrade.unlockedNowHost()) && !upgrade.isBanned();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -259,7 +259,7 @@ public class Reconstructor extends UnitBlock{
|
||||
if(payload == null) return null;
|
||||
|
||||
UnitType t = upgrade(payload.unit.type);
|
||||
return t != null && t.unlockedNowHost() ? t : null;
|
||||
return t != null && (t.unlockedNowHost() || team.isAI()) ? t : null;
|
||||
}
|
||||
|
||||
public boolean constructing(){
|
||||
@@ -268,7 +268,7 @@ public class Reconstructor extends UnitBlock{
|
||||
|
||||
public boolean hasUpgrade(UnitType type){
|
||||
UnitType t = upgrade(type);
|
||||
return t != null && t.unlockedNowHost() && !type.isBanned();
|
||||
return t != null && (t.unlockedNowHost() || team.isAI()) && !type.isBanned();
|
||||
}
|
||||
|
||||
public UnitType upgrade(UnitType type){
|
||||
|
||||
Reference in New Issue
Block a user