Skip to content

Commit

Permalink
1.3.135 Dev (#1)
Browse files Browse the repository at this point in the history
* Some gas protection improvements

* Fix incorrect parameter values ​​for an item

* Updated version
  • Loading branch information
kotmatross28729 authored Dec 10, 2023
1 parent 602dd36 commit 57c9fb6
Show file tree
Hide file tree
Showing 19 changed files with 822 additions and 803 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ catch (Exception ignored) {
'or the VERSION override must be set! ').style(Style.SuccessHeader).text('(Do NOT download from GitHub using the ZIP option, instead\n' +
'clone the repository, see ').style(Style.Info).text('https://gtnh.miraheze.org/wiki/Development').style(Style.SuccessHeader).println(' for details.)'
)
versionOverride = '1.3.134'
versionOverride = '1.3.135'
identifiedVersion = versionOverride
}
version = identifiedVersion
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
compileOnly name: 'HBM-NTM-[1.0.27_X4775]'
compileOnly name: 'HBM-NTM-[1.0.27_X4795]'
compileOnly fileTree(dir: 'libs', include: '*.jar')
compileOnly fileTree(dir: 'libs', include: '*.zip')
}
Binary file not shown.
69 changes: 34 additions & 35 deletions src/main/java/enviromine/EnviroPotion.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public class EnviroPotion extends Potion
public static EnviroPotion frostbite;
public static EnviroPotion dehydration;
public static EnviroPotion insanity;

public static ResourceLocation textureResource = new ResourceLocation("enviromine", "textures/gui/status_Gui.png");

public EnviroPotion(int par1, boolean par2, int par3)
{
super(par1, par2, par3);
}

public static void RegisterPotions()
{
EnviroPotion.frostbite = ((EnviroPotion)new EnviroPotion(EM_Settings.frostBitePotionID, true, 8171462).setPotionName("potion.enviromine.frostbite")).setIconIndex(0, 0);
Expand All @@ -44,32 +44,32 @@ public static void RegisterPotions()
EnviroPotion.heatstroke = ((EnviroPotion)new EnviroPotion(EM_Settings.heatstrokePotionID, true, RenderAssist.getColorFromRGBA(255, 0, 0, 255)).setPotionName("potion.enviromine.heatstroke")).setIconIndex(3, 0);
EnviroPotion.hypothermia = ((EnviroPotion)new EnviroPotion(EM_Settings.hypothermiaPotionID, true, 8171462).setPotionName("potion.enviromine.hypothermia")).setIconIndex(4, 0);
}

public static void checkAndApplyEffects(EntityLivingBase entityLiving)
{
if(entityLiving.worldObj.isRemote)
{
return;
}

EnviroDataTracker tracker = EM_StatusManager.lookupTracker(entityLiving);

boolean isVampire = entityLiving instanceof EntityPlayer && EnviroUtils.isPlayerAVampire((EntityPlayer)entityLiving);
// boolean isWerewolf = entityLiving instanceof EntityPlayer && EnviroUtils.isPlayerAWerewolf((EntityPlayer)entityLiving);
boolean isCurrentlyAndroid = entityLiving instanceof EntityPlayer && EnviroUtils.isPlayerCurrentlyMOAndroid((EntityPlayer)entityLiving);
boolean isCurrentlyWerewolf = entityLiving instanceof EntityPlayer && EnviroUtils.isPlayerCurrentlyWitcheryWerewolf((EntityPlayer)entityLiving);
boolean isCurrentlyWolf = entityLiving instanceof EntityPlayer && EnviroUtils.isPlayerCurrentlyWitcheryWolf((EntityPlayer)entityLiving);
int vampireLevel = entityLiving instanceof EntityPlayer ? EnviroUtils.getWitcheryVampireLevel((EntityPlayer)entityLiving) : 0;
int werewolfLevel = entityLiving instanceof EntityPlayer ? EnviroUtils.getWitcheryWerewolfLevel((EntityPlayer)entityLiving) : 0;

int vampireDuration = MathHelper.clamp_int(200 - (entityLiving instanceof EntityPlayer && EM_Settings.witcheryVampireImmunities ? vampireLevel : 0)*15, 0, 200);
int werewolfDuration = MathHelper.clamp_int(200 - (entityLiving instanceof EntityPlayer && EM_Settings.witcheryWerewolfImmunities ? werewolfLevel : 0)*15, 0, 200);

// === Heatstroke === //
if(entityLiving.isPotionActive(heatstroke))
{
PotionEffect effect = entityLiving.getActivePotionEffect(heatstroke);

// Remove effect if it's worn off
if (effect.getDuration() <= 0)
{
Expand All @@ -93,13 +93,13 @@ else if(
{
entityLiving.attackEntityFrom(EnviroDamageSource.heatstroke, 4.0F);
}

if(effect.getAmplifier() >= 1)
{
entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 200, 0));
entityLiving.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 200, 0));
entityLiving.addPotionEffect(new PotionEffect(Potion.hunger.id, 200, 0));

if(entityLiving.getRNG().nextInt(10) == 0)
{
if(EM_Settings.noNausea)
Expand All @@ -113,12 +113,11 @@ else if(
}
}
}

