/// <summary> /// ステートがACTIONの時に毎フレーム行う処理 /// </summary> private void actionState() { BattleTask task = creatTask(); task.getSkill().action(user, task); delay = task.getSkill().getDelay(user); state = BattleState.IDLE; }
public void canseledTask(BattleTask task) { if (task.getSkill().getActiveSkillType() == ActiveSkillType.MOVE) { goingPos -= task.getMove(); } if (ActiveSkillSupporter.isAffectSkill(task.getSkill()) && task.getIsProssesing()) { deleteTargetingLine(player); } tasks.Remove(task); }
private void idleState() { if (tasks.Count > 0) { BattleTask runTask = tasks[0]; if (runTask.getIsSkill()) { delay = runTask.getSkill().getDelay(player); } else { float delayBonus = (float)player.getAbilityContainsBonus(BattleAbility.AGI) / 20; delayBonus = (delayBonus < 1.0f) ? delayBonus : 1.0f; delay = 2.0f - delayBonus; } maxDelay = delay; listView.deleteTask(runTask); state.resetProgress(); updateTargetLine(); runTask.activeteIsProssesing(); this.battleState = BattleState.DELAY; } }
/// <summary> /// 自分から出すターゲットラインを更新します /// </summary> private void updateTargetLine() { if (tasks.Count <= 0) { return; } BattleTask task = tasks[0]; if (task.getIsSkill()) { IActiveSkill useSkill = task.getSkill(); if (ActiveSkillSupporter.isAffectSkill(useSkill)) { List <IBattleable> targets = task.getTargets(); drawTargetingLine(player, targets, useSkill.getName(), useSkill.isFriendly()); } } else { List <IBattleable> targets = task.getTargets(); var item = task.getItem(); drawTargetingLine(player, targets, item.getName(), true); } }
/// <summary> /// ステートがACTIONの時に毎フレーム行う処理 /// </summary> private void actionState() { BattleTask runTask = tasks[0]; Debug.Log("run " + runTask.getName()); if (runTask.getIsSkill()) { IActiveSkill runSkill = runTask.getSkill(); runSkill.action(player, runTask); if (ActiveSkillSupporter.isAffectSkill(runSkill)) { Debug.Log("into isAffect"); deleteTargetingLine(player); } } else { IItem runItem = runTask.getItem(); player.getInventory().useItem(runItem, player); } tasks.Remove(runTask); battleState = BattleState.IDLE; }