Mapping and balance fixes

This commit is contained in:
Marco 2025-06-26 13:17:21 +02:00
commit 79cac3ebae
11 changed files with 1112 additions and 682 deletions

File diff suppressed because one or more lines are too long

View file

@ -102,7 +102,7 @@
( 192 568 0 ) ( 192 567 0 ) ( 193 568 0 ) Walls/Wall0 [ 0 -1 0 8 ] [ -1 0 0 0 ] 270 1 1
( 208 440 48 ) ( 209 440 48 ) ( 208 439 48 ) Manual/Black [ 0 -1 0 8 ] [ -1 0 0 0 ] 270 1 1
( 192 568 16 ) ( 193 568 16 ) ( 192 568 17 ) Manual/Black [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 440 32 ) ( 384 439 32 ) ( 384 440 33 ) Walls/Wall0 [ 0 1 0 8 ] [ 0 0 -1 0 ] 0 -1 1
( 384 440 32 ) ( 384 439 32 ) ( 384 440 33 ) Various/Various17 [ 0 1 0 8 ] [ 0 0 -1 0 ] 0 -1 1
}
// brush 11
{
@ -298,7 +298,7 @@
( 384 704 -16 ) ( 384 704 -15 ) ( 384 703 -16 ) Floors/Floor103 [ 0 -1 0 0 ] [ 0 0 1 0 ] 180 1 -1
( 464 560 16 ) ( 464 560 17 ) ( 465 560 16 ) Floors/Floor103 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 336 704 0 ) ( 336 703 0 ) ( 337 704 0 ) Floors/Floor103 [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 464 576 16 ) ( 465 576 16 ) ( 464 575 16 ) Floors/Floor103 [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 464 576 16 ) ( 465 576 16 ) ( 464 575 16 ) Various/Various14 [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 336 672 -16 ) ( 337 672 -16 ) ( 336 672 -15 ) Floors/Floor103 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 400 576 16 ) ( 400 575 16 ) ( 400 576 17 ) Floors/Floor103 [ 0 -1 0 0 ] [ 0 0 1 0 ] 180 1 -1
}
@ -307,9 +307,9 @@
( 376 800 16 ) ( 376 800 17 ) ( 376 799 16 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 384 568 32 ) ( 384 568 33 ) ( 385 568 32 ) Walls/Wall0 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 368 800 0 ) ( 368 799 0 ) ( 369 800 0 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 16 ] 270 1 1
( 384 672 48 ) ( 385 672 48 ) ( 384 671 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 16 ] 270 1 1
( 368 672 16 ) ( 369 672 16 ) ( 368 672 17 ) Walls/Wall0 [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 384 672 32 ) ( 384 671 32 ) ( 384 672 33 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 384 672 32 ) ( 385 672 32 ) ( 384 671 32 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 0 ] 180 1 1
( 368 664 16 ) ( 369 664 16 ) ( 368 664 17 ) Various/Various0 [ 1 0 0 0 ] [ 0 0 -1 0 ] 180 1 1
( 384 672 32 ) ( 384 671 32 ) ( 384 672 33 ) Various/Various17 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
}
// brush 34
{
@ -333,15 +333,15 @@
{
( 384 568 40 ) ( 384 568 41 ) ( 384 567 40 ) Walls/Wall0 [ 0 1 0 8 ] [ 0 0 -1 -8 ] 0 -1 1
( 152 560 56 ) ( 152 560 57 ) ( 153 560 56 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 -8 ] 0 1 1
( 136 568 40 ) ( 136 567 40 ) ( 137 568 40 ) Walls/Wall0 [ 0 -1 0 8 ] [ -1 0 0 8 ] 270 1 1
( 136 568 32 ) ( 136 567 32 ) ( 137 568 32 ) Walls/Wall0 [ 0 -1 0 8 ] [ -1 0 0 8 ] 0 1 1
( 152 440 48 ) ( 153 440 48 ) ( 152 439 48 ) Manual/Black [ 0 -1 0 8 ] [ -1 0 0 8 ] 270 1 1
( 136 568 40 ) ( 137 568 40 ) ( 136 568 41 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 -8 ] 0 1 1
( 136 568 40 ) ( 137 568 40 ) ( 136 568 41 ) Various/Various17 [ 1 0 0 -8 ] [ 0 0 -1 -8 ] 0 1 1
( 400 440 56 ) ( 400 439 56 ) ( 400 440 57 ) Walls/Wall0 [ 0 1 0 8 ] [ 0 0 -1 -8 ] 0 -1 1
}
// brush 37
{
( 400 800 40 ) ( 400 800 41 ) ( 400 799 40 ) special/clip [ 0 1 0 0 ] [ 0 0 -1 24 ] 90 -1 1
( 408 568 56 ) ( 408 568 57 ) ( 409 568 56 ) special/clip [ 1 0 0 8 ] [ 0 0 -1 24 ] 270 1 1
( 392 672 40 ) ( 392 672 41 ) ( 393 672 40 ) special/clip [ 1 0 0 8 ] [ 0 0 -1 24 ] 270 1 1
( 392 800 24 ) ( 392 799 24 ) ( 393 800 24 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 8 ] 0 1 1
( 408 672 48 ) ( 409 672 48 ) ( 408 671 48 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 8 ] 180 1 1
( 392 744 40 ) ( 393 744 40 ) ( 392 744 41 ) special/clip [ 1 0 0 8 ] [ 0 0 -1 24 ] 270 1 1
@ -588,7 +588,7 @@
( 224 928 0 ) ( 224 927 0 ) ( 225 928 0 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 240 800 48 ) ( 241 800 48 ) ( 240 799 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 224 800 16 ) ( 225 800 16 ) ( 224 800 17 ) Manual/Black [ 1 0 0 0 ] [ 0 0 -1 0 ] 0 1 1
( 240 800 32 ) ( 240 799 32 ) ( 240 800 33 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 240 800 32 ) ( 240 799 32 ) ( 240 800 33 ) Various/Various0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
}
// brush 65
{
@ -650,8 +650,8 @@
( 376 664 32 ) ( 376 664 33 ) ( 377 664 32 ) Walls/Wall0 [ 1 0 0 8 ] [ 0 0 -1 0 ] 0 1 1
( 360 800 0 ) ( 360 799 0 ) ( 361 800 0 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 376 672 48 ) ( 377 672 48 ) ( 376 671 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 360 672 16 ) ( 361 672 16 ) ( 360 672 17 ) Walls/Wall0 [ 1 0 0 8 ] [ 0 0 -1 0 ] 0 1 1
( 376 672 32 ) ( 376 671 32 ) ( 376 672 33 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 360 672 16 ) ( 361 672 16 ) ( 360 672 17 ) Various/Various0 [ 1 0 0 8 ] [ 0 0 -1 0 ] 0 1 1
( 384 672 32 ) ( 384 671 32 ) ( 384 672 33 ) Various/Various17 [ 0 1 0 0 ] [ 0 0 -1 0 ] 270 -1 1
}
// brush 72
{
@ -659,8 +659,8 @@
( 344 696 32 ) ( 344 696 33 ) ( 345 696 32 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 0 ] 0 1 1
( 328 832 0 ) ( 328 831 0 ) ( 329 832 0 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 344 704 48 ) ( 345 704 48 ) ( 344 703 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 328 704 16 ) ( 329 704 16 ) ( 328 704 17 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 0 ] 0 1 1
( 344 704 32 ) ( 344 703 32 ) ( 344 704 33 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 328 704 16 ) ( 329 704 16 ) ( 328 704 17 ) Various/Various0 [ 1 0 0 -8 ] [ 0 0 -1 0 ] 0 1 1
( 344 704 32 ) ( 344 703 32 ) ( 344 704 33 ) Various/Various0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
}
// brush 73
{
@ -669,7 +669,7 @@
( 328 864 0 ) ( 328 863 0 ) ( 329 864 0 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 344 736 48 ) ( 345 736 48 ) ( 344 735 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 8 ] 270 1 1
( 328 696 16 ) ( 329 696 16 ) ( 328 696 17 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 0 ] 0 1 1
( 344 736 32 ) ( 344 735 32 ) ( 344 736 33 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
( 344 736 32 ) ( 344 735 32 ) ( 344 736 33 ) Various/Various0 [ 0 1 0 0 ] [ 0 0 -1 0 ] 0 -1 1
}
// brush 74
{
@ -2283,6 +2283,42 @@
( 496 -256 16 ) ( 497 -256 16 ) ( 496 -256 17 ) Manual/Wall_Mine_001 [ 1 0 0 0 ] [ 0 0 -1 0 ] 180 1 1
( 512 -208 32 ) ( 512 -209 32 ) ( 512 -208 33 ) Manual/Wall_Mine_001 [ 0 1 0 0 ] [ 0 0 -1 16 ] 0 -1 1
}
// brush 254
{
( 384 672 40 ) ( 384 672 41 ) ( 384 671 40 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 -8 ] 0 -1 1
( 152 664 56 ) ( 152 664 57 ) ( 153 664 56 ) Walls/Wall0 [ 1 0 0 -8 ] [ 0 0 -1 -8 ] 0 1 1
( 136 672 32 ) ( 136 671 32 ) ( 137 672 32 ) Walls/Wall0 [ 0 -1 0 0 ] [ -1 0 0 8 ] 0 1 1
( 152 544 48 ) ( 153 544 48 ) ( 152 543 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 0 ] 270 1 1
( 136 672 40 ) ( 137 672 40 ) ( 136 672 41 ) Various/Various17 [ 1 0 0 -8 ] [ 0 0 -1 -8 ] 0 1 1
( 400 544 56 ) ( 400 543 56 ) ( 400 544 57 ) Walls/Wall0 [ 0 1 0 0 ] [ 0 0 -1 -8 ] 0 -1 1
}
// brush 255
{
( 400 552 32 ) ( 400 552 33 ) ( 400 551 32 ) Walls/Wall0 [ 0 1 0 -8 ] [ 0 0 -1 0 ] 270 -1 1
( 160 664 32 ) ( 160 664 33 ) ( 161 664 32 ) Walls/Wall0 [ 1 0 0 0 ] [ 0 0 -1 0 ] 180 1 1
( 144 680 24 ) ( 144 679 24 ) ( 145 680 24 ) Walls/Wall0 [ 0 -1 0 -8 ] [ -1 0 0 16 ] 180 1 1
( 160 552 48 ) ( 161 552 48 ) ( 160 551 48 ) Manual/Black [ 0 -1 0 0 ] [ -1 0 0 0 ] 90 1 1
( 144 672 16 ) ( 145 672 16 ) ( 144 672 17 ) Manual/Black [ 1 0 0 0 ] [ 0 0 -1 0 ] 180 1 1
( 408 552 32 ) ( 408 551 32 ) ( 408 552 33 ) Manual/Black [ 0 1 0 0 ] [ 0 0 -1 0 ] 180 -1 1
}
// brush 256
{
( 400 800 40 ) ( 400 800 41 ) ( 400 799 40 ) special/clip [ 0 1 0 0 ] [ 0 0 -1 24 ] 90 -1 1
( 408 568 56 ) ( 408 568 57 ) ( 409 568 56 ) special/clip [ 1 0 0 8 ] [ 0 0 -1 24 ] 270 1 1
( 392 800 24 ) ( 392 799 24 ) ( 393 800 24 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 8 ] 0 1 1
( 408 672 48 ) ( 409 672 48 ) ( 408 671 48 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 8 ] 180 1 1
( 392 664 40 ) ( 393 664 40 ) ( 392 664 41 ) special/clip [ 1 0 0 8 ] [ 0 0 -1 24 ] 0 1 1
( 408 672 56 ) ( 408 671 56 ) ( 408 672 57 ) special/clip [ 0 -1 0 0 ] [ 0 0 1 0 ] 90 1 -1
}
// brush 257
{
( 376 800 40 ) ( 376 800 41 ) ( 376 799 40 ) special/clip [ 0 1 0 0 ] [ 0 0 -1 24 ] 180 -1 1
( 384 568 56 ) ( 384 568 57 ) ( 385 568 56 ) special/clip [ 1 0 0 0 ] [ 0 0 -1 24 ] 180 1 1
( 368 800 24 ) ( 368 799 24 ) ( 369 800 24 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 -16 ] 90 1 1
( 384 672 48 ) ( 385 672 48 ) ( 384 671 48 ) special/clip [ 0 -1 0 0 ] [ -1 0 0 -16 ] 90 1 1
( 368 664 40 ) ( 369 664 40 ) ( 368 664 41 ) special/clip [ 1 0 0 0 ] [ 0 0 -1 24 ] 90 1 1
( 384 672 56 ) ( 384 671 56 ) ( 384 672 57 ) special/clip [ 0 -1 0 0 ] [ 0 0 1 0 ] 0 1 -1
}
}
// entity 1
{

View file

@ -3,25 +3,26 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cyoesu20d664t"
path="res://.godot/imported/Various17.png-bc47b12c618e2dcd0bc624cbc6437748.ctex"
path.s3tc="res://.godot/imported/Various17.png-bc47b12c618e2dcd0bc624cbc6437748.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://textures/Various/Various17.png"
dest_files=["res://.godot/imported/Various17.png-bc47b12c618e2dcd0bc624cbc6437748.ctex"]
dest_files=["res://.godot/imported/Various17.png-bc47b12c618e2dcd0bc624cbc6437748.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@ -31,4 +32,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

View file

@ -0,0 +1,8 @@
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dgdpscyefwron"]
[ext_resource type="Texture2D" uid="uid://cyoesu20d664t" path="res://textures/Various/Various17.png" id="1_5bgo2"]
[resource]
albedo_texture = ExtResource("1_5bgo2")
metallic_specular = 0.0
texture_filter = 2

View file

@ -492,6 +492,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 21.0389, 2.33215, 3.16925)
script = ExtResource("16_e2nai")
[node name="Camera3D" type="Camera3D" parent="."]
physics_interpolation_mode = 1
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 26.5146, 7.935, 10.4923)
projection = 1
size = 7.537

View file

@ -8,8 +8,8 @@ script = ExtResource("3_xep6w")
BulletScene = ExtResource("1_qojek")
BulletSpeed = 10.0
Direction = Vector2(1, 0)
BulletDamage = 0.4
MaxDamage = 1.0
BulletDamage = 0.8
MaxDamage = 1.2
Knockback = 100.0
LifeTime = 10.0
DestroyOnCollision = true

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=32 format=3 uid="uid://rimplblbptcd"]
[gd_scene load_steps=49 format=3 uid="uid://rimplblbptcd"]
[ext_resource type="Script" uid="uid://88smibkin17p" path="res://Scripts/Components/FSM/3DPlayer/IsoPlayerFSMProxy.cs" id="1_cc7e7"]
[ext_resource type="Texture2D" uid="uid://ddwhrlrgj6i00" path="res://Sprites/Actors/Cirno.png" id="1_vex34"]
@ -25,6 +25,9 @@
[ext_resource type="Script" uid="uid://by0x0qmbmkoak" path="res://Scripts/Components/FSM/3DPlayer/PlayerWeaponProvider3D.cs" id="16_olwak"]
[ext_resource type="PackedScene" uid="uid://cfgc6ik8vb08c" path="res://Scenes/Weapons/BaseWeapon_3D.tscn" id="17_olwak"]
[ext_resource type="Script" uid="uid://cqyr8mko8oo5" path="res://Scripts/Components/FSM/3DPlayer/PlayerAcidDeathModule.cs" id="19_7selo"]
[ext_resource type="Script" uid="uid://hdw15b6fi7de" path="res://Scripts/Components/Actors/3D/PlayerDamageReceiver3D.cs" id="26_ok6gd"]
[ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="27_5v3dv"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="28_b3jpo"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fg04g"]
radius = 0.349554
@ -48,6 +51,87 @@ radius = 1.20117
[sub_resource type="SphereShape3D" id="SphereShape3D_ok250"]
[sub_resource type="Resource" id="Resource_c4ide"]
script = ExtResource("27_5v3dv")
DamageType = 0
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_fjg1v"]
script = ExtResource("27_5v3dv")
DamageType = 1
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_hed00"]
script = ExtResource("27_5v3dv")
DamageType = 2
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_q2flx"]
script = ExtResource("27_5v3dv")
DamageType = 3
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_k7ckg"]
script = ExtResource("27_5v3dv")
DamageType = 4
Attribute = 4
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_qlmfy"]
script = ExtResource("27_5v3dv")
DamageType = 5
Attribute = 4
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_v2m0j"]
script = ExtResource("27_5v3dv")
DamageType = 0
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_awrib"]
script = ExtResource("27_5v3dv")
DamageType = 1
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_nfrn8"]
script = ExtResource("27_5v3dv")
DamageType = 2
Attribute = 2
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_nfq4p"]
script = ExtResource("27_5v3dv")
DamageType = 3
Attribute = 1
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_m1iep"]
script = ExtResource("27_5v3dv")
DamageType = 0
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_ckpe7"]
script = ExtResource("27_5v3dv")
DamageType = 4
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="Resource" id="Resource_p5rkw"]
script = ExtResource("27_5v3dv")
DamageType = 5
Attribute = 0
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
[sub_resource type="SphereShape3D" id="SphereShape3D_p313o"]
radius = 0.0913725
[node name="IsoPlayerFsm" type="CharacterBody3D" node_paths=PackedStringArray("PlayerFSM")]
collision_layer = 2
collision_mask = 17
@ -60,11 +144,12 @@ script = ExtResource("1_vsywg")
[node name="Init" type="Node" parent="StateMachine"]
script = ExtResource("2_3oyrx")
[node name="Active" type="Node" parent="StateMachine" node_paths=PackedStringArray("_inputProvider", "AnimationProvider", "Storage", "_moduleNodes")]
[node name="Active" type="Node" parent="StateMachine" node_paths=PackedStringArray("_inputProvider", "AnimationProvider", "Storage", "DamageReceiver", "_moduleNodes")]
script = ExtResource("3_cc7e7")
_inputProvider = NodePath("../../InputProvider")
AnimationProvider = NodePath("../../Sprites")
Storage = NodePath("../../Storage")
DamageReceiver = NodePath("../../DamageReceiver")
_moduleNodes = [NodePath("../../InputProvider"), NodePath("../../MovementModule"), NodePath("../../ShadowModule"), NodePath("../../InteractionController"), NodePath("../../ActivationProvider"), NodePath("../../WeaponModule"), NodePath("../../AcidDeathModule")]
[node name="Dead" type="Node" parent="StateMachine"]
@ -82,7 +167,7 @@ pixel_size = 0.05
texture_filter = 0
sprite_frames = ExtResource("6_yq7h2")
animation = &"idle"
frame_progress = 0.0351052
frame_progress = 0.840695
script = ExtResource("9_yarib")
[node name="Legs" type="AnimatedSprite3D" parent="Sprites"]
@ -191,10 +276,40 @@ WeaponLeftOffset = NodePath("../../WeaponOffset")
script = ExtResource("19_7selo")
[node name="AcidDetector" type="Area3D" parent="."]
visible = false
collision_layer = 2
collision_mask = 256
[node name="CollisionShape3D" type="CollisionShape3D" parent="AcidDetector"]
shape = SubResource("SphereShape3D_ok250")
[node name="DamageReceiver" type="Area3D" parent="." node_paths=PackedStringArray("_healthProvider", "_shieldProvider", "_motivationProvider")]
collision_layer = 2
collision_mask = 128
script = ExtResource("26_ok6gd")
_healthProvider = NodePath("HealthProvider")
_shieldProvider = NodePath("ShieldProvider")
_motivationProvider = NodePath("MotivationProvider")
ShieldDamageResistances = Array[ExtResource("27_5v3dv")]([SubResource("Resource_c4ide"), SubResource("Resource_fjg1v"), SubResource("Resource_hed00"), SubResource("Resource_q2flx"), SubResource("Resource_k7ckg"), SubResource("Resource_qlmfy")])
HealthDamageResistances = Array[ExtResource("27_5v3dv")]([SubResource("Resource_v2m0j"), SubResource("Resource_awrib"), SubResource("Resource_nfrn8"), SubResource("Resource_nfq4p"), SubResource("Resource_m1iep"), SubResource("Resource_ckpe7"), SubResource("Resource_p5rkw")])
[node name="HealthProvider" type="Node" parent="DamageReceiver"]
script = ExtResource("28_b3jpo")
ResourceName = "Health"
_maxResource = 32.0
[node name="MotivationProvider" type="Node" parent="DamageReceiver"]
script = ExtResource("28_b3jpo")
ResourceName = "Motivation"
_maxResource = 400.0
[node name="ShieldProvider" type="Node" parent="DamageReceiver"]
script = ExtResource("28_b3jpo")
ResourceName = "Shield"
_maxResource = 32.0
[node name="CollisionShape2D" type="CollisionShape3D" parent="DamageReceiver"]
shape = SubResource("SphereShape3D_p313o")
[connection signal="area_entered" from="AcidDetector" to="AcidDeathModule" method="OnAcidCollision"]
[connection signal="area_entered" from="DamageReceiver" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]

