Compare commits

...

5 Commits

Author SHA1 Message Date
fa66ba24e2 Small inventory fixes 2026-02-15 02:58:10 -08:00
9c4c82af68 All items have an image 2026-02-15 02:56:26 -08:00
fe502debd1 Fix inventory sizes 2026-02-15 02:33:09 -08:00
33a58a2893 Fix box issue 2026-02-15 02:24:14 -08:00
69b25aacb9 Overhaul item and inventory and clean up bits and pieces 2026-02-15 01:19:27 -08:00
269 changed files with 4568 additions and 2436 deletions

View File

@@ -5,21 +5,21 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter;
public interface IEquipmentComponent : IEntityComponent
{
public IAutoProp<EquipableItem> EquippedWeapon { get; }
public IAutoProp<IWeapon> EquippedWeapon { get; }
public IAutoProp<EquipableItem> EquippedArmor { get; }
public IAutoProp<IArmor> EquippedArmor { get; }
public IAutoProp<EquipableItem> EquippedAccessory { get; }
public IAutoProp<IAccessory> EquippedAccessory { get; }
public IAutoProp<EquipableItem> EquippedAmmo { get; }
public IAutoProp<IEquipableItem> EquippedAmmo { get; }
public void Equip(EquipableItem equipable);
public void Equip(IEquipableItem equipable);
public void Unequip(EquipableItem equipable);
public void Unequip(IEquipableItem equipable);
public bool IsItemEquipped(InventoryItem item);
public bool IsItemEquipped(IEquipableItem item);
public void UpdateEquipment(EquipableItem equipable);
public void UpdateEquipment(IEquipableItem equipable);
public bool AugmentableEquipmentExists();
@@ -35,5 +35,5 @@ public interface IEquipmentComponent : IEntityComponent
public ElementalResistanceSet ElementalResistance { get; }
public event Action<EquipableItem> EquipmentChanged;
public event Action<IEquipableItem> EquipmentChanged;
}

View File

@@ -16,6 +16,8 @@ public interface IExperiencePointsComponent : IEntityComponent
public void Gain(int baseExpGain);
public void GainUnmodified(int flateRateExpGain);
public void LevelUp();
public event Action PlayerLevelUp;

View File

@@ -13,13 +13,6 @@ public class Augment
public IAugmentType AugmentType { get; set; }
}
public interface IAugmentType
{
void Apply();
void Remove();
}
public class HPRecoverySpeedAugment : IAugmentType
{
private readonly IPlayer _player;

View File

@@ -1,28 +0,0 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("equipable_item")]
public abstract partial class EquipableItem : InventoryItem
{
[Save("bonus_attack_stats")]
public virtual int BonusAttack { get; }
[Save("bonus_defense_stats")]
public virtual int BonusDefense { get; }
[Save("bonus_hp_stats")]
public virtual int BonusHP { get; }
[Save("bonus_vt_stats")]
public virtual int BonusVT { get; }
[Save("bonus_luck_stats")]
public virtual int BonusLuck { get; }
[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,6 @@
public interface IAugmentType
{
void Apply();
void Remove();
}

View File

@@ -1,26 +0,0 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("inventory_item")]
public abstract partial class InventoryItem : Node3D
{
[Save("inventory_item_id")]
public Guid ID => Guid.NewGuid();
[Save("inventory_item_name")]
public abstract string ItemName { get; }
[Save("inventory_item_description")]
public abstract string Description { get; }
[Save("inventory_item_spawn_rate")]
public abstract float SpawnRate { get; }
[Save("inventory_item_throw_damage")]
public abstract int ThrowDamage { get; }
[Save("inventory_item_throw_speed")]
public abstract float ThrowSpeed { get; }
[Save("inventory_item_tag")]
public abstract ItemTag ItemTag { get; }
public abstract Texture2D GetTexture();
}

View File

@@ -20,7 +20,7 @@ public interface IGameRepo : IDisposable
event Action? DoubleExpTimeEnd;
event Action<InventoryItem>? RemoveItemFromInventoryEvent;
event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
event Action? PlayerAttack;
@@ -28,9 +28,9 @@ public interface IGameRepo : IDisposable
event Action? PlayerAttackedEnemy;
event Action<EquipableItem>? EquippedItem;
event Action<IEquipableItem>? EquippedItem;
event Action<EquipableItem>? UnequippedItem;
event Action<IEquipableItem>? UnequippedItem;
event Action<IEnemy>? EnemyDied;
@@ -48,7 +48,7 @@ public interface IGameRepo : IDisposable
public void AnnounceMessageInInventory(string message);
public void RemoveItemFromInventory(InventoryItem item);
public void RemoveItemFromInventory(IBaseInventoryItem item);
public void OnPlayerAttack();
@@ -58,9 +58,9 @@ public interface IGameRepo : IDisposable
public void GameEnded();
public void OnEquippedItem(EquipableItem item);
public void OnEquippedItem(IEquipableItem item);
public void OnUnequippedItem(EquipableItem item);
public void OnUnequippedItem(IEquipableItem item);
public void OnEnemyDied(IEnemy enemy);
@@ -75,12 +75,12 @@ public class GameRepo : IGameRepo
public event Action<string>? AnnounceMessageInInventoryEvent;
public event Action<int>? DoubleExpTimeStart;
public event Action? DoubleExpTimeEnd;
public event Action<InventoryItem>? RemoveItemFromInventoryEvent;
public event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
public event Action? PlayerAttack;
public event Action? PlayerAttackedWall;
public event Action? PlayerAttackedEnemy;
public event Action<EquipableItem>? EquippedItem;
public event Action<EquipableItem>? UnequippedItem;
public event Action<IEquipableItem>? EquippedItem;
public event Action<IEquipableItem>? UnequippedItem;
public event Action<IEnemy>? EnemyDied;
public IAutoProp<bool> IsPaused => _isPaused;
private readonly AutoProp<bool> _isPaused;
@@ -131,7 +131,7 @@ public class GameRepo : IGameRepo
AnnounceMessageInInventoryEvent?.Invoke(message);
}
public void RemoveItemFromInventory(InventoryItem item)
public void RemoveItemFromInventory(IBaseInventoryItem item)
{
RemoveItemFromInventoryEvent?.Invoke(item);
}
@@ -151,9 +151,9 @@ public class GameRepo : IGameRepo
CloseInventoryEvent?.Invoke();
}
public void OnEquippedItem(EquipableItem item) => EquippedItem?.Invoke(item);
public void OnEquippedItem(IEquipableItem item) => EquippedItem?.Invoke(item);
public void OnUnequippedItem(EquipableItem item) => UnequippedItem?.Invoke(item);
public void OnUnequippedItem(IEquipableItem item) => UnequippedItem?.Invoke(item);
public void OnEnemyDied(IEnemy enemy) => EnemyDied?.Invoke(enemy);

View File

@@ -0,0 +1,5 @@
using Zennysoft.Ma.Adapter;
public interface IAccessory : IEquipableItem, IAugmentableItem
{
}

View File

@@ -0,0 +1,5 @@
using Zennysoft.Ma.Adapter;
public interface IArmor : IEquipableItem, IAugmentableItem
{
}

View File

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

View File

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

View File

@@ -0,0 +1,15 @@
using Godot;
using Zennysoft.Ma.Adapter;
public interface IBaseInventoryItem
{
public string ItemName { get; }
public string Description { get; }
public float SpawnRate { get; }
public int ThrowDamage { get; }
public float ThrowSpeed { get; }
public ItemTag ItemTag { get; }
public abstract Texture2D GetTexture();
}

View File

@@ -4,6 +4,6 @@
{
void RescueItem();
public InventoryItem Item { get; }
public IBaseInventoryItem Item { get; }
}
}

View File

@@ -0,0 +1,14 @@
using Zennysoft.Ma.Adapter.Entity;
public interface IEquipableItem : IBaseInventoryItem
{
public int BonusAttack { get; }
public int BonusDefense { get; }
public int BonusHP { get; }
public int BonusVT { get; }
public int BonusLuck { get; }
public bool Glued { get; set; }
public ElementalResistanceSet ElementalResistance { get; }
}

View File

