Skip to content

Commit

Permalink
UNHARDCODE PROJECT - START
Browse files Browse the repository at this point in the history
  • Loading branch information
kotmatross28729 committed Nov 18, 2024
1 parent fafc603 commit 08beb5c
Show file tree
Hide file tree
Showing 7 changed files with 411 additions and 111 deletions.
71 changes: 71 additions & 0 deletions src/main/java/enviromine/core/EM_ConfigHandler.java

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions src/main/java/enviromine/core/EM_Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,81 @@ public class EM_Settings
//...


//UNHARDCODE PROJECT

//WATER
public static float FrostyWaterTemperatureInfluence = -0.5F;
public static float DirtyColdWaterTemperatureInfluence = -0.1F;
public static float CleanColdWaterTemperatureInfluence = -0.1F;
public static float SaltyWaterTemperatureInfluence = -0.05F;
public static float DirtyWaterTemperatureInfluence = -0.05F;
public static float CleanWaterTemperatureInfluence = -0.05F;
public static float CleanWarmWaterTemperatureInfluence = 0.1F;
public static float DirtyWarmWaterTemperatureInfluence = 0.1F;
public static float HotWarmWaterTemperatureInfluence = 0.5F;

public static float WaterReducesTemperatureStartingValue = 37.05F;
public static float ColdFrostyWaterReducesTemperatureStartingValue = 30.1F;
public static float WarmHotWaterReducesTemperatureStartingValue = 0.0F;
public static float FrostyWaterHydrate = 25.0F;
public static float DirtyColdWaterHydrate = 25.0F;
public static float CleanColdWaterHydrate = 25.0F;
public static float SaltyWaterHydrate = 10.0F;
public static float DirtyWaterHydrate = 25.0F;
public static float CleanWaterHydrate = 25.0F;
public static float CleanWarmWaterHydrate = 25.0F;
public static float DirtyWarmWaterHydrate = 25.0F;
public static float HotWaterHydrate = 25.0F;

public static float FrostyWaterHydratePlastic = 50.0F;
public static float DirtyColdWaterHydratePlastic = 50.0F;
public static float CleanColdWaterHydratePlastic = 50.0F;
public static float SaltyWaterHydratePlastic = 30.0F;
public static float DirtyWaterHydratePlastic = 50.0F;
public static float CleanWaterHydratePlastic = 50.0F;
public static float CleanWarmWaterHydratePlastic = 50.0F;
public static float DirtyWarmWaterHydratePlastic = 50.0F;
public static float HotWaterHydratePlastic = 50.0F;

public static float FrostyWaterHydrateWorld = 10.0F;
public static float DirtyColdWaterHydrateWorld = 10.0F;
public static float CleanColdWaterHydrateWorld = 10.0F;
public static float SaltyWaterHydrateWorld = 5.0F;
public static float DirtyWaterHydrateWorld = 10.0F;
public static float CleanWaterHydrateWorld = 10.0F;
public static float CleanWarmWaterHydrateWorld = 10.0F;
public static float DirtyWarmWaterHydrateWorld = 10.0F;
public static float HotWaterHydrateWorld = 10.0F;

//EnviroDataTracker

public static float SanityDropHealth = 0.0F;
public static float SanityDropTemperatureHigh = 41.0F;
public static float SanityDropTemperatureLow = 30.0F;

public static float NTMSpaceAirQualityDecrease = -10.0F;
public static float NTMSpaceAirVentAirQualityIncrease = -10.0F;

public static float RealTemperatureConstant = 12.0F;

public static float TimeBelow10AirAndTemperatureConstantAir = 10.0F;
public static float TimeBelow10AirAndTemperatureConstantBodyTemperature = 35.0F;
public static float TimeBelow10BodyTemperatureConstant = 30.0F;


public static float BodyTemperatureHeatStartValue = 39.0F;
public static float BodyTemperatureHeatInstantDeath = 1000.0F;

