9341 【BT5】【主干】【后端】情缘系统(增加魅力等级属性;伴侣亲密度等级属性;优化已成亲的伴侣再次提亲时直接成亲)
# Conflicts:
# ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTeam.py
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
| | |
| | | DWORD UpEatItemPerCount; //每次培养消耗x个
|
| | | };
|
| | |
|
| | | //情缘魅力属性表
|
| | |
|
| | | struct tagLoveCharm
|
| | | {
|
| | | BYTE _CharmLV; //魅力等级
|
| | | DWORD UpNeedCharm; //升下级所需总魅力
|
| | | list LVAttrType; //属性类型
|
| | | list LVAttrValue; //总属性值
|
| | | list LVAwardItemInfo; //等级物品奖励[[物品ID,个数,是否拍品], ...]
|
| | | };
|
| | |
|
| | | //骑宠幻化表
|
| | |
|
| | | struct tagHorsePetSkin
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | | RegisterPackCount = 2
|
| | |
|
| | | PacketCMD_1=0xB3
|
| | | PacketSubCMD_1=0x09
|
| | | PacketCallFunc_1=OnCharmOfferBillboardQuery
|
| | |
|
| | | PacketCMD_2=0xB3
|
| | | PacketSubCMD_2=0x19
|
| | | PacketCallFunc_2=OnCharmLVUp
|
| | |
|
| | | [PlayerTalk]
|
| | | ScriptName = Player\PlayerTalk.py
|
| | | Writer = alee
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B3 19 提升魅力等级 #tagCGCharmLVUp
|
| | |
|
| | | class tagCGCharmLVUp(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB3
|
| | | self.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB3
|
| | | self.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGCharmLVUp)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B3 19 提升魅力等级 //tagCGCharmLVUp:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGCharmLVUp=tagCGCharmLVUp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGCharmLVUp.Cmd,m_NAtagCGCharmLVUp.SubCmd))] = m_NAtagCGCharmLVUp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B3 09 魅力贡献榜查看 #tagCGCharmOfferBillboardQuery
|
| | |
|
| | | class tagCGCharmOfferBillboardQuery(Structure):
|
| | |
| | | import PlayerCharm
|
| | |
|
| | | def __Help(curPlayer):
|
| | | GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
|
| | | GameWorld.DebugAnswer(curPlayer, "清空魅力: Charm 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "随机魅力: Charm 1 人数 贡献人数 [选填 随机范围值A B]")
|
| | | GameWorld.DebugAnswer(curPlayer, "随机范围值不填的话默认10~1000")
|
| | | GameWorld.DebugAnswer(curPlayer, "增加魅力: Charm 2 数值 [选填 贡献玩家ID 获得玩家ID]")
|
| | | GameWorld.DebugAnswer(curPlayer, "玩家ID不填的话均默认自己")
|
| | | return
|
| | |
|
| | | #逻辑实现
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | #// B3 19 提升魅力等级 #tagCGCharmLVUp
|
| | | #
|
| | | #struct tagCGCharmLVUp
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnCharmLVUp(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index) |
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | totalCharm = 0
|
| | | charmValueRecMgr = PyDataManager.GetDBPyCharmValueRecManager()
|
| | | if playerID in charmValueRecMgr.charmTotalDict:
|
| | | recTypeValueDict = charmValueRecMgr.charmTotalDict.get(playerID, {})
|
| | | totalCharm = recTypeValueDict.get(CharmValueRecType_Total, 0)
|
| | | |
| | | PlayerControl.MapServer_QueryPlayer_DoLogic(curPlayer, "Charm", ["CharmLVUp", totalCharm], curPlayer.GetID())
|
| | | return
|
| | |
|
| | | def GMClearCharm():
|
| | | ## GM清空魅力
|
| | |
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | | def MapServer_QueryPlayer_DoLogic(tagPlayer, callName, cmdInfo, srcPlayerID=0, queryType=0):
|
| | | ## 通知目标玩家地图执行 DoLogic
|
| | | tagPlayerID = tagPlayer.GetPlayerID()
|
| | | tagMapID = tagPlayer.GetRealMapID()
|
| | | if tagMapID:
|
| | | cmdStr = str(cmdInfo)
|
| | | GameWorld.Log("MapServer_QueryPlayer_DoLogic: %s, cmdInfo=%s,tagPlayerID=%s,tagMapID=%s" |
| | | % (callName, cmdInfo, tagPlayerID, tagMapID), srcPlayerID)
|
| | | #MapServer_QueryPlayer(int srcPlayerID, int queryType, int queryID, int mapID, char *callName, char *cmd,WORD cmdLen, int RouteServerIndex)
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(srcPlayerID, 0, tagPlayerID, tagMapID, callName,
|
| | | cmdStr, len(cmdStr), tagPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | | ## 增加成就完成进度
|
| | | # @param curPlayer
|
| | |
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | PyDataManager.GetDBPyUnNotifyLoveGiftRecManager().LoginNotify(curPlayer)
|
| | | |
| | | # 同步伴侣亲密度
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
|
| | | if couple:
|
| | | coupleID = couple.GetCoupleID(playerID)
|
| | | intimacys = PyDataManager.GetIntimacyManager().GetIntimacys(playerID)
|
| | | intimacys.SyncMapServerIntimacy(curPlayer, coupleID)
|
| | | |
| | | Sync_CoupleInfo(curPlayer)
|
| | | Sync_CandyList(curPlayer)
|
| | | return
|
| | |
| | | __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK)
|
| | | return
|
| | |
|
| | | def __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK):
|
| | | def __DoMarryResponse(curPlayer, reqPlayer, reqPlayerID, isOK, needResponse=True):
|
| | | ''' 提亲回应
|
| | | @param curPlayer: 回应玩家
|
| | | @param reqPlayer: 提亲玩家
|
| | |
| | | reqPlayerName = reqPlayer.GetName() if reqPlayer else PlayerSocial.GetSocialPlayerName(reqPlayerID)
|
| | | playerName = curPlayer.GetName()
|
| | |
|
| | | responsePack = ChPyNetSendPack.tagGCMarryResponseRet()
|
| | | responsePack.PlayerIDA = reqPlayerID
|
| | | responsePack.PlayerNameA = reqPlayerName
|
| | | responsePack.NameALen = len(responsePack.PlayerNameA)
|
| | | responsePack.PlayerIDB = playerID
|
| | | responsePack.PlayerNameB = playerName
|
| | | responsePack.NameBLen = len(responsePack.PlayerNameB)
|
| | | responsePack.IsOK = isOK
|
| | | if reqPlayer:
|
| | | NetPackCommon.SendFakePack(reqPlayer, responsePack) # 必回复提亲方
|
| | | if needResponse:
|
| | | responsePack = ChPyNetSendPack.tagGCMarryResponseRet()
|
| | | responsePack.PlayerIDA = reqPlayerID
|
| | | responsePack.PlayerNameA = reqPlayerName
|
| | | responsePack.NameALen = len(responsePack.PlayerNameA)
|
| | | responsePack.PlayerIDB = playerID
|
| | | responsePack.PlayerNameB = playerName
|
| | | responsePack.NameBLen = len(responsePack.PlayerNameB)
|
| | | responsePack.IsOK = isOK
|
| | | if reqPlayer:
|
| | | NetPackCommon.SendFakePack(reqPlayer, responsePack) # 必回复提亲方
|
| | | # 拒绝
|
| | | if not isOK:
|
| | | return
|
| | | NetPackCommon.SendFakePack(curPlayer, responsePack) # 回应方仅同意时同步
|
| | | if needResponse:
|
| | | NetPackCommon.SendFakePack(curPlayer, responsePack) # 回应方仅同意时同步
|
| | |
|
| | | # ===================== 以下执行成亲逻辑 =====================
|
| | | GameWorld.Log("执行成亲: reqPlayerID=%s,playerID=%s,bridePriceID=%s" % (reqPlayerID, playerID, bridePriceID), playerID)
|
| | |
| | | if not player:
|
| | | continue
|
| | | mapServerCoupleInfo = couple.GetSendMapServerCoupleInfo(player.GetPlayerID())
|
| | | dataMsg = [reqPlayerID, bridePriceID, mapServerCoupleInfo]
|
| | | |
| | | curIntimacys = PyDataManager.GetIntimacyManager().GetIntimacys(player.GetPlayerID())
|
| | | coupleIntimacy = curIntimacys.GetTagIntimacy(couple.GetCoupleID(player.GetPlayerID())) if curIntimacys else 0
|
| | | |
| | | dataMsg = [reqPlayerID, bridePriceID, mapServerCoupleInfo, coupleIntimacy]
|
| | | MapServer_QueryPlayer_DoLogic_Love(player, "MarrySuccess", dataMsg, playerID)
|
| | | Sync_CoupleInfo(player)
|
| | |
|
| | |
| | | if not __MarryCheckComm(curPlayer, tagPlayer, tagPlayerID, True):
|
| | | return
|
| | |
|
| | | curTime = int(time.time())
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | if (playerID, tagPlayerID) in PyGameData.g_marryCandyInfo or (tagPlayerID, playerID) in PyGameData.g_marryCandyInfo:
|
| | |
| | | GameWorld.Log("聘礼提亲次数不足,无法提亲! bridePriceID=%s,buyCount(%s) >= canBuyMax(%s)"
|
| | | % (bridePriceID, buyCount, canBuyMax), playerID)
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | |
| | | GameWorld.Log("已成亲的伴侣再次提亲,直接成亲! tagPlayerID=%s,coupleID=%s" % (tagPlayerID, coupleID), playerID)
|
| | | reqData = MarryReq()
|
| | | reqData.playerIDA = playerID
|
| | | reqData.playerIDB = tagPlayerID
|
| | | reqData.bridePriceID = bridePriceID
|
| | | reqData.reqTime = curTime
|
| | | PyGameData.g_marryReqInfo[playerID] = reqData
|
| | | __DoMarryResponse(tagPlayer, curPlayer, playerID, 1, False)
|
| | | return
|
| | | |
| | | if tagPlayerID in PyGameData.g_marryReqInfo:
|
| | | tagReqData = PyGameData.g_marryReqInfo[tagPlayerID]
|
| | | tagBridePriceID = tagReqData.bridePriceID
|
| | |
| | | if not curPlayer:
|
| | | return nowIntimacy
|
| | |
|
| | | self.__SyncMapServerCoupleIntimacy(curPlayer, tagID)
|
| | | |
| | | tagName = ""
|
| | | socialPlayer = PyDataManager.GetPersonalSocialManager().GetSocialPlayer(tagID)
|
| | | if socialPlayer:
|
| | |
| | | return 0
|
| | | intimacyObj.Intimacy = setValue
|
| | | if curPlayer:
|
| | | self.__SyncMapServerCoupleIntimacy(curPlayer, tagID)
|
| | | self.Sync_SocialsInfo(curPlayer, [tagID])
|
| | | return intimacyObj.Intimacy
|
| | |
|
| | | def __SyncMapServerCoupleIntimacy(self, curPlayer, tagID):
|
| | | ## 同步地图玩家伴侣亲密度
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
|
| | | if not couple:
|
| | | return
|
| | | if couple.GetCoupleID(playerID) != tagID:
|
| | | return
|
| | | self.SyncMapServerIntimacy(curPlayer, tagID)
|
| | | return
|
| | | |
| | | def SyncMapServerIntimacy(self, curPlayer, tagID):
|
| | | ## 同步地图玩家伴侣亲密度
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | intimacyValue = 0
|
| | | intimacyObj = self.GetIntimacyObj(tagID)
|
| | | if intimacyObj:
|
| | | intimacyValue = intimacyObj.Intimacy
|
| | | cmdInfo = ["SyncMapServerIntimacy", [tagID, intimacyValue]]
|
| | | PlayerControl.MapServer_QueryPlayer_DoLogic(curPlayer, "Love", cmdInfo, playerID)
|
| | | return
|
| | | |
| | | # 整个游戏的亲密管理
|
| | | class IntimacyManager(object):
|
| | | def __init__(self):
|
| | |
| | | Def_PDict_FamilyWarDailyReward = "FamilyWarDailyReward" # 王者仙盟每日俸禄领取状态
|
| | | Def_PDict_Family_Contribution = "FamilyContribution" #战盟贡献度
|
| | | Def_PDict_HasChange_FamilyActiveToContribution = "HasChangeContribution" #战盟活跃度已转化过贡献度
|
| | | Def_PDict_FreeGiveFlowerCnt = "FreeGiveFlowerCnt" #当日已免费赠送鲜花数
|
| | | Def_PDict_GiveFlowerCntByDay = "GiveFlowerCntByDay" #当日已赠送鲜次数
|
| | | Def_PDict_PackCount_FineSoul = "PackCount_FineSoul" # 已购买精魄/符文背包格子数
|
| | | Def_PDict_KillPlayerAddActive = "KillPlayerAddActiveByDay" # 杀人每日获得活跃度
|
| | | Def_PDict_LoginDayCnt = "PLoginDayCnt" # 累计登陆天数
|
| | |
| | | Def_PDict_LoveRingClassLV = "LoveRingClassLV" # 情戒 - 阶级
|
| | | Def_PDict_LoveRingStarLV = "LoveRingStarLV" # 情戒 - 星级
|
| | | Def_PDict_LoveRingEatCount = "LoveRingEatCount" # 情戒 - 本星已淬炼道具数
|
| | | Def_PDict_LoveCoupleIntimacy = "LoveCoupleIntimacy" # 伴侣亲密度
|
| | | Def_PDict_CharmLV = "CharmLV" # 魅力等级
|
| | | #-------------------------------------------------------------------------------
|
| | | #可以从07 41封包购买的背包类型,和对应字典{背包类型:[字典key, 默认格子数]}
|
| | |
|
| | |
| | | Def_CalcAttrFunc_FaQi, # 法器 48
|
| | | Def_CalcAttrFunc_LoveRing, # 情戒基础 49
|
| | | Def_CalcAttrFunc_LoveRingCouple, # 情戒仙侣 50
|
| | | ) = range(51)
|
| | | Def_CalcAttrFunc_Charm, # 魅力 51
|
| | | ) = range(52)
|
| | |
|
| | | # 技能功能点列表 - 默认不算战力,不享受百分比加成,技能功能点暂时配置,之后优化技能属性逻辑后可去掉
|
| | | CalcAttrFuncSkillList = [Def_CalcAttrFunc_HorseSkill, Def_CalcAttrFunc_PetSkill, Def_CalcAttrFunc_DogzBattleSkill]
|
| | |
| | | ShareDefine.Def_MFPType_HorseSoul:[Def_CalcAttrFunc_HorseSoul],
|
| | | ShareDefine.Def_MFPType_FaQi:[Def_CalcAttrFunc_FaQi],
|
| | | ShareDefine.Def_MFPType_Love:[Def_CalcAttrFunc_LoveRing, Def_CalcAttrFunc_LoveRingCouple],
|
| | | ShareDefine.Def_MFPType_Charm:[Def_CalcAttrFunc_Charm],
|
| | | ShareDefine.Def_MFPType_Prestige:[Def_CalcAttrFunc_Prestige],
|
| | | ShareDefine.Def_MFPType_GodWeapon:[Def_CalcAttrFunc_GodWeapon],
|
| | | ShareDefine.Def_MFPType_Dienstgrad:[Def_CalcAttrFunc_Dienstgrad],
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B3 19 提升魅力等级 #tagCGCharmLVUp
|
| | |
|
| | | class tagCGCharmLVUp(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB3
|
| | | self.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB3
|
| | | self.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCGCharmLVUp)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B3 19 提升魅力等级 //tagCGCharmLVUp:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCGCharmLVUp=tagCGCharmLVUp()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCGCharmLVUp.Cmd,m_NAtagCGCharmLVUp.SubCmd))] = m_NAtagCGCharmLVUp
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B3 09 魅力贡献榜查看 #tagCGCharmOfferBillboardQuery
|
| | |
|
| | | class tagCGCharmOfferBillboardQuery(Structure):
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GM.Commands.Charm
|
| | | #
|
| | | # @todo:魅力
|
| | | # @author hxp
|
| | | # @date 2021-12-03
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 魅力
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2021-12-03 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import PlayerCharm
|
| | |
|
| | |
|
| | | def __Help(curPlayer):
|
| | | GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
|
| | | GameWorld.DebugAnswer(curPlayer, "清空魅力: Charm 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "魅力等级: Charm 等级")
|
| | | GameWorld.DebugAnswer(curPlayer, "随机魅力: Charm 1 人数 贡献人数 [选填 随机范围值A B]")
|
| | | GameWorld.DebugAnswer(curPlayer, "随机范围值不填的话默认10~1000")
|
| | | GameWorld.DebugAnswer(curPlayer, "增加魅力: Charm 2 数值 [选填 贡献玩家ID 获得玩家ID]")
|
| | | GameWorld.DebugAnswer(curPlayer, "玩家ID不填的话均默认自己")
|
| | | return
|
| | |
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | | # @param msgList 参数列表 [addSkillID]
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, msgList):
|
| | | |
| | | if not msgList:
|
| | | __Help(curPlayer)
|
| | | return
|
| | | |
| | | value1 = msgList[0]
|
| | | |
| | | # 设置魅力等级
|
| | | if value1 > 0 and len(msgList) == 1:
|
| | | maxIpyData = IpyGameDataPY.IPY_Data().GetLoveCharmByIndex(IpyGameDataPY.IPY_Data().GetLoveCharmCount() - 1)
|
| | | if maxIpyData:
|
| | | value1 = min(value1, maxIpyData.GetCharmLV())
|
| | | GameWorld.DebugAnswer(curPlayer, "设置魅力等级: %s" % value1)
|
| | | PlayerControl.SetCharmLV(curPlayer, value1)
|
| | | PlayerCharm.RefreshCharmAttr(curPlayer)
|
| | | return
|
| | | |
| | | isSendGameServer = True
|
| | | # 清空魅力
|
| | | if value1 == 0:
|
| | | PlayerControl.SetCharmLV(curPlayer, value1)
|
| | | PlayerCharm.RefreshCharmAttr(curPlayer)
|
| | | |
| | | # 随机魅力
|
| | | elif value1 == 1 and len(msgList) >= 3:
|
| | | pass
|
| | | |
| | | # 增加魅力
|
| | | elif value1 == 2 and len(msgList) >= 2:
|
| | | pass
|
| | | |
| | | else:
|
| | | __Help(curPlayer)
|
| | | return
|
| | | |
| | | return isSendGameServer
|
| | |
| | | ShareDefine.Def_MFPType_Dogz:"神兽",
|
| | | ShareDefine.Def_MFPType_Coat:"ʱװ",
|
| | | ShareDefine.Def_MFPType_Love:"情缘",
|
| | | ShareDefine.Def_MFPType_Charm:"魅力",
|
| | | ShareDefine.Def_MFPType_Other:"其他",
|
| | | }
|
| | |
|
| | |
| | | ChConfig.Def_CalcAttrFunc_FaQi:"法器",
|
| | | ChConfig.Def_CalcAttrFunc_LoveRing:"情戒基础",
|
| | | ChConfig.Def_CalcAttrFunc_LoveRingCouple:"情戒仙侣",
|
| | | ChConfig.Def_CalcAttrFunc_Charm:"魅力",
|
| | | }
|
| | |
|
| | | GameWorld.DebugAnswer(curPlayer, "PrintFightPower 模块类型(可选)")
|
| | |
| | | ("DWORD", "UpEatItemPerCount", 0),
|
| | | ),
|
| | |
|
| | | "LoveCharm":(
|
| | | ("BYTE", "CharmLV", 1),
|
| | | ("DWORD", "UpNeedCharm", 0),
|
| | | ("list", "LVAttrType", 0),
|
| | | ("list", "LVAttrValue", 0),
|
| | | ("list", "LVAwardItemInfo", 0),
|
| | | ),
|
| | |
|
| | | "HorsePetSkin":(
|
| | | ("BYTE", "Type", 1),
|
| | | ("DWORD", "ID", 1),
|
| | |
| | | def GetNeedEatCount(self): return self.NeedEatCount # 升级所需个数(非累计)
|
| | | def GetUpEatItemPerCount(self): return self.UpEatItemPerCount # 每次培养消耗x个 |
| | | |
| | | # 情缘魅力属性表 |
| | | class IPY_LoveCharm(): |
| | | |
| | | def __init__(self): |
| | | self.CharmLV = 0
|
| | | self.UpNeedCharm = 0
|
| | | self.LVAttrType = []
|
| | | self.LVAttrValue = []
|
| | | self.LVAwardItemInfo = [] |
| | | return |
| | | |
| | | def GetCharmLV(self): return self.CharmLV # 魅力等级
|
| | | def GetUpNeedCharm(self): return self.UpNeedCharm # 升下级所需总魅力
|
| | | def GetLVAttrType(self): return self.LVAttrType # 属性类型
|
| | | def GetLVAttrValue(self): return self.LVAttrValue # 总属性值
|
| | | def GetLVAwardItemInfo(self): return self.LVAwardItemInfo # 等级物品奖励[[物品ID,个数,是否拍品], ...] |
| | | |
| | | # 骑宠幻化表 |
| | | class IPY_HorsePetSkin(): |
| | | |
| | |
| | | self.ipyMarryLen = len(self.ipyMarryCache)
|
| | | self.ipyLoveRingCache = self.__LoadFileData("LoveRing", IPY_LoveRing)
|
| | | self.ipyLoveRingLen = len(self.ipyLoveRingCache)
|
| | | self.ipyLoveCharmCache = self.__LoadFileData("LoveCharm", IPY_LoveCharm)
|
| | | self.ipyLoveCharmLen = len(self.ipyLoveCharmCache)
|
| | | self.ipyHorsePetSkinCache = self.__LoadFileData("HorsePetSkin", IPY_HorsePetSkin)
|
| | | self.ipyHorsePetSkinLen = len(self.ipyHorsePetSkinCache)
|
| | | self.ipyAssistThanksGiftCache = self.__LoadFileData("AssistThanksGift", IPY_AssistThanksGift)
|
| | |
| | | def GetMarryByIndex(self, index): return self.ipyMarryCache[index]
|
| | | def GetLoveRingCount(self): return self.ipyLoveRingLen
|
| | | def GetLoveRingByIndex(self, index): return self.ipyLoveRingCache[index]
|
| | | def GetLoveCharmCount(self): return self.ipyLoveCharmLen
|
| | | def GetLoveCharmByIndex(self, index): return self.ipyLoveCharmCache[index]
|
| | | def GetHorsePetSkinCount(self): return self.ipyHorsePetSkinLen
|
| | | def GetHorsePetSkinByIndex(self, index): return self.ipyHorsePetSkinCache[index]
|
| | | def GetAssistThanksGiftCount(self): return self.ipyAssistThanksGiftLen
|
| | |
| | | import PyGameData
|
| | | import PlayerCoin
|
| | | import PlayerGeTui
|
| | | import PlayerCharm
|
| | | import PlayerDogz
|
| | | import PlayerCoat
|
| | | import PlayerFB
|
| | |
| | | #成就
|
| | | PlayerSuccess.SuccOnLogin(curPlayer)
|
| | |
|
| | | #魅力
|
| | | PlayerCharm.OnPlayerLogin(curPlayer)
|
| | | |
| | | #情缘
|
| | | PlayerLove.DoPlayerLogin(curPlayer)
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerCharm
|
| | | #
|
| | | # @todo:魅力
|
| | | # @author hxp
|
| | | # @date 2021-12-03
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 魅力
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2021-12-03 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ItemControler
|
| | | import GameWorld
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | |
| | | # 重新设置,触发上线通知
|
| | | if PlayerControl.GetCharmLV(curPlayer):
|
| | | PlayerControl.SetCharmLV(curPlayer, PlayerControl.GetCharmLV(curPlayer))
|
| | | |
| | | return
|
| | |
|
| | | def GameServer_DoLogic_Charm(curPlayer, msgData):
|
| | | |
| | | msgType = msgData[0]
|
| | | |
| | | ## 魅力等级提升
|
| | | if msgType == "CharmLVUp":
|
| | | totalCharm = msgData[1]
|
| | | __DoCharmLVUp(curPlayer, totalCharm)
|
| | | |
| | | return
|
| | |
|
| | | def __DoCharmLVUp(curPlayer, totalCharm):
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | charmLV = PlayerControl.GetCharmLV(curPlayer)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("LoveCharm", charmLV)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | if not ipyData.GetUpNeedCharm():
|
| | | GameWorld.DebugLog("魅力等级已满级,无法升级! charmLV=%s" % charmLV, playerID)
|
| | | return
|
| | | |
| | | if totalCharm < ipyData.GetUpNeedCharm():
|
| | | GameWorld.DebugLog("魅力值不足,无法升级! totalCharm=%s < %s, charmLV=%s" % (totalCharm, ipyData.GetUpNeedCharm(), charmLV), playerID)
|
| | | return
|
| | | |
| | | charmLV += 1
|
| | | nextLVIpyData = IpyGameDataPY.GetIpyGameData("LoveCharm", charmLV)
|
| | | if not nextLVIpyData:
|
| | | return
|
| | | awardItemList = nextLVIpyData.GetLVAwardItemInfo()
|
| | | GameWorld.DebugLog("魅力等级升级! charmLV=%s" % charmLV, playerID)
|
| | | PlayerControl.SetCharmLV(curPlayer, charmLV)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList)
|
| | | RefreshCharmAttr(curPlayer)
|
| | | return
|
| | |
|
| | | def RefreshCharmAttr(curPlayer):
|
| | | CalcCharmAttr(curPlayer)
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def CalcCharmAttr(curPlayer):
|
| | | |
| | | allAttrList = [{} for _ in range(4)]
|
| | | |
| | | charmLV = PlayerControl.GetCharmLV(curPlayer)
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("LoveCharm", charmLV)
|
| | | if ipyData:
|
| | | lvAttrTypeList = ipyData.GetLVAttrType()
|
| | | lvAttrValueList = ipyData.GetLVAttrValue()
|
| | | for i, attrID in enumerate(lvAttrTypeList):
|
| | | attrValue = lvAttrValueList[i]
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrList)
|
| | | |
| | | # 保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Charm, allAttrList)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | import ItemControler
|
| | | import NetPackCommon
|
| | | import ChConfig
|
| | | import SkillCommon
|
| | | import BuffSkill
|
| | | import PyGameData
|
| | |
|
| | | def DoPlayerOnDay(curPlayer):
|
| | | return
|
| | |
| | | ## 离婚成功
|
| | | elif msgType == "ClearCoupleSocial":
|
| | | __ClearCoupleSocial(curPlayer, dataMsg)
|
| | | |
| | | ## 同步亲密度
|
| | | elif msgType == "SyncMapServerIntimacy":
|
| | | SyncMapServerIntimacy(curPlayer, dataMsg)
|
| | |
|
| | | return
|
| | |
|
| | |
| | |
|
| | | def __DoMarrySuccess(curPlayer, dataMsg):
|
| | | ## 执行成亲成功
|
| | | reqPlayerID, bridePriceID, mapServerCoupleInfo = dataMsg
|
| | | reqPlayerID, bridePriceID, mapServerCoupleInfo, coupleIntimacy = dataMsg
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | PlayerControl.SetCoupleInfo(playerID, mapServerCoupleInfo)
|
| | |
|
| | | GameWorld.Log("执行成亲成功! reqPlayerID=%s,bridePriceID=%s" % (reqPlayerID, bridePriceID), playerID)
|
| | | GameWorld.Log("执行成亲成功! reqPlayerID=%s,bridePriceID=%s,coupleIntimacy=%s" % (reqPlayerID, bridePriceID, coupleIntimacy), playerID)
|
| | |
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveRingClassLV) == 0:
|
| | | GameWorld.DebugLog("激活情戒!")
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveRingEatCount, 0)
|
| | | Sync_LoveRingInfo(curPlayer)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveCoupleIntimacy, coupleIntimacy)
|
| | | RefreshCoupleTeamBuff(curPlayer)
|
| | | |
| | | # 提亲的玩家扣除消耗
|
| | | if playerID == reqPlayerID:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Marry", bridePriceID)
|
| | |
| | | PlayerControl.SetCoupleInfo(playerID, None)
|
| | |
|
| | | GameWorld.Log("清除伴侣关系成功! coupleID=%s" % (coupleID), playerID)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveCoupleIntimacy, 0)
|
| | | RefreshCoupleTeamBuff(curPlayer)
|
| | | |
| | | RefreshLoveAttr(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def SyncMapServerIntimacy(curPlayer, dataMsg):
|
| | | tagID, intimacyValue = dataMsg
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if coupleID == tagID:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveCoupleIntimacy, intimacyValue)
|
| | | RefreshCoupleTeamBuff(curPlayer)
|
| | | return
|
| | |
|
| | | def RefreshCoupleTeamBuff(curPlayer):
|
| | | ## 刷新伴侣组队buff
|
| | | |
| | | teamID = curPlayer.GetTeamID()
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | cupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | teamPlayerInfoDict = PyGameData.g_teamPlayerInfoDict.get(teamID, {}) if teamID else {}
|
| | | teamPlayerIDList = teamPlayerInfoDict.keys()
|
| | | skillLV = 0
|
| | | skillTypeID = IpyGameDataPY.GetFuncCfg("IntimacyBuff", 2)
|
| | | coupleIntimacy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveCoupleIntimacy)
|
| | | if cupleID and cupleID in teamPlayerIDList:
|
| | | skillLVIntimacyList = IpyGameDataPY.GetFuncEvalCfg("IntimacyBuff", 1)
|
| | | for lv, lvIntimacy in enumerate(skillLVIntimacyList, 1):
|
| | | if coupleIntimacy >= lvIntimacy:
|
| | | skillLV = lv
|
| | | else:
|
| | | break
|
| | | |
| | | GameWorld.DebugLog("刷新伴侣组队Buff: cupleID=%s,coupleIntimacy=%s,teamID=%s,teamPlayerIDList=%s,skillTypeID=%s,skillLV=%s" |
| | | % (cupleID, coupleIntimacy, teamID, teamPlayerIDList, skillTypeID, skillLV), playerID)
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if skillLV > 0:
|
| | | findBuff = SkillCommon.FindBuffByID(curPlayer, skillTypeID)[0]
|
| | | if findBuff:
|
| | | if skillLV == findBuff.GetSkill().GetSkillLV():
|
| | | return
|
| | | BuffSkill.DelBuffBySkillID(curPlayer, skillTypeID, tick)
|
| | | SkillCommon.AddBuffBySkillType(curPlayer, skillTypeID, tick, skillLV)
|
| | | else:
|
| | | if BuffSkill.DelBuffBySkillID(curPlayer, skillTypeID, tick):
|
| | | #统一刷新状态
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrByBuff()
|
| | | |
| | | return
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.RemoteQuery.GY_Query_Charm
|
| | | #
|
| | | # @todo:魅力
|
| | | # @author hxp
|
| | | # @date 2021-12-03
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 魅力
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2021-12-03 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import PlayerCharm
|
| | |
|
| | | #------------------------------------------------------------------------------ |
| | | ## 跨服赛报名调用接口
|
| | | # @param query_Type 请求类型
|
| | | # @param query_ID 请求的玩家ID
|
| | | # @param packCMDList 发包命令
|
| | | # @param tick 当前时间
|
| | | # @return "True" or "False" or ""
|
| | | # @remarks 函数详细说明.
|
| | | def DoLogic(query_Type, query_ID, packCMDList, tick):
|
| | | |
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
|
| | | if not curPlayer or curPlayer.IsEmpty():
|
| | | return
|
| | | |
| | | PlayerCharm.GameServer_DoLogic_Charm(curPlayer, packCMDList)
|
| | | return
|
| | |
|
| | | #------------------------------------------------------------------------------ |
| | | ## 执行结果
|
| | | # @param curPlayer 发出请求的玩家
|
| | | # @param callFunName 功能名称
|
| | | # @param funResult 查询的结果
|
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DoResult(curPlayer, callFunName, funResult, tick):
|
| | | return
|
| | |
|
| | |
| | |
|
| | | g_teamPlayerHurtValue = {} # 队伍玩家对NPC伤害输出量 {(lineID, objID, npcID):{(teamID, playerID):hurtValue, ...}, }
|
| | | g_teamPlayerDict = {} # 地图队伍对应玩家ID列表,含离线玩家 {teamID:[playerID, ...], ...}
|
| | | g_teamPlayerInfoDict = {} # 地图队伍对应玩家ID信息 {teamID:{playerID:{k:v, ...}, ...}
|
| | |
|
| | | g_unLoginOKPlayerMailInfo = {} # GameServer 未登录成功前需要发送的邮件缓存,防止登录失败不存db导致重复发送邮件 {playerID:[[待发送邮件内容信息], ...], ...}
|
| | | g_disconnectPlayer = {} # 在本地图离线的玩家信息 {playerID:[tick, posX, posY], ...}
|