| | |
| | | def __doSetAttr(curPlayer, msgList):
|
| | | ## 设置属性
|
| | | attrID = msgList[1] if len(msgList) > 1 else 1
|
| | | attrValue = msgList[2] if len(msgList) > 2 else 1
|
| | | faction = msgList[3] if len(msgList) > 3 else 1
|
| | | posNum = msgList[4] if len(msgList) > 4 else 1
|
| | | attrValue = msgList[2] if len(msgList) > 2 else 1 |
| | | faction = msgList[3] if len(msgList) > 3 else 0
|
| | | pNum = msgList[4] if len(msgList) > 4 else 0
|
| | |
|
| | | if faction not in FactionList:
|
| | | GameWorld.DebugAnswer(curPlayer, "阵营: 1-左边;2-右边")
|
| | | factionList = [faction] if faction else FactionList
|
| | | |
| | | if attrID not in ChConfig.AttrIDList:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该属性ID:%s" % (attrID))
|
| | | return
|
| | |
|
| | | mainFightMgr = TurnAttack.GetMainFightMgr(curPlayer)
|
| | |
| | | if not turnFight.isInFight():
|
| | | GameWorld.DebugAnswer(curPlayer, "主线非战斗中")
|
| | | return
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(1)
|
| | | objID = batLineup.posObjIDDict.get(posNum)
|
| | | batObj = None
|
| | | |
| | | GameWorld.DebugAnswer(curPlayer, "----- 设置属性 -----")
|
| | | |
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | if objID:
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该战斗对象:阵营:%s,位置:%s" % (faction, posNum))
|
| | | return
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugAnswer(curPlayer, "该对象已被击杀:阵营:%s,位置:%s" % (faction, posNum))
|
| | | return
|
| | | |
| | | if attrID not in ChConfig.AttrIDList:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该属性ID:%s" % (attrID))
|
| | | return
|
| | | |
| | | objName = TurnAttack.GetObjName(batObj)
|
| | | GameWorld.DebugAnswer(curPlayer, "%s" % (objName))
|
| | | batObj.GMSetBatAttr(attrID, attrValue)
|
| | | if attrID == ChConfig.AttrID_HP:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置生命:%s/%s" % (batObj.GetHP(), batObj.GetMaxHP()))
|
| | | elif attrID == ChConfig.AttrID_XP:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置怒气:%s" % (batObj.GetXP()))
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置属性ID:%s,V=%s" % (attrID, attrValue))
|
| | | |
| | | for faction in factionList:
|
| | | if faction not in FactionList:
|
| | | GameWorld.DebugAnswer(curPlayer, "阵营: 1-左边;2-右边")
|
| | | continue
|
| | | batFaction = turnFight.getBatFaction(faction)
|
| | | batLineup = batFaction.getBatlineup(1)
|
| | | posNumList = [pNum] if pNum else batLineup.posObjIDDict.keys()
|
| | | for posNum in posNumList:
|
| | | objID = batLineup.posObjIDDict.get(posNum)
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | GameWorld.DebugAnswer(curPlayer, "对象不存在:阵营:%s,位置:%s" % (faction, posNum))
|
| | | continue
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugAnswer(curPlayer, "对象已阵亡:阵营:%s,位置:%s" % (faction, posNum))
|
| | | continue
|
| | | objName = TurnAttack.GetObjName(batObj)
|
| | | GameWorld.DebugAnswer(curPlayer, "%s" % (objName))
|
| | | batObj.GMSetBatAttr(attrID, attrValue)
|
| | | if attrID == ChConfig.AttrID_HP:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置生命:%s/%s" % (batObj.GetHP(), batObj.GetMaxHP()))
|
| | | elif attrID == ChConfig.AttrID_XP:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置怒气:%s" % (batObj.GetXP()))
|
| | | else:
|
| | | GameWorld.DebugAnswer(curPlayer, "设置属性ID:%s,V=%s" % (attrID, attrValue))
|
| | | return
|
| | |
|
| | | def __doKillObj(curPlayer, msgList):
|
| | |
| | | continue
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该战斗对象:阵营:%s,位置:%s" % (faction, posNum))
|
| | | GameWorld.DebugAnswer(curPlayer, "对象不存在:阵营:%s,位置:%s" % (faction, posNum))
|
| | | continue
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugAnswer(curPlayer, "该对象已被击杀:阵营:%s,位置:%s" % (faction, posNum))
|
| | | GameWorld.DebugAnswer(curPlayer, "对象已阵亡:阵营:%s,位置:%s" % (faction, posNum))
|
| | | continue
|
| | | GameWorld.DebugAnswer(curPlayer, "击杀: %s" % TurnAttack.GetObjName(batObj))
|
| | | TurnAttack.SetObjKilled(turnFight, batObj)
|
| | |
| | | objID = batLineup.posObjIDDict.get(posNum)
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该战斗对象:阵营:%s,位置:%s" % (faction, posNum))
|
| | | GameWorld.DebugAnswer(curPlayer, "对象不存在:阵营:%s,位置:%s" % (faction, posNum))
|
| | | return
|
| | | if not batObj.IsAlive():
|
| | | GameWorld.DebugAnswer(curPlayer, "该对象已被击杀:阵营:%s,位置:%s" % (faction, posNum))
|
| | | GameWorld.DebugAnswer(curPlayer, "对象已阵亡:阵营:%s,位置:%s" % (faction, posNum))
|
| | | return
|
| | |
|
| | | addBuff = TurnBuff.DoAddBuffBySkillID(turnFight, batObj, skillID)
|