Beispiel #1
0
 public override void FindCardType(ObjectType t, List <GameObject> finds, CardAligment aligment = CardAligment.All)
 {
     foreach (CardZone zone in UnitPos)
     {
         zone.FindCardType(t, finds, aligment);
     }
 }
Beispiel #2
0
    public void AligmentUpdate(CardAligment ali)
    {
        Sprite aliSprite = null;

        if (ali == CardAligment.Magician)
        {
            aliSprite = Resources.Load <Sprite>(Constants.UNITZONE_ALIGMENT_MAGICK);
        }
        else if (ali == CardAligment.SowrdMan)
        {
            aliSprite = Resources.Load <Sprite>(Constants.UNITZONE_ALIGMENT_SOWRD);
        }
        //Debug.Log(ali + "" + aliSprite);

        foreach (CardZone pos in UnitPos)
        {
            Image posImage = pos.GetComponent <Image>();
            if (posImage != null)
            {
                posImage.sprite = aliSprite;
                if (posImage.sprite != null)
                {
                    posImage.color = new Color(1, 1, 1, 1);
                }
                else
                {
                    posImage.color = new Color(0, 0, 0, 0);
                }
            }
        }
    }
 private void AligmentUpdate()
 {
     if (Constants.BATTLE.Players[0].cardAligment != p1 || Constants.BATTLE.Players[1].cardAligment != p2)
     {
         p1             = Constants.BATTLE.Players[0].cardAligment;
         p2             = Constants.BATTLE.Players[1].cardAligment;
         image[0].color = p1 == CardAligment.SowrdMan ? Constants.S_COLOR : Constants.M_COLOR;
         image[1].color = p2 == CardAligment.SowrdMan ? Constants.S_COLOR : Constants.M_COLOR;
     }
 }
Beispiel #4
0
 //引数のタイプの対象がこの場にあるか確認し、Listに格納して返す
 public virtual void FindCardType(ObjectType t, List <GameObject> finds, CardAligment aligment = CardAligment.All)
 {
     foreach (Card card in Cards)
     {
         if ((card.State.cardType == t || t == ObjectType.All) &&
             (aligment == CardAligment.All || card.State.cardAligment == aligment))
         {
             finds.Add(card.gameObject);
         }
     }
 }
Beispiel #5
0
 private bool isAligment(CardAligment aligment)
 {
     if (state.cardAligment == CardAligment.All)
     {
         return(true);
     }
     if (state.cardAligment == aligment)
     {
         return(true);
     }
     return(false);
 }
Beispiel #6
0
    /// <summary>
    /// カードの陣営フィルタ
    /// </summary>
    /// <param name="num"></param>
    public void Filter_Aligment(int num)
    {
        filter_Aligment_Buttons[(int)filter_Aligment].GetComponent <Image>().color = Color.white;
        filter_Aligment_Buttons[num].GetComponent <Image>().color = Color.black;
        CardAligment aligment = (CardAligment)Enum.ToObject(typeof(CardAligment), num);

        if (filter_Aligment == aligment)
        {
            return;
        }
        filter_Aligment = aligment;
        //FilterChange();
    }
Beispiel #7
0
    void Update()
    {
        if (player.cardAligment == CardAligment.None || player.cardAligment == CardAligment.All)
        {
            return;
        }

        if (atk != player.AttackPower)
        {
            if (player.AttackPower > atk)
            {
                StartCoroutine(Constants.ANIMATION_EFFECT.EffectStart(UpEffect, atkEffectPos.gameObject));
            }
            else if (player.AttackPower < atk)
            {
                StartCoroutine(Constants.ANIMATION_EFFECT.EffectStart(DownEffect, atkEffectPos.gameObject));
            }
            atkText.text = (atk = player.AttackPower).ToString();
        }
        if (skill != player.SkillDamage)
        {
            if (player.SkillDamage > skill)
            {
                StartCoroutine(Constants.ANIMATION_EFFECT.EffectStart(UpEffect, skillEffectPos.gameObject));
            }
            else if (player.SkillDamage < skill)
            {
                StartCoroutine(Constants.ANIMATION_EFFECT.EffectStart(DownEffect, skillEffectPos.gameObject));
            }
            skillText.text = (skill = player.SkillDamage).ToString();
        }
        if (life != player.Life && lifeText != null)
        {
            lifeText.text = (life = player.GetLifeZone().GetCardsCount()).ToString();
        }

        if (player.cardAligment != aligment)
        {
            aligment = player.cardAligment;
            if (player.cardAligment == CardAligment.SowrdMan)
            {
                lifeText        = lifeText_s;
                lifeText_m.text = "";
            }
            else if (player.cardAligment == CardAligment.Magician)
            {
                lifeText        = lifeText_m;
                lifeText_s.text = "";
            }
        }
    }
    //プレイヤーの陣営決定 *a版用に1pだけ任意決定、2pは選ばれなかった方になる
    public void AligmentEnter(CardAligment aligment)
    {
        Players[0].cardAligment = aligment;
        if (aligment == CardAligment.Magician)
        {
            Players[1].cardAligment = CardAligment.SowrdMan;
        }
        else
        {
            Players[1].cardAligment = CardAligment.Magician;
        }

        AligmentButton.aligment.AligmentEnter();
        CoinTosStart();
    }
