Просмотр исходного кода

1.修改战斗逻辑 2.秘宝新效果相关代码 3.失落神庙打到条件后可以跳过功能 4.统一战斗结束后处理函数参数顺序

gitxsm 1 год назад
Родитель
Сommit
a11e3f418a

+ 6 - 6
script/module/battle/BattleLogic.lua

@@ -3731,13 +3731,13 @@ function BattleLogic_AddMopup(human, nGoodsID, nGoodsNum)
         return
     end
 
-    -- 检测数量
-    if false == BagLogic.checkItemCnt(human, nGoodsID, nGoodsNum) then
-        return
-    end
+    -- -- 检测数量
+    -- if false == BagLogic.checkItemCnt(human, nGoodsID, nGoodsNum) then
+    --     return
+    -- end
 
-    -- 消耗物品
-    BagLogic.delItem(human, nGoodsID, nGoodsNum, "battle")
+    -- -- 消耗物品
+    -- BagLogic.delItem(human, nGoodsID, nGoodsNum, "battle")
 
     -- 增加次数
     BattleLogic_SetAddFreeMopupNum(human, nGoodsNum)

+ 23 - 0
script/module/combat/CombatBuff.lua

@@ -44,6 +44,29 @@ function isStop(obj)
 	return ret
 end
 
+--判断英雄身上是否只有控制buff中的charao
+function IsJustHaveChanraoBuff(obj)
+	if not obj then
+		return false
+	end
+
+	local bufferCmd = obj.bufferCmd
+	if not bufferCmd then
+		return false
+	end
+	
+	if bufferCmd["xuanyun"] or bufferCmd["shihua"] or bufferCmd["bingdong"] then
+		return false
+	end
+
+	if bufferCmd["chanrao"] then
+		return true
+	end
+	return false
+end
+
+
+
 --使用主动技能
 function isJingji(obj)
 	if obj.bufferCmd["jinmo"] then

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

@@ -1023,7 +1023,10 @@ end
 function comboAgain(obj, type, hurtRate, comboSkillID, skip)
     if not obj or obj.hp <=0 then return end
 	local stop = CombatBuff.isStop(obj)
-    if stop and skip == nil then return end
+
+	--新增条件,如果控制buff只有chanrao也能继续执行
+	if stop and skip == nil and not CombatBuff.IsJustHaveChanraoBuff(obj)  then return end
+
     local skillID = comboSkillID or getSkillID(obj)
     if skillID then
        comboType = type

+ 3 - 3
script/module/combat/CombatLogic.lua

@@ -231,12 +231,12 @@ end
 
 
 -- 战斗结束回调 在发送GC_COMBAT_FINISH前
-local function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+local function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	local moduleFn = getModule(combatType)
 	if not moduleFn then return end
 	if not moduleFn.onFightEnd then return end
 
-	moduleFn.onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+	moduleFn.onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 end
 
 -- 战斗名称
@@ -1287,7 +1287,7 @@ function combatBegin(human, mapID, param, combatType, cbParam, isSaodang)
 	local isQuick = human.db.combatQuick[combatType] == 1-- 是否跳过战斗
 	if isSaodang or isQuick then 
 		-- 扫荡/跳过战斗需要立刻出结果
-		onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+		onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 		sendCombatFinish(human, combatInfo)
 	else
 		-- 发送战斗开始+战斗帧

+ 14 - 1
script/module/combat/CombatObj.lua

@@ -423,7 +423,20 @@ function getValue(obj,key)
 	if obj.isPet then
 		return 0
 	end
-	return obj.attr[key] or 0
+
+	if key == RoleDefine.SUB_HP_COMBAT then
+		local hpNow = obj.hp or 0
+		local hpMax = getHpMax(obj) or 0
+		if hpMax <= 0 then
+			print(string.format("战斗数据错误, obj.id: %d, obj.pos: %d", obj.id, obj.pos))
+			return 0
+		end
+		local res = hpNow / hpMax
+		res = math.floor(res * 10000) --取到小数点后四位,再转成整数
+		return res
+	else
+		return obj.attr[key] or 0
+	end
 end
 
 function setValue(obj,key,value)

+ 1 - 1
script/module/drawCard/DrawCardLogic.lua

