Пример #1
0
 void SelectInDamage(int n, bool bEnd, Void0ParamsDelegate fnc)
 {
     _SID_n = n;
     _SID_Active = true;
     _SID_fnc = fnc;
     _SID_End = bEnd;
     EnableMouse("Choose a card from your damage zone.");
 }
Пример #2
0
 public void CallFromHandUpdate(Void0ParamsDelegate f)
 {
     if(_CFH_Active)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             _CFH_Active = false;
             f();
         }
         else
         {
             Game.HandleCallFromHand();
         }
     }
 }
Пример #3
0
    public void DelayUpdate(Void0ParamsDelegate func, int id = -1)
    {
        if(_Delay_Bool && (id == -1 || GetBool(id)))
        {
            if(_Delay_Time >= 0)
            {
                _Delay_Time -= Time.deltaTime;
            }
            else
            {
                if(id != -1)
                {
                    UnsetBool(id);
                }

                _Delay_Bool = false;
                func();
            }
        }
    }
Пример #4
0
 /**
  * When Soul Charge is finished (After call SoulCharge()) the delegate function "func" is executed.
  */
 public void SoulChargeUpdate(Void0ParamsDelegate func)
 {
     if(SC_Bool)
     {
         if(SC_Card == null || !SC_Card.AnimationOngoing())
         {
             if(SC_Int > 0)
             {
                 SC_Int--;
                 if(SC_WithSelection)
                 {
                     SC_Card = Game.SoulCharge (SC_List[0]);
                     SC_List.RemoveAt(0);
                 }
                 else
                 {
                     SC_Card = Game.SoulCharge();
                 }
             }
             else
             {
                 SC_Bool = false;
                 func();
             }
         }
     }
 }
Пример #5
0
 public void CallFromDeckUpdate(Void0ParamsDelegate func)
 {
     if(_CFDAux_Bool1)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             if(_CFDAux_Int1 <= 0)
             {
                 _CFDAux_Bool1 = false;
                 func();
             }
             else
             {
                 _CFDAux_Card = Game.playerDeck.SearchForID(_CFDAux_IDVector[0]);
                 CallFromDeckList.Add(Game.playerDeck.SearchForID(_CFDAux_IDVector[0]));
                 _CFDAux_IDVector.RemoveAt(0);
                 Game.playerDeck.RemoveFromDeck(_CFDAux_Card);
                 Game.CallFromDeck(_CFDAux_Card);
                 _CFDAux_Card.TurnUp();
                 _CFDAux_Int1--;
             }
         }
         else
         {
             Game.HandleCallFromDeck();
         }
     }
 }
Пример #6
0
    public bool SelectInHand_Pointer(bool bForceEnd = false, Void0ParamsDelegate newEndFunction = null)
    {
        if(_SIH_Active)
        {
            if(CancelInput() && bForceEnd)
            {
                ClearPointer(_SIH_End);
                _SIH_Active = false;

                if(newEndFunction == null)
                {
                    _SIH_fnc_end();
                }
                else
                {
                    newEndFunction();
                }
            }

            if(AcceptInput())
            {
                _SIH_Card = HandSelectedCard();
                if(ValidHand(_SIH_Card) && _SIH_constraint())
                {
                    _SIH_fnc();
                    _SIH_n--;
                    if(_SIH_n <= 0)
                    {
                        ClearPointer(_SIH_End);
                        _SIH_Active = false;
                        _SIH_fnc_end();
                    }
                }
            }
        }

        return _SIH_Active;
    }
Пример #7
0
    /**
     * This method performs the animation of the cards that will be send to Bind Zone. And also performs
     * the remove from deck, add to bind and networking communication. This method must be call in a
     * Update function after a BindFromDeck method was called. When all Cards passed in the BindFromDeck
     * argument were sent to BindZone, func delegate will be executed.
     */
    public void BindFromDeckUpdate(Void0ParamsDelegate func)
    {
        if(BindFromDeck_Active)
        {
            if(BindFromDeck_Card == null || !BindFromDeck_Card.AnimationOngoing())
            {
                if(BindFromDeck_Card != null)
                {
                    //Remove from deck and add to BindZone.
                    Game.playerDeck.RemoveFromDeck(BindFromDeck_Card);
                    Game.field.AddToBindZone(BindFromDeck_Card);
                    BindFromDeck_Card = null;
                }

                //Send the next card in the list, if any. If not, func delegate is called.
                if(BindFromDeck_CardList.Count > 0)
                {
                    BindFromDeck_Card = BindFromDeck_CardList[0];
                    BindFromDeck_CardList.RemoveAt(0);
                    BindFromDeck_Card.TurnUp();
                    BindFromDeck_Card.BindAnim();
                    Game.SendPacket (GameAction.BIND_FROM_DECK, BindFromDeck_Card.cardID);
                }
                else
                {
                    BindFromDeck_Active = false;
                    func();
                }
            }
        }
    }
