Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2025-02-05 18:52:09 -05:00
5 changed files with 24 additions and 19 deletions

View File

@@ -45,9 +45,9 @@ public class LExecutor{
public LInstruction[] instructions = {};
/** Non-constant variables used for network sync */
public LVar[] vars = {};
public LVar counter, unit, thisv, ipt;
public int[] binds;
public boolean yield;
@@ -226,7 +226,7 @@ public class LExecutor{
cache.found = false;
outFound.setnum(0);
}
if(res != null && res.build != null &&
(unit.within(res.build.x, res.build.y, Math.max(unit.range(), buildingRange)) || res.build.team == exec.team)){
cache.build = res.build;
@@ -1512,6 +1512,7 @@ public class LExecutor{
case dropZoneRadius -> state.rules.dropZoneRadius = value.numf() * 8f;
case unitCap -> state.rules.unitCap = Math.max(value.numi(), 0);
case lighting -> state.rules.lighting = value.bool();
case canGameOver -> state.rules.canGameOver = value.bool();
case mapArea -> {
int x = p1.numi(), y = p2.numi(), w = p3.numi(), h = p4.numi();
if(!checkMapArea(x, y, w, h, false)){
@@ -1963,7 +1964,7 @@ public class LExecutor{
public void run(LExecutor exec){
Sound sound = Sounds.getSound(id.numi());
if(sound == null || sound == Sounds.swish) sound = Sounds.none; //no.
if(positional){
sound.at(World.unconv(x.numf()), World.unconv(y.numf()), pitch.numf(), Math.min(volume.numf(), 2f), limit.bool());
}else{

View File

@@ -13,6 +13,7 @@ public enum LogicRule{
unitCap,
mapArea,
lighting,
canGameOver,
ambientLight,
solarMultiplier,
dragMultiplier,

View File

@@ -40,6 +40,7 @@ public class GenericCrafter extends Block{
public Effect craftEffect = Fx.none;
public Effect updateEffect = Fx.none;
public float updateEffectChance = 0.04f;
public float updateEffectSpread = 4f;
public float warmupSpeed = 0.019f;
/** Only used for legacy cultivator blocks. */
public boolean legacyReadWarmup = false;
@@ -233,7 +234,7 @@ public class GenericCrafter extends Block{
}
if(wasVisible && Mathf.chanceDelta(updateEffectChance)){
updateEffect.at(x + Mathf.range(size * 4f), y + Mathf.range(size * 4));
updateEffect.at(x + Mathf.range(size * updateEffectSpread), y + Mathf.range(size * updateEffectSpread));
}
}else{
warmup = Mathf.approachDelta(warmup, 0f, warmupSpeed);