Exemplo n.º 1
0
    public override float Affect(Message message, float input)
    {
        PlayerScript player = null == message ? null : message.Player(myObject);

        if (null == player)
        {
        }
        else
        {
            switch (myResource)
            {
            case Enum.ManaCap:
                player.myManaCap = (int)myFunctionScript.Affect(message, (float)player.myManaCap);
                break;

            case Enum.Debt:
                player.myDebt = (int)myFunctionScript.Affect(message, (float)player.myDebt);
                break;

            case Enum.Gold:
                player.myGold = (int)myFunctionScript.Affect(message, (float)player.myGold);
                break;

            case Enum.Mana:
                player.myMana = (int)myFunctionScript.Affect(message, (float)player.myMana);
                break;

            case Enum.Overload:
                player.myOverload = (int)myFunctionScript.Affect(message, (float)player.myOverload);
                break;
            }
        }

        return(input);
    }
Exemplo n.º 2
0
    //public int count
    //{
    //	get
    //	{
    //		return myPhases.Length;
    //	}
    //}

    public void Activate()
    {
        if (myWait <= 0f)
        {
            myWait = myDuration;

            HealthScript health = myUnit.GetComponent <HealthScript>();

            if (health.isAlive)
            {
                if (myTarget)
                {
                    myDistance = (myTarget.transform.position - myUnit.transform.position).magnitude;
                    if (myDistance < myRange)
                    {
                        myEffect.Affect(new Message(myUnit.ToTerm(), myTarget.ToTerm()), 0f);
                    }
                }
            }
        }
        else
        {
            myWait -= Time.deltaTime;
        }
    }