mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 23:11:54 +08:00
2232c9148a
将 randv2_range 重命名为 randomVector2In,randc_from 重命名为 randomChoiceFrom,randc_from_weights 重命名为 randChoiceWeightsFrom,并新增 randomRingPoint 方法
15 lines
441 B
GDScript
15 lines
441 B
GDScript
extends BulletBase
|
|
class_name MushroomPickaxe
|
|
|
|
var count: int = 2
|
|
var rate: float = 0.1
|
|
|
|
func succeedToHit(_dmg, entity):
|
|
if MathTool.rate(rate):
|
|
for i in randi_range(1, count):
|
|
ItemDropped.generate(
|
|
MathTool.randomChoiceFrom([ItemStore.ItemType.BASEBALL, ItemStore.ItemType.BASKETBALL, ItemStore.ItemType.BEACHBALL]),
|
|
randi_range(1, count),
|
|
entity.position + MathTool.randomVector2In(GameRule.itemDroppedSpawnOffset)
|
|
)
|