diff --git a/src/main/java/electroblob/wizardry/client/ClientProxy.java b/src/main/java/electroblob/wizardry/client/ClientProxy.java index 65c614de..5e3a2bc1 100644 --- a/src/main/java/electroblob/wizardry/client/ClientProxy.java +++ b/src/main/java/electroblob/wizardry/client/ClientProxy.java @@ -728,6 +728,9 @@ public class ClientProxy extends CommonProxy { LayerTiledOverlay.initialiseLayers(LayerMindControl::new); LayerTiledOverlay.initialiseLayers(LayerSummonAnimation::new); LayerTiledOverlay.initialiseLayers(LayerDisintegrateAnimation::new); + LayerTiledOverlay.initialiseLayers(LayerOak::new); + LayerTiledOverlay.initialiseLayers(LayerIron::new); + LayerTiledOverlay.initialiseLayers(LayerDiamond::new); } @Override diff --git a/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerDiamond.java b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerDiamond.java new file mode 100644 index 00000000..964b9694 --- /dev/null +++ b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerDiamond.java @@ -0,0 +1,47 @@ +package electroblob.wizardry.client.renderer.entity.layers; + +import electroblob.wizardry.registry.WizardryPotions; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.GlStateManager.DestFactor; +import net.minecraft.client.renderer.GlStateManager.SourceFactor; +import net.minecraft.client.renderer.entity.RenderLivingBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +/** + * Layer used to render the diamondflesh texture on creatures with the diamondflesh effect. + * + * @author WinDanesz + * @since Wizardry 4.3.7 + */ +public class LayerDiamond extends LayerTiledOverlay { + + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/blocks/diamond_block.png"); + + public LayerDiamond(RenderLivingBase renderer){ + super(renderer); + } + + @Override + public boolean shouldRender(EntityLivingBase entity, float partialTicks){ + return !entity.isInvisible() && entity.isPotionActive(WizardryPotions.diamondflesh); + } + + @Override + public ResourceLocation getTexture(EntityLivingBase entity, float partialTicks){ + return TEXTURE; + } + + @Override + public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, + float ageInTicks, float netHeadYaw, float headPitch, float scale){ + + GlStateManager.enableBlend(); + GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + + super.doRenderLayer(entity, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale); + + GlStateManager.disableBlend(); + } + +} \ No newline at end of file diff --git a/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerIron.java b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerIron.java new file mode 100644 index 00000000..f7e6b3bd --- /dev/null +++ b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerIron.java @@ -0,0 +1,47 @@ +package electroblob.wizardry.client.renderer.entity.layers; + +import electroblob.wizardry.registry.WizardryPotions; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.GlStateManager.DestFactor; +import net.minecraft.client.renderer.GlStateManager.SourceFactor; +import net.minecraft.client.renderer.entity.RenderLivingBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +/** + * Layer used to render the ironflesh texture on creatures with the ironflesh effect. + * + * @author WinDanesz + * @since Wizardry 4.3.7 + */ +public class LayerIron extends LayerTiledOverlay { + + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/blocks/iron_block.png"); + + public LayerIron(RenderLivingBase renderer){ + super(renderer); + } + + @Override + public boolean shouldRender(EntityLivingBase entity, float partialTicks){ + return !entity.isInvisible() && entity.isPotionActive(WizardryPotions.ironflesh); + } + + @Override + public ResourceLocation getTexture(EntityLivingBase entity, float partialTicks){ + return TEXTURE; + } + + @Override + public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, + float ageInTicks, float netHeadYaw, float headPitch, float scale){ + + GlStateManager.enableBlend(); + GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + + super.doRenderLayer(entity, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale); + + GlStateManager.disableBlend(); + } + +} \ No newline at end of file diff --git a/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerOak.java b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerOak.java new file mode 100644 index 00000000..111b3217 --- /dev/null +++ b/src/main/java/electroblob/wizardry/client/renderer/entity/layers/LayerOak.java @@ -0,0 +1,47 @@ +package electroblob.wizardry.client.renderer.entity.layers; + +import electroblob.wizardry.registry.WizardryPotions; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.GlStateManager.DestFactor; +import net.minecraft.client.renderer.GlStateManager.SourceFactor; +import net.minecraft.client.renderer.entity.RenderLivingBase; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.ResourceLocation; + +/** + * Layer used to render the oakflesh texture on creatures with the oakflesh effect. + * + * @author WinDanesz + * @since Wizardry 4.3.7 + */ +public class LayerOak extends LayerTiledOverlay { + + private static final ResourceLocation TEXTURE = new ResourceLocation("textures/blocks/log_oak.png"); + + public LayerOak(RenderLivingBase renderer){ + super(renderer); + } + + @Override + public boolean shouldRender(EntityLivingBase entity, float partialTicks){ + return !entity.isInvisible() && entity.isPotionActive(WizardryPotions.oakflesh); + } + + @Override + public ResourceLocation getTexture(EntityLivingBase entity, float partialTicks){ + return TEXTURE; + } + + @Override + public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, + float ageInTicks, float netHeadYaw, float headPitch, float scale){ + + GlStateManager.enableBlend(); + GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA); + + super.doRenderLayer(entity, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale); + + GlStateManager.disableBlend(); + } + +} \ No newline at end of file diff --git a/src/main/java/electroblob/wizardry/potion/PotionDiamondflesh.java b/src/main/java/electroblob/wizardry/potion/PotionDiamondflesh.java new file mode 100644 index 00000000..3773ddbf --- /dev/null +++ b/src/main/java/electroblob/wizardry/potion/PotionDiamondflesh.java @@ -0,0 +1,28 @@ +package electroblob.wizardry.potion; + +import electroblob.wizardry.Wizardry; +import electroblob.wizardry.util.EntityUtils; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.Mod; + +@Mod.EventBusSubscriber +public class PotionDiamondflesh extends PotionMagicEffect { + + public PotionDiamondflesh(boolean isBadEffect, int liquidColour) { + super(isBadEffect, liquidColour, new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/diamondflesh.png")); + // This needs to be here because registerPotionAttributeModifier doesn't like it if the potion has no name yet. + this.setPotionName("potion." + Wizardry.MODID + ":ironflesh"); + this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED, + "158a8af2-6db0-4340-a01c-a7b60d10ddf4", -0.1f, EntityUtils.Operations.MULTIPLY_CUMULATIVE); + this.registerPotionAttributeModifier(SharedMonsterAttributes.ARMOR_TOUGHNESS, + "a68d4532-5847-426c-9b03-d541b113cec2", 3.0f, EntityUtils.Operations.ADD); + this.registerPotionAttributeModifier(SharedMonsterAttributes.ARMOR, + "46a095be-82dd-43fd-8b67-13f51591eb8e", 4.0f, EntityUtils.Operations.ADD); + } + + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } +} diff --git a/src/main/java/electroblob/wizardry/potion/PotionIronflesh.java b/src/main/java/electroblob/wizardry/potion/PotionIronflesh.java new file mode 100644 index 00000000..3152fab8 --- /dev/null +++ b/src/main/java/electroblob/wizardry/potion/PotionIronflesh.java @@ -0,0 +1,28 @@ +package electroblob.wizardry.potion; + +import electroblob.wizardry.Wizardry; +import electroblob.wizardry.util.EntityUtils; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.Mod; + +@Mod.EventBusSubscriber +public class PotionIronflesh extends PotionMagicEffect { + + public PotionIronflesh(boolean isBadEffect, int liquidColour) { + super(isBadEffect, liquidColour, new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/ironflesh.png")); + // This needs to be here because registerPotionAttributeModifier doesn't like it if the potion has no name yet. + this.setPotionName("potion." + Wizardry.MODID + ":ironflesh"); + this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED, + "fe607d55-50e3-4f4f-a959-6571503f92f4", -0.1f, EntityUtils.Operations.MULTIPLY_CUMULATIVE); + this.registerPotionAttributeModifier(SharedMonsterAttributes.KNOCKBACK_RESISTANCE, + "6f78206e-8dd4-4d44-9792-d7a882111951", 0.3f, EntityUtils.Operations.ADD); + this.registerPotionAttributeModifier(SharedMonsterAttributes.ARMOR, + "e1adff1e-8510-4a09-96ed-ef677cad20c1", 4.0f, EntityUtils.Operations.ADD); + } + + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } +} diff --git a/src/main/java/electroblob/wizardry/potion/PotionOakflesh.java b/src/main/java/electroblob/wizardry/potion/PotionOakflesh.java new file mode 100644 index 00000000..a273b845 --- /dev/null +++ b/src/main/java/electroblob/wizardry/potion/PotionOakflesh.java @@ -0,0 +1,28 @@ +package electroblob.wizardry.potion; + +import electroblob.wizardry.Wizardry; +import electroblob.wizardry.util.EntityUtils; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.Mod; + +@Mod.EventBusSubscriber +public class PotionOakflesh extends PotionMagicEffect { + + public PotionOakflesh(boolean isBadEffect, int liquidColour) { + super(isBadEffect, liquidColour, new ResourceLocation(Wizardry.MODID, "textures/gui/potion_icons/oakflesh.png")); + // This needs to be here because registerPotionAttributeModifier doesn't like it if the potion has no name yet. + this.setPotionName("potion." + Wizardry.MODID + ":ironflesh"); + this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED, + "98b4ba66-7c50-4a4c-9f3f-40bcb37313b5", -0.1f, EntityUtils.Operations.MULTIPLY_CUMULATIVE); + this.registerPotionAttributeModifier(SharedMonsterAttributes.MAX_HEALTH, + "ed9d0423-60f4-4998-bd8d-dc7c33bd45b8", 0.2f, EntityUtils.Operations.MULTIPLY_FLAT); + this.registerPotionAttributeModifier(SharedMonsterAttributes.ARMOR, + "0b607c3f-fb14-43d7-96b5-1c1b6f6da242", 3.0f, EntityUtils.Operations.ADD); + } + + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } +} diff --git a/src/main/java/electroblob/wizardry/registry/Spells.java b/src/main/java/electroblob/wizardry/registry/Spells.java index 3f1afe3e..2e7a544b 100644 --- a/src/main/java/electroblob/wizardry/registry/Spells.java +++ b/src/main/java/electroblob/wizardry/registry/Spells.java @@ -359,7 +359,7 @@ public final class Spells { registry.register(new GreaterHeal()); registry.register(new SpellConstruct<>("healing_aura", SpellActions.POINT_DOWN, EntityHealAura::new, false).addProperties(Spell.EFFECT_RADIUS, Spell.DAMAGE, Spell.HEALTH)); registry.register(new Forcefield()); - registry.register(new SpellBuff("ironflesh", 0.4f, 0.5f, 0.6f, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f)); + registry.register(new SpellBuff("ironflesh", 0.4f, 0.5f, 0.6f, () -> WizardryPotions.ironflesh).soundValues(0.7f, 1.2f, 0.4f)); registry.register(new Transience()); registry.register(new Meteor()); @@ -380,7 +380,7 @@ public final class Spells { registry.register(new Shockwave()); registry.register(new SummonIronGolem()); registry.register(new ArrowRain()); - registry.register(new SpellBuff("diamondflesh", 0.1f, 0.7f, 1, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f)); + registry.register(new SpellBuff("diamondflesh", 0.1f, 0.7f, 1, () -> WizardryPotions.diamondflesh).soundValues(0.7f, 1.2f, 0.4f)); registry.register(new SpellBuff("font_of_vitality", 1, 0.8f, 0.3f, () -> MobEffects.ABSORPTION, () -> MobEffects.REGENERATION).soundValues(0.7f, 1.2f, 0.4f)); // Wizardry 1.1 spells @@ -398,7 +398,7 @@ public final class Spells { registry.register(new PocketWorkbench()); registry.register(new ImbueWeapon()); registry.register(new InvigoratingPresence()); - registry.register(new SpellBuff("oakflesh", 0.6f, 0.5f, 0.4f, () -> MobEffects.RESISTANCE).soundValues(0.7f, 1.2f, 0.4f)); + registry.register(new SpellBuff("oakflesh", 0.6f, 0.5f, 0.4f, () -> WizardryPotions.oakflesh).soundValues(0.7f, 1.2f, 0.4f)); registry.register(new SpellProjectile<>("greater_fireball", EntityLargeMagicFireball::new).addProperties(Spell.DAMAGE, EntityLargeMagicFireball.EXPLOSION_POWER));//new GreaterFireball()); registry.register(new FlamingWeapon()); diff --git a/src/main/java/electroblob/wizardry/registry/WizardryPotions.java b/src/main/java/electroblob/wizardry/registry/WizardryPotions.java index 75535e1a..a4fd9662 100644 --- a/src/main/java/electroblob/wizardry/registry/WizardryPotions.java +++ b/src/main/java/electroblob/wizardry/registry/WizardryPotions.java @@ -57,6 +57,9 @@ public final class WizardryPotions { public static final Potion frost_step = placeholder(); public static final Potion mark_of_sacrifice = placeholder(); public static final Potion mirage = placeholder(); + public static final Potion oakflesh = placeholder(); + public static final Potion ironflesh = placeholder(); + public static final Potion diamondflesh = placeholder(); /** * Sets both the registry and unlocalised names of the given potion, then registers it with the given registry. Use @@ -201,6 +204,10 @@ public final class WizardryPotions { public void spawnCustomParticle(World world, double x, double y, double z){} // We only want the syncing }.setBeneficial()); + registerPotion(registry, "oakflesh", new PotionOakflesh(false, 0).setBeneficial()); + registerPotion(registry, "ironflesh", new PotionIronflesh(false, 0).setBeneficial()); + registerPotion(registry, "diamondflesh", new PotionDiamondflesh(false, 0).setBeneficial()); + } } \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/lang/en_us.lang b/src/main/resources/assets/ebwizardry/lang/en_us.lang index 7821d9fc..01b96ce0 100644 --- a/src/main/resources/assets/ebwizardry/lang/en_us.lang +++ b/src/main/resources/assets/ebwizardry/lang/en_us.lang @@ -1203,7 +1203,7 @@ spell.ebwizardry\:intimidate.desc=Emits an intimidating growl which causes nearb spell.ebwizardry\:invigorating_presence.desc=Grants the caster and all nearby allies increased strength for 45 seconds. spell.ebwizardry\:invisibility.desc=Makes the caster invisible for 30 seconds. spell.ebwizardry\:invoke_weather.desc=Changes the weather in the world. -spell.ebwizardry\:ironflesh.desc=Greatly improves the caster's damage resistance for 30 seconds. +spell.ebwizardry\:ironflesh.desc=Greatly improves the caster's armor and knockback resistance for 30 seconds. spell.ebwizardry\:leap.desc=Causes the caster to jump upwards several blocks and slightly forward. spell.ebwizardry\:levitation.desc=Raises the caster upwards while the use item button is held. Will also negate fall damage if used before hitting the ground. spell.ebwizardry\:life_drain.desc=Creates a stream of withering energy in the direction you are pointing which drains the life of the target and uses it to gradually regenerate your health. @@ -1226,7 +1226,7 @@ spell.ebwizardry\:mine.desc=Breaks the block the caster is looking at. Potency w spell.ebwizardry\:mirage.desc=Creates an illusion where the caster appears to be a few blocks away from their actual position, blinking around every few seconds. The illusion lasts for 20 seconds. spell.ebwizardry\:muffle.desc=Silences any sounds made by the caster for 30 seconds. When muffled, mobs can only detect you when looking towards you. spell.ebwizardry\:none.desc=To get a spell book with the /give command, use id\: /give [player] ebwizardry\:spell_book 1 [spell id] (if you found this book in a chest, some other mod has messed things up). -spell.ebwizardry\:oakflesh.desc=Improves the caster's damage resistance for 30 seconds. +spell.ebwizardry\:oakflesh.desc=Slightly improves the caster's vitality and damage resistance for 30 seconds. spell.ebwizardry\:paralysis.desc=Delivers a powerful lightning bolt that paralyses targets for 5 seconds. Paralysed creatures cannot move and will still take damage - but too much will snap the creature out of paralysis. spell.ebwizardry\:permafrost.desc=Spreads a layer of slippery ice on the ground where you are pointing, the extreme cold of which causes creatures to slowly take damage. spell.ebwizardry\:petrify.desc=Turns the target to stone until broken out, with a chance for it to break out when it is dark. The target cannot move or do anything while petrified but is also impervious to all damage. @@ -1400,6 +1400,9 @@ potion.ebwizardry\:containment=Containment potion.ebwizardry\:frost_step=Frost Step potion.ebwizardry\:mark_of_sacrifice=Mark of Sacrifice potion.ebwizardry\:mirage=Mirage +potion.ebwizardry\:oakflesh=Oakflesh +potion.ebwizardry\:ironflesh=Ironflesh +potion.ebwizardry\:diamondflesh=Diamondflesh enchantment.ebwizardry\:magic_sword=Imbuement enchantment.ebwizardry\:magic_bow=Imbuement diff --git a/src/main/resources/assets/ebwizardry/spells/diamondflesh.json b/src/main/resources/assets/ebwizardry/spells/diamondflesh.json index 2867ca12..59e33be7 100644 --- a/src/main/resources/assets/ebwizardry/spells/diamondflesh.json +++ b/src/main/resources/assets/ebwizardry/spells/diamondflesh.json @@ -17,7 +17,7 @@ "chargeup": 25, "cooldown": 300, "base_properties": { - "resistance_duration": 600, - "resistance_strength": 2 + "diamondflesh_duration": 600, + "diamondflesh_strength": 0 } } \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/spells/empowering_presence.json b/src/main/resources/assets/ebwizardry/spells/empowering_presence.json index 3165ecc7..43305a8d 100644 --- a/src/main/resources/assets/ebwizardry/spells/empowering_presence.json +++ b/src/main/resources/assets/ebwizardry/spells/empowering_presence.json @@ -14,12 +14,12 @@ "element": "healing", "type": "buff", "cost": 30, - "chargeup": 0, + "chargeup": 20, "cooldown": 60, "base_properties": { "effect_radius": 5, "effect_duration": 900, - "effect_strength": 1, + "effect_strength": 0, "potency_per_level": 0.15 } } \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/spells/ironflesh.json b/src/main/resources/assets/ebwizardry/spells/ironflesh.json index 089f63bd..02a6ab45 100644 --- a/src/main/resources/assets/ebwizardry/spells/ironflesh.json +++ b/src/main/resources/assets/ebwizardry/spells/ironflesh.json @@ -17,7 +17,7 @@ "chargeup": 15, "cooldown": 100, "base_properties": { - "resistance_duration": 600, - "resistance_strength": 1 + "ironflesh_duration": 600, + "ironflesh_strength": 0 } } \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/spells/oakflesh.json b/src/main/resources/assets/ebwizardry/spells/oakflesh.json index d62278ba..c3e2406a 100644 --- a/src/main/resources/assets/ebwizardry/spells/oakflesh.json +++ b/src/main/resources/assets/ebwizardry/spells/oakflesh.json @@ -17,7 +17,7 @@ "chargeup": 0, "cooldown": 50, "base_properties": { - "resistance_duration": 600, - "resistance_strength": 0 + "oakflesh_duration": 600, + "oakflesh_strength": 0 } } \ No newline at end of file diff --git a/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/diamondflesh.png b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/diamondflesh.png new file mode 100644 index 00000000..a57fdbaa Binary files /dev/null and b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/diamondflesh.png differ diff --git a/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/ironflesh.png b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/ironflesh.png new file mode 100644 index 00000000..75c25546 Binary files /dev/null and b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/ironflesh.png differ diff --git a/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/oakflesh.png b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/oakflesh.png new file mode 100644 index 00000000..126450b1 Binary files /dev/null and b/src/main/resources/assets/ebwizardry/textures/gui/potion_icons/oakflesh.png differ