// === Hypothermia === //
if(entityLiving.isPotionActive(hypothermia))
{
PotionEffect effect = entityLiving.getActivePotionEffect(hypothermia);

// Remove effect if it's worn off
if (effect.getDuration() <= 0)
{
Expand Down Expand Up @@ -146,20 +145,20 @@ else if(
{
entityLiving.attackEntityFrom(EnviroDamageSource.organfailure, 4.0F * 5F / (((EM_Settings.witcheryWerewolfImmunities && entityLiving instanceof EntityPlayer) ? werewolfLevel : 0)+5));
}

if(effect.getAmplifier() >= 1)
{
entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, werewolfDuration, 0));
entityLiving.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, werewolfDuration, 0));
}
}
}

// === Frostbite === //
if(entityLiving.isPotionActive(frostbite))
{
PotionEffect effect = entityLiving.getActivePotionEffect(frostbite);

// Remove effect if it's worn off
if (effect.getDuration() <= 0)
{
Expand Down Expand Up @@ -187,7 +186,7 @@ else if(
{
entityLiving.attackEntityFrom(EnviroDamageSource.frostbite, 4.0F * 5F / (((EM_Settings.witcheryWerewolfImmunities && entityLiving instanceof EntityPlayer) ? werewolfLevel : 0)+5));
}

if(entityLiving.getHeldItem() != null)
{
if(effect != null)
Expand All @@ -197,9 +196,9 @@ else if(
EntityItem item = entityLiving.entityDropItem(entityLiving.getHeldItem(), 0.0F);
item.delayBeforeCanPickup = 40;
entityLiving.setCurrentItemOrArmor(0, null);

entityLiving.worldObj.playSoundAtEntity(entityLiving, "enviromine:shiver", 1f, 1f);

if(entityLiving instanceof EntityPlayer)
{
((EntityPlayer)entityLiving).addStat(EnviroAchievements.iNeededThat, 1);
Expand All @@ -209,12 +208,12 @@ else if(
}
}
}

// === Dehydration === //
if(entityLiving.isPotionActive(dehydration.id))
{
PotionEffect effect = entityLiving.getActivePotionEffect(dehydration);

// Remove effect if it's worn off
if (effect.getDuration() <= 0)
{
Expand Down Expand Up @@ -244,12 +243,12 @@ else if(
}
}
}

// === Insanity === //
if(entityLiving.isPotionActive(insanity.id))
{
PotionEffect effect = entityLiving.getActivePotionEffect(insanity);

// Remove effect if it's worn off
if (effect.getDuration() <= 0)
{
Expand All @@ -274,10 +273,10 @@ else if(
)
{
int chance = 50 / (effect.getAmplifier() + 1);

chance = chance > 0? chance : 1;
chance += (entityLiving instanceof EntityPlayer && EM_Settings.witcheryWerewolfImmunities ? werewolfLevel*4 : 0);

if(entityLiving.getRNG().nextInt(chance) == 0)
{
if(effect.getAmplifier() >= 1)
Expand All @@ -291,12 +290,12 @@ else if(
}
}
}

if(EnviroMine.proxy.isClient() && effect.getAmplifier() >= 2 && entityLiving.getRNG().nextInt(1000 + (entityLiving instanceof EntityPlayer && EM_Settings.witcheryWerewolfImmunities ? werewolfLevel*200 : 0)) == 0)
{
displayFakeDeath();
}

String sound = "";
if(entityLiving.getRNG().nextInt(chance) == 0 && entityLiving instanceof EntityPlayer)
{
Expand Down Expand Up @@ -383,15 +382,15 @@ else if(
break;
}
}

EntityPlayer player = ((EntityPlayer)entityLiving);

float rndX = (player.getRNG().nextInt(6) - 3) * player.getRNG().nextFloat();
float rndY = (player.getRNG().nextInt(6) - 3) * player.getRNG().nextFloat();
float rndZ = (player.getRNG().nextInt(6) - 3) * player.getRNG().nextFloat();

S29PacketSoundEffect packet = new S29PacketSoundEffect(sound, entityLiving.posX + rndX, entityLiving.posY + rndY, entityLiving.posZ + rndZ, 1.0F, !EM_Settings.randomizeInsanityPitch ? 1F : player.getRNG().nextBoolean()? 0.2F : (player.getRNG().nextFloat() - player.getRNG().nextFloat()) * 0.2F + 1.0F);

if(!EnviroMine.proxy.isClient() && player instanceof EntityPlayerMP)
{
((EntityPlayerMP)player).playerNetServerHandler.sendPacket(packet);
Expand All @@ -402,7 +401,7 @@ else if(
}
}
}

// Award achievement for heatstroke and hypothermia together
if(entityLiving.isPotionActive(heatstroke.id) && entityLiving.isPotionActive(hypothermia.id))
{
Expand All @@ -412,7 +411,7 @@ else if(
}
}
}

@SideOnly(Side.CLIENT)
private static void displayFakeDeath()
{
Expand All @@ -421,7 +420,7 @@ private static void displayFakeDeath()
Minecraft.getMinecraft().displayGuiScreen(new EM_GuiFakeDeath());
}
}

@Override
@SideOnly(Side.CLIENT)
/**
Expand All @@ -432,7 +431,7 @@ public boolean hasStatusIcon()
Minecraft.getMinecraft().renderEngine.bindTexture(textureResource);
return true;
}

@Override
@SideOnly(Side.CLIENT)
/**
Expand Down
Loading

0 comments on commit 57c9fb6

Please sign in to comment.