| | |
| | | # @param expViewType 经验获得的渠道
|
| | | # @param isSysHint 是否系统提示(默认是)
|
| | | # @return 布尔值
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True):
|
| | | def AddExp(self, addExp, expViewType=ShareDefine.Def_ViewExpType_Mission, isSysHint=True, addSkillID=0):
|
| | | curPlayer = self.__Player
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint)
|
| | | finalAddExp, expNotifyType = self.__AddExp(curPlayer, addExp, expViewType, isSysHint, addSkillID)
|
| | |
|
| | | # 通知客户端经验来源
|
| | | if finalAddExp:
|
| | |
| | |
|
| | | return finalAddExp
|
| | |
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint):
|
| | | # 参数 addSkillID 表示因什么技能杀死NPC获得经验
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0):
|
| | | if addExp == 0:
|
| | | # 不进入计算
|
| | | return addExp, expViewType
|
| | |
| | | if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
|
| | | exp_rate = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)
|
| | | superRate = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(curPlayer, None, None, ChConfig.TriggerType_AddExpRate)
|
| | | if addSkillID == ChConfig.Def_SkillID_LXHY_AddExpRate:
|
| | | addSkill = GameWorld.GetGameData().GetSkillBySkillID(addSkillID)
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(addSkill, ChConfig.Def_Skill_Effect_AddExpRate)
|
| | | if hasEffect:
|
| | | superRate += hasEffect.GetEffectValue(0)
|
| | | exp_rate += superRate
|
| | | if superRate:
|
| | | expViewType = ShareDefine.Def_ViewExpType_KillNPCSuper
|