Пример #1
0
 private void CountCharacterParams(Master.MSkill skillMaster)
 {
     this.power           += skillMaster.power;
     this.knowledge       += skillMaster.knowledge;
     this.speed           += skillMaster.speed;
     this.trick           += skillMaster.trick;
     this.endurance       += skillMaster.endurance;
     this.movingPower     += skillMaster.movingPower;
     this.riding          += skillMaster.riding;
     this.walker          += skillMaster.walker;
     this.pike            += skillMaster.pike;
     this.sword           += skillMaster.sword;
     this.longKnife       += skillMaster.longKnife;
     this.knife           += skillMaster.knife;
     this.longAx          += skillMaster.longAx;
     this.ax              += skillMaster.ax;
     this.longSticks      += skillMaster.longSticks;
     this.sticks          += skillMaster.sticks;
     this.archery         += skillMaster.archery;
     this.hiddenWeapons   += skillMaster.hiddenWeapons;
     this.dualWield       += skillMaster.dualWield;
     this.magic           += skillMaster.magic;
     this.resistanceMetal += skillMaster.resistanceMetal;
     this.resistanceWood  += skillMaster.resistanceWood;
     this.resistanceWater += skillMaster.resistanceWater;
     this.resistanceFire  += skillMaster.resistanceFire;
     this.resistanceEarth += skillMaster.resistanceEarth;
 }
Пример #2
0
        public float TileAid(View.Map.VTile vTile)
        {
            int aid = 0;

            foreach (MSkill skill in skills)
            {
                Master.MSkill mSkill = skill.master;
                if (!Master.MSkill.IsSkillType(mSkill, SkillType.help) || mSkill.effect.special != SkillEffectSpecial.tile)
                {
                    continue;
                }
                if (mSkill.wild > 0 && Array.Exists(Util.Global.Constant.tile_wild, v => v == vTile.tileId))
                {
                    aid += mSkill.wild;
                }
                if (mSkill.swim > 0 && Array.Exists(Util.Global.Constant.tile_swim, v => v == vTile.tileId))
                {
                    aid += mSkill.swim;
                }
            }
            return(aid == 0 ? 1f : (100 + aid) * 0.01f);
        }
