#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
##@package PlayerGameEvent
|
#СÓÎϷʼþÂß¼´¦Àí
|
#
|
# @author ifo
|
# @date 2010-4-23
|
# @version 2.1
|
#
|
# @change: "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ
|
# @change: "2010-05-26 14:27" panwei ¿ªÆôµöÓã, ×¢Ê͵ô»Æ½ðС·¹ÍŵÈÔö¼ÓСÓÎÏ·¾ÑéµÄÎïÆ·
|
# @change: "2010-07-09 17:55" panwei ¹Ø±ÕÑæ»ð¹¦ÄÜ
|
# @change: "2010-09-01 16:40" panwei СÓÎϷʼþÂß¼ÖØ¹¹
|
# @change: "2010-11-22 12:15" Alee ÏÞÖÆÐ¡ÓÎÏ·
|
# @change: "2010-12-07 12:00" Alee ͨ¹ý¶¯×÷»ñµÃ¶¯×÷λÐÞÕý
|
# @change: "2010-12-28 17:30" panwei »ñÈ¡¾ÑéÐÂÔöÇþµÀ, º¬É±¹Ö, ÓÎÏ·, ÈÎÎñ
|
# @change: "2011-05-03 15:40" panwei µöÓãÕٻسèÎï
|
# @change: "2011-07-01 12:40" Alee ·À³ÁÃÔÏÞÖÆ
|
# @change: "2013-09-10 20:10" Alee ϵͳÌáʾ³åÍ»
|
# @change: "2015-07-01 18:00" hxp µöÓãÐÞ¸Ä
|
#---------------------------------------------------------------------
|
"""Version = 2015-07-01 18:00"""
|
#------------------------------------------------------------------------------
|
import ShareDefine
|
import ChConfig
|
import IPY_GameWorld
|
import GameWorld
|
import random
|
import ItemControler
|
import PlayerControl
|
import EventShell
|
import ItemCommon
|
import GameDataControl
|
import OperControlManager
|
import PetControl
|
import ReadChConfig
|
import DataRecordPack
|
import ChPyNetSendPack
|
import NetPackCommon
|
import NPCCommon
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
## ¿ªÊ¼Ð¡ÓÎϷʼþ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param eventType ʼþÀàÐÍ
|
# @param tick µ±Ç°Ê±¼ä
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks ¿ªÊ¼Ð¡ÓÎϷʼþ
|
def StartGameEvent(curPlayer, eventType, tick):
|
if eventType == IPY_GameWorld.geDance:
|
PlayerControl.NotifyCode(curPlayer, "BeginDance")
|
|
elif eventType == IPY_GameWorld.geFish:
|
#PlayerControl.NotifyCode(curPlayer, "BeginFishing")
|
pass
|
|
else:
|
GameWorld.ErrLog('StartGameEvent unKnowType = %s'%(eventType))
|
return
|
|
#Çå³ýµã»÷¶ÔÏó
|
curPlayer.SetActionObj(None)
|
#ÖжÏÕ½¶·¶ÔÖÅ
|
PlayerControl.ExitPlayerConfronting(curPlayer)
|
#ÕÙ»½»Ø³öÕ½µÄ³èÎï
|
PetControl.ReCallFightPet(curPlayer)
|
|
#¿ªÊ¼ÓÎϷʼþ
|
curPlayer.SetGameEventTick(tick)
|
curPlayer.SetFishEventTick(tick)
|
curPlayer.SetDanceEventTick(tick)
|
|
curPlayer.SetPlayerGameEvent(eventType)
|
__PutonFishermanEquipment(curPlayer)
|
curPlayer.View_StartGameEvent(eventType)
|
GameWorld.DebugLog("StartGameEvent...")
|
return
|
|
##»ñÈ¡Óæ·ò×°ID
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def GetFishermanCoatID(curPlayer):
|
jobType = ChConfig.JOB_TYPE_DICT[curPlayer.GetJob()]
|
jobCoatIDDict = ReadChConfig.GetEvalChConfig("FisherClothes")
|
return jobCoatIDDict.get(jobType, [0, 0])
|
|
##´©ÉÏÓæ·ò×°±¸
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def __PutonFishermanEquipment(curPlayer):
|
return
|
|
##¸øÎ±×°Ê±×°
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def __AssignItem(curPlayer, index, itemID):
|
equipePack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
destItem = equipePack.GetAt(index)
|
|
destItem.Clear()
|
|
tagItem = ItemCommon.CreateSingleItem(itemID)
|
if tagItem == None:
|
# ÎÞ´ËÎïÆ·
|
GameWorld.ErrLog('Can not find item, itemID=%s' % itemID)
|
return False
|
|
destItem.AssignItem(tagItem)
|
|
curPlayer.ChangeEquip(itemID, index, 0, 0, 0, destItem.GetUserData())
|
return True
|
|
##ÍÑÏÂÓæ·ò×°±¸
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def TakeoffFishermanEquipment(curPlayer):
|
|
#===============================================================================
|
# clothesID, weaponID = GetFishermanCoatID(curPlayer)
|
#
|
# equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
#
|
# clothesCoatItem = equipPack.GetAt(IPY_GameWorld.retClothesCoat)
|
# if clothesCoatItem and not clothesCoatItem.IsEmpty() and clothesCoatItem.GetItemTypeID() == clothesID:
|
# clothesCoatItem.Clear()
|
# curPlayer.Sync_UnEquipItem(clothesID, IPY_GameWorld.retClothesCoat)
|
# GameWorld.DebugLog(" TakeoffFishermanEquipment clothesID=%s" % clothesID)
|
#
|
# weaponCoatItem = equipPack.GetAt(IPY_GameWorld.retWeaponCoat)
|
# if weaponCoatItem and not weaponCoatItem.IsEmpty() and weaponCoatItem.GetItemTypeID() == weaponID:
|
# weaponCoatItem.Clear()
|
# curPlayer.Sync_UnEquipItem(weaponID, IPY_GameWorld.retWeaponCoat)
|
# GameWorld.DebugLog(" TakeoffFishermanEquipment weaponID=%s" % weaponID)
|
#===============================================================================
|
|
return
|
#---------------------------------------------------------------------
|
## Í£Ö¹Íæ¼ÒСÓÎϷʼþ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param tick ʱ¼ä´Á
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks Í£Ö¹Íæ¼ÒСÓÎϷʼþ
|
def StopGameEvent(curPlayer, tick):
|
curPlayer.SetPlayerGameEvent(IPY_GameWorld.geNull)
|
curPlayer.View_StartGameEvent(IPY_GameWorld.geNull)
|
|
#Èç¹ûÔÚÓÎÏ·ÖÐ,ÉèÖÃΪ¿ÕÏÐ״̬
|
if curPlayer.GetPlayerAction() == IPY_GameWorld.paGameEvent:
|
PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
|
|
TakeoffFishermanEquipment(curPlayer)
|
GameWorld.DebugLog("StopGameEvent...")
|
return
|
#---------------------------------------------------------------------
|
## ¼ì²âÊÇ·ñ¿ÉÒÔ¿ªÊ¼Ð¡ÓÎÏ·Âß¼
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param tick µ±Ç°Ê±¼ä
|
# @return ²¼¶ûÖµ
|
# @remarks ¼ì²âÊÇ·ñ¿ÉÒÔ¿ªÊ¼Ð¡ÓÎÏ·Âß¼
|
def CheckCanBeginGameEvent(curPlayer, tick):
|
#---ÑéÖ¤Íæ¼Ò»ù´¡×´Ì¬---
|
|
if curPlayer.GetPlayerAction() not in ChConfig.Def_Player_StartGameEvent_State:
|
return False
|
|
#---ÑéÖ¤Íæ¼ÒÌØÊâ״̬---
|
|
if curPlayer.IsMoving():
|
#PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_0")
|
return False
|
|
return True
|
#---------------------------------------------------------------------
|
## ´¦ÀíÍæ¼ÒСÓÎϷʼþ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param tick µ±Ç°Ê±¼ä
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks ¶¨Ê±Æ÷µ÷ÓÃ, ´¦ÀíÍæ¼ÒСÓÎϷʼþ
|
def ProcessGameEvent(curPlayer, tick):
|
#---»ù±¾¼ì²é---
|
|
if curPlayer.GetPlayerGameEvent() == IPY_GameWorld.geNull:
|
return
|
|
#---Ö´ÐÐСÓÎÏ·¶¯×÷---
|
|
if __ProcessGameEvent(curPlayer, tick):
|
return
|
|
#---Ö´ÐÐСÓÎÏ·¶¯×÷ʧ°Ü, ½áÊøÐ¡ÓÎÏ·---
|
|
StopGameEvent(curPlayer, tick)
|
return
|
#---------------------------------------------------------------------
|
## ´¦ÀíÍæ¼ÒСÓÎϷʼþ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param tick µ±Ç°Ê±¼ä
|
# @return ²¼¶ûÖµ, ÊÇ·ñ¼ÌÐøÐ¡ÓÎϷ״̬
|
# @remarks ÄÚ²¿º¯Êý, ´¦ÀíÍæ¼ÒСÓÎϷʼþ
|
def __ProcessGameEvent(curPlayer, tick):
|
#---Íæ¼Ò״̬¼ì²é, ÊÇ·ñ»¹¿ÉÒÔ¼ÌÐøÐ¡ÓÎϷʼþ---
|
curPlayerAction = curPlayer.GetPlayerAction()
|
|
if curPlayerAction != IPY_GameWorld.paGameEvent:
|
return False
|
|
#---Íæ¼ÒÓÎϷʼþ¼ì²é---
|
gameEventType = curPlayer.GetPlayerGameEvent()
|
|
if not CanProcessGameEvent(curPlayer, gameEventType, tick):
|
return False
|
|
#---´¦ÀíÌøÎè---
|
if gameEventType == IPY_GameWorld.geDance:
|
__GivePlayerGameEventReward(curPlayer, gameEventType, ChConfig.Def_Item_Type_Dance, \
|
curPlayer.GetDanceEventTick(), ChConfig.Def_EventRewardTime, curPlayer.SetDanceEventTick, tick)
|
return True
|
|
#---´¦ÀíµöÓã---
|
__GivePlayerGameEventReward(curPlayer, gameEventType, ChConfig.Def_Item_Type_Fish, \
|
curPlayer.GetFishEventTick(), ChConfig.Def_EventRewardTime, curPlayer.SetFishEventTick, tick)
|
return True
|
#---------------------------------------------------------------------
|
## ÊÇ·ñÄܼÌÐøÓÎϷʼþ
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param gameEvent ÓÎϷʼþ
|
# @param tick µ±Ç°Ê±¼ä
|
# @return ²¼¶ûÖµ
|
# @remarks ÊÇ·ñÄܼÌÐøÓÎϷʼþ
|
def CanProcessGameEvent(curPlayer, gameEvent, tick):
|
#---ͨÓüì²é---
|
#ͨ¹ý¶¯×÷»ñµÃÏàÓ¦¶¯×÷λ
|
curActBit= OperControlManager.GetActBitByAction(ChConfig.Def_ActBit_GameEvent, gameEvent)
|
|
if curActBit != None:
|
#À½ø¶ÈÌõÖР״̬, ·þÎñ¶ËÏÞÖÆ
|
if not OperControlManager.IsObjCanDoAction(curPlayer,
|
ChConfig.Def_Obj_ActState_ServerAct,
|
curActBit):
|
return False
|
|
#Óн»Í¨¹¤¾ß²»¿ÉÖ´ÐÐ
|
#if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvNull:
|
# GameWorld.DebugLog("Óн»Í¨¹¤¾ß£¬²»¿ÉÖ´ÐÐСÓÎÏ·£¡")
|
# return False
|
|
#---µöÓã¼ì²é---
|
|
if gameEvent == IPY_GameWorld.geFish:
|
# ºóÐøÓÐÐèÒªÓà GetAreaTypeByMapPosÅжÏ
|
pass
|
#PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_542057")
|
|
#if not CheckPlayerFishWeapon(curPlayer, tick):
|
# PlayerControl.NotifyCode(curPlayer, "ScarcityRod")
|
# return False
|
|
#if not curPlayer.GetHaveGameBuff():
|
# PlayerControl.NotifyCode(curPlayer, "GeRen_jin_681085")
|
# return False
|
|
return True
|
#---------------------------------------------------------------------
|
## ¼ì²éÍæ¼ÒµöÓ㹤¾ß
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param tick µ±Ç°Ê±¼ä
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def CheckPlayerFishWeapon(curPlayer, tick):
|
#µÃµ½Íæ¼ÒµÄÎäÆ÷¸ñ
|
playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
curWeapon = playerEquip.GetAt(ShareDefine.retWeapon)
|
|
if curWeapon.IsEmpty():
|
#ÐèÒªÓã¸Í,µ«ÊÇÍæ¼ÒûÓÐ×°±¸Óã¸Í
|
#GameWorld.Log("ûÓÐ×°±¸ÎäÆ÷")
|
return False
|
|
#¼ì²éÊÇ·ñ×°±¸ÁËÓã¸Í
|
return curWeapon.GetEffectByIndex(0).GetEffectID() == ChConfig.Def_Item_Effect_FishTool
|
#---------------------------------------------------------------------
|
## ¸øÍæ¼ÒСÓÎÏ·½±Àø
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @return ÎÞÒâÒå
|
# @remarks ¸øÍæ¼ÒСÓÎÏ·½±Àø
|
def AddGameEventExp(curPlayer):
|
#---»ñµÃÍæ¼Ò¶ÓÎéÈËÊý(º¬×Ô¼º)---
|
|
teamMemberList = PlayerControl.GetAreaTeamMember(curPlayer.GetTeam(), curPlayer.GetPosX(), curPlayer.GetPosY())
|
teamMemberCnt = len(teamMemberList)
|
|
#---»ñµÃReExp---
|
|
#ReEXPµÄµÈ¼¶²î
|
getExpLV = max(1, curPlayer.GetLV() - ChConfig.Def_GameEventExpLVDiff)
|
|
givePlayerReExp = 0
|
|
#---¸øÍæ¼Ò¾Ñé---
|
|
giveExp = GameWorld.GetFloatUpper(givePlayerReExp * ChConfig.Def_TeamMemberExp[teamMemberCnt])
|
|
playerControl = PlayerControl.PlayerControl(curPlayer)
|
playerControl.AddExp(giveExp, ShareDefine.Def_ViewExpType_GameEvent)
|
return
|
#---------------------------------------------------------------------
|
## ¸øÓèÍæ¼ÒÓÎÏ·½±ÀøÎïÆ·
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @param giveItemType ½±ÀøÎïÆ·ÀàÐÍ
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks ¸øÓèÍæ¼ÒÓÎÏ·½±ÀøÎïÆ·
|
def AddGameEventItem(curPlayer, giveItemType):
|
#---¼ì²éÊÇ·ñ´ïµ½Ã¿ÈÕ×î´ó»ñÈ¡ÉÏÏÞ---
|
dayCount = curPlayer.GetDayProcessGameEventCount()
|
|
#===============================================================================
|
# #ÔÝʱ²»ÏÞÖÆÁË
|
# if dayCount > ChConfig.Def_EventCount:
|
# #GameWorld.Log("µ±Ç°´ÎÊý = %s,³¬¹ýÿÈÕ×î´ó´ÎÊý %s,²»ÄÜ»ñµÃÎïÆ·"%(dayCount , ChConfig.Def_EventCount))
|
# return
|
#===============================================================================
|
curPlayer.SetDayProcessGameEventCount(dayCount + 1)
|
|
#---¼ì²éʼþ½±Àø¸ÅÂÊ---
|
happenRate = eval(ChConfig.Def_EventRate)
|
|
if not GameWorld.CanHappen(happenRate, ChConfig.Def_EventMaxRate):
|
return
|
|
#---¸øÍæ¼Ò½±ÀøÎïÆ·---
|
|
#»ñµÃ½±Àø¸øÍæ¼ÒµÄÎïÆ·Áбí
|
giveItemList = GameDataControl.GetItemDataListByType(giveItemType)
|
|
if len(giveItemList) == 0:
|
GameWorld.ErrLog('СÓÎϷʼþ, Êý¾Ý¿âÎÞ´ËÀàÐÍÎïÆ· giveItemType = %s'%(giveItemType))
|
return
|
|
#Ëæ»ú¸øÍæ¼ÒÒ»¸ö½±ÀøÎïÆ·
|
giveItemData = random.choice(giveItemList)
|
#ÎïÆ·ÊôÐÔ
|
giveItemID = giveItemData.GetItemTypeID()
|
giveItemCnt = 1
|
giveItemBind = False
|
#·ÅÈë±³°üË÷Òý
|
packIndex = IPY_GameWorld.rptItem
|
|
itemControl = ItemControler.PlayerItemControler(curPlayer)
|
|
if not itemControl.CanPutInItem(packIndex, giveItemID, giveItemCnt, giveItemBind):
|
PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_676165", [packIndex])
|
return
|
|
giveItem = ItemCommon.CreateSingleItem(giveItemID)
|
|
if giveItem == None:
|
GameWorld.ErrLog("СÓÎϷʼþ, ´´ÔìÎïÆ·ID = %s, ʧ°Ü"%(giveItemID))
|
return
|
|
if not itemControl.PutInItem(packIndex, giveItem):
|
giveItem.Clear()
|
GameWorld.ErrLog('СÓÎϷʼþ, ·ÅÈëÎïÆ·Òì³£!! itemID = %s'%(giveItemID))
|
return
|
|
#PlayerControl.NotifyCode(curPlayer, "ObtainRes01", [giveItemID, giveItemCnt])
|
return
|
#---------------------------------------------------------------------
|
## ¸øÓèÍæ¼ÒСÓÎϷʼþ½±Àø
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param eventType ʼþÀàÐÍ
|
# @param giveItemType ¸øÓè½±ÀøÎïÆ·ÀàÐÍ
|
# @param lastTimeTick Éϴν±ÀøÊ±¼ä´Á
|
# @param limitTimeGap ½±ÀøÏÞÖÆÊ±¼ä¼ä¸ô
|
# @param setTickFunc ±£´æ±¾´Î½±Àøº¯Êý½á¹¹Ìå
|
# @param tick µ±Ç°Ê±¼ä´Á
|
# @return ÎÞ·µ»ØÖµ
|
# @remarks ¸øÓèÍæ¼ÒСÓÎϷʼþ½±Àø
|
def __GivePlayerGameEventReward(curPlayer, eventType, giveItemType, lastTimeTick, limitTimeGap, setTickFunc, tick):
|
#---¼ì²â¼ä¸ô---
|
if tick - lastTimeTick < limitTimeGap:
|
return
|
|
setTickFunc(tick)
|
|
#·À³ÁÃÔ
|
if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_Wallow_LV) > ChConfig.Def_GameWallow_LV_First:
|
PlayerControl.NotifyCode(curPlayer, "AvoidSink09")
|
return
|
|
#---֪ͨ¿Í»§¶Ë»ñµÃ½±Àø---
|
curPlayer.Sync_GameEventResult(eventType)
|
|
#¸øÍæ¼Ò¾Ñé
|
AddGameEventExp(curPlayer)
|
|
#¸øÍæ¼ÒÎïÆ·
|
AddGameEventItem(curPlayer, giveItemType)
|
|
#µ÷ÓÃÈÎÎñ´¥·¢Æ÷
|
EventShell.EventRespons_OnGameEvent(curPlayer)
|
return
|
#---------------------------------------------------------------------
|
|
## Ö´ÐеöÓãÂß¼
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @param fishType µöÓã½±ÀøÀàÐÍ
|
# @return ÎÞ·µ»ØÖµ
|
def DoFishLogic(curPlayer, fishType):
|
GameWorld.DebugLog("µöÓãÊÕ¸Ë: fishType=%s" % (fishType))
|
|
fishAwardTypeDict = __GetFishAwardTypeDict(curPlayer)
|
if not fishAwardTypeDict:
|
return
|
|
if fishType not in fishAwardTypeDict:
|
return
|
|
fishAwardItemList = fishAwardTypeDict[fishType]
|
awardItemInfo = GameWorld.GetResultByRandomList(fishAwardItemList)
|
if len(awardItemInfo) != 4:
|
return
|
|
#ÑéÖ¤±³°ü¿Õ¼ä
|
if not ItemCommon.CheckPackHasSpace(curPlayer, IPY_GameWorld.rptItem):
|
PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
return
|
|
hasBind = False
|
|
# µöÓãÏûºÄ
|
costItemInfo = ReadChConfig.GetEvalChConfig("FishCostItem")
|
if costItemInfo:
|
costItemID, costItemCnt = costItemInfo
|
if costItemID > 0 and costItemCnt > 0:
|
itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(
|
costItemID, itemPack, costItemCnt)
|
if not enough:
|
GameWorld.DebugLog("µöÓãÏûºÄÎïÆ·²»×ã costItemID=%s,costCnt=%s" \
|
% (costItemID, costItemCnt))
|
return True
|
|
ItemCommon.ReduceItem(curPlayer, itemPack, indexList, costItemCnt, False)
|
|
itemType, itemID, itemCnt, isBind = awardItemInfo
|
|
isBind = hasBind or isBind
|
if itemType == 0:
|
ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0,
|
[IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
|
elif itemType == 1:
|
ItemControler.GivePlayerAppointItem(curPlayer, itemID, False)
|
|
else:
|
GameWorld.ErrLog("µöÓã½±ÀøÀàÐͲ»Ö§³ÖitemType=%s" % itemType, curPlayer.GetPlayerID())
|
|
addDataDict = {"CostItemInfo":costItemInfo, "AwardItemInfo":awardItemInfo}
|
DataRecordPack.DR_FuncGiveItem(curPlayer, "Fish", addDataDict)
|
Sync_FishResult(curPlayer, awardItemInfo)
|
|
syncItemInfoList = [[itemType, itemID, itemCnt, isBind, ""]]
|
NPCCommon.SyncCollectionItemInfo(curPlayer, 0, 0, 0, syncItemInfoList)
|
return
|
|
## »ñÈ¡µöÓã½±ÀøÀàÐÍ×Öµä
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def __GetFishAwardTypeDict(curPlayer):
|
FishAwardLVModeDict = ReadChConfig.GetEvalChConfig("FishAwardLV")
|
modeID = None
|
playerLV = curPlayer.GetLV()
|
for lvKey, mIDStr in FishAwardLVModeDict.items():
|
if lvKey[0] <= playerLV <= lvKey[1]:
|
modeID = mIDStr
|
break
|
|
if not modeID:
|
GameWorld.ErrLog("ÕÒ²»µ½Íæ¼ÒµÈ¼¶¶ÔÓ¦µÄµöÓã½±ÀøÄ£°å£¡playerLV=%s" % playerLV, curPlayer.GetPlayerID())
|
return
|
|
modeFileName = "FishAward_%s" % modeID
|
fishAwardInfo = ReadChConfig.GetEvalChConfig(modeFileName)
|
|
if not fishAwardInfo:
|
return
|
|
infoKey = () # ĬÈÏkey
|
job = curPlayer.GetJob()
|
for key in fishAwardInfo.keys():
|
if job in key:
|
infoKey = key
|
break
|
|
if infoKey not in fishAwardInfo:
|
GameWorld.ErrLog('%s.txt can not find key=%s!' % (modeFileName, infoKey), curPlayer.GetPlayerID())
|
return
|
|
return fishAwardInfo[infoKey]
|
|
|
## ͬ²½µöÓã½á¹û
|
# @param curPlayer Íæ¼ÒʵÀý
|
# @return
|
def Sync_FishResult(curPlayer, awardItemInfo):
|
fishResultPack = ChPyNetSendPack.tagMCFishResult()
|
fishResultPack.Clear()
|
NetPackCommon.SendFakePack(curPlayer, fishResultPack)
|
return
|
|
|