mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 23:11:54 +08:00
b4bb95cc72
实现音元护盾武器系统,包含以下内容: - 新增护盾武器资源及脚本 - 添加护盾召唤物逻辑 - 实现护盾AI跟随主人功能 - 更新公鸡角色默认武器为护盾
14 lines
423 B
GDScript
14 lines
423 B
GDScript
@tool
|
|
extends Weapon
|
|
class_name ShieldWeapon
|
|
|
|
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|
origin["atk"] += 2 * to * soulLevel
|
|
return origin
|
|
func attack(entity: EntityBase):
|
|
var summon = entity.summon(ComponentManager.getSummon("Shield"))
|
|
if !summon: return true
|
|
summon.fields[FieldStore.Entity.MAX_HEALTH] = readStore("atk")
|
|
summon.health = summon.fields[FieldStore.Entity.MAX_HEALTH]
|
|
return true
|