mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-30 16:01:53 +08:00
8fcc742c77
添加新的武器蘑菇矿挖爪,包括武器脚本、子弹脚本和场景文件。修改BulletBase.gd以支持新武器的功能,并在Rooster角色中添加该武器。同时设置rooster节点为初始不可见状态。 - 新增MushroomPickaxe武器,具有概率掉落物品的特性 - 修改BulletBase的succeedToHit方法以支持实体参数 - 在Rooster场景中添加新武器 - 设置rooster节点的currentInvinsible属性为true
17 lines
606 B
GDScript
17 lines
606 B
GDScript
@tool
|
|
extends Weapon
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|
origin["atk"] += 0.5 * to
|
|
origin["rate"] += 0.02 * to
|
|
origin["count"] += 1 * level
|
|
return origin
|
|
func attack(entity: EntityBase):
|
|
var weaponPos = entity.findWeaponAnchor("normal")
|
|
for j in BulletBase.generate(preload("res://components/Bullets/MushroomPickaxe.tscn"), entity, entity.texture.global_position, weaponPos.angle_to_point(get_global_mouse_position())):
|
|
var bullet: MushroomPickaxe = j
|
|
bullet.damage = readStore("atk")
|
|
bullet.rate = readStore("rate")
|
|
bullet.count = readStore("count")
|
|
return true
|