mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
feat(武器): 添加钢管武器蓄力特效和音效
- 为钢管武器添加蓄力粒子效果 - 新增钢管落地音效资源 - 修改钢管子弹碰撞形状为圆形 - 添加钢管武器能量消耗和冷却时间配置 - 实现钢管子弹销毁时的落地效果
This commit is contained in:
@@ -15,8 +15,8 @@ animations = [{
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_j5ir5"]
|
||||
size = Vector2(162, 12)
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_vcs8c"]
|
||||
radius = 83.00603
|
||||
|
||||
[node name="Pipe" instance=ExtResource("1_3h25n")]
|
||||
script = ExtResource("2_vcs8c")
|
||||
@@ -29,4 +29,4 @@ scale = Vector2(0.27, 0.27)
|
||||
sprite_frames = SubResource("SpriteFrames_vcs8c")
|
||||
|
||||
[node name="hitbox" parent="." index="1"]
|
||||
shape = SubResource("RectangleShape2D_j5ir5")
|
||||
shape = SubResource("CircleShape2D_vcs8c")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://dky8574uqc18r"]
|
||||
[gd_scene load_steps=20 format=3 uid="uid://dky8574uqc18r"]
|
||||
|
||||
[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"]
|
||||
@@ -10,6 +10,43 @@
|
||||
[ext_resource type="Texture2D" uid="uid://fn8qx72clh38" path="res://resources/characters/cock/rooster-a.svg" id="8_da2ca"]
|
||||
[ext_resource type="Texture2D" uid="uid://ci2ik43ce82uy" path="res://resources/characters/cock/rooster-b.svg" id="9_0omr3"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_da2ca"]
|
||||
_data = [Vector2(0.5, 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_0omr3"]
|
||||
curve = SubResource("Curve_da2ca")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_joj4g"]
|
||||
_limits = [-360.0, 1.0, 0.0, 1.0]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, -360), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_jluqw"]
|
||||
curve = SubResource("Curve_joj4g")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_0omr3"]
|
||||
_data = [Vector2(0.5, 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_joj4g"]
|
||||
curve = SubResource("Curve_0omr3")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_joj4g"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 300.0
|
||||
angle_min = 1.0728835e-05
|
||||
angle_max = 360.00003
|
||||
angle_curve = SubResource("CurveTexture_jluqw")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
radial_accel_min = -200.0
|
||||
radial_accel_max = -100.0
|
||||
scale_min = 7.0
|
||||
scale_max = 10.0
|
||||
scale_curve = SubResource("CurveTexture_joj4g")
|
||||
alpha_curve = SubResource("CurveTexture_0omr3")
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_4v2ol"]
|
||||
animations = [{
|
||||
"frames": [],
|
||||
@@ -55,7 +92,13 @@ useStatic = true
|
||||
metadata/_edit_horizontal_guides_ = [-188.0]
|
||||
metadata/_edit_vertical_guides_ = [71.0]
|
||||
|
||||
[node name="weaponStore" parent="." index="1"]
|
||||
[node name="chargeParticle" type="GPUParticles2D" parent="." index="0"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -54)
|
||||
amount = 100
|
||||
process_material = SubResource("ParticleProcessMaterial_joj4g")
|
||||
|
||||
[node name="weaponStore" parent="." index="2"]
|
||||
process_mode = 4
|
||||
|
||||
[node name="Pipe" parent="weaponStore" index="0" instance=ExtResource("3_da2ca")]
|
||||
@@ -72,7 +115,7 @@ stream = ExtResource("5_xnbhq")
|
||||
[node name="hurt" parent="sounds" index="3"]
|
||||
stream = ExtResource("6_m5px1")
|
||||
|
||||
[node name="texture" parent="." index="3"]
|
||||
[node name="texture" parent="." index="4"]
|
||||
position = Vector2(0, -47)
|
||||
sprite_frames = SubResource("SpriteFrames_4v2ol")
|
||||
animation = &"walk"
|
||||
@@ -89,6 +132,6 @@ shape = SubResource("CircleShape2D_h1v0q")
|
||||
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
|
||||
position = Vector2(56, -69)
|
||||
|
||||
[node name="statebar" parent="." index="4" node_paths=PackedStringArray("entity")]
|
||||
[node name="statebar" parent="." index="5" node_paths=PackedStringArray("entity")]
|
||||
position = Vector2(0, -150)
|
||||
entity = NodePath("..")
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ukta2xq1l32k"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bcvuuy2m0pke0" path="res://components/Abstracts/EffectBase.tscn" id="1_qau47"]
|
||||
[ext_resource type="AudioStream" uid="uid://7k43qbbcim2l" path="res://resources/sounds/weapon/pipefall.mp3" id="2_4ds2m"]
|
||||
|
||||
[node name="PipeFall" instance=ExtResource("1_qau47")]
|
||||
spawnSound = "spawn"
|
||||
|
||||
[node name="spawn" parent="sounds" index="0"]
|
||||
stream = ExtResource("2_4ds2m")
|
||||
@@ -20,6 +20,8 @@ storeType = {
|
||||
}
|
||||
descriptionTemplate = "按住蓄力扔出钢管,蓄力越久伤害越高。
|
||||
基础伤害:$atk,蓄力倍率:$charge"
|
||||
needEnergy = 2.0
|
||||
cooldown = 1000.0
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("2_mmtf8")
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://7k43qbbcim2l"
|
||||
path="res://.godot/imported/pipefall.mp3-a309c798ff22faf6a524405b2ca37197.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sounds/weapon/pipefall.mp3"
|
||||
dest_files=["res://.godot/imported/pipefall.mp3-a309c798ff22faf6a524405b2ca37197.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
@@ -7,3 +7,5 @@ func ai():
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
texture.rotation += energy * (1 - lifeTimePercent()) / 100
|
||||
speed = initialSpeed * (1 - lifeTimePercent())
|
||||
func destroy(_beacuseMap: bool):
|
||||
EffectController.create(ComponentManager.getEffect("PipeFall"), position).shot()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
extends EntityBase
|
||||
class_name Rooster
|
||||
|
||||
@onready var chargeParticle: GPUParticles2D = $%chargeParticle
|
||||
|
||||
func register():
|
||||
attackCooldownMap[0] = 200
|
||||
attackCooldownMap[1] = 6000
|
||||
@@ -11,6 +13,7 @@ func register():
|
||||
elif bullet is FoxZhua:
|
||||
EffectController.create(ComponentManager.getEffect("BloodFall"), texture.global_position).shot()
|
||||
)
|
||||
chargeParticle.emitting = false
|
||||
var chargeStartTime = {}
|
||||
|
||||
func ai():
|
||||
@@ -62,6 +65,7 @@ func startCharge(weaponIndex: int):
|
||||
var weapon = weapons[weaponIndex]
|
||||
if weapon.chargable:
|
||||
chargeStartTime[weaponIndex] = Time.get_ticks_msec()
|
||||
chargeParticle.emitting = true
|
||||
func endCharge(weaponIndex: int):
|
||||
if chargeStartTime.has(weaponIndex):
|
||||
var startTime = chargeStartTime[weaponIndex]
|
||||
@@ -73,3 +77,4 @@ func endCharge(weaponIndex: int):
|
||||
if weapon.chargable:
|
||||
weapon.chargedTime = chargedTime
|
||||
tryAttack(weaponIndex)
|
||||
chargeParticle.emitting = false
|
||||
|
||||
@@ -175,7 +175,7 @@ func tryAttack(entity: EntityBase):
|
||||
entity.useEnergy(needEnergy)
|
||||
return result
|
||||
func charged(base: float, percent: float):
|
||||
return base * (1 + chargedTime / 50 * percent)
|
||||
return base * (1 + chargedTime / 75 * percent)
|
||||
|
||||
# 抽象
|
||||
func update(_to: int, origin: Dictionary, _entity: EntityBase):
|
||||
|
||||
Reference in New Issue
Block a user