当前位置: 首页>>代码示例>>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;未经允许,请勿转载。