体力和负重系统

配置介绍

负重列表

参数名数据类型说明
Keyint字典的键,必选,全局唯一
weightfloat负重,可选,默认0.1
namestr物品名称,可选,默认空字符串
  • 示例
1:{
'weight':20.0,
'name':'罐头'
}

接口

GetPlayerMaxValue

服务端|客户端

  • 描述
    获取玩家最大体力
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的最大体力值,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
maxValue = PhysicalSystem.GetPlayerMaxValue(PlayerId)
print(maxValue)

GetPlayerCurrentMaxValue

服务端|客户端

  • 描述
    获取玩家当前体力上限
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的体力上限,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
currentMaxValue = PhysicalSystem.GetPlayerCurrentMaxValue(PlayerId)
print(currentMaxValue)

GetPlayerRunDeplete

服务端|客户端

  • 描述
    获取玩家奔跑时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家奔跑时消耗的体力值,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
runDeplete = PhysicalSystem.GetPlayerRunDeplete(PlayerId)
print(runDeplete)

GetPlayerRunRecover

服务端|客户端

  • 描述
    获取玩家休息时回复的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家休息时回复的体力值,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
runRecover = PhysicalSystem.GetPlayerRunRecover(PlayerId)
print(runRecover)

GetPlayerJumpDelete

服务端|客户端

  • 描述
    获取玩家跳跃时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家跳跃时消耗的体力值,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
jumpDelete = PhysicalSystem.GetPlayerJumpDelete(PlayerId)
print(jumpDelete)

GetPlayerWeightRotio

服务端|客户端

  • 描述
    获取玩家负重所影响的比例
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的负重所影响的比例,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightRotio = PhysicalSystem.GetPlayerWeightRotio(PlayerId)
print(weightRotio)

GetPlayerWeightRotioRate

服务端|客户端

  • 描述
    获取玩家负重所影响的比例,小数形式
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的负重所影响的比例,不存在则返回0.0 (float)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightRotioRate = PhysicalSystem.GetPlayerWeightRotioRate(PlayerId)
print(weightRotioRate)

GetPlayerWeights

服务端|客户端

  • 描述
    获取玩家当前的负重
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的当前负重,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weights = PhysicalSystem.GetPlayerWeights(PlayerId)
print(weights)

GetPlayerCurrentValue

服务端|客户端

  • 描述
    获取玩家当前的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    该玩家的当前体力值,不存在则返回0 (int)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
currentValue = PhysicalSystem.GetPlayerCurrentValue(PlayerId)
print(currentValue)

SetPlayerCurrentValue

服务端

  • 描述
    设置玩家当前的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的当前体力值
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerCurrentValue(PlayerId, 100)

AddPlayerCurrentValue

服务端

  • 描述
    增加玩家当前的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的当前体力值
  • 返回值
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerCurrentValue(PlayerId, 50)

SetPlayerCurrentMaxValue

服务端

  • 描述
    设置玩家当前的体力上限
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的当前体力上限
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerCurrentMaxValue(PlayerId, 200)

AddPlayerCurrentMaxValue

服务端

  • 描述
    增加玩家当前的体力上限
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的当前体力上限
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerCurrentMaxValue(PlayerId, 50)

SetPlayerMaxValue

服务端

  • 描述
    设置玩家最大的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的最大体力值
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerMaxValue(PlayerId, 300)

AddPlayerMaxValue

服务端

  • 描述
    增加玩家最大的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的最大体力值
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerMaxValue(PlayerId, 50)

SetPlayerRunDeplete

服务端

  • 描述
    设置玩家奔跑时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的奔跑时消耗的体力值
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerRunDeplete(PlayerId, 5)

AddPlayerRunDeplete

服务端

  • 描述
    增加玩家奔跑时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的奔跑时消耗的体力值
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerRunDeplete(PlayerId, 2)

SetPlayerRunRecover