@@ -398,7 +398,7 @@ function checkUseItem(human, id, op, config,isAct)
         local vipArg = 100
         vipArg = VipLogic.getPowerArgs(human, VipLogic.VIP_POWER21)
         print(" checkUseItem  vipArg   ", vipArg, "  ,   old  :  " ,itemCnt , "  ,  new : ", math.floor(itemCnt * vipArg / 100 ) )
-        itemCnt = math.floor(itemCnt * vipArg / 100 )
+        finalItemCnt = math.floor(itemCnt * vipArg / 100 )
     end 
     print("  checkUseItem   itemID  itemCnt ", itemID, finalItemCnt)
     -- 活动只扣道具

+ 9 - 0
script/module/equip/EquipWash.lua

@@ -12,6 +12,7 @@ local Broadcast = require("broadcast.Broadcast")
 local HeroLogic = require("hero.HeroLogic")
 local Util = require("common.Util")
 local HeroGrowUp = require("absAct.HeroGrowUp")
+local ObjHuman = require("core.ObjHuman")
 
 -- 取出合适的装备
 local function getEquipGrid(human, bagIndex, heroUuid, pos)
@@ -252,4 +253,12 @@ function randomSave(human, bagIndex, heroUuid, pos)
 
     Broadcast.sendErr(human, Lang.EQUIP_WASH_SAVE_SUC)
     randomQuery(human, bagIndex, heroUuid, pos)
+
+    --刷新属性
+    local heroGrid, heroIndex = HeroLogic.getHeroGridByUuid(human, heroUuid)
+    if not heroGrid or not heroIndex or not heroGrid.id then
+        return Broadcast.sendErr(human, Lang.DRILL_CHOOSE_FRIEND_ERR_INFO)
+    end
+    ObjHuman.doCalcHero(human, heroIndex)
+    HeroLogic.sendHeroBagDynamic(human, heroGrid.id, heroIndex)
 end

+ 1 - 1
script/module/friend/FriendLogic.lua

@@ -457,7 +457,7 @@ function fight(human, args)
 end
 
 
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
     local videoUuid = CombatVideo.saveCombatVideo(human, true)
     if videoUuid then		
        local msgRet = Msg.gc.GC_COMBAT_RETURN_RECORD

+ 1 - 1
script/module/jjcLadder/JjcLadderLogic.lua

@@ -530,7 +530,7 @@ function fight(human, args, combatType)
 end
 
 -- 战斗结束回调
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang, param)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	print("   onFightEnd   onFightEnd  onFightEnd onFightEnd")
 	--print("fight end", result, combatInfo, result)
 	if not cbParam or not cbParam.uuid then

+ 2 - 0
script/module/lostTemple/Proto.lua

@@ -65,6 +65,8 @@ GC_LOST_TEMPLE_MONSTER = {
     { "gdReward", 10, ItemData },
     { "randomReward", 10, ItemData },
     { "list", 6, HeroSimple },
+    {"quick",     1,       "byte"},    -- 是否勾选了跳过,0-没有勾选,1-勾选了
+    {"showNext",  1,       "byte"},    -- 是否显示跳过,0-不显示,1-显示
 }
 
 -- 英雄信息

+ 32 - 25
script/module/lostTemple/lostTempleCombatLogic.lua

@@ -1,6 +1,5 @@
 --[[
-    ʧ������ ս��ģ��
-
+    失落神庙 战斗模块
 ]]
 local Msg = require("core.Msg")
 local LuaMongo = _G.lua_mongo
@@ -27,10 +26,12 @@ local BeSkill = require("combat.BeSkill")
 local Skill = require("combat.Skill")
 local RoleAttr = require("role.RoleAttr")
 local ItemDefine = require("bag.ItemDefine")
+local Broadcast = require("broadcast.Broadcast")
+local Lang = require("common.Lang")
 
 
 -------------------------------------- combat -----------------------------------------
--- ��ȡ����
+-- 获取属性
 function getHeroAttrs(human, index)
     human.lostTempleAttr = human.lostTempleAttr or { }
     if not human.lostTempleAttr[index] then
@@ -39,7 +40,7 @@ function getHeroAttrs(human, index)
     return human.lostTempleAttr[index]
 end
 
--- ����uuid ��ȡheroGrid
+-- 根据uuid 获取heroGrid
 function getHeroGridByUuid(human, uuid)
     if not uuid or uuid == "" or uuid == "0" then return end
 