@@ -2,17 +2,17 @@
public interface IInventory
{
public bool PickUpItem(InventoryItem item);
public bool PickUpItem(IBaseInventoryItem item);
public List<InventoryItem> Items { get; }
public List<IBaseInventoryItem> Items { get; }
public bool TryAdd(InventoryItem inventoryItem);
public bool TryAdd(IBaseInventoryItem inventoryItem);
public bool TryInsert(InventoryItem inventoryItem, int index);
public bool TryInsert(IBaseInventoryItem inventoryItem, int index);
public void Remove(InventoryItem inventoryItem);
public void Remove(IBaseInventoryItem inventoryItem);
public bool Sort(EquipableItem currentWeapon, EquipableItem currentArmor, EquipableItem currentAccessory, EquipableItem ammo);
public bool Sort(IWeapon currentWeapon, IArmor currentArmor, IAccessory currentAccessory, IEquipableItem ammo);
public bool AtCapacity();

View File

@@ -2,5 +2,5 @@
public interface IThrownItem
{
public InventoryItem ItemThatIsThrown { get; set; }
public IBaseInventoryItem ItemThatIsThrown { get; set; }
}

View File

@@ -0,0 +1,5 @@
using Zennysoft.Ma.Adapter;
public interface IWeapon : IEquipableItem, IAugmentableItem
{
}

View File

@@ -7,10 +7,10 @@ namespace Zennysoft.Ma.Adapter;
public partial class RescuedItemDatabase
{
[Save("rescued_item_list")]
public List<InventoryItem> Items { get; init; }
public List<IBaseInventoryItem> Items { get; init; }
public RescuedItemDatabase()
{
Items = new List<InventoryItem>();
Items = new List<IBaseInventoryItem>();
}
}

View File

@@ -20,15 +20,15 @@ public interface IPlayer : IKillable, ICharacterBody3D
public void TeleportPlayer((Vector3 Rotation, Vector3 Position) newTransform);
public void Equip(EquipableItem equipable);
public void Equip(IEquipableItem equipable);
public void Unequip(EquipableItem equipable);
public void Unequip(IEquipableItem equipable);
public void PlayJumpScareAnimation();
public void ApplyNewAugment(IAugmentItem jewel, EquipableItem equipableItem);
public void ApplyNewAugment(IAugmentItem jewel, IAugmentableItem equipableItem);
public void IdentifyItem(InventoryItem unidentifiedItem);
public void IdentifyItem(IBaseInventoryItem unidentifiedItem);
public IInventory Inventory { get; }
@@ -63,5 +63,5 @@ public interface IPlayer : IKillable, ICharacterBody3D
public bool AutoIdentifyItems { get; set; }
public event Action PlayerDied;
public delegate InventoryItem RerollItem(InventoryItem item);
public delegate IBaseInventoryItem RerollItem(IBaseInventoryItem item);
}

View File

@@ -38,7 +38,7 @@ public partial class InGameUILogic
Output(new Output.AnnounceMessageInInventory(message));
}
private void OnRemoveItemFromInventory(InventoryItem item) => Output(new Output.RemoveItemFromInventory(item));
private void OnRemoveItemFromInventory(IBaseInventoryItem item) => Output(new Output.RemoveItemFromInventory(item));
}
}

View File

@@ -8,7 +8,7 @@ public partial class InGameUILogic
{
public readonly record struct AnnounceMessageOnMainScreen(string Message);
public readonly record struct AnnounceMessageInInventory(string Message);
public readonly record struct RemoveItemFromInventory(InventoryItem Item);
public readonly record struct RemoveItemFromInventory(IBaseInventoryItem Item);
public readonly record struct ShowInventory;
public readonly record struct HideInventory;
}

View File

