mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
whoops
This commit is contained in:
parent
6e32c9818d
commit
c2e002419f
@ -343,7 +343,8 @@ public class EntityEffectHandler {
|
|||||||
double asbestos = Math.min(HbmLivingProps.getAsbestos(entity), HbmLivingProps.maxAsbestos);
|
double asbestos = Math.min(HbmLivingProps.getAsbestos(entity), HbmLivingProps.maxAsbestos);
|
||||||
double fibrosis = Math.min(HbmLivingProps.getFibrosis(entity), HbmLivingProps.maxFibrosis);
|
double fibrosis = Math.min(HbmLivingProps.getFibrosis(entity), HbmLivingProps.maxFibrosis);
|
||||||
|
|
||||||
boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D || fibrosis / HbmLivingProps.maxFibrosis > 0.25D;
|
boolean coughs = blacklung / HbmLivingProps.maxBlacklung > 0.25D || asbestos / HbmLivingProps.maxAsbestos > 0.25D;
|
||||||
|
boolean bronchospasms = fibrosis / HbmLivingProps.maxFibrosis > 0.20D;
|
||||||
|
|
||||||
if(!coughs)
|
if(!coughs)
|
||||||
return;
|
return;
|
||||||
@ -351,7 +352,6 @@ public class EntityEffectHandler {
|
|||||||
boolean coughsCoal = blacklung / HbmLivingProps.maxBlacklung > 0.5D;
|
boolean coughsCoal = blacklung / HbmLivingProps.maxBlacklung > 0.5D;
|
||||||
boolean coughsALotOfCoal = blacklung / HbmLivingProps.maxBlacklung > 0.8D;
|
boolean coughsALotOfCoal = blacklung / HbmLivingProps.maxBlacklung > 0.8D;
|
||||||
boolean coughsBlood = asbestos / HbmLivingProps.maxAsbestos > 0.75D || blacklung / HbmLivingProps.maxBlacklung > 0.75D;
|
boolean coughsBlood = asbestos / HbmLivingProps.maxAsbestos > 0.75D || blacklung / HbmLivingProps.maxBlacklung > 0.75D;
|
||||||
boolean asthmaAttack = fibrosis / HbmLivingProps.maxFibrosis > 0.30D;
|
|
||||||
|
|
||||||
double blacklungDelta = 1D - (blacklung / (double)HbmLivingProps.maxBlacklung);
|
double blacklungDelta = 1D - (blacklung / (double)HbmLivingProps.maxBlacklung);
|
||||||
double asbestosDelta = 1D - (asbestos / (double)HbmLivingProps.maxAsbestos);
|
double asbestosDelta = 1D - (asbestos / (double)HbmLivingProps.maxAsbestos);
|
||||||
@ -373,36 +373,29 @@ public class EntityEffectHandler {
|
|||||||
|
|
||||||
if(world.getTotalWorldTime() % freq == entity.getEntityId() % freq) {
|
if(world.getTotalWorldTime() % freq == entity.getEntityId() % freq) {
|
||||||
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:player.cough", 1.0F, 1.0F);
|
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:player.cough", 1.0F, 1.0F);
|
||||||
|
if (new Random().nextInt(6) > 1) {
|
||||||
if(coughsBlood) {
|
if(coughsBlood) {
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
nbt.setString("type", "vomit");
|
nbt.setString("type", "vomit");
|
||||||
nbt.setString("mode", "blood");
|
nbt.setString("mode", "blood");
|
||||||
nbt.setInteger("count", 5);
|
nbt.setInteger("count", 5);
|
||||||
nbt.setInteger("entity", entity.getEntityId());
|
nbt.setInteger("entity", entity.getEntityId());
|
||||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25));
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25));
|
||||||
if(asthmaAttack) {
|
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 40, 1));
|
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1));
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(coughsCoal) {
|
if(coughsCoal) {
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
nbt.setString("type", "vomit");
|
nbt.setString("type", "vomit");
|
||||||
nbt.setString("mode", "smoke");
|
nbt.setString("mode", "smoke");
|
||||||
nbt.setInteger("count", coughsALotOfCoal ? 50 : 10);
|
nbt.setInteger("count", coughsALotOfCoal ? 50 : 10);
|
||||||
nbt.setInteger("entity", entity.getEntityId());
|
nbt.setInteger("entity", entity.getEntityId());
|
||||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25));
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25));
|
||||||
if(asthmaAttack) {
|
}
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 40, 1));
|
} else {
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1));
|
if(bronchospasms) {
|
||||||
|
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 200, 2));
|
||||||
|
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 140, 2));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(asthmaAttack) {
|
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 40, 1));
|
|
||||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user