public HaveSufferStateStore Get() { HaveSufferStateStore haveSufferStateStore = new HaveSufferStateStore(); List <HaveSufferStateStore.Data> list = new List <HaveSufferStateStore.Data>(); Array values = Enum.GetValues(typeof(SufferStateProperty.SufferType)); IEnumerator enumerator = values.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; SufferStateProperty.SufferType key = (SufferStateProperty.SufferType)obj; if (this.sufferStatePropertyDictionary.ContainsKey(key)) { list.Add(new HaveSufferStateStore.Data { key = key, values = this.sufferStatePropertyDictionary[key].Get() }); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } haveSufferStateStore.sufferStatePropertys = list.ToArray(); return(haveSufferStateStore); }
public void ApplyWarning(SufferStateProperty.SufferType sufferType, CharacterStateControl characterStateControl = null) { this.allyTitleBarSkinner.SetSkins((!characterStateControl.isEnemy) ? 0 : 1); switch (sufferType) { case SufferStateProperty.SufferType.Paralysis: this.messageLocalize.text = StringMaster.GetString("BattleNotice-10"); return; case SufferStateProperty.SufferType.Sleep: this.messageLocalize.text = StringMaster.GetString("BattleNotice-06"); return; case SufferStateProperty.SufferType.Stun: this.messageLocalize.text = StringMaster.GetString("BattleNotice-09"); return; default: if (sufferType == SufferStateProperty.SufferType.PowerCharge) { this.messageLocalize.text = StringMaster.GetString("BattleNotice-07"); return; } if (sufferType != SufferStateProperty.SufferType.Escape) { return; } return; } }
public HaveSufferState() { this.sufferStatePropertyDictionary = new Dictionary <SufferStateProperty.SufferType, SufferStateProperty>(); Array values = Enum.GetValues(typeof(SufferStateProperty.SufferType)); IEnumerator enumerator = values.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; SufferStateProperty.SufferType sufferType = (SufferStateProperty.SufferType)obj; SufferStateProperty value = new SufferStateProperty(sufferType); this.sufferStatePropertyDictionary.Add(sufferType, value); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } }
public void UpdateCount(SufferStateProperty.SufferType key, SkillStatus skillStatus = null) { List <SufferStatePropertyCounter.CountData> list = null; this.countDictionary.TryGetValue(key, out list); if (list == null || list.Count == 0) { return; } using (List <SufferStatePropertyCounter.CountData> .Enumerator enumerator = list.GetEnumerator()) { while (enumerator.MoveNext()) { SufferStatePropertyCounter.CountData countData = enumerator.Current; HaveSufferState currentSufferState = countData.characterStateControl.currentSufferState; if (currentSufferState.FindSufferState(key)) { SufferStateProperty sufferStateProperty = currentSufferState.GetSufferStateProperty(key); SufferStateProperty.Data[] array = sufferStateProperty.GetNotIsMultiHitThroughDatas(); if (!string.IsNullOrEmpty(countData.id)) { array = array.Where((SufferStateProperty.Data item) => countData.id == item.id).ToArray <SufferStateProperty.Data>(); } if (array.Length > 0) { sufferStateProperty.AddCurrentKeepCount(array, -1, skillStatus, countData.characterStateControl); } } } } }
private static bool CheckSufferHit(string effectTriggerValue, CharacterStateControl characterStateControl) { if (characterStateControl != null) { string[] array = effectTriggerValue.Split(new char[] { ',' }); List <SufferStateProperty.SufferType> list = new List <SufferStateProperty.SufferType>(); for (int i = 0; i < array.Length; i++) { SufferStateProperty.SufferType item = (SufferStateProperty.SufferType)array[i].ToInt32(); list.Add(item); } foreach (SufferStateProperty.SufferType sufferType in list) { foreach (SufferStateProperty sufferStateProperty in characterStateControl.hitSufferList) { if (sufferStateProperty.sufferTypeCache == sufferType) { return(true); } } } return(false); } return(false); }
public void Set(HaveSufferStateStore haveSufferStateStore) { Array values = Enum.GetValues(typeof(SufferStateProperty.SufferType)); IEnumerator enumerator = values.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; SufferStateProperty.SufferType key = (SufferStateProperty.SufferType)obj; HaveSufferStateStore.Data data = haveSufferStateStore.sufferStatePropertys.Where((HaveSufferStateStore.Data item) => item.key == key).SingleOrDefault <HaveSufferStateStore.Data>(); if (data != null) { if (!this.sufferStatePropertyDictionary.ContainsKey(key)) { this.sufferStatePropertyDictionary.Add(key, new SufferStateProperty(key)); } this.sufferStatePropertyDictionary[key].Set(data.values); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } }
public void TurnUpdate() { SufferStateProperty.SufferType[] array = new SufferStateProperty.SufferType[0]; foreach (SufferStateProperty.SufferType key in array) { this.sufferStatePropertyDictionary[key].AddCurrentKeepRound(-1); } }
public void RoundUpdate() { SufferStateProperty.SufferType[] array = new SufferStateProperty.SufferType[] { SufferStateProperty.SufferType.Poison, SufferStateProperty.SufferType.Confusion, SufferStateProperty.SufferType.Paralysis, SufferStateProperty.SufferType.Sleep, SufferStateProperty.SufferType.Stun, SufferStateProperty.SufferType.SkillLock, SufferStateProperty.SufferType.AttackUp, SufferStateProperty.SufferType.AttackDown, SufferStateProperty.SufferType.DefenceUp, SufferStateProperty.SufferType.DefenceDown, SufferStateProperty.SufferType.SpAttackUp, SufferStateProperty.SufferType.SpAttackDown, SufferStateProperty.SufferType.SpDefenceUp, SufferStateProperty.SufferType.SpDefenceDown, SufferStateProperty.SufferType.SpeedUp, SufferStateProperty.SufferType.SpeedDown, SufferStateProperty.SufferType.Counter, SufferStateProperty.SufferType.Reflection, SufferStateProperty.SufferType.Protect, SufferStateProperty.SufferType.PowerCharge, SufferStateProperty.SufferType.HitRateUp, SufferStateProperty.SufferType.HitRateDown, SufferStateProperty.SufferType.SatisfactionRateUp, SufferStateProperty.SufferType.SatisfactionRateDown, SufferStateProperty.SufferType.ApRevival, SufferStateProperty.SufferType.ApConsumptionUp, SufferStateProperty.SufferType.ApConsumptionDown, SufferStateProperty.SufferType.TurnBarrier, SufferStateProperty.SufferType.DamageRateUp, SufferStateProperty.SufferType.DamageRateDown, SufferStateProperty.SufferType.Regenerate, SufferStateProperty.SufferType.TurnEvasion, SufferStateProperty.SufferType.Escape, SufferStateProperty.SufferType.ChangeToleranceUp, SufferStateProperty.SufferType.ChangeToleranceDown }; foreach (SufferStateProperty.SufferType key in array) { this.sufferStatePropertyDictionary[key].AddCurrentKeepRound(-1); } SufferStateProperty sufferStateProperty = this.sufferStatePropertyDictionary[SufferStateProperty.SufferType.Escape]; if (sufferStateProperty.isActive) { sufferStateProperty.SaveAheadEscapeResult(); } }
public static List <CharacterStateControl> GetSufferCharacters(SufferStateProperty.SufferType sufferType, BattleStateData battleStateData) { List <CharacterStateControl> list = new List <CharacterStateControl>(); foreach (CharacterStateControl characterStateControl in battleStateData.GetTotalCharacters()) { if (!characterStateControl.isDied) { if (characterStateControl.currentSufferState.FindSufferState(sufferType)) { list.Add(characterStateControl); } } } return(list); }
private string SufferTypeToSpriteName(SufferStateProperty.SufferType sufferType) { if (this.iconSpriteNames.Count == 0) { this.InitIconNames(); } string result = string.Empty; if (this.iconSpriteNames.ContainsKey(sufferType)) { result = this.iconSpriteNames[sufferType]; } else { global::Debug.LogError("unknown type :" + sufferType); } return(result); }
private void CorrectionUpReset(CharacterStateControl target) { SufferStateProperty.SufferType[] array = new SufferStateProperty.SufferType[] { SufferStateProperty.SufferType.AttackUp, SufferStateProperty.SufferType.DefenceUp, SufferStateProperty.SufferType.SpAttackUp, SufferStateProperty.SufferType.SpDefenceUp, SufferStateProperty.SufferType.SpeedUp, SufferStateProperty.SufferType.HitRateUp }; foreach (SufferStateProperty.SufferType type in array) { if (target.currentSufferState.FindSufferState(type)) { target.currentSufferState.RemoveSufferState(type, false); } } }
public void AddCountDictionary(SufferStateProperty.SufferType key, CharacterStateControl value, string[] ids = null) { if (!this.countDictionary.ContainsKey(key)) { this.countDictionary.Add(key, new List <SufferStatePropertyCounter.CountData>()); } HaveSufferState currentSufferState = value.currentSufferState; if (currentSufferState.FindSufferState(key)) { SufferStateProperty sufferStateProperty = currentSufferState.GetSufferStateProperty(key); SufferStateProperty.Data[] array = sufferStateProperty.GetIsMultiHitThroughDatas(); if (ids != null) { array = array.Where((SufferStateProperty.Data item) => ids.Contains(item.id)).ToArray <SufferStateProperty.Data>(); } if (array.Length > 0) { sufferStateProperty.AddCurrentKeepCount(array, -1, null, null); } SufferStateProperty.Data[] array2 = sufferStateProperty.GetNotIsMultiHitThroughDatas(); if (ids != null) { array2 = array2.Where((SufferStateProperty.Data item) => ids.Contains(item.id)).ToArray <SufferStateProperty.Data>(); } if (array2.Length > 0) { SufferStateProperty.Data[] array3 = array2; for (int i = 0; i < array3.Length; i++) { SufferStateProperty.Data notIsMultiHitThroughData = array3[i]; if (!this.countDictionary[key].Where((SufferStatePropertyCounter.CountData item) => item.characterStateControl == value && item.id == notIsMultiHitThroughData.id).Any <SufferStatePropertyCounter.CountData>()) { SufferStatePropertyCounter.CountData countData = new SufferStatePropertyCounter.CountData(); countData.characterStateControl = value; countData.id = notIsMultiHitThroughData.id; this.countDictionary[key].Add(countData); } } } } }
private IEnumerator DownFunction() { SufferStateProperty.SufferType[] sufferTypes = new SufferStateProperty.SufferType[] { SufferStateProperty.SufferType.AttackDown, SufferStateProperty.SufferType.DefenceDown, SufferStateProperty.SufferType.SpAttackDown, SufferStateProperty.SufferType.SpDefenceDown, SufferStateProperty.SufferType.SpeedDown, SufferStateProperty.SufferType.HitRateDown, SufferStateProperty.SufferType.SatisfactionRateDown }; IEnumerator function = this.HitEffectFunction(sufferTypes, CharacterAnimationType.hit); while (function.MoveNext()) { yield return(null); } yield break; }
private List <CharacterStateControl> GetSufferCharacters(SufferStateProperty.SufferType sufferType) { List <CharacterStateControl> list = new List <CharacterStateControl>(); foreach (CharacterStateControl characterStateControl in base.battleStateData.GetTotalCharacters()) { base.stateManager.threeDAction.ShowAliveCharactersAction(new CharacterStateControl[] { characterStateControl }); base.stateManager.threeDAction.PlayIdleAnimationUndeadCharactersAction(new CharacterStateControl[] { characterStateControl }); if (!characterStateControl.isDied) { if (characterStateControl.currentSufferState.FindSufferState(sufferType)) { list.Add(characterStateControl); } } } return(list); }
private static int CompareGenreationStartTimingBase(CharacterStateControl x, CharacterStateControl y, SufferStateProperty.SufferType sufferType) { if (x == y) { return(0); } int num = 0; SufferStateProperty sufferStateProperty = x.currentSufferState.GetSufferStateProperty(sufferType); SufferStateProperty sufferStateProperty2 = y.currentSufferState.GetSufferStateProperty(sufferType); if (sufferStateProperty.generationStartTiming < sufferStateProperty2.generationStartTiming) { num = -1; } else if (sufferStateProperty.generationStartTiming > sufferStateProperty2.generationStartTiming) { num = 1; } if (Mathf.Abs(num) == 1) { return(num); } return(RandomExtension.IntPlusMinus()); }
private static void CalculationBasePower(ref float attackCalced, ref float defenceCalced, bool isPhysics, bool isExtra, CharacterStateControl attackerCharacter, CharacterStateControl targetCharacter) { HaveSufferState currentSufferState = attackerCharacter.currentSufferState; HaveSufferState currentSufferState2 = targetCharacter.currentSufferState; float num = 0f; float num2 = 0f; float num3 = 0f; float num4 = 0f; int num5; int num6; if (isExtra) { num5 = ((!isPhysics) ? attackerCharacter.specialAttackPower : attackerCharacter.attackPower); num6 = ((!isPhysics) ? targetCharacter.specialDefencePower : targetCharacter.defencePower); } else { num5 = ((!isPhysics) ? attackerCharacter.extraSpecialAttackPower : attackerCharacter.extraAttackPower); num6 = ((!isPhysics) ? targetCharacter.extraSpecialDefencePower : targetCharacter.extraDefencePower); } float num7 = (!isPhysics) ? attackerCharacter.leaderSkillResult.specialAttackUpPercent : attackerCharacter.leaderSkillResult.attackUpPercent; float num8 = (!isPhysics) ? targetCharacter.leaderSkillResult.specialDefenceUpPercent : targetCharacter.leaderSkillResult.defenceUpPercent; float num9 = num7 * (float)num5; float num10 = num8 * (float)num6; global::Debug.Log(string.Format("onLeaderAttackUp {0} | onLeaderDefenceUp {1}", num9, num10)); SufferStateProperty.SufferType sufferType = SufferStateProperty.SufferType.AttackUp; SufferStateProperty.SufferType sufferType2 = SufferStateProperty.SufferType.AttackDown; SufferStateProperty.SufferType sufferType3 = SufferStateProperty.SufferType.DefenceUp; SufferStateProperty.SufferType sufferType4 = SufferStateProperty.SufferType.DefenceDown; if (!isPhysics) { sufferType = SufferStateProperty.SufferType.SpAttackUp; sufferType2 = SufferStateProperty.SufferType.SpAttackDown; sufferType3 = SufferStateProperty.SufferType.SpDefenceUp; sufferType4 = SufferStateProperty.SufferType.SpDefenceDown; } SufferStateProperty sufferStateProperty = currentSufferState.GetSufferStateProperty(sufferType); if (sufferStateProperty.isActive) { num = sufferStateProperty.upPercent * (float)num5; } SufferStateProperty sufferStateProperty2 = currentSufferState.GetSufferStateProperty(sufferType2); if (sufferStateProperty2.isActive) { num2 = sufferStateProperty2.downPercent * (float)num5; } SufferStateProperty sufferStateProperty3 = currentSufferState2.GetSufferStateProperty(sufferType3); if (sufferStateProperty3.isActive) { num3 = sufferStateProperty3.upPercent * (float)num6; } SufferStateProperty sufferStateProperty4 = currentSufferState2.GetSufferStateProperty(sufferType4); if (sufferStateProperty4.isActive) { num4 = sufferStateProperty4.downPercent * (float)num6; } attackCalced = (float)num5 + num - num2 + num9; defenceCalced = (float)num6 + num3 - num4 + num10; attackCalced = Mathf.Min(attackCalced, (float)num5 * 3f); attackCalced = Mathf.Max(attackCalced, 0f); defenceCalced = Mathf.Min(defenceCalced, (float)num6 * 3f); defenceCalced = Mathf.Max(defenceCalced, 0f); global::Debug.Log("========================================="); global::Debug.Log("onAttackUp : " + num); global::Debug.Log("onAttackDown : " + num2); global::Debug.Log("onDefenceUp : " + num3); global::Debug.Log("onDefenceDown : " + num4); global::Debug.Log(string.Format("攻撃 {0}/(上限{1}/下限{2}/基礎{3})", new object[] { attackCalced, (float)num5 * 3f, 0f, num5 })); global::Debug.Log(string.Format("防御 {0}/(上限{1}/下限{2}/基礎{3})", new object[] { defenceCalced, (float)num6 * 3f, 0f, num6 })); }
public SufferStateProperty(SufferStateProperty.SufferType typeCache) { this.sufferType = typeCache; }
public Sprite GetSufferStatusIcon(SufferStateProperty.SufferType sufferType) { switch (sufferType) { case SufferStateProperty.SufferType.Poison: if (this.auxiliaryEffectIcons[22] != null) { return(this.auxiliaryEffectIcons[22]); } break; case SufferStateProperty.SufferType.Confusion: if (this.auxiliaryEffectIcons[29] != null) { return(this.auxiliaryEffectIcons[29]); } break; case SufferStateProperty.SufferType.Paralysis: if (this.auxiliaryEffectIcons[21] != null) { return(this.auxiliaryEffectIcons[21]); } break; case SufferStateProperty.SufferType.Sleep: if (this.auxiliaryEffectIcons[24] != null) { return(this.auxiliaryEffectIcons[24]); } break; case SufferStateProperty.SufferType.Stun: if (this.auxiliaryEffectIcons[30] != null) { return(this.auxiliaryEffectIcons[30]); } break; case SufferStateProperty.SufferType.SkillLock: if (this.auxiliaryEffectIcons[25] != null) { return(this.auxiliaryEffectIcons[25]); } break; case SufferStateProperty.SufferType.AttackUp: if (this.auxiliaryEffectIcons[0] != null) { return(this.auxiliaryEffectIcons[0]); } break; case SufferStateProperty.SufferType.AttackDown: if (this.auxiliaryEffectIcons[1] != null) { return(this.auxiliaryEffectIcons[1]); } break; case SufferStateProperty.SufferType.DefenceUp: if (this.auxiliaryEffectIcons[2] != null) { return(this.auxiliaryEffectIcons[2]); } break; case SufferStateProperty.SufferType.DefenceDown: if (this.auxiliaryEffectIcons[3] != null) { return(this.auxiliaryEffectIcons[3]); } break; case SufferStateProperty.SufferType.SpAttackUp: if (this.auxiliaryEffectIcons[4] != null) { return(this.auxiliaryEffectIcons[4]); } break; case SufferStateProperty.SufferType.SpAttackDown: if (this.auxiliaryEffectIcons[5] != null) { return(this.auxiliaryEffectIcons[5]); } break; case SufferStateProperty.SufferType.SpDefenceUp: if (this.auxiliaryEffectIcons[6] != null) { return(this.auxiliaryEffectIcons[6]); } break; case SufferStateProperty.SufferType.SpDefenceDown: if (this.auxiliaryEffectIcons[7] != null) { return(this.auxiliaryEffectIcons[7]); } break; case SufferStateProperty.SufferType.SpeedUp: if (this.auxiliaryEffectIcons[8] != null) { return(this.auxiliaryEffectIcons[8]); } break; case SufferStateProperty.SufferType.SpeedDown: if (this.auxiliaryEffectIcons[9] != null) { return(this.auxiliaryEffectIcons[9]); } break; case SufferStateProperty.SufferType.HitRateUp: if (this.auxiliaryEffectIcons[26] != null) { return(this.auxiliaryEffectIcons[26]); } break; case SufferStateProperty.SufferType.HitRateDown: if (this.auxiliaryEffectIcons[27] != null) { return(this.auxiliaryEffectIcons[27]); } break; case SufferStateProperty.SufferType.SatisfactionRateUp: if (this.auxiliaryEffectIcons[9] != null) { return(this.auxiliaryEffectIcons[9]); } break; case SufferStateProperty.SufferType.SatisfactionRateDown: if (this.auxiliaryEffectIcons[31] != null) { return(this.auxiliaryEffectIcons[31]); } break; case SufferStateProperty.SufferType.Counter: if (this.auxiliaryEffectIcons[14] != null) { return(this.auxiliaryEffectIcons[14]); } break; case SufferStateProperty.SufferType.Reflection: if (this.auxiliaryEffectIcons[15] != null) { return(this.auxiliaryEffectIcons[15]); } break; case SufferStateProperty.SufferType.Protect: if (this.auxiliaryEffectIcons[16] != null) { return(this.auxiliaryEffectIcons[16]); } break; case SufferStateProperty.SufferType.PowerCharge: if (this.auxiliaryEffectIcons[19] != null) { return(this.auxiliaryEffectIcons[19]); } break; } return(null); }
public bool FindSufferState(SufferStateProperty.SufferType type) { return(this.sufferStatePropertyDictionary[type].isActive); }
public SufferStateProperty GetSufferStateProperty(SufferStateProperty.SufferType sufferType) { return(this.sufferStatePropertyDictionary[sufferType]); }
public static CharacterStateControl[] SortedSufferStateGenerateStartTiming(CharacterStateControl[] characterStatus, SufferStateProperty.SufferType sufferType) { CharacterStateControl[] array = characterStatus.Clone() as CharacterStateControl[]; Comparison <CharacterStateControl> comparison = (CharacterStateControl x, CharacterStateControl y) => CharacterStateControlSorter.CompareGenreationStartTimingBase(x, y, sufferType); Array.Sort <CharacterStateControl>(array, comparison); return(array); }
public SufferStateProperty(AffectEffectProperty affectProperty, int lastGenerationStartTiming = 0) { SufferStateProperty.Data data = new SufferStateProperty.Data(affectProperty, lastGenerationStartTiming); this.sufferType = data.sufferType; this.AddSufferStateProperty(data); }
public Data(AffectEffectProperty affectProperty, int lastGenerationStartTiming = 0) { if (affectProperty.sufferSetType == SufferStateProperty.SetType.Override) { this.id = "Override"; } else { this.id = SufferStateProperty.Data.CreateId(affectProperty.skillId, affectProperty.subSkillId); } this.isActive = true; this.generationStartTiming = lastGenerationStartTiming; this.removeOptionType = affectProperty.removeOptionType; switch (affectProperty.type) { case AffectEffect.AttackUp: this.sufferType = SufferStateProperty.SufferType.AttackUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.AttackDown: this.sufferType = SufferStateProperty.SufferType.AttackDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.DefenceUp: this.sufferType = SufferStateProperty.SufferType.DefenceUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.DefenceDown: this.sufferType = SufferStateProperty.SufferType.DefenceDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpAttackUp: this.sufferType = SufferStateProperty.SufferType.SpAttackUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpAttackDown: this.sufferType = SufferStateProperty.SufferType.SpAttackDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpDefenceUp: this.sufferType = SufferStateProperty.SufferType.SpDefenceUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpDefenceDown: this.sufferType = SufferStateProperty.SufferType.SpDefenceDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpeedUp: this.sufferType = SufferStateProperty.SufferType.SpeedUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SpeedDown: this.sufferType = SufferStateProperty.SufferType.SpeedDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.Counter: this.sufferType = SufferStateProperty.SufferType.Counter; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.damagePercent = affectProperty.damagePercent; this.recieveDamageRate = affectProperty.recieveDamageRate; break; case AffectEffect.Reflection: this.sufferType = SufferStateProperty.SufferType.Reflection; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.damagePercent = affectProperty.damagePercent; this.recieveDamageRate = affectProperty.recieveDamageRate; break; case AffectEffect.Protect: this.sufferType = SufferStateProperty.SufferType.Protect; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; break; case AffectEffect.PowerCharge: this.sufferType = SufferStateProperty.SufferType.PowerCharge; this.keepRoundNumber = affectProperty.chargeRoundNumber; this.currentKeepRound = affectProperty.chargeRoundNumber; this.physicUpPercent = affectProperty.physicUpPercent; this.specialUpPercent = affectProperty.specialUpPercent; break; case AffectEffect.Paralysis: this.sufferType = SufferStateProperty.SufferType.Paralysis; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.incidenceRate = affectProperty.incidenceRate; break; case AffectEffect.Poison: this.sufferType = SufferStateProperty.SufferType.Poison; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.powerType = affectProperty.powerType; this.damagePower = affectProperty.damagePower; this.damagePercent = affectProperty.damagePercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; break; case AffectEffect.Sleep: this.sufferType = SufferStateProperty.SufferType.Sleep; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.incidenceRate = affectProperty.incidenceRate; this.damageGetupIncidenceRate = affectProperty.damageGetupIncidenceRate; this.selfGetupIncidenceRate = affectProperty.selfGetupIncidenceRate; break; case AffectEffect.SkillLock: this.sufferType = SufferStateProperty.SufferType.SkillLock; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; break; case AffectEffect.HitRateUp: this.sufferType = SufferStateProperty.SufferType.HitRateUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.HitRateDown: this.sufferType = SufferStateProperty.SufferType.HitRateDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.InstantDeath: this.sufferType = SufferStateProperty.SufferType.InstantDeath; this.isMiss = affectProperty.isMiss; break; case AffectEffect.Confusion: this.sufferType = SufferStateProperty.SufferType.Confusion; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.incidenceRate = affectProperty.incidenceRate; break; case AffectEffect.Stun: this.sufferType = SufferStateProperty.SufferType.Stun; this.keepRoundNumber = 1; this.currentKeepRound = 1; break; case AffectEffect.SatisfactionRateUp: this.sufferType = SufferStateProperty.SufferType.SatisfactionRateUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.SatisfactionRateDown: this.sufferType = SufferStateProperty.SufferType.SatisfactionRateDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPercent = affectProperty.downPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = affectProperty.sufferSetType; break; case AffectEffect.ApRevival: this.sufferType = SufferStateProperty.SufferType.ApRevival; this.powerType = affectProperty.powerType; this.revivalPower = affectProperty.revivalPower; this.revivalPercent = affectProperty.revivalPercent; this.currentKeepRound = 0; break; case AffectEffect.ApConsumptionUp: this.sufferType = SufferStateProperty.SufferType.ApConsumptionUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPower = affectProperty.upPower; break; case AffectEffect.ApConsumptionDown: this.sufferType = SufferStateProperty.SufferType.ApConsumptionDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.downPower = affectProperty.downPower; break; case AffectEffect.CountGuard: this.sufferType = SufferStateProperty.SufferType.CountGuard; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.damagePercent = affectProperty.damagePercent; this.isMultiHitThrough = affectProperty.isMultiHitThrough; this.damageRateForPhantomStudents = affectProperty.damageRateForPhantomStudents; this.damageRateForHeatHaze = affectProperty.damageRateForHeatHaze; this.damageRateForGlacier = affectProperty.damageRateForGlacier; this.damageRateForElectromagnetic = affectProperty.damageRateForElectromagnetic; this.damageRateForEarth = affectProperty.damageRateForEarth; this.damageRateForShaftOfLight = affectProperty.damageRateForShaftOfLight; this.damageRateForAbyss = affectProperty.damageRateForAbyss; this.recieveSkillType = affectProperty.recieveSkillType; this.recieveSkillTargetSubType = affectProperty.recieveSkillTargetSubType; this.setType = affectProperty.sufferSetType; break; case AffectEffect.TurnBarrier: this.sufferType = SufferStateProperty.SufferType.TurnBarrier; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; break; case AffectEffect.CountBarrier: this.sufferType = SufferStateProperty.SufferType.CountBarrier; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.isMultiHitThrough = affectProperty.isMultiHitThrough; break; case AffectEffect.DamageRateUp: this.sufferType = SufferStateProperty.SufferType.DamageRateUp; this.keepRoundNumber = affectProperty.damageRateKeepRoundNumber; this.currentKeepRound = affectProperty.damageRateKeepRoundNumber; this.damagePercent = affectProperty.damagePercent; this.damageRateForPhantomStudents = affectProperty.damageRateForPhantomStudents; this.damageRateForHeatHaze = affectProperty.damageRateForHeatHaze; this.damageRateForGlacier = affectProperty.damageRateForGlacier; this.damageRateForElectromagnetic = affectProperty.damageRateForElectromagnetic; this.damageRateForEarth = affectProperty.damageRateForEarth; this.damageRateForShaftOfLight = affectProperty.damageRateForShaftOfLight; this.damageRateForAbyss = affectProperty.damageRateForAbyss; this.recieveSkillType = affectProperty.recieveSkillType; this.recieveSkillTargetSubType = affectProperty.recieveSkillTargetSubType; this.setType = affectProperty.sufferSetType; break; case AffectEffect.DamageRateDown: this.sufferType = SufferStateProperty.SufferType.DamageRateDown; this.keepRoundNumber = affectProperty.damageRateKeepRoundNumber; this.currentKeepRound = affectProperty.damageRateKeepRoundNumber; this.damagePercent = affectProperty.damagePercent; this.damageRateForPhantomStudents = affectProperty.damageRateForPhantomStudents; this.damageRateForHeatHaze = affectProperty.damageRateForHeatHaze; this.damageRateForGlacier = affectProperty.damageRateForGlacier; this.damageRateForElectromagnetic = affectProperty.damageRateForElectromagnetic; this.damageRateForEarth = affectProperty.damageRateForEarth; this.damageRateForShaftOfLight = affectProperty.damageRateForShaftOfLight; this.damageRateForAbyss = affectProperty.damageRateForAbyss; this.recieveSkillType = affectProperty.recieveSkillType; this.recieveSkillTargetSubType = affectProperty.recieveSkillTargetSubType; this.setType = affectProperty.sufferSetType; break; case AffectEffect.Regenerate: this.sufferType = SufferStateProperty.SufferType.Regenerate; this.powerType = affectProperty.powerType; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.revivalPower = affectProperty.revivalPower; this.revivalPercent = affectProperty.revivalPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; break; case AffectEffect.TurnEvasion: this.sufferType = SufferStateProperty.SufferType.TurnEvasion; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; break; case AffectEffect.CountEvasion: this.sufferType = SufferStateProperty.SufferType.CountEvasion; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.isMultiHitThrough = affectProperty.isMultiHitThrough; break; case AffectEffect.Escape: this.sufferType = SufferStateProperty.SufferType.Escape; this.keepRoundNumber = affectProperty.escapeRound; this.currentKeepRound = affectProperty.escapeRound; this.escapeRate = affectProperty.escapeRate; break; case AffectEffect.ChangeToleranceUp: this.sufferType = SufferStateProperty.SufferType.ChangeToleranceUp; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = SufferStateProperty.SetType.Add; this.toleranceValue = affectProperty.toleranceValue; this.doRoundUpdate = (affectProperty.toleranceCountType <= 0); break; case AffectEffect.ChangeToleranceDown: this.sufferType = SufferStateProperty.SufferType.ChangeToleranceDown; this.keepRoundNumber = affectProperty.keepRoundNumber; this.currentKeepRound = affectProperty.keepRoundNumber; this.upPercent = affectProperty.upPercent; this.turnRate = affectProperty.turnRate; this.maxValue = affectProperty.maxValue; this.setType = SufferStateProperty.SetType.Add; this.toleranceValue = affectProperty.toleranceValue; this.doRoundUpdate = (affectProperty.toleranceCountType <= 0); break; } }
private static List <ExtraEffectStatus> GetTotalExtraEffectStatusList(List <ExtraEffectStatus> extraEffectStatusList, string[] monsterIntegrationIds, string groupId, Tolerance tolerance, string tribe, GrowStep growStep, AffectEffectProperty skillPropety, HaveSufferState currentSufferState, ExtraEffectStatus.ExtraTargetType targetType, EffectStatusBase.ExtraEffectType effectType) { List <ExtraEffectStatus> list = new List <ExtraEffectStatus>(); if (skillPropety != null) { bool flag = skillPropety.skillId.ToString() == BattleStateManager.PublicAttackSkillId; List <ExtraEffectStatus> list2 = new List <ExtraEffectStatus>(); foreach (ExtraEffectStatus extraEffectStatus in extraEffectStatusList) { if (extraEffectStatus.TargetValue2 == "0") { list2.Add(extraEffectStatus); } else if (extraEffectStatus.TargetValue2 == "1") { if (flag) { list2.Add(extraEffectStatus); } } else if (extraEffectStatus.TargetValue2 == "2" && !flag) { list2.Add(extraEffectStatus); } } ConstValue.ResistanceType skillResistanceType = EffectStatusBase.GetSkillResistanceType(skillPropety); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, 0, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, (int)skillResistanceType, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillId, 0, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillId, skillPropety.skillId, effectType)); } list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, 0, effectType)); List <ConstValue.ResistanceType> attributeStrengthList = tolerance.GetAttributeStrengthList(); foreach (ConstValue.ResistanceType targetValue in attributeStrengthList) { list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, (int)targetValue, effectType)); } list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, 0, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, tribe.ToInt32(), effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, 0, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, groupId.ToInt32(), effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, 0, effectType)); list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, (int)growStep, effectType)); if (currentSufferState != null) { list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, 0, effectType)); IEnumerator enumerator3 = Enum.GetValues(typeof(SufferStateProperty.SufferType)).GetEnumerator(); try { while (enumerator3.MoveNext()) { object obj = enumerator3.Current; SufferStateProperty.SufferType sufferType = (SufferStateProperty.SufferType)obj; if (sufferType != SufferStateProperty.SufferType.Null) { if (currentSufferState.FindSufferState(sufferType)) { list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, (int)sufferType, effectType)); } } } } finally { IDisposable disposable; if ((disposable = (enumerator3 as IDisposable)) != null) { disposable.Dispose(); } } } list.AddRange(ExtraEffectStatus.GetMonsterIntegrationGroupList(extraEffectStatusList, monsterIntegrationIds, targetType, effectType)); return(list); }
public void RemoveSufferState(SufferStateProperty.SufferType type, bool isRevival = false) { this.sufferStatePropertyDictionary[type].SetNull(isRevival); }
private static List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> GetTotalChipEffectStatusList(GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects, bool isEnemy, string[] monsterIntegrationIds, string groupId, Tolerance tolerance, string tribe, GrowStep growStep, AffectEffectProperty skillPropety, HaveSufferState currentSufferState, ChipEffectStatus.TargetType targetType, EffectStatusBase.ExtraEffectType effectType) { List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>(); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Non, 0, isEnemy, effectType)); if (skillPropety != null) { bool flag = skillPropety.skillId.ToString() == BattleStateManager.PublicAttackSkillId; List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list2 = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>(); foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffects) { if (chipEffect.targetValue2 == "0") { list2.Add(chipEffect); } else if (chipEffect.targetValue2 == "1") { if (flag) { list2.Add(chipEffect); } } else if (chipEffect.targetValue2 == "2" && !flag) { list2.Add(chipEffect); } } ConstValue.ResistanceType skillResistanceType = EffectStatusBase.GetSkillResistanceType(skillPropety); list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, 0, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, (int)skillResistanceType, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillId, 0, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillId, skillPropety.skillId, isEnemy, effectType)); } list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, 0, isEnemy, effectType)); List <ConstValue.ResistanceType> attributeStrengthList = tolerance.GetAttributeStrengthList(); foreach (ConstValue.ResistanceType targetValue in attributeStrengthList) { list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, (int)targetValue, isEnemy, effectType)); } list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, 0, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, tribe.ToInt32(), isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, 0, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, groupId.ToInt32(), isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, 0, isEnemy, effectType)); list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, (int)growStep, isEnemy, effectType)); if (currentSufferState != null) { list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, 0, isEnemy, effectType)); IEnumerator enumerator2 = Enum.GetValues(typeof(SufferStateProperty.SufferType)).GetEnumerator(); try { while (enumerator2.MoveNext()) { object obj = enumerator2.Current; SufferStateProperty.SufferType sufferType = (SufferStateProperty.SufferType)obj; if (sufferType != SufferStateProperty.SufferType.Null) { if (currentSufferState.FindSufferState(sufferType)) { list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, (int)sufferType, isEnemy, effectType)); } } } } finally { IDisposable disposable; if ((disposable = (enumerator2 as IDisposable)) != null) { disposable.Dispose(); } } } list.AddRange(ChipEffectStatus.GetMonsterIntegrationGroupList(chipEffects, isEnemy, monsterIntegrationIds, targetType, effectType)); return(list); }