Skip to content

Commit

Permalink
elem mastery - amplifying
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoismDeepLake committed Mar 21, 2022
1 parent fe3a9cd commit c87f3fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/deeplake/genshin12/designs/ElemTuple.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static ReactionResult reactionResult(ElemTuple aura, ElemTuple apply, int
case DENDRO:
break;
case PYRO:
return normalCalculation(aura,apply,EnumReaction.VAPORIZE_W, lv1,lv2);
return normalCalculation(aura,apply,EnumReaction.VAPORIZE_S, lv1,lv2);
case CYRO:
break;
}
Expand All @@ -198,7 +198,7 @@ public static ReactionResult reactionResult(ElemTuple aura, ElemTuple apply, int
//burn
break;
case HYDRO:
return normalCalculation(aura,apply,EnumReaction.VAPORIZE_S, lv1,lv2);
return normalCalculation(aura,apply,EnumReaction.VAPORIZE_W, lv1,lv2);
case CYRO:
return normalCalculation(aura,apply,EnumReaction.MELT_S, lv1,lv2);
}
Expand All @@ -219,7 +219,7 @@ public static ReactionResult reactionResult(ElemTuple aura, ElemTuple apply, int
case HYDRO:
break;
case PYRO:
return normalCalculation(aura,apply,EnumReaction.MELT_S, lv1,lv2);
return normalCalculation(aura,apply,EnumReaction.MELT_W, lv1,lv2);
}
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ public static IAttribute getNewAttrNonpercent(String name)
return attribute;
}

public static float getElemMastery(EntityLivingBase livingBase)
{
IAttributeInstance instance = livingBase.getEntityAttribute(ELEM_MASTERY);
if (instance != null)
{
return (float) instance.getAttributeValue();
}
return 0f;
}


//Elemental
//-Damage Bonus
Expand Down
26 changes: 22 additions & 4 deletions src/main/java/com/deeplake/genshin12/util/ElementalUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.deeplake.genshin12.designs.ElemTuple;
import com.deeplake.genshin12.designs.ReactionResult;
import com.deeplake.genshin12.entity.creatures.attribute.HandleResistance;
import com.deeplake.genshin12.entity.creatures.attribute.ModAttributes;
import com.deeplake.genshin12.init.ModConfig;
import com.deeplake.genshin12.potion.ModPotions;
import net.minecraft.entity.EntityLivingBase;
Expand All @@ -15,6 +16,22 @@

public class ElementalUtil {

static final float elemMastAmpl(float em)
{
return 278 * em / (em + 1400);
}

static final float elemMastTrans(float em)
{
return 1600 * em / (em + 2000);//v1.6
}

//Crystallize
static final float elemMastCrst(float em)
{
return 444 * em / (em + 1400);
}

public static float getAmountFromBuff(PotionEffect effect)
{
if (effect == null)
Expand Down Expand Up @@ -102,21 +119,22 @@ else if (elemental != EnumElemental.PHYSICAL)
Idealland.Log("Reaction: %s", reactionResult);
}

float ampl = 1 + elemMastAmpl(ModAttributes.getElemMastery(attacker));
switch (reactionResult.reaction)
{
case NONE:
break;
case MELT_S:
damage *= ModConfig.ELEMCONF.DAMAGE_STRONG_MELT;
damage *= ModConfig.ELEMCONF.DAMAGE_STRONG_MELT * ampl;
break;
case MELT_W:
damage *= ModConfig.ELEMCONF.DAMAGE_WEAK_MELT;
damage *= ModConfig.ELEMCONF.DAMAGE_WEAK_MELT * ampl;
break;
case VAPORIZE_S:
damage *= ModConfig.ELEMCONF.DAMAGE_STRONG_VAPORIZE;
damage *= ModConfig.ELEMCONF.DAMAGE_STRONG_VAPORIZE * ampl;
break;
case VAPORIZE_W:
damage *= ModConfig.ELEMCONF.DAMAGE_WEAK_VAPORIZE;
damage *= ModConfig.ELEMCONF.DAMAGE_WEAK_VAPORIZE * ampl;
break;
case OVERLOAD:
target.getEntityWorld().createExplosion(attacker, target.posX, target.posY, target.posZ, 1f, ModConfig.ELEMCONF.OVERLOAD_EXPLOSION_GRIEF);
Expand Down

0 comments on commit c87f3fe

Please sign in to comment.