mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Game over and proper acid death
This commit is contained in:
parent
bacf41e726
commit
7d49c5a25e
13 changed files with 925 additions and 784 deletions
File diff suppressed because one or more lines are too long
|
|
@ -3775,11 +3775,11 @@
|
|||
// brush 143
|
||||
{
|
||||
( 248 256 8 ) ( 248 256 9 ) ( 248 255 8 ) Walls/Wall0 [ 0 -1 0 0 ] [ 0 0 1 -8 ] 0 1 -1
|
||||
( 136 144 8 ) ( 135 144 8 ) ( 136 144 9 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 0 1 -8 ] 270 1 -1
|
||||
( 264 296 -24 ) ( 263 296 -24 ) ( 264 296 -23 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 0 1 -8 ] 180 1 -1
|
||||
( 264 384 -32 ) ( 263 384 -32 ) ( 264 383 -32 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 1 0 0 ] 0 1 1
|
||||
( 136 256 8 ) ( 136 255 8 ) ( 135 256 8 ) Manual/Black [ -1 0 0 8 ] [ 0 1 0 0 ] 0 1 1
|
||||
( 264 312 -24 ) ( 264 312 -23 ) ( 263 312 -24 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 0 1 -8 ] 90 1 -1
|
||||
( 256 384 -24 ) ( 256 383 -24 ) ( 256 384 -23 ) Manual/Black [ 0 -1 0 0 ] [ 0 0 1 0 ] 0 1 -1
|
||||
( 256 384 -24 ) ( 256 383 -24 ) ( 256 384 -23 ) Various/Various1 [ 0 -1 0 0 ] [ 0 0 1 0 ] 0 1 -1
|
||||
}
|
||||
// brush 144
|
||||
{
|
||||
|
|
@ -4181,7 +4181,7 @@
|
|||
{
|
||||
( -136 144 -28 ) ( -136 144 -27 ) ( -136 143 -28 ) Floors/Floor103 [ 0 -1 0 0 ] [ 0 0 1 -12 ] 180 1 -1
|
||||
( 144 144 -28 ) ( 143 144 -28 ) ( 144 144 -27 ) Floors/Floor103 [ -1 0 0 0 ] [ 0 0 1 -12 ] 270 1 -1
|
||||
( 272 272 -20 ) ( 271 272 -20 ) ( 272 271 -20 ) Floors/Floor103 [ -1 0 0 0 ] [ 0 1 0 0 ] 180 1 1
|
||||
( 272 272 -28 ) ( 271 272 -28 ) ( 272 271 -28 ) Floors/Floor103 [ -1 0 0 0 ] [ 0 1 0 0 ] 270 1 1
|
||||
( 144 144 -12 ) ( 144 143 -12 ) ( 143 144 -12 ) Various/Various16 [ -1 0 0 8 ] [ 0 1 0 0 ] 180 1 1
|
||||
( 272 264 -60 ) ( 272 264 -59 ) ( 271 264 -60 ) Floors/Floor103 [ -1 0 0 8 ] [ 0 0 1 -4 ] 270 1 -1
|
||||
( -120 144 -28 ) ( -120 143 -28 ) ( -120 144 -27 ) Floors/Floor103 [ 0 -1 0 0 ] [ 0 0 1 -12 ] 270 1 -1
|
||||
|
|
@ -4291,7 +4291,7 @@
|
|||
( 248 288 -24 ) ( 247 288 -24 ) ( 248 288 -23 ) __TB_empty [ -1 0 0 -8 ] [ 0 0 1 -8 ] 90 1 -1
|
||||
( 376 416 -32 ) ( 375 416 -32 ) ( 376 415 -32 ) __TB_empty [ -1 0 0 -8 ] [ 0 1 0 0 ] 270 1 1
|
||||
( 248 288 8 ) ( 248 287 8 ) ( 247 288 8 ) Manual/Black [ -1 0 0 0 ] [ 0 1 0 0 ] 90 1 1
|
||||
( 376 296 -56 ) ( 376 296 -55 ) ( 375 296 -56 ) Walls/Wall0 [ -1 0 0 -8 ] [ 0 0 1 -8 ] 270 1 -1
|
||||
( 376 296 -56 ) ( 376 296 -55 ) ( 375 296 -56 ) Various/Various1 [ -1 0 0 -8 ] [ 0 0 1 -8 ] 270 1 -1
|
||||
( 312 416 -56 ) ( 312 415 -56 ) ( 312 416 -55 ) __TB_empty [ 0 -1 0 0 ] [ 0 0 1 -8 ] 90 1 -1
|
||||
}
|
||||
// brush 201
|
||||
|
|
@ -4438,6 +4438,24 @@
|
|||
( 416 312 -56 ) ( 416 312 -55 ) ( 415 312 -56 ) Floors/Floor278 [ -1 0 0 0 ] [ 0 0 1 -8 ] 180 1 -1
|
||||
( 312 312 -56 ) ( 312 311 -56 ) ( 312 312 -55 ) Floors/Floor278 [ 0 -1 0 -8 ] [ 0 0 1 -8 ] 270 1 -1
|
||||
}
|
||||
// brush 217
|
||||
{
|
||||
( -344 152 16 ) ( -344 152 17 ) ( -344 151 16 ) special/clip [ -5.053215498074303e-16 -1 0 -8 ] [ 0 0 1 0 ] 180 1 -1
|
||||
( 160 136 48 ) ( 160 136 49 ) ( 161 136 48 ) special/clip [ 1 -5.053215498074303e-16 0 0 ] [ 0 0 1 0 ] 0 1 -1
|
||||
( 32 152 8 ) ( 32 151 8 ) ( 33 152 8 ) special/clip [ -5.053215498074303e-16 -1 0 -8 ] [ -1 5.053215498074303e-16 0 0 ] 90 1 1
|
||||
( 160 24 48 ) ( 161 24 48 ) ( 160 23 48 ) special/clip [ -5.053215498074303e-16 -1 0 -8 ] [ -1 5.053215498074303e-16 0 0 ] 270 1 1
|
||||
( 32 144 16 ) ( 33 144 16 ) ( 32 144 17 ) special/clip [ 1 -5.053215498074303e-16 0 0 ] [ 0 0 1 0 ] 0 1 -1
|
||||
( 272 24 48 ) ( 272 23 48 ) ( 272 24 49 ) special/clip [ -5.053215498074303e-16 -1 0 -8 ] [ 0 0 1 0 ] 270 1 -1
|
||||
}
|
||||
// brush 218
|
||||
{
|
||||
( 248 256 8 ) ( 248 256 9 ) ( 248 255 8 ) Walls/Wall0 [ 0 -1 0 0 ] [ 0 0 1 -8 ] 0 1 -1
|
||||
( 136 144 8 ) ( 135 144 8 ) ( 136 144 9 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 0 1 -8 ] 270 1 -1
|
||||
( 264 384 -32 ) ( 263 384 -32 ) ( 264 383 -32 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 1 0 0 ] 0 1 1
|
||||
( 136 256 8 ) ( 136 255 8 ) ( 135 256 8 ) Manual/Black [ -1 0 0 8 ] [ 0 1 0 0 ] 0 1 1
|
||||
( 264 296 -24 ) ( 264 296 -23 ) ( 263 296 -24 ) Walls/Wall0 [ -1 0 0 8 ] [ 0 0 1 -8 ] 180 1 -1
|
||||
( 256 384 -24 ) ( 256 383 -24 ) ( 256 384 -23 ) Manual/Black [ 0 -1 0 0 ] [ 0 0 1 0 ] 0 1 -1
|
||||
}
|
||||
}
|
||||
// entity 180
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_resource type="Resource" script_class="FuncGodotFGDSolidClass" load_steps=3 format=3 uid="uid://c2x5nns4yv5y1"]
|
||||
[gd_resource type="Resource" script_class="FuncGodotFGDSolidClass" load_steps=4 format=3 uid="uid://c2x5nns4yv5y1"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://ermxog0n4mvn" path="res://3D/TrenchBroom/EntityDefinitions/base/trigger_base.tres" id="1_pinv3"]
|
||||
[ext_resource type="Script" uid="uid://msq50x6rk4po" path="res://addons/func_godot/src/fgd/func_godot_fgd_solid_class.gd" id="2_5u7ls"]
|
||||
[ext_resource type="Script" uid="uid://bexetda02atk1" path="res://3D/TrenchBroom/EntityScripts/Solid/acidarea.gd" id="3_7wro5"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_5u7ls")
|
||||
|
|
@ -22,6 +23,7 @@ add_vertex_metadata = false
|
|||
add_face_position_metadata = false
|
||||
add_face_normal_metadata = false
|
||||
add_collision_shape_face_range_metadata = false
|
||||
script_class = ExtResource("3_7wro5")
|
||||
classname = "acid_area"
|
||||
description = "Acid"
|
||||
func_godot_internal = false
|
||||
|
|
|
|||
6
3D/TrenchBroom/EntityScripts/Solid/acidarea.gd
Normal file
6
3D/TrenchBroom/EntityScripts/Solid/acidarea.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
@tool
|
||||
class_name AcidArea
|
||||
extends Area3D
|
||||
|
||||
func _init() -> void:
|
||||
add_to_group("Acid", true)
|
||||
1
3D/TrenchBroom/EntityScripts/Solid/acidarea.gd.uid
Normal file
1
3D/TrenchBroom/EntityScripts/Solid/acidarea.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bexetda02atk1
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=66 format=3 uid="uid://rimplblbptcd"]
|
||||
[gd_scene load_steps=67 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"]
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
[ext_resource type="Script" uid="uid://cmafvigtkg2qo" path="res://Scripts/Components/FSM/3DPlayer/Dead.cs" id="5_ok250"]
|
||||
[ext_resource type="Script" uid="uid://ci87ilsfrj1xh" path="res://Scripts/Components/FSM/3DPlayer/Cutscene.cs" id="6_chmen"]
|
||||
[ext_resource type="Script" uid="uid://eop2ue3otxcs" path="res://Scripts/Components/FSM/3DPlayer/IsoPlayerStorageModule.cs" id="6_habpy"]
|
||||
[ext_resource type="Script" uid="uid://bwdmhpotan5ai" path="res://Scripts/Components/FSM/3DPlayer/Drowning.cs" id="6_nk07c"]
|
||||
[ext_resource type="Script" uid="uid://cq1joxgoj3jdp" path="res://Scripts/Components/Actors/3D/PlayerAnimationProvider3D.cs" id="6_onfm2"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://c6exoa8pxbc6w" path="res://Resources/Sprites/player_float.tres" id="6_yq7h2"]
|
||||
[ext_resource type="Script" uid="uid://dq338w2lw5phl" path="res://Scripts/Components/Actors/KeyboardInputProvider.cs" id="7_4cdxq"]
|
||||
|
|
@ -219,10 +220,18 @@ _inputProvider = NodePath("../../InputProvider")
|
|||
AnimationProvider = NodePath("../../AnimationProvider")
|
||||
Storage = NodePath("../../Storage")
|
||||
DamageReceiver = NodePath("../../DamageReceiver")
|
||||
_moduleNodes = [NodePath("../../InputProvider"), NodePath("../../MovementModule"), NodePath("../../ShadowModule"), NodePath("../../InteractionController"), NodePath("../../ActivationProvider"), NodePath("../../WeaponModule"), NodePath("../../AcidDeathModule"), NodePath("../../CrosshairModule")]
|
||||
_moduleNodes = [NodePath("../../InputProvider"), NodePath("../../MovementModule"), NodePath("../../ShadowModule"), NodePath("../../InteractionController"), NodePath("../../ActivationProvider"), NodePath("../../WeaponModule"), NodePath("../../CrosshairModule")]
|
||||
|
||||
[node name="Dead" type="Node" parent="StateMachine"]
|
||||
[node name="Dead" type="Node" parent="StateMachine" node_paths=PackedStringArray("_motivationProvider", "_inputProvider", "_healthProvider", "_animationProvider")]
|
||||
script = ExtResource("5_ok250")
|
||||
_motivationProvider = NodePath("../../DamageReceiver/MotivationProvider")
|
||||
_inputProvider = NodePath("../../InputProvider")
|
||||
_healthProvider = NodePath("../../DamageReceiver/HealthProvider")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="Drowning" type="Node" parent="StateMachine" node_paths=PackedStringArray("_animationProvider")]
|
||||
script = ExtResource("6_nk07c")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="Cutscene" type="Node" parent="StateMachine" node_paths=PackedStringArray("AnimationProvider", "PlayerStorage")]
|
||||
script = ExtResource("6_chmen")
|
||||
|
|
@ -248,8 +257,8 @@ material_override = ExtResource("7_yarib")
|
|||
pixel_size = 0.05
|
||||
texture_filter = 0
|
||||
sprite_frames = ExtResource("6_yq7h2")
|
||||
animation = &"idle"
|
||||
frame_progress = 0.316881
|
||||
animation = &"walk_down"
|
||||
frame_progress = 0.402096
|
||||
script = ExtResource("9_yarib")
|
||||
|
||||
[node name="Legs" type="AnimatedSprite3D" parent="AnimationProvider"]
|
||||
|
|
@ -367,7 +376,7 @@ shape = SubResource("SphereShape3D_ok250")
|
|||
|
||||
[node name="DamageReceiver" type="Area3D" parent="." node_paths=PackedStringArray("_healthProvider", "_shieldProvider", "_motivationProvider")]
|
||||
collision_layer = 2
|
||||
collision_mask = 128
|
||||
collision_mask = 384
|
||||
script = ExtResource("26_ok6gd")
|
||||
_healthProvider = NodePath("HealthProvider")
|
||||
_shieldProvider = NodePath("ShieldProvider")
|
||||
|
|
|
|||
|
|
@ -381,9 +381,10 @@ _animationProvider = NodePath("../../AnimationProvider")
|
|||
script = ExtResource("6_82vrk")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
|
||||
[node name="Dead" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("_animationProvider", "_healthProvider", "_motivationProvider")]
|
||||
[node name="Dead" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("_animationProvider", "_inputProvider", "_healthProvider", "_motivationProvider")]
|
||||
script = ExtResource("4_0pqs8")
|
||||
_animationProvider = NodePath("../../AnimationProvider")
|
||||
_inputProvider = NodePath("../../InputProvider")
|
||||
_healthProvider = NodePath("../../DamageReceiver/HealthProvider")
|
||||
_motivationProvider = NodePath("../../DamageReceiver/MotivationProvider")
|
||||
|
||||
|
|
|
|||
|
|
@ -102,9 +102,10 @@ public partial class PlayerAnimationProvider3D : Node3D
|
|||
|
||||
public void PlayDeathAnimation()
|
||||
{
|
||||
this.Visible = false;
|
||||
// if (_deathParticles is null) return;
|
||||
// this.CreateSibling<AutodeleteParticle>(_deathParticles, this.GlobalPosition);
|
||||
// _animatedSprite.Visible = false;
|
||||
|
||||
}
|
||||
|
||||
public void PlayDrowningAnimation()
|
||||
|
|
|
|||
|
|
@ -1,20 +1,53 @@
|
|||
using Godot;
|
||||
using Cirno.Scripts.Components.Actors;
|
||||
using Cirno.Scripts.Components.Actors._3D;
|
||||
using Cirno.Scripts.Controllers;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
public partial class Dead : BaseState<PlayerState, CharacterBody3D>
|
||||
{
|
||||
public override PlayerState StateId => PlayerState.Dead;
|
||||
|
||||
[Export]
|
||||
private ActorResourceProvider _motivationProvider;
|
||||
[Export]
|
||||
private InputProvider _inputProvider;
|
||||
|
||||
[Export]
|
||||
private ActorResourceProvider _healthProvider;
|
||||
|
||||
[Export]
|
||||
private PlayerAnimationProvider3D _animationProvider;
|
||||
|
||||
private bool _isGameOver = false;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
base.EnterState();
|
||||
MainObject.Hide();
|
||||
//MainObject.Hide();
|
||||
|
||||
_animationProvider.PlayDeathAnimation();
|
||||
|
||||
|
||||
if (_motivationProvider.CurrentResource < 100f)
|
||||
{
|
||||
// If motivation is not enough show game over scene
|
||||
Hud.Instance.ShowGameOver();
|
||||
_isGameOver = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Else show respawn notification
|
||||
Hud.Instance.ShowTerminated();
|
||||
_isGameOver = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
{
|
||||
base.ExitState();
|
||||
Hud.Instance.HideTerminated();
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
@ -25,5 +58,34 @@ public partial class Dead : BaseState<PlayerState, CharacterBody3D>
|
|||
public override void ProcessState(double delta)
|
||||
{
|
||||
base.ProcessState(delta);
|
||||
|
||||
if (_inputProvider.GetShootJustPressed())
|
||||
{
|
||||
if (_isGameOver)
|
||||
{
|
||||
// Restart Level
|
||||
GlobalState.Instance.RestartLevel();
|
||||
}
|
||||
else
|
||||
{
|
||||
Respawn();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Respawn()
|
||||
{
|
||||
MainObject.GlobalPosition = GameController.Instance.LastCheckPointPosition;
|
||||
_healthProvider.FillResource();
|
||||
PoolingManager.Instance.ClearBullets();
|
||||
|
||||
_motivationProvider.CurrentResource -= 100f;
|
||||
if (_motivationProvider.CurrentResource <= 1f)
|
||||
{
|
||||
_motivationProvider.CurrentResource = 1f;
|
||||
}
|
||||
|
||||
ChangeState(PlayerState.Active);
|
||||
}
|
||||
}
|
||||
30
Scripts/Components/FSM/3DPlayer/Drowning.cs
Normal file
30
Scripts/Components/FSM/3DPlayer/Drowning.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using Cirno.Scripts.Components.Actors._3D;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM._3DPlayer;
|
||||
|
||||
public partial class Drowning : BaseState<PlayerState, CharacterBody3D>
|
||||
{
|
||||
public override PlayerState StateId => PlayerState.Drowning;
|
||||
|
||||
[Export]
|
||||
private PlayerAnimationProvider3D _animationProvider;
|
||||
|
||||
public override void EnterState()
|
||||
{
|
||||
_animationProvider.PlayDrowningAnimation();
|
||||
|
||||
// Wait for animation to be over and switch to death
|
||||
_animationProvider.OnAnimationEnded += AnimationProviderOnOnAnimationEnded;
|
||||
}
|
||||
|
||||
private void AnimationProviderOnOnAnimationEnded(StringName animationName)
|
||||
{
|
||||
if (animationName != _animationProvider.DrowningAnimationName) return;
|
||||
|
||||
_animationProvider.OnAnimationEnded -= AnimationProviderOnOnAnimationEnded;
|
||||
|
||||
StateMachine.SetState(PlayerState.Dead);
|
||||
|
||||
}
|
||||
}
|
||||
1
Scripts/Components/FSM/3DPlayer/Drowning.cs.uid
Normal file
1
Scripts/Components/FSM/3DPlayer/Drowning.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bwdmhpotan5ai
|
||||
|
|
@ -15,13 +15,13 @@ dest_files=["res://.godot/imported/Cirno_Drowning.png-9637a2b29d8ed3f0e666c2c65c
|
|||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/mode=3
|
||||
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 +31,4 @@ process/normal_map_invert_y=false
|
|||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
detect_3d/compress_to=0
|
||||
|
|
|
|||
|
|
@ -3,20 +3,19 @@
|
|||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bvjyivjk530r5"
|
||||
path.s3tc="res://.godot/imported/Cirno_Surprised.png-cb1fc228a9e5f07a7c2cd5414df6d36f.s3tc.ctex"
|
||||
path="res://.godot/imported/Cirno_Surprised.png-cb1fc228a9e5f07a7c2cd5414df6d36f.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/Actors/Cirno_Surprised.png"
|
||||
dest_files=["res://.godot/imported/Cirno_Surprised.png-cb1fc228a9e5f07a7c2cd5414df6d36f.s3tc.ctex"]
|
||||
dest_files=["res://.godot/imported/Cirno_Surprised.png-cb1fc228a9e5f07a7c2cd5414df6d36f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/mode=3
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue