示例#1
0
    public void ConfirmPlacement()
    {
        if (gamestate != GameState.Placement)
        {
            return;
        }

        Board.CurrentBoard.HidePlacementTilemap();
        gamestate = GameState.Combat;
        ActivateClassSynergy();
        SpellHandler.instance.ActivateRaceSynergy();
        Player.instance.Inventory.Hide();
        TimeButtonHandler.instance.ShowTimeButton();
        HealthbarHandler.ShowBars();
        Player.instance.Inventory.inventoryUI.rewardSystem.RegisterCombatParticipants();
    }
示例#2
0
    private void CombatResolution(string resolution)
    {
        gamestate = GameState.Resolution;
        if (resolution == "UnitEnemy")
        {
            ResolutionPhaseHandler.instance.ChangeText("DEFAITE");
            ResolutionPhaseHandler.instance.Show();
        }
        if (resolution == "UnitAlly")
        {
            ResolutionPhaseHandler.instance.ChangeText("");
            Player.instance.Inventory.Hide();
            Player.instance.Inventory.inventoryUI.rewardSystem.StartRewardPhase();
        }

        SpellHandler.instance.HideSpells();
        SpellHandler.instance.gameObject.SetActive(false);
        Tooltip.HideTooltip_Static();
        HealthbarHandler.HideAll();
        TimeButtonHandler.instance.HideTimeButton();
        Player.instance.Inventory.Hide();
    }
示例#3
0
    private void ActivateSpell()
    {
        List <Unit> affectedAllyUnit  = new List <Unit>();
        List <Unit> affectedEnemyUnit = new List <Unit>();

        if (race != Race.Ratman)
        {
            affectedAllyUnit  = PathfindingTool.unitsInRadius(currentCell, range, "UnitAlly");
            affectedEnemyUnit = PathfindingTool.unitsInRadius(currentCell, range, "UnitEnemy");
        }
        else
        {
            affectedAllyUnit = GameManager.instance.getUnit();
        }
        bool launched = false;

        switch (race)
        {
        case (Race.Orc):
            foreach (Unit unit in affectedAllyUnit)
            {
                if (unit != null)
                {
                    if (unit.getRace() == Race.Orc)
                    {
                        unit.activateOrcSpell(10, 5);
                        launched = true;
                    }
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Skeleton):
            foreach (Unit unit in affectedEnemyUnit)
            {
                if (unit != null)
                {
                    unit.activateSkeletonSpell(0.25f, 5);
                    launched = true;
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Octopus):
            foreach (Unit unit in affectedEnemyUnit)
            {
                if (unit != null)
                {
                    unit.activateStun(2);
                    launched = true;
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Elemental):
            foreach (Unit unit in affectedEnemyUnit)
            {
                if (unit != null)
                {
                    unit.activateElementalSpell(elemental.getNumber() * 10);
                    launched = true;
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Giant):
            foreach (Unit unit in affectedAllyUnit)
            {
                if (unit != null)
                {
                    if (unit.getRace() == Race.Giant)
                    {
                        unit.activateGiantSpell();
                        launched = true;
                    }
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Ratman):
            foreach (Unit unit in affectedAllyUnit)
            {
                if (unit != null)
                {
                    if (unit.CompareTag("UnitAlly") && unit.getRace() == Race.Ratman)
                    {
                        unit.activateRatmanSpell();
                        launched = true;
                    }
                }
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;

        case (Race.Demon):
            if (currentCell.GetIsOccupied() == false && currentCell.GetIsObstacle() == false)
            {
                demonKing = Instantiate(demonKing);
                HealthbarHandler.ShowBars();
                launched = true;
            }
            if (launched == true)
            {
                onCooldown = true;
                cooldownImage.fillAmount = 1;
                activated = false;
            }
            break;
        }
    }