mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-24 20:42:30 +08:00
feat(SevenSoul): 增强七魂武器功能并修复子弹伤害逻辑
为七魂武器添加攻击力属性并调整伤害和治疗机制 修复子弹工具中空引用检查缺失的问题 移除子弹基类中冗余的空检查逻辑 更新武器描述以反映新功能 调整子弹粒子效果和伤害计算方式
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=10 format=3 uid="uid://bymprh2qel2oj"]
|
[gd_scene load_steps=10 format=3 uid="uid://bymprh2qel2oj"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_c4fl5"]
|
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_c4fl5"]
|
||||||
[ext_resource type="Script" path="res://scripts/Contents/Bullets/SevenSoul.gd" id="2_egs34"]
|
[ext_resource type="Script" uid="uid://tkgkjb7v65j8" path="res://scripts/Contents/Bullets/SevenSoul.gd" id="2_egs34"]
|
||||||
[ext_resource type="Texture2D" uid="uid://wy10fc3bqppg" path="res://resources/bullets/seven-soul/soul.png" id="2_itucu"]
|
[ext_resource type="Texture2D" uid="uid://wy10fc3bqppg" path="res://resources/bullets/seven-soul/soul.png" id="2_itucu"]
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_0y25k"]
|
[sub_resource type="Curve" id="Curve_0y25k"]
|
||||||
@@ -12,7 +12,7 @@ point_count = 3
|
|||||||
curve = SubResource("Curve_0y25k")
|
curve = SubResource("Curve_0y25k")
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_acuqr"]
|
[sub_resource type="Curve" id="Curve_acuqr"]
|
||||||
max_value = 4.0
|
_limits = [0.0, 4.0, 0.0, 1.0]
|
||||||
_data = [Vector2(0, 1), 0.0, 3.0, 0, 1, Vector2(1, 4), 0.0, 0.0, 0, 0]
|
_data = [Vector2(0, 1), 0.0, 3.0, 0, 1, Vector2(1, 4), 0.0, 0.0, 0, 0]
|
||||||
point_count = 2
|
point_count = 2
|
||||||
|
|
||||||
@@ -32,8 +32,7 @@ size = Vector2(30, 100)
|
|||||||
|
|
||||||
[node name="SevenSoul" instance=ExtResource("1_c4fl5")]
|
[node name="SevenSoul" instance=ExtResource("1_c4fl5")]
|
||||||
script = ExtResource("2_egs34")
|
script = ExtResource("2_egs34")
|
||||||
speed = 0.0
|
baseDamage = 2.0
|
||||||
damage = 0.0
|
|
||||||
penerate = 1.0
|
penerate = 1.0
|
||||||
lifeTime = 112000.0
|
lifeTime = 112000.0
|
||||||
|
|
||||||
@@ -48,11 +47,11 @@ unique_name_in_owner = true
|
|||||||
position = Vector2(100, 0)
|
position = Vector2(100, 0)
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 1
|
amount = 1
|
||||||
process_material = SubResource("ParticleProcessMaterial_4d30u")
|
|
||||||
texture = ExtResource("2_itucu")
|
texture = ExtResource("2_itucu")
|
||||||
lifetime = 0.5
|
lifetime = 0.5
|
||||||
one_shot = true
|
one_shot = true
|
||||||
local_coords = true
|
local_coords = true
|
||||||
|
process_material = SubResource("ParticleProcessMaterial_4d30u")
|
||||||
|
|
||||||
[node name="hitbox" parent="." index="1"]
|
[node name="hitbox" parent="." index="1"]
|
||||||
position = Vector2(100, 0)
|
position = Vector2(100, 0)
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ metadata/_edit_vertical_guides_ = [71.0]
|
|||||||
process_mode = 4
|
process_mode = 4
|
||||||
|
|
||||||
[node name="SevenSoul" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
[node name="SevenSoul" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
||||||
|
cooldown = 2000.0
|
||||||
|
debugRebuild = false
|
||||||
|
|
||||||
[node name="sprint" parent="sounds" index="0"]
|
[node name="sprint" parent="sounds" index="0"]
|
||||||
stream = ExtResource("4_66s6c")
|
stream = ExtResource("4_66s6c")
|
||||||
|
|||||||
@@ -12,14 +12,16 @@ displayName = "bilioicik"
|
|||||||
quality = 2
|
quality = 2
|
||||||
typeTopic = 3
|
typeTopic = 3
|
||||||
store = {
|
store = {
|
||||||
|
"atk": 2.0,
|
||||||
"dmg": 0.1,
|
"dmg": 0.1,
|
||||||
"heal": 1.0
|
"heal": 1.0
|
||||||
}
|
}
|
||||||
storeType = {
|
storeType = {
|
||||||
|
"atk": 1,
|
||||||
"dmg": 2,
|
"dmg": 2,
|
||||||
"heal": 1
|
"heal": 1
|
||||||
}
|
}
|
||||||
descriptionTemplate = "召唤7条人类灵魂,敌人子弹命中灵魂时将伤害的$dmg转换为能量并提供$heal点治疗。"
|
descriptionTemplate = "召唤7条灵魂,每条造成$atk点伤害,命中敌人时将伤害的$dmg转换为能量并提供$heal点治疗。"
|
||||||
needEnergy = 150.0
|
needEnergy = 150.0
|
||||||
cooldown = 180000.0
|
cooldown = 180000.0
|
||||||
debugRebuild = true
|
debugRebuild = true
|
||||||
@@ -46,4 +48,4 @@ quality = 2
|
|||||||
typeTopic = 3
|
typeTopic = 3
|
||||||
|
|
||||||
[node name="description" parent="container" index="2"]
|
[node name="description" parent="container" index="2"]
|
||||||
text = "[center]召唤7条人类灵魂,敌人子弹命中灵魂时将伤害的[color=cyan]10%[/color]转换为能量并提供[color=cyan]1[/color]点治疗。[/center]"
|
text = "[center]召唤7条灵魂,每条造成[color=cyan]2[/color]点伤害,命中敌人时将伤害的[color=cyan]10%[/color]转换为能量并提供[color=cyan]1[/color]点治疗。[/center]"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
extends BulletBase
|
extends BulletBase
|
||||||
|
class_name SevenSoulBullet
|
||||||
|
|
||||||
var colors = [
|
var colors = [
|
||||||
"#2BEAFF",
|
"#2BEAFF",
|
||||||
@@ -11,27 +12,19 @@ var colors = [
|
|||||||
var index = 0
|
var index = 0
|
||||||
var generationDuration: float = 15000
|
var generationDuration: float = 15000
|
||||||
var pingAfterGeneration: float = 5000
|
var pingAfterGeneration: float = 5000
|
||||||
|
var energyCollect: float = 0
|
||||||
|
var healAmount: float = 0
|
||||||
|
|
||||||
@onready var heart = $"%heart"
|
@onready var heart = $"%heart"
|
||||||
@onready var effect: GPUParticles2D = $"%effect"
|
@onready var effect: GPUParticles2D = $"%effect"
|
||||||
|
|
||||||
func register():
|
|
||||||
area_entered.connect(
|
|
||||||
func(area):
|
|
||||||
var bullet = BulletTool.fromArea(area)
|
|
||||||
if bullet and BulletTool.canDamage(bullet, launcher):
|
|
||||||
launcher.storeEnergy(baseDamage * 2)
|
|
||||||
)
|
|
||||||
func spawn():
|
func spawn():
|
||||||
modulate = Color(colors[index % colors.size()])
|
modulate = Color(colors[index % colors.size()])
|
||||||
effect.emitting = true
|
effect.emitting = true
|
||||||
|
|
||||||
func ai():
|
func ai():
|
||||||
rotation_degrees = 360.0 / colors.size() * index + timeLived() / generationDuration * 360 - index / 6.0 * 360.0
|
rotation_degrees = 360.0 / colors.size() * index + timeLived() / generationDuration * 360 - index / 6.0 * 360.0
|
||||||
heart.global_rotation_degrees = 0
|
heart.global_rotation_degrees = 0
|
||||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||||
func applyDot():
|
func succeedToHit(_dmg: float, _entity: EntityBase):
|
||||||
if timeLived() > generationDuration * ((6.0 - index) / 6.0) + pingAfterGeneration:
|
launcher.storeEnergy(getDamage() * energyCollect)
|
||||||
BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position()))
|
launcher.tryHeal(healAmount)
|
||||||
await TickTool.millseconds(100)
|
|
||||||
return true
|
|
||||||
|
|||||||
@@ -4,9 +4,15 @@ extends Weapon
|
|||||||
func attack(entity: EntityBase):
|
func attack(entity: EntityBase):
|
||||||
playSound("attack")
|
playSound("attack")
|
||||||
for i in 6:
|
for i in 6:
|
||||||
for j in BulletBase.generate(ComponentManager.getBullet("SevenSoul"), entity, entity.texture.global_position, 0):
|
for bullet in BulletBase.generate(ComponentManager.getBullet("SevenSoul"), entity, entity.texture.global_position, 0):
|
||||||
j.index = i
|
if bullet is SevenSoulBullet:
|
||||||
|
bullet.index = i
|
||||||
|
bullet.baseDamage = readStore("atk")
|
||||||
|
bullet.energyCollect = readStore("dmg")
|
||||||
|
bullet.healAmount = readStore("heal")
|
||||||
await TickTool.millseconds(15000 / 6.0)
|
await TickTool.millseconds(15000 / 6.0)
|
||||||
func update(to, origin, _entity):
|
func update(to, origin, _entity):
|
||||||
origin["atk"] += 1 * to * soulLevel
|
origin["atk"] += 1 * to * soulLevel
|
||||||
|
origin["dmg"] += 0.02 * to * soulLevel
|
||||||
|
origin["heal"] += 0.1 * to * soulLevel
|
||||||
return origin
|
return origin
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ func getDamage():
|
|||||||
return baseDamage * damageMultipliers[usingDamageMultiplier]
|
return baseDamage * damageMultipliers[usingDamageMultiplier]
|
||||||
func hit(target: Node):
|
func hit(target: Node):
|
||||||
var entity: EntityBase = EntityTool.fromHurtbox(target)
|
var entity: EntityBase = EntityTool.fromHurtbox(target)
|
||||||
if !entity || !launcher: return
|
|
||||||
if !BulletTool.canDamage(self, entity): return
|
if !BulletTool.canDamage(self, entity): return
|
||||||
var resultDamage = entity.bulletHit(self, MathTool.rate(launcher.fields.get(FieldStore.Entity.CRIT_RATE) + GameRule.critRateInfluenceByLuckValue * launcher.fields[FieldStore.Entity.LUCK_VALUE]))
|
var resultDamage = entity.bulletHit(self, MathTool.rate(launcher.fields.get(FieldStore.Entity.CRIT_RATE) + GameRule.critRateInfluenceByLuckValue * launcher.fields[FieldStore.Entity.LUCK_VALUE]))
|
||||||
succeedToHit(resultDamage, entity)
|
succeedToHit(resultDamage, entity)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ static func fromArea(area: Area2D) -> BulletBase:
|
|||||||
else:
|
else:
|
||||||
return null
|
return null
|
||||||
static func canDamage(bullet: BulletBase, target: EntityBase) -> bool:
|
static func canDamage(bullet: BulletBase, target: EntityBase) -> bool:
|
||||||
|
if !bullet or !target: return false
|
||||||
if target.currentInvinsible: return false
|
if target.currentInvinsible: return false
|
||||||
if !bullet.canDamageSelf && target == bullet.launcher: return false
|
if !bullet.canDamageSelf && target == bullet.launcher: return false
|
||||||
if !GameRule.allowFriendlyFire:
|
if !GameRule.allowFriendlyFire:
|
||||||
|
|||||||
Reference in New Issue
Block a user