2
0
Fork 0

Renaming Herbal Poisoning to Overdose

main
Shinare 7 months ago
parent 646849e0d4
commit 0ea495ee2b

@ -96,8 +96,8 @@ public class LoEItemMug extends LOTRItemMug {
public void increment_toxin(EntityPlayer player) { public void increment_toxin(EntityPlayer player) {
int effect_duration = 7200; // 360 seconds * 20 ticks int effect_duration = 7200; // 360 seconds * 20 ticks
int effect_potency = 0; // Default to level 1 effect int effect_potency = 0; // Default to level 1 effect
PotionEffect potion = player.getActivePotionEffect(LoEPotions.herbal_poisoning); PotionEffect potion = player.getActivePotionEffect(LoEPotions.overdose);
if (potion != null) effect_potency = potion.getAmplifier() + 1; if (potion != null) effect_potency = potion.getAmplifier() + 1;
player.addPotionEffect(new PotionEffect(LoEPotions.herbal_poisoning.id, effect_duration, effect_potency)); player.addPotionEffect(new PotionEffect(LoEPotions.overdose.id, effect_duration, effect_potency));
} }
} }

@ -154,22 +154,6 @@ public abstract class MixinEntityPlayer extends EntityLivingBase implements IMix
public int get_last_pickpocket_attempt() { public int get_last_pickpocket_attempt() {
return this.last_pickpocket_attempt; return this.last_pickpocket_attempt;
} }
/* Proper solution for later
@Redirect(
method = "func_71059_n",
at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;field_70143_R:F", remap = false)
)
private float redirectFallDistanceForCrit(Entity instance) {
if (instance instanceof EntityPlayer) {
PotionEffect poison = ((EntityPlayer) instance).getActivePotionEffect(LoEPotions.herbal_poisoning);
if (poison != null && poison.getAmplifier() >= 1) {
System.out.println("Setting fall distance to 0.0F");
return 0.0F; // no fall distance = no crit
}
}
System.out.println("Preserving fall distance.");
return instance.fallDistance;
}*/
@Overwrite @Overwrite
public void attackTargetEntityWithCurrentItem(Entity p_71059_1_) public void attackTargetEntityWithCurrentItem(Entity p_71059_1_)
@ -305,9 +289,9 @@ public abstract class MixinEntityPlayer extends EntityLivingBase implements IMix
} }
@Inject(method = "onLivingUpdate", at = @At("TAIL")) @Inject(method = "onLivingUpdate", at = @At("TAIL"))
public void disableHotbarSlotsHerbalPoisoning(CallbackInfo ci) { public void disableHotbarSlotsOverdose(CallbackInfo ci) {
EntityPlayer player = (EntityPlayer)(Object)this; EntityPlayer player = (EntityPlayer)(Object)this;
PotionEffect effect = player.getActivePotionEffect(LoEPotions.herbal_poisoning); PotionEffect effect = player.getActivePotionEffect(LoEPotions.overdose);
if (effect != null && effect.getAmplifier() >= 2) { if (effect != null && effect.getAmplifier() >= 2) {
int slot = player.inventory.currentItem; int slot = player.inventory.currentItem;
@ -318,7 +302,7 @@ public abstract class MixinEntityPlayer extends EntityLivingBase implements IMix
} }
public boolean canAttackWithItem() { public boolean canAttackWithItem() {
EntityPlayer player = (EntityPlayer)(Object)this; EntityPlayer player = (EntityPlayer)(Object)this;
PotionEffect effect = player.getActivePotionEffect(LoEPotions.herbal_poisoning); PotionEffect effect = player.getActivePotionEffect(LoEPotions.overdose);
if (effect != null && effect.getAmplifier() >= 2) { if (effect != null && effect.getAmplifier() >= 2) {
int slot = player.inventory.currentItem; int slot = player.inventory.currentItem;

@ -51,8 +51,7 @@ public class MixinFoodStats {
++this.foodTimer; ++this.foodTimer;
if (this.foodTimer >= 80) { if (this.foodTimer >= 80) {
boolean has_herbal_poisoning = false; PotionEffect potion = player.getActivePotionEffect(LoEPotions.overdose);
PotionEffect potion = player.getActivePotionEffect(LoEPotions.herbal_poisoning);
if (potion == null || potion.getAmplifier() < 1) if (potion == null || potion.getAmplifier() < 1)
player.heal(1.0F); player.heal(1.0F);
this.addExhaustion(3.0F); this.addExhaustion(3.0F);

@ -6,11 +6,11 @@ import net.minecraft.entity.EntityLivingBase;
public class LoEPotions { public class LoEPotions {
public static Potion corrupting; public static Potion corrupting;
public static Potion herbal_poisoning; public static Potion overdose;
public static void registerPotions() { public static void registerPotions() {
corrupting = new PotionCorrupting(31, false, 0x7F0000).setPotionName("potion.corrupting"); corrupting = new PotionCorrupting(31, false, 0x7F0000).setPotionName("potion.corrupting");
herbal_poisoning = new PotionHerbPoison(29, false, 0x114023).setPotionName("potion.herbal_poisoning"); overdose = new PotionHerbPoison(29, false, 0x114023).setPotionName("potion.overdose");
} }
} }

@ -2,12 +2,21 @@ package com.zivilon.cinder_loe.potion;
import com.zivilon.cinder_loe.CinderLoE; import com.zivilon.cinder_loe.CinderLoE;
import net.minecraft.potion.Potion; import net.minecraft.client.Minecraft;
import net.minecraft.potion.PotionEffect; import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PotionHerbPoison extends Potion { public class PotionHerbPoison extends Potion {
public static ResourceLocation OVERDOSE_ICON = new ResourceLocation("cinder_loe", "misc/overdose.png");
public PotionHerbPoison(int id, boolean isBadEffect, int liquidColor) { public PotionHerbPoison(int id, boolean isBadEffect, int liquidColor) {
super(id, isBadEffect, liquidColor); super(id, isBadEffect, liquidColor);
} }
@ -22,7 +31,7 @@ public class PotionHerbPoison extends Potion {
} }
public static boolean should_cancel_crit(EntityPlayer player) { public static boolean should_cancel_crit(EntityPlayer player) {
PotionEffect poison = player.getActivePotionEffect(LoEPotions.herbal_poisoning); PotionEffect poison = player.getActivePotionEffect(LoEPotions.overdose);
if (poison != null && poison.getAmplifier() >= 1) { if (poison != null && poison.getAmplifier() >= 1) {
if (CinderLoE.DEBUG) System.out.println("Should cancel crit"); if (CinderLoE.DEBUG) System.out.println("Should cancel crit");
return true; return true;
@ -30,4 +39,13 @@ public class PotionHerbPoison extends Potion {
if (CinderLoE.DEBUG) System.out.println("Should not cancel crit"); if (CinderLoE.DEBUG) System.out.println("Should not cancel crit");
return false; return false;
} }
@Override
public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) {
// Currently not implemented
}
@Override
public boolean hasStatusIcon() {
return false;
}
} }

@ -390,4 +390,4 @@ item.lotr:mugOrcBrew.name=Concentrated Orc Draught
item.lotr:mugHumanBrew.name=Athelas Tea item.lotr:mugHumanBrew.name=Athelas Tea
item.lotr:mugDwarfBrew.name=Dwarven Stout item.lotr:mugDwarfBrew.name=Dwarven Stout
potion.herbal_poisoning=Herbal Poisoning potion.overdose=Overdose

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

@ -52,13 +52,9 @@
"MixinLOTREntityNPC", "MixinLOTREntityNPC",
"MixinFoodStats", "MixinFoodStats",
"MixinLOTRItemMug", "MixinLOTRItemMug",
<<<<<<< HEAD "MixinLOTREntityHorse",
"MixinLOTRNPCTargetSelector",
"MixinLOTREntityHorse"
=======
"MixinLOTRGuiMap", "MixinLOTRGuiMap",
"MixinLOTREntityAIOrcSkirmish" "MixinLOTREntityAIOrcSkirmish"
>>>>>>> b62b012e70ebb6eea11d071eb443e10f77f855ce
], ],
"client": [] "client": []
} }

Loading…
Cancel
Save