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);
 }
Exemple #2
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);
    }