Attempt to bring in other branch

This commit is contained in:
2024-09-18 16:51:27 -07:00
1389 changed files with 64824 additions and 2665 deletions

View File

@@ -0,0 +1,17 @@
shader_type canvas_item;
uniform float inner_radius = 0.1;
uniform float outer_radius = 1;
uniform float vignette_strength = 1.0;
uniform float dither_strength = 0.03;
uniform vec4 vignette_color: source_color;
void fragment() {
float dist = distance(UV, vec2(0.5));
float vignette = smoothstep(inner_radius, outer_radius, dist) * vignette_strength;
float dither = fract(sin(dot(UV, vec2(12.9898, 78.233))) * 43758.5453123) * dither_strength;
COLOR = vec4(vignette_color.rgb, vignette + dither);
}

View File

@@ -1,5 +1,4 @@
using Chickensoft.AutoInject;
using Chickensoft.Collections;
using Chickensoft.GodotNodeInterfaces;
using Chickensoft.Introspection;
using Chickensoft.SaveFileBuilder;
@@ -7,15 +6,19 @@ using Godot;
namespace GameJamDungeon
{
public interface IPlayer : ICharacterBody3D
public interface IPlayer : ICharacterBody3D, IKillable
{
PlayerStatInfo PlayerStatInfo { get; }
PlayerLogic PlayerLogic { get; }
PlayerData PlayerData { get; }
public Vector3 GetGlobalInputVector();
public float GetLeftStrafeInputVector();
public float GetRightStrafeInputVector();
event Player.InventoryButtonPressedEventHandler InventoryButtonPressed;
event Player.MinimapButtonHeldEventHandler MinimapButtonHeld;
event Player.PauseButtonPressedEventHandler PauseButtonPressed;
}
[Meta(typeof(IAutoNode))]
@@ -34,27 +37,20 @@ namespace GameJamDungeon
[Dependency]
public ISaveChunk<GameData> GameChunk => this.DependOn<ISaveChunk<GameData>>();
/// <summary>Rotation speed (quaternions?/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float RotationSpeed { get; set; } = 12.0f;
/// <summary>Player speed (meters/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float MoveSpeed { get; set; } = 8f;
/// <summary>Player speed (meters^2/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float Acceleration { get; set; } = 4f;
[Signal]
public delegate void InventoryButtonPressedEventHandler();
[Signal]
public delegate void MinimapButtonHeldEventHandler();
[Signal]
public delegate void PauseButtonPressedEventHandler();
[Export]
public PlayerStatInfo PlayerStatInfo { get; set; }
public PlayerStatResource PlayerStatResource { get; set; } = default!;
public PlayerLogic.Settings Settings { get; set; } = default!;
public PlayerLogic PlayerLogic { get; set; } = default!;
public PlayerData PlayerData { get; set; } = default!;
public PlayerLogic.IBinding PlayerBinding { get; set; } = default!;
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
@@ -65,21 +61,13 @@ namespace GameJamDungeon
[Node] public Timer HealthTimer { get; set; } = default!;
[Node] public Label HPNumber { get; set; } = default!;
[Node] public Label VTNumber { get; set; } = default!;
[Node] public ProgressBar HPBar { get; set; } = default!;
[Node] public ProgressBar VTBar { get; set; } = default!;
[Node] public IArea3D CollisionDetector { get; set; } = default!;
private IAutoProp<Weapon> EquippedWeapon { get; set; } = default!;
private PlayerData PlayerData { get; set; } = default!;
private AutoProp<double> _currentHP { get; set; } = default!;
private bool flipAttack = false;
private AutoProp<int> _currentVT { get; set; } = default!;
private float _healthTimerWaitTime = 3.0f;
public void Initialize()
{
@@ -88,7 +76,28 @@ namespace GameJamDungeon
public void Setup()
{
Settings = new PlayerLogic.Settings(RotationSpeed, MoveSpeed);
Settings = new PlayerLogic.Settings() { RotationSpeed = PlayerStatResource.RotationSpeed, MoveSpeed = PlayerStatResource.MoveSpeed, Acceleration = PlayerStatResource.Acceleration };
PlayerData = new PlayerData()
{
GlobalTransform = GlobalTransform,
StateMachine = PlayerLogic,
Velocity = Velocity,
Inventory = new Inventory(),
};
PlayerData.SetCurrentHP(PlayerStatResource.CurrentHP);
PlayerData.SetMaximumHP(PlayerStatResource.MaximumHP);
PlayerData.SetCurrentVT(PlayerStatResource.CurrentVT);
PlayerData.SetMaximumVT(PlayerStatResource.MaximumVT);
PlayerData.SetCurrentAttack(PlayerStatResource.CurrentAttack);
PlayerData.SetMaxAttack(PlayerStatResource.MaxAttack);
PlayerData.SetCurrentDefense(PlayerStatResource.CurrentDefense);
PlayerData.SetMaxDefense(PlayerStatResource.MaxDefense);
PlayerData.SetCurrentExp(PlayerStatResource.CurrentExp);
PlayerData.SetCurrentLevel(PlayerStatResource.CurrentLevel);
PlayerData.SetExpToNextLevel(PlayerStatResource.ExpToNextLevel);
PlayerData.SetLuck(PlayerStatResource.Luck);
PlayerLogic = new PlayerLogic();
PlayerLogic.Set(this as IPlayer);
@@ -97,24 +106,10 @@ namespace GameJamDungeon
PlayerLogic.Set(GameRepo);
PlayerLogic.Set(PlayerData);
GameRepo.SetPlayerGlobalPosition(GlobalPosition);
GameRepo.PlayerGlobalPosition.Sync += OnPlayerPositionUpdated;
PlayerData.Inventory.EquippedAccessory.Sync += EquippedAccessory_Sync;
PlayerData.CurrentHP.Sync += CurrentHP_Sync;
EquippedWeapon = new AutoProp<Weapon>(new Weapon());
EquippedWeapon.Sync += OnEquippedWeaponChanged;
_currentHP = new AutoProp<double>(PlayerStatInfo.MaximumHP);
_currentVT = new AutoProp<int>(PlayerStatInfo.MaximumVT);
_currentHP.Sync += OnHPChanged;
_currentVT.Sync += OnVTChanged;
HPBar.MaxValue = PlayerStatInfo.MaximumHP;
HPBar.Value = _currentHP.Value;
VTBar.MaxValue = PlayerStatInfo.MaximumVT;
VTBar.Value = _currentVT.Value;
HealthTimer.Timeout += OnHealthTimerTimeout;
CollisionDetector.AreaEntered += OnEnemyHitBoxEntered;
HealthTimer.WaitTime = _healthTimerWaitTime;
}
public void OnResolved()
@@ -129,17 +124,23 @@ namespace GameJamDungeon
})
.Handle((in PlayerLogic.Output.Animations.Attack output) =>
{
var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed;
AnimationPlayer.SetSpeedScale((float)attackSpeed);
AnimationPlayer.Play("attack");
})
.Handle((in PlayerLogic.Output.ThrowItem output) =>
{
ThrowItem();
});
this.Provide();
PlayerLogic.Start();
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
GameRepo.SetPlayerData(PlayerData);
GlobalPosition = GameRepo.PlayerGlobalPosition.Value;
GameRepo.PlayerGlobalPosition.Sync += PlayerGlobalPosition_Sync;
HealthTimer.Timeout += OnHealthTimerTimeout;
CollisionDetector.BodyEntered += CollisionDetector_BodyEntered;
PlayerData.Inventory.AccessoryUnequipped += Inventory_AccessoryUnequipped;
}
public void OnReady()
@@ -147,37 +148,48 @@ namespace GameJamDungeon
SetPhysicsProcess(true);
}
private void OnEnemyHitBoxEntered(Area3D area)
public override void _UnhandledInput(InputEvent @event)
{
if (area is IHitbox hitBox)
if (@event.IsActionPressed(GameInputs.Inventory))
{
if (_currentHP.Value > 0)
{
var enemy = hitBox.GetParent<IEnemy>();
var damage = DamageCalculator.CalculateEnemyDamage(hitBox.Damage, PlayerStatInfo, enemy.EnemyStatInfo, GameRepo.EquippedArmor);
_currentHP.OnNext(_currentHP.Value - damage);
GD.Print($"Player hit for {damage} damage.");
}
GD.Print("Inventory button pressed");
EmitSignal(SignalName.InventoryButtonPressed);
}
if (@event.IsActionPressed(GameInputs.MiniMap))
{
GD.Print("MiniMap button pressed");
EmitSignal(SignalName.MinimapButtonHeld);
}
if (@event.IsActionPressed(GameInputs.Pause))
{
GD.Print("Pause button pressed");
EmitSignal(SignalName.PauseButtonPressed);
}
if (@event.IsActionPressed(GameInputs.Attack))
PlayerLogic.Input(new PlayerLogic.Input.Attack());
if (@event.IsActionPressed(GameInputs.Sprint))
Settings.MoveSpeed *= 4;
if (@event.IsActionReleased(GameInputs.Sprint))
Settings.MoveSpeed /= 4;
}
public void OnPhysicsProcess(double delta)
{
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
var attackIsPressed = Input.IsActionJustPressed(GameInputs.Attack);
if (attackIsPressed)
PlayerLogic.Input(new PlayerLogic.Input.Attack());
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
MoveAndSlide();
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition));
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition, GlobalTransform));
}
public Vector3 GetGlobalInputVector()
{
var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
var input = new Vector3
{
X = rawInput.X,
@@ -186,14 +198,25 @@ namespace GameJamDungeon
return input with { Y = 0f };
}
public float GetLeftStrafeInputVector()
{
var leftStrafe = Input.GetActionStrength(GameInputs.StrafeLeft);
return leftStrafe;
}
public float GetRightStrafeInputVector()
{
var rightStrafe = Input.GetActionStrength(GameInputs.StrafeRight);
return rightStrafe;
}
public void ThrowItem()
{
var itemScene = GD.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn");
var throwItem = itemScene.Instantiate<IThrowableItem>();
var throwItem = itemScene.Instantiate<ThrowableItem>();
GetTree().Root.AddChildEx(throwItem);
throwItem.GlobalPosition = GameRepo.PlayerGlobalPosition.Value;
throwItem.GlobalRotation = GlobalRotation;
throwItem.AnimationPlayer.Play("throw");
}
public void OnAnimationFinished(StringName animation)
@@ -209,31 +232,63 @@ namespace GameJamDungeon
AnimationPlayer.AnimationFinished -= OnAnimationFinished;
}
private void OnEquippedWeaponChanged(Weapon info) => Hitbox.Damage = info.WeaponInfo.Damage;
public void Kill() => PlayerLogic.Input(new PlayerLogic.Input.Killed());
private void OnHPChanged(double newHP)
private void PlayerGlobalPosition_Sync(Vector3 newPlayerPosition)
{
HPNumber.Text = Mathf.RoundToInt(newHP).ToString();
HPBar.Value = newHP;
if (newHP <= 0.0)
PlayerLogic.Input(new PlayerLogic.Input.Killed());
}
private void OnVTChanged(int newVT)
{
VTNumber.Text = newVT.ToString();
VTBar.Value = newVT;
GlobalPosition = newPlayerPosition;
}
private void OnPlayerPositionUpdated(Vector3 globalPosition) => GlobalPosition = globalPosition;
private void OnHealthTimerTimeout()
{
if (_currentVT.Value > 0)
_currentVT.OnNext(_currentVT.Value - 1);
if (PlayerData.CurrentVT.Value > 0)
PlayerData.SetCurrentVT(PlayerData.CurrentVT.Value - 1);
else
_currentHP.OnNext(_currentHP.Value - 1);
PlayerData.SetCurrentHP(PlayerData.CurrentHP.Value - 1);
}
private void EquippedAccessory_Sync(Accessory equippedItem)
{
PlayerData.SetMaximumHP(PlayerData.MaximumHP.Value + equippedItem.AccessoryStats.MaxHPUp);
PlayerData.SetMaximumVT(PlayerData.MaximumVT.Value + equippedItem.AccessoryStats.MaxVTUp);
PlayerData.SetLuck(PlayerData.Luck.Value + equippedItem.AccessoryStats.LUCKUp);
if (equippedItem.AccessoryStats.AccessoryTags.Contains(AccessoryTag.HalfVTConsumption))
HealthTimer.WaitTime = _healthTimerWaitTime * 2;
}
private void Inventory_AccessoryUnequipped(AccessoryStats unequippedAccessory)
{
PlayerData.SetMaximumHP(PlayerData.MaximumHP.Value - unequippedAccessory.MaxHPUp);
PlayerData.SetMaximumVT(PlayerData.MaximumVT.Value - unequippedAccessory.MaxVTUp);
PlayerData.SetLuck(PlayerData.Luck.Value - unequippedAccessory.LUCKUp);
if (unequippedAccessory.AccessoryTags.Contains(AccessoryTag.HalfVTConsumption))
HealthTimer.WaitTime = _healthTimerWaitTime;
}
private void CollisionDetector_BodyEntered(Node3D body)
{
if (body is IHitbox hitBox)
{
var enemy = hitBox.GetParent<IEnemy>();
var isCriticalHit = false;
var rng = new RandomNumberGenerator();
rng.Randomize();
var roll = rng.Randf();
if (roll <= enemy.EnemyStatResource.Luck)
isCriticalHit = true;
var damage = DamageCalculator.CalculateEnemyDamage(PlayerData.CurrentDefense.Value + PlayerData.BonusDefense, enemy.EnemyStatResource, GameRepo.PlayerData.Inventory.EquippedArmor.Value.ArmorStats, isCriticalHit);
PlayerData.SetCurrentHP(PlayerData.CurrentHP.Value - Mathf.RoundToInt(damage));
GD.Print($"Player hit for {damage} damage.");
}
}
private void CurrentHP_Sync(int newHealth)
{
if (newHealth <= 0)
Kill();
}
}
}

