Пример #1
0
    void OnExperienceException(object sender, object args)
    {
        GameObject           actor = (sender as Stats).gameObject;
        ValueChangeException vce   = args as ValueChangeException;
        int roll = UnityEngine.Random.Range(0, 5);

        switch (roll)
        {
        case 0:
            vce.FlipToggle();
            Debug.Log(string.Format("{0} would have received {1} experience, but we stopped it", actor.name, vce.delta));
            break;

        case 1:
            vce.AddModifier(new AddValueModifier(0, 1000));
            Debug.Log(string.Format("{0} would have received {1} experience, but we added 1000", actor.name, vce.delta));
            break;

        case 2:
            vce.AddModifier(new MultValueModifier(0, 2f));
            Debug.Log(string.Format("{0} would have received {1} experience, but we multiplied by 2", actor.name, vce.delta));
            break;

        default:
            Debug.Log(string.Format("{0} will receive {1} experience", actor.name, vce.delta));
            break;
        }
    }
Пример #2
0
    void OnStatCounterWillChange(object sender, object args)
    {
        // Dont allow a KO'd unit to increment the turn order counter
        ValueChangeException exc = args as ValueChangeException;

        if (exc.toValue > exc.fromValue)
        {
            exc.FlipToggle();
        }
    }
Пример #3
0
    private void OnStatCounterWillChange(object sender, object args)
    {
        // KO'd unit gains no turn counter
        ValueChangeException exc = args as ValueChangeException;

        if (exc.toValue > exc.fromValue)
        {
            exc.FlipToggle();
        }
    }
Пример #4
0
    // handler method for speed counter notification
    void OnCounterWillChange(object sender, object args)
    {
        ValueChangeException exc = args as ValueChangeException;

        exc.FlipToggle();
    }