1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

feat(武器系统): 添加七彩矢武器及其相关资源

添加新的七彩矢武器系统,包括武器脚本、子弹特效、着色器和动画资源
为Rooster角色添加新武器选项
实现光效追踪和颜色渐变效果
调整窗口模式为2(全屏)
This commit is contained in:
2025-09-07 09:25:51 +08:00
parent 2d42eaea9a
commit 94589131fa
18 changed files with 445 additions and 2 deletions
@@ -0,0 +1,161 @@
[gd_scene load_steps=24 format=3 uid="uid://bjskq2m1rrlks"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_dvf35"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/BossAttack/Bear/ArrowSeven.gd" id="2_uqsop"]
[ext_resource type="Shader" path="res://shaders/Light.gdshader" id="3_j0g0m"]
[ext_resource type="Texture2D" uid="uid://chq2rnqi00nbj" path="res://resources/bullets/light-express/Prismatic_Bolt.webp" id="3_tmrnu"]
[ext_resource type="Shader" path="res://shaders/SuperLight.gdshader" id="5_lyybq"]
[ext_resource type="Script" path="res://scripts/Statemachine/ShaderStage.gd" id="5_ppdpf"]
[sub_resource type="Gradient" id="Gradient_wd04q"]
offsets = PackedFloat32Array(0, 0.16, 0.32, 0.48, 0.64, 0.8, 1)
colors = PackedColorArray(1, 0, 0, 1, 1, 0.447059, 0, 1, 1, 0.890625, 0, 1, 0, 0.820313, 0.128174, 1, 0, 1, 0.859375, 1, 0, 0.53125, 1, 1, 0.429688, 0, 1, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_e0qv5"]
gradient = SubResource("Gradient_wd04q")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1nfgk"]
shader = ExtResource("3_j0g0m")
shader_parameter/color = Color(1, 1, 1, 1)
[sub_resource type="SpriteFrames" id="SpriteFrames_q4xus"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_tmrnu")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="Animation" id="Animation_usqjd"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("superlight:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_oinqg"]
resource_name = "destroy"
length = 0.5
step = 0.1
[sub_resource type="Animation" id="Animation_ynxlt"]
resource_name = "loop"
length = 0.2
loop_mode = 1
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("superlight:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 0,
"values": [Vector2(1, 1), Vector2(0.8, 0.8), Vector2(1, 1)]
}
[sub_resource type="Animation" id="Animation_kmogx"]
resource_name = "spawn"
[sub_resource type="AnimationLibrary" id="AnimationLibrary_f7cx6"]
_data = {
"RESET": SubResource("Animation_usqjd"),
"destroy": SubResource("Animation_oinqg"),
"loop": SubResource("Animation_ynxlt"),
"spawn": SubResource("Animation_kmogx")
}
[sub_resource type="ShaderMaterial" id="ShaderMaterial_7e3fr"]
shader = ExtResource("5_lyybq")
shader_parameter/k = -0.223
shader_parameter/color = Color(1, 1, 1, 1)
shader_parameter/scale = 10.0
[sub_resource type="ShaderMaterial" id="ShaderMaterial_w3sk0"]
shader = ExtResource("3_j0g0m")
shader_parameter/color = Color(1, 1, 1, 1)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_yjmap"]
radius = 5.0
height = 42.0
[sub_resource type="Curve" id="Curve_n2t6r"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_wjo54"]
curve = SubResource("Curve_n2t6r")
[sub_resource type="Curve" id="Curve_uxwl3"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_i5kg3"]
curve = SubResource("Curve_uxwl3")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7osnr"]
particle_flag_disable_z = true
direction = Vector3(-1, 0, 0)
spread = 180.0
initial_velocity_min = 30.0
initial_velocity_max = 60.0
gravity = Vector3(0, 0, 0)
scale_min = 10.0
scale_max = 10.0
scale_curve = SubResource("CurveTexture_i5kg3")
alpha_curve = SubResource("CurveTexture_wjo54")
[node name="ArrowSeven" instance=ExtResource("1_dvf35")]
position = Vector2(-34, -24)
script = ExtResource("2_uqsop")
allColor = SubResource("GradientTexture1D_e0qv5")
autoLoopAnimation = true
[node name="texture" parent="." index="0"]
material = SubResource("ShaderMaterial_1nfgk")
rotation = 1.5708
sprite_frames = SubResource("SpriteFrames_q4xus")
[node name="animator" parent="texture" index="0"]
libraries = {
"": SubResource("AnimationLibrary_f7cx6")
}
[node name="superlight" type="Node2D" parent="texture" index="1"]
unique_name_in_owner = true
z_index = -1
material = SubResource("ShaderMaterial_7e3fr")
script = ExtResource("5_ppdpf")
size = Vector2(100, 200)
[node name="frontlight" type="Node2D" parent="texture" index="2"]
unique_name_in_owner = true
material = SubResource("ShaderMaterial_w3sk0")
scale = Vector2(0.968786, 0.968786)
script = ExtResource("5_ppdpf")
size = Vector2(40, 40)
color = Color(1, 1, 1, 0)
[node name="hitbox" parent="." index="1"]
visible = false
rotation = 1.5708
shape = SubResource("CapsuleShape2D_yjmap")
[node name="trail" type="GPUParticles2D" parent="." index="2"]
unique_name_in_owner = true
z_index = -1
amount = 100
process_material = SubResource("ParticleProcessMaterial_7osnr")
+9 -1
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://bm7ymrri6pykb"]
[gd_scene load_steps=18 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" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
@@ -13,6 +13,7 @@
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
[ext_resource type="PackedScene" uid="uid://bb1uh8k7gkhr7" path="res://components/Weapons/VectorStar.tscn" id="6_fvy5n"]
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
[ext_resource type="PackedScene" uid="uid://ct2p0fbd5ktof" path="res://components/Weapons/Arrow7.tscn" id="7_jguvd"]
[ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"]
[sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"]
@@ -47,12 +48,19 @@ script = ExtResource("2_oqdqd")
process_mode = 4
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")]
debugRebuild = false
[node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("6_fvy5n")]
debugRebuild = false
[node name="LGBT" parent="weaponStore" index="2" instance=ExtResource("4_pb8qn")]
debugRebuild = false
[node name="BigLaser" parent="weaponStore" index="3" instance=ExtResource("4_plqwu")]
debugRebuild = false
[node name="WeaponCard" parent="weaponStore" index="4" instance=ExtResource("7_jguvd")]
debugRebuild = false
[node name="sprint" parent="sounds" index="0"]
stream = ExtResource("4_66s6c")
+30
View File
@@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=3 uid="uid://ct2p0fbd5ktof"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_ra1fw"]
[ext_resource type="Script" path="res://scripts/Contents/Weapons/Arrow7.gd" id="2_a7w7h"]
[ext_resource type="Texture2D" uid="uid://chq2rnqi00nbj" path="res://resources/bullets/light-express/Prismatic_Bolt.webp" id="2_vwdyb"]
[node name="Arrow7" instance=ExtResource("1_ra1fw")]
script = ExtResource("2_a7w7h")
avatarTexture = ExtResource("2_vwdyb")
displayName = "七彩矢"
typeTopic = 3
store = {
"atk": 10,
"count": 20
}
storeType = {
"atk": 1,
"count": 1
}
descriptionTemplate = "发射$count支七彩矢,每支造成$atk点伤害。"
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_vwdyb")
[node name="name" parent="container/info" index="2"]
displayName = "七彩矢"
typeTopic = 3
[node name="description" parent="container" index="2"]
text = "[center]发射[color=cyan]20[/color]支七彩矢,每支造成[color=cyan]10[/color]点伤害。[/center]"
+1
View File
@@ -19,6 +19,7 @@ config/icon="res://icon.svg"
window/size/viewport_width=1280
window/size/viewport_height=720
window/size/mode=2
[dotnet]
Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cf065c7jjufq"
path="res://.godot/imported/Ethereal_Lance.webp-f8d5b78c1006096eb0a4dbd912d0b40b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/light-express/Ethereal_Lance.webp"
dest_files=["res://.godot/imported/Ethereal_Lance.webp-f8d5b78c1006096eb0a4dbd912d0b40b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bkiaaucejquik"
path="res://.godot/imported/Everlasting_Rainbow.png-e1d35de17a7261a88419c468ef630bba.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/light-express/Everlasting_Rainbow.png"
dest_files=["res://.godot/imported/Everlasting_Rainbow.png-e1d35de17a7261a88419c468ef630bba.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://chq2rnqi00nbj"
path="res://.godot/imported/Prismatic_Bolt.webp-ce6218303d6b2aa5c4b3def0c1c66b83.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/light-express/Prismatic_Bolt.webp"
dest_files=["res://.godot/imported/Prismatic_Bolt.webp-ce6218303d6b2aa5c4b3def0c1c66b83.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://0w8sebsqjb7a"
path="res://.godot/imported/Sun_Dance.webp-a2f97cb60ab8eed183860f5e649ba3ad.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/light-express/Sun_Dance.webp"
dest_files=["res://.godot/imported/Sun_Dance.webp-a2f97cb60ab8eed183860f5e649ba3ad.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
@@ -0,0 +1,42 @@
extends BulletBase
@export var allColor: GradientTexture1D = null
@onready var superlight: Node2D = $"%superlight"
@onready var trail: GPUParticles2D = $"%trail"
var myColor: Color
var tracer: EntityBase = null
var forwardTime: float = 500
var forwarded: bool = false
func register():
speed = 1
damage = 5
penerate = 1
func spawn():
myColor = allColor.gradient.sample(randf())
superlight.material = superlight.material.duplicate()
trail.process_material = trail.process_material.duplicate()
setColor(myColor)
func ai():
superlight.global_rotation_degrees = 90
PresetBulletAI.forward(self, rotation)
if timeLived() <= forwardTime:
speed = 10 * ((forwardTime - timeLived()) / forwardTime)
elif forwarded:
if timeLived() < forwardTime + 1000:
speed = clamp((timeLived() - forwardTime) / 75, 0, 30)
if is_instance_valid(tracer):
PresetBulletAI.trace(self, tracer.position, 0.1)
else:
forwarded = true
func setColor(color: Color):
texture.self_modulate = color
var mat: ParticleProcessMaterial = trail.process_material
mat.color = color
superlight.material.set_shader_parameter("color", color)
+7 -1
View File
@@ -1,2 +1,8 @@
extends EntityBase
class_name Bear
class_name Bear # 攻击方式模仿泰拉瑞亚光之女皇
func ai():
pass
func attack(type):
if type == 0:
pass
+15
View File
@@ -0,0 +1,15 @@
@tool
extends Weapon
class_name Arrow7Weapon
func update(to: int, origin: Dictionary, _entity: EntityBase):
origin["atk"] += 5 * to
origin["count"] += 1 * to
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for i in range(readStore("count")):
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), entity, weaponPos, deg_to_rad(randf_range(0, 360))):
bullet.damage = readStore("atk")
bullet.tracer = EntityTool.findClosetEntity(entity.position, get_tree(), false, true)
return true
+10
View File
@@ -0,0 +1,10 @@
@tool
extends CanvasItem
@export var size: Vector2 = Vector2.ONE * 100
@export var color: Color = Color.WHITE
func _draw():
draw_rect(Rect2(size / -2, size), color)
func _process(_delta):
queue_redraw()
+8
View File
@@ -0,0 +1,8 @@
shader_type canvas_item;
uniform vec4 color:source_color;
void fragment() {
float maxDistance=0.5;
float dist=distance(UV,vec2(0.5));
vec4 mixed=vec4(color.rgb,smoothstep(0,1,(maxDistance-dist)/maxDistance));
COLOR=mix(COLOR,mixed,0.5);
}
+26
View File
@@ -0,0 +1,26 @@
shader_type canvas_item;
uniform float k : hint_range(-10.0, 10.0) = 1.0;
uniform vec4 color : source_color = vec4(1.0);
uniform float scale : hint_range(10.0, 500.0) = 100.0;
void fragment() {
vec2 pos = (UV - 0.5) * scale;
float y1 = k / pos.x;
float y2 = -k / pos.x;
bool in_region = false;
if (pos.x > 0.0) {
if ((pos.y > y2 && pos.y < y1) || (pos.y < y2 && pos.y > y1)) {
in_region = true;
}
}
else if (pos.x < 0.0) {
if ((pos.y > y1 && pos.y < y2) || (pos.y < y1 && pos.y > y2)) {
in_region = true;
}
}
if (in_region) {
COLOR = color;
} else {
COLOR = vec4(0.0);
}
COLOR.a*=(0.5-distance(UV,vec2(0.5)))/0.5;
}