Added stronger variant of Hill-troll Chieftain. Fixed Hill-troll Chieftain phases
parent
cc80be23dc
commit
54c2dbec62
@ -0,0 +1,16 @@
|
|||||||
|
package com.zivilon.cinder_loe.entity.npc.boss;
|
||||||
|
|
||||||
|
import lotr.common.entity.npc.LOTREntityMountainTrollChieftain;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
|
||||||
|
public class StrongHillTrollChieftain extends LOTREntityMountainTrollChieftain {
|
||||||
|
public StrongHillTrollChieftain(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyEntityAttributes() {
|
||||||
|
super.applyEntityAttributes();
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(150.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package com.zivilon.cinder_loe.mixins;
|
||||||
|
|
||||||
|
import lotr.common.LOTRMod;
|
||||||
|
import lotr.common.entity.npc.LOTREntityMountainTrollChieftain;
|
||||||
|
import lotr.common.entity.npc.LOTREntityMountainTroll;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
|
import com.zivilon.cinder_loe.util.IBossEntity;
|
||||||
|
|
||||||
|
@Mixin(LOTREntityMountainTrollChieftain.class)
|
||||||
|
public class MixinLOTREntityMountainTrollChieftain extends LOTREntityMountainTroll implements IBossEntity {
|
||||||
|
@Shadow
|
||||||
|
public int getTrollArmorLevel() {return 1;}
|
||||||
|
@Shadow
|
||||||
|
public void setTrollArmorLevel(int i) {}
|
||||||
|
|
||||||
|
public MixinLOTREntityMountainTrollChieftain(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Overwrite
|
||||||
|
protected void damageEntity(DamageSource damagesource, float f) {
|
||||||
|
super.damageEntity(damagesource, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void change_phase() {
|
||||||
|
if (!this.worldObj.isRemote) {
|
||||||
|
setTrollArmorLevel(getTrollArmorLevel() - 1);
|
||||||
|
if (getTrollArmorLevel() == 0) {
|
||||||
|
double speed = getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue();
|
||||||
|
speed *= 1.5D;
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed);
|
||||||
|
}
|
||||||
|
double maxHealth = getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue();
|
||||||
|
maxHealth *= 2.0D;
|
||||||
|
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
|
||||||
|
setHealth(getMaxHealth());
|
||||||
|
this.worldObj.setEntityState((Entity)this, (byte)21);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
package com.zivilon.cinder_loe.util;
|
||||||
|
|
||||||
|
public interface IBossEntity {
|
||||||
|
public void change_phase();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue