public virtual void OnCollision(GameResult gameResult, IControlable collider)
 {
     if (CanEffect(collider))
     {
         EffectAttachmentResult attachmentResult = new EffectAttachmentResult(gameResult);
         collider.AttachEffects(attachmentResult, effectCollection);
         if (attachmentResult.WeaponIsExpired && solidHost != null)
         {
             solidHost.Kill(gameResult);
         }
     }
 }
예제 #2
0
        public void OnCreation(GameResult gameResult, IControlable host)
        {
            EffectAttachmentResult attachmentResult = new EffectAttachmentResult(gameResult);

            foreach (IEffect effect in effects)
            {
                effect.OnTargetAttachment(attachmentResult, host);
            }
            foreach (IProlongedEffect prolongedEffect in prolongedEffects)
            {
                prolongedEffect.OnTargetAttachment(attachmentResult, host);
            }
        }
예제 #3
0
 public void AttachEffects(EffectAttachmentResult attachmentResult, IControlable attachie, EffectCollection effectCollection)
 {
     if (effectCollection.CanEffect(attachie))
     {
         attachmentResult.WeaponIsExpired = (effectCollection.attachmentFlags & EffectAttachmentFlags.WeaponExpires) == EffectAttachmentFlags.WeaponExpires;
         if ((effectCollection.attachmentFlags & EffectAttachmentFlags.ClonedAttachment) == EffectAttachmentFlags.ClonedAttachment)
         {
             foreach (IEffect effect in effectCollection.effects)
             {
                 if (effect.CanEffect(attachie) && (!BlockEffect(effect)))
                 {
                     IEffect clone = (IEffect)effect.Clone();
                     clone.OnTargetAttachment(attachmentResult, attachie);
                     effects.Add(clone);
                     attachmentResult.EffectAttached = true;
                 }
             }
             foreach (IProlongedEffect prolongedEffect in effectCollection.prolongedEffects)
             {
                 if (prolongedEffect.CanEffect(attachie) && (!BlockEffect(prolongedEffect)))
                 {
                     IProlongedEffect clone = (IProlongedEffect)prolongedEffect.Clone();
                     clone.OnTargetAttachment(attachmentResult, attachie);
                     prolongedEffects.Add(clone);
                     attachmentResult.EffectAttached = true;
                 }
             }
         }
         else
         {
             foreach (IEffect effect in effectCollection.effects)
             {
                 if (effect.CanEffect(attachie) && (!BlockEffect(effect)))
                 {
                     effect.OnTargetAttachment(attachmentResult, attachie);
                     effects.Add(effect);
                     attachmentResult.EffectAttached = true;
                 }
             }
             foreach (IProlongedEffect prolongedEffect in effectCollection.prolongedEffects)
             {
                 if (prolongedEffect.CanEffect(attachie) && (!BlockEffect(prolongedEffect)))
                 {
                     prolongedEffect.OnTargetAttachment(attachmentResult, attachie);
                     prolongedEffects.Add(prolongedEffect);
                     attachmentResult.EffectAttached = true;
                 }
             }
         }
     }
 }
예제 #4
0
 public void AttachEffects(EffectAttachmentResult attachmentResult, EffectCollection effectCollection)
 {
     attachedEffectCollection.AttachEffects(attachmentResult, this, effectCollection);
 }