View file

@ -177,4 +177,9 @@ public partial class PlayerAnimationProvider3D : Node3D
{
((ShaderMaterial)AnimatedSprite.MaterialOverride).SetShaderParameter("blink_intensity", newValue);
}
public void PlayShieldAnimation()
{
}
}

View file

@ -0,0 +1,211 @@
using System.Linq;
using Cirno.Scripts.Components.FSM;
using Cirno.Scripts.Enums;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Weapons;
using Godot;
using Godot.Collections;
namespace Cirno.Scripts.Components.Actors._3D;
public partial class PlayerDamageReceiver3D : Area3D
{
[Export]
public bool Enabled { get; set; } = false;
[Export]
public bool Invulnerable { get; private set; } = false;
[Export] public BulletOwner BulletGroup { get; set; } = BulletOwner.Player;
[ExportCategory("Extensions")]
[Export] public StringName HealthExtendName { get; private set; } = "HEALTH_EXTEND";
[Export] public StringName ShieldExtendName { get; private set; } = "SHIELD_EXTEND";
[Export] public float BaseHealth { get; private set; } = 32f;
[Export] public float BaseShield { get; private set; } = 32f;
[Export] public float BaseMotivation { get; private set; } = 100f;
[Export] public float HealthExtendAmount { get; private set; } = 4f;
[Export] public float ShieldExtendAmount { get; private set; } = 4f;
[ExportCategory("Providers")]
[Export]
private ActorResourceProvider _healthProvider;
[Export]
private ActorResourceProvider _shieldProvider;
[Export] private ActorResourceProvider _motivationProvider;
[ExportCategory("Damage Types")]
[Export] public StringName AcidGroupName { get; private set; } = "Acid";
[Export] public Array<DamageResistance> ShieldDamageResistances { get; set; } = [];
[Export] public Array<DamageResistance> HealthDamageResistances { get; set; } = [];
[Signal]
public delegate void HealthChangedEventHandler(float newValue, float maxValue);
[Signal]
public delegate void HealthDecreasedEventHandler(float value, float newValue, float maxValue);
[Signal]
public delegate void ShieldChangedEventHandler(float newValue, float maxValue);
[Signal]
public delegate void ShieldDecreasedEventHandler(float value, float newValue, float maxValue);
[Signal]
public delegate void DeathEventHandler();
public float CurrentHealth
{
get => _healthProvider.CurrentResource;
set => _healthProvider.CurrentResource = value;
}
public float CurrentShield
{
get => _shieldProvider.CurrentResource;
set => _shieldProvider.CurrentResource = value;
}
public float CurrentMotivation
{
get => _motivationProvider.CurrentResource;
set => _motivationProvider.CurrentResource = value;
}
private IStateMachine<PlayerState, CharacterBody3D> _stateMachine;
public void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
{
_stateMachine = machine;
Invulnerable = GlobalState.Instance.SessionSettings.GodMode;
_healthProvider.ResourceChanged += ((value, maxValue) =>
{
//if (!Enabled) return;
Hud.Instance?.UpdateHealth(value, maxValue);
EmitSignal(SignalName.HealthChanged, value, maxValue);
});
_healthProvider.ResourceDecreased += (value, newValue, maxValue) =>
{
EmitSignal(SignalName.HealthDecreased, value, newValue, maxValue);
};
_shieldProvider.ResourceDecreased += (value, newValue, maxValue) =>
{
EmitSignal(SignalName.ShieldDecreased, value, newValue, maxValue);
};
_shieldProvider.ResourceChanged += ((value, maxValue) =>
{
//if (!Enabled) return;
Hud.Instance?.UpdateShield(value, maxValue);
EmitSignal(SignalName.ShieldChanged, value, maxValue);
});
_healthProvider.ResourceDepleted += () =>
{
//if (!Enabled) return;
EmitSignal(SignalName.Death);
};
// Set max resources based on inventory
SetMaxResources();
InventoryManager.Instance.ItemAdded += (item, amount) =>
{
if (item.ItemKey != HealthExtendName && item.ItemKey != ShieldExtendName) return;
SetMaxResources();
};
_motivationProvider.ResourceChanged += (value, maxValue) =>
{
Hud.Instance?.UpdateMotivation(value, maxValue);
};
}
private void SetMaxResources()
{
var healthExtends = InventoryManager.Instance.GetItemCount(HealthExtendName);
var shieldExtends = InventoryManager.Instance.GetItemCount(ShieldExtendName);
_healthProvider.MaxResource = BaseHealth + (healthExtends * HealthExtendAmount);
_shieldProvider.MaxResource = BaseShield + (shieldExtends * ShieldExtendAmount);
_motivationProvider.CurrentResource = BaseMotivation;
}
public void RefillHealth()
{
_healthProvider.FillResource();
}
public void RefillShield()
{
_shieldProvider.FillResource();
}
private void _on_damage_hitbox_area_entered(Area3D area)
{
if (!Enabled) return;
if (Invulnerable) return;
if (area.IsInGroup(AcidGroupName))
{
// Handle acid death
AcidDeath();
return;
}
if (area is not Bullet3D bullet || bullet.BulletOwner == BulletGroup) return;
this.Hit(bullet.Damage, bullet.DamageType);
bullet.RequestCollisionDestruction();
}
private void AcidDeath()
{
if (!Enabled) return;
GD.Print("Acid death");
_stateMachine.SetState(PlayerState.Drowning);
//_healthProvider.CurrentResource = 0;
}
private void ApplyDamageToHealth(float damage, DamageType type = DamageType.Neutral)
{
if (HealthDamageResistances.Where(x => x.DamageType == type)
.Any(x => x.Attribute is DamageAttribute.Skip)) return;
var dmg = HealthDamageResistances.Aggregate(damage, (current, resistance) => current * resistance.CalculateDamage(current, type));
CurrentHealth -= dmg;
}
public void Hit(float damage, DamageType type = DamageType.Neutral)
{
if (!Enabled) return;
// Change value based on difficulty
float difficultyReducedDmg = damage / GlobalState.Instance.SessionSettings.DifficultyDamageMultiplier;
// Check if the shield is empty or damage has skip attributes
if (CurrentShield <= 0 || ShieldDamageResistances.Where(x => x.DamageType == type).Any(x => x.Attribute is DamageAttribute.Skip))
{
// do not apply, go to health
ApplyDamageToHealth(difficultyReducedDmg, type);
}
else
{
var shieldDmg = ShieldDamageResistances.Aggregate(difficultyReducedDmg, (current, resistance) => current * resistance.CalculateDamage(current, type));
// apply and get remainder
var remainder = CurrentShield - shieldDmg;
CurrentShield = remainder; // Let the resource's self-balancing take care of any remainders
if (remainder < 0)
{
// Apply remainder to health
ApplyDamageToHealth(-remainder, type);
}
}
}
}