Пример #3
0
        public void Update(MCharacter mCharacter)
        {
            Master.MCharacter master = mCharacter.master;
            if (master == null)
            {
                return;
            }
            MSkill[] skills = mCharacter.skills;
            this.power            = master.power;
            this.knowledge        = master.knowledge;
            this.speed            = master.speed;
            this.trick            = master.trick;
            this.endurance        = master.endurance;
            this.movingPower      = master.movingPower;
            this.riding           = master.riding;
            this.walker           = master.walker;
            this.pike             = master.pike;
            this.sword            = master.sword;
            this.longKnife        = master.longKnife;
            this.knife            = master.knife;
            this.longAx           = master.longAx;
            this.ax               = master.ax;
            this.longSticks       = master.longSticks;
            this.sticks           = master.sticks;
            this.archery          = master.archery;
            this.hiddenWeapons    = master.hiddenWeapons;
            this.dualWield        = master.dualWield;
            this.resistanceMetal += master.resistanceMetal;
            this.resistanceWood  += master.resistanceWood;
            this.resistanceWater += master.resistanceWater;
            this.resistanceFire  += master.resistanceFire;
            this.resistanceEarth += master.resistanceEarth;
            int hp = master.hp;
            int mp = master.mp;

            if (skills != null)
            {
                foreach (MSkill skill in skills)
                {
                    Master.MSkill skillMaster = skill.master;
                    if (skillMaster == null)
                    {
                        return;
                    }
                    if (!System.Array.Exists(skillMaster.types, s => s == SkillType.ability))
                    {
                        continue;
                    }
                    hp += skillMaster.hp;
                    mp += skillMaster.mp;
                    this.CountCharacterParams(skillMaster);
                }
            }
            List <MEquipment> equipments = new List <MEquipment>();

            if (mCharacter.weapon > 0)
            {
                equipments.Add(mCharacter.equipmentWepon);
            }
            if (mCharacter.clothes > 0)
            {
                equipments.Add(mCharacter.equipmentClothes);
            }
            if (mCharacter.horse > 0)
            {
                equipments.Add(mCharacter.equipmentHorse);
            }
            physicalAttack  = 0;
            physicalDefense = 0;
            magicAttack     = 0;
            magicDefense    = 0;
            foreach (MEquipment equipment in equipments)
            {
                hp                   += equipment.hp;
                mp                   += equipment.mp;
                this.power           += equipment.power;
                this.knowledge       += equipment.knowledge;
                this.speed           += equipment.speed;
                this.trick           += equipment.trick;
                this.endurance       += equipment.endurance;
                this.movingPower     += equipment.movingPower;
                this.riding          += equipment.riding;
                this.walker          += equipment.walker;
                this.pike            += equipment.pike;
                this.sword           += equipment.sword;
                this.longKnife       += equipment.longKnife;
                this.knife           += equipment.knife;
                this.longAx          += equipment.longAx;
                this.ax              += equipment.ax;
                this.longSticks      += equipment.longSticks;
                this.sticks          += equipment.sticks;
                this.archery         += equipment.archery;
                this.hiddenWeapons   += equipment.hiddenWeapons;
                this.dualWield       += equipment.dualWield;
                this.magic           += equipment.magic;
                this.resistanceMetal += equipment.resistanceMetal;
                this.resistanceWood  += equipment.resistanceWood;
                this.resistanceWater += equipment.resistanceWater;
                this.resistanceFire  += equipment.resistanceFire;
                this.resistanceEarth += equipment.resistanceEarth;
                physicalAttack       += equipment.physicalAttack;
                physicalDefense      += equipment.physicalDefense;
                magicAttack          += equipment.magicAttack;
                magicDefense         += equipment.magicDefense;
            }

            this.hpMax = Mathf.FloorToInt(mCharacter.level * (10 + this.endurance * 0.2f) + hp);
            this.mpMax = Mathf.FloorToInt(mCharacter.level * (5 + this.knowledge * 0.1f) + mp);
            float moveTypeValue = (mCharacter.moveType == MoveType.cavalry ? this.riding : this.walker);

            switch (mCharacter.weaponType)
            {
            case WeaponType.archery:
                moveTypeValue += this.archery;
                break;

            case WeaponType.pike:
                moveTypeValue += this.pike;
                break;

            case WeaponType.sword:
                moveTypeValue += this.sword;
                break;

            case WeaponType.longAx:
                moveTypeValue += this.longAx;
                break;

            case WeaponType.ax:
                moveTypeValue += this.ax;
                break;

            case WeaponType.longKnife:
                moveTypeValue += this.longKnife;
                break;

            case WeaponType.shortKnife:
                moveTypeValue += this.knife;
                break;

            case WeaponType.longSticks:
                moveTypeValue += this.longSticks;
                break;

            case WeaponType.sticks:
                moveTypeValue += this.sticks;
                break;

            case WeaponType.dualWield:
                moveTypeValue += this.dualWield;
                break;

            case WeaponType.magic:
                moveTypeValue += this.magic;
                break;
            }
            float starPower = 0.7f + mCharacter.star * 0.06f;

            this.physicalAttack   = Mathf.FloorToInt((this.power + this.knowledge) * 0.3f + (this.power * 2f + this.knowledge) * (0.4f + (moveTypeValue * 0.5f) * 0.006f) * (1f + mCharacter.level * starPower * 0.5f) * 0.1f);
            this.physicalAttack  += physicalAttack;
            this.magicAttack      = Mathf.FloorToInt((this.trick + this.knowledge) * 0.3f + (this.trick * 2f + this.knowledge) * (0.4f + (moveTypeValue * 0.5f) * 0.006f) * (1f + mCharacter.level * starPower * 0.5f) * 0.1f);
            this.magicAttack     += magicAttack;
            this.physicalDefense  = Mathf.FloorToInt((this.power * 0.5f + this.knowledge) * 0.3f + (this.power + this.knowledge) * (1f + mCharacter.level * starPower * 0.5f) * 0.04f);
            this.physicalDefense += physicalDefense;
            this.magicDefense     = Mathf.FloorToInt((this.trick * 0.5f + this.knowledge) * 0.3f + (this.trick + this.knowledge) * (1f + mCharacter.level * starPower * 0.5f) * 0.04f);
            this.magicDefense    += magicDefense;


            this.hpMax *= 3;
            this.mpMax *= 3;
        }