Restructure Sigil implementation, add all sigils to debug menu
This commit is contained in:
@@ -2,25 +2,25 @@
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Ma;
|
||||
public interface ISigil : IEntityComponent
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public interface ISigil
|
||||
{
|
||||
public double AttackModifier { get; }
|
||||
|
||||
[Export]
|
||||
public double DefenseModifier { get; set; }
|
||||
public double DefenseModifier { get; }
|
||||
|
||||
[Export]
|
||||
public int HealthModifier { get; set; }
|
||||
public int HealthModifier { get; }
|
||||
|
||||
[Export]
|
||||
public int VTModifier { get; set; }
|
||||
public int VTModifier { get; }
|
||||
|
||||
[Export]
|
||||
public double LuckModifier { get; set; }
|
||||
public double LuckModifier { get; }
|
||||
|
||||
[Export]
|
||||
public double ElementalModifier { get; set; }
|
||||
public double ElementalModifier { get; }
|
||||
|
||||
[Export]
|
||||
public ElementType ElementType { get; set; }
|
||||
public ElementType ElementType { get; }
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Godot;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Zennysoft.Game.Ma;
|
||||
using Zennysoft.Ma;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
@@ -59,7 +60,7 @@ public partial class Sarco : Node3D
|
||||
|
||||
public async Task EquipAffinity()
|
||||
{
|
||||
_player.SetSigil(new Sigil() { ElementType = Affinity });
|
||||
_player.SetSigil(GetSigilByAffinity());
|
||||
}
|
||||
|
||||
public async Task ShowFlower()
|
||||
@@ -122,4 +123,24 @@ public partial class Sarco : Node3D
|
||||
if (Affinity == ElementType.Shura)
|
||||
_game.SarcoData.ShuraSarcoAcquired = true;
|
||||
}
|
||||
|
||||
private ISigil GetSigilByAffinity()
|
||||
{
|
||||
if (Affinity == ElementType.Aeolic)
|
||||
return new AeolicSigil();
|
||||
if (Affinity == ElementType.Igneous)
|
||||
return new IgneousSigil();
|
||||
if (Affinity == ElementType.Telluric)
|
||||
return new TelluricSigil();
|
||||
if (Affinity == ElementType.Hydric)
|
||||
return new HydricSigil();
|
||||
if (Affinity == ElementType.Ferrum)
|
||||
return new FerrumSigil();
|
||||
if (Affinity == ElementType.Sankta)
|
||||
return new SanktaSigil();
|
||||
if (Affinity == ElementType.Shura)
|
||||
return new ShuraSigil();
|
||||
|
||||
return new NoneSigil();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,21 +10,6 @@
|
||||
height = 10.272
|
||||
radius = 2.56201
|
||||
|
||||
[sub_resource type="Animation" id="Animation_c6ny3"]
|
||||
resource_name = "fade_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("FLOWER:transparency")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [1.0, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_bw4xo"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
@@ -40,6 +25,21 @@ tracks/0/keys = {
|
||||
"values": [1.0]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_c6ny3"]
|
||||
resource_name = "fade_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("FLOWER:transparency")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [1.0, 0.0]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_21qtc"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_bw4xo"),
|
||||
|
||||
@@ -130,9 +130,23 @@ focus_neighbor_bottom = NodePath("../LoadNextFloorButton")
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_1ctjd")
|
||||
flat = true
|
||||
allow_reselect = true
|
||||
item_count = 1
|
||||
item_count = 8
|
||||
popup/item_0/text = "None"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Aeolic"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Igneous"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "Telluric"
|
||||
popup/item_3/id = 3
|
||||
popup/item_4/text = "Hydric"
|
||||
popup/item_4/id = 4
|
||||
popup/item_5/text = "Ferrum"
|
||||
popup/item_5/id = 5
|
||||
popup/item_6/text = "Sankta"
|
||||
popup/item_6/id = 6
|
||||
popup/item_7/text = "Shura"
|
||||
popup/item_7/id = 7
|
||||
|
||||
[node name="LoadNextFloorButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer/VFlowContainer"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
@@ -344,7 +344,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
if (AutoRevive)
|
||||
return;
|
||||
|
||||
SetSigil(new Sigil() { ElementType = ElementType.None });
|
||||
SetSigil(new NoneSigil());
|
||||
|
||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
using Godot;
|
||||
using Zennysoft.Ma;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class Sigil : Resource, ISigil
|
||||
{
|
||||
[Export]
|
||||
public double AttackModifier { get; set; } = 1f;
|
||||
|
||||
[Export]
|
||||
public double DefenseModifier { get; set; } = 1f;
|
||||
|
||||
[Export]
|
||||
public int HealthModifier { get; set; }
|
||||
|
||||
[Export]
|
||||
public int VTModifier { get; set; }
|
||||
|
||||
[Export]
|
||||
public double LuckModifier { get; set; }
|
||||
|
||||
[Export]
|
||||
public double ElementalModifier { get; set; } = 1;
|
||||
|
||||
[Export]
|
||||
public ElementType ElementType { get; set; } = ElementType.None;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
AttackModifier = 1;
|
||||
DefenseModifier = 1;
|
||||
HealthModifier = 0;
|
||||
VTModifier = 0;
|
||||
LuckModifier = 0;
|
||||
ElementalModifier = 1;
|
||||
ElementType = ElementType.None;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Zennysoft.Ma;
|
||||
using Godot;
|
||||
using Zennysoft.Ma;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public class SigilComponent : ISigilComponent
|
||||
{
|
||||
@@ -6,6 +8,94 @@ public class SigilComponent : ISigilComponent
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Sigil = new Sigil();
|
||||
Sigil = new NoneSigil();
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NoneSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.None;
|
||||
}
|
||||
|
||||
public partial class AeolicSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Aeolic;
|
||||
}
|
||||
|
||||
public partial class IgneousSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Igneous;
|
||||
}
|
||||
|
||||
public partial class TelluricSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Telluric;
|
||||
}
|
||||
|
||||
public partial class HydricSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Hydric;
|
||||
}
|
||||
|
||||
public partial class FerrumSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Ferrum;
|
||||
}
|
||||
|
||||
public partial class SanktaSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Sankta;
|
||||
}
|
||||
|
||||
public partial class ShuraSigil : ISigil
|
||||
{
|
||||
public double AttackModifier { get; set; }
|
||||
public double DefenseModifier { get; set; }
|
||||
public int HealthModifier { get; set; }
|
||||
public int VTModifier { get; set; }
|
||||
public double LuckModifier { get; set; }
|
||||
public double ElementalModifier { get; set; }
|
||||
public ElementType ElementType { get; } = ElementType.Shura;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Zennysoft.Ma;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
@@ -83,9 +84,6 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
||||
FloorSelectDropDown.AddItem(folder + "/" + file);
|
||||
}
|
||||
|
||||
var sigils = DirAccess.GetFilesAt(_sigilFilePath).Where(x => x.EndsWith(".tres"));
|
||||
foreach (var sigil in sigils)
|
||||
SigilDropDown.AddItem(sigil);
|
||||
SigilDropDown.Select(0);
|
||||
|
||||
FloorSelectDropDown.AllowReselect = true;
|
||||
@@ -104,15 +102,23 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
||||
private void SigilDropDown_ItemSelected(long index)
|
||||
{
|
||||
var sigilName = SigilDropDown.GetItemText((int)index);
|
||||
|
||||
if (sigilName == "Aeolic")
|
||||
_player.SetSigil(new AeolicSigil());
|
||||
if (sigilName == "Igneous")
|
||||
_player.SetSigil(new IgneousSigil());
|
||||
if (sigilName == "Telluric")
|
||||
_player.SetSigil(new TelluricSigil());
|
||||
if (sigilName == "Hydric")
|
||||
_player.SetSigil(new HydricSigil());
|
||||
if (sigilName == "Ferrum")
|
||||
_player.SetSigil(new FerrumSigil());
|
||||
if (sigilName == "Sankta")
|
||||
_player.SetSigil(new SanktaSigil());
|
||||
if (sigilName == "Shura")
|
||||
_player.SetSigil(new ShuraSigil());
|
||||
if (sigilName == "None")
|
||||
{
|
||||
_player.SigilComponent.Reset();
|
||||
}
|
||||
else
|
||||
{
|
||||
var sigilComponent = ResourceLoader.Load<Sigil>(_sigilFilePath + "/" + sigilName);
|
||||
_player.SetSigil(sigilComponent);
|
||||
}
|
||||
_player.SetSigil(new NoneSigil());
|
||||
}
|
||||
|
||||
private void DebugInfoCheckbox_Pressed() => _game.ShowDebugInfo(DebugInfoCheckbox.ButtonPressed);
|
||||
|
||||
Reference in New Issue
Block a user