public static float BodyTemperatureHeatstroke6 = 100.0F;
public static float BodyTemperatureHeatstroke5 = 80.0F;
public static float BodyTemperatureHeatstroke4 = 60.0F;
public static float BodyTemperatureHeatstroke3 = 43.0F;
public static float BodyTemperatureHeatstroke2 = 41.0F;

public static float BodyTemperatureCatchFireMin = 45.0F;
public static float BodyTemperatureCatchFireMax = 50.0F;
public static float BodyTemperatureCatchFireDuration = 10.0F;


public static boolean enableItemPropsDivideByTwo = true;

Expand Down
109 changes: 81 additions & 28 deletions src/main/java/enviromine/handlers/EM_EventManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -891,14 +891,19 @@ public static void drinkWater(EntityPlayer entityPlayer, PlayerInteractEvent eve
int werewolfDuration200 = MathHelper.clamp_int(200 - (EM_Settings.witcheryWerewolfImmunities ? werewolfLevel : 0)*15, 0, 200);
int werewolfDuration600 = MathHelper.clamp_int(600 - (EM_Settings.witcheryWerewolfImmunities ? werewolfLevel : 0)*45, 0, 600);

//TODO HARDCODED
if(type == -3) // Hot
{
if(tracker.bodyTemp >= 0F)
if(tracker.bodyTemp >= EM_Settings.WarmHotWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp += 0.5;
tracker.bodyTemp += EM_Settings.HotWarmWaterTemperatureInfluence;
}
if(EM_Settings.HotWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.HotWaterHydrateWorld);
} else if(EM_Settings.HotWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.HotWaterHydrateWorld));
}
tracker.hydrate(10F);
} else if(type == -2) // Dirty warm
{
if(!(EM_Settings.witcheryWerewolfImmunities && (EnviroUtils.isPlayerCurrentlyWitcheryWerewolf(entityPlayer) || EnviroUtils.isPlayerCurrentlyWitcheryWolf(entityPlayer))))
Expand All @@ -912,25 +917,43 @@ public static void drinkWater(EntityPlayer entityPlayer, PlayerInteractEvent eve
entityPlayer.addPotionEffect(new PotionEffect(Potion.poison.id, werewolfDuration200));
}
}
if(tracker.bodyTemp >= 0F)
if(tracker.bodyTemp >= EM_Settings.WarmHotWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp += 0.1;
tracker.bodyTemp += EM_Settings.DirtyWarmWaterTemperatureInfluence;
}
if(EM_Settings.DirtyWarmWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.DirtyWarmWaterHydrateWorld);
} else if(EM_Settings.DirtyWarmWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.DirtyWarmWaterHydrateWorld));
}
tracker.hydrate(10F);
} else if(type == -1) // Warm
{
if(tracker.bodyTemp >= 0F)
if(tracker.bodyTemp >= EM_Settings.WarmHotWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp += EM_Settings.CleanWarmWaterTemperatureInfluence;
}
if(EM_Settings.CleanWarmWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.CleanWarmWaterHydrateWorld);
} else if(EM_Settings.CleanWarmWaterHydrateWorld < 0F)
{
tracker.bodyTemp += 0.1;
tracker.dehydrate(Math.abs(EM_Settings.CleanWarmWaterHydrateWorld));
}
tracker.hydrate(10F);
} else if(type == 0) // Clean
{
if(tracker.bodyTemp >= 37.05F)
if(tracker.bodyTemp >= EM_Settings.WaterReducesTemperatureStartingValue)
{
tracker.bodyTemp -= 0.05;
tracker.bodyTemp += EM_Settings.CleanWaterTemperatureInfluence;
}
tracker.hydrate(10F);
if(EM_Settings.CleanWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.CleanWaterHydrateWorld);
} else if(EM_Settings.CleanWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.CleanWaterHydrateWorld));
}
} else if(type == 1) // Dirty
{
if(!(EM_Settings.witcheryWerewolfImmunities && (EnviroUtils.isPlayerCurrentlyWitcheryWerewolf(entityPlayer) || EnviroUtils.isPlayerCurrentlyWitcheryWolf(entityPlayer))))
Expand All @@ -945,11 +968,17 @@ public static void drinkWater(EntityPlayer entityPlayer, PlayerInteractEvent eve
}
}