Пример #8
0
    public void FromDropToDeckUpdate(Void0ParamsDelegate DD_fnc)
    {
        if(DD_Active)
        {
            if(DD_Card == null || !DD_Card.AnimationOngoing())
            {
                if(DD_List.Count > 0)
                {
                    DD_Card = Game.field.GetDropByID(DD_List[0]);
                    DD_Card.TurnDown();

                    DD_List.RemoveAt(0);
                    Game.field.RemoveFromDropzone(DD_Card);

                    if(DD_toBottom)
                    {
                        Game.playerDeck.AddToBottom(DD_Card);
                    }
                    else
                    {
                        Game.playerDeck.AddCard(DD_Card);
                    }

                    Game.SendPacket(GameAction.FROM_DROP_TO_DECK, DD_Card.cardID);
                }
                else
                {
                    DD_Active = false;
                    Game.field.FixDropZonePosition();
                    DD_fnc();
                }
            }
        }
    }
Пример #9
0
    public void FromHandToBindUpdate(Void0ParamsDelegate func)
    {
        if(FromHandToBind_Bool1)
        {
            if(FromHandToBind_Card == null || !FromHandToBind_Card.AnimationOngoing())
            {
                if(FromHandToBind_Card != null)
                {
                    Game.playerHand.RemoveFromHand(FromHandToBind_Card);
                    Game.field.AddToBindZone(FromHandToBind_Card);
                    if(FromHandToBind_Facedown)
                    {
                        FromHandToBind_Card.TurnDown();
                    }
                }

                FromHandToBind_Bool1 = false;
                FromHandToBind_Card = null;
                func();
            }
        }
    }
Пример #10
0
    public void FromBindToDeckUpdate(Void0ParamsDelegate fnc)
    {
        if(FromBindToDeck_Active)
        {
            if(!FromBindToDeck_Card.AnimationOngoing())
            {
                Game.field.RemoveFromBindZone(FromBindToDeck_Card);

                if(FromBindToDeck_toBottom)
                {
                    Game.playerDeck.AddToBottom(FromBindToDeck_Card);
                }
                else
                {
                    Game.playerDeck.AddCard(FromBindToDeck_Card);
                }

                FromBindToDeck_Active = false;
                FromBindToDeck_Card = null;
                fnc();
            }
        }
    }
Пример #11
0
 public void FromDeckToGuardianCircleUpdate(Void0ParamsDelegate f)
 {
     if(FDTGC_Active)
     {
         if(!FDTGC_Card.AnimationOngoing())
         {
             FDTGC_Active = false;
             GetDeck().DrawCard();
             Game.guardZone.AddToGuardZone(FDTGC_Card, true);
             GetDefensor().AddExtraShield(FDTGC_Card.shield);
             //Game.guardZone.AddExtraPower(FDTGC_Card.shield);
             f();
         }
     }
 }
Пример #12
0
 public void DelayUpdate(Void0ParamsDelegate func)
 {
     if(_Delay_Bool)
     {
         if(_Delay_Time >= 0)
         {
             _Delay_Time -= Time.deltaTime;
         }
         else
         {
             _Delay_Bool = false;
             func();
         }
     }
 }
Пример #13
0
 void SelectUnit(string msg, int n, bool bEnd, Void0ParamsDelegate fnc, delegateConstraint constr, Void0ParamsDelegate fnc_end, bool bVC = false)
 {
     _SU_n = n;
     _SU_fnc = fnc;
     _SU_Active = true;
     EnableMouse(msg);
     _SU_EndEffect = bEnd;
     _SU_constraint = constr;
     _SU_fnc_end = fnc_end;
     bSelectVanguard = bVC;
 }
Пример #14
0
 void SelectUnit(string msg, int n, Void0ParamsDelegate fnc, bool bEnd = true)
 {
     _SU_n = n;
     _SU_fnc = fnc;
     _SU_Active = true;
     EnableMouse(msg);
     _SU_EndEffect = bEnd;
     _SU_constraint = null;
     _SU_fnc_end = null;
     bSelectVanguard = false;
 }