服务端

  • 描述
    设置玩家休息时回复的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的休息时回复的体力值
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerRunRecover(PlayerId, 3)

AddPlayerRunRecover

服务端

  • 描述
    增加玩家休息时回复的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的休息时回复的体力值
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerRunRecover(PlayerId, 1)

SetPlayerJumpDelete

服务端

  • 描述
    设置玩家跳跃时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的跳跃时消耗的体力值
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerJumpDelete(PlayerId, 10)

AddPlayerJumpDelete

服务端

  • 描述
    增加玩家跳跃时消耗的体力值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的跳跃时消耗的体力值
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerJumpDelete(PlayerId, 2)

SetPlayerWeightRotio

服务端

  • 描述
    设置玩家负重所影响的比例
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的负重所影响的比例
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerWeightRotio(PlayerId, 50)

AddPlayerWeightRotio

服务端

  • 描述
    增加玩家负重所影响的比例
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valueint玩家的负重所影响的比例
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerWeightRotio(PlayerId, 10)

AddPlayerWeightList

服务端

  • 描述
    增加玩家的负重列表,当物品Id已经存在时,会增加该物品的重量
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
WeightIdint物品Id
Weightint物品的重量
Namestr物品的名称
  • 返回值
    是否增加成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerWeightList(PlayerId, 1001, 5, "Iron Sword")

SetPlayerWeightList

服务端

  • 描述
    设置玩家的负重列表,当物品Id已经存在时,会覆盖该物品的重量
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
WeightIdint物品Id
Weightint物品的重量
Namestr物品的名称
  • 返回值
    是否设置成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerWeightList(PlayerId, 1001, 8, "Golden Sword")

DelPlayerWeightList

服务端

  • 描述
    删除玩家的负重列表
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
WeightIdint物品Id
  • 返回值
    是否删除成功
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.DelPlayerWeightList(PlayerId, 1001)

GetPlayerWeightList

服务端|客户端

  • 描述
    获取玩家的负重列表
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    玩家的负重列表,不存在则返回{} (dict)
  • 备注
  • 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightList = PhysicalSystem.GetPlayerWeightList(PlayerId)
print(weightList)

GetPlayerWeights

服务端|客户端

  • 描述
    获取玩家的负重
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    玩家的负重,不存在则返回0.0
  • 备注
  • 示例

SetPlayerWeights

服务端

  • 描述
    设置玩家的负重
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valuefloat玩家的负重
  • 返回值
  • 备注
  • 示例

AddPlayerWeights

服务端

  • 描述
    增加玩家的负重
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valuefloat玩家的负重
  • 返回值
  • 备注
  • 示例

GetPlayerWeightMaxValue

服务端|客户端

  • 描述
    获取玩家的负重最大值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    玩家的负重最大值,不存在则返回0.0
  • 备注
  • 示例

SetPlayerWeightMaxValue

服务端

  • 描述
    设置玩家的负重最大值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valuefloat玩家的负重最大值
  • 返回值
  • 备注
  • 示例

AddPlayerWeightMaxValue

服务端

  • 描述
    增加玩家的负重最大值
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valuefloat玩家的负重最大值
  • 返回值
  • 备注
  • 示例

AddPlayerWeightMaxCount

服务端

  • 描述
    增加玩家的负重最大数量
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
Valuefloat玩家的负重最大值
  • 返回值
  • 备注
  • 示例

GetPlayerWeightMaxCount

服务端|客户端

  • 描述
    获取玩家的负重最大数量
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    玩家的负重最大数量,不存在则返回0
  • 备注
  • 示例

GetPlayerWeightRatio

服务端|客户端

  • 描述
    获取玩家的负重比例
  • 参数
参数名数据类型说明
PlayerIdstr玩家Id
  • 返回值
    玩家的负重比例,不存在则返回0
  • 备注
  • 示例
评论交流

文档目录

绝地惊变二创文档