Mystery item implementation
This commit is contained in:
@@ -60,6 +60,10 @@ public class EffectService
|
||||
public void TurnAllEnemiesInRoomIntoHealingItem()
|
||||
{
|
||||
var currentRoom = _map.GetPlayersCurrentRoom();
|
||||
|
||||
if (currentRoom is not MonsterRoom)
|
||||
return;
|
||||
|
||||
var currentEnemies = currentRoom.EnemiesInRoom;
|
||||
foreach (var enemy in currentEnemies)
|
||||
{
|
||||
@@ -86,6 +90,10 @@ public class EffectService
|
||||
public void HealAllEnemiesAndPlayerInRoomToFull()
|
||||
{
|
||||
var currentRoom = _map.GetPlayersCurrentRoom();
|
||||
|
||||
if (currentRoom is not MonsterRoom)
|
||||
return;
|
||||
|
||||
var currentEnemies = currentRoom.EnemiesInRoom;
|
||||
foreach (var enemy in currentEnemies)
|
||||
enemy.SetCurrentHP(enemy.GetMaximumHP());
|
||||
@@ -95,6 +103,10 @@ public class EffectService
|
||||
public void AbsorbHPFromAllEnemiesInRoom()
|
||||
{
|
||||
var currentRoom = _map.GetPlayersCurrentRoom();
|
||||
|
||||
if (currentRoom is not MonsterRoom)
|
||||
return;
|
||||
|
||||
var currentEnemies = currentRoom.EnemiesInRoom;
|
||||
var hpToAbsorb = 0.0;
|
||||
foreach (var enemy in currentEnemies)
|
||||
@@ -106,6 +118,10 @@ public class EffectService
|
||||
public void DealElementalDamageToAllEnemiesInRoom(ElementType elementType)
|
||||
{
|
||||
var currentRoom = _map.GetPlayersCurrentRoom();
|
||||
|
||||
if (currentRoom is not MonsterRoom)
|
||||
return;
|
||||
|
||||
var currentEnemies = currentRoom.EnemiesInRoom;
|
||||
foreach (var enemy in currentEnemies)
|
||||
enemy.TakeDamage(20, elementType);
|
||||
@@ -132,20 +148,22 @@ public class EffectService
|
||||
|
||||
public void RaiseCurrentWeaponAttack()
|
||||
{
|
||||
if (_player.EquippedWeapon.Value.ItemName == string.Empty)
|
||||
if (string.IsNullOrEmpty(_player.EquippedWeapon.Value.ItemName))
|
||||
return;
|
||||
|
||||
var currentWeapon = (Weapon)_player.EquippedWeapon.Value;
|
||||
currentWeapon.IncreaseWeaponAttack(1);
|
||||
_player.ModifyBonusAttack(1);
|
||||
}
|
||||
|
||||
public void RaiseCurrentArmorDefense()
|
||||
{
|
||||
if (_player.EquippedArmor.Value.ItemName == string.Empty)
|
||||
if (string.IsNullOrEmpty(_player.EquippedArmor.Value.ItemName))
|
||||
return;
|
||||
|
||||
var currentArmor = (Armor)_player.EquippedArmor.Value;
|
||||
currentArmor.IncreaseArmorDefense(1);
|
||||
_player.ModifyBonusDefense(1);
|
||||
}
|
||||
|
||||
public void RaiseLevel()
|
||||
@@ -197,12 +215,15 @@ public class EffectService
|
||||
public void ChangeAffinity(ThrowableItem throwableItem)
|
||||
{
|
||||
var maximumElements = Enum.GetNames(typeof(ElementType)).Length;
|
||||
throwableItem.SetElementType(throwableItem.ElementType + 1 % maximumElements);
|
||||
var newElement = ((int)throwableItem.ElementType + 1) % maximumElements;
|
||||
throwableItem.SetElementType((ElementType)newElement);
|
||||
|
||||
// TODO: Make this an inventory animation to cycle through elements.
|
||||
throwableItem.SetDescription(
|
||||
$"Inflicts {throwableItem.ElementType} damage when thrown." +
|
||||
$"{System.Environment.NewLine}Use item to change Affinity.");
|
||||
|
||||
throwableItem.SetCount(throwableItem.Count + 1);
|
||||
}
|
||||
|
||||
public void WarpToExit(IPlayer player)
|
||||
|
||||
@@ -34,6 +34,15 @@ public partial class Inventory : Node, IInventory
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool TryInsert(InventoryItem inventoryItem, int index)
|
||||
{
|
||||
if (Items.Count >= _maxInventorySize || index >= _maxInventorySize || index < 0)
|
||||
return false;
|
||||
|
||||
Items.Insert(index, inventoryItem);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Remove(InventoryItem inventoryItem) => Items.Remove(inventoryItem);
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +1,36 @@
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public partial class ItemDatabase : Node
|
||||
{
|
||||
[Export]
|
||||
public PackedScene WeaponScene { get; set; }
|
||||
public ImmutableList<InventoryItem> Items { get; set; }
|
||||
|
||||
[Export]
|
||||
public PackedScene ArmorScene { get; set; }
|
||||
public InventoryItem PickItem<T>(T itemToExclude = null)
|
||||
where T : InventoryItem
|
||||
{
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
|
||||
[Export]
|
||||
public PackedScene AccessoryScene { get; set; }
|
||||
var itemsToSelectFrom = Items;
|
||||
|
||||
[Export]
|
||||
public PackedScene ThrowableItemScene { get; set; }
|
||||
if (itemToExclude is not null)
|
||||
itemsToSelectFrom = [.. itemsToSelectFrom.OfType<T>().Where(x => x.ItemName != itemToExclude.ItemName)];
|
||||
|
||||
[Export]
|
||||
public PackedScene ConsumableItemScene { get; set; }
|
||||
var weights = itemsToSelectFrom.Select(x => x.SpawnRate).ToArray();
|
||||
var selectedItem = itemsToSelectFrom.ToArray()[rng.RandWeighted(weights)];
|
||||
|
||||
[Export]
|
||||
public PackedScene EffectItemScene { get; set; }
|
||||
if (selectedItem is ThrowableItem throwableItem)
|
||||
throwableItem.SetCount(rng.RandiRange(throwableItem.Stats.MinimumCount, throwableItem.Stats.MaximumCount));
|
||||
|
||||
public InventoryItem[] Initialize()
|
||||
return selectedItem;
|
||||
}
|
||||
|
||||
public ItemDatabase()
|
||||
{
|
||||
var database = new List<InventoryItem>();
|
||||
var armorResources = DirAccess.GetFilesAt("res://src/items/armor/resources/");
|
||||
@@ -37,7 +43,7 @@ public partial class ItemDatabase : Node
|
||||
foreach (var armor in armorResources)
|
||||
{
|
||||
var armorInfo = GD.Load<ArmorStats>($"res://src/items/armor/resources/{armor}");
|
||||
var armorScene = ArmorScene.Instantiate<Armor>();
|
||||
var armorScene = ResourceLoader.Load<PackedScene>("res://src/items/armor/Armor.tscn").Instantiate<Armor>();
|
||||
armorScene.Stats = armorInfo;
|
||||
database.Add(armorScene);
|
||||
}
|
||||
@@ -45,7 +51,7 @@ public partial class ItemDatabase : Node
|
||||
foreach (var weapon in weaponResources)
|
||||
{
|
||||
var weaponInfo = GD.Load<WeaponStats>($"res://src/items/weapons/resources/{weapon}");
|
||||
var weaponScene = WeaponScene.Instantiate<Weapon>();
|
||||
var weaponScene = ResourceLoader.Load<PackedScene>("res://src/items/weapons/Weapon.tscn").Instantiate<Weapon>();
|
||||
weaponScene.Stats = weaponInfo;
|
||||
database.Add(weaponScene);
|
||||
}
|
||||
@@ -53,7 +59,7 @@ public partial class ItemDatabase : Node
|
||||
foreach (var accessory in accessoryResources)
|
||||
{
|
||||
var accessoryInfo = GD.Load<AccessoryStats>($"res://src/items/accessory/resources/{accessory}");
|
||||
var accessoryScene = AccessoryScene.Instantiate<Accessory>();
|
||||
var accessoryScene = ResourceLoader.Load<PackedScene>("res://src/items/accessory/Accessory.tscn").Instantiate<Accessory>();
|
||||
accessoryScene.Stats = accessoryInfo;
|
||||
database.Add(accessoryScene);
|
||||
}
|
||||
@@ -61,7 +67,7 @@ public partial class ItemDatabase : Node
|
||||
foreach (var throwable in throwableResources)
|
||||
{
|
||||
var throwableItemInfo = GD.Load<ThrowableItemStats>($"res://src/items/throwable/resources/{throwable}");
|
||||
var throwableItemScene = ThrowableItemScene.Instantiate<ThrowableItem>();
|
||||
var throwableItemScene = ResourceLoader.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn").Instantiate<ThrowableItem>();
|
||||
throwableItemScene.Stats = throwableItemInfo;
|
||||
database.Add(throwableItemScene);
|
||||
}
|
||||
@@ -69,7 +75,7 @@ public partial class ItemDatabase : Node
|
||||
foreach (var consumable in consumableResources)
|
||||
{
|
||||
var consumableItemInfo = GD.Load<ConsumableItemStats>($"res://src/items/consumable/resources/{consumable}");
|
||||
var consumableItemScene = ConsumableItemScene.Instantiate<ConsumableItem>();
|
||||
var consumableItemScene = ResourceLoader.Load<PackedScene>("res://src/items/consumable/ConsumableItem.tscn").Instantiate<ConsumableItem>();
|
||||
consumableItemScene.Stats = consumableItemInfo;
|
||||
database.Add(consumableItemScene);
|
||||
}
|
||||
@@ -77,11 +83,11 @@ public partial class ItemDatabase : Node
|
||||
foreach (var effectItem in effectResources)
|
||||
{
|
||||
var effectItemInfo = GD.Load<EffectItemStats>($"res://src/items/effect/resources/{effectItem}");
|
||||
var effectItemScene = EffectItemScene.Instantiate<EffectItem>();
|
||||
var effectItemScene = ResourceLoader.Load<PackedScene>("res://src/items/effect/EffectItem.tscn").Instantiate<EffectItem>();
|
||||
effectItemScene.Stats = effectItemInfo;
|
||||
database.Add(effectItemScene);
|
||||
}
|
||||
|
||||
return [.. database];
|
||||
Items = [.. database];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_resource type="Resource" script_class="AccessoryStats" load_steps=3 format=3 uid="uid://ecmjxvihuahv"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://brvxh7iiurnem" path="res://src/items/accessory/textures/MASK 04.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")
|
||||
Name = "Mask"
|
||||
Description = "Unknown mask."
|
||||
ATKUp = 0
|
||||
DEFUp = 0
|
||||
LuckUp = 0.0
|
||||
MaxHPUp = 0
|
||||
MaxVTUp = 0
|
||||
AccessoryTag = 0
|
||||
Name = "Mask"
|
||||
Description = "Unknown mask."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 2
|
||||
Texture = ExtResource("1_fbxyn")
|
||||
metadata/_custom_type_script = "uid://b8arlmivk68b"
|
||||
BIN
Zennysoft.Game.Ma/src/items/accessory/textures/MASK 04.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/accessory/textures/MASK 04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://brvxh7iiurnem"
|
||||
path="res://.godot/imported/MASK 04.png-914661f8104473279933392df3169ef1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/accessory/textures/MASK 04.png"
|
||||
dest_files=["res://.godot/imported/MASK 04.png-914661f8104473279933392df3169ef1.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@@ -23,9 +23,12 @@ public partial class Armor : EquipableItem
|
||||
|
||||
public override float ThrowSpeed => Stats.ThrowSpeed;
|
||||
|
||||
public int Defense => Stats.Defense;
|
||||
public int Defense => Stats.Defense + _bonusDefense;
|
||||
|
||||
public void IncreaseArmorDefense(int bonus) => Stats.Defense += bonus;
|
||||
[Save("armor_bonus_defense")]
|
||||
private int _bonusDefense { get; set; } = 0;
|
||||
|
||||
public void IncreaseArmorDefense(int bonus) => _bonusDefense += bonus;
|
||||
|
||||
public override ItemTag ItemTag => Stats.ItemTag;
|
||||
|
||||
|
||||
@@ -15,15 +15,12 @@ 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.0006
|
||||
billboard = 2
|
||||
shaded = true
|
||||
double_sided = false
|
||||
alpha_cut = 1
|
||||
texture_filter = 0
|
||||
render_priority = 100
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481)
|
||||
shape = SubResource("BoxShape3D_qdeu2")
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_resource type="Resource" script_class="ArmorStats" load_steps=3 format=3 uid="uid://05hilwkmrs7a"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cics3txmkkloh" path="res://src/items/armor/textures/MYSTERY.png" id="1_rp3e6"]
|
||||
[ext_resource type="Script" uid="uid://dqtp6ewvttoyu" path="res://src/items/armor/ArmorStats.cs" id="1_s5wnf"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_s5wnf")
|
||||
Name = "Coat"
|
||||
Description = "Unidentified coat."
|
||||
Defense = 0
|
||||
_telluricResistance = 0.0
|
||||
_aeolicResistance = 0.0
|
||||
_hydricResistance = 0.0
|
||||
_igneousResistance = 0.0
|
||||
_ferrumResistance = 0.0
|
||||
Name = "Coat"
|
||||
Description = "Unidentified coat."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 2
|
||||
Texture = ExtResource("1_rp3e6")
|
||||
metadata/_custom_type_script = "uid://dqtp6ewvttoyu"
|
||||
BIN
Zennysoft.Game.Ma/src/items/armor/textures/MYSTERY.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/armor/textures/MYSTERY.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cics3txmkkloh"
|
||||
path="res://.godot/imported/MYSTERY.png-17d813137e6c64f71109fe85ac9d2857.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/armor/textures/MYSTERY.png"
|
||||
dest_files=["res://.godot/imported/MYSTERY.png-17d813137e6c64f71109fe85ac9d2857.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@@ -36,6 +36,8 @@ public partial class ConsumableItem : InventoryItem
|
||||
|
||||
public int RaiseVTAmount => Stats.RaiseVTAmount;
|
||||
|
||||
public override ItemTag ItemTag => Stats.ItemTag;
|
||||
|
||||
[Export]
|
||||
[Save("consumable_item_stats")]
|
||||
public ConsumableItemStats Stats { get; set; } = new ConsumableItemStats();
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
[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://b5s0sr6ddpjp4" path="res://src/items/consumable/textures/Mystery.png" id="1_g5ngs"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_51ovu")
|
||||
Name = "Fragment"
|
||||
Description = "Unidentified fragment."
|
||||
RaiseHPAmount = 0
|
||||
RaiseVTAmount = 0
|
||||
Name = "Fragment"
|
||||
Description = "Unidentified fragment."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 2
|
||||
Texture = ExtResource("1_g5ngs")
|
||||
metadata/_custom_type_script = "uid://cymeea1n4f04i"
|
||||
BIN
Zennysoft.Game.Ma/src/items/consumable/textures/Mystery.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/consumable/textures/Mystery.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b5s0sr6ddpjp4"
|
||||
path="res://.godot/imported/Mystery.png-c83e5746610e0656fa2a5584a2f1b51d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/consumable/textures/Mystery.png"
|
||||
dest_files=["res://.godot/imported/Mystery.png-c83e5746610e0656fa2a5584a2f1b51d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@@ -30,6 +30,8 @@ public partial class EffectItem : InventoryItem
|
||||
|
||||
public UsableItemTag UsableItemTag => Stats.UsableItemTag;
|
||||
|
||||
public override ItemTag ItemTag => Stats.ItemTag;
|
||||
|
||||
public void SetEffectTag(UsableItemTag effect) => Stats.UsableItemTag = effect;
|
||||
|
||||
[Export]
|
||||
|
||||
21
Zennysoft.Game.Ma/src/items/effect/resources/MysteryTag.tres
Normal file
21
Zennysoft.Game.Ma/src/items/effect/resources/MysteryTag.tres
Normal file
@@ -0,0 +1,21 @@
|
||||
[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://hcnit28wyhwq" path="res://src/items/effect/textures/mystery seal.png" id="1_yerq2"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_eeb8x")
|
||||
Name = "Seal"
|
||||
Description = "Mystery seal."
|
||||
UsableItemTag = 0
|
||||
ElementalDamageType = 0
|
||||
Name = "Seal"
|
||||
Description = "Mystery seal."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 2
|
||||
Texture = ExtResource("1_yerq2")
|
||||
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"
|
||||
BIN
Zennysoft.Game.Ma/src/items/effect/textures/mystery seal.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/effect/textures/mystery seal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://hcnit28wyhwq"
|
||||
path="res://.godot/imported/mystery seal.png-a1e02d59d178b9e4c4e9836dba36e1fc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/effect/textures/mystery seal.png"
|
||||
dest_files=["res://.godot/imported/mystery seal.png-a1e02d59d178b9e4c4e9836dba36e1fc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@@ -16,16 +16,4 @@ public partial class Restorative : Node3D, IHealthPack
|
||||
[Node] public Area3D Pickup { get; set; } = default!;
|
||||
|
||||
public double RestoreAmount => 4;
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void OnEntered(Node3D body)
|
||||
{
|
||||
GameEventDepot.OnRestorativePickedUp(this);
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,14 +8,12 @@ radius = 0.13613
|
||||
height = 1.09613
|
||||
|
||||
[node name="Restorative" type="Node3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
|
||||
script = ExtResource("1_3beyl")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.363669, 0)
|
||||
pixel_size = 0.001
|
||||
billboard = 2
|
||||
shaded = true
|
||||
texture_filter = 0
|
||||
render_priority = 100
|
||||
texture = ExtResource("1_1rwq6")
|
||||
|
||||
@@ -37,6 +37,8 @@ public partial class ThrowableItem : InventoryItem, IStackable
|
||||
|
||||
public int HealVTAmount => Stats.HealVTAmount;
|
||||
|
||||
public override ItemTag ItemTag => Stats.ItemTag;
|
||||
|
||||
public void SetElementType(ElementType elementType) => Stats.ElementType = elementType;
|
||||
|
||||
public void SetDescription(string description) => Stats.Description = description;
|
||||
|
||||
@@ -14,14 +14,12 @@ collision_layer = 4
|
||||
collision_mask = 0
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0600509, 0.26725, 0.180481)
|
||||
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)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
pixel_size = 0.0005
|
||||
billboard = 2
|
||||
shaded = true
|
||||
texture_filter = 0
|
||||
render_priority = 100
|
||||
|
||||
@@ -28,4 +28,10 @@ public partial class ThrowableItemStats : InventoryItemStats
|
||||
[Export]
|
||||
[Save("throwable_item_usable_tag")]
|
||||
public UsableItemTag UsableItemTag { get; set; } = UsableItemTag.None;
|
||||
|
||||
[Export]
|
||||
public int MinimumCount { get; set; } = 1;
|
||||
|
||||
[Export]
|
||||
public int MaximumCount { get; set; } = 8;
|
||||
}
|
||||
|
||||
@@ -5,16 +5,21 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_ewck5")
|
||||
ThrowableItemTags = Array[int]([1])
|
||||
ElementType = 0
|
||||
UsableItemTags = Array[int]([])
|
||||
Name = "Geomantic Dice"
|
||||
Description = "Inflicts base damage when thrown.
|
||||
Use item to change Affinity."
|
||||
Texture = ExtResource("1_jhits")
|
||||
SpawnRate = 0.1
|
||||
ThrowableItemTag = 3
|
||||
ElementType = 0
|
||||
UsableItemTag = 0
|
||||
MinimumCount = 1
|
||||
MaximumCount = 8
|
||||
Name = "Geomantic Dice"
|
||||
Description = "Inflicts base damage when thrown.
|
||||
Use item to change Affinity."
|
||||
SpawnRate = 1.0
|
||||
ThrowSpeed = 20.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 20
|
||||
ItemTags = Array[int]([])
|
||||
ItemTag = 0
|
||||
Texture = ExtResource("1_jhits")
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_m680r")
|
||||
Name = "Gospel of Dimension"
|
||||
Description = "Teleports target to a random location."
|
||||
ThrowableItemTag = 0
|
||||
ElementType = 0
|
||||
UsableItemTag = 0
|
||||
MinimumCount = 1
|
||||
MaximumCount = 8
|
||||
Name = "Gospel of Dimension"
|
||||
Description = "Teleports target to a random location."
|
||||
SpawnRate = 0.1
|
||||
|
||||
@@ -5,9 +5,13 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_pn8sr")
|
||||
Name = "Gospel of Escape"
|
||||
Description = "Warps target to the exit. No effect on player if exit has not been found."
|
||||
ThrowableItemTag = 0
|
||||
ElementType = 0
|
||||
UsableItemTag = 0
|
||||
MinimumCount = 1
|
||||
MaximumCount = 8
|
||||
Name = "Gospel of Escape"
|
||||
Description = "Warps target to the exit. No effect on player if exit has not been found."
|
||||
SpawnRate = 0.5
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
[gd_resource type="Resource" script_class="ThrowableItemStats" load_steps=3 format=3 uid="uid://b12mgrqpki54y"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dit865t330r1e" path="res://src/items/throwable/textures/MysteryDice.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")
|
||||
Name = "Mystery Dice"
|
||||
Description = "Mystery dice."
|
||||
ThrowableItemTag = 0
|
||||
ElementType = 0
|
||||
UsableItemTag = 0
|
||||
MinimumCount = 1
|
||||
MaximumCount = 8
|
||||
Name = "Mystery Dice"
|
||||
Description = "Mystery dice."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 0
|
||||
Texture = ExtResource("1_r4wv3")
|
||||
metadata/_custom_type_script = "uid://d3wlunkcuv2w2"
|
||||
BIN
Zennysoft.Game.Ma/src/items/throwable/textures/MysteryDice.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/throwable/textures/MysteryDice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dit865t330r1e"
|
||||
path="res://.godot/imported/MysteryDice.png-2f382950a7e0406a57e80258738116c4.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/throwable/textures/MysteryDice.png"
|
||||
dest_files=["res://.godot/imported/MysteryDice.png-2f382950a7e0406a57e80258738116c4.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
@@ -24,8 +24,6 @@ public partial class Weapon : EquipableItem
|
||||
|
||||
public override float SpawnRate => Stats.SpawnRate;
|
||||
|
||||
public int Damage => Stats.Damage;
|
||||
|
||||
public override double ThrowDamage => Stats.ThrowDamage;
|
||||
|
||||
public override float ThrowSpeed => Stats.ThrowSpeed;
|
||||
@@ -42,7 +40,12 @@ public partial class Weapon : EquipableItem
|
||||
|
||||
public double ElementalDamageBonus => Stats.ElementalDamageBonus;
|
||||
|
||||
public void IncreaseWeaponAttack(int bonus) => Stats.Damage += bonus;
|
||||
public int Damage => Stats.Damage + _bonusDamage;
|
||||
|
||||
public void IncreaseWeaponAttack(int bonus) => _bonusDamage += bonus;
|
||||
|
||||
[Save("weapon_bonus_damage")]
|
||||
private int _bonusDamage { get; set; } = 0;
|
||||
|
||||
[Export]
|
||||
[Save("weapon_stats")]
|
||||
|
||||
@@ -15,10 +15,9 @@ collision_mask = 0
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="Pickup"]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(0.0978955, 0, 0.995197, 0, 1, 0, -0.995197, 0, 0.0978955, 0, 0.271026, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
|
||||
pixel_size = 0.0006
|
||||
billboard = 2
|
||||
shaded = true
|
||||
double_sided = false
|
||||
alpha_antialiasing_mode = 1
|
||||
texture_filter = 0
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_resource type="Resource" script_class="WeaponStats" load_steps=3 format=3 uid="uid://cfhwlpa0d7wb4"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cpwwr4elpbo6i" path="res://src/items/weapons/textures/mystery rod.png" id="1_8fklg"]
|
||||
[ext_resource type="Script" uid="uid://cc7byqeolw5y4" path="res://src/items/weapons/WeaponStats.cs" id="1_iran7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_iran7")
|
||||
Name = "Mystery rod"
|
||||
Description = "Unidentified rod."
|
||||
Damage = 0
|
||||
Luck = 0.05
|
||||
AttackSpeed = 1.0
|
||||
WeaponElement = 0
|
||||
ElementalDamageBonus = 1.0
|
||||
WeaponTag = 0
|
||||
Name = "Mystery rod"
|
||||
Description = "Unidentified rod."
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 2
|
||||
Texture = ExtResource("1_8fklg")
|
||||
metadata/_custom_type_script = "uid://cc7byqeolw5y4"
|
||||
BIN
Zennysoft.Game.Ma/src/items/weapons/textures/mystery rod.png
Normal file
BIN
Zennysoft.Game.Ma/src/items/weapons/textures/mystery rod.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cpwwr4elpbo6i"
|
||||
path="res://.godot/imported/mystery rod.png-2c7d466030a42082bd4ef4c9910f5943.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/items/weapons/textures/mystery rod.png"
|
||||
dest_files=["res://.godot/imported/mystery rod.png-2c7d466030a42082bd4ef4c9910f5943.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Reference in New Issue
Block a user