public void Effect(Forms.BasePanel panel, HsActionCallback success, HsActionCallback fail) { if (type == "item") { UserProfile.InfoBag.AddItem(infos[0], 1); HItemConfig itemConfig = ConfigData.GetHItemConfig(infos[0]); panel.AddFlowCenter(string.Format("获得{0}x1", itemConfig.Name), HSTypes.I2RareColor(itemConfig.Rare)); } else if (type == "mon") { PeopleBook.Fight(infos[0], "oneline", mlevel + infos[1], new PeopleFightParm(), success, fail, null); return; } else if (type == "gold") { UserProfile.InfoBag.AddResource(GameResourceType.Gold, (uint)infos[0]); panel.AddFlowCenter(string.Format("获得黄金x{0}", infos[0]), HSTypes.I2ResourceColor(0)); } else if (type == "resource") { UserProfile.InfoBag.AddResource((GameResourceType)(infos[0] - 1), 1); panel.AddFlowCenter(string.Format("获得{1}x{0}", 1, HSTypes.I2Resource(infos[0] - 1)), HSTypes.I2ResourceColor(infos[0] - 1)); } string word = MazeItemConfig.Word; if (word != "") { panel.AddFlowCenter(word, "White"); } success(); }
private void Fight() { if (realTar == -1) { return; } PeopleConfig peopleConfig = ConfigData.GetPeopleConfig(people[realTar].Pid); if (peopleConfig.Emethod == "") { ControlPlus.MessageBoxEx.Show("目前版本暂不开放!"); return; } var parm = new PeopleFightParm(); parm.Reason = PeopleFightReason.PeopleView; PeopleBook.Fight(peopleConfig.Id, peopleConfig.BattleMap, peopleConfig.Level, parm, null, null, null); }
public void CheckMatch(int mid, bool autoGiveup) { TournamentConfig tournamentConfig = ConfigData.GetTournamentConfig(Id); TournamentMatchConfig match = ConfigData.GetTournamentMatchConfig(mid); int left; int right; if (match.LeftType == 1) { left = Pids[match.LeftValue]; } else { left = Results[match.LeftValue].Winner; } if (match.RightType == 1) { right = Pids[match.RightValue]; } else { right = Results[match.RightValue].Winner; } currentMid = mid; currentAutoGiveUp = autoGiveup; currentRvId = left == -1 ? right : left; Results[mid] = new MatchResult(); if (left != -1 && right != -1) { FastBattle.Instance.StartGame(left, right, tournamentConfig.Map, -1); Results[mid].Winner = FastBattle.Instance.LeftWin ? left : right; Results[mid].Loser = FastBattle.Instance.LeftWin ? right : left; } else { PeopleBook.Fight(currentRvId, tournamentConfig.Map, 1, new PeopleFightParm(), OnWin, OnLose, null); } }
public TalkEventItemFight(int evtId, int level, Rectangle r, SceneQuestEvent e) : base(evtId, level, r, e) { int enemyId = config.EnemyId; HsActionCallback winCallback = OnWin; HsActionCallback failCallback = OnFail; var parm = new PeopleFightParm(); parm.Reason = PeopleFightReason.SceneQuest; if (evt.ParamList.Count > 1) { parm.RuleAddon = (PeopleFightRuleAddon)Enum.Parse(typeof(PeopleFightRuleAddon), evt.ParamList[0]); parm.RuleLevel = int.Parse(evt.ParamList[1]); } if (enemyId == 1)//特殊处理标记 { enemyId = UserProfile.InfoRecord.GetRecordById((int)MemPlayerRecordTypes.SceneQuestRandPeopleId); } int fightLevel = Math.Max(1, level + BlessManager.FightLevelChange); PeopleBook.Fight(enemyId, config.BattleMap, fightLevel, parm, winCallback, failCallback, failCallback); }