public GameTurnTableCtrl() { TurnTableData data = new TurnTableData { type = TurnTableType.Get }; this.resultGet = data; this.list = new List <TurnTableData>(); this.action = new ActionBasic(); }
private void InitUI() { List <TurnTableData> list = new List <TurnTableData>(); TurnTableData item = new TurnTableData { type = TurnTableType.ExpBig }; int exp = LocalModelManager.Instance.Exp_exp.GetBeanById(GameLogic.Self.m_EntityData.GetLevel()).Exp; int num2 = (int)GameLogic.Random((float)(exp * 0.4f), (float)(exp * 0.6f)); item.value = num2; list.Add(item); for (int i = 0; i < 2; i++) { TurnTableData data2 = new TurnTableData { type = TurnTableType.ExpSmall }; int num4 = LocalModelManager.Instance.Exp_exp.GetBeanById(GameLogic.Self.m_EntityData.GetLevel()).Exp; int num5 = (int)GameLogic.Random((float)(num4 * 0.1f), (float)(num4 * 0.3f)); data2.value = num5; list.Add(data2); } TurnTableData data3 = new TurnTableData { type = TurnTableType.HPAdd }; list.Add(data3); data3.value = 0x10c8e1; TurnTableData data4 = new TurnTableData { type = TurnTableType.PlayerSkill }; int randomSkill = GameLogic.Self.GetRandomSkill(); for (int j = 0; j < 100; j++) { if (!this.GetRerandom(randomSkill)) { break; } randomSkill = GameLogic.Self.GetRandomSkill(); } data4.value = randomSkill; list.Add(data4); TurnTableData data5 = new TurnTableData { type = TurnTableType.EventSkill, value = GameLogic.Release.Form.GetRandomID("GameTurntable") }; list.Add(data5); this.mTurnCtrl.InitGood(list); }
private void CheckResult() { EventChest1OneCtrl ctrl = this.mList[0]; int num = 0; for (int i = 1; i < 6; i++) { EventChest1OneCtrl ctrl2 = this.mList[i]; if (this.GetMinAngle(ctrl2.transform.eulerAngles.z) < this.GetMinAngle(ctrl.transform.eulerAngles.z)) { num = i; ctrl = ctrl2; } } this.resultData = ctrl.mData; object[] args = new object[] { num, this.resultData.type, (this.resultData.value != null) ? this.resultData.value.ToString() : string.Empty }; Debugger.Log(Utils.FormatString("result : {0} {1} {2}", args)); string str = string.Empty; string str2 = string.Empty; switch (this.resultData.type) { case TurnTableType.Boss: GameLogic.Release.Mode.RoomGenerate.SendEvent("Event_TurnTable_Boss", null); break; case TurnTableType.Hitted: if (GameLogic.Self != null) { float maxHP = GameLogic.Self.m_EntityData.MaxHP; int num4 = (int)(-maxHP * 0.3f); GameLogic.Self.ChangeHP(null, (long)num4); } break; } if (str != string.Empty) { CInstance <TipsManager> .Instance.Show(str, str2); } this.playCount++; this.resultData.type = TurnTableType.Get; this.mList[num].Init(this.resultData); if (this.playCount <= GameLogic.Self.m_EntityData.TurnTableCount) { this.bDelayTurnEnd = false; this.action.AddActionIgnoreWaitDelegate(0.4f, () => this.Init()); } }
public void InitGood(Drop_DropModel.DropData[] equips) { this.equips = equips; if (GameLogic.Self != null) { this.playCount = 0; this.list.Clear(); this.action.Init(true); for (int i = 0; i < 3; i++) { TurnTableData item = new TurnTableData { type = TurnTableType.Boss }; this.list.Add(item); } for (int j = 0; j < 1; j++) { TurnTableData item = new TurnTableData { type = TurnTableType.BigEquip, value = equips[1] }; this.list.Add(item); } for (int k = 0; k < 1; k++) { TurnTableData item = new TurnTableData { type = TurnTableType.SmallEquip, value = equips[0] }; this.list.Add(item); } for (int m = 0; m < 1; m++) { TurnTableData item = new TurnTableData { type = TurnTableType.Hitted }; this.list.Add(item); } this.list.RandomSort <TurnTableData>(); int num5 = 0; int count = this.list.Count; while (num5 < count) { this.mList[num5].Init(this.list[num5]); num5++; } } }
private void InitUI() { List <TurnTableData> list = new List <TurnTableData>(); string[] goldTurn = LocalModelManager.Instance.Stage_Level_stagechapter.GetBeanByChapter(GameLogic.Hold.BattleData.Level_CurrentStage).GoldTurn; int index = 0; int length = goldTurn.Length; while ((index < length) && (index < 6)) { TurnTableData item = new TurnTableData(); char[] separator = new char[] { ',' }; string[] strArray2 = goldTurn[index].Split(separator); int result = 0; int.TryParse(strArray2[0], out result); long num4 = 0L; long.TryParse(strArray2[1], out num4); if (num4 > 0L) { if (result == 1) { item.type = TurnTableType.Gold; } else { item.type = TurnTableType.Diamond; } item.value = num4; } else { item.type = TurnTableType.Empty; } item.quality = this.qualities[index]; list.Add(item); index++; } for (int i = list.Count; i < 6; i++) { TurnTableData item = new TurnTableData { type = TurnTableType.Empty }; list.Add(item); } this.mTurnCtrl.InitGood(list); }
private void InitUI() { List <TurnTableData> list = new List <TurnTableData>(); int index = 0; int length = this.qualities.Length; while (index < length) { TurnTableData item = new TurnTableData { type = this.types[index], quality = this.qualities[index] }; list.Add(item); index++; } this.mTurnCtrl.InitGood(list); }
public void Init(TurnTableData data) { this.mData = data; this.child.localScale = Vector3.one; this.Text_Value.text = string.Empty; this.Image_Icon.enabled = true; if ((data.type != TurnTableType.Get) && (this._equipone != null)) { this._equipone.gameObject.SetActive(false); } switch (data.type) { case TurnTableType.BigEquip: case TurnTableType.SmallEquip: { this.Image_Icon.enabled = false; Drop_DropModel.DropData data2 = data.value as Drop_DropModel.DropData; this.equipone.gameObject.SetActive(true); this.equipone.InitEquip(data2.id, data2.count); this.Image_Icon.set_sprite(SpriteManager.GetEquip(LocalModelManager.Instance.Equip_equip.GetBeanById(data2.id).EquipIcon)); break; } case TurnTableType.Boss: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_Monster")); break; case TurnTableType.Hitted: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_Hitted")); break; case TurnTableType.Get: { Sequence sequence = DOTween.Sequence(); TweenSettingsExtensions.SetUpdate <Sequence>(sequence, true); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1.3f, 0.18f)); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1f, 0.18f)); TweenSettingsExtensions.AppendCallback(sequence, new TweenCallback(this, this.< Init > m__0)); break; } } }
private void CheckResult() { GameTurnTableOneCtrl ctrl = this.mList[0]; int num = 0; for (int i = 1; i < 6; i++) { GameTurnTableOneCtrl ctrl2 = this.mList[i]; if (this.GetMinAngle(ctrl2.transform.eulerAngles.z) < this.GetMinAngle(ctrl.transform.eulerAngles.z)) { num = i; ctrl = ctrl2; } } this.resultData = ctrl.mData; string skillName = string.Empty; string skillContent = string.Empty; switch (this.resultData.type) { case TurnTableType.ExpBig: case TurnTableType.ExpSmall: GameLogic.Release.Mode.CreateGoods(GameLogic.Self.position, GameLogic.GetExpList((int)this.resultData.value), 2); break; case TurnTableType.PlayerSkill: { int skillid = (int)this.resultData.value; GameLogic.Self.LearnExtraSkill(skillid); skillName = GameLogic.Hold.Language.GetSkillName(skillid); skillContent = GameLogic.Hold.Language.GetSkillContent(skillid); break; } case TurnTableType.EventSkill: { int getID = LocalModelManager.Instance.Room_eventgameturn.GetBeanById((int)this.resultData.value).GetID; GameLogic.Self.AddSkill(getID, Array.Empty <object>()); skillName = GameLogic.Hold.Language.GetSkillName(getID); skillContent = GameLogic.Hold.Language.GetSkillContent(getID); break; } case TurnTableType.HPAdd: { int skillId = (int)this.resultData.value; GameLogic.Self.AddSkillAttribute(skillId, Array.Empty <object>()); skillName = GameLogic.Hold.Language.GetSkillName(skillId); skillContent = GameLogic.Hold.Language.GetSkillContent(skillId); break; } case TurnTableType.Empty: skillName = GameLogic.Hold.Language.GetLanguageByTID("GameTurn_EmptyTitle", Array.Empty <object>()); skillContent = GameLogic.Hold.Language.GetLanguageByTID("GameTurn_EmptyContent", Array.Empty <object>()); break; case TurnTableType.Gold: { long allcount = (long)this.resultData.value; skillName = GameLogic.Hold.Language.GetLanguageByTID("GameTurn_GoldTitle", Array.Empty <object>()); object[] args = new object[] { allcount }; skillContent = GameLogic.Hold.Language.GetLanguageByTID("GameTurn_GoldContent", args); if (allcount > 0L) { IMediator mediator = Facade.Instance.RetrieveMediator("BattleModuleMediator"); if (mediator != null) { object obj2 = mediator.GetEvent("Event_GetGoldPosition"); if ((obj2 == null) || !(obj2 is Vector3)) { GameLogic.Hold.BattleData.AddGold((float)allcount); break; } Vector3 endpos = (Vector3)obj2; if (< > f__am$cache0 == null) { < > f__am$cache0 = onecount => GameLogic.Hold.BattleData.AddGold((float)onecount); }
public void Init(TurnTableData data) { this.mData = data; this.child.localScale = Vector3.one; this.Text_Value.text = string.Empty; if (LocalSave.QualityColors.ContainsKey(data.quality)) { this.Text_Value.set_color(LocalSave.QualityColors[data.quality]); } switch (data.type) { case TurnTableType.ExpBig: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_ExpBig")); break; case TurnTableType.ExpSmall: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_ExpSmall")); break; case TurnTableType.PlayerSkill: { int skillIcon = LocalModelManager.Instance.Skill_skill.GetBeanById((int)data.value).SkillIcon; this.Image_Icon.set_sprite(SpriteManager.GetSkillIcon(skillIcon)); break; } case TurnTableType.EventSkill: { Room_eventgameturn beanById = LocalModelManager.Instance.Room_eventgameturn.GetBeanById((int)data.value); int skillIcon = LocalModelManager.Instance.Skill_skill.GetBeanById(beanById.GetID).SkillIcon; this.Image_Icon.set_sprite(SpriteManager.GetSkillIcon(skillIcon)); break; } case TurnTableType.HPAdd: this.Image_Icon.set_sprite(SpriteManager.GetSkillIcon((int)data.value)); break; case TurnTableType.Empty: this.Image_Icon.set_sprite(SpriteManager.GetBattle("GameTurn_Empty")); break; case TurnTableType.Gold: { this.Image_Icon.set_sprite(SpriteManager.GetUICommon("Currency_Gold")); object[] args = new object[] { data.value }; this.Text_Value.text = Utils.FormatString("x{0}", args); break; } case TurnTableType.Diamond: { this.Image_Icon.set_sprite(SpriteManager.GetUICommon("Currency_Diamond")); object[] args = new object[] { data.value }; this.Text_Value.text = Utils.FormatString("x{0}", args); break; } case TurnTableType.Get: { Sequence sequence = DOTween.Sequence(); TweenSettingsExtensions.SetUpdate <Sequence>(sequence, true); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1.3f, 0.18f)); TweenSettingsExtensions.Append(sequence, ShortcutExtensions.DOScale(this.child, 1f, 0.18f)); TweenSettingsExtensions.AppendCallback(sequence, new TweenCallback(this, this.< Init > m__0)); break; } case TurnTableType.Reward_Gold2: case TurnTableType.Reward_Gold3: case TurnTableType.Reward_Item2: case TurnTableType.Reward_Item3: case TurnTableType.Reward_All2: case TurnTableType.Reward_All3: this.Image_Icon.set_sprite(SpriteManager.GetBattle(data.type.ToString())); break; } }