| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using System.Text; |
| using System.Text; |
| using UnityEngine; |
| using UnityEngine; |
| |
| |
| public class SE_Stats : StatusEffect |
| public class SE_Stats : StatusEffect |
| { |
| { |
| public override void Setup(Character character) |
| public override void Setup(Character character) |
| { |
| { |
| base.Setup(character); |
| base.Setup(character); |
| if (this.m_healthOverTime > 0f && this.m_healthOverTimeInterval > 0f) |
| if (this.m_healthOverTime > 0f && this.m_healthOverTimeInterval > 0f) |
| { |
| { |
| if (this.m_healthOverTimeDuration <= 0f) |
| if (this.m_healthOverTimeDuration <= 0f) |
| { |
| { |
| this.m_healthOverTimeDuration = this.m_ttl; |
| this.m_healthOverTimeDuration = this.m_ttl; |
| } |
| } |
| this.m_healthOverTimeTicks = this.m_healthOverTimeDuration / this.m_healthOverTimeInterval; |
| this.m_healthOverTimeTicks = this.m_healthOverTimeDuration / this.m_healthOverTimeInterval; |
| this.m_healthOverTimeTickHP = this.m_healthOverTime / this.m_healthOverTimeTicks; |
| this.m_healthOverTimeTickHP = this.m_healthOverTime / this.m_healthOverTimeTicks; |
| } |
| } |
| if (this.m_staminaOverTime > 0f && this.m_staminaOverTimeDuration <= 0f) |
| if (this.m_staminaOverTime > 0f && this.m_staminaOverTimeDuration <= 0f) |
| { |
| { |
| this.m_staminaOverTimeDuration = this.m_ttl; |
| this.m_staminaOverTimeDuration = this.m_ttl; |
| } |
| } |
| if (this.m_eitrOverTime > 0f && this.m_eitrOverTimeDuration <= 0f) |
| if (this.m_eitrOverTime > 0f && this.m_eitrOverTimeDuration <= 0f) |
| { |
| { |
| this.m_eitrOverTimeDuration = this.m_ttl; |
| this.m_eitrOverTimeDuration = this.m_ttl; |
| } |
| } |
| } |
| } |
| |
| |
| public override void UpdateStatusEffect(float dt) |
| public override void UpdateStatusEffect(float dt) |
| { |
| { |
| base.UpdateStatusEffect(dt); |
| base.UpdateStatusEffect(dt); |
| if (this.m_tickInterval > 0f) |
| if (this.m_tickInterval > 0f) |
| { |
| { |
| this.m_tickTimer += dt; |
| this.m_tickTimer += dt; |
| if (this.m_tickTimer >= this.m_tickInterval) |
| if (this.m_tickTimer >= this.m_tickInterval) |
| { |
| { |
| this.m_tickTimer = 0f; |
| this.m_tickTimer = 0f; |
| if (this.m_character.GetHealthPercentage() >= this.m_healthPerTickMinHealthPercentage) |
| if (this.m_character.GetHealthPercentage() >= this.m_healthPerTickMinHealthPercentage) |
| { |
| { |
| if (this.m_healthPerTick > 0f) |
| if (this.m_healthPerTick > 0f) |
| { |
| { |
| this.m_character.Heal(this.m_healthPerTick, true); |
| this.m_character.Heal(this.m_healthPerTick, true); |
| } |
| } |
| else |
| else |
| { |
| { |
| HitData hitData = new HitData(); |
| HitData hitData = new HitData(); |
| hitData.m_damage.m_damage = -this.m_healthPerTick; |
| hitData.m_damage.m_damage = -this.m_healthPerTick; |
| hitData.m_point = this.m_character.GetTopPoint(); |
| hitData.m_point = this.m_character.GetTopPoint(); |
| hitData.m_hitType = this.m_hitType; |
| hitData.m_hitType = this.m_hitType; |
| this.m_character.Damage(hitData); |
| this.m_character.Damage(hitData); |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| if (this.m_healthOverTimeTicks > 0f) |
| if (this.m_healthOverTimeTicks > 0f) |
| { |
| { |
| this.m_healthOverTimeTimer += dt; |
| this.m_healthOverTimeTimer += dt; |
| if (this.m_healthOverTimeTimer > this.m_healthOverTimeInterval) |
| if (this.m_healthOverTimeTimer > this.m_healthOverTimeInterval) |
| { |
| { |
| this.m_healthOverTimeTimer = 0f; |
| this.m_healthOverTimeTimer = 0f; |
| this.m_healthOverTimeTicks -= 1f; |
| this.m_healthOverTimeTicks -= 1f; |
| this.m_character.Heal(this.m_healthOverTimeTickHP, true); |
| this.m_character.Heal(this.m_healthOverTimeTickHP, true); |
| } |
| } |
| } |
| } |
| if (this.m_staminaOverTime != 0f && this.m_time <= this.m_staminaOverTimeDuration) |
| if (this.m_staminaOverTime != 0f && this.m_time <= this.m_staminaOverTimeDuration) |
| { |
| { |
| float num = this.m_staminaOverTimeDuration / dt; |
| float num = this.m_staminaOverTimeDuration / dt; |
| this.m_character.AddStamina(this.m_staminaOverTime / num); |
| this.m_character.AddStamina(this.m_staminaOverTime / num); |
| } |
| } |
| if (this.m_eitrOverTime != 0f && this.m_time <= this.m_eitrOverTimeDuration) |
| if (this.m_eitrOverTime != 0f && this.m_time <= this.m_eitrOverTimeDuration) |
| { |
| { |
| float num2 = this.m_eitrOverTimeDuration / dt; |
| float num2 = this.m_eitrOverTimeDuration / dt; |
| this.m_character.AddEitr(this.m_eitrOverTime / num2); |
| this.m_character.AddEitr(this.m_eitrOverTime / num2); |
| } |
| } |
| if (this.m_staminaDrainPerSec > 0f) |
| if (this.m_staminaDrainPerSec > 0f) |
| { |
| { |
| this.m_character.UseStamina(this.m_staminaDrainPerSec * dt, false); |
| this.m_character.UseStamina(this.m_staminaDrainPerSec * dt, false); |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifyHealthRegen(ref float regenMultiplier) |
| public override void ModifyHealthRegen(ref float regenMultiplier) |
| { |
| { |
| if (this.m_healthRegenMultiplier > 1f) |
| if (this.m_healthRegenMultiplier > 1f) |
| { |
| { |
| regenMultiplier += this.m_healthRegenMultiplier - 1f; |
| regenMultiplier += this.m_healthRegenMultiplier - 1f; |
| return; |
| return; |
| } |
| } |
| regenMultiplier *= this.m_healthRegenMultiplier; |
| regenMultiplier *= this.m_healthRegenMultiplier; |
| } |
| } |
| |
| |
| public override void ModifyStaminaRegen(ref float staminaRegen) |
| public override void ModifyStaminaRegen(ref float staminaRegen) |
| { |
| { |
| if (this.m_staminaRegenMultiplier > 1f) |
| if (this.m_staminaRegenMultiplier > 1f) |
| { |
| { |
| staminaRegen += this.m_staminaRegenMultiplier - 1f; |
| staminaRegen += this.m_staminaRegenMultiplier - 1f; |
| return; |
| return; |
| } |
| } |
| staminaRegen *= this.m_staminaRegenMultiplier; |
| staminaRegen *= this.m_staminaRegenMultiplier; |
| } |
| } |
| |
| |
| public override void ModifyEitrRegen(ref float staminaRegen) |
| public override void ModifyEitrRegen(ref float staminaRegen) |
| { |
| { |
| if (this.m_eitrRegenMultiplier > 1f) |
| if (this.m_eitrRegenMultiplier > 1f) |
| { |
| { |
| staminaRegen += this.m_eitrRegenMultiplier - 1f; |
| staminaRegen += this.m_eitrRegenMultiplier - 1f; |
| return; |
| return; |
| } |
| } |
| staminaRegen *= this.m_eitrRegenMultiplier; |
| staminaRegen *= this.m_eitrRegenMultiplier; |
| } |
| } |
| |
| |
| public override void ModifyDamageMods(ref HitData.DamageModifiers modifiers) |
| public override void ModifyDamageMods(ref HitData.DamageModifiers modifiers) |
| { |
| { |
| modifiers.Apply(this.m_mods); |
| modifiers.Apply(this.m_mods); |
| } |
| } |
| |
| |
| public override void ModifyRaiseSkill(Skills.SkillType skill, ref float value) |
| public override void ModifyRaiseSkill(Skills.SkillType skill, ref float value) |
| { |
| { |
| if (this.m_raiseSkill == Skills.SkillType.None) |
| if (this.m_raiseSkill == Skills.SkillType.None) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.m_raiseSkill == Skills.SkillType.All || this.m_raiseSkill == skill) |
| if (this.m_raiseSkill == Skills.SkillType.All || this.m_raiseSkill == skill) |
| { |
| { |
| value += this.m_raiseSkillModifier; |
| value += this.m_raiseSkillModifier; |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifySkillLevel(Skills.SkillType skill, ref float value) |
| public override void ModifySkillLevel(Skills.SkillType skill, ref float value) |
| { |
| { |
| if (this.m_skillLevel == Skills.SkillType.None) |
| if (this.m_skillLevel == Skills.SkillType.None) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| if (this.m_skillLevel == Skills.SkillType.All || this.m_skillLevel == skill) |
| if (this.m_skillLevel == Skills.SkillType.All || this.m_skillLevel == skill) |
| { |
| { |
| value += this.m_skillLevelModifier; |
| value += this.m_skillLevelModifier; |
| } |
| } |
| if (this.m_skillLevel2 == Skills.SkillType.All || this.m_skillLevel2 == skill) |
| if (this.m_skillLevel2 == Skills.SkillType.All || this.m_skillLevel2 == skill) |
| { |
| { |
| value += this.m_skillLevelModifier2; |
| value += this.m_skillLevelModifier2; |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifyNoise(float baseNoise, ref float noise) |
| public override void ModifyNoise(float baseNoise, ref float noise) |
| { |
| { |
| noise += baseNoise * this.m_noiseModifier; |
| noise += baseNoise * this.m_noiseModifier; |
| } |
| } |
| |
| |
| public override void ModifyStealth(float baseStealth, ref float stealth) |
| public override void ModifyStealth(float baseStealth, ref float stealth) |
| { |
| { |
| stealth += baseStealth * this.m_stealthModifier; |
| stealth += baseStealth * this.m_stealthModifier; |
| } |
| } |
| |
| |
| public override void ModifyMaxCarryWeight(float baseLimit, ref float limit) |
| public override void ModifyMaxCarryWeight(float baseLimit, ref float limit) |
| { |
| { |
| limit += this.m_addMaxCarryWeight; |
| limit += this.m_addMaxCarryWeight; |
| if (limit < 0f) |
| if (limit < 0f) |
| { |
| { |
| limit = 0f; |
| limit = 0f; |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifyAttack(Skills.SkillType skill, ref HitData hitData) |
| public override void ModifyAttack(Skills.SkillType skill, ref HitData hitData) |
| { |
| { |
| if (skill == this.m_modifyAttackSkill || this.m_modifyAttackSkill == Skills.SkillType.All) |
| if (skill == this.m_modifyAttackSkill || this.m_modifyAttackSkill == Skills.SkillType.All) |
| { |
| { |
| hitData.m_damage.Modify(this.m_damageModifier); |
| hitData.m_damage.Modify(this.m_damageModifier); |
| } |
| } |
| . | |
| hitData.m_damage.Modify(this.m_percentigeDamageModifiers); |
| } |
| } |
| |
| |
| public override void ModifyRunStaminaDrain(float baseDrain, ref float drain) |
| public override void ModifyRunStaminaDrain(float baseDrain, ref float drain) |
| { |
| { |
| drain += baseDrain * this.m_runStaminaDrainModifier; |
| drain += baseDrain * this.m_runStaminaDrainModifier; |
| } |
| } |
| |
| |
| public override void ModifyJumpStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| public override void ModifyJumpStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| { |
| { |
| staminaUse += baseStaminaUse * this.m_jumpStaminaUseModifier; |
| staminaUse += baseStaminaUse * this.m_jumpStaminaUseModifier; |
| } |
| } |
| |
| |
| . | public override void ModifySpeed(float baseSpeed, ref float speed) |
| public override void ModifyAttackStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_attackStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifyBlockStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_blockStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifyDodgeStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_dodgeStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifySwimStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_swimStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifyHomeItemStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_homeItemStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifySneakStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| |
| { |
| |
| staminaUse += baseStaminaUse * this.m_sneakStaminaUseModifier; |
| |
| } |
| |
| |
| |
| public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) |
| { |
| { |
| if (this.m_character.IsSwimming()) |
| if (this.m_character.IsSwimming()) |
| { |
| { |
| speed += baseSpeed * this.m_speedModifier * 0.5f; |
| speed += baseSpeed * this.m_speedModifier * 0.5f; |
| } |
| } |
| else |
| else |
| { |
| { |
| speed += baseSpeed * this.m_speedModifier; |
| speed += baseSpeed * this.m_speedModifier; |
| } |
| } |
| . | |
| if (this.m_windMovementModifier > 0f) |
| |
| { |
| |
| dir.Normalize(); |
| |
| float num = (Vector3.Dot(dir, EnvMan.instance.GetWindDir()) + 1f) / 2f; |
| |
| num *= EnvMan.instance.GetWindIntensity(); |
| |
| speed *= 1f + num; |
| |
| } |
| if (speed < 0f) |
| if (speed < 0f) |
| { |
| { |
| speed = 0f; |
| speed = 0f; |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifyJump(Vector3 baseJump, ref Vector3 jump) |
| public override void ModifyJump(Vector3 baseJump, ref Vector3 jump) |
| { |
| { |
| jump += new Vector3(baseJump.x * this.m_jumpModifier.x, baseJump.y * this.m_jumpModifier.y, baseJump.z * this.m_jumpModifier.z); |
| jump += new Vector3(baseJump.x * this.m_jumpModifier.x, baseJump.y * this.m_jumpModifier.y, baseJump.z * this.m_jumpModifier.z); |
| } |
| } |
| |
| |
| public override void ModifyWalkVelocity(ref Vector3 vel) |
| public override void ModifyWalkVelocity(ref Vector3 vel) |
| { |
| { |
| if (this.m_maxMaxFallSpeed > 0f && vel.y < -this.m_maxMaxFallSpeed) |
| if (this.m_maxMaxFallSpeed > 0f && vel.y < -this.m_maxMaxFallSpeed) |
| { |
| { |
| vel.y = -this.m_maxMaxFallSpeed; |
| vel.y = -this.m_maxMaxFallSpeed; |
| } |
| } |
| } |
| } |
| |
| |
| public override void ModifyFallDamage(float baseDamage, ref float damage) |
| public override void ModifyFallDamage(float baseDamage, ref float damage) |
| { |
| { |
| damage += baseDamage * this.m_fallDamageModifier; |
| damage += baseDamage * this.m_fallDamageModifier; |
| if (damage < 0f) |
| if (damage < 0f) |
| { |
| { |
| damage = 0f; |
| damage = 0f; |
| } |
| } |
| } |
| } |
| |
| |
| public override string GetTooltipString() |
| public override string GetTooltipString() |
| { |
| { |
| StringBuilder stringBuilder = new StringBuilder(256); |
| StringBuilder stringBuilder = new StringBuilder(256); |
| if (this.m_tooltip.Length > 0) |
| if (this.m_tooltip.Length > 0) |
| { |
| { |
| stringBuilder.AppendFormat("{0}\n", this.m_tooltip); |
| stringBuilder.AppendFormat("{0}\n", this.m_tooltip); |
| } |
| } |
| . | if (this.m_jumpStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_jumpstamina: <color=orange>{0}%</color>\n", (this.m_jumpStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_runStaminaDrainModifier != 0f) |
| if (this.m_runStaminaDrainModifier != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_runstamina: <color=orange>{0}%</color>\n", (this.m_runStaminaDrainModifier * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_runstamina: <color=orange>{0}%</color>\n", (this.m_runStaminaDrainModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_healthOverTime != 0f) |
| if (this.m_healthOverTime != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_health: <color=orange>{0}</color>\n", this.m_healthOverTime.ToString()); |
| stringBuilder.AppendFormat("$se_health: <color=orange>{0}</color>\n", this.m_healthOverTime.ToString()); |
| } |
| } |
| if (this.m_staminaOverTime != 0f) |
| if (this.m_staminaOverTime != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_stamina: <color=orange>{0}</color>\n", this.m_staminaOverTime.ToString()); |
| stringBuilder.AppendFormat("$se_stamina: <color=orange>{0}</color>\n", this.m_staminaOverTime.ToString()); |
| } |
| } |
| if (this.m_eitrOverTime != 0f) |
| if (this.m_eitrOverTime != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_eitr: <color=orange>{0}</color>\n", this.m_eitrOverTime.ToString()); |
| stringBuilder.AppendFormat("$se_eitr: <color=orange>{0}</color>\n", this.m_eitrOverTime.ToString()); |
| } |
| } |
| if (this.m_healthRegenMultiplier != 1f) |
| if (this.m_healthRegenMultiplier != 1f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_healthregen: <color=orange>{0}%</color>\n", ((this.m_healthRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_healthregen: <color=orange>{0}%</color>\n", ((this.m_healthRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_staminaRegenMultiplier != 1f) |
| if (this.m_staminaRegenMultiplier != 1f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_staminaregen: <color=orange>{0}%</color>\n", ((this.m_staminaRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_staminaregen: <color=orange>{0}%</color>\n", ((this.m_staminaRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_eitrRegenMultiplier != 1f) |
| if (this.m_eitrRegenMultiplier != 1f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_eitrregen: <color=orange>{0}%</color>\n", ((this.m_eitrRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_eitrregen: <color=orange>{0}%</color>\n", ((this.m_eitrRegenMultiplier - 1f) * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_addMaxCarryWeight != 0f) |
| if (this.m_addMaxCarryWeight != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_max_carryweight: <color=orange>{0}</color>\n", this.m_addMaxCarryWeight.ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_max_carryweight: <color=orange>{0}</color>\n", this.m_addMaxCarryWeight.ToString("+0;-0")); |
| } |
| } |
| if (this.m_mods.Count > 0) |
| if (this.m_mods.Count > 0) |
| { |
| { |
| stringBuilder.Append(SE_Stats.GetDamageModifiersTooltipString(this.m_mods)); |
| stringBuilder.Append(SE_Stats.GetDamageModifiersTooltipString(this.m_mods)); |
| stringBuilder.Append("\n"); |
| stringBuilder.Append("\n"); |
| } |
| } |
| if (this.m_noiseModifier != 0f) |
| if (this.m_noiseModifier != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_noisemod: <color=orange>{0}%</color>\n", (this.m_noiseModifier * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_noisemod: <color=orange>{0}%</color>\n", (this.m_noiseModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_stealthModifier != 0f) |
| if (this.m_stealthModifier != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$se_sneakmod: <color=orange>{0}%</color>\n", (this.m_stealthModifier * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$se_sneakmod: <color=orange>{0}%</color>\n", (this.m_stealthModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_speedModifier != 0f) |
| if (this.m_speedModifier != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$item_movement_modifier: <color=orange>{0}%</color>\n", (this.m_speedModifier * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$item_movement_modifier: <color=orange>{0}%</color>\n", (this.m_speedModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| if (this.m_maxMaxFallSpeed != 0f) |
| if (this.m_maxMaxFallSpeed != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$item_limitfallspeed: <color=orange>{0}m/s</color>\n", this.m_maxMaxFallSpeed.ToString("0")); |
| stringBuilder.AppendFormat("$item_limitfallspeed: <color=orange>{0}m/s</color>\n", this.m_maxMaxFallSpeed.ToString("0")); |
| } |
| } |
| if (this.m_fallDamageModifier != 0f) |
| if (this.m_fallDamageModifier != 0f) |
| { |
| { |
| stringBuilder.AppendFormat("$item_falldamage: <color=orange>{0}%</color>\n", (this.m_fallDamageModifier * 100f).ToString("+0;-0")); |
| stringBuilder.AppendFormat("$item_falldamage: <color=orange>{0}%</color>\n", (this.m_fallDamageModifier * 100f).ToString("+0;-0")); |
| } |
| } |
| . | |
| if (this.m_jumpModifier.y != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_jumpheight: <color=orange>{0}%</color>\n", (this.m_jumpModifier.y * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_jumpModifier.x != 0f || this.m_jumpModifier.z != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_jumplength: <color=orange>{0}%</color>\n", (Mathf.Max(this.m_jumpModifier.x, this.m_jumpModifier.z) * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_jumpStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_jumpstamina: <color=orange>{0}%</color>\n", (this.m_jumpStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_attackStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_attackstamina: <color=orange>{0}%</color>\n", (this.m_attackStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_blockStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_blockstamina: <color=orange>{0}%</color>\n", (this.m_blockStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_dodgeStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_dodgestamina: <color=orange>{0}%</color>\n", (this.m_dodgeStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_swimStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_swimstamina: <color=orange>{0}%</color>\n", (this.m_dodgeStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_homeItemStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$base_item_modifier: <color=orange>{0}%</color>\n", (this.m_homeItemStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_sneakStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_sneakstamina: <color=orange>{0}%</color>\n", (this.m_sneakStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_runStaminaUseModifier != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$se_runstamina: <color=orange>{0}%</color>\n", (this.m_runStaminaUseModifier * 100f).ToString("+0;-0")); |
| |
| } |
| if (this.m_skillLevel != Skills.SkillType.None) |
| if (this.m_skillLevel != Skills.SkillType.None) |
| { |
| { |
| stringBuilder.AppendFormat("{0} <color=orange>{1}</color>\n", Localization.instance.Localize("$skill_" + this.m_skillLevel.ToString().ToLower()), this.m_skillLevelModifier.ToString("+0;-0")); |
| stringBuilder.AppendFormat("{0} <color=orange>{1}</color>\n", Localization.instance.Localize("$skill_" + this.m_skillLevel.ToString().ToLower()), this.m_skillLevelModifier.ToString("+0;-0")); |
| } |
| } |
| if (this.m_skillLevel2 != Skills.SkillType.None) |
| if (this.m_skillLevel2 != Skills.SkillType.None) |
| { |
| { |
| stringBuilder.AppendFormat("{0} <color=orange>{1}</color>\n", Localization.instance.Localize("$skill_" + this.m_skillLevel2.ToString().ToLower()), this.m_skillLevelModifier2.ToString("+0;-0")); |
| stringBuilder.AppendFormat("{0} <color=orange>{1}</color>\n", Localization.instance.Localize("$skill_" + this.m_skillLevel2.ToString().ToLower()), this.m_skillLevelModifier2.ToString("+0;-0")); |
| } |
| } |
| . | |
| if (this.m_percentigeDamageModifiers.m_blunt != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_blunt: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_blunt * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_slash != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_slash: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_slash * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_pierce != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_pierce: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_pierce * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_chop != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_chop: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_chop * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_pickaxe != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_pickaxe: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_pickaxe * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_fire != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_fire: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_fire * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_frost != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_frost: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_frost * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_lightning != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_lightning: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_lightning * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_poison != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_poison: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_poison * 100f).ToString("+0;-0")); |
| |
| } |
| |
| if (this.m_percentigeDamageModifiers.m_spirit != 0f) |
| |
| { |
| |
| stringBuilder.AppendFormat("$inventory_spirit: <color=orange>{0}%</color>\n", (this.m_percentigeDamageModifiers.m_spirit * 100f).ToString("+0;-0")); |
| |
| } |
| return stringBuilder.ToString(); |
| return stringBuilder.ToString(); |
| } |
| } |
| |
| |
| public static string GetDamageModifiersTooltipString(List<HitData.DamageModPair> mods) |
| public static string GetDamageModifiersTooltipString(List<HitData.DamageModPair> mods) |
| { |
| { |
| if (mods.Count == 0) |
| if (mods.Count == 0) |
| { |
| { |
| return ""; |
| return ""; |
| } |
| } |
| string text = ""; |
| string text = ""; |
| foreach (HitData.DamageModPair damageModPair in mods) |
| foreach (HitData.DamageModPair damageModPair in mods) |
| { |
| { |
| if (damageModPair.m_modifier != HitData.DamageModifier.Ignore && damageModPair.m_modifier != HitData.DamageModifier.Normal) |
| if (damageModPair.m_modifier != HitData.DamageModifier.Ignore && damageModPair.m_modifier != HitData.DamageModifier.Normal) |
| { |
| { |
| switch (damageModPair.m_modifier) |
| switch (damageModPair.m_modifier) |
| { |
| { |
| case HitData.DamageModifier.Resistant: |
| case HitData.DamageModifier.Resistant: |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_resistant</color> VS "; |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_resistant</color> VS "; |
| break; |
| break; |
| case HitData.DamageModifier.Weak: |
| case HitData.DamageModifier.Weak: |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_weak</color> VS "; |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_weak</color> VS "; |
| break; |
| break; |
| case HitData.DamageModifier.Immune: |
| case HitData.DamageModifier.Immune: |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_immune</color> VS "; |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_immune</color> VS "; |
| break; |
| break; |
| case HitData.DamageModifier.VeryResistant: |
| case HitData.DamageModifier.VeryResistant: |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_veryresistant</color> VS "; |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_veryresistant</color> VS "; |
| break; |
| break; |
| case HitData.DamageModifier.VeryWeak: |
| case HitData.DamageModifier.VeryWeak: |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_veryweak</color> VS "; |
| text += "\n$inventory_dmgmod: <color=orange>$inventory_veryweak</color> VS "; |
| break; |
| break; |
| } |
| } |
| text += "<color=orange>"; |
| text += "<color=orange>"; |
| HitData.DamageType type = damageModPair.m_type; |
| HitData.DamageType type = damageModPair.m_type; |
| if (type <= HitData.DamageType.Fire) |
| if (type <= HitData.DamageType.Fire) |
| { |
| { |
| if (type <= HitData.DamageType.Chop) |
| if (type <= HitData.DamageType.Chop) |
| { |
| { |
| switch (type) |
| switch (type) |
| { |
| { |
| case HitData.DamageType.Blunt: |
| case HitData.DamageType.Blunt: |
| text += "$inventory_blunt"; |
| text += "$inventory_blunt"; |
| break; |
| break; |
| case HitData.DamageType.Slash: |
| case HitData.DamageType.Slash: |
| text += "$inventory_slash"; |
| text += "$inventory_slash"; |
| break; |
| break; |
| case HitData.DamageType.Blunt | HitData.DamageType.Slash: |
| case HitData.DamageType.Blunt | HitData.DamageType.Slash: |
| break; |
| break; |
| case HitData.DamageType.Pierce: |
| case HitData.DamageType.Pierce: |
| text += "$inventory_pierce"; |
| text += "$inventory_pierce"; |
| break; |
| break; |
| default: |
| default: |
| if (type == HitData.DamageType.Chop) |
| if (type == HitData.DamageType.Chop) |
| { |
| { |
| text += "$inventory_chop"; |
| text += "$inventory_chop"; |
| } |
| } |
| break; |
| break; |
| } |
| } |
| } |
| } |
| else if (type != HitData.DamageType.Pickaxe) |
| else if (type != HitData.DamageType.Pickaxe) |
| { |
| { |
| if (type == HitData.DamageType.Fire) |
| if (type == HitData.DamageType.Fire) |
| { |
| { |
| text += "$inventory_fire"; |
| text += "$inventory_fire"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| text += "$inventory_pickaxe"; |
| text += "$inventory_pickaxe"; |
| } |
| } |
| } |
| } |
| else if (type <= HitData.DamageType.Lightning) |
| else if (type <= HitData.DamageType.Lightning) |
| { |
| { |
| if (type != HitData.DamageType.Frost) |
| if (type != HitData.DamageType.Frost) |
| { |
| { |
| if (type == HitData.DamageType.Lightning) |
| if (type == HitData.DamageType.Lightning) |
| { |
| { |
| text += "$inventory_lightning"; |
| text += "$inventory_lightning"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| text += "$inventory_frost"; |
| text += "$inventory_frost"; |
| } |
| } |
| } |
| } |
| else if (type != HitData.DamageType.Poison) |
| else if (type != HitData.DamageType.Poison) |
| { |
| { |
| if (type == HitData.DamageType.Spirit) |
| if (type == HitData.DamageType.Spirit) |
| { |
| { |
| text += "$inventory_spirit"; |
| text += "$inventory_spirit"; |
| } |
| } |
| } |
| } |
| else |
| else |
| { |
| { |
| text += "$inventory_poison"; |
| text += "$inventory_poison"; |
| } |
| } |
| text += "</color>"; |
| text += "</color>"; |
| } |
| } |
| } |
| } |
| return text; |
| return text; |
| } |
| } |
| |
| |
| [Header("__SE_Stats__")] |
| [Header("__SE_Stats__")] |
| [Header("HP per tick")] |
| [Header("HP per tick")] |
| public float m_tickInterval; |
| public float m_tickInterval; |
| |
| |
| public float m_healthPerTickMinHealthPercentage; |
| public float m_healthPerTickMinHealthPercentage; |
| |
| |
| public float m_healthPerTick; |
| public float m_healthPerTick; |
| |
| |
| public HitData.HitType m_hitType; |
| public HitData.HitType m_hitType; |
| |
| |
| [Header("Health over time")] |
| [Header("Health over time")] |
| public float m_healthOverTime; |
| public float m_healthOverTime; |
| |
| |
| public float m_healthOverTimeDuration; |
| public float m_healthOverTimeDuration; |
| |
| |
| public float m_healthOverTimeInterval = 5f; |
| public float m_healthOverTimeInterval = 5f; |
| |
| |
| [Header("Stamina")] |
| [Header("Stamina")] |
| public float m_staminaOverTime; |
| public float m_staminaOverTime; |
| |
| |
| public float m_staminaOverTimeDuration; |
| public float m_staminaOverTimeDuration; |
| |
| |
| public float m_staminaDrainPerSec; |
| public float m_staminaDrainPerSec; |
| |
| |
| public float m_runStaminaDrainModifier; |
| public float m_runStaminaDrainModifier; |
| |
| |
| public float m_jumpStaminaUseModifier; |
| public float m_jumpStaminaUseModifier; |
| |
| |
| . | |
| public float m_attackStaminaUseModifier; |
| |
| |
| |
| public float m_blockStaminaUseModifier; |
| |
| |
| |
| public float m_dodgeStaminaUseModifier; |
| |
| |
| |
| public float m_swimStaminaUseModifier; |
| |
| |
| |
| public float m_homeItemStaminaUseModifier; |
| |
| |
| |
| public float m_sneakStaminaUseModifier; |
| |
| |
| |
| public float m_runStaminaUseModifier; |
| |
| |
| [Header("Eitr")] |
| [Header("Eitr")] |
| public float m_eitrOverTime; |
| public float m_eitrOverTime; |
| |
| |
| public float m_eitrOverTimeDuration; |
| public float m_eitrOverTimeDuration; |
| |
| |
| [Header("Regen modifiers")] |
| [Header("Regen modifiers")] |
| public float m_healthRegenMultiplier = 1f; |
| public float m_healthRegenMultiplier = 1f; |
| |
| |
| public float m_staminaRegenMultiplier = 1f; |
| public float m_staminaRegenMultiplier = 1f; |
| |
| |
| public float m_eitrRegenMultiplier = 1f; |
| public float m_eitrRegenMultiplier = 1f; |
| |
| |
| [Header("Modify raise skill")] |
| [Header("Modify raise skill")] |
| public Skills.SkillType m_raiseSkill; |
| public Skills.SkillType m_raiseSkill; |
| |
| |
| public float m_raiseSkillModifier; |
| public float m_raiseSkillModifier; |
| |
| |
| [Header("Modify skill level")] |
| [Header("Modify skill level")] |
| public Skills.SkillType m_skillLevel; |
| public Skills.SkillType m_skillLevel; |
| |
| |
| public float m_skillLevelModifier; |
| public float m_skillLevelModifier; |
| |
| |
| public Skills.SkillType m_skillLevel2; |
| public Skills.SkillType m_skillLevel2; |
| |
| |
| public float m_skillLevelModifier2; |
| public float m_skillLevelModifier2; |
| |
| |
| [Header("Hit modifier")] |
| [Header("Hit modifier")] |
| public List<HitData.DamageModPair> m_mods = new List<HitData.DamageModPair>(); |
| public List<HitData.DamageModPair> m_mods = new List<HitData.DamageModPair>(); |
| |
| |
| [Header("Attack")] |
| [Header("Attack")] |
| public Skills.SkillType m_modifyAttackSkill; |
| public Skills.SkillType m_modifyAttackSkill; |
| |
| |
| public float m_damageModifier = 1f; |
| public float m_damageModifier = 1f; |
| |
| |
| . | |
| public HitData.DamageTypes m_percentigeDamageModifiers; |
| |
| |
| [Header("Sneak")] |
| [Header("Sneak")] |
| public float m_noiseModifier; |
| public float m_noiseModifier; |
| |
| |
| public float m_stealthModifier; |
| public float m_stealthModifier; |
| |
| |
| [Header("Carry weight")] |
| [Header("Carry weight")] |
| public float m_addMaxCarryWeight; |
| public float m_addMaxCarryWeight; |
| |
| |
| [Header("Speed")] |
| [Header("Speed")] |
| public float m_speedModifier; |
| public float m_speedModifier; |
| |
| |
| public Vector3 m_jumpModifier; |
| public Vector3 m_jumpModifier; |
| |
| |
| [Header("Fall")] |
| [Header("Fall")] |
| public float m_maxMaxFallSpeed; |
| public float m_maxMaxFallSpeed; |
| |
| |
| public float m_fallDamageModifier; |
| public float m_fallDamageModifier; |
| . | |
| |
| |
| [Header("Wind")] |
| |
| public float m_windMovementModifier; |
| |
| |
| private float m_tickTimer; |
| private float m_tickTimer; |
| |
| |
| private float m_healthOverTimeTimer; |
| private float m_healthOverTimeTimer; |
| |
| |
| private float m_healthOverTimeTicks; |
| private float m_healthOverTimeTicks; |
| |
| |
| private float m_healthOverTimeTickHP; |
| private float m_healthOverTimeTickHP; |
| } |
| } |
| |
| |