View file

@ -0,0 +1 @@
uid://hdw15b6fi7de

View file

@ -15,29 +15,31 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
[Export] public IsoPlayerStorageModule Storage { get; private set; }
[Export] public PlayerDamageReceiver3D DamageReceiver { get; private set; }
public override void Init(IStateMachine<PlayerState, CharacterBody3D> machine)
{
base.Init(machine);
//_hud = Hud.Instance;
//_damageReceiver.Death += () => { ChangeState(PlayerState.Dead); };
DamageReceiver.Death += () => { ChangeState(PlayerState.Dead); };
// _damageReceiver.HealthDecreased += (value, newValue, maxValue) =>
// {
// _animationProvider.Blink();
// };
DamageReceiver.HealthDecreased += (value, newValue, maxValue) =>
{
AnimationProvider.Blink();
};
// _damageReceiver.ShieldDecreased += (value, newValue, maxValue) =>
// {
// _animationProvider.PlayShieldAnimation();
//
// };
DamageReceiver.ShieldDecreased += (value, newValue, maxValue) =>
{
AnimationProvider.PlayShieldAnimation();
};
//_damageReceiver.Init(StateMachine);
DamageReceiver.Init(StateMachine);
//_damageReceiver.RefillHealth();
//_damageReceiver.RefillShield();
DamageReceiver.RefillHealth();
DamageReceiver.RefillShield();
//_activationProvider.Init(MainObject);
@ -54,7 +56,7 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
// enable crosshair
//_crosshairProvider.Show();
AnimationProvider.ShowSprite();
//_damageReceiver.Enabled = true;
DamageReceiver.Enabled = true;
//_activationProvider.Enabled = true;
//_interactionController.Enabled = true;
@ -69,7 +71,7 @@ public partial class Active : BaseState<PlayerState, CharacterBody3D>
// _crosshairProvider.Hide();
// _hitboxSpriteProvider.Hide();
//
// _damageReceiver.Enabled = false;
DamageReceiver.Enabled = false;
// _activationProvider.Enabled = false;
// _interactionController.Enabled = false;
}