當前位置: 首頁>>代碼示例>>C#>>正文


C# Character.getEquipment方法代碼示例

本文整理匯總了C#中Character.getEquipment方法的典型用法代碼示例。如果您正苦於以下問題:C# Character.getEquipment方法的具體用法?C# Character.getEquipment怎麽用?C# Character.getEquipment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Character的用法示例。


在下文中一共展示了Character.getEquipment方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: canCastSkill

        public bool canCastSkill(Character ch, int id)
        {
            if(!this.skills.ContainsKey(id))
            {
                Console.WriteLine("no key");
                return false;
            }

            if(!this.skills[id].getIsCastable())
            {
                Console.WriteLine("Cannot cast skill [not castable]");
                return false;
            }

            SkillData skill = skills[id];

            if(skill.getLvl()>ch.getLevel()){
                Console.WriteLine("Cannot cast skill [lvl too low]");
                return false;
            }
            if(skill.getFaction()!=0 && skill.getFaction()!=ch.getFaction()){
                Console.WriteLine("Cannot cast skill [wrong faction]");
                return false;
            }
            if(skill.getNeedsWepToCast()!=46 && skill.getNeedsWepToCast()!=0 &&
            (!ch.getEquipment().getEquipments().ContainsKey(7) ||
            (skill.getNeedsWepToCast()!=55 && skill.getNeedsWepToCast()!=45 && ItemDataCache.Instance.getItemData(ch.getEquipment().getEquipments()[7].getItemID()).getCategory()!=skill.getNeedsWepToCast()))){
                Console.WriteLine("Cannot cast skill [you do not have the req wep]");
                return false;
            }
            if(skill.getManaCost()>ch.getCurMP()){
                Console.WriteLine("Cannot cast skill [not enough mana]");
                return false;
            }
            if(skill.getStaminaCost()>ch.getCurSP()){
                Console.WriteLine("Cannot cast skill [not enough stamina]");
                return false;
            }
            if(skill.getUltiSetID()!=0 && !ch.getEquipment().getFullSets().ContainsKey(skill.getUltiSetID())){
                Console.WriteLine("Cannot cast skill [you do not have the req set]");
                return false;
            }
            return true;
        }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:44,代碼來源:SkillDataCache.cs

示例2: getSkillIDFromCast

        public int getSkillIDFromCast(Character ch, byte decrypted)
        {
            int skillIDInt = 0;
            int key=(int) decrypted;
            if(key <= ch.getSkills().getLearnedSkills().Count){
                skillIDInt = ch.getSkills().getLearnedSkills()[key];
            }else{
                if(decrypted==(byte)0xFF){
                    if(ch.getEquipment().getEquipments().ContainsKey(7))
                        skillIDInt = woodenSkills[ch.getcClass()];
                    else
                        skillIDInt = knockSkills[ch.getcClass()];
                }else{
                    Console.WriteLine("Cannot cast skill [skill not learned]");
                }
            }

            return skillIDInt;
        }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:19,代碼來源:SkillDataCache.cs

