public FightDataFormat(EnemyDataFormat enemy) { this.attributeOriginCache = new CommonAttributeFormat(true); this.attributesAggregateBuff = new CommonAttributeFormat(true); this.finalAttributesCache = new CommonAttributeFormat(true); this.DotManager = new BattleDotManagerFormat(); this.OneTurnFightData = new OneTurnFightDataFormat(); this.InitFight(enemy); }
public List <EnemyDataFormat> LoadMonsterBattleEnemyData() { var _battleSaveData = BattleDataManager.Instance.BattleDataCache; var _monsterBattleTableList = MonsterBattleTableReader.Instance.GenerateListByProbability(_battleSaveData.Area, _battleSaveData.Level); var _monsterTableListWithSlotID = _monsterBattleTableList.FindAll(item => { return(item.SlotID != -1); }); var _monsterTableListWithoutSlotID = _monsterBattleTableList.FindAll(item => { return(item.SlotID == -1); }); var _enemyList = new List <EnemyDataFormat> (); var _slotIDList = Enumerable.Repeat <bool> (false, _monsterBattleTableList.Count).ToList();//new bool[_monsterTableList.Count]; if (_monsterTableListWithSlotID != null && _monsterTableListWithSlotID.Count > 0) { foreach (var _monsterData in _monsterTableListWithSlotID) { int _slotID = _monsterData.SlotID; if (_slotIDList [_slotID]) { _slotID = _slotIDList.FindIndex(item => { return(item == false); }); } _slotIDList [_slotID] = true; var _enemy = new EnemyDataFormat(_slotID, MonsterTableReader.Instance.FindDefaultUnique(_monsterData.MonsterID)); _enemyList.Add(_enemy); } } if (_monsterTableListWithoutSlotID != null && _monsterTableListWithoutSlotID.Count > 0) { foreach (var _monsterData in _monsterTableListWithoutSlotID) { int _slotID = _slotIDList.ToList().FindIndex(item => { return(item == false); }); _slotIDList [_slotID] = true; var _enemy = new EnemyDataFormat(_slotID, MonsterTableReader.Instance.FindDefaultUnique(_monsterData.MonsterID)); _enemyList.Add(_enemy); } } if (_enemyList.Count == 0) { return(null); } return(_enemyList); }
public void InitFight(EnemyDataFormat enemyData) { this.EnemyDataCache = enemyData.CloneEx(); base.FightData.InitFight(this.EnemyDataCache); base.InitBodyView(this.EnemyDataCache.AnimationInfo.TexturePath, this.EnemyDataCache.AnimationInfo.IdleID, this.EnemyDataCache.AnimationInfo.AttackID, this.EnemyDataCache.AnimationInfo.GetDamageID, this.EnemyDataCache.AnimationInfo.DeadID); this.state = STATES.ALIVE; }
public void InitFight(EnemyDataFormat enemy) { this.Clear(); var _attribute = (enemy.Attributes as EnemyAttributeFormat).CloneEx(); this.SlotID = _attribute.SlotID; this.Type = CHARACTER_TYPE.ENEMY; this.attributeOriginCache = _attribute; if (enemy.AttributesAggregateBuff != null) { this.attributesAggregateBuff = enemy.AttributesAggregateBuff.CloneEx(); } }
public void InitTurn(EnemyDataFormat enemy, BATTLE_FIGHT_TYPE fightType) { this.FightType = fightType; var _skill = enemy.SkillList.CloneEx(); this.SkillList = _skill.Cast <ICommonSkill> ().ToList(); this.SkillList.ForEach(skill => skill.Reset()); var _equipt = enemy.EquipmentList.CloneEx(); this.EquipmentList = _equipt.Cast <CommonEquipmentFormat>().ToList(); this.OneTurnFightData.Clear(); this.CalculateFinalAttributes(); }
public List <EnemyDataFormat> LoadBossBattleEnemyData() { var _battleSaveData = BattleDataManager.Instance.BattleDataCache; var _bossBattleTableList = BossBattleTableReader.Instance.FindDefault(_battleSaveData.Area, _battleSaveData.Level); var _enemyList = new List <EnemyDataFormat> (); _bossBattleTableList.ForEach(enemyInfo => { EnemyDataFormat _enemy = null; EnemySaveDataFormat _savedEnemyData = null; if (_battleSaveData.BossBattleEnemyList != null && _battleSaveData.BossBattleEnemyList.Count > 0) { _savedEnemyData = _battleSaveData.BossBattleEnemyList.Find(data => { return(data.EnemyID == enemyInfo.EnemyID && data.Type == enemyInfo.Type); }); } if (enemyInfo.Type == ENEMY_TYPE.MONSTER) { _enemy = new EnemyDataFormat(enemyInfo.SlotID, MonsterTableReader.Instance.FindDefaultUnique(enemyInfo.EnemyID), _savedEnemyData); } else if (enemyInfo.Type == ENEMY_TYPE.BOSS) { _enemy = new EnemyDataFormat(enemyInfo.SlotID, BossTableReader.Instance.FindDefaultUnique(enemyInfo.EnemyID), _savedEnemyData); } _enemyList.Add(_enemy); }); if (_enemyList.Count == 0) { return(null); } return(_enemyList); }