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

            if (count == 1 && TypeChecker.CheckTypes(L, typeof(Logic.Player.Model.PlayerInfo)))
            {
                Logic.Player.Model.PlayerInfo           arg0 = (Logic.Player.Model.PlayerInfo)ToLua.ToObject(L, 1);
                Logic.Character.Model.CharacterBaseInfo o    = Logic.Character.Model.CharacterBaseInfo.CreateCharacterBaseInfo(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes(L, typeof(Logic.Hero.Model.HeroInfo)))
            {
                Logic.Hero.Model.HeroInfo arg0            = (Logic.Hero.Model.HeroInfo)ToLua.ToObject(L, 1);
                Logic.Character.Model.CharacterBaseInfo o = Logic.Character.Model.CharacterBaseInfo.CreateCharacterBaseInfo(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Logic.Character.Model.CharacterBaseInfo.CreateCharacterBaseInfo"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
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.º 3
0
        public static CharacterBaseInfo CreateCharacterBaseInfo(HeroInfo heroInfo)
        {
            CharacterBaseInfo characterInfo = new CharacterBaseInfo()
            {
                baseId   = (uint)heroInfo.heroData.id,
                hitId    = heroInfo.heroData.hitId,
                skillId1 = heroInfo.heroData.skillId1,
                skillId2 = heroInfo.heroData.skillId2,
                //passiveId1 = heroInfo.heroData.passiveId1,
                passiveIdDic = new Dictionary <int, int>(),
                passiveId2   = heroInfo.heroData.passiveId2,
                instanceID   = heroInfo.instanceID,
                HP           = (int)heroInfo.heroData.HP,
                maxHP        = heroInfo.heroData.HP,
                floatable    = heroInfo.heroData.floatable,
                speed        = (int)heroInfo.heroData.speed,
                roleType     = heroInfo.heroData.roleType,
                roleInfo     = heroInfo
            };

            if (characterInfo.hitId != 0)
            {
                characterInfo.hitSkillInfo = new SkillInfo(characterInfo.hitId);
                characterInfo.hitSkillInfo.characterInstanceId = heroInfo.instanceID;
            }
            if (characterInfo.skillId1 != 0)
            {
                characterInfo.skillInfo1 = new SkillInfo(characterInfo.skillId1);
                characterInfo.skillInfo1.characterInstanceId = heroInfo.instanceID;
            }
            if (characterInfo.skillId2 != 0)
            {
                characterInfo.skillInfo2 = new SkillInfo(characterInfo.skillId2);
                characterInfo.skillInfo2.characterInstanceId = heroInfo.instanceID;
            }
            if (characterInfo.roleInfo.advanceLevel > characterInfo.roleInfo.heroData.starMin)
            {
                characterInfo.dlevel = (uint)characterInfo.roleInfo.advanceLevel - characterInfo.roleInfo.heroData.starMin;
            }
            if (heroInfo.heroData.passiveId1 > 0)
            {
                characterInfo.passiveIdDic.Add((int)heroInfo.heroData.passiveId1, 1);
                string luaFile = "user/skill/passive_skill_" + heroInfo.heroData.passiveId1;
                //if (Lua.Model.LuaData.ExistLuaFile(luaFile))
                LuaScriptMgr.Instance.DoFile(luaFile);
            }
            LuaInterface.LuaFunction initFunc = PassiveSkillController.instance.GetPassiveSkillLuaFunction(PassiveSkillController.INIT_CHARACTER_DATAS, (int)characterInfo.baseId);
            if (initFunc != null)
            {
                initFunc.Call(characterInfo.instanceID);
            }
            return(characterInfo);
        }
Ejemplo n.º 4
0
    static int set_skill2CD(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.skill2CD = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index skill2CD on a nil value" : e.Message));
        }
    }
Ejemplo n.º 5
0
    static int set_aeonEffectId(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
            obj.aeonEffectId = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index aeonEffectId on a nil value" : e.Message));
        }
    }
Ejemplo n.º 6
0
    static int set_passiveIdDic(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo          obj  = (Logic.Character.Model.CharacterBaseInfo)o;
            System.Collections.Generic.Dictionary <int, int> arg0 = (System.Collections.Generic.Dictionary <int, int>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.Dictionary <int, int>));
            obj.passiveIdDic = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index passiveIdDic on a nil value" : e.Message));
        }
    }
Ejemplo n.º 7
0
    static int get_floatable(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            bool ret = obj.floatable;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index floatable on a nil value" : e.Message));
        }
    }
Ejemplo n.º 8
0
    static int get_dlevel(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            uint ret = obj.dlevel;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index dlevel on a nil value" : e.Message));
        }
    }
Ejemplo n.º 9
0
    static int get_roleInfo(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            Logic.Role.Model.RoleInfo ret = obj.roleInfo;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index roleInfo on a nil value" : e.Message));
        }
    }
Ejemplo n.º 10
0
    static int get_scale(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            UnityEngine.Vector3 ret = obj.scale;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index scale on a nil value" : e.Message));
        }
    }
Ejemplo n.º 11
0
    static int get_passiveIdDic(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo          obj = (Logic.Character.Model.CharacterBaseInfo)o;
            System.Collections.Generic.Dictionary <int, int> ret = obj.passiveIdDic;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index passiveIdDic on a nil value" : e.Message));
        }
    }
