WIP dynamic fog + bugfixes + cleanup

This commit is contained in:
Anuken
2022-02-19 14:53:06 -05:00
parent 63eeaae22d
commit eaf96fcc86
22 changed files with 339 additions and 142 deletions

View File

@@ -249,6 +249,9 @@ public class Block extends UnlockableContent implements Senseable{
/** Radius of the light emitted by this block. */
public float lightRadius = 60f;
/** How much fog this block uncovers, in tiles. Cannot be dynamic. <= 0 to disable. */
public int fogRadius = -1;
/** The sound that this block makes while active. One sound loop. Do not overuse. */
public Sound loopSound = Sounds.none;
/** Active sound base volume. */
@@ -1038,6 +1041,10 @@ public class Block extends UnlockableContent implements Senseable{
hasShadow = false;
}
if(fogRadius > 0){
flags = flags.with(BlockFlag.hasFogRadius);
}
//initialize default health based on size
if(health == -1){
boolean round = false;

View File

@@ -23,10 +23,11 @@ public enum BlockFlag{
/** Blocks that extinguishes fires. */
extinguisher,
//single-block identifiers
//special, internal identifiers
launchPad,
unitCargoUnloadPoint,
unitAssembler;
unitAssembler,
hasFogRadius;
public final static BlockFlag[] all = values();