Initial commit
This commit is contained in:
commit
c4a24c9fdf
142 changed files with 15491 additions and 0 deletions
60
JotunnModStub/Trol/TrolDamagePatches.cs
Normal file
60
JotunnModStub/Trol/TrolDamagePatches.cs
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
using HarmonyLib;
|
||||
using UnityEngine;
|
||||
|
||||
namespace RacesOfValheim
|
||||
{
|
||||
[HarmonyPatch(typeof(Character), "ApplyDamage")]
|
||||
public static class Trol_Character_ApplyDamage_Patch
|
||||
{
|
||||
public static void Prefix(Character __instance, ref HitData hit)
|
||||
{
|
||||
if (__instance == Player.m_localPlayer && TrolRace.IsTrol())
|
||||
{
|
||||
// Trols are weak to fire (take 50% more damage)
|
||||
if (hit.m_damage.m_fire > 0f)
|
||||
{
|
||||
hit.m_damage.m_fire *= 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
if (hit.GetAttacker() == Player.m_localPlayer && TrolRace.IsTrol())
|
||||
{
|
||||
if (BossProgressionManager.GetCurrentProgressionState() >= 4) // Bonemass
|
||||
{
|
||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||
{
|
||||
hit.m_damage.m_blunt += 10f;
|
||||
}
|
||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||
{
|
||||
hit.m_damage.m_slash += 10f;
|
||||
}
|
||||
}
|
||||
|
||||
if (BossProgressionManager.GetCurrentProgressionState() >= 6) // Yagluth
|
||||
{
|
||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||
{
|
||||
hit.m_damage.m_blunt += 5f;
|
||||
}
|
||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||
{
|
||||
hit.m_damage.m_slash += 5f;
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.m_localPlayer.GetSEMan().HaveStatusEffect("SE_TrolTrueForm".GetStableHashCode()))
|
||||
{
|
||||
if (hit.m_skill == Skills.SkillType.Clubs || hit.m_skill == Skills.SkillType.Unarmed)
|
||||
{
|
||||
hit.m_damage.m_blunt += 40f;
|
||||
}
|
||||
else if (hit.m_skill == Skills.SkillType.Axes)
|
||||
{
|
||||
hit.m_damage.m_slash += 40f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue