diff --git a/GameJamDungeon.csproj b/GameJamDungeon.csproj index fa18b237..fe43ddeb 100644 --- a/GameJamDungeon.csproj +++ b/GameJamDungeon.csproj @@ -1,37 +1,37 @@ - - - net8.0 - net8.0 - net8.0 - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + net8.0 + net8.0 + net8.0 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameJamDungeon.csproj.old b/GameJamDungeon.csproj.old new file mode 100644 index 00000000..fa18b237 --- /dev/null +++ b/GameJamDungeon.csproj.old @@ -0,0 +1,37 @@ + + + net8.0 + net8.0 + net8.0 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/addons/SimpleDungeons/DungeonRoom3D.gd b/addons/SimpleDungeons/DungeonRoom3D.gd index e99a5ced..494ad1c8 100644 --- a/addons/SimpleDungeons/DungeonRoom3D.gd +++ b/addons/SimpleDungeons/DungeonRoom3D.gd @@ -4,8 +4,6 @@ extends Node3D signal dungeon_done_generating() -var room = %Room; - var dungeon_generator : DungeonGenerator3D : get: if is_inside_tree() and get_parent() is DungeonGenerator3D: diff --git a/project.godot b/project.godot index aabfd6cf..695a1a71 100644 --- a/project.godot +++ b/project.godot @@ -176,9 +176,7 @@ StrafeRight={ } Pause={ "deadzone": 0.5, -"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) -] +"events": [] } [internationalization] diff --git a/src/enemy/Enemy.cs b/src/enemy/Enemy.cs index 57e1e1bd..96be209c 100644 --- a/src/enemy/Enemy.cs +++ b/src/enemy/Enemy.cs @@ -2,6 +2,7 @@ using Chickensoft.AutoInject; using Chickensoft.Collections; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; +using Chickensoft.LogicBlocks; using Godot; using System; using System.Linq; @@ -14,7 +15,7 @@ public interface IEnemy : ICharacterBody3D public AutoProp CurrentHP { get; set; } - public EnemyStatInfo EnemyStatInfo { get; set; } + public EnemyStatResource EnemyStatResource { get; set; } public NavigationAgent3D NavAgent { get; set; } @@ -39,7 +40,7 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide [Dependency] IGameRepo GameRepo => this.DependOn(); [Export] - public EnemyStatInfo EnemyStatInfo { get; set; } = default!; + public EnemyStatResource EnemyStatResource { get; set; } = default!; public static PackedScene CollisionDetectorScene => GD.Load("res://src/enemy/CollisionDetector.tscn"); @@ -62,14 +63,14 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide public void Setup() { EnemyLogic = new EnemyLogic(); - EnemyLogic.Set(EnemyStatInfo); + EnemyLogic.Set(EnemyStatResource); EnemyLogic.Set(this as IEnemy); EnemyLogic.Set(GameRepo); } public void Initialize() { - CurrentHP = new AutoProp(EnemyStatInfo.MaximumHP); + CurrentHP = new AutoProp(EnemyStatResource.MaximumHP); CurrentHP.Sync += OnHPChanged; LineOfSight.BodyEntered += LineOfSight_BodyEntered; PatrolTimer.Timeout += OnPatrolTimeout; @@ -138,8 +139,8 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide }) .Handle((in EnemyLogic.Output.HitByPlayer output) => { - if (GameRepo.EquippedWeapon.Value.WeaponInfo.WeaponTags.Contains(WeaponTag.SelfDamage)) - GameRepo.PlayerStatInfo.Value.CurrentHP -= 5; + if (GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.WeaponTags.Contains(WeaponTag.SelfDamage)) + GameRepo.PlayerData.CurrentHP.OnNext(GameRepo.PlayerData.CurrentHP.Value - 5); }); this.Provide(); @@ -182,9 +183,9 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide var rng = new RandomNumberGenerator(); rng.Randomize(); var roll = rng.Randf(); - if (roll <= GameRepo.EquippedWeapon.Value.WeaponInfo.Luck) + if (roll <= GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.Luck) isCriticalHit = true; - var damage = DamageCalculator.CalculatePlayerDamage(hitBox.GetParent().PlayerStatInfo, EnemyStatInfo, GameRepo.EquippedWeapon.Value.WeaponInfo, isCriticalHit); + var damage = DamageCalculator.CalculatePlayerDamage(GameRepo.PlayerData.CurrentAttack.Value + GameRepo.PlayerData.BonusAttack.Value, EnemyStatResource, GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats, isCriticalHit); GD.Print($"Enemy Hit for {damage} damage."); EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(damage)); } diff --git a/src/enemy/EnemyStatInfo.cs b/src/enemy/EnemyStatResource.cs similarity index 94% rename from src/enemy/EnemyStatInfo.cs rename to src/enemy/EnemyStatResource.cs index 236e4524..347611c3 100644 --- a/src/enemy/EnemyStatInfo.cs +++ b/src/enemy/EnemyStatResource.cs @@ -3,7 +3,7 @@ namespace GameJamDungeon { [GlobalClass] - public partial class EnemyStatInfo : Resource, ICharacterStats + public partial class EnemyStatResource : Resource { [Export] public double CurrentHP { get; set; } diff --git a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tres b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tres index 2ec26d0d..ea57c07e 100644 --- a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tres +++ b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="EnemyStatInfo" load_steps=2 format=3 uid="uid://c08wbuumw6dk5"] -[ext_resource type="Script" path="res://src/enemy/EnemyStatInfo.cs" id="1_2i74g"] +[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="1_2i74g"] [resource] script = ExtResource("1_2i74g") diff --git a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn index 675034d3..25d6ef0a 100644 --- a/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn +++ b/src/enemy/enemy_types/floating_enemy/FloatingEnemy.tscn @@ -1,9 +1,29 @@ -[gd_scene load_steps=15 format=4 uid="uid://dcgj5i52i76gj"] +[gd_scene load_steps=16 format=4 uid="uid://dcgj5i52i76gj"] [ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_jw471"] -[ext_resource type="Resource" uid="uid://c08wbuumw6dk5" path="res://src/enemy/enemy_types/floating_enemy/FloatingEnemy.tres" id="2_b8sx5"] +[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_wlf85"] [ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="3_erpyl"] +[sub_resource type="Resource" id="Resource_rxw8v"] +script = ExtResource("2_wlf85") +CurrentHP = 45.0 +MaximumHP = 45.0 +CurrentAttack = 3 +CurrentDefense = 2 +MaxAttack = 3 +MaxDefense = 2 +Luck = 0.05 +TelluricResistance = 0.0 +AeolicResistance = 0.0 +HydricResistance = 0.0 +IgneousResistance = 0.0 +FerrumResistance = 0.0 +TelluricDamageBonus = 0.0 +AeolicDamageBonus = 0.0 +BaseHydricDamageBonus = 0.0 +IgneousDamageBonus = 0.0 +FerrumDamageBonus = 0.0 + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5tio6"] resource_name = "Material.001" cull_mode = 2 @@ -155,7 +175,7 @@ collision_layer = 10 collision_mask = 9 axis_lock_linear_y = true script = ExtResource("1_jw471") -EnemyStatInfo = ExtResource("2_b8sx5") +EnemyStatResource = SubResource("Resource_rxw8v") [node name="DISSAPPEARING ENEMY" type="Node3D" parent="."] diff --git a/src/enemy/enemy_types/floating_enemy/Overworld.gltf b/src/enemy/enemy_types/floating_enemy/Overworld.gltf deleted file mode 100644 index 00f3de3d..00000000 --- a/src/enemy/enemy_types/floating_enemy/Overworld.gltf +++ /dev/null @@ -1 +0,0 @@ -{"accessors":[{"bufferView":0,"byteOffset":0,"componentType":5126,"count":1737,"max":[22.5253982543945,0.499990224838257,28.5243167877197],"min":[-48.5307998657227,-9.99121284484863,-94.4715805053711],"normalized":false,"type":"VEC3"},{"bufferView":1,"byteOffset":0,"componentType":5126,"count":1737,"max":[1,0.0966419205069542,0.997165203094482,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":2,"byteOffset":0,"componentType":5126,"count":1737,"max":[0.999999403953552,1,0.999999403953552],"min":[-0.9999994635582,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":3,"byteOffset":0,"componentType":5126,"count":1737,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":4,"byteOffset":0,"componentType":5123,"count":1737,"max":[1736],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":5,"byteOffset":0,"componentType":5126,"count":4668,"max":[22.4101867675781,23.8554248809814,42.8572158813477],"min":[-143.134826660156,-38.4902496337891,-107.917472839355],"normalized":false,"type":"VEC3"},{"bufferView":6,"byteOffset":0,"componentType":5126,"count":4668,"max":[1,1,1,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":7,"byteOffset":0,"componentType":5126,"count":4668,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":8,"byteOffset":0,"componentType":5126,"count":4668,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":9,"byteOffset":0,"componentType":5123,"count":4668,"max":[4667],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":10,"byteOffset":0,"componentType":5126,"count":1869,"max":[36.8812370300293,13.444712638855,29.4924087524414],"min":[-44.7531967163086,-16.4198551177979,-17.0227947235107],"normalized":false,"type":"VEC3"},{"bufferView":11,"byteOffset":0,"componentType":5126,"count":1869,"max":[1,0.656867682933807,0.999999403953552,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":12,"byteOffset":0,"componentType":5126,"count":1869,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":13,"byteOffset":0,"componentType":5126,"count":1869,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":14,"byteOffset":0,"componentType":5123,"count":1869,"max":[1868],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":15,"byteOffset":0,"componentType":5126,"count":1770,"max":[22.4999485015869,13.4804239273071,36.5154991149902],"min":[-62.534797668457,-16.4198551177979,-27.7709522247314],"normalized":false,"type":"VEC3"},{"bufferView":16,"byteOffset":0,"componentType":5126,"count":1770,"max":[0.993339538574219,0.847915232181549,0.7287358045578,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":17,"byteOffset":0,"componentType":5126,"count":1770,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":18,"byteOffset":0,"componentType":5126,"count":1770,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":19,"byteOffset":0,"componentType":5123,"count":1770,"max":[1769],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":20,"byteOffset":0,"componentType":5126,"count":36,"max":[36.8812370300293,2.77345514297485,22.5917873382568],"min":[34.9177665710449,0.323644995689392,21.7584133148193],"normalized":false,"type":"VEC3"},{"bufferView":21,"byteOffset":0,"componentType":5126,"count":36,"max":[0,0,0.0000763009302318096,-1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":22,"byteOffset":0,"componentType":5126,"count":36,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":23,"byteOffset":0,"componentType":5126,"count":36,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":24,"byteOffset":0,"componentType":5123,"count":36,"max":[35],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":25,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":26,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":27,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":28,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":29,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":30,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":31,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":32,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":33,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":34,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":35,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":36,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":37,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":38,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":39,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":40,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":41,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":42,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":43,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":44,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":45,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":46,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":47,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":48,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":49,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":50,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":51,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":52,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":53,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":54,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":55,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":56,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":57,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":58,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":59,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":60,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":61,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":62,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":63,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":64,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":65,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":66,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":67,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":68,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":69,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":70,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":71,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":72,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":73,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":74,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":75,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":76,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":77,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":78,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":79,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":80,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":81,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":82,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":83,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":84,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":85,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":86,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":87,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":88,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":89,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":90,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":91,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":92,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":93,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":94,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":95,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":96,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":97,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":98,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":99,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":100,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":101,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":102,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":103,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":104,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":105,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":106,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":107,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":108,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":109,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":110,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":111,"byteOffset":0,"componentType":5126,"count":377,"max":[1,1,0.472351938486099,1],"min":[-0.99999618530273,-0.23378157615662,-0.29359644651413,1],"normalized":false,"type":"VEC4"},{"bufferView":112,"byteOffset":0,"componentType":5126,"count":377,"max":[1,0.999992489814758,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":113,"byteOffset":0,"componentType":5126,"count":377,"max":[2.78239393234253,1.87047100067139],"min":[-0.38342559337616,-1.69100165367126],"normalized":false,"type":"VEC2"},{"bufferView":114,"byteOffset":0,"componentType":5123,"count":576,"max":[376],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":115,"byteOffset":0,"componentType":5126,"count":372,"max":[0.287544012069702,0.0998470038175583,6.62903213500977],"min":[-0.0458110012114,-0.09673400223255,-0.01328300032765],"normalized":false,"type":"VEC3"},{"bufferView":116,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.996852159500122,0.998831689357758,1],"min":[-0.99203103780746,-0.99280786514282,-0.87214529514313,-1],"normalized":false,"type":"VEC4"},{"bufferView":117,"byteOffset":0,"componentType":5126,"count":372,"max":[0.996830761432648,0.992014527320862,1],"min":[-0.99946355819702,-0.99946147203445,-1],"normalized":false,"type":"VEC3"},{"bufferView":118,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.988097965717316],"min":[0.000640878919512033,0],"normalized":false,"type":"VEC2"},{"bufferView":119,"byteOffset":0,"componentType":5123,"count":426,"max":[371],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":120,"byteOffset":0,"componentType":5126,"count":368,"max":[0.681685984134674,0.117201000452042,6.62973213195801],"min":[0.232550993561745,-0.27360999584198,-0.01562800072134],"normalized":false,"type":"VEC3"},{"bufferView":121,"byteOffset":0,"componentType":5126,"count":368,"max":[0.999813675880432,0.999308705329895,0.53583037853241,1],"min":[-0.99977874755859,-0.99998515844345,-0.67323392629623,-1],"normalized":false,"type":"VEC4"},{"bufferView":122,"byteOffset":0,"componentType":5126,"count":368,"max":[0.98846822977066,0.999921917915344,0.999786555767059],"min":[-0.99996781349182,-0.99855142831802,-0.99978905916214],"normalized":false,"type":"VEC3"},{"bufferView":123,"byteOffset":0,"componentType":5126,"count":368,"max":[1,0.982116401195526],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":124,"byteOffset":0,"componentType":5123,"count":426,"max":[367],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":125,"byteOffset":0,"componentType":5126,"count":372,"max":[0.903819978237152,0.0998470038175583,6.62903213500977],"min":[0.570464015007019,-0.09673400223255,-0.01328300032765],"normalized":false,"type":"VEC3"},{"bufferView":126,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.996852159500122,0.998831689357758,1],"min":[-0.99203103780746,-0.99280786514282,-0.87214529514313,-1],"normalized":false,"type":"VEC4"},{"bufferView":127,"byteOffset":0,"componentType":5126,"count":372,"max":[0.996830761432648,0.992014527320862,1],"min":[-0.99946355819702,-0.99946147203445,-1],"normalized":false,"type":"VEC3"},{"bufferView":128,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.988097965717316],"min":[0.000640878919512033,0],"normalized":false,"type":"VEC2"},{"bufferView":129,"byteOffset":0,"componentType":5123,"count":426,"max":[371],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":130,"byteOffset":0,"componentType":5126,"count":368,"max":[1.25964903831482,0.334629982709885,6.62971496582031],"min":[0.842091977596283,-0.19986000657082,-0.01461999956518],"normalized":false,"type":"VEC3"},{"bufferView":131,"byteOffset":0,"componentType":5126,"count":368,"max":[0.998985767364502,0.999892950057983,0.546814918518066,1],"min":[-0.98991215229034,-0.99948585033417,-0.66868644952774,-1],"normalized":false,"type":"VEC4"},{"bufferView":132,"byteOffset":0,"componentType":5126,"count":368,"max":[0.999845743179321,0.989085853099823,0.999912977218628],"min":[-0.99641251564026,-0.99681329727173,-0.99991410970688],"normalized":false,"type":"VEC3"},{"bufferView":133,"byteOffset":0,"componentType":5126,"count":368,"max":[1,0.982116401195526],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":134,"byteOffset":0,"componentType":5123,"count":426,"max":[367],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":135,"byteOffset":0,"componentType":5126,"count":372,"max":[1.47161602973938,0.0998470038175583,6.62903213500977],"min":[1.13826096057892,-0.09673400223255,-0.01328300032765],"normalized":false,"type":"VEC3"},{"bufferView":136,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.996852159500122,0.998836040496826,1],"min":[-0.99203103780746,-0.99280786514282,-0.87214529514313,-1],"normalized":false,"type":"VEC4"},{"bufferView":137,"byteOffset":0,"componentType":5126,"count":372,"max":[0.996830761432648,0.992014527320862,1],"min":[-0.99946355819702,-0.99946147203445,-1],"normalized":false,"type":"VEC3"},{"bufferView":138,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.988097965717316],"min":[0.000640878919512033,0],"normalized":false,"type":"VEC2"},{"bufferView":139,"byteOffset":0,"componentType":5123,"count":426,"max":[371],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":140,"byteOffset":0,"componentType":5126,"count":372,"max":[2.776123046875,0.0998470038175583,6.62903213500977],"min":[2.44276690483093,-0.09673400223255,-0.01328300032765],"normalized":false,"type":"VEC3"},{"bufferView":141,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.996852159500122,0.998831689357758,1],"min":[-0.99203103780746,-0.99280786514282,-0.87214529514313,-1],"normalized":false,"type":"VEC4"},{"bufferView":142,"byteOffset":0,"componentType":5126,"count":372,"max":[0.996830761432648,0.992014527320862,1],"min":[-0.99946355819702,-0.99946147203445,-1],"normalized":false,"type":"VEC3"},{"bufferView":143,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.988097965717316],"min":[0.000640878919512033,0],"normalized":false,"type":"VEC2"},{"bufferView":144,"byteOffset":0,"componentType":5123,"count":426,"max":[371],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":145,"byteOffset":0,"componentType":5126,"count":368,"max":[2.5189220905304,0.334629982709885,6.62971496582031],"min":[2.10136604309082,-0.19986000657082,-0.01461999956518],"normalized":false,"type":"VEC3"},{"bufferView":146,"byteOffset":0,"componentType":5126,"count":368,"max":[0.998985767364502,0.999892950057983,0.546814918518066,1],"min":[-0.98991215229034,-0.99948585033417,-0.66868644952774,-1],"normalized":false,"type":"VEC4"},{"bufferView":147,"byteOffset":0,"componentType":5126,"count":368,"max":[0.999845743179321,0.989085853099823,0.999912977218628],"min":[-0.99641251564026,-0.99681329727173,-0.9999133348465],"normalized":false,"type":"VEC3"},{"bufferView":148,"byteOffset":0,"componentType":5126,"count":368,"max":[1,0.982116401195526],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":149,"byteOffset":0,"componentType":5123,"count":426,"max":[367],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":150,"byteOffset":0,"componentType":5126,"count":372,"max":[2.11812710762024,0.0998470038175583,6.62903213500977],"min":[1.78477203845978,-0.09673400223255,-0.01328300032765],"normalized":false,"type":"VEC3"},{"bufferView":151,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.996852159500122,0.998831689357758,1],"min":[-0.99203103780746,-0.99280786514282,-0.87214529514313,-1],"normalized":false,"type":"VEC4"},{"bufferView":152,"byteOffset":0,"componentType":5126,"count":372,"max":[0.996830761432648,0.992014527320862,1],"min":[-0.99946355819702,-0.99946147203445,-1],"normalized":false,"type":"VEC3"},{"bufferView":153,"byteOffset":0,"componentType":5126,"count":372,"max":[1,0.988097965717316],"min":[0.000640878919512033,0],"normalized":false,"type":"VEC2"},{"bufferView":154,"byteOffset":0,"componentType":5123,"count":426,"max":[371],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":155,"byteOffset":0,"componentType":5126,"count":368,"max":[1.90109598636627,0.117201000452042,6.62973213195801],"min":[1.45196104049683,-0.27360999584198,-0.01562800072134],"normalized":false,"type":"VEC3"},{"bufferView":156,"byteOffset":0,"componentType":5126,"count":368,"max":[0.999813675880432,0.999308705329895,0.53583037853241,1],"min":[-0.99977874755859,-0.99998515844345,-0.67323392629623,-1],"normalized":false,"type":"VEC4"},{"bufferView":157,"byteOffset":0,"componentType":5126,"count":368,"max":[0.98846822977066,0.999921917915344,0.999786555767059],"min":[-0.99996781349182,-0.99855142831802,-0.99978905916214],"normalized":false,"type":"VEC3"},{"bufferView":158,"byteOffset":0,"componentType":5126,"count":368,"max":[1,0.982116401195526],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":159,"byteOffset":0,"componentType":5123,"count":426,"max":[367],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":160,"byteOffset":0,"componentType":5126,"count":1950,"max":[0.5,1,0.5],"min":[-0.5,-1,-0.5],"normalized":false,"type":"VEC3"},{"bufferView":161,"byteOffset":0,"componentType":5126,"count":1950,"max":[1,0,1,1],"min":[-1,-0.00002157951531,-1,1],"normalized":false,"type":"VEC4"},{"bufferView":162,"byteOffset":0,"componentType":5126,"count":1950,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":163,"byteOffset":0,"componentType":5126,"count":1950,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":164,"byteOffset":0,"componentType":5123,"count":10368,"max":[1949],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":165,"byteOffset":0,"componentType":5126,"count":300,"max":[4.84180879592896,1.72171926498413,2.2201509475708],"min":[-0.12374600023031,-7.72472906112671,-1.14087903499603],"normalized":false,"type":"VEC3"},{"bufferView":166,"byteOffset":0,"componentType":5126,"count":300,"max":[0.898086071014404,0.831473588943481,0.72337007522583,1],"min":[-0.8275437951088,-0.77934193611145,-0.99119395017624,-1],"normalized":false,"type":"VEC4"},{"bufferView":167,"byteOffset":0,"componentType":5126,"count":300,"max":[0.998313248157501,0.613872110843658,0.993226706981659],"min":[-0.99323570728302,-0.95921093225479,-0.99925273656845],"normalized":false,"type":"VEC3"},{"bufferView":168,"byteOffset":0,"componentType":5126,"count":300,"max":[0.704249620437622,0.971099436283112],"min":[0.22270542383194,0.671854734420776],"normalized":false,"type":"VEC2"},{"bufferView":169,"byteOffset":0,"componentType":5123,"count":948,"max":[299],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":170,"byteOffset":0,"componentType":5126,"count":266,"max":[0.967149972915649,1.74001312255859,5.66332912445068],"min":[-2.41637110710144,-7.60743522644043,-0.58943998813629],"normalized":false,"type":"VEC3"},{"bufferView":171,"byteOffset":0,"componentType":5126,"count":266,"max":[0.937930643558502,0.841973960399628,0.357428520917892,1],"min":[-0.86257672309875,-0.8973496556282,-0.98955273628235,-1],"normalized":false,"type":"VEC4"},{"bufferView":172,"byteOffset":0,"componentType":5126,"count":266,"max":[0.998611867427826,0.686730027198792,0.970931231975555],"min":[-0.97103232145309,-0.97366863489151,-0.99955028295517],"normalized":false,"type":"VEC3"},{"bufferView":173,"byteOffset":0,"componentType":5126,"count":266,"max":[0.580959022045135,0.939698994159698],"min":[-0.19127720594406,0.639127254486084],"normalized":false,"type":"VEC2"},{"bufferView":174,"byteOffset":0,"componentType":5123,"count":948,"max":[265],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":175,"byteOffset":0,"componentType":5126,"count":362,"max":[0.906970977783203,2.3415949344635,2.22337794303894],"min":[-6.35487413406372,-5.16016721725464,-1.76011395454407],"normalized":false,"type":"VEC3"},{"bufferView":176,"byteOffset":0,"componentType":5126,"count":362,"max":[0.995760560035706,0.775522887706757,0.532780230045319,1],"min":[-0.9070862531662,-0.94253700971603,-0.99132174253464,-1],"normalized":false,"type":"VEC4"},{"bufferView":177,"byteOffset":0,"componentType":5126,"count":362,"max":[0.759204983711243,0.633196711540222,0.993785798549652],"min":[-0.98496580123901,-0.95591992139816,-0.98529577255249],"normalized":false,"type":"VEC3"},{"bufferView":178,"byteOffset":0,"componentType":5126,"count":362,"max":[0.702018976211548,0.759675025939941],"min":[0.0872090011835098,0.61224102973938],"normalized":false,"type":"VEC2"},{"bufferView":179,"byteOffset":0,"componentType":5123,"count":948,"max":[361],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":180,"byteOffset":0,"componentType":5126,"count":258,"max":[1.9744598865509,1.84285497665405,1.19489240646362],"min":[-2.57632088661194,-6.52901601791382,-7.64524221420288],"normalized":false,"type":"VEC3"},{"bufferView":181,"byteOffset":0,"componentType":5126,"count":258,"max":[0.967066466808319,0.665820240974426,0.746790528297424,1],"min":[-0.81581419706345,-0.68626689910889,-0.98716253042221,-1],"normalized":false,"type":"VEC4"},{"bufferView":182,"byteOffset":0,"componentType":5126,"count":258,"max":[0.980927467346191,0.677398085594177,0.651114761829376],"min":[-0.99941432476044,-0.9179493188858,-0.94398891925812],"normalized":false,"type":"VEC3"},{"bufferView":183,"byteOffset":0,"componentType":5126,"count":258,"max":[1.19557595252991,0.796868979930878],"min":[0.273120701313019,0.628995716571808],"normalized":false,"type":"VEC2"},{"bufferView":184,"byteOffset":0,"componentType":5123,"count":948,"max":[257],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":185,"byteOffset":0,"componentType":5126,"count":391,"max":[3.09796118736267,18.3190670013428,3.36574172973633],"min":[-3.21257901191711,-1.52961301803589,-2.92802810668945],"normalized":false,"type":"VEC3"},{"bufferView":186,"byteOffset":0,"componentType":5126,"count":391,"max":[0.999761760234833,0.551902592182159,0.676508665084839,1],"min":[-0.99684637784958,-0.53892129659653,-0.99822604656219,-1],"normalized":false,"type":"VEC4"},{"bufferView":187,"byteOffset":0,"componentType":5126,"count":391,"max":[0.995298564434052,0.768694519996643,0.974540591239929],"min":[-0.97690415382385,-0.99680370092392,-0.99551230669022],"normalized":false,"type":"VEC3"},{"bufferView":188,"byteOffset":0,"componentType":5126,"count":391,"max":[0.909582018852234,0.761798977851868],"min":[-0.00034697799128,0.00773013709113002],"normalized":false,"type":"VEC2"},{"bufferView":189,"byteOffset":0,"componentType":5123,"count":1332,"max":[390],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":190,"byteOffset":0,"componentType":5126,"count":305,"max":[4.38013315200806,12.4633264541626,0.212440967559814],"min":[0.467171996831894,10.9964780807495,-1.54540002346039],"normalized":false,"type":"VEC3"},{"bufferView":191,"byteOffset":0,"componentType":5126,"count":305,"max":[0.99985271692276,0.196993321180344,0.65107262134552,1],"min":[-0.97046947479248,-0.2960758805275,-0.99948197603226,-1],"normalized":false,"type":"VEC4"},{"bufferView":192,"byteOffset":0,"componentType":5126,"count":305,"max":[0.942729532718658,0.958922207355499,0.965081691741943],"min":[-0.90049719810486,-0.99468410015106,-0.99212163686752],"normalized":false,"type":"VEC3"},{"bufferView":193,"byteOffset":0,"componentType":5126,"count":305,"max":[0.872861802577972,0.350194543600082],"min":[0.569161534309387,0.280582904815674],"normalized":false,"type":"VEC2"},{"bufferView":194,"byteOffset":0,"componentType":5123,"count":948,"max":[304],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":195,"byteOffset":0,"componentType":5126,"count":261,"max":[1.25263404846191,14.7164840698242,0.67419707775116],"min":[-1.01745796203613,11.128833770752,-1.45965301990509],"normalized":false,"type":"VEC3"},{"bufferView":196,"byteOffset":0,"componentType":5126,"count":261,"max":[0.999509871006012,0.131053358316422,0.574789881706238,1],"min":[-0.94079113006592,-0.16305334866047,-0.99977535009384,-1],"normalized":false,"type":"VEC4"},{"bufferView":197,"byteOffset":0,"componentType":5126,"count":261,"max":[0.936193227767944,0.985082566738129,0.989574432373047],"min":[-0.99856853485107,-0.7207316160202,-0.99836897850037],"normalized":false,"type":"VEC3"},{"bufferView":198,"byteOffset":0,"componentType":5126,"count":261,"max":[0.752666532993317,0.338384062051773],"min":[0.316136419773102,0.186175331473351],"normalized":false,"type":"VEC2"},{"bufferView":199,"byteOffset":0,"componentType":5123,"count":948,"max":[260],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":200,"byteOffset":0,"componentType":5126,"count":250,"max":[1.08174204826355,16.7056522369385,-0.41699504852295],"min":[-0.07125300168991,14.0015716552734,-2.27429509162903],"normalized":false,"type":"VEC3"},{"bufferView":201,"byteOffset":0,"componentType":5126,"count":250,"max":[0.999935448169708,0.297976791858673,0.56687605381012,1],"min":[-0.97507226467133,-0.09436675161123,-0.99982446432114,-1],"normalized":false,"type":"VEC4"},{"bufferView":202,"byteOffset":0,"componentType":5126,"count":250,"max":[0.996047735214233,0.838679552078247,0.796637117862701],"min":[-0.99948960542679,-0.79676181077957,-0.99440628290176],"normalized":false,"type":"VEC3"},{"bufferView":203,"byteOffset":0,"componentType":5126,"count":250,"max":[0.878217756748199,0.412283509969711],"min":[0.581322968006134,0.338521391153336],"normalized":false,"type":"VEC2"},{"bufferView":204,"byteOffset":0,"componentType":5123,"count":948,"max":[249],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":205,"byteOffset":0,"componentType":5126,"count":198,"max":[39.7730178833008,0.559042036533356,22.2098350524902],"min":[22.10178565979,-1.90033102035522,10.2852001190186],"normalized":false,"type":"VEC3"},{"bufferView":206,"byteOffset":0,"componentType":5126,"count":198,"max":[0.00177315517794341,0.137377008795738,0.000137350056320429,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":207,"byteOffset":0,"componentType":5126,"count":198,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":208,"byteOffset":0,"componentType":5126,"count":198,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":209,"byteOffset":0,"componentType":5123,"count":198,"max":[197],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":210,"byteOffset":0,"componentType":5126,"count":708,"max":[44.7490158081055,12.5726947784424,24.2848873138428],"min":[27.0777835845947,-2.76338624954224,21.2654247283936],"normalized":false,"type":"VEC3"},{"bufferView":211,"byteOffset":0,"componentType":5126,"count":708,"max":[0.196900263428688,0.0000919251178856939,0.000259470689343289,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":212,"byteOffset":0,"componentType":5126,"count":708,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":213,"byteOffset":0,"componentType":5126,"count":708,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":214,"byteOffset":0,"componentType":5123,"count":708,"max":[707],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":215,"byteOffset":0,"componentType":5126,"count":1887,"max":[6,3,12.5],"min":[-6.00000095367432,-3,-12.5],"normalized":false,"type":"VEC3"},{"bufferView":216,"byteOffset":0,"componentType":5126,"count":1887,"max":[1,0.990609228610992,1,1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":217,"byteOffset":0,"componentType":5126,"count":1887,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":218,"byteOffset":0,"componentType":5126,"count":1887,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":219,"byteOffset":0,"componentType":5123,"count":1887,"max":[1886],"min":[0],"normalized":false,"type":"SCALAR"},{"bufferView":220,"byteOffset":0,"componentType":5126,"count":156,"max":[8.68967056274414,0.387550354003906,36.069896697998],"min":[-197.427261352539,-0.61244964599609,-49.3255500793457],"normalized":false,"type":"VEC3"},{"bufferView":221,"byteOffset":0,"componentType":5126,"count":156,"max":[0.0000958947348408401,0,0.860812842845917,-1],"min":[-1,-1,-1,-1],"normalized":false,"type":"VEC4"},{"bufferView":222,"byteOffset":0,"componentType":5126,"count":156,"max":[1,1,1],"min":[-1,-1,-1],"normalized":false,"type":"VEC3"},{"bufferView":223,"byteOffset":0,"componentType":5126,"count":156,"max":[1,1],"min":[0,0],"normalized":false,"type":"VEC2"},{"bufferView":224,"byteOffset":0,"componentType":5123,"count":156,"max":[155],"min":[0],"normalized":false,"type":"SCALAR"}],"asset":{"generator":"Godot Engine v4.3.stable.mono.official@77dcf97d82cbfe4e4615475fa52ca03da645dbd8","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":20844,"byteOffset":0,"byteStride":12,"target":34962},{"buffer":0,"byteLength":27792,"byteOffset":20844,"byteStride":16,"target":34962},{"buffer":0,"byteLength":20844,"byteOffset":48636,"byteStride":12,"target":34962},{"buffer":0,"byteLength":13896,"byteOffset":69480,"byteStride":8,"target":34962},{"buffer":0,"byteLength":3474,"byteOffset":83376,"target":34963},{"buffer":0,"byteLength":56016,"byteOffset":86852,"byteStride":12,"target":34962},{"buffer":0,"byteLength":74688,"byteOffset":142868,"byteStride":16,"target":34962},{"buffer":0,"byteLength":56016,"byteOffset":217556,"byteStride":12,"target":34962},{"buffer":0,"byteLength":37344,"byteOffset":273572,"byteStride":8,"target":34962},{"buffer":0,"byteLength":9336,"byteOffset":310916,"target":34963},{"buffer":0,"byteLength":22428,"byteOffset":320252,"byteStride":12,"target":34962},{"buffer":0,"byteLength":29904,"byteOffset":342680,"byteStride":16,"target":34962},{"buffer":0,"byteLength":22428,"byteOffset":372584,"byteStride":12,"target":34962},{"buffer":0,"byteLength":14952,"byteOffset":395012,"byteStride":8,"target":34962},{"buffer":0,"byteLength":3738,"byteOffset":409964,"target":34963},{"buffer":0,"byteLength":21240,"byteOffset":413704,"byteStride":12,"target":34962},{"buffer":0,"byteLength":28320,"byteOffset":434944,"byteStride":16,"target":34962},{"buffer":0,"byteLength":21240,"byteOffset":463264,"byteStride":12,"target":34962},{"buffer":0,"byteLength":14160,"byteOffset":484504,"byteStride":8,"target":34962},{"buffer":0,"byteLength":3540,"byteOffset":498664,"target":34963},{"buffer":0,"byteLength":432,"byteOffset":502204,"byteStride":12,"target":34962},{"buffer":0,"byteLength":576,"byteOffset":502636,"byteStride":16,"target":34962},{"buffer":0,"byteLength":432,"byteOffset":503212,"byteStride":12,"target":34962},{"buffer":0,"byteLength":288,"byteOffset":503644,"byteStride":8,"target":34962},{"buffer":0,"byteLength":72,"byteOffset":503932,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":504004,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":508528,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":514560,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":519084,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":522100,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":523252,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":527776,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":533808,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":538332,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":541348,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":542500,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":547024,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":553056,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":557580,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":560596,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":561748,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":566272,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":572304,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":576828,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":579844,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":580996,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":585520,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":591552,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":596076,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":599092,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":600244,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":604768,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":610800,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":615324,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":618340,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":619492,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":624016,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":630048,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":634572,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":637588,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":638740,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":643264,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":649296,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":653820,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":656836,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":657988,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":662512,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":668544,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":673068,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":676084,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":677236,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":681760,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":687792,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":692316,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":695332,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":696484,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":701008,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":707040,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":711564,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":714580,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":715732,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":720256,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":726288,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":730812,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":733828,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":734980,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":739504,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":745536,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":750060,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":753076,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":754228,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":758752,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":764784,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":769308,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":772324,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":773476,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":778000,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":784032,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":788556,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":791572,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":792724,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":797248,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":803280,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":807804,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":810820,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":811972,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":816496,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":822528,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":827052,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":830068,"target":34963},{"buffer":0,"byteLength":4524,"byteOffset":831220,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6032,"byteOffset":835744,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4524,"byteOffset":841776,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3016,"byteOffset":846300,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1152,"byteOffset":849316,"target":34963},{"buffer":0,"byteLength":4464,"byteOffset":850468,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5952,"byteOffset":854932,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4464,"byteOffset":860884,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2976,"byteOffset":865348,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":868324,"target":34963},{"buffer":0,"byteLength":4416,"byteOffset":869176,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5888,"byteOffset":873592,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4416,"byteOffset":879480,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2944,"byteOffset":883896,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":886840,"target":34963},{"buffer":0,"byteLength":4464,"byteOffset":887692,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5952,"byteOffset":892156,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4464,"byteOffset":898108,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2976,"byteOffset":902572,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":905548,"target":34963},{"buffer":0,"byteLength":4416,"byteOffset":906400,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5888,"byteOffset":910816,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4416,"byteOffset":916704,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2944,"byteOffset":921120,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":924064,"target":34963},{"buffer":0,"byteLength":4464,"byteOffset":924916,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5952,"byteOffset":929380,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4464,"byteOffset":935332,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2976,"byteOffset":939796,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":942772,"target":34963},{"buffer":0,"byteLength":4464,"byteOffset":943624,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5952,"byteOffset":948088,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4464,"byteOffset":954040,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2976,"byteOffset":958504,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":961480,"target":34963},{"buffer":0,"byteLength":4416,"byteOffset":962332,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5888,"byteOffset":966748,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4416,"byteOffset":972636,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2944,"byteOffset":977052,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":979996,"target":34963},{"buffer":0,"byteLength":4464,"byteOffset":980848,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5952,"byteOffset":985312,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4464,"byteOffset":991264,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2976,"byteOffset":995728,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":998704,"target":34963},{"buffer":0,"byteLength":4416,"byteOffset":999556,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5888,"byteOffset":1003972,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4416,"byteOffset":1009860,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2944,"byteOffset":1014276,"byteStride":8,"target":34962},{"buffer":0,"byteLength":852,"byteOffset":1017220,"target":34963},{"buffer":0,"byteLength":23400,"byteOffset":1018072,"byteStride":12,"target":34962},{"buffer":0,"byteLength":31200,"byteOffset":1041472,"byteStride":16,"target":34962},{"buffer":0,"byteLength":23400,"byteOffset":1072672,"byteStride":12,"target":34962},{"buffer":0,"byteLength":15600,"byteOffset":1096072,"byteStride":8,"target":34962},{"buffer":0,"byteLength":20736,"byteOffset":1111672,"target":34963},{"buffer":0,"byteLength":3600,"byteOffset":1132408,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4800,"byteOffset":1136008,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3600,"byteOffset":1140808,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2400,"byteOffset":1144408,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1146808,"target":34963},{"buffer":0,"byteLength":3192,"byteOffset":1148704,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4256,"byteOffset":1151896,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3192,"byteOffset":1156152,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2128,"byteOffset":1159344,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1161472,"target":34963},{"buffer":0,"byteLength":4344,"byteOffset":1163368,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5792,"byteOffset":1167712,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4344,"byteOffset":1173504,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2896,"byteOffset":1177848,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1180744,"target":34963},{"buffer":0,"byteLength":3096,"byteOffset":1182640,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4128,"byteOffset":1185736,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3096,"byteOffset":1189864,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2064,"byteOffset":1192960,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1195024,"target":34963},{"buffer":0,"byteLength":4692,"byteOffset":1196920,"byteStride":12,"target":34962},{"buffer":0,"byteLength":6256,"byteOffset":1201612,"byteStride":16,"target":34962},{"buffer":0,"byteLength":4692,"byteOffset":1207868,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3128,"byteOffset":1212560,"byteStride":8,"target":34962},{"buffer":0,"byteLength":2664,"byteOffset":1215688,"target":34963},{"buffer":0,"byteLength":3660,"byteOffset":1218352,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4880,"byteOffset":1222012,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3660,"byteOffset":1226892,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2440,"byteOffset":1230552,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1232992,"target":34963},{"buffer":0,"byteLength":3132,"byteOffset":1234888,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4176,"byteOffset":1238020,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3132,"byteOffset":1242196,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2088,"byteOffset":1245328,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1247416,"target":34963},{"buffer":0,"byteLength":3000,"byteOffset":1249312,"byteStride":12,"target":34962},{"buffer":0,"byteLength":4000,"byteOffset":1252312,"byteStride":16,"target":34962},{"buffer":0,"byteLength":3000,"byteOffset":1256312,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2000,"byteOffset":1259312,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1896,"byteOffset":1261312,"target":34963},{"buffer":0,"byteLength":2376,"byteOffset":1263208,"byteStride":12,"target":34962},{"buffer":0,"byteLength":3168,"byteOffset":1265584,"byteStride":16,"target":34962},{"buffer":0,"byteLength":2376,"byteOffset":1268752,"byteStride":12,"target":34962},{"buffer":0,"byteLength":1584,"byteOffset":1271128,"byteStride":8,"target":34962},{"buffer":0,"byteLength":396,"byteOffset":1272712,"target":34963},{"buffer":0,"byteLength":8496,"byteOffset":1273108,"byteStride":12,"target":34962},{"buffer":0,"byteLength":11328,"byteOffset":1281604,"byteStride":16,"target":34962},{"buffer":0,"byteLength":8496,"byteOffset":1292932,"byteStride":12,"target":34962},{"buffer":0,"byteLength":5664,"byteOffset":1301428,"byteStride":8,"target":34962},{"buffer":0,"byteLength":1416,"byteOffset":1307092,"target":34963},{"buffer":0,"byteLength":22644,"byteOffset":1308508,"byteStride":12,"target":34962},{"buffer":0,"byteLength":30192,"byteOffset":1331152,"byteStride":16,"target":34962},{"buffer":0,"byteLength":22644,"byteOffset":1361344,"byteStride":12,"target":34962},{"buffer":0,"byteLength":15096,"byteOffset":1383988,"byteStride":8,"target":34962},{"buffer":0,"byteLength":3774,"byteOffset":1399084,"target":34963},{"buffer":0,"byteLength":1872,"byteOffset":1402860,"byteStride":12,"target":34962},{"buffer":0,"byteLength":2496,"byteOffset":1404732,"byteStride":16,"target":34962},{"buffer":0,"byteLength":1872,"byteOffset":1407228,"byteStride":12,"target":34962},{"buffer":0,"byteLength":1248,"byteOffset":1409100,"byteStride":8,"target":34962},{"buffer":0,"byteLength":312,"byteOffset":1410348,"target":34963}],"buffers":[{"byteLength":1410660,"uri":"Overworld0.bin"}],"cameras":[{"perspective":{"yfov":1.30899691581726,"zfar":4000,"znear":0.0500000007450581},"type":"perspective"}],"extensions":{"KHR_lights_punctual":{"lights":[{"color":[1,1,1],"intensity":1,"range":73.1559982299805,"type":"point"}]},"OMI_physics_shape":{"shapes":[{"capsule":{"height":2,"radius":0.5},"type":"capsule"},{"box":{"size":[1,1,1]},"type":"box"},{"box":{"size":[1.94530999660492,2.43945002555847,1.08447003364563]},"type":"box"}]}},"extensionsUsed":["KHR_lights_punctual","OMI_physics_body","OMI_physics_shape"],"materials":[{"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.0200688615441322,0.119280159473419,0.0347481369972229,1],"metallicFactor":0,"roughnessFactor":1}},{"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.0868663638830185,0.106539219617844,0.0818345248699188,1],"metallicFactor":0,"roughnessFactor":1}},{"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.106539219617844,0.106539219617844,0.106539219617844,1],"metallicFactor":0.280000001192093,"roughnessFactor":0}},{"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.99999988079071,0.99999988079071,0.99999988079071,1],"metallicFactor":0,"roughnessFactor":1}},{"emissiveFactor":[0,0,0],"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0,0.142188608646393,0.0736702010035515,1],"metallicFactor":0,"roughnessFactor":1}},{"extensions":{},"name":"Material","pbrMetallicRoughness":{"baseColorFactor":[0.99999988079071,0.99999988079071,0.99999988079071,1],"metallicFactor":0.5,"roughnessFactor":1}},{"extensions":{},"name":"Material_006","pbrMetallicRoughness":{"baseColorFactor":[0.99999988079071,0.99999988079071,0.99999988079071,1],"metallicFactor":0.5,"roughnessFactor":1}},{"extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.99999988079071,0.99999988079071,0.99999988079071,1],"metallicFactor":0,"roughnessFactor":1}},{"extensions":{},"name":"tree2_001","pbrMetallicRoughness":{"baseColorFactor":[0.99999988079071,0.99999988079071,0.99999988079071,1],"metallicFactor":0.5,"roughnessFactor":1}},{"alphaMode":"BLEND","extensions":{},"pbrMetallicRoughness":{"baseColorFactor":[0.0149305770173669,0.0533112473785877,0.0835351049900055,0.458823531866074],"metallicFactor":0,"roughnessFactor":1}}],"meshes":[{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":2,"POSITION":0,"TANGENT":1,"TEXCOORD_0":3},"indices":4,"material":0,"mode":4},{"attributes":{"NORMAL":7,"POSITION":5,"TANGENT":6,"TEXCOORD_0":8},"indices":9,"material":1,"mode":4},{"attributes":{"NORMAL":12,"POSITION":10,"TANGENT":11,"TEXCOORD_0":13},"indices":14,"material":2,"mode":4},{"attributes":{"NORMAL":17,"POSITION":15,"TANGENT":16,"TEXCOORD_0":18},"indices":19,"material":3,"mode":4},{"attributes":{"NORMAL":22,"POSITION":20,"TANGENT":21,"TEXCOORD_0":23},"indices":24,"material":4,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":27,"POSITION":25,"TANGENT":26,"TEXCOORD_0":28},"indices":29,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":32,"POSITION":30,"TANGENT":31,"TEXCOORD_0":33},"indices":34,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":37,"POSITION":35,"TANGENT":36,"TEXCOORD_0":38},"indices":39,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":42,"POSITION":40,"TANGENT":41,"TEXCOORD_0":43},"indices":44,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":47,"POSITION":45,"TANGENT":46,"TEXCOORD_0":48},"indices":49,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":52,"POSITION":50,"TANGENT":51,"TEXCOORD_0":53},"indices":54,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":57,"POSITION":55,"TANGENT":56,"TEXCOORD_0":58},"indices":59,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":62,"POSITION":60,"TANGENT":61,"TEXCOORD_0":63},"indices":64,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":67,"POSITION":65,"TANGENT":66,"TEXCOORD_0":68},"indices":69,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":72,"POSITION":70,"TANGENT":71,"TEXCOORD_0":73},"indices":74,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":77,"POSITION":75,"TANGENT":76,"TEXCOORD_0":78},"indices":79,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":82,"POSITION":80,"TANGENT":81,"TEXCOORD_0":83},"indices":84,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":87,"POSITION":85,"TANGENT":86,"TEXCOORD_0":88},"indices":89,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":92,"POSITION":90,"TANGENT":91,"TEXCOORD_0":93},"indices":94,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":97,"POSITION":95,"TANGENT":96,"TEXCOORD_0":98},"indices":99,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":102,"POSITION":100,"TANGENT":101,"TEXCOORD_0":103},"indices":104,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":107,"POSITION":105,"TANGENT":106,"TEXCOORD_0":108},"indices":109,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":112,"POSITION":110,"TANGENT":111,"TEXCOORD_0":113},"indices":114,"material":5,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":117,"POSITION":115,"TANGENT":116,"TEXCOORD_0":118},"indices":119,"material":6,"mode":4},{"attributes":{"NORMAL":122,"POSITION":120,"TANGENT":121,"TEXCOORD_0":123},"indices":124,"material":6,"mode":4},{"attributes":{"NORMAL":127,"POSITION":125,"TANGENT":126,"TEXCOORD_0":128},"indices":129,"material":6,"mode":4},{"attributes":{"NORMAL":132,"POSITION":130,"TANGENT":131,"TEXCOORD_0":133},"indices":134,"material":6,"mode":4},{"attributes":{"NORMAL":137,"POSITION":135,"TANGENT":136,"TEXCOORD_0":138},"indices":139,"material":6,"mode":4},{"attributes":{"NORMAL":142,"POSITION":140,"TANGENT":141,"TEXCOORD_0":143},"indices":144,"material":6,"mode":4},{"attributes":{"NORMAL":147,"POSITION":145,"TANGENT":146,"TEXCOORD_0":148},"indices":149,"material":6,"mode":4},{"attributes":{"NORMAL":152,"POSITION":150,"TANGENT":151,"TEXCOORD_0":153},"indices":154,"material":6,"mode":4},{"attributes":{"NORMAL":157,"POSITION":155,"TANGENT":156,"TEXCOORD_0":158},"indices":159,"material":6,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":162,"POSITION":160,"TANGENT":161,"TEXCOORD_0":163},"indices":164,"material":7,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":167,"POSITION":165,"TANGENT":166,"TEXCOORD_0":168},"indices":169,"material":8,"mode":4},{"attributes":{"NORMAL":172,"POSITION":170,"TANGENT":171,"TEXCOORD_0":173},"indices":174,"material":8,"mode":4},{"attributes":{"NORMAL":177,"POSITION":175,"TANGENT":176,"TEXCOORD_0":178},"indices":179,"material":8,"mode":4},{"attributes":{"NORMAL":182,"POSITION":180,"TANGENT":181,"TEXCOORD_0":183},"indices":184,"material":8,"mode":4},{"attributes":{"NORMAL":187,"POSITION":185,"TANGENT":186,"TEXCOORD_0":188},"indices":189,"material":8,"mode":4},{"attributes":{"NORMAL":192,"POSITION":190,"TANGENT":191,"TEXCOORD_0":193},"indices":194,"material":8,"mode":4},{"attributes":{"NORMAL":197,"POSITION":195,"TANGENT":196,"TEXCOORD_0":198},"indices":199,"material":8,"mode":4},{"attributes":{"NORMAL":202,"POSITION":200,"TANGENT":201,"TEXCOORD_0":203},"indices":204,"material":8,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":207,"POSITION":205,"TANGENT":206,"TEXCOORD_0":208},"indices":209,"material":1,"mode":4},{"attributes":{"NORMAL":212,"POSITION":210,"TANGENT":211,"TEXCOORD_0":213},"indices":214,"material":2,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":217,"POSITION":215,"TANGENT":216,"TEXCOORD_0":218},"indices":219,"material":1,"mode":4}]},{"extras":{"targetNames":[]},"primitives":[{"attributes":{"NORMAL":222,"POSITION":220,"TANGENT":221,"TEXCOORD_0":223},"indices":224,"material":9,"mode":4}]}],"nodes":[{"children":[1,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],"mesh":0,"name":"CSGCombiner3D2"},{"children":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22],"name":"Terrain","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-13.0026998519897,-4.74561023712158,2.4859299659729]},{"name":"CSGCylinder3D","rotation":[0.500270485877991,0.500270426273346,0.499729454517365,0.499729454517365],"scale":[1.96346879005432,2.44980978965759,1.00000011920929],"translation":[-19.9404563903809,5.33507347106934,-19.2534084320068]},{"name":"CSGMesh3D","translation":[-0.10973644256592,12.3323192596436,-6.48062324523926]},{"mesh":1,"name":"Block","rotation":[0,0.000541050743777305,0,0.99999988079071],"translation":[22.835880279541,5.72934246063232,-8.56402683258057]},{"mesh":2,"name":"Block2","rotation":[0,-0.56937277317047,0,0.822079479694366],"translation":[25.0090217590332,5.72934246063232,-6.10501718521118]},{"mesh":3,"name":"Block3","rotation":[0,-0.83961027860641,0,0.54318904876709],"scale":[8.99999618530273,9,8.99999618530273],"translation":[31.5793590545654,5.91044092178345,-52.3054122924805]},{"mesh":4,"name":"Block13","rotation":[0,-0.8396103978157,0,0.543188989162445],"scale":[3.99999856948853,4,3.99999856948853],"translation":[17.1308174133301,4.13162612915039,-21.1291942596436]},{"matrix":[3.12551212310791,11.4877252578735,1.50444436073303,0,8.3065299987793,-1.13561940193176,-8.5855598449707,0,-8.07666969299316,3.27758121490479,-8.24770927429199,0,5.16219329833984,5.99411630630493,-71.4504928588867,1],"mesh":5,"name":"Block6"},{"mesh":6,"name":"Block5","rotation":[0,0.193412318825722,0,0.98111754655838],"scale":[8.99999523162842,9.00000095367432,8.99999523162842],"translation":[-23.281063079834,5.91044092178345,-52.2460479736328]},{"matrix":[-14.7272939682007,2.82266569137573,-0.37312233448029,0,2.14130616188049,12.276008605957,8.34951591491699,0,1.8765572309494,8.144455909729,-12.4557781219482,0,-70.7058029174805,5.62063074111938,26.4264030456543,1],"mesh":7,"name":"Block14"},{"matrix":[5.07412338256836,3.28748059272766,13.7275409698486,0,6.55585622787476,-13.4676485061646,0.801997482776642,0,12.5009660720825,5.72843027114868,-5.99258708953857,0,-86.9528884887695,1.16581630706787,5.89325618743896,1],"mesh":8,"name":"Block17"},{"matrix":[0.922963678836823,5.9648175239563,13.7320261001587,0,14.4188871383667,-4.05783987045288,0.793488800525665,0,4.03036975860596,13.1512365341187,-5.98342084884644,0,-101.635597229004,1.16581630706787,-39.3332672119141,1],"mesh":9,"name":"Block18"},{"mesh":10,"name":"Block16","rotation":[-0.1746039390564,0.553352415561676,0.245587423443794,0.776531636714935],"scale":[8.9999885559082,9.00000095367432,8.9999885559082],"translation":[-45.6466865539551,5.62063074111938,26.3992977142334]},{"mesh":11,"name":"Block15","rotation":[0,0.58032613992691,0,0.814384162425995],"scale":[8.99998950958252,9.00000095367432,8.99998950958252],"translation":[-45.6986846923828,5.62063074111938,-21.6528091430664]},{"mesh":12,"name":"Block4","rotation":[-0.00048000106472,0.388721287250519,0.000410608161473647,0.921355187892914],"translation":[16.3739948272705,5.51780700683594,-15.1385841369629]},{"mesh":13,"name":"Block7","rotation":[0.292343854904175,-0.06858689337969,0.350322693586349,0.887189388275146],"scale":[3.99999976158142,3.99999976158142,4.00000047683716],"translation":[-2.71547508239746,-2.09747505187988,-40.8427429199219]},{"mesh":14,"name":"Block8","rotation":[0.0000434210596722551,-0.62103217840195,0.456279247999191,0.637281894683838],"scale":[4,3.99999761581421,4.00000143051147],"translation":[14.1751747131348,-1.45563697814941,-32.7447166442871]},{"mesh":15,"name":"Block9","rotation":[0.12408996373415,-0.42438364028931,0.439081400632858,0.782117486000061],"scale":[4,3.99999737739563,4.00000143051147],"translation":[-18.7529544830322,-1.45563697814941,-32.7090835571289]},{"mesh":16,"name":"Block10","rotation":[-0.00627145916224,-0.62979280948639,0.456236243247986,0.628625690937042],"scale":[4.00000095367432,3.99999785423279,4.00000143051147],"translation":[26.7862014770508,4.00993919372559,21.45778465271]},{"mesh":17,"name":"Block11","rotation":[0.264100015163422,0.87530928850174,-0.37207797169685,-0.16013400256634],"scale":[4.00000047683716,3.99999737739563,4.00000143051147],"translation":[-7.04319190979004,4.00993919372559,23.8430042266846]},{"mesh":18,"name":"Block12","rotation":[0.358069717884064,0.115113258361816,0.282801955938339,0.882359385490417],"scale":[4.00000047683716,3.99999737739563,4.00000143051147],"translation":[-26.3833045959473,4.00993919372559,23.8639316558838]},{"mesh":19,"name":"Raft","rotation":[0,0.000541050743777305,0,0.99999988079071],"translation":[3.3277416229248,5.12365674972534,-32.7668533325195]},{"name":"Terrain2","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-13.0026998519897,-4.74561023712158,-68.4331817626953]},{"name":"Terrain4","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-57.0958862304688,-11.1742553710938,-12.8962249755859]},{"name":"Terrain3","rotation":[0,-0.17239327728748,0,0.985028207302094],"translation":[-34.1612205505371,9.31135940551758,-75.5618133544922]},{"name":"Terrain5","rotation":[0,0.759549558162689,0,0.650449454784393],"translation":[-80.599365234375,9.31135940551758,-51.1462821960449]},{"name":"Terrain6","rotation":[0,0.907165229320526,0,-0.42077457904816],"translation":[-114.584983825684,9.31135940551758,-24.0953769683838]},{"name":"Subtract","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[16.6984996795654,5.77351999282837,19.2828006744385]},{"name":"WellWall","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[4.48484992980957,0,14.0048999786377]},{"name":"WellSubtract","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[4.48484992980957,-8.04580020904541,14.0048999786377]},{"name":"SubtractCylinder2","rotation":[-0.20512656867504,0.495184063911438,0.121892131865025,0.835379064083099],"translation":[23.0417995452881,-5.60324001312256,24.8250999450684]},{"name":"SubtractCylinder4","rotation":[-0.07400631904602,0.530855059623718,-0.0921046808362,0.839185774326324],"scale":[1.2071498632431,2.0478367805481,1.97397828102112],"translation":[23.0417995452881,-5.60324001312256,-12.9279003143311]},{"name":"SubtractCylinder5","rotation":[-0.31769216060638,0.254640758037567,-0.38606223464012,0.827759444713593],"scale":[1.20714974403381,2.04783654212952,1.97397828102112],"translation":[-52.9976348876953,-5.60324001312256,-19.1241054534912]},{"name":"SubtractCylinder3","rotation":[-0.59787803888321,0.353392332792282,-0.36467033624649,0.620218694210052],"translation":[23.0417995452881,-8.81270027160645,-7.98110008239746]},{"name":"Ramparts","translation":[-30.5706996917725,2.66809010505676,32.5154991149902]},{"name":"Ramparts2","translation":[12.2158002853394,-15.9505996704102,29.7078990936279]},{"name":"RampartsSubtractCylinder3","rotation":[-0.20512656867504,0.495184063911438,0.121892131865025,0.835379064083099],"translation":[21.9459991455078,5.08797979354858,29.62380027771]},{"children":[39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"name":"Wall","translation":[-13.5,7.08436012268066,28]},{"name":"DoorWay","translation":[10.7040004730225,-0.63964802026749,-0.0075912498869]},{"name":"WallSubtractCylindar","rotation":[-0.60278987884521,0.488036841154099,-0.14793536067009,0.61366081237793],"translation":[25.0440998077393,4.89838981628418,2.94027996063232]},{"name":"WallSubtract","rotation":[-0.0001166081347,-0.00096213223878,-0.24096286296844,0.970533847808838],"translation":[34.7672996520996,2.81410002708435,-0.46432700753212]},{"name":"Windows","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[3.19352006912231,4.8960599899292,0.0337123982608318]},{"name":"Windows2","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[0.193517997860909,4.8960599899292,0.0337123982608318]},{"name":"Windows3","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-2.80647993087769,4.8960599899292,0.0337123982608318]},{"name":"Windows4","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-5.80647993087769,4.8960599899292,0.0337123982608318]},{"name":"Windows5","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-8.80648040771484,4.8960599899292,0.0337123982608318]},{"name":"Windows6","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-11.8065004348755,4.8960599899292,0.0337123982608318]},{"name":"Windows7","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-14.8065004348755,4.8960599899292,0.0337123982608318]},{"name":"Windows8","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-17.8064994812012,4.8960599899292,0.0337123982608318]},{"name":"Windows9","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-20.8064994812012,4.8960599899292,0.0337123982608318]},{"name":"Windows10","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-23.8064994812012,4.8960599899292,0.0337123982608318]},{"name":"Windows11","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-26.8064994812012,4.8960599899292,0.0337123982608318]},{"name":"Windows12","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[-29.8064994812012,4.8960599899292,0.0337123982608318]},{"name":"GateSubtract","rotation":[0,-0.00054105033632,0,0.999999821186066],"translation":[10.8273000717163,-1.45649003982544,-0.42907899618149]},{"name":"ShrinePodium","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8995018005371,1.54855000972748,22.1751003265381]},{"name":"ShrineAccent","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8995018005371,-0.31930500268936,9.91670036315918]},{"name":"ShrineAccent2","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8995018005371,0.323650002479553,9.08417987823486]},{"name":"ShrineAccent3","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8959007263184,1.28419995307922,8.30282974243164]},{"name":"Ruin","scale":[1.96346998214722,2.44981002807617,1],"translation":[-19.1840000152588,2.67377996444702,7.3028302192688]},{"name":"Ruin2","rotation":[0,0,0.140192598104477,0.9901242852211],"scale":[1.96346986293793,2.44980692863464,1],"translation":[-19.1839008331299,-1.42128002643585,2.30282998085022]},{"name":"Ruin3","scale":[1.96346998214722,2.44981002807617,1],"translation":[-16.1840000152588,2.67377996444702,7.3028302192688]},{"name":"Ruin4","scale":[1.96346998214722,2.44981002807617,1],"translation":[-16.1840000152588,2.67377996444702,2.30282998085022]},{"name":"Ruin55","scale":[1.96346998214722,2.44981002807617,1],"translation":[-20.8204708099365,2.67377996444702,-15.5373859405518]},{"name":"Ruin56","scale":[1.96346998214722,2.44981002807617,1],"translation":[-20.8204708099365,2.67377996444702,-12.5373859405518]},{"name":"Ruin57","scale":[1.96346998214722,2.44981002807617,1],"translation":[-20.8204708099365,2.67377996444702,-9.53738594055176]},{"name":"Ruin58","scale":[1.96346998214722,2.44981002807617,1],"translation":[-20.8204708099365,2.67377996444702,-6.53738594055176]},{"name":"Ruin61","rotation":[0,0,0.70710676908493,0.70710676908493],"scale":[1.96346986293793,2.44980978965759,1],"translation":[-24.5526237487793,1.52633929252625,-16.6061058044434]},{"name":"Ruin62","rotation":[-0.5,0.5,-0.5,-0.5],"scale":[1.96346986293793,2.44980978965759,1],"translation":[-32.9261169433594,-0.24897387623787,-19.7943458557129]},{"name":"Ruin60","rotation":[0,0,0.70710676908493,0.70710676908493],"scale":[1.96346986293793,2.44980978965759,1],"translation":[-41.3428382873535,1.43527603149414,-16.6061058044434]},{"name":"Ruin9","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,1.68259644508362]},{"name":"Ruin10","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-0.31740355491638]},{"name":"Ruin11","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-2.31740355491638]},{"name":"Ruin12","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-4.31740379333496]},{"name":"Ruin13","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-6.31740379333496]},{"name":"Ruin14","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-8.31740379333496]},{"name":"Ruin15","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-10.317403793335]},{"name":"Ruin16","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-12.317403793335]},{"name":"Ruin17","scale":[1.96346998214722,2.44981002807617,1],"translation":[-21.553581237793,11.9210739135742,-14.317403793335]},{"name":"Ruin18","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-23.0249042510986,11.9210739135742,-16.0243110656738]},{"name":"Ruin19","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-25.0249042510986,11.9210739135742,-16.0243110656738]},{"name":"Ruin20","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-27.0249042510986,11.9210739135742,-16.0243110656738]},{"name":"Ruin21","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-29.0249042510986,11.9210739135742,-16.0243110656738]},{"name":"Ruin22","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-31.0249042510986,11.9210739135742,-16.0243110656738]},{"name":"Ruin23","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-33.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin24","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-35.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin25","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-37.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin26","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-39.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin27","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-41.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin28","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[1.96346998214722,2.44980978965759,0.999999940395355],"translation":[-43.02490234375,11.9210739135742,-16.0243110656738]},{"name":"Ruin29","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-14.4945192337036]},{"name":"Ruin30","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-12.4945192337036]},{"name":"Ruin31","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-10.4945192337036]},{"name":"Ruin32","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-8.49451923370361]},{"name":"Ruin33","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-6.49451923370361]},{"name":"Ruin34","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-4.49451923370361]},{"name":"Ruin35","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-2.49451923370361]},{"name":"Ruin36","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,-0.49451923370361]},{"name":"Ruin37","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,1.50548076629639]},{"name":"Ruin38","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,3.50548076629639]},{"name":"Ruin39","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,5.50548076629639]},{"name":"Ruin40","rotation":[0,1,0,-0.00000004371138],"scale":[1.96346998214722,2.44980978965759,0.99999988079071],"translation":[-44.5423431396484,11.9210739135742,7.50548076629639]},{"name":"Ruin41","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-42.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin42","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-40.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin43","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-38.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin44","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-36.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin45","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-34.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin46","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-32.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin47","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-30.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin48","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-28.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin49","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-26.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin50","rotation":[0,-0.70710670948029,0,0.707106828689575],"scale":[1.96346998214722,2.44980955123901,0.999999821186066],"translation":[-24.5423431396484,11.9210739135742,8.57416439056396]},{"name":"Ruin51","scale":[1.96346998214722,2.44980955123901,0.999999761581421],"translation":[-21.5322799682617,11.9210739135742,6.58393955230713]},{"name":"Ruin52","scale":[1.96346998214722,2.44980955123901,0.999999761581421],"translation":[-21.5322799682617,11.9210739135742,8.62893581390381]},{"name":"Ruin5","scale":[1.96346998214722,2.44981002807617,1],"translation":[-13.175461769104,2.67377996444702,7.3159031867981]},{"name":"Ruin6","scale":[1.96346998214722,2.44981002807617,1],"translation":[-13.1840000152588,2.67377996444702,2.30282998085022]},{"name":"Ruin7","scale":[1.96346998214722,2.44981002807617,1],"translation":[-10.1840000152588,2.67377996444702,7.3028302192688]},{"name":"Ruin53","rotation":[0,-0.03418433666229,0,0.999415576457977],"scale":[1.96346974372864,2.44980978965759,1],"translation":[0.461402654647827,1.17180597782135,26.2002029418945]},{"name":"Ruin54","rotation":[0,-0.03418433666229,0,0.999415576457977],"scale":[1.96346974372864,2.44980978965759,1],"translation":[-6.04369735717773,1.17180597782135,26.2002029418945]},{"name":"Ruin8","scale":[1.96346998214722,2.44981002807617,1],"translation":[-10.2906856536865,2.67378091812134,2.28666138648987]},{"children":[121,123,124,125,126,128,129,130,136],"extensions":{"OMI_physics_body":{"motion":{"type":"kinematic"}}},"name":"Player","rotation":[0,-0.67557740211487,0,0.737289130687714],"translation":[0.816029012203217,0.747025012969971,0.564047992229462]},{"children":[122],"extensions":{"OMI_physics_body":{"collider":{"shape":0}}},"name":"CollisionShape3D","translation":[0,0.937566995620728,0]},{"mesh":20,"name":"MeshInstance3D"},{"camera":0,"name":"Camera3D","translation":[0,1.36135995388031,-0.47279500961304]},{"extensions":{"KHR_lights_punctual":{"light":0}},"name":"OmniLight3D"},{"name":"AnimationPlayer"},{"children":[127],"extensions":{"OMI_physics_body":{"trigger":{"nodes":[127]}}},"name":"Hitbox","translation":[0,1,-1]},{"extensions":{"OMI_physics_body":{"trigger":{"shape":1}}},"name":"HitboxCollision"},{"name":"SwordSlashAnimation"},{"name":"HealthTimer"},{"children":[131],"name":"MarginContainer"},{"children":[132,133,134,135],"name":"VBoxContainer"},{"name":"HPNumber"},{"name":"HPBar"},{"name":"VTNumber"},{"name":"VTBar"},{"children":[137],"extensions":{"OMI_physics_body":{"trigger":{"nodes":[137]}}},"name":"CollisionDetector"},{"extensions":{"OMI_physics_body":{"trigger":{"shape":2}}},"name":"CollisionShape3D2","translation":[-0.04795610159636,0.982638001441956,-0.04021000117064]},{"mesh":21,"name":"Tree","rotation":[0,0.980236709117889,0,0.197828412055969],"scale":[1.76175653934479,2.42554998397827,2.84312725067139],"translation":[-1.6596200466156,15.8289003372192,30.4834003448486]},{"children":[140,141,142,143,144,145,146,147],"mesh":22,"name":"Shrine2","translation":[0,-0.0719055980444,0]},{"name":"ShrinePath","scale":[1.96346998214722,2.44981002807617,1],"translation":[30.9374008178711,-0.67542600631714,11.7852001190186]},{"name":"ShrinePath2","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8440017700195,-0.66586297750473,17.7019004821777]},{"name":"ShrineBack","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8017997741699,6.44817018508911,23.8675994873047]},{"name":"ShrineBack4","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8017997741699,3.36114001274109,23.271900177002]},{"name":"ShrineBack2","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.8017997741699,3.99835991859436,23.8675994873047]},{"name":"ShrineBack3","scale":[1.96346998214722,2.44981002807617,1],"translation":[35.9133987426758,2.82757997512817,23.868200302124]},{"name":"ShrineArch","scale":[1.96346998214722,2.44981002807617,1],"translation":[36.3160018920898,4.03647994995117,22.6077995300293]},{"name":"ShrineSubtract","scale":[1.96346998214722,2.44981002807617,1],"translation":[36.046199798584,3.50032997131348,22.694299697876]},{"children":[149],"mesh":23,"name":"Ruins2","translation":[0,-0.0719055980444,0]},{"children":[150],"name":"Shrine3"},{"children":[151,152,153,154,155,156,157,158],"mesh":24,"name":"Ruins4","scale":[1.96346998214722,2.44981002807617,1],"translation":[-32.9426002502441,5.22326993942261,-3.78048992156982]},{"name":"CSGBox3D","scale":[0.999997973442078,1,0.999980986118317],"translation":[2.50591993331909,0.500001013278961,8.34955978393555]},{"name":"CSGBox3D2","rotation":[0,0.70710676908493,0,0.70710676908493],"scale":[0.9999880194664,1,0.999981999397278],"translation":[-0.50261300802231,0.500001013278961,3.22035002708435]},{"name":"CSGBox3D3","scale":[0.9999880194664,1,0.999975025653839],"translation":[1.77658998966217,0.500001013278961,-1.82788002490997]},{"name":"CSGBox3D4","scale":[0.9999880194664,1,0.999967992305756],"translation":[-2.00541996955872,0.500001013278961,-3.45861005783081]},{"name":"CSGBox3D5","scale":[0.9999880194664,1,0.999957978725433],"translation":[-3.82170009613037,0.500001013278961,3.98898005485535]},{"name":"CSGBox3D6","scale":[0.9999880194664,1,0.999953985214233],"translation":[-3.82170009613037,-0.01782130077481,-7.88076019287109]},{"name":"CSGBox3D7","scale":[0.9999880194664,1,0.999949991703033],"translation":[-1.32766997814178,-1.03775000572205,-8.28207015991211]},{"name":"CSGCylinder3D2","rotation":[-0.70710676908493,0,0,0.70710676908493],"translation":[0,-1.93809938430786,-14.9331521987915]},{"children":[160,161],"mesh":25,"name":"CSGCombiner3D23"},{"name":"water","translation":[-43.1625938415527,-0.11244964599609,-6.62782669067383]},{"name":"water2","translation":[-145.574996948242,-0.11244964599609,-28.9885749816895]}],"scene":0,"scenes":[{"name":"Node3D","nodes":[0,120,138,139,148,159]}]} \ No newline at end of file diff --git a/src/enemy/enemy_types/floating_enemy/Overworld.gltf.import b/src/enemy/enemy_types/floating_enemy/Overworld.gltf.import deleted file mode 100644 index c96e9043..00000000 --- a/src/enemy/enemy_types/floating_enemy/Overworld.gltf.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="scene" -importer_version=1 -type="PackedScene" -uid="uid://cx042gptg5aew" -valid=false - -[deps] - -source_file="res://src/enemy/enemy_types/floating_enemy/Overworld.gltf" - -[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 diff --git a/src/game/Game.cs b/src/game/Game.cs index db1ad873..16421f12 100644 --- a/src/game/Game.cs +++ b/src/game/Game.cs @@ -4,15 +4,10 @@ namespace GameJamDungeon; using Chickensoft.AutoInject; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; -using DialogueManagerRuntime; using Godot; -using System; -using System.Collections.Generic; -using System.Linq; public interface IGame : IProvide, IProvide, INode3D { - public void ToggleInventory(); } [Meta(typeof(IAutoNode))] @@ -34,17 +29,17 @@ public partial class Game : Node3D, IGame [Dependency] public IAppRepo AppRepo => this.DependOn(); + #region Nodes [Node] public IMap Map { get; set; } = default!; - [Node] public DialogueController DialogueController { get; set; } = default!; - - [Node] public IPauseMenu PauseMenu { get; set; } = default!; + [Node] public InGameUI InGameUI { get; set; } = default!; [Node] public FloorClearMenu FloorClearMenu { get; set; } = default!; [Node] public DeathMenu DeathMenu { get; set; } = default!; - [Node] public InGameUI InGameUI { get; set; } = default!; + [Node] public IPauseMenu PauseMenu { get; set; } = default!; + #endregion public void Setup() { @@ -53,9 +48,30 @@ public partial class Game : Node3D, IGame GameLogic.Set(GameRepo); GameLogic.Set(AppRepo); Instantiator = new Instantiator(GetTree()); + } - FloorClearMenu.TransitionCompleted += OnFloorClearTransitionCompleted; - PauseMenu.TransitionCompleted += OnPauseMenuTransitioned; + private void PlayerInventory_InventoryAtCapacity(string rejectedItem) + { + InGameUI.PlayerInfoUI.DisplayInventoryFullMessage(rejectedItem); + } + + private void OnInventoryAtCapacity(string rejectedItemName) => InGameUI.PlayerInfoUI.DisplayInventoryFullMessage(rejectedItemName); + + private void InventoryMenu_CloseInventory() => GameLogic.Input(new GameLogic.Input.InventoryMenuToggle()); + + private void Map_DungeonFinishedGenerating() + { + GameRepo.SetPlayerGlobalPosition(Map.GetPlayerSpawnPoint()); + } + + private void Map_DialogueChoiceMade() + { + GameRepo.Resume(); + } + + private void Map_TeleportReached() + { + GameRepo.Pause(); } private void OnFloorClearTransitionCompleted() @@ -68,12 +84,6 @@ public partial class Game : Node3D, IGame GameLogic.Input(new GameLogic.Input.PauseMenuTransitioned()); } - public void Exit() - { - GameLogic.Input(new GameLogic.Input.LoadNextFloor()); - GameRepo.Resume(); - } - public void OnResolved() { GameBinding = GameLogic.Bind(); @@ -92,6 +102,7 @@ public partial class Game : Node3D, IGame .Handle((in GameLogic.Output.HidePauseMenu _) => { PauseMenu.Hide(); }) .Handle((in GameLogic.Output.ExitPauseMenu _) => { PauseMenu.FadeOut(); }) .Handle((in GameLogic.Output.ShowFloorClearMenu _) => { FloorClearMenu.Show(); FloorClearMenu.FadeIn(); }) + .Handle((in GameLogic.Output.ExitFloorClearMenu _) => { FloorClearMenu.FadeOut(); }) .Handle((in GameLogic.Output.SetInventoryMode _) => { InGameUI.ShowInventoryScreen(); }) .Handle((in GameLogic.Output.HideInventory _) => { InGameUI.HideInventoryScreen(); }) .Handle((in GameLogic.Output.ShowMiniMap _) => { InGameUI.ShowMiniMap(); }) @@ -103,6 +114,14 @@ public partial class Game : Node3D, IGame GameLogic.Input(new GameLogic.Input.Initialize()); this.Provide(); + + FloorClearMenu.TransitionCompleted += OnFloorClearTransitionCompleted; + PauseMenu.TransitionCompleted += OnPauseMenuTransitioned; + Map.TeleportReached += Map_TeleportReached; + Map.DialogueDecisionMade += Map_DialogueChoiceMade; + Map.DungeonFinishedGenerating += Map_DungeonFinishedGenerating; + InGameUI.InventoryMenu.ClosedMenu += InventoryMenu_CloseInventory; + GameRepo.PlayerData.Inventory.InventoryAtCapacity += PlayerInventory_InventoryAtCapacity; } public void ToggleInventory() @@ -143,5 +162,5 @@ public partial class Game : Node3D, IGame GetTree().Paused = isPaused; } - public void OnStart() => GameLogic.Input(new GameLogic.Input.Start()); + public void OnStart() => GameLogic.Input(new GameLogic.Input.StartGame()); } diff --git a/src/game/Game.tscn b/src/game/Game.tscn index 1d02e6d6..5213defe 100644 --- a/src/game/Game.tscn +++ b/src/game/Game.tscn @@ -31,7 +31,6 @@ script = ExtResource("4_f5pye") [node name="InGameUI" parent="." instance=ExtResource("5_lxtnp")] unique_name_in_owner = true -visible = false [node name="InGameAudio" parent="." instance=ExtResource("6_qc71l")] @@ -47,6 +46,7 @@ visible = false [node name="FloorClearMenu" parent="." instance=ExtResource("11_rya1n")] unique_name_in_owner = true visible = false +modulate = Color(1, 1, 1, 1) [node name="PauseMenu" parent="." instance=ExtResource("12_yev8k")] unique_name_in_owner = true diff --git a/src/game/GameLogic.Input.cs b/src/game/GameLogic.Input.cs index b2b086c8..5b1f539e 100644 --- a/src/game/GameLogic.Input.cs +++ b/src/game/GameLogic.Input.cs @@ -4,7 +4,7 @@ { public static class Input { - public readonly record struct Start; + public readonly record struct StartGame; public readonly record struct Initialize; @@ -16,12 +16,12 @@ public readonly record struct GameOver; - public readonly record struct LoadNextFloor; - public readonly record struct FloorExitReached; public readonly record struct FloorClearTransitioned; + public readonly record struct GoToNextFloor; + public readonly record struct PauseButtonPressed; public readonly record struct PauseMenuTransitioned; diff --git a/src/game/GameLogic.Output.cs b/src/game/GameLogic.Output.cs index 6fb701fe..2e3ab303 100644 --- a/src/game/GameLogic.Output.cs +++ b/src/game/GameLogic.Output.cs @@ -14,7 +14,7 @@ namespace GameJamDungeon public readonly record struct ExitPauseMenu; - public readonly record struct SetInventoryMode(List Inventory); + public readonly record struct SetInventoryMode(); public readonly record struct HideInventory; @@ -32,7 +32,7 @@ namespace GameJamDungeon public readonly record struct ShowFloorClearMenu; - public readonly record struct HideFloorClearMenu; + public readonly record struct ExitFloorClearMenu; } } } diff --git a/src/game/GameLogic.g.puml b/src/game/GameLogic.g.puml index 25972707..368c6f42 100644 --- a/src/game/GameLogic.g.puml +++ b/src/game/GameLogic.g.puml @@ -1,6 +1,7 @@ @startuml GameLogic state "GameLogic State" as GameJamDungeon_GameLogic_State { state "FloorCleared" as GameJamDungeon_GameLogic_State_FloorCleared + state "GameStarted" as GameJamDungeon_GameLogic_State_GameStarted state "InventoryOpened" as GameJamDungeon_GameLogic_State_InventoryOpened state "MenuBackdrop" as GameJamDungeon_GameLogic_State_MenuBackdrop state "MinimapOpen" as GameJamDungeon_GameLogic_State_MinimapOpen @@ -10,9 +11,11 @@ state "GameLogic State" as GameJamDungeon_GameLogic_State { state "Resuming" as GameJamDungeon_GameLogic_State_Resuming } +GameJamDungeon_GameLogic_State_FloorCleared --> GameJamDungeon_GameLogic_State_FloorCleared : GoToNextFloor +GameJamDungeon_GameLogic_State_GameStarted --> GameJamDungeon_GameLogic_State_Playing : Initialize GameJamDungeon_GameLogic_State_InventoryOpened --> GameJamDungeon_GameLogic_State_Playing : InventoryMenuToggle GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_MenuBackdrop : Initialize -GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_Playing : Start +GameJamDungeon_GameLogic_State_MenuBackdrop --> GameJamDungeon_GameLogic_State_Playing : StartGame GameJamDungeon_GameLogic_State_MinimapOpen --> GameJamDungeon_GameLogic_State_Playing : MiniMapButtonReleased GameJamDungeon_GameLogic_State_Paused --> GameJamDungeon_GameLogic_State_Resuming : PauseButtonPressed GameJamDungeon_GameLogic_State_Playing --> GameJamDungeon_GameLogic_State_FloorCleared : FloorExitReached @@ -24,14 +27,16 @@ GameJamDungeon_GameLogic_State_Resuming --> GameJamDungeon_GameLogic_State_Playi GameJamDungeon_GameLogic_State : OnIsPaused() → SetPauseMode GameJamDungeon_GameLogic_State_FloorCleared : OnEnter → ShowFloorClearMenu -GameJamDungeon_GameLogic_State_FloorCleared : OnExit → HideFloorClearMenu +GameJamDungeon_GameLogic_State_FloorCleared : OnExit → ExitFloorClearMenu +GameJamDungeon_GameLogic_State_GameStarted : OnEnter → ShowFloorClearMenu +GameJamDungeon_GameLogic_State_GameStarted : OnExit → ExitFloorClearMenu +GameJamDungeon_GameLogic_State_GameStarted : OnInitialize → StartGame GameJamDungeon_GameLogic_State_InventoryOpened : OnEnter → SetInventoryMode GameJamDungeon_GameLogic_State_InventoryOpened : OnExit → HideInventory GameJamDungeon_GameLogic_State_MinimapOpen : OnEnter → ShowMiniMap GameJamDungeon_GameLogic_State_MinimapOpen : OnExit → HideMiniMap GameJamDungeon_GameLogic_State_Paused : OnEnter → ShowPauseMenu GameJamDungeon_GameLogic_State_Paused : OnExit → ExitPauseMenu -GameJamDungeon_GameLogic_State_Playing : OnEnter → StartGame GameJamDungeon_GameLogic_State_Quit : OnEnter → ShowLostScreen GameJamDungeon_GameLogic_State_Resuming : OnExit → HidePauseMenu diff --git a/src/game/IGameRepo.cs b/src/game/IGameRepo.cs index 2598c755..7cb0d4a3 100644 --- a/src/game/IGameRepo.cs +++ b/src/game/IGameRepo.cs @@ -1,107 +1,57 @@ using Chickensoft.Collections; using Godot; using System; -using System.Collections.Generic; namespace GameJamDungeon; public interface IGameRepo : IDisposable { - public void OnGameEnded(); - - event Action? Ended; - - AutoProp> InventoryItems { get; } - - IAutoProp IsInventoryScreenOpened { get; } - - IAutoProp IsPaused { get; } - void Pause(); void Resume(); + IAutoProp IsPaused { get; } + IAutoProp PlayerGlobalPosition { get; } + PlayerData PlayerData { get; } + + public void SetPlayerData(PlayerData playerData); + void SetPlayerGlobalPosition(Vector3 playerGlobalPosition); - void SetPlayerStatInfo(PlayerStatInfo playerStatInfo); - - public void OnWeaponEquipped(Weapon equippedItem); - - public void OnArmorEquipped(Armor equippedItem); - - public void OnAccessoryEquipped(Accessory equippedItem); - - public AutoProp EquippedWeapon { get; } - - public AutoProp EquippedArmor { get; } - - public AutoProp EquippedAccessory { get; } - public int MaxItemSize { get; } - public AutoProp PlayerStatInfo { get; } - - public bool IsItemEquipped(IEquipable item); - - public void EquipItem(IEquipable item); - - public void UnequipItem(IEquipable item); - public int CurrentFloor { get; set; } + + public void OnGameEnded(); + + event Action? Ended; } public class GameRepo : IGameRepo { public event Action? Ended; - private readonly AutoProp> _inventoryItems; - private readonly AutoProp _isInventoryScreenOpened; - - public AutoProp> InventoryItems => _inventoryItems; - - public IAutoProp IsInventoryScreenOpened => _isInventoryScreenOpened; - public IAutoProp PlayerGlobalPosition => _playerGlobalPosition; private readonly AutoProp _playerGlobalPosition; public IAutoProp IsPaused => _isPaused; private readonly AutoProp _isPaused; - private AutoProp _equippedWeapon; - public AutoProp EquippedWeapon => _equippedWeapon; - - private AutoProp _equippedArmor; - - public AutoProp EquippedArmor => _equippedArmor; - - private AutoProp _equippedAccessory; - - public AutoProp EquippedAccessory => _equippedAccessory; - - public bool IsWithinDialogueSpace { get; set; } + public PlayerData PlayerData => _playerData; + private PlayerData _playerData; public int MaxItemSize => 20; private bool _disposedValue; - private AutoProp _playerStatInfo; - - public AutoProp PlayerStatInfo => _playerStatInfo; - - public int CurrentFloor { get; set; } = -1; + public int CurrentFloor { get; set; } = 0; public GameRepo() { - _inventoryItems = new AutoProp>([]); - _isInventoryScreenOpened = new AutoProp(false); _isPaused = new AutoProp(false); _playerGlobalPosition = new AutoProp(Vector3.Zero); - _equippedWeapon = new AutoProp(new Weapon()); - _equippedArmor = new AutoProp(new Armor()); - _equippedAccessory = new AutoProp(new Accessory()); - _playerStatInfo = new AutoProp(new PlayerStatInfo()); } public void Pause() @@ -118,37 +68,7 @@ public class GameRepo : IGameRepo public void SetPlayerGlobalPosition(Vector3 playerGlobalPosition) => _playerGlobalPosition.OnNext(playerGlobalPosition); - public void SetPlayerStatInfo(PlayerStatInfo playerStatInfo) => _playerStatInfo.OnNext(playerStatInfo); - - public void OnWeaponEquipped(Weapon equippedItem) - { - PlayerStatInfo.Value.BonusAttack -= _equippedWeapon.Value.WeaponInfo.Damage; - PlayerStatInfo.Value.BonusAttack += equippedItem.WeaponInfo.Damage; - _equippedWeapon.OnNext(equippedItem); - } - - public void OnArmorEquipped(Armor equippedItem) - { - PlayerStatInfo.Value.BonusDefense -= _equippedArmor.Value.ArmorInfo.Defense; - PlayerStatInfo.Value.BonusDefense += equippedItem.ArmorInfo.Defense; - _equippedArmor.OnNext(equippedItem); - } - - public void OnAccessoryEquipped(Accessory equippedItem) - { - PlayerStatInfo.Value.BonusAttack -= _equippedAccessory.Value.AccessoryInfo.ATKUp; - PlayerStatInfo.Value.BonusDefense -= _equippedAccessory.Value.AccessoryInfo.DEFUp; - PlayerStatInfo.Value.MaximumHP -= _equippedAccessory.Value.AccessoryInfo.MaxHPUp; - PlayerStatInfo.Value.MaximumVT -= _equippedAccessory.Value.AccessoryInfo.MaxVTUp; - PlayerStatInfo.Value.Luck -= _equippedAccessory.Value.AccessoryInfo.LUCKUp; - - PlayerStatInfo.Value.BonusAttack += equippedItem.AccessoryInfo.ATKUp; - PlayerStatInfo.Value.BonusDefense += equippedItem.AccessoryInfo.DEFUp; - PlayerStatInfo.Value.MaximumHP += equippedItem.AccessoryInfo.MaxHPUp; - PlayerStatInfo.Value.MaximumVT += equippedItem.AccessoryInfo.MaxVTUp; - PlayerStatInfo.Value.Luck += equippedItem.AccessoryInfo.LUCKUp; - _equippedAccessory.OnNext(equippedItem); - } + public void SetPlayerData(PlayerData playerData) => _playerData = playerData; public void OnGameEnded() { @@ -156,42 +76,6 @@ public class GameRepo : IGameRepo Ended?.Invoke(); } - public bool IsItemEquipped(IEquipable item) - { - if (item is Weapon) - return EquippedWeapon.Value == item; - - if (item is Armor) - return EquippedArmor.Value == item; - - if (item is Accessory) - return EquippedAccessory.Value == item; - - return false; - } - - public void EquipItem(IEquipable item) - { - if (item is Weapon weapon) - OnWeaponEquipped(weapon); - - if (item is Armor armor) - OnArmorEquipped(armor); - - if (item is Accessory accessory) - OnAccessoryEquipped(accessory); - } - - public void UnequipItem(IEquipable item) - { - if (item == EquippedWeapon.Value) - OnWeaponEquipped(new Weapon()); - if (item == EquippedArmor.Value) - OnArmorEquipped(new Armor()); - if (item == EquippedAccessory.Value) - OnAccessoryEquipped(new Accessory()); - } - protected void Dispose(bool disposing) { if (!_disposedValue) @@ -200,10 +84,6 @@ public class GameRepo : IGameRepo { _playerGlobalPosition.OnCompleted(); _playerGlobalPosition.Dispose(); - _inventoryItems.OnCompleted(); - _inventoryItems.Dispose(); - _isInventoryScreenOpened.OnCompleted(); - _isInventoryScreenOpened.Dispose(); _isPaused.OnCompleted(); _isPaused.Dispose(); } diff --git a/src/game/state/states/GameLogic.State.FloorCleared.cs b/src/game/state/states/GameLogic.State.FloorCleared.cs index 3c4079d5..c785690a 100644 --- a/src/game/state/states/GameLogic.State.FloorCleared.cs +++ b/src/game/state/states/GameLogic.State.FloorCleared.cs @@ -8,12 +8,17 @@ namespace GameJamDungeon public partial record State { [Meta] - public partial record FloorCleared : State + public partial record FloorCleared : State, IGet { public FloorCleared() { this.OnEnter(() => { Get().Pause(); Output(new Output.ShowFloorClearMenu()); }); - this.OnExit(() => { Output(new Output.HideFloorClearMenu()); }); + this.OnExit(() => { Output(new Output.ExitFloorClearMenu()); }); + } + + public Transition On(in Input.GoToNextFloor input) + { + return ToSelf(); } } } diff --git a/src/game/state/states/GameLogic.State.GameStarted.cs b/src/game/state/states/GameLogic.State.GameStarted.cs new file mode 100644 index 00000000..a5036654 --- /dev/null +++ b/src/game/state/states/GameLogic.State.GameStarted.cs @@ -0,0 +1,27 @@ +using Chickensoft.Introspection; +using Chickensoft.LogicBlocks; + +namespace GameJamDungeon +{ + public partial class GameLogic + { + public partial record State + { + [Meta] + public partial record GameStarted : State, IGet + { + public GameStarted() + { + this.OnEnter(() => { Get().Pause(); Output(new Output.ShowFloorClearMenu()); }); + this.OnExit(() => { Output(new Output.ExitFloorClearMenu()); }); + } + + public Transition On(in Input.Initialize input) + { + Output(new Output.StartGame()); + return To(); + } + } + } + } +} diff --git a/src/game/state/states/GameLogic.State.InventoryOpened.cs b/src/game/state/states/GameLogic.State.InventoryOpened.cs index 62c8acfe..d3b9cd07 100644 --- a/src/game/state/states/GameLogic.State.InventoryOpened.cs +++ b/src/game/state/states/GameLogic.State.InventoryOpened.cs @@ -12,7 +12,7 @@ namespace GameJamDungeon { public InventoryOpened() { - this.OnEnter(() => { Get().Pause(); Output(new Output.SetInventoryMode(Get().InventoryItems.Value)); }); + this.OnEnter(() => { Get().Pause(); Output(new Output.SetInventoryMode()); }); this.OnExit(() => { Get().Resume(); Output(new Output.HideInventory()); }); } public Transition On(in Input.InventoryMenuToggle input) => To(); diff --git a/src/game/state/states/GameLogic.State.MenuBackdrop.cs b/src/game/state/states/GameLogic.State.MenuBackdrop.cs index 3f840ce3..93167a5f 100644 --- a/src/game/state/states/GameLogic.State.MenuBackdrop.cs +++ b/src/game/state/states/GameLogic.State.MenuBackdrop.cs @@ -7,7 +7,7 @@ namespace GameJamDungeon public partial record State { [Meta] - public partial record MenuBackdrop : State, IGet, IGet + public partial record MenuBackdrop : State, IGet, IGet { public MenuBackdrop() { @@ -15,9 +15,9 @@ namespace GameJamDungeon OnDetach(() => Get().GameEntered -= OnGameEntered); } - public void OnGameEntered() => Input(new Input.Start()); + public void OnGameEntered() => Input(new Input.StartGame()); - public Transition On(in Input.Start input) => To(); + public Transition On(in Input.StartGame input) => To(); public Transition On(in Input.Initialize input) { diff --git a/src/game/state/states/GameLogic.State.Playing.cs b/src/game/state/states/GameLogic.State.Playing.cs index b11dafac..784a374b 100644 --- a/src/game/state/states/GameLogic.State.Playing.cs +++ b/src/game/state/states/GameLogic.State.Playing.cs @@ -17,8 +17,6 @@ namespace GameJamDungeon { public Playing() { - this.OnEnter(() => { Output(new Output.StartGame()); }); - OnAttach(() => Get().Ended += OnEnded); OnDetach(() => Get().Ended -= OnEnded); } diff --git a/src/inventory_menu/InventoryMenu.cs b/src/inventory_menu/InventoryMenu.cs index ae3760db..43258c19 100644 --- a/src/inventory_menu/InventoryMenu.cs +++ b/src/inventory_menu/InventoryMenu.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; public interface IInventoryMenu : IControl { public Task RedrawInventory(); + + event InventoryMenu.ClosedMenuEventHandler ClosedMenu; } [Meta(typeof(IAutoNode))] @@ -19,8 +21,8 @@ public partial class InventoryMenu : Control, IInventoryMenu [Dependency] public IGameRepo GameRepo => this.DependOn(); - [Dependency] - public IGame Game => this.DependOn(); + [Signal] + public delegate void ClosedMenuEventHandler(); private InventoryPageNumber _currentPageNumber = InventoryPageNumber.FirstPage; @@ -77,12 +79,12 @@ public partial class InventoryMenu : Control, IInventoryMenu #pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed public override void _UnhandledInput(InputEvent @event) { - if (ItemSlots.Length == 0) + if (ItemSlots.Length == 0 || GetViewport().GuiGetFocusOwner() is Button) return; - var inventory = GameRepo.InventoryItems.Value; + var inventory = GameRepo.PlayerData.Inventory; - if (@event.IsActionPressed(GameInputs.UiRight) && _currentPageNumber == InventoryPageNumber.FirstPage && inventory.Count > _itemsPerPage) + if (@event.IsActionPressed(GameInputs.UiRight) && _currentPageNumber == InventoryPageNumber.FirstPage && inventory.Items.Count() > _itemsPerPage) ChangeInventoryPage(InventoryPageNumber.SecondPage); if (@event.IsActionPressed(GameInputs.UiLeft) && _currentPageNumber == InventoryPageNumber.SecondPage) @@ -104,7 +106,7 @@ public partial class InventoryMenu : Control, IInventoryMenu if (@event.IsActionPressed(GameInputs.UiAccept)) { - if (ItemSlots.Length == 0 || GetViewport().GuiGetFocusOwner() is Button) + if (ItemSlots.Length == 0) return; DisplayUserActionPrompt(); } @@ -129,37 +131,37 @@ public partial class InventoryMenu : Control, IInventoryMenu { FloorLabel.Text = $"Level {GameRepo.CurrentFloor:D2}"; - var currentLevel = GameRepo.PlayerStatInfo.Value.CurrentLevel; + var currentLevel = GameRepo.PlayerData.CurrentLevel.Value; CurrentLevelLabel.Text = $"Level {currentLevel:D2}"; - var currentHP = GameRepo.PlayerStatInfo.Value.CurrentHP; - var maxHP = GameRepo.PlayerStatInfo.Value.MaximumHP; + var currentHP = GameRepo.PlayerData.CurrentHP.Value; + var maxHP = GameRepo.PlayerData.MaximumHP.Value; HPValue.Text = $"{currentHP}/{maxHP}"; - var currentVT = GameRepo.PlayerStatInfo.Value.CurrentVT; - var maxVT = GameRepo.PlayerStatInfo.Value.MaximumVT; + var currentVT = GameRepo.PlayerData.CurrentVT.Value; + var maxVT = GameRepo.PlayerData.MaximumVT.Value; VTValue.Text = $"{currentVT}/{maxVT}"; - var currentAttack = GameRepo.PlayerStatInfo.Value.CurrentAttack; - var maxAttack = GameRepo.PlayerStatInfo.Value.MaxAttack; + var currentAttack = GameRepo.PlayerData.CurrentAttack.Value; + var maxAttack = GameRepo.PlayerData.MaxAttack.Value; ATKValue.Text = $"{currentAttack}/{maxAttack}"; - var currentDefense = GameRepo.PlayerStatInfo.Value.CurrentDefense; - var maxDefense = GameRepo.PlayerStatInfo.Value.MaxDefense; + var currentDefense = GameRepo.PlayerData.CurrentDefense.Value; + var maxDefense = GameRepo.PlayerData.MaxDefense.Value; DEFValue.Text = $"{currentDefense}/{maxDefense}"; - var atkBonus = GameRepo.PlayerStatInfo.Value.BonusAttack; - var defBonus = GameRepo.PlayerStatInfo.Value.BonusDefense; + var atkBonus = GameRepo.PlayerData.BonusAttack.Value; + var defBonus = GameRepo.PlayerData.BonusDefense.Value; ATKBonusLabel.Text = atkBonus != 0 ? $"{atkBonus:+0;-#}" : "..."; DEFBonusLabel.Text = defBonus != 0 ? $"{defBonus:+0;-#}" : "..."; // TODO: Change font style when EXP Bonus effect is active - var currentExp = GameRepo.PlayerStatInfo.Value.CurrentEXP; - var expToNextLevel = GameRepo.PlayerStatInfo.Value.EXPToNextLevel; + var currentExp = GameRepo.PlayerData.CurrentExp.Value; + var expToNextLevel = GameRepo.PlayerData.ExpToNextLevel.Value; EXPValue.Text = $"{currentExp}/{expToNextLevel}"; if (ItemSlots.Any()) @@ -183,7 +185,7 @@ public partial class InventoryMenu : Control, IInventoryMenu if (currentItem is IEquipable equipable) { - var isEquipped = GameRepo.IsItemEquipped(equipable); + var isEquipped = GameRepo.PlayerData.Inventory.IsEquipped(equipable); UseButton.Text = isEquipped ? "Unequip" : "Equip"; ThrowButton.Disabled = isEquipped ? true : false; ThrowButton.FocusMode = isEquipped ? FocusModeEnum.None : FocusModeEnum.All; @@ -219,14 +221,14 @@ public partial class InventoryMenu : Control, IInventoryMenu private void PopulateInventory() { - var inventory = GameRepo.InventoryItems.Value; - var numberOfItemsToDisplay = _currentPageNumber == InventoryPageNumber.FirstPage ? Mathf.Min(inventory.Count, _itemsPerPage) : Mathf.Min(inventory.Count - _itemsPerPage, _itemsPerPage); + var inventory = GameRepo.PlayerData.Inventory; + var numberOfItemsToDisplay = _currentPageNumber == InventoryPageNumber.FirstPage ? Mathf.Min(inventory.Items.Count, _itemsPerPage) : Mathf.Min(inventory.Items.Count - _itemsPerPage, _itemsPerPage); var indexToStart = _currentPageNumber == InventoryPageNumber.FirstPage ? 0 : _itemsPerPage - 1; ForwardArrow.Text = ""; BackArrow.Text = ""; - if (_currentPageNumber == InventoryPageNumber.FirstPage && inventory.Count > _itemsPerPage) + if (_currentPageNumber == InventoryPageNumber.FirstPage && inventory.Items.Count > _itemsPerPage) { ForwardArrow.Text = "►"; BackArrow.Text = ""; @@ -240,20 +242,20 @@ public partial class InventoryMenu : Control, IInventoryMenu for (var i = 0; i < numberOfItemsToDisplay; i++) { - var item = inventory.ElementAt(i + indexToStart); + var item = inventory.Items.ElementAt(i + indexToStart); var itemScene = GD.Load(ITEM_SLOT_SCENE); var itemSlot = itemScene.Instantiate(); itemSlot.Item = item; ItemsPage.AddChildEx(itemSlot); - if (itemSlot.Item is IEquipable equipable && GameRepo.IsItemEquipped(equipable)) + if (itemSlot.Item is IEquipable equipable && GameRepo.PlayerData.Inventory.IsEquipped(equipable)) itemSlot.SetEquippedItemStyle(); } if (ItemSlots.Any()) { ItemSlots.ElementAt(_currentIndex).SetSelectedItemStyle(); - if (ItemSlots.ElementAt(_currentIndex).Item is IEquipable equipable && GameRepo.IsItemEquipped(equipable)) + if (ItemSlots.ElementAt(_currentIndex).Item is IEquipable equipable && GameRepo.PlayerData.Inventory.IsEquipped(equipable)) ItemSlots.ElementAt(_currentIndex).SetEquippedSelectedItemStyle(); } } @@ -262,7 +264,7 @@ public partial class InventoryMenu : Control, IInventoryMenu { await ToSignal(GetTree().CreateTimer(0.1f), "timeout"); itemSlot.SetItemStyle(); - if (itemSlot.Item is IEquipable equipable && GameRepo.IsItemEquipped(equipable)) + if (itemSlot.Item is IEquipable equipable && GameRepo.PlayerData.Inventory.IsEquipped(equipable)) itemSlot.SetEquippedItemStyle(); } @@ -270,7 +272,7 @@ public partial class InventoryMenu : Control, IInventoryMenu { await ToSignal(GetTree().CreateTimer(0.1f), "timeout"); itemSlot.SetSelectedItemStyle(); - if (itemSlot.Item is IEquipable newEquipable && GameRepo.IsItemEquipped(newEquipable)) + if (itemSlot.Item is IEquipable newEquipable && GameRepo.PlayerData.Inventory.IsEquipped(newEquipable)) itemSlot.SetEquippedSelectedItemStyle(); ItemDescriptionTitle.Text = $"{itemSlot.Item.Info.Name}"; ItemEffectLabel.Text = $"{itemSlot.Item.Info.Description}"; @@ -282,14 +284,14 @@ public partial class InventoryMenu : Control, IInventoryMenu await ToSignal(GetTree().CreateTimer(0.2f), "timeout"); if (itemSlot.Item is IEquipable equipableItem) { - if (GameRepo.IsItemEquipped(equipableItem)) + if (GameRepo.PlayerData.Inventory.IsEquipped(equipableItem)) { - GameRepo.UnequipItem(equipableItem); + GameRepo.PlayerData.Inventory.Unequip(equipableItem); itemSlot.SetSelectedItemStyle(); } else { - GameRepo.EquipItem(equipableItem); + GameRepo.PlayerData.Inventory.Equip(equipableItem); itemSlot.SetEquippedSelectedItemStyle(); } @@ -299,20 +301,13 @@ public partial class InventoryMenu : Control, IInventoryMenu private void UpdateStatBonusInfo() { - var atkBonus = GameRepo.PlayerStatInfo.Value.BonusAttack; + var atkBonus = GameRepo.PlayerData.BonusAttack.Value; ATKBonusLabel.Text = atkBonus != 0 ? $"{atkBonus:+0;-#}" : "..."; - var defBonus = GameRepo.PlayerStatInfo.Value.BonusDefense; + var defBonus = GameRepo.PlayerData.BonusDefense.Value; DEFBonusLabel.Text = defBonus != 0 ? $"{defBonus:+0;-#}" : "..."; - var currentHP = GameRepo.PlayerStatInfo.Value.CurrentHP; - var maxHP = GameRepo.PlayerStatInfo.Value.MaximumHP; - - HPValue.Text = $"{currentHP}/{maxHP}"; - - var currentVT = GameRepo.PlayerStatInfo.Value.CurrentVT; - var maxVT = GameRepo.PlayerStatInfo.Value.MaximumVT; - - VTValue.Text = $"{currentVT}/{maxVT}"; + HPValue.Text = $"{GameRepo.PlayerData.CurrentHP.Value}/{GameRepo.PlayerData.MaximumHP.Value}"; + VTValue.Text = $"{GameRepo.PlayerData.CurrentVT.Value}/{GameRepo.PlayerData.MaximumVT.Value}"; } private async void UseButtonPressed() @@ -321,7 +316,10 @@ public partial class InventoryMenu : Control, IInventoryMenu if (currentItem is IEquipable) await EquipOrUnequipItem(); if (currentItem is ConsumableItem consumable) + { + EmitSignal(SignalName.ClosedMenu); consumable.Use(); + } if (_currentIndex >= ItemSlots.Length - 1) _currentIndex--; @@ -341,7 +339,7 @@ public partial class InventoryMenu : Control, IInventoryMenu _currentIndex--; if (_currentIndex <= 0) _currentIndex = 0; - Game.ToggleInventory(); + EmitSignal(SignalName.ClosedMenu); currentItem.Throw(); } @@ -354,7 +352,7 @@ public partial class InventoryMenu : Control, IInventoryMenu if (_currentIndex <= 0) _currentIndex = 0; - Game.ToggleInventory(); + EmitSignal(SignalName.ClosedMenu); currentItem.Drop(); } diff --git a/src/inventory_menu/InventoryMenu.tscn b/src/inventory_menu/InventoryMenu.tscn index e9a2ad59..67b4fa54 100644 --- a/src/inventory_menu/InventoryMenu.tscn +++ b/src/inventory_menu/InventoryMenu.tscn @@ -102,7 +102,6 @@ font_size = 80 font_color = Color(0.737255, 0.705882, 0.690196, 1) [node name="InventoryMenu" type="Control"] -process_mode = 2 layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 diff --git a/src/inventory_menu/ItemSlot.cs b/src/inventory_menu/ItemSlot.cs index 8db25a6d..aa09004c 100644 --- a/src/inventory_menu/ItemSlot.cs +++ b/src/inventory_menu/ItemSlot.cs @@ -42,9 +42,9 @@ public partial class ItemSlot : HBoxContainer, IItemSlot ItemName.Text = Item.Info.Name; EquipBonus.Text = "..."; ItemTexture.Texture = Item.Info.Texture; - GameRepo.EquippedWeapon.Sync += EquippedWeapon_Sync; - GameRepo.EquippedArmor.Sync += EquippedArmor_Sync; - GameRepo.EquippedAccessory.Sync += EquippedAccessory_Sync; + GameRepo.PlayerData.Inventory.EquippedWeapon.Sync += EquippedWeapon_Sync; + GameRepo.PlayerData.Inventory.EquippedArmor.Sync += EquippedArmor_Sync; + GameRepo.PlayerData.Inventory.EquippedAccessory.Sync += EquippedAccessory_Sync; } private void EquippedWeapon_Sync(Weapon obj) diff --git a/src/items/Inventory.cs b/src/items/Inventory.cs new file mode 100644 index 00000000..5b630a35 --- /dev/null +++ b/src/items/Inventory.cs @@ -0,0 +1,105 @@ +using Chickensoft.Collections; +using Chickensoft.GodotNodeInterfaces; +using Godot; +using System; +using System.Collections.Generic; +using static GameJamDungeon.Inventory; + +namespace GameJamDungeon; + +public interface IInventory : INode +{ + public List Items { get; } + public IAutoProp EquippedWeapon { get; } + + public IAutoProp EquippedArmor { get; } + + public IAutoProp EquippedAccessory { get; } + + public bool TryAdd(IInventoryItem inventoryItem); + + public void Remove(IInventoryItem inventoryItem); + + public void Equip(IEquipable equipable); + + public void Unequip(IEquipable equipable); + + public bool IsEquipped(IEquipable equipable); + + event Inventory.InventoryAtCapacityEventHandler InventoryAtCapacity; +} + +public partial class Inventory : Node, IInventory +{ + // TODO: Constants class with export + private const int _maxInventorySize = 20; + + [Signal] + public delegate void InventoryAtCapacityEventHandler(string rejectedItemName); + + public Inventory() + { + Items = []; + } + + public List Items { get; private set; } + + public IAutoProp EquippedWeapon => _equippedWeapon; + private AutoProp _equippedWeapon { get; set; } = new AutoProp(new Weapon()); + + public IAutoProp EquippedArmor => _equippedArmor; + private AutoProp _equippedArmor { get; set; } = new AutoProp(new Armor()); + + public IAutoProp EquippedAccessory => _equippedAccessory; + private AutoProp _equippedAccessory { get; set; } = new AutoProp(new Accessory()); + + public bool TryAdd(IInventoryItem inventoryItem) + { + if (Items.Count >= _maxInventorySize) + { + EmitSignal(SignalName.InventoryAtCapacity, inventoryItem.Info.Name); + return false; + } + + Items.Add(inventoryItem); + return true; + } + + public void Remove(IInventoryItem inventoryItem) => Items.Remove(inventoryItem); + + public void Equip(IEquipable equipable) + { + if (equipable is Weapon weapon) + _equippedWeapon.OnNext(weapon); + else if (equipable is Armor armor) + _equippedArmor.OnNext(armor); + else if (equipable is Accessory accessory) + _equippedAccessory.OnNext(accessory); + else + throw new NotImplementedException("Item type is not supported."); + } + + public void Unequip(IEquipable equipable) + { + if (equipable is Weapon weapon) + _equippedWeapon.OnNext(new Weapon()); + else if (equipable is Armor armor) + _equippedArmor.OnNext(new Armor()); + else if (equipable is Accessory accessory) + _equippedAccessory.OnNext(new Accessory()); + else + throw new NotImplementedException("Item type is not supported."); + } + + public bool IsEquipped(IEquipable equipable) + { + if (equipable is Weapon weapon) + return _equippedWeapon.Value.Equals(weapon); + else if (equipable is Armor armor) + return _equippedArmor.Value.Equals(armor); + else if (equipable is Accessory accessory) + return _equippedAccessory.Value.Equals(accessory); + else + throw new NotImplementedException("Item type is not supported."); + } +} diff --git a/src/items/InventoryItem.cs b/src/items/InventoryItem.cs index 1259a884..71b6156f 100644 --- a/src/items/InventoryItem.cs +++ b/src/items/InventoryItem.cs @@ -1,16 +1,13 @@ -using Chickensoft.AutoInject; -using Chickensoft.GodotNodeInterfaces; +using Chickensoft.GodotNodeInterfaces; using System; namespace GameJamDungeon { public interface IInventoryItem : INode3D { - public Guid ID { get; } - public IGameRepo GameRepo { get; } - public InventoryItemInfo Info { get; } + public InventoryItemStats Info { get; } public void Throw(); diff --git a/src/items/InventoryItemInfo.cs b/src/items/InventoryItemInfo.cs index 519818c7..6d27f710 100644 --- a/src/items/InventoryItemInfo.cs +++ b/src/items/InventoryItemInfo.cs @@ -2,7 +2,7 @@ using Godot; using System; [GlobalClass] -public partial class InventoryItemInfo : Resource +public partial class InventoryItemStats : Resource { [Export] public string Name = string.Empty; diff --git a/src/items/ItemDatabase.cs b/src/items/ItemDatabase.cs index 2ad0e0be..3cac6fca 100644 --- a/src/items/ItemDatabase.cs +++ b/src/items/ItemDatabase.cs @@ -31,23 +31,23 @@ namespace GameJamDungeon foreach (var armor in armorResources) { - var armorInfo = GD.Load($"res://src/items/armor/resources/{armor}"); + var armorInfo = GD.Load($"res://src/items/armor/resources/{armor}"); var armorScene = ArmorScene.Instantiate(); - armorScene.ArmorInfo = armorInfo; + armorScene.ArmorStats = armorInfo; database.Add(armorScene); } foreach (var weapon in weaponResources) { - var weaponInfo = GD.Load($"res://src/items/weapons/resources/{weapon}"); + var weaponInfo = GD.Load($"res://src/items/weapons/resources/{weapon}"); var weaponScene = WeaponScene.Instantiate(); - weaponScene.WeaponInfo = weaponInfo; + weaponScene.WeaponStats = weaponInfo; database.Add(weaponScene); } foreach (var accessory in accessoryResources) { - var accessoryInfo = GD.Load($"res://src/items/accessory/resources/{accessory}"); + var accessoryInfo = GD.Load($"res://src/items/accessory/resources/{accessory}"); var accessoryScene = AccessoryScene.Instantiate(); accessoryScene.AccessoryInfo = accessoryInfo; database.Add(accessoryScene); @@ -55,7 +55,7 @@ namespace GameJamDungeon foreach (var throwable in throwableResources) { - var throwableItemInfo = GD.Load($"res://src/items/throwable/resources/{throwable}"); + var throwableItemInfo = GD.Load($"res://src/items/throwable/resources/{throwable}"); var throwableItemScene = ThrowableItemScene.Instantiate(); throwableItemScene.ThrowableItemInfo = throwableItemInfo; database.Add(throwableItemScene); @@ -63,7 +63,7 @@ namespace GameJamDungeon foreach (var consumable in consumableResources) { - var consumableItemInfo = GD.Load($"res://src/items/consumable/resources/{consumable}"); + var consumableItemInfo = GD.Load($"res://src/items/consumable/resources/{consumable}"); var consumableItemScene = ConsumableItemScene.Instantiate(); consumableItemScene.ConsumableItemInfo = consumableItemInfo; database.Add(consumableItemScene); diff --git a/src/items/ItemDatabase.tscn b/src/items/ItemDatabase.tscn index 0d162ba0..bea3cac8 100644 --- a/src/items/ItemDatabase.tscn +++ b/src/items/ItemDatabase.tscn @@ -1,16 +1,16 @@ [gd_scene load_steps=7 format=3 uid="uid://twrj4wixcbu7"] [ext_resource type="Script" path="res://src/items/ItemDatabase.cs" id="1_7b315"] -[ext_resource type="PackedScene" uid="uid://db206brufi83s" path="res://src/items/weapons/Weapon.tscn" id="2_14w53"] -[ext_resource type="PackedScene" uid="uid://dorr7v1tkeiy0" path="res://src/items/armor/Armor.tscn" id="3_p6rkn"] -[ext_resource type="PackedScene" uid="uid://b07srt3lckt4e" path="res://src/items/accessory/Accessory.tscn" id="4_oqm6k"] -[ext_resource type="PackedScene" uid="uid://1fl6s352e2ej" path="res://src/items/throwable/ThrowableItem.tscn" id="5_l0fpl"] -[ext_resource type="PackedScene" uid="uid://c6w7dpk0hurj0" path="res://src/items/consumable/ConsumableItem.tscn" id="6_51k8r"] +[ext_resource type="PackedScene" uid="uid://db206brufi83s" path="res://src/items/weapons/Weapon.tscn" id="2_wq002"] +[ext_resource type="PackedScene" uid="uid://dorr7v1tkeiy0" path="res://src/items/armor/Armor.tscn" id="3_8wlg5"] +[ext_resource type="PackedScene" uid="uid://b07srt3lckt4e" path="res://src/items/accessory/Accessory.tscn" id="4_pr7ub"] +[ext_resource type="PackedScene" uid="uid://1fl6s352e2ej" path="res://src/items/throwable/ThrowableItem.tscn" id="5_r5y4t"] +[ext_resource type="PackedScene" uid="uid://c6w7dpk0hurj0" path="res://src/items/consumable/ConsumableItem.tscn" id="6_yvger"] [node name="ItemDatabase" type="Node"] script = ExtResource("1_7b315") -WeaponScene = ExtResource("2_14w53") -ArmorScene = ExtResource("3_p6rkn") -AccessoryScene = ExtResource("4_oqm6k") -ThrowableItemScene = ExtResource("5_l0fpl") -ConsumableItemScene = ExtResource("6_51k8r") +WeaponScene = ExtResource("2_wq002") +ArmorScene = ExtResource("3_8wlg5") +AccessoryScene = ExtResource("4_pr7ub") +ThrowableItemScene = ExtResource("5_r5y4t") +ConsumableItemScene = ExtResource("6_yvger") diff --git a/src/items/accessory/Accessory.cs b/src/items/accessory/Accessory.cs index bf2b6c0d..b8ee323b 100644 --- a/src/items/accessory/Accessory.cs +++ b/src/items/accessory/Accessory.cs @@ -11,14 +11,12 @@ public partial class Accessory : Node3D, IInventoryItem, IEquipable { public override void _Notification(int what) => this.Notify(what); - public Guid ID { get; } = new Guid(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - public InventoryItemInfo Info => AccessoryInfo; + public InventoryItemStats Info => AccessoryInfo; [Export] - public AccessoryInfo AccessoryInfo { get; set; } = new AccessoryInfo(); + public AccessoryStats AccessoryInfo { get; set; } = new AccessoryStats(); [Node] public Sprite3D Sprite { get; set; } = default!; @@ -32,21 +30,18 @@ public partial class Accessory : Node3D, IInventoryItem, IEquipable public void Throw() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void Drop() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void OnEntered(Node3D body) { - if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize) - return; - - var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList(); - GameRepo.InventoryItems.OnNext(inventoryList); - QueueFree(); + var isAdded = GameRepo.PlayerData.Inventory.TryAdd(this); + if (isAdded) + QueueFree(); } } diff --git a/src/items/accessory/AccessoryInfo.cs b/src/items/accessory/AccessoryStats.cs similarity index 90% rename from src/items/accessory/AccessoryInfo.cs rename to src/items/accessory/AccessoryStats.cs index ce7bdafd..dd09ab3c 100644 --- a/src/items/accessory/AccessoryInfo.cs +++ b/src/items/accessory/AccessoryStats.cs @@ -4,7 +4,7 @@ using System; namespace GameJamDungeon; [GlobalClass] -public partial class AccessoryInfo : InventoryItemInfo +public partial class AccessoryStats : InventoryItemStats { [Export] public int ATKUp { get; set; } = 0; diff --git a/src/items/accessory/resources/MaskAvarice.tres b/src/items/accessory/resources/MaskAvarice.tres index e9711400..544cdbd1 100644 --- a/src/items/accessory/resources/MaskAvarice.tres +++ b/src/items/accessory/resources/MaskAvarice.tres @@ -1,10 +1,10 @@ -[gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://cvkwmart5y51r"] +[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://cvkwmart5y51r"] -[ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_578a0"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_sjkji"] +[ext_resource type="Texture2D" uid="uid://hjyk3j24o48b" path="res://src/items/accessory/textures/MASK 03.PNG" id="1_q42cv"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_xqaot"] [resource] -script = ExtResource("1_sjkji") +script = ExtResource("1_xqaot") ATKUp = 0 DEFUp = 0 LUCKUp = 0.15 @@ -12,6 +12,6 @@ MaxHPUp = 0 MaxVTUp = 0 AccessoryTags = [] Name = "Mask of the Goddess of Avarice" -Description = "Raises LUCK." -Texture = ExtResource("1_578a0") +Description = "Raises Luck" +Texture = ExtResource("1_q42cv") SpawnRate = 0.5 diff --git a/src/items/accessory/resources/MaskDestruction.tres b/src/items/accessory/resources/MaskDestruction.tres index cdaa9afc..af2a0c06 100644 --- a/src/items/accessory/resources/MaskDestruction.tres +++ b/src/items/accessory/resources/MaskDestruction.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://d4bcem2nup7ef"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_0p1ot"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_vef66"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_vef66"] [resource] script = ExtResource("1_vef66") diff --git a/src/items/accessory/resources/MaskGuilt.tres b/src/items/accessory/resources/MaskGuilt.tres index 691d68cd..2d1313f8 100644 --- a/src/items/accessory/resources/MaskGuilt.tres +++ b/src/items/accessory/resources/MaskGuilt.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://bejy3lpudgawg"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_0k42r"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_cgxkh"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_cgxkh"] [resource] script = ExtResource("1_cgxkh") diff --git a/src/items/accessory/resources/MaskObstinance.tres b/src/items/accessory/resources/MaskObstinance.tres index 9a222656..ed492383 100644 --- a/src/items/accessory/resources/MaskObstinance.tres +++ b/src/items/accessory/resources/MaskObstinance.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://ddwyaxxqvk52h"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_1uw37"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_kuyyj"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_kuyyj"] [resource] script = ExtResource("1_kuyyj") diff --git a/src/items/accessory/resources/MaskShunned.tres b/src/items/accessory/resources/MaskShunned.tres index af2746d7..c8e6ce7a 100644 --- a/src/items/accessory/resources/MaskShunned.tres +++ b/src/items/accessory/resources/MaskShunned.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://c3v6r8s8yruag"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_co7sc"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_co7sc"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_uwbei"] [resource] diff --git a/src/items/accessory/resources/MaskSloth.tres b/src/items/accessory/resources/MaskSloth.tres index ad00fae5..85fd89bd 100644 --- a/src/items/accessory/resources/MaskSloth.tres +++ b/src/items/accessory/resources/MaskSloth.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://ct8iply3dwssv"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_t16cd"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_vdb56"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_vdb56"] [resource] script = ExtResource("1_vdb56") diff --git a/src/items/accessory/resources/MaskSuffering.tres b/src/items/accessory/resources/MaskSuffering.tres index ec5d2ff8..47e2ba5a 100644 --- a/src/items/accessory/resources/MaskSuffering.tres +++ b/src/items/accessory/resources/MaskSuffering.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://d02kuxaus43mk"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_3iw2y"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_3iw2y"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_vc77e"] [resource] diff --git a/src/items/accessory/resources/MaskZeal.tres b/src/items/accessory/resources/MaskZeal.tres index cd0e546c..9104bf4c 100644 --- a/src/items/accessory/resources/MaskZeal.tres +++ b/src/items/accessory/resources/MaskZeal.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AccessoryInfo" load_steps=3 format=3 uid="uid://b0bxwp55mcyyp"] -[ext_resource type="Script" path="res://src/items/accessory/AccessoryInfo.cs" id="1_0u4rq"] +[ext_resource type="Script" path="res://src/items/accessory/AccessoryStats.cs" id="1_0u4rq"] [ext_resource type="Texture2D" uid="uid://db7i7iy5gagae" path="res://src/items/accessory/textures/MASK 02.PNG" id="1_ggv41"] [resource] diff --git a/src/items/accessory/textures/MASK 03.PNG.import b/src/items/accessory/textures/MASK 03.PNG.import index 6f1ff078..2608dc94 100644 --- a/src/items/accessory/textures/MASK 03.PNG.import +++ b/src/items/accessory/textures/MASK 03.PNG.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://hjyk3j24o48b" -path="res://.godot/imported/MASK 03.PNG-9ab390330efa1f35084ad56075377b4d.ctex" +path.s3tc="res://.godot/imported/MASK 03.PNG-9ab390330efa1f35084ad56075377b4d.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://src/items/accessory/textures/MASK 03.PNG" -dest_files=["res://.godot/imported/MASK 03.PNG-9ab390330efa1f35084ad56075377b4d.ctex"] +dest_files=["res://.godot/imported/MASK 03.PNG-9ab390330efa1f35084ad56075377b4d.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/src/items/armor/Armor.cs b/src/items/armor/Armor.cs index e7b578d1..b462724f 100644 --- a/src/items/armor/Armor.cs +++ b/src/items/armor/Armor.cs @@ -3,22 +3,18 @@ using Chickensoft.Introspection; using GameJamDungeon; using Godot; using System; -using System.Collections.Generic; -using System.Linq; [Meta(typeof(IAutoNode))] public partial class Armor : Node3D, IInventoryItem, IEquipable { public override void _Notification(int what) => this.Notify(what); - public Guid ID { get; } = new Guid(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - public InventoryItemInfo Info => ArmorInfo; + public InventoryItemStats Info => ArmorStats; [Export] - public ArmorInfo ArmorInfo { get; set; } = new ArmorInfo(); + public ArmorStats ArmorStats { get; set; } = new ArmorStats(); [Node] public Sprite3D Sprite { get; set; } = default!; @@ -26,27 +22,24 @@ public partial class Armor : Node3D, IInventoryItem, IEquipable public void OnReady() { - Sprite.Texture = ArmorInfo.Texture; + Sprite.Texture = ArmorStats.Texture; Pickup.BodyEntered += OnEntered; } public void Throw() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void Drop() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void OnEntered(Node3D body) { - if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize) - return; - - var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList(); - GameRepo.InventoryItems.OnNext(inventoryList); - QueueFree(); + var isAdded = GameRepo.PlayerData.Inventory.TryAdd(this); + if (isAdded) + QueueFree(); } } diff --git a/src/items/armor/ArmorInfo.cs b/src/items/armor/ArmorStats.cs similarity index 89% rename from src/items/armor/ArmorInfo.cs rename to src/items/armor/ArmorStats.cs index 0196b0a3..d3751158 100644 --- a/src/items/armor/ArmorInfo.cs +++ b/src/items/armor/ArmorStats.cs @@ -3,7 +3,7 @@ namespace GameJamDungeon; [GlobalClass] -public partial class ArmorInfo : InventoryItemInfo +public partial class ArmorStats : InventoryItemStats { [Export] public int Defense { get; set; } = 0; diff --git a/src/items/armor/resources/Acceptance.tres b/src/items/armor/resources/Acceptance.tres index b9d345a6..a3d20b3e 100644 --- a/src/items/armor/resources/Acceptance.tres +++ b/src/items/armor/resources/Acceptance.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://b8mjje06x6dl1"] [ext_resource type="Texture2D" uid="uid://dbb3x4cbo8jc1" path="res://src/items/armor/textures/ACCEPTANCE.PNG" id="1_p85jd"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_si4wu"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_si4wu"] [resource] script = ExtResource("1_si4wu") diff --git a/src/items/armor/resources/AtonersAdornments.tres b/src/items/armor/resources/AtonersAdornments.tres index 8a6951e2..324b4f86 100644 --- a/src/items/armor/resources/AtonersAdornments.tres +++ b/src/items/armor/resources/AtonersAdornments.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://ce2vfa2t3io67"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_6r2bl"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_6r2bl"] [ext_resource type="Texture2D" uid="uid://ckcn67d64mgke" path="res://src/items/armor/textures/atoners adornment.PNG" id="1_588l8"] [resource] diff --git a/src/items/armor/resources/CeremonialVestments.tres b/src/items/armor/resources/CeremonialVestments.tres index 11875b58..341ea86e 100644 --- a/src/items/armor/resources/CeremonialVestments.tres +++ b/src/items/armor/resources/CeremonialVestments.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://dnu241lh47oqd"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_0qtvf"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_0qtvf"] [ext_resource type="Texture2D" uid="uid://vvhbibkslh57" path="res://src/items/armor/textures/CEREMONIAL.PNG" id="1_s4gpg"] [resource] diff --git a/src/items/armor/resources/DevicLayer.tres b/src/items/armor/resources/DevicLayer.tres index a7958214..912e21b8 100644 --- a/src/items/armor/resources/DevicLayer.tres +++ b/src/items/armor/resources/DevicLayer.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://4s7wjsb7eb6e"] [ext_resource type="Texture2D" uid="uid://381ddynsa3gc" path="res://src/items/armor/textures/DEVIC.PNG" id="1_5ik54"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_w3lql"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_w3lql"] [resource] script = ExtResource("1_w3lql") diff --git a/src/items/armor/resources/GoddessRobe.tres b/src/items/armor/resources/GoddessRobe.tres index cbba76b0..6e0fbba8 100644 --- a/src/items/armor/resources/GoddessRobe.tres +++ b/src/items/armor/resources/GoddessRobe.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://dc0qjer88chme"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_3mc7x"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_3mc7x"] [ext_resource type="Texture2D" uid="uid://c57kuugsc2lti" path="res://src/items/armor/textures/GODDESS.PNG" id="1_5vleh"] [resource] diff --git a/src/items/armor/resources/IronCage.tres b/src/items/armor/resources/IronCage.tres index b49ead64..fbb9e000 100644 --- a/src/items/armor/resources/IronCage.tres +++ b/src/items/armor/resources/IronCage.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://ceqnyutl7y7t4"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_iqj2w"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_iqj2w"] [ext_resource type="Texture2D" uid="uid://cj5m8qkpqrcx4" path="res://src/items/armor/textures/IRON.PNG" id="1_jyoar"] [resource] diff --git a/src/items/armor/resources/LogisticiansGarb.tres b/src/items/armor/resources/LogisticiansGarb.tres index ee0b89c8..42a8231b 100644 --- a/src/items/armor/resources/LogisticiansGarb.tres +++ b/src/items/armor/resources/LogisticiansGarb.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://chhxktntl4k8r"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_frqfh"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_frqfh"] [ext_resource type="Texture2D" uid="uid://2qvbtq2obsac" path="res://src/items/armor/textures/LOGISTIAN.PNG" id="1_kh3n2"] [resource] diff --git a/src/items/armor/resources/Stoic.tres b/src/items/armor/resources/Stoic.tres index 9ba75d20..7f96c588 100644 --- a/src/items/armor/resources/Stoic.tres +++ b/src/items/armor/resources/Stoic.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://d3l8aa87tevgt"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_dh6tr"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_dh6tr"] [ext_resource type="Texture2D" uid="uid://ddtscpfj6nf6i" path="res://src/items/armor/textures/STOIC.PNG" id="1_xpphu"] [resource] diff --git a/src/items/armor/resources/WoodenArmament.tres b/src/items/armor/resources/WoodenArmament.tres index 7918313d..a363242e 100644 --- a/src/items/armor/resources/WoodenArmament.tres +++ b/src/items/armor/resources/WoodenArmament.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ArmorInfo" load_steps=3 format=3 uid="uid://dq4c6an78qa4q"] -[ext_resource type="Script" path="res://src/items/armor/ArmorInfo.cs" id="1_bkpin"] +[ext_resource type="Script" path="res://src/items/armor/ArmorStats.cs" id="1_bkpin"] [ext_resource type="Texture2D" uid="uid://dghvd33w32q63" path="res://src/items/armor/textures/WOODEN.PNG" id="1_vs6ua"] [resource] diff --git a/src/items/consumable/ConsumableItem.cs b/src/items/consumable/ConsumableItem.cs index 0645c4a6..acdb4e58 100644 --- a/src/items/consumable/ConsumableItem.cs +++ b/src/items/consumable/ConsumableItem.cs @@ -10,14 +10,12 @@ public partial class ConsumableItem : Node3D, IInventoryItem { public override void _Notification(int what) => this.Notify(what); - public Guid ID { get; } = new Guid(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - public InventoryItemInfo Info => ConsumableItemInfo; + public InventoryItemStats Info => ConsumableItemInfo; [Export] - public ConsumableItemInfo ConsumableItemInfo { get; set; } + public ConsumableItemStats ConsumableItemInfo { get; set; } [Node] public Sprite3D Sprite { get; set; } = default!; @@ -40,54 +38,51 @@ public partial class ConsumableItem : Node3D, IInventoryItem if (ConsumableItemInfo.HealVTAmount != 0) HealVT(); - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } private void RaiseHP() { - if (GameRepo.PlayerStatInfo.Value.CurrentHP == GameRepo.PlayerStatInfo.Value.MaximumHP) + if (GameRepo.PlayerData.CurrentHP == GameRepo.PlayerData.MaximumHP) { - GameRepo.PlayerStatInfo.Value.MaximumHP += ConsumableItemInfo.RaiseHPAmount; - GameRepo.PlayerStatInfo.Value.CurrentHP = GameRepo.PlayerStatInfo.Value.MaximumHP; + GameRepo.PlayerData.MaximumHP.OnNext(GameRepo.PlayerData.MaximumHP.Value + ConsumableItemInfo.RaiseHPAmount); + GameRepo.PlayerData.CurrentHP.OnNext(GameRepo.PlayerData.MaximumHP.Value); } } private void HealHP() { - GameRepo.PlayerStatInfo.Value.CurrentHP += ConsumableItemInfo.HealHPAmount; + GameRepo.PlayerData.CurrentHP.OnNext(GameRepo.PlayerData.CurrentHP.Value + ConsumableItemInfo.HealHPAmount); } private void RaiseVT() { - if (GameRepo.PlayerStatInfo.Value.CurrentVT == GameRepo.PlayerStatInfo.Value.MaximumVT) + if (GameRepo.PlayerData.CurrentVT == GameRepo.PlayerData.MaximumVT) { - GameRepo.PlayerStatInfo.Value.MaximumVT += ConsumableItemInfo.RaiseVTAmount; - GameRepo.PlayerStatInfo.Value.CurrentVT = GameRepo.PlayerStatInfo.Value.MaximumVT; + GameRepo.PlayerData.MaximumVT.OnNext(GameRepo.PlayerData.MaximumVT.Value + ConsumableItemInfo.RaiseVTAmount); + GameRepo.PlayerData.CurrentVT.OnNext(GameRepo.PlayerData.MaximumVT.Value); } } private void HealVT() { - GameRepo.PlayerStatInfo.Value.CurrentVT += ConsumableItemInfo.HealVTAmount; + GameRepo.PlayerData.CurrentVT.OnNext(GameRepo.PlayerData.CurrentVT.Value + ConsumableItemInfo.HealVTAmount); } public void Throw() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void Drop() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void OnEntered(Node3D body) { - if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize) - return; - - var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList(); - GameRepo.InventoryItems.OnNext(inventoryList); - QueueFree(); + var isAdded = GameRepo.PlayerData.Inventory.TryAdd(this); + if (isAdded) + QueueFree(); } } diff --git a/src/items/consumable/ConsumableItem.tscn b/src/items/consumable/ConsumableItem.tscn index 2b2b2a67..3975275b 100644 --- a/src/items/consumable/ConsumableItem.tscn +++ b/src/items/consumable/ConsumableItem.tscn @@ -1,12 +1,17 @@ [gd_scene load_steps=5 format=3 uid="uid://c6w7dpk0hurj0"] [ext_resource type="Script" path="res://src/items/consumable/ConsumableItem.cs" id="1_26bad"] -[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemInfo.cs" id="2_g3oo3"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_g3oo3"] [sub_resource type="Resource" id="Resource_33w5s"] script = ExtResource("2_g3oo3") +HealHPAmount = 0 +RaiseHPAmount = 0 +HealVTAmount = 0 +RaiseVTAmount = 0 Name = "" Description = "" +SpawnRate = 0.5 [sub_resource type="BoxShape3D" id="BoxShape3D_7mh0f"] size = Vector3(0.778381, 0.929947, 0.731567) diff --git a/src/items/consumable/ConsumableItemInfo.cs b/src/items/consumable/ConsumableItemStats.cs similarity index 82% rename from src/items/consumable/ConsumableItemInfo.cs rename to src/items/consumable/ConsumableItemStats.cs index 523e4ff5..7645e32a 100644 --- a/src/items/consumable/ConsumableItemInfo.cs +++ b/src/items/consumable/ConsumableItemStats.cs @@ -3,7 +3,7 @@ namespace GameJamDungeon; [GlobalClass] -public partial class ConsumableItemInfo : InventoryItemInfo +public partial class ConsumableItemStats : InventoryItemStats { [Export] public int HealHPAmount { get; set; } = 0; diff --git a/src/items/consumable/resources/SteloFragment.tres b/src/items/consumable/resources/SteloFragment.tres index d9563db7..f259f93e 100644 --- a/src/items/consumable/resources/SteloFragment.tres +++ b/src/items/consumable/resources/SteloFragment.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="ConsumableItemInfo" load_steps=3 format=3 uid="uid://75fpkwfp0t0k"] -[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemInfo.cs" id="1_f8ogj"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="1_f8ogj"] [ext_resource type="Texture2D" uid="uid://dbl5v5i1s3m2u" path="res://src/items/consumable/textures/stelo fragment.PNG" id="1_ic5xm"] [resource] diff --git a/src/items/throwable/ThrowableItem.cs b/src/items/throwable/ThrowableItem.cs index 53a5b00c..28b6dca8 100644 --- a/src/items/throwable/ThrowableItem.cs +++ b/src/items/throwable/ThrowableItem.cs @@ -11,18 +11,18 @@ public partial class ThrowableItem : Node3D, IInventoryItem { public override void _Notification(int what) => this.Notify(what); - public Guid ID { get; } = new Guid(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); [Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!; [Node] public IHitbox Hitbox { get; set; } = default!; - public InventoryItemInfo Info => ThrowableItemInfo; + public InventoryItemStats Info => ThrowableItemInfo; + + public int Count { get; } [Export] - public ThrowableItemInfo ThrowableItemInfo { get; set; } + public ThrowableItemStats ThrowableItemInfo { get; set; } [Node] public Sprite3D Sprite { get; set; } = default!; @@ -37,22 +37,19 @@ public partial class ThrowableItem : Node3D, IInventoryItem public void Throw() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void Drop() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void OnEntered(Node3D body) { - if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize) - return; - - var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList(); - GameRepo.InventoryItems.OnNext(inventoryList); - QueueFree(); + var isAdded = GameRepo.PlayerData.Inventory.TryAdd(this); + if (isAdded) + QueueFree(); } private void OnAnimationFinished(StringName animName) diff --git a/src/items/throwable/ThrowableItemInfo.cs b/src/items/throwable/ThrowableItemStats.cs similarity index 77% rename from src/items/throwable/ThrowableItemInfo.cs rename to src/items/throwable/ThrowableItemStats.cs index 342f3e65..81c63869 100644 --- a/src/items/throwable/ThrowableItemInfo.cs +++ b/src/items/throwable/ThrowableItemStats.cs @@ -3,7 +3,7 @@ namespace GameJamDungeon; [GlobalClass] -public partial class ThrowableItemInfo : InventoryItemInfo +public partial class ThrowableItemStats : InventoryItemStats { [Export] public Godot.Collections.Array ThrowableItemTags { get; set; } = new Godot.Collections.Array(); diff --git a/src/items/throwable/resources/GeomanticDice.tres b/src/items/throwable/resources/GeomanticDice.tres index aad4390c..ca9920f6 100644 --- a/src/items/throwable/resources/GeomanticDice.tres +++ b/src/items/throwable/resources/GeomanticDice.tres @@ -1,6 +1,6 @@ -[gd_resource type="Resource" script_class="ThrowableItemInfo" load_steps=3 format=3 uid="uid://bph8c6by4s047"] +[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://bph8c6by4s047"] -[ext_resource type="Script" path="res://src/items/throwable/ThrowableItemInfo.cs" id="1_ewck5"] +[ext_resource type="Script" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_ewck5"] [ext_resource type="Texture2D" uid="uid://mi70lolgtf3n" path="res://src/items/throwable/textures/GEOMANCER-DICE.png" id="1_jhits"] [resource] diff --git a/src/items/throwable/resources/SpellSignKnowledge.tres b/src/items/throwable/resources/SpellSignKnowledge.tres index 483ad512..81052498 100644 --- a/src/items/throwable/resources/SpellSignKnowledge.tres +++ b/src/items/throwable/resources/SpellSignKnowledge.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="ThrowableItemInfo" load_steps=3 format=3 uid="uid://qqg0gdcb8fwg"] [ext_resource type="Texture2D" uid="uid://dhfn51smm818x" path="res://src/items/throwable/textures/spell sign - luck.PNG" id="1_3605p"] -[ext_resource type="Script" path="res://src/items/throwable/ThrowableItemInfo.cs" id="1_s3pq7"] +[ext_resource type="Script" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_s3pq7"] [resource] script = ExtResource("1_s3pq7") diff --git a/src/items/weapons/Weapon.cs b/src/items/weapons/Weapon.cs index a16206f9..f9e1a5a3 100644 --- a/src/items/weapons/Weapon.cs +++ b/src/items/weapons/Weapon.cs @@ -3,21 +3,18 @@ using Chickensoft.Introspection; using GameJamDungeon; using Godot; using System; -using System.Linq; [Meta(typeof(IAutoNode))] public partial class Weapon : Node3D, IInventoryItem, IEquipable { public override void _Notification(int what) => this.Notify(what); - public Guid ID { get; } = new Guid(); - [Dependency] public IGameRepo GameRepo => this.DependOn(); - public InventoryItemInfo Info => WeaponInfo; + public InventoryItemStats Info => WeaponStats; [Export] - public WeaponInfo WeaponInfo { get; set; } = new WeaponInfo(); + public WeaponStats WeaponStats { get; set; } = new WeaponStats(); [Node] public Sprite3D Sprite { get; set; } = default!; @@ -25,27 +22,24 @@ public partial class Weapon : Node3D, IInventoryItem, IEquipable public void OnReady() { - Sprite.Texture = WeaponInfo.Texture; + Sprite.Texture = WeaponStats.Texture; Pickup.BodyEntered += OnEntered; } public void Throw() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void Drop() { - GameRepo.InventoryItems.Value.Remove(this); + GameRepo.PlayerData.Inventory.Remove(this); } public void OnEntered(Node3D body) { - if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize) - return; - - var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList(); - GameRepo.InventoryItems.OnNext(inventoryList); - QueueFree(); + var isAdded = GameRepo.PlayerData.Inventory.TryAdd(this); + if (isAdded) + QueueFree(); } } diff --git a/src/items/weapons/WeaponInfo.cs b/src/items/weapons/WeaponStats.cs similarity index 92% rename from src/items/weapons/WeaponInfo.cs rename to src/items/weapons/WeaponStats.cs index 5176779e..a9a399a9 100644 --- a/src/items/weapons/WeaponInfo.cs +++ b/src/items/weapons/WeaponStats.cs @@ -2,7 +2,7 @@ using GameJamDungeon; using Godot; [GlobalClass] -public partial class WeaponInfo : InventoryItemInfo +public partial class WeaponStats : InventoryItemStats { [Export] public int Damage { get; set; } = 0; diff --git a/src/items/weapons/resources/Jiblett.tres b/src/items/weapons/resources/Jiblett.tres index b423fc89..18b0f0b4 100644 --- a/src/items/weapons/resources/Jiblett.tres +++ b/src/items/weapons/resources/Jiblett.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://c1bg0o7nmu2xw"] [ext_resource type="Texture2D" uid="uid://cil3xe3jq82r6" path="res://src/items/weapons/textures/JIBLETT.PNG" id="1_ifm43"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_re512"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_re512"] [resource] script = ExtResource("1_re512") diff --git a/src/items/weapons/resources/Kubel.tres b/src/items/weapons/resources/Kubel.tres index aea80075..f201349a 100644 --- a/src/items/weapons/resources/Kubel.tres +++ b/src/items/weapons/resources/Kubel.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://db075qhmlmrcu"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_kbje7"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_kbje7"] [ext_resource type="Texture2D" uid="uid://bkntmni5jxfpk" path="res://src/items/weapons/textures/KUBEL.PNG" id="1_kwtbu"] [resource] diff --git a/src/items/weapons/resources/LoveJudgement.tres b/src/items/weapons/resources/LoveJudgement.tres index b63942d2..b326af76 100644 --- a/src/items/weapons/resources/LoveJudgement.tres +++ b/src/items/weapons/resources/LoveJudgement.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://cfr100khjkloh"] [ext_resource type="Texture2D" uid="uid://blq3nnyostunl" path="res://src/items/weapons/textures/LOVE JUDGEMENT.PNG" id="1_ivlxj"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_vroib"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_vroib"] [resource] script = ExtResource("1_vroib") diff --git a/src/items/weapons/resources/Palm of Heaven.tres b/src/items/weapons/resources/Palm of Heaven.tres index 54e51d5a..372edecf 100644 --- a/src/items/weapons/resources/Palm of Heaven.tres +++ b/src/items/weapons/resources/Palm of Heaven.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://ckj1m4iv4m02r"] [ext_resource type="Texture2D" uid="uid://740syoj0w14p" path="res://src/items/weapons/textures/PALM OF HEAVEN.PNG" id="1_hi6xm"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_pwwg7"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_pwwg7"] [resource] script = ExtResource("1_pwwg7") diff --git a/src/items/weapons/resources/Rondo.tres b/src/items/weapons/resources/Rondo.tres index cfd7c056..909159fa 100644 --- a/src/items/weapons/resources/Rondo.tres +++ b/src/items/weapons/resources/Rondo.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://gebgo2x6nr3t"] [ext_resource type="Texture2D" uid="uid://b8c7kd436tg4" path="res://src/items/weapons/textures/RONDO.PNG" id="1_cvwbh"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_xfb0x"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_xfb0x"] [resource] script = ExtResource("1_xfb0x") diff --git a/src/items/weapons/resources/SealingRod.tres b/src/items/weapons/resources/SealingRod.tres index 99f1367d..6577c84c 100644 --- a/src/items/weapons/resources/SealingRod.tres +++ b/src/items/weapons/resources/SealingRod.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://b7xr0l4a8g1gk"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_40b5j"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_40b5j"] [ext_resource type="Texture2D" uid="uid://b1qbho30vnuxf" path="res://src/items/weapons/textures/sealing rod.PNG" id="1_wiylj"] [resource] diff --git a/src/items/weapons/resources/Sword Sword Odette.tres b/src/items/weapons/resources/Sword Sword Odette.tres index 6fa835bc..98e55ea2 100644 --- a/src/items/weapons/resources/Sword Sword Odette.tres +++ b/src/items/weapons/resources/Sword Sword Odette.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://bpdbuf0k0exb5"] -[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_cik6n"] +[ext_resource type="Script" path="res://src/items/weapons/WeaponStats.cs" id="1_cik6n"] [ext_resource type="Texture2D" uid="uid://cvtcsi2sagfwm" path="res://src/items/weapons/textures/SWAN SWORD.PNG" id="1_qc4eu"] [resource] diff --git a/src/map/Map.cs b/src/map/Map.cs index 08da5093..fb5df14a 100644 --- a/src/map/Map.cs +++ b/src/map/Map.cs @@ -5,14 +5,21 @@ using DialogueManagerRuntime; using Godot; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; namespace GameJamDungeon; public interface IMap : INode3D { + event Map.TeleportReachedEventHandler TeleportReached; + event Map.DialogueDecisionMadeEventHandler DialogueDecisionMade; + event Map.DungeonFinishedGeneratingEventHandler DungeonFinishedGenerating; + public List Floors { get; } public Vector3 GetPlayerSpawnPoint(); + + public void SpawnNextFloor(); } @@ -23,6 +30,15 @@ public partial class Map : Node3D, IMap [Node] public Area3D Teleport { get; set; } = default!; + [Signal] + public delegate void TeleportReachedEventHandler(); + + [Signal] + public delegate void DialogueDecisionMadeEventHandler(); + + [Signal] + public delegate void DungeonFinishedGeneratingEventHandler(); + public List Floors { get; set; } = default!; private IDungeonFloor _currentFloor; @@ -32,6 +48,8 @@ public partial class Map : Node3D, IMap Floors = GetChildren().OfType().ToList(); _currentFloor = Floors.ElementAt(0); Teleport.BodyEntered += OnTeleportEntered; + Teleport.GlobalPosition = _currentFloor.GetTeleportSpawnPoint(); + DialogueManager.DialogueEnded += DecisionMade; } public Vector3 GetPlayerSpawnPoint() @@ -39,10 +57,27 @@ public partial class Map : Node3D, IMap return _currentFloor.GetPlayerSpawnPoint(); } + public void SpawnNextFloor() + { + var oldFloor = _currentFloor; + Floors.Remove(oldFloor); + oldFloor.CallDeferred(MethodName.QueueFree, []); + _currentFloor = Floors.ElementAt(0); + _currentFloor.InitializeDungeon(); + Teleport.GlobalPosition = _currentFloor.GetTeleportSpawnPoint(); + EmitSignal(SignalName.DungeonFinishedGenerating); + } + + private void DecisionMade(Resource resource) + { + EmitSignal(SignalName.DialogueDecisionMade); + } + private void OnTeleportEntered(Node3D body) { DialogueManager.GetCurrentScene = (() => this); var dialogueResource = GD.Load("res://src/ui/dialogue/FloorExit.dialogue"); DialogueController.ShowDialogue(dialogueResource, "floor_exit"); + EmitSignal(SignalName.TeleportReached); } } diff --git a/src/map/dungeon/floors/DungeonFloor.cs b/src/map/dungeon/floors/DungeonFloor.cs index 56cb6f79..4434d74f 100644 --- a/src/map/dungeon/floors/DungeonFloor.cs +++ b/src/map/dungeon/floors/DungeonFloor.cs @@ -2,12 +2,16 @@ using Chickensoft.AutoInject; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using Godot; +using System.Collections.Generic; +using System.Linq; public interface IDungeonFloor : INode3D { void InitializeDungeon(); public Vector3 GetPlayerSpawnPoint(); + + public Vector3 GetTeleportSpawnPoint(); } [Meta(typeof(IAutoNode))] @@ -17,13 +21,34 @@ public partial class DungeonFloor : Node3D, IDungeonFloor [Node] public GodotObject DungeonGenerator { get; set; } = default!; + internal List Rooms { get; private set; } + public void InitializeDungeon() { + Rooms = new List(); DungeonGenerator.Call("generate"); + Rooms = FindAllDungeonRooms(GetChildren().ToList(), Rooms); } public Vector3 GetPlayerSpawnPoint() { - return Vector3.Zero; + return Rooms.First().PlayerSpawn.GlobalPosition; + } + + public Vector3 GetTeleportSpawnPoint() + { + return Rooms.First().TeleportSpawn.GlobalPosition; + } + + private List FindAllDungeonRooms(List nodesToSearch, List roomsFound) + { + if (nodesToSearch.Count == 0) + return roomsFound; + + foreach (var node in nodesToSearch) + if (node is IDungeonRoom dungeonRoom) + roomsFound.Add(dungeonRoom); + + return FindAllDungeonRooms(nodesToSearch.SelectMany(x => x.GetChildren()).ToList(), roomsFound); } } diff --git a/src/map/dungeon/floors/Overworld.cs b/src/map/dungeon/floors/Overworld.cs index 0fa56bee..81167c06 100644 --- a/src/map/dungeon/floors/Overworld.cs +++ b/src/map/dungeon/floors/Overworld.cs @@ -13,6 +13,8 @@ public partial class Overworld : Node3D, IDungeonFloor [Node] public Marker3D PlayerSpawnPoint { get; set; } = default!; + [Node] public Marker3D ExitSpawnPoint { get; set; } = default!; + public void InitializeDungeon() { GameRepo.SetPlayerGlobalPosition(PlayerSpawnPoint.GlobalPosition); @@ -22,4 +24,9 @@ public partial class Overworld : Node3D, IDungeonFloor { return PlayerSpawnPoint.GlobalPosition; } + + public Vector3 GetTeleportSpawnPoint() + { + return ExitSpawnPoint.GlobalPosition; + } } diff --git a/src/map/dungeon/rooms/Antechamber.tscn b/src/map/dungeon/rooms/Antechamber.tscn index 914f5f15..508b3a06 100644 --- a/src/map/dungeon/rooms/Antechamber.tscn +++ b/src/map/dungeon/rooms/Antechamber.tscn @@ -1097,15 +1097,18 @@ data = PackedVector3Array(0.5414, 0.1147, -0.9114, -0.5965, 0.1148, -1.0371, -0. size = Vector2(35, 30) [node name="Antechamber" type="Node3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.73082, 0, -1.86841) +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.73082, 0, -1.86841) script = ExtResource("1_tdydv") +size_in_voxels = Vector3i(5, 2, 5) +voxel_scale = Vector3(12, 12, 12) [node name="Room" type="Node3D" parent="."] unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -6.03201, 0) script = ExtResource("16_osbes") [node name="NavigationRegion3D" type="NavigationRegion3D" parent="Room"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.04836, 3.10489, 12.6166) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.04836, 9.49697, 12.6166) navigation_mesh = SubResource("NavigationMesh_2x5qh") [node name="ANTECHAMBER" type="Node3D" parent="Room/NavigationRegion3D"] @@ -1196,15 +1199,9 @@ skeleton = NodePath("") transform = Transform3D(0, 0, -0.515006, 0, 0.54653, 0, 0.593558, 0, 0, 116.446, 7.82144, 86.6174) shape = SubResource("ConcavePolygonShape3D_cnvi5") -[node name="DOOR" type="Marker3D" parent="Room"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.1142, -8.45784, 32.0232) - -[node name="DOOR2" type="Marker3D" parent="Room"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.92078, -8.62051, -27.067) - [node name="PlayerSpawn" type="Marker3D" parent="Room"] unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -11.8813, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -5.38078, 0) [node name="Minimap Texture" type="MeshInstance3D" parent="Room"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00325966, -7.7801, 0) @@ -1217,170 +1214,170 @@ skeleton = NodePath("../..") unique_name_in_owner = true [node name="ItemSpawn1" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.83448, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.83448, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn2" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.44186, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.44186, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn3" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.09183, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.09183, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn4" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.83448, -11.8091, -5.86665) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.83448, -5.49583, -5.86665) gizmo_extents = 1.0 [node name="ItemSpawn5" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.21845, -11.8091, -5.59059) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.21845, -5.49583, -5.59059) gizmo_extents = 1.0 [node name="ItemSpawn6" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn7" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn8" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn9" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn10" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn11" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn12" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn13" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn14" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn15" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn16" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn17" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn18" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn19" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn20" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn21" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn22" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn23" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn24" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn25" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn26" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn27" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn28" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn29" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn30" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn31" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn32" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn33" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn34" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn35" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn36" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn37" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn38" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn39" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="ItemSpawn40" type="Marker3D" parent="Room/ItemSpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -11.8091, -2.92704) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.8145, -5.49583, -2.92704) gizmo_extents = 1.0 [node name="EnemySpawnPoints" type="Node3D" parent="Room"] unique_name_in_owner = true [node name="EnemySpawn1" type="Marker3D" parent="Room/EnemySpawnPoints"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.71409, -11.0741, 0) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.71409, -3.95028, 0) [node name="ItemDatabase" parent="Room" instance=ExtResource("17_50pl8")] unique_name_in_owner = true @@ -1389,5 +1386,12 @@ unique_name_in_owner = true unique_name_in_owner = true SpawnRate = PackedFloat32Array(1) -[node name="ExitSpawnLocation" type="Marker3D" parent="Room" groups=["Exit"]] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.06499, -11.8837, -9.52855) +[node name="TeleportSpawn" type="Marker3D" parent="Room" groups=["Exit"]] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.06499, -5.37073, -18.2257) + +[node name="DOOR1" type="Marker3D" parent="Room"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.42407, 0, -28.6818) + +[node name="DOOR2" type="Marker3D" parent="Room"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.1207, 0, 30.0499) diff --git a/src/map/dungeon/rooms/DungeonRoom.cs b/src/map/dungeon/rooms/DungeonRoom.cs index f43ba6f4..a3386221 100644 --- a/src/map/dungeon/rooms/DungeonRoom.cs +++ b/src/map/dungeon/rooms/DungeonRoom.cs @@ -9,6 +9,7 @@ public interface IDungeonRoom : INode3D { DungeonRoomLogic DungeonRoomLogic { get; } public Marker3D PlayerSpawn { get; set; } + public Marker3D TeleportSpawn { get; set; } } [Meta(typeof(IAutoNode))] @@ -24,6 +25,8 @@ public partial class DungeonRoom : Node3D, IDungeonRoom, IProvide + { + public State() + { + + } + } +} diff --git a/src/map/state/MapLogic.cs b/src/map/state/MapLogic.cs new file mode 100644 index 00000000..56c8c476 --- /dev/null +++ b/src/map/state/MapLogic.cs @@ -0,0 +1,13 @@ +using Chickensoft.Introspection; +using Chickensoft.LogicBlocks; + +namespace GameJamDungeon; + +public interface IMapLogic : ILogicBlock; + +[Meta] +[LogicBlock(typeof(State))] +public partial class MapLogic : LogicBlock, IMapLogic +{ + public override Transition GetInitialState() => To(); +} diff --git a/src/player/Player.cs b/src/player/Player.cs index d1bcc687..b25f13cc 100644 --- a/src/player/Player.cs +++ b/src/player/Player.cs @@ -9,12 +9,8 @@ namespace GameJamDungeon { public interface IPlayer : ICharacterBody3D, IKillable { - PlayerStatInfo PlayerStatInfo { get; } - PlayerLogic PlayerLogic { get; } - PlayerData PlayerData { get; } - public Vector3 GetGlobalInputVector(); public float GetLeftStrafeInputVector(); @@ -38,27 +34,13 @@ namespace GameJamDungeon [Dependency] public ISaveChunk GameChunk => this.DependOn>(); - /// Rotation speed (quaternions?/sec). - [Export(PropertyHint.Range, "0, 100, 0.1")] - public float RotationSpeed { get; set; } = 12.0f; - - /// Player speed (meters/sec). - [Export(PropertyHint.Range, "0, 100, 0.1")] - public float MoveSpeed { get; set; } = 8f; - - /// Player speed (meters^2/sec). - [Export(PropertyHint.Range, "0, 100, 0.1")] - public float Acceleration { get; set; } = 4f; - [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!; @@ -69,14 +51,10 @@ 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 Label LevelNumber { get; set; } = default!; - [Node] public IArea3D CollisionDetector { get; set; } = default!; + private PlayerData PlayerData { get; set; } = default!; + public void Initialize() { AnimationPlayer.AnimationFinished += OnAnimationFinished; @@ -84,7 +62,29 @@ namespace GameJamDungeon public void Setup() { - Settings = new PlayerLogic.Settings() { RotationSpeed = RotationSpeed, MoveSpeed = MoveSpeed, Acceleration = Acceleration }; + 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(), + CurrentHP = new AutoProp(PlayerStatResource.CurrentHP), + MaximumHP = new AutoProp(PlayerStatResource.MaximumHP), + CurrentVT = new AutoProp(PlayerStatResource.CurrentVT), + MaximumVT = new AutoProp(PlayerStatResource.MaximumVT), + CurrentAttack = new AutoProp(PlayerStatResource.CurrentAttack), + MaxAttack = new AutoProp(PlayerStatResource.MaxAttack), + CurrentDefense = new AutoProp(PlayerStatResource.CurrentDefense), + MaxDefense = new AutoProp(PlayerStatResource.MaxDefense), + CurrentExp = new AutoProp(PlayerStatResource.CurrentExp), + ExpToNextLevel = new AutoProp(PlayerStatResource.ExpToNextLevel), + CurrentLevel = new AutoProp(PlayerStatResource.CurrentLevel), + BonusAttack = new AutoProp(PlayerStatResource.BonusAttack), + BonusDefense = new AutoProp(PlayerStatResource.BonusDefense), + Luck = new AutoProp(PlayerStatResource.Luck) + }; PlayerLogic = new PlayerLogic(); PlayerLogic.Set(this as IPlayer); @@ -92,6 +92,12 @@ namespace GameJamDungeon PlayerLogic.Set(AppRepo); PlayerLogic.Set(GameRepo); PlayerLogic.Set(PlayerData); + + PlayerData.Inventory.EquippedWeapon.Sync += EquippedWeapon_Sync; + PlayerData.Inventory.EquippedArmor.Sync += EquippedArmor_Sync; + PlayerData.Inventory.EquippedAccessory.Sync += EquippedAccessory_Sync; + + PlayerData.CurrentHP.Sync += CurrentHP_Sync; } public void OnResolved() @@ -106,9 +112,8 @@ namespace GameJamDungeon }) .Handle((in PlayerLogic.Output.Animations.Attack output) => { - var weaponInfo = GameRepo.EquippedWeapon.Value.WeaponInfo; - var attackSpeed = (float)weaponInfo.AttackSpeed; - AnimationPlayer.SetSpeedScale(attackSpeed); + var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed; + AnimationPlayer.SetSpeedScale((float)attackSpeed); AnimationPlayer.Play("attack"); }) .Handle((in PlayerLogic.Output.ThrowItem output) => @@ -117,11 +122,10 @@ namespace GameJamDungeon this.Provide(); PlayerLogic.Start(); - + GameRepo.SetPlayerData(PlayerData); SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2; GlobalPosition = GameRepo.PlayerGlobalPosition.Value; - GameRepo.SetPlayerStatInfo(PlayerStatInfo); - + GameRepo.PlayerGlobalPosition.Sync += PlayerGlobalPosition_Sync; HealthTimer.Timeout += OnHealthTimerTimeout; CollisionDetector.AreaEntered += OnEnemyHitBoxEntered; } @@ -142,26 +146,6 @@ namespace GameJamDungeon Settings.MoveSpeed /= 4; } - private void OnEnemyHitBoxEntered(Area3D area) - { - if (area is IHitbox hitBox) - { - if (GameRepo.PlayerStatInfo.Value.CurrentHP > 0) - { - var enemy = hitBox.GetParent(); - var isCriticalHit = false; - var rng = new RandomNumberGenerator(); - rng.Randomize(); - var roll = rng.Randf(); - if (roll <= enemy.EnemyStatInfo.Luck) - isCriticalHit = true; - var damage = DamageCalculator.CalculateEnemyDamage(PlayerStatInfo, enemy.EnemyStatInfo, GameRepo.EquippedArmor.Value.ArmorInfo, isCriticalHit); - GameRepo.PlayerStatInfo.Value.CurrentHP = GameRepo.PlayerStatInfo.Value.CurrentHP - damage; - GD.Print($"Player hit for {damage} damage."); - } - } - } - public void OnPhysicsProcess(double delta) { PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta)); @@ -171,13 +155,6 @@ namespace GameJamDungeon PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition)); } - public override void _Process(double delta) - { - OnHPChanged(GameRepo.PlayerStatInfo.Value.CurrentHP); - OnVTChanged(GameRepo.PlayerStatInfo.Value.CurrentVT); - OnLevelChanged(GameRepo.PlayerStatInfo.Value.CurrentLevel); - } - public Vector3 GetGlobalInputVector() { var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown); @@ -226,35 +203,72 @@ namespace GameJamDungeon 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)}/{PlayerStatInfo.MaximumHP}"; - - if (newHP <= 0.0) - { - PlayerLogic.Input(new PlayerLogic.Input.Killed()); - HealthTimer.Stop(); - } - } - - private void OnVTChanged(int newVT) - { - VTNumber.Text = $"{newVT}/{PlayerStatInfo.MaximumVT}"; - } - - private void OnLevelChanged(int newLevel) - { - LevelNumber.Text = $"{newLevel}"; + GlobalPosition = newPlayerPosition; } private void OnPlayerPositionUpdated(Vector3 globalPosition) => GlobalPosition = globalPosition; private void OnHealthTimerTimeout() { - if (GameRepo.PlayerStatInfo.Value.CurrentVT > 0) - GameRepo.PlayerStatInfo.Value.CurrentVT = GameRepo.PlayerStatInfo.Value.CurrentVT - 1; + if (PlayerData.CurrentVT.Value > 0) + PlayerData.CurrentVT.OnNext(PlayerData.CurrentVT.Value - 1); else - GameRepo.PlayerStatInfo.Value.CurrentHP = GameRepo.PlayerStatInfo.Value.CurrentHP - 1; + PlayerData.CurrentHP.OnNext(PlayerData.CurrentHP.Value - 1); + } + + private void EquippedAccessory_Sync(Accessory equippedItem) + { + PlayerData.BonusAttack.OnNext(PlayerData.BonusAttack.Value - PlayerData.Inventory.EquippedAccessory.Value.AccessoryInfo.ATKUp); + PlayerData.BonusDefense.OnNext(PlayerData.BonusDefense.Value - PlayerData.Inventory.EquippedAccessory.Value.AccessoryInfo.DEFUp); + PlayerData.MaximumHP.OnNext(PlayerData.MaximumHP.Value - PlayerData.Inventory.EquippedAccessory.Value.AccessoryInfo.MaxHPUp); + PlayerData.MaximumVT.OnNext(PlayerData.MaximumVT.Value - PlayerData.Inventory.EquippedAccessory.Value.AccessoryInfo.MaxVTUp); + PlayerData.Luck.OnNext(PlayerData.Luck.Value - PlayerData.Inventory.EquippedAccessory.Value.AccessoryInfo.LUCKUp); + + PlayerData.BonusAttack.OnNext(PlayerData.BonusAttack.Value + equippedItem.AccessoryInfo.ATKUp); + PlayerData.BonusDefense.OnNext(PlayerData.BonusDefense.Value + equippedItem.AccessoryInfo.DEFUp); + PlayerData.MaximumHP.OnNext(PlayerData.MaximumHP.Value + equippedItem.AccessoryInfo.MaxHPUp); + PlayerData.MaximumVT.OnNext(PlayerData.MaximumVT.Value + equippedItem.AccessoryInfo.MaxVTUp); + PlayerData.Luck.OnNext(PlayerData.Luck.Value + equippedItem.AccessoryInfo.LUCKUp); + PlayerData.Inventory.Equip(equippedItem); + } + + private void EquippedArmor_Sync(Armor equippedItem) + { + PlayerData.BonusDefense.OnNext(PlayerData.BonusDefense.Value - PlayerData.Inventory.EquippedArmor.Value.ArmorStats.Defense); + PlayerData.BonusDefense.OnNext(PlayerData.BonusDefense.Value + equippedItem.ArmorStats.Defense); + PlayerData.Inventory.Equip(equippedItem); + } + + private void EquippedWeapon_Sync(Weapon equippedItem) + { + PlayerData.BonusAttack.OnNext(PlayerData.BonusAttack.Value - PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.Damage); + PlayerData.BonusAttack.OnNext(PlayerData.BonusAttack.Value + equippedItem.WeaponStats.Damage); + PlayerData.Inventory.Equip(equippedItem); + } + + private void OnEnemyHitBoxEntered(Area3D area) + { + if (area is IHitbox hitBox) + { + var enemy = hitBox.GetParent(); + 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.Value, enemy.EnemyStatResource, GameRepo.PlayerData.Inventory.EquippedArmor.Value.ArmorStats, isCriticalHit); + PlayerData.CurrentHP.OnNext(PlayerData.CurrentHP.Value - Mathf.RoundToInt(damage)); + GD.Print($"Player hit for {damage} damage."); + } + } + + private void CurrentHP_Sync(int newHealth) + { + if (newHealth <= 0) + Kill(); } } } diff --git a/src/player/Player.tscn b/src/player/Player.tscn index 4a6c6091..af9deacb 100644 --- a/src/player/Player.tscn +++ b/src/player/Player.tscn @@ -1,34 +1,34 @@ -[gd_scene load_steps=22 format=3 uid="uid://cfecvvav8kkp6"] +[gd_scene load_steps=19 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="Script" path="res://src/player/PlayerStatInfo.cs" id="2_n88di"] +[ext_resource type="Script" path="res://src/player/PlayerStatResource.cs" id="2_xq68d"] [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="Texture2D" uid="uid://hg2kraa5nrnl" path="res://src/ui/textures/blank level symbol.png" id="10_rsd7v"] -[ext_resource type="LabelSettings" uid="uid://ca1q6yu8blwxf" path="res://src/ui/label_settings/InventoryMainTextBold.tres" id="11_6gvkm"] -[ext_resource type="LabelSettings" uid="uid://dupifadnagodp" path="res://src/ui/label_settings/MainTextRegular.tres" id="12_f4uqk"] -[sub_resource type="Resource" id="Resource_up0v1"] -script = ExtResource("2_n88di") -CurrentHP = 100.0 -MaximumHP = 100.0 +[sub_resource type="Resource" id="Resource_btp2w"] +script = ExtResource("2_xq68d") +RotationSpeed = 3.0 +MoveSpeed = 4.0 +Acceleration = 1.0 +CurrentHP = 100 +MaximumHP = 100 CurrentVT = 90 MaximumVT = 90 +CurrentExp = 0 +ExpToNextLevel = 100 CurrentLevel = 1 -CurrentEXP = 0 -EXPToNextLevel = 100 -CurrentAttack = 12 -MaxAttack = 12 -CurrentDefense = 8 -MaxDefense = 8 +CurrentAttack = 14 +CurrentDefense = 12 +MaxAttack = 14 +MaxDefense = 12 BonusAttack = 0 BonusDefense = 0 -Luck = 0.0 +Luck = 0.05 [sub_resource type="BoxShape3D" id="BoxShape3D_wedu3"] @@ -98,8 +98,8 @@ tracks/1/keys = { [sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"] _data = { -&"attack": SubResource("Animation_0jjwv"), -&"RESET": SubResource("Animation_hcjph") +"RESET": SubResource("Animation_hcjph"), +"attack": SubResource("Animation_0jjwv") } [sub_resource type="SpriteFrames" id="SpriteFrames_ywvvo"] @@ -139,10 +139,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.381018, 0) collision_layer = 38 collision_mask = 7 script = ExtResource("1_xcol5") -RotationSpeed = 3.0 -MoveSpeed = 4.0 -Acceleration = 1.0 -PlayerStatInfo = SubResource("Resource_up0v1") +PlayerStatResource = SubResource("Resource_btp2w") [node name="Hitbox" type="Area3D" parent="."] unique_name_in_owner = true @@ -183,7 +180,7 @@ omni_range = 83.659 [node name="AnimationPlayer" type="AnimationPlayer" parent="."] unique_name_in_owner = true libraries = { -&"": SubResource("AnimationLibrary_w8l8m") +"": SubResource("AnimationLibrary_w8l8m") } [node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."] @@ -197,82 +194,3 @@ unique_name_in_owner = true process_mode = 1 wait_time = 3.0 autostart = true - -[node name="PlayerInfoUI" type="MarginContainer" parent="."] -offset_right = 629.0 -offset_bottom = 256.0 -theme_override_constants/margin_left = 32 - -[node name="HBoxContainer" type="HBoxContainer" parent="PlayerInfoUI"] -layout_mode = 2 - -[node name="CenterContainer" type="CenterContainer" parent="PlayerInfoUI/HBoxContainer"] -layout_mode = 2 - -[node name="TextureRect" type="TextureRect" parent="PlayerInfoUI/HBoxContainer/CenterContainer"] -custom_minimum_size = Vector2(128, 128) -layout_mode = 2 -size_flags_vertical = 3 -texture = ExtResource("10_rsd7v") -expand_mode = 1 -stretch_mode = 4 - -[node name="LevelNumber" type="Label" parent="PlayerInfoUI/HBoxContainer/CenterContainer"] -unique_name_in_owner = true -custom_minimum_size = Vector2(80, 80) -layout_mode = 2 -text = "99" -label_settings = ExtResource("11_6gvkm") -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="VBox" type="VBoxContainer" parent="PlayerInfoUI/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 4 -size_flags_vertical = 4 -theme_override_constants/separation = 15 - -[node name="HBox" type="HBoxContainer" parent="PlayerInfoUI/HBoxContainer/VBox"] -layout_mode = 2 -size_flags_horizontal = 3 - -[node name="HP" type="Label" parent="PlayerInfoUI/HBoxContainer/VBox/HBox"] -layout_mode = 2 -text = "HP: " -label_settings = ExtResource("11_6gvkm") - -[node name="ReferenceRect" type="ReferenceRect" parent="PlayerInfoUI/HBoxContainer/VBox/HBox"] -custom_minimum_size = Vector2(30, 0) -layout_mode = 2 -border_width = 0.0 - -[node name="HPNumber" type="Label" parent="PlayerInfoUI/HBoxContainer/VBox/HBox"] -unique_name_in_owner = true -layout_mode = 2 -text = "222/222" -label_settings = ExtResource("12_f4uqk") - -[node name="HBox2" type="HBoxContainer" parent="PlayerInfoUI/HBoxContainer/VBox"] -layout_mode = 2 - -[node name="VT" type="Label" parent="PlayerInfoUI/HBoxContainer/VBox/HBox2"] -layout_mode = 2 -text = "VT:" -label_settings = ExtResource("11_6gvkm") - -[node name="ReferenceRect" type="ReferenceRect" parent="PlayerInfoUI/HBoxContainer/VBox/HBox2"] -custom_minimum_size = Vector2(30, 0) -layout_mode = 2 -border_width = 0.0 - -[node name="VTNumber" type="Label" parent="PlayerInfoUI/HBoxContainer/VBox/HBox2"] -unique_name_in_owner = true -layout_mode = 2 -text = "444/444" -label_settings = ExtResource("12_f4uqk") - -[node name="TextureButton" type="TextureButton" parent="PlayerInfoUI"] -layout_mode = 2 - -[node name="Marker3D" type="Marker3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -2.70201) diff --git a/src/player/PlayerData.cs b/src/player/PlayerData.cs index 9c04b55b..0f228110 100644 --- a/src/player/PlayerData.cs +++ b/src/player/PlayerData.cs @@ -1,4 +1,5 @@ -using Chickensoft.Serialization; +using Chickensoft.Collections; +using Chickensoft.Serialization; using Godot; namespace GameJamDungeon @@ -12,5 +13,36 @@ namespace GameJamDungeon public required PlayerLogic StateMachine { get; init; } [Save("velocity")] public required Vector3 Velocity { get; init; } + + [Save("inventory")] + public required Inventory Inventory { get; init; } + [Save("currentHP")] + public required AutoProp CurrentHP { get; init; } + [Save("maximumHP")] + public required AutoProp MaximumHP { get; init; } + [Save("currentVT")] + public required AutoProp CurrentVT { get; init; } + [Save("maximumVT")] + public required AutoProp MaximumVT { get; init; } + [Save("currentExp")] + public required AutoProp CurrentExp { get; init; } + [Save("expToNextLevel")] + public required AutoProp ExpToNextLevel { get; init; } + [Save("currentLevel")] + public required AutoProp CurrentLevel { get; init; } + [Save("currentAttack")] + public required AutoProp CurrentAttack { get; init; } + [Save("currentDefense")] + public required AutoProp CurrentDefense { get; init; } + [Save("maxAttack")] + public required AutoProp MaxAttack { get; init; } + [Save("maxDefense")] + public required AutoProp MaxDefense { get; init; } + [Save("bonusAttack")] + public required AutoProp BonusAttack { get; init; } + [Save("bonusDefense")] + public required AutoProp BonusDefense { get; init; } + [Save("luck")] + public required AutoProp Luck { get; init; } } } diff --git a/src/player/PlayerStatInfo.cs b/src/player/PlayerStatInfo.cs deleted file mode 100644 index 6225a3e6..00000000 --- a/src/player/PlayerStatInfo.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Chickensoft.Collections; -using Godot; - -namespace GameJamDungeon -{ - [GlobalClass] - public partial class PlayerStatInfo : Resource, ICharacterStats - { - [Export] - public double CurrentHP { get => _currentHP.Value; set => _currentHP.OnNext(Mathf.Min(MaximumHP, value)); } - - [Export] - public double MaximumHP { get => _maximumHP.Value; set => _maximumHP.OnNext(value); } - - [Export] - public int CurrentVT { get => _currentVT.Value; set => _currentVT.OnNext(Mathf.Min(MaximumVT, value)); } - - [Export] - public int MaximumVT { get => _maximumVT.Value; set => _maximumVT.OnNext(value); } - - [Export] - public int CurrentLevel { get => _currentLevel.Value; set => _currentLevel.OnNext(value); } - - - [Export] - public int CurrentEXP { get => _currentExp.Value; set => _currentExp.OnNext(value); } - - [Export] - public int EXPToNextLevel { get => _expToNextLevel.Value; set => _expToNextLevel.OnNext(value); } - - [Export] - public int CurrentAttack { get => _currentAttack.Value; set => _currentAttack.OnNext(Mathf.Min(MaxAttack, value)); } - - [Export] - public int MaxAttack { get => _maxAttack.Value; set => _maxAttack.OnNext(value); } - - [Export] - public int CurrentDefense { get => _currentDefense.Value; set => _currentDefense.OnNext(Mathf.Min(CurrentDefense, value)); } - [Export] - public int MaxDefense { get => _maxDefense.Value; set => _maxDefense.OnNext(value); } - - [Export] - public int BonusAttack { get => _bonusAttack.Value; set => _bonusAttack.OnNext(value); } - - [Export] - public int BonusDefense { get => _bonusDefense.Value; set => _bonusDefense.OnNext(value); } - - [Export] - public double Luck { get => _luck.Value; set => _luck.OnNext(value); } - - // AutoProp backing data - private readonly AutoProp _currentHP = new AutoProp(double.MaxValue); - private readonly AutoProp _maximumHP = new AutoProp(double.MaxValue); - - private readonly AutoProp _currentVT = new AutoProp(int.MaxValue); - private readonly AutoProp _maximumVT = new AutoProp(int.MaxValue); - - private readonly AutoProp _currentExp = new AutoProp(int.MaxValue); - private readonly AutoProp _expToNextLevel = new AutoProp(int.MaxValue); - private readonly AutoProp _currentLevel = new AutoProp(int.MaxValue); - - private readonly AutoProp _currentAttack = new AutoProp(int.MaxValue); - private readonly AutoProp _currentDefense = new AutoProp(int.MaxValue); - - private readonly AutoProp _maxAttack = new AutoProp(int.MaxValue); - private readonly AutoProp _maxDefense = new AutoProp(int.MaxValue); - - private readonly AutoProp _bonusAttack = new AutoProp(int.MaxValue); - private readonly AutoProp _bonusDefense = new AutoProp(int.MaxValue); - - private readonly AutoProp _luck = new AutoProp(double.MaxValue); - } -} diff --git a/src/player/PlayerStatResource.cs b/src/player/PlayerStatResource.cs new file mode 100644 index 00000000..5d7367bd --- /dev/null +++ b/src/player/PlayerStatResource.cs @@ -0,0 +1,42 @@ +using Godot; + +namespace GameJamDungeon +{ + [GlobalClass] + public partial class PlayerStatResource : Resource + { + /// Rotation speed (quaternions?/sec). + [Export(PropertyHint.Range, "0, 100, 0.1")] + public float RotationSpeed { get; set; } = 12.0f; + + /// Player speed (meters/sec). + [Export(PropertyHint.Range, "0, 100, 0.1")] + public float MoveSpeed { get; set; } = 8f; + + /// Player speed (meters^2/sec). + [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; } + } +} diff --git a/src/player/PlayerStats.tres b/src/player/PlayerStats.tres deleted file mode 100644 index 87498a3b..00000000 --- a/src/player/PlayerStats.tres +++ /dev/null @@ -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 diff --git a/src/system/stats/DamageCalculator.cs b/src/system/stats/DamageCalculator.cs index aa01ad71..10f76ef4 100644 --- a/src/system/stats/DamageCalculator.cs +++ b/src/system/stats/DamageCalculator.cs @@ -4,9 +4,8 @@ namespace GameJamDungeon { public static class DamageCalculator { - public static double CalculatePlayerDamage(PlayerStatInfo playerStatInfo, EnemyStatInfo enemyStatInfo, WeaponInfo weapon, bool isCriticalHit) + public static double CalculatePlayerDamage(int totalAttack, EnemyStatResource enemyStatInfo, WeaponStats weapon, bool isCriticalHit) { - var baseDamage = playerStatInfo.CurrentAttack + playerStatInfo.BonusAttack; var hydricResistance = enemyStatInfo.HydricResistance; var igneousResistance = enemyStatInfo.IgneousResistance; var telluricResistance = enemyStatInfo.TelluricResistance; @@ -27,7 +26,7 @@ namespace GameJamDungeon var elementCDamage = (weapon.TelluricDamageBonus > 0 ? weapon.TelluricDamageBonus - telluricResistance : 0) / 100; var elementDDamage = (weapon.AeolicDamageBonus > 0 ? weapon.AeolicDamageBonus - aeolicResistance : 0) / 100; var elementEDamage = (weapon.FerrumDamageBonus > 0 ? weapon.FerrumDamageBonus - ferrumResistance : 0) / 100; - var elementalBonusDamage = baseDamage + (baseDamage * elementADamage) + (baseDamage * elementBDamage) + (baseDamage * elementCDamage) + (baseDamage * elementDDamage) + (baseDamage * elementEDamage); + var elementalBonusDamage = totalAttack + (totalAttack * elementADamage) + (totalAttack * elementBDamage) + (totalAttack * elementCDamage) + (totalAttack * elementDDamage) + (totalAttack * elementEDamage); var calculatedDamage = elementalBonusDamage - enemyStatInfo.CurrentDefense; if (isCriticalHit) @@ -36,16 +35,16 @@ namespace GameJamDungeon return calculatedDamage; } - public static double CalculateEnemyDamage(PlayerStatInfo playerStatInfo, EnemyStatInfo enemyStatInfo, ArmorInfo armor, bool isCriticalHit) + public static double CalculateEnemyDamage(int playerTotalDefense, EnemyStatResource enemyStatInfo, ArmorStats armor, bool isCriticalHit) { - var baseDamage = enemyStatInfo.CurrentAttack; + var totalAttack = enemyStatInfo.CurrentAttack; var elementADamage = (enemyStatInfo.BaseHydricDamageBonus > 0 ? enemyStatInfo.BaseHydricDamageBonus - armor.HydricResistance : 0) / 100; var elementBDamage = (enemyStatInfo.IgneousDamageBonus > 0 ? enemyStatInfo.IgneousDamageBonus - armor.IgneousResistance : 0) / 100; var elementCDamage = (enemyStatInfo.TelluricDamageBonus > 0 ? enemyStatInfo.TelluricDamageBonus - armor.TelluricResistance : 0) / 100; var elementDDamage = (enemyStatInfo.AeolicDamageBonus > 0 ? enemyStatInfo.AeolicDamageBonus - armor.AeolicResistance : 0) / 100; var elementEDamage = (enemyStatInfo.FerrumDamageBonus > 0 ? enemyStatInfo.FerrumDamageBonus - armor.FerrumResistance : 0) / 100; - var elementalBonusDamage = baseDamage + (baseDamage * elementADamage) + (baseDamage * elementBDamage) + (baseDamage * elementCDamage) + (baseDamage * elementDDamage) + (baseDamage * elementEDamage); - var calculatedDamage = elementalBonusDamage - playerStatInfo.CurrentDefense - (armor != null ? armor.Defense : 0); + var elementalBonusDamage = totalAttack + (totalAttack * elementADamage) + (totalAttack * elementBDamage) + (totalAttack * elementCDamage) + (totalAttack * elementDDamage) + (totalAttack * elementEDamage); + var calculatedDamage = elementalBonusDamage - playerTotalDefense - (armor != null ? armor.Defense : 0); if (isCriticalHit) calculatedDamage *= 2; diff --git a/src/system/stats/ICharacterStats.cs b/src/system/stats/ICharacterStats.cs index 312b2931..915016ba 100644 --- a/src/system/stats/ICharacterStats.cs +++ b/src/system/stats/ICharacterStats.cs @@ -1,19 +1,21 @@ -namespace GameJamDungeon +using Chickensoft.Collections; + +namespace GameJamDungeon { public interface ICharacterStats { - public double CurrentHP { get; } + public IAutoProp CurrentHP { get; } - public double MaximumHP { get; } + public IAutoProp MaximumHP { get; } - public int CurrentAttack { get; } + public IAutoProp CurrentAttack { get; } - public int CurrentDefense { get; } + public IAutoProp CurrentDefense { get; } - public int MaxAttack { get; } + public IAutoProp MaxAttack { get; } - public int MaxDefense { get; } + public IAutoProp MaxDefense { get; } - public double Luck { get; } + public IAutoProp Luck { get; } } } diff --git a/src/ui/dialogue/DialogueBalloon.tscn b/src/ui/dialogue/DialogueBalloon.tscn index 93155b8f..05f9e132 100644 --- a/src/ui/dialogue/DialogueBalloon.tscn +++ b/src/ui/dialogue/DialogueBalloon.tscn @@ -87,6 +87,7 @@ Panel/styles/panel = SubResource("StyleBoxFlat_uy0d5") [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_dboi3"] [node name="DialogueBalloon" type="CanvasLayer"] +process_mode = 3 layer = 100 script = ExtResource("1_okfmu") NextAction = "ui_cancel" diff --git a/src/ui/dialogue/FloorExit.dialogue b/src/ui/dialogue/FloorExit.dialogue index b13b957f..b82e6454 100644 --- a/src/ui/dialogue/FloorExit.dialogue +++ b/src/ui/dialogue/FloorExit.dialogue @@ -1,6 +1,6 @@ ~ floor_exit Proceed to the next floor? - Yes - do Exit() + do SpawnNextFloor() - No => END \ No newline at end of file diff --git a/src/ui/floor_clear/FloorClearMenu.cs b/src/ui/floor_clear/FloorClearMenu.cs index 1d7e669f..2c705436 100644 --- a/src/ui/floor_clear/FloorClearMenu.cs +++ b/src/ui/floor_clear/FloorClearMenu.cs @@ -3,8 +3,6 @@ using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using GameJamDungeon; using Godot; -using System; -using System.Linq; [Meta(typeof(IAutoNode))] public partial class FloorClearMenu : Control @@ -27,10 +25,4 @@ public partial class FloorClearMenu : Control { EmitSignal(SignalName.TransitionCompleted); } - - private void AnimationPlayer_AnimationFinished(StringName animName) - { - var spawnPoints = GetTree().GetNodesInGroup("Exit").OfType(); - GameRepo.CurrentFloor++; - } } diff --git a/src/ui/in_game_ui/InGameUI.cs b/src/ui/in_game_ui/InGameUI.cs index 4e76309b..b78635ef 100644 --- a/src/ui/in_game_ui/InGameUI.cs +++ b/src/ui/in_game_ui/InGameUI.cs @@ -2,19 +2,20 @@ using Chickensoft.AutoInject; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using Godot; -using System.Threading.Tasks; namespace GameJamDungeon; public interface IInGameUI : IControl { - public Task ShowInventoryScreen(); + public void ShowInventoryScreen(); public void HideInventoryScreen(); public void ShowMiniMap(); public void HideMiniMap(); + + public void ShowInventoryFullMessage(string rejectedItemName); } [Meta(typeof(IAutoNode))] @@ -26,6 +27,13 @@ public partial class InGameUI : Control, IInGameUI [Node] public IInventoryMenu InventoryMenu { get; set; } = default!; + [Node] public IPlayerInfoUI PlayerInfoUI { get; set; } = default!; + + public void ShowInventoryFullMessage(string rejectedItemName) + { + PlayerInfoUI.DisplayInventoryFullMessage(rejectedItemName); + } + public void HideInventoryScreen() { InventoryMenu.Hide(); @@ -36,9 +44,9 @@ public partial class InGameUI : Control, IInGameUI MiniMap.Hide(); } - public async Task ShowInventoryScreen() + public void ShowInventoryScreen() { - await InventoryMenu.RedrawInventory(); + InventoryMenu.RedrawInventory(); InventoryMenu.Show(); } diff --git a/src/ui/in_game_ui/InGameUI.tscn b/src/ui/in_game_ui/InGameUI.tscn index 446cff5c..f05d1b4b 100644 --- a/src/ui/in_game_ui/InGameUI.tscn +++ b/src/ui/in_game_ui/InGameUI.tscn @@ -1,19 +1,27 @@ -[gd_scene load_steps=4 format=3 uid="uid://b1muxus5qdbeu"] +[gd_scene load_steps=5 format=3 uid="uid://b1muxus5qdbeu"] [ext_resource type="Script" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"] [ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"] [ext_resource type="PackedScene" uid="uid://dlj8qdg1c5048" path="res://src/inventory_menu/InventoryMenu.tscn" id="3_4vcdl"] +[ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"] [node name="InGameUI" type="Control"] process_mode = 3 +custom_minimum_size = Vector2(1920, 1080) layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 script = ExtResource("1_sc13i") +[node name="PlayerInfoUI" parent="." instance=ExtResource("4_46s5l")] +unique_name_in_owner = true +layout_mode = 1 + [node name="MiniMap" parent="." instance=ExtResource("2_6sfje")] unique_name_in_owner = true visible = false diff --git a/src/ui/pause_menu/PauseMenu.tscn b/src/ui/pause_menu/PauseMenu.tscn index 08b74a52..3223d53e 100644 --- a/src/ui/pause_menu/PauseMenu.tscn +++ b/src/ui/pause_menu/PauseMenu.tscn @@ -1,21 +1,5 @@ [gd_scene load_steps=5 format=3 uid="uid://blbqgw3wosc1w"] -[sub_resource type="Animation" id="Animation_bium7"] -resource_name = "fade_in" -length = 0.3 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath(".:modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.3), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] -} - [sub_resource type="Animation" id="Animation_ccrq3"] resource_name = "fade_out" length = 0.5 @@ -27,11 +11,27 @@ tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { "times": PackedFloat32Array(0, 0.3), -"transitions": PackedFloat32Array(1, 1), +"transitions": PackedFloat32Array(1, 7.7), "update": 0, "values": [Color(1, 1, 1, 1), Color(1, 1, 1, 0)] } +[sub_resource type="Animation" id="Animation_bium7"] +resource_name = "fade_in" +length = 0.3 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.3), +"transitions": PackedFloat32Array(1, 7.7), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} + [sub_resource type="Animation" id="Animation_f1eqn"] length = 0.001 tracks/0/type = "value" diff --git a/src/ui/player_ui/PlayerInfoUI.cs b/src/ui/player_ui/PlayerInfoUI.cs new file mode 100644 index 00000000..2a57effc --- /dev/null +++ b/src/ui/player_ui/PlayerInfoUI.cs @@ -0,0 +1,75 @@ +using Chickensoft.AutoInject; +using Chickensoft.GodotNodeInterfaces; +using Chickensoft.Introspection; +using Godot; + +namespace GameJamDungeon; + +public interface IPlayerInfoUI : IControl +{ + public void DisplayInventoryFullMessage(string rejectedItemName); +} + +[Meta(typeof(IAutoNode))] +public partial class PlayerInfoUI : Control, IPlayerInfoUI +{ + public override void _Notification(int what) => this.Notify(what); + + private LabelSettings _labelSettings { get; set; } + + #region Nodes + [Node] public VBoxContainer PlayerInfo { get; set; } = default!; + + [Node] public Label LevelNumber { get; set; } = default!; + + [Node] public Label HPNumber { get; set; } = default!; + + [Node] public Label VTNumber { get; set; } = default!; + #endregion + + [Dependency] + public IGameRepo GameRepo => this.DependOn(); + + public void OnResolved() + { + _labelSettings = GD.Load("res://src/ui/label_settings/MainTextRegular.tres"); + GameRepo.PlayerData.CurrentHP.Sync += CurrentHP_Sync; + GameRepo.PlayerData.MaximumHP.Sync += MaximumHP_Sync; + + GameRepo.PlayerData.CurrentVT.Sync += CurrentVT_Sync; + GameRepo.PlayerData.MaximumVT.Sync += MaximumVT_Sync; + + GameRepo.PlayerData.CurrentLevel.Sync += CurrentLevel_Sync; + } + + private void CurrentLevel_Sync(int obj) + { + LevelNumber.Text = $"{obj}"; + } + + private void MaximumVT_Sync(int obj) + { + VTNumber.Text = $"{GameRepo.PlayerData.CurrentVT.Value}/{obj}"; + } + + private void CurrentVT_Sync(int obj) + { + VTNumber.Text = $"{obj}/{GameRepo.PlayerData.MaximumVT.Value}"; + } + + private void MaximumHP_Sync(int obj) + { + HPNumber.Text = $"{GameRepo.PlayerData.CurrentHP.Value}/{obj}"; + } + + private void CurrentHP_Sync(int obj) + { + HPNumber.Text = $"{obj}/{GameRepo.PlayerData.MaximumHP.Value}"; + } + + public void DisplayInventoryFullMessage(string rejectedItemName) + { + var newLabel = new Label() { Text = $"Could not pick up {rejectedItemName}.", LabelSettings = _labelSettings }; + PlayerInfo.AddChild(newLabel); + } +} diff --git a/src/ui/player_ui/PlayerInfoUI.tscn b/src/ui/player_ui/PlayerInfoUI.tscn new file mode 100644 index 00000000..3202c1fe --- /dev/null +++ b/src/ui/player_ui/PlayerInfoUI.tscn @@ -0,0 +1,98 @@ +[gd_scene load_steps=5 format=3 uid="uid://dxl8il8f13c2x"] + +[ext_resource type="Texture2D" uid="uid://hg2kraa5nrnl" path="res://src/ui/textures/blank level symbol.png" id="1_78qrq"] +[ext_resource type="Script" path="res://src/ui/player_ui/PlayerInfoUI.cs" id="1_d8yyu"] +[ext_resource type="LabelSettings" uid="uid://ca1q6yu8blwxf" path="res://src/ui/label_settings/InventoryMainTextBold.tres" id="2_aa7fx"] +[ext_resource type="LabelSettings" uid="uid://dupifadnagodp" path="res://src/ui/label_settings/MainTextRegular.tres" id="3_xdjh1"] + +[node name="PlayerInfoUI" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_d8yyu") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 9 +anchor_bottom = 1.0 +offset_right = 426.0 +grow_vertical = 2 +theme_override_constants/margin_left = 32 + +[node name="PlayerInfo" type="VBoxContainer" parent="MarginContainer"] +unique_name_in_owner = true +layout_mode = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PlayerInfo"] +layout_mode = 2 + +[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/PlayerInfo/HBoxContainer"] +layout_mode = 2 + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/PlayerInfo/HBoxContainer/CenterContainer"] +custom_minimum_size = Vector2(128, 128) +layout_mode = 2 +size_flags_vertical = 3 +texture = ExtResource("1_78qrq") +expand_mode = 1 +stretch_mode = 4 + +[node name="LevelNumber" type="Label" parent="MarginContainer/PlayerInfo/HBoxContainer/CenterContainer"] +unique_name_in_owner = true +custom_minimum_size = Vector2(80, 80) +layout_mode = 2 +text = "99" +label_settings = ExtResource("2_aa7fx") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="VBox" type="VBoxContainer" parent="MarginContainer/PlayerInfo/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme_override_constants/separation = 15 + +[node name="HBox" type="HBoxContainer" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="HP" type="Label" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox"] +layout_mode = 2 +text = "HP: " +label_settings = ExtResource("2_aa7fx") + +[node name="ReferenceRect" type="ReferenceRect" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox"] +custom_minimum_size = Vector2(30, 0) +layout_mode = 2 +border_width = 0.0 + +[node name="HPNumber" type="Label" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox"] +unique_name_in_owner = true +layout_mode = 2 +text = "222/222" +label_settings = ExtResource("3_xdjh1") + +[node name="HBox2" type="HBoxContainer" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox"] +layout_mode = 2 + +[node name="VT" type="Label" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox2"] +layout_mode = 2 +text = "VT:" +label_settings = ExtResource("2_aa7fx") + +[node name="ReferenceRect" type="ReferenceRect" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox2"] +custom_minimum_size = Vector2(30, 0) +layout_mode = 2 +border_width = 0.0 + +[node name="VTNumber" type="Label" parent="MarginContainer/PlayerInfo/HBoxContainer/VBox/HBox2"] +unique_name_in_owner = true +layout_mode = 2 +text = "444/444" +label_settings = ExtResource("3_xdjh1") + +[node name="TextureButton" type="TextureButton" parent="MarginContainer"] +layout_mode = 2