1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-09 05:07:12 +08:00

feat(武器): 添加彩虹猫之刃武器及相关资源

添加彩虹猫之刃武器,包含以下内容:
- 新增彩虹猫子弹和武器贴图资源
- 实现彩虹猫子弹和武器逻辑脚本
- 添加武器预制体和相关动画效果
- 在公鸡角色中默认装备该武器
- 修改子弹基类添加AI调用逻辑
This commit is contained in:
2025-09-21 08:26:29 +08:00
parent 73c59be0e8
commit f58a8ea014
13 changed files with 271 additions and 6 deletions
+71
View File
@@ -0,0 +1,71 @@
[gd_scene load_steps=9 format=3 uid="uid://dseriubgri7j5"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_newpt"]
[ext_resource type="Texture2D" uid="uid://cwr2pud7h8o3e" path="res://resources/bullets/meowmere/Meowmere.webp" id="2_ahi5w"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/Meowmere.gd" id="2_eoimw"]
[sub_resource type="SpriteFrames" id="SpriteFrames_432r6"]
[sub_resource type="Animation" id="Animation_jdotg"]
resource_name = "spwan"
length = 0.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("sword:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [-0.436332, 2.00713]
}
[sub_resource type="Animation" id="Animation_q4hki"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("sword:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [-0.436332]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_47iyl"]
_data = {
"RESET": SubResource("Animation_q4hki"),
"spawn": SubResource("Animation_jdotg")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ja03c"]
size = Vector2(56, 107)
[node name="Meowmere" instance=ExtResource("1_newpt")]
script = ExtResource("2_eoimw")
autoSpawnAnimation = true
freeAfterSpawn = true
[node name="texture" parent="." index="0"]
sprite_frames = SubResource("SpriteFrames_432r6")
[node name="animator" parent="texture" index="0"]
libraries = {
"": SubResource("AnimationLibrary_47iyl")
}
[node name="sword" type="Node2D" parent="texture" index="1"]
rotation = -0.436332
[node name="texture" type="Sprite2D" parent="texture/sword" index="0"]
position = Vector2(25, -29)
texture = ExtResource("2_ahi5w")
[node name="hitbox" parent="." index="1"]
position = Vector2(30, -4.5)
shape = SubResource("RectangleShape2D_ja03c")
+62
View File
@@ -0,0 +1,62 @@
[gd_scene load_steps=12 format=3 uid="uid://ct8ijxg7ftypd"]
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_vvwmq"]
[ext_resource type="Script" path="res://scripts/Contents/Bullets/RainbowCat.gd" id="2_4c1xc"]
[ext_resource type="Texture2D" uid="uid://ceqhttm1urmk3" path="res://resources/bullets/rainbow-cat/1.webp" id="2_bt3cu"]
[sub_resource type="SpriteFrames" id="SpriteFrames_0xq5p"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_bt3cu")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="Curve" id="Curve_80oph"]
_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_pwojl"]
curve = SubResource("Curve_80oph")
[sub_resource type="Curve" id="Curve_dmif4"]
_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_yu884"]
curve = SubResource("Curve_dmif4")
[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_f6n6f"]
gradient = SubResource("Gradient_wd04q")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_u7fxt"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 10.0
angle_min = 1.07288e-05
angle_max = 360.0
angle_curve = SubResource("CurveTexture_yu884")
gravity = Vector3(0, 0, 0)
scale_min = 3.0
scale_max = 5.0
color_ramp = SubResource("GradientTexture1D_f6n6f")
alpha_curve = SubResource("CurveTexture_pwojl")
[node name="RainbowCat" instance=ExtResource("1_vvwmq")]
script = ExtResource("2_4c1xc")
[node name="texture" parent="." index="0"]
rotation = 1.5708
sprite_frames = SubResource("SpriteFrames_0xq5p")
[node name="trail" type="GPUParticles2D" parent="texture" index="1"]
z_index = -1
amount = 400
process_material = SubResource("ParticleProcessMaterial_u7fxt")
+9 -5
View File
@@ -1,10 +1,11 @@
[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"]
[ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="2_q0j6j"]
[ext_resource type="AudioStream" uid="uid://dclinyhu256xi" path="res://resources/sounds/effect/Low Whoosh.mp3" id="3_4syso"]
[ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="3_b0fgx"]
[ext_resource type="PackedScene" uid="uid://frwt0fgrpskb" path="res://components/Weapons/Meowmere.tscn" id="3_e2rag"]
[ext_resource type="PackedScene" uid="uid://c0n3igy4hucrg" path="res://components/Weapons/PurpleCrystal.tscn" id="3_ms5sq"]
[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"]
@@ -47,15 +48,18 @@ displayName = "公鸡"
[node name="weaponStore" parent="." index="0"]
process_mode = 4
[node name="PurpleCrystal" parent="weaponStore" index="0" instance=ExtResource("3_ms5sq")]
[node name="Meowmere" parent="weaponStore" index="0" instance=ExtResource("3_e2rag")]
offset_bottom = 315.0
[node name="PurpleCrystal" parent="weaponStore" index="1" instance=ExtResource("3_ms5sq")]
debugRebuild = false
[node name="VectorStar" parent="weaponStore" index="1" instance=ExtResource("6_fvy5n")]
[node name="VectorStar" parent="weaponStore" index="2" instance=ExtResource("6_fvy5n")]
debugRebuild = false
[node name="LGBT" parent="weaponStore" index="2" instance=ExtResource("4_pb8qn")]
[node name="LGBT" parent="weaponStore" index="3" instance=ExtResource("4_pb8qn")]
[node name="BigLaser" parent="weaponStore" index="3" instance=ExtResource("4_plqwu")]
[node name="BigLaser" parent="weaponStore" index="4" instance=ExtResource("4_plqwu")]
[node name="sprint" parent="sounds" index="0"]
stream = ExtResource("4_66s6c")
+37
View File
@@ -0,0 +1,37 @@
[gd_scene load_steps=4 format=3 uid="uid://frwt0fgrpskb"]
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_xhgkg"]
[ext_resource type="Script" path="res://scripts/Contents/Weapons/Meowmere.gd" id="2_4rd12"]
[ext_resource type="Texture2D" uid="uid://cwr2pud7h8o3e" path="res://resources/bullets/meowmere/Meowmere.webp" id="2_kiocs"]
[node name="Meowmere" instance=ExtResource("1_xhgkg")]
script = ExtResource("2_4rd12")
avatarTexture = ExtResource("2_kiocs")
displayName = "彩虹猫之刃"
quality = 2
typeTopic = 3
costBeachball = 600
store = {
"atk": 10,
"count": 1.0
}
storeType = {
"atk": 1,
"count": 1.0
}
descriptionTemplate = "发射$count只彩虹猫的同时挥舞造成$atk点伤害。"
cooldown = 200.0
[node name="avatar" parent="container/info" index="0"]
texture = ExtResource("2_kiocs")
[node name="beachball" parent="container/info/infos/beachballInfo" index="1"]
text = "600"
[node name="name" parent="container/info" index="2"]
displayName = "彩虹猫之刃"
quality = 2
typeTopic = 3
[node name="description" parent="container" index="2"]
text = "[center]发射[color=cyan]1[/color]→[color=yellow]1[/color]只彩虹猫的同时挥舞造成[color=cyan]10[/color]→[color=yellow]17[/color]点伤害。[/center]"
Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwr2pud7h8o3e"
path="res://.godot/imported/Meowmere.webp-c52ec4150a4f8810198837f26763ea36.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/meowmere/Meowmere.webp"
dest_files=["res://.godot/imported/Meowmere.webp-c52ec4150a4f8810198837f26763ea36.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: 150 B

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ceqhttm1urmk3"
path="res://.godot/imported/1.webp-d5451562a57d963aa8e8d4716bd74c9b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/bullets/rainbow-cat/1.webp"
dest_files=["res://.godot/imported/1.webp-d5451562a57d963aa8e8d4716bd74c9b.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
+4
View File
@@ -0,0 +1,4 @@
extends BulletBase
func ai():
PresetBulletAI.lockLauncher(self, launcher, true)
+5
View File
@@ -0,0 +1,5 @@
extends BulletBase
class_name RainbowCat
func ai():
PresetBulletAI.forward(self, rotation)
+13
View File
@@ -0,0 +1,13 @@
@tool
extends Weapon
func update(to, origin, _entity):
origin["atk"] += 7 * to * soulLevel
origin["count"] = 1 * soulLevel
return origin
func attack(entity: EntityBase):
var weaponPos = entity.findWeaponAnchor("normal")
for i in BulletBase.generate(preload("res://components/Bullets/Meowmere.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position())):
i.damage = readStore("atk")
for i in readStore("count"):
BulletBase.generate(preload("res://components/Bullets/RainbowCat.tscn"), entity, weaponPos, weaponPos.angle_to_point(get_global_mouse_position()))
+1
View File
@@ -50,6 +50,7 @@ func _ready():
if autoDestroyOnHitMap:
tryDestroy(true)
)
ai()
func _process(_delta: float) -> void:
if destroying: return
if lifeTime > 0:
+1 -1
View File
@@ -327,7 +327,7 @@ func tryHeal(count: float):
playSound("heal")
healed.emit(heal(count * fields.get(FieldStore.Entity.HEAL_ABILITY)))
healthChanged.emit(health)
func findWeaponAnchor(weaponName: String):
func findWeaponAnchor(weaponName: String) -> Vector2:
var anchor = $"%weapons".get_node_or_null(weaponName)
if anchor is Node2D:
return anchor.global_position