This repository has been archived by the owner on Jan 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
843 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set version=0.7.00 | ||
dotnet pack ../src/OpenRpg.Genres -c Release -o ../../_dist /p:version=%version% | ||
dotnet pack ../src/OpenRpg.Genres.Fantasy -c Release -o ../../_dist /p:version=%version% | ||
dotnet pack ../src/OpenRpg.Genres.Scifi -c Release -o ../../_dist /p:version=%version% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
59 changes: 13 additions & 46 deletions
59
src/OpenRpg.Genres.Fantasy/Extensions/EquipmentExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,21 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using OpenRpg.Core.Effects; | ||
using OpenRpg.Genres.Fantasy.Equipment; | ||
using OpenRpg.Items; | ||
using OpenRpg.Genres.Fantasy.Equipment.Slots; | ||
using OpenRpg.Genres.Fantasy.Types; | ||
using OpenRpg.Items.Equipment; | ||
using OpenRpg.Items.Extensions; | ||
|
||
namespace OpenRpg.Genres.Fantasy.Extensions | ||
{ | ||
public static class EquipmentExtensions | ||
{ | ||
public static IEnumerable<IEquipmentSlot<IItem>> GetEquipmentSlots(this IEquipment equipment) | ||
{ | ||
yield return equipment.BackSlot; | ||
yield return equipment.FootSlot; | ||
yield return equipment.HeadSlot; | ||
yield return equipment.NeckSlot; | ||
yield return equipment.Ring1Slot; | ||
yield return equipment.Ring2Slot; | ||
yield return equipment.WristSlot; | ||
yield return equipment.OffHandSlot; | ||
yield return equipment.MainHandSlot; | ||
yield return equipment.LowerBodySlot; | ||
yield return equipment.UpperBodySlot; | ||
} | ||
|
||
private static void ProcessEquipmentSlot(IEquipmentSlot<IItem> equipmentSlot, List<Effect> effectList) | ||
{ | ||
if(equipmentSlot?.SlottedItem == null) { return; } | ||
var effects = equipmentSlot.SlottedItem.GetItemEffects(); | ||
effectList.AddRange(effects); | ||
} | ||
|
||
public static ICollection<Effect> GetEquipmentEffects(this IEquipment equipment) | ||
{ | ||
var equipmentEffects = new List<Effect>(); | ||
|
||
ProcessEquipmentSlot(equipment.NeckSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.OffHandSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.LowerBodySlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.UpperBodySlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.BackSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.FootSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.HeadSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.Ring1Slot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.Ring2Slot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.WristSlot, equipmentEffects); | ||
ProcessEquipmentSlot(equipment.MainHandSlot, equipmentEffects); | ||
|
||
return equipmentEffects; | ||
} | ||
public static BackSlot BackSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.BackSlot) as BackSlot; | ||
public static FootSlot FootSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.FootSlot) as FootSlot; | ||
public static HeadSlot HeadSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.HeadSlot) as HeadSlot; | ||
public static NeckSlot NeckSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.NeckSlot) as NeckSlot; | ||
public static RingSlot Ring1Slot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.Ring1Slot) as RingSlot; | ||
public static RingSlot Ring2Slot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.Ring2Slot) as RingSlot; | ||
public static WristSlot WristSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.WristSlot) as WristSlot; | ||
public static OffHandSlot OffHandSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.OffHandSlot) as OffHandSlot; | ||
public static MainHandSlot MainHandSlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.MainHandSlot) as MainHandSlot; | ||
public static LowerBodySlot LowerBodySlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.LowerBodySlot) as LowerBodySlot; | ||
public static UpperBodySlot UpperBodySlot(this IEquipment equipment) => equipment.Slots.Get(EquipmentSlotTypes.UpperBodySlot) as UpperBodySlot; | ||
} | ||
} |
Oops, something went wrong.