Exemple #1
0
 private void CloneMembers(RPGStatsComponent original)
 {
     health      = original.health;
     mana        = original.mana;
     nourishment = original.nourishment;
     strength    = original.strength;
 }
Exemple #2
0
        void IConsumer.Consume(Item item)
        {
            if (item == null)
            {
                return;
            }

            ConsumableComponent consumable = item.GetComponent <ConsumableComponent>();
            RPGStatsComponent   stats      = GetComponent <RPGStatsComponent>();

            if (consumable == null || stats == null)
            {
                return;
            }

            stats.Consume(consumable);

            if (consumable.IsSpent)
            {
                Inventory.Remove(item);
            }

            NotifyRedrawObservers(new RedrawNotification($"{Name} consumed {item.Name}, " +
                                                         $"receiving effect: [{consumable.Effect.ToString()}] for {consumable.Potency} points"));
        }
Exemple #3
0
 private RPGStatsComponent(RPGStatsComponent original)
 {
     CloneMembers(original);
 }