| | |
| | | |
| | | public Dictionary<int, BattleObject> allBattleObjDict = new Dictionary<int, BattleObject>(); |
| | | |
| | | public MinggeBattleObject redMingge = null; |
| | | |
| | | public MinggeBattleObject blueMingge = null; |
| | | |
| | | protected BattleField battleField; |
| | | |
| | | public void Init(BattleField _battleField, TeamBase _redTeam, TeamBase _blueTeam) |
| | |
| | | BattleObject battleObj = BattleObjectFactory.CreateBattleObject(battleField, posNodeList, teamHero, _Camp); |
| | | battleObj.SetActive(active); |
| | | allBattleObjDict.Add(battleObj.ObjID, battleObj); |
| | | campDict.Add(teamHero.positionNum, battleObj); |
| | | campDict.Add(battleObj.GetPositionNum(), battleObj); |
| | | battleObj.SetSpeedRatio(battleField.speedRatio); |
| | | } |
| | | } |
| | | |
| | | if (teamBase.teamMingge != null) |
| | | { |
| | | BattleObject minggeObj = BattleObjectFactory.CreateMinggeBattleObject(battleField, teamBase, _Camp); |
| | | allBattleObjDict.Add(minggeObj.ObjID, minggeObj); |
| | | campDict.Add(minggeObj.GetPositionNum(), minggeObj); |
| | | minggeObj.SetSpeedRatio(battleField.speedRatio); |
| | | if (_Camp == BattleCamp.Red) |
| | | { |
| | | redMingge = minggeObj as MinggeBattleObject; |
| | | } |
| | | else |
| | | { |
| | | blueMingge = minggeObj as MinggeBattleObject; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return battleObj; |
| | | } |
| | | |
| | | if (blueMingge != null && blueMingge.ObjID == objId) |
| | | { |
| | | return blueMingge; |
| | | } |
| | | |
| | | if (redMingge != null && redMingge.ObjID == objId) |
| | | { |
| | | return redMingge; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | { |
| | | if (battleObj.Camp == BattleCamp.Red) |
| | | { |
| | | redCampDict.Remove(battleObj.teamHero.positionNum); |
| | | redCampDict.Remove(battleObj.GetPositionNum()); |
| | | } |
| | | else |
| | | { |
| | | blueCampDict.Remove(battleObj.teamHero.positionNum); |
| | | blueCampDict.Remove(battleObj.GetPositionNum()); |
| | | } |
| | | allBattleObjDict.Remove((int)objID); |
| | | BattleObjectFactory.DestroyBattleObject((int)objID, battleObj); |
| | |
| | | DestroyTeam(redCampDict); |
| | | DestroyTeam(blueCampDict); |
| | | allBattleObjDict.Clear(); |
| | | redMingge = null; |
| | | blueMingge = null; |
| | | } |
| | | |
| | | public void Run() |
| | |
| | | //暂时没有召唤物 |
| | | // 放在第7格的BOSS后排的。。位置放在正中间 |
| | | // a)前排,1、2、3号为前排,前排全部阵亡后,4、5、6号即是前排也是后排 7其实也是后排 |
| | | List<BattleObject> frontList = new List<BattleObject>(from BO in returnList where BO.teamHero.positionNum < 3 && !BO.IsDead() select BO); |
| | | List<BattleObject> frontList = new List<BattleObject>(from BO in returnList where BO.GetPositionNum() < 3 && !BO.IsDead() select BO); |
| | | if (frontList.Count == 0) |
| | | { |
| | | frontList.AddRange(returnList); |
| | |
| | | returnList = frontList; |
| | | break; |
| | | case SkillTargetRangeType.Back: |
| | | List<BattleObject> backList = new List<BattleObject>(from BO in returnList where BO.teamHero.positionNum >= 3 && !BO.IsDead() select BO); |
| | | List<BattleObject> backList = new List<BattleObject>(from BO in returnList where BO.GetPositionNum() >= 3 && !BO.IsDead() select BO); |
| | | if (backList.Count == 0) |
| | | { |
| | | backList.AddRange(returnList); |
| | |
| | | loweastHpObj = returnList[i]; |
| | | continue; |
| | | } |
| | | if (returnList[i].teamHero.curHp < loweastHpObj.teamHero.curHp) |
| | | if (returnList[i].GetCurHp() < loweastHpObj.GetCurHp()) |
| | | { |
| | | loweastHpObj = returnList[i]; |
| | | } |