@@ -52,7 +53,7 @@ function getHeroGridByUuid(human, uuid)
         end
     end
 
-    -- ��ȡ��ʱ������
+    -- 获取临时背包的
     if human.lostTemple and human.lostTemple.summonHero then
         for i = 1, human.lostTemple.summonHero[0] do
             local heroGrid = human.lostTemple.summonHero[i]
@@ -67,7 +68,7 @@ function getHeroGridByUuid(human, uuid)
     return nil
 end
 
--- �����趨
+-- 阵容设定
 function checkUpdatePos(human, msg)
     if not human.lostTemple then return end
 
@@ -78,17 +79,17 @@ function checkUpdatePos(human, msg)
     local useList = { }
     local fatherList = { }
 
-    -- ȷ��Ӣ�۴治����
+    -- 确定英雄存不存在
     for i = 1, CombatDefine.COMBAT_HERO_CNT do
         local uuid = heroList[i] or ""
         if uuid ~= "0" and uuid ~= "" then
             if i == CombatDefine.COMBAT_HERO_CNT and CombatPosLogic.canBackup(human) == 0 then
-                -- Ԯ��δ����
+                -- 援军未激活
                 return
             end
 
             if posList[i] == nil and i ~= CombatDefine.COMBAT_HERO_CNT then
-                -- վλ������
+                -- 站位不可用
                 return
             end
 
@@ -97,7 +98,7 @@ function checkUpdatePos(human, msg)
 
             local heroConfig = HeroExcel.hero[heroGrid.id]
             if useList[uuid] or fatherList[heroGrid.id] then
-                -- ͬ����Ӣ���ظ�
+                -- 同父类英雄重复
                 return
             else
                 cnt = cnt + 1
@@ -107,10 +108,10 @@ function checkUpdatePos(human, msg)
         end
     end
     if cnt == 0 then
-        -- ����Ӣ�ۿ�
+        -- 上阵英雄空
         return
     end
-    -- ��鸨�������Ƿ񼤻� todo
+    -- 检查辅助对象是否激活 todo
 
     return true, heroList, helpList
 end
@@ -119,7 +120,7 @@ end
 
 
 
--- ս��ǰ������
+-- 战斗前加属性
 function onFightBegin(human, cbParam, combatType, param)
     local putY = tonumber(param[1])
     if not putY then return end
@@ -129,12 +130,12 @@ function onFightBegin(human, cbParam, combatType, param)
     if not grid.monsterOutID then return end
 
     for index = 1, CombatDefine.COMBAT_HERO_CNT do
-        -- ����Ѫ��
+        -- 攻方血量
         local atkPos = CombatLogic.getPos(CombatDefine.ATTACK_SIDE, index)
         local atkObj = CombatImpl.objList[atkPos]
 
         if atkObj ~= nil then
-           -- Ӣ��״̬
+           -- 英雄状态
            if human.lostTemple.heroStatus then
               local hpRate = human.lostTemple.heroStatus[atkObj.uuid] or 1.0
               local hpMax = CombatObj.getHpMax(atkObj)
@@ -148,7 +149,7 @@ function onFightBegin(human, cbParam, combatType, param)
               end
            end
 
-           -- ����
+           -- 属性
            if human.lostTemple.summonTree then
               atkObj.isSysAttrChange = true
               for key, value in pairs(human.lostTemple.summonTree) do
@@ -157,7 +158,7 @@ function onFightBegin(human, cbParam, combatType, param)
            end
         end
 
-        -- �ط�Ѫ��
+        -- 守方血量
         local defPos = CombatLogic.getPos(CombatDefine.DEFEND_SIDE, index)
         local defObj = CombatImpl.objList[defPos]
         local objStatus = grid.objStatus and grid.objStatus[defPos] or nil
@@ -169,7 +170,7 @@ function onFightBegin(human, cbParam, combatType, param)
 end
 
 
--- ����Ӣ�۱���������ʱ����
+-- 根据英雄背包创建临时对象
 function createHumanObj(human, uuid)
     if not uuid then return end
     local heroGrid = getHeroGridByUuid(human, uuid)
@@ -178,7 +179,7 @@ function createHumanObj(human, uuid)
     return CombatLogic.createHeroObjByHeroGrid(human, heroGrid)
 end
 
--- ��ȡӢ������
+-- 获取英雄阵容
 function getHumanObjList(human, combatType)
     local teamType = CombatPosLogic.getTeamType(combatType)
     if not teamType then return end