@@ -6,23 +6,23 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
public class EquipmentComponent : IEquipmentComponent
{
public IAutoProp<EquipableItem> EquippedWeapon => _equippedWeapon;
public IAutoProp<IWeapon> EquippedWeapon => _equippedWeapon;
public IAutoProp<EquipableItem> EquippedArmor => _equippedArmor;
public IAutoProp<IArmor> EquippedArmor => _equippedArmor;
public IAutoProp<EquipableItem> EquippedAccessory => _equippedAccessory;
public IAutoProp<IAccessory> EquippedAccessory => _equippedAccessory;
public IAutoProp<EquipableItem> EquippedAmmo => _equippedAmmo;
public IAutoProp<IEquipableItem> EquippedAmmo => _equippedAmmo;
public AutoProp<EquipableItem> _equippedWeapon;
public AutoProp<IWeapon> _equippedWeapon;
public AutoProp<EquipableItem> _equippedArmor;
public AutoProp<IArmor> _equippedArmor;
public AutoProp<EquipableItem> _equippedAccessory;
public AutoProp<IAccessory> _equippedAccessory;
public AutoProp<EquipableItem> _equippedAmmo;
public AutoProp<IEquipableItem> _equippedAmmo;
public event Action<EquipableItem> EquipmentChanged;
public event Action<IEquipableItem> EquipmentChanged;
public int BonusAttack => _equippedWeapon.Value.BonusAttack + _equippedArmor.Value.BonusAttack + _equippedAccessory.Value.BonusAttack;
@@ -38,10 +38,10 @@ public class EquipmentComponent : IEquipmentComponent
public EquipmentComponent()
{
_equippedWeapon = new AutoProp<EquipableItem>(new Weapon());
_equippedArmor = new AutoProp<EquipableItem>(new Armor());
_equippedAccessory = new AutoProp<EquipableItem>(new Accessory());
_equippedAmmo = new AutoProp<EquipableItem>(new Ammo());
_equippedWeapon = new AutoProp<IWeapon>(new Weapon());
_equippedArmor = new AutoProp<IArmor>(new Armor());
_equippedAccessory = new AutoProp<IAccessory>(new Accessory());
_equippedAmmo = new AutoProp<IEquipableItem>(new Ammo());
}
public void Reset()
@@ -52,7 +52,7 @@ public class EquipmentComponent : IEquipmentComponent
_equippedAmmo.OnNext(new Ammo());
}
public void Equip(EquipableItem equipable)
public void Equip(IEquipableItem equipable)
{
if (equipable is Weapon weapon)
_equippedWeapon.OnNext(weapon);
@@ -65,7 +65,7 @@ public class EquipmentComponent : IEquipmentComponent
EquipmentChanged?.Invoke(equipable);
}
public void Unequip(EquipableItem equipable)
public void Unequip(IEquipableItem equipable)
{
if (equipable is Weapon weapon)
_equippedWeapon.OnNext(new Weapon());
@@ -78,15 +78,12 @@ public class EquipmentComponent : IEquipmentComponent
EquipmentChanged?.Invoke(equipable);
}
public bool IsItemEquipped(InventoryItem item)
public bool IsItemEquipped(IEquipableItem item)
{
if (item is not EquipableItem)
return false;
return item == _equippedWeapon.Value || item == _equippedArmor.Value || item == _equippedAccessory.Value || item == _equippedAmmo.Value;
}
public void UpdateEquipment(EquipableItem equipable) => EquipmentChanged?.Invoke(equipable);
public void UpdateEquipment(IEquipableItem equipable) => EquipmentChanged?.Invoke(equipable);
public bool AugmentableEquipmentExists()
{

View File

@@ -51,6 +51,16 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
var cappedAmount = Math.Min(baseExpGain + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void GainUnmodified(int flatRateExp)
{
var newCurrentExpTotal = flatRateExp + _currentExp.Value;
while (flatRateExp + _currentExp.Value >= _expToNextLevel.Value)
LevelUp();
var cappedAmount = Math.Min(flatRateExp + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
}
public void ModifyExpGainRate(double newRate) => _expGainRate.OnNext(newRate);
public void LevelUp()

View File

@@ -146,7 +146,7 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.SetupGameScene _) =>
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
LoadGame(GAME_SCENE_PATH);
})
.Handle((in AppLogic.Output.ShowMainMenu _) =>
@@ -155,7 +155,7 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.CloseGame _) =>
{
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
_game.GameExitRequested -= GameExitRequested;
MainMenu.StartGameButton.GrabFocus();
_game.CallDeferred(MethodName.QueueFree, []);
@@ -166,13 +166,13 @@ public partial class App : Node, IApp
})
.Handle((in AppLogic.Output.EnemyViewerOpened _) =>
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
MainMenu.Hide();
LoadEnemyViewer(ENEMY_VIEWER_PATH);
})
.Handle((in AppLogic.Output.EnemyViewerExited _) =>
{
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
if (_enemyViewer != null && _enemyViewer is DataViewer enemyViewer)
enemyViewer.CallDeferred(MethodName.QueueFree);
MainMenu.Show();
@@ -203,24 +203,22 @@ public partial class App : Node, IApp
_game = scene as IGame;
_game.GameLoaded += OnGameLoaded;
_game.GameExitRequested += GameExitRequested;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene);
}
private void OnGameLoaded() => LoadingScreen.Hide();
private void OnGameLoaded() => LoadingScreen.HideLoadingScreen();
private async void LoadEnemyViewer(string sceneName)
{
var scene = await LoadSceneInternal(sceneName);
_enemyViewer = scene as IDataViewer;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene);
LoadingScreen.Hide();
LoadingScreen.HideLoadingScreen();
}
private async Task<Node> LoadSceneInternal(string sceneName)
{
LoadingScreen.Show();
LoadingScreen.ShowLoadingScreen();
LoadingScreen.ProgressBar.Value = 0;
var sceneLoader = new SceneLoader();
CallDeferred(MethodName.AddChild, sceneLoader);

View File

@@ -10,9 +10,16 @@
process_mode = 3
script = ExtResource("1_rt73h")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MainMenu" parent="." instance=ExtResource("2_1uiag")]
unique_name_in_owner = true
visible = false
[node name="OptionsMenu" parent="." instance=ExtResource("2_v0mgf")]
unique_name_in_owner = true
@@ -24,5 +31,6 @@ visible = false
[node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")]
unique_name_in_owner = true
visible = false
top_level = true
z_index = 999

View File

@@ -39,6 +39,7 @@ bus = &"SFX"
[node name="MoveSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("6_r16t0")
max_polyphony = 5
bus = &"SFX"
[node name="SelectSound" type="AudioStreamPlayer" parent="UI"]

View File

@@ -109,7 +109,6 @@ _acquireTargetTime = 2.0
unique_name_in_owner = true
avoidance_enabled = true
radius = 1.0
debug_enabled = true
[node name="SFX" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0617, 0)

View File

@@ -7,7 +7,6 @@ using Chickensoft.SaveFileBuilder;
using Godot;
using System;
using System.Text.Json;
using Zennysoft.Game.Abstractions;
using Zennysoft.Ma.Adapter;
using System.IO;
using System.Threading.Tasks;
@@ -158,9 +157,7 @@ public partial class Game : Node3D, IGame
GameState.Set(_player);
GameState.Set(_map);
GameState.Set(InGameUI);
GameRepo.Resume();
InGameUI.Show();
HandleGameLogic();
GameState.Start();
this.Provide();
@@ -189,6 +186,8 @@ public partial class Game : Node3D, IGame
GameRepo.IsPaused.Sync += IsPaused_Sync;
InGameUI.PlayerInfoUI.Activate();
InGameUI.Show();
GameRepo.Resume();
}
private void GameRepo_EnemyDied(IEnemy obj)
@@ -210,14 +209,13 @@ public partial class Game : Node3D, IGame
_effectService = new EffectService(this, _player, _map);
_player.Activate();
await _map.LoadFloor();
GameLoaded?.Invoke();
}
public async Task Save() => await SaveFile.Save();
public void FloorExitReached() => GameState.Input(new GameState.Input.FloorExitEntered());
public async Task UseItem(InventoryItem item)
public async Task UseItem(IBaseInventoryItem item)
{
if (item.ItemTag == ItemTag.MysteryItem)
_effectService.RerollItem(item);
@@ -234,13 +232,10 @@ public partial class Game : Node3D, IGame
EnactEffectItemEffects(effectItem);
break;
}
await ToSignal(GetTree().CreateTimer(0.3f), "timeout");
RemoveItemOrSubtractFromItemCount(item);
}
public void DropItem(InventoryItem item)
public void DropItem(IBaseInventoryItem item)
{
var droppedScene = GD.Load<PackedScene>("res://src/items/dropped/DroppedItem.tscn");
var dropped = droppedScene.Instantiate<DroppedItem>();
@@ -250,7 +245,7 @@ public partial class Game : Node3D, IGame
_player.Inventory.Remove(item);
}
public void SetItem(InventoryItem item)
public void SetItem(IBaseInventoryItem item)
{
var setScene = GD.Load<PackedScene>("res://src/items/misc/SetItem.tscn");
var setItem = setScene.Instantiate<SetItem>();
@@ -259,7 +254,7 @@ public partial class Game : Node3D, IGame
_player.Inventory.Remove(item);
}
public void ThrowItem(InventoryItem item)
public void ThrowItem(IBaseInventoryItem item)
{
var thrownScene = GD.Load<PackedScene>("res://src/items/thrown/ThrownItem.tscn");
var thrown = thrownScene.Instantiate<ThrownItem>();
@@ -399,7 +394,10 @@ public partial class Game : Node3D, IGame
InGameUI.InventoryMenu.SetProcessInput(false);
}
private async void LoadLevel() => await _map.LoadFloor();
private async void LoadLevel()
{
await _map.LoadFloor();
}
private void FloorClearMenu_GoToNextFloor() => GameState.Input(new GameState.Input.LoadNextFloor());
@@ -420,7 +418,6 @@ public partial class Game : Node3D, IGame
private void UseTeleportPrompt_TeleportToNextFloor()
{
//_player.LookUp();
GameState.Input(new GameState.Input.UseTeleport());
}
@@ -459,10 +456,10 @@ public partial class Game : Node3D, IGame
_player.Inventory.TryAdd(_effectService.GetRandomItemOfType<ConsumableItem>());
break;
case ItemTag.DropTo1HPAndGainRareItem:
_effectService.DropTo1HPAndGainRareItem<InventoryItem>();
_effectService.DropTo1HPAndGainRareItem<IBaseInventoryItem>();
break;
case ItemTag.TradeAllRandomItems:
var newInventory = _effectService.TradeAllRandomItems<InventoryItem>(boxItem);
var newInventory = _effectService.TradeAllRandomItems(boxItem);
_player.Inventory.Items.Clear();
_player.Inventory.TryAdd(boxItem);
foreach (var item in newInventory)
@@ -472,7 +469,7 @@ public partial class Game : Node3D, IGame
_effectService.GetUnobtainedItem();
break;
case ItemTag.ContainsBasicItem:
_effectService.GetBasicItem<InventoryItem>();
_effectService.GetBasicItem<IBaseInventoryItem>();
break;
case ItemTag.UnequipAllItems:
_player.EquipmentComponent.Unequip(_player.EquipmentComponent.EquippedWeapon.Value);
@@ -567,7 +564,7 @@ public partial class Game : Node3D, IGame
}
}
private void RemoveItemOrSubtractFromItemCount(InventoryItem item)
private void RemoveItemOrSubtractFromItemCount(IBaseInventoryItem item)
{
if (item is IStackable stackableItem && stackableItem.Count.Value > 1)
stackableItem.SetCount(stackableItem.Count.Value - 1);
@@ -589,6 +586,8 @@ public partial class Game : Node3D, IGame
private void OnFloorLoadFinished()
{
LoadNextLevel.Hide();
GameLoaded?.Invoke();
_map.FadeIn();
}
private void OnQuit() => GameExitRequested?.Invoke();

View File

@@ -11,11 +11,11 @@ process_mode = 3
script = ExtResource("1_ytcii")
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
custom_minimum_size = Vector2(1440, 1080)
custom_minimum_size = Vector2(1456, 1080)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_right = -480.0
offset_right = -464.0
grow_horizontal = 2
grow_vertical = 2
stretch = true
@@ -23,7 +23,7 @@ stretch = true
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
handle_input_locally = false
audio_listener_enable_3d = true
size = Vector2i(1440, 1080)
size = Vector2i(1456, 1080)
render_target_update_mode = 4
[node name="PauseContainer" type="Node3D" parent="SubViewportContainer/SubViewport"]

View File

@@ -18,13 +18,13 @@ public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>
public IDungeonFloor CurrentFloor { get; }
public Task UseItem(InventoryItem item);
public Task UseItem(IBaseInventoryItem item);
public void DropItem(InventoryItem item);
public void DropItem(IBaseInventoryItem item);
public void SetItem(InventoryItem item);
public void SetItem(IBaseInventoryItem item);
public void ThrowItem(InventoryItem item);
public void ThrowItem(IBaseInventoryItem item);
public void FloorExitReached();

View File

@@ -172,7 +172,11 @@ public class EffectService
SfxDatabase.Instance.Play(SoundEffect.IncreaseStat);
}
public void RaiseLevel() => _player.LevelUp();
public void RaiseLevel()
{
var expToNextLevel = _player.ExperiencePointsComponent.ExpToNextLevel.Value - _player.ExperiencePointsComponent.CurrentExp.Value;
_player.ExperiencePointsComponent.GainUnmodified(expToNextLevel);
}
public void TeleportToRandomRoom(IEnemy enemy)
{
@@ -228,14 +232,14 @@ public class EffectService
_player.TakeDamage(new AttackData(damage, ElementType.None, true, true));
}
public void RerollItem(InventoryItem itemToReroll)
public void RerollItem(IBaseInventoryItem itemToReroll)
{
var itemReroller = new ItemReroller(ItemDatabase.Instance);
itemReroller.RerollItem(itemToReroll, _player.Inventory);
}
public T GetRandomItemOfType<T>(T itemToExclude = null)
where T : InventoryItem => ItemDatabase.Instance.PickItem(itemToExclude);
public T GetRandomItemOfType<T>(params T[] itemsToExclude)
where T : IBaseInventoryItem => ItemDatabase.Instance.PickItem(itemsToExclude);
public void RandomSpell()
{
@@ -243,38 +247,33 @@ public class EffectService
}
public void DropTo1HPAndGainRareItem<T>()
where T : InventoryItem
where T : IBaseInventoryItem
{
_player.HealthComponent.SetCurrentHealth(1);
_player.Inventory.TryAdd(ItemDatabase.Instance.PickRareItem<T>());
}
public void TradeRandomItem<T>(BoxItem box)
where T : InventoryItem
where T : IBaseInventoryItem
{
var tradableItems = _player.Inventory.Items.OfType<T>().Where(x => x != box).ToList();
var tradableItems = _player.Inventory.Items.OfType<T>().ToList();
var rng = new RandomNumberGenerator();
rng.Randomize();
var randomIndex = rng.RandiRange(0, tradableItems.Count - 1);
var randomItem = tradableItems[randomIndex];
if (randomItem is EquipableItem equipableItem)
{
if (_player.EquipmentComponent.IsItemEquipped(equipableItem))
_player.Unequip(equipableItem);
}
if (randomItem is IEquipableItem equipableItem && _player.EquipmentComponent.IsItemEquipped(equipableItem))
_player.Unequip(equipableItem);
_player.Inventory.Remove(randomItem);
GetRandomItemOfType<T>();
}
public IEnumerable<InventoryItem> TradeAllRandomItems<T>(BoxItem box)
where T : InventoryItem
public IEnumerable<IBaseInventoryItem> TradeAllRandomItems(BoxItem box)
{
var newInventory = new List<InventoryItem>();
var items = _player.Inventory.Items.OfType<T>().Where(x => x != box).ToList();
var newInventory = new List<IBaseInventoryItem>();
var items = _player.Inventory.Items.ToList();
foreach (var item in items)
newInventory.Add(GetRandomItemOfType<T>());
newInventory.Add(GetRandomItemOfType<IBaseInventoryItem>());
return newInventory;
}
@@ -294,7 +293,7 @@ public class EffectService
}
public void GetBasicItem<T>()
where T : InventoryItem
where T : IBaseInventoryItem
{
_player.Inventory.TryAdd(ItemDatabase.Instance.PickBasicItem<T>());
}

