| | |
| | | Def_ViewExpType_SysEx, #系统给经验-不需要展示倍率 用来区别于类型0 7
|
| | | Def_ViewExpType_LYZS, #烈焰战神 特殊特效 8
|
| | | Def_ViewExpType_Activity, #活跃吸纳 9
|
| | | ) = range(0, 10)
|
| | | Def_ViewExpType_Chuangong, #传功经验10
|
| | | ) = range(0, 11)
|
| | |
|
| | |
|
| | | #物品相关操作类型
|
| | |
| | | DailyActionID_Arena, # 竞技场 33
|
| | | DailyActionID_CrossDemonLand, # 跨服魔化之地Boss 34
|
| | | DailyActionID_CrossBattlefield, # 跨服战场 35
|
| | | ) = range(1, 35 + 1)
|
| | | DailyActionID_FamilySit, # 跨服战场 36
|
| | | ) = range(1, 36 + 1)
|
| | |
|
| | | # 跨服每日活动编号定义, 从150开始
|
| | | CrossDailyActionIDList = (
|
| | |
| | | Def_Player_Dict_FamilyPartyTotalExpPoint = "FamilyPartyTotalExpPoint" # 获得的总经验点
|
| | | Def_Player_Dict_FamilyPartyTotalPoint = "FamilyPartyTotalPoint" # 获得的总仙盟贡献值
|
| | |
|
| | | #仙盟打坐
|
| | | Def_Player_Dict_FamilySitExpRound = "FamilySitExpRound" # 已给经验轮次
|
| | | Def_Player_Dict_FamilySitTotalExp = "FamilySitTotalExp" # 获得的总经验
|
| | | Def_Player_Dict_FamilySitTotalExpPoint = "FamilySitTotalExpPoint" # 获得的总经验点
|
| | |
|
| | | #虚拟背包物品数据
|
| | | Def_PDict_VPackItem = "VPackItem_%s_%s" # 虚拟背包物品数据, 参数(背包类型, 位置索引)
|
| | |
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalExpPoint, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyPartyTotalPoint, 0)
|
| | | #打坐
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitExpRound, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitTotalExp, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitTotalExpPoint, 0)
|
| | | return
|
| | |
|
| | | ##开启副本
|
| | |
| | | return
|
| | |
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | sitActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilySit)
|
| | | partyActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyParty)
|
| | | if partyActionState:
|
| | | |
| | | if sitActionState:
|
| | | Process_SitAction(tick)
|
| | | |
| | | # 由于宴会不需要额外处理,只需要同步Help,所以如果打坐进行中,就不需要再重复处理宴会同步
|
| | | elif partyActionState:
|
| | | FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000)
|
| | |
|
| | | return
|
| | |
|
| | | def Process_SitAction(tick):
|
| | | key = "SitActionProcessTick"
|
| | | interval, expRoundMax = IpyGameDataPY.GetFuncEvalCfg("FamilySit", 1)
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | lastTick = gameFB.GetGameFBDictByKey(key)
|
| | | if tick - lastTick < interval * 1000:
|
| | | return
|
| | | gameFB.SetGameFBDict(key, tick)
|
| | | |
| | | worldlv = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | playerCount = playerManager.GetPlayerCount()
|
| | | # 每增加一名仙盟成员加成经验百分比|最高加成百分比,两个人开始算加成
|
| | | perPlayerExpRateAdd, expRateAddMax = IpyGameDataPY.GetFuncEvalCfg("FamilySit", 3)
|
| | | expRateEx = min(expRateAddMax, (playerCount - 1) * perPlayerExpRateAdd) if playerCount > 1 else 0
|
| | | |
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | |
| | | expRound = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitExpRound)
|
| | | if expRound < expRoundMax:
|
| | | expRound += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitExpRound, expRound)
|
| | | |
| | | # 给经验
|
| | | reLV = curPlayer.GetLV()
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | giveExp = eval(IpyGameDataPY.GetFuncCompileCfg("FamilySit", 2))
|
| | | finalAddExp = PlayerControl.PlayerControl(curPlayer).AddExp(giveExp, ShareDefine.Def_ViewExpType_Sit, expRateEx=expRateEx)
|
| | | |
| | | exp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitTotalExp)
|
| | | expPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitTotalExpPoint)
|
| | | newTotalExp = expPoint * ChConfig.Def_PerPointValue + exp + finalAddExp
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitTotalExp, newTotalExp % ChConfig.Def_PerPointValue)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilySitTotalExpPoint, newTotalExp / ChConfig.Def_PerPointValue) |
| | | |
| | | #GameWorld.DebugLog("打坐经验: expRound=%s,reLV=%s,reExp=%s,giveExp=%s,expRateEx=%s,finalAddExp=%s" |
| | | # % (expRound, reLV, reExp, giveExp, expRateEx, finalAddExp), curPlayer.GetPlayerID())
|
| | | |
| | | DoFBHelp(curPlayer, tick)
|
| | | |
| | | return
|
| | |
|
| | | def FamilyPartyAnswerRight(curPlayer, answerInfo):
|
| | | #回答正确,给奖励
|
| | |
| | | lineID = GameWorld.GetGameWorld().GetLineID()
|
| | | helpDict['familyPartyPlayer'] = g_familyMapPlayerIDDict.get(lineID, [])
|
| | |
|
| | | # 打坐
|
| | | sitActionState = gameWorld.GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilySit)
|
| | | if sitActionState:
|
| | | exp = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitTotalExp)
|
| | | expPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitTotalExpPoint)
|
| | | expRound = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilySitExpRound)
|
| | | playerCount = GameWorld.GetMapCopyPlayerManager().GetPlayerCount()
|
| | | sitInfo = {FBCommon.Help_exp:exp, FBCommon.Help_expPoint:expPoint, "expRound":expRound, "playerCount":playerCount}
|
| | | helpDict["sitInfo"] = sitInfo
|
| | | |
| | | GameWorld.DebugLog("DoFBHelp %s" % helpDict, playerID)
|
| | | FBCommon.Notify_FBHelp(curPlayer, helpDict)
|
| | | return
|
| | |
| | | # @param expViewType 经验获得的渠道
|
| | | # @param isSysHint 是否系统提示(默认是)
|
| | | # @return 布尔值
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True, addSkillID=0):
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True, addSkillID=0, expRateEx=0):
|
| | | curPlayer = self.__Player
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint, addSkillID)
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint, addSkillID, expRateEx)
|
| | |
|
| | | # 通知客户端经验来源
|
| | | if finalAddExp:
|
| | |
| | | return finalAddExp
|
| | |
|
| | | # 参数 addSkillID 表示因什么技能杀死NPC获得经验
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0):
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0, expRateEx=0):
|
| | | if addExp == 0:
|
| | | # 不进入计算
|
| | | return addExp, expViewType
|
| | |
| | |
|
| | | elif expViewType in [ShareDefine.Def_ViewExpType_GameEvent, ShareDefine.Def_ViewExpType_Sit]:
|
| | | exp_rate = curPlayer.GetGameEventExpRate()
|
| | | exp_rate += GetFamilySitExpPer(curPlayer)
|
| | | exp_rate += expRateEx
|
| | | else:
|
| | | exp_rate = max(GameWorld.GetGameWorld().GetExpRate(), ChConfig.Def_MaxRateValue)
|
| | |
|
| | |
| | | reLV = curPlayer.GetLV()
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | giveExp = eval(IpyGameDataPY.GetFuncCompileCfg("FamilyChuangong", 2))
|
| | | finalAddExp = playerControl.AddExp(giveExp, ShareDefine.Def_ViewExpType_SysEx)
|
| | | finalAddExp = playerControl.AddExp(giveExp, ShareDefine.Def_ViewExpType_Chuangong)
|
| | | totalExp += finalAddExp
|
| | | GameWorld.DebugLog("传功经验: 轮次=%s,reLV=%s,reExp=%s,finalAddExp=%s, %s" % (index, reLV, reExp, finalAddExp, totalExp), playerID)
|
| | |
|
| | |
| | | Def_ViewExpType_SysEx, #系统给经验-不需要展示倍率 用来区别于类型0 7
|
| | | Def_ViewExpType_LYZS, #烈焰战神 特殊特效 8
|
| | | Def_ViewExpType_Activity, #活跃吸纳 9
|
| | | ) = range(0, 10)
|
| | | Def_ViewExpType_Chuangong, #传功经验10
|
| | | ) = range(0, 11)
|
| | |
|
| | |
|
| | | #物品相关操作类型
|
| | |
| | | DailyActionID_Arena, # 竞技场 33
|
| | | DailyActionID_CrossDemonLand, # 跨服魔化之地Boss 34
|
| | | DailyActionID_CrossBattlefield, # 跨服战场 35
|
| | | ) = range(1, 35 + 1)
|
| | | DailyActionID_FamilySit, # 跨服战场 36
|
| | | ) = range(1, 36 + 1)
|
| | |
|
| | | # 跨服每日活动编号定义, 从150开始
|
| | | CrossDailyActionIDList = (
|