private void UpdateAp() { this.apEndTick = true; for (Int32 i = 0; i < 4; i++) { if (this.isNeedAp[i]) { BattleEndValue battleEndValue = this.apValue[i]; if (battleEndValue.current < battleEndValue.value) { this.apEndTick = false; UInt32 ap = (UInt32)((battleEndValue.current + battleEndValue.step > battleEndValue.value) ? (battleEndValue.value - battleEndValue.current) : battleEndValue.step); this.AddAp(i, ap); } } } }
private void UpdateExp() { this.expEndTick = true; for (Int32 i = 0; i < 4; i++) { PLAYER player = FF9StateSystem.Common.FF9.party.member[i]; BattleEndValue battleEndValue = this.expValue[i]; if (this.isNeedExp[i]) { if (player != null) { UInt32 num = (UInt32)((battleEndValue.current + battleEndValue.step > battleEndValue.value) ? (battleEndValue.value - battleEndValue.current) : battleEndValue.step); if (battleEndValue.current < battleEndValue.value) { this.expEndTick = false; if (num != 0u) { if (9999999u > player.exp) { battleEndValue.current += num; player.exp += num; if (9999999u <= player.exp) { player.exp = 9999999u; } if (99 > player.level) { for (UInt32 exp = ff9level.CharacterLevelUps[player.level].ExperienceToLevel; exp <= player.exp; exp = ff9level.CharacterLevelUps[player.level].ExperienceToLevel) { this.DisplayLevelup(i); if (player.level >= 99) { break; } } } } } } } } } }
public override Boolean OnKeyConfirm(GameObject go) { if (base.OnKeyConfirm(go)) { switch (this.currentState) { case BattleResultUI.ResultState.Start: FF9Sfx.FF9SFX_PlayLoop(105); this.currentState = BattleResultUI.ResultState.EXPAndAPTick; break; case BattleResultUI.ResultState.EXPAndAPTick: { FF9Sfx.FF9SFX_StopLoop(105); this.currentState = BattleResultUI.ResultState.EndEXPAndAP; BattleEndValue[] array = this.expValue; for (Int32 i = 0; i < (Int32)array.Length; i++) { BattleEndValue battleEndValue = array[i]; battleEndValue.step = battleEndValue.value; } this.UpdateExp(); BattleEndValue[] array2 = this.apValue; for (Int32 j = 0; j < (Int32)array2.Length; j++) { BattleEndValue battleEndValue2 = array2[j]; battleEndValue2.step = battleEndValue2.value; } this.UpdateAp(); this.DisplayEXPAndAPInfo(); this.ApplyTweenAndFade(); break; } case BattleResultUI.ResultState.EndEXPAndAP: this.ApplyTweenAndFade(); break; case BattleResultUI.ResultState.StartGilAndItem: if (!this.UpdateItem()) { this.ItemOverflowPanelTween.TweenIn((Action)null); this.currentState = BattleResultUI.ResultState.ItemFullDialog; } else if (this.gilValue.value == 0u) { this.currentState = BattleResultUI.ResultState.End; } else { FF9Sfx.FF9SFX_PlayLoop(109); this.currentState = BattleResultUI.ResultState.GilTick; } break; case BattleResultUI.ResultState.ItemFullDialog: this.ItemOverflowPanelTween.TweenOut(delegate { if (this.gilValue.value == 0u) { this.currentState = BattleResultUI.ResultState.End; } else { FF9Sfx.FF9SFX_PlayLoop(109); this.currentState = BattleResultUI.ResultState.GilTick; } }); break; case BattleResultUI.ResultState.GilTick: this.currentState = BattleResultUI.ResultState.End; this.gilValue.step = this.gilValue.value; FF9Sfx.FF9SFX_StopLoop(109); this.UpdateGil(); this.DisplayGilAndItemInfo(); break; case BattleResultUI.ResultState.End: this.currentState = BattleResultUI.ResultState.Hide; this.Hide((UIScene.SceneVoidDelegate)null); break; } } return(true); }
private void InitialInfo() { Boolean flag = false; this.AnalyzeArgument(); for (Int32 i = 0; i < 4; i++) { PLAYER player = FF9StateSystem.Common.FF9.party.member[i]; if (this.isNeedExp[i] && player != null) { BattleEndValue battleEndValue = new BattleEndValue(); battleEndValue.value = this.defaultExp; if (ff9abil.FF9Abil_GetEnableSA(player.Index, 235)) { battleEndValue.value += this.defaultExp >> 1; } if (this.defaultExp < (UInt64)EXPMinTick) { battleEndValue.step = 1u; } else if (this.defaultExp < (UInt64)(EXPMinTick * EXPDefaultAdd)) { battleEndValue.step = (UInt32)((this.defaultExp + (UInt64)EXPMinTick - 1UL) / (UInt64)EXPMinTick); } else { battleEndValue.step = (UInt32)BattleResultUI.EXPDefaultAdd; UInt32 num = this.defaultExp / battleEndValue.step; if ((UInt64)num > (UInt64)((Int64)BattleResultUI.EXPTickMax)) { battleEndValue.step = (UInt32)(((UInt64)this.defaultExp + (UInt64)((Int64)BattleResultUI.EXPTickMax) - 1UL) / (UInt64)((Int64)BattleResultUI.EXPTickMax)); } } battleEndValue.current = 0u; this.expValue[i] = battleEndValue; } if (this.isNeedAp[i] && player != null) { BattleEndValue battleEndValue2 = new BattleEndValue(); if (ff9abil.FF9Abil_GetEnableSA(player.Index, 236)) { battleEndValue2.value = this.defaultAp << 1; } else { battleEndValue2.value = this.defaultAp; } battleEndValue2.step = 1u; battleEndValue2.current = 0u; this.apValue[i] = battleEndValue2; } if (player != null && ff9abil.FF9Abil_GetEnableSA(player.Index, 237)) { flag = true; } } this.gilValue.value = (UInt32)this.defaultGil; if (flag) { this.gilValue.value += this.gilValue.value >> 1; } if ((UInt64)this.gilValue.value < (UInt64)((Int64)BattleResultUI.GilCountTick)) { this.gilValue.step = 1u; } else if ((UInt64)this.gilValue.value < (UInt64)((Int64)(BattleResultUI.GilCountTick * BattleResultUI.GilDefaultAdd))) { this.gilValue.step = (UInt32)(((UInt64)this.gilValue.value + (UInt64)((Int64)BattleResultUI.GilCountTick) - 1UL) / (UInt64)((Int64)BattleResultUI.GilCountTick)); } else { this.gilValue.step = (UInt32)BattleResultUI.GilDefaultAdd; } this.gilValue.current = 0u; }
private void InitialNormal() { this.AllPanel.SetActive(true); for (Int32 i = 0; i < 4; i++) { this.expValue[i] = new BattleEndValue(); this.apValue[i] = new BattleEndValue(); this.isNeedAp[i] = false; this.isNeedExp[i] = false; } this.currentState = BattleResultUI.ResultState.Start; this.InitialInfo(); this.ClearUI(); this.DisplayEXPAndAPInfo(); this.DisplayCharacterInfo(); this.infoPanelTween.TweenIn(new Byte[1], (UIScene.SceneVoidDelegate)null); this.helpPanelTween.TweenIn(new Byte[1], (UIScene.SceneVoidDelegate)null); this.expLeftSideTween.TweenIn(new Byte[] { 0, 1, 2 }, (UIScene.SceneVoidDelegate)null); this.expRightSideTween.TweenIn(new Byte[] { 0, 1, 2 }, (UIScene.SceneVoidDelegate)null); this.totalLevelUp = new Int32[4]; this.finishedLevelUpAnimation = new Int32[4]; this.abilityLearned[0] = new List <Int32>(); this.abilityLearned[1] = new List <Int32>(); this.abilityLearned[2] = new List <Int32>(); this.abilityLearned[3] = new List <Int32>(); this.isReadyToShowNextAbil = new Boolean[] { true, true, true, true }; Boolean flag = true; BattleEndValue[] array = this.expValue; for (Int32 j = 0; j < (Int32)array.Length; j++) { BattleEndValue battleEndValue = array[j]; if (battleEndValue.value != 0u) { flag = false; break; } } BattleEndValue[] array2 = this.apValue; for (Int32 k = 0; k < (Int32)array2.Length; k++) { BattleEndValue battleEndValue2 = array2[k]; if (battleEndValue2.value != 0u) { flag = false; break; } } if (!flag) { this.currentState = BattleResultUI.ResultState.Start; } else { this.currentState = BattleResultUI.ResultState.EndEXPAndAP; } }