예제 #1
0
 private void Reset()
 {
     e         = (Tapestry_Effect)ScriptableObject.CreateInstance("Tapestry_Effect");
     e.payload = new Tapestry_EffectBuilder_Payload_Damage();
     d         = new Tapestry_EffectBuilder_Payload_Damage();
     //e.name = "buttfarts";
 }
예제 #2
0
 public virtual void AddEffect(Tapestry_Effect effect)
 {
     if (effect.canBeStacked || !effects.Contains(effect))
     {
         effects.Add(effect);
     }
 }
예제 #3
0
 public virtual void RemoveEffectByName(Tapestry_Effect effect)
 {
     for (int i = effects.Count - 1; i >= 0; i--)
     {
         if (effect.displayName == effects[i].displayName)
         {
             effects.RemoveAt(i);
             break;
         }
     }
 }
예제 #4
0
 public virtual void RemoveEffect(Tapestry_Effect effect)
 {
     for (int i = effects.Count - 1; i >= 0; i--)
     {
         if (effect.Equals(effects[i]))
         {
             effects.RemoveAt(i);
             break;
         }
     }
 }
예제 #5
0
    public bool Equals(Tapestry_Effect other)
    {
        bool comp = true;

        comp = comp & (displayName == other.displayName);
        comp = comp & (duration == other.duration);
        comp = comp & (sprite == other.sprite);
        comp = comp & (hideEffectDisplay == other.hideEffectDisplay);
        comp = comp & (canBeStacked == other.canBeStacked);
        comp = comp & (payload.GetType() == other.payload.GetType());
        return(true);
    }
예제 #6
0
    private void HandleEffects()
    {
        for (int i = effects.Count - 1; i >= 0; i--)
        {
            Tapestry_Effect e = effects[i];

            e.Apply(this);

            if (e.readyForRemoval)//if (e.duration == Tapestry_EffectBuilder_Duration.Instant)
            {
                effects.Remove(e);
            }
        }
    }
예제 #7
0
 public override void Apply(Tapestry_Actor target)
 {
     for (int i = target.effects.Count - 1; i >= 0; i--)
     {
         Tapestry_Effect e = target.effects[i];
         if (e.payload.GetType() != typeof(Tapestry_EffectBuilder_Payload_Purge))
         {
             if (needsOneKeyword)
             {
                 if (e.keywords.ContainsOne(keywords))
                 {
                     e.readyForRemoval = true;
                 }
             }
             else
             {
                 if (e.keywords.ContainsAll(keywords))
                 {
                     e.readyForRemoval = true;
                 }
             }
         }
     }
 }
 private void Reset()
 {
     effect   = (Tapestry_Effect)ScriptableObject.CreateInstance("Tapestry_Effect");
     keywords = (Tapestry_KeywordRegistry)ScriptableObject.CreateInstance("Tapestry_KeywordRegistry");
 }
예제 #9
0
    public Tapestry_Effect Clone()
    {
        Tapestry_Effect export = (Tapestry_Effect)this.MemberwiseClone();

        return(export);
    }