@@ -214,7 +215,7 @@ function getHumanObjList(human, combatType)
 end
 
 
--- ��ȡ������id
+-- 获取怪物组id
 function getCombatMonsterOutID(human, side, args, combatType)
     if side == CombatDefine.ATTACK_SIDE then return end
 
@@ -228,7 +229,7 @@ function getCombatMonsterOutID(human, side, args, combatType)
     return grid.monsterOutID
 end
 
--- ս��
+-- 战斗
 function fight(human, args)
     if not human.lostTemple then return end
 
@@ -239,11 +240,17 @@ function fight(human, args)
     if not grid then return end
     if not grid.monsterOutID then return end
 
+    local power = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE24)
+    if power <= 0 then
+        Broadcast.sendErr(human, Lang.COMBAT_ERR_NO_SET_FIGHT)
+        return
+    end
+
     CombatLogic.combatBegin(human, 1001, args, CombatDefine.COMBAT_TYPE24)
 end
 
 
--- ս������
+-- 战斗结束
 function onFightEnd(human, result, combatType, cbParam, combatInfo, param)
     if not human.lostTemple then return end
 
@@ -289,7 +296,7 @@ function onFightEnd(human, result, combatType, cbParam, combatInfo, param)
         end
     else
         grid.objStatus = grid.objStatus or { }
-        -- ���·��ط�Ѫ��
+        -- 更新防守方血量
         for index = 1, CombatDefine.COMBAT_HERO_CNT do
             local defPos = CombatLogic.getPos(CombatDefine.DEFEND_SIDE, index)
             local defObj = combatInfo.objList[defPos]
@@ -303,7 +310,7 @@ function onFightEnd(human, result, combatType, cbParam, combatInfo, param)
         end
     end
 
-    -- ���¹�����Ѫ��
+    -- 更新攻击方血量
     local combatHero = CombatPosLogic.getCombatHeros(human, CombatDefine.COMBAT_TYPE24)
     human.lostTemple.heroStatus = human.lostTemple.heroStatus or { }
     for index = 1, CombatDefine.COMBAT_HERO_CNT do
@@ -317,7 +324,7 @@ function onFightEnd(human, result, combatType, cbParam, combatInfo, param)
                human.lostTemple.heroStatus[atkObj.uuid] = hpRate
             end
 
-            -- ����Ӣ������
+            -- 阵上英雄下阵
             if combatHero and hp <= 0 then  
                for pos, uuid in pairs(combatHero) do
                   if uuid == atkObj.uuid then

+ 14 - 0
script/module/lostTemple/lostTempleLogic.lua

@@ -38,6 +38,9 @@ DAY_7s = 604800
 DAY_2s = 172800
 DAY_1s = 86400
 
+--跳过战斗需要的战力
+local SHOWQUICKPOWER = 2000000
+
 function initAfterHot()
 
 end
@@ -787,6 +790,17 @@ local function monsterQuery(human, grid, elementConfig)
             HeroGrid.makeHeroSimpleByMonsterID(msgRet.list[msgRet.list[0]], monsterID, others)
         end
     end
+
+    msgRet.showNext = 0
+    if human.db.zhandouli >= SHOWQUICKPOWER then
+        msgRet.showNext = 1
+    end
+
+    msgRet.quick = 0
+    if human.db.combatQuick[CombatDefine.COMBAT_TYPE24] == 1 then
+        msgRet.quick = 1
+    end
+
     Msg.send(msgRet, human.fd)
 end
 

+ 1 - 0
script/module/role/RoleDefine.lua

@@ -138,6 +138,7 @@ INIT_HP_COMBAT		= 312 --战斗时的初始血量
 HURT_RATE_MAX 		= 313 --最大伤害率(最大血量为基数)
 BACKUP_COMBAT		= 314 -- 援军替换站位
 HURT_COMBAT_TOTAL	= 315 -- 总伤害
+SUB_HP_COMBAT		= 316 --剩余血量百分比
 
 JIANSHANG_RATE_MAX	= 7000 --减伤率上限7000
 DEFAUT_MINGZHONG = 10000 -- 默认命中

+ 1 - 1
script/module/shop/WarOrder.lua

@@ -19,7 +19,7 @@ local arenaOrder = 4
 local passBattleExp = 5
 local passDevilExp = 5
 local passClanBattleExp = 10
