4359 子 【1.2.0】背包物品排序修改 / 【后端】背包物品排序修改
技能效果4028触发不死则进入CD;死亡清除被动BUFF
| | |
| | | # 理论伤害一致, 多加点预算伤害避免计算误差
|
| | | #hurtValue = min(ShareDefine.Def_UpperLimit_DWord, hurtValue+10)
|
| | | #atkObj.SetDict(ChConfig.Def_PlayerKey_ClientMaxHurtValue, int(hurtValue*1.2))
|
| | | hurtValue = atkObj.GetMaxAtk()*atkSkillPer*10 + atkObj.GetSuperHit() # 加入被动计算不准确改成估算
|
| | | hurtValue = atkObj.GetMaxAtk()*atkSkillPer*20 # 加入被动计算不准确改成估算
|
| | |
|
| | | clientValue, hurtType = SkillShell.GetClientHurtByObj(defObj.GetID(), defObjType)
|
| | | if clientValue <= hurtValue:
|
| | |
| | |
|
| | | # buff减少伤害百分比
|
| | | reducePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | | |
| | | # 被攻击被动技能特殊减免 受到单次伤害超过生命上限10%时候,减免50%伤害,CD10秒
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_curHurtValue, hurtValue)
|
| | | reducePer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ReduceHurtHPPer)
|
| | |
| | | remainHP = min(dMaxHP, max(0, dHP - hurtValue)) # 剩余血量
|
| | |
|
| | | remainHP = int(remainHP) #防范
|
| | |
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | GameObj.SetHP(defObj, remainHP, False)
|
| | |
|
| | |
| | | # @return 返回值无意义
|
| | | # @remarks 客户端封包响应 //0C 07 客户端发送仓库密码#tagSendWarehousePsw
|
| | | def SendWarehousePsw(curPlayer, tick):
|
| | | #玩家当前状态不是输入密码状态
|
| | | if curPlayer.GetWarehouseState() != IPY_GameWorld.wsEnterPsw:
|
| | | return
|
| | | |
| | | #获得客户端封包
|
| | | sendPack = IPY_GameWorld.IPY_SendWarehousePsw()
|
| | | curPsw = sendPack.GetPsw()
|
| | | oldPsw = curPlayer.GetWarehousePsw()
|
| | | |
| | | #这里是调用c++的过滤空格,可以过滤全角空格, python不能
|
| | | curPsw = GameWorld.GetGameWorld().GetCharTrim(curPsw)
|
| | | |
| | | #密码不正确
|
| | | if curPsw != oldPsw:
|
| | | curPlayer.Frm_WarehouseMsg(IPY_GameWorld.whmPswError)
|
| | | EventShell.DoExitEvent(curPlayer)
|
| | | |
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_pan_59781")
|
| | | return
|
| | | |
| | | #密码正确
|
| | | ShowWarehouse(curPlayer)
|
| | | #===========================================================================
|
| | | # #玩家当前状态不是输入密码状态
|
| | | # if curPlayer.GetWarehouseState() != IPY_GameWorld.wsEnterPsw:
|
| | | # return
|
| | | # |
| | | # #获得客户端封包
|
| | | # sendPack = IPY_GameWorld.IPY_SendWarehousePsw()
|
| | | # curPsw = sendPack.GetPsw()
|
| | | # oldPsw = curPlayer.GetWarehousePsw()
|
| | | # |
| | | # #这里是调用c++的过滤空格,可以过滤全角空格, python不能
|
| | | # curPsw = GameWorld.GetGameWorld().GetCharTrim(curPsw)
|
| | | # |
| | | # #密码不正确
|
| | | # if curPsw != oldPsw:
|
| | | # curPlayer.Frm_WarehouseMsg(IPY_GameWorld.whmPswError)
|
| | | # EventShell.DoExitEvent(curPlayer)
|
| | | # |
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_pan_59781")
|
| | | # return
|
| | | # |
| | | # #密码正确
|
| | | # ShowWarehouse(curPlayer)
|
| | | #===========================================================================
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | |
|
| | | def __CmpRolePack(item1, item2):
|
| | | # 装备评分高 评分0 评分低,外层分列表
|
| | | # 颜色-星数 - 装备类型 - ID,内层比较 暂时不做时间判断
|
| | | #===========================================================================
|
| | | # # 颜色-星数 - 装备类型 - ID,内层比较 暂时不做时间判断
|
| | | # |
| | | # if item1.GetItemColor() == item2.GetItemColor():
|
| | | # if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | # itemType1 = item1.GetType()
|
| | | # itemType2 = item2.GetType()
|
| | | # if itemType1 == itemType2:
|
| | | # return cmp(item1.GetItemTypeID(), item2.GetItemTypeID())
|
| | | # else:
|
| | | # #类型有定义配置顺序
|
| | | # typeList = IpyGameDataPY.GetFuncEvalCfg("PackageSortPriority", 1)
|
| | | # if itemType1 in typeList and itemType2 in typeList:
|
| | | # return cmp(typeList.index(item1.GetType()), typeList.index(item2.GetType()))
|
| | | # elif itemType1 in typeList:
|
| | | # #排在前面
|
| | | # return -1
|
| | | # elif itemType2 in typeList:
|
| | | # return 1
|
| | | # else:
|
| | | # return cmp(itemType1, itemType2)
|
| | | # else:
|
| | | # return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | # else:
|
| | | # return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | | #===========================================================================
|
| | |
|
| | | if item1.GetItemColor() == item2.GetItemColor():
|
| | | if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | # 装备类型-颜色-星数 - ID,内层比较 暂时不做时间判断
|
| | | itemType1 = item1.GetType()
|
| | | itemType2 = item2.GetType()
|
| | | if itemType1 == itemType2:
|
| | | if item1.GetItemColor() == item2.GetItemColor():
|
| | | if item1.GetItemQuality() == item2.GetItemQuality():
|
| | | return cmp(item1.GetItemTypeID(), item2.GetItemTypeID())
|
| | | else:
|
| | | return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | else:
|
| | | return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | | else:
|
| | | #类型有定义配置顺序
|
| | | typeList = IpyGameDataPY.GetFuncEvalCfg("PackageSortPriority", 1)
|
| | |
| | | return 1
|
| | | else:
|
| | | return cmp(itemType1, itemType2)
|
| | | else:
|
| | | return cmp(0-item1.GetItemQuality(), 0-item2.GetItemQuality())
|
| | | else:
|
| | | return cmp(0-item1.GetItemColor(), 0-item2.GetItemColor())
|
| | | |
| | |
|
| | |
|
| | | def __ResetItem_AddItemInList(curList, addItem):
|
| | |
| | | index = 0
|
| | | buffSkillIDList = []
|
| | |
|
| | | passiveEff = PassiveBuffEffMng.GetPassiveEffManager().GetPassiveEff(curPlayer)
|
| | | while index < buffState.GetBuffCount():
|
| | | curBuff = buffState.GetBuff(index)
|
| | | #异常
|
| | |
| | | continue
|
| | |
|
| | | #BuffSkill.DoBuffDisApper(curPlayer, curBuff, tick)
|
| | | buffSkillIDList.append([curBuff.GetSkill().GetSkillID(), curBuff.GetOwnerID(), curBuff.GetOwnerType()])
|
| | | #buffSkillIDList.append([curBuff.GetSkill().GetSkillID(), curBuff.GetOwnerID(), curBuff.GetOwnerType()])
|
| | | buffSkillIDList.append(curBuff.GetSkill().GetSkillID())
|
| | | #GameWorld.DebugLog("死亡清理-----%s"%curBuff.GetSkill().GetSkillID())
|
| | | if passiveEff:
|
| | | passiveEff.DelBuffInfo(curBuff.GetSkill())
|
| | | |
| | | #删除这个buff
|
| | | buffState.DeleteBuffByIndex(index)
|
| | |
|
| | | |
| | | SkillShell.ClearBuffEffectBySkillIDList(curPlayer, buffState, buffSkillIDList)
|
| | | return
|
| | |
|
| | |
| | | import ChConfig
|
| | | import GameWorld
|
| | | import GameObj
|
| | | import PlayerControl
|
| | |
|
| | | import SkillCommon
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | |
|
| | | result = GameWorld.CanHappen(effect.GetEffectValue(0))
|
| | | if result:
|
| | | GameObj.SetHP(attacker, 1) # 为了避免生命为0时,屏蔽过多逻辑
|
| | | # 提前触发CD, 不然外层无法触发技能的话就不进入CD, 如和平模式
|
| | | if curSkill.GetCoolDownTime():
|
| | | SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)
|
| | | return True
|
| | |
|
| | | if effect.GetEffectValue(1):
|
| | | #不死血量1,但不触发技能
|
| | | if GameWorld.CanHappen(effect.GetEffectValue(1)):
|
| | | GameObj.SetHP(attacker, 1)
|
| | | # 提前触发CD, 不然外层无法触发技能的话就不进入CD, 如和平模式
|
| | | if curSkill.GetCoolDownTime():
|
| | | SkillCommon.SetSkillRemainTime(curSkill, 0, GameWorld.GetGameWorld().GetTick(), attacker)
|
| | | return False
|
| | |
|
| | | return False
|
| | |
| | | buffState.DeleteEffectByIndex(i)
|
| | |
|
| | |
|
| | | # 通过技能ID列表删除buff对应的效果ID
|
| | | # 通过技能ID列表删除buff对应的效果ID, 死亡调用
|
| | | def ClearBuffEffectBySkillIDList(curObj, buffState, skillIDList):
|
| | |
|
| | | effectIndexList = []
|
| | |
| | | if curEffectID == 0:
|
| | | continue
|
| | |
|
| | | # [技能ID, 来源对象ID,对象类型]
|
| | | if [buffState.GetEffectFromSkillID(i), |
| | | buffState.GetEffectOwnerID(i), |
| | | buffState.GetEffectOwnerType(i)] not in skillIDList:
|
| | | #=======================================================================
|
| | | # # [技能ID, 来源对象ID,对象类型]
|
| | | # if [buffState.GetEffectFromSkillID(i), |
| | | # buffState.GetEffectOwnerID(i), |
| | | # buffState.GetEffectOwnerType(i)] not in skillIDList:
|
| | | # continue
|
| | | #=======================================================================
|
| | | # 改成只判断技能ID
|
| | | if buffState.GetEffectFromSkillID(i) not in skillIDList:
|
| | | continue
|
| | | |
| | | effectIndexList.append(i)
|
| | |
|
| | | # 倒序删除
|