Collaborative changes

This commit is contained in:
2026-04-22 21:26:21 -07:00
parent 6f79c64924
commit c6b958c577
39 changed files with 7634 additions and 1875 deletions
+6 -8
View File
@@ -134,14 +134,12 @@ public class EffectService
public void RandomEffect()
{
var spells = _player.Inventory.Items.OfType<EffectItem>().Where(x => x.UsableItemTag != UsableItemTag.RandomEffect).ToList();
if (spells.Count > 0)
{
var rng = new RandomNumberGenerator();
rng.Randomize();
var index = rng.RandiRange(0, spells.Count - 1);
_game.UseItem(spells[index]);
}
var randomEffects = Enum.GetValues(typeof(UsableItemTag)).Cast<UsableItemTag>().Except([UsableItemTag.RandomEffect, UsableItemTag.None]).ToList();
var rng = new RandomNumberGenerator();
rng.Randomize();
var index = rng.RandiRange(0, randomEffects.Count - 1);
var randomItem = new EffectItem() { Stats = new EffectItemStats() { UsableItemTag = randomEffects[index], BonusAttack = 1, BonusDefense = 1, BonusLuck = 10 } };
_game.UseItem(randomItem);
}
public void DoubleExp()
@@ -12,7 +12,7 @@ _igneousResistance = 0.0
_ferrumResistance = 0.0
_holyResistance = 0.0
_curseResistance = 0.0
ArmorTag = 0
ArmorTag = 1
Name = "Holy Barrier"
StatDescription = "Loses 1 DEF every time the wearer is hit."
FlavorText = "Armor from a country of renowned spell casters.
@@ -1,13 +1,15 @@
using Chickensoft.AutoInject;
using Chickensoft.Collections;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode)), Id("effect_item")]
public partial class EffectItem : Node3D, IBaseInventoryItem
public partial class EffectItem : Node3D, IBaseInventoryItem, IStackable
{
public override void _Notification(int what) => this.Notify(what);
@@ -16,6 +18,7 @@ public partial class EffectItem : Node3D, IBaseInventoryItem
public override void _Ready()
{
_sprite.Texture = Stats.Texture;
Count = new AutoProp<int>(Stats.InitialCount);
}
public string ItemName => Stats.Name;
@@ -41,5 +44,9 @@ public partial class EffectItem : Node3D, IBaseInventoryItem
[Save("effect_item_stats")]
public EffectItemStats Stats { get; set; } = new EffectItemStats();
[Save("ammo_item_count")]
public AutoProp<int> Count { get; private set; } = new AutoProp<int>(3);
public Texture2D GetTexture() => Stats.Texture;
public void SetCount(int count) => Count.OnNext(count);
}
@@ -17,4 +17,8 @@ public partial class EffectItemStats : InventoryItemStats
[Export]
[Save("effect_item_element")]
public ElementType ElementalDamageType { get; set; }
[Export]
[Save("effect_item_initial_count")]
public int InitialCount { get; set; } = 0;
}
@@ -7,6 +7,7 @@
script = ExtResource("2_7dbb6")
UsableItemTag = 17
ElementalDamageType = 0
InitialCount = 3
Name = "Spell Sign: Ablution"
StatDescription = "Lowers user or target to 1 HP."
FlavorText = "A spell that induces extreme vulnerability and a return to a purer state.
@@ -7,6 +7,7 @@
script = ExtResource("2_n24ed")
UsableItemTag = 33
ElementalDamageType = 0
InitialCount = 1
Name = "Spell Sign: Anamnesis"
StatDescription = "Randomly identifies one held unidentified item."
FlavorText = "A spell that traverses the metaphysical tree of genetic memory in search of answers.
@@ -7,6 +7,7 @@
script = ExtResource("2_7c6oa")
UsableItemTag = 27
ElementalDamageType = 0
InitialCount = 1
Name = "Spell Sign: Cell Degradation"
StatDescription = "Lowers all stats."
FlavorText = "A spell for breaking down one's enemies on a cellular level.
@@ -7,6 +7,7 @@
script = ExtResource("2_o41ik")
UsableItemTag = 11
ElementalDamageType = 0
InitialCount = 1
Name = "Spell Sign: Cloth Resolution"
StatDescription = "Raises the effectiveness of currently equipped armor."
FlavorText = "A spell for strengthening armor.
@@ -7,6 +7,7 @@
script = ExtResource("2_n1557")
UsableItemTag = 13
ElementalDamageType = 0
InitialCount = 1
Name = "Spell Sign: Cosmos"
StatDescription = "Increases the users level."
FlavorText = "A summoning spell that draws energy from the harmony of the solar system in order to bolster one's soul.
@@ -0,0 +1,29 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://c60ej6ce8s1ox"]
[ext_resource type="Texture2D" uid="uid://esqaln68twiw" path="res://src/items/Icons/Unidentified Item.png" id="1_ne34t"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="2_nwwms"]
[resource]
script = ExtResource("2_nwwms")
JewelTag = 0
Name = "Unidentified Jewel"
StatDescription = ""
FlavorText = ""
SpawnRate = 0.15
BonusAttack = 0
BonusDefense = 0
BonusLuck = 0
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 2
Texture = ExtResource("1_ne34t")
metadata/_custom_type_script = "uid://btikba31yb0tl"
@@ -0,0 +1,32 @@
[gd_resource type="Resource" script_class="WeaponStats" load_steps=3 format=3 uid="uid://b3t6govsnap4p"]
[ext_resource type="Texture2D" uid="uid://dfpc2ighwlxjk" path="res://src/items/weapons/textures/joyeuse.png" id="1_yuqyb"]
[ext_resource type="Script" uid="uid://cc7byqeolw5y4" path="res://src/items/weapons/WeaponStats.cs" id="2_fr8u4"]
[resource]
script = ExtResource("2_fr8u4")
AttackSpeed = 1.0
WeaponElement = 3
WeaponTag = 0
SelfDamage = 0
SoundEffect = 23
Name = "Joyeuse"
StatDescription = "Attacks twice."
FlavorText = "Placeholder text, something about blade found in the midst of a devil's whirlpool"
SpawnRate = 0.008
BonusAttack = 6
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_yuqyb")
@@ -3,7 +3,7 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bl4xempufmgr5"
path.bptc="res://.godot/imported/PALM OF HEAVEN.PNG-35554a412a9c4bc09647efa86e6b581e.bptc.ctex"
path.bptc="res://.godot/imported/palm of heaven.png-8afcb54f797720ff29f3c00c68c0f579.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
@@ -11,8 +11,8 @@ metadata={
[deps]
source_file="res://src/items/weapons/textures/PALM OF HEAVEN.PNG"
dest_files=["res://.godot/imported/PALM OF HEAVEN.PNG-35554a412a9c4bc09647efa86e6b581e.bptc.ctex"]
source_file="res://src/items/weapons/textures/palm of heaven.png"
dest_files=["res://.godot/imported/palm of heaven.png-8afcb54f797720ff29f3c00c68c0f579.bptc.ctex"]
[params]