diff --git a/render/shader/after_image.gdshader b/render/shader/after_image.gdshader index 12bb21d..ec09ea1 100644 --- a/render/shader/after_image.gdshader +++ b/render/shader/after_image.gdshader @@ -10,5 +10,5 @@ void fragment() { //col.rgb = mix(vec3(0.0), col.rgb, alpha * 0.5); col.rgb = mix(vec3(dot(vec3(1.0), col.rgb) * 0.33333), col.rgb, alpha); ALBEDO = col.rgb; - ALPHA = alpha; + ALPHA = alpha * 0.5; } diff --git a/render/texture/particle/shape/flare7.png b/render/texture/particle/shape/flare7.png new file mode 100644 index 0000000..4528cd4 Binary files /dev/null and b/render/texture/particle/shape/flare7.png differ diff --git a/render/texture/particle/shape/flare7.png.import b/render/texture/particle/shape/flare7.png.import new file mode 100644 index 0000000..43a73fa --- /dev/null +++ b/render/texture/particle/shape/flare7.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddgscopu6xk3e" +path="res://.godot/imported/flare7.png-4017e3b2091aa46dc4637305c5e8251c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://render/texture/particle/shape/flare7.png" +dest_files=["res://.godot/imported/flare7.png-4017e3b2091aa46dc4637305c5e8251c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=0 +compress/normal_map=2 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=false +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=0 diff --git a/scene/effect/particle/particle_warn_normal.tscn b/scene/effect/particle/particle_warn_normal.tscn index 49c25d4..342e516 100644 --- a/scene/effect/particle/particle_warn_normal.tscn +++ b/scene/effect/particle/particle_warn_normal.tscn @@ -3,12 +3,11 @@ [ext_resource type="Script" path="res://script/effect/particle.gd" id="1_4fbrb"] [ext_resource type="Shader" path="res://render/shader/particle.gdshader" id="2_j7csm"] [ext_resource type="Texture2D" uid="uid://0bc1rnv1shnn" path="res://render/texture/particle/shape/circle3.png" id="3_rqs4m"] -[ext_resource type="Texture2D" uid="uid://g2030mlk6npf" path="res://render/texture/particle/shape/flare4.png" id="4_xp1yk"] +[ext_resource type="Texture2D" uid="uid://ddgscopu6xk3e" path="res://render/texture/particle/shape/flare7.png" id="4_d5yic"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_fvph4"] render_priority = 0 shader = ExtResource("2_j7csm") -shader_parameter/is_billboard = false shader_parameter/tex_main = ExtResource("3_rqs4m") [sub_resource type="Curve" id="Curve_fuavy"] @@ -38,14 +37,13 @@ sub_emitter_amount_at_end = 1 [sub_resource type="QuadMesh" id="QuadMesh_70aem"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_0r62o"] -render_priority = 0 +render_priority = 10 shader = ExtResource("2_j7csm") -shader_parameter/is_billboard = false -shader_parameter/tex_main = ExtResource("4_xp1yk") +shader_parameter/tex_main = ExtResource("4_d5yic") [sub_resource type="Curve" id="Curve_dso35"] -_data = [Vector2(0, 0.786236), 0.0, 2.24107, 0, 1, Vector2(0.0953846, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -1.10544, 0.0, 1, 0] -point_count = 3 +_data = [Vector2(0, 0.786236), 0.0, 1.38947, 0, 1, Vector2(0.153846, 1), 0.0, 0.0, 0, 0, Vector2(0.741538, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -3.86905, 0.0, 1, 0] +point_count = 4 [sub_resource type="CurveTexture" id="CurveTexture_f0x81"] curve = SubResource("Curve_dso35") @@ -59,14 +57,16 @@ gradient = SubResource("Gradient_c5xhr") [sub_resource type="Curve" id="Curve_6goqw"] max_value = 2.0 -_data = [Vector2(0, 0.627893), 0.0, 15.9262, 0, 1, Vector2(0.0861538, 2), 0.0, 0.0, 0, 0, Vector2(0.950769, 0), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 1, 0] -point_count = 4 +_data = [Vector2(0, 0), 0.0, 5.6, 0, 0, Vector2(0.32, 2), 0.0, 0.0, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0] +point_count = 3 [sub_resource type="CurveTexture" id="CurveTexture_3g7q4"] curve = SubResource("Curve_6goqw") [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_o28ow"] particle_flag_disable_z = true +angle_min = 1.07288e-05 +angle_max = 360.0 gravity = Vector3(0, 0, 0) scale_curve = SubResource("CurveTexture_3g7q4") color_ramp = SubResource("GradientTexture1D_3qqjy") diff --git a/script/_global/enum.gd b/script/_global/enum.gd index abd049c..9c8bae6 100644 --- a/script/_global/enum.gd +++ b/script/_global/enum.gd @@ -20,4 +20,4 @@ enum EGlobalEffect {CameraSize, CameraShake, ColorShift, Blur, SpeedLine} enum EAIRoleType {None, Saber, Assassin, Caster} enum ESkillWarnType {None, Normal, Mid, Heavy} enum EMaterial {None, Cloth, Steel} -enum EPtType {HP,MP,Money} \ No newline at end of file +enum EPtType {HP, MP, Money} \ No newline at end of file diff --git a/script/character/battle.gd b/script/character/battle.gd index 59192fd..d5dc116 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -274,12 +274,10 @@ func add_attack(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResul 1: particle_hit = ResourceManager.particle_hit_blunt_normal 2: particle_hit = ResourceManager.particle_hit_blunt_mid 3: particle_hit = ResourceManager.particle_hit_blunt_heavy - Enum.EDamageType.Ground: - particle_hit = ResourceManager.particle_hit_ground _: pass if particle_hit: character_to.cast_particle(particle_hit, false) - + #受击材质特效 if (damage > 0) and (break_level_sub > 2): var material: Enum.EMaterial = cfg_to.material_on if has_shield else cfg_to.material_off diff --git a/script/character/buff.gd b/script/character/buff.gd index afabd82..ef11523 100644 --- a/script/character/buff.gd +++ b/script/character/buff.gd @@ -96,13 +96,8 @@ func on_start_floating(rate)->void: func on_update_floating(rate) -> void: if not status.is_on_floor or status.is_rising: return - if has_buff("hit_down"): - battle.add_attack(character.id(), character.id(), status.move_dir, ResourceManager.cfg_attack_rebound) - remove_buff("hit_down") - else: - remove_buff("floating") - add_buff("stagger", 3) - return + remove_buff("floating") + add_buff("stagger", 3) func on_end_floating(rate)->void: status.is_floating = false diff --git a/script/character/move.gd b/script/character/move.gd index 149e8ed..bb246ba 100644 --- a/script/character/move.gd +++ b/script/character/move.gd @@ -21,7 +21,7 @@ func _process(delta) -> void: var is_hit_floor: bool = update_on_floor(delta) update_move(delta) update_speed_y(delta) - character.move_and_slide() + update_move_check(delta) status.velocity_change = character.velocity.abs() - velocity_cache velocity_cache = character.velocity.abs() if character.velocity: @@ -99,6 +99,28 @@ func update_move_effect(delta): effect.cast_after_image(after_image_alpha) +func update_move_check(delta): + var velocity: Vector3 = character.velocity + character.move_and_slide() + if status.is_stagger: + var collision_count: int = character.get_slide_collision_count() + if collision_count > 0: + var normal: Vector3 = Vector3.ZERO + for i in collision_count: + var collision: KinematicCollision3D = character.get_slide_collision(i) + normal += collision.get_normal() + normal = normal.normalized() + var normal_speed: float = velocity.dot(normal) + if normal_speed < -6: + #墙体互动 + character.velocity = velocity - normal * normal_speed * 2 + character.add_buff("floating", -1) + elif normal_speed <-2: + #反弹 + character.velocity = velocity - normal * normal_speed * 1.5 + character.add_buff("floating", -1) + + func jump(): character.velocity.y = status.cfg.move.jump_velocity status.is_jumped = true diff --git a/script/manager/effect_manager.gd b/script/manager/effect_manager.gd index 3674a8c..0c0bd9a 100644 --- a/script/manager/effect_manager.gd +++ b/script/manager/effect_manager.gd @@ -1,8 +1,16 @@ extends Node3D func _ready(): + #Global.character_mgr = self SignalManager.effect_create.connect(on_effect_create) func on_effect_create(effect: Node3D): add_child(effect) + + +func cast_particle(resource: Resource, pos: Vector3, rotation = Vector3.ZERO): + var new_particle: Particle = resource.instantiate() as Particle + new_particle.position = pos + new_particle.rotation = rotation + add_child(new_particle)