mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-07 04:07:13 +08:00
feat(武器系统): 新增蓝水晶武器及其子弹效果
实现蓝水晶武器系统,包含追踪子弹和环绕钻石效果 - 添加蓝水晶武器及配套子弹资源 - 实现子弹追踪逻辑和钻石环绕效果 - 扩展BulletBase类支持父子弹关联 - 更新角色预设包含新武器
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://b15v8csigsx5s"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_flng1"]
|
||||
[ext_resource type="Script" uid="uid://d1031p38h24tw" path="res://scripts/Contents/Bullets/BlueCrystal.gd" id="2_0q2lw"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7hyatbuieaj" path="res://resources/bullets/purple-crystal/frames/0.svg" id="3_7v6qk"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4h7m0"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_7v6qk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_7v6qk"]
|
||||
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_4h7m0"]
|
||||
curve = SubResource("Curve_7v6qk")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_u2ooq"]
|
||||
particle_flag_disable_z = true
|
||||
direction = Vector3(-1, 0, 0)
|
||||
spread = 0.0
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 100.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.5
|
||||
scale_max = 0.5
|
||||
color = Color(1.353256, 1.353256, 1.353256, 1)
|
||||
alpha_curve = SubResource("CurveTexture_4h7m0")
|
||||
|
||||
[node name="BlueCrystal" instance=ExtResource("1_flng1")]
|
||||
script = ExtResource("2_0q2lw")
|
||||
displayName = "蓝水晶"
|
||||
speed = 5.0
|
||||
lifeTime = 5000.0
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
modulate = Color(0.8283318, 1.529841, 1.548706, 1)
|
||||
sprite_frames = SubResource("SpriteFrames_4h7m0")
|
||||
|
||||
[node name="trail" type="GPUParticles2D" parent="texture" index="1"]
|
||||
unique_name_in_owner = true
|
||||
z_index = -1
|
||||
position = Vector2(-23, 0)
|
||||
amount = 10
|
||||
texture = ExtResource("3_7v6qk")
|
||||
local_coords = true
|
||||
process_material = SubResource("ParticleProcessMaterial_u2ooq")
|
||||
@@ -0,0 +1,69 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://chqclu0q4ew46"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_slk7q"]
|
||||
[ext_resource type="Script" uid="uid://c1ywds8xwerm3" path="res://scripts/Contents/Bullets/Diamond2.gd" id="2_i4qda"]
|
||||
[ext_resource type="Texture2D" uid="uid://dfptmc7clhtx7" path="res://resources/bullets/diamond/frames/0.svg" id="3_pkqnc"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_pkqnc"]
|
||||
resource_name = "spawn"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_0d4xv"]
|
||||
resource_name = "loop"
|
||||
loop_mode = 1
|
||||
step = 0.05
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [0.0, 6.283185307179586]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_g4uh6"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_v5jve"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_g4uh6"),
|
||||
&"loop": SubResource("Animation_0d4xv"),
|
||||
&"spawn": SubResource("Animation_pkqnc")
|
||||
}
|
||||
|
||||
[node name="Diamond2" instance=ExtResource("1_slk7q")]
|
||||
script = ExtResource("2_i4qda")
|
||||
displayName = "钻石"
|
||||
lifeTime = 5000.0
|
||||
autoLoopAnimation = true
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
scale = Vector2(0.6, 0.6)
|
||||
|
||||
[node name="animator" parent="texture" index="0"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_v5jve")
|
||||
}
|
||||
|
||||
[node name="static" type="Sprite2D" parent="texture" index="1"]
|
||||
position = Vector2(70, 0)
|
||||
rotation = 1.5707964
|
||||
texture = ExtResource("3_pkqnc")
|
||||
|
||||
[node name="hitbox" parent="." index="1"]
|
||||
position = Vector2(43, 0)
|
||||
@@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
[gd_scene load_steps=15 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://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"]
|
||||
@@ -56,7 +57,11 @@ metadata/_edit_vertical_guides_ = [71.0]
|
||||
[node name="weaponStore" parent="." index="1"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="Shield" parent="weaponStore" index="0" instance=ExtResource("3_0omr3")]
|
||||
[node name="BlueCrystal" parent="weaponStore" index="0" instance=ExtResource("3_joj4g")]
|
||||
offset_bottom = 398.0
|
||||
|
||||
[node name="Shield" parent="weaponStore" index="1" instance=ExtResource("3_0omr3")]
|
||||
debugRebuild = false
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_66s6c")
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=4 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"]
|
||||
|
||||
[node name="BlueCrystal" instance=ExtResource("1_rlc3s")]
|
||||
script = ExtResource("2_jbcf8")
|
||||
avatarTexture = ExtResource("2_4qqa7")
|
||||
displayName = "蓝水晶簇"
|
||||
quality = 2
|
||||
store = {
|
||||
"atk": 5,
|
||||
"count": 2.0
|
||||
}
|
||||
storeType = {
|
||||
"atk": 1,
|
||||
"count": 1,
|
||||
"distance": 0
|
||||
}
|
||||
descriptionTemplate = "发射[b]蓝水晶[/b],可无限追踪,命中造成$atk点伤害,飞行过程中有$count颗[b]钻石[/b]环绕。"
|
||||
cooldown = 175.0
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
modulate = Color(0.828, 1.53, 1.549, 1)
|
||||
texture = ExtResource("2_4qqa7")
|
||||
|
||||
[node name="beachball" parent="container/info/infos" index="1"]
|
||||
count = 500
|
||||
|
||||
[node name="soul" parent="container/info/infos" index="2"]
|
||||
count = 1
|
||||
|
||||
[node name="name" parent="container/info" index="2"]
|
||||
displayName = "蓝水晶簇"
|
||||
quality = 2
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]发射[b]蓝水晶[/b],可无限追踪,命中造成[color=cyan]5[/color]点伤害,飞行过程中有[color=cyan]2[/color]颗[b]钻石[/b]环绕,在运动$distance秒后逃逸。[/center]"
|
||||
@@ -0,0 +1,16 @@
|
||||
extends BulletBase
|
||||
class_name BlueCrystalBullet
|
||||
|
||||
var tracer: EntityBase = null
|
||||
@onready var trail: GPUParticles2D = $%trail
|
||||
|
||||
func ai():
|
||||
if is_instance_valid(tracer):
|
||||
var tracker = tracer.getTrackingAnchor()
|
||||
var targetAngle = position.angle_to_point(tracker)
|
||||
trail.rotation = - Vector2.from_angle(rotation).angle_to(Vector2.from_angle(targetAngle)) * 0.75 / (speed / initialSpeed)
|
||||
PresetBulletAI.trace(self, tracker, 0.05)
|
||||
else:
|
||||
trail.rotation = 0
|
||||
speed += 0.1
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
@@ -0,0 +1 @@
|
||||
uid://d1031p38h24tw
|
||||
@@ -0,0 +1,6 @@
|
||||
extends BulletBase
|
||||
class_name Diamond2Bullet
|
||||
|
||||
func ai():
|
||||
if is_instance_valid(parent):
|
||||
position = parent.position
|
||||
@@ -0,0 +1 @@
|
||||
uid://c1ywds8xwerm3
|
||||
@@ -0,0 +1,17 @@
|
||||
@tool
|
||||
extends Weapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 1 * to * soulLevel
|
||||
origin["count"] = 1 * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
for i in BulletBase.generate(ComponentManager.getBullet("BlueCrystal"), entity, entity.findWeaponAnchor("normal"), deg_to_rad(randf_range(0, 360))):
|
||||
if i is BlueCrystalBullet:
|
||||
i.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
|
||||
i.baseDamage = readStore("atk")
|
||||
for index in readStore("count"):
|
||||
for j in BulletBase.generate(ComponentManager.getBullet("Diamond2"), entity, i.position, deg_to_rad(360.0 / readStore("count") * index)):
|
||||
if j is Diamond2Bullet:
|
||||
j.baseDamage = readStore("atk")
|
||||
j.parent = i
|
||||
@@ -0,0 +1 @@
|
||||
uid://8xlc5upq36n7
|
||||
@@ -26,6 +26,7 @@ class_name BulletBase
|
||||
|
||||
var launcher: EntityBase = null
|
||||
var launcherSummoned: EntityBase = null
|
||||
var parent: BulletBase = null
|
||||
var spawnInWhen: float = 0
|
||||
var spawnInWhere: Vector2 = Vector2.ZERO
|
||||
var destroying: bool = false
|
||||
|
||||
Reference in New Issue
Block a user