mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(游戏机制): 添加幸运值对掉落率、暴击率和穿透率的影响
在GameRule中新增幸运值影响系数,并修改相关计算逻辑: - 幸运值现在会影响苹果掉落率、暴击率和穿透率 - 更新了EntityBase和BulletBase中的相关计算逻辑 - 添加了GameRule中的相关配置参数
This commit is contained in:
@@ -198,7 +198,11 @@ func tryDie(by: BulletBase):
|
||||
var count = ceil(randf_range(dropCounts[drop].x, dropCounts[drop].y))
|
||||
for i in range(count):
|
||||
ItemDropped.generate(item, count, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
|
||||
if MathTool.rate(GameRule.appleDropRate + by.launcher.fields.get(FieldStore.Entity.DROP_APPLE_RATE)) or isBoss:
|
||||
if MathTool.rate(
|
||||
GameRule.appleDropRate +
|
||||
by.launcher.fields.get(FieldStore.Entity.DROP_APPLE_RATE) +
|
||||
GameRule.appleDropRateInfluenceByLuckValue * by.launcher.fields[FieldStore.Entity.LUCK_VALUE]
|
||||
) or isBoss:
|
||||
for i in randi_range(appleCount.x, appleCount.y):
|
||||
ItemDropped.generate(ItemStore.ItemType.APPLE, 1, position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset))
|
||||
await die()
|
||||
|
||||
Reference in New Issue
Block a user