Example #1
0
    //默认的初始化方式
    void defaultInit(NPCConfigData cfg)
    {
        this.lv  = 1;
        this.num = cfg.ID;

        this.curHp        = cfg.healthpoint;
        this.totalConstHp = cfg.healthpoint;
        this.totalTempHp  = cfg.healthpoint;

        this.attackpower           = cfg.attackpower;
        this.armorclass            = cfg.armorclass;
        this.armorpenetration      = cfg.armorpenetration;
        this.spellpower            = cfg.spellpower;
        this.spellresistance       = cfg.spellresistance;
        this.spellpenetration      = cfg.spellpenetration;
        this.attackdamagereduction = cfg.attackdamagereduction;
        this.spelldamagereduction  = cfg.spelldamagereduction;
        this.speed                  = cfg.speed;
        this.crit                   = cfg.crit;
        this.BeHeal                 = cfg.BeHeal;
        this.critresistance         = cfg.critresistance;
        this.additionalcrit         = cfg.additionalcrit;
        this.attacklifesteal        = cfg.attacklifesteal;
        this.spelllifesteal         = cfg.spelllifesteal;
        this.attackspeed            = cfg.attackspeed;
        this.additionalreduction    = cfg.additionalreduction;
        this.attackdamageback       = cfg.attackdamageback;
        this.spelldamageback        = cfg.spelldamageback;
        this.recovery               = cfg.recovery;
        this.attackadditionaldamage = cfg.attackadditionaldamage;
        this.Protection             = 0f;
        this.factor                 = cfg.factor;
        this.seekRange              = cfg.seekRange;
        this.fleeRange              = cfg.fleeRange;
    }
Example #2
0
        public void setCurAtt(float att, bool ignoreDS = false)
        {
            _curAtt = MathHelper.MidpointRounding(att);
            if (_curAtt <= 0)
            {
                _curAtt = 0;

                if (!ignoreDS)
                {
                    //这里可能触发濒死技...
                    _almostDie = true;
                    List <BT_Skill> castArr = canCastSkill(SkillOpData.Death_Closed_Skill);
                    foreach (BT_Skill sk in castArr)
                    {
                        sk.castSkill();
                    }
                }

                if (_curAtt <= 0)
                {
                    _isAlive = false;
                }
                //这里看是否真挂了...
                if (!alive)
                {
                    MonsterData md = Core.Data.monManager.getMonsterByNum(_num);
                    int         Ap = md == null ? BT_WarUtils.Unit_Angry : md.nuqi2;
                    _selfTeam.curPetDie(_fullFated, isUsedFateAngry, Ap);
                    clearBuffOrDebuff();
                }
            }
        }
Example #3
0
    public float getFloatValue(string FieldName)
    {
        FieldInfo fi = GetType().GetField(FieldName, c_bf);

        if (fi.FieldType == typeof(Int32Fog))
        {
            Int32Fog val = (Int32Fog)fi.GetValue(this);
            return(val.toInt32());
        }
        else
        {
            FloatFog val = (FloatFog)fi.GetValue(this);
            return(val);
        }
    }
Example #4
0
    void test_MyInt()
    {
        testValue = 12345;

        int add = testValue + 12345;

        int minus = testValue - 1000;

        int mul = testValue * 3;

        int dividual = testValue / 2;

        ConsoleEx.DebugLog("testValue " + testValue);

        ConsoleEx.DebugLog("add = " + add + " \t minus = " + minus + "\t mul = " + mul + "\t dividual = " + dividual);
    }
Example #5
0
        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);
        }
Example #6
0
        /// <summary>
        /// Init the specified owner and param.
        /// </summary>
        /// <param name="owner">Owner.</param>
        /// <param name="param">Parameter.</param>
        public override void Init(ServerNPC owner, WarMsgParam param)
        {
            parent = owner;
            tran   = transform;
            wmMgr  = WarServerManager.Instance;
            Camp   = Camp.set(parent.Camp);

            WarSrcAnimParam srcParam = param as WarSrcAnimParam;

            if (srcParam != null)
            {
                SelfDescribed sd = srcParam.described;
                if (sd != null)
                {
                    EndResult result      = sd.targetEnd;
                    int       effectIndex = result.param2;
                    targetIndex = result.param5;
                    if (targetIndex > 0)
                    {
                        if (wmMgr != null)
                        {
                            target = wmMgr.npcMgr.GetNPCByUniqueID(targetIndex);
                        }
                    }
                    EffectConfigData effect = Core.Data.getIModelConfig <EffectModel>().get(effectIndex);
                    if (effect != null)
                    {
                        effectID      = effectIndex;
                        speed         = effect.Param3 / 1000f;
                        maxDis        = effect.Param4 / 1000;
                        damageType    = effect.Param8;
                        disappearType = effect.Param5;
                    }
//                    string msg = string.Format("[effect:{0} speed:{1} maxDis:{2} disappearType:{3} damageType:{4}]", effectID, speed, maxDis, disappearType, damageType);
//                    Debug.Log(msg);
                }
                inited = true;
            }
        }
Example #7
0
 public BattleMonster(int baseAtt, int enhanceAtt, int baseDef, int enhanceDef)
 {
     CombieAttack = baseAtt + enhanceAtt;
     CombieDefend = baseDef + enhanceDef;
     //useless or ignore it
 }