Exemple #1
0
        void ResolveProperty(Property prop, int value, int target)
        {
            switch (prop)
            {
            // --- Resource --- //
            case Property.Health:
                if (value < 0)
                {
                    HealthLostEvent?.Invoke(target, -value);
                }
                else
                {
                    HealthGainedEvent?.Invoke(target, value);
                }
                break;

            // --- Stat --- //
            case Property.Str:
            case Property.Dex:
            case Property.Int:
            case Property.Fire:
            case Property.Nature:
            case Property.Water:
            case Property.Wind:
                Stat stat = prop.ToStat();
                StatChangedEvent?.Invoke(target, stat, value, Math.Abs(value * 2));
                break;

            default:
                UISystem.Message(String.Format("Item effect not implemented: {0} ({1})", prop.ToString(), value));
                break;
            }
        }
Exemple #2
0
 void RaiseHealthLostEvent(int entity, float amount)
 {
     HealthLostEvent?.Invoke(entity, amount);
 }