Bladeren bron

精灵系统相关修改

gitxsm 6 maanden geleden
bovenliggende
commit
a2f6e35b83

+ 2 - 0
script/module/combat/CombatDefine.lua

@@ -231,6 +231,8 @@ COMBAT_OBJ_TYPE1 = 1 --玩家
 COMBAT_OBJ_TYPE2 = 2 --怪物
 COMBAT_OBJ_TYPE3 = 3 --BOSS
 
+COMBAT_OBJ_TYPE99 = 99 --精灵
+
 --职业枚举
 JOB_TYPE1 = 1 --虎卫
 JOB_TYPE2 = 2 --猛将

+ 1 - 0
script/module/combat/CombatImpl.lua

@@ -234,6 +234,7 @@ function setElf(pos, elf)
 	CombatObj.initElf(elfObj)
 
 	elfObj.id = elf.id
+	elfObj.type = elf.type
 	elfObj.body = elf.body or 0
 	elfObj.head = elf.head or 0
 	elfObj.quality = elf.quality or 1

+ 18 - 0
script/module/combat/CombatLogic.lua

@@ -547,6 +547,7 @@ function createElfObj(human, elfId, pos)
 	local itemCfg = ItemConfig[elfId]
 	local elfObj = {}
 	elfObj.id = elfId
+	elfObj.type = CombatDefine.COMBAT_OBJ_TYPE99
 	elfObj.isElf = true
 	elfObj.head = itemCfg and itemCfg.icon or 0
 	elfObj.body = itemCfg and itemCfg.icon or 0
@@ -1083,6 +1084,12 @@ function fontFinishResultNet(net, obj)
        net.body = heroConfig and heroConfig.body.."" or ""
        net.head = heroConfig and heroConfig.head or 0
        net.grade = heroConfig and heroConfig.grade or 0
+	elseif obj.type == CombatDefine.COMBAT_OBJ_TYPE99 then
+		local itemCfg = ItemConfig[obj.id]
+		net.name = itemCfg and itemCfg.name or ""
+		net.body = itemCfg and itemCfg.icon.."" or ""
+		net.head = itemCfg and itemCfg.icon or 0
+		net.grade = 0
     else
        net.name = monsterConfig and monsterConfig.name or ""
        net.body = monsterConfig and monsterConfig.body.."" or ""
@@ -1153,6 +1160,17 @@ function fontCombatFinish(dataNet, combatInfo, isQuick)
 			fontFinishResultNet(net, pet)
 		end
 	end
+
+	-- 出战精灵
+    for _,pos in ipairs(CombatDefine.SIDE2ELFPOS[0]) do
+		local elfObj = combatInfo.elfList and combatInfo.elfList[pos]
+		if elfObj then
+			dataNet.result[0] = dataNet.result[0] + 1
+			local net = dataNet.result[dataNet.result[0]]
+			fontFinishResultNet(net, elfObj)
+		end
+	end
+
 	-- 奖励
 	local rewardItem = combatInfo.rewardItem
     local len = 0 

+ 5 - 0
script/module/combat/CombatPosLogic.lua

@@ -722,6 +722,11 @@ function posQuery(human, combatType, group, param, flag)
     local skillConfig = SkillExcel.skill[skillID]
     msgRet.moshouSkill = skillConfig and skillConfig.icon or ""
 
+	msgRet.elfSystemState = 0
+	if ElfLogic.ModuleisOpen(human) then
+		msgRet.elfSystemState = 1
+	end
+
 	Msg.send(msgRet,human.fd)
 end
 

+ 1 - 0
script/module/combat/Proto.lua

@@ -50,6 +50,7 @@ GC_COMBAT_POS_QUERY = {
     {"moshouLock",	1,	"byte"},          --魔兽开启
     {"moshouSkill",	1,	"string"},        --魔兽开启
     {"totalZdl",	1,	"int"},           --战斗力
+	{"elfSystemState",	1,	"byte"},      -- 精灵系统状态, 0 - 未解锁, 1 -  已解锁
 }
 
 POS_ATTR_DATA = {

+ 10 - 3
script/module/elf/ElfLogic.lua

@@ -269,7 +269,7 @@ end
 
 
 
--- 精灵加成
+-- 外部调用,精灵加成
 function doCalcHero(human, addAttrs)
     if not human or not human.db then
         return
@@ -304,6 +304,12 @@ function doCalcHero(human, addAttrs)
     end
 end
 
+-- 外部调用, 本系统是否开启
+function ModuleisOpen(human)
+    return isOpen(human)
+end
+
+-- 外部调用, 是否有红点
 function isDot(human, dotConfig)
     if not isOpen(human) then
         return false
@@ -333,7 +339,7 @@ function isDot(human, dotConfig)
     end
 end
 
--- 是否激活了精灵
+-- 外部调用,是否激活了精灵
 function IsActivateElf(human, elfId)
     if not isOpen(human) then
         return false
@@ -347,7 +353,7 @@ function IsActivateElf(human, elfId)
     return true
 end
 
--- 获取精灵当前技能
+-- 外部调用,获取精灵当前技能
 function GetElfSkill(human, elfId)
     -- if not isOpen(human) then
     --     return
@@ -369,6 +375,7 @@ end
 
 
 
+
 -- 请求某个品质的所有精灵的简单数据
 function Elf_SimpleData_Query(human, targetElfQuality)
     if not isOpen(human) then