public CombatCenter(EmbattleRole role, CombatGeneral general, EmbattleRole targerRole, TargetHandle targetHandle) { _role = role; _attrGeneral = general; _targerRole = targerRole; _targerHandle = targetHandle; _processLog = new CombatProcess(); }
public CombatBaseAttack(CombatGeneral general) { General = general; ProcessLog = new CombatProcess(); ProcessLog.GeneralID = general.GeneralID; ProcessLog.Position = general.Position.ToShort(); ProcessLog.LiveNum = general.LifeNum; ProcessLog.Momentum = general.Momentum; ProcessLog.AttStatus = general.BattleStatus; }
/// <summary> /// 判断是否有持续伤害[未完成] /// 判断是普通还是技能功能 /// 计算功击伤害 /// 触发主动属性几率(爆击、必杀) /// 触发被动属性几率(闪避、格挡) /// 计算双方气势 /// </summary> /// <returns>False:结束战斗</returns> public bool HasDoing() { //1.判断攻击方式 CombatBaseAttack baseAttack = CombatBaseAttack.CheckAttack(_attrGeneral); //2.取攻击目标和取攻击单位 if (baseAttack.BeforeAttack()) { CombatGeneral[] generalList = baseAttack.GetTargetRoleUnit(_targerHandle, _role); if (generalList.Length == 0) { return false; } foreach (CombatGeneral tagetGeneral in generalList) { baseAttack.TagetGeneral = tagetGeneral; baseAttack.Attack(); IGeneral replaceTagetGeneral; if (tagetGeneral.IsOver && _targerHandle(_targerRole).ReplaceWaitGeneral(tagetGeneral.Position, out replaceTagetGeneral)) { ReplaceGeneralPostion(tagetGeneral.UserID, replaceTagetGeneral); baseAttack.TargetProcess.TrumpStatusList.Add(new SkillInfo() { AbilityID = (int)AbilityType.ReplaceGeneral, Num = 0 }); } } } baseAttack.AfterAttack(); IGeneral replaceGeneral; if (_attrGeneral.IsOver && _targerHandle(_role).ReplaceWaitGeneral(_attrGeneral.Position, out replaceGeneral)) { ReplaceGeneralPostion(_attrGeneral.UserID, replaceGeneral); baseAttack.ProcessLog.TrumpStatusList.Add(new SkillInfo() { AbilityID = (int)AbilityType.ReplaceGeneral, Num = 0 }); } //回档最后一轮 _processLog = baseAttack.ProcessLog; _processLog.Role = _role; return true; }