-local victoryArenaBattleExp = 2
+local victoryArenaBattleExp = 3
 
 local orderExpMap = {
     [battleOrder] = passBattleExp,

+ 6 - 0
script/module/skin/SkinLogic.lua

@@ -290,6 +290,9 @@ function getBody(human,heroInd)
     end
 	local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
     local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
+    if not heroGrid then 
+        return
+    end
 	local skinId = heroGrid.skinOn
 	if not skinId then 
 		return
@@ -308,6 +311,9 @@ end
 
 function getHeroSkin(human,heroInd)
 	local heroId = HeroLogic.getHeroIdByIndex(human,heroInd)
+    if not heroId then
+        return
+    end
     local heroGrid = HeroLogic.getHeroGrid(human,heroId,heroInd)
 	local skinId = heroGrid.skinOn
 	if not skinId then

+ 3 - 0
script/module/talisman/TalismanLogic.lua

@@ -42,6 +42,9 @@ OTHER_EFFECT_TBL = {
     ["NW_FWJH"] = "NW_FWJH",                        --女巫森林符文精华
     ["NW_CHALLENGE_TIMES"] = "NW_CHALLENGE_TIMES",  --女巫森林所有类型挑战次数
     ["XUANSHANG_QB_MAX"] = "XUANSHANG_QB_MAX",      --悬赏情报上限
+    ["ZHANBU_POS6"] = "ZHANBU_POS6",                --占卜解锁格子6
+    ["ZHANBU_POS7"] = "ZHANBU_POS7",                --占卜解锁格子7
+    ["ZHANBU_FRAGMENT"] = "ZHANBU_FRAGMENT",        --占卜获得碎片加成
 }
 
 --是否开启本系统

+ 1 - 1
script/module/valley/ValleyLogic.lua

@@ -1034,7 +1034,7 @@ function onFightBegin(human, cbParam)
 end
 
 -- 战斗结束回调
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	print("fight end", result, combatInfo, result)
 
 	-- 如果两边都没死,按照

+ 1 - 1
script/module/yjTreasure/YjTreasureCombat.lua

@@ -531,7 +531,7 @@ function sdMonsterOpenGrids(human,gridIndex,itemTb)
 	YjTreasureDBLogic.updateUuid2Role(roleData)
 end
 
-function onFightEnd(human, result, type, gridIndex, combatInfo, isQuick)
+function onFightEnd(human, result, type, gridIndex, combatInfo, param, isQuick)
 	resetCombatHp(human.db._id,combatInfo,gridIndex) --刷新血量
 	if CombatDefine.RESULT_WIN == result then -- 胜利处理
 		killMonsterOpenGrids(human,gridIndex)

+ 1 - 1
script/module/yunying/YunYingLogic.lua

@@ -417,6 +417,7 @@ function sendIcons(human)
     for _, YYInfo in pairs(ID2YYInfo) do
         if isOpen(YYInfo, human, true) and
             YYInfo.config.pos == YUNYING_POS_TYPE1 then
+            print("[sendIcons] 发送的活动ID = "..YYInfo.yyID)
             if msgRet.list[0] >= maxLen then
                 break
             end
@@ -500,7 +501,6 @@ function sendGroupList(human, panelID)
     -- 通过运营ID获取运营信息
     local YYInfo = ID2YYInfo[actID]
     if not isOpen(YYInfo, human, true) then
-        print("============ panel not open ",panelID)
         return
     end
 

+ 2 - 2
script/module/zhanbu/Proto.lua

@@ -11,7 +11,7 @@ CG_ZHANBU_QUERY = {}
 
 GC_ZHANBU_QUERY = {
     {"heroPool",5,CardInfo},    -- 卡池的牌
-    {"hand",5,CardInfo},        -- 手牌
+    {"hand",7,CardInfo},        -- 手牌
     {"cardRate",3,"double"},      -- 卡的概率 1 R 2 SR 3 SSR
     {"lv",1,"byte"},            -- 卡池等级
     {"money",1,"int"},         -- 拥有道具数
@@ -20,7 +20,7 @@ GC_ZHANBU_QUERY = {
     {"nextRecover",1,"int"},    -- 下一次回复剩余时间
     {"recoverTs",1,"int"},     -- 回复时间
     {"isGuide",1,"byte"},      -- 是否新手引导 1是
-    {"isLock",1,"byte"},        -- 第五格是否被锁住
+    {"isLock",3,"byte"},        -- 5~7位置的解锁状态,1-锁定 0-解锁
     {"hasRed",1,"byte"},        -- 是否设置了心仪英雄
 }
 

+ 121 - 41
script/module/zhanbu/ZhanbuLogic.lua

@@ -39,6 +39,48 @@ local CARD_POOL_REFRESH = 2             -- ˢ�¿����������
 local AUTO_GET_MONEY_TS = 300          -- �Զ��ظ�����ʱ��
 CARD_POOL = CARD_POOL or {}
 
+--初始时hand拥有的数量
+local INITIALHANDCNT = 4
+--hand最大拥有的数量
+local MAXHANDCNT = 7
+
+
+--获取来自秘宝的加成
+local function getTalismanAdd(human, addType)
+    local addValue = TalismanLogic.getTalismanAdd(human, addType) or 0
+    return addValue
+end
+
+local function getHandInfo(human)
+    local isUnlock = false
+    local extraPosList = {}
+    local realyHandCnt = INITIALHANDCNT
+
+    for i=INITIALHANDCNT+1, MAXHANDCNT do
+        isUnlock = false
+        if i == 5 then
+            if ChengjiuLogic.checkPrivilege(human, ChengjiuDefine.PRIVILEGE_TYPE_7) then
+                isUnlock = true
+            end
+        elseif i == 6 then
+            if getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_POS6) > 0 then
+                isUnlock = true
+            end
+        elseif i == 7 then
+            if getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_POS7) > 0 then
+                isUnlock = true
+            end
+        end
+
+        if isUnlock then
+            extraPosList[i] = i
+            realyHandCnt = realyHandCnt + 1
+        end
+    end
+    return realyHandCnt, extraPosList
+end
+
+
 function initAfterStart()
     for i = 1,#ZhanbuExcel.pool do
         local grade = ZhanbuExcel.pool[i].grade
