mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
fix: 限制实体字段的最大值以防止数值溢出
在FieldStore.gd中添加entityMaxValueMap定义各字段的最大值 在Feed.gd中应用clamp确保字段值不超过定义的最大值
This commit is contained in:
@@ -69,6 +69,14 @@ static var entityMapType = {
|
||||
Entity.MAX_ENERGY: DataType.VALUE,
|
||||
Entity.LUCK_VALUE: DataType.VALUE
|
||||
}
|
||||
static var entityMaxValueMap = {
|
||||
Entity.CRIT_RATE: 1,
|
||||
Entity.PENERATE: 1,
|
||||
Entity.PENARATION_RESISTANCE: 1,
|
||||
Entity.PRICE_REDUCTION: 0.8,
|
||||
Entity.DROP_APPLE_RATE: 0.5,
|
||||
Entity.FEED_COUNT_SHOW: 6
|
||||
}
|
||||
static var entityApplier = {
|
||||
Entity.MAX_HEALTH: func(entity, value):
|
||||
entity.health += value
|
||||
|
||||
Reference in New Issue
Block a user