mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(战斗系统): 实现实体格挡效果并增强武器伤害配置
添加ParryEntity效果,用于实体格挡时的视觉表现 修改Tree武器攻击逻辑,增加基础伤害配置 优化Parrier子弹格挡逻辑,修正效果生成位置
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://61vnckgx6x28"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bwbhxnuhmkwww" path="res://components/Effects/Parry.tscn" id="1_2mq06"]
|
||||
[ext_resource type="Script" uid="uid://btj8sxcc0m28q" path="res://scripts/Contents/Effects/ParryEntity.gd" id="2_7dupr"]
|
||||
[ext_resource type="AudioStream" uid="uid://23ttwefh4ej2" path="res://resources/sounds/effect/arrowshot.mp3" id="2_vfg08"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_471em"]
|
||||
_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_tu1jt"]
|
||||
curve = SubResource("Curve_471em")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_f5km5"]
|
||||
_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_molrd"]
|
||||
curve = SubResource("Curve_f5km5")
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_vfg08"]
|
||||
colors = PackedColorArray(1, 0.23036289, 0.23036289, 1, 0.58383155, 0, 0, 1)
|
||||
|
||||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_7dupr"]
|
||||
gradient = SubResource("Gradient_vfg08")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_pg3k8"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 3
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_tys76"]
|
||||
curve = SubResource("Curve_pg3k8")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rs11f"]
|
||||
particle_flag_disable_z = true
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 22.49
|
||||
angle_min = 1.0728835e-05
|
||||
angle_max = 360.00003
|
||||
angle_curve = SubResource("CurveTexture_molrd")
|
||||
direction = Vector3(-1, 0, 0)
|
||||
initial_velocity_max = 2000.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
damping_min = 1000.00006
|
||||
damping_max = 1000.00006
|
||||
scale_min = 0.19999999
|
||||
scale_max = 0.59999996
|
||||
scale_curve = SubResource("CurveTexture_tys76")
|
||||
color_initial_ramp = SubResource("GradientTexture1D_7dupr")
|
||||
alpha_curve = SubResource("CurveTexture_tu1jt")
|
||||
|
||||
[node name="ParryEntity" instance=ExtResource("1_2mq06")]
|
||||
script = ExtResource("2_7dupr")
|
||||
|
||||
[node name="spawn" parent="sounds" index="0"]
|
||||
stream = ExtResource("2_vfg08")
|
||||
volume_db = 10.0
|
||||
|
||||
[node name="particles" parent="." index="1"]
|
||||
process_material = SubResource("ParticleProcessMaterial_rs11f")
|
||||
|
||||
[node name="texture" parent="stage" index="1"]
|
||||
modulate = Color(1, 1, 1, 1)
|
||||
@@ -23,11 +23,11 @@ func spawn():
|
||||
func succeedToHit(_dmg: float, entity: EntityBase):
|
||||
if parryiedTimes < maxParryTimes:
|
||||
parryiedTimes += 1
|
||||
var eff = EffectController.create(ComponentManager.getEffect("Parry"), entity.position)
|
||||
eff.rotation = position.angle_to_point(entity.position)
|
||||
var effSpawn = entity.texture.global_position
|
||||
var eff = EffectController.create(ComponentManager.getEffect("ParryEntity"), effSpawn)
|
||||
eff.rotation = position.angle_to_point(effSpawn)
|
||||
eff.shot()
|
||||
launcher.impluse((position - entity.position).normalized() * 600)
|
||||
entity.impluse((entity.position - position).normalized() * 600)
|
||||
entity.impluse((effSpawn - position).normalized() * 600)
|
||||
func hitBullet(bullet: BulletBase): # 当前子弹与其他子弹相撞
|
||||
if BulletTool.canDamage(bullet, launcher): # 其他子弹可以使当前子弹的发射者受伤吗?
|
||||
if parryiedTimes < maxParryTimes && MathTool.rate(parryRate): # 一个刀光最多格挡多少个敌方子弹?
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
extends ParryEffect
|
||||
class_name ParryEntityEffect
|
||||
|
||||
func beforeShot():
|
||||
CameraManager.shake(100, 200)
|
||||
@@ -0,0 +1 @@
|
||||
uid://btj8sxcc0m28q
|
||||
@@ -19,4 +19,5 @@ func attack(entity: EntityBase):
|
||||
bullet.maxParryTimes = readStore("count")
|
||||
bullet.maxBallCount = readStore("max")
|
||||
bullet.reflectRate = readStore("rate")
|
||||
bullet.baseDamage = readStore("atk")
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user