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? }
public void SetSingleTarget(Actor target) { this.Targets = new TargetList(); this.Targets.Actors.Add(target); }