コード例 #1
0
    public void OnPointerEnterAttack(int which)
    {
        if (currentStatus != Status.Rest)
        {
            return;
        }

        if (which == 0)
        {
            hexMap.ProbeAttackTarget(selectedPawn.currentCell);
            hexMap.ShowReachableEnemyCells();
        }
        else
        {
            Monster         monster = (Monster)selectedPawn;
            SkillTargetType type    = SkillTargetType.None;
            int             range   = -1;

            if (which == 1)
            {
                type  = characterReader.GetMonsterSkillTargetType(monster.Name, monster.defaultSkill);
                range = characterReader.GetMonsterSkillRange(monsterManager.GetMonsterUnlockLevel(monster.monsterType), monster.Name, monster.defaultSkill, monster.level);
            }
            else if (which == 2)
            {
                type  = characterReader.GetMonsterSkillTargetType(monster.Name, monster.equippedSkill);
                range = characterReader.GetMonsterSkillRange(monsterManager.GetMonsterUnlockLevel(monster.monsterType), monster.Name, monster.equippedSkill, monster.level);
            }

            if (range < 0)
            {
                return;
            }

            hexMap.ProbeAttackTarget(selectedPawn.currentCell, range);
            switch ((int)type)
            {
            case (int)SkillTargetType.Enemy:
                hexMap.ShowReachableEnemyCells();
                break;

            case (int)SkillTargetType.Friend:
                hexMap.ShowReachableFriendCells();
                break;

            case (int)SkillTargetType.Building:
                hexMap.ShowReachableBuildingCells();
                break;

            case (int)SkillTargetType.Empty:
                hexMap.ShowReachableEmptyCells();
                break;

            case (int)SkillTargetType.Self:
                hexMap.ShowReachableFriendCells();
                break;

            default:
                break;
            }
        }
    }