View File

@@ -27,9 +27,9 @@ public partial class Inventory : Node, IInventory
}
[Save("inventory_items")]
public List<InventoryItem> Items { get; private set; }
public List<IBaseInventoryItem> Items { get; private set; }
public bool PickUpItem(InventoryItem item)
public bool PickUpItem(IBaseInventoryItem item)
{
var isAdded = TryAdd(item);
if (isAdded)
@@ -43,7 +43,7 @@ public partial class Inventory : Node, IInventory
return isAdded;
}
public bool TryAdd(InventoryItem inventoryItem)
public bool TryAdd(IBaseInventoryItem inventoryItem)
{
if (Items.Count >= _maxInventorySize)
return false;
@@ -55,7 +55,7 @@ public partial class Inventory : Node, IInventory
public bool AtCapacity() => Items.Count >= _maxInventorySize;
public bool TryInsert(InventoryItem inventoryItem, int index)
public bool TryInsert(IBaseInventoryItem inventoryItem, int index)
{
if (Items.Count >= _maxInventorySize || index >= _maxInventorySize || index < 0)
return false;
@@ -65,20 +65,20 @@ public partial class Inventory : Node, IInventory
return true;
}
public void Remove(InventoryItem inventoryItem)
public void Remove(IBaseInventoryItem inventoryItem)
{
Items.Remove(inventoryItem);
InventoryChanged?.Invoke();
}
public bool Sort(EquipableItem currentWeapon, EquipableItem currentArmor, EquipableItem currentAccessory, EquipableItem currentAmmo)
public bool Sort(IWeapon currentWeapon, IArmor currentArmor, IAccessory currentAccessory, IEquipableItem currentAmmo)
{
var initialList = Items;
var equippedWeapon = Items.OfType<Weapon>().Where(x => x == currentWeapon);
var equippedArmor = Items.OfType<Armor>().Where(x => x == currentArmor);
var equippedAccessory = Items.OfType<Accessory>().Where(x => x == currentAccessory);
var equippedAmmo = Items.OfType<Ammo>().Where(x => x == currentAmmo);
var equippedItems = new List<InventoryItem>();
var equippedItems = new List<IBaseInventoryItem>();
equippedItems.AddRange(equippedWeapon);
equippedItems.AddRange(equippedArmor);
equippedItems.AddRange(equippedAccessory);
@@ -96,12 +96,12 @@ public partial class Inventory : Node, IInventory
Items = [.. equippedItems, .. weapons, .. armor, .. accessories, .. ammo, .. consumables, .. throwables, .. effectItems, .. jewelItems, .. setItems];
var stackableItems = Items.OfType<IStackable>();
var itemsToStack = stackableItems.GroupBy(x => ((InventoryItem)x).ItemName).Where(x => x.Count() > 1);
var itemsToStack = stackableItems.GroupBy(x => ((IBaseInventoryItem)x).ItemName).Where(x => x.Count() > 1);
foreach (var itemStack in itemsToStack)
{
var firstItem = itemStack.First();
firstItem.SetCount(itemStack.Sum(x => x.Count.Value));
var itemsToRemove = itemStack.Except([firstItem]).Cast<InventoryItem>();
var itemsToRemove = itemStack.Except([firstItem]).Cast<IBaseInventoryItem>();
foreach (var item in itemsToRemove)
Remove(item);
}

View File

@@ -14,37 +14,37 @@ public class ItemDatabase
public static ItemDatabase Instance { get { return lazy.Value; } }
public ImmutableList<InventoryItem> Items { get; set; }
public ImmutableList<IBaseInventoryItem> Items { get; set; }
public T PickItem<T>(T itemToExclude = null)
where T : InventoryItem
public T PickItem<T>(params T[] itemsToExclude)
where T : IBaseInventoryItem
{
var itemsToSelectFrom = Items.OfType<T>();
return PickItemInternal(itemsToSelectFrom, itemToExclude);
return PickItemInternal(itemsToSelectFrom, itemsToExclude);
}
public T PickRareItem<T>(T itemToExclude = null)
where T : InventoryItem
public T PickRareItem<T>(params T[] itemsToExclude)
where T : IBaseInventoryItem
{
var getRareItems = Items.OfType<T>().Where(x => x.SpawnRate < 0.1f);
return PickItemInternal(getRareItems, itemToExclude);
return PickItemInternal(getRareItems, itemsToExclude);
}
public T PickBasicItem<T>(T itemToExclude = null)
where T : InventoryItem
public T PickBasicItem<T>(params T[] itemsToExclude)
where T : IBaseInventoryItem
{
var getBasicItems = Items.OfType<T>().Where(x => x.SpawnRate > 0.5f);
return PickItemInternal(getBasicItems, itemToExclude);
return PickItemInternal(getBasicItems, itemsToExclude);
}
private T PickItemInternal<T>(IEnumerable<T> itemsToSelectFrom, T itemToExclude = null)
where T : InventoryItem
private T PickItemInternal<T>(IEnumerable<T> itemsToSelectFrom, params T[] itemsToExclude)
where T : IBaseInventoryItem
{
var rng = new RandomNumberGenerator();
rng.Randomize();
if (itemToExclude is not null)
itemsToSelectFrom = [.. itemsToSelectFrom.Where(x => x.ItemName != itemToExclude.ItemName)];
if (itemsToExclude.Any())
itemsToSelectFrom.Except(itemsToExclude);
var weights = itemsToSelectFrom.Select(x => x.SpawnRate).ToArray();
var selectedItem = itemsToSelectFrom.ToArray()[rng.RandWeighted(weights)];
@@ -54,7 +54,7 @@ public class ItemDatabase
private ItemDatabase()
{
var database = new List<InventoryItem>();
var database = new List<IBaseInventoryItem>();
var armorResources = DirAccess.GetFilesAt("res://src/items/armor/resources/");
var weaponResources = DirAccess.GetFilesAt("res://src/items/weapons/resources/");
var accessoryResources = DirAccess.GetFilesAt("res://src/items/accessory/resources/");

View File

@@ -12,7 +12,7 @@ public class ItemReroller
}
public T RerollItem<T>(T itemToReroll, IInventory inventory, bool insertIntoInventory = true)
where T : InventoryItem
where T : IBaseInventoryItem
{
var currentIndex = inventory.Items.IndexOf(itemToReroll);
@@ -27,7 +27,7 @@ public class ItemReroller
return rolledItem;
}
public InventoryItem RerollItemToAny(InventoryItem itemToReroll, IInventory inventory, bool insertIntoInventory = true)
public IBaseInventoryItem RerollItemToAny(IBaseInventoryItem itemToReroll, IInventory inventory, bool insertIntoInventory = true)
{
var currentIndex = inventory.Items.IndexOf(itemToReroll);

View File

@@ -8,7 +8,7 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("accessory")]
public partial class Accessory : EquipableItem
public partial class Accessory : Node3D, IAccessory
{
public override void _Notification(int what) => this.Notify(what);
@@ -21,32 +21,32 @@ public partial class Accessory : EquipableItem
_bonusDefense = Stats.BonusDefense;
_bonusLuck = Stats.BonusLuck;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override int BonusAttack { get => _bonusDamage; }
public int BonusAttack { get => _bonusDamage; }
public override int BonusDefense { get => _bonusDefense; }
public int BonusDefense { get => _bonusDefense; }
public override int BonusLuck { get => _bonusLuck; }
public int BonusLuck { get => _bonusLuck; }
public override int BonusHP => Stats.BonusHP;
public int BonusHP => Stats.BonusHP;
public override int BonusVT => Stats.BonusVT;
public int BonusVT => Stats.BonusVT;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
[Save("accessory_tag")]
public AccessoryTag AccessoryTag => Stats.AccessoryTag;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
[Save("accessory_bonus_damage")]
private int _bonusDamage { get; set; } = 0;
@@ -72,6 +72,8 @@ public partial class Accessory : EquipableItem
[Export]
[Save("accessory_stats")]
public AccessoryStats Stats { get; set; } = new AccessoryStats();
public Augment Augment { get; set; }
public bool Glued { get; set; }
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
}

View File

@@ -28,7 +28,6 @@ collision_mask = 0
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
pixel_size = 0.025
billboard = 2
shaded = true
texture_filter = 0

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 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://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_tdick"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_xqaot"]
[resource]
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_tdick")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://d4bcem2nup7ef"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://d4bcem2nup7ef"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_o4s2p"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_vef66"]
[resource]
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_o4s2p")

View File

@@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://bejy3lpudgawg"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://bejy3lpudgawg"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_cgxkh"]
[ext_resource type="Texture2D" uid="uid://cy7qvpjahblv3" path="res://src/items/3D Render Icons/Mask of Zeal.png" id="1_vadtu"]
[resource]
script = ExtResource("1_cgxkh")
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_vadtu")

View File

@@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://ddwyaxxqvk52h"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://ddwyaxxqvk52h"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_kuyyj"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_q802c"]
[resource]
script = ExtResource("1_kuyyj")
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_q802c")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://c3v6r8s8yruag"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://c3v6r8s8yruag"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_8s3rr"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_co7sc"]
[resource]
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_8s3rr")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://ct8iply3dwssv"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://ct8iply3dwssv"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_j1foy"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_vdb56"]
[resource]
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_j1foy")

View File

@@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://d02kuxaus43mk"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://d02kuxaus43mk"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_3iw2y"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_l1p50"]
[resource]
script = ExtResource("1_3iw2y")
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_l1p50")

View File

@@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://b0bxwp55mcyyp"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://b0bxwp55mcyyp"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_0u4rq"]
[ext_resource type="Texture2D" uid="uid://m0f8xmp8l2fe" path="res://src/items/3D Render Icons/mask placeholder.png" id="1_o1pjn"]
[resource]
script = ExtResource("1_0u4rq")
@@ -19,6 +20,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_o1pjn")

View File

@@ -1,11 +1,12 @@
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=2 format=3 uid="uid://ecmjxvihuahv"]
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://ecmjxvihuahv"]
[ext_resource type="Texture2D" uid="uid://djby4qor86st1" path="res://src/items/Icons/Unidentified Item.png" id="1_fbxyn"]
[ext_resource type="Script" uid="uid://b8arlmivk68b" path="res://src/items/accessory/AccessoryStats.cs" id="1_xc7fh"]
[resource]
script = ExtResource("1_xc7fh")
AccessoryTag = 0
Name = "Mask"
Name = "Unknown Mask"
Description = "Unknown mask."
SpawnRate = 0.5
BonusAttack = 0
@@ -19,7 +20,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 2
Texture = ExtResource("1_fbxyn")
metadata/_custom_type_script = "uid://b8arlmivk68b"

View File

@@ -6,9 +6,10 @@ using Godot;
using Zennysoft.Game.Implementation;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
[Meta(typeof(IAutoNode)), Id("ammo")]
public partial class Ammo : EquipableItem, IStackable
public partial class Ammo : Node3D, IEquipableItem, IStackable
{
public override void _Notification(int what) => this.Notify(what);
@@ -21,19 +22,19 @@ public partial class Ammo : EquipableItem, IStackable
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
[Save("ammo_item_count")]
public AutoProp<int> Count { get; private set; }
@@ -46,4 +47,11 @@ public partial class Ammo : EquipableItem, IStackable
[Export]
[Save("ammo_stats")]
public AmmoStats Stats { get; set; } = new AmmoStats();
public int BonusAttack { get; }
public int BonusDefense { get; }
public int BonusHP { get; }
public int BonusVT { get; }
public int BonusLuck { get; }
public bool Glued { get; set; }
public ElementalResistanceSet ElementalResistance { get; }
}

View File

@@ -29,7 +29,6 @@ collision_mask = 0
[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.370004, 0)
pixel_size = 0.025
billboard = 2
texture_filter = 0

View File

@@ -8,7 +8,7 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("armor")]
public partial class Armor : EquipableItem
public partial class Armor : Node3D, IArmor
{
public override void _Notification(int what) => this.Notify(what);
@@ -22,21 +22,21 @@ public partial class Armor : EquipableItem
_bonusLuck = Stats.BonusLuck;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override int BonusAttack { get => _bonusDamage; }
public int BonusAttack { get => _bonusDamage; }
public override int BonusDefense { get => _bonusDefense; }
public int BonusDefense { get => _bonusDefense; }
public override int BonusLuck { get => _bonusLuck; }
public int BonusLuck { get => _bonusLuck; }
public void IncreaseAttack(int bonus) => _bonusDamage += bonus;
@@ -60,14 +60,19 @@ public partial class Armor : EquipableItem
[Save("armor_bonus_luck")]
private int _bonusLuck { get; set; } = 0;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public void IncreaseArmorDefense(int bonus) => _bonusDefense += bonus;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
[Save("armor_stats")]
[Export]
public ArmorStats Stats { get; set; } = new ArmorStats();
public override Texture2D GetTexture() => Stats.Texture;
public Augment Augment { get; set; }
public int BonusHP { get; }
public int BonusVT { get; }
public bool Glued { get; set; }
public Texture2D GetTexture() => Stats.Texture;
}

View File

@@ -28,7 +28,6 @@ collision_mask = 0
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
pixel_size = 0.025
billboard = 2
double_sided = false
alpha_cut = 1

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://b8mjje06x6dl1"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_2ab2r"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_2ab2r"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_si4wu"]
[resource]
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Acceptance"
Description = "+9 DEF"
SpawnRate = 0.01
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://ce2vfa2t3io67"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_6r2bl"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_wqsgh"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_wqsgh"]
[resource]
script = ExtResource("1_6r2bl")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Atoner's Adornments"
Description = "+1 DEF"
SpawnRate = 0.25
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://dnu241lh47oqd"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_0qtvf"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_ab4cm"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_ab4cm"]
[resource]
script = ExtResource("1_0qtvf")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Ceremonial Vestments"
Description = "+2 DEF"
SpawnRate = 0.2
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://4s7wjsb7eb6e"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_l5ice"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_l5ice"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_w3lql"]
[resource]
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Devic Layers"
Description = "+7 DEF"
SpawnRate = 0.05
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://dc0qjer88chme"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_3mc7x"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_b51k4"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_b51k4"]
[resource]
script = ExtResource("1_3mc7x")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Goddess' Robe"
Description = "+8 DEF"
SpawnRate = 0.03
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://ceqnyutl7y7t4"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_bo8yj"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_bo8yj"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_iqj2w"]
[resource]
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Iron Cage"
Description = "+4 DEF"
SpawnRate = 0.15
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://chhxktntl4k8r"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_frqfh"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_sm3rm"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_sm3rm"]
[resource]
script = ExtResource("1_frqfh")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Logistician's Garb"
Description = "+5 DEF"
SpawnRate = 0.08
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://05hilwkmrs7a"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_7ghri"]
[ext_resource type="Texture2D" uid="uid://djby4qor86st1" path="res://src/items/Icons/Unidentified Item.png" id="1_7ghri"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_s5wnf"]
[resource]
@@ -11,8 +11,9 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
Name = "Coat"
Description = "Unidentified coat."
_curseResistance = 0.0
Name = "Unknown Coat"
Description = "Unknown coat."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 2

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://d3l8aa87tevgt"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_dh6tr"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_ykqpi"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_ykqpi"]
[resource]
script = ExtResource("1_dh6tr")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Stoic"
Description = "+6 DEF"
SpawnRate = 0.05
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://dq4c6an78qa4q"]
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_bkpin"]
[ext_resource type="Texture2D" uid="uid://ci4oqkr0auqlw" path="res://src/items/armor/textures/Ceremonial Vestments.PNG" id="1_wq31s"]
[ext_resource type="Texture2D" uid="uid://clmtbjmwemepv" path="res://src/items/3D Render Icons/Wood Armor.png" id="1_wq31s"]
[resource]
script = ExtResource("1_bkpin")
@@ -11,6 +11,7 @@ _hydricResistance = 0.0
_igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
Name = "Wooden Armament"
Description = "+3 DEF"
SpawnRate = 0.3
@@ -25,6 +26,7 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0

View File

@@ -6,7 +6,7 @@ using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode)), Id("box_item")]
public partial class BoxItem : InventoryItem
public partial class BoxItem : Node3D, IBaseInventoryItem
{
public override void _Notification(int what) => this.Notify(what);
@@ -16,19 +16,19 @@ public partial class BoxItem : InventoryItem
[Save("box_stats")]
public BoxItemStats Stats { get; set; } = new BoxItemStats();
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
public void OnReady()
{

View File

@@ -28,7 +28,6 @@ collision_mask = 0
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
pixel_size = 0.025
billboard = 2
shaded = true
texture_filter = 0

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="BoxItemStats" load_steps=2 format=3 uid="uid://cgkorwblwr12t"]
[gd_resource type="Resource" script_class="BoxItemStats" load_steps=3 format=3 uid="uid://cgkorwblwr12t"]
[ext_resource type="Texture2D" uid="uid://b0oixkrxy542r" path="res://src/items/3D Render Icons/Empty Box.png" id="1_650jj"]
[ext_resource type="Script" uid="uid://vuavr681au06" path="res://src/items/accessory/BoxItemStats.cs" id="1_i336w"]
[resource]
@@ -19,7 +20,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_650jj")
metadata/_custom_type_script = "uid://vuavr681au06"

View File

@@ -7,7 +7,7 @@ using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("consumable_item")]
public partial class ConsumableItem : InventoryItem
public partial class ConsumableItem : Node3D, IBaseInventoryItem
{
public override void _Notification(int what) => this.Notify(what);
@@ -15,15 +15,15 @@ public partial class ConsumableItem : InventoryItem
public override void _Ready() => _sprite.Texture = Stats.Texture;
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
[Save("consumable_heal_hp")]
public int HealHPAmount => Stats.HealHPAmount;
@@ -34,10 +34,10 @@ public partial class ConsumableItem : InventoryItem
[Save("consumable_increase_vt")]
public int RaiseVTAmount => Stats.PermanentRaiseVTAmount;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
[Export]
[Save("consumable_item_stats")]
public ConsumableItemStats Stats { get; set; } = new ConsumableItemStats();
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
}

View File

@@ -29,7 +29,6 @@ collision_mask = 0
[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
billboard = 2
shaded = true
double_sided = false

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://d0cxrf0nldona"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://d0cxrf0nldona"]
[ext_resource type="Texture2D" uid="uid://cyulehmrydvlj" path="res://src/items/3D Render Icons/Amrit Draught.png" id="1_6vdf0"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_riwik"]
[resource]
@@ -23,6 +24,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_6vdf0")

View File

@@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://bjwbx3ymt8o7"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://bjwbx3ymt8o7"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="1_51ovu"]
[ext_resource type="Texture2D" uid="uid://djby4qor86st1" path="res://src/items/Icons/Unidentified Item.png" id="1_g5ngs"]
[resource]
script = ExtResource("1_51ovu")
@@ -8,8 +9,8 @@ HealHPAmount = 0
HealVTAmount = 0
PermanentRaiseHPAmount = 0
PermanentRaiseVTAmount = 0
Name = "Fragment"
Description = "Unidentified fragment."
Name = "Unknown Fragment"
Description = "Unknown fragment."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
@@ -22,7 +23,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 2
Texture = ExtResource("1_g5ngs")
metadata/_custom_type_script = "uid://cymeea1n4f04i"

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://dns281deffo6q"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://dns281deffo6q"]
[ext_resource type="Texture2D" uid="uid://cy5bd7f37fi35" path="res://src/items/3D Render Icons/health item placeholder.png" id="1_154ao"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_e61q8"]
[resource]
@@ -22,6 +23,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_154ao")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://bnec53frgyue8"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://bnec53frgyue8"]
[ext_resource type="Texture2D" uid="uid://cyulehmrydvlj" path="res://src/items/3D Render Icons/Amrit Draught.png" id="1_3gnvj"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_wmtl1"]
[resource]
@@ -22,6 +23,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_3gnvj")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://75fpkwfp0t0k"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://75fpkwfp0t0k"]
[ext_resource type="Texture2D" uid="uid://cyulehmrydvlj" path="res://src/items/3D Render Icons/Amrit Draught.png" id="1_33rp1"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="1_f8ogj"]
[resource]
@@ -23,6 +24,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_33rp1")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://ypw2yg10430p"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://ypw2yg10430p"]
[ext_resource type="Texture2D" uid="uid://cyulehmrydvlj" path="res://src/items/3D Render Icons/Amrit Draught.png" id="1_omu2j"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_41hue"]
[resource]
@@ -23,6 +24,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_omu2j")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=2 format=3 uid="uid://lu0ddu3538p6"]
[gd_resource type="Resource" script_class="ConsumableItemStats" load_steps=3 format=3 uid="uid://lu0ddu3538p6"]
[ext_resource type="Texture2D" uid="uid://cy5bd7f37fi35" path="res://src/items/3D Render Icons/health item placeholder.png" id="1_5oqkr"]
[ext_resource type="Script" uid="uid://cymeea1n4f04i" path="res://src/items/consumable/ConsumableItemStats.cs" id="2_q4pyq"]
[resource]
@@ -23,6 +24,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_5oqkr")

View File

@@ -18,7 +18,7 @@ public partial class DroppedItem : RigidBody3D, IDroppedItem
[Node] private Area3D Pickup { get; set; } = default!;
public InventoryItem Item { get; set; }
public IBaseInventoryItem Item { get; set; }
public void OnResolved()
{

View File

@@ -7,7 +7,7 @@ using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("effect_item")]
public partial class EffectItem : InventoryItem
public partial class EffectItem : Node3D, IBaseInventoryItem
{
public override void _Notification(int what) => this.Notify(what);
@@ -18,20 +18,20 @@ public partial class EffectItem : InventoryItem
_sprite.Texture = Stats.Texture;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
[Save("usable_tag")]
public UsableItemTag UsableItemTag => Stats.UsableItemTag;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public void SetEffectTag(UsableItemTag effect) => Stats.UsableItemTag = effect;
@@ -39,5 +39,5 @@ public partial class EffectItem : InventoryItem
[Save("effect_item_stats")]
public EffectItemStats Stats { get; set; } = new EffectItemStats();
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
}

View File

@@ -32,7 +32,6 @@ shape = SubResource("BoxShape3D_03cqg")
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
transform = Transform3D(0.999973, 0.00489444, -0.00548299, -0.00488109, 0.999985, 0.00244357, 0.00549488, -0.00241672, 0.999982, 0, 0, 0)
pixel_size = 0.025
billboard = 2
shaded = true
texture_filter = 0

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://crvn3srgpj2fh"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://crvn3srgpj2fh"]
[ext_resource type="Texture2D" uid="uid://bybhtaq06p0yk" path="res://src/items/3D Render Icons/Gospel of Paths.png" id="1_u0h2q"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_yytis"]
[resource]
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_u0h2q")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://d3to07qm7fm4"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://d3to07qm7fm4"]
[ext_resource type="Texture2D" uid="uid://bybhtaq06p0yk" path="res://src/items/3D Render Icons/Gospel of Paths.png" id="1_xsfvc"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_i4na1"]
[resource]
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_xsfvc")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://5tbtsch3qagg"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_drp30"]
[ext_resource type="Texture2D" uid="uid://iiajy3h10e6a" path="res://src/items/effect/textures/Heaven's Rebellion.png" id="1_g0a3x"]
[ext_resource type="Texture2D" uid="uid://clcnicpji56vc" path="res://src/items/3D Render Icons/Heaven's Rebellion.png" id="1_g0a3x"]
[resource]
script = ExtResource("1_drp30")
@@ -12,7 +12,7 @@ Description = "Heals self and all enemies in current room to maximum HP."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 0.05
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://bgqu6jsadtqjq"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://bgqu6jsadtqjq"]
[ext_resource type="Texture2D" uid="uid://bybhtaq06p0yk" path="res://src/items/3D Render Icons/Gospel of Paths.png" id="1_8v5wn"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_mj844"]
[resource]
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_8v5wn")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://brj7h6tgifa5n"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://brj7h6tgifa5n"]
[ext_resource type="Texture2D" uid="uid://bybhtaq06p0yk" path="res://src/items/3D Render Icons/Gospel of Paths.png" id="1_3iam5"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_cl8lc"]
[resource]
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_3iam5")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://bldgbv38yplgk"]
[ext_resource type="Texture2D" uid="uid://dg6rwrbmo67yp" path="res://src/items/effect/textures/Kyuuketsuki.png" id="1_0tcgy"]
[ext_resource type="Texture2D" uid="uid://cft1sn3ttmqkg" path="res://src/items/3D Render Icons/Kyuuketsuki.png" id="1_0tcgy"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_hxj1b"]
[resource]
@@ -12,7 +12,7 @@ Description = "Absorbs HP from all enemies in the room."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 0.05
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0

View File

@@ -1,13 +1,14 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://2ymi6ooyqyox"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://2ymi6ooyqyox"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_eeb8x"]
[ext_resource type="Texture2D" uid="uid://djby4qor86st1" path="res://src/items/Icons/Unidentified Item.png" id="1_yerq2"]
[resource]
script = ExtResource("1_eeb8x")
UsableItemTag = 0
ElementalDamageType = 0
Name = "Seal"
Description = "Mystery seal."
Name = "Unknown Seal"
Description = "Unknown seal."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 2
Texture = ExtResource("1_yerq2")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://cwh5w1yabwrxf"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_ksb1c"]
[ext_resource type="Texture2D" uid="uid://bj7vhhgq7c0s1" path="res://src/items/effect/textures/SineMorph.png" id="1_vqhky"]
[ext_resource type="Texture2D" uid="uid://3i21sj5kbya0" path="res://src/items/3D Render Icons/Sine Morph.png" id="1_vqhky"]
[resource]
script = ExtResource("1_ksb1c")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=2 format=3 uid="uid://dw26l3f3hd2sq"]
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://dw26l3f3hd2sq"]
[ext_resource type="Texture2D" uid="uid://bybhtaq06p0yk" path="res://src/items/3D Render Icons/Gospel of Paths.png" id="1_x62ct"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_38yjb"]
[resource]
@@ -20,7 +21,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_x62ct")
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -6,7 +6,7 @@ using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode)), Id("jewel")]
public partial class Jewel : InventoryItem, IAugmentItem
public partial class Jewel : Node3D, IAugmentItem
{
public override void _Notification(int what) => this.Notify(what);
@@ -17,23 +17,23 @@ public partial class Jewel : InventoryItem, IAugmentItem
_sprite.Texture = Stats.Texture;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
[Export]
[Save("jewel_stats")]
public JewelStats Stats { get; set; } = new JewelStats();
public JewelTags Augment => Stats.JewelTag;
public IAugmentType Augment { get; set; }
}

View File

@@ -29,7 +29,6 @@ collision_mask = 0
[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.370004, 0)
pixel_size = 0.025
billboard = 2
texture_filter = 0

View File

@@ -7,30 +7,30 @@ using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
[Meta(typeof(IAutoNode))]
public partial class Plastique : InventoryItem
public partial class Plastique : Node3D, IBaseInventoryItem
{
public override void _Notification(int what) => this.Notify(what);
[Node] private Sprite3D _sprite { get; set; }
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public void OnResolved()
{
_sprite.Texture = Stats.Texture;
_sprite.Texture = Stats.Texture;
}
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
[Export]
[Save("inventory_stats")]

View File

@@ -1,23 +1,34 @@
[gd_scene load_steps=4 format=3 uid="uid://dofju2wfj12y4"]
[gd_scene load_steps=7 format=3 uid="uid://dofju2wfj12y4"]
[ext_resource type="Script" uid="uid://qjvotbwutcb5" path="res://src/items/restorative/Restorative.cs" id="1_3beyl"]
[ext_resource type="Texture2D" uid="uid://d07kcaqe682l1" path="res://src/items/ammo/textures/AirGeo.png" id="2_6y0d4"]
[ext_resource type="Texture2D" uid="uid://b36xqrykgtdkw" path="res://src/items/VT Crystal/FRAME1.png" id="2_jv3e6"]
[ext_resource type="Texture2D" uid="uid://d3g5l5x5crrcy" path="res://src/items/VT Crystal/FRAME 2.png" id="3_wrrxk"]
[ext_resource type="Texture2D" uid="uid://evb7fqb01tm5" path="res://src/items/VT Crystal/FRAME 3.png" id="4_qorf7"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_o8f22"]
radius = 0.120977
height = 1.09613
[sub_resource type="SpriteFrames" id="SpriteFrames_mejdx"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_jv3e6")
}, {
"duration": 1.0,
"texture": ExtResource("3_wrrxk")
}, {
"duration": 1.0,
"texture": ExtResource("4_qorf7")
}],
"loop": true,
"name": &"default",
"speed": 7.0
}]
[node name="Restorative" type="Node3D"]
script = ExtResource("1_3beyl")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.205191, 0)
pixel_size = 0.025
billboard = 2
texture_filter = 0
render_priority = 100
texture = ExtResource("2_6y0d4")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
collision_layer = 4
@@ -26,3 +37,10 @@ collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.190116, 0)
shape = SubResource("CapsuleShape3D_o8f22")
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
billboard = 1
texture_filter = 0
sprite_frames = SubResource("SpriteFrames_mejdx")
autoplay = "default"
frame_progress = 0.513336

View File

@@ -9,29 +9,33 @@ using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("throwable_item")]
public partial class ThrowableItem : InventoryItem, IStackable
public partial class ThrowableItem : Node3D, IBaseInventoryItem, IStackable
{
public override void _Notification(int what) => this.Notify(what);
[Node] private Sprite3D _sprite { get; set; } = default!;
public ThrowableItem()
{
var rng = new RandomNumberGenerator();
rng.Randomize();
Count = new AutoProp<int>(rng.RandiRange(1, 5));
}
public override void _Ready()
{
_sprite.Texture = Stats.Texture;
var rng = new RandomNumberGenerator();
rng.Randomize();
Count = new AutoProp<int>(rng.RandiRange(Stats.MinimumCount, Stats.MaximumCount));
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
[Save("throwable_item_element")]
public ElementType ElementType => Stats.ElementType;
@@ -40,7 +44,7 @@ public partial class ThrowableItem : InventoryItem, IStackable
[Save("throwable_item_heal_vt")]
public int HealVTAmount => Stats.HealVTAmount;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
public void SetElementType(ElementType elementType) => Stats.ElementType = elementType;
@@ -53,7 +57,7 @@ public partial class ThrowableItem : InventoryItem, IStackable
[Save("throwable_item_stats")]
public ThrowableItemStats Stats { get; set; }
public override Texture2D GetTexture() => Stats.Texture;
public Texture2D GetTexture() => Stats.Texture;
public void SetCount(int count) => Count.OnNext(count);
}

View File

@@ -31,7 +31,6 @@ shape = SubResource("BoxShape3D_03cqg")
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
pixel_size = 0.025
billboard = 2
texture_filter = 0
render_priority = 100

View File

@@ -1,18 +1,18 @@
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=2 format=3 uid="uid://b12mgrqpki54y"]
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://b12mgrqpki54y"]
[ext_resource type="Texture2D" uid="uid://djby4qor86st1" path="res://src/items/Icons/Unidentified Item.png" id="1_r4wv3"]
[ext_resource type="Script" uid="uid://d3wlunkcuv2w2" path="res://src/items/throwable/ThrowableItemStats.cs" id="1_xaank"]
[resource]
script = ExtResource("1_xaank")
HealHPAmount = 0
HealVTAmount = 0
ThrowableItemTag = 0
ElementType = 0
UsableItemTag = 0
MinimumCount = 1
MaximumCount = 8
Name = "Mystery Dice"
Description = "Mystery dice."
Name = "Unknown Dice"
Description = "Unknown Dice."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
@@ -25,7 +25,9 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_r4wv3")
metadata/_custom_type_script = "uid://d3wlunkcuv2w2"

View File

@@ -15,7 +15,7 @@ public partial class ThrownItem : RigidBody3D, IThrownItem
[Dependency] public IGame Game => this.DependOn<IGame>();
public InventoryItem ItemThatIsThrown { get; set; }
public IBaseInventoryItem ItemThatIsThrown { get; set; }
private EffectService _effectService;
private ItemReroller _itemReroller;

View File

@@ -35,7 +35,6 @@ shape = SubResource("SphereShape3D_xxdqr")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.1, 0)
pixel_size = 0.025
billboard = 2
texture_filter = 0
texture = SubResource("ViewportTexture_xxdqr")
@@ -55,10 +54,10 @@ size_flags_vertical = 3
transparent_bg = true
handle_input_locally = false
canvas_cull_mask = 4293918721
size = Vector2i(100, 100)
size = Vector2i(150, 150)
render_target_update_mode = 4
[node name="Sprite" type="Sprite2D" parent="Sprite3D/SubViewportContainer/SubViewport"]
unique_name_in_owner = true
texture_filter = 1
offset = Vector2(50, 50)
offset = Vector2(75, 75)

View File

@@ -2,14 +2,13 @@ using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using System;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("weapon")]
public partial class Weapon : EquipableItem
public partial class Weapon : Node3D, IWeapon
{
public override void _Notification(int what) => this.Notify(what);
@@ -25,26 +24,26 @@ public partial class Weapon : EquipableItem
_bonusLuck = Stats.BonusLuck;
}
public override string ItemName => Stats.Name;
public string ItemName => Stats.Name;
public override string Description => Stats.Description;
public string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public float ThrowSpeed => Stats.ThrowSpeed;
[Save("weapon_attack_speed")]
public double AttackSpeed => Stats.AttackSpeed;
[Save("weapon_tag")]
public WeaponTag WeaponTag => Stats.WeaponTag;
public override ItemTag ItemTag => Stats.ItemTag;
public ItemTag ItemTag => Stats.ItemTag;
[Save("weapon_element")]
public ElementType WeaponElement => Stats.WeaponElement;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance);
public void IncreaseAttack(int bonus) => _bonusDamage += bonus;
@@ -58,11 +57,15 @@ public partial class Weapon : EquipableItem
public void SetLuck(int newBonus) => _bonusLuck = newBonus;
public override int BonusAttack { get => _bonusDamage; }
public int BonusAttack { get => _bonusDamage; }
public override int BonusDefense { get => _bonusDefense; }
public int BonusDefense { get => _bonusDefense; }
public override int BonusLuck { get => _bonusLuck; }
public int BonusLuck { get => _bonusLuck; }
public int BonusHP { get; }
public int BonusVT { get; }
[Save("weapon_bonus_damage")]
private int _bonusDamage { get; set; } = 0;
@@ -76,6 +79,9 @@ public partial class Weapon : EquipableItem
[Export]
[Save("weapon_stats")]
public WeaponStats Stats { get; set; } = new WeaponStats();
public Augment Augment { get; set; }
public override Texture2D GetTexture() => Stats.Texture;
public bool Glued { get; set; }
public Texture2D GetTexture() => Stats.Texture;
}