示例3: calculateCharacterStatistics

        public static void calculateCharacterStatistics(Character chr)
        {
            Boolean[] pureHeal = new Boolean[] { chr.getCurHP() == chr.getMaxHP(), chr.getCurMP() == chr.getMaxMP(), chr.getCurSP() == chr.getMaxSP() };

            chr.getEquipment().calculateEquipStats();

            short bonusMaxhp = 0;
            //if(bonusAttributes.containsKey("maxhp"))
            //	bonusMaxhp = (Short)bonusAttributes.get("maxhp");

            short bonusDmg = 0;
            //if(bonusAttributes.containsKey("bonusDmg"))
            //	bonusDmg = (Short)bonusAttributes.get("bonusDmg");

            short bonusAtkSucces = 0;
            //if(bonusAttributes.containsKey("bonusAtkSucces"))
            //	bonusAtkSucces = (Short)bonusAttributes.get("bonusAtkSucces");

            short[] stats = new short[5];
            short[] eqstats = chr.getEquipment().getStats();
            for(int i = 0;i < 5;i++)
            {
                stats[i] = (short)(chr.getCStats()[i] + eqstats[i]);
            }
            chr.setMaxHP((int)(30 + bonusMaxhp + chr.getEquipment().getHp() + stats[0] * 2.2 + stats[1] * 2.4 + stats[2] * 2.5 + stats[3] * 1.6 + stats[4] * 1.5));
            chr.setMaxMP((short)(30 + chr.getEquipment().getMana() + stats[0] * 1.4 + stats[1] * 1.7 + stats[2] * 1.5 + stats[3] * 3.5 + stats[4] * 1.5));
            chr.setMaxSP((short)(30 + chr.getEquipment().getStamina() + stats[0] * 0.9 + stats[1] * 1.3 + stats[2] * 1.5 + stats[3] * 1.7 + stats[4] * 1.3));
            chr.setRegHP((short)(stats[2] / 2 + stats[0] / 4));
            chr.setRegMP((short)(stats[3] / 2 + stats[1] / 4));
            chr.setRegSP((short)(stats[4] * 0.1));
            chr.setAtk((int)(chr.getLevel() / 2 + chr.getEquipment().getAtk() + stats[0] * 0.53 + stats[1] * 0.5 + stats[2] * 0.44 + stats[3] * 0.25 + stats[4] * 0.25)
                + chr.getEquipment().getMaxDmg());
            chr.setDef((int)(chr.getLevel() / 2 + chr.getEquipment().getDeff() + stats[0] * 0.28 + stats[1] * 0.3 + stats[2] * 0.53 + stats[3] * 0.22 + stats[4] * 0.42));
            chr.setMinDmg((int)(bonusDmg + chr.getEquipment().getMinDmg()));
            chr.setMaxDmg((int)(bonusDmg + chr.getEquipment().getMaxDmg()));
            chr.setBasicAtkSuc((int)(stats[0] * 0.5 + stats[1] * 0.6 + stats[2] * 0.3 + stats[3] * 1 + stats[4] * 0.8 + chr.getLevel() * 6));
            chr.setBasicDefSuc((int)(stats[0] * 0.2 + stats[1] * 0.2 + stats[2] * 0.5 + stats[3] * 0.7 + stats[4] * 0.6 + chr.getLevel() * 4));
            chr.setBasicCritRate((int)(stats[0] * 0.1 + stats[1] * 1 + stats[2] * 0.1 + stats[3] * 0.5 + stats[4] * 0.3 + chr.getLevel() * 2) - 300);
            chr.setAdditionalAtkSuc(1000 + bonusAtkSucces);
            chr.setAdditionalDefSuc(500);
            chr.setAdditionalCritRate(2000);
            float atkSucMul = chr.getEquipment().getAtkSucMul();
            float defSucMul = chr.getEquipment().getDefSucMul();
            float critRateMul = chr.getEquipment().getCritRateMul();
            chr.setAtkSuc((int)(chr.getBasicAtkSuc() + chr.getAdditionalAtkSuc() * atkSucMul));
            chr.setDefSuc((int)(chr.getBasicDefSuc() + chr.getAdditionalDefSuc() * defSucMul));
            chr.setCritRate((int)(chr.getBasicCritRate() + chr.getAdditionalCritRate() * critRateMul));
            chr.setCritDmg((short)(chr.getEquipment().getCritDmg() + stats[1] - 10));

            if(chr.getCurHP() > chr.getMaxHP())
                chr.setCurHP(chr.getMaxHP());
            if(chr.getCurMP() > chr.getMaxMP())
                chr.setCurMP(chr.getMaxMP());
            if(chr.getCurSP() > chr.getMaxSP())
                chr.setCurSP(chr.getMaxSP());

            if(chr.getAccount().activeCharacter != null)
            {
                if(chr.getAccount().activeCharacter == chr)
                {
                    StaticPackets.releaseHealPacket(chr, pureHeal[0] ? chr.getMaxHP() : chr.getCurHP(),
                        pureHeal[1] ? chr.getMaxMP() : chr.getCurMP(),
                            pureHeal[2] ? chr.getMaxSP() : chr.getCurSP());
                }
            }

            Console.WriteLine("{0} {1}", chr.getAtk(), chr.getDef());
        }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:68,代碼來源:CharacterFunctions.cs

