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/DaoStatue.gd
T
fallingshrimp 04727c0feb feat(武器): 调整道教石像属性和机制
修改道教石像的攻击属性计算方式,移除rate3属性并调整rate2的计算公式
更新武器描述文本以匹配新的机制
将道教石像添加到猞猁角色的武器库中
2026-05-08 16:04:41 +08:00

33 lines
1.2 KiB
GDScript

@tool
extends Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 4 * to * soulLevel
origin["rate1"] *= soulLevel
origin["rate2"] += 0.06 * (soulLevel - 1)
return origin
func checkAttack(entity: EntityBase) -> bool:
return len(entity.getOrCreateCycleTimer("parry", 2000, 100).bullets) > 0
func attack(entity: EntityBase):
var parryCounter = entity.getOrCreateCycleTimer("parry", 2000, 100)
for bullet in BulletBase.generate(
ComponentManager.getBullet("Wuwei"),
entity,
entity.position,
entity.position.angle_to_point(get_global_mouse_position())
):
if bullet is WuweiBullet:
bullet.baseDamage = readStore("atk")
bullet.baseDamage *= max(-0.99, readStore("rate2") * ((1.0 - entity.fields[FieldStore.Entity.ATTACK_SPEED]) * 100)) + 1
bullet.baseDamage *= max(-0.99, readStore("rate1") * (entity.fields[FieldStore.Entity.MAX_HEALTH] - entity.health)) + 1
var atkAll = 0
for bulle in parryCounter.bullets:
if bulle is ParryBallBullet:
atkAll += bulle.atk
bullet.baseDamage *= max(-0.99, readStore("rate3") * atkAll) + 1
for bulle in parryCounter.bullets:
if bulle is ParryBallBullet:
bulle.tryDestroy()
parryCounter.forceFilter()
return true