Beispiel #9
0
 /// <summary>
 /// フィルタ&ソートのBoxの表示を切り替える処理
 /// </summary>
 /// <param name="isActive"></param>
 public void Filter_Sort_Button(bool isActive)
 {
     FilterBox.SetActive(isActive);
     if (isActive)
     {
         def_Aligment = filter_Aligment;
         def_CardType = new List <ObjectType>(filter_CardType);
     }
     else
     {
         Filter_Aligment((int)def_Aligment);
         Filter_CardType(0);
         foreach (ObjectType t in def_CardType)
         {
             Filter_CardType((int)t, true);
         }
     }
 }
Beispiel #10
0
 void Update()
 {
     if (player.cardAligment != oldAl)
     {
         image.color = new Color(1, 1, 1, 1);
         oldAl       = player.cardAligment;
         if (oldAl == CardAligment.Magician)
         {
             image.sprite = Resources.Load <Sprite>(Constants.PLAYERSTATE_ALIGMENT_MAGICK);
             text.text    = Constants.M_NAME;
         }
         else if (oldAl == CardAligment.SowrdMan)
         {
             image.sprite = Resources.Load <Sprite>(Constants.PLAYERSTATE_ALIGMENT_SOWRD);
             text.text    = Constants.S_NAME;
         }
     }
 }
Beispiel #11
0
    public void AligmentUpdate(CardAligment aligment)
    {
        Sprite sprite = null;

        if (aligment == CardAligment.SowrdMan)
        {
            sprite = Resources.Load <Sprite>(Constants.SUPPORTZONE_ALIGMENT_SOWRD);
        }
        else if (aligment == CardAligment.Magician)
        {
            sprite = Resources.Load <Sprite>(Constants.SUPPORTZONE_ALIGMENT_MAGICK);
        }
        Image image = GetComponent <Image>();

        if (image)
        {
            image.sprite = sprite;
            image.SetNativeSize();
        }
    }
Beispiel #12
0
 //渡されたList<GameObject>tに<Player>pの陣営の対象となりうるオブジェクトを格納して返す
 private void FindTargets(Player p, List <GameObject> targets, CardAligment aligment = CardAligment.All)
 {
     foreach (CardZoneType zone in targetZone)
     {
         CardZone zoneObj = Constants.BATTLE.GetCardZone(zone, p);
         if (zone == CardZoneType.Deck)
         {
             continue;
         }
         foreach (ObjectType objT in targetObjectType)
         {
             zoneObj.FindCardType(objT, targets, aligment);
         }
     }
     foreach (ObjectType t in targetObjectType)
     {
         if (t == ObjectType.Player)
         {
             targets.Add(p.gameObject);
         }
     }
 }
Beispiel #13
0
 //Listでない初期化子のみ
 public Target(TargetType targetType, CardZoneType targetZone, ObjectType targetObjectType, bool isAll = true, CardAligment targetAligment = CardAligment.All)
 {
     this.targetType = targetType; this.targetZone.Add(targetZone); this.targetObjectType.Add(targetObjectType); this.isAll = isAll; this.targetAligment = targetAligment;
 }
Beispiel #14
0
 public virtual bool isPlay(int haveCost, CardAligment aligment = CardAligment.All)
 {
     return(isAligment(aligment) && haveCost >= state.Cost);
 }
Beispiel #15
0
 //セットは使用コスト0、場が空いているかのみ確認
 public override bool isPlay(int haveCost, CardAligment aligment = CardAligment.All)
 {
     return(Constants.BATTLE.FindCardPlayZone(this, Constants.BATTLE.FindCardHolder(this)).isAddCard());
 }
Beispiel #16
0
 //Listの初期化子あり
 public Target(TargetType targetType, List <CardZoneType> targetZone, List <ObjectType> targetObjectType, bool isAll = true, CardAligment targetAligment = CardAligment.All)
 {
     this.targetType = targetType; this.targetZone = targetZone; this.targetObjectType = targetObjectType; this.isAll = isAll; this.targetAligment = targetAligment;
 }
Beispiel #17
0
 /// <summary>
 /// 使用条件に適合する属性ならtrue、それ以外ならfalseを返す
 /// </summary>
 /// <param name="aligment"></param>
 /// <returns></returns>
 public bool AligmentCheck(CardAligment aligment)
 {
     return(!(_cardAligment == (aligment == CardAligment.SowrdMan ? CardAligment.Magician : CardAligment.SowrdMan)));
 }