Ejemplo n.º 1
0
    static int UpdateCharacterBaseInfo(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, typeof(Logic.Character.Model.CharacterBaseInfo), typeof(Logic.Hero.Model.HeroData)))
            {
                Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)ToLua.ToObject(L, 1);
                Logic.Hero.Model.HeroData arg0            = (Logic.Hero.Model.HeroData)ToLua.ToObject(L, 2);
                Logic.Character.Model.CharacterBaseInfo o = obj.UpdateCharacterBaseInfo(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, typeof(Logic.Character.Model.CharacterBaseInfo), typeof(uint), typeof(uint)))
            {
                Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)ToLua.ToObject(L, 1);
                uint arg0 = (uint)LuaDLL.lua_tonumber(L, 2);
                uint arg1 = (uint)LuaDLL.lua_tonumber(L, 3);
                Logic.Character.Model.CharacterBaseInfo o = obj.UpdateCharacterBaseInfo(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Logic.Character.Model.CharacterBaseInfo.UpdateCharacterBaseInfo"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
 public HeroInfo(DrawCardDropProto drawDropCardProto)
 {
     this.instanceID        = 0;
     this.heroData          = HeroData.GetHeroDataByID(drawDropCardProto.no);
     this.breakthroughLevel = 0;
     this.strengthenLevel   = 0;
     this.advanceLevel      = drawDropCardProto.star;
     this.level             = 1;
 }
Ejemplo n.º 3
0
        public static HeroData GetHeroDataByID(int heroID)
        {
            HeroData heroData = null;

            if (HeroDataDictionary.ContainsKey(heroID) && HeroDataDictionary[heroID] != null)
            {
                heroData = HeroDataDictionary[heroID];
            }
            return(heroData);
        }
Ejemplo n.º 4
0
        //public int breakthroughLevel = 0;
        //public int strengthenLevel = 0;
        //public int advanceLevel = 0;
        //public int level = 1;

        //public int exp = 0;
        //public int strengthenExp = 0;
        //public int weaponID = 0;
        //public int armorID = 0;
        //public int accessoryID = 0;

        public HeroInfo(uint instanceID, int heroDataID, int breakthroughLevel, int strengthenLevel, int advanceLevel, int level = 1)
        {
            this.instanceID = instanceID;
            this.heroData   = HeroData.GetHeroDataByID(heroDataID);
            if (this.heroData == null)
            {
                Debugger.LogError("heroData is null,can't find id :" + heroDataID);
            }
            this.breakthroughLevel = breakthroughLevel;
            this.strengthenLevel   = strengthenLevel;
            this.advanceLevel      = advanceLevel;
            this.level             = level;
            UpdateHeroAttribute();
        }
Ejemplo n.º 5
0
 public HeroInfo(TeamHeroProtoData data)
 {
     this.instanceID = (uint)data.id;
     heroData        = HeroData.GetHeroDataByID(data.heroNo);
     if (data.lv != 1)
     {
         level = data.lv;
     }
     if (data.star != 0)
     {
         advanceLevel = data.star;
     }
     if (data.aggrLv != -1)
     {
         strengthenLevel = data.aggrLv;
     }
     if (data.breakLayer != 0)
     {
         breakthroughLevel = data.breakLayer;
     }
 }
Ejemplo n.º 6
0
        public HeroInfo(LuaTable heroInfoLuaTable)
        {
            this.instanceID = heroInfoLuaTable["instanceID"].ToString().ToUInt32();
            LuaTable heroDataLuaTable = (LuaTable)heroInfoLuaTable["heroData"];

            if (heroDataLuaTable == null)
            {
                Debugger.LogError("heroData is null,can't find ");
            }
            this.heroData          = HeroData.GetHeroDataByID(heroDataLuaTable["id"].ToString().ToInt32());
            this.breakthroughLevel = heroInfoLuaTable["breakthroughLevel"].ToString().ToInt32();
            this.strengthenLevel   = heroInfoLuaTable["strengthenLevel"].ToString().ToInt32();
            this.advanceLevel      = heroInfoLuaTable["advanceLevel"].ToString().ToInt32();
            this.level             = heroInfoLuaTable["level"].ToString().ToInt32();

            this.exp           = heroInfoLuaTable["exp"].ToString().ToInt32();
            this.strengthenExp = heroInfoLuaTable["strengthenExp"].ToString().ToInt32();

            this.weaponID    = heroInfoLuaTable["weaponID"].ToString().ToInt32();
            this.armorID     = heroInfoLuaTable["armorID"].ToString().ToInt32();
            this.accessoryID = heroInfoLuaTable["accessoryID"].ToString().ToInt32();
        }
Ejemplo n.º 7
0
 public HeroInfo(GameResData gameResData)
 {
     this.heroData     = HeroData.GetHeroDataByID(gameResData.id);
     this.advanceLevel = gameResData.star;
     UpdateHeroAttribute();
 }
Ejemplo n.º 8
0
 public HeroInfo(HeroData heroData)
 {
     this.heroData     = heroData;
     this.advanceLevel = 1;//召唤兽默认用1阶模型
     UpdateHeroAttribute();
 }