| | |
| | | import GameObj |
| | | import PetControl |
| | | import SkillShell |
| | | import BuffSkill |
| | | |
| | | ( |
| | | FightState_Start, |
| | |
| | | |
| | | for obj in fightObjList: |
| | | TurnFightObjPerTurnActionnum(turnNum, actionNum, obj, tick) |
| | | |
| | | |
| | | objType = gameObj.GetGameObjType() |
| | | objID = gameObj.GetID() |
| | | SyncTurnFightObjAction(curPlayer, turnNum, objType, objID) |
| | |
| | | # 复活时机在自己行动节点 |
| | | if not DoReborn(gameObj): |
| | | continue |
| | | |
| | | |
| | | faction = GameObj.GetFaction(gameObj) |
| | | objName = GetObjName(gameObj) |
| | | curHP = GameObj.GetHP(gameObj) |
| | |
| | | |
| | | if isWin != None: |
| | | break |
| | | |
| | | |
| | | GameWorld.DebugLog("--- 战斗结束处理 ---") |
| | | overState = FightState_Win if isWin else FightState_Fail |
| | | SyncTurnFightState(curPlayer, mapID, funcLineID, tagPlayerID, overState, turnNum, turnMax) |
| | | |
| | | # 结算奖励...待扩展 |
| | | |
| | | for gameObj in fightObjList: |
| | | TurnFightObjOverReset(gameObj) |
| | | TurnFightObjOverReset(gameObj, tick) |
| | | |
| | | GameWorld.DebugLog("===== 回合制战斗结束: mapID=%s,funcLineID=%s,tagPlayerID=%s,isWin=%s,overState=%s" |
| | | % (mapID, funcLineID, tagPlayerID, isWin, overState), playerID) |
| | |
| | | |
| | | return |
| | | |
| | | def TurnFightObjOverReset(gameObj): |
| | | def TurnFightObjOverReset(gameObj, tick): |
| | | ## 回合制战斗实例结束重置 |
| | | if not gameObj: |
| | | return |
| | | |
| | | objType = gameObj.GetGameObjType() |
| | | |
| | | #NPC直接回收 |
| | | if objType == IPY_GameWorld.gotNPC: |
| | | RecycleObj(gameObj) |
| | | return |
| | | |
| | | if objType != IPY_GameWorld.gotPlayer: |
| | | return |
| | | |
| | | timeline = gameObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline) |
| | | isDelRefresh = ClearTurnFightBuff(gameObj, timeline, tick) |
| | | SetTimeline(gameObj, 0, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnBattleType, 0) |
| | | GameObj.SetFaction(gameObj, 0) |
| | | |
| | | objType = gameObj.GetGameObjType() |
| | | if objType == IPY_GameWorld.gotPlayer: |
| | | pass |
| | | |
| | | elif objType == IPY_GameWorld.gotNPC: |
| | | RecycleObj(gameObj) |
| | | GameObj.SetHPFull(gameObj) |
| | | if isDelRefresh: |
| | | playerControl = PlayerControl.PlayerControl(gameObj) |
| | | playerControl.RefreshPlayerAttrByBuff() |
| | | return |
| | | |
| | | def ClearTurnFightBuff(gameObj, timeLine, tick): |
| | | ## 清除回合制战斗相关buff |
| | | isDelRefresh = False |
| | | objType = gameObj.GetGameObjType() |
| | | objID = gameObj.GetID() |
| | | for buffType in range(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax): |
| | | if objType != IPY_GameWorld.gotPlayer and buffType in ChConfig.Def_BuffType_OnlyPlayer: |
| | | continue |
| | | buffTuple = SkillCommon.GetBuffManagerByBuffType(gameObj, buffType) |
| | | if buffTuple == (): |
| | | continue |
| | | buffState = buffTuple[0] |
| | | for i in range(0, buffState.GetBuffCount())[::-1]: |
| | | curBuff = buffState.GetBuff(i) |
| | | curSkill = curBuff.GetSkill() |
| | | buffSkillID = curSkill.GetSkillID() |
| | | if not buffSkillID: |
| | | continue |
| | | if curBuff.GetCalcStartTick() > timeLine: |
| | | # 回合制中产生的buff是以timeline作为CalcStartTick的,所以超过timeline的可视为非回合制buff |
| | | continue |
| | | GameWorld.DebugLog(" 删除回合制buff: buffSkillID=%s" % buffSkillID, objID) |
| | | ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType() |
| | | BuffSkill.DoBuffDisApper(gameObj, curBuff, tick) |
| | | buffState.DeleteBuffByIndex(i) |
| | | SkillShell.ClearBuffEffectBySkillID(gameObj, buffSkillID, ownerID, ownerType) |
| | | #删除未知BUFF,刷新属性 |
| | | isDelRefresh = True |
| | | return isDelRefresh |
| | | |
| | | def RecycleObj(gameObj): |
| | | ## 释放回合制战斗对象 |
| | | |