| using System; |
| using System; |
| using System.Collections.Generic; |
| using System.Collections.Generic; |
| using UnityEngine; |
| using UnityEngine; |
| |
| |
| public class SEMan |
| public class SEMan |
| { |
| { |
| public SEMan(Character character, ZNetView nview) |
| public SEMan(Character character, ZNetView nview) |
| { |
| { |
| this.m_character = character; |
| this.m_character = character; |
| this.m_nview = nview; |
| this.m_nview = nview; |
| this.m_nview.Register<int, bool, int, float>("RPC_AddStatusEffect", new RoutedMethod<int, bool, int, float>.Method(this.RPC_AddStatusEffect)); |
| this.m_nview.Register<int, bool, int, float>("RPC_AddStatusEffect", new RoutedMethod<int, bool, int, float>.Method(this.RPC_AddStatusEffect)); |
| } |
| } |
| |
| |
| public void OnDestroy() |
| public void OnDestroy() |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.OnDestroy(); |
| statusEffect.OnDestroy(); |
| } |
| } |
| this.m_statusEffects.Clear(); |
| this.m_statusEffects.Clear(); |
| this.m_statusEffectsHashSet.Clear(); |
| this.m_statusEffectsHashSet.Clear(); |
| } |
| } |
| |
| |
| . | public void ApplyStatusEffectSpeedMods(ref float speed) |
| public void ApplyStatusEffectSpeedMods(ref float speed, Vector3 dir) |
| { |
| { |
| float num = speed; |
| float num = speed; |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| . | statusEffect.ModifySpeed(num, ref speed); |
| statusEffect.ModifySpeed(num, ref speed, this.m_character, dir); |
| } |
| } |
| } |
| } |
| |
| |
| public void ApplyStatusEffectJumpMods(ref Vector3 jump) |
| public void ApplyStatusEffectJumpMods(ref Vector3 jump) |
| { |
| { |
| Vector3 vector = jump; |
| Vector3 vector = jump; |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyJump(vector, ref jump); |
| statusEffect.ModifyJump(vector, ref jump); |
| } |
| } |
| } |
| } |
| |
| |
| public void ApplyDamageMods(ref HitData.DamageModifiers mods) |
| public void ApplyDamageMods(ref HitData.DamageModifiers mods) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyDamageMods(ref mods); |
| statusEffect.ModifyDamageMods(ref mods); |
| } |
| } |
| } |
| } |
| |
| |
| public void Update(ZDO zdo, float dt) |
| public void Update(ZDO zdo, float dt) |
| { |
| { |
| this.m_statusEffectAttributes = 0; |
| this.m_statusEffectAttributes = 0; |
| int count = this.m_statusEffects.Count; |
| int count = this.m_statusEffects.Count; |
| for (int i = 0; i < count; i++) |
| for (int i = 0; i < count; i++) |
| { |
| { |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| statusEffect.UpdateStatusEffect(dt); |
| statusEffect.UpdateStatusEffect(dt); |
| if (statusEffect.IsDone()) |
| if (statusEffect.IsDone()) |
| { |
| { |
| this.m_removeStatusEffects.Add(statusEffect); |
| this.m_removeStatusEffects.Add(statusEffect); |
| } |
| } |
| else |
| else |
| { |
| { |
| this.m_statusEffectAttributes |= (int)statusEffect.m_attributes; |
| this.m_statusEffectAttributes |= (int)statusEffect.m_attributes; |
| } |
| } |
| } |
| } |
| if (this.m_removeStatusEffects.Count > 0) |
| if (this.m_removeStatusEffects.Count > 0) |
| { |
| { |
| foreach (StatusEffect statusEffect2 in this.m_removeStatusEffects) |
| foreach (StatusEffect statusEffect2 in this.m_removeStatusEffects) |
| { |
| { |
| statusEffect2.Stop(); |
| statusEffect2.Stop(); |
| this.m_statusEffects.Remove(statusEffect2); |
| this.m_statusEffects.Remove(statusEffect2); |
| this.m_statusEffectsHashSet.Remove(statusEffect2.NameHash()); |
| this.m_statusEffectsHashSet.Remove(statusEffect2.NameHash()); |
| } |
| } |
| this.m_removeStatusEffects.Clear(); |
| this.m_removeStatusEffects.Clear(); |
| } |
| } |
| if (this.m_statusEffectAttributes != this.m_statusEffectAttributesOld) |
| if (this.m_statusEffectAttributes != this.m_statusEffectAttributesOld) |
| { |
| { |
| zdo.Set(ZDOVars.s_seAttrib, this.m_statusEffectAttributes, false); |
| zdo.Set(ZDOVars.s_seAttrib, this.m_statusEffectAttributes, false); |
| this.m_statusEffectAttributesOld = this.m_statusEffectAttributes; |
| this.m_statusEffectAttributesOld = this.m_statusEffectAttributes; |
| } |
| } |
| } |
| } |
| |
| |
| public StatusEffect AddStatusEffect(int nameHash, bool resetTime = false, int itemLevel = 0, float skillLevel = 0f) |
| public StatusEffect AddStatusEffect(int nameHash, bool resetTime = false, int itemLevel = 0, float skillLevel = 0f) |
| { |
| { |
| if (nameHash == 0) |
| if (nameHash == 0) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| return this.Internal_AddStatusEffect(nameHash, resetTime, itemLevel, skillLevel); |
| return this.Internal_AddStatusEffect(nameHash, resetTime, itemLevel, skillLevel); |
| } |
| } |
| this.m_nview.InvokeRPC("RPC_AddStatusEffect", new object[] { nameHash, resetTime, itemLevel, skillLevel }); |
| this.m_nview.InvokeRPC("RPC_AddStatusEffect", new object[] { nameHash, resetTime, itemLevel, skillLevel }); |
| return null; |
| return null; |
| } |
| } |
| |
| |
| private void RPC_AddStatusEffect(long sender, int nameHash, bool resetTime, int itemLevel, float skillLevel) |
| private void RPC_AddStatusEffect(long sender, int nameHash, bool resetTime, int itemLevel, float skillLevel) |
| { |
| { |
| if (!this.m_nview.IsOwner()) |
| if (!this.m_nview.IsOwner()) |
| { |
| { |
| return; |
| return; |
| } |
| } |
| this.Internal_AddStatusEffect(nameHash, resetTime, itemLevel, skillLevel); |
| this.Internal_AddStatusEffect(nameHash, resetTime, itemLevel, skillLevel); |
| } |
| } |
| |
| |
| private StatusEffect Internal_AddStatusEffect(int nameHash, bool resetTime, int itemLevel, float skillLevel) |
| private StatusEffect Internal_AddStatusEffect(int nameHash, bool resetTime, int itemLevel, float skillLevel) |
| { |
| { |
| StatusEffect statusEffect = this.GetStatusEffect(nameHash); |
| StatusEffect statusEffect = this.GetStatusEffect(nameHash); |
| if (statusEffect) |
| if (statusEffect) |
| { |
| { |
| if (resetTime) |
| if (resetTime) |
| { |
| { |
| statusEffect.ResetTime(); |
| statusEffect.ResetTime(); |
| statusEffect.SetLevel(itemLevel, skillLevel); |
| statusEffect.SetLevel(itemLevel, skillLevel); |
| } |
| } |
| return null; |
| return null; |
| } |
| } |
| StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(nameHash); |
| StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(nameHash); |
| if (statusEffect2 == null) |
| if (statusEffect2 == null) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| return this.AddStatusEffect(statusEffect2, false, itemLevel, skillLevel); |
| return this.AddStatusEffect(statusEffect2, false, itemLevel, skillLevel); |
| } |
| } |
| |
| |
| public StatusEffect AddStatusEffect(StatusEffect statusEffect, bool resetTime = false, int itemLevel = 0, float skillLevel = 0f) |
| public StatusEffect AddStatusEffect(StatusEffect statusEffect, bool resetTime = false, int itemLevel = 0, float skillLevel = 0f) |
| { |
| { |
| StatusEffect statusEffect2 = this.GetStatusEffect(statusEffect.NameHash()); |
| StatusEffect statusEffect2 = this.GetStatusEffect(statusEffect.NameHash()); |
| if (statusEffect2) |
| if (statusEffect2) |
| { |
| { |
| if (resetTime) |
| if (resetTime) |
| { |
| { |
| statusEffect2.ResetTime(); |
| statusEffect2.ResetTime(); |
| statusEffect2.SetLevel(itemLevel, skillLevel); |
| statusEffect2.SetLevel(itemLevel, skillLevel); |
| } |
| } |
| return null; |
| return null; |
| } |
| } |
| if (!statusEffect.CanAdd(this.m_character)) |
| if (!statusEffect.CanAdd(this.m_character)) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| StatusEffect statusEffect3 = statusEffect.Clone(); |
| StatusEffect statusEffect3 = statusEffect.Clone(); |
| this.m_statusEffects.Add(statusEffect3); |
| this.m_statusEffects.Add(statusEffect3); |
| this.m_statusEffectsHashSet.Add(statusEffect3.NameHash()); |
| this.m_statusEffectsHashSet.Add(statusEffect3.NameHash()); |
| statusEffect3.Setup(this.m_character); |
| statusEffect3.Setup(this.m_character); |
| statusEffect3.SetLevel(itemLevel, skillLevel); |
| statusEffect3.SetLevel(itemLevel, skillLevel); |
| if (this.m_character.IsPlayer()) |
| if (this.m_character.IsPlayer()) |
| { |
| { |
| Gogan.LogEvent("Game", "StatusEffect", statusEffect.name, 0L); |
| Gogan.LogEvent("Game", "StatusEffect", statusEffect.name, 0L); |
| } |
| } |
| return statusEffect3; |
| return statusEffect3; |
| } |
| } |
| |
| |
| public bool RemoveStatusEffect(StatusEffect se, bool quiet = false) |
| public bool RemoveStatusEffect(StatusEffect se, bool quiet = false) |
| { |
| { |
| return this.RemoveStatusEffect(se.NameHash(), quiet); |
| return this.RemoveStatusEffect(se.NameHash(), quiet); |
| } |
| } |
| |
| |
| public bool RemoveStatusEffect(int nameHash, bool quiet = false) |
| public bool RemoveStatusEffect(int nameHash, bool quiet = false) |
| { |
| { |
| if (nameHash == 0) |
| if (nameHash == 0) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| for (int i = 0; i < this.m_statusEffects.Count; i++) |
| for (int i = 0; i < this.m_statusEffects.Count; i++) |
| { |
| { |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| if (statusEffect.NameHash() == nameHash) |
| if (statusEffect.NameHash() == nameHash) |
| { |
| { |
| if (quiet) |
| if (quiet) |
| { |
| { |
| statusEffect.m_stopMessage = ""; |
| statusEffect.m_stopMessage = ""; |
| } |
| } |
| statusEffect.Stop(); |
| statusEffect.Stop(); |
| this.m_statusEffects.Remove(statusEffect); |
| this.m_statusEffects.Remove(statusEffect); |
| this.m_statusEffectsHashSet.Remove(nameHash); |
| this.m_statusEffectsHashSet.Remove(nameHash); |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| public void RemoveAllStatusEffects(bool quiet = false) |
| public void RemoveAllStatusEffects(bool quiet = false) |
| { |
| { |
| for (int i = this.m_statusEffects.Count - 1; i >= 0; i--) |
| for (int i = this.m_statusEffects.Count - 1; i >= 0; i--) |
| { |
| { |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| if (quiet) |
| if (quiet) |
| { |
| { |
| statusEffect.m_stopMessage = ""; |
| statusEffect.m_stopMessage = ""; |
| } |
| } |
| statusEffect.Stop(); |
| statusEffect.Stop(); |
| this.m_statusEffects.Remove(statusEffect); |
| this.m_statusEffects.Remove(statusEffect); |
| } |
| } |
| this.m_statusEffectsHashSet.Clear(); |
| this.m_statusEffectsHashSet.Clear(); |
| } |
| } |
| |
| |
| public bool HaveStatusEffectCategory(string cat) |
| public bool HaveStatusEffectCategory(string cat) |
| { |
| { |
| if (cat.Length == 0) |
| if (cat.Length == 0) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| for (int i = 0; i < this.m_statusEffects.Count; i++) |
| for (int i = 0; i < this.m_statusEffects.Count; i++) |
| { |
| { |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| StatusEffect statusEffect = this.m_statusEffects[i]; |
| if (statusEffect.m_category.Length > 0 && statusEffect.m_category == cat) |
| if (statusEffect.m_category.Length > 0 && statusEffect.m_category == cat) |
| { |
| { |
| return true; |
| return true; |
| } |
| } |
| } |
| } |
| return false; |
| return false; |
| } |
| } |
| |
| |
| public bool HaveStatusAttribute(StatusEffect.StatusAttribute value) |
| public bool HaveStatusAttribute(StatusEffect.StatusAttribute value) |
| { |
| { |
| if (!this.m_nview.IsValid()) |
| if (!this.m_nview.IsValid()) |
| { |
| { |
| return false; |
| return false; |
| } |
| } |
| if (this.m_nview.IsOwner()) |
| if (this.m_nview.IsOwner()) |
| { |
| { |
| return (this.m_statusEffectAttributes & (int)value) != 0; |
| return (this.m_statusEffectAttributes & (int)value) != 0; |
| } |
| } |
| return (this.m_nview.GetZDO().GetInt(ZDOVars.s_seAttrib, 0) & (int)value) != 0; |
| return (this.m_nview.GetZDO().GetInt(ZDOVars.s_seAttrib, 0) & (int)value) != 0; |
| } |
| } |
| |
| |
| . | public bool HaveStatusEffect(string name) |
| |
| { |
| |
| using (List<StatusEffect>.Enumerator enumerator = this.m_statusEffects.GetEnumerator()) |
| |
| { |
| |
| while (enumerator.MoveNext()) |
| |
| { |
| |
| if (enumerator.Current.name == name) |
| |
| { |
| |
| return true; |
| |
| } |
| |
| } |
| |
| } |
| |
| return false; |
| |
| } |
| |
| |
| |
| public bool HaveStatusEffect(int nameHash) |
| public bool HaveStatusEffect(int nameHash) |
| { |
| { |
| return this.m_statusEffectsHashSet.Contains(nameHash); |
| return this.m_statusEffectsHashSet.Contains(nameHash); |
| } |
| } |
| |
| |
| public List<StatusEffect> GetStatusEffects() |
| public List<StatusEffect> GetStatusEffects() |
| { |
| { |
| return this.m_statusEffects; |
| return this.m_statusEffects; |
| } |
| } |
| |
| |
| public StatusEffect GetStatusEffect(int nameHash) |
| public StatusEffect GetStatusEffect(int nameHash) |
| { |
| { |
| if (nameHash == 0) |
| if (nameHash == 0) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| if (!this.m_statusEffectsHashSet.Contains(nameHash)) |
| if (!this.m_statusEffectsHashSet.Contains(nameHash)) |
| { |
| { |
| return null; |
| return null; |
| } |
| } |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| if (statusEffect.NameHash() == nameHash) |
| if (statusEffect.NameHash() == nameHash) |
| { |
| { |
| return statusEffect; |
| return statusEffect; |
| } |
| } |
| } |
| } |
| return null; |
| return null; |
| } |
| } |
| |
| |
| public void GetHUDStatusEffects(List<StatusEffect> effects) |
| public void GetHUDStatusEffects(List<StatusEffect> effects) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| if (statusEffect.m_icon) |
| if (statusEffect.m_icon) |
| { |
| { |
| effects.Add(statusEffect); |
| effects.Add(statusEffect); |
| } |
| } |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyFallDamage(float baseDamage, ref float damage) |
| public void ModifyFallDamage(float baseDamage, ref float damage) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyFallDamage(baseDamage, ref damage); |
| statusEffect.ModifyFallDamage(baseDamage, ref damage); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyWalkVelocity(ref Vector3 vel) |
| public void ModifyWalkVelocity(ref Vector3 vel) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyWalkVelocity(ref vel); |
| statusEffect.ModifyWalkVelocity(ref vel); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyNoise(float baseNoise, ref float noise) |
| public void ModifyNoise(float baseNoise, ref float noise) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyNoise(baseNoise, ref noise); |
| statusEffect.ModifyNoise(baseNoise, ref noise); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifySkillLevel(Skills.SkillType skill, ref float level) |
| public void ModifySkillLevel(Skills.SkillType skill, ref float level) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifySkillLevel(skill, ref level); |
| statusEffect.ModifySkillLevel(skill, ref level); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyRaiseSkill(Skills.SkillType skill, ref float multiplier) |
| public void ModifyRaiseSkill(Skills.SkillType skill, ref float multiplier) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyRaiseSkill(skill, ref multiplier); |
| statusEffect.ModifyRaiseSkill(skill, ref multiplier); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyStaminaRegen(ref float staminaMultiplier) |
| public void ModifyStaminaRegen(ref float staminaMultiplier) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyStaminaRegen(ref staminaMultiplier); |
| statusEffect.ModifyStaminaRegen(ref staminaMultiplier); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyEitrRegen(ref float eitrMultiplier) |
| public void ModifyEitrRegen(ref float eitrMultiplier) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyEitrRegen(ref eitrMultiplier); |
| statusEffect.ModifyEitrRegen(ref eitrMultiplier); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyHealthRegen(ref float regenMultiplier) |
| public void ModifyHealthRegen(ref float regenMultiplier) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyHealthRegen(ref regenMultiplier); |
| statusEffect.ModifyHealthRegen(ref regenMultiplier); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyMaxCarryWeight(float baseLimit, ref float limit) |
| public void ModifyMaxCarryWeight(float baseLimit, ref float limit) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyMaxCarryWeight(baseLimit, ref limit); |
| statusEffect.ModifyMaxCarryWeight(baseLimit, ref limit); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyStealth(float baseStealth, ref float stealth) |
| public void ModifyStealth(float baseStealth, ref float stealth) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyStealth(baseStealth, ref stealth); |
| statusEffect.ModifyStealth(baseStealth, ref stealth); |
| } |
| } |
| } |
| } |
| |
| |
| public void ModifyAttack(Skills.SkillType skill, ref HitData hitData) |
| public void ModifyAttack(Skills.SkillType skill, ref HitData hitData) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyAttack(skill, ref hitData); |
| statusEffect.ModifyAttack(skill, ref hitData); |
| } |
| } |
| } |
| } |
| |
| |
| . | public void ModifyRunStaminaDrain(float baseDrain, ref float drain) |
| public void ModifyRunStaminaDrain(float baseDrain, ref float drain, bool minZero = true) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyRunStaminaDrain(baseDrain, ref drain); |
| statusEffect.ModifyRunStaminaDrain(baseDrain, ref drain); |
| } |
| } |
| . | if (drain < 0f) |
| if (minZero && drain < 0f) |
| { |
| { |
| drain = 0f; |
| drain = 0f; |
| } |
| } |
| } |
| } |
| |
| |
| . | public void ModifyJumpStaminaUsage(float baseStaminaUse, ref float staminaUse) |
| public void ModifyJumpStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.ModifyJumpStaminaUsage(baseStaminaUse, ref staminaUse); |
| statusEffect.ModifyJumpStaminaUsage(baseStaminaUse, ref staminaUse); |
| } |
| } |
| . | if (staminaUse < 0f) |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifyAttackStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifyAttackStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifyBlockStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifyBlockStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifyDodgeStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifyDodgeStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifySwimStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifySwimStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifyHomeItemStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifyHomeItemStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| |
| { |
| |
| staminaUse = 0f; |
| |
| } |
| |
| } |
| |
| |
| |
| public void ModifySneakStaminaUsage(float baseStaminaUse, ref float staminaUse, bool minZero = true) |
| |
| { |
| |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| |
| { |
| |
| statusEffect.ModifySneakStaminaUsage(baseStaminaUse, ref staminaUse); |
| |
| } |
| |
| if (minZero && staminaUse < 0f) |
| { |
| { |
| staminaUse = 0f; |
| staminaUse = 0f; |
| } |
| } |
| } |
| } |
| |
| |
| public void OnDamaged(HitData hit, Character attacker) |
| public void OnDamaged(HitData hit, Character attacker) |
| { |
| { |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| foreach (StatusEffect statusEffect in this.m_statusEffects) |
| { |
| { |
| statusEffect.OnDamaged(hit, attacker); |
| statusEffect.OnDamaged(hit, attacker); |
| } |
| } |
| } |
| } |
| |
| |
| private readonly HashSet<int> m_statusEffectsHashSet = new HashSet<int>(); |
| private readonly HashSet<int> m_statusEffectsHashSet = new HashSet<int>(); |
| |
| |
| private readonly List<StatusEffect> m_statusEffects = new List<StatusEffect>(); |
| private readonly List<StatusEffect> m_statusEffects = new List<StatusEffect>(); |
| |
| |
| private readonly List<StatusEffect> m_removeStatusEffects = new List<StatusEffect>(); |
| private readonly List<StatusEffect> m_removeStatusEffects = new List<StatusEffect>(); |
| |
| |
| private int m_statusEffectAttributes; |
| private int m_statusEffectAttributes; |
| |
| |
| private int m_statusEffectAttributesOld = -1; |
| private int m_statusEffectAttributesOld = -1; |
| |
| |
| private Character m_character; |
| private Character m_character; |
| |
| |
| private ZNetView m_nview; |
| private ZNetView m_nview; |
| . | |
| |
| |
| public static readonly int s_statusEffectRested = "Rested".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectEncumbered = "Encumbered".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectSoftDeath = "SoftDeath".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectWet = "Wet".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectShelter = "Shelter".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectCampFire = "CampFire".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectResting = "Resting".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectCold = "Cold".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectFreezing = "Freezing".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectBurning = "Burning".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectFrost = "Frost".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectLightning = "Lightning".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectPoison = "Poison".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectSmoked = "Smoked".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectSpirit = "Spirit".GetStableHashCode(); |
| |
| |
| |
| public static readonly int s_statusEffectTared = "Tared".GetStableHashCode(); |
| } |
| } |
| |
| |