mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-13 07:07:12 +08:00
feat(Bear): 添加新的攻击类型SunDance
为Bear角色添加新的攻击类型SunDance,包含子弹特效和动画。修改了Bear.gd以支持新攻击类型,并创建了SunDance.gd脚本和对应的场景文件。新攻击会生成旋转的彩色子弹,具有不同的颜色和大小变化效果。
This commit is contained in:
@@ -1,29 +1,160 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://8ayxqglkc2nm"]
|
||||
[gd_scene load_steps=11 format=3 uid="uid://8ayxqglkc2nm"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_h0611"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Bullets/BossAttack/Bear/SunDance.gd" id="2_0kdtj"]
|
||||
[ext_resource type="Texture2D" uid="uid://0w8sebsqjb7a" path="res://resources/bullets/light-express/Sun_Dance.webp" id="2_rqhmg"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_ep4dl"]
|
||||
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_ikq3n"]
|
||||
gradient = SubResource("Gradient_ep4dl")
|
||||
|
||||
[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"
|
||||
loop_mode = 1
|
||||
step = 0.1
|
||||
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.28319]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_kmogx"]
|
||||
resource_name = "spawn"
|
||||
length = 3.0
|
||||
step = 0.1
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("%texture/..:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0, 0, 0),
|
||||
"points": PackedFloat32Array(0.5, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.5, 2, 3)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("%texture/..:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0, 0, 0),
|
||||
"points": PackedFloat32Array(0.5, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.5, 2, 3)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("%texture/..:modulate:a")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0, 0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0.2, -0.25, 0, 0.25, 0, 0.2, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.504665, 2.00467, 3)
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n0ppl"]
|
||||
length = 0.001
|
||||
tracks/0/type = "bezier"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("%texture/..:scale:x")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "bezier"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("%texture/..:scale:y")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/2/type = "bezier"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("%texture/..:modulate:a")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"handle_modes": PackedInt32Array(0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_fv2s4"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_n0ppl"),
|
||||
"destroy": SubResource("Animation_oinqg"),
|
||||
"loop": SubResource("Animation_ynxlt"),
|
||||
"spawn": SubResource("Animation_kmogx")
|
||||
}
|
||||
|
||||
[node name="SunDance" instance=ExtResource("1_h0611")]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
scale = Vector2(1e-05, 1e-05)
|
||||
script = ExtResource("2_0kdtj")
|
||||
allColor = SubResource("GradientTexture1D_ikq3n")
|
||||
autoSpawnAnimation = true
|
||||
freeAfterSpawn = true
|
||||
|
||||
[node name="animator" parent="texture" index="0"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_fv2s4")
|
||||
}
|
||||
|
||||
[node name="leave1" type="Sprite2D" parent="texture" index="1"]
|
||||
modulate = Color(1, 0, 0, 1)
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(180, 0)
|
||||
texture = ExtResource("2_rqhmg")
|
||||
|
||||
[node name="leave2" type="Sprite2D" parent="texture" index="2"]
|
||||
self_modulate = Color(3, 1, 1, 1)
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(160, 0)
|
||||
scale = Vector2(0.9, 0.9)
|
||||
texture = ExtResource("2_rqhmg")
|
||||
|
||||
[node name="leave3" type="Sprite2D" parent="texture" index="3"]
|
||||
modulate = Color(10, 10, 10, 1)
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(140, 0)
|
||||
scale = Vector2(0.8, 0.8)
|
||||
texture = ExtResource("2_rqhmg")
|
||||
|
||||
[node name="leave4" type="Sprite2D" parent="texture" index="4"]
|
||||
modulate = Color(10, 10, 10, 1)
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(120, 0)
|
||||
scale = Vector2(0.7, 0.7)
|
||||
texture = ExtResource("2_rqhmg")
|
||||
|
||||
[node name="hitbox" parent="." index="1"]
|
||||
rotation = 1.5708
|
||||
|
||||
[node name="hitbox2" type="CollisionPolygon2D" parent="." index="2"]
|
||||
visible = false
|
||||
position = Vector2(-13, -1)
|
||||
polygon = PackedVector2Array(21, -8, 23, 10, 61, 21, 96, 23, 198, 17, 296, 1, 196, -17, 95, -20, 61, -19)
|
||||
|
||||
@@ -60,7 +60,6 @@ debugRebuild = false
|
||||
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")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
extends BulletBase
|
||||
|
||||
@export var allColor: GradientTexture1D = null
|
||||
|
||||
@onready var leave1: Sprite2D = $"%leave1"
|
||||
@onready var leave2: Sprite2D = $"%leave2"
|
||||
@onready var leave3: Sprite2D = $"%leave3"
|
||||
@onready var leave4: Sprite2D = $"%leave4"
|
||||
|
||||
var myColor: Color
|
||||
|
||||
func register():
|
||||
speed = 0
|
||||
damage = 5
|
||||
penerate = 1
|
||||
func spawn():
|
||||
myColor = allColor.gradient.sample(randf())
|
||||
setColor(myColor)
|
||||
|
||||
func ai():
|
||||
rotation_degrees += 1
|
||||
PresetBulletAI.lockLauncher(self, launcher, true)
|
||||
|
||||
func setColor(color: Color):
|
||||
leave1.modulate = Color(color) * 2
|
||||
leave2.modulate = Color(color) * 4
|
||||
leave3.modulate = Color(color) * 8
|
||||
leave4.modulate = Color.WHITE * 16
|
||||
@@ -5,13 +5,19 @@ func register():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 2000
|
||||
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.25
|
||||
attackCooldownMap[0] = 100
|
||||
attackCooldownMap[1] = 100
|
||||
func spawn():
|
||||
texture.play("walk")
|
||||
func ai():
|
||||
PresetEntityAI.follow(self, currentFocusedBoss, 0)
|
||||
tryAttack(0)
|
||||
tryAttack(1)
|
||||
func attack(type):
|
||||
var weaponPos = findWeaponAnchor("normal")
|
||||
if type == 0:
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/ArrowSeven.tscn"), self, weaponPos, deg_to_rad(randf_range(0, 360))):
|
||||
bullet.tracer = currentFocusedBoss
|
||||
elif type == 1:
|
||||
for bullet in BulletBase.generate(preload("res://components/Bullets/BossAttack/Bear/SunDance.tscn"), self, weaponPos, deg_to_rad(randf_range(0, 360))):
|
||||
bullet.damage = 1
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user