View File

@@ -28,7 +28,6 @@ collision_mask = 0
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
pixel_size = 0.025
billboard = 2
texture_filter = 0

View File

@@ -1,14 +1,14 @@
[gd_resource type="Resource" script_class="WeaponStats" load_steps=4 format=3 uid="uid://db075qhmlmrcu"]
[gd_resource type="Resource" script_class="WeaponStats" load_steps=3 format=3 uid="uid://db075qhmlmrcu"]
[ext_resource type="Texture2D" uid="uid://cj1psfba5bhup" path="res://src/items/3D Render Icons/3Dkubel.png" id="1_gulxx"]
[ext_resource type="Script" uid="uid://cc7byqeolw5y4" 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"]
[ext_resource type="AudioStream" uid="uid://ilf2s8ct2stt" path="res://src/audio/sfx/PLAYER_slower_slash.ogg" id="1_xfglq"]
[resource]
script = ExtResource("1_kbje7")
AttackSpeed = 1.0
WeaponElement = 5
WeaponTag = 0
SelfDamage = 0
SoundEffect = 4
Name = "Kubel"
Description = "+9 ATK
@@ -25,8 +25,9 @@ TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_kwtbu")
AudioStream = ExtResource("1_xfglq")
Texture = ExtResource("1_gulxx")

View File

@@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="WeaponStats" load_steps=2 format=3 uid="uid://u8ed8gs5xx2h"]
[gd_resource type="Resource" script_class="WeaponStats" load_steps=3 format=3 uid="uid://u8ed8gs5xx2h"]
[ext_resource type="Texture2D" uid="uid://b4b2qa08jn6vp" path="res://src/items/weapons/textures/AIRSPEAR.PNG" id="1_f06uw"]
[ext_resource type="Script" uid="uid://cc7byqeolw5y4" path="res://src/items/weapons/WeaponStats.cs" id="2_j7txh"]
[resource]
@@ -7,6 +8,7 @@ script = ExtResource("2_j7txh")
AttackSpeed = 1.0
WeaponElement = 2
WeaponTag = 0
SelfDamage = 0
SoundEffect = 22
Name = "Mother's Spear"
Description = "\"Earth, When I am about to Die, I Lean on you. Earth, While I am Alive, I Depend on You\"."
@@ -22,6 +24,8 @@ HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_f06uw")

