Add item spawn menu

Fix game over bug
Start adding more implementation for jewels
This commit is contained in:
2026-02-11 15:25:20 -08:00
parent 8ce38c3c13
commit 230b47061d
32 changed files with 1215 additions and 358 deletions

View File

@@ -25,7 +25,7 @@ namespace Zennysoft.Ma.Adapter
int incomingDamage,
double elementalResistance)
{
var result = incomingDamage - (int)(incomingDamage * elementalResistance);
var result = incomingDamage - (int)(incomingDamage * (elementalResistance / 100));
return result;
}
}

View File

@@ -12,6 +12,8 @@ public interface IExperiencePointsComponent : IEntityComponent
public IAutoProp<int> Level { get; }
public void ModifyExpGainRate(double newRate);
public void Gain(int baseExpGain);
public void LevelUp();

View File

@@ -0,0 +1,9 @@
public class Augment
{
public JewelTags AugmentTag;
public Augment(JewelTags tag)
{
AugmentTag = tag;
}
}

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections;
using Chickensoft.Introspection;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Ma.Adapter.Entity;
@@ -22,6 +21,8 @@ public abstract partial class EquipableItem : InventoryItem
[Save("equipment_is_glued")]
public bool Glued { get; set; }
public virtual Augment? Augment { get; set; }
[Save("bonus_elemental_resist_stats")]
public virtual ElementalResistanceSet ElementalResistance { get; } = new ElementalResistanceSet(0, 0, 0, 0, 0, 0, 0);
}

View File

@@ -0,0 +1,19 @@
public enum JewelTags
{
None,
AeolicElement,
IncreaseHPRecovery,
HastenVT,
LowerEXPGain,
Glue,
ItemRescue,
HydricElement,
IgneousElement,
IncreaseEXPGain,
LowerHPRecovery,
SlowVTReduction,
AutoIdentifyAllItems,
ReviveUserOnce,
TelluricElement
}

View File

@@ -110,14 +110,14 @@ public class GameRepo : IGameRepo
{
AnnounceMessageInInventory("Experience points temporarily doubled.");
DoubleExpTimeStart?.Invoke(lengthOfEffect.Seconds);
ExpRate = 2;
ExpRate *= 2;
}
public void EndDoubleExp()
{
AnnounceMessageOnMainScreen("Experience points effect wore off.");
DoubleExpTimeEnd?.Invoke();
ExpRate = 1;
ExpRate /= 2;
}
public void AnnounceMessageOnMainScreen(string message)

View File

@@ -8,13 +8,20 @@ public partial class GameState
public partial record State
{
[Meta, LogicBlock(typeof(State), Diagram = true)]
public partial record GameOver : State, IGet<Input.NewGame>
public partial record GameOver : InGame, IGet<Input.NewGame>, IGet<Input.ExitGame>
{
public Transition On(in Input.NewGame input)
{
Output(new Output.InitializeGame());
return To<InGame>();
}
public Transition On(in Input.ExitGame input)
{
Output(new Output.ClosePauseScreen());
Output(new Output.ExitGame());
return To<State>();
}
}
}
}

View File

@@ -0,0 +1,7 @@
namespace Zennysoft.Ma.Adapter
{
public interface IAugmentItem
{
public JewelTags Augment { get; }
}
}

View File

@@ -14,6 +14,8 @@ public interface IInventory
public bool Sort(EquipableItem currentWeapon, EquipableItem currentArmor, EquipableItem currentAccessory, EquipableItem ammo);
public bool AtCapacity();
public event Action<string> BroadcastMessage;
public event Action InventoryChanged;
}

View File

@@ -26,6 +26,8 @@ public interface IPlayer : IKillable, ICharacterBody3D
public void PlayJumpScareAnimation();
//public void AugmentItem(IAugmentItem jewel, EquipableItem equipableItem);
public IInventory Inventory { get; }
public IHealthComponent HealthComponent { get; }