Browse Source

boss Buff

ybx_Gdn 1 year ago
parent
commit
4141e90c1a

+ 8 - 0
Assets/Lua/Config/HardBossBuffCfg.lua

@@ -0,0 +1,8 @@
+local HardBossBuffCfg ={
+[1] = {
+['LeveId']=10001,
+['buffEffect'] = {{6,-20}}
+}
+}
+
+return HardBossBuffCfg

+ 7 - 0
Assets/Lua/Config/HardBossBuffCfg.lua.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 35178099a6a1fda4397bb21ad430b06a
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 16 - 0
Assets/Lua/Config/LevelDifficultCfg.lua

@@ -79,5 +79,21 @@ local LevelDifficultCfg = {
         ['Function'] = { { 70036, -5, 999 } },
         ['WarriorScore'] = 40,
     },   
+    [6]={
+        ['Id']=84,
+        ['BuffId']=50028,
+        ['Ratio']=100,
+        ['CD']=0,
+        ['ConditionType']=128,
+        ['ExtendPara']=0,
+        ['Type']=1,
+        ['Quality']=3,
+        ['FilterParam']={5},
+        ['Desc']='戰鬥開場,劍士受到傷害減少20%',
+        ['Name']='朗基努斯Ⅲ',
+        ['Icon']='GodBless/buff_role_ljns_mvp',
+        ['Function']={{70120,0.2,999},{70121,0.2,999}},
+        ['WarriorScore']=15,
+    },
 }
 return LevelDifficultCfg

+ 36 - 3
Assets/Lua/Managers/LuaBattleMgr.lua

@@ -701,7 +701,7 @@ function LuaBattleMgr:SetBattleData(data,first,IsShowEnterNextMap)
             self.usedQuickBattleTimes = data.quick_battle.day_times
         end
     end
-   self:SetCurDifAttr()
+   --self:SetCurDifAttr()
     ManagerContainer.LuaGameMgr:SetMapLevelId(self.curMapId,self.curLevelId);
     if IsShowEnterNextMap or (preMapId > 0 and preMapId~= self.curMapId ) then
         if self.nextMapState == NextMapState.WaitServer then
@@ -859,6 +859,7 @@ end
 function LuaBattleMgr:OnBossSpawned(bossActor,bossName,life,maxLife,skillParam,isPlayRecord)
     self.bKillBoss = true
     --boos 展示等级设置为当前关卡Turn
+    self:AddBuffToActor(bossActor,true)
     local curLevel = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
     local levelData = ManagerContainer.CfgMgr:GetLevelDataById(curLevel)
     bossActor.ShowLevel = levelData.Turn
@@ -905,9 +906,17 @@ function LuaBattleMgr:OnBattleStartBoss()
     end
 end
 
-function LuaBattleMgr:AddBuffToActor(actor)
+function LuaBattleMgr:AddBuffToActor(actor,isboss)
     local buffCfgs = ManagerContainer.CfgMgr:GetLevelDifficultCfg()
