refactor file scoped namespace
parent
96fd6f5c26
commit
706354e813
|
@ -1,11 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using SupaLidlGame.Utils;
|
using SupaLidlGame.Utils;
|
||||||
|
|
||||||
namespace SupaLidlGame.BoundingBoxes
|
namespace SupaLidlGame.BoundingBoxes;
|
||||||
|
|
||||||
|
public abstract partial class BoundingBox : Area2D, IFaction
|
||||||
{
|
{
|
||||||
public abstract partial class BoundingBox : Area2D, IFaction
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public ushort Faction { get; set; }
|
public ushort Faction { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using System;
|
using System;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
|
|
||||||
namespace SupaLidlGame.BoundingBoxes
|
namespace SupaLidlGame.BoundingBoxes;
|
||||||
|
|
||||||
|
public partial class ConnectorBox : Area2D
|
||||||
{
|
{
|
||||||
public partial class ConnectorBox : Area2D
|
|
||||||
{
|
|
||||||
[Signal]
|
[Signal]
|
||||||
public delegate void RequestedEnterEventHandler(
|
public delegate void RequestedEnterEventHandler(
|
||||||
ConnectorBox box,
|
ConnectorBox box,
|
||||||
|
@ -68,5 +68,4 @@ namespace SupaLidlGame.BoundingBoxes
|
||||||
|
|
||||||
base._Process(delta);
|
base._Process(delta);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
using SupaLidlGame.Items;
|
using SupaLidlGame.Items;
|
||||||
|
|
||||||
namespace SupaLidlGame.BoundingBoxes
|
namespace SupaLidlGame.BoundingBoxes;
|
||||||
|
|
||||||
|
public partial class Hitbox : BoundingBox
|
||||||
{
|
{
|
||||||
public partial class Hitbox : BoundingBox
|
|
||||||
{
|
|
||||||
private HashSet<BoundingBox> _ignoreList = new HashSet<BoundingBox>();
|
private HashSet<BoundingBox> _ignoreList = new HashSet<BoundingBox>();
|
||||||
|
|
||||||
[Signal]
|
[Signal]
|
||||||
|
@ -101,5 +101,4 @@ namespace SupaLidlGame.BoundingBoxes
|
||||||
{
|
{
|
||||||
get => _ignoreList;
|
get => _ignoreList;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
using SupaLidlGame.Utils;
|
using SupaLidlGame.Utils;
|
||||||
|
|
||||||
namespace SupaLidlGame.BoundingBoxes
|
namespace SupaLidlGame.BoundingBoxes;
|
||||||
|
|
||||||
|
public partial class Hurtbox : BoundingBox, IFaction
|
||||||
{
|
{
|
||||||
public partial class Hurtbox : BoundingBox, IFaction
|
|
||||||
{
|
|
||||||
[Signal]
|
[Signal]
|
||||||
public delegate void ReceivedDamageEventHandler(
|
public delegate void ReceivedDamageEventHandler(
|
||||||
float damage,
|
float damage,
|
||||||
|
@ -36,5 +36,4 @@ namespace SupaLidlGame.BoundingBoxes
|
||||||
knockback,
|
knockback,
|
||||||
knockbackOrigin, knockbackVector);
|
knockbackOrigin, knockbackVector);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,10 @@ using SupaLidlGame.Items;
|
||||||
using SupaLidlGame.Utils;
|
using SupaLidlGame.Utils;
|
||||||
using SupaLidlGame.State.Character;
|
using SupaLidlGame.State.Character;
|
||||||
|
|
||||||
namespace SupaLidlGame.Characters
|
namespace SupaLidlGame.Characters;
|
||||||
|
|
||||||
|
public partial class Character : CharacterBody2D, IFaction
|
||||||
{
|
{
|
||||||
public partial class Character : CharacterBody2D, IFaction
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public float Speed { get; protected set; } = 32.0f;
|
public float Speed { get; protected set; } = 32.0f;
|
||||||
|
|
||||||
|
@ -220,5 +220,4 @@ namespace SupaLidlGame.Characters
|
||||||
sound.At(GlobalPosition).WithPitchDeviation(0.125f).Play();
|
sound.At(GlobalPosition).WithPitchDeviation(0.125f).Play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Characters
|
namespace SupaLidlGame.Characters;
|
||||||
|
|
||||||
|
public partial class Enemy : NPC
|
||||||
{
|
{
|
||||||
public partial class Enemy : NPC
|
|
||||||
{
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
Inventory.SelectedItem = Inventory.GetNode<Items.Item>("Sword");
|
Inventory.SelectedItem = Inventory.GetNode<Items.Item>("Sword");
|
||||||
|
@ -15,5 +15,4 @@ namespace SupaLidlGame.Characters
|
||||||
{
|
{
|
||||||
base.Die();
|
base.Die();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ using SupaLidlGame.Extensions;
|
||||||
using SupaLidlGame.Items;
|
using SupaLidlGame.Items;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Characters
|
namespace SupaLidlGame.Characters;
|
||||||
|
|
||||||
|
public partial class NPC : Character
|
||||||
{
|
{
|
||||||
public partial class NPC : Character
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Time in seconds it takes for the NPC to think FeelsDankCube
|
/// Time in seconds it takes for the NPC to think FeelsDankCube
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -225,5 +225,4 @@ namespace SupaLidlGame.Characters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using SupaLidlGame.Utils;
|
using SupaLidlGame.Utils;
|
||||||
|
|
||||||
namespace SupaLidlGame.Characters
|
namespace SupaLidlGame.Characters;
|
||||||
|
|
||||||
|
public partial class Player : Character
|
||||||
{
|
{
|
||||||
public partial class Player : Character
|
|
||||||
{
|
|
||||||
private AnimatedSprite2D _sprite;
|
private AnimatedSprite2D _sprite;
|
||||||
private string _spriteAnim;
|
private string _spriteAnim;
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ namespace SupaLidlGame.Characters
|
||||||
{
|
{
|
||||||
// the Player.Animation property might be set before this node is
|
// the Player.Animation property might be set before this node is
|
||||||
// even ready, so if _sprite is null, then we just hold the new
|
// even ready, so if _sprite is null, then we just hold the new
|
||||||
// animation in a temp value, which will be assigned once this
|
// animation in a temp value, which will be assigned once this node
|
||||||
// node is ready
|
// is ready
|
||||||
if (_sprite is null)
|
if (_sprite is null)
|
||||||
{
|
{
|
||||||
_spriteAnim = value;
|
_spriteAnim = value;
|
||||||
|
@ -61,5 +61,4 @@ namespace SupaLidlGame.Characters
|
||||||
GD.Print("died");
|
GD.Print("died");
|
||||||
//base.Die();
|
//base.Die();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
namespace SupaLidlGame.Characters.Thinkers
|
namespace SupaLidlGame.Characters.Thinkers;
|
||||||
|
|
||||||
|
public class Thinker
|
||||||
{
|
{
|
||||||
public class Thinker
|
|
||||||
{
|
|
||||||
public virtual void Think()
|
public virtual void Think()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Entities
|
namespace SupaLidlGame.Entities;
|
||||||
|
|
||||||
|
public partial class Campfire : StaticBody2D
|
||||||
{
|
{
|
||||||
public partial class Campfire : StaticBody2D
|
|
||||||
{
|
|
||||||
private PointLight2D _light;
|
private PointLight2D _light;
|
||||||
|
|
||||||
[Signal]
|
[Signal]
|
||||||
|
@ -20,5 +20,4 @@ namespace SupaLidlGame.Entities
|
||||||
_light.Energy += (GD.Randf() - 0.5f) * 8 * (float)delta;
|
_light.Energy += (GD.Randf() - 0.5f) * 8 * (float)delta;
|
||||||
_light.Energy = Math.Clamp(_light.Energy, 1.2f, 2.0f);
|
_light.Energy = Math.Clamp(_light.Energy, 1.2f, 2.0f);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
using SupaLidlGame.BoundingBoxes;
|
using SupaLidlGame.BoundingBoxes;
|
||||||
|
|
||||||
namespace SupaLidlGame.Entities
|
namespace SupaLidlGame.Entities;
|
||||||
|
|
||||||
|
public partial class Projectile : RigidBody2D
|
||||||
{
|
{
|
||||||
public partial class Projectile : RigidBody2D
|
|
||||||
{
|
|
||||||
public Vector2 Velocity => Direction * Speed;
|
public Vector2 Velocity => Direction * Speed;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
|
@ -48,5 +48,4 @@ namespace SupaLidlGame.Entities
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using System;
|
using System;
|
||||||
using SupaLidlGame.Utils;
|
using SupaLidlGame.Utils;
|
||||||
|
|
||||||
namespace SupaLidlGame.Extensions
|
namespace SupaLidlGame.Extensions;
|
||||||
|
|
||||||
|
public static class AudioStreamPlayer2DExtensions
|
||||||
{
|
{
|
||||||
public static class AudioStreamPlayer2DExtensions
|
|
||||||
{
|
|
||||||
public static AudioStreamPlayer2D Clone(
|
public static AudioStreamPlayer2D Clone(
|
||||||
this AudioStreamPlayer2D audio)
|
this AudioStreamPlayer2D audio)
|
||||||
{
|
{
|
||||||
|
@ -69,5 +69,4 @@ namespace SupaLidlGame.Extensions
|
||||||
audio.PitchScale = (float)GD.Randfn(audio.PitchScale, deviation);
|
audio.PitchScale = (float)GD.Randfn(audio.PitchScale, deviation);
|
||||||
return audio;
|
return audio;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.Extensions
|
namespace SupaLidlGame.Extensions;
|
||||||
|
|
||||||
|
public static class NodeExtensions
|
||||||
{
|
{
|
||||||
public static class NodeExtensions
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Iterates through each ancestor until it finds an ancestor of type
|
/// Iterates through each ancestor until it finds an ancestor of type
|
||||||
/// <c>T</c>
|
/// <c>T</c>
|
||||||
|
@ -37,5 +37,4 @@ namespace SupaLidlGame.Extensions
|
||||||
{
|
{
|
||||||
return node.GetNode(name) as T;
|
return node.GetNode(name) as T;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.Extensions
|
namespace SupaLidlGame.Extensions;
|
||||||
|
|
||||||
|
public static class Node2DExtensions
|
||||||
{
|
{
|
||||||
public static class Node2DExtensions
|
|
||||||
{
|
|
||||||
public static void RayCast(this Node2D node, Vector2 ray)
|
public static void RayCast(this Node2D node, Vector2 ray)
|
||||||
{
|
{
|
||||||
//var spaceState = node.GetWorld2d().DirectSpaceState;
|
//var spaceState = node.GetWorld2d().DirectSpaceState;
|
||||||
//var result = spaceState.IntersectRay();
|
//var result = spaceState.IntersectRay();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.Extensions
|
namespace SupaLidlGame.Extensions;
|
||||||
|
|
||||||
|
public static class Vector2Extensions
|
||||||
{
|
{
|
||||||
public static class Vector2Extensions
|
|
||||||
{
|
|
||||||
public static Vector2 Midpoint(this Vector2 vector, Vector2 other)
|
public static Vector2 Midpoint(this Vector2 vector, Vector2 other)
|
||||||
{
|
{
|
||||||
return new Vector2((vector.X + other.X) / 2,
|
return new Vector2((vector.X + other.X) / 2,
|
||||||
|
@ -37,5 +37,4 @@ namespace SupaLidlGame.Extensions
|
||||||
{
|
{
|
||||||
return new Vector2(vector.Y, -vector.X);
|
return new Vector2(vector.Y, -vector.X);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
using Godot.Collections;
|
using Godot.Collections;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items
|
namespace SupaLidlGame.Items;
|
||||||
|
|
||||||
|
public partial class Inventory : Node2D
|
||||||
{
|
{
|
||||||
public partial class Inventory : Node2D
|
|
||||||
{
|
|
||||||
public Character Character { get; private set; }
|
public Character Character { get; private set; }
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
|
@ -142,5 +142,4 @@ namespace SupaLidlGame.Items
|
||||||
var e = SelectedItem = item;
|
var e = SelectedItem = item;
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items
|
namespace SupaLidlGame.Items;
|
||||||
|
|
||||||
|
public abstract partial class Item : Node2D
|
||||||
{
|
{
|
||||||
public abstract partial class Item : Node2D
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public string ItemName { get; set; }
|
public string ItemName { get; set; }
|
||||||
|
|
||||||
|
@ -49,5 +49,4 @@ namespace SupaLidlGame.Items
|
||||||
public abstract void Use();
|
public abstract void Use();
|
||||||
|
|
||||||
public abstract void Deuse();
|
public abstract void Deuse();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using SupaLidlGame.BoundingBoxes;
|
using SupaLidlGame.BoundingBoxes;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items
|
namespace SupaLidlGame.Items;
|
||||||
|
|
||||||
|
public abstract partial class Weapon : Item
|
||||||
{
|
{
|
||||||
public abstract partial class Weapon : Item
|
|
||||||
{
|
|
||||||
public double RemainingUseTime { get; protected set; } = 0;
|
public double RemainingUseTime { get; protected set; } = 0;
|
||||||
|
|
||||||
public override bool IsUsing => RemainingUseTime > 0;
|
public override bool IsUsing => RemainingUseTime > 0;
|
||||||
|
@ -106,5 +106,4 @@ namespace SupaLidlGame.Items
|
||||||
hurtbox.InflictDamage(Damage, Character, Knockback);
|
hurtbox.InflictDamage(Damage, Character, Knockback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
namespace SupaLidlGame.Items.Weapons
|
namespace SupaLidlGame.Items.Weapons;
|
||||||
|
|
||||||
|
public interface IParryable
|
||||||
{
|
{
|
||||||
public interface IParryable
|
|
||||||
{
|
|
||||||
public bool IsParryable { get; }
|
public bool IsParryable { get; }
|
||||||
public bool IsParried { get; }
|
public bool IsParried { get; }
|
||||||
public ulong ParryTimeOrigin { get; }
|
public ulong ParryTimeOrigin { get; }
|
||||||
public void Stun();
|
public void Stun();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using SupaLidlGame.Extensions;
|
using SupaLidlGame.Extensions;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items.Weapons
|
namespace SupaLidlGame.Items.Weapons;
|
||||||
|
|
||||||
|
public partial class Railgun : Ranged
|
||||||
{
|
{
|
||||||
public partial class Railgun : Ranged
|
|
||||||
{
|
|
||||||
public override void Attack()
|
public override void Attack()
|
||||||
{
|
{
|
||||||
// create projectile
|
// create projectile
|
||||||
|
@ -18,5 +18,4 @@ namespace SupaLidlGame.Items.Weapons
|
||||||
this.GetAncestor<SupaLidlGame.Scenes.Map>()
|
this.GetAncestor<SupaLidlGame.Scenes.Map>()
|
||||||
.Entities.AddChild(projectile);
|
.Entities.AddChild(projectile);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items.Weapons
|
namespace SupaLidlGame.Items.Weapons;
|
||||||
|
|
||||||
|
public abstract partial class Ranged : Weapon
|
||||||
{
|
{
|
||||||
public abstract partial class Ranged : Weapon
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public float AngleDeviation { get; set; }
|
public float AngleDeviation { get; set; }
|
||||||
|
|
||||||
|
@ -39,5 +39,4 @@ namespace SupaLidlGame.Items.Weapons
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void Attack();
|
public abstract void Attack();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,10 @@ using SupaLidlGame.Characters;
|
||||||
using SupaLidlGame.Extensions;
|
using SupaLidlGame.Extensions;
|
||||||
using SupaLidlGame.State.Weapon;
|
using SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
namespace SupaLidlGame.Items.Weapons
|
namespace SupaLidlGame.Items.Weapons;
|
||||||
|
|
||||||
|
public partial class Sword : Weapon, IParryable
|
||||||
{
|
{
|
||||||
public partial class Sword : Weapon, IParryable
|
|
||||||
{
|
|
||||||
public bool IsAttacking { get; protected set; }
|
public bool IsAttacking { get; protected set; }
|
||||||
|
|
||||||
public override bool IsUsing => StateMachine.CurrentState
|
public override bool IsUsing => StateMachine.CurrentState
|
||||||
|
@ -233,5 +233,4 @@ namespace SupaLidlGame.Items.Weapons
|
||||||
{
|
{
|
||||||
AnimationTree.Set("parameters/conditions/" + condition, value);
|
AnimationTree.Set("parameters/conditions/" + condition, value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
[ext_resource type="Script" path="res://Utils/World.cs" id="1_1k6ew"]
|
[ext_resource type="Script" path="res://Utils/World.cs" id="1_1k6ew"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bxtpv6jqodj4v" path="res://Scenes/Maps/Hills.tscn" id="2_juio7"]
|
[ext_resource type="PackedScene" uid="uid://bxtpv6jqodj4v" path="res://Scenes/Maps/Hills.tscn" id="2_juio7"]
|
||||||
|
|
||||||
[node name="World" type="Node2D" node_paths=PackedStringArray("CurrentPlayer")]
|
[node name="World" type="Node2D"]
|
||||||
script = ExtResource("1_1k6ew")
|
script = ExtResource("1_1k6ew")
|
||||||
StartingArea = ExtResource("2_juio7")
|
StartingArea = ExtResource("2_juio7")
|
||||||
CurrentPlayer = NodePath("")
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Scenes
|
namespace SupaLidlGame.Scenes;
|
||||||
|
|
||||||
|
public partial class Map : TileMap
|
||||||
{
|
{
|
||||||
public partial class Map : TileMap
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public Node2D Entities { get; set; }
|
public Node2D Entities { get; set; }
|
||||||
|
|
||||||
|
@ -44,5 +44,4 @@ namespace SupaLidlGame.Scenes
|
||||||
{
|
{
|
||||||
base._Process(delta);
|
base._Process(delta);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public abstract partial class CharacterState : Node, IState<CharacterState>
|
||||||
{
|
{
|
||||||
public abstract partial class CharacterState : Node, IState<CharacterState>
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public Characters.Character Character { get; set; }
|
public Characters.Character Character { get; set; }
|
||||||
|
|
||||||
|
@ -66,5 +66,4 @@ namespace SupaLidlGame.State.Character
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual CharacterState Input(InputEvent @event) => null;
|
public virtual CharacterState Input(InputEvent @event) => null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class CharacterStateMachine : StateMachine<CharacterState>
|
||||||
{
|
{
|
||||||
public partial class CharacterStateMachine : StateMachine<CharacterState>
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public override CharacterState InitialState { get; set; }
|
public override CharacterState InitialState { get; set; }
|
||||||
|
|
||||||
|
@ -36,5 +36,4 @@ namespace SupaLidlGame.State.Character
|
||||||
ChangeState(state);
|
ChangeState(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class NPCIdleState : NPCState
|
||||||
{
|
{
|
||||||
public partial class NPCIdleState : NPCState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public CharacterState MoveState { get; set; }
|
public CharacterState MoveState { get; set; }
|
||||||
|
|
||||||
|
@ -22,5 +22,4 @@ namespace SupaLidlGame.State.Character
|
||||||
Character.Sprite.Play("idle");
|
Character.Sprite.Play("idle");
|
||||||
return base.Enter(previousState);
|
return base.Enter(previousState);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class NPCMoveState : NPCState
|
||||||
{
|
{
|
||||||
public partial class NPCMoveState : NPCState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public CharacterState IdleState { get; set; }
|
public CharacterState IdleState { get; set; }
|
||||||
|
|
||||||
|
@ -22,5 +22,4 @@ namespace SupaLidlGame.State.Character
|
||||||
Character.Sprite.Play("move");
|
Character.Sprite.Play("move");
|
||||||
return base.Enter(prev);
|
return base.Enter(prev);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public abstract partial class NPCState : CharacterState
|
||||||
{
|
{
|
||||||
public abstract partial class NPCState : CharacterState
|
|
||||||
{
|
|
||||||
protected Characters.NPC _npc => Character as Characters.NPC;
|
protected Characters.NPC _npc => Character as Characters.NPC;
|
||||||
|
|
||||||
public override CharacterState Process(double delta)
|
public override CharacterState Process(double delta)
|
||||||
|
@ -9,5 +9,4 @@ namespace SupaLidlGame.State.Character
|
||||||
_npc.ThinkProcess(delta);
|
_npc.ThinkProcess(delta);
|
||||||
return base.Process(delta);
|
return base.Process(delta);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class PlayerIdleState : PlayerState
|
||||||
{
|
{
|
||||||
public partial class PlayerIdleState : PlayerState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public CharacterState MoveState { get; set; }
|
public CharacterState MoveState { get; set; }
|
||||||
|
|
||||||
|
@ -34,5 +34,4 @@ namespace SupaLidlGame.State.Character
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class PlayerMoveState : PlayerState
|
||||||
{
|
{
|
||||||
public partial class PlayerMoveState : PlayerState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public PlayerRollState RollState { get; set; }
|
public PlayerRollState RollState { get; set; }
|
||||||
|
|
||||||
|
@ -42,5 +42,4 @@ namespace SupaLidlGame.State.Character
|
||||||
}
|
}
|
||||||
return base.Input(@event);
|
return base.Input(@event);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public partial class PlayerRollState : PlayerState
|
||||||
{
|
{
|
||||||
public partial class PlayerRollState : PlayerState
|
|
||||||
{
|
|
||||||
private double _timeLeftToRoll = 0;
|
private double _timeLeftToRoll = 0;
|
||||||
|
|
||||||
private Vector2 _rollDirection = Vector2.Zero;
|
private Vector2 _rollDirection = Vector2.Zero;
|
||||||
|
@ -35,5 +35,4 @@ namespace SupaLidlGame.State.Character
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using SupaLidlGame.Characters;
|
using SupaLidlGame.Characters;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Character
|
namespace SupaLidlGame.State.Character;
|
||||||
|
|
||||||
|
public abstract partial class PlayerState : CharacterState
|
||||||
{
|
{
|
||||||
public abstract partial class PlayerState : CharacterState
|
|
||||||
{
|
|
||||||
protected Player _player => Character as Player;
|
protected Player _player => Character as Player;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
|
@ -68,5 +68,4 @@ namespace SupaLidlGame.State.Character
|
||||||
|
|
||||||
return base.Process(delta);
|
return base.Process(delta);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
namespace SupaLidlGame.State
|
namespace SupaLidlGame.State;
|
||||||
|
|
||||||
|
public interface IState<T> where T : IState<T>
|
||||||
{
|
{
|
||||||
public interface IState<T> where T : IState<T>
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when this state is entered
|
/// Called when this state is entered
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -19,5 +19,4 @@ namespace SupaLidlGame.State
|
||||||
public void Exit(IState<T> nextState);
|
public void Exit(IState<T> nextState);
|
||||||
|
|
||||||
public IState<T> Process(double delta) => null;
|
public IState<T> Process(double delta) => null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State
|
namespace SupaLidlGame.State;
|
||||||
|
|
||||||
|
public abstract partial class StateMachine<T> : Node where T : IState<T>
|
||||||
{
|
{
|
||||||
public abstract partial class StateMachine<T> : Node where T : IState<T>
|
|
||||||
{
|
|
||||||
public T CurrentState { get; protected set; }
|
public T CurrentState { get; protected set; }
|
||||||
|
|
||||||
public abstract T InitialState { get; set; }
|
public abstract T InitialState { get; set; }
|
||||||
|
@ -37,5 +37,4 @@ namespace SupaLidlGame.State
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class RangedFireState : WeaponState
|
||||||
{
|
{
|
||||||
public partial class RangedFireState : WeaponState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public Items.Weapons.Ranged Weapon { get; set; }
|
public Items.Weapons.Ranged Weapon { get; set; }
|
||||||
|
|
||||||
|
@ -34,5 +34,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class RangedIdleState : WeaponState
|
||||||
{
|
{
|
||||||
public partial class RangedIdleState : WeaponState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public RangedFireState FireState { get; set; }
|
public RangedFireState FireState { get; set; }
|
||||||
|
|
||||||
|
@ -25,5 +25,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
{
|
{
|
||||||
Weapon.Visible = true;
|
Weapon.Visible = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class SwordAnticipateState : WeaponState
|
||||||
{
|
{
|
||||||
public partial class SwordAnticipateState : WeaponState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public SupaLidlGame.Items.Weapons.Sword Sword { get; set; }
|
public SupaLidlGame.Items.Weapons.Sword Sword { get; set; }
|
||||||
|
|
||||||
|
@ -42,5 +42,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class SwordAttackState : WeaponState
|
||||||
{
|
{
|
||||||
public partial class SwordAttackState : WeaponState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public SupaLidlGame.Items.Weapons.Sword Sword { get; set; }
|
public SupaLidlGame.Items.Weapons.Sword Sword { get; set; }
|
||||||
|
|
||||||
|
@ -85,5 +85,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class SwordIdleState : WeaponState
|
||||||
{
|
{
|
||||||
public partial class SwordIdleState : WeaponState
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public SwordAnticipateState AnticipateState { get; set; }
|
public SwordAnticipateState AnticipateState { get; set; }
|
||||||
|
|
||||||
|
@ -48,5 +48,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public abstract partial class WeaponState : Node, IState<WeaponState>
|
||||||
{
|
{
|
||||||
public abstract partial class WeaponState : Node, IState<WeaponState>
|
|
||||||
{
|
|
||||||
public virtual WeaponState Use() => null;
|
public virtual WeaponState Use() => null;
|
||||||
|
|
||||||
public virtual WeaponState Deuse() => null;
|
public virtual WeaponState Deuse() => null;
|
||||||
|
@ -16,5 +16,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IState<WeaponState> Process(double delta) => null;
|
public virtual IState<WeaponState> Process(double delta) => null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.State.Weapon
|
namespace SupaLidlGame.State.Weapon;
|
||||||
|
|
||||||
|
public partial class WeaponStateMachine : StateMachine<WeaponState>
|
||||||
{
|
{
|
||||||
public partial class WeaponStateMachine : StateMachine<WeaponState>
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public override WeaponState InitialState { get; set; }
|
public override WeaponState InitialState { get; set; }
|
||||||
|
|
||||||
|
@ -33,5 +33,4 @@ namespace SupaLidlGame.State.Weapon
|
||||||
ChangeState(s);
|
ChangeState(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using SupaLidlGame.Extensions;
|
using SupaLidlGame.Extensions;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Prototyping
|
namespace SupaLidlGame.Prototyping;
|
||||||
|
|
||||||
|
public partial class ContextBasedSteering : Node2D
|
||||||
{
|
{
|
||||||
public partial class ContextBasedSteering : Node2D
|
|
||||||
{
|
|
||||||
public float PreferredDistance { get; set; } = 256.0f;
|
public float PreferredDistance { get; set; } = 256.0f;
|
||||||
Vector2 _direction;
|
Vector2 _direction;
|
||||||
|
|
||||||
|
@ -54,5 +54,4 @@ namespace SupaLidlGame.Prototyping
|
||||||
{
|
{
|
||||||
DrawLine(Vector2.Zero, _direction * 256, Colors.Green);
|
DrawLine(Vector2.Zero, _direction * 256, Colors.Green);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.UI
|
namespace SupaLidlGame.UI;
|
||||||
|
|
||||||
|
public partial class FloatingText : Node2D
|
||||||
{
|
{
|
||||||
public partial class FloatingText : Node2D
|
|
||||||
{
|
|
||||||
private Label _label;
|
private Label _label;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
|
@ -47,5 +47,4 @@ namespace SupaLidlGame.UI
|
||||||
{
|
{
|
||||||
QueueFree();
|
QueueFree();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace SupaLidlGame.Utils
|
namespace SupaLidlGame.Utils;
|
||||||
|
|
||||||
|
public interface IFaction
|
||||||
{
|
{
|
||||||
public interface IFaction
|
|
||||||
{
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The faction index that this entity belongs to.
|
/// The faction index that this entity belongs to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Export]
|
[Export]
|
||||||
public ushort Faction { get; set; }
|
public ushort Faction { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using Godot;
|
using Godot;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace SupaLidlGame.Utils
|
namespace SupaLidlGame.Utils;
|
||||||
|
|
||||||
|
public partial class PlayerCamera : Camera2D
|
||||||
{
|
{
|
||||||
public partial class PlayerCamera : Camera2D
|
|
||||||
{
|
|
||||||
protected float _intensity;
|
protected float _intensity;
|
||||||
|
|
||||||
protected double _timeLeft;
|
protected double _timeLeft;
|
||||||
|
@ -46,5 +46,4 @@ namespace SupaLidlGame.Utils
|
||||||
ret.Y = (rng.Randf() - 0.5f) * intensity;
|
ret.Y = (rng.Randf() - 0.5f) * intensity;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ using Godot;
|
||||||
using Godot.Collections;
|
using Godot.Collections;
|
||||||
using SupaLidlGame.Extensions;
|
using SupaLidlGame.Extensions;
|
||||||
|
|
||||||
namespace SupaLidlGame.Utils
|
namespace SupaLidlGame.Utils;
|
||||||
|
|
||||||
|
public partial class Spawner : Node2D
|
||||||
{
|
{
|
||||||
public partial class Spawner : Node2D
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public Area2D SpawnArea { get; set; }
|
public Area2D SpawnArea { get; set; }
|
||||||
|
|
||||||
|
@ -55,5 +55,4 @@ namespace SupaLidlGame.Utils
|
||||||
this.GetAncestor<Scenes.Map>().Entities.AddChild(chr);
|
this.GetAncestor<Scenes.Map>().Entities.AddChild(chr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,10 @@ using SupaLidlGame.Extensions;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace SupaLidlGame.Utils
|
namespace SupaLidlGame.Utils;
|
||||||
|
|
||||||
|
public partial class World : Node2D
|
||||||
{
|
{
|
||||||
public partial class World : Node2D
|
|
||||||
{
|
|
||||||
[Export]
|
[Export]
|
||||||
public PackedScene StartingArea { get; set; }
|
public PackedScene StartingArea { get; set; }
|
||||||
|
|
||||||
|
@ -146,5 +146,4 @@ namespace SupaLidlGame.Utils
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue