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; } }
void OnCRTWillChange(object sender, object args) { ValueChangeException exc = args as ValueChangeException; MultDeltaModifier m = new MultDeltaModifier(0, 1.10f); exc.AddModifier(m); }
void OnCTRWillChange(object sender, object args) { ValueChangeException exc = args as ValueChangeException; MultDeltaModifier mod = new MultDeltaModifier(0, 2); exc.AddModifier(mod); }
void OnHPWillChange(object sender, object args) { ValueChangeException vce = args as ValueChangeException; vce.AddModifier(new ClampValueModifier(int.MaxValue, MinHP, stats[StatTypes.MHP])); }
void OnExpWillChange(object sender, object args) { ValueChangeException vce = args as ValueChangeException; vce.AddModifier(new ClampValueModifier(int.MaxValue, EXP, maxExperience)); }
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) }