1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/MushroomPickaxe.gd
T

15 lines
432 B
GDScript
Raw Normal View History

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.randc_from([ItemStore.ItemType.BASEBALL, ItemStore.ItemType.BASKETBALL, ItemStore.ItemType.BEACHBALL]),
randi_range(1, count),
entity.position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset)
)