diff --git a/render/material/character.tres b/render/material/character.tres new file mode 100644 index 0000000..bb9262d --- /dev/null +++ b/render/material/character.tres @@ -0,0 +1,8 @@ +[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://c8r7kifl8faqr"] + +[ext_resource type="Shader" path="res://render/shader/character.gdshader" id="1_ja5hr"] + +[resource] +render_priority = 0 +shader = ExtResource("1_ja5hr") +shader_parameter/flash_white = null diff --git a/shader/character.gdshader b/render/shader/character.gdshader similarity index 65% rename from shader/character.gdshader rename to render/shader/character.gdshader index 6fc43fc..251a928 100644 --- a/shader/character.gdshader +++ b/render/shader/character.gdshader @@ -2,11 +2,13 @@ shader_type spatial; render_mode depth_prepass_alpha,unshaded; uniform sampler2D tex : source_color,filter_nearest; +uniform float flash_white; void fragment() { vec4 col = texture(tex, UV); - if(col.a<0.5){ - discard; + if(col.a<0.5){discard;} + if(flash_white>0.0){ + col.rgb = col.rgb * (flash_white + 1.0) * vec3(1,1,1); } ALBEDO = col.rgb; ALPHA = 1.0; diff --git a/render/texture/explodeDecal.png b/render/texture/explodeDecal.png new file mode 100644 index 0000000..620fe95 Binary files /dev/null and b/render/texture/explodeDecal.png differ diff --git a/render/texture/explodeDecal.png.import b/render/texture/explodeDecal.png.import new file mode 100644 index 0000000..c252f30 --- /dev/null +++ b/render/texture/explodeDecal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjv7f83tdgq17" +path="res://.godot/imported/explodeDecal.png-f644d5db8c0778f842c076bf4d5a2eb8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://render/texture/explodeDecal.png" +dest_files=["res://.godot/imported/explodeDecal.png-f644d5db8c0778f842c076bf4d5a2eb8.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/render/texture/swordDecal.png b/render/texture/swordDecal.png new file mode 100644 index 0000000..80cd02e Binary files /dev/null and b/render/texture/swordDecal.png differ diff --git a/render/texture/swordDecal.png.import b/render/texture/swordDecal.png.import new file mode 100644 index 0000000..5049424 --- /dev/null +++ b/render/texture/swordDecal.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ceu7b4nuktlgy" +path="res://.godot/imported/swordDecal.png-cb01b48f8d07246ce447a89d9248f176.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://render/texture/swordDecal.png" +dest_files=["res://.godot/imported/swordDecal.png-cb01b48f8d07246ce447a89d9248f176.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/resource/animation/character/_design_hero01.png.import b/resource/animation/character/_design_hero01.png.import index 25ebf61..621d679 100644 --- a/resource/animation/character/_design_hero01.png.import +++ b/resource/animation/character/_design_hero01.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/_design_hero01_flat.png.import b/resource/animation/character/_design_hero01_flat.png.import index 44d30b2..ed54076 100644 --- a/resource/animation/character/_design_hero01_flat.png.import +++ b/resource/animation/character/_design_hero01_flat.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/_design_monster.png.import b/resource/animation/character/_design_monster.png.import index f404804..d8d8262 100644 --- a/resource/animation/character/_design_monster.png.import +++ b/resource/animation/character/_design_monster.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/basic_move.png.import b/resource/animation/character/basic_move.png.import index 823a007..9c3e63e 100644 --- a/resource/animation/character/basic_move.png.import +++ b/resource/animation/character/basic_move.png.import @@ -18,17 +18,17 @@ dest_files=["res://.godot/imported/basic_move.png-ca2a3b7e7fd156603c8676a90db561 compress/mode=0 compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 +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=true +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=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/boss01_attack.png.import b/resource/animation/character/boss01_attack.png.import index 70ca85a..52cc54c 100644 --- a/resource/animation/character/boss01_attack.png.import +++ b/resource/animation/character/boss01_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/boss01_move.png.import b/resource/animation/character/boss01_move.png.import index 537dd38..198733f 100644 --- a/resource/animation/character/boss01_move.png.import +++ b/resource/animation/character/boss01_move.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/hero01_fist_attack.png.import b/resource/animation/character/hero01_fist_attack.png.import index ba77381..d99f030 100644 --- a/resource/animation/character/hero01_fist_attack.png.import +++ b/resource/animation/character/hero01_fist_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/hero01_fist_skill01.png.import b/resource/animation/character/hero01_fist_skill01.png.import index f817805..04f8d2a 100644 --- a/resource/animation/character/hero01_fist_skill01.png.import +++ b/resource/animation/character/hero01_fist_skill01.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/hero01_long_attack.png.import b/resource/animation/character/hero01_long_attack.png.import index 0852b2e..636b1db 100644 --- a/resource/animation/character/hero01_long_attack.png.import +++ b/resource/animation/character/hero01_long_attack.png.import @@ -23,7 +23,7 @@ compress/normal_map=2 compress/channel_pack=0 mipmaps/generate=false mipmaps/limit=-1 -roughness/mode=1 +roughness/mode=0 roughness/src_normal="" process/fix_alpha_border=false process/premult_alpha=false diff --git a/resource/animation/character/hero01_long_skill02.png.import b/resource/animation/character/hero01_long_skill02.png.import index 84f52b7..5f5636a 100644 --- a/resource/animation/character/hero01_long_skill02.png.import +++ b/resource/animation/character/hero01_long_skill02.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/hero01_move.png.import b/resource/animation/character/hero01_move.png.import index 6147e4b..3108c6a 100644 --- a/resource/animation/character/hero01_move.png.import +++ b/resource/animation/character/hero01_move.png.import @@ -3,30 +3,29 @@ importer="texture" type="CompressedTexture2D" uid="uid://dkcoj30ykgfck" -path.s3tc="res://.godot/imported/hero01_move.png-bcacccbe39aeeae76a6dd3feeffec29f.s3tc.ctex" +path="res://.godot/imported/hero01_move.png-bcacccbe39aeeae76a6dd3feeffec29f.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], -"vram_texture": true +"vram_texture": false } [deps] source_file="res://resource/animation/character/hero01_move.png" -dest_files=["res://.godot/imported/hero01_move.png-bcacccbe39aeeae76a6dd3feeffec29f.s3tc.ctex"] +dest_files=["res://.godot/imported/hero01_move.png-bcacccbe39aeeae76a6dd3feeffec29f.ctex"] [params] -compress/mode=2 +compress/mode=0 compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 +compress/hdr_compression=0 +compress/normal_map=2 compress/channel_pack=0 -mipmaps/generate=true +mipmaps/generate=false mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" -process/fix_alpha_border=true +process/fix_alpha_border=false process/premult_alpha=false process/normal_map_invert_y=false process/hdr_as_srgb=false diff --git a/resource/animation/character/hero01_short_attack.png.import b/resource/animation/character/hero01_short_attack.png.import index 9576220..17569c7 100644 --- a/resource/animation/character/hero01_short_attack.png.import +++ b/resource/animation/character/hero01_short_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/hero01_short_skill01.png.import b/resource/animation/character/hero01_short_skill01.png.import index df97f06..4e7f6ae 100644 --- a/resource/animation/character/hero01_short_skill01.png.import +++ b/resource/animation/character/hero01_short_skill01.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster01_attack.png.import b/resource/animation/character/monster01_attack.png.import index 23b8ebe..5b3d572 100644 --- a/resource/animation/character/monster01_attack.png.import +++ b/resource/animation/character/monster01_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster01_move.png.import b/resource/animation/character/monster01_move.png.import index 238fe03..f23f9f9 100644 --- a/resource/animation/character/monster01_move.png.import +++ b/resource/animation/character/monster01_move.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster02_attack.png.import b/resource/animation/character/monster02_attack.png.import index f8c9e43..de5c3a1 100644 --- a/resource/animation/character/monster02_attack.png.import +++ b/resource/animation/character/monster02_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster02_move.png.import b/resource/animation/character/monster02_move.png.import index 49c3412..418abdc 100644 --- a/resource/animation/character/monster02_move.png.import +++ b/resource/animation/character/monster02_move.png.import @@ -18,17 +18,17 @@ dest_files=["res://.godot/imported/monster02_move.png-71e8627cfe4ec225664844395c compress/mode=0 compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 +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=true +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=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster03_attack.png.import b/resource/animation/character/monster03_attack.png.import index e03eb5a..a90ee67 100644 --- a/resource/animation/character/monster03_attack.png.import +++ b/resource/animation/character/monster03_attack.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/animation/character/monster03_move.png.import b/resource/animation/character/monster03_move.png.import index 836569c..a4681ce 100644 --- a/resource/animation/character/monster03_move.png.import +++ b/resource/animation/character/monster03_move.png.import @@ -31,4 +31,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/resource/ui/hud/headbar_hp.png b/resource/ui/hud/headbar_hp.png new file mode 100644 index 0000000..16d2d9f Binary files /dev/null and b/resource/ui/hud/headbar_hp.png differ diff --git a/resource/ui/hud/headbar_hp.png.import b/resource/ui/hud/headbar_hp.png.import new file mode 100644 index 0000000..5937408 --- /dev/null +++ b/resource/ui/hud/headbar_hp.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b4ly1exl0owck" +path="res://.godot/imported/headbar_hp.png-4c7bcc4d968ba9ca97f4dfd5f7a72960.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/ui/hud/headbar_hp.png" +dest_files=["res://.godot/imported/headbar_hp.png-4c7bcc4d968ba9ca97f4dfd5f7a72960.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/resource/ui/hud/headbar_hp_empty.png b/resource/ui/hud/headbar_hp_empty.png new file mode 100644 index 0000000..a0b375b Binary files /dev/null and b/resource/ui/hud/headbar_hp_empty.png differ diff --git a/resource/ui/hud/headbar_hp_empty.png.import b/resource/ui/hud/headbar_hp_empty.png.import new file mode 100644 index 0000000..6f858ae --- /dev/null +++ b/resource/ui/hud/headbar_hp_empty.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwhu1ec03t3c8" +path="res://.godot/imported/headbar_hp_empty.png-3162ff30a21804f44a538a5ac31e6fbc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/ui/hud/headbar_hp_empty.png" +dest_files=["res://.godot/imported/headbar_hp_empty.png-3162ff30a21804f44a538a5ac31e6fbc.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/resource/ui/hud/shield_icon.png b/resource/ui/hud/shield_icon.png new file mode 100644 index 0000000..75c87f8 Binary files /dev/null and b/resource/ui/hud/shield_icon.png differ diff --git a/resource/ui/hud/shield_icon.png.import b/resource/ui/hud/shield_icon.png.import new file mode 100644 index 0000000..4ab56bc --- /dev/null +++ b/resource/ui/hud/shield_icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvaylj7jl2n0c" +path="res://.godot/imported/shield_icon.png-4b43321b9822c003c4aa51e5d91caecc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/ui/hud/shield_icon.png" +dest_files=["res://.godot/imported/shield_icon.png-4b43321b9822c003c4aa51e5d91caecc.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/character/character.tscn b/scene/character/character.tscn index a70b54d..0433991 100644 --- a/scene/character/character.tscn +++ b/scene/character/character.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://script/character/character.gd" id="1_tonbs"] [ext_resource type="Script" path="res://script/character/status.gd" id="2_txdip"] -[ext_resource type="Shader" path="res://shader/character.gdshader" id="3_j0vnf"] +[ext_resource type="Shader" path="res://render/shader/character.gdshader" id="3_ed424"] [ext_resource type="SpriteFrames" uid="uid://ce83cuqwgwwi4" path="res://resource/animation/character/hero01_long_attack.aseprite" id="3_q8i10"] [ext_resource type="Script" path="res://script/character/move.gd" id="4_66r53"] [ext_resource type="Texture2D" uid="uid://daqn6aqfp1hva" path="res://resource/animation/character/hero01_long_attack.png" id="4_fcd8a"] @@ -16,7 +16,8 @@ [sub_resource type="ShaderMaterial" id="ShaderMaterial_3u7mw"] render_priority = 0 -shader = ExtResource("3_j0vnf") +shader = ExtResource("3_ed424") +shader_parameter/flash_white = null shader_parameter/tex = ExtResource("4_fcd8a") [node name="Character" type="CharacterBody3D"] @@ -36,6 +37,7 @@ break_level = 4 [node name="View" type="AnimatedSprite3D" parent="."] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1.414, 0, 0, 0, 1, 0, 0.376646, 0) +layers = 524288 material_override = SubResource("ShaderMaterial_3u7mw") lod_bias = 0.001 gi_mode = 0 diff --git a/scene/launcher.tscn b/scene/launcher.tscn index 35df9ea..d440e77 100644 --- a/scene/launcher.tscn +++ b/scene/launcher.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=3 uid="uid://bkhnhc6bk3w7l"] +[gd_scene load_steps=11 format=3 uid="uid://bkhnhc6bk3w7l"] [ext_resource type="Script" path="res://script/manager/game_manager.gd" id="1_q2t80"] [ext_resource type="ArrayMesh" uid="uid://cap7t5iwpjpi2" path="res://resource/level/levelground0000.vox" id="1_u51ir"] @@ -6,6 +6,9 @@ [ext_resource type="Resource" uid="uid://dmfh54jffhx28" path="res://config/character/monster02.tres" id="3_t5dvy"] [ext_resource type="Script" path="res://script/manager/character_manager.gd" id="4_oonkb"] [ext_resource type="Script" path="res://script/editor_tool/editor_tool.gd" id="5_n3qhi"] +[ext_resource type="PackedScene" uid="uid://cc525u8auypjf" path="res://scene/ui/profile_screen.tscn" id="6_u1fxn"] +[ext_resource type="PackedScene" uid="uid://126wph4owvoy" path="res://scene/ui/hud_screen.tscn" id="7_gx646"] +[ext_resource type="Texture2D" uid="uid://bjv7f83tdgq17" path="res://render/texture/explodeDecal.png" id="7_hqv3v"] [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_2mxa4"] data = PackedVector3Array(-6.4, 0, -6.4, -3.2, 0, -6.4, -3.2, 0, 6.4, -3.2, 0, 6.4, -6.4, 0, 6.4, -6.4, 0, -6.4, -3.2, 0, 3.2, 6.4, 0, 3.2, 6.4, 0, 6.4, 6.4, 0, 6.4, -3.2, 0, 6.4, -3.2, 0, 3.2, -3.2, 0, -3.2, 3.2, 0, -3.2, 3.2, 0, 3.2, 3.2, 0, 3.2, -3.2, 0, 3.2, -3.2, 0, -3.2, -3.2, 0, -6.4, 6.4, 0, -6.4, 6.4, 0, -3.2, 6.4, 0, -3.2, -3.2, 0, -3.2, -3.2, 0, -6.4, 3.2, 0, -3.2, 6.4, 0, -3.2, 6.4, 0, 3.2, 6.4, 0, 3.2, 3.2, 0, 3.2, 3.2, 0, -3.2, -3.2, -0.1, 6.4, -3.2, -0.1, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, 6.4, -3.2, -0.1, 6.4, 6.4, -0.1, 6.4, 6.4, -0.1, 3.2, -3.2, -0.1, 3.2, -3.2, -0.1, 3.2, -3.2, -0.1, 6.4, 6.4, -0.1, 6.4, 3.2, -0.1, 3.2, 3.2, -0.1, -3.2, -3.2, -0.1, -3.2, -3.2, -0.1, -3.2, -3.2, -0.1, 3.2, 3.2, -0.1, 3.2, 6.4, -0.1, -3.2, 6.4, -0.1, -6.4, -3.2, -0.1, -6.4, -3.2, -0.1, -6.4, -3.2, -0.1, -3.2, 6.4, -0.1, -3.2, 6.4, -0.1, 3.2, 6.4, -0.1, -3.2, 3.2, -0.1, -3.2, 3.2, -0.1, -3.2, 3.2, -0.1, 3.2, 6.4, -0.1, 3.2, -6.4, 0, -6.4, -6.4, 0, 6.4, -6.4, -0.1, 6.4, -6.4, -0.1, 6.4, -6.4, -0.1, -6.4, -6.4, 0, -6.4, 6.4, 0, -6.4, 6.4, -0.1, -6.4, 6.4, -0.1, 6.4, 6.4, -0.1, 6.4, 6.4, 0, 6.4, 6.4, 0, -6.4, -6.4, -0.1, 6.4, -6.4, 0, 6.4, 6.4, 0, 6.4, 6.4, 0, 6.4, 6.4, -0.1, 6.4, -6.4, -0.1, 6.4, 6.4, 0, -6.4, -6.4, 0, -6.4, -6.4, -0.1, -6.4, -6.4, -0.1, -6.4, 6.4, -0.1, -6.4, 6.4, 0, -6.4) @@ -50,5 +53,18 @@ use_collision = true unique_name_in_owner = true script = ExtResource("4_oonkb") +[node name="UIManager" type="Node3D" parent="GameManager"] + +[node name="ProfileScreen" parent="GameManager/UIManager" instance=ExtResource("6_u1fxn")] + +[node name="HudScreen" parent="GameManager/UIManager" instance=ExtResource("7_gx646")] + [node name="EditorTool" type="Node3D" parent="."] script = ExtResource("5_n3qhi") + +[node name="Decal" type="Decal" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.924324, -0.0136981, 0) +size = Vector3(0.5, 0.5, 0.5) +texture_albedo = ExtResource("7_hqv3v") +modulate = Color(0, 0, 0, 1) +cull_mask = 1 diff --git a/scene/ui/hud_screen.tscn b/scene/ui/hud_screen.tscn new file mode 100644 index 0000000..c4fd77c --- /dev/null +++ b/scene/ui/hud_screen.tscn @@ -0,0 +1,39 @@ +[gd_scene load_steps=3 format=3 uid="uid://126wph4owvoy"] + +[ext_resource type="Texture2D" uid="uid://cwhu1ec03t3c8" path="res://resource/ui/hud/headbar_hp_empty.png" id="1_flgf6"] +[ext_resource type="Texture2D" uid="uid://b4ly1exl0owck" path="res://resource/ui/hud/headbar_hp.png" id="2_sktwb"] + +[node name="HudScreen" type="CanvasLayer"] + +[node name="HudPage" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="Player" type="Control" parent="HudPage"] +anchors_preset = 0 +offset_left = 29.0 +offset_top = 29.0 +offset_right = 29.0 +offset_bottom = 29.0 + +[node name="HpBar" type="TextureProgressBar" parent="HudPage/Player"] +layout_mode = 0 +offset_left = -13.0 +offset_top = -13.0 +offset_right = 51.0 +offset_bottom = 3.0 +value = 50.0 +stretch_margin_left = 10 +stretch_margin_top = 10 +stretch_margin_right = 10 +stretch_margin_bottom = 10 +texture_under = ExtResource("1_flgf6") +texture_progress = ExtResource("2_sktwb") + +[node name="HeadBarPage" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 diff --git a/scene/ui/profile_screen.tscn b/scene/ui/profile_screen.tscn new file mode 100644 index 0000000..46c03e4 --- /dev/null +++ b/scene/ui/profile_screen.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=2 format=3 uid="uid://cc525u8auypjf"] + +[ext_resource type="Script" path="res://script/ui/profile/fps.gd" id="1_ay6sg"] + +[node name="ProfileScreen" type="CanvasLayer"] + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -41.0 +offset_bottom = 56.0 +grow_horizontal = 0 +size_flags_horizontal = 8 +size_flags_vertical = 0 + +[node name="FPS" type="Label" parent="VBoxContainer"] +layout_mode = 2 +text = "123" +script = ExtResource("1_ay6sg") diff --git a/script/character/battle.gd b/script/character/battle.gd index 6466158..48535b6 100644 --- a/script/character/battle.gd +++ b/script/character/battle.gd @@ -65,10 +65,11 @@ func settle(hit_info:HitInfo): character_to.add_buff("hit_up",attack.hit_up_duration) #抖动 - character_to.add_buff("shake_x",0.2) + character_to.add_buff("shake_x",0.2,true) + + #闪白 + character_to.add_buff("flash_white",0.1) #卡帧 character_from.add_buff("pause",0.1) character_to.add_buff("pause",0.1) - - diff --git a/script/character/buff.gd b/script/character/buff.gd index c4971a0..53e42a6 100644 --- a/script/character/buff.gd +++ b/script/character/buff.gd @@ -8,17 +8,20 @@ class BuffInfo: var name : String var duration_max : float var duration : float + var ignore_pause : bool var buff_map = {} #命中信息 func _process(delta): for buff_name in buff_map: var buff_info = buff_map[buff_name] - if has_buff("pause") and buff_name!="pause": + if has_buff("pause") and buff_name!="pause" and !buff_info.ignore_pause: continue if buff_info.duration_max == -1: trigger_buff_effect(buff_info,"update") else: + if buff_info.duration == 0: + trigger_buff_effect(buff_info,"second") buff_info.duration += delta if buff_info.duration >= buff_info.duration_max: trigger_buff_effect(buff_info,"end") @@ -36,7 +39,7 @@ func trigger_buff_effect(buff:BuffInfo,trigger_name:String): func has_buff(buff_name:String) -> bool: return buff_name in buff_map -func add_buff(buff_name:String,duration:float): +func add_buff(buff_name:String,duration:float,ignore_pause:bool=false): var buff : BuffInfo if buff_name in buff_map: buff = buff_map[buff_name] @@ -46,28 +49,34 @@ func add_buff(buff_name:String,duration:float): buff_map[buff_name] = buff buff.duration_max = duration buff.duration = 0 + buff.ignore_pause = ignore_pause trigger_buff_effect(buff,"start") func remove_buff(buff_name:String): buff_map.erase(buff_name) #==具体实现== +#位移 func on_end_hit_back(rate):status.hit_back_speed = 0 func on_end_hit_up(rate):status.hit_up_speed = 0 -func on_start_stagger(rate):status.is_stagger = true -func on_end_stagger(rate):status.is_stagger = false -func on_end_stun(rate):status.is_stun = false func on_start_jumping(rate):status.is_jumping = true func on_end_jumping(rate):status.is_jumping = false -func on_update_shake_x(rate): - var offset = sin(rate * PI * 4) - 0.5 - status.shake_offset = Vector3(offset*0.02,0,0); -func on_end_shake_x(rate):status.shake_offset = Vector3.ZERO -func on_start_pause(rate):status.is_pause = true -func on_end_pause(rate):status.is_pause = false func on_start_floating(rate):status.is_floating = true func on_update_floating(rate): if status.is_on_floor: #反弹 status.is_floating=false - + +#战斗状态 +func on_start_stagger(rate):status.is_stagger = true +func on_end_stagger(rate):status.is_stagger = false +func on_end_stun(rate):status.is_stun = false + +#表现 +func on_start_flash_white(rate):status.flash_white_rate = 1 +func on_update_flash_white(rate):status.flash_white_rate = 1 - rate +func on_end_flash_white(rate):status.flash_white_rate = 0 +func on_second_pause(rate):status.is_pause = true +func on_end_pause(rate):status.is_pause = false +func on_update_shake_x(rate):status.shake_offset = Vector3((sin(rate * PI * 4) - 0.5)*0.02,0,0); +func on_end_shake_x(rate):status.shake_offset = Vector3.ZERO diff --git a/script/character/character.gd b/script/character/character.gd index 6c84f2c..a02f775 100644 --- a/script/character/character.gd +++ b/script/character/character.gd @@ -33,6 +33,9 @@ func build_battle(cfg:CharacterCfg): status.shield = cfg.shield_max status.shield_max = cfg.shield_max +func set_material(material:ShaderMaterial): + view.material_override = material + #==getter== func manager()->CharacterManager:return character_manager func id()->int:return status.id @@ -41,7 +44,7 @@ func pos()->Vector2:return Vector2(position.x,position.z) #==interface== func set_pos(pos:Vector3):position = pos -func add_buff(buff_name:String,duration:float):buff.add_buff(buff_name,duration) +func add_buff(buff_name:String,duration:float,ignore_pause:bool=false):buff.add_buff(buff_name,duration,ignore_pause) func set_hit_move(hit_back_dir:Vector2,hit_back_speed:float,hit_up_speed:float): status.hit_back_dir = hit_back_dir status.hit_back_speed = hit_back_speed diff --git a/script/character/status.gd b/script/character/status.gd index 0ebcecc..88f0577 100644 --- a/script/character/status.gd +++ b/script/character/status.gd @@ -19,6 +19,7 @@ class_name Status @export var basic_offset : Vector3 #基本偏移值 @export var shake_offset : Vector3 #抖动偏移值 @export var is_pause : bool #是否暂停 +@export var flash_white_rate : float #闪白比例 @export_category("移动状态") @export var move_dir : Vector2 #移动方向 diff --git a/script/character/view.gd b/script/character/view.gd index fb975fb..eaa51fd 100644 --- a/script/character/view.gd +++ b/script/character/view.gd @@ -57,13 +57,16 @@ func _ready(): trans("ground1_loop","ground2","is_stagger","=",false) run("ground2","idle_loop") - - func _process(delta): + update_view() + if not status.is_skill_running and status.is_pause == is_playing(): + if status.is_pause:pause(); + else:play(); if status.is_pause:return update_flip() - update_view() update_trans(false) + update_texture() + update_flash_white() func init(default:SpriteFrames): sprite_frames = default @@ -127,3 +130,12 @@ func update_view(): func _on_animation_finished(): update_trans(true) +func update_texture(): + var tex = sprite_frames.get_frame_texture(animation,frame) + var material = material_override as ShaderMaterial + material.set_shader_parameter("tex",tex) + +func update_flash_white(): + var material = material_override as ShaderMaterial + material.set_shader_parameter("flash_white",status.flash_white_rate) + diff --git a/script/manager/character_manager.gd b/script/manager/character_manager.gd index cb7be8a..9aacbab 100644 --- a/script/manager/character_manager.gd +++ b/script/manager/character_manager.gd @@ -3,6 +3,7 @@ class_name CharacterManager var scene_player = preload("res://scene/character/player.tscn") var scene_monster = preload("res://scene/character/monster.tscn") +var character_material = preload("res://render/material/character.tres") var character_map = {} var character_idx : int = 0 @@ -20,6 +21,7 @@ func create_character(cfg:CharacterCfg,team:Enum.ETeam,pos:Vector3): character_idx += 1 character_map[character_idx]=character character.init(self,character_idx,cfg,team) + character.set_material(character_material.duplicate()) character.set_pos(pos) func get_character(id:int) -> Character: diff --git a/script/ui/profile/fps.gd b/script/ui/profile/fps.gd new file mode 100644 index 0000000..cb3de2c --- /dev/null +++ b/script/ui/profile/fps.gd @@ -0,0 +1,4 @@ +extends Label + +func _process(delta): + set_text("FPS %d" % Engine.get_frames_per_second())