if(tracker.bodyTemp >= 37.05)
if(tracker.bodyTemp >= EM_Settings.WaterReducesTemperatureStartingValue)
{
tracker.bodyTemp -= 0.05;
tracker.bodyTemp += EM_Settings.DirtyWaterTemperatureInfluence;
}
tracker.hydrate(10F);
if(EM_Settings.DirtyWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.DirtyWaterHydrateWorld);
} else if(EM_Settings.DirtyWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.DirtyWaterHydrateWorld));
}
} else if(type == 2) // Salty
{
if(!(EM_Settings.witcheryWerewolfImmunities && (EnviroUtils.isPlayerCurrentlyWitcheryWerewolf(entityPlayer) || EnviroUtils.isPlayerCurrentlyWitcheryWolf(entityPlayer))))
Expand All @@ -963,18 +992,30 @@ public static void drinkWater(EntityPlayer entityPlayer, PlayerInteractEvent eve
}
}

if(tracker.bodyTemp >= 37.05)
if(tracker.bodyTemp >= EM_Settings.WaterReducesTemperatureStartingValue)
{
tracker.bodyTemp -= 0.05;
tracker.bodyTemp += EM_Settings.SaltyWaterTemperatureInfluence;
}
tracker.hydrate(5F);
if(EM_Settings.SaltyWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.SaltyWaterHydrateWorld);
} else if(EM_Settings.SaltyWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.SaltyWaterHydrateWorld));
}
} else if(type == 3) // Cold
{
if(tracker.bodyTemp >= 30.1)
if(tracker.bodyTemp >= EM_Settings.ColdFrostyWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp -= 0.1;
tracker.bodyTemp += EM_Settings.CleanColdWaterTemperatureInfluence;
}
tracker.hydrate(10F);
if(EM_Settings.CleanColdWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.CleanColdWaterHydrateWorld);
} else if(EM_Settings.CleanColdWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.CleanColdWaterHydrateWorld));
}
} else if(type == 4) // Dirty cold
{
if(!(EM_Settings.witcheryWerewolfImmunities && (EnviroUtils.isPlayerCurrentlyWitcheryWerewolf(entityPlayer) || EnviroUtils.isPlayerCurrentlyWitcheryWolf(entityPlayer))))
Expand All @@ -987,18 +1028,30 @@ public static void drinkWater(EntityPlayer entityPlayer, PlayerInteractEvent eve
entityPlayer.addPotionEffect(new PotionEffect(EnviroPotion.dehydration.id, werewolfDuration600));
}
}
if(tracker.bodyTemp >= 30.1)
if(tracker.bodyTemp >= EM_Settings.ColdFrostyWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp -= 0.1;
tracker.bodyTemp += EM_Settings.DirtyColdWaterTemperatureInfluence;
}
if(EM_Settings.DirtyColdWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.DirtyColdWaterHydrateWorld);
} else if(EM_Settings.DirtyColdWaterHydrateWorld < 0F)
{
tracker.dehydrate(Math.abs(EM_Settings.DirtyColdWaterHydrateWorld));
}
tracker.hydrate(10F);
} else if(type == 5) // Frosty
{
if(tracker.bodyTemp >= 30.1)
if(tracker.bodyTemp >= EM_Settings.ColdFrostyWaterReducesTemperatureStartingValue)
{
tracker.bodyTemp += EM_Settings.FrostyWaterTemperatureInfluence;
}
if(EM_Settings.FrostyWaterHydrateWorld > 0F)
{
tracker.hydrate(EM_Settings.FrostyWaterHydrateWorld);
} else if(EM_Settings.FrostyWaterHydrateWorld < 0F)
{
tracker.bodyTemp -= 0.5;
tracker.dehydrate(Math.abs(EM_Settings.FrostyWaterHydrateWorld));
}
tracker.hydrate(10F);
}

if(isValidCauldron)
Expand Down
Loading

0 comments on commit 08beb5c

Please sign in to comment.