示例4: createEquipments

        public static int createEquipments(Character chr)
        {
            switch(chr.getcClass())
            {
                case 1:
                {
                    chr.getEquipment().getEquipments().Add(0, new Item(210110101));
                    chr.getEquipment().getEquipments().Add(1, new Item(207114101));
                    chr.getEquipment().getEquipments().Add(3, new Item(202110103));
                    chr.getEquipment().getEquipments().Add(4, new Item(203110102));
                    chr.getEquipment().getEquipments().Add(6, new Item(209114101));
                    chr.getEquipment().getEquipments().Add(7, new Item(201011002));
                    chr.getEquipment().getEquipments().Add(9, new Item(208114101));
                    chr.getEquipment().getEquipments().Add(10, new Item(208114101));
                    chr.getEquipment().getEquipments().Add(11, new Item(206110102));
                    break;
                }

                case 2:
                {
                    chr.getEquipment().getEquipments().Add(0, new Item(210220101));
                    chr.getEquipment().getEquipments().Add(1, new Item(207224101));
                    chr.getEquipment().getEquipments().Add(3, new Item(202220103));
                    chr.getEquipment().getEquipments().Add(4, new Item(203220102));
                    chr.getEquipment().getEquipments().Add(6, new Item(209225101));
                    chr.getEquipment().getEquipments().Add(7, new Item(201011008));
                    chr.getEquipment().getEquipments().Add(9, new Item(208224101));
                    chr.getEquipment().getEquipments().Add(10, new Item(208224101));
                    chr.getEquipment().getEquipments().Add(11, new Item(206220102));
                    break;
                }

                case 3:
                {
                    chr.getEquipment().getEquipments().Add(0, new Item(210130101));
                    chr.getEquipment().getEquipments().Add(1, new Item(207134101));
                    chr.getEquipment().getEquipments().Add(3, new Item(202130103));
                    chr.getEquipment().getEquipments().Add(4, new Item(203130102));
                    chr.getEquipment().getEquipments().Add(6, new Item(209135101));
                    chr.getEquipment().getEquipments().Add(7, new Item(201011014));
                    chr.getEquipment().getEquipments().Add(9, new Item(208134101));
                    chr.getEquipment().getEquipments().Add(10, new Item(208134101));
                    chr.getEquipment().getEquipments().Add(11, new Item(206130102));
                    break;
                }

                case 4:
                {
                    chr.getEquipment().getEquipments().Add(0, new Item(210140101));
                    chr.getEquipment().getEquipments().Add(1, new Item(207144101));
                    chr.getEquipment().getEquipments().Add(3, new Item(202140103));
                    chr.getEquipment().getEquipments().Add(4, new Item(203140102));
                    chr.getEquipment().getEquipments().Add(6, new Item(209140101));
                    chr.getEquipment().getEquipments().Add(7, new Item(201011020));
                    chr.getEquipment().getEquipments().Add(9, new Item(208144101));
                    chr.getEquipment().getEquipments().Add(10, new Item(208144101));
                    chr.getEquipment().getEquipments().Add(11, new Item(206140102));
                    break;
                }
            }

            MySQLTool.SaveEquipments(chr);
            return 1;
        }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:64,代碼來源:CharacterFunctions.cs

示例5: isCharacterWearingItem

 public static bool isCharacterWearingItem(Character character, int itemID)
 {
     if(itemID == 0)
         return true;
     foreach(KeyValuePair<byte, Item> entry in character.getEquipment().getEquipments()) {
         if(entry.Value.getItemID() == itemID) {
             return true;
         }
     }
     return false;
 }
開發者ID:cjs3187607,項目名稱:brightmh,代碼行數:11,代碼來源:CharacterFunctions.cs


注:本文中的Character.getEquipment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。