mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-05 19:27:15 +08:00
feat(武器): 为乾坤剑添加弹反机制和伤害比例
增加子弹弹反概率和伤害比例属性 修改武器描述以反映新机制 更新子弹碰撞逻辑实现弹反或格挡
This commit is contained in:
@@ -7,6 +7,7 @@ var parryiedTimes: int = 0
|
||||
var maxParryTimes: int = 1
|
||||
var maxBallCount: int = 3
|
||||
var atk: float = 0
|
||||
var reflectRate: float = 0.25
|
||||
|
||||
func spawn():
|
||||
var varians = randi_range(0, 2)
|
||||
@@ -30,10 +31,15 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
|
||||
eff.shot()
|
||||
CameraManager.shake(250, 300)
|
||||
launcher.impluse((position - bullet.position).normalized() * (bullet.speed * bullet.getDamage()) ** (1.0 / 3) * 250)
|
||||
# 弹反
|
||||
bullet.look_at(bullet.launcher.position)
|
||||
bullet.launcher = launcher
|
||||
bullet.baseDamage *= atk
|
||||
# 弹反 还是 格挡?
|
||||
if MathTool.rate(reflectRate):
|
||||
bullet.look_at(bullet.launcher.position)
|
||||
bullet.launcher = launcher
|
||||
bullet.baseDamage *= atk
|
||||
bullet.baseDamage *= reflectRate
|
||||
bullet.lifeTime *= 2
|
||||
else:
|
||||
bullet.tryDestroy()
|
||||
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
|
||||
if len(cycler.bullets) < maxBallCount: # 玩家最多只能拥有多少气
|
||||
for b in BulletBase.generate(
|
||||
|
||||
@@ -50,7 +50,7 @@ static var WAVE_JUSTJOKE = [
|
||||
Wave.create("Kernyr", 0, 0, true, 0, INF, 1),
|
||||
]
|
||||
static var WAVE_EMPTY = []
|
||||
static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_JUSTJOKE
|
||||
static var data = WAVE_NORMAL if WorldManager.isRelease() else WAVE_TESTBOSS_KUKE
|
||||
|
||||
static func create(
|
||||
entity_: String,
|
||||
|
||||
@@ -5,6 +5,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 5 * to * soulLevel
|
||||
origin["count"] += 1 * (soulLevel - 1)
|
||||
origin["max"] += 2 * (soulLevel - 1)
|
||||
origin["rate"] += 0.15 * (soulLevel - 1)
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
for bullet in BulletBase.generate(
|
||||
@@ -17,4 +18,5 @@ func attack(entity: EntityBase):
|
||||
bullet.atk = readStore("atk")
|
||||
bullet.maxParryTimes = readStore("count")
|
||||
bullet.maxBallCount = readStore("max")
|
||||
bullet.reflectRate = readStore("rate")
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user