@@ -52,28 +94,28 @@ function initAfterStart()
     end
 end
 
---获取最大占卜积分的加成值
-local function getMaxPointsAdd(human)
-    local maxPointsAdd = TalismanLogic.getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS) or 0
-    return maxPointsAdd
-end
-
 
 local function initDB(human)
     if human.db.zhanbu == nil then
-        local maxPointsAdd = getMaxPointsAdd(human)
+        local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
         human.db.zhanbu = {}
         local zhanbu = human.db.zhanbu
         zhanbu.hand = {}
         zhanbu.handCnt = 0
-        zhanbu.handMaxCnt = 4   -- ���������Ϊ4��
+        --zhanbu.handMaxCnt = 4   -- ���������Ϊ4��
+        zhanbu.handMaxCnt = MAXHANDCNT  --直接改成最大值方便一点
         zhanbu.money = AUTO_GET_MONEY_MAX + maxPointsAdd
         zhanbu.lv = 1
         zhanbu.isGuide = 1
         zhanbu.refreshCnt = 0
         zhanbu.heartHero = {}
         zhanbu.pool = {}
-        refreshPool(human)
+        refreshPool(human) 
+    end
+
+    --处理老号
+    if human.db.zhanbu and human.db.zhanbu.handMaxCnt < MAXHANDCNT then
+        human.db.zhanbu.handMaxCnt = MAXHANDCNT
     end
 
     -- ���û�û��heartHero
@@ -81,18 +123,19 @@ local function initDB(human)
         human.db.zhanbu.heartHero = {}
     end
 
-    local cjPrivilege = ChengjiuLogic.checkPrivilege(human, ChengjiuDefine.PRIVILEGE_TYPE_7)
-    if cjPrivilege then
-        -- �Ѽ������Ȩ����Ϊ5��
-        human.db.zhanbu.handMaxCnt = 5
-    else
-        if human.db.zhanbu.hand[5] ~= nil then
-            -- ������ҵ��������������ߣ�Ĭ�ϼ���
-            human.db.zhanbu.handMaxCnt = 5
-        else
-            human.db.zhanbu.handMaxCnt = 4
-        end
-    end
+    --屏蔽这里的判断, 改为通过 getHandInfo() 获取数据后进行判断
+    -- local cjPrivilege = ChengjiuLogic.checkPrivilege(human, ChengjiuDefine.PRIVILEGE_TYPE_7)
+    -- if cjPrivilege then
+    --     -- �Ѽ������Ȩ����Ϊ5��
+    --     human.db.zhanbu.handMaxCnt = 5
+    -- else
+    --     if human.db.zhanbu.hand[5] ~= nil then
+    --         -- ������ҵ��������������ߣ�Ĭ�ϼ���
+    --         human.db.zhanbu.handMaxCnt = 5
+    --     else
+    --         human.db.zhanbu.handMaxCnt = 4
+    --     end
+    -- end
 end
 
 function refreshPool(human)