Пример #15
0
    public bool SelectInEnemyHand_Pointer(bool bForceEnd = false, Void0ParamsDelegate newEndFunction = null)
    {
        if(_SIEH_Active)
        {
            if(CancelInput() && bForceEnd)
            {
                ClearPointer(_SIEH_End);
                _SIEH_Active = false;

                if(newEndFunction == null)
                {
                    _SIEH_fnc_end();
                }
                else
                {
                    newEndFunction();
                }
            }

            if(AcceptInput())
            {
                _SIEH_Card = Game.LastEnemyHandSelected;
                if(_SIEH_Card != null && _SIEH_Card._HandleEnemyMouse.mouseOn && _SIEH_constraint())
                {
                    _SIEH_fnc();
                    _SIEH_n--;
                    if(_SIEH_n <= 0)
                    {
                        ClearPointer(_SIEH_End);
                        _SIEH_Active = false;
                        _SIEH_fnc_end();
                    }
                }
            }
        }

        return _SIH_Active;
    }
Пример #16
0
    public void FromHandToSoulUpdate(Void0ParamsDelegate func)
    {
        if(FHTS_Bool1)
        {
            if(FHTS_Card == null || !FHTS_Card.AnimationOngoing())
            {
                if(FHTS_Card != null)
                {
                    Game.playerHand.RemoveFromHand(FHTS_Card);
                    Game.field.AddToSoul(FHTS_Card);
                }

                FHTS_Bool1 = false;
                FHTS_Card = null;
                func();
            }
        }
    }
Пример #17
0
 public void SelectInHand(int n, bool bEnd, Void0ParamsDelegate fnc, delegateConstraint constraint, Void0ParamsDelegate fnc_end, string msg)
 {
     _SIH_n = n;
     _SIH_Active = true;
     _SIH_fnc = fnc;
     _SIH_constraint = constraint;
     _SIH_fnc_end = fnc_end;
     _SIH_End = bEnd;
     EnableMouse(msg);
 }
Пример #18
0
 public void Heal(int num, Void0ParamsDelegate f)
 {
     _H_n = num;
     _H_Active = true;
     EnableMouse("Choose " + _H_n + " card(s) from your damage zone.");
     _H_f = f;
 }
Пример #19
0
 public void SelectUnit(string msg, int n, bool bEnd, Void0ParamsDelegate fnc, delegateConstraint constr, Void0ParamsDelegate fnc_end, bool bVC = false)
 {
     if(n == 0)
     {
         fnc_end();
         if(bEnd)
         {
             EndEffect();
         }
     }
     else
     {
         _SU_n = n;
         _SU_fnc = fnc;
         _SU_Active = true;
         EnableMouse(msg + "\n\nRight-Click to end the effect. (If the effect says \"up to\", for example)");
         _SU_EndEffect = bEnd;
         _SU_constraint = constr;
         _SU_fnc_end = fnc_end;
         bSelectVanguard = bVC;
     }
 }
Пример #20
0
 public void MillUpdate(Void0ParamsDelegate f)
 {
     if(millActive)
     {
         currMillTime -= Time.deltaTime;
         if(millCard == null || currMillTime <= 0)
         {
             if(millNum <= 0)
             {
                 millActive = false;
                 f();
             }
             else
             {
                 millCard = SendCardFromDeckToDrop();
                 currMillTime = millTime;
                 millNum--;
             }
         }
     }
 }
Пример #21
0
    public void SoulBlastUpdate(Void0ParamsDelegate func)
    {
        if(_SBAux_Bool1)
        {
            if(!Game.field.ViewingSoul())
            {
                _SBAux_Bool1 = false;
                _SBAux_IDVector = Game.field.GetLastSelectedList();
                _SBAux_Bool2 = true;
            }
        }

        if(_SBAux_Bool2)
        {
            if(_SBAux_Int1 > 0)
            {
                if(_SBAux_Card1 == null || !_SBAux_Card1.AnimationOngoing())
                {
                    if(_SBAux_Card1 != null)
                    {
                        Game.field.RemoveFromSoulByCard(_SBAux_Card1);
                        Game.field.AddToDropZone(_SBAux_Card1);
                        _SBAux_Card1.CheckAbilities(CardState.DropFromSoul);
                        Game.field.CheckAbilitiesExcept(_SBAux_Card1.pos, CardState.DropFromSoul_NotMe, _SBAux_Card1);
                    }

                    _SBAux_Card1 = Game.field.GetSoulByID(_SBAux_IDVector[0]);
                    _SBAux_IDVector.RemoveAt(0);
                    Game.SoulBlast(_SBAux_Card1);
                    Debug.Log(_SBAux_Card1.cardID);
                    _SBAux_Int1--;
                }
            }
            else
            {
                if(_SBAux_Card1 != null)
                {
                    Game.field.RemoveFromSoulByCard(_SBAux_Card1);
                    Game.field.AddToDropZone(_SBAux_Card1);
                    _SBAux_Card1 = null;
                }

                _SBAux_Bool2 = false;
                ClearMessage();
                func();
            }
        }
    }
