/// <summary> /// キャラクターの死亡による離脱処理をおこないます /// </summary> /// <param name="character"> 死亡したキャラクター </param> public void deadCharacter(IBattleable character) { if (!isBattleing) { throw new InvalidOperationException("battle isn't started"); } if (character is Enemy) { this.expSum += ((Enemy)character).getGiveExp(); } removeBalFromJoinedCharacter(character); character.death(); if (isContinuingBattle()) { finishBattle(); } else { var keys = joinedManager.Keys; foreach (long id in keys) { IBattleTaskManager taskManager = joinedManager [id]; taskManager.deleteTaskFromTarget(character); } } }
/// <summary> /// 攻撃を行います /// </summary> /// <param name="bal"> 攻撃を行うIBattleableキャラクター </param> /// <param name="targets"> 攻撃の対象のリスト </param> private void attack(IBattleable bal, List <IBattleable> targets) { if (targets.Count <= 0) { throw new InvalidOperationException("invlid battleTask operation"); } foreach (IBattleable target in targets) { //対象のリアクション IBattleTaskManager targetManager = BattleManager.getInstance().getTaskManager(target.getUniqueId()); targetManager.offerReaction(bal, this); } }
/// <summary> /// 対象はバトルから離脱します /// </summary> /// <param name="bal">離脱するキャラクター</param> public void escapeCommand(IBattleable bal) { if (!isBattleing) { throw new InvalidOperationException("battle isn't started"); } removeBalFromJoinedCharacter(bal); bal.setIsBattling(false); if (isContinuingBattle()) { finishBattle(); } else { var keys = joinedManager.Keys; foreach (long id in keys) { IBattleTaskManager taskManager = joinedManager[id]; taskManager.deleteTaskFromTarget(bal); } } }