View File

@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://c63uufq63qpuy"
path.bptc="res://.godot/imported/RONDO.PNG-77b50e9afaf9eb46f5672e079a5f50bf.bptc.ctex"
path.bptc="res://.godot/imported/Rondo.png-57553b850a093da6dba43a1e1947fcce.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
@@ -11,8 +11,8 @@ metadata={
[deps]
source_file="res://src/items/weapons/textures/RONDO.PNG"
dest_files=["res://.godot/imported/RONDO.PNG-77b50e9afaf9eb46f5672e079a5f50bf.bptc.ctex"]
source_file="res://src/items/weapons/textures/Rondo.png"
dest_files=["res://.godot/imported/Rondo.png-57553b850a093da6dba43a1e1947fcce.bptc.ctex"]
[params]

View File

@@ -20,6 +20,10 @@ public interface IMap : INode3D
void InitializeMapData();
public void FadeIn();
public void FadeOut();
public AutoProp<int> CurrentFloorNumber { get; }
public event Action<(Vector3 Rotation, Vector3 Position)> SpawnPointCreated;

View File

@@ -59,9 +59,11 @@ public partial class Map : Node3D, IMap
var floor = MapOrder.GetChildren().OfType<FloorNode>().ElementAt(CurrentFloorNumber.Value);
if (CurrentFloor is DungeonFloor dungeonFloor && floor is DungeonFloorNode dungeonFloorNode)
dungeonFloor.SpawnEnemies(dungeonFloorNode);
AnimationPlayer.CallDeferred(AnimationPlayer.MethodName.Play, ("fade_in"));
}
public void FadeIn() => AnimationPlayer.Play("fade_in");
public void FadeOut() => AnimationPlayer.Play("fade_out");
public void InitializeMapData()
{
CurrentFloorNumber.OnNext(-1);
@@ -89,7 +91,7 @@ public partial class Map : Node3D, IMap
public async Task LoadFloor(string sceneName)
{
AnimationPlayer.CallDeferred(AnimationPlayer.MethodName.Play, "fade_out");
CallDeferred(MethodName.FadeOut);
_sceneName = sceneName;
var dimmableAudio = GetTree().GetNodesInGroup("DimmableAudio").OfType<IDimmableAudioStreamPlayer>();
foreach (var node in dimmableAudio)

View File

@@ -19,7 +19,22 @@ tracks/0/keys = {
"values": [Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_g6eui"]
[sub_resource type="Animation" id="Animation_v14r0"]
resource_name = "fade_out"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_0qcd2"]
resource_name = "fade_in"
tracks/0/type = "value"
tracks/0/imported = false
@@ -34,39 +49,16 @@ tracks/0/keys = {
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
[sub_resource type="Animation" id="Animation_v14r0"]
resource_name = "fade_out"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(-0.0666667, 0),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_00xd7"]
_data = {
&"RESET": SubResource("Animation_00xd7"),
&"fade_in": SubResource("Animation_g6eui"),
&"fade_in": SubResource("Animation_0qcd2"),
&"fade_out": SubResource("Animation_v14r0")
}
[node name="Map" type="Node3D"]
script = ExtResource("1_bw70o")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
@@ -219,3 +211,11 @@ FloorName = 4
[node name="Final Floor" type="Node" parent="MapOrder"]
script = ExtResource("3_v14r0")
FloorName = 6
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)

Some files were not shown because too many files have changed in this diff Show More