Esempio n. 1
0
 public void Handle(HealingEvent arg)
 {
     if (!arg.Target.Entity.HasComponent <FloatingText>())
     {
         return;
     }
     UIFloatingText.WorldSpawn(arg.Amount.ToString("F0"), arg.Target.Entity.GetPosition(), Color.green);
 }
Esempio n. 2
0
        public void HandleGlobal(HealingEvent arg)
        {
            var entity = arg.Target;
            var stats  = entity.Get <StatsContainer>();
            var vital  = stats.GetVital(arg.TargetVital);

            if (vital == null)
            {
                vital = stats.GetVital(GameData.Vitals.GetID(arg.TargetVital));
            }
            if (vital != null)
            {
                vital.Current += arg.Amount;
                if (arg.Amount > 0)
                {
                    Color color = arg.TargetVital == Stats.Health ? Color.green : Color.yellow;
                    entity.Post(new CombatStatusUpdate(entity, arg.Amount.ToString("F1"), color));
                }
            }
        }