Skip to content

Commit

Permalink
I am in s
Browse files Browse the repository at this point in the history
  • Loading branch information
70000hp committed Nov 17, 2023
1 parent bf699e4 commit 3f7f218
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
12 changes: 9 additions & 3 deletions src/main/java/com/hbm/config/MobConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,23 @@ public static void loadFromConfig(Configuration config) {
rampantGlyphidGuidance = CommonConfig.createConfigBool(config, CATEGORY,"12.R05_rampantGlyphidGuidance", "Whether Glyphids should always expand toward a player's spawnpoint", false);
rampantSmokeStackOverride = CommonConfig.createConfigDouble(config, CATEGORY, "12.R06_rampantSmokeStackOverride", "How much should the smokestack multiply soot by when on rampant mode", 0.4);
scoutInitialSpawn = CommonConfig.createConfigBool(config, CATEGORY,"12.R07_scoutInitialSpawn", "Whether glyphid scouts should be able to spawn on the first swarm of a hive, causes glyphids to expand significantly faster", false);
pollutionMult = CommonConfig.createConfigDouble(config, CATEGORY, "12.R06_rampantSmokeStackOverride", "A multiplier for soot emitted, whether you want to increase or decrease it", 1);
pollutionMult = CommonConfig.createConfigDouble(config, CATEGORY, "12.R08_pollutionMult", "A multiplier for soot emitted, whether you want to increase or decrease it", 1);

if(rampantMode){
rampantNaturalScoutSpawn = true;
rampantExtendedTargetting = true;
rampantDig = true;
rampantGlyphidGuidance = true;
scoutSwarmSpawnChance = 1;
if(pollutionMult == 1)
pollutionMult = 3;
scoutThreshold = 0.1;
RadiationConfig.pollutionSpreadThreshold = 25;
if(pollutionMult == 1) {
pollutionMult = 2;
RadiationConfig.pollutionSpreadEfficiency = 0.2 / pollutionMult;
}
else RadiationConfig.pollutionSpreadEfficiency = 0.1 / pollutionMult;
RadiationConfig.sootFogThreshold *= pollutionMult;

}
}
}
5 changes: 4 additions & 1 deletion src/main/java/com/hbm/config/RadiationConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class RadiationConfig {
public static double sootFogThreshold = 35D;
public static double sootFogDivisor = 120D;
public static double smokeStackSootMult = 0.8;
public static int pollutionSpreadThreshold = 15;
public static double pollutionSpreadEfficiency = 0.05D;

public static void loadFromConfig(Configuration config) {

Expand Down Expand Up @@ -70,6 +72,7 @@ public static void loadFromConfig(Configuration config) {
sootFogThreshold = CommonConfig.createConfigDouble(config, CATEGORY_POL, "POL_06_sootFogThreshold", "How much soot is required for smog to become visible", 35D);
sootFogDivisor = CommonConfig.createConfigDouble(config, CATEGORY_POL, "POL_07_sootFogDivisor", "The divisor for smog, higher numbers will require more soot for the same smog density", 120D);
smokeStackSootMult = CommonConfig.createConfigDouble(config, CATEGORY_POL, "POL_08_smokeStackSootMult", "How much does smokestack multiply soot by, with decimal values reducing the soot", 0.8);

pollutionSpreadThreshold = CommonConfig.createConfigInt(config, CATEGORY_POL, "POL_09_pollutionSpreadThreshold", "The amount of soot required for it to be spread to nearby chunks, causes it to concentrate more", 15);
pollutionSpreadEfficiency = CommonConfig.createConfigDouble(config, CATEGORY_POL, "POL_10_pollutionSpreadEfficiency", "How much soot will be spread to nearby chunks at once (percentage), values higher than 0.05 may cause infinite feedback loop of soot", 0.05);
}
}
14 changes: 8 additions & 6 deletions src/main/java/com/hbm/handler/pollution/PollutionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ public String getDataDir(WorldServer world) {
public void updateSystem(TickEvent.ServerTickEvent event) {

if(event.side == Side.SERVER && event.phase == Phase.END) {


int spreadThreshold = RadiationConfig.pollutionSpreadThreshold;
double spreadEff = RadiationConfig.pollutionSpreadEfficiency;
eggTimer++;
if(eggTimer < 60) return;
eggTimer = 0;
Expand All @@ -198,11 +200,11 @@ public void updateSystem(TickEvent.ServerTickEvent event) {
int P = PollutionType.POISON.ordinal();

/* CALCULATION */
if(data.pollution[S] > 15) {
pollutionForNeightbors[S] = data.pollution[S] * 0.05F;
data.pollution[S] *= 0.8F;
if(data.pollution[S] > spreadThreshold) {
pollutionForNeightbors[S] = (float) (data.pollution[S] * spreadEff);
data.pollution[S] *= 1-spreadEff*4;
} else {
data.pollution[S] *= 0.99F;
data.pollution[S] *= 0.8;
}

data.pollution[H] *= 0.9995F;
Expand Down Expand Up @@ -356,7 +358,7 @@ public void rampantScoutPopulator(WorldEvent.PotentialSpawns event){
&& event.type == EnumCreatureType.monster
&& event.world.canBlockSeeTheSky(event.x, event.y, event.z)) {

if (event.world.rand.nextInt(60) == 0) {
if (event.world.rand.nextInt(1000) == 0) {

float soot = PollutionHandler.getPollution(event.world, event.x, event.y, event.z, PollutionType.SOOT);

Expand Down

0 comments on commit 3f7f218

Please sign in to comment.