Compare commits

...

4 Commits

Author SHA1 Message Date
4224333963 improved weapon system and cleaner weapon setup
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 20s
Create tag and build when new code gets to main / Export (push) Successful in 10m20s
2026-01-19 17:25:12 +01:00
4dd48bed70 orienting flying sword 2026-01-19 16:55:22 +01:00
abe6f42a3b some juice work on the first person weapon 2026-01-19 16:46:00 +01:00
27c67dbdd9 Some swords
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 18s
Create tag and build when new code gets to main / Export (push) Successful in 10m0s
2026-01-18 18:34:11 +01:00
64 changed files with 1501 additions and 85 deletions

View File

@@ -0,0 +1 @@
https://craftpix.net/file-licenses/

BIN
assets/swords/fbx/Texture_MAp_sword.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,42 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qtu5ue4ixkwm"
path.s3tc="res://.godot/imported/Texture_MAp_sword.png-2af3c78c4883b079065f66f1feac90e4.s3tc.ctex"
path.etc2="res://.godot/imported/Texture_MAp_sword.png-2af3c78c4883b079065f66f1feac90e4.etc2.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}
[deps]
source_file="res://assets/swords/fbx/Texture_MAp_sword.png"
dest_files=["res://.godot/imported/Texture_MAp_sword.png-2af3c78c4883b079065f66f1feac90e4.s3tc.ctex", "res://.godot/imported/Texture_MAp_sword.png-2af3c78c4883b079065f66f1feac90e4.etc2.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

BIN
assets/swords/fbx/_sword_1.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://pgd71ofvqsmf"
path="res://.godot/imported/_sword_1.fbx-4fe48a2bb63be1f77a3cf7c7a5c46a2d.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_1.fbx"
dest_files=["res://.godot/imported/_sword_1.fbx-4fe48a2bb63be1f77a3cf7c7a5c46a2d.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_10.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dc867it2djc0j"
path="res://.godot/imported/_sword_10.fbx-26a7b1fe725211263b2c77d9a7dc6a5a.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_10.fbx"
dest_files=["res://.godot/imported/_sword_10.fbx-26a7b1fe725211263b2c77d9a7dc6a5a.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_11.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b817njxdpygk4"
path="res://.godot/imported/_sword_11.fbx-6b498f728a419e5cdf7015937648dc0c.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_11.fbx"
dest_files=["res://.godot/imported/_sword_11.fbx-6b498f728a419e5cdf7015937648dc0c.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_12.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://vfwwh86wf1ds"
path="res://.godot/imported/_sword_12.fbx-2e156e5fe829c5a90f46f02befc39030.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_12.fbx"
dest_files=["res://.godot/imported/_sword_12.fbx-2e156e5fe829c5a90f46f02befc39030.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_13.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bdo4w8qjps8k1"
path="res://.godot/imported/_sword_13.fbx-0a46eb67177c7e5eef79859c7c94d975.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_13.fbx"
dest_files=["res://.godot/imported/_sword_13.fbx-0a46eb67177c7e5eef79859c7c94d975.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_15.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bo14ktg303cci"
path="res://.godot/imported/_sword_15.fbx-c121fcd47cad6f0460d63d2867e3fecd.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_15.fbx"
dest_files=["res://.godot/imported/_sword_15.fbx-c121fcd47cad6f0460d63d2867e3fecd.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_16.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bu55u3oj7roer"
path="res://.godot/imported/_sword_16.fbx-6c55a39e578558d03763795cf751f0e0.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_16.fbx"
dest_files=["res://.godot/imported/_sword_16.fbx-6c55a39e578558d03763795cf751f0e0.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_17.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b4gescssbshia"
path="res://.godot/imported/_sword_17.fbx-b5a7ae5038b5033dcc9a27b689bdf110.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_17.fbx"
dest_files=["res://.godot/imported/_sword_17.fbx-b5a7ae5038b5033dcc9a27b689bdf110.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_18.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://fm4607vrkr5l"
path="res://.godot/imported/_sword_18.fbx-eda4d9cb8bcde4d55ac99ec09b545356.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_18.fbx"
dest_files=["res://.godot/imported/_sword_18.fbx-eda4d9cb8bcde4d55ac99ec09b545356.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_19.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://c8lx8075hl8cw"
path="res://.godot/imported/_sword_19.fbx-eb227611876b1946d2773f4e1a392c73.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_19.fbx"
dest_files=["res://.godot/imported/_sword_19.fbx-eb227611876b1946d2773f4e1a392c73.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_2.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dw35utjjm8gb6"
path="res://.godot/imported/_sword_2.fbx-75c5e721ad94d604d3e69e3919dbb3c5.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_2.fbx"
dest_files=["res://.godot/imported/_sword_2.fbx-75c5e721ad94d604d3e69e3919dbb3c5.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_20.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dc65lwlhqbmqd"
path="res://.godot/imported/_sword_20.fbx-0617cc5a77fb88a346d20ddf46355225.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_20.fbx"
dest_files=["res://.godot/imported/_sword_20.fbx-0617cc5a77fb88a346d20ddf46355225.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_21.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://wawgl6e0h6tj"
path="res://.godot/imported/_sword_21.fbx-7200ded408f5953cbc70877022c333a5.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_21.fbx"
dest_files=["res://.godot/imported/_sword_21.fbx-7200ded408f5953cbc70877022c333a5.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_22.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b0x5klx5auig6"
path="res://.godot/imported/_sword_22.fbx-c6ed8d5dbb3050e43ea62d2e5ccc565c.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_22.fbx"
dest_files=["res://.godot/imported/_sword_22.fbx-c6ed8d5dbb3050e43ea62d2e5ccc565c.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_23.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dqmfrrbc3ewal"
path="res://.godot/imported/_sword_23.fbx-493172d63aace2a9301836d894a62890.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_23.fbx"
dest_files=["res://.godot/imported/_sword_23.fbx-493172d63aace2a9301836d894a62890.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_24.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b1qfs4yugw3ph"
path="res://.godot/imported/_sword_24.fbx-0adbb8989d27c2a804efc391a50e4c7b.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_24.fbx"
dest_files=["res://.godot/imported/_sword_24.fbx-0adbb8989d27c2a804efc391a50e4c7b.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_3.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://sdufabwshlrj"
path="res://.godot/imported/_sword_3.fbx-04a6f1a0f269fa6ff0c8cba8aed2c8b8.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_3.fbx"
dest_files=["res://.godot/imported/_sword_3.fbx-04a6f1a0f269fa6ff0c8cba8aed2c8b8.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_4.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://dmiewrsn2o1xt"
path="res://.godot/imported/_sword_4.fbx-25a5609f8f6918f76d0ed4b3e8e55618.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_4.fbx"
dest_files=["res://.godot/imported/_sword_4.fbx-25a5609f8f6918f76d0ed4b3e8e55618.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_5.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://brogj578mkndo"
path="res://.godot/imported/_sword_5.fbx-9d38cdd495cd4ff9bc2758f9d1e01b7e.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_5.fbx"
dest_files=["res://.godot/imported/_sword_5.fbx-9d38cdd495cd4ff9bc2758f9d1e01b7e.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_6.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://tol5v11e7bhx"
path="res://.godot/imported/_sword_6.fbx-65a0a7d72918e7512792cfa786f56e6e.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_6.fbx"
dest_files=["res://.godot/imported/_sword_6.fbx-65a0a7d72918e7512792cfa786f56e6e.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_7.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://bag0oxbvo7ya7"
path="res://.godot/imported/_sword_7.fbx-5a2d61c3625b87c9b91bab13a45ef09e.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_7.fbx"
dest_files=["res://.godot/imported/_sword_7.fbx-5a2d61c3625b87c9b91bab13a45ef09e.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_8.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b7ibkej2rcs03"
path="res://.godot/imported/_sword_8.fbx-84c74a27d77c6f3455ecd47693de31ef.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_8.fbx"
dest_files=["res://.godot/imported/_sword_8.fbx-84c74a27d77c6f3455ecd47693de31ef.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/_sword_9.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://7widux5ck7kg"
path="res://.godot/imported/_sword_9.fbx-83e0a99c6bcb7a2f902fc35d3c339287.scn"
[deps]
source_file="res://assets/swords/fbx/_sword_9.fbx"
dest_files=["res://.godot/imported/_sword_9.fbx-83e0a99c6bcb7a2f902fc35d3c339287.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

BIN
assets/swords/fbx/sword_14.fbx (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,44 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://3gho2priko7i"
path="res://.godot/imported/sword_14.fbx-43a1e42a5de4603e1b903e8a8848e2b4.scn"
[deps]
source_file="res://assets/swords/fbx/sword_14.fbx"
dest_files=["res://.godot/imported/sword_14.fbx-43a1e42a5de4603e1b903e8a8848e2b4.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/root_script=null
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
nodes/use_name_suffixes=true
nodes/use_node_type_suffixes=true
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=true
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
materials/extract=0
materials/extract_format=0
materials/extract_path=""
_subresources={}
fbx/importer=0
fbx/allow_geometry_helper_nodes=false
fbx/embedded_image_handling=1
fbx/naming_version=2

2
assets/swords/readme.txt Normal file
View File

@@ -0,0 +1,2 @@
Font that was used for the background of the preview:
https://www.dafont.com/the-bold-font.font

View File

@@ -0,0 +1,13 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://buevqo8w8fq75"]
[ext_resource type="Texture2D" uid="uid://qtu5ue4ixkwm" path="res://assets/swords/fbx/Texture_MAp_sword.png" id="1_ke6g8"]
[resource]
resource_name = "Sword_mat_map"
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("1_ke6g8")
emission_enabled = true
use_z_clip_scale = true
z_clip_scale = 0.5
use_fov_override = true
fov_override = 30.0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

BIN
assets/swords/texture/Texture_MAp_sword.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://br8gpitkrtroi"
path="res://.godot/imported/Texture_MAp_sword.png-5d2e59afea3d1af36913e0e3757cf603.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/swords/texture/Texture_MAp_sword.png"
dest_files=["res://.godot/imported/Texture_MAp_sword.png-5d2e59afea3d1af36913e0e3757cf603.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=1

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=54 format=3 uid="uid://bei4nhkf8lwdo"] [gd_scene load_steps=52 format=3 uid="uid://bei4nhkf8lwdo"]
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"] [ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
[ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"] [ext_resource type="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
@@ -17,11 +17,9 @@
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"]
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"] [ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"] [ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"]
[ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"]
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"] [ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"]
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"] [ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"]
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="12_34snm"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="12_34snm"]
[ext_resource type="Script" uid="uid://b6k73aj5povgv" path="res://player_controller/Scripts/FieldOfView.cs" id="12_m2mxi"]
[ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://systems/inputs/base_mode/jump_pressed.tres" id="13_nob5r"] [ext_resource type="Resource" uid="uid://55b0dsvioj08" path="res://systems/inputs/base_mode/jump_pressed.tres" id="13_nob5r"]
[ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"] [ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"]
[ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"] [ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"]
@@ -174,6 +172,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.6, 0)
CameraInclineAcceleration = 20.0 CameraInclineAcceleration = 20.0
GroundedCameraIncline = 3.0 GroundedCameraIncline = 3.0
SlidingJitterAmplitude = 0.2 SlidingJitterAmplitude = 0.2
WeaponSway = 8.0
WeaponLookRotation = 10.0
WeaponAdjustmentSpeed = 1.0
[node name="MantleSystem" parent="HeadSystem" instance=ExtResource("8_qu4wy")] [node name="MantleSystem" parent="HeadSystem" instance=ExtResource("8_qu4wy")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.6, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.6, 0)
@@ -203,12 +204,6 @@ collision_mask = 256
target_position = Vector3(0, -0.75, 0) target_position = Vector3(0, -0.75, 0)
collision_mask = 256 collision_mask = 256
[node name="Bobbing" type="Node3D" parent="."]
script = ExtResource("10_7wk1w")
[node name="FieldOfView" type="Node3D" parent="."]
script = ExtResource("12_m2mxi")
[node name="HeadCollisionDetectors" type="Node3D" parent="."] [node name="HeadCollisionDetectors" type="Node3D" parent="."]
visible = false visible = false
@@ -277,11 +272,11 @@ collision_mask = 256
DashSpeed = 0.2 DashSpeed = 0.2
PostDashSpeed = 30.0 PostDashSpeed = 30.0
[node name="WeaponRoot" type="Node3D" parent="."] [node name="WeaponSystem" parent="." instance=ExtResource("29_wv70j")]
[node name="WeaponSystem" parent="WeaponRoot" instance=ExtResource("29_wv70j")]
transform = Transform3D(1, 0, 0, 0, 0.173648, -0.984808, 0, 0.984808, 0.173648, 0.45268, 1.44035, -0.692528) transform = Transform3D(1, 0, 0, 0, 0.173648, -0.984808, 0, 0.984808, 0.173648, 0.45268, 1.44035, -0.692528)
ThrowForce = 15.0 mass = 10.0
gravity_scale = 3.0
ThrowForce = 300.0
StraightThrowDuration = 0.05 StraightThrowDuration = 0.05
[node name="DashIndicator" type="Node3D" parent="."] [node name="DashIndicator" type="Node3D" parent="."]

View File

@@ -41,14 +41,11 @@ public partial class PlayerController : CharacterBody3D,
// Public stuff // // Public stuff //
/////////////////////////// ///////////////////////////
public HeadSystem HeadSystem; public HeadSystem HeadSystem;
public Bobbing Bobbing;
public FieldOfView FieldOfView;
public StairsSystem StairsSystem; public StairsSystem StairsSystem;
public MantleSystem MantleSystem; public MantleSystem MantleSystem;
public DashSystem DashSystem; public DashSystem DashSystem;
public CollisionShape3D StandingCollider; public CollisionShape3D StandingCollider;
public CollisionShape3D SlideCollider; public CollisionShape3D SlideCollider;
public Node3D WeaponRoot;
public WeaponSystem WeaponSystem; public WeaponSystem WeaponSystem;
public WallHugSystem WallHugSystem; public WallHugSystem WallHugSystem;
public PlayerUi PlayerUi; public PlayerUi PlayerUi;
@@ -311,6 +308,8 @@ public partial class PlayerController : CharacterBody3D,
private StateChartState _onWallHanging; private StateChartState _onWallHanging;
private StateChartState _onWallRunning; private StateChartState _onWallRunning;
private Transition _onDashEnded;
private Transition _onJumpFromWall; private Transition _onJumpFromWall;
private Transition _onJumpFromWallFalling; private Transition _onJumpFromWallFalling;
private Transition _onLeaveWallFromRun; private Transition _onLeaveWallFromRun;
@@ -340,14 +339,11 @@ public partial class PlayerController : CharacterBody3D,
// Camera stuff // Camera stuff
HeadSystem = GetNode<HeadSystem>("HeadSystem"); HeadSystem = GetNode<HeadSystem>("HeadSystem");
Bobbing = GetNode<Bobbing>("Bobbing");
FieldOfView = GetNode<FieldOfView>("FieldOfView");
Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D"); Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D");
Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth"); Node3D cameraSmooth = GetNode<Node3D>("HeadSystem/CameraSmooth");
// Movement stuff // Movement stuff
WeaponRoot = GetNode<Node3D>("WeaponRoot"); WeaponSystem = GetNode<WeaponSystem>("WeaponSystem");
WeaponSystem = GetNode<WeaponSystem>("WeaponRoot/WeaponSystem");
MantleSystem = GetNode<MantleSystem>("HeadSystem/MantleSystem"); MantleSystem = GetNode<MantleSystem>("HeadSystem/MantleSystem");
StandingCollider = GetNode<CollisionShape3D>("StandingCollider"); StandingCollider = GetNode<CollisionShape3D>("StandingCollider");
SlideCollider = GetNode<CollisionShape3D>("SlideCollider"); SlideCollider = GetNode<CollisionShape3D>("SlideCollider");
@@ -388,6 +384,7 @@ public partial class PlayerController : CharacterBody3D,
_airGlidingDoubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Sliding/AirGlideDoubleJumpEnabled")); _airGlidingDoubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Sliding/AirGlideDoubleJumpEnabled"));
_onGroundSlideJump = Transition.Of(GetNode("StateChart/Root/Movement/Sliding/GroundSlide/OnJump")); _onGroundSlideJump = Transition.Of(GetNode("StateChart/Root/Movement/Sliding/GroundSlide/OnJump"));
_onAirGlideDoubleJump = Transition.Of(GetNode("StateChart/Root/Movement/Sliding/AirGlideDoubleJumpEnabled/OnJump")); _onAirGlideDoubleJump = Transition.Of(GetNode("StateChart/Root/Movement/Sliding/AirGlideDoubleJumpEnabled/OnJump"));
_onDashEnded = Transition.Of(GetNode("StateChart/Root/Movement/Dashing/OnDashEnded"));
// _actionHanging = StateChartState.Of(GetNode("StateChart/Root/Actions/Hanging")); // _actionHanging = StateChartState.Of(GetNode("StateChart/Root/Actions/Hanging"));
_powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired")); _powerExpired = StateChartState.Of(GetNode("StateChart/Root/PowerReserve/Expired"));
@@ -422,8 +419,6 @@ public partial class PlayerController : CharacterBody3D,
// Camera stuff // Camera stuff
HeadSystem.Init(); HeadSystem.Init();
Bobbing.Init(camera);
FieldOfView.Init(camera);
// Movement stuff // Movement stuff
// Getting universal setting from GODOT editor to be in sync // Getting universal setting from GODOT editor to be in sync
@@ -501,6 +496,9 @@ public partial class PlayerController : CharacterBody3D,
_onWallHanging.StatePhysicsProcessing += HandleWallHanging; _onWallHanging.StatePhysicsProcessing += HandleWallHanging;
_onWallRunning.StatePhysicsProcessing += HandleWallRunning; _onWallRunning.StatePhysicsProcessing += HandleWallRunning;
_onWallHanging.StateExited += RecoverWeapon;
_onDashEnded.Taken += RecoverWeapon;
_onJumpFromWall.Taken += OnJumpFromWall; _onJumpFromWall.Taken += OnJumpFromWall;
_onJumpFromWallFalling.Taken += OnJumpFromWall; _onJumpFromWallFalling.Taken += OnJumpFromWall;
_onLeaveWallFromRun.Taken += OnLeaveWallFromRun; _onLeaveWallFromRun.Taken += OnLeaveWallFromRun;
@@ -548,9 +546,9 @@ public partial class PlayerController : CharacterBody3D,
if (TutorialDone) if (TutorialDone)
return; return;
RemoveChild(WeaponRoot); RemoveChild(WeaponSystem);
GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponRoot); GetTree().GetRoot().CallDeferred(Node.MethodName.AddChild, WeaponSystem);
WeaponRoot.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition); WeaponSystem.CallDeferred(Node3D.MethodName.SetGlobalPosition, TutorialWeaponTarget.GlobalPosition);
WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition); WeaponSystem.CallDeferred(WeaponSystem.MethodName.PlaceWeaponForTutorial, TutorialWeaponTarget.GlobalPosition);
} }
@@ -811,39 +809,25 @@ public partial class PlayerController : CharacterBody3D,
var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier; var lookSensitivity = _isUsingGamepad ? _lookSensitivityMultiplier : _mouseSensitivityMultiplier;
var wallHugContactPoint = _onWallRunning.Active ? _currentWallContactPoint : Vector3.Zero; var wallHugContactPoint = _onWallRunning.Active ? _currentWallContactPoint : Vector3.Zero;
var playerVelocity = GetGlobalMoveInput(); var moveInput = GetGlobalMoveInput();
HeadSystem.LookAround(delta, inputLookDir, playerVelocity, Velocity, wallHugContactPoint, lookSensitivity, isSliding: _groundSliding.Active);
} var lookAroundInputs = new HeadSystem.CameraParameters(
public void RotateWeaponWithPlayer() Delta: delta,
{ LookDir: inputLookDir,
WeaponRoot.SetRotation(HeadSystem.Rotation); PlayerInput: moveInput,
PlayerVelocity:Velocity,
WallContactPoint: wallHugContactPoint,
SensitivitMultiplier: lookSensitivity,
WithCameraJitter: _groundSliding.Active,
WithCameraBobbing: _grounded.Active || _onWallRunning.Active,
BobbingMultiplier: _headBobbingMultiplier,
FovMultiplier: _fovChangeMultiplier);
HeadSystem.LookAround(lookAroundInputs);
} }
public Vector3 GetGlobalForwardFacingVector() public Vector3 GetGlobalForwardFacingVector()
{ {
return Transform.Basis * HeadSystem.Transform.Basis * Vector3.Forward; return Transform.Basis * HeadSystem.Transform.Basis * Vector3.Forward;
} }
private void CameraModifications(float delta)
{
Bobbing.CameraBobbingParams cameraBobbingParams = new Bobbing.CameraBobbingParams
{
Delta = delta,
IsOnFloorCustom = _grounded.Active || _onWallRunning.Active,
Velocity = Velocity,
SettingsMultiplier = _headBobbingMultiplier
};
Bobbing.PerformCameraBobbing(cameraBobbingParams);
FieldOfView.FovParameters fovParams = new FieldOfView.FovParameters
{
IsCrouchingHeight = false,
Delta = delta,
SprintSpeed = WalkSpeed,
Velocity = Velocity,
FOVMultiplier = _fovChangeMultiplier
};
FieldOfView.PerformFovAdjustment(fovParams);
}
// Horizontal velocity computing // Horizontal velocity computing
public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null) public Vector3 ComputeHVelocity(float delta, float accelerationFactor, float decelerationFactor, Vector3? direction = null)
{ {
@@ -1570,9 +1554,6 @@ public partial class PlayerController : CharacterBody3D,
} }
public void HandleAiming(float delta) public void HandleAiming(float delta)
{ {
if (WeaponSystem.InHandState.Active)
RotateWeaponWithPlayer();
DashIndicatorMeshCylinder.Height = DashSystem.PlannedLocation.DistanceTo(GlobalPosition); DashIndicatorMeshCylinder.Height = DashSystem.PlannedLocation.DistanceTo(GlobalPosition);
DashIndicatorNode.LookAt(DashSystem.PlannedLocation); DashIndicatorNode.LookAt(DashSystem.PlannedLocation);
@@ -1640,7 +1621,8 @@ public partial class PlayerController : CharacterBody3D,
public void ThrowWeapon() public void ThrowWeapon()
{ {
_playerState.SendEvent("cancel_aim"); _playerState.SendEvent("cancel_aim");
RemoveChildNode(WeaponRoot); RemoveChildNode(WeaponSystem);
HeadSystem.HideWeapon();
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation; var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.PlannedLocation;
WeaponSystem.ThrowWeapon( WeaponSystem.ThrowWeapon(
@@ -1651,7 +1633,10 @@ public partial class PlayerController : CharacterBody3D,
} }
public void RecoverWeapon() public void RecoverWeapon()
{ {
RecoverChildNode(WeaponRoot); if (WeaponSystem.GetParent() == this) return;
HeadSystem.ShowWeapon();
RecoverChildNode(WeaponSystem);
WeaponSystem.ResetWeapon(); WeaponSystem.ResetWeapon();
} }
@@ -1704,8 +1689,6 @@ public partial class PlayerController : CharacterBody3D,
var isPlantedUnderPlatform = WeaponSystem.IsPlantedUnderPlatform(); var isPlantedUnderPlatform = WeaponSystem.IsPlantedUnderPlatform();
var shouldDashToHanging = isPlantedOnWall || isPlantedUnderPlatform; var shouldDashToHanging = isPlantedOnWall || isPlantedUnderPlatform;
RecoverWeapon();
var resultingEvent = shouldDashToHanging ? "dash_to_planted" : "dash_finished"; var resultingEvent = shouldDashToHanging ? "dash_to_planted" : "dash_finished";
_playerState.SendEvent(resultingEvent); _playerState.SendEvent(resultingEvent);
} }
@@ -1718,12 +1701,9 @@ public partial class PlayerController : CharacterBody3D,
if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1; if (_currentInputBufferFrames > 0) _currentInputBufferFrames -= 1;
LookAround(delta); LookAround(delta);
CameraModifications((float) delta);
MoveSlideAndHandleStairs((float) delta); MoveSlideAndHandleStairs((float) delta);
MantleSystem.ProcessMantle(_grounded.Active); MantleSystem.ProcessMantle(_grounded.Active);
if (WeaponSystem.InHandState.Active)
RotateWeaponWithPlayer();
if (WeaponSystem.InHandState.Active && !_aiming.Active && TutorialDone) if (WeaponSystem.InHandState.Active && !_aiming.Active && TutorialDone)
{ {
DashIndicatorMesh.Visible = false; DashIndicatorMesh.Visible = false;

View File

@@ -148,6 +148,7 @@ locale/translations=PackedStringArray("res://addons/maaacks_game_template/base/t
[layer_names] [layer_names]
3d_render/layer_2="FirstPersonView"
3d_physics/layer_1="Player" 3d_physics/layer_1="Player"
3d_physics/layer_2="2" 3d_physics/layer_2="2"
3d_physics/layer_3="3" 3d_physics/layer_3="3"

View File

@@ -6,6 +6,18 @@ namespace Movementtests.systems;
public partial class HeadSystem : Node3D public partial class HeadSystem : Node3D
{ {
public record CameraParameters(
double Delta,
Vector2 LookDir,
Vector3 PlayerInput,
Vector3 PlayerVelocity,
Vector3 WallContactPoint,
float SensitivitMultiplier,
bool WithCameraJitter,
bool WithCameraBobbing,
float BobbingMultiplier,
float FovMultiplier);
private Camera3D _camera; private Camera3D _camera;
private Marker3D _cameraAnchor; private Marker3D _cameraAnchor;
private AnimationPlayer _animationPlayer; private AnimationPlayer _animationPlayer;
@@ -13,25 +25,53 @@ public partial class HeadSystem : Node3D
[Export(PropertyHint.Range, "0,10,0.1,or_greater")] [Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float LookSensitivity { get; set; } = 1f; public float LookSensitivity { get; set; } = 1f;
[ExportGroup("Camera incline")]
[Export(PropertyHint.Range, "0.1,50,0.1,or_greater")] [Export(PropertyHint.Range, "0.1,50,0.1,or_greater")]
public double CameraInclineAcceleration { get; set; } = 10f; public double CameraInclineAcceleration { get; set; } = 10f;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")] [Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float WallRunCameraIncline { get; set; } = 5f; public float WallRunCameraIncline { get; set; } = 5f;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")] [Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float GroundedCameraIncline { get; set; } = 5f; public float GroundedCameraIncline { get; set; } = 5f;
[ExportGroup("Sliding")]
[Export(PropertyHint.Range, "0,2,0.1,or_greater")] [Export(PropertyHint.Range, "0,2,0.1,or_greater")]
public float SlidingCameraHeightOffset { get; set; } = 1.0f; public float SlidingCameraHeightOffset { get; set; } = 1.0f;
[Export(PropertyHint.Range, "0,1,0.01,or_greater")] [Export(PropertyHint.Range, "0,1,0.01,or_greater")]
public float SlidingJitterFrequency { get; set; } = 0.01f; public float SlidingJitterFrequency { get; set; } = 0.01f;
[Export(PropertyHint.Range, "0,1,0.01,or_greater")] [Export(PropertyHint.Range, "0,1,0.01,or_greater")]
public float SlidingJitterAmplitude { get; set; } = 0.1f; public float SlidingJitterAmplitude { get; set; } = 0.1f;
private FastNoiseLite _slidingNoise = new FastNoiseLite(); private FastNoiseLite _slidingNoise = new FastNoiseLite();
[ExportGroup("Bobbing")]
private float _bobbingAccumulator; // Constantly increases when player moves in X or/and Z axis
[Export(PropertyHint.Range, "0,10,0.01,or_greater")]
public float BobbingFrequency { set; get; } = 2.4f;
[Export(PropertyHint.Range, "0,0.4,0.01,or_greater")]
public float BobbingAmplitude { set; get; } = 0.08f;
[ExportGroup("FOV")]
[Export(PropertyHint.Range, "0,180,0.1,degrees")]
public float BaseFov { get; set; } = 75.0f;
[Export(PropertyHint.Range, "0,10,0.01,or_greater")]
public float FovChangeFactor { get; set; } = 1.2f;
[Export(PropertyHint.Range, "0,10,0.01,or_greater")]
public float FovChangeSpeed { get; set; } = 6.25f;
[Export(PropertyHint.Range, "0,100,1,or_greater")]
public float FovMaxedOutSpeed { get; set; } = 20f;
[ExportGroup("First Person rig")]
private Node3D _fpRig;
private Vector3 _fpRigInitialPosition;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float WeaponSway { get; set; } = 5f;
[Export(PropertyHint.Range, "0,10,0.1,or_greater")]
public float WeaponLookRotation { get; set; } = 1f;
[Export(PropertyHint.Range, "0,200,1,or_greater")]
public float WeaponMoveRotation { get; set; } = 80f;
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
public float WeaponAdjustmentSpeed { get; set; } = 10f;
public void Init() public void Init()
{ {
@@ -39,7 +79,10 @@ public partial class HeadSystem : Node3D
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D"); _camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
_cameraAnchor = GetNode<Marker3D>("CameraAnchor"); _cameraAnchor = GetNode<Marker3D>("CameraAnchor");
_animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer"); _animationPlayer = GetNode<AnimationPlayer>("AnimationPlayer");
_fpRig = GetNode<Node3D>("FPRig");
_fpRigInitialPosition = _fpRig.GlobalPosition;
_slidingNoise.NoiseType = FastNoiseLite.NoiseTypeEnum.Perlin; _slidingNoise.NoiseType = FastNoiseLite.NoiseTypeEnum.Perlin;
_slidingNoise.SetFrequency(SlidingJitterFrequency); _slidingNoise.SetFrequency(SlidingJitterFrequency);
} }
@@ -49,8 +92,19 @@ public partial class HeadSystem : Node3D
_animationPlayer.Play("mantle"); _animationPlayer.Play("mantle");
} }
public void LookAround(double delta, Vector2 lookDir, Vector3 playerInput, Vector3 playerVelocity, Vector3? wallContactPoint = null, float sensitivitMultiplier = 1f, bool isSliding = false) public void LookAround(CameraParameters inputs)
{ {
var (delta,
lookDir,
playerInput,
playerVelocity,
wallContactPoint,
sensitivitMultiplier,
withCameraJitter,
withCameraBobbing,
bobbingMultiplier,
fovMultiplier) = inputs;
// Horizontal movement of head // Horizontal movement of head
float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier; float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier;
RotateY(angleForHorizontalRotation); RotateY(angleForHorizontalRotation);
@@ -61,11 +115,11 @@ public partial class HeadSystem : Node3D
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f)); currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
// Camera incline on Wall and more // Camera incline on Wall and more
var isWallRunning = wallContactPoint.HasValue && wallContactPoint.Value.Length() > Mathf.Epsilon; var isWallRunning = wallContactPoint.Length() > Mathf.Epsilon;
float cameraIncline; float cameraIncline;
if (isWallRunning) if (isWallRunning)
{ {
var directionToWall = (wallContactPoint.Value - GlobalPosition).Normalized(); var directionToWall = (wallContactPoint - GlobalPosition).Normalized();
var cameraInclineFactor = ComputeCameraInclineFactor(directionToWall); var cameraInclineFactor = ComputeCameraInclineFactor(directionToWall);
cameraIncline = Mathf.DegToRad(WallRunCameraIncline * cameraInclineFactor); cameraIncline = Mathf.DegToRad(WallRunCameraIncline * cameraInclineFactor);
} }
@@ -77,7 +131,7 @@ public partial class HeadSystem : Node3D
currentCameraRotation.Z = (float) Mathf.Lerp(currentCameraRotation.Z, cameraIncline, delta * CameraInclineAcceleration); currentCameraRotation.Z = (float) Mathf.Lerp(currentCameraRotation.Z, cameraIncline, delta * CameraInclineAcceleration);
_cameraAnchor.Rotation = currentCameraRotation; _cameraAnchor.Rotation = currentCameraRotation;
if (isSliding) if (withCameraJitter)
{ {
_cameraAnchor.Position = Vector3.Down*SlidingCameraHeightOffset; _cameraAnchor.Position = Vector3.Down*SlidingCameraHeightOffset;
float noise1D = _slidingNoise.GetNoise1D(Time.GetTicksMsec()); float noise1D = _slidingNoise.GetNoise1D(Time.GetTicksMsec());
@@ -89,7 +143,54 @@ public partial class HeadSystem : Node3D
_cameraAnchor.Position = Vector3.Zero; _cameraAnchor.Position = Vector3.Zero;
} }
Vector3 newPositionForCamera = Vector3.Zero;
Vector3 newPositionForRig = Vector3.Zero;
if (withCameraBobbing)
{
_bobbingAccumulator += (float) delta * playerVelocity.Length();
// As the _bobbingAccumulator increases we're changing values for sin and cos functions.
// Because both of them are just waves, we will be slide up with y and then slide down with y
// creating bobbing effect. The same works for cos. As the _bobbingAccumulator increases the cos decreases and then increases
newPositionForCamera.Y = Mathf.Sin(_bobbingAccumulator * BobbingFrequency) * BobbingAmplitude * bobbingMultiplier;
newPositionForCamera.X = Mathf.Cos(_bobbingAccumulator * BobbingFrequency / 2.0f) * BobbingAmplitude * bobbingMultiplier;
// Offset bobbing for weapon rig
newPositionForRig.Y = Mathf.Cos(_bobbingAccumulator * BobbingFrequency) * BobbingAmplitude * bobbingMultiplier * 0.2f;
newPositionForRig.X = Mathf.Sin(_bobbingAccumulator * BobbingFrequency / 2.0f) * BobbingAmplitude * bobbingMultiplier * 0.2f;
}
_cameraAnchor.Position += newPositionForCamera;
_camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated(); _camera.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
// First person rig adjustments
_fpRig.GlobalTransform = _cameraAnchor.GetGlobalTransformInterpolated();
// Apply bobbing
_fpRig.Position += newPositionForRig;
var newRigRotation = _fpRig.Rotation;
var camTilt = Mathf.Lerp(_fpRig.Rotation.Z, cameraIncline*WeaponMoveRotation, delta*WeaponAdjustmentSpeed);
newRigRotation.Z = (float) camTilt;
// var lookInputLerped = lookDir.Lerp(Vector2.Zero, (float) delta * WeaponAdjustmentSpeed);
newRigRotation.X = Mathf.Lerp(newRigRotation.X, -lookDir.Y*WeaponSway, (float) delta*WeaponAdjustmentSpeed);
newRigRotation.Y = Mathf.Lerp(newRigRotation.Y, -lookDir.X*WeaponSway, (float) delta*WeaponAdjustmentSpeed);
_fpRig.Rotation = newRigRotation;
// Camera adjustments
float velocityClamped = Mathf.Clamp(playerVelocity.Length(), 0.5f, FovMaxedOutSpeed);
float targetFov = BaseFov + FovChangeFactor * velocityClamped * fovMultiplier;
_camera.Fov = Mathf.Lerp(_camera.Fov, targetFov, (float) delta * FovChangeSpeed);
}
public void HideWeapon()
{
_fpRig.Visible = false;
}
public void ShowWeapon()
{
_fpRig.Visible = true;
} }
public float ComputeCameraInclineFactor(Vector3 direction) public float ComputeCameraInclineFactor(Vector3 direction)

View File

@@ -1,6 +1,7 @@
[gd_scene load_steps=5 format=3 uid="uid://0ysqmqphq6mq"] [gd_scene load_steps=6 format=3 uid="uid://0ysqmqphq6mq"]
[ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"] [ext_resource type="Script" uid="uid://dtkdrnsmlwm67" path="res://systems/head/HeadSystem.cs" id="1_8abgy"]
[ext_resource type="ArrayMesh" uid="uid://ckr26s4e3fj1m" path="res://assets/swords/resources/fp_sword23.tres" id="2_c5qep"]
[sub_resource type="Animation" id="Animation_urko7"] [sub_resource type="Animation" id="Animation_urko7"]
length = 0.001 length = 0.001
@@ -62,6 +63,15 @@ _data = {
[node name="HeadSystem" type="Node3D"] [node name="HeadSystem" type="Node3D"]
script = ExtResource("1_8abgy") script = ExtResource("1_8abgy")
[node name="FPRig" type="Node3D" parent="."]
[node name="Sword" type="Node3D" parent="FPRig"]
[node name="SwordMesh" type="MeshInstance3D" parent="FPRig/Sword"]
transform = Transform3D(0.43494374, 0.027831191, -0.9000275, 0.1806065, 0.9765146, 0.117475554, 0.8821594, -0.2136461, 0.41970232, 0.53640664, -0.82246387, -1.9288678)
cast_shadow = 0
mesh = ExtResource("2_c5qep")
[node name="CameraSmooth" type="Node3D" parent="."] [node name="CameraSmooth" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="CameraSmooth"] [node name="Camera3D" type="Camera3D" parent="CameraSmooth"]

View File

@@ -28,6 +28,7 @@ public partial class WeaponSystem : RigidBody3D
private TweenQueueSystem _tweenQueueSystem; private TweenQueueSystem _tweenQueueSystem;
private Transform3D _startTransform; private Transform3D _startTransform;
private Transform3D _startMeshTransform;
private Vector3 _throwDirection; private Vector3 _throwDirection;
public Vector3 PlantLocation { get; set; } public Vector3 PlantLocation { get; set; }
@@ -36,7 +37,6 @@ public partial class WeaponSystem : RigidBody3D
public MeshInstance3D WeaponLocationIndicator { get; set; } public MeshInstance3D WeaponLocationIndicator { get; set; }
public StandardMaterial3D WeaponLocationIndicatorMaterial { get; set; } public StandardMaterial3D WeaponLocationIndicatorMaterial { get; set; }
public MeshInstance3D WeaponMesh { get; set; } public MeshInstance3D WeaponMesh { get; set; }
public StandardMaterial3D WeaponMaterial { get; set; }
public void Init(Node3D head, Camera3D camera) public void Init(Node3D head, Camera3D camera)
{ {
@@ -53,13 +53,14 @@ public partial class WeaponSystem : RigidBody3D
WeaponLocationIndicatorMaterial = WeaponLocationIndicator.GetActiveMaterial(0) as StandardMaterial3D; WeaponLocationIndicatorMaterial = WeaponLocationIndicator.GetActiveMaterial(0) as StandardMaterial3D;
WeaponMesh = GetNode<MeshInstance3D>("Weapon"); WeaponMesh = GetNode<MeshInstance3D>("Weapon");
WeaponMaterial = WeaponMesh.GetActiveMaterial(0) as StandardMaterial3D; _startMeshTransform = WeaponMesh.Transform;
_tweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem"); _tweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
_tweenQueueSystem.Init(this); _tweenQueueSystem.Init(this);
_startTransform = Transform; _startTransform = Transform;
Freeze = true; Freeze = true;
Visible = false;
BodyEntered += OnThrownWeaponReachesGround; BodyEntered += OnThrownWeaponReachesGround;
@@ -69,15 +70,15 @@ public partial class WeaponSystem : RigidBody3D
public void WeaponLeft() public void WeaponLeft()
{ {
WeaponLocationIndicator.Visible = true; Visible = true;
WeaponMaterial!.UseFovOverride = false; // WeaponLocationIndicator.Visible = true;
EmitSignalWeaponThrown(); EmitSignalWeaponThrown();
} }
public void WeaponBack() public void WeaponBack()
{ {
WeaponLocationIndicator.Visible = false; Visible = false;
WeaponMaterial!.UseFovOverride = true; // WeaponLocationIndicator.Visible = false;
EmitSignalWeaponRetrieved(); EmitSignalWeaponRetrieved();
} }
@@ -87,14 +88,13 @@ public partial class WeaponSystem : RigidBody3D
Freeze = true; Freeze = true;
GlobalPosition = location; GlobalPosition = location;
PlantLocation = location; PlantLocation = location;
Visible = false;
} }
public void ThrowWeapon(Vector3 end, bool hasHit, Vector3 collisionLocation, Vector3 collisionNormal) public void ThrowWeapon(Vector3 end, bool hasHit, Vector3 collisionLocation, Vector3 collisionNormal)
{ {
_weaponState.SendEvent("throw"); _weaponState.SendEvent("throw");
WeaponLocationIndicatorMaterial.StencilColor = new Color(1f, 1f, 1f); // WeaponLocationIndicatorMaterial.StencilColor = new Color(1f, 1f, 1f);
_throwDirection = (end - GlobalPosition).Normalized(); _throwDirection = (end - GlobalPosition).Normalized();
PlantLocation = collisionLocation; PlantLocation = collisionLocation;
@@ -118,10 +118,11 @@ public partial class WeaponSystem : RigidBody3D
{ {
_weaponState.SendEvent("plant"); _weaponState.SendEvent("plant");
WeaponLocationIndicatorMaterial.StencilColor = new Color(1f, 0.2f, 0.2f); // WeaponLocationIndicatorMaterial.StencilColor = new Color(1f, 0.2f, 0.2f);
Freeze = true; Freeze = true;
GlobalPosition = PlantLocation; GlobalPosition = PlantLocation;
WeaponMesh.Transform = _startMeshTransform;
LookAt(GlobalTransform.Origin + PlantNormal, Vector3.Up, true); LookAt(GlobalTransform.Origin + PlantNormal, Vector3.Up, true);
} }
@@ -135,7 +136,7 @@ public partial class WeaponSystem : RigidBody3D
_weaponState.SendEvent("recover"); _weaponState.SendEvent("recover");
Transform = _startTransform; Transform = _startTransform;
Freeze = true; Freeze = true;
Visible = true; Visible = false;
} }
public override void _IntegrateForces(PhysicsDirectBodyState3D state) public override void _IntegrateForces(PhysicsDirectBodyState3D state)
@@ -149,6 +150,14 @@ public partial class WeaponSystem : RigidBody3D
} }
} }
public override void _Process(double delta)
{
if (!FlyingState.Active) return;
WeaponMesh.Rotation = new Vector3(WeaponMesh.Rotation.X, WeaponMesh.Rotation.Y + (float) delta * 100, WeaponMesh.Rotation.Z);
//LookAt(GlobalTransform.Origin + LinearVelocity.Normalized(), Vector3.Up, false);
}
public bool IsPlantedUnderPlatform() public bool IsPlantedUnderPlatform()
{ {
return PlantedState.Active && GlobalRotation.X > 1 && Math.Abs(GlobalRotation.Y) > 1; return PlantedState.Active && GlobalRotation.X > 1 && Math.Abs(GlobalRotation.Y) > 1;

View File

@@ -3,7 +3,7 @@
[ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://systems/weapon/WeaponSystem.cs" id="1_csqwk"] [ext_resource type="Script" uid="uid://iii3wfto4t5b" path="res://systems/weapon/WeaponSystem.cs" id="1_csqwk"]
[ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="2_x1nha"] [ext_resource type="PackedScene" uid="uid://dbe5f0p6lvqtr" path="res://systems/tween_queue/tween_queue_system.tscn" id="2_x1nha"]
[ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"] [ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="3_5owyf"]
[ext_resource type="CylinderMesh" uid="uid://b7vt0nk2htpo4" path="res://systems/weapon/weapon.tres" id="3_svc06"] [ext_resource type="ArrayMesh" uid="uid://cho5fixitrbds" path="res://assets/swords/resources/sword23.tres" id="3_svc06"]
[ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"] [ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="4_svc06"]
[ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"] [ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_m0v1h"]
[ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"] [ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_jpdh0"]
@@ -51,7 +51,7 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0,
shape = SubResource("CylinderShape3D_avini") shape = SubResource("CylinderShape3D_avini")
[node name="Weapon" type="MeshInstance3D" parent="."] [node name="Weapon" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0) transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0.8673003)
mesh = ExtResource("3_svc06") mesh = ExtResource("3_svc06")
[node name="StateChart" type="Node" parent="."] [node name="StateChart" type="Node" parent="."]