Update items
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -103,10 +103,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
||||
})
|
||||
.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<IEnemyLogic>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ namespace GameJamDungeon
|
||||
|
||||
[Export]
|
||||
public double FerrumDamageBonus { get; set; }
|
||||
|
||||
[Export]
|
||||
public float DropsSoulGemChance { get; set; } = 0.75f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,6 +5,7 @@ using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, IProvide<IGameEventDepot>, IProvide<IGame>, 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()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
namespace GameJamDungeon
|
||||
{
|
||||
@@ -37,8 +38,8 @@ namespace GameJamDungeon
|
||||
event Action<ConsumableItemStats>? HealingItemConsumed;
|
||||
public void OnHealingItemConsumed(ConsumableItemStats item);
|
||||
|
||||
event Action<EnemyStatResource>? EnemyDefeated;
|
||||
public void OnEnemyDefeated(EnemyStatResource enemyStatResource);
|
||||
event Action<Vector3, EnemyStatResource>? 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<ConsumableItemStats>? HealingItemConsumed;
|
||||
public event Action<EnemyStatResource>? EnemyDefeated;
|
||||
public event Action<Vector3, EnemyStatResource>? 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()
|
||||
{
|
||||
|
||||
16
src/items/PickupItem.gdshader
Normal file
16
src/items/PickupItem.gdshader
Normal file
@@ -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 );
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.9 KiB |
@@ -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
|
||||
|
||||
16
src/items/consumable/resources/AmritShard.tres
Normal file
16
src/items/consumable/resources/AmritShard.tres
Normal file
@@ -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
|
||||
16
src/items/consumable/resources/PastSelfRemnant.tres
Normal file
16
src/items/consumable/resources/PastSelfRemnant.tres
Normal file
@@ -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
|
||||
15
src/items/consumable/resources/PastSelfSpirit.tres
Normal file
15
src/items/consumable/resources/PastSelfSpirit.tres
Normal file
@@ -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
|
||||
16
src/items/consumable/resources/SunaFragment.tres
Normal file
16
src/items/consumable/resources/SunaFragment.tres
Normal file
@@ -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
|
||||
15
src/items/consumable/resources/YdunicShard.tres
Normal file
15
src/items/consumable/resources/YdunicShard.tres
Normal file
@@ -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
|
||||
BIN
src/items/consumable/textures/amrit shard.PNG
Normal file
BIN
src/items/consumable/textures/amrit shard.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
@@ -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=""
|
||||
BIN
src/items/consumable/textures/past self remnant.PNG
Normal file
BIN
src/items/consumable/textures/past self remnant.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
34
src/items/consumable/textures/past self remnant.PNG.import
Normal file
34
src/items/consumable/textures/past self remnant.PNG.import
Normal file
@@ -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
|
||||
BIN
src/items/consumable/textures/past self spirit.PNG
Normal file
BIN
src/items/consumable/textures/past self spirit.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
34
src/items/consumable/textures/past self spirit.PNG.import
Normal file
34
src/items/consumable/textures/past self spirit.PNG.import
Normal file
@@ -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
|
||||
BIN
src/items/consumable/textures/suna fragment.PNG
Normal file
BIN
src/items/consumable/textures/suna fragment.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
34
src/items/consumable/textures/suna fragment.PNG.import
Normal file
34
src/items/consumable/textures/suna fragment.PNG.import
Normal file
@@ -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
|
||||
BIN
src/items/consumable/textures/ydunic fragment.PNG
Normal file
BIN
src/items/consumable/textures/ydunic fragment.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
34
src/items/consumable/textures/ydunic fragment.PNG.import
Normal file
34
src/items/consumable/textures/ydunic fragment.PNG.import
Normal file
@@ -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
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
72
src/vfx/shaders/2DPostProcessing.gdshader
Normal file
72
src/vfx/shaders/2DPostProcessing.gdshader
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
44
src/vfx/shaders/PostProcessing.gdshader
Normal file
44
src/vfx/shaders/PostProcessing.gdshader
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user