Add amulet of vitality
This commit is contained in:
@@ -276,6 +276,7 @@ public final class WizardryModels {
|
|||||||
registerItemModel(WizardryItems.amulet_transience);
|
registerItemModel(WizardryItems.amulet_transience);
|
||||||
registerItemModel(WizardryItems.amulet_resurrection);
|
registerItemModel(WizardryItems.amulet_resurrection);
|
||||||
registerItemModel(WizardryItems.amulet_auto_shield);
|
registerItemModel(WizardryItems.amulet_auto_shield);
|
||||||
|
registerItemModel(WizardryItems.amulet_absorption);
|
||||||
|
|
||||||
registerItemModel(WizardryItems.charm_haggler);
|
registerItemModel(WizardryItems.charm_haggler);
|
||||||
registerItemModel(WizardryItems.charm_experience_tome);
|
registerItemModel(WizardryItems.charm_experience_tome);
|
||||||
|
|||||||
@@ -261,6 +261,7 @@ public final class WizardryItems {
|
|||||||
public static final Item amulet_transience = placeholder();
|
public static final Item amulet_transience = placeholder();
|
||||||
public static final Item amulet_resurrection = placeholder();
|
public static final Item amulet_resurrection = placeholder();
|
||||||
public static final Item amulet_auto_shield = placeholder();
|
public static final Item amulet_auto_shield = placeholder();
|
||||||
|
public static final Item amulet_absorption = placeholder();
|
||||||
|
|
||||||
public static final Item charm_haggler = placeholder();
|
public static final Item charm_haggler = placeholder();
|
||||||
public static final Item charm_experience_tome = placeholder();
|
public static final Item charm_experience_tome = placeholder();
|
||||||
@@ -620,6 +621,7 @@ public final class WizardryItems {
|
|||||||
registerItem(registry, "amulet_transience", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
registerItem(registry, "amulet_transience", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||||
registerItem(registry, "amulet_resurrection", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
registerItem(registry, "amulet_resurrection", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||||
registerItem(registry, "amulet_auto_shield", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
registerItem(registry, "amulet_auto_shield", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.AMULET));
|
||||||
|
registerItem(registry, "amulet_absorption", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.AMULET));
|
||||||
|
|
||||||
registerItem(registry, "charm_haggler", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
registerItem(registry, "charm_haggler", new ItemArtefact(EnumRarity.RARE, ItemArtefact.Type.CHARM));
|
||||||
registerItem(registry, "charm_experience_tome", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
registerItem(registry, "charm_experience_tome", new ItemArtefact(EnumRarity.EPIC, ItemArtefact.Type.CHARM));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class GreaterHeal extends SpellBuff {
|
|||||||
protected boolean applyEffects(EntityLivingBase caster, SpellModifiers modifiers){
|
protected boolean applyEffects(EntityLivingBase caster, SpellModifiers modifiers){
|
||||||
|
|
||||||
if(caster.getHealth() < caster.getMaxHealth() && caster.getHealth() > 0){
|
if(caster.getHealth() < caster.getMaxHealth() && caster.getHealth() > 0){
|
||||||
caster.heal(getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
Heal.heal(caster, getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class GroupHeal extends Spell {
|
|||||||
|
|
||||||
if(target.getHealth() < target.getMaxHealth() && target.getHealth() > 0){
|
if(target.getHealth() < target.getMaxHealth() && target.getHealth() > 0){
|
||||||
|
|
||||||
target.heal(getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
Heal.heal(target, getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
||||||
|
|
||||||
if(world.isRemote) ParticleBuilder.spawnHealParticles(world, target);
|
if(world.isRemote) ParticleBuilder.spawnHealParticles(world, target);
|
||||||
playSound(world, target, ticksInUse, -1, modifiers);
|
playSound(world, target, ticksInUse, -1, modifiers);
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package electroblob.wizardry.spell;
|
package electroblob.wizardry.spell;
|
||||||
|
|
||||||
|
import electroblob.wizardry.item.ItemArtefact;
|
||||||
|
import electroblob.wizardry.registry.WizardryItems;
|
||||||
import electroblob.wizardry.util.SpellModifiers;
|
import electroblob.wizardry.util.SpellModifiers;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
|
||||||
public class Heal extends SpellBuff {
|
public class Heal extends SpellBuff {
|
||||||
|
|
||||||
@@ -15,11 +18,31 @@ public class Heal extends SpellBuff {
|
|||||||
protected boolean applyEffects(EntityLivingBase caster, SpellModifiers modifiers){
|
protected boolean applyEffects(EntityLivingBase caster, SpellModifiers modifiers){
|
||||||
|
|
||||||
if(caster.getHealth() < caster.getMaxHealth() && caster.getHealth() > 0){
|
if(caster.getHealth() < caster.getMaxHealth() && caster.getHealth() > 0){
|
||||||
caster.heal(getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
heal(caster, getProperty(HEALTH).floatValue() * modifiers.get(SpellModifiers.POTENCY));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Heals the given entity by the given amount, accounting for special behaviour from artefacts. This does not check
|
||||||
|
* whether the entity is already on full health or not.
|
||||||
|
* @param entity The entity to heal
|
||||||
|
* @param health The number of half-hearts to heal
|
||||||
|
*/
|
||||||
|
public static void heal(EntityLivingBase entity, float health){
|
||||||
|
|
||||||
|
float excessHealth = entity.getHealth() + health - entity.getMaxHealth();
|
||||||
|
|
||||||
|
entity.heal(health);
|
||||||
|
|
||||||
|
// If the player is able to heal, they can't possibly have absorption hearts, so no need to check!
|
||||||
|
if(excessHealth > 0 && entity instanceof EntityPlayer
|
||||||
|
&& ItemArtefact.isArtefactActive((EntityPlayer)entity, WizardryItems.amulet_absorption)){
|
||||||
|
entity.setAbsorptionAmount(excessHealth);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,6 +360,8 @@ item.ebwizardry\:amulet_resurrection.name=Amulet of the Immortal
|
|||||||
item.ebwizardry\:amulet_resurrection.desc=The resurrection spell can be used on yourself from beyond the grave
|
item.ebwizardry\:amulet_resurrection.desc=The resurrection spell can be used on yourself from beyond the grave
|
||||||
item.ebwizardry\:amulet_auto_shield.name=Hyeleth's Amulet
|
item.ebwizardry\:amulet_auto_shield.name=Hyeleth's Amulet
|
||||||
item.ebwizardry\:amulet_auto_shield.desc=Grants a 25%% chance to trigger the shield spell for a few seconds when bound to a wand on your hotbar
|
item.ebwizardry\:amulet_auto_shield.desc=Grants a 25%% chance to trigger the shield spell for a few seconds when bound to a wand on your hotbar
|
||||||
|
item.ebwizardry\:amulet_absorption.name=Amulet of Vitality
|
||||||
|
item.ebwizardry\:amulet_absorption.desc=Excess health from healing spells is converted into absorption hearts
|
||||||
|
|
||||||
item.ebwizardry\:charm_haggler.name=Haggler's Sign
|
item.ebwizardry\:charm_haggler.name=Haggler's Sign
|
||||||
item.ebwizardry\:charm_haggler.desc=Wizards are guaranteed to offer a new trade every time you trade with them
|
item.ebwizardry\:charm_haggler.desc=Wizards are guaranteed to offer a new trade every time you trade with them
|
||||||
|
|||||||
@@ -360,6 +360,8 @@ item.ebwizardry\:amulet_resurrection.name=Amulet of the Immortal
|
|||||||
item.ebwizardry\:amulet_resurrection.desc=The resurrection spell can be used on yourself from beyond the grave
|
item.ebwizardry\:amulet_resurrection.desc=The resurrection spell can be used on yourself from beyond the grave
|
||||||
item.ebwizardry\:amulet_auto_shield.name=Hyeleth's Amulet
|
item.ebwizardry\:amulet_auto_shield.name=Hyeleth's Amulet
|
||||||
item.ebwizardry\:amulet_auto_shield.desc=Grants a 25%% chance to trigger the shield spell for a few seconds when bound to a wand on your hotbar
|
item.ebwizardry\:amulet_auto_shield.desc=Grants a 25%% chance to trigger the shield spell for a few seconds when bound to a wand on your hotbar
|
||||||
|
item.ebwizardry\:amulet_absorption.name=Amulet of Vitality
|
||||||
|
item.ebwizardry\:amulet_absorption.desc=Excess health from healing spells is converted into absorption hearts
|
||||||
|
|
||||||
item.ebwizardry\:charm_haggler.name=Haggler's Sign
|
item.ebwizardry\:charm_haggler.name=Haggler's Sign
|
||||||
item.ebwizardry\:charm_haggler.desc=Wizards are guaranteed to offer a new trade every time you trade with them
|
item.ebwizardry\:charm_haggler.desc=Wizards are guaranteed to offer a new trade every time you trade with them
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "ebwizardry:items/amulet_absorption"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Reference in New Issue
Block a user