具体函数名及描述如下:
序号 | 函数名 | 函数描述 |
1 | addBuff(...) | 给对象附加效果 |
2 | removeBuff(...) | 给对象移除指定效果 |
3 | clearAllBuff(...) | 给对象清除所有效果 |
4 | clearAllBadBuff(...) | 为对象清除所有负面效果 |
5 | hasBuff(...) | 判断对象身上是否有指定效果 |
6 | getBuffList(...) | 获取对象身上效果列表 |
7 | getBuffNumByBuffid(...) | 获取对象身上指定效果数量 |
8 | getBuffIndex(...) |
获取对象身上指定效果的索引位置(索引从1开始) |
9 | getBuffLeftTime(...) |
获取对象身上指定效果剩余时间 |
10 | getBuffName(...) |
获取对象身上状态效果名称 |
11 | GetBuffDefName(...) |
获取状态效果名称 |
12 | GetBuffDefDesc(...) |
获取状态效果描述 |
local code = Buff:addBuff(objid, buffid, bufflv, customticks)
if code == ErrorCode.OK then
print('执行成功' )
else
print('执行失败')
end
local code = Buff:removeBuff(objid, buffid)
if code == ErrorCode.OK then
print('执行成功' )
else
print('执行失败')
end
local code = Buff:clearAllBuff(objid)
if code == ErrorCode.OK then
print('执行成功' )
else
print('执行失败')
end
local code = Buff:clearAllBadBuff(objid)
if code == ErrorCode.OK then
print('执行成功' )
else
print('执行失败')
end
local code = Buff:hasBuff(objid, buffid, bufflv)
if code == ErrorCode.OK then
print('执行成功' )
else
print('执行失败')
end
local code ,num,arr = Buff:getBuffList(objid)
if code == ErrorCode.OK then
print('执行成功' ,num,arr )
else
print('执行失败')
end
local code ,num = Buff:getBuffNumByBuffid(objid, buffid)
if code == ErrorCode.OK then
print('执行成功' ,num )
else
print('执行失败')
end
local code ,ix = Buff:getBuffIndex(objid, buffid)
if code == ErrorCode.OK then
print('执行成功' ,ix )
else
print('执行失败')
end
local code ,num = Buff:getBuffLeftTime(objid, buffid)
if code == ErrorCode.OK then
print('执行成功' ,num )
else
print('执行失败')
end
local code ,name = Buff:getBuffName(objid, buffid)
if code == ErrorCode.OK then
print('执行成功' ,name )
else
print('执行失败')
end
local code ,name = Buff:GetBuffDefName(buffid)
if code == ErrorCode.OK then
print('执行成功' ,name )
else
print('执行失败')
end
local code ,desc = Buff:GetBuffDefDesc(buffid)
if code == ErrorCode.OK then
print('执行成功' ,desc )
else
print('执行失败')
end