Ejemplo n.º 12
0
    static int set_roleInfo(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            Logic.Role.Model.RoleInfo arg0 = (Logic.Role.Model.RoleInfo)ToLua.CheckObject(L, 2, typeof(Logic.Role.Model.RoleInfo));
            obj.roleInfo = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index roleInfo on a nil value" : e.Message));
        }
    }
Ejemplo n.º 13
0
    static int set_eulerAngles(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.Character.Model.CharacterBaseInfo obj = (Logic.Character.Model.CharacterBaseInfo)o;
            UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 2);
            obj.eulerAngles = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index eulerAngles on a nil value" : e.Message));
        }
    }
Ejemplo n.º 14
0
    static int _CreateLogic_Character_Model_CharacterBaseInfo(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Logic.Character.Model.CharacterBaseInfo obj = new Logic.Character.Model.CharacterBaseInfo();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Logic.Character.Model.CharacterBaseInfo.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 15
0
        public static CharacterBaseInfo CreateCharacterBaseInfo(PlayerInfo playerInfo)
        {
            CharacterBaseInfo characterInfo = new CharacterBaseInfo()
            {
                baseId       = playerInfo.playerData.Id,
                hitId        = playerInfo.heroData.hitId,
                skillId1     = playerInfo.heroData.skillId1,
                skillId2     = playerInfo.heroData.skillId2,
                passiveIdDic = new Dictionary <int, int>(),
                //passiveId1 = (uint)playerInfo.passiveSkillId,
                //passiveId1Level = (uint)playerInfo.passiveSkillLevel,
                passiveId2     = playerInfo.heroData.passiveId2,
                aeonEffectId   = (uint)playerInfo.summonEffectId,
                aeonSkillLevel = (uint)playerInfo.summonSkillLevel,
                maxAngerValue  = playerInfo.playerData.maxAngry,
                instanceID     = playerInfo.instanceID,
                HP             = (int)playerInfo.heroData.HP,
                maxHP          = (uint)playerInfo.heroData.HP,
                angerValue     = 0,
                speed          = (int)playerInfo.heroData.speed,
                floatable      = true,
                roleType       = playerInfo.heroData.roleType,
                roleInfo       = playerInfo
            };

            if (playerInfo.passiveSkillId > 0)
            {
                characterInfo.passiveIdDic.Add(playerInfo.passiveSkillId, playerInfo.passiveSkillLevel);
            }
            characterInfo.passiveIdDic.AddRange(playerInfo.normalPassiveSkilIdDic);
            if (characterInfo.hitId != 0)
            {
                characterInfo.hitSkillInfo = new SkillInfo(characterInfo.hitId);
                characterInfo.hitSkillInfo.characterInstanceId = playerInfo.instanceID;
            }
            if (characterInfo.skillId1 != 0)
            {
                characterInfo.skillInfo1 = new SkillInfo(characterInfo.skillId1);
                characterInfo.skillInfo1.characterInstanceId = playerInfo.instanceID;
            }
            if (characterInfo.skillId2 != 0)
            {
                characterInfo.skillInfo2 = new SkillInfo(characterInfo.skillId2);
                characterInfo.skillInfo2.characterInstanceId = playerInfo.instanceID;
            }
            if (characterInfo.roleInfo.advanceLevel > characterInfo.roleInfo.heroData.starMin)
            {
                characterInfo.dlevel = (uint)characterInfo.roleInfo.advanceLevel - characterInfo.roleInfo.heroData.starMin;
            }
            string luaFile = "user/skill/passive_skill_" + characterInfo.baseId;

            //if (Lua.Model.LuaData.ExistLuaFile(luaFile))
            LuaScriptMgr.Instance.DoFile(luaFile);
            LuaInterface.LuaFunction initFunc = PassiveSkillController.instance.GetPassiveSkillLuaFunction(PassiveSkillController.INIT_CHARACTER_DATAS, (int)characterInfo.baseId);
            if (initFunc != null)
            {
                initFunc.Call(characterInfo.instanceID);
            }
            if (characterInfo.aeonEffectId > 0)
            {
                LuaInterface.LuaFunction func = PassiveSkillController.instance.GetPassiveSkillLuaFunction(PassiveSkillController.AEON_ID_AND_SKILL_ID, (int)characterInfo.baseId);
                if (func != null)
                {
                    object[] rs = func.Call(characterInfo.aeonEffectId);
                    if (rs.Length > 0)
                    {
                        uint eaonId = 0;
                        uint.TryParse(rs[0].ToString(), out eaonId);
                        uint eaonSkillId = 0;
                        uint.TryParse(rs[1].ToString(), out eaonSkillId);
                        characterInfo.aeonId    = eaonId;
                        characterInfo.aeonSkill = eaonSkillId;

                        if (characterInfo.aeonSkill != 0)
                        {
                            characterInfo.aeonSkillInfo = new SkillInfo(characterInfo.aeonSkill);
                        }
                    }
                }
            }
            if (characterInfo.aeonId == 0)
            {
                characterInfo.aeonId    = (uint)playerInfo.playerData.summonID;
                characterInfo.aeonSkill = (uint)playerInfo.playerData.summonSkillId;
                if (characterInfo.aeonSkill != 0)
                {
                    characterInfo.aeonSkillInfo = new SkillInfo(characterInfo.aeonSkill);
                    characterInfo.aeonSkillInfo.characterInstanceId = playerInfo.instanceID;
                }
            }
            return(characterInfo);
        }