diff --git a/addons/SimpleDungeons/debug_visuals/WireframeColorMat.tres b/addons/SimpleDungeons/debug_visuals/WireframeColorMat.tres index 9078f816..ffa3783e 100644 --- a/addons/SimpleDungeons/debug_visuals/WireframeColorMat.tres +++ b/addons/SimpleDungeons/debug_visuals/WireframeColorMat.tres @@ -1,4 +1,12 @@ -[gd_resource type="ShaderMaterial" format=3 uid="uid://pq2fqq4ophsy"] +[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://pq2fqq4ophsy"] + +[ext_resource type="Shader" path="res://src/items/PickupItem.gdshader" id="1_hcihy"] [resource] resource_local_to_scene = true +render_priority = 0 +shader = ExtResource("1_hcihy") +shader_parameter/shine_color = Color(1, 1, 1, 1) +shader_parameter/cycle_interval = 1.0 +shader_parameter/shine_speed = 3.0 +shader_parameter/shine_width = 3.0 diff --git a/src/enemy/Enemy.cs b/src/enemy/Enemy.cs index 8dd8e3f8..c805fd69 100644 --- a/src/enemy/Enemy.cs +++ b/src/enemy/Enemy.cs @@ -103,10 +103,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide }) .Handle((in EnemyLogic.Output.Attack _) => { + AnimationPlayer.Stop(); AnimationPlayer.Play("attack"); }) .Handle((in EnemyLogic.Output.Defeated output) => { + AnimationPlayer.Stop(); AnimationPlayer.Play("defeated"); }); @@ -225,13 +227,15 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide if (newHP <= 0) { EnemyLogic.Input(new EnemyLogic.Input.EnemyDefeated()); - GameEventDepot.OnEnemyDefeated(EnemyStatResource); } } private void AnimationPlayer_AnimationFinished(StringName animName) { if (animName == "defeated") + { + GameEventDepot.OnEnemyDefeated(GlobalPosition, EnemyStatResource); QueueFree(); + } } } diff --git a/src/enemy/EnemyStatResource.cs b/src/enemy/EnemyStatResource.cs index 347611c3..0fc7420e 100644 --- a/src/enemy/EnemyStatResource.cs +++ b/src/enemy/EnemyStatResource.cs @@ -55,5 +55,8 @@ namespace GameJamDungeon [Export] public double FerrumDamageBonus { get; set; } + + [Export] + public float DropsSoulGemChance { get; set; } = 0.75f; } } diff --git a/src/enemy/enemy_types/michael/Michael.tscn b/src/enemy/enemy_types/michael/Michael.tscn index 0b41b48a..53e57b7c 100644 --- a/src/enemy/enemy_types/michael/Michael.tscn +++ b/src/enemy/enemy_types/michael/Michael.tscn @@ -95,6 +95,7 @@ AeolicDamageBonus = 0.0 BaseHydricDamageBonus = 0.0 IgneousDamageBonus = 0.0 FerrumDamageBonus = 0.0 +DropsSoulGemChance = 0.75 [sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"] height = 4.83757 @@ -104,7 +105,7 @@ radius = 1.0 size = Vector3(1, 0.564941, 1.14453) [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] -height = 1.0 +radius = 1.0 [sub_resource type="Animation" id="Animation_41ppy"] length = 0.001 @@ -219,6 +220,36 @@ tracks/1/keys = { "values": [-1.0, 1.0] } +[sub_resource type="Animation" id="Animation_ppbeh"] +resource_name = "idle_back_walk" +length = 1.91667 +loop_mode = 1 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_back_walk"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667, 1.25, 1.33333, 1.41667, 1.5, 1.58333, 1.66667, 1.75, 1.83333), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] +} + [sub_resource type="Animation" id="Animation_3dffb"] resource_name = "idle_front_walk" length = 1.91667 @@ -279,36 +310,6 @@ tracks/1/keys = { "values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] } -[sub_resource type="Animation" id="Animation_ppbeh"] -resource_name = "idle_back_walk" -length = 1.91667 -loop_mode = 1 -step = 0.0833333 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [&"idle_back_walk"] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667, 1.25, 1.33333, 1.41667, 1.5, 1.58333, 1.66667, 1.75, 1.83333), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 1, -"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_346xs"] _data = { "RESET": SubResource("Animation_41ppy"), @@ -623,4 +624,4 @@ unique_name_in_owner = true material = ExtResource("4_01npl") position = Vector2(45, 45) sprite_frames = SubResource("SpriteFrames_8xwq0") -animation = &"idle_front_walk" +animation = &"idle_left_walk" diff --git a/src/enemy/enemy_types/sproingy/Sproingy.tscn b/src/enemy/enemy_types/sproingy/Sproingy.tscn index 09a6983c..cef44083 100644 --- a/src/enemy/enemy_types/sproingy/Sproingy.tscn +++ b/src/enemy/enemy_types/sproingy/Sproingy.tscn @@ -81,6 +81,7 @@ AeolicDamageBonus = 0.0 BaseHydricDamageBonus = 0.0 IgneousDamageBonus = 0.0 FerrumDamageBonus = 0.0 +DropsSoulGemChance = 0.9 [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] radius = 1.0 @@ -334,6 +335,35 @@ tracks/3/keys = { "values": [&"idle_left_walk"] } +[sub_resource type="Animation" id="Animation_ruc6s"] +resource_name = "attack" +length = 0.750008 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"attack"] +} + [sub_resource type="Animation" id="Animation_lkjbu"] resource_name = "defeated" length = 1.00001 @@ -392,9 +422,10 @@ tracks/1/keys = { "values": [0.0, 1.0] } -[sub_resource type="Animation" id="Animation_ruc6s"] -resource_name = "attack" -length = 0.750008 +[sub_resource type="Animation" id="Animation_1tda5"] +resource_name = "idle_back_walk" +length = 1.25001 +loop_mode = 1 step = 0.0833333 tracks/0/type = "value" tracks/0/imported = false @@ -403,10 +434,10 @@ tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/keys = { -"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 1, -"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] } tracks/1/type = "value" tracks/1/imported = false @@ -418,7 +449,7 @@ tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 1, -"values": [&"attack"] +"values": [&"idle_back_walk"] } [sub_resource type="Animation" id="Animation_31nry"] @@ -481,36 +512,6 @@ tracks/1/keys = { "values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] } -[sub_resource type="Animation" id="Animation_1tda5"] -resource_name = "idle_back_walk" -length = 1.25001 -loop_mode = 1 -step = 0.0833333 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667), -"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), -"update": 1, -"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [&"idle_back_walk"] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_6tj5r"] _data = { "RESET": SubResource("Animation_ch8ic"), @@ -557,7 +558,7 @@ autostart = true [node name="AttackTimer" type="Timer" parent="."] unique_name_in_owner = true -wait_time = 1.8 +wait_time = 0.8 autostart = true [node name="Hitbox" type="Area3D" parent="."] @@ -585,7 +586,9 @@ texture = SubResource("ViewportTexture_moptw") [node name="SubViewport" type="SubViewport" parent="Sprite3D"] disable_3d = true transparent_bg = true +handle_input_locally = false size = Vector2i(95, 95) +render_target_update_mode = 4 [node name="AnimatedSprite" type="AnimatedSprite2D" parent="Sprite3D/SubViewport"] unique_name_in_owner = true diff --git a/src/game/Game.cs b/src/game/Game.cs index 2f06eaf0..afa40227 100644 --- a/src/game/Game.cs +++ b/src/game/Game.cs @@ -5,6 +5,7 @@ using Chickensoft.AutoInject; using Chickensoft.GodotNodeInterfaces; using Chickensoft.Introspection; using Godot; +using System; public interface IGame : IProvide, IProvide, IProvide, INode3D { @@ -129,6 +130,13 @@ public partial class Game : Node3D, IGame Player.PauseButtonPressed += Player_PauseButtonPressed; GameRepo.PlayerData.Inventory.EquippedItem += Inventory_EquippedItem; + + GameEventDepot.EnemyDefeated += OnEnemyDefeated; + } + + private void OnEnemyDefeated(Vector3 vector, EnemyStatResource resource) + { + } private void Inventory_EquippedItem() diff --git a/src/game/GameEventDepot.cs b/src/game/GameEventDepot.cs index 4e925748..757ab600 100644 --- a/src/game/GameEventDepot.cs +++ b/src/game/GameEventDepot.cs @@ -1,4 +1,5 @@ -using System; +using Godot; +using System; namespace GameJamDungeon { @@ -37,8 +38,8 @@ namespace GameJamDungeon event Action? HealingItemConsumed; public void OnHealingItemConsumed(ConsumableItemStats item); - event Action? EnemyDefeated; - public void OnEnemyDefeated(EnemyStatResource enemyStatResource); + event Action? EnemyDefeated; + public void OnEnemyDefeated(Vector3 position, EnemyStatResource enemyStatResource); } public class GameEventDepot : IGameEventDepot @@ -57,7 +58,7 @@ namespace GameJamDungeon public event Action? UnequippedItem; public event Action? InventorySorted; public event Action? HealingItemConsumed; - public event Action? EnemyDefeated; + public event Action? EnemyDefeated; public void OnOverworldEntered() => OverworldEntered?.Invoke(); public void OnDungeonAThemeAreaEntered() => DungeonAThemeAreaEntered?.Invoke(); @@ -73,7 +74,7 @@ namespace GameJamDungeon public void OnInventorySorted() => InventorySorted?.Invoke(); public void OnHealingItemConsumed(ConsumableItemStats item) => HealingItemConsumed?.Invoke(item); - public void OnEnemyDefeated(EnemyStatResource enemyStatResource) => EnemyDefeated?.Invoke(enemyStatResource); + public void OnEnemyDefeated(Vector3 position, EnemyStatResource enemyStatResource) => EnemyDefeated?.Invoke(position, enemyStatResource); public void Dispose() { diff --git a/src/items/PickupItem.gdshader b/src/items/PickupItem.gdshader new file mode 100644 index 00000000..40257d24 --- /dev/null +++ b/src/items/PickupItem.gdshader @@ -0,0 +1,16 @@ +shader_type spatial; +render_mode unshaded, depth_draw_never; + +uniform vec4 shine_color : source_color = vec4( 1.0, 1.0, 1.0, 1.0 ); +uniform float cycle_interval : hint_range(0.5, 5.0) = 1.0; +uniform float shine_speed : hint_range(1.0, 5.0) = 3.0; +uniform float shine_width : hint_range(1.0, 100.0) = 3.0; + +void fragment( ) +{ + vec3 vertex = ( INV_VIEW_MATRIX * vec4( VERTEX, 1.0 ) ).xyz; + float width = shine_width * 0.001 * cycle_interval; + float frequency = floor( sin( vertex.z * cycle_interval + TIME * shine_speed * cycle_interval ) + width ); + ALBEDO = shine_color.rgb; + ALPHA = clamp( ( 1.0 - dot( NORMAL, VIEW ) ) * frequency * shine_color.a, 0.0, 1.0 ); +} \ No newline at end of file diff --git a/src/items/armor/Armor.tscn b/src/items/armor/Armor.tscn index d097d856..5f960176 100644 --- a/src/items/armor/Armor.tscn +++ b/src/items/armor/Armor.tscn @@ -16,7 +16,7 @@ collision_mask = 4 [node name="Sprite" type="Sprite3D" parent="Pickup"] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0322805, 0) -pixel_size = 0.0003 +pixel_size = 0.0006 billboard = 2 double_sided = false alpha_cut = 1 diff --git a/src/items/armor/armor.png b/src/items/armor/armor.png deleted file mode 100644 index 76ad0b9b..00000000 Binary files a/src/items/armor/armor.png and /dev/null differ diff --git a/src/items/consumable/ConsumableItem.tscn b/src/items/consumable/ConsumableItem.tscn index 3975275b..3c12697b 100644 --- a/src/items/consumable/ConsumableItem.tscn +++ b/src/items/consumable/ConsumableItem.tscn @@ -28,7 +28,7 @@ collision_mask = 4 [node name="Sprite" type="Sprite3D" parent="Pickup"] unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0322805, 0) -pixel_size = 0.001 +pixel_size = 0.002 billboard = 2 double_sided = false alpha_cut = 1 diff --git a/src/items/consumable/resources/AmritShard.tres b/src/items/consumable/resources/AmritShard.tres new file mode 100644 index 00000000..34ef998f --- /dev/null +++ b/src/items/consumable/resources/AmritShard.tres @@ -0,0 +1,16 @@ +[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://d0cxrf0nldona"] + +[ext_resource type="Texture2D" uid="uid://ttmu3vttq8yo" path="res://src/items/consumable/textures/amrit shard.PNG" id="1_f1n30"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_riwik"] + +[resource] +script = ExtResource("2_riwik") +HealHPAmount = 60 +RaiseHPAmount = 16 +HealVTAmount = 0 +RaiseVTAmount = 0 +Name = "Amrit Shard" +Description = "A droplet of the heavenly elixir, frozen in time. +Restores 60 HP. If HP full, raises MAX HP by 16." +Texture = ExtResource("1_f1n30") +SpawnRate = 0.5 diff --git a/src/items/consumable/resources/PastSelfRemnant.tres b/src/items/consumable/resources/PastSelfRemnant.tres new file mode 100644 index 00000000..5d533d93 --- /dev/null +++ b/src/items/consumable/resources/PastSelfRemnant.tres @@ -0,0 +1,16 @@ +[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://dns281deffo6q"] + +[ext_resource type="Texture2D" uid="uid://bg47n2tmintm0" path="res://src/items/consumable/textures/past self remnant.PNG" id="1_rc8t1"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_e61q8"] + +[resource] +script = ExtResource("2_e61q8") +HealHPAmount = 30 +RaiseHPAmount = 8 +HealVTAmount = 0 +RaiseVTAmount = 0 +Name = "Ydunic Shard" +Description = "A fragment of the divine fruit, frozen in time. +Restores 30 HP. If HP full, raises MAX HP by 8." +Texture = ExtResource("1_rc8t1") +SpawnRate = 0.5 diff --git a/src/items/consumable/resources/PastSelfSpirit.tres b/src/items/consumable/resources/PastSelfSpirit.tres new file mode 100644 index 00000000..86806fcf --- /dev/null +++ b/src/items/consumable/resources/PastSelfSpirit.tres @@ -0,0 +1,15 @@ +[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://bnec53frgyue8"] + +[ext_resource type="Texture2D" uid="uid://cj0x1u7rknrvy" path="res://src/items/consumable/textures/past self spirit.PNG" id="1_jx43p"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_wmtl1"] + +[resource] +script = ExtResource("2_wmtl1") +HealHPAmount = 0 +RaiseHPAmount = 0 +HealVTAmount = 1000 +RaiseVTAmount = 25 +Name = "Past Self's Spirit" +Description = "Restores all VT. If VT full, raises MAX VT by 20." +Texture = ExtResource("1_jx43p") +SpawnRate = 0.5 diff --git a/src/items/consumable/resources/SunaFragment.tres b/src/items/consumable/resources/SunaFragment.tres new file mode 100644 index 00000000..1f315c26 --- /dev/null +++ b/src/items/consumable/resources/SunaFragment.tres @@ -0,0 +1,16 @@ +[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://ypw2yg10430p"] + +[ext_resource type="Texture2D" uid="uid://dbl5v5i1s3m2u" path="res://src/items/consumable/textures/stelo fragment.PNG" id="1_2qtta"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_41hue"] + +[resource] +script = ExtResource("2_41hue") +HealHPAmount = 0 +RaiseHPAmount = 0 +HealVTAmount = 60 +RaiseVTAmount = 20 +Name = "Suna Fragment" +Description = "A large gathered piece of the former heavens. +Restores 30 VT. If VT full, raises MAX VT by 10." +Texture = ExtResource("1_2qtta") +SpawnRate = 0.5 diff --git a/src/items/consumable/resources/YdunicShard.tres b/src/items/consumable/resources/YdunicShard.tres new file mode 100644 index 00000000..4bc13e73 --- /dev/null +++ b/src/items/consumable/resources/YdunicShard.tres @@ -0,0 +1,15 @@ +[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://lu0ddu3538p6"] + +[ext_resource type="Texture2D" uid="uid://dw06kkltgk3sv" path="res://src/items/consumable/textures/ydunic fragment.PNG" id="1_4llax"] +[ext_resource type="Script" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_q4pyq"] + +[resource] +script = ExtResource("2_q4pyq") +HealHPAmount = 1000 +RaiseHPAmount = 25 +HealVTAmount = 0 +RaiseVTAmount = 0 +Name = "Ydunic Shard" +Description = "Restores all HP. If HP full, raises MAX HP by 8." +Texture = ExtResource("1_4llax") +SpawnRate = 0.5 diff --git a/src/items/consumable/textures/amrit shard.PNG b/src/items/consumable/textures/amrit shard.PNG new file mode 100644 index 00000000..be54371f Binary files /dev/null and b/src/items/consumable/textures/amrit shard.PNG differ diff --git a/src/items/armor/armor.png.import b/src/items/consumable/textures/amrit shard.PNG.import similarity index 57% rename from src/items/armor/armor.png.import rename to src/items/consumable/textures/amrit shard.PNG.import index ac60b3ff..b9ea91ec 100644 --- a/src/items/armor/armor.png.import +++ b/src/items/consumable/textures/amrit shard.PNG.import @@ -2,27 +2,26 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cgoubcl86pib4" -path.s3tc="res://.godot/imported/armor.png-09542d6705cb16e2f3946b1b9613fb06.s3tc.ctex" +uid="uid://ttmu3vttq8yo" +path="res://.godot/imported/amrit shard.PNG-23a55a1bb7d06a5be7415aa697551420.ctex" metadata={ -"imported_formats": ["s3tc_bptc"], -"vram_texture": true +"vram_texture": false } [deps] -source_file="res://src/items/armor/armor.png" -dest_files=["res://.godot/imported/armor.png-09542d6705cb16e2f3946b1b9613fb06.s3tc.ctex"] +source_file="res://src/items/consumable/textures/amrit shard.PNG" +dest_files=["res://.godot/imported/amrit shard.PNG-23a55a1bb7d06a5be7415aa697551420.ctex"] [params] -compress/mode=2 +compress/mode=0 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=true +mipmaps/generate=false mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" diff --git a/src/items/consumable/textures/past self remnant.PNG b/src/items/consumable/textures/past self remnant.PNG new file mode 100644 index 00000000..a1470e08 Binary files /dev/null and b/src/items/consumable/textures/past self remnant.PNG differ diff --git a/src/items/consumable/textures/past self remnant.PNG.import b/src/items/consumable/textures/past self remnant.PNG.import new file mode 100644 index 00000000..793226c8 --- /dev/null +++ b/src/items/consumable/textures/past self remnant.PNG.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bg47n2tmintm0" +path="res://.godot/imported/past self remnant.PNG-ea5a4a4ccf2107f35ad1f867c61e12ee.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/items/consumable/textures/past self remnant.PNG" +dest_files=["res://.godot/imported/past self remnant.PNG-ea5a4a4ccf2107f35ad1f867c61e12ee.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/src/items/consumable/textures/past self spirit.PNG b/src/items/consumable/textures/past self spirit.PNG new file mode 100644 index 00000000..4d648225 Binary files /dev/null and b/src/items/consumable/textures/past self spirit.PNG differ diff --git a/src/items/consumable/textures/past self spirit.PNG.import b/src/items/consumable/textures/past self spirit.PNG.import new file mode 100644 index 00000000..b4ea7be4 --- /dev/null +++ b/src/items/consumable/textures/past self spirit.PNG.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cj0x1u7rknrvy" +path="res://.godot/imported/past self spirit.PNG-75c61955a4c45cf77c3086abe5fb7c7f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/items/consumable/textures/past self spirit.PNG" +dest_files=["res://.godot/imported/past self spirit.PNG-75c61955a4c45cf77c3086abe5fb7c7f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/src/items/consumable/textures/suna fragment.PNG b/src/items/consumable/textures/suna fragment.PNG new file mode 100644 index 00000000..caba7e26 Binary files /dev/null and b/src/items/consumable/textures/suna fragment.PNG differ diff --git a/src/items/consumable/textures/suna fragment.PNG.import b/src/items/consumable/textures/suna fragment.PNG.import new file mode 100644 index 00000000..fd83b66d --- /dev/null +++ b/src/items/consumable/textures/suna fragment.PNG.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bqyjjdgub6iem" +path="res://.godot/imported/suna fragment.PNG-549d5b874b83189bde36ace3c7ae46c7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/items/consumable/textures/suna fragment.PNG" +dest_files=["res://.godot/imported/suna fragment.PNG-549d5b874b83189bde36ace3c7ae46c7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/src/items/consumable/textures/ydunic fragment.PNG b/src/items/consumable/textures/ydunic fragment.PNG new file mode 100644 index 00000000..e845d491 Binary files /dev/null and b/src/items/consumable/textures/ydunic fragment.PNG differ diff --git a/src/items/consumable/textures/ydunic fragment.PNG.import b/src/items/consumable/textures/ydunic fragment.PNG.import new file mode 100644 index 00000000..e069745a --- /dev/null +++ b/src/items/consumable/textures/ydunic fragment.PNG.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dw06kkltgk3sv" +path="res://.godot/imported/ydunic fragment.PNG-fc040e7fba1c332c8770eb9e76f5206b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/items/consumable/textures/ydunic fragment.PNG" +dest_files=["res://.godot/imported/ydunic fragment.PNG-fc040e7fba1c332c8770eb9e76f5206b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/src/items/throwable/ThrowableItem.tscn b/src/items/throwable/ThrowableItem.tscn index 60ef7869..e00444b2 100644 --- a/src/items/throwable/ThrowableItem.tscn +++ b/src/items/throwable/ThrowableItem.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=3 uid="uid://1fl6s352e2ej"] +[gd_scene load_steps=6 format=3 uid="uid://1fl6s352e2ej"] [ext_resource type="Script" path="res://src/items/throwable/ThrowableItem.cs" id="1_nac2l"] [ext_resource type="Resource" uid="uid://bph8c6by4s047" path="res://src/items/throwable/resources/GeomanticDice.tres" id="2_pefeg"] @@ -10,57 +10,19 @@ size = Vector3(0.371643, 0.289612, 0.286743) [sub_resource type="BoxShape3D" id="BoxShape3D_03cqg"] size = Vector3(0.778381, 0.929947, 0.731567) -[sub_resource type="Animation" id="Animation_d22ed"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Hitbox:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Vector3(0, 1, 0)] -} - -[sub_resource type="Animation" id="Animation_7gvmx"] -resource_name = "throw" -length = 2.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Hitbox:position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 2), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [Vector3(0, 1, 0), Vector3(0, 1, -15)] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_qfght"] -_data = { -"RESET": SubResource("Animation_d22ed"), -"throw": SubResource("Animation_7gvmx") -} - [node name="ThrowableItem" type="Node3D"] script = ExtResource("1_nac2l") ThrowableItemInfo = ExtResource("2_pefeg") [node name="Hitbox" type="Area3D" parent="."] unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) collision_layer = 16 collision_mask = 16 script = ExtResource("3_qpunu") [node name="Sprite" type="Sprite3D" parent="Hitbox"] unique_name_in_owner = true -pixel_size = 0.0005 +pixel_size = 0.001 billboard = 2 [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] @@ -74,9 +36,3 @@ collision_mask = 4 [node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox/Pickup"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481) shape = SubResource("BoxShape3D_03cqg") - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -unique_name_in_owner = true -libraries = { -"": SubResource("AnimationLibrary_qfght") -} diff --git a/src/items/weapons/Weapon.tscn b/src/items/weapons/Weapon.tscn index 5c8f64cf..7313cf22 100644 --- a/src/items/weapons/Weapon.tscn +++ b/src/items/weapons/Weapon.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://db206brufi83s"] +[gd_scene load_steps=4 format=3 uid="uid://db206brufi83s"] [ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_7pkyf"] +[ext_resource type="Texture2D" uid="uid://cvtcsi2sagfwm" path="res://src/items/weapons/textures/SWAN SWORD.PNG" id="2_qxo05"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wll7p"] radius = 0.470016 @@ -15,13 +16,13 @@ collision_mask = 4 [node name="Sprite" type="Sprite3D" parent="Pickup"] unique_name_in_owner = true -pixel_size = 0.0003 +transform = Transform3D(0.0978955, 0, 0.995197, 0, 1, 0, -0.995197, 0, 0.0978955, 0, 0.271026, 0) +pixel_size = 0.0006 billboard = 2 double_sided = false -alpha_cut = 1 -alpha_scissor_threshold = 0.511 alpha_antialiasing_mode = 1 texture_filter = 0 +texture = ExtResource("2_qxo05") [node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"] shape = SubResource("CapsuleShape3D_wll7p") diff --git a/src/player/Player.cs b/src/player/Player.cs index 01df739a..d150afa8 100644 --- a/src/player/Player.cs +++ b/src/player/Player.cs @@ -67,6 +67,8 @@ namespace GameJamDungeon private bool flipAttack = false; + private float _healthTimerWaitTime = 3.0f; + public void Initialize() { AnimationPlayer.AnimationFinished += OnAnimationFinished; @@ -106,6 +108,8 @@ namespace GameJamDungeon PlayerData.Inventory.EquippedAccessory.Sync += EquippedAccessory_Sync; PlayerData.CurrentHP.Sync += CurrentHP_Sync; + + HealthTimer.WaitTime = _healthTimerWaitTime; } public void OnResolved() @@ -251,6 +255,8 @@ namespace GameJamDungeon PlayerData.SetMaximumHP(PlayerData.MaximumHP.Value + equippedItem.AccessoryStats.MaxHPUp); PlayerData.SetMaximumVT(PlayerData.MaximumVT.Value + equippedItem.AccessoryStats.MaxVTUp); PlayerData.SetLuck(PlayerData.Luck.Value + equippedItem.AccessoryStats.LUCKUp); + if (equippedItem.AccessoryStats.AccessoryTags.Contains(AccessoryTag.HalfVTConsumption)) + HealthTimer.WaitTime = _healthTimerWaitTime * 2; } private void Inventory_AccessoryUnequipped(AccessoryStats unequippedAccessory) @@ -258,6 +264,8 @@ namespace GameJamDungeon PlayerData.SetMaximumHP(PlayerData.MaximumHP.Value - unequippedAccessory.MaxHPUp); PlayerData.SetMaximumVT(PlayerData.MaximumVT.Value - unequippedAccessory.MaxVTUp); PlayerData.SetLuck(PlayerData.Luck.Value - unequippedAccessory.LUCKUp); + if (unequippedAccessory.AccessoryTags.Contains(AccessoryTag.HalfVTConsumption)) + HealthTimer.WaitTime = _healthTimerWaitTime; } private void OnEnemyHitBoxEntered(Area3D area) diff --git a/src/vfx/shaders/2DPostProcessing.gdshader b/src/vfx/shaders/2DPostProcessing.gdshader new file mode 100644 index 00000000..2f5acaff --- /dev/null +++ b/src/vfx/shaders/2DPostProcessing.gdshader @@ -0,0 +1,72 @@ +shader_type canvas_item; + +render_mode unshaded; + +#define MAXCOLORS 16 + +uniform bool enabled = true; +uniform bool dithering = true; +uniform int colors : hint_range(1, MAXCOLORS) = 12; +uniform int dither_size: hint_range(1, 8) = 1; + +float dithering_pattern(ivec2 fragcoord) { + const float pattern[] = { + 0.00, 0.50, 0.10, 0.65, + 0.75, 0.25, 0.90, 0.35, + 0.20, 0.70, 0.05, 0.50, + 0.95, 0.40, 0.80, 0.30 + }; + + int x = fragcoord.x % 4; + int y = fragcoord.y % 4; + + return pattern[y * 4 + x]; +} + +float reduce_color(float raw, float dither, int depth) { + float div = 1.0 / float(depth); + float val = 0.0; + int i = 0; + + while (i <= MAXCOLORS) + { + if (raw > div * (float(i + 1))) { + i = i + 1; + continue; + } + + if (raw * float(depth) - float(i) <= dither * 0.999) + { + val = div * float(i); + } + else + { + val = div * float(i + 1); + } + return val; + + i = i+1; + } + + return val; +} + +void fragment() { + vec4 raw = texture(TEXTURE, SCREEN_UV); + ivec2 uv = ivec2(FRAGCOORD.xy / float(dither_size)); + + if (enabled == true){ + float dithering_value = 1.0; + if (dithering) + { + dithering_value = dithering_pattern(uv); + } + + COLOR.r = reduce_color(raw.r, (dithering_value - 0.5) * dithering_value + 0.5, colors - 1); + COLOR.g = reduce_color(raw.g, (dithering_value - 0.5) * dithering_value + 0.5, colors - 1); + COLOR.b = reduce_color(raw.b, (dithering_value - 0.5) * dithering_value + 0.5, colors - 1); + + } else { + COLOR.rgb = raw.rgb; + } +} \ No newline at end of file diff --git a/src/vfx/shaders/PixelMelt.gdshader b/src/vfx/shaders/PixelMelt.gdshader index d5183d0b..55f8d5e9 100644 --- a/src/vfx/shaders/PixelMelt.gdshader +++ b/src/vfx/shaders/PixelMelt.gdshader @@ -12,15 +12,15 @@ float psuedo_rand(float x) { void fragment() { vec2 uv = UV; - + // Move pixels near the top faster uv.y -= progress / UV.y; - - // Created jagged edges for each pixel on the x-axis + + // Created jagged edges for each pixel on the x-axis uv.y -= progress * meltiness * psuedo_rand(UV.x - mod(UV.x, TEXTURE_PIXEL_SIZE.x)); - + COLOR = texture(TEXTURE, uv); - + // "delete" pixels out of range if (uv.y <= 0.0) { COLOR.a = 0.0; diff --git a/src/vfx/shaders/PostProcessing.gdshader b/src/vfx/shaders/PostProcessing.gdshader new file mode 100644 index 00000000..36ac52f1 --- /dev/null +++ b/src/vfx/shaders/PostProcessing.gdshader @@ -0,0 +1,44 @@ +shader_type spatial; +render_mode unshaded, shadows_disabled, depth_test_disabled, depth_draw_never; +uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap; + +uniform int color_depth : hint_range(1, 8) = 5; +uniform bool dithering = true; +uniform int resolution_scale = 4; + +int dithering_pattern(ivec2 fragcoord) { + const int pattern[] = { + -4, +0, -3, +1, + +2, -2, +3, -1, + -3, +1, -4, +0, + +3, -1, +2, -2 + }; + + int x = fragcoord.x % 4; + int y = fragcoord.y % 4; + + return pattern[y * 4 + x]; +} + +void vertex() { + POSITION = vec4(VERTEX.xy, 1.0, 1.0); +} + +void fragment() { + ivec2 uv = ivec2(FRAGCOORD.xy / float(resolution_scale)); + vec3 color = texelFetch(SCREEN_TEXTURE, uv * resolution_scale, 0).rgb; + + // Convert from [0.0, 1.0] range to [0, 255] range + ivec3 c = ivec3(round(color * 255.0)); + + // Apply the dithering pattern + if (dithering) { + c += ivec3(dithering_pattern(uv)); + } + + // Truncate from 8 bits to color_depth bits + c >>= (8 - color_depth); + + // Convert back to [0.0, 1.0] range + ALBEDO = vec3(c) / float(1 << color_depth); +} \ No newline at end of file