Пример #22
0
 public void ResolveDeckOpening(int id, Void0ParamsDelegate success, Void0ParamsDelegate failure)
 {
     if(GetBool(id) && !GetDeck().IsOpen())
     {
         UnsetBool(id);
         _AuxIdVector = GetDeck().GetLastSelectedList();
         if(_AuxIdVector.Count > 0)
         {
             success();
         }
         else
         {
             failure();
         }
     }
 }
Пример #23
0
 public void CallFromDamageUpdate(Void0ParamsDelegate fnc)
 {
     if(_CFDamage_Active)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             _CFDamage_Active = false;
             fnc();
         }
         else
         {
             Game.HandleCallFromDamage();
         }
     }
 }
Пример #24
0
 public void ResolveSoulOpening(int id, Void0ParamsDelegate success, Void0ParamsDelegate failure)
 {
     if (GetBool(id) && !Game.field.ViewingSoul())
     {
         UnsetBool(id);
         _AuxIdVector = Game.field.GetLastSelectedList();
         if (_AuxIdVector.Count > 0)
         {
             success();
         }
         else
         {
             failure();
         }
     }
 }
Пример #25
0
 public void CallFromDropUpdate(Void0ParamsDelegate func)
 {
     if(_DropCall_AuxBool)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             _DropCall_AuxBool = false;
             func();
         }
         else
         {
             Game.HandleCallFromDrop();
         }
     }
 }
Пример #26
0
 public void SelectEnemyUnit(string msg, int n, bool bEndEffect, Void0ParamsDelegate fnc, delegateConstraint constraint, Void0ParamsDelegate fncEnd)
 {
     if(n == 0)
     {
         fncEnd();
         if(bEndEffect)
         {
             EndEffect();
         }
     }
     else
     {
         SEU_Func = fnc;
         SEU_Constraint = constraint;
         SEU_End = fncEnd;
         SEU_bEndEffect = bEndEffect;
         SEU_num = n;
         SEU_Active = true;
         EnableMouse(msg);
     }
 }
Пример #27
0
 public void CallFromSoulUpdate(Void0ParamsDelegate func)
 {
     if(_CFS_AuxBool3)
     {
         if(Game._MouseHelper.GetAttachedCard() == null)
         {
             _CFS_AuxBool3 = false;
             Game.field.RemoveFromSoulByCard(_CFS_AuxCard);
             _CFS_AuxCard.TurnUp();
             func();
         }
         else
         {
             Game.HandleSpecialCall();
         }
     }
 }
Пример #28
0
 public void SelectInEnemyDamage(int n, bool bEnd, Void0ParamsDelegate fnc, boolCardFunction bcf = null, Void0ParamsDelegate efnc = null)
 {
     _ESID_n = n;
     _ESID_Active = true;
     _ESID_fnc = fnc;
     _ESID_End = bEnd;
     _ESID_Constraint = bcf;
     _ESID_EndFnc = efnc;
     EnableMouse("Choose a card from your opponent's damage zone.");
 }
Пример #29
0
    public void DrawCardUpdate(Void0ParamsDelegate func)
    {
        if(DC_bool)
        {
            DC_time -= Time.deltaTime;

            if(DC_n > 0)
            {
                if(DC_time <= 0)
                {
                    DrawCardWithoutDelay();
                    DC_n--;
                    DC_time = 1.2f;
                }
            }
            else
            {
                DC_bool = false;
                func();
            }
        }
    }
Пример #30
0
 void SelectEnemyUnit(Void0ParamsDelegate fnc, bool bEndEffect = true)
 {
     if(AcceptInput())
     {
         fieldPositions p = Util.GetMousePosition();
         if(Util.IsEnemyPosition(p) && p != fieldPositions.ENEMY_VANGUARD)
         {
             Card c = Game.enemyField.GetCardAt(Util.TransformToEquivalentEnemyPosition(p));
             if(c != null)
             {
                 EnemyUnit = c;
                 fnc();
                 ClearPointer(bEndEffect);
             }
         }
     }
 }