Пример #1
0
 public void RuleEventEnded(ref PrepareDamageEvent context)
 {
     if (context.CurrentTotal() > 0)
     {
         World.Get <RulesSystem>().Post(new TakeDamageEvent(ref context));
     }
 }
Пример #2
0
 public TakeDamageEvent(ref PrepareDamageEvent prepareEvent)
 {
     Action  = prepareEvent.Action;
     Origin  = prepareEvent.Origin;
     Target  = prepareEvent.Target;
     Hit     = prepareEvent.Hit;
     Entries = prepareEvent.Entries;
     Amount  = prepareEvent.CurrentTotal();
     prepareEvent.Entries = null;
 }
Пример #3
0
        public static void OnUsage(ActionEvent ae, ActionCommand cmd, string stat)
        {
            var prepareDamage = new PrepareDamageEvent(ae.Origin, ae.Target, cmd.Action, cmd.HitResult);
            var damageStat    = cmd.Owner.Stats.Get <DiceStat>(stat);

            if (damageStat == null)
            {
                return;
            }
            var total = cmd.HitResult.Result == CollisionResult.CriticalHit ? damageStat.GetMax() : damageStat.Value;

            prepareDamage.Entries.Add(new DamageEntry(total, cmd.Action.Data.GetString(AbilityDataEntries.DamageType), Stats.Health, "Weapon Attack"));
            World.Get <RulesSystem>().Post(prepareDamage);
        }