コード例 #1
0
    static int SkillShoot(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(NTGBattlePlayerController), typeof(int), typeof(float), typeof(float)))
            {
                NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.ToObject(L, 1);
                int   arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                float arg1 = (float)LuaDLL.lua_tonumber(L, 3);
                float arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                obj.SkillShoot(arg0, arg1, arg2);
                return(0);
            }
            else if (count == 5 && TypeChecker.CheckTypes(L, 1, typeof(NTGBattlePlayerController), typeof(int), typeof(string), typeof(float), typeof(float)))
            {
                NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.ToObject(L, 1);
                int    arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                float  arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                float  arg3 = (float)LuaDLL.lua_tonumber(L, 5);
                obj.SkillShoot(arg0, arg1, arg2, arg3);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: NTGBattlePlayerController.SkillShoot"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
    public virtual void Init(NTGBattlePlayerController pc, int gindex, float[] p)
    {
        this.pc       = pc;
        this.position = gIndexToPosition[gindex];

        stopDistance = p[0];
        idleTime     = p[1];

        skillPriority = new[] { (int)(p[2] / 100 % 10), (int)(p[2] / 10 % 10), (int)(p[2] % 10) };

        var c     = p[3];
        var cList = new ArrayList();

        while (((int)c) > 0)
        {
            cList.Add((int)(c % 10));
            c /= 10;
        }
        skillChain = new int[cList.Count];
        for (int i = 0; i < skillChain.Length; i++)
        {
            skillChain[i] = (int)cList[cList.Count - 1 - i];
        }

        chainWeight = 0.1f;
        skillWeight = new[] { 0.25f, 0.25f, 0.25f, 0.25f };
    }
コード例 #3
0
 public void ShowUnitCoin(NTGBattleUnitController mob, NTGBattlePlayerController player, float coin)
 {
     if (player == localPlayerController && unitUiMap.ContainsKey(mob))
     {
         NTGApplicationController.Instance.LuaCall("UIDamage", "ShowDamage", unitUiMap[mob]["UIDamage"], 6, coin, false);
     }
 }
コード例 #4
0
 public override void PlayerHit(NTGBattlePlayerController player, NTGBattlePlayerController shooter)
 {
     if (!playerHitLocked && player.group == group && (transform.position - shooter.transform.position).sqrMagnitude < sqrTargetRange)
     {
         playerHitLocked = true;
         targetUnit      = shooter;
     }
 }
コード例 #5
0
    // Use this for initialization
    private void Start()
    {
        owner = GetComponentInParent <NTGBattlePlayerController>();

        moving = false;

        position = owner.transform.position;
    }
コード例 #6
0
    public override void Respawn()
    {
        base.Respawn();

        collider.radius  = this.range;
        collider.height  = this.range * 2;
        collider.enabled = true;
        alliedPlayers    = new List <NTGBattlePlayerController>();
        buffPlayer       = null;
        minHpPlayer      = null;
    }
コード例 #7
0
    public void ShowPlayerKillMessage(NTGBattleUnitController killer, NTGBattlePlayerController victim, NTGBattlePlayerController.KillRecord killRecord)
    {
        if (mainController.serverSimulator)
        {
            return;
        }

        if (killer == null)
        {
            Debug.LogError("ShowPlayerKillMessage killer is null!");
            return;
        }

        int comboCount = 1;

        var playerkiller = killer as NTGBattlePlayerController;

        if (playerkiller != null)
        {
            comboCount = 0;
            foreach (NTGBattlePlayerController.KillRecord kr in playerkiller.killSteak)
            {
                if (killRecord.time - kr.time < mainController.configX)
                {
                    comboCount++;
                }
            }
            if (comboCount > 5)
            {
                comboCount = 5;
            }
        }

        if (mainController.firstBlood)
        {
            ShowMessage(1, 0, killer.group == mainController.localGroup, killer.icon, victim.icon);
        }
        else
        {
            ShowMessage(1, comboCount, killer.group == mainController.localGroup, killer.icon, victim.icon);
        }

        if (playerkiller != null && playerkiller.killSteak.Count > 2)
        {
            var steak = playerkiller.killSteak.Count;
            if (steak > 7)
            {
                steak = 7;
            }
            ShowMessage(2, steak, killer.group == mainController.localGroup, killer.icon, victim.icon);
        }
    }
コード例 #8
0
 static int ShootUp(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         obj.ShootUp();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #9
0
 static int AddCoin(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.AddCoin(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #10
0
 static int TargetUnit(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGBattlePlayerController obj  = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         NTGBattleUnitController   arg0 = (NTGBattleUnitController)ToLua.CheckUnityObject(L, 2, typeof(NTGBattleUnitController));
         obj.TargetUnit(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #11
0
 static int RemoveEquip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         string arg0 = ToLua.CheckString(L, 2);
         obj.RemoveEquip(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #12
0
 static int SkillUpgradeById(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         obj.SkillUpgradeById(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #13
0
 static int Hit(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NTGBattlePlayerController obj  = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         NTGBattleUnitController   arg0 = (NTGBattleUnitController)ToLua.CheckUnityObject(L, 2, typeof(NTGBattleUnitController));
         NTGBattleSkillBehaviour   arg1 = (NTGBattleSkillBehaviour)ToLua.CheckUnityObject(L, 3, typeof(NTGBattleSkillBehaviour));
         obj.Hit(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #14
0
 static int SetVelocity(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NTGBattlePlayerController obj  = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         UnityEngine.Vector3       arg0 = ToLua.ToVector3(L, 2);
         bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
         obj.SetVelocity(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #15
0
 static int SellEquip(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         NTGBattlePlayerController obj = (NTGBattlePlayerController)ToLua.CheckObject(L, 1, typeof(NTGBattlePlayerController));
         string arg0 = ToLua.CheckString(L, 2);
         double arg1 = (double)LuaDLL.luaL_checknumber(L, 3);
         bool   o    = obj.SellEquip(arg0, arg1);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #16
0
    static int set_deathSteak(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj  = (NTGBattlePlayerController)o;
            System.Collections.Queue  arg0 = (System.Collections.Queue)ToLua.CheckObject(L, 2, typeof(System.Collections.Queue));
            obj.deathSteak = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index deathSteak on a nil value" : e.Message));
        }
    }
コード例 #17
0
    static int get_deathSteak(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            System.Collections.Queue  ret = obj.deathSteak;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index deathSteak on a nil value" : e.Message));
        }
    }
コード例 #18
0
    static int set_skillPoint(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.skillPoint = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index skillPoint on a nil value" : e.Message));
        }
    }
コード例 #19
0
    static int set_reviveCountDown(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.reviveCountDown = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index reviveCountDown on a nil value" : e.Message));
        }
    }
コード例 #20
0
    static int get_Player(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattleUIController.BattleUpdateData obj = (NTGBattleUIController.BattleUpdateData)o;
            NTGBattlePlayerController ret = obj.Player;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Player on a nil value" : e.Message));
        }
    }
コード例 #21
0
    static int set_targetUnit(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj  = (NTGBattlePlayerController)o;
            NTGBattleUnitController   arg0 = (NTGBattleUnitController)ToLua.CheckUnityObject(L, 2, typeof(NTGBattleUnitController));
            obj.targetUnit = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index targetUnit on a nil value" : e.Message));
        }
    }
コード例 #22
0
    static int get_expCap(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            float ret = obj.expCap;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index expCap on a nil value" : e.Message));
        }
    }
コード例 #23
0
    static int set_equips(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController    obj  = (NTGBattlePlayerController)o;
            System.Collections.ArrayList arg0 = (System.Collections.ArrayList)ToLua.CheckObject(L, 2, typeof(System.Collections.ArrayList));
            obj.equips = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index equips on a nil value" : e.Message));
        }
    }
コード例 #24
0
    static int get_joystickDirection(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            UnityEngine.Vector3       ret = obj.joystickDirection;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index joystickDirection on a nil value" : e.Message));
        }
    }
コード例 #25
0
    static int get_recentTargetedPlayers(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController    obj = (NTGBattlePlayerController)o;
            System.Collections.ArrayList ret = obj.recentTargetedPlayers;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index recentTargetedPlayers on a nil value" : e.Message));
        }
    }
コード例 #26
0
    static int get_walking(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            bool ret = obj.walking;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index walking on a nil value" : e.Message));
        }
    }
コード例 #27
0
    static int set_walking(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.walking = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index walking on a nil value" : e.Message));
        }
    }
コード例 #28
0
    static int get_atkType(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController obj = (NTGBattlePlayerController)o;
            int ret = obj.atkType;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index atkType on a nil value" : e.Message));
        }
    }
コード例 #29
0
    static int get_aic(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            NTGBattlePlayerController   obj = (NTGBattlePlayerController)o;
            UTGBattlePlayerAIController ret = obj.aic;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index aic on a nil value" : e.Message));
        }
    }
