Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
    void OnCRTWillChange(object sender, object args)
    {
        ValueChangeException exc = args as ValueChangeException;
        MultDeltaModifier    m   = new MultDeltaModifier(0, 1.10f);

        exc.AddModifier(m);
    }
Exemplo n.º 3
0
    void OnCTRWillChange(object sender, object args)
    {
        ValueChangeException exc = args as ValueChangeException;
        MultDeltaModifier    mod = new MultDeltaModifier(0, 2);

        exc.AddModifier(mod);
    }
Exemplo n.º 4
0
    void OnHPWillChange(object sender, object args)
    {
        ValueChangeException vce = args as ValueChangeException;

        vce.AddModifier(new ClampValueModifier(int.MaxValue, MinHP, stats[StatTypes.MHP]));
    }
Exemplo n.º 5
0
    void OnExpWillChange(object sender, object args)
    {
        ValueChangeException vce = args as ValueChangeException;

        vce.AddModifier(new ClampValueModifier(int.MaxValue, EXP, maxExperience));
    }
Exemplo n.º 6
0
    void OnExpWillChange(object sender, object args)
    {
        ValueChangeException vce = args as ValueChangeException;

        vce.AddModifier(new ClampValueModifier(int.MaxValue, EXP, maxExperience)); //the highest possible sort order (to make sure it is the last modifier to be applied)
    }