| | |
| | | def __doClickUnOpendGrid(curPlayer, row, col):
|
| | | ## 执行点击未开启的格子
|
| | | gridState = GetGridState(curPlayer, row, col)
|
| | | if gridState == GridState_None:
|
| | | crackRate = IpyGameDataPY.GetFuncCfg("TravelRate", 1)
|
| | | if GameWorld.CanHappen(crackRate):
|
| | | GameWorld.DebugLog("触发裂纹: row=%s,col=%s,crackRate=%s" % (row, col, crackRate))
|
| | | SetGridState(curPlayer, row, col, GridState_Crack)
|
| | | else:
|
| | | __openGridRandEvent(curPlayer, row, col)
|
| | | |
| | | # 再次点击裂纹
|
| | | elif gridState == GridState_Crack:
|
| | | if gridState in [GridState_None, GridState_Crack]:
|
| | | __openGridRandEvent(curPlayer, row, col)
|
| | | else:
|
| | | return
|
| | |
| | |
|
| | | def __openGridRandEvent(curPlayer, row, col):
|
| | | ## 执行打开格子随机生成事件
|
| | | SetGridState(curPlayer, row, col, GridState_Opend)
|
| | | eventID = GetGridEventID(curPlayer, row, col)
|
| | | if eventID:
|
| | | SetGridState(curPlayer, row, col, GridState_Opend)
|
| | | GameWorld.DebugLog("该游历格子已经有事件ID了! row=%s,col=%s,eventID=%s" % (row, col, eventID))
|
| | | return
|
| | |
|
| | |
| | | eventID = EventID_Blank
|
| | | else:
|
| | | eventID = ipyData.GetEventID()
|
| | | if ipyData.GetAwardItemID():
|
| | | awardItemID = ipyData.GetAwardItemID()
|
| | | if awardItemID in IpyGameDataPY.GetFuncEvalCfg("TravelRate", 1) and GetGridState(curPlayer, row, col) == GridState_None:
|
| | | GameWorld.DebugLog("必出现裂纹的奖励事件! eventID=%s,awardItemID=%s" % (eventID, awardItemID))
|
| | | SetGridState(curPlayer, row, col, GridState_Crack)
|
| | | |
| | | if awardItemID:
|
| | | multiRate = IpyGameDataPY.GetFuncCfg("TravelRate", 2)
|
| | | if GameWorld.CanHappen(multiRate):
|
| | | multi = 2
|
| | | SetGridMulti(curPlayer, row, col, multi)
|
| | | SetGridEventID(curPlayer, row, col, eventID)
|
| | | if GetGridState(curPlayer, row, col) == GridState_None:
|
| | | SetGridState(curPlayer, row, col, GridState_Opend)
|
| | | GameWorld.DebugLog("随机格子事件: row=%s,col=%s,eventID=%s,multi=%s" % (row, col, eventID, multi))
|
| | | return
|
| | |
|
| | |
| | | eventID = GetGridEventID(curPlayer, row, col)
|
| | | if eventID in SpecEventIDList or eventID < EventID_Portal:
|
| | | continue
|
| | | if GetGridState(curPlayer, row, col) != GridState_Opend:
|
| | | #GameWorld.DebugLog(" 未开启的格子: row=%s,col=%s,eventID=%s" % (row, col, eventID))
|
| | | continue
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog("TravelEvent", eventID)
|
| | | if not ipyData:
|
| | | continue
|