コード例 #30
0
    IEnumerator doPassive()
    {
        //Debugger.LogError("cor~~~~~~~~~");
        while (alliedPlayers.Count > 0)
        {
            if (buffPlayer != null && !buffPlayer.alive)
            {
                buffPlayer = null;
            }
            for (int i = alliedPlayers.Count - 1; i >= 0; i--)
            {
                if (!alliedPlayers[i].alive)
                {
                    alliedPlayers.Remove(alliedPlayers[i]);
                }
            }
            if (alliedPlayers.Count == 0)
            {
                break;
            }

            minHpPlayer = alliedPlayers[0];
            foreach (var unit in alliedPlayers)
            {
                if (unit != minHpPlayer && unit.alive && unit.hp < minHpPlayer.hp)
                {
                    minHpPlayer = unit;
                }
            }
            if (minHpPlayer != buffPlayer)
            {
                AddBuff(owner);
                AddBuff(minHpPlayer);
                RemoveBuff(buffPlayer);
                buffPlayer = minHpPlayer;
            }
            yield return(new WaitForSeconds(0.1f));
        }
        //Debugger.LogError("cor end ~~~~~~~~~~~");
        RemoveBuff(owner);
        RemoveBuff(buffPlayer);
        buffPlayer  = null;
        minHpPlayer = null;
        cor         = null;
    }