コード例 #1
0
        public static float[] propertyType(MonsterAttribute att)
        {
            float[] result = new float[3];
            int     pro    = (int)att;

            if (pro >= (int)MonsterAttribute.GOLDEN && pro <= (int)MonsterAttribute.FIRE)
            {
                result[0] = proNormal;
                result[1] = proNormalKill;
                result[2] = proNormalBeKill;
            }
            else if (pro >= (int)MonsterAttribute.GOLDEN_S && pro <= (int)MonsterAttribute.FIRE_S)
            {
                result[0] = proSuper;
                result[1] = proSuperKill;
                result[2] = proSuperBeKill;
            }
            else if (pro == (int)MonsterAttribute.ALL)
            {
                result[0] = proTypeAll;
                result[1] = proAllKill;
                result[2] = 1;
            }

            return(result);
        }
コード例 #2
0
        // TODO: 变为全属性 (ok)
        public bool castPropertyChangeToAll(MonsterAttribute curPro)
        {
            BT_Logical war = owner._war;

            bool change = false;

            if (opObj.ID == 29 && canCastSkillOpDefault())
            {
                if (curPro != MonsterAttribute.ALL)
                {
                    change = true;

                    BT_MonsterTeam selfTeam = owner.ownerTeam;
                    if (selfTeam.getTeamName == "Att")
                    {
                        war._AoYiCastCount_Att = 1;
                    }
                    else
                    {
                        war._AoYiCastCount_Def = 1;
                    }

                    CMsgSkillCast msg = new CMsgSkillCast(this, CMsgSkillCast.categoryPropertyChangeToAll);
                    war.addMsgToRecorder(msg);
                }
                else
                {
                    if (real == 1)
                    {
                        war.resetAoYi(this, owner.ownerTeam);
                    }
                }
            }
            return(change);
        }
コード例 #3
0
ファイル: Card3DUI.cs プロジェクト: mengtest/DragonBallNew
    public void Del3DModel()
    {
        if (mShowOne != null)
        {
            previouNum   = 0;
            previousAttr = MonsterAttribute.DEFAULT_NO;
            mShowOne.DeleteSelf();
            mShowOne = null;
        }
        if (CradSystemFx.GetInstance()._CRLuo_Rot_Inversion != null)
        {
            CradSystemFx.GetInstance()._CRLuo_Rot_Inversion.InputOBJ = null;
        }

        if (CradSystemFx.GetInstance()._CRLuo_ShowStage != null)
        {
            CradSystemFx.GetInstance()._CRLuo_ShowStage.DeleteSelf();
        }
        m_data = null;

        if (m_Animator.GetFloat("Time") >= 10.0f)
        {
            m_Animator.SetFloat("aa", 0.0f);
            m_Animator.SetFloat("Time", 0.0f);
            m_Animator.SetFloat("Reset", 20.0f);
        }
        else
        {
            m_Animator.SetFloat("aa", 20.0f);
            m_Animator.SetFloat("Time", 0.0f);
            m_Animator.SetFloat("Reset", 0.0f);
        }
    }
コード例 #4
0
ファイル: MonsterCard.cs プロジェクト: Thyerry/Yugioh-CRUD
 public MonsterCard(string _nome, int atkValue, int defValue, int level, MonsterType tipo, MonsterAttribute atributo) : base(_nome)
 {
     this._atkValue  = atkValue;
     this._defValue  = defValue;
     this._level     = level;
     this._type      = tipo;
     this._attribute = atributo;
 }
コード例 #5
0
 public Monster(MonsterAttribute attribute, int attack, int defence, int level, string infoText, string pathToImage)
     : base(infoText, pathToImage)
 {
     this.Attack    = attack;
     this.Defence   = defence;
     this.Level     = level;
     this.Attribute = attribute;
 }
コード例 #6
0
 public Monster(int countStars, double atk, double def, MonsterType mType, MonsterAttribute mAttribute,
                string name, string des, bool front, bool back, Image art) : base(name, des, front, back, art)
 {
     this.stars         = countStars;
     this.attackPoints  = atk;
     this.defensePoints = def;
     this.type          = mType;
     this.attribute     = mAttribute;
 }
コード例 #7
0
 public void del3DModel()
 {
     if (mShowOne != null)
     {
         previouNum   = 0;
         previousAttr = MonsterAttribute.DEFAULT_NO;
         mShowOne.DeleteSelf();
         mShowOne = null;
     }
 }
