当前位置: 首页>>代码示例>>C#>>正文


C# Character.getLevel方法代码示例

本文整理汇总了C#中Character.getLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Character.getLevel方法的具体用法?C# Character.getLevel怎么用?C# Character.getLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character的用法示例。


在下文中一共展示了Character.getLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: canLearnSkill

        public Boolean canLearnSkill(Character chr, int ID)
        {
            if(!this.skills.ContainsKey(ID))
            {
                Console.WriteLine("playa already has dat skill");
                return false;
            }

            SkillData skill = skills[ID];

            if(skill.getChClass() != chr.getcClass() && skill.getChClass()!=0){
                Console.WriteLine("Cannot learn skill [wrong character class]");
                return false;
            }
            if(skill.getLvl()>chr.getLevel()){
                Console.WriteLine("Cannot learn skill [lvl too low]");
                return false;
            }
            if(skill.getFaction()!=0 && skill.getFaction()!=chr.getFaction()){
                Console.WriteLine("Cannot learn skill [wrong faction]");
                return false;
            }
            if(skill.getSkillPoints()>chr.getSkillPoints()){
                Console.WriteLine("Cannot learn skill [not enough skillpoints]");
                return false;
            }
            if((!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill1()) && skill.getReqSkill1() != 0) || (!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill2()) && skill.getReqSkill2() != 0) || (!chr.getSkills().getLearnedSkills().Contains(skill.getReqSkill3()) && skill.getReqSkill3() != 0))
            {
                Console.WriteLine("Cannot learn skill [you do not have the req skills]");
                return false;
            }
            return true;
        }
开发者ID:cjs3187607,项目名称:brightmh,代码行数:33,代码来源: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


注:本文中的Character.getLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。