View File

@@ -1,81 +1,228 @@
[gd_scene load_steps=20 format=3 uid="uid://cfecvvav8kkp6"]
[gd_scene load_steps=47 format=3 uid="uid://cfecvvav8kkp6"]
[ext_resource type="Script" path="res://src/player/Player.cs" id="1_xcol5"]
[ext_resource type="Texture2D" uid="uid://bokx3h8kfdo5i" path="res://src/player/slash_0000_Classic_30.png" id="2_la11l"]
[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"]
[ext_resource type="Resource" uid="uid://cofd1ylluj24" path="res://src/player/PlayerStats.tres" id="2_nuh2a"]
[ext_resource type="Texture2D" uid="uid://byosr5gk51237" path="res://src/player/slash_0001_Classic_29.png" id="3_ux3f1"]
[ext_resource type="Texture2D" uid="uid://nh071o6ii03j" path="res://src/player/slash_0002_Classic_28.png" id="4_gqnq0"]
[ext_resource type="Texture2D" uid="uid://bodfblud4kea3" path="res://src/player/slash_0003_Classic_27.png" id="5_eebal"]
[ext_resource type="Texture2D" uid="uid://de55prolicl0u" path="res://src/player/slash_0004_Classic_26.png" id="6_ngag5"]
[ext_resource type="Texture2D" uid="uid://bp0msic3uk3kc" path="res://src/player/slash_0005_Layer-1.png" id="7_tp5uu"]
[ext_resource type="Script" path="res://src/player/PlayerStatResource.cs" id="2_xq68d"]
[ext_resource type="Texture2D" uid="uid://c6r3dhnkuw22w" path="res://src/vfx/hit_effects/FIRE_STRIKE_1.0.png" id="5_wr6lo"]
[ext_resource type="Texture2D" uid="uid://b5qjlbcesth53" path="res://src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png" id="6_p34sl"]
[ext_resource type="Texture2D" uid="uid://mjobx7ph7hf1" path="res://src/vfx/playerdot.png" id="7_8hi2n"]
[ext_resource type="PackedScene" uid="uid://ctwtksu2406c" path="res://src/player/dont_look_in_here/player_model.tscn" id="10_prmgx"]
[sub_resource type="Resource" id="Resource_btp2w"]
script = ExtResource("2_xq68d")
RotationSpeed = 1.5
MoveSpeed = 3.0
Acceleration = 1.0
CurrentHP = 100
MaximumHP = 100
CurrentVT = 90
MaximumVT = 90
CurrentExp = 0
ExpToNextLevel = 100
CurrentLevel = 1
CurrentAttack = 14
CurrentDefense = 12
MaxAttack = 14
MaxDefense = 12
BonusAttack = 0
BonusDefense = 0
Luck = 0.05
[sub_resource type="BoxShape3D" id="BoxShape3D_wedu3"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dw45s"]
radius = 1.0
[sub_resource type="CapsuleMesh" id="CapsuleMesh_dmans"]
[sub_resource type="BoxShape3D" id="BoxShape3D_hs4wf"]
size = Vector3(1.94531, 2.43945, 2.35425)
[sub_resource type="Animation" id="Animation_hcjph"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SwordSlashAnimation:frame")
tracks/0/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_0jjwv"]
resource_name = "attack"
length = 0.7
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SwordSlashAnimation:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0667, 0.1667, 0.2667, 0.366667, 0.433333, 0.5, 0.6333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/1/path = NodePath("SwordSlashAnimation:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1667, 0.3333),
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_0jjwv"]
resource_name = "attack"
length = 0.916675
step = 0.0833333
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0833333, 0.333333),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("SwordSlashAnimation:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666667, 0.75, 0.833333, 0.916666),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
}
[sub_resource type="Animation" id="Animation_uxo8q"]
resource_name = "explosion"
length = 3.66668
step = 0.0833333
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"]
_data = {
"RESET": SubResource("Animation_hcjph"),
"attack": SubResource("Animation_0jjwv")
"attack": SubResource("Animation_0jjwv"),
"explosion": SubResource("Animation_uxo8q")
}
[sub_resource type="BoxShape3D" id="BoxShape3D_wedu3"]
[sub_resource type="AtlasTexture" id="AtlasTexture_irupf"]
atlas = ExtResource("6_p34sl")
region = Rect2(300, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_63m7j"]
atlas = ExtResource("6_p34sl")
region = Rect2(600, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_1ypgu"]
atlas = ExtResource("6_p34sl")
region = Rect2(900, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_d7qd7"]
atlas = ExtResource("6_p34sl")
region = Rect2(1200, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_7heog"]
atlas = ExtResource("6_p34sl")
region = Rect2(1500, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_x4mbv"]
atlas = ExtResource("6_p34sl")
region = Rect2(1800, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_f7ysd"]
atlas = ExtResource("6_p34sl")
region = Rect2(2100, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_i2p57"]
atlas = ExtResource("6_p34sl")
region = Rect2(2400, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_tfnlg"]
atlas = ExtResource("6_p34sl")
region = Rect2(2700, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_gvgtb"]
atlas = ExtResource("6_p34sl")
region = Rect2(3000, 0, 300, 300)
[sub_resource type="AtlasTexture" id="AtlasTexture_fha34"]
atlas = ExtResource("5_wr6lo")
region = Rect2(0, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_6es8e"]
atlas = ExtResource("5_wr6lo")
region = Rect2(450, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ajsk2"]
atlas = ExtResource("5_wr6lo")
region = Rect2(1350, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_m6lxd"]
atlas = ExtResource("5_wr6lo")
region = Rect2(2250, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_66iny"]
atlas = ExtResource("5_wr6lo")
region = Rect2(3150, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ifj8k"]
atlas = ExtResource("5_wr6lo")
region = Rect2(4050, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_0sse1"]
atlas = ExtResource("5_wr6lo")
region = Rect2(4950, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_biijj"]
atlas = ExtResource("5_wr6lo")
region = Rect2(5850, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ox7ae"]
atlas = ExtResource("5_wr6lo")
region = Rect2(6750, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_0jda2"]
atlas = ExtResource("5_wr6lo")
region = Rect2(7650, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_6i1pl"]
atlas = ExtResource("5_wr6lo")
region = Rect2(8550, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ivimc"]
atlas = ExtResource("5_wr6lo")
region = Rect2(9450, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_3pwkw"]
atlas = ExtResource("5_wr6lo")
region = Rect2(10350, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_fr7ff"]
atlas = ExtResource("5_wr6lo")
region = Rect2(11250, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_yopcg"]
atlas = ExtResource("5_wr6lo")
region = Rect2(12150, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_j6465"]
atlas = ExtResource("5_wr6lo")
region = Rect2(13050, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_sqdiu"]
atlas = ExtResource("5_wr6lo")
region = Rect2(13950, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_p3jka"]
atlas = ExtResource("5_wr6lo")
region = Rect2(0, 450, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_1g7qb"]
atlas = ExtResource("5_wr6lo")
region = Rect2(900, 450, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_7ab4x"]
atlas = ExtResource("5_wr6lo")
region = Rect2(1800, 450, 450, 450)
[sub_resource type="SpriteFrames" id="SpriteFrames_ywvvo"]
animations = [{
@@ -84,22 +231,34 @@ animations = [{
"texture": null
}, {
"duration": 1.0,
"texture": ExtResource("2_la11l")
"texture": SubResource("AtlasTexture_irupf")
}, {
"duration": 1.0,
"texture": ExtResource("3_ux3f1")
"texture": SubResource("AtlasTexture_63m7j")
}, {
"duration": 1.0,
"texture": ExtResource("4_gqnq0")
"texture": SubResource("AtlasTexture_1ypgu")
}, {
"duration": 1.0,
"texture": ExtResource("5_eebal")
"texture": SubResource("AtlasTexture_d7qd7")
}, {
"duration": 1.0,
"texture": ExtResource("6_ngag5")
"texture": SubResource("AtlasTexture_7heog")
}, {
"duration": 1.0,
"texture": ExtResource("7_tp5uu")
"texture": SubResource("AtlasTexture_x4mbv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f7ysd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_i2p57")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tfnlg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gvgtb")
}, {
"duration": 1.0,
"texture": null
@@ -107,49 +266,87 @@ animations = [{
"loop": false,
"name": &"attack",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_fha34")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6es8e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ajsk2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_m6lxd")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_66iny")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ifj8k")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0sse1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_biijj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ox7ae")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0jda2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6i1pl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ivimc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3pwkw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fr7ff")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yopcg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j6465")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sqdiu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p3jka")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1g7qb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7ab4x")
}, {
"duration": 1.0,
"texture": null
}],
"loop": false,
"name": &"attack_fire",
"speed": 12.0
}, {
"frames": [],
"loop": true,
"name": &"attack_water",
"speed": 12.0
}]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_kxbln"]
bg_color = Color(0, 0.411765, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_onron"]
bg_color = Color(0, 0.411765, 0, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_hs4wf"]
size = Vector3(1.94531, 2.43945, 1.08447)
[node name="Player" type="CharacterBody3D"]
collision_layer = 38
collision_mask = 7
axis_lock_linear_y = true
axis_lock_angular_x = true
axis_lock_angular_z = true
motion_mode = 1
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.172521, 0)
collision_layer = 806
collision_mask = 775
script = ExtResource("1_xcol5")
RotationSpeed = 0.025
MoveSpeed = 3.0
Acceleration = 0.01
PlayerStatInfo = ExtResource("2_nuh2a")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.937567, 0)
shape = SubResource("CapsuleShape3D_dw45s")
[node name="MeshInstance3D" type="MeshInstance3D" parent="CollisionShape3D"]
mesh = SubResource("CapsuleMesh_dmans")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.36136, -0.472795)
cull_mask = 1048573
[node name="OmniLight3D" type="OmniLight3D" parent="."]
omni_range = 73.156
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_w8l8m")
}
PlayerStatResource = SubResource("Resource_btp2w")
[node name="Hitbox" type="Area3D" parent="."]
unique_name_in_owner = true
@@ -162,11 +359,36 @@ script = ExtResource("2_lb3qc")
shape = SubResource("BoxShape3D_wedu3")
disabled = true
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.937567, 0)
shape = SubResource("CapsuleShape3D_dw45s")
[node name="CollisionDetector" type="Area3D" parent="CollisionShape3D"]
unique_name_in_owner = true
scale = Vector2(9.03192, 6.39623)
sprite_frames = SubResource("SpriteFrames_ywvvo")
animation = &"attack"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.937567, 0)
collision_layer = 196
collision_mask = 196
[node name="CollisionShape3D" type="CollisionShape3D" parent="CollisionShape3D/CollisionDetector"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0479561, 0.982638, -0.675098)
shape = SubResource("BoxShape3D_hs4wf")
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00341564, 1.40507, 0.645068)
cull_mask = 1048573
fov = 45.0
near = 0.001
[node name="OmniLight3D" type="OmniLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.57563, 0.620484)
omni_range = 16.633
omni_attenuation = 0.27
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
"": SubResource("AnimationLibrary_w8l8m")
}
[node name="HealthTimer" type="Timer" parent="."]
unique_name_in_owner = true
@@ -174,52 +396,21 @@ process_mode = 1
wait_time = 3.0
autostart = true
[node name="MarginContainer" type="MarginContainer" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="player_model" parent="." instance=ExtResource("10_prmgx")]
visible = false
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
[node name="HPNumber" type="Label" parent="MarginContainer/VBoxContainer"]
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
layout_mode = 2
text = "HP: inf/inf"
texture_filter = 1
position = Vector2(983, 555)
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_ywvvo")
animation = &"attack"
flip_h = true
flip_v = true
[node name="HPBar" type="ProgressBar" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 25)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_kxbln")
show_percentage = false
[node name="VTNumber" type="Label" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "VT: inf/inf"
[node name="VTBar" type="ProgressBar" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 25)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_onron")
show_percentage = false
[node name="CollisionDetector" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 64
collision_mask = 64
[node name="CollisionShape3D" type="CollisionShape3D" parent="CollisionDetector"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0479561, 0.982638, -0.04021)
shape = SubResource("BoxShape3D_hs4wf")
[node name="Sprite3D" type="Sprite3D" parent="."]
layers = 2
pixel_size = 0.025
billboard = 1
texture = ExtResource("7_8hi2n")

View File

@@ -1,31 +1,116 @@
using Chickensoft.Collections;
using Chickensoft.Serialization;
using Godot;
using System.Collections.Generic;
namespace GameJamDungeon
{
public partial record PlayerData
{
// TODO: Implement save system
[Save("global_transform")]
public required Transform3D GlobalTransform { get; init; }
[Save("state_machine")]
public required PlayerLogic StateMachine { get; init; }
[Save("velocity")]
public required Vector3 Velocity { get; init; }
[Save("PlayerEquippedSword")]
public required IAutoProp<WeaponInfo> EquippedWeapon { get; set; }
[Save("inventory")]
public required Inventory Inventory { get; init; }
[Save("currentHP")]
public IAutoProp<int> CurrentHP => _currentHP;
[Save("maximumHP")]
public IAutoProp<int> MaximumHP => _maximumHP;
[Save("currentVT")]
public IAutoProp<int> CurrentVT => _currentVT;
[Save("maximumVT")]
public IAutoProp<int> MaximumVT => _maximumVT;
[Save("currentExp")]
public IAutoProp<int> CurrentExp => _currentExp;
[Save("currentLevel")]
public IAutoProp<int> CurrentLevel => _currentLevel;
[Save("currentAttack")]
public IAutoProp<int> CurrentAttack => _currentAttack;
[Save("currentDefense")]
public IAutoProp<int> CurrentDefense => _currentDefense;
[Save("maxAttack")]
public IAutoProp<int> MaxAttack => _maxAttack;
[Save("maxDefense")]
public IAutoProp<int> MaxDefense => _maxDefense;
public int BonusAttack => Inventory.EquippedWeapon.Value.WeaponStats.Damage + Inventory.EquippedAccessory.Value.AccessoryStats.ATKUp;
public int BonusDefense => Inventory.EquippedArmor.Value.ArmorStats.Defense + Inventory.EquippedAccessory.Value.AccessoryStats.DEFUp;
[Save("expToNextLevel")]
public IAutoProp<int> ExpToNextLevel => _expToNextLevel;
[Save("luck")]
public IAutoProp<double> Luck => _luck;
[Save("PlayerInventory")]
public required IEnumerable<InventoryItemInfo> Inventory { get; set; }
public void SetCurrentHP(int newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, MaximumHP.Value);
_currentHP.OnNext(clampedValue);
}
public void SetMaximumHP(int newValue)
{
_maximumHP.OnNext(newValue);
}
public void SetCurrentVT(int newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, MaximumVT.Value);
_currentVT.OnNext(clampedValue);
}
public void SetMaximumVT(int newValue)
{
_maximumVT.OnNext(newValue);
}
public void SetCurrentExp(int newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, ExpToNextLevel.Value);
_currentExp.OnNext(clampedValue);
}
public void SetCurrentLevel(int newValue)
{
_currentLevel.OnNext(newValue);
}
public void SetCurrentAttack(int newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, MaxAttack.Value);
_currentAttack.OnNext(clampedValue);
}
public void SetCurrentDefense(int newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, MaxDefense.Value);
_currentDefense.OnNext(clampedValue);
}
public void SetMaxAttack(int newValue)
{
_maxAttack.OnNext(newValue);
}
public void SetMaxDefense(int newValue)
{
_maxDefense.OnNext(newValue);
}
public void SetExpToNextLevel(int newValue)
{
_expToNextLevel.OnNext(newValue);
}
public void SetLuck(double newValue)
{
var clampedValue = Mathf.Clamp(newValue, 0, 1.0);
_luck.OnNext(clampedValue);
}
[Save("PlayerStats")]
public required PlayerStatInfo PlayerStats { get; set; }
[Save("CurrentHP")]
public required int CurrentHP { get; set; }
[Save("CurrentVT")]
public required int CurrentVT { get; set; }
private readonly AutoProp<int> _currentHP = new(int.MaxValue);
private readonly AutoProp<int> _maximumHP = new(int.MaxValue);
private readonly AutoProp<int> _currentVT = new(int.MaxValue);
private readonly AutoProp<int> _maximumVT = new(int.MaxValue);
private readonly AutoProp<int> _currentExp = new(int.MaxValue);
private readonly AutoProp<int> _currentLevel = new(int.MaxValue);
private readonly AutoProp<int> _currentAttack = new(int.MaxValue);
private readonly AutoProp<int> _currentDefense = new(int.MaxValue);
private readonly AutoProp<int> _maxAttack = new(int.MaxValue);
private readonly AutoProp<int> _maxDefense = new(int.MaxValue);
private readonly AutoProp<int> _bonusAttack = new(int.MaxValue);
private readonly AutoProp<int> _bonusDefense = new(int.MaxValue);
private readonly AutoProp<int> _expToNextLevel = new(int.MaxValue);
private readonly AutoProp<double> _luck = new(double.MaxValue);
}
}

View File

@@ -1,20 +0,0 @@
using Godot;
namespace GameJamDungeon
{
[GlobalClass]
public partial class PlayerStatInfo : Resource, ICharacterStats
{
[Export]
public double MaximumHP { get; set; }
[Export]
public int MaximumVT { get; set; }
[Export]
public int BaseAttack { get; set; }
[Export]
public int BaseDefense { get; set; }
}
}

View File

@@ -0,0 +1,42 @@
using Godot;
namespace GameJamDungeon
{
[GlobalClass]
public partial class PlayerStatResource : Resource
{
/// <summary>Rotation speed (quaternions?/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float RotationSpeed { get; set; } = 12.0f;
/// <summary>Player speed (meters/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float MoveSpeed { get; set; } = 8f;
/// <summary>Player speed (meters^2/sec).</summary>
[Export(PropertyHint.Range, "0, 100, 0.1")]
public float Acceleration { get; set; } = 4f;
[Export] public int CurrentHP { get; set; }
[Export] public int MaximumHP { get; set; }
[Export] public int CurrentVT { get; set; }
[Export] public int MaximumVT { get; set; }
[Export] public int CurrentExp { get; set; }
[Export] public int ExpToNextLevel { get; set; }
[Export] public int CurrentLevel { get; set; }
[Export] public int CurrentAttack { get; set; }
[Export] public int CurrentDefense { get; set; }
[Export] public int MaxAttack { get; set; }
[Export] public int MaxDefense { get; set; }
[Export] public int BonusAttack { get; set; }
[Export] public int BonusDefense { get; set; }
[Export(PropertyHint.Range, "0, 1, 0.01")]
public double Luck { get; set; }
}
}

View File

@@ -1,16 +0,0 @@
[gd_resource type="Resource" script_class="PlayerStatInfo" load_steps=2 format=3 uid="uid://cofd1ylluj24"]
[ext_resource type="Script" path="res://src/player/PlayerStatInfo.cs" id="1_a84hi"]
[resource]
script = ExtResource("1_a84hi")
MaximumHP = 120.0
MaximumVT = 90
BaseAttack = 10
BaseDefense = 0
ElementAResistance = 0.0
ElementBResistance = 0.0
ElementCResistance = 15.0
BaseElementADamageBonus = 30.0
BaseElementBDamageBonus = 15.0
BaseElementCDamageBonus = 20.0

View File

@@ -1,40 +0,0 @@
[gd_resource type="SpriteFrames" load_steps=7 format=3 uid="uid://nxdb75oa71hj"]
[ext_resource type="Texture2D" uid="uid://cd8gggy8mdm2e" path="res://src/vfx/Sword Slash/slash_0000_Classic_30.png" id="1_dmb5o"]
[ext_resource type="Texture2D" uid="uid://difp6a34ot1oq" path="res://src/vfx/Sword Slash/slash_0001_Classic_29.png" id="2_dme0j"]
[ext_resource type="Texture2D" uid="uid://brjqbpy3wsksb" path="res://src/vfx/Sword Slash/slash_0002_Classic_28.png" id="3_twn5o"]
[ext_resource type="Texture2D" uid="uid://brpnjc7aho55s" path="res://src/vfx/Sword Slash/slash_0003_Classic_27.png" id="4_3f3ea"]
[ext_resource type="Texture2D" uid="uid://mb7qoowmapaj" path="res://src/vfx/Sword Slash/slash_0004_Classic_26.png" id="5_fp65h"]
[ext_resource type="Texture2D" uid="uid://d2e5prh2tm73h" path="res://src/vfx/Sword Slash/slash_0005_Layer-1.png" id="6_6syma"]
[resource]
animations = [{
"frames": [{
"duration": 1.0,
"texture": null
}, {
"duration": 1.0,
"texture": ExtResource("1_dmb5o")
}, {
"duration": 1.0,
"texture": ExtResource("2_dme0j")
}, {
"duration": 1.0,
"texture": ExtResource("3_twn5o")
}, {
"duration": 1.0,
"texture": ExtResource("4_3f3ea")
}, {
"duration": 1.0,
"texture": ExtResource("5_fp65h")
}, {
"duration": 1.0,
"texture": ExtResource("6_6syma")
}, {
"duration": 1.0,
"texture": null
}],
"loop": false,
"name": &"slash",
"speed": 12.0
}]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://wm86fj4argv6"
path="res://.godot/imported/slash_0001_Classic_29.png-3673010723601f8b6d22db47032b50c1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0001_Classic_29.png"
dest_files=["res://.godot/imported/slash_0001_Classic_29.png-3673010723601f8b6d22db47032b50c1.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://j4m8omoaui1x"
path="res://.godot/imported/slash_0002_Classic_28.png-597c35b28abcb81bd5ff794f73b0fdd0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0002_Classic_28.png"
dest_files=["res://.godot/imported/slash_0002_Classic_28.png-597c35b28abcb81bd5ff794f73b0fdd0.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://caqgpeg6yfy04"
path="res://.godot/imported/slash_0003_Classic_27.png-a5584650bbab5644c4f68a72c7102891.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0003_Classic_27.png"
dest_files=["res://.godot/imported/slash_0003_Classic_27.png-a5584650bbab5644c4f68a72c7102891.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnasdkwdao7br"
path="res://.godot/imported/slash_0004_Classic_26.png-edc418ced5f957bf9acd48ba10300783.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0004_Classic_26.png"
dest_files=["res://.godot/imported/slash_0004_Classic_26.png-edc418ced5f957bf9acd48ba10300783.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dpulted24fmhb"
path="res://.godot/imported/slash_0005_Layer-1.png-1d7636cfc5c4b430e4a056383d58afa9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0005_Layer-1.png"
dest_files=["res://.godot/imported/slash_0005_Layer-1.png-1d7636cfc5c4b430e4a056383d58afa9.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://d60ka3oda7au"
path="res://.godot/imported/tendomaya.glb-f10208c626b86ebd9779207b611bbe24.scn"
[deps]
source_file="res://src/player/dont_look_in_here/tendomaya.glb"
dest_files=["res://.godot/imported/tendomaya.glb-f10208c626b86ebd9779207b611bbe24.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
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=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dcf5vnogu2qpl"
path.s3tc="res://.godot/imported/tendomaya_Diffuse Texture-Diffuse Texture.png-c133987a802d5d3b355e9b92080e5bbf.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "538abddaba633fa07d06288706267c48"
}
[deps]
source_file="res://src/player/dont_look_in_here/tendomaya_Diffuse Texture-Diffuse Texture.png"
dest_files=["res://.godot/imported/tendomaya_Diffuse Texture-Diffuse Texture.png-c133987a802d5d3b355e9b92080e5bbf.s3tc.ctex"]
[params]
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=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 KiB

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://m6xsyhnt67sh"
path.s3tc="res://.godot/imported/tendomaya_body0_tex00.png-2256e86fdf18d5c857533d2038fd1eb6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "b25486677e476cae8eb50c6d6dc8ea8b"
}
[deps]
source_file="res://src/player/dont_look_in_here/tendomaya_body0_tex00.png"
dest_files=["res://.godot/imported/tendomaya_body0_tex00.png-2256e86fdf18d5c857533d2038fd1eb6.s3tc.ctex"]
[params]
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=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qxq1jjr1cojo"
path.s3tc="res://.godot/imported/tendomaya_face10_tex00.png-7cecce20e0644b630e61b58c3cca33f8.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
generator_parameters={
"md5": "d4587d57094eebb71486d1ee6d26a975"
}
[deps]
source_file="res://src/player/dont_look_in_here/tendomaya_face10_tex00.png"
dest_files=["res://.godot/imported/tendomaya_face10_tex00.png-7cecce20e0644b630e61b58c3cca33f8.s3tc.ctex"]
[params]
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=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -2,16 +2,16 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bqpaiixbyo16v"
path="res://.godot/imported/slash_0000_Classic_30.png-2c428e005da5748673e1d7868aa6b18a.ctex"
uid="uid://hepeb1q46ybj"
path="res://.godot/imported/tendomaya_face20_tex00.png-b681d471a8f5b5fe143eb3e299e00cfc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/animations/slash_0000_Classic_30.png"
dest_files=["res://.godot/imported/slash_0000_Classic_30.png-2c428e005da5748673e1d7868aa6b18a.ctex"]
source_file="res://src/player/dont_look_in_here/tendomaya_face20_tex00.png"
dest_files=["res://.godot/imported/tendomaya_face20_tex00.png-b681d471a8f5b5fe143eb3e299e00cfc.ctex"]
[params]
@@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bokx3h8kfdo5i"
path="res://.godot/imported/slash_0000_Classic_30.png-29bf4d1f49823b71f227d5df12819eb4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0000_Classic_30.png"
dest_files=["res://.godot/imported/slash_0000_Classic_30.png-29bf4d1f49823b71f227d5df12819eb4.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://byosr5gk51237"
path="res://.godot/imported/slash_0001_Classic_29.png-8b6cb25db8f26faae8c794cbe9767b96.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0001_Classic_29.png"
dest_files=["res://.godot/imported/slash_0001_Classic_29.png-8b6cb25db8f26faae8c794cbe9767b96.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://nh071o6ii03j"
path="res://.godot/imported/slash_0002_Classic_28.png-4e04a86162e517edc488454a4efd1ae0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0002_Classic_28.png"
dest_files=["res://.godot/imported/slash_0002_Classic_28.png-4e04a86162e517edc488454a4efd1ae0.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bodfblud4kea3"
path="res://.godot/imported/slash_0003_Classic_27.png-e6e9f96a812c6c1dc9c174b34a127296.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0003_Classic_27.png"
dest_files=["res://.godot/imported/slash_0003_Classic_27.png-e6e9f96a812c6c1dc9c174b34a127296.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://de55prolicl0u"
path="res://.godot/imported/slash_0004_Classic_26.png-2ac987800cb2865f139b46d65ad72e26.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0004_Classic_26.png"
dest_files=["res://.godot/imported/slash_0004_Classic_26.png-2ac987800cb2865f139b46d65ad72e26.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bp0msic3uk3kc"
path="res://.godot/imported/slash_0005_Layer-1.png-e9a5a7f6279134cbc1e523399aaf9074.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/slash_0005_Layer-1.png"
dest_files=["res://.godot/imported/slash_0005_Layer-1.png-e9a5a7f6279134cbc1e523399aaf9074.ctex"]
[params]
compress/mode=0
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/limit=-1
roughness/mode=0
roughness/src_normal=""
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

@@ -8,7 +8,7 @@ namespace GameJamDungeon
{
public readonly record struct PhysicsTick(double Delta);
public readonly record struct Moved(Vector3 GlobalPosition);
public readonly record struct Moved(Vector3 GlobalPosition, Transform3D GlobalTransform);
public readonly record struct Enable;

View File

@@ -2,8 +2,13 @@
{
public partial class PlayerLogic
{
public record Settings(
float RotationSpeed,
float MoveSpeed);
public record Settings
{
public float MoveSpeed { get; set; }
public float RotationSpeed { get; set; }
public float Acceleration { get; set; }
}
}
}

View File

@@ -1,20 +1,22 @@
@startuml PlayerLogic
state "PlayerLogic State" as GameJam2024Practice_PlayerLogic_State {
state "Alive" as GameJam2024Practice_PlayerLogic_State_Alive {
state "Idle" as GameJam2024Practice_PlayerLogic_State_Idle
state "Attacking" as GameJam2024Practice_PlayerLogic_State_Attacking
state "PlayerLogic State" as GameJamDungeon_PlayerLogic_State {
state "Alive" as GameJamDungeon_PlayerLogic_State_Alive {
state "Attacking" as GameJamDungeon_PlayerLogic_State_Attacking
state "Idle" as GameJamDungeon_PlayerLogic_State_Idle
}
state "Disabled" as GameJam2024Practice_PlayerLogic_State_Disabled
state "Dead" as GameJamDungeon_PlayerLogic_State_Dead
state "Disabled" as GameJamDungeon_PlayerLogic_State_Disabled
}
GameJam2024Practice_PlayerLogic_State_Alive --> GameJam2024Practice_PlayerLogic_State_Alive : Moved
GameJam2024Practice_PlayerLogic_State_Alive --> GameJam2024Practice_PlayerLogic_State_Alive : PhysicsTick
GameJam2024Practice_PlayerLogic_State_Attacking --> GameJam2024Practice_PlayerLogic_State_Idle : AttackAnimationFinished
GameJam2024Practice_PlayerLogic_State_Disabled --> GameJam2024Practice_PlayerLogic_State_Idle : Enable
GameJam2024Practice_PlayerLogic_State_Idle --> GameJam2024Practice_PlayerLogic_State_Attacking : Attack
GameJamDungeon_PlayerLogic_State_Alive --> GameJamDungeon_PlayerLogic_State_Alive : Moved
GameJamDungeon_PlayerLogic_State_Alive --> GameJamDungeon_PlayerLogic_State_Alive : PhysicsTick
GameJamDungeon_PlayerLogic_State_Alive --> GameJamDungeon_PlayerLogic_State_Dead : Killed
GameJamDungeon_PlayerLogic_State_Attacking --> GameJamDungeon_PlayerLogic_State_Idle : AttackAnimationFinished
GameJamDungeon_PlayerLogic_State_Disabled --> GameJamDungeon_PlayerLogic_State_Idle : Enable
GameJamDungeon_PlayerLogic_State_Idle --> GameJamDungeon_PlayerLogic_State_Attacking : Attack
GameJam2024Practice_PlayerLogic_State_Alive : OnPhysicsTick → MovementComputed
GameJam2024Practice_PlayerLogic_State_Idle : OnAttack → Attack
GameJamDungeon_PlayerLogic_State_Alive : OnPhysicsTick → MovementComputed
GameJamDungeon_PlayerLogic_State_Idle : OnAttack → Attack
[*] --> GameJam2024Practice_PlayerLogic_State_Disabled
[*] --> GameJamDungeon_PlayerLogic_State_Idle
@enduml

View File

@@ -12,20 +12,18 @@ namespace GameJamDungeon
{
public virtual Transition On(in Input.PhysicsTick input)
{
var delta = input.Delta;
var player = Get<IPlayer>();
var settings = Get<Settings>();
var rawInput = player.GetGlobalInputVector();
var strafeLeftInput = player.GetLeftStrafeInputVector();
var strafeRightInput = player.GetRightStrafeInputVector();
var transform = player.Transform;
transform.Basis = new Basis(Vector3.Up, settings.RotationSpeed * -rawInput.X) * transform.Basis;
var velocity = player.Basis * new Vector3(0, 0, rawInput.Z) * settings.MoveSpeed;
if (Godot.Input.IsActionPressed(GameInputs.Sprint))
velocity *= 3;
if (Godot.Input.IsActionJustPressed(GameInputs.Throw))
Output(new Output.ThrowItem());
transform.Basis = new Basis(Vector3.Up, settings.RotationSpeed * -rawInput.X * (float)delta) * transform.Basis;
var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z);
var velocity = player.Basis * moveDirection * settings.MoveSpeed * settings.Acceleration;
Output(new Output.MovementComputed(transform.Basis, velocity));
@@ -36,13 +34,14 @@ namespace GameJamDungeon
{
var gameRepo = Get<IGameRepo>();
gameRepo.SetPlayerGlobalPosition(input.GlobalPosition);
gameRepo.SetPlayerGlobalTransform(input.GlobalTransform);
return ToSelf();
}
public Transition On(in Input.Killed input)
{
GD.Print("Player died");
return To<Disabled>();
return To<Dead>();
}
}
}

View File

@@ -0,0 +1,12 @@
using Chickensoft.Introspection;
namespace GameJamDungeon;
public partial class PlayerLogic
{
public abstract partial record State
{
[Meta, Id("player_logic_state_dead")]
public partial record Dead : State;
}
}