配置介绍
负重列表
| 参数名 | 数据类型 | 说明 |
| Key | int | 字典的键,必选,全局唯一 |
| weight | float | 负重,可选,默认0.1 |
| name | str | 物品名称,可选,默认空字符串 |
1:{
'weight':20.0,
'name':'罐头'
}
接口
GetPlayerMaxValue
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的最大体力值,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
maxValue = PhysicalSystem.GetPlayerMaxValue(PlayerId)
print(maxValue)
GetPlayerCurrentMaxValue
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的体力上限,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
currentMaxValue = PhysicalSystem.GetPlayerCurrentMaxValue(PlayerId)
print(currentMaxValue)
GetPlayerRunDeplete
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家奔跑时消耗的体力值,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
runDeplete = PhysicalSystem.GetPlayerRunDeplete(PlayerId)
print(runDeplete)
GetPlayerRunRecover
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家休息时回复的体力值,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
runRecover = PhysicalSystem.GetPlayerRunRecover(PlayerId)
print(runRecover)
GetPlayerJumpDelete
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家跳跃时消耗的体力值,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
jumpDelete = PhysicalSystem.GetPlayerJumpDelete(PlayerId)
print(jumpDelete)
GetPlayerWeightRotio
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的负重所影响的比例,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightRotio = PhysicalSystem.GetPlayerWeightRotio(PlayerId)
print(weightRotio)
GetPlayerWeightRotioRate
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的负重所影响的比例,不存在则返回0.0 (float)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightRotioRate = PhysicalSystem.GetPlayerWeightRotioRate(PlayerId)
print(weightRotioRate)
GetPlayerWeights
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的当前负重,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weights = PhysicalSystem.GetPlayerWeights(PlayerId)
print(weights)
GetPlayerCurrentValue
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
该玩家的当前体力值,不存在则返回0 (int)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
currentValue = PhysicalSystem.GetPlayerCurrentValue(PlayerId)
print(currentValue)
SetPlayerCurrentValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的当前体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerCurrentValue(PlayerId, 100)
AddPlayerCurrentValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的当前体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerCurrentValue(PlayerId, 50)
SetPlayerCurrentMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的当前体力上限 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerCurrentMaxValue(PlayerId, 200)
AddPlayerCurrentMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的当前体力上限 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerCurrentMaxValue(PlayerId, 50)
SetPlayerMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的最大体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerMaxValue(PlayerId, 300)
AddPlayerMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的最大体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerMaxValue(PlayerId, 50)
SetPlayerRunDeplete
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的奔跑时消耗的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerRunDeplete(PlayerId, 5)
AddPlayerRunDeplete
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的奔跑时消耗的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerRunDeplete(PlayerId, 2)
SetPlayerRunRecover
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的休息时回复的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerRunRecover(PlayerId, 3)
AddPlayerRunRecover
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的休息时回复的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerRunRecover(PlayerId, 1)
SetPlayerJumpDelete
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的跳跃时消耗的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerJumpDelete(PlayerId, 10)
AddPlayerJumpDelete
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的跳跃时消耗的体力值 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerJumpDelete(PlayerId, 2)
SetPlayerWeightRotio
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的负重所影响的比例 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerWeightRotio(PlayerId, 50)
AddPlayerWeightRotio
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | int | 玩家的负重所影响的比例 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerWeightRotio(PlayerId, 10)
AddPlayerWeightList
服务端
- 描述
增加玩家的负重列表,当物品Id已经存在时,会增加该物品的重量
- 参数
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| WeightId | int | 物品Id |
| Weight | int | 物品的重量 |
| Name | str | 物品的名称 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.AddPlayerWeightList(PlayerId, 1001, 5, "Iron Sword")
SetPlayerWeightList
服务端
- 描述
设置玩家的负重列表,当物品Id已经存在时,会覆盖该物品的重量
- 参数
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| WeightId | int | 物品Id |
| Weight | int | 物品的重量 |
| Name | str | 物品的名称 |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.SetPlayerWeightList(PlayerId, 1001, 8, "Golden Sword")
DelPlayerWeightList
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| WeightId | int | 物品Id |
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
PhysicalSystem.DelPlayerWeightList(PlayerId, 1001)
GetPlayerWeightList
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
玩家的负重列表,不存在则返回{} (dict)
- 备注
无
- 示例
PhysicalSystem = serverApi.GetSystem('Physical', 'PhysicalSystem')
weightList = PhysicalSystem.GetPlayerWeightList(PlayerId)
print(weightList)
GetPlayerWeights
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
玩家的负重,不存在则返回0.0
- 备注
无
- 示例
SetPlayerWeights
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | float | 玩家的负重 |
AddPlayerWeights
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | float | 玩家的负重 |
GetPlayerWeightMaxValue
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
玩家的负重最大值,不存在则返回0.0
- 备注
无
- 示例
SetPlayerWeightMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | float | 玩家的负重最大值 |
AddPlayerWeightMaxValue
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | float | 玩家的负重最大值 |
AddPlayerWeightMaxCount
服务端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
| Value | float | 玩家的负重最大值 |
GetPlayerWeightMaxCount
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
玩家的负重最大数量,不存在则返回0
- 备注
无
- 示例
GetPlayerWeightRatio
服务端|客户端
| 参数名 | 数据类型 | 说明 |
| PlayerId | str | 玩家Id |
- 返回值
玩家的负重比例,不存在则返回0
- 备注
无
- 示例