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/Weapons/Shield.gd
T
fallingshrimp b4bb95cc72 feat: 添加音元护盾武器和召唤物功能
实现音元护盾武器系统,包含以下内容:
- 新增护盾武器资源及脚本
- 添加护盾召唤物逻辑
- 实现护盾AI跟随主人功能
- 更新公鸡角色默认武器为护盾
2025-12-08 22:23:53 +08:00

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