mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-09 13:17:12 +08:00
feat(掉落物): 将物品拾取半径改为可配置属性
将硬编码的物品拾取半径改为从FieldStore中获取的可配置属性,并增加默认值60。同时调整了EntityBase中的初始物品数量配置。
This commit is contained in:
@@ -23,7 +23,7 @@ func _physics_process(_delta):
|
||||
var direction = (targetPlayer.position - position).normalized()
|
||||
var speed = 5000.0 / ((targetPlayer.position - position).length() ** (1 / 3.0))
|
||||
apply_central_force(direction * speed)
|
||||
if position.distance_to(targetPlayer.position) < 60:
|
||||
if position.distance_to(targetPlayer.position) < targetPlayer.fields.get(FieldStore.Entity.DROPPED_ITEM_COLLECT_RADIUS):
|
||||
targetPlayer.collectItem(item, stackCount)
|
||||
collect()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user