diff --git a/project.godot b/project.godot index 631224a..80d9be1 100644 --- a/project.godot +++ b/project.godot @@ -38,6 +38,34 @@ enabled=PackedStringArray("res://addons/godot_super-wakatime/plugin.cfg", "res:/ navigation_mesh_source_group="" +[importer_defaults] + +texture={ +"compress/channel_pack": 0, +"compress/hdr_compression": 1, +"compress/high_quality": false, +"compress/lossy_quality": 0.7, +"compress/mode": 0, +"compress/normal_map": 0, +"compress/rdo_quality_loss": 0.0, +"compress/uastc_level": 0, +"detect_3d/compress_to": 0, +"mipmaps/generate": false, +"mipmaps/limit": -1, +"process/channel_remap/alpha": 3, +"process/channel_remap/blue": 2, +"process/channel_remap/green": 1, +"process/channel_remap/red": 0, +"process/fix_alpha_border": true, +"process/hdr_as_srgb": false, +"process/hdr_clamp_exposure": false, +"process/normal_map_invert_y": false, +"process/premult_alpha": false, +"process/size_limit": 0, +"roughness/mode": 0, +"roughness/src_normal": "" +} + [input] move_left={ diff --git a/scenes/game.tscn b/scenes/game.tscn index 0372683..7992309 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -41,7 +41,7 @@ size = Vector3(0.65, 1, 0.65) [sub_resource type="Environment" id="Environment_uwrxv"] background_mode = 1 -background_color = Color(0.21272367, 0.00026760699, 0.30778188, 1) +background_color = Color(1, 1, 1, 1) tonemap_mode = 2 volumetric_fog_enabled = true adjustment_enabled = true diff --git a/scenes/inhands/basic_hammer.tscn b/scenes/inhands/basic_hammer.tscn new file mode 100644 index 0000000..4688f13 --- /dev/null +++ b/scenes/inhands/basic_hammer.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://cjwn7j4we5gqu"] + +[ext_resource type="Texture2D" uid="uid://d1abd236mlb6" path="res://textures/weapons/inhands/basic_hammer.png" id="1_57fji"] + +[node name="Sword" type="Sprite3D" unique_id=1724644759] +offset = Vector2(0, 5.5) +pixel_size = 0.03 +shaded = true +alpha_cut = 2 +texture_filter = 0 +texture = ExtResource("1_57fji") diff --git a/scenes/inhands/basic_knife.tscn b/scenes/inhands/basic_knife.tscn new file mode 100644 index 0000000..2734aca --- /dev/null +++ b/scenes/inhands/basic_knife.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://tf0jfb52567t"] + +[ext_resource type="Texture2D" uid="uid://lb0ljo6sf7ob" path="res://textures/weapons/inhands/basic_knife.png" id="1_f4o4v"] + +[node name="Sword" type="Sprite3D" unique_id=1724644759] +offset = Vector2(0, 5.5) +pixel_size = 0.03 +shaded = true +alpha_cut = 2 +texture_filter = 0 +texture = ExtResource("1_f4o4v") diff --git a/scenes/inhands/basic_sword.tscn b/scenes/inhands/basic_sword.tscn new file mode 100644 index 0000000..4228ab0 --- /dev/null +++ b/scenes/inhands/basic_sword.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://dqiw6d5pc5dhl"] + +[ext_resource type="Texture2D" uid="uid://xufvik31gru8" path="res://textures/weapons/inhands/basic_sword.png" id="1_coycx"] + +[node name="Sword" type="Sprite3D" unique_id=1724644759] +offset = Vector2(0, 9.5) +pixel_size = 0.03 +shaded = true +alpha_cut = 2 +texture_filter = 0 +texture = ExtResource("1_coycx") diff --git a/scenes/inhands/test_sword.tscn b/scenes/inhands/test_sword.tscn new file mode 100644 index 0000000..0730f7c --- /dev/null +++ b/scenes/inhands/test_sword.tscn @@ -0,0 +1,11 @@ +[gd_scene format=3 uid="uid://cjja5um2l5s1n"] + +[ext_resource type="Texture2D" uid="uid://xufvik31gru8" path="res://textures/weapons/inhands/basic_sword.png" id="1_k8uy1"] + +[node name="Sword" type="Sprite3D" unique_id=1724644759] +offset = Vector2(0, 9.5) +pixel_size = 0.03 +shaded = true +alpha_cut = 2 +texture_filter = 0 +texture = ExtResource("1_k8uy1") diff --git a/scenes/living/dreamer_body.tscn b/scenes/living/dreamer_body.tscn index e291042..ec09cf0 100644 --- a/scenes/living/dreamer_body.tscn +++ b/scenes/living/dreamer_body.tscn @@ -4,7 +4,6 @@ [ext_resource type="Script" uid="uid://c8sptss1aulmi" path="res://scripts/dreamer_body.gd" id="1_54k0m"] [ext_resource type="Texture2D" uid="uid://3ptkafoafq14" path="res://textures/character-leg.png" id="2_54k0m"] [ext_resource type="Texture2D" uid="uid://rgxhw23471ut" path="res://textures/character-arm.png" id="3_yptk5"] -[ext_resource type="Texture2D" uid="uid://cvtipichutylm" path="res://textures/test-sword.png" id="5_54k0m"] [sub_resource type="Animation" id="Animation_gee14"] length = 0.001 @@ -188,6 +187,18 @@ tracks/14/keys = { "update": 0, "values": [Vector3(0, 0, 0)] } +tracks/15/type = "value" +tracks/15/imported = false +tracks/15/enabled = true +tracks/15/path = NodePath("Body/ArmPivot/FrontArm/HandPoint:position:z") +tracks/15/interp = 1 +tracks/15/loop_wrap = true +tracks/15/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0.0010000002] +} [sub_resource type="Animation" id="Animation_lg4u0"] resource_name = "charge_weapon" @@ -812,6 +823,18 @@ tracks/3/keys = { "update": 1, "values": [-0.011] } +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("Body/ArmPivot/FrontArm/HandPoint:position:z") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [-0.001] +} [sub_resource type="Animation" id="Animation_06ej8"] resource_name = "limbs_front" @@ -864,6 +887,18 @@ tracks/3/keys = { "update": 1, "values": [0.011] } +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("Body/ArmPivot/FrontArm/HandPoint:position:z") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0.0010000002] +} [sub_resource type="Animation" id="Animation_0tnpc"] resource_name = "move" @@ -1028,7 +1063,6 @@ filters = ["Body/ArmPivot:rotation"] [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_p57ef"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_kvpfn"] -graph_offset = Vector2(246.604, -45.23578) nodes/output/position = Vector2(3580, 40) nodes/jump/node = SubResource("AnimationNodeOneShot_u5sy4") nodes/jump/position = Vector2(860, 100) @@ -1123,16 +1157,7 @@ texture_filter = 0 texture = ExtResource("3_yptk5") [node name="HandPoint" type="Node3D" parent="Body/ArmPivot/FrontArm" unique_id=709125335] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.24, 0.001) - -[node name="Sword" type="Sprite3D" parent="Body/ArmPivot/FrontArm/HandPoint" unique_id=1523806768] -transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, 0, 0, 0) -offset = Vector2(0, 5.5) -pixel_size = 0.03 -shaded = true -alpha_cut = 2 -texture_filter = 0 -texture = ExtResource("5_54k0m") +transform = Transform3D(-4.371139e-08, -1, 0, 1, -4.371139e-08, 0, 0, 0, 1, 0, -0.24, 0.0010000002) [node name="BackArm" type="Sprite3D" parent="Body/ArmPivot" unique_id=111008142] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.089999996, 0, 0) diff --git a/scripts/dreamer_body.gd b/scripts/dreamer_body.gd index bbdd0b5..86c087d 100644 --- a/scripts/dreamer_body.gd +++ b/scripts/dreamer_body.gd @@ -4,6 +4,15 @@ extends Node3D func _ready() -> void: pass # Replace with function body. +func set_inhand(weapon_name: String) -> void: + var inhand = Global.inhands[weapon_name].instantiate() + + for n in $Body/ArmPivot/FrontArm/HandPoint.get_children(): n.queue_free() + + $Body/ArmPivot/FrontArm/HandPoint.add_child(inhand) + + inhand.position = Vector3.ZERO + inhand.rotation = Vector3.ZERO # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: diff --git a/scripts/enemies/dreamer.gd b/scripts/enemies/dreamer.gd index 4dff94d..22f2653 100644 --- a/scripts/enemies/dreamer.gd +++ b/scripts/enemies/dreamer.gd @@ -14,7 +14,7 @@ var knockback_time := 0.0 var health := 100.0 -var current_weapon := "test_sword" +var current_weapon := "basic_sword" enum { STATE_IDLE, @@ -52,6 +52,7 @@ func on_knockback(hitter: Node3D = null) -> void: func _ready() -> void: $DreamerBody/Animator.set("parameters/hold_weapon/blend_amount", 1.0) + $DreamerBody.set_inhand(current_weapon) func _process(delta: float) -> void: $DreamerBody.rotation.x = 0 diff --git a/scripts/global.gd b/scripts/global.gd index 029fea8..317d082 100644 --- a/scripts/global.gd +++ b/scripts/global.gd @@ -1,7 +1,7 @@ extends Node const weapons = { - "test_sword": { + "basic_sword": { "combo_weapon": true, "hits_to_finish": 3, "swing_time": 0.16, @@ -13,5 +13,37 @@ const weapons = { "knockback": 3.5, "knockback_mid_combo": 0.75, "stun_time": 0.4, + }, + "basic_knife": { + "combo_weapon": true, + "hits_to_finish": 10, + "swing_time": 0.06, + "combo_timeout": 0.25, + "swing_time_combo_finish": 0.66, + "damage": 20, + "damage_mid_combo": 5, + + "knockback": 2.5, + "knockback_mid_combo": 0.3, + "stun_time": 0.4, + }, + "basic_hammer": { + "combo_weapon": true, + "hits_to_finish": 2, + "swing_time": 0.6, + "combo_timeout": 1, + "swing_time_combo_finish": 1, + "damage": 35, + "damage_mid_combo": 25, + + "knockback": 5.5, + "knockback_mid_combo": 1.5, + "stun_time": 0.6, } } + +const inhands = { + "basic_sword": preload("res://scenes/inhands/basic_sword.tscn"), + "basic_hammer": preload("res://scenes/inhands/basic_hammer.tscn"), + "basic_knife": preload("res://scenes/inhands/basic_knife.tscn") +} diff --git a/scripts/player.gd b/scripts/player.gd index 8f0ed43..418612f 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -19,7 +19,7 @@ var swing_timer = 0 var queue_swing = false -var current_weapon = "test_sword" +var current_weapon = "basic_sword" @onready var game = get_parent() @onready var camera = game.get_node("PlayerCamera") @@ -46,6 +46,7 @@ func on_hit(hitter: Node3D = null) -> void: func _ready() -> void: LimboConsole.register_command(hit_me) + $DreamerBody.set_inhand(current_weapon) func _process(delta: float) -> void: diff --git a/textures/weapons/inhands/basic_hammer.png b/textures/weapons/inhands/basic_hammer.png new file mode 100644 index 0000000..e64ada1 Binary files /dev/null and b/textures/weapons/inhands/basic_hammer.png differ diff --git a/textures/weapons/inhands/basic_hammer.png.import b/textures/weapons/inhands/basic_hammer.png.import new file mode 100644 index 0000000..c5f64fd --- /dev/null +++ b/textures/weapons/inhands/basic_hammer.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1abd236mlb6" +path="res://.godot/imported/basic_hammer.png-f6a9fb81df6ee9f07b87f642d9ea7366.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/weapons/inhands/basic_hammer.png" +dest_files=["res://.godot/imported/basic_hammer.png-f6a9fb81df6ee9f07b87f642d9ea7366.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +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/textures/weapons/inhands/basic_knife.png b/textures/weapons/inhands/basic_knife.png new file mode 100644 index 0000000..cc3e154 Binary files /dev/null and b/textures/weapons/inhands/basic_knife.png differ diff --git a/textures/weapons/inhands/basic_knife.png.import b/textures/weapons/inhands/basic_knife.png.import new file mode 100644 index 0000000..3fe5dd6 --- /dev/null +++ b/textures/weapons/inhands/basic_knife.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://lb0ljo6sf7ob" +path="res://.godot/imported/basic_knife.png-1a93caa096c021d74c3a79a908c30051.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/weapons/inhands/basic_knife.png" +dest_files=["res://.godot/imported/basic_knife.png-1a93caa096c021d74c3a79a908c30051.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +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/textures/weapons/inhands/basic_spear.png b/textures/weapons/inhands/basic_spear.png new file mode 100644 index 0000000..4bfa6d3 Binary files /dev/null and b/textures/weapons/inhands/basic_spear.png differ diff --git a/textures/weapons/inhands/basic_spear.png.import b/textures/weapons/inhands/basic_spear.png.import new file mode 100644 index 0000000..8efa1bd --- /dev/null +++ b/textures/weapons/inhands/basic_spear.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5g7bhk0kj16" +path="res://.godot/imported/basic_spear.png-5e51f45d76972d56ca4fd506aabd79eb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/weapons/inhands/basic_spear.png" +dest_files=["res://.godot/imported/basic_spear.png-5e51f45d76972d56ca4fd506aabd79eb.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +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/textures/weapons/inhands/basic_sword.png b/textures/weapons/inhands/basic_sword.png new file mode 100644 index 0000000..14866a9 Binary files /dev/null and b/textures/weapons/inhands/basic_sword.png differ diff --git a/textures/weapons/inhands/basic_sword.png.import b/textures/weapons/inhands/basic_sword.png.import new file mode 100644 index 0000000..dd9c516 --- /dev/null +++ b/textures/weapons/inhands/basic_sword.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://xufvik31gru8" +path="res://.godot/imported/basic_sword.png-46a3846d4b7127f9e2efda8e742286a2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/weapons/inhands/basic_sword.png" +dest_files=["res://.godot/imported/basic_sword.png-46a3846d4b7127f9e2efda8e742286a2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +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/textures/weapons/inhands/test_sword.png b/textures/weapons/inhands/test_sword.png new file mode 100644 index 0000000..e810153 Binary files /dev/null and b/textures/weapons/inhands/test_sword.png differ diff --git a/textures/weapons/inhands/test_sword.png.import b/textures/weapons/inhands/test_sword.png.import new file mode 100644 index 0000000..cc6df98 --- /dev/null +++ b/textures/weapons/inhands/test_sword.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b0vgfbnn88ack" +path.s3tc="res://.godot/imported/test_sword.png-cdc76d21f0f70d4649a4a0d8edd8c16e.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://textures/weapons/inhands/test_sword.png" +dest_files=["res://.godot/imported/test_sword.png-cdc76d21f0f70d4649a4a0d8edd8c16e.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +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