コード例 #1
0
        public override void Apply()
        {
            if (this.Targets == null)
            {
                this.Targets = new TargetList();
            }

            // main targets
            foreach (Actor target in this.Targets.Actors)
            {
                // filter null and killed targets
                if (target == null /*&& target.World.PowerManager.IsDeletingActor(target)*/)
                {
                    continue;
                }

                if (target.World == null)
                {
                    continue;
                }

                // TODO: calculate hit chance for monsters instead of always hitting
                bool       docrit     = _doCriticalHit(this.Context.Player, target);
                HitPayload hitpayload = new HitPayload(this, true, target);
                //payload.AutomaticHitEffects = this.AutomaticHitEffects;
                //payload.OnDeath = OnDeath;

                //foreach (Func<Buff> buffFactory in _hitBuffs)
                //  this.Context.AddBuff(target, buffFactory());

                /*if (OnHit != null)
                *   OnHit(hitpayload);*/

                hitpayload.Apply();
            }

            //aca hacer un foreach con this.Targets.ExtraActors?
        }
コード例 #2
0
 public void SetSingleTarget(Actor target)
 {
     this.Targets = new TargetList();
     this.Targets.Actors.Add(target);
 }