- 精华
- 阅读权限
- 90
- 好友
- 相册
- 分享
- 听众
- 收听
- 注册时间
- 2023-3-4
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|

楼主 |
发表于 2024-8-23 23:35:45
|
显示全部楼层
能详细说一下嘛,我测试的没有问题,仔细看了算法,把三种情况都包括了↓↓↓
local TargetId = LuaFnGetTargetObjID(sceneId,selfId)
local xinfa33 = LuaFnGetXinFaLevel(sceneId,selfId,33)
local mymaxhp = GetMaxHp(sceneId,selfId)
local myhp = GetHp(sceneId,selfId)
local dmg = xinfa33*50
local increasehp = xinfa33*50
if GetHp(sceneId,TargetId) < dmg then
increasehp = GetHp(sceneId,TargetId)
end
if mymaxhp-myhp < dmg then
increasehp = mymaxhp-myhp
dmg = (myhp+dmg-mymaxhp)*2+increasehp
end
LuaFnSetDamage(sceneId,selfId,TargetId,dmg)
IncreaseHp(sceneId,selfId,increasehp) |
|