Esempio n. 1
0
 /// <summary>
 /// 设置附加属性
 /// </summary>
 public void SetAddAttrInfo(s_monsterInfo monster)
 {
     if (monster == null)
     {
         Debug.LogError("SetAddAttrInfo is null");
         return;
     }
     AddAttr(AddAttrType.Main, monster.data1, monster.value1);
     AddAttr(AddAttrType.Main, monster.data2, monster.value2);
     AddAttr(AddAttrType.Main, monster.data3, monster.value3);
     AddAttr(AddAttrType.Main, monster.data4, monster.value4);
     AddAttr(AddAttrType.Main, monster.data5, monster.value5);
 }
Esempio n. 2
0
    /// <summary>
    /// 获取怪物奖励
    /// </summary>
    private static List <int> GetMonsterReward(int monsterid)
    {
        List <int>    lReward = new List <int>();
        s_monsterInfo Info    = GetMonsterInfo(monsterid);

        if (Info != null)
        {
            if (Info.drop1 > 0)
            {
                lReward.Add(Info.drop1);
            }
            if (Info.drop2 > 0)
            {
                lReward.Add(Info.drop2);
            }
            if (Info.drop3 > 0)
            {
                lReward.Add(Info.drop3);
            }
            if (Info.drop4 > 0)
            {
                lReward.Add(Info.drop4);
            }
            if (Info.drop5 > 0)
            {
                lReward.Add(Info.drop5);
            }
            if (Info.drop6 > 0)
            {
                lReward.Add(Info.drop6);
            }
            if (Info.drop7 > 0)
            {
                lReward.Add(Info.drop7);
            }
            if (Info.drop8 > 0)
            {
                lReward.Add(Info.drop8);
            }
            if (Info.drop9 > 0)
            {
                lReward.Add(Info.drop9);
            }
            if (Info.drop10 > 0)
            {
                lReward.Add(Info.drop10);
            }
        }
        return(lReward);
    }
Esempio n. 3
0
    public void SetSkill(s_monsterInfo monster)
    {
        if (monster == null)
        {
            return;
        }
        SoldierSkill Info = new SoldierSkill();

        //0
        SkillM.GetSkillInfo(monster.gskillid, ref Info);
        m_Skillinfo.Add(Info);
        //1
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.skill1id, ref Info);
        m_skill1_level = Info.m_level;
        m_Skillinfo.Add(Info);
        //2
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.skill2id, ref Info);
        m_skill2_level = Info.m_level;
        m_Skillinfo.Add(Info);
        //3
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.skill3id, ref Info);
        m_skill3_level = Info.m_level;
        m_Skillinfo.Add(Info);
        //4
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.skill4id, ref Info);
        m_skill4_level = Info.m_level;
        m_Skillinfo.Add(Info);
        //5
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.skill5id, ref Info);
        m_skill5_level = Info.m_level;
        m_Skillinfo.Add(Info);
        //6
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.askillid, ref Info);
        m_Skillinfo.Add(Info);
        //7
        Info = new SoldierSkill();
        SkillM.GetSkillInfo(monster.lskillid, ref Info);
        m_Skillinfo.Add(Info);
    }
Esempio n. 4
0
    /// <summary>
    /// 获取怪物数据
    /// </summary>
    public static SoldierInfo Getmonster(s_countershipputInfo Info)
    {
        if (Info == null)
        {
            return(null);
        }
        s_monsterInfo monster = GetMonsterInfo(Info.objid);

        if (monster == null)
        {
            return(null);
        }
        SoldierInfo I = SoldierM.GetSoldierInfo(monster);

        if (I.m_modeltype == 200009 || I.m_modeltype == 102003)
        {
            s_monsterInfo monsterturn = GetMonsterInfo(Info.objid + 1);
            I.m_TurnInfo = SoldierM.GetSoldierInfo(monsterturn);

            if (I.m_TurnInfo != null)
            {
                I.m_TurnInfo.CX = Info.cx;
                I.m_TurnInfo.CY = Info.cy;
                s_monsterskillorderInfo order = GetSkillOrder(Info.objid + 1);
                if (order != null && I.m_TurnInfo.m_Skill != null)
                {
                    I.m_TurnInfo.m_Skill.attack1 = order.attack;
                    I.m_TurnInfo.m_Skill.attack2 = order.attack1;
                }
            }
        }
        if (I != null)
        {
            I.CX = Info.cx;
            I.CY = Info.cy;
            s_monsterskillorderInfo order = GetSkillOrder(Info.objid);
            if (order != null && I.m_Skill != null)
            {
                I.m_Skill.attack1 = order.attack;
                I.m_Skill.attack2 = order.attack1;
            }
        }
        return(I);
    }
Esempio n. 5
0
    /// <summary>
    /// 获取炮弹兵信息
    /// </summary>
    /// <param name="Info">炮弹兵数据</param>
    public static SoldierInfo GetSoldierInfo(s_monsterInfo monster)
    {
        if (monster == null)
        {
            return(null);
        }
        SoldierInfo I = new SoldierInfo();

        //
        I.m_name          = monster.name;
        I.ID              = monster.id;
        I.SoldierTypeID   = monster.id;
        I.m_modeltype     = monster.modeid;
        I.m_soldier_type  = monster.type;
        I.Level           = monster.level;
        I.StarLevel       = monster.star;
        I.Quality         = monster.quality;
        I.m_hp            = monster.hp;
        I.m_phy_attack    = monster.physical_attack;
        I.m_phy_defend    = monster.physical_defend;
        I.m_phy_crit      = monster.physical_crit;
        I.m_magic_attack  = monster.magic_attack;
        I.m_magic_defend  = monster.magic_defend;
        I.m_dodge         = monster.dodge;
        I.m_Flyspeed      = 1.0f * monster.flyspeed / MapGrid.m_Pixel;
        I.m_attack_like   = monster.attack_like;
        I.m_attack_type   = monster.attacktype;
        I.m_speed         = 1.0f * monster.speed / MapGrid.m_Pixel;
        I.m_jump_distance = monster.jump_distance / MapGrid.m_Pixel;
        I.m_resist        = monster.resist;
        I.m_attack_time   = monster.attack_time * 0.001f;
        I.m_desc          = monster.description;
        I.m_FireAI        = monster.fireai;
        I.m_shape         = monster.shape;
        I.m_goorder       = monster.goorder;
        I.m_concussion    = monster.concussion;
        I.m_dead_mp       = monster.dead_mp;
        //附加属性
        //主附加属性
        I.m_AddAttr.SetAddAttrInfo(monster);
        //被动技能附加属性
        I.m_Skill.SetSkill(monster);
        I.m_Skill.SetAddrData(ref I.m_AddAttr);
        SetAddAttr(ref I);
        //爆击及闪避
        s_soldier_experienceInfo ExpInfo = SoldierM.GetSoldierExpData(I.Level);

        if (ExpInfo != null)
        {
            I.m_critratio  = ExpInfo.critratio;
            I.m_dodgeratio = ExpInfo.dodgeratio;
        }
        I.m_combat_power = monster.power;

        I.m_hpstart         = I.m_hp;
        I.m_phy_attackstart = I.m_phy_attack;
        I.m_phy_defendstart = I.m_phy_defend;
        I.m_phy_critstart   = I.m_phy_crit;

        I.m_magic_attackstart = I.m_magic_attack;
        I.m_magic_defendstart = I.m_magic_defend;
        I.m_magic_critstart   = I.m_magic_crit;
        I.m_strengthstart     = I.m_strength;
        I.m_agilitystart      = I.m_agility;
        I.m_intelligencestart = I.m_intelligence;
        return(I);
    }