Team-colored shields

This commit is contained in:
Anuken
2020-06-26 18:42:29 -04:00
parent 0df4e26736
commit 7401c16ded
9 changed files with 23 additions and 30 deletions

View File

@@ -200,7 +200,7 @@ public class BuildBlock extends Block{
setConstruct(previous, cblock);
}
float maxProgress = core == null || team.rules().infiniteResources ? amount : checkRequired(core.items(), amount, false);
float maxProgress = core == null || team.rules().infiniteResources ? amount : checkRequired(core.items, amount, false);
for(int i = 0; i < cblock.requirements.length; i++){
int reqamount = Math.round(state.rules.buildCostMultiplier * cblock.requirements[i].amount);
@@ -208,7 +208,7 @@ public class BuildBlock extends Block{
totalAccumulator[i] = Math.min(totalAccumulator[i] + reqamount * maxProgress, reqamount);
}
maxProgress = core == null || team.rules().infiniteResources ? maxProgress : checkRequired(core.items(), maxProgress, true);
maxProgress = core == null || team.rules().infiniteResources ? maxProgress : checkRequired(core.items, maxProgress, true);
progress = Mathf.clamp(progress + maxProgress);
builderID = builder.id();

View File

@@ -158,19 +158,12 @@ public class ForceProjector extends Block{
Draw.z(Layer.shields);
Draw.color(Pal.accent);
Draw.color(team.color, Color.white, Mathf.clamp(hit));
if(Core.settings.getBool("animatedshields")){
Fill.poly(x, y, 6, radius);
Draw.z(Layer.shields + 0.01f);
if(hit > 0){
Draw.color(Color.white);
Draw.alpha(1f);
Fill.poly(x, y, 6, radius);
Draw.color();
}
}else{
Lines.stroke(1.5f);
Draw.alpha(0.09f + Mathf.clamp(0.08f * hit));