Ejemplo n.º 1
0
 public override bool Apply(Tile tile)
 {
     if (tile.tileContent != null)
     {
         EffectHandler handler = tile.tileContent.GetComponent <EffectHandler>();
         A_Effect      effect  = handler.GetFirst(GameHelper.EffectType.SpiderWeb);
         if (effect != null)
         {
             effect.AddDuration(1.0f);
             Destroy(this.gameObject);
             return(false);
         }
         else
         {
             if (tile.tileContent != null && tile.GetCharacter() != null)
             {
                 character          = tile.GetCharacter();
                 character.movment += movementDec;
             }
             this.tile = tile;
             active    = true;
             EventManager.OnTurnEnd += TurnEnd;
             tile.tileContent.GetComponent <EffectHandler>().AddEffect(this);
         }
     }
     return(true);
 }
Ejemplo n.º 2
0
 public void DrawEffect(A_Effect effect, Tile tile)
 {
     if (noCast)
     {
         NoCastEffects.Add(new EffectAction(effect, tile, effect.DrawIndicator(tile)));
     }
     else
     {
         activeEffects.Add(new EffectAction(effect, tile, effect.DrawIndicator(tile)));
     }
 }
Ejemplo n.º 3
0
    public void RemoveEffect(A_Effect effect, Tile tile)
    {
        int index = activeEffects.FindIndex(x => (x.effect == effect && x.tile == tile));

        if (index != -1)
        {
            EffectAction ea = activeEffects[index];
            RemoveEffect(ea);
            activeEffects.RemoveAt(index);
            Refresh();
        }
    }
Ejemplo n.º 4
0
    public override bool Apply(Tile tile)
    {
        EffectHandler handler = tile.tileContent.GetComponent <EffectHandler>();
        A_Effect      effect  = handler.GetFirst(GameHelper.EffectType.SpiderWeb);

        if (effect != null)
        {
            effect.AddDuration(1.0f);
            Destroy(this.gameObject);
            return(false);
        }
        else if (tile.tileContent != null)
        {
            this.tile = tile;
            active    = true;
            tile.tileContent.OnWalkOver += WalkOver;
            EventManager.OnTurnEnd      += TurnEnd;
            tile.tileContent.GetComponent <EffectHandler>().AddEffect(this);
        }
        return(true);
    }
Ejemplo n.º 5
0
 public EffectAction(A_Effect effect, Tile tile, List <Tile> tiles)
 {
     this.effect = effect;
     this.tile   = tile;
     this.tiles  = tiles;
 }
Ejemplo n.º 6
0
 public void DrawEffect(Tile tile, A_Effect effect)
 {
     effect.DrawIndicator(tile);
 }
Ejemplo n.º 7
0
 public void AddEffect(A_Effect effect)
 {
     effects.Add(effect);
 }
Ejemplo n.º 8
0
    //public A_Effect Contains()


    public void RemoveEffect(A_Effect effect)
    {
        effects.Remove(effect);
    }
Ejemplo n.º 9
0
 public void KillEffect(A_Effect effect)
 {
 }