def noticeClientBagUpdate(self, uuid, itemId, num): if uuid not in self.bagUUIDList: if num != 0: self.bagUUIDList.append(uuid) else: ERROR_MSG("--------exec Error check now!!! -----------") util.printStackTrace("noticeClientBagUpdate ") value = {} value["UUID"] = uuid value["itemID"] = int(itemId) value["amount"] = num self.client.onGetItemInfo(value) if num <= 0: self.bagUUIDList.remove(uuid)
def addEffect28(self, subSkillID, effectType, valueType, value, targetList): room = KBEngine.entities.get(self.roomID) # 补射 room.reShootCardID = self.id room.endRound = False ERROR_MSG(util.printStackTrace("addEffect28 reshoot ")) room.onCmdSelectSkill(PlayerOp.shoot)
def setSelectState(self,controllerID,op): if op != -1: ERROR_MSG(util.printStackTrace( "op select from ")) self.curPartOp = op if controllerID == self.avatarAID: self.aSelect = True # 使用前置技能 if controllerID == self.avatarBID: self.bSelect = True if self.aSelect and self.bSelect: self.aSelect = False self.bSelect = False self.onCmdSelectSkill(self.curPartOp)
def delBuffer(self, i): buffer = self.bufferContainer[i] subSkillID = buffer["subSkillID"] subSkillConf = skillConfig.SkillConfig[subSkillID] controller = KBEngine.entities.get(self.controllerID) ERROR_MSG("delBuffer cardID is " + str(self.id) + " buffer " + buffer.__str__()) ERROR_MSG(util.printStackTrace("delBuffer ")) noticeClient = subSkillConf["noticeClient"] if isinstance(controller, Avatar) and noticeClient == 1: controller.client.onDelBuffer(self.id, subSkillID)
def noticeClientResult(self): avatarA = KBEngine.entities.get(self.avatarAID) avatarB = KBEngine.entities.get(self.avatarBID) if self.roundResult == -1: ERROR_MSG(util.printStackTrace(" round result is -1")) ERROR_MSG("noticeClientResult " + str(self.roundResult)) if isinstance(avatarA, Avatar.Avatar): avatarA.client.onOprateResult(self.curPart, self.roundResult) if isinstance(avatarB, Avatar.Avatar): avatarB.client.onOprateResult(self.curPart, self.roundResult)
def onRoomEndResult(self, avatarAID, aScore, avatarBID, bScore): ERROR_MSG(util.printStackTrace("onRoomEndResult ")) if self.inActionType == ActionTypeEnum.action_clone: self.judgeInFootBallFeast(avatarAID, aScore, avatarBID, bScore) elif self.inActionType == ActionTypeEnum.action_world_boss: self.onWorldBossEndResult(avatarAID, aScore, avatarBID, bScore) elif self.inActionType == ActionTypeEnum.official_promotion: self.onOfficialEndResult(avatarAID, aScore, avatarBID, bScore) elif self.inActionType == ActionTypeEnum.action_arena: self.onArenaEndResult(avatarAID, aScore, avatarBID, bScore) elif self.inActionType == ActionTypeEnum.league_clone: self.onLeagueEndResult(avatarAID, aScore, avatarBID, bScore) elif self.inActionType == ActionTypeEnum.league_player: self.onLeagueEndResult(avatarAID, aScore, avatarBID, bScore) self.inRoom = 0
def onCmdPass(self): result = self.__canSteal() if result != -1: # 抢断成功 通知客户端播放动画 ERROR_MSG("-------onOprateResult------trickSucc----------------self.curPart " + str(self.curPart)) self.endRound = True result = ConditionEnum.con_result_be_steal else: result = self.__isPerfectPassBall() if result is True: # 通知客户端完美传球 ERROR_MSG("-------onOprateResult------perfectPassBall----------------self.curPart " + str(self.curPart)) result = ConditionEnum.con_result_perfect_pass else: ERROR_MSG(util.printStackTrace("passBall")) # 通知客户端普通传球 ERROR_MSG("-------onOprateResult------passBall----------------self.curPart " + str(self.curPart)) # self.__onThirdPart() result = ConditionEnum.con_result_pass_succ return result
def setReadyState(self,controllerID): ERROR_MSG("setReadyState " + str(controllerID) + " aReady is " + str(self.aReady) +" bready is " + str(self.bReady)) if controllerID == self.avatarAID: self.aReady = True if controllerID == self.avatarBID: self.bReady = True WARNING_MSG("aReady is " + str(self.aReady) +" bready is " + str(self.bReady)) if self.aReady and self.bReady: ERROR_MSG("setReadyState " + util.printStackTrace("setReadyState")) inTeamCardIDList = KBEngine.entities.get(self.avatarAID).inTeamcardIDList for cardID in inTeamCardIDList: self.usePassiveSkill(cardID, PassiveSkillCondition.game_start) self.usePassiveSkill(cardID, PassiveSkillCondition.first_half) inTeamCardIDList = KBEngine.entities.get(self.avatarBID).inTeamcardIDList for cardID in inTeamCardIDList: self.usePassiveSkill(cardID, PassiveSkillCondition.game_start) self.usePassiveSkill(cardID, PassiveSkillCondition.first_half) self.onCmdBeginFight()
def onCmdChangeOnlineState(self, argMap): guildDBID = argMap["guildDBID"] for item in self.guildNPCList: if item["configID"] == guildDBID: guildDBID = item["dbid"] WARNING_MSG(util.printStackTrace("onCmdChangeOnlineState")) def cancelApplyCB(guild, guildDBID, wasActive): if guildDBID not in self.dbidToMb: self.dbidToMb[guildDBID] = guild guild.onCmd("onChangeOnlineState", argMap) if guildDBID not in self.dbidToMb: KBEngine.createBaseAnywhereFromDBID("Guild", guildDBID, cancelApplyCB) else: guildMb = self.dbidToMb[guildDBID] guildMb.onCmd("onChangeOnlineState", argMap)