mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
refactor(武器系统): 调整水晶武器伤害计算和子弹行为
重构蓝水晶和紫水晶武器的伤害计算方式,将蓝水晶的基础伤害从3降至2 移除紫水晶子弹的分裂和折射功能,将其逻辑移至BulletBase基类 更新相关场景文件中的显示文本和配置参数 调整角色初始武器配置,移除无用音效资源
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://uj0aqhm8wgy8"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_45mh7"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Bullets/PurpleCrystal.gd" id="2_4lnlm"]
|
||||
[ext_resource type="Script" uid="uid://t1q1eq8fk0ro" path="res://scripts/Contents/Bullets/PurpleCrystal.gd" id="2_4lnlm"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7hyatbuieaj" path="res://resources/bullets/purple-crystal/frames/0.svg" id="2_ca3pq"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_r86b3"]
|
||||
@@ -19,8 +19,8 @@ animations = [{
|
||||
|
||||
[node name="PurpleCrystal" instance=ExtResource("1_45mh7")]
|
||||
script = ExtResource("2_4lnlm")
|
||||
displayName = "水晶"
|
||||
lifeTime = 1000.0
|
||||
displayName = "紫水晶"
|
||||
lifeTime = 1500.0
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
sprite_frames = SubResource("SpriteFrames_r86b3")
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
[gd_scene load_steps=15 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
|
||||
[ext_resource type="Script" uid="uid://cthtupc6dtbav" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
|
||||
[ext_resource type="PackedScene" uid="uid://sp8f50c5mxyc" path="res://components/Weapons/Shield.tscn" id="3_0omr3"]
|
||||
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"]
|
||||
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_jluqw"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3crr8r7y3oho" path="res://components/Weapons/BlueCrystal.tscn" id="3_joj4g"]
|
||||
[ext_resource type="AudioStream" uid="uid://cdrevrq7n6yqa" path="res://resources/sounds/effect/Boing.mp3" id="4_66s6c"]
|
||||
[ext_resource type="AudioStream" uid="uid://benyec5bqni0b" path="res://resources/sounds/effect/Chomp.wav" id="4_k0yme"]
|
||||
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
|
||||
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
|
||||
[ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"]
|
||||
[ext_resource type="Texture2D" uid="uid://x7ic6wm22jv4" path="res://resources/characters/cock/rooster.png" id="11_joj4g"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"]
|
||||
@@ -57,10 +56,14 @@ metadata/_edit_vertical_guides_ = [71.0]
|
||||
[node name="weaponStore" parent="." index="1"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="BlueCrystal" parent="weaponStore" index="0" instance=ExtResource("3_joj4g")]
|
||||
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_jluqw")]
|
||||
offset_bottom = 350.0
|
||||
debugRebuild = false
|
||||
|
||||
[node name="BlueCrystal" parent="weaponStore" index="1" instance=ExtResource("3_joj4g")]
|
||||
offset_bottom = 398.0
|
||||
|
||||
[node name="Shield" parent="weaponStore" index="1" instance=ExtResource("3_0omr3")]
|
||||
[node name="Shield" parent="weaponStore" index="2" instance=ExtResource("3_0omr3")]
|
||||
debugRebuild = false
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
@@ -75,12 +78,6 @@ stream = ExtResource("5_xnbhq")
|
||||
[node name="hurt" parent="sounds" index="3"]
|
||||
stream = ExtResource("6_m5px1")
|
||||
|
||||
[node name="attack1" type="AudioStreamPlayer2D" parent="sounds" index="5"]
|
||||
stream = ExtResource("8_7dhim")
|
||||
|
||||
[node name="attack0" parent="sounds" index="7"]
|
||||
stream = ExtResource("3_4syso")
|
||||
|
||||
[node name="texture" parent="." index="3"]
|
||||
position = Vector2(0, -70)
|
||||
sprite_frames = SubResource("SpriteFrames_4v2ol")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c3crr8r7y3oho"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://c3crr8r7y3oho"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_rlc3s"]
|
||||
[ext_resource type="Texture2D" uid="uid://cp4ypuarjoshp" path="res://resources/skillIcons/purple-crystal.png" id="2_4qqa7"]
|
||||
[ext_resource type="Script" uid="uid://8xlc5upq36n7" path="res://scripts/Contents/Weapons/BlueCrystal.gd" id="2_jbcf8"]
|
||||
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="4_fewtg"]
|
||||
|
||||
[node name="BlueCrystal" instance=ExtResource("1_rlc3s")]
|
||||
script = ExtResource("2_jbcf8")
|
||||
@@ -10,7 +11,7 @@ avatarTexture = ExtResource("2_4qqa7")
|
||||
displayName = "蓝水晶簇"
|
||||
quality = 2
|
||||
store = {
|
||||
"atk": 3,
|
||||
"atk": 2,
|
||||
"count": 2.0
|
||||
}
|
||||
storeType = {
|
||||
@@ -21,6 +22,9 @@ storeType = {
|
||||
descriptionTemplate = "发射[b]蓝水晶[/b],可无限追踪,命中造成$atk点伤害,飞行过程中有$count颗[b]钻石[/b]环绕。"
|
||||
cooldown = 200.0
|
||||
|
||||
[node name="attack" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_fewtg")
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
modulate = Color(0.828, 1.53, 1.549, 1)
|
||||
texture = ExtResource("2_4qqa7")
|
||||
@@ -36,4 +40,4 @@ displayName = "蓝水晶簇"
|
||||
quality = 2
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]发射[b]蓝水晶[/b],可无限追踪,命中造成[color=cyan]5[/color]点伤害,飞行过程中有[color=cyan]2[/color]颗[b]钻石[/b]环绕。[/center]"
|
||||
text = "[center]发射[b]蓝水晶[/b],可无限追踪,命中造成[color=cyan]2[/color]点伤害,飞行过程中有[color=cyan]2[/color]颗[b]钻石[/b]环绕。[/center]"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://c0n3igy4hucrg"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_hyubh"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Weapons/PurpleCrystal.gd" id="2_0xgcv"]
|
||||
[ext_resource type="Script" uid="uid://cfgdvytfnwe8l" path="res://scripts/Contents/Weapons/PurpleCrystal.gd" id="2_0xgcv"]
|
||||
[ext_resource type="Texture2D" uid="uid://16yhngg3jpun" path="res://resources/weapons/purple-crystal.svg" id="2_wgtcw"]
|
||||
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="4_16daa"]
|
||||
|
||||
@@ -13,7 +13,6 @@ displayName = "紫水晶簇"
|
||||
costBeachball = 250
|
||||
descriptionTemplate = "撞击造成$atk点伤害。"
|
||||
cooldown = 200.0
|
||||
debugRebuild = true
|
||||
|
||||
[node name="attack" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_16daa")
|
||||
@@ -21,9 +20,14 @@ stream = ExtResource("4_16daa")
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_wgtcw")
|
||||
|
||||
[node name="beachball" parent="container/info/infos" index="1"]
|
||||
count = 250
|
||||
|
||||
[node name="soul" parent="container/info/infos" index="2"]
|
||||
count = 1
|
||||
|
||||
[node name="name" parent="container/info" index="2"]
|
||||
displayName = "紫水晶簇"
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]撞击造成[color=cyan]10[/color]→[color=yellow]15[/color]点伤害。[/center]"
|
||||
text = "[center]撞击造成[color=cyan]10[/color]点伤害。[/center]"
|
||||
|
||||
@@ -6,21 +6,3 @@ func destroy(_beacuseMap: bool):
|
||||
var eff = EffectController.create(ComponentManager.getEffect("PurpleCrystalExplosion"), global_position)
|
||||
eff.rotation = rotation
|
||||
eff.shot()
|
||||
func split(index, total, _last):
|
||||
BulletBase.generate(
|
||||
ComponentManager.getBullet("PurpleCrystal"),
|
||||
launcher,
|
||||
position,
|
||||
rotation + deg_to_rad(360 / total * index),
|
||||
true,
|
||||
isChildRefract
|
||||
)
|
||||
func refract(entity, _index, _total, _last):
|
||||
BulletBase.generate(
|
||||
ComponentManager.getBullet("PurpleCrystal"),
|
||||
launcher,
|
||||
position,
|
||||
position.angle_to_point(entity.position) if is_instance_valid(entity) else randf_range(0, deg_to_rad(360)),
|
||||
isChildSplit,
|
||||
true
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
extends Weapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 1 * to * soulLevel
|
||||
origin["atk"] += 2 * to * soulLevel
|
||||
origin["count"] = 1 + 1 * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
@@ -15,3 +15,4 @@ func attack(entity: EntityBase):
|
||||
if j is Diamond2Bullet:
|
||||
j.baseDamage = readStore("atk")
|
||||
j.parent = i
|
||||
return true
|
||||
|
||||
@@ -35,6 +35,7 @@ var isChildRefract: bool = false
|
||||
var initialSpeed: float = 0
|
||||
var initialDamage: float = 0
|
||||
var speedScale: float = 1
|
||||
var scene: PackedScene = null
|
||||
|
||||
func _ready():
|
||||
initialSpeed = speed
|
||||
@@ -163,10 +164,24 @@ func succeedToHit(_dmg: float, _entity: EntityBase):
|
||||
pass
|
||||
func register():
|
||||
pass
|
||||
func split(_index: int, _total: int, _lastBullet: float):
|
||||
pass
|
||||
func refract(_entity: EntityBase, _index: int, _total: int, _lastBullet: float):
|
||||
pass
|
||||
func split(index: int, total: int, _lastBullet: float):
|
||||
BulletBase.generate(
|
||||
scene,
|
||||
launcher,
|
||||
position,
|
||||
rotation + deg_to_rad(360.0 / total * index),
|
||||
true,
|
||||
isChildRefract
|
||||
)
|
||||
func refract(entity: EntityBase, _index: int, _total: int, _lastBullet: float):
|
||||
BulletBase.generate(
|
||||
scene,
|
||||
launcher,
|
||||
position,
|
||||
position.angle_to_point(entity.position) if is_instance_valid(entity) else randf_range(0, deg_to_rad(360)),
|
||||
isChildSplit,
|
||||
true
|
||||
)
|
||||
|
||||
static func generate(
|
||||
bullet: PackedScene,
|
||||
@@ -187,6 +202,7 @@ static func generate(
|
||||
instance.isChildRefract = asChildRefract
|
||||
instance.launcher = launchBy
|
||||
instance.position = spawnPosition
|
||||
instance.scene = bullet
|
||||
instance.rotation = spawnRotation + deg_to_rad(launchBy.fields.get(FieldStore.Entity.OFFSET_SHOOT) * randf_range(-1, 1) * int(!ignoreOffset))
|
||||
if addToWorld:
|
||||
WorldManager.rootNode.call_deferred("add_child", instance)
|
||||
|
||||
Reference in New Issue
Block a user