@@ -170,10 +213,25 @@ function zhanbuQuery(human)
         human.db.zhanbu.isGuide = 0
     end
     msgRet.heroPool[0] = len
-    msgRet.isLock = 1
-    if human.db.zhanbu.handMaxCnt == 5 then
-        msgRet.isLock = 0
+
+    -- msgRet.isLock = 1
+    -- if human.db.zhanbu.handMaxCnt == 5 then
+    --     msgRet.isLock = 0
+    -- end
+
+    len = MAXHANDCNT - INITIALHANDCNT
+    msgRet.isLock[0] = len
+    local _, extraPosList = getHandInfo(human)
+
+    for i=MAXHANDCNT, INITIALHANDCNT+1, -1 do
+        msgRet.isLock[len] = 1
+        if extraPosList[i] then
+            msgRet.isLock[len] = 0
+        end
+        len = len - 1
     end
+
+
     len = 0
     for i = 1,human.db.zhanbu.handMaxCnt do
         if human.db.zhanbu.hand[i] ~= nil then
@@ -187,7 +245,7 @@ function zhanbuQuery(human)
     end
     msgRet.hand[0] = len
 
-    local maxPointsAdd = getMaxPointsAdd(human)
+    local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
     msgRet.cardRate = Util.copyTable(ZhanbuExcel.poolLv[human.db.zhanbu.lv].weight)
     msgRet.cardRate[0] = 3
 
@@ -240,7 +298,7 @@ function buyCard(human,index,heroID)
     local msgRet = Msg.gc.GC_ZHANBU_BUY_CARD
 
     -- �ɺϳ���Ƭ
-    local maxPointsAdd = getMaxPointsAdd(human)
+    local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
     if sameCnt >= 2 then
         -- �۳�����
         human.db.zhanbu.money = human.db.zhanbu.money - config.price
@@ -264,6 +322,8 @@ function buyCard(human,index,heroID)
 
         -- ������Ƭ
         local randomCnt = math.random(config.chipCnt[1],config.chipCnt[2])
+        randomCnt = randomCnt + getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_FRAGMENT)
+
         local item = {}
         item[config.heroID] = randomCnt
         BagLogic.addItem(human, config.heroID, randomCnt, "zhanbu")
@@ -284,7 +344,12 @@ function buyCard(human,index,heroID)
         MengxinLogic.onCallBack(human,MengxinLogic.MX_TASK_TYPE_6,1)
     else
         -- �ж������Ƿ�����
-        if human.db.zhanbu.handCnt >= human.db.zhanbu.handMaxCnt then
+        -- if human.db.zhanbu.handCnt >= human.db.zhanbu.handMaxCnt then
+        --     return Broadcast.sendErr(human,Lang.ZHANBU_HAND_CARD_FULL)
+        -- end
+
+        local realyHandCnt, extraPosList = getHandInfo(human)
+        if human.db.zhanbu.handCnt >= realyHandCnt then
             return Broadcast.sendErr(human,Lang.ZHANBU_HAND_CARD_FULL)
         end
 
@@ -300,16 +365,24 @@ function buyCard(human,index,heroID)
         -- �ӿ�����ɾ��
         human.db.zhanbu.pool[index] = nil
 
+        local bl = true
         for i = 1,human.db.zhanbu.handMaxCnt do
             if human.db.zhanbu.hand[i] == nil then
-                human.db.zhanbu.handCnt = human.db.zhanbu.handCnt + 1
-                human.db.zhanbu.hand[i] = heroIndex
-                msgRet.index = i
-                break
+                bl = true
+                if i >= INITIALHANDCNT + 1 and not extraPosList[i] then
+                    bl = false
+                end
+                
+                if bl then
+                    human.db.zhanbu.handCnt = human.db.zhanbu.handCnt + 1
+                    human.db.zhanbu.hand[i] = heroIndex
+                    msgRet.index = i
+                    break
+                end
             end
         end
     end