-    local dropBuffs = self:GetDropBuffs(buffCfgs)
+    local dropBuffs = nil
+
+    if isboss ~= nil and isboss then
+        --dropBuffs = self:CreatBuffs(buffCfgs,{{6,1}})
+    else
+        
+        dropBuffs =  self:GetDropBuffs(buffCfgs)
+    end
+
     if dropBuffs ~= nil then
         local dropBuffParamList = System.Array.CreateInstance(Enum.TypeInfo.BuffParam, #dropBuffs)
         for j = 1, #dropBuffs do
@@ -949,6 +958,30 @@ function LuaBattleMgr:GetDropBuffs(buffCfgs)
     end
     return bufflist
 end
+function LuaBattleMgr:CreatBuffs(buffCfgs,buffEffects)
+    local bufflist = {}
+    if buffCfgs == nil or buffEffects == nil then
+        return bufflist
+    end
+   
+    for _, v in pairs(buffEffects) do
+        local buffCfg =  buffCfgs[v[1]]-- 获取buff配置
+        if buffCfg ~= nil then
+            local funlist = {}
+            for _, buffFun in pairs(buffCfg.Function) do
+                local fun = {buffFun[1],v[2],buffFun[3]}
+                funlist[#funlist +1] = fun
+            end
+            LogError("FunList = "..Inspect(funlist))
+            local buff = ExpeditionBuff:new(buffCfg.BuffId,buffCfg.Ratio,buffCfg.CD,buffCfg.ConditionType,buffCfg.ExtendPara,funlist)
+            bufflist[#bufflist+1] = buff  
+        end
+        
+    end
+   
+    
+    return bufflist
+end
 
 function  LuaBattleMgr:GetCurLeveDebuffCfg()
     local id = self:GetCurDiffLvID()

+ 10 - 1
Assets/Src/Utils/SDataUtil.cs

@@ -1,4 +1,4 @@
-using UnityEngine;
+using UnityEngine;
 using System.Collections;
 
 public static class SDataUtil
@@ -383,6 +383,15 @@ public static class SDataUtil
         return b;
     }
 
+    public static long InvConvert(SLong b)
+    {
+        return (long)b;
+    }
+
+    public static long InvConvert(long a)
+    {
+        return a;
+    }
     public static double InvConvertDouble(SFloat b)
     {
         float value = SFloat.InvConvert(b);

+ 1 - 0
Assets/ToLua/Editor/Custom/CustomSettings.cs

@@ -188,6 +188,7 @@ public static class CustomSettings
         _GT (typeof (HorizontalLayoutGroup)),
         _GT (typeof (MeshFilter)),
         _GT (typeof (Int32)),
+        _GT(typeof(Int64)),
         _GT (typeof (PlayerPrefs)),
         _GT (typeof (ToggleGroup)),
         _GT (typeof (Quaternion)),

+ 14 - 0
Assets/ToLua/Source/Generate/SDataUtilWrap.cs

@@ -681,6 +681,20 @@ public class SDataUtilWrap
 				LuaDLL.lua_pushnumber(L, o);
 				return 1;
 			}
+			else if (count == 1 && TypeChecker.CheckTypes<SLong>(L, 1))
+			{
+				SLong arg0 = StackTraits<SLong>.To(L, 1);
+				long o = SDataUtil.InvConvert(arg0);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
+			else if (count == 1 && TypeChecker.CheckTypes<long>(L, 1))
+			{
+				long arg0 = LuaDLL.tolua_toint64(L, 1);
+				long o = SDataUtil.InvConvert(arg0);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
 			else
 			{
 				return LuaDLL.luaL_throw(L, "invalid arguments to method: SDataUtil.InvConvert");

+ 285 - 0
Assets/ToLua/Source/Generate/System_Int64Wrap.cs

@@ -0,0 +1,285 @@
+//this source code was auto-generated by tolua#, do not modify it
+using System;
+using LuaInterface;
+
+public class System_Int64Wrap
+{
+	public static void Register(LuaState L)
+	{
+		L.BeginClass(typeof(System.Int64), null);
+		L.RegFunction("CompareTo", CompareTo);
+		L.RegFunction("Equals", Equals);
+		L.RegFunction("GetHashCode", GetHashCode);
+		L.RegFunction("ToString", ToString);
+		//L.RegFunction("TryFormat", TryFormat);
+		L.RegFunction("Parse", Parse);
+		L.RegFunction("TryParse", TryParse);
+		L.RegFunction("GetTypeCode", GetTypeCode);
+		L.RegFunction("New", _CreateSystem_Int64);
+		L.RegFunction("__tostring", ToLua.op_ToString);
+		L.RegConstant("MaxValue", 9.22337203685478E+18);
+		L.RegConstant("MinValue", -9.22337203685478E+18);
+		L.EndClass();
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int _CreateSystem_Int64(IntPtr L)
+	{
+		System.Int64 obj = new System.Int64();
+		LuaDLL.tolua_pushint64(L, obj);
+		return 1;
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int CompareTo(IntPtr L)
+	{
+		try
+		{
+			int count = LuaDLL.lua_gettop(L);
+
+			if (count == 2 && TypeChecker.CheckTypes<long>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				long arg0 = LuaDLL.tolua_toint64(L, 2);
+				int o = obj.CompareTo(arg0);
+				LuaDLL.lua_pushinteger(L, o);
+				ToLua.SetBack(L, 1, obj);
+				return 1;
+			}
+			else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				object arg0 = ToLua.ToVarObject(L, 2);
+				int o = obj.CompareTo(arg0);
+				LuaDLL.lua_pushinteger(L, o);
+				ToLua.SetBack(L, 1, obj);
+				return 1;
+			}
+			else
+			{
+				return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int64.CompareTo");
+			}
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int Equals(IntPtr L)
+	{
+		try
+		{
+			int count = LuaDLL.lua_gettop(L);
+
+			if (count == 2 && TypeChecker.CheckTypes<long>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				long arg0 = LuaDLL.tolua_toint64(L, 2);
+				bool o = obj.Equals(arg0);
+				LuaDLL.lua_pushboolean(L, o);
+				ToLua.SetBack(L, 1, obj);
+				return 1;
+			}
+			else if (count == 2 && TypeChecker.CheckTypes<object>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				object arg0 = ToLua.ToVarObject(L, 2);
+				bool o = obj.Equals(arg0);
+				LuaDLL.lua_pushboolean(L, o);
+				ToLua.SetBack(L, 1, obj);
+				return 1;
+			}
+			else
+			{
+				return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int64.Equals");
+			}
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int GetHashCode(IntPtr L)
+	{
+		try
+		{
+			ToLua.CheckArgsCount(L, 1);
+			System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+			int o = obj.GetHashCode();
+			LuaDLL.lua_pushinteger(L, o);
+			ToLua.SetBack(L, 1, obj);
+			return 1;
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int ToString(IntPtr L)
+	{
+		try
+		{
+			int count = LuaDLL.lua_gettop(L);
+
+			if (count == 1)
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				string o = obj.ToString();
+				LuaDLL.lua_pushstring(L, o);
+				return 1;
+			}
+			else if (count == 2 && TypeChecker.CheckTypes<System.IFormatProvider>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				System.IFormatProvider arg0 = (System.IFormatProvider)ToLua.ToObject(L, 2);
+				string o = obj.ToString(arg0);
+				LuaDLL.lua_pushstring(L, o);
+				return 1;
+			}
+			else if (count == 2 && TypeChecker.CheckTypes<string>(L, 2))
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				string arg0 = ToLua.ToString(L, 2);
+				string o = obj.ToString(arg0);
+				LuaDLL.lua_pushstring(L, o);
+				return 1;
+			}
+			else if (count == 3)
+			{
+				System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+				string arg0 = ToLua.CheckString(L, 2);
+				System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.CheckObject<System.IFormatProvider>(L, 3);
+				string o = obj.ToString(arg0, arg1);
+				LuaDLL.lua_pushstring(L, o);
+				return 1;
+			}
+			else
+			{
+				return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int64.ToString");
+			}
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int Parse(IntPtr L)
+	{
+		try
+		{
+			int count = LuaDLL.lua_gettop(L);
+
+			if (count == 1 && TypeChecker.CheckTypes<string>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				long o = System.Int64.Parse(arg0);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
+		
+			else if (count == 2 && TypeChecker.CheckTypes<string, System.Globalization.NumberStyles>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.ToObject(L, 2);
+				long o = System.Int64.Parse(arg0, arg1);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
+			else if (count == 2 && TypeChecker.CheckTypes<string, System.IFormatProvider>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				System.IFormatProvider arg1 = (System.IFormatProvider)ToLua.ToObject(L, 2);
+				long o = System.Int64.Parse(arg0, arg1);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
+		
+			else if (count == 3 && TypeChecker.CheckTypes<string, System.Globalization.NumberStyles, System.IFormatProvider>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.ToObject(L, 2);
+				System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
+				long o = System.Int64.Parse(arg0, arg1, arg2);
+				LuaDLL.tolua_pushint64(L, o);
+				return 1;
+			}
+		
+			else
+			{
+				return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int64.Parse");
+			}
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int TryParse(IntPtr L)
+	{
+		try
+		{
+			int count = LuaDLL.lua_gettop(L);
+
+			if (count == 2 && TypeChecker.CheckTypes<string, LuaInterface.LuaOut<long>>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				long arg1;
+				bool o = System.Int64.TryParse(arg0, out arg1);
+				LuaDLL.lua_pushboolean(L, o);
+				LuaDLL.tolua_pushint64(L, arg1);
+				return 2;
+			}
+		
+			else if (count == 4 && TypeChecker.CheckTypes<string, System.Globalization.NumberStyles, System.IFormatProvider, LuaInterface.LuaOut<long>>(L, 1))
+			{
+				string arg0 = ToLua.ToString(L, 1);
+				System.Globalization.NumberStyles arg1 = (System.Globalization.NumberStyles)ToLua.ToObject(L, 2);
+				System.IFormatProvider arg2 = (System.IFormatProvider)ToLua.ToObject(L, 3);
+				long arg3;
+				bool o = System.Int64.TryParse(arg0, arg1, arg2, out arg3);
+				LuaDLL.lua_pushboolean(L, o);
+				LuaDLL.tolua_pushint64(L, arg3);
+				return 2;
+			}
+           
+			else
+			{
+				return LuaDLL.luaL_throw(L, "invalid arguments to method: System.Int64.TryParse");
+			}
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+
+	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
+	static int GetTypeCode(IntPtr L)
+	{
+		try
+		{
+			ToLua.CheckArgsCount(L, 1);
+			System.Int64 obj = (System.Int64)ToLua.CheckObject(L, 1, typeof(System.Int64));
+			System.TypeCode o = obj.GetTypeCode();
+			ToLua.Push(L, o);
+			ToLua.SetBack(L, 1, obj);
+			return 1;
+		}
+		catch (Exception e)
+		{
+			return LuaDLL.toluaL_exception(L, e);
+		}
+	}
+}
+

+ 11 - 0
Assets/ToLua/Source/Generate/System_Int64Wrap.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d04704977439abc4f8ed469e62021bcf
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: