From 70c1354a4a96698758a88c032866288f79de6f5a Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Sat, 24 Aug 2024 08:16:37 -0400 Subject: Initial commit --- .../java/jp/plusplus/fbs/api/MagicEnchantBase.java | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java (limited to 'src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java') diff --git a/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java new file mode 100644 index 0000000..fedf3ba --- /dev/null +++ b/src/main/java/jp/plusplus/fbs/api/MagicEnchantBase.java @@ -0,0 +1,55 @@ +package jp.plusplus.fbs.api; + +import jp.plusplus.fbs.api.IMagicEnchant; +import jp.plusplus.fbs.api.MagicBase; +import net.minecraft.entity.EntityLivingBase; + +/** + * Created by pluslus_F on 2015/06/22. + */ +public abstract class MagicEnchantBase extends MagicBase implements IMagicEnchant { + protected int trial, max; + + public MagicEnchantBase(int t, int m){ + trial=t; + max=m; + } + + @Override + public void success() { + enchant(player, true); + } + + @Override + public void failure() { + sanity(trial, max); + enchant(player, false); + } + + public int getAmplifier(int rate){ + int t=getLvDiff(); + if(t<=0) return 1; + int a=1+t/rate; + return a>5?5:a; + } + public int getDuration(int base, float rate){ + int t=getLvDiff(); + if(t<=0) return 20*base; + return (int)(20*(base+t/rate)); + } + + @Override + public float damageScale(EntityLivingBase entity){ + return 0.f; + } + + @Override + public float damageValue(EntityLivingBase entity){ + return 0.f; + } + + @Override + public ParticleColor setParticleColor(){ + return new ParticleColor(); + } +} -- cgit v1.2.3