-    
+
     -- ֪ͨ�ͻ��˹���ɹ�
     Msg.send(msgRet,human.fd)
 
@@ -343,7 +416,7 @@ function sellCard(human,index,heroID)
     RoleSystemLogic.onDot(human,RoleSystemDefine.ROLE_SYS_ID_502)
 
     -- �Զ��ظ���ʱ
-    local maxPointsAdd = getMaxPointsAdd(human)
+    local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
     if human.db.zhanbu.money >= AUTO_GET_MONEY_MAX + maxPointsAdd then
         human.db.zhanbu.ts = nil
     end
@@ -364,20 +437,27 @@ function changePos(human,posList)
 
     -- ��������λ���Ƿ�Ϸ�
     local tb = Util.split(posList, "|")
-
     -- ���Ȳ��ԣ����Ϸ�
     if #tb > human.db.zhanbu.handMaxCnt then
         return
     end
 
+    local _, extraPosList = getHandInfo(human)
+
     for i = 1,#tb do
         -- ���ܽ���ɾ��
         tb[i] = tonumber(tb[i])
-        if tb[i] == 0 and human.db.zhanbu.hand[i] ~= nil then
+        local pos = tb[i]
+
+        if pos == 0 and human.db.zhanbu.hand[i] ~= nil then
             return
         end
         -- ��λ�ò��Ϸ�
-        if tb[i] > human.db.zhanbu.handMaxCnt then
+        if pos > human.db.zhanbu.handMaxCnt then
+            return
+        end
+
+        if pos >= INITIALHANDCNT + 1 and not extraPosList[pos] then
             return
         end
     end
@@ -386,7 +466,7 @@ function changePos(human,posList)
     local dataList = Util.copyTable(human.db.zhanbu.hand)
     human.db.zhanbu.hand = {}
     for i = 1,human.db.zhanbu.handMaxCnt do
-        if tb[i] ~= 0 then
+        if tb[i] and tb[i] ~= 0 then
             human.db.zhanbu.hand[tb[i]] = dataList[i]
         end
     end
@@ -411,7 +491,7 @@ function refreshCardPool(human)
     RoleSystemLogic.onDot(human,RoleSystemDefine.ROLE_SYS_ID_502)
     
     -- �Զ��ظ���ʱ
-    local maxPointsAdd = getMaxPointsAdd(human)
+    local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
     if human.db.zhanbu.money < AUTO_GET_MONEY_MAX + maxPointsAdd then
         human.db.zhanbu.ts = human.db.zhanbu.ts or os.time()
     end
@@ -519,7 +599,7 @@ function checkRecover()
     local now = os.time()
     for _,human in pairs(ObjHuman.onlineUuid) do
         if human.db.zhanbu and human.db.zhanbu.ts then
-            local maxPointsAdd = getMaxPointsAdd(human)
+            local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
             local finalMaxPoints = maxPointsAdd + AUTO_GET_MONEY_MAX
             local ts = now - human.db.zhanbu.ts
             local cnt = math.floor(ts/AUTO_GET_MONEY_TS)
@@ -563,7 +643,7 @@ function updateDaily(human)
 
     if human.db.zhanbu and human.db.zhanbu.money then
         local ts = human.db.zhanbu.ts
-        local maxPointsAdd = getMaxPointsAdd(human)
+        local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
         if not ts and human.db.zhanbu.money < AUTO_GET_MONEY_MAX + maxPointsAdd then
             human.db.zhanbu.ts = os.time()
         end
@@ -574,7 +654,7 @@ function onLogin(human)
     --处理mone达到老的上限值后, human.db.zhanbu.ts为nil,导致后面获得秘宝时,无法获得秘宝加成情况
     if human.db.zhanbu and human.db.zhanbu.money then
         local ts = human.db.zhanbu.ts
-        local maxPointsAdd = getMaxPointsAdd(human)
+        local maxPointsAdd = getTalismanAdd(human, TalismanLogic.OTHER_EFFECT_TBL.ZHANBU_MAX_POINTS)
         if not ts and human.db.zhanbu.money < AUTO_GET_MONEY_MAX + maxPointsAdd then
             human.db.zhanbu.ts = os.time()
         end