mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-12 11:05:54 +00:00
Changed player to new one
This commit is contained in:
parent
60ab375572
commit
1c1436a539
27 changed files with 323 additions and 87 deletions
|
|
@ -77,7 +77,8 @@ public partial class EnemyPossessionMovement : ActorFreeMovement
|
|||
public void AssumeControl()
|
||||
{
|
||||
GameManager.Instance.CameraTargetObject(_parent);
|
||||
GameManager.Instance.Player.RequestMovementDisable(true);
|
||||
//GameManager.Instance.Player.RequestMovementDisable(true);
|
||||
GameManager.Instance.Player.SetState((int)PlayerState.Controlling);
|
||||
|
||||
_previousAiState = _actorAi.Ai;
|
||||
_actorAi.Ai = AiState.Controlled;
|
||||
|
|
@ -92,7 +93,8 @@ public partial class EnemyPossessionMovement : ActorFreeMovement
|
|||
_actorAi.Ai = _previousAiState;
|
||||
|
||||
GameManager.Instance.CameraTargetPlayer();
|
||||
GameManager.Instance.Player.RequestMovementDisable(false);
|
||||
//GameManager.Instance.Player.RequestMovementDisable(false);
|
||||
GameManager.Instance.Player.SetState((int)PlayerState.Active);
|
||||
|
||||
DamageReceiver.BulletGroup = BulletOwner.Enemy;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,33 +6,33 @@ public partial class KeyboardInputProvider : InputProvider
|
|||
{
|
||||
[ExportCategory("Movement")]
|
||||
[Export]
|
||||
public string LeftAxisName { get; private set; } = "left";
|
||||
public StringName LeftAxisName { get; private set; } = "left";
|
||||
[Export]
|
||||
public string RightAxisName { get; private set; } = "right";
|
||||
public StringName RightAxisName { get; private set; } = "right";
|
||||
[Export]
|
||||
public string UpAxisName { get; private set; } = "up";
|
||||
public StringName UpAxisName { get; private set; } = "up";
|
||||
[Export]
|
||||
public string DownAxisName { get; private set; } = "down";
|
||||
public StringName DownAxisName { get; private set; } = "down";
|
||||
|
||||
[ExportCategory("Aiming")]
|
||||
[Export]
|
||||
public string LeftAimName { get; private set; } = "aim_left";
|
||||
public StringName LeftAimName { get; private set; } = "aim_left";
|
||||
[Export]
|
||||
public string RightAimName { get; private set; } = "aim_right";
|
||||
public StringName RightAimName { get; private set; } = "aim_right";
|
||||
[Export]
|
||||
public string UpAimName { get; private set; } = "aim_up";
|
||||
public StringName UpAimName { get; private set; } = "aim_up";
|
||||
[Export]
|
||||
public string DownAimName { get; private set; } = "aim_down";
|
||||
public StringName DownAimName { get; private set; } = "aim_down";
|
||||
|
||||
[ExportCategory("Action Names")]
|
||||
[Export] private string _shootActionName = "shoot";
|
||||
[Export] private string _useActionName = "Use";
|
||||
[Export] private string _scanActionName = "scan";
|
||||
[Export] private string _strafeActionName = "strafe";
|
||||
[Export] private string _nextWeaponActionName = "next_weapon";
|
||||
[Export] private string _previousWeaponActionName = "previous_weapon";
|
||||
[Export] private string _inventoryActionName = "inventory";
|
||||
[Export] private string _pauseActionName = "pause";
|
||||
[Export] private StringName _shootActionName = "shoot";
|
||||
[Export] private StringName _useActionName = "Use";
|
||||
[Export] private StringName _scanActionName = "scan";
|
||||
[Export] private StringName _strafeActionName = "strafe";
|
||||
[Export] private StringName _nextWeaponActionName = "next_weapon";
|
||||
[Export] private StringName _previousWeaponActionName = "previous_weapon";
|
||||
[Export] private StringName _inventoryActionName = "inventory";
|
||||
[Export] private StringName _pauseActionName = "pause";
|
||||
|
||||
public override Vector2 GetMovementInput()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,21 +16,33 @@ public partial class PlayerAnimationProvider : Node2D
|
|||
|
||||
[ExportCategory("Animation Names")]
|
||||
[Export]
|
||||
public string WalkRightAnimationName {get; private set;} = "walk_right";
|
||||
public StringName WalkRightAnimationName {get; private set;} = "walk_right";
|
||||
|
||||
[Export]
|
||||
public string WalkLeftAnimationName {get; private set;} = "walk_left";
|
||||
public StringName WalkLeftAnimationName {get; private set;} = "walk_left";
|
||||
[Export]
|
||||
public string WalkDownAnimationName {get; private set;} = "walk_down";
|
||||
public StringName WalkDownAnimationName {get; private set;} = "walk_down";
|
||||
[Export]
|
||||
public string WalkUpAnimationName {get; private set;} = "walk_up";
|
||||
public StringName WalkUpAnimationName {get; private set;} = "walk_up";
|
||||
|
||||
[ExportCategory("Shaders")]
|
||||
[Export] public ShaderMaterial BlinkMaterial {get; private set;}
|
||||
|
||||
[Export] public StringName BlinkShaderPropertyName { get; private set; } = new StringName("blink_intensity");
|
||||
[Export] public StringName BlinkShaderPropertyName { get; private set; } = new("blink_intensity");
|
||||
[Export] public StringName TeleportProgressPropertyName { get; private set; } = new("teleport_progress");
|
||||
[Export] public StringName ScanlineDensityPropertyName { get; private set; } = new("scanline_density");
|
||||
|
||||
private GTween _blinkTween;
|
||||
|
||||
public void ShowSprite()
|
||||
{
|
||||
_animatedSprite.Show();
|
||||
}
|
||||
|
||||
public void HideSprite()
|
||||
{
|
||||
_animatedSprite.Hide();
|
||||
}
|
||||
|
||||
public void SetAnimation(Vector2 velocity)
|
||||
{
|
||||
|
|
@ -78,6 +90,38 @@ public partial class PlayerAnimationProvider : Node2D
|
|||
_blinkTween.Play();
|
||||
}
|
||||
|
||||
public void PlayTeleportAnimation()
|
||||
{
|
||||
if (BlinkMaterial == null) return;
|
||||
_animatedSprite.Material = BlinkMaterial;
|
||||
var material = ((ShaderMaterial)_animatedSprite.Material);
|
||||
_blinkTween?.Kill();
|
||||
_blinkTween = GTweenSequenceBuilder.New()
|
||||
.Append(material.TweenPropertyFloat(TeleportProgressPropertyName, 0f, 0f))
|
||||
.Append(material.TweenPropertyFloat(ScanlineDensityPropertyName, 0f, 0f))
|
||||
.Append(material.TweenPropertyFloat(ScanlineDensityPropertyName,50f,0.5f))
|
||||
.Join(material.TweenPropertyFloat(TeleportProgressPropertyName, 1f,0.5f))
|
||||
.Build();
|
||||
|
||||
_blinkTween.Play();
|
||||
}
|
||||
|
||||
public void PlayUnteleportAnimation()
|
||||
{
|
||||
if (BlinkMaterial == null) return;
|
||||
_animatedSprite.Material = BlinkMaterial;
|
||||
var material = ((ShaderMaterial)_animatedSprite.Material);
|
||||
_blinkTween?.Kill();
|
||||
_blinkTween = GTweenSequenceBuilder.New()
|
||||
.Append(material.TweenPropertyFloat(TeleportProgressPropertyName, 1f, 0f))
|
||||
.Append(material.TweenPropertyFloat(ScanlineDensityPropertyName, 50f, 0f))
|
||||
.Append(material.TweenPropertyFloat(ScanlineDensityPropertyName,0f,0.5f))
|
||||
.Join(material.TweenPropertyFloat(TeleportProgressPropertyName, 0f,0.5f))
|
||||
.Build();
|
||||
|
||||
_blinkTween.Play();
|
||||
}
|
||||
|
||||
private void SetShaderTeleportProgress(float value)
|
||||
{
|
||||
((ShaderMaterial)_animatedSprite.Material).SetShaderParameter("teleport_progress", value);
|
||||
|
|
@ -103,4 +147,6 @@ public partial class PlayerAnimationProvider : Node2D
|
|||
{
|
||||
_shieldParticles.Emitting = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -8,9 +8,21 @@ public partial class PlayerHitboxSpriteProvider : Node2D
|
|||
public AnimatedSprite2D Hitbox { get; private set; }
|
||||
[Export]
|
||||
public AnimatedSprite2D Circle { get; private set; }
|
||||
[Export]
|
||||
public AnimatedSprite2D Square { get; private set; }
|
||||
|
||||
[Export] public float RotationSpeed { get; private set; } = 10f;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (!Visible) return;
|
||||
Circle.Rotate((float)(RotationSpeed * delta));
|
||||
Square.Rotate((float)(-RotationSpeed * delta));
|
||||
}
|
||||
|
||||
public void SetVisibility(bool isVisible)
|
||||
{
|
||||
if (isVisible == Visible) return;
|
||||
if (isVisible)
|
||||
{
|
||||
Show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue