示例#1
0
    // drops a specialattack into the play area, 1 = left hand, 2 = right hand, 3 = both
    // should not be called if there is no corresponding orb(s), or if isDouble() [check these in playerManager]
    public void deploySpecial(int hand, Vector3 cursorPos, Vector3 playerPos)
    {
        string tempSpecial = "";

        // determine which special to deploy
        if (hand == 1)
        {
            tempSpecial = leftHand;
        }
        else if (hand == 2)
        {
            tempSpecial = rightHand;
        }
        else if (hand == 3)
        {
            tempSpecial = leftHand + rightHand;
        }
        else
        {
            tempSpecial = "X";
        }

        // deploy the selected special
        if (!(tempSpecial == "X"))
        {
            if (tempSpecial.Length < 2)
            {
                if (tempSpecial == "A")
                {
                    areaSpecial.deploy(playerPos, playerPos);
                }
                else if (tempSpecial == "R")
                {
                    rangeSpecial.deploy(playerPos, cursorPos);
                }
                else
                {
                    forceSpecial.deploy(playerPos, cursorPos);
                }

                // update tracker
                ScoreCounter.self.num1h++;
            }
            else
            {
                if (tempSpecial == "AR" || tempSpecial == "RA")
                {
                    areaRangeSpecial.deploy(cursorPos, cursorPos);
                }
                else if (tempSpecial == "AF" || tempSpecial == "FA")
                {
                    areaForceSpecial.deploy(cursorPos, playerPos);
                }
                else
                {
                    rangeForceSpecial.deploy(playerPos, cursorPos);
                }

                // update tracker
                ScoreCounter.self.num2h++;
            }
        }
    }