mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-01 08:51:53 +08:00
refactor(Bullets): 优化Parrier子弹效果和动画
- 调整子弹碰撞体大小和位置 - 修改动画效果,简化动画轨道 - 移除未使用的AI函数 - 添加子弹颜色继承效果
This commit is contained in:
@@ -1,58 +1,9 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://brt2q316hrswe"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://brt2q316hrswe"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_57y3f"]
|
||||
[ext_resource type="Script" uid="uid://bi7nde2rs0w4m" path="res://scripts/Contents/Bullets/Parrier.gd" id="2_li4th"]
|
||||
[ext_resource type="Texture2D" uid="uid://cajy8iya7achn" path="res://resources/bullets/parrier/造型2.png" id="3_ksxds"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_hu1af"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_ksxds")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ksxds"]
|
||||
resource_name = "spawn"
|
||||
step = 0.1
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 2, 2),
|
||||
"points": PackedFloat32Array(0.4, -0.25, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
|
||||
"times": PackedFloat32Array(0, 0.2, 1)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(2, 2, 2),
|
||||
"points": PackedFloat32Array(0.4, 0, 0, 0, 0, 0.5, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
|
||||
"times": PackedFloat32Array(0, 0.2, 1)
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath(".:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.5, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_hu1af"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
@@ -90,6 +41,44 @@ tracks/2/keys = {
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ksxds"]
|
||||
resource_name = "spawn"
|
||||
step = 0.1
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 2, 0, 2),
|
||||
"points": PackedFloat32Array(0.8, -0.25, 0, 0, 0, 1, -0.1, 0, 0.8, 0, 1, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
|
||||
"times": PackedFloat32Array(0, 0.2, 0.5, 1)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(2, 2, 0, 2),
|
||||
"points": PackedFloat32Array(0.8, 0, 0, 0, 0, 1, -0.1, 0, 0.8, 0, 1, -0.1, 0, 0.8, 0, 0, 0, 0, 0, 0),
|
||||
"times": PackedFloat32Array(0, 0.2, 0.5, 1)
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath(".:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 0.2, 0.5, 1),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1), Color(1, 1, 1, 1), Color(1, 1, 1, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_k4ctn"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_hu1af"),
|
||||
@@ -97,11 +86,10 @@ _data = {
|
||||
}
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_57y3f"]
|
||||
size = Vector2(26, 102)
|
||||
size = Vector2(54, 204)
|
||||
|
||||
[node name="Parrier" instance=ExtResource("1_57y3f")]
|
||||
script = ExtResource("2_li4th")
|
||||
speed = 5.0
|
||||
baseDamage = 0.0
|
||||
penerate = 1.0
|
||||
autoSpawnAnimation = true
|
||||
@@ -109,12 +97,16 @@ freeAfterSpawn = true
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
scale = Vector2(1e-05, 1e-05)
|
||||
sprite_frames = SubResource("SpriteFrames_hu1af")
|
||||
|
||||
[node name="animator" parent="texture" index="0"]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_k4ctn")
|
||||
}
|
||||
|
||||
[node name="anchor" type="Sprite2D" parent="texture" index="1"]
|
||||
position = Vector2(96, -4)
|
||||
texture = ExtResource("3_ksxds")
|
||||
|
||||
[node name="hitbox" parent="." index="1"]
|
||||
position = Vector2(95, 0)
|
||||
shape = SubResource("RectangleShape2D_57y3f")
|
||||
|
||||
@@ -3,8 +3,8 @@ class_name ParrierBullet
|
||||
|
||||
func hitBullet(bullet: BulletBase):
|
||||
if BulletTool.canDamage(bullet, launcher):
|
||||
EffectController.create(ComponentManager.getEffect("Parry"), position).shot()
|
||||
var eff = EffectController.create(ComponentManager.getEffect("Parry"), position)
|
||||
eff.modulate = bullet.modulate
|
||||
eff.shot()
|
||||
bullet.tryDestroy()
|
||||
tryDestroy()
|
||||
func ai():
|
||||
PresetBulletAI.forward(self , rotation)
|
||||
|
||||
Reference in New Issue
Block a user