コード例 #8
0
ファイル: BT_Monster.cs プロジェクト: mengtest/DragonBallNew
 //属性变为全
 public bool shouldCastPropertyChangeToAll()
 {
     foreach (BT_Skill sk in _nskillArr)
     {
         if (sk != null && sk.castPropertyChangeToAll(_property))
         {
             _property = MonsterAttribute.ALL;
             return(true);
         }
     }
     return(false);
 }
コード例 #9
0
    //
    public List <Monster> GetHechengMon(int star, int num, MonsterAttribute attr)
    {
        List <Monster> list = new List <Monster>();

        foreach (KeyValuePair <int, Monster> itor in mBagOfMonster)
        {
            if (itor.Value.num == num && itor.Value.RTData.Attribute == attr && !itor.Value.inTeam && itor.Value.Star == star)
            {
                list.Add(itor.Value);
            }
        }
        return(list);
    }
コード例 #10
0
ファイル: BT_Monster.cs プロジェクト: mengtest/DragonBallNew
        //复活.
        public void revive()
        {
            if (alive)
            {
                ConsoleEx.DebugLog("Monster is alive. Don't need to revive.");
            }

            _isAlive = true;
            _lastLun = 0;
            setCurAtt(_finalAtt);
            //设置为初始的属性
            _property = _initProperty;
        }
コード例 #11
0
 void show3DModel(int num, MonsterAttribute attri, bool AllFated)
 {
     if (mShowOne == null)
     {
         mShowOne         = CreateMonsterComeShowStage();
         mShowOne.Try_key = false;
     }
     RED.SetActive(true, mShowOne.gameObject);
     if (previouNum != num || attri != previousAttr)
     {
         mShowOne.ShowCharactor(num, attri, AllFated);
         previouNum   = num;
         previousAttr = attri;
     }
 }
コード例 #12
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Obstacle") || other.CompareTag("Monster"))
     {
         Destroy(gameObject);
         //this.gameObject.SetActive(false);
         //this.gameObject.transform.parent = FindObjectOfType<PoolManager>().transform;
     }
     if (other.CompareTag("Monster"))
     {
         GameObject       hit_monster = other.gameObject;
         MonsterAttribute stat        = hit_monster.GetComponent <MonsterAttribute>();
         stat.GetHit();
         Destroy(gameObject);
     }
 }
コード例 #13
0
ファイル: MonsterCard.cs プロジェクト: mwoyden/Yugioh
        public MonsterCard()
        {
            // super fields
            name     = "no name";
            cardText = "no text";

            // member fields
            attack            = 0;
            defense           = 0;
            effect            = false;
            canAttack         = true;
            canAttackDirectly = false;
            canChangePosition = false;
            stars             = 0;
            monsterType       = MonsterType.NONE;
            subType           = MonsterSubType.NONE;
            attribute         = MonsterAttribute.NONE;
            mode = MonsterPosition.NONE;
        }
