mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器): 为乾坤剑添加弹反机制和伤害比例
增加子弹弹反概率和伤害比例属性 修改武器描述以反映新机制 更新子弹碰撞逻辑实现弹反或格挡
This commit is contained in:
@@ -15,22 +15,24 @@ oneShoot = true
|
|||||||
store = {
|
store = {
|
||||||
"atk": 20,
|
"atk": 20,
|
||||||
"count": 1.0,
|
"count": 1.0,
|
||||||
"max": 3.0
|
"max": 3.0,
|
||||||
|
"rate": 0.25
|
||||||
}
|
}
|
||||||
storeType = {
|
storeType = {
|
||||||
"atk": 1,
|
"atk": 1,
|
||||||
"count": 1,
|
"count": 1,
|
||||||
"max": 1
|
"max": 1,
|
||||||
|
"rate": 2
|
||||||
}
|
}
|
||||||
descriptionTemplate = "进行[b]格挡[/b],化解飞来的子弹。
|
descriptionTemplate = "进行[b]格挡[/b],化解飞来的子弹。
|
||||||
每成功格挡一次,获得一点[b]气力[/b]。
|
每成功格挡一次,获得一点[b]气力[/b]。
|
||||||
每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],一段时间后符咒自动引爆,
|
每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],符咒会自动引爆,召唤[b]乾坤剑[/b]穿透敌人。
|
||||||
召唤[b]乾坤剑[/b]穿透敌人。
|
|
||||||
|
|
||||||
|
每次格挡有$rate的概率弹反,子弹弹反后造成乾坤剑的$rate伤害。
|
||||||
|
每次格挡最多化解$count个子弹,
|
||||||
|
体内最多储存$max点气力。
|
||||||
每化解[color=yellow]1[/color]点伤害,
|
每化解[color=yellow]1[/color]点伤害,
|
||||||
乾坤剑造成的伤害+$atk点。
|
乾坤剑造成的伤害+$atk点。
|
||||||
每次格挡最多化解$count个子弹,
|
|
||||||
体内最多储存$max点气力,
|
|
||||||
格挡时机越精确,成功率越高。"
|
格挡时机越精确,成功率越高。"
|
||||||
cooldown = 250.0
|
cooldown = 250.0
|
||||||
debugRebuild = true
|
debugRebuild = true
|
||||||
@@ -49,11 +51,11 @@ typeTopic = 3
|
|||||||
[node name="description" parent="container" index="2"]
|
[node name="description" parent="container" index="2"]
|
||||||
text = "[center]进行[b]格挡[/b],化解飞来的子弹。
|
text = "[center]进行[b]格挡[/b],化解飞来的子弹。
|
||||||
每成功格挡一次,获得一点[b]气力[/b]。
|
每成功格挡一次,获得一点[b]气力[/b]。
|
||||||
每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],一段时间后符咒自动引爆,
|
每拥有一点气力,增加[color=yellow]1[/color]点冲刺初速度,闪避穿过敌人时对其贴上一层[b]符咒[/b],符咒会自动引爆,召唤[b]乾坤剑[/b]穿透敌人。
|
||||||
召唤[b]乾坤剑[/b]穿透敌人。
|
|
||||||
|
|
||||||
|
每次格挡有[color=cyan]25.0%[/color]的概率弹反,子弹弹反后造成乾坤剑的[color=cyan]25.0%[/color]伤害。
|
||||||
|
每次格挡最多化解[color=cyan]1[/color]个子弹,
|
||||||
|
体内最多储存[color=cyan]3[/color]点气力。
|
||||||
每化解[color=yellow]1[/color]点伤害,
|
每化解[color=yellow]1[/color]点伤害,
|
||||||
乾坤剑造成的伤害+[color=cyan]20[/color]点。
|
乾坤剑造成的伤害+[color=cyan]20[/color]点。
|
||||||
每次格挡最多化解[color=cyan]1[/color]个子弹,
|
|
||||||
体内最多储存[color=cyan]3[/color]点气力,
|
|
||||||
格挡时机越精确,成功率越高。[/center]"
|
格挡时机越精确,成功率越高。[/center]"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ var parryiedTimes: int = 0
|
|||||||
var maxParryTimes: int = 1
|
var maxParryTimes: int = 1
|
||||||
var maxBallCount: int = 3
|
var maxBallCount: int = 3
|
||||||
var atk: float = 0
|
var atk: float = 0
|
||||||
|
var reflectRate: float = 0.25
|
||||||
|
|
||||||
func spawn():
|
func spawn():
|
||||||
var varians = randi_range(0, 2)
|
var varians = randi_range(0, 2)
|
||||||
@@ -30,10 +31,15 @@ func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
|
|||||||
eff.shot()
|
eff.shot()
|
||||||
CameraManager.shake(250, 300)
|
CameraManager.shake(250, 300)
|
||||||
launcher.impluse((position - bullet.position).normalized() * (bullet.speed * bullet.getDamage()) ** (1.0 / 3) * 250)
|
launcher.impluse((position - bullet.position).normalized() * (bullet.speed * bullet.getDamage()) ** (1.0 / 3) * 250)
|
||||||
# 弹反
|
# 弹反 还是 格挡?
|
||||||
bullet.look_at(bullet.launcher.position)
|
if MathTool.rate(reflectRate):
|
||||||
bullet.launcher = launcher
|
bullet.look_at(bullet.launcher.position)
|
||||||
bullet.baseDamage *= atk
|
bullet.launcher = launcher
|
||||||
|
bullet.baseDamage *= atk
|
||||||
|
bullet.baseDamage *= reflectRate
|
||||||
|
bullet.lifeTime *= 2
|
||||||
|
else:
|
||||||
|
bullet.tryDestroy()
|
||||||
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
|
var cycler = launcher.getOrCreateCycleTimer("parry", 2000, 100)
|
||||||
if len(cycler.bullets) < maxBallCount: # 玩家最多只能拥有多少气
|
if len(cycler.bullets) < maxBallCount: # 玩家最多只能拥有多少气
|
||||||
for b in BulletBase.generate(
|
for b in BulletBase.generate(
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ static var WAVE_JUSTJOKE = [
|
|||||||
Wave.create("Kernyr", 0, 0, true, 0, INF, 1),
|
Wave.create("Kernyr", 0, 0, true, 0, INF, 1),
|
||||||
]
|
]
|
||||||
static var WAVE_EMPTY = []
|
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(
|
static func create(
|
||||||
entity_: String,
|
entity_: String,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ func update(to: int, origin: Dictionary, _entity: EntityBase):
|
|||||||
origin["atk"] += 5 * to * soulLevel
|
origin["atk"] += 5 * to * soulLevel
|
||||||
origin["count"] += 1 * (soulLevel - 1)
|
origin["count"] += 1 * (soulLevel - 1)
|
||||||
origin["max"] += 2 * (soulLevel - 1)
|
origin["max"] += 2 * (soulLevel - 1)
|
||||||
|
origin["rate"] += 0.15 * (soulLevel - 1)
|
||||||
return origin
|
return origin
|
||||||
func attack(entity: EntityBase):
|
func attack(entity: EntityBase):
|
||||||
for bullet in BulletBase.generate(
|
for bullet in BulletBase.generate(
|
||||||
@@ -17,4 +18,5 @@ func attack(entity: EntityBase):
|
|||||||
bullet.atk = readStore("atk")
|
bullet.atk = readStore("atk")
|
||||||
bullet.maxParryTimes = readStore("count")
|
bullet.maxParryTimes = readStore("count")
|
||||||
bullet.maxBallCount = readStore("max")
|
bullet.maxBallCount = readStore("max")
|
||||||
|
bullet.reflectRate = readStore("rate")
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user