Exemple #1
0
    void DoAbility(Ability ability)
    {
        // Now that we have selected a character, proceed with  the ability cast
        AbilityToCast = ability;
        combat.HideSelectMenu();
        combat.actionToDo = ability;
        int rangeBase = 0;

        // Decide on stats to use based on the ability name
        // I might replace the choosing method to a dictionary  or something
        if (ability.name == "Fireball")
        {
            rangeBase        = 4;
            combat.areaRange = 3;
            combat.selectTargetLocation(rangeBase);
        }
        else if (ability.name == "Sniper Attack")
        {
            // Change to individual target
            rangeBase = 8;

            combat.ShowSelectMenu(combat.getEnemiesInRange(rangeBase, "Player"));
            combat.areaRange = 1;
        }
        else if (ability.name == "Heal Self")
        {
            // Change select method to individual ally, or just f**k it
            rangeBase = 0;
            combat.selectTargetLocation(rangeBase);
        }
        combat.selectingRange = rangeBase;
        //combat.selectTargetLocation (rangeBase);
    }
Exemple #2
0
    /********************************************************************************************/
    /******************************************* Buttons ****************************************/
    /********************************************************************************************/


    public void AttackPress()
    {
        // When you hit that attack button
        //print ("ATTACKKKKK");
        combat.HideBattleMenu();
        //combat.CreateSelectOptions ();

        Ability temp = ScriptableObject.CreateInstance("Ability") as Ability;

        temp.init("Basic Attack", combat.actionFrom);
        combat.actionToDo = temp;


        List <CharacterClass> tempChars = combat.getEnemiesInRange(1, "Player");

        if (tempChars != null)
        {
            combat.HideBattleMenu();
            combat.ShowSelectMenu(tempChars);
        }
        else
        {
            print("NOONE IN MELEE RANGE");
        }
        //combat.PlayerAttack(0,0);
    }