コード例 #14
0
        private void UpdateFilters(object sender, EventArgs e)
        {
            TitleOnly       = TitleOnly_CheckBox.IsChecked.Value;
            DescriptionOnly = DescriptionOnly_CheckBox.IsChecked.Value;
            ExactWords      = ExactWords_CheckBox.IsChecked.Value;
            SortAlpha       = (Sorting_ComboBox.SelectedIndex == 0);
            SearchArchetype = SearchArchetype_CheckBox.IsChecked.Value;
            UseGOATFormat   = UseGoatFormat.IsChecked;

            ChosenCardType         = Helper.GetSelection <CardType>(CardType_ComboBox.SelectedIndex);
            ChosenMonsterCardType  = Helper.GetSelection <MonsterCardType>(MonsterCardType_ComboBox.SelectedIndex);
            ChosenMonsterAttribute = Helper.GetSelection <MonsterAttribute>(MonsterAttribute_ComboBox.SelectedIndex);
            ChosenMonsterType      = Helper.GetSelection <MonsterType>(MonsterType_ComboBox.SelectedIndex);
            ChosenMonster2ndType   = Helper.GetSelection <Monster2ndType>(Monster2ndType_ComboBox.SelectedIndex);
            ChosenSpellType        = Helper.GetSelection <SpellType>(SpellType_ComboBox.SelectedIndex);
            ChosenTrapType         = Helper.GetSelection <TrapType>(TrapType_ComboBox.SelectedIndex);

            LvlMin           = (LvlMin_TextBox.Text == "") ? -1 : int.Parse(LvlMin_TextBox.Text);
            LvlMax           = (LvlMax_TextBox.Text == "") ? -1 : int.Parse(LvlMax_TextBox.Text);
            AtkMin           = (AtkMin_TextBox.Text == "") ? -1 : int.Parse(AtkMin_TextBox.Text);
            AtkMax           = (AtkMax_TextBox.Text == "") ? -1 : int.Parse(AtkMax_TextBox.Text);
            DefMin           = (DefMin_TextBox.Text == "") ? -1 : int.Parse(DefMin_TextBox.Text);
            DefMax           = (DefMax_TextBox.Text == "") ? -1 : int.Parse(DefMax_TextBox.Text);
            PendulumScaleMin = (PendulumScalesMin_TextBox.Text == "") ? -1 : int.Parse(PendulumScalesMin_TextBox.Text);
            PendulumScaleMax = (PendulumScalesMax_TextBox.Text == "") ? -1 : int.Parse(PendulumScalesMax_TextBox.Text);

            CardLimitation = Limit_ComboBox.SelectedIndex - 1;

            MonsterCardType_ComboBox.Visibility    = Helper.CardTypeIsOfType(ChosenCardType, CardType.MONSTER) ? Visibility.Visible : Visibility.Collapsed;
            MonsterType_WrapPanel.Visibility       = Helper.CardTypeIsOfType(ChosenCardType, CardType.MONSTER) ? Visibility.Visible : Visibility.Collapsed;
            MonsterAttributes_WrapPanel.Visibility = Helper.CardTypeIsOfType(ChosenCardType, CardType.MONSTER) ? Visibility.Visible : Visibility.Collapsed;
            SpellType_WrapPanel.Visibility         = Helper.CardTypeIsOfType(ChosenCardType, CardType.SPELL) ? Visibility.Visible : Visibility.Collapsed;
            TrapType_WrapPanel.Visibility          = Helper.CardTypeIsOfType(ChosenCardType, CardType.TRAP) ? Visibility.Visible : Visibility.Collapsed;
            PendulumScales_WrapPanel.Visibility    = ChosenMonster2ndType.HasFlag(Monster2ndType.PENDULUM) ? Visibility.Visible : Visibility.Collapsed;

            if (CardType_ComboBox.SelectedIndex == 0)
            {
                ResetFilters(null, null);
            }

            UpdateDeck();
        }
コード例 #15
0
ファイル: BanTools.cs プロジェクト: mengtest/DragonBallNew
    public static BanBattleRole.Attribute TransAttributeType(MonsterAttribute attribute)
    {
        switch (attribute)
        {
        case MonsterAttribute.GOLDEN:
            return(BanBattleRole.Attribute.Jin);

        case MonsterAttribute.GOLDEN_S:
            return(BanBattleRole.Attribute.SJin);

        case MonsterAttribute.WOOD:
            return(BanBattleRole.Attribute.Mu);

        case MonsterAttribute.WOOD_S:
            return(BanBattleRole.Attribute.SMu);

        case MonsterAttribute.WATER:
            return(BanBattleRole.Attribute.Shui);

        case MonsterAttribute.WATER_S:
            return(BanBattleRole.Attribute.SShui);

        case MonsterAttribute.FIRE:
            return(BanBattleRole.Attribute.Huo);

        case MonsterAttribute.FIRE_S:
            return(BanBattleRole.Attribute.SHuo);

        case MonsterAttribute.SOIL:
            return(BanBattleRole.Attribute.Tu);

        case MonsterAttribute.SOIL_S:
            return(BanBattleRole.Attribute.STu);

        case MonsterAttribute.ALL:
            return(BanBattleRole.Attribute.Quan);

        default:
            Debug.LogWarning("Unknown" + attribute);
            return(BanBattleRole.Attribute.Unknown);
        }
    }
コード例 #16
0
    //    public MonsterAttribute monsterAttribute;

//    clone = Instantiate(projectile, transform.position, transform.rotation);

    // Use this for initialization
    void Start()
    {
        atkLabel.text         = atk.ToString();
        defLabel.text         = def.ToString();
        nameLabel.text        = name;
        codeCardLabel.text    = codeCard.ToString();
        desLabel.text         = des;
        monsterTypeLabel.text = MonsterType.Machine.ToString();
        monsterAttribute      = MonsterAttribute.Earth;
        //atkLabel.text = atk.ToString();
        setAttributeOnCardLayout(monsterAttribute);

        for (int count = 0; count < lv; count++)
        {
            // To add Ui component to gridLayout, we just need to move component to grid and it will update automatically
            var clone = Instantiate(star, panel.transform);
            //star.GetComponent<Image>();
            //            panel.GetComponent<Image>().obj
        }
    }
コード例 #17
0
ファイル: BT_Monster.cs プロジェクト: mengtest/DragonBallNew
        public BT_Monster(Battle_Monster value, int pveIndex, BT_Logical war, BT_MonsterTeam selfTeam, BT_MonsterTeam enemyTeam)
        {
            //初始化 技能
            _nSkill    = new List <SkillObj>();
            _aSkill    = new List <SkillObj>();
            _nskillArr = new List <BT_Skill>();
            _askillArr = new List <BT_Skill>();

            //初始化 敌人ID
            _killEnemyId = new List <int>();
            //初始化 Buff & Debuff
            _buffArr   = new Dictionary <short, BT_BuffOrDebuff>();
            _debuffArr = new Dictionary <short, BT_BuffOrDebuff>();

            //初始化底层依赖
            skillMgr = Core.Data.skillManager;

            this._id       = value.petId;
            this._num      = value.petNum;
            this._property = (MonsterAttribute)value.property;
            _initProperty  = _property; //记住默认初始的属性,部分宠物可能会属性转换
            this._level    = value.lvl;
            this._finalAtt = value.finalAtt;
            _killCount     = 0;
            //缘配齐
            _fullFated = value.fullfated;
            _fateNuqi  = value.nuqi;
            float skillup = value.skillUp;    // 技能概率的提升

            this._isBoss = value.isBoss;      // 是否是boss
            //取出技能1,2,3
            //初始化宠物的技能信息
            parseSkill(value, skillup);

            _pveIndex  = pveIndex;
            _war       = war;
            _selfTeam  = selfTeam;
            _enemyTeam = enemyTeam;

            this.setCurAtt(_finalAtt);
        }
コード例 #18
0
ファイル: Card3DUI.cs プロジェクト: mengtest/DragonBallNew
    //-----------------change by jc 2014.12.12------------------
    //----要显示两张卡一样的卡牌,是不需要创建两次这个模型的,显示层显示同一个模型在不同的位置即可
    //--------------------------------------------------------------------
    void SetMonsterModel(CRLuo_ShowStage _mShowOne = null)
    {
        if (_mShowOne != null)
        {
            this.mShowOne = _mShowOne;
        }
        if (mShowOne == null)
        {
            mShowOne                      = InitCardFx();
            mShowOne.Try_key              = false;
            _CRLuo_Rot_Inversion          = mShowOne.GetComponent <CRLuo_Rot_Inversion>();
            _CRLuo_Rot_Inversion.InputOBJ = cardObj.gameObject;
        }
        if (previouNum != m_data.num || m_data.RTData.Attribute != previousAttr)
        {
            mShowOne.ShowCharactor(m_data.num, m_data.RTData.Attribute);
            previouNum   = m_data.num;
            previousAttr = m_data.RTData.Attribute;
        }
//		m_Animator.SetFloat ("aa", 20.0f);
    }
コード例 #19
0
    public void ShowCharactor(int ID, MonsterAttribute attri = MonsterAttribute.DEFAULT_NO, bool allFated = false)
    {
        //NewOBJ = true;
        this.attri     = attri;
        this.mAllFated = allFated;

        string prefabName = "pb" + ID;

        #if SPLIT_MODEL
        Object temp = ModelLoader.get3DModel(ID);
        if (temp != null)
        {
            AssetTask aTask = new AssetTask("pb" + ID, typeof(Object), FeatureShow);
            aTask.AppendCommonParam(ID, temp);
            FeatureShow(aTask);
        }
        else
        {
            if (Core.Data.sourceManager.IsModelExist(ID))
            {
                AssetTask aTask = new AssetTask(prefabName, typeof(Object), FeatureShow);
                aTask.AppendCommonParam(ID, null, AssetTask.loadType.Only_loadlocal);
                //再通过WWW加载
                aTask.DispatchToRealHandler();
            }
            else
            {
                Object    tempDefault = PrefabLoader.loadFromUnPack("CRLuo/pbXXX", false, false);
                AssetTask task        = new AssetTask(prefabName, typeof(Object), null);
                task.AppendCommonParam(ID, tempDefault);
                FeatureShow(task);
            }
        }
        #else
        Object    temp  = ModelLoader.get3DModel(ID);
        AssetTask aTask = new AssetTask(prefabName, typeof(Object), FeatureShow);
        aTask.AppendCommonParam(ID, temp);
        FeatureShow(aTask);
        #endif
    }
コード例 #20
0
        public static float[] propertyVs(MonsterAttribute pro1, MonsterAttribute pro2)
        {
            float[] result = new float[] { 1, 1 };

            float[] proArr1 = propertyType(pro1);
            float[] proArr2 = propertyType(pro2);
            if (pro1 == MonsterAttribute.ALL || pro2 == MonsterAttribute.ALL)
            {
                if (pro1 == MonsterAttribute.ALL && pro2 == MonsterAttribute.ALL)
                {
                    result = new float[] { proArr1[2], proArr2[2] }
                }
                ;
                else if (pro1 == MonsterAttribute.ALL)
                {
                    result = new float[] { proArr1[1], proArr2[2] }
                }
                ;
                else if (pro2 == MonsterAttribute.ALL)
                {
                    result = new float[] { proArr1[2], proArr2[1] }
                }
                ;
            }
            else
            {
                result = Vs(pro1, pro2);
                if (result[0] == 1 && result[1] == 1)
                {
                    result = Vs(pro2, pro1);

                    float temp = result[0];
                    result[0] = result[1];
                    result[1] = temp;
                }
            }
            return(result);
        }
コード例 #21
0
 void setAttributeOnCardLayout(MonsterAttribute attribute)
 {
     //feu
     //eau
     //vent
     //terre
     //lumière
     //tenebres
     //divin
     if (attribute == MonsterAttribute.Fire)
     {
         var cardAttribute = Instantiate(attributeArray[0], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Water)
     {
         var cardAttribute = Instantiate(attributeArray[1], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Wind)
     {
         var cardAttribute = Instantiate(attributeArray[2], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Earth)
     {
         var cardAttribute = Instantiate(attributeArray[3], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Light)
     {
         var cardAttribute = Instantiate(attributeArray[4], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Dark)
     {
         var cardAttribute = Instantiate(attributeArray[5], attributePanel.transform);
     }
     else if (attribute == MonsterAttribute.Divine)
     {
         var cardAttribute = Instantiate(attributeArray[6], attributePanel.transform);
     }
 }
コード例 #22
0
ファイル: TeamUI.cs プロジェクト: mengtest/DragonBallNew
    public void show3DModel(int num, MonsterAttribute attri, bool AllFated)
    {
        if (mShowOne == null)
        {
            mShowOne         = CRLuo_ShowStage.CreateShowStage();
            mShowOne.Try_key = false;
        }
        RED.SetActive(true, mShowOne.gameObject);

        if (previouNum != num || attri != previousAttr)
        {
            mShowOne.ShowCharactor(num, attri, AllFated);
            if (Core.Data.sourceManager.IsModelExist(num))
            {
                previouNum   = num;
                previousAttr = attri;
            }
            else
            {
                previouNum   = 0;
                previousAttr = MonsterAttribute.DEFAULT_NO;;
            }
        }
    }
コード例 #23
0
        static float[] Vs(MonsterAttribute pro1, MonsterAttribute pro2)
        {
            float[] result = new float[] { 1, 1 };

            if (pro1 == MonsterAttribute.GOLDEN && pro2 == MonsterAttribute.WOOD)
            {
                result = new float[] { proNormalKill, proNormalBeKill };
            }
            if (pro1 == MonsterAttribute.GOLDEN && pro2 == MonsterAttribute.WOOD_S)
            {
                result = new float[] { proNormalKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.WOOD && pro2 == MonsterAttribute.SOIL)
            {
                result = new float[] { proNormalKill, proNormalBeKill };
            }
            if (pro1 == MonsterAttribute.WOOD && pro2 == MonsterAttribute.SOIL_S)
            {
                result = new float[] { proNormalKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.SOIL && pro2 == MonsterAttribute.WATER)
            {
                result = new float[] { proNormalKill, proNormalBeKill };
            }
            if (pro1 == MonsterAttribute.SOIL && pro2 == MonsterAttribute.WATER_S)
            {
                result = new float[] { proNormalKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.WATER && pro2 == MonsterAttribute.FIRE)
            {
                result = new float[] { proNormalKill, proNormalBeKill };
            }
            if (pro1 == MonsterAttribute.WATER && pro2 == MonsterAttribute.FIRE_S)
            {
                result = new float[] { proNormalKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.FIRE && pro2 == MonsterAttribute.GOLDEN)
            {
                result = new float[] { proNormalKill, proNormalBeKill };
            }
            if (pro1 == MonsterAttribute.FIRE && pro2 == MonsterAttribute.GOLDEN_S)
            {
                result = new float[] { proNormalKill, proSuperBeKill };
            }


            if (pro1 == MonsterAttribute.GOLDEN_S && pro2 == MonsterAttribute.WOOD)
            {
                result = new float[] { proSuperKill, proNormalVsSuper };
            }
            if (pro1 == MonsterAttribute.GOLDEN_S && pro2 == MonsterAttribute.WOOD_S)
            {
                result = new float[] { proSuperKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.WOOD_S && pro2 == MonsterAttribute.SOIL)
            {
                result = new float[] { proSuperKill, proNormalVsSuper };
            }
            if (pro1 == MonsterAttribute.WOOD_S && pro2 == MonsterAttribute.SOIL_S)
            {
                result = new float[] { proSuperKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.SOIL_S && pro2 == MonsterAttribute.WATER)
            {
                result = new float[] { proSuperKill, proNormalVsSuper };
            }
            if (pro1 == MonsterAttribute.SOIL_S && pro2 == MonsterAttribute.WATER_S)
            {
                result = new float[] { proSuperKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.WATER_S && pro2 == MonsterAttribute.FIRE)
            {
                result = new float[] { proSuperKill, proNormalVsSuper };
            }
            if (pro1 == MonsterAttribute.WATER_S && pro2 == MonsterAttribute.FIRE_S)
            {
                result = new float[] { proSuperKill, proSuperBeKill };
            }
            if (pro1 == MonsterAttribute.FIRE_S && pro2 == MonsterAttribute.GOLDEN)
            {
                result = new float[] { proSuperKill, proNormalVsSuper };
            }
            if (pro1 == MonsterAttribute.FIRE_S && pro2 == MonsterAttribute.GOLDEN_S)
            {
                result = new float[] { proSuperKill, proSuperBeKill };
            }
            return(result);
        }
コード例 #24
0
ファイル: Card.cs プロジェクト: NhgrtPlayer/YGO_Searcher
        public Card(JToken Token, bool UseGoatFormat)
        {
            try
            {
                Id          = Token.Value <string>("id");
                Name        = Token.Value <string>("name");
                Description = Token.Value <string>("desc");
                Limitation  = Helper.GetLimitationByString(Token.Value <string>("ban_tcg"));
                if (UseGoatFormat)
                {
                    Limitation = Helper.GetLimitationByString(Token.Value <string>("ban_goat"));
                }

                Type     = Helper.GetCardTypeByString(Token.Value <string>("type"));
                DeckPart = DeckPart.MAIN_DECK;

                switch (Type)
                {
                case CardType.MONSTER:
                    MonsterCardType = Helper.GetMonsterCardTypeByString(Token.Value <string>("type"));
                    if (MonsterCardType == MonsterCardType.FUSION ||
                        MonsterCardType == MonsterCardType.SYNCHRO ||
                        MonsterCardType == MonsterCardType.XYZ ||
                        MonsterCardType == MonsterCardType.LINK)
                    {
                        DeckPart = DeckPart.EXTRA_DECK;
                    }
                    MonsterType      = Helper.GetMonsterTypeByString(Token.Value <string>("race"));
                    Monster2ndType   = Helper.GetMonster2ndCardTypeByString(Token.Value <string>("type"));
                    MonsterAttribute = Helper.GetMonsterAttributeByString(Token.Value <string>("attribute"));
                    Atk = Token.Value <int>("atk");
                    if (MonsterCardType != MonsterCardType.LINK)
                    {
                        Level = Token.Value <int>("level");
                        Def   = Token.Value <int>("def");
                        if (Monster2ndType == Monster2ndType.PENDULUM)
                        {
                            PendulumScale = Token.Value <int>("scale");
                        }
                    }
                    else
                    {
                        Level = Token.Value <int>("linkval");
                    }
                    break;

                case CardType.SPELL:
                    SpellType = Helper.GetSpellTypeByString(Token.Value <string>("race"));
                    break;

                case CardType.TRAP:
                    TrapType = Helper.GetTrapTypeByString(Token.Value <string>("race"));
                    break;

                default:
                    break;
                }

                this.ImgUrl      = Token.Value <string>("image_url");
                this.ImgUrlSmall = Token.Value <string>("image_url_small");
                this.Archetype   = Token.Value <string>("archetype");
            }
            catch (Exception e)
            {
            }
        }
コード例 #25
0
ファイル: Card.cs プロジェクト: NhgrtPlayer/YGO_Searcher
        public bool CheckCardCriteria(string UserInput,
                                      bool titleOnly,
                                      bool descriptionOnly,
                                      bool exactWords,
                                      bool SearchArchetype,
                                      CardType ChosenCardType,
                                      MonsterCardType ChosenMonsterCardType,
                                      MonsterAttribute ChosenMonsterAttribute,
                                      MonsterType ChosenMonsterType,
                                      Monster2ndType ChosenMonster2ndType,
                                      SpellType ChosenSpellType,
                                      TrapType ChosenTrapType,
                                      int LvlMin, int LvlMax,
                                      int AtkMin, int AtkMax,
                                      int DefMin, int DefMax,
                                      int PendulumScaleMin, int PendulumScaleMax,
                                      int CardLimitation)
        {
            bool ToReturn = ((ChosenCardType & Type) != 0);

            if (SearchArchetype && Archetype != null && ToReturn)
            {
                ToReturn |= Helper.CheckString(Archetype, UserInput);
            }

            if (titleOnly && !descriptionOnly)
            {
                ToReturn &= Helper.CheckString(Name, UserInput);
            }
            else if (descriptionOnly && !titleOnly)
            {
                ToReturn &= Helper.CheckString(Description, UserInput);
            }
            else
            {
                ToReturn &= (Helper.CheckString(Name, UserInput) || Helper.CheckString(Description, UserInput));
            }

            switch (Type)
            {
            case CardType.MONSTER:
                ToReturn &= ((ChosenMonsterCardType & MonsterCardType) != 0);
                ToReturn &= ((ChosenMonsterAttribute & MonsterAttribute) != 0);
                ToReturn &= ((ChosenMonsterType & MonsterType) != 0);
                ToReturn &= ((ChosenMonster2ndType & Monster2ndType) != 0 || (int)ChosenMonster2ndType == (1 << 8) - 1);
                if (LvlMin >= 0)
                {
                    ToReturn &= (LvlMin <= Level);
                }
                if (LvlMax >= 0)
                {
                    ToReturn &= (Level <= LvlMax);
                }
                if (AtkMin >= 0)
                {
                    ToReturn &= (AtkMin <= Atk);
                }
                if (AtkMax >= 0)
                {
                    ToReturn &= (Atk <= AtkMax);
                }
                if (DefMin >= 0)
                {
                    ToReturn &= (DefMin <= Def);
                }
                if (DefMax >= 0)
                {
                    ToReturn &= (Def <= DefMax);
                }
                if (Monster2ndType.HasFlag(Monster2ndType.PENDULUM) && PendulumScaleMin >= 0)
                {
                    ToReturn &= (PendulumScaleMin <= PendulumScale);
                }
                if (Monster2ndType.HasFlag(Monster2ndType.PENDULUM) && PendulumScaleMax >= 0)
                {
                    ToReturn &= (PendulumScale <= PendulumScaleMax);
                }
                break;

            case CardType.SPELL:
                ToReturn &= ((ChosenSpellType & SpellType) != 0);
                break;

            case CardType.TRAP:
                ToReturn &= ((ChosenTrapType & TrapType) != 0);
                break;

            default:
                return(false);
            }
            if (CardLimitation >= 0)
            {
                ToReturn &= (Limitation == CardLimitation);
            }
            return(ToReturn);
        }
コード例 #26
0
 public void Start()
 {
     RandomChangeTarget();
     monsterAttribute = this.GetComponent <MonsterAttribute>();
 }
コード例 #27
0
        private List <Cards> MenuAddMonstro(List <Cards> cartas)
        {
            try {
                Console.Clear();
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("MONSTRO\n");
                Console.ResetColor();
                Console.Write("Nome: ");
                string nome = Console.ReadLine();
                if (cartas.Find(card => card.Nome.Equals(nome)) != null)
                {
                    throw new Exception("Já existe uma Carta com esse nome!");
                }

                Console.Write("Ataque: ");
                int atk = Convert.ToInt32(Console.ReadLine());

                Console.Write("Defesa: ");
                int def = Convert.ToInt32(Console.ReadLine());

                Console.WriteLine(MostraTipos());
                MonsterType tipo = (MonsterType)Convert.ToInt32(Console.ReadLine());
                if ((int)tipo < 1 || (int)tipo > 25)
                {
                    throw new FormatException("Tipo Inválido!");
                }

                Console.WriteLine("Atributo: ");
                Console.WriteLine("1 - Luz");
                Console.WriteLine("2 - Trevas");
                Console.WriteLine("3 - Água");
                Console.WriteLine("4 - Terra");
                Console.WriteLine("5 - Fogo");
                Console.WriteLine("6 - Vento");
                Console.WriteLine("7 - Divino");
                MonsterAttribute atributo = (MonsterAttribute)Convert.ToInt32(Console.ReadLine());
                if ((int)atributo < 1 || (int)atributo > 7)
                {
                    throw new FormatException("Atributo Inválido!");
                }

                Console.WriteLine("Level (1-12): ");
                int lvl = Convert.ToInt32(Console.ReadLine());
                if (lvl < 1 || lvl > 12)
                {
                    throw new FormatException("Valor de Level Inválido!\nO level do monstro deve ser um numero entre 1 e 12!");
                }

                MonsterCard monster = new MonsterCard(nome, atk, def, lvl, tipo, atributo);
                cartas.Add(monster);
            }
            catch (Exception e) {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine(e.Message);
                Console.ReadKey();
                Console.ResetColor();
                MenuAddMonstro(cartas);
            }

            return(cartas);
        }
コード例 #28
0
        public static string ToString(MonsterCardType MonsterCardType, MonsterType MonsterType, Monster2ndType Monster2ndType, MonsterAttribute MonsterAttribute)
        {
            string ToReturn = "";

            if (Enum.IsDefined(MonsterAttribute.GetType(), MonsterAttribute))
            {
                ToReturn += '[' + MonsterAttribute.ToString() + "] ";
            }

            switch (MonsterType)
            {
            case MonsterType.AQUA:
                ToReturn += "Aqua";
                break;

            case MonsterType.BEAST:
                ToReturn += "Beast";
                break;

            case MonsterType.BEAST_WARRIOR:
                ToReturn += "Beast-Warrior";
                break;

            case MonsterType.CREATOR_GOD:
                ToReturn += "Creator-God";
                break;

            case MonsterType.CYBERSE:
                ToReturn += "Cyberse";
                break;

            case MonsterType.DINOSAUR:
                ToReturn += "Dinosaur";
                break;

            case MonsterType.DIVINE_BEAST:
                ToReturn += "Divine-Beast";
                break;

            case MonsterType.DRAGON:
                ToReturn += "Dragon";
                break;

            case MonsterType.FAIRY:
                ToReturn += "Fairy";
                break;

            case MonsterType.FIEND:
                ToReturn += "Fiend";
                break;

            case MonsterType.FISH:
                ToReturn += "Fish";
                break;

            case MonsterType.INSECT:
                ToReturn += "Insect";
                break;

            case MonsterType.MACHINE:
                ToReturn += "Machine";
                break;

            case MonsterType.PLANT:
                ToReturn += "Plant";
                break;

            case MonsterType.PSYCHIC:
                ToReturn += "Psychic";
                break;

            case MonsterType.PYRO:
                ToReturn += "Pyro";
                break;

            case MonsterType.REPTILE:
                ToReturn += "Reptile";
                break;

            case MonsterType.ROCK:
                ToReturn += "Rock";
                break;

            case MonsterType.SEA_SERPENT:
                ToReturn += "Sea Serpent";
                break;

            case MonsterType.SPELLCASTER:
                ToReturn += "Spellcaster";
                break;

            case MonsterType.THUNDER:
                ToReturn += "Thunder";
                break;

            case MonsterType.WARRIOR:
                ToReturn += "Warrior";
                break;

            case MonsterType.WINGED_BEAST:
                ToReturn += "Winged-Beast";
                break;

            case MonsterType.WYRM:
                ToReturn += "Wyrm";
                break;

            case MonsterType.ZOMBIE:
                ToReturn += "Zombie";
                break;

            default:
                return("");
            }

            switch (Monster2ndType)
            {
            case Monster2ndType.FLIP:
                ToReturn += "/Flip";
                break;

            case Monster2ndType.GEMINI:
                ToReturn += "/Gemini";
                break;

            case Monster2ndType.PENDULUM:
                ToReturn += "/Pendulum";
                break;

            case Monster2ndType.SPIRIT:
                ToReturn += "/Spirit";
                break;

            case Monster2ndType.TOON:
                ToReturn += "/Toon";
                break;

            case Monster2ndType.TUNER:
                ToReturn += "/Tuner";
                break;

            case Monster2ndType.UNION:
                ToReturn += "/Union";
                break;
            }

            switch (MonsterCardType)
            {
            case MonsterCardType.NORMAL:
                ToReturn += "/Normal";
                break;

            case MonsterCardType.EFFECT:
                ToReturn += "/Effect";
                break;

            case MonsterCardType.RITUAL:
                ToReturn += "/Ritual";
                break;

            case MonsterCardType.FUSION:
                ToReturn += "/Fusion";
                break;

            case MonsterCardType.SYNCHRO:
                ToReturn += "/Synchro";
                break;

            case MonsterCardType.XYZ:
                ToReturn += "/Xyz";
                break;

            case MonsterCardType.LINK:
                ToReturn += "/Link";
                break;
            }

            return(ToReturn);
        }