From d96fb985602b9002521b668efae0bd5a5911a46d Mon Sep 17 00:00:00 2001 From: LP Date: Fri, 20 Aug 2021 12:49:39 +0100 Subject: [PATCH 1/2] Moving to have a shared genre base project --- ...odifier.cs => RemoveDamageTypeModifier.cs} | 14 +- .../Defaults/DefaultCharacter.cs | 26 --- .../Defaults/DefaultDefenseStatPopulator.cs | 1 - .../Defaults/DefaultEquipment.cs | 20 -- .../Equipment/IEquipment.cs | 26 --- .../Extensions/EquipmentExtensions.cs | 59 ++---- .../Extensions/StatExtensions.cs | 72 +++---- .../OpenRpg.Genres.Fantasy.csproj | 16 +- ...faultFantasyCharacterRequirementChecker.cs | 40 ++++ .../Types/AssociatedTypes.cs | 16 -- .../Types/DamageTypes.cs | 27 +-- .../Types/EffectTypes.cs | 192 +++++++++--------- .../Types/EquipmentSlotTypes.cs | 19 ++ .../Types/ItemQualityTypes.cs | 18 +- src/OpenRpg.Genres.Fantasy/Types/ItemTypes.cs | 29 ++- .../Types/ModificationTypes.cs | 4 +- .../Types/RequirementTypes.cs | 32 +-- .../Types/RewardTypes.cs | 10 +- .../Types/StatsVariableTypes.cs | 66 +++--- ....Genres.Fantasy.sln => OpenRpg.Genres.sln} | 6 + .../Characters/ICharacter.cs | 9 +- .../Extensions/CharacterExtensions.cs | 10 +- .../Extensions/RequirementExtensions.cs | 10 +- src/OpenRpg.Genres/OpenRpg.Genres.csproj | 22 ++ .../DefaultCharacterRequirementChecker.cs | 38 +--- .../ICharacterRequirementChecker.cs | 4 +- src/OpenRpg.Genres/Types/AssociatedTypes.cs | 17 ++ src/OpenRpg.Genres/Types/DamageTypes.cs | 9 + src/OpenRpg.Genres/Types/EffectTypes.cs | 14 ++ .../Types/GenderTypes.cs | 2 +- src/OpenRpg.Genres/Types/ItemQualityTypes.cs | 11 + src/OpenRpg.Genres/Types/ItemTypes.cs | 11 + src/OpenRpg.Genres/Types/ModificationTypes.cs | 7 + .../Types/ObjectiveTypes.cs | 4 +- .../Types/QuestStateTypes.cs | 2 +- src/OpenRpg.Genres/Types/RequirementTypes.cs | 17 ++ src/OpenRpg.Genres/Types/RewardTypes.cs | 12 ++ .../Types/StatsVariableTypes.cs | 15 ++ .../Variables/DefaultCharacterVariables.cs | 2 +- .../Variables/DefaultEquipmentVariables.cs | 12 ++ .../Variables/ICharacterVariables.cs | 2 +- .../Variables/IEquipmentSlots.cs | 11 + .../Variables/IEquipmentVariables.cs | 7 + 43 files changed, 488 insertions(+), 453 deletions(-) rename src/OpenRpg.Genres.Fantasy/Combat/Modifiers/{RemoveLightDamageModifier.cs => RemoveDamageTypeModifier.cs} (64%) delete mode 100644 src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacter.cs delete mode 100644 src/OpenRpg.Genres.Fantasy/Defaults/DefaultEquipment.cs delete mode 100644 src/OpenRpg.Genres.Fantasy/Equipment/IEquipment.cs create mode 100644 src/OpenRpg.Genres.Fantasy/Requirements/DefaultFantasyCharacterRequirementChecker.cs delete mode 100644 src/OpenRpg.Genres.Fantasy/Types/AssociatedTypes.cs create mode 100644 src/OpenRpg.Genres.Fantasy/Types/EquipmentSlotTypes.cs rename src/{OpenRpg.Genres.Fantasy.sln => OpenRpg.Genres.sln} (64%) rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Characters/ICharacter.cs (66%) rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Extensions/CharacterExtensions.cs (55%) rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Extensions/RequirementExtensions.cs (78%) create mode 100644 src/OpenRpg.Genres/OpenRpg.Genres.csproj rename src/{OpenRpg.Genres.Fantasy/Defaults => OpenRpg.Genres/Requirements}/DefaultCharacterRequirementChecker.cs (53%) rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Requirements/ICharacterRequirementChecker.cs (73%) create mode 100644 src/OpenRpg.Genres/Types/AssociatedTypes.cs create mode 100644 src/OpenRpg.Genres/Types/DamageTypes.cs create mode 100644 src/OpenRpg.Genres/Types/EffectTypes.cs rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Types/GenderTypes.cs (81%) create mode 100644 src/OpenRpg.Genres/Types/ItemQualityTypes.cs create mode 100644 src/OpenRpg.Genres/Types/ItemTypes.cs create mode 100644 src/OpenRpg.Genres/Types/ModificationTypes.cs rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Types/ObjectiveTypes.cs (85%) rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Types/QuestStateTypes.cs (86%) create mode 100644 src/OpenRpg.Genres/Types/RequirementTypes.cs create mode 100644 src/OpenRpg.Genres/Types/RewardTypes.cs create mode 100644 src/OpenRpg.Genres/Types/StatsVariableTypes.cs rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Variables/DefaultCharacterVariables.cs (87%) create mode 100644 src/OpenRpg.Genres/Variables/DefaultEquipmentVariables.cs rename src/{OpenRpg.Genres.Fantasy => OpenRpg.Genres}/Variables/ICharacterVariables.cs (70%) create mode 100644 src/OpenRpg.Genres/Variables/IEquipmentSlots.cs create mode 100644 src/OpenRpg.Genres/Variables/IEquipmentVariables.cs diff --git a/src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveLightDamageModifier.cs b/src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveDamageTypeModifier.cs similarity index 64% rename from src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveLightDamageModifier.cs rename to src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveDamageTypeModifier.cs index 5d677f5..a27dd05 100644 --- a/src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveLightDamageModifier.cs +++ b/src/OpenRpg.Genres.Fantasy/Combat/Modifiers/RemoveDamageTypeModifier.cs @@ -6,18 +6,20 @@ namespace OpenRpg.Genres.Fantasy.Combat.Modifiers { /// - /// This can be useful for those scenarios where you only want light to be seen as a healing mechanism not a damage one + /// This can be useful for those scenarios where you only want light to be seen as a healing mechanism not a damage one etc /// - /// - /// This is a purely optional helper - /// - public class RemoveLightDamageModifier : IAttackModifier + public class RemoveDamageTypeModifier : IAttackModifier { + public int DamageType { get; } + + public RemoveDamageTypeModifier(int damageType) + { DamageType = damageType; } + public bool ShouldApply(Attack attack) => true; public Attack ModifyValue(Attack attack) { - attack.Damages = attack.Damages.Where(x => x.Type != DamageTypes.LightDamage).ToArray(); + attack.Damages = attack.Damages.Where(x => x.Type != DamageType).ToArray(); return attack; } } diff --git a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacter.cs b/src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacter.cs deleted file mode 100644 index cfaa9b7..0000000 --- a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacter.cs +++ /dev/null @@ -1,26 +0,0 @@ -using OpenRpg.Core.Classes; -using OpenRpg.Core.Races; -using OpenRpg.Core.Stats; -using OpenRpg.Genres.Fantasy.Characters; -using OpenRpg.Genres.Fantasy.Equipment; -using OpenRpg.Genres.Fantasy.Variables; - -namespace OpenRpg.Genres.Fantasy.Defaults -{ - /// - /// A default character implementation, this can be ignored or used as a basis for your own - /// - public class DefaultCharacter : ICharacter - { - public int Id { get; set; } - public string NameLocaleId { get; set; } - public string DescriptionLocaleId { get; set; } - - public byte GenderType { get; set; } - public IClass Class { get; set; } - public IRaceTemplate Race { get; set; } - public IEquipment Equipment { get; set; } = new DefaultEquipment(); - public IStatsVariables Stats { get; set; } = new DefaultStatsVariables(); - public ICharacterVariables Variables { get; set; } = new DefaultCharacterVariables(); - } -} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultDefenseStatPopulator.cs b/src/OpenRpg.Genres.Fantasy/Defaults/DefaultDefenseStatPopulator.cs index 04c8d20..ee2eee3 100644 --- a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultDefenseStatPopulator.cs +++ b/src/OpenRpg.Genres.Fantasy/Defaults/DefaultDefenseStatPopulator.cs @@ -4,7 +4,6 @@ using OpenRpg.Core.Effects; using OpenRpg.Core.Extensions; using OpenRpg.Core.Stats; -using OpenRpg.Genres.Fantasy.Characters; using OpenRpg.Genres.Fantasy.Effects; using OpenRpg.Genres.Fantasy.Extensions; using OpenRpg.Genres.Fantasy.Stats; diff --git a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultEquipment.cs b/src/OpenRpg.Genres.Fantasy/Defaults/DefaultEquipment.cs deleted file mode 100644 index ef3e268..0000000 --- a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultEquipment.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OpenRpg.Genres.Fantasy.Equipment; -using OpenRpg.Genres.Fantasy.Equipment.Slots; - -namespace OpenRpg.Genres.Fantasy.Defaults -{ - public class DefaultEquipment : IEquipment - { - public HeadSlot HeadSlot { get; set; } = new HeadSlot(); - public BackSlot BackSlot { get; set; } = new BackSlot(); - public UpperBodySlot UpperBodySlot { get; set; } = new UpperBodySlot(); - public WristSlot WristSlot { get; set; } = new WristSlot(); - public MainHandSlot MainHandSlot { get; set; } = new MainHandSlot(); - public OffHandSlot OffHandSlot { get; set; } = new OffHandSlot(); - public LowerBodySlot LowerBodySlot { get; set; } = new LowerBodySlot(); - public FootSlot FootSlot { get; set; } = new FootSlot(); - public NeckSlot NeckSlot { get; set; } = new NeckSlot(); - public RingSlot Ring1Slot { get; set; } = new RingSlot(); - public RingSlot Ring2Slot { get; set; } = new RingSlot(); - } -} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Equipment/IEquipment.cs b/src/OpenRpg.Genres.Fantasy/Equipment/IEquipment.cs deleted file mode 100644 index 5a16b96..0000000 --- a/src/OpenRpg.Genres.Fantasy/Equipment/IEquipment.cs +++ /dev/null @@ -1,26 +0,0 @@ -using OpenRpg.Genres.Fantasy.Equipment.Slots; - -namespace OpenRpg.Genres.Fantasy.Equipment -{ - /// - /// This is an example equipment layout for most fantasy style games - /// - /// - /// Not all properties need to be used, and can be added to or ignored based on scenario - /// - public interface IEquipment - { - HeadSlot HeadSlot { get; } - BackSlot BackSlot { get; } - UpperBodySlot UpperBodySlot { get; } - WristSlot WristSlot { get; } - MainHandSlot MainHandSlot { get; } - OffHandSlot OffHandSlot { get; } - LowerBodySlot LowerBodySlot { get; } - FootSlot FootSlot { get; } - - NeckSlot NeckSlot { get; } - RingSlot Ring1Slot { get; } - RingSlot Ring2Slot { get; } - } -} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Extensions/EquipmentExtensions.cs b/src/OpenRpg.Genres.Fantasy/Extensions/EquipmentExtensions.cs index 34a5808..e991a1b 100644 --- a/src/OpenRpg.Genres.Fantasy/Extensions/EquipmentExtensions.cs +++ b/src/OpenRpg.Genres.Fantasy/Extensions/EquipmentExtensions.cs @@ -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> 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 equipmentSlot, List effectList) - { - if(equipmentSlot?.SlottedItem == null) { return; } - var effects = equipmentSlot.SlottedItem.GetItemEffects(); - effectList.AddRange(effects); - } - - public static ICollection GetEquipmentEffects(this IEquipment equipment) - { - var equipmentEffects = new List(); - - 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; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Extensions/StatExtensions.cs b/src/OpenRpg.Genres.Fantasy/Extensions/StatExtensions.cs index 5680e10..5eecd5f 100644 --- a/src/OpenRpg.Genres.Fantasy/Extensions/StatExtensions.cs +++ b/src/OpenRpg.Genres.Fantasy/Extensions/StatExtensions.cs @@ -6,12 +6,12 @@ namespace OpenRpg.Genres.Fantasy.Extensions { public static class StatExtensions { - public static int Strength(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Strength); - public static int Dexterity(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Dexterity); - public static int Constitution(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Constitution); - public static int Intelligence(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Intelligence); - public static int Wisdom(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Wisdom); - public static int Charisma(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Charisma); + public static int Strength(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Strength); + public static int Dexterity(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Dexterity); + public static int Constitution(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Constitution); + public static int Intelligence(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Intelligence); + public static int Wisdom(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Wisdom); + public static int Charisma(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Charisma); public static void Strength(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Strength] = value; public static void Dexterity(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Dexterity] = value; public static void Constitution(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Constitution] = value; @@ -19,17 +19,17 @@ public static class StatExtensions public static void Wisdom(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Wisdom] = value; public static void Charisma(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Charisma] = value; - public static int Health(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Health); - public static int MaxHealth(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.MaxHealth); - public static int Magic(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.Magic); - public static int MaxMagic(this IStatsVariables stats) => (int)stats.GetVariable(StatsVariableTypes.MaxMagic); + public static int Health(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Health); + public static int MaxHealth(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.MaxHealth); + public static int Magic(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.Magic); + public static int MaxMagic(this IStatsVariables stats) => (int)stats.Get(StatsVariableTypes.MaxMagic); public static void Health(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Health] = value; public static void HealthWithCheck(this IStatsVariables stats, int value) { - if(value > stats.GetVariable(StatsVariableTypes.MaxHealth)) - { stats[StatsVariableTypes.Health] = stats.GetVariable(StatsVariableTypes.MaxHealth); } + if(value > stats.Get(StatsVariableTypes.MaxHealth)) + { stats[StatsVariableTypes.Health] = stats.Get(StatsVariableTypes.MaxHealth); } else if(value <= 0) { stats[StatsVariableTypes.Health] = 0; } else @@ -41,8 +41,8 @@ public static void HealthWithCheck(this IStatsVariables stats, int value) public static void Magic(this IStatsVariables stats, int value) => stats[StatsVariableTypes.Magic] = value; public static void MagicWithCheck(this IStatsVariables stats, int value) { - if(value > stats.GetVariable(StatsVariableTypes.MaxMagic)) - { stats[StatsVariableTypes.Magic] = stats.GetVariable(StatsVariableTypes.MaxMagic); } + if(value > stats.Get(StatsVariableTypes.MaxMagic)) + { stats[StatsVariableTypes.Magic] = stats.Get(StatsVariableTypes.MaxMagic); } else if(value <= 0) { stats[StatsVariableTypes.Magic] = 0; } else @@ -56,17 +56,17 @@ public static void MagicWithCheck(this IStatsVariables stats, int value) public static void AddHealth(this IStatsVariables stats, int change) => stats.HealthWithCheck(stats.Health() + change); public static void DeductHealth(this IStatsVariables stats, int change) => stats.HealthWithCheck(stats.Health() - change); - public static float IceDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.IceDamage); - public static float FireDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.FireDamage); - public static float WindDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.WindDamage); - public static float EarthDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.EarthDamage); - public static float LightDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.LightDamage); - public static float DarkDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.DarkDamage); - public static float SlashingDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.SlashingDamage); - public static float BluntDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.BluntDamage); - public static float PiercingDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.PiercingDamage); - public static float UnarmedDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.UnarmedDamage); - public static float PureDamage(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.PureDamage); + public static float IceDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.IceDamage); + public static float FireDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.FireDamage); + public static float WindDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.WindDamage); + public static float EarthDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.EarthDamage); + public static float LightDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.LightDamage); + public static float DarkDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.DarkDamage); + public static float SlashingDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.SlashingDamage); + public static float BluntDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.BluntDamage); + public static float PiercingDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.PiercingDamage); + public static float UnarmedDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.UnarmedDamage); + public static float PureDamage(this IStatsVariables stats) => stats.Get(StatsVariableTypes.PureDamage); public static void IceDamage(this IStatsVariables stats, float value) => stats[StatsVariableTypes.IceDamage] = value; public static void FireDamage(this IStatsVariables stats, float value) => stats[StatsVariableTypes.FireDamage] = value; public static void WindDamage(this IStatsVariables stats, float value) => stats[StatsVariableTypes.WindDamage] = value; @@ -79,17 +79,17 @@ public static void MagicWithCheck(this IStatsVariables stats, int value) public static void UnarmedDamage(this IStatsVariables stats, float value) => stats[StatsVariableTypes.UnarmedDamage] = value; public static void PureDamage(this IStatsVariables stats, float value) => stats[StatsVariableTypes.PureDamage] = value; - public static float IceDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.IceDefense); - public static float FireDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.FireDefense); - public static float WindDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.WindDefense); - public static float EarthDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.EarthDefense); - public static float LightDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.LightDefense); - public static float DarkDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.DarkDefense); - public static float SlashingDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.SlashingDefense); - public static float BluntDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.BluntDefense); - public static float PiercingDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.PiercingDefense); - public static float UnarmedDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.UnarmedDefense); - public static float PureDefense(this IStatsVariables stats) => stats.GetVariable(StatsVariableTypes.PureDefense); + public static float IceDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.IceDefense); + public static float FireDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.FireDefense); + public static float WindDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.WindDefense); + public static float EarthDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.EarthDefense); + public static float LightDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.LightDefense); + public static float DarkDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.DarkDefense); + public static float SlashingDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.SlashingDefense); + public static float BluntDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.BluntDefense); + public static float PiercingDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.PiercingDefense); + public static float UnarmedDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.UnarmedDefense); + public static float PureDefense(this IStatsVariables stats) => stats.Get(StatsVariableTypes.PureDefense); public static void IceDefense(this IStatsVariables stats, float value) => stats[StatsVariableTypes.IceDefense] = value; public static void FireDefense(this IStatsVariables stats, float value) => stats[StatsVariableTypes.FireDefense] = value; public static void WindDefense(this IStatsVariables stats, float value) => stats[StatsVariableTypes.WindDefense] = value; diff --git a/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj b/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj index 509d126..8742d61 100644 --- a/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj +++ b/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj @@ -5,17 +5,21 @@ netstandard2.0;net46 OpenRpg.Genres.Fantasy Grofit (LP) - https://github.com/openrpg/OpenRpg.Fantasy/blob/master/LICENSE - https://github.com/openrpg/OpenRpg.Fantasy + https://github.com/openrpg/OpenRpg.Genres/blob/master/LICENSE + https://github.com/openrpg/OpenRpg.Genres Adds common types and classes for fantasy style settings rpg game-development xna monogame unity godot - - - - + + + + + + + + diff --git a/src/OpenRpg.Genres.Fantasy/Requirements/DefaultFantasyCharacterRequirementChecker.cs b/src/OpenRpg.Genres.Fantasy/Requirements/DefaultFantasyCharacterRequirementChecker.cs new file mode 100644 index 0000000..ec48c19 --- /dev/null +++ b/src/OpenRpg.Genres.Fantasy/Requirements/DefaultFantasyCharacterRequirementChecker.cs @@ -0,0 +1,40 @@ +using OpenRpg.Core.Requirements; +using OpenRpg.Genres.Characters; +using OpenRpg.Genres.Fantasy.Extensions; +using OpenRpg.Genres.Requirements; +using RequirementTypes = OpenRpg.Genres.Fantasy.Types.RequirementTypes; + +namespace OpenRpg.Genres.Fantasy.Requirements +{ + public class DefaultFantasyCharacterRequirementChecker : DefaultCharacterRequirementChecker + { + public override bool IsRequirementMet(ICharacter character, Requirement requirement) + { + if(requirement.RequirementType == RequirementTypes.StrengthRequirement) + { return character.Stats.Strength() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.DexterityRequirement) + { return character.Stats.Dexterity() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.IntelligenceRequirement) + { return character.Stats.Intelligence() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.ConstitutionRequirement) + { return character.Stats.Constitution() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.WisdomRequirement) + { return character.Stats.Wisdom() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.CharismaRequirement) + { return character.Stats.Charisma() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.MaxMagicRequirement) + { return character.Stats.MaxMagic() >= requirement.AssociatedValue; } + + if(requirement.RequirementType == RequirementTypes.MaxHealthRequirement) + { return character.Stats.MaxHealth() >= requirement.AssociatedValue; } + + return base.IsRequirementMet(character, requirement); + } + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/AssociatedTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/AssociatedTypes.cs deleted file mode 100644 index 612d3d0..0000000 --- a/src/OpenRpg.Genres.Fantasy/Types/AssociatedTypes.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace OpenRpg.Genres.Fantasy.Types -{ - public class AssociatedTypes - { - public static int UnknownAssociation = 0; - - public static int ItemAssociation = 1; - public static int QuestAssociation = 2; - public static int NpcAssociation = 3; - public static int NpcDialogAssociation = 4; - public static int MonsterSpawnAssociation = 5; - public static int ClassAssociation = 6; - public static int NpcDialogLinkAssociation = 7; - public static int RaceAssociation = 8; - } -} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/DamageTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/DamageTypes.cs index d8fa60a..d600194 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/DamageTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/DamageTypes.cs @@ -1,24 +1,19 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class DamageTypes + public class DamageTypes : Genres.Types.DamageTypes { - public static int UnknownDamage = 0; - // Melee types - public static int SlashingDamage = 1; - public static int BluntDamage = 2; - public static int PiercingDamage = 3; - public static int UnarmedDamage = 4; + public static int SlashingDamage = 50; + public static int BluntDamage = 51; + public static int PiercingDamage = 52; + public static int UnarmedDamage = 53; // Magic types - public static int FireDamage = 50; - public static int IceDamage = 51; - public static int EarthDamage = 52; - public static int WindDamage = 53; - public static int LightDamage = 54; - public static int DarkDamage = 55; - - // Pure type - public static int PureDamage = 100; + public static int FireDamage = 80; + public static int IceDamage = 81; + public static int EarthDamage = 82; + public static int WindDamage = 83; + public static int LightDamage = 84; + public static int DarkDamage = 85; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/EffectTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/EffectTypes.cs index 3519806..9ceffd2 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/EffectTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/EffectTypes.cs @@ -1,122 +1,114 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class EffectTypes + public class EffectTypes : Genres.Types.EffectTypes { - public static int UnknownBonus = 0; - // Generic Melee/Magic - public static int AllMeleeAttackBonusAmount = 1; - public static int AllMeleeDefenseBonusAmount = 2; - public static int AllAttributeBonusAmount = 3; - public static int AllElementDamageBonusAmount = 4; - public static int AllElementDefenseBonusAmount = 5; - public static int AllMeleeAttackBonusPercentage = 6; - public static int AllMeleeDefenseBonusPercentage = 7; - public static int AllElementDamageBonusPercentage = 8; - public static int AllElementDefenseBonusPercentage = 9; + public static int AllMeleeAttackBonusAmount = 50; + public static int AllMeleeDefenseBonusAmount = 51; + public static int AllAttributeBonusAmount = 52; + public static int AllElementDamageBonusAmount = 53; + public static int AllElementDefenseBonusAmount = 54; + public static int AllMeleeAttackBonusPercentage = 55; + public static int AllMeleeDefenseBonusPercentage = 56; + public static int AllElementDamageBonusPercentage = 57; + public static int AllElementDefenseBonusPercentage = 58; // General Attribute Amount - public static int DexterityBonusAmount = 10; - public static int IntelligenceBonusAmount = 11; - public static int WisdomBonusAmount = 12; - public static int StrengthBonusAmount = 13; - public static int ConstitutionBonusAmount = 14; - public static int CharismaBonusAmount = 15; - public static int HealthBonusAmount = 16; - public static int MagicBonusAmount = 17; - public static int HealthRestoreAmount = 18; - public static int MagicRestoreAmount = 19; - public static int ExperienceRestoreAmount = 20; + public static int DexterityBonusAmount = 70; + public static int IntelligenceBonusAmount = 71; + public static int WisdomBonusAmount = 72; + public static int StrengthBonusAmount = 73; + public static int ConstitutionBonusAmount = 74; + public static int CharismaBonusAmount = 75; + public static int HealthBonusAmount = 76; + public static int MagicBonusAmount = 77; + public static int HealthRestoreAmount = 78; + public static int MagicRestoreAmount = 79; + public static int ExperienceRestoreAmount = 80; // General Attribute Percentage - public static int DexterityBonusPercentage = 30; - public static int IntelligenceBonusPercentage = 31; - public static int WisdomBonusPercentage = 32; - public static int StrengthBonusPercentage = 33; - public static int ConstitutionBonusPercentage = 34; - public static int CharismaBonusPercentage = 35; - public static int HealthBonusPercentage = 36; - public static int HealthRestorePercentage = 37; - public static int MagicBonusPercentage = 38; - public static int MagicRestorePercentage = 39; - public static int ExperienceRestorePercentage = 40; + public static int DexterityBonusPercentage = 90; + public static int IntelligenceBonusPercentage = 91; + public static int WisdomBonusPercentage = 92; + public static int StrengthBonusPercentage = 93; + public static int ConstitutionBonusPercentage = 94; + public static int CharismaBonusPercentage = 95; + public static int HealthBonusPercentage = 96; + public static int HealthRestorePercentage = 97; + public static int MagicBonusPercentage = 98; + public static int MagicRestorePercentage = 99; + public static int ExperienceRestorePercentage = 100; // Melee Damage (Damage Types) - public static int SlashingDamageAmount = 50; - public static int PiercingDamageAmount = 51; - public static int BluntDamageAmount = 52; - public static int UnarmedDamageAmount = 53; - public static int SlashingDamagePercentage = 54; - public static int PiercingDamagePercentage = 55; - public static int BluntDamagePercentage = 56; - public static int UnarmedDamagePercentage = 57; + public static int SlashingDamageAmount = 110; + public static int PiercingDamageAmount = 111; + public static int BluntDamageAmount = 112; + public static int UnarmedDamageAmount = 113; + public static int SlashingDamagePercentage = 114; + public static int PiercingDamagePercentage = 115; + public static int BluntDamagePercentage = 116; + public static int UnarmedDamagePercentage = 117; // Melee Defense (Defense Types) - public static int SlashingDefenseAmount = 70; - public static int PiercingDefenseAmount = 71; - public static int BluntDefenseAmount = 72; - public static int UnarmedDefenseAmount = 73; - public static int SlashingDefensePercentage = 74; - public static int PiercingDefensePercentage = 75; - public static int BluntDefensePercentage = 76; - public static int UnarmedDefensePercentage = 77; + public static int SlashingDefenseAmount = 130; + public static int PiercingDefenseAmount = 131; + public static int BluntDefenseAmount = 132; + public static int UnarmedDefenseAmount = 133; + public static int SlashingDefensePercentage = 134; + public static int PiercingDefensePercentage = 135; + public static int BluntDefensePercentage = 136; + public static int UnarmedDefensePercentage = 137; // Melee Type Bonus (Damage/Defense Bonus) - public static int SlashingBonusAmount = 90; - public static int PiercingBonusAmount = 91; - public static int BluntBonusAmount = 92; - public static int UnarmedBonusAmount = 93; - public static int SlashingBonusPercentage = 94; - public static int PiercingBonusPercentage = 95; - public static int BluntBonusPercentage = 96; - public static int UnarmedBonusPercentage = 97; + public static int SlashingBonusAmount = 150; + public static int PiercingBonusAmount = 151; + public static int BluntBonusAmount = 152; + public static int UnarmedBonusAmount = 153; + public static int SlashingBonusPercentage = 154; + public static int PiercingBonusPercentage = 155; + public static int BluntBonusPercentage = 156; + public static int UnarmedBonusPercentage = 157; // Magic Damage (Raw Damage) - public static int FireDamageAmount = 110; - public static int IceDamageAmount = 111; - public static int EarthDamageAmount = 112; - public static int WindDamageAmount = 113; - public static int LightDamageAmount = 114; - public static int DarkDamageAmount = 115; - public static int FireDamagePercentage = 116; - public static int IceDamagePercentage = 117; - public static int EarthDamagePercentage = 118; - public static int WindDamagePercentage = 119; - public static int LightDamagePercentage = 120; - public static int DarkDamagePercentage = 121; + public static int FireDamageAmount = 170; + public static int IceDamageAmount = 171; + public static int EarthDamageAmount = 172; + public static int WindDamageAmount = 173; + public static int LightDamageAmount = 174; + public static int DarkDamageAmount = 175; + public static int FireDamagePercentage = 176; + public static int IceDamagePercentage = 177; + public static int EarthDamagePercentage = 178; + public static int WindDamagePercentage = 179; + public static int LightDamagePercentage = 180; + public static int DarkDamagePercentage = 181; // Magic Defense (Defense Bonus) - public static int FireDefenseAmount = 130; - public static int IceDefenseAmount = 131; - public static int EarthDefenseAmount = 132; - public static int WindDefenseAmount = 134; - public static int LightDefenseAmount = 135; - public static int DarkDefenseAmount = 136; - public static int FireDefensePercentage = 137; - public static int IceDefensePercentage = 138; - public static int EarthDefensePercentage = 139; - public static int WindDefensePercentage = 140; - public static int LightDefensePercentage = 141; - public static int DarkDefensePercentage = 142; + public static int FireDefenseAmount = 200; + public static int IceDefenseAmount = 201; + public static int EarthDefenseAmount = 202; + public static int WindDefenseAmount = 204; + public static int LightDefenseAmount = 205; + public static int DarkDefenseAmount = 206; + public static int FireDefensePercentage = 207; + public static int IceDefensePercentage = 208; + public static int EarthDefensePercentage = 209; + public static int WindDefensePercentage = 210; + public static int LightDefensePercentage = 211; + public static int DarkDefensePercentage = 212; // Magic Bonus (Damage Bonus) - public static int FireBonusAmount = 150; - public static int IceBonusAmount = 151; - public static int EarthBonusAmount = 152; - public static int WindBonusAmount = 153; - public static int LightBonusAmount = 154; - public static int DarkBonusAmount = 155; - public static int FireBonusPercentage = 156; - public static int IceBonusPercentage = 157; - public static int EarthBonusPercentage = 158; - public static int WindBonusPercentage = 159; - public static int LightBonusPercentage = 160; - public static int DarkBonusPercentage = 161; - - // Pure Damage Types - public static int PureDamageAmount = 170; - public static int PureDamagePercentage = 171; - public static int PureDefenseAmount = 172; - public static int PureDefensePercentage = 173; + public static int FireBonusAmount = 230; + public static int IceBonusAmount = 231; + public static int EarthBonusAmount = 232; + public static int WindBonusAmount = 233; + public static int LightBonusAmount = 234; + public static int DarkBonusAmount = 235; + public static int FireBonusPercentage = 236; + public static int IceBonusPercentage = 237; + public static int EarthBonusPercentage = 238; + public static int WindBonusPercentage = 239; + public static int LightBonusPercentage = 240; + public static int DarkBonusPercentage = 241; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/EquipmentSlotTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/EquipmentSlotTypes.cs new file mode 100644 index 0000000..ed27347 --- /dev/null +++ b/src/OpenRpg.Genres.Fantasy/Types/EquipmentSlotTypes.cs @@ -0,0 +1,19 @@ +namespace OpenRpg.Genres.Fantasy.Types +{ + public class EquipmentSlotTypes + { + public static int UnknownSlot = 0; + + public static int HeadSlot = 50; + public static int BackSlot = 51; + public static int UpperBodySlot = 52; + public static int WristSlot = 53; + public static int MainHandSlot = 54; + public static int OffHandSlot = 55; + public static int LowerBodySlot = 56; + public static int FootSlot = 57; + public static int NeckSlot = 58; + public static int Ring1Slot = 59; + public static int Ring2Slot = 60; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/ItemQualityTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/ItemQualityTypes.cs index d26b588..16edce1 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/ItemQualityTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/ItemQualityTypes.cs @@ -1,18 +1,10 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class ItemQualityTypes + public class ItemQualityTypes : Genres.Types.ItemQualityTypes { - public static int UnknownQuality = 0; - - public static int JunkQuality = 1; - public static int CommonQuality = 2; - public static int UncommonQuality = 3; - public static int WellMadeQuality = 4; - public static int RareQuality = 5; - public static int MagicalQuality = 6; - public static int EpicQuality = 7; - public static int IncredibleQuality = 8; - public static int LegendaryQuality = 9; - public static int MythicalQuality = 10; + public static int UncommonQuality = 10; + public static int MagicalQuality = 11; + public static int EpicQuality = 12; + public static int MythicalQuality = 13; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/ItemTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/ItemTypes.cs index d76366c..6062ece 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/ItemTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/ItemTypes.cs @@ -1,23 +1,18 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class ItemTypes + public class ItemTypes : Genres.Types.ItemTypes { - public static int UnknownItem = 0; - - public static int QuestItem = 1; - public static int HeadItem = 2; - public static int UpperBodyArmour = 3; - public static int LowerBodyArmour = 4; - public static int BackArmour = 5; - public static int FootArmour = 6; - public static int WristItem = 7; - public static int NeckItem = 8; - public static int RingItem = 9; - public static int Potions = 10; - public static int GenericWeapon = 11; - public static int OffhandItem = 12; - public static int GenericItem = 13; - public static int CraftingMaterial = 14; + public static int HeadItem = 30; + public static int UpperBodyArmour = 31; + public static int LowerBodyArmour = 32; + public static int BackArmour = 33; + public static int FootArmour = 34; + public static int WristItem = 35; + public static int NeckItem = 36; + public static int RingItem = 37; + + public static int OffhandItem = 50; + public static int Potions = 60; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/ModificationTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/ModificationTypes.cs index 8d6fc12..fa9f335 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/ModificationTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/ModificationTypes.cs @@ -1,9 +1,7 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class ModificationTypes + public class ModificationTypes : Genres.Types.ModificationTypes { - public static int UnknownModification = 0; - public static int EnchantmentModification = 1; public static int GemModification = 2; public static int RuneModification = 3; diff --git a/src/OpenRpg.Genres.Fantasy/Types/RequirementTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/RequirementTypes.cs index c7a185e..c79aaef 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/RequirementTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/RequirementTypes.cs @@ -1,28 +1,14 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class RequirementTypes + public class RequirementTypes : Genres.Types.RequirementTypes { - public static int UnknownRequirement = 0; - - public static int RaceRequirement = 1; - public static int ClassRequirement = 2; - public static int LevelRequirement = 3; - public static int TriggerRequirement = 4; - public static int QuestStateRequirement = 5; - public static int SkillRequirement = 6; - public static int InventoryItemRequirement = 7; - public static int MonsterSightedRequirement = 8; - public static int AreaExploredRequirement = 9; - public static int RegionExploredRequirement = 10; - public static int EquipmentItemRequirement = 11; - public static int StrengthRequirement = 12; - public static int DexterityRequirement = 13; - public static int ConstitutionRequirement = 14; - public static int IntelligenceRequirement = 15; - public static int WisdomRequirement = 16; - public static int CharismaRequirement = 17; - public static int GenderRequirement = 18; - public static int MaxHealthRequirement = 19; - public static int MaxMagicRequirement = 20; + public static int StrengthRequirement = 50; + public static int DexterityRequirement = 51; + public static int ConstitutionRequirement = 52; + public static int IntelligenceRequirement = 53; + public static int WisdomRequirement = 54; + public static int CharismaRequirement = 55; + public static int MaxHealthRequirement = 56; + public static int MaxMagicRequirement = 57; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/RewardTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/RewardTypes.cs index cc36801..410056f 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/RewardTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/RewardTypes.cs @@ -1,13 +1,7 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class RewardTypes + public class RewardTypes : Genres.Types.RewardTypes { - public static int UnknownReward = 0; - - public static int ExperienceReward = 1; - public static int GoldReward = 2; - public static int ItemReward = 3; - public static int QuestReward = 4; - public static int TriggerReward = 5; + public static int ExperienceReward = 50; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/StatsVariableTypes.cs b/src/OpenRpg.Genres.Fantasy/Types/StatsVariableTypes.cs index ac6c4d1..a09bb7e 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/StatsVariableTypes.cs +++ b/src/OpenRpg.Genres.Fantasy/Types/StatsVariableTypes.cs @@ -1,46 +1,40 @@ namespace OpenRpg.Genres.Fantasy.Types { - public class StatsVariableTypes + public class StatsVariableTypes : Genres.Types.StatsVariableTypes { + public static int MaxMagic = 50; + public static int Magic = 51; + // Base stats - public static int Strength = 1; - public static int Dexterity = 2; - public static int Constitution = 3; - public static int Intelligence = 4; - public static int Wisdom = 5; - public static int Charisma = 6; + public static int Strength = 60; + public static int Dexterity = 61; + public static int Constitution = 62; + public static int Intelligence = 63; + public static int Wisdom = 64; + public static int Charisma = 65; - public static int MaxHealth = 10; - public static int MaxMagic = 11; - // Attack stats - public static int PureDamage = 20; - public static int SlashingDamage = 21; - public static int BluntDamage = 22; - public static int PiercingDamage = 23; - public static int UnarmedDamage = 24; - public static int FireDamage = 25; - public static int IceDamage = 26; - public static int EarthDamage = 27; - public static int WindDamage = 28; - public static int LightDamage = 29; - public static int DarkDamage = 30; + public static int SlashingDamage = 80; + public static int BluntDamage = 81; + public static int PiercingDamage = 82; + public static int UnarmedDamage = 83; + public static int FireDamage = 84; + public static int IceDamage = 85; + public static int EarthDamage = 86; + public static int WindDamage = 87; + public static int LightDamage = 88; + public static int DarkDamage = 89; // Defense stats - public static int PureDefense = 50; - public static int SlashingDefense = 51; - public static int BluntDefense = 52; - public static int PiercingDefense = 53; - public static int UnarmedDefense = 54; - public static int FireDefense = 55; - public static int IceDefense = 56; - public static int EarthDefense = 57; - public static int WindDefense = 58; - public static int LightDefense = 59; - public static int DarkDefense = 60; - - // Dynamic Stats - public static int Health = 70; - public static int Magic = 71; + public static int SlashingDefense = 100; + public static int BluntDefense = 101; + public static int PiercingDefense = 102; + public static int UnarmedDefense = 103; + public static int FireDefense = 104; + public static int IceDefense = 105; + public static int EarthDefense = 106; + public static int WindDefense = 107; + public static int LightDefense = 108; + public static int DarkDefense = 109; } } \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy.sln b/src/OpenRpg.Genres.sln similarity index 64% rename from src/OpenRpg.Genres.Fantasy.sln rename to src/OpenRpg.Genres.sln index 2c0274f..f6431b2 100644 --- a/src/OpenRpg.Genres.Fantasy.sln +++ b/src/OpenRpg.Genres.sln @@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRpg.Genres.Fantasy", "OpenRpg.Genres.Fantasy\OpenRpg.Genres.Fantasy.csproj", "{9F45DCD0-D4E9-4632-8E43-993953BC2010}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRpg.Genres", "OpenRpg.Genres\OpenRpg.Genres.csproj", "{2E807C6D-06C6-45AB-9FFC-86797C4A631B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -12,6 +14,10 @@ Global {9F45DCD0-D4E9-4632-8E43-993953BC2010}.Debug|Any CPU.Build.0 = Debug|Any CPU {9F45DCD0-D4E9-4632-8E43-993953BC2010}.Release|Any CPU.ActiveCfg = Release|Any CPU {9F45DCD0-D4E9-4632-8E43-993953BC2010}.Release|Any CPU.Build.0 = Release|Any CPU + {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution EndGlobalSection diff --git a/src/OpenRpg.Genres.Fantasy/Characters/ICharacter.cs b/src/OpenRpg.Genres/Characters/ICharacter.cs similarity index 66% rename from src/OpenRpg.Genres.Fantasy/Characters/ICharacter.cs rename to src/OpenRpg.Genres/Characters/ICharacter.cs index ccc8c7b..d8dfbf1 100644 --- a/src/OpenRpg.Genres.Fantasy/Characters/ICharacter.cs +++ b/src/OpenRpg.Genres/Characters/ICharacter.cs @@ -2,11 +2,14 @@ using OpenRpg.Core.Common; using OpenRpg.Core.Races; using OpenRpg.Core.Stats; -using OpenRpg.Genres.Fantasy.Equipment; -using OpenRpg.Genres.Fantasy.Variables; +using OpenRpg.Genres.Variables; +using OpenRpg.Items.Equipment; -namespace OpenRpg.Genres.Fantasy.Characters +namespace OpenRpg.Genres.Characters { + /// + /// Barebones character for extending elsewhere + /// public interface ICharacter : IHasDataId, IHasLocaleDescription, IHasStats, IHasClass { byte GenderType { get; } diff --git a/src/OpenRpg.Genres.Fantasy/Extensions/CharacterExtensions.cs b/src/OpenRpg.Genres/Extensions/CharacterExtensions.cs similarity index 55% rename from src/OpenRpg.Genres.Fantasy/Extensions/CharacterExtensions.cs rename to src/OpenRpg.Genres/Extensions/CharacterExtensions.cs index aaae9c7..fd3017a 100644 --- a/src/OpenRpg.Genres.Fantasy/Extensions/CharacterExtensions.cs +++ b/src/OpenRpg.Genres/Extensions/CharacterExtensions.cs @@ -1,18 +1,18 @@ using System.Collections.Generic; using OpenRpg.Core.Effects; -using OpenRpg.Core.Requirements; -using OpenRpg.Genres.Fantasy.Characters; +using OpenRpg.Genres.Characters; +using OpenRpg.Items.Extensions; -namespace OpenRpg.Genres.Fantasy.Extensions +namespace OpenRpg.Genres.Extensions { public static class CharacterExtensions { - public static IEnumerable GetActiveEffects(this ICharacter character) + public static IEnumerable GetEffects(this ICharacter character) { var effects = new List(); effects.AddRange(character.Race.Effects); effects.AddRange(character.Class.ClassTemplate.Effects); - effects.AddRange(character.Equipment.GetEquipmentEffects()); + effects.AddRange(character.Equipment.GetEffects()); return effects; } } diff --git a/src/OpenRpg.Genres.Fantasy/Extensions/RequirementExtensions.cs b/src/OpenRpg.Genres/Extensions/RequirementExtensions.cs similarity index 78% rename from src/OpenRpg.Genres.Fantasy/Extensions/RequirementExtensions.cs rename to src/OpenRpg.Genres/Extensions/RequirementExtensions.cs index b4eb186..fa88560 100644 --- a/src/OpenRpg.Genres.Fantasy/Extensions/RequirementExtensions.cs +++ b/src/OpenRpg.Genres/Extensions/RequirementExtensions.cs @@ -1,10 +1,10 @@ using System.Linq; using OpenRpg.Core.Requirements; -using OpenRpg.Genres.Fantasy.Characters; -using OpenRpg.Genres.Fantasy.Requirements; +using OpenRpg.Genres.Characters; +using OpenRpg.Genres.Requirements; using OpenRpg.Quests.States; -namespace OpenRpg.Genres.Fantasy.Extensions +namespace OpenRpg.Genres.Extensions { public static class RequirementExtensions { @@ -18,9 +18,7 @@ public static bool AreRequirementsMet(this ICharacterRequirementChecker characte ICharacter character, IHasRequirements hasRequirements) { var characterRequirementsMet = AreRequirementsMet(characterRequirementChecker, character, hasRequirements); - if(characterRequirementsMet == false) { return false; } - - return AreRequirementsMet(characterRequirementChecker, state, hasRequirements); + return characterRequirementsMet && AreRequirementsMet(characterRequirementChecker, state, hasRequirements); } } } \ No newline at end of file diff --git a/src/OpenRpg.Genres/OpenRpg.Genres.csproj b/src/OpenRpg.Genres/OpenRpg.Genres.csproj new file mode 100644 index 0000000..0a33546 --- /dev/null +++ b/src/OpenRpg.Genres/OpenRpg.Genres.csproj @@ -0,0 +1,22 @@ + + + + 0.0.0 + netstandard2.0;net46 + OpenRpg.Genres + Grofit (LP) + https://github.com/openrpg/OpenRpg.Genres/blob/master/LICENSE + https://github.com/openrpg/OpenRpg.Genres + Adds common types and classes for various genres to build off + rpg game-development xna monogame unity godot + + + + + + + + + + + diff --git a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacterRequirementChecker.cs b/src/OpenRpg.Genres/Requirements/DefaultCharacterRequirementChecker.cs similarity index 53% rename from src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacterRequirementChecker.cs rename to src/OpenRpg.Genres/Requirements/DefaultCharacterRequirementChecker.cs index 6cf47bb..0e0bfcd 100644 --- a/src/OpenRpg.Genres.Fantasy/Defaults/DefaultCharacterRequirementChecker.cs +++ b/src/OpenRpg.Genres/Requirements/DefaultCharacterRequirementChecker.cs @@ -1,16 +1,14 @@ using System.Linq; using OpenRpg.Core.Requirements; -using OpenRpg.Genres.Fantasy.Characters; -using OpenRpg.Genres.Fantasy.Extensions; -using OpenRpg.Genres.Fantasy.Requirements; -using OpenRpg.Genres.Fantasy.Types; +using OpenRpg.Genres.Characters; +using OpenRpg.Genres.Types; using OpenRpg.Quests.States; -namespace OpenRpg.Genres.Fantasy.Defaults +namespace OpenRpg.Genres.Requirements { public class DefaultCharacterRequirementChecker : ICharacterRequirementChecker { - public bool IsRequirementMet(ICharacter character, Requirement requirement) + public virtual bool IsRequirementMet(ICharacter character, Requirement requirement) { if (requirement.RequirementType == RequirementTypes.RaceRequirement) { return character.Race.Id == requirement.AssociatedId; } @@ -24,33 +22,9 @@ public bool IsRequirementMet(ICharacter character, Requirement requirement) if(requirement.RequirementType == RequirementTypes.GenderRequirement) { return character.GenderType == requirement.AssociatedId; } - if(requirement.RequirementType == RequirementTypes.StrengthRequirement) - { return character.Stats.Strength() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.DexterityRequirement) - { return character.Stats.Dexterity() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.IntelligenceRequirement) - { return character.Stats.Intelligence() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.ConstitutionRequirement) - { return character.Stats.Constitution() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.WisdomRequirement) - { return character.Stats.Wisdom() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.CharismaRequirement) - { return character.Stats.Charisma() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.MaxMagicRequirement) - { return character.Stats.MaxMagic() >= requirement.AssociatedValue; } - - if(requirement.RequirementType == RequirementTypes.MaxHealthRequirement) - { return character.Stats.MaxHealth() >= requirement.AssociatedValue; } - if (requirement.RequirementType == RequirementTypes.EquipmentItemRequirement) { - return character.Equipment.GetEquipmentSlots().Any(x => + return character.Equipment.Slots.Values.Any(x => x.SlotType == requirement.AssociatedId && x.SlottedItem.ItemTemplate.Id == requirement.AssociatedValue); } @@ -58,7 +32,7 @@ public bool IsRequirementMet(ICharacter character, Requirement requirement) return true; } - public bool IsRequirementMet(IGameState state, Requirement requirement) + public virtual bool IsRequirementMet(IGameState state, Requirement requirement) { if (requirement.RequirementType == RequirementTypes.TriggerRequirement) { diff --git a/src/OpenRpg.Genres.Fantasy/Requirements/ICharacterRequirementChecker.cs b/src/OpenRpg.Genres/Requirements/ICharacterRequirementChecker.cs similarity index 73% rename from src/OpenRpg.Genres.Fantasy/Requirements/ICharacterRequirementChecker.cs rename to src/OpenRpg.Genres/Requirements/ICharacterRequirementChecker.cs index 5b5b30b..80fb922 100644 --- a/src/OpenRpg.Genres.Fantasy/Requirements/ICharacterRequirementChecker.cs +++ b/src/OpenRpg.Genres/Requirements/ICharacterRequirementChecker.cs @@ -1,8 +1,8 @@ using OpenRpg.Core.Requirements; -using OpenRpg.Genres.Fantasy.Characters; +using OpenRpg.Genres.Characters; using OpenRpg.Quests.States; -namespace OpenRpg.Genres.Fantasy.Requirements +namespace OpenRpg.Genres.Requirements { public interface ICharacterRequirementChecker : IRequirementChecker { diff --git a/src/OpenRpg.Genres/Types/AssociatedTypes.cs b/src/OpenRpg.Genres/Types/AssociatedTypes.cs new file mode 100644 index 0000000..c30f3ba --- /dev/null +++ b/src/OpenRpg.Genres/Types/AssociatedTypes.cs @@ -0,0 +1,17 @@ +namespace OpenRpg.Genres.Types +{ + public class AssociatedTypes + { + public static int UnknownAssociation = 0; + + public static int ItemAssociation = 1; + public static int ClassAssociation = 2; + public static int RaceAssociation = 3; + + public static int QuestAssociation = 10; + + public static int NpcAssociation = 20; + public static int NpcDialogAssociation = 21; + public static int NpcDialogLinkAssociation = 22; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/DamageTypes.cs b/src/OpenRpg.Genres/Types/DamageTypes.cs new file mode 100644 index 0000000..b259a22 --- /dev/null +++ b/src/OpenRpg.Genres/Types/DamageTypes.cs @@ -0,0 +1,9 @@ +namespace OpenRpg.Genres.Types +{ + public class DamageTypes + { + public static int UnknownDamage = 0; + + public static int PureDamage = 1; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/EffectTypes.cs b/src/OpenRpg.Genres/Types/EffectTypes.cs new file mode 100644 index 0000000..0083d66 --- /dev/null +++ b/src/OpenRpg.Genres/Types/EffectTypes.cs @@ -0,0 +1,14 @@ +namespace OpenRpg.Genres.Types +{ + public class EffectTypes + { + public static int UnknownBonus = 0; + + // Pure Damage Types + public static int PureDamageAmount = 1; + public static int PureDamagePercentage = 2; + + public static int PureDefenseAmount = 10; + public static int PureDefensePercentage = 11; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/GenderTypes.cs b/src/OpenRpg.Genres/Types/GenderTypes.cs similarity index 81% rename from src/OpenRpg.Genres.Fantasy/Types/GenderTypes.cs rename to src/OpenRpg.Genres/Types/GenderTypes.cs index 585b889..03dfc80 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/GenderTypes.cs +++ b/src/OpenRpg.Genres/Types/GenderTypes.cs @@ -1,4 +1,4 @@ -namespace OpenRpg.Genres.Fantasy.Types +namespace OpenRpg.Genres.Types { public class GenderTypes { diff --git a/src/OpenRpg.Genres/Types/ItemQualityTypes.cs b/src/OpenRpg.Genres/Types/ItemQualityTypes.cs new file mode 100644 index 0000000..47b3002 --- /dev/null +++ b/src/OpenRpg.Genres/Types/ItemQualityTypes.cs @@ -0,0 +1,11 @@ +namespace OpenRpg.Genres.Types +{ + public class ItemQualityTypes + { + public static int UnknownQuality = 0; + + public static int JunkQuality = 1; + public static int CommonQuality = 2; + public static int RareQuality = 3; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/ItemTypes.cs b/src/OpenRpg.Genres/Types/ItemTypes.cs new file mode 100644 index 0000000..696c87c --- /dev/null +++ b/src/OpenRpg.Genres/Types/ItemTypes.cs @@ -0,0 +1,11 @@ +namespace OpenRpg.Genres.Types +{ + public class ItemTypes + { + public static int UnknownItem = 0; + + public static int QuestItem = 1; + public static int GenericWeapon = 2; + public static int GenericItem = 3; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/ModificationTypes.cs b/src/OpenRpg.Genres/Types/ModificationTypes.cs new file mode 100644 index 0000000..8773842 --- /dev/null +++ b/src/OpenRpg.Genres/Types/ModificationTypes.cs @@ -0,0 +1,7 @@ +namespace OpenRpg.Genres.Types +{ + public class ModificationTypes + { + public static int UnknownModification = 0; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Types/ObjectiveTypes.cs b/src/OpenRpg.Genres/Types/ObjectiveTypes.cs similarity index 85% rename from src/OpenRpg.Genres.Fantasy/Types/ObjectiveTypes.cs rename to src/OpenRpg.Genres/Types/ObjectiveTypes.cs index 6108547..dd38024 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/ObjectiveTypes.cs +++ b/src/OpenRpg.Genres/Types/ObjectiveTypes.cs @@ -1,11 +1,11 @@ -namespace OpenRpg.Genres.Fantasy.Types +namespace OpenRpg.Genres.Types { public class ObjectiveTypes { public static int UnknownObjective = 0; public static int ItemObjective = 1; - public static int GoldObjective = 2; + public static int CurrencyObjective = 2; public static int TriggerObjective = 3; public static int LevelObjective = 4; public static int ClassObjective = 5; diff --git a/src/OpenRpg.Genres.Fantasy/Types/QuestStateTypes.cs b/src/OpenRpg.Genres/Types/QuestStateTypes.cs similarity index 86% rename from src/OpenRpg.Genres.Fantasy/Types/QuestStateTypes.cs rename to src/OpenRpg.Genres/Types/QuestStateTypes.cs index ad5491c..e58a6b7 100644 --- a/src/OpenRpg.Genres.Fantasy/Types/QuestStateTypes.cs +++ b/src/OpenRpg.Genres/Types/QuestStateTypes.cs @@ -1,4 +1,4 @@ -namespace OpenRpg.Genres.Fantasy.Types +namespace OpenRpg.Genres.Types { public class QuestStateTypes { diff --git a/src/OpenRpg.Genres/Types/RequirementTypes.cs b/src/OpenRpg.Genres/Types/RequirementTypes.cs new file mode 100644 index 0000000..35ea3ee --- /dev/null +++ b/src/OpenRpg.Genres/Types/RequirementTypes.cs @@ -0,0 +1,17 @@ +namespace OpenRpg.Genres.Types +{ + public class RequirementTypes + { + public static int UnknownRequirement = 0; + + public static int RaceRequirement = 1; + public static int ClassRequirement = 2; + public static int LevelRequirement = 3; + public static int TriggerRequirement = 4; + public static int QuestStateRequirement = 5; + public static int InventoryItemRequirement = 6; + public static int EquipmentItemRequirement = 7; + public static int GenderRequirement = 8; + public static int ActiveEffectRequirement = 9; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/RewardTypes.cs b/src/OpenRpg.Genres/Types/RewardTypes.cs new file mode 100644 index 0000000..a77c006 --- /dev/null +++ b/src/OpenRpg.Genres/Types/RewardTypes.cs @@ -0,0 +1,12 @@ +namespace OpenRpg.Genres.Types +{ + public class RewardTypes + { + public static int UnknownReward = 0; + + public static int ItemReward = 1; + public static int QuestReward = 2; + public static int TriggerReward = 3; + public static int CurrencyReward = 4; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Types/StatsVariableTypes.cs b/src/OpenRpg.Genres/Types/StatsVariableTypes.cs new file mode 100644 index 0000000..a6b9d41 --- /dev/null +++ b/src/OpenRpg.Genres/Types/StatsVariableTypes.cs @@ -0,0 +1,15 @@ +namespace OpenRpg.Genres.Types +{ + public class StatsVariableTypes + { + // Base stats + public static int MaxHealth = 1; + public static int Health = 2; + + // Attack stats + public static int PureDamage = 10; + + // Defense stats + public static int PureDefense = 20; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Variables/DefaultCharacterVariables.cs b/src/OpenRpg.Genres/Variables/DefaultCharacterVariables.cs similarity index 87% rename from src/OpenRpg.Genres.Fantasy/Variables/DefaultCharacterVariables.cs rename to src/OpenRpg.Genres/Variables/DefaultCharacterVariables.cs index 73c51ca..ca4c688 100644 --- a/src/OpenRpg.Genres.Fantasy/Variables/DefaultCharacterVariables.cs +++ b/src/OpenRpg.Genres/Variables/DefaultCharacterVariables.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using OpenRpg.Core.Variables; -namespace OpenRpg.Genres.Fantasy.Variables +namespace OpenRpg.Genres.Variables { public class DefaultCharacterVariables : DefaultVariables, ICharacterVariables { diff --git a/src/OpenRpg.Genres/Variables/DefaultEquipmentVariables.cs b/src/OpenRpg.Genres/Variables/DefaultEquipmentVariables.cs new file mode 100644 index 0000000..96cd28e --- /dev/null +++ b/src/OpenRpg.Genres/Variables/DefaultEquipmentVariables.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using OpenRpg.Core.Variables; + +namespace OpenRpg.Genres.Variables +{ + public class DefaultEquipmentVariables : DefaultVariables, IEquipmentVariables + { + public DefaultEquipmentVariables(IDictionary internalVariables = null) : base(internalVariables) + { + } + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Fantasy/Variables/ICharacterVariables.cs b/src/OpenRpg.Genres/Variables/ICharacterVariables.cs similarity index 70% rename from src/OpenRpg.Genres.Fantasy/Variables/ICharacterVariables.cs rename to src/OpenRpg.Genres/Variables/ICharacterVariables.cs index d4d873c..3e5b5aa 100644 --- a/src/OpenRpg.Genres.Fantasy/Variables/ICharacterVariables.cs +++ b/src/OpenRpg.Genres/Variables/ICharacterVariables.cs @@ -1,6 +1,6 @@ using OpenRpg.Core.Variables; -namespace OpenRpg.Genres.Fantasy.Variables +namespace OpenRpg.Genres.Variables { public interface ICharacterVariables : IVariables {} diff --git a/src/OpenRpg.Genres/Variables/IEquipmentSlots.cs b/src/OpenRpg.Genres/Variables/IEquipmentSlots.cs new file mode 100644 index 0000000..e6ca5d0 --- /dev/null +++ b/src/OpenRpg.Genres/Variables/IEquipmentSlots.cs @@ -0,0 +1,11 @@ +using OpenRpg.Core.Variables; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Variables +{ + public interface IEquipmentSlots : IVariables> + { + + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres/Variables/IEquipmentVariables.cs b/src/OpenRpg.Genres/Variables/IEquipmentVariables.cs new file mode 100644 index 0000000..6c635fe --- /dev/null +++ b/src/OpenRpg.Genres/Variables/IEquipmentVariables.cs @@ -0,0 +1,7 @@ +using OpenRpg.Core.Variables; + +namespace OpenRpg.Genres.Variables +{ + public interface IEquipmentVariables : IVariables + {} +} \ No newline at end of file From 89ce73ec9ac022c222a1769bebf9efe87aac1ec7 Mon Sep 17 00:00:00 2001 From: LP Date: Fri, 20 Aug 2021 14:47:12 +0100 Subject: [PATCH 2/2] Have moved over to new genre format --- appveyor.yml | 6 ++-- build/pack.bat | 4 +++ readme.md | 3 +- .../OpenRpg.Genres.Fantasy.csproj | 9 +----- .../Equipment/CharacterSlots/ArmourSlot.cs | 11 +++++++ .../Equipment/CharacterSlots/WeaponSlot.cs | 11 +++++++ .../Equipment/IShipEquipment.cs | 9 ++++++ .../Equipment/ShipSlots/EngineSlot.cs | 11 +++++++ .../Equipment/ShipSlots/HullArmourSlot.cs | 11 +++++++ .../Equipment/ShipSlots/MiscSlot.cs | 11 +++++++ .../Equipment/ShipSlots/ShieldSlot.cs | 11 +++++++ .../Equipment/ShipSlots/WeaponSlot.cs | 11 +++++++ .../Equipment/ShipSlots/WingSlot.cs | 11 +++++++ .../Extensions/EquipmentExtensions.cs | 13 ++++++++ .../Extensions/ShipEquipmentExtensions.cs | 24 ++++++++++++++ .../OpenRpg.Genres.Scifi.csproj | 18 +++++++++++ src/OpenRpg.Genres.Scifi/Ships/IPilot.cs | 9 ++++++ src/OpenRpg.Genres.Scifi/Ships/IShip.cs | 15 +++++++++ .../Ships/IShipTemplate.cs | 11 +++++++ .../Types/CharacterEquipmentSlotTypes.cs | 10 ++++++ src/OpenRpg.Genres.Scifi/Types/DamageTypes.cs | 11 +++++++ src/OpenRpg.Genres.Scifi/Types/EffectTypes.cs | 31 +++++++++++++++++++ src/OpenRpg.Genres.Scifi/Types/ItemTypes.cs | 9 ++++++ .../Types/ShipEquipmentSlotTypes.cs | 22 +++++++++++++ .../Types/ShipItemTypes.cs | 13 ++++++++ .../Types/StatsVariableTypes.cs | 26 ++++++++++++++++ .../Variables/DefaultShipStats.cs | 12 +++++++ .../Variables/IShipStats.cs | 7 +++++ src/OpenRpg.Genres.sln | 6 ++++ 29 files changed, 344 insertions(+), 12 deletions(-) create mode 100644 build/pack.bat create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/ArmourSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/WeaponSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/IShipEquipment.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/EngineSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/HullArmourSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/MiscSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/ShieldSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WeaponSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WingSlot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Extensions/EquipmentExtensions.cs create mode 100644 src/OpenRpg.Genres.Scifi/Extensions/ShipEquipmentExtensions.cs create mode 100644 src/OpenRpg.Genres.Scifi/OpenRpg.Genres.Scifi.csproj create mode 100644 src/OpenRpg.Genres.Scifi/Ships/IPilot.cs create mode 100644 src/OpenRpg.Genres.Scifi/Ships/IShip.cs create mode 100644 src/OpenRpg.Genres.Scifi/Ships/IShipTemplate.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/CharacterEquipmentSlotTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/DamageTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/EffectTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/ItemTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/ShipEquipmentSlotTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/ShipItemTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Types/StatsVariableTypes.cs create mode 100644 src/OpenRpg.Genres.Scifi/Variables/DefaultShipStats.cs create mode 100644 src/OpenRpg.Genres.Scifi/Variables/IShipStats.cs diff --git a/appveyor.yml b/appveyor.yml index 8c560ab..09fd5f6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.19.{build} +version: 0.20.{build} branches: only: - master @@ -14,9 +14,9 @@ dotnet_csproj: file_version: '{version}' informational_version: '{version}' before_build: -- cmd: nuget restore src/OpenRpg.Genres.Fantasy.sln +- cmd: nuget restore src/OpenRpg.Genres.sln build: - project: src/OpenRpg.Genres.Fantasy.sln + project: src/OpenRpg.Genres.sln publish_nuget: true verbosity: minimal artifacts: diff --git a/build/pack.bat b/build/pack.bat new file mode 100644 index 0000000..b0b88b2 --- /dev/null +++ b/build/pack.bat @@ -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% \ No newline at end of file diff --git a/readme.md b/readme.md index 6f2c0b8..b05e252 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,8 @@ This builds on top of the `OpenRpg` core library and adds common genres infrastr [![Nuget Version][nuget-image]][nuget-url] [![Join Discord Chat][discord-image]][discord-url] -This contains common fantasy related helpers, i.e providing helpers for str, dex, con, int, wis, cha releated stats and +## Summary +This contains common helpers for various genres, such as fantasy or scifi, i.e providing helpers for str, dex, con, int, wis, cha releated stats and common item qualities and damage types which all adhere to common fantasy settings. As with all layers on top of OpenRpg feel free to use parts or all of this as well as augment it to fit your needs. diff --git a/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj b/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj index 8742d61..ee5207c 100644 --- a/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj +++ b/src/OpenRpg.Genres.Fantasy/OpenRpg.Genres.Fantasy.csproj @@ -10,14 +10,7 @@ Adds common types and classes for fantasy style settings rpg game-development xna monogame unity godot - - - - - - - - + diff --git a/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/ArmourSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/ArmourSlot.cs new file mode 100644 index 0000000..93d969b --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/ArmourSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.CharacterSlots +{ + public class ArmourSlot : DefaultEquipmentSlot + { + public override int SlotType => ItemTypes.Armour; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/WeaponSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/WeaponSlot.cs new file mode 100644 index 0000000..bf737e4 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/CharacterSlots/WeaponSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.CharacterSlots +{ + public class WeaponSlot : DefaultEquipmentSlot + { + public override int SlotType => ItemTypes.GenericWeapon; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/IShipEquipment.cs b/src/OpenRpg.Genres.Scifi/Equipment/IShipEquipment.cs new file mode 100644 index 0000000..cc4f19a --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/IShipEquipment.cs @@ -0,0 +1,9 @@ +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment +{ + public interface IShipEquipment : IEquipment + { + + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/EngineSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/EngineSlot.cs new file mode 100644 index 0000000..815c9e9 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/EngineSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class EngineSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.Engine; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/HullArmourSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/HullArmourSlot.cs new file mode 100644 index 0000000..b7fc1fe --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/HullArmourSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class HullArmourSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.HullArmour; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/MiscSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/MiscSlot.cs new file mode 100644 index 0000000..38d92e9 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/MiscSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class MiscSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.Misc; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/ShieldSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/ShieldSlot.cs new file mode 100644 index 0000000..987f737 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/ShieldSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class ShieldSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.Shield; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WeaponSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WeaponSlot.cs new file mode 100644 index 0000000..e538076 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WeaponSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class WeaponSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.GenericWeapon; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WingSlot.cs b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WingSlot.cs new file mode 100644 index 0000000..a12b203 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Equipment/ShipSlots/WingSlot.cs @@ -0,0 +1,11 @@ +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Equipment.ShipSlots +{ + public class WingSlot : DefaultEquipmentSlot + { + public override int SlotType => ShipItemTypes.Wings; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Extensions/EquipmentExtensions.cs b/src/OpenRpg.Genres.Scifi/Extensions/EquipmentExtensions.cs new file mode 100644 index 0000000..1ac5c1d --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Extensions/EquipmentExtensions.cs @@ -0,0 +1,13 @@ +using OpenRpg.Genres.Scifi.Equipment; +using OpenRpg.Genres.Scifi.Equipment.CharacterSlots; +using OpenRpg.Genres.Scifi.Types; +using OpenRpg.Items.Equipment; + +namespace OpenRpg.Genres.Scifi.Extensions +{ + public static class EquipmentExtensions + { + public static WeaponSlot WeaponSlot(this IEquipment equipment) => equipment.Slots.Get(CharacterEquipmentSlotTypes.WeaponSlot) as WeaponSlot; + public static ArmourSlot ArmourSlot(this IEquipment equipment) => equipment.Slots.Get(CharacterEquipmentSlotTypes.ArmourSlot) as ArmourSlot; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Extensions/ShipEquipmentExtensions.cs b/src/OpenRpg.Genres.Scifi/Extensions/ShipEquipmentExtensions.cs new file mode 100644 index 0000000..6ca0118 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Extensions/ShipEquipmentExtensions.cs @@ -0,0 +1,24 @@ +using OpenRpg.Genres.Scifi.Equipment; +using OpenRpg.Genres.Scifi.Equipment.ShipSlots; +using OpenRpg.Genres.Scifi.Types; + +namespace OpenRpg.Genres.Scifi.Extensions +{ + public static class ShipEquipmentExtensions + { + public static WingSlot WingSlot(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WingsSlot) as WingSlot; + public static EngineSlot EngineSlot(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.EngineSlot) as EngineSlot; + public static ShieldSlot ShieldSlot(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.ShieldSlot) as ShieldSlot; + public static HullArmourSlot HullArmourSlot(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.HullArmourSlot) as HullArmourSlot; + public static MiscSlot MiscSlot1(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.MiscSlot1) as MiscSlot; + public static MiscSlot MiscSlot2(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.MiscSlot2) as MiscSlot; + public static MiscSlot MiscSlot3(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.MiscSlot3) as MiscSlot; + public static MiscSlot MiscSlot4(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.MiscSlot4) as MiscSlot; + public static WeaponSlot WeaponSlot1(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot1) as WeaponSlot; + public static WeaponSlot WeaponSlot2(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot2) as WeaponSlot; + public static WeaponSlot WeaponSlot3(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot3) as WeaponSlot; + public static WeaponSlot WeaponSlot4(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot4) as WeaponSlot; + public static WeaponSlot WeaponSlot5(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot5) as WeaponSlot; + public static WeaponSlot WeaponSlot6(this IShipEquipment equipment) => equipment.Slots.Get(ShipEquipmentSlotTypes.WeaponSlot6) as WeaponSlot; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/OpenRpg.Genres.Scifi.csproj b/src/OpenRpg.Genres.Scifi/OpenRpg.Genres.Scifi.csproj new file mode 100644 index 0000000..a01ea81 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/OpenRpg.Genres.Scifi.csproj @@ -0,0 +1,18 @@ + + + + 0.0.0 + netstandard2.0;net46 + OpenRpg.Genres.Scifi + Grofit (LP) + https://github.com/openrpg/OpenRpg.Genres/blob/master/LICENSE + https://github.com/openrpg/OpenRpg.Genres + Adds common types and classes for scifi/space ship related game types + rpg game-development xna monogame unity godot + + + + + + + diff --git a/src/OpenRpg.Genres.Scifi/Ships/IPilot.cs b/src/OpenRpg.Genres.Scifi/Ships/IPilot.cs new file mode 100644 index 0000000..d1ef29c --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Ships/IPilot.cs @@ -0,0 +1,9 @@ +using OpenRpg.Genres.Characters; + +namespace OpenRpg.Genres.Scifi.Ships +{ + public interface IPilot : ICharacter + { + + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Ships/IShip.cs b/src/OpenRpg.Genres.Scifi/Ships/IShip.cs new file mode 100644 index 0000000..0bff05e --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Ships/IShip.cs @@ -0,0 +1,15 @@ +using OpenRpg.Genres.Scifi.Equipment; +using OpenRpg.Genres.Scifi.Variables; +using OpenRpg.Items.Inventory; + +namespace OpenRpg.Genres.Scifi.Ships +{ + public interface IShip + { + IPilot Pilot { get; } + IShipTemplate ShipTemplate { get; } + IShipEquipment Equipment { get; } + IInventory Inventory { get; } + IShipStats Stats { get; } + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Ships/IShipTemplate.cs b/src/OpenRpg.Genres.Scifi/Ships/IShipTemplate.cs new file mode 100644 index 0000000..f6dd4ff --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Ships/IShipTemplate.cs @@ -0,0 +1,11 @@ +using OpenRpg.Core.Common; +using OpenRpg.Core.Effects; +using OpenRpg.Core.Requirements; + +namespace OpenRpg.Genres.Scifi.Ships +{ + public interface IShipTemplate : IHasDataId, IHasLocaleDescription, IHasEffects, IHasRequirements + { + + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/CharacterEquipmentSlotTypes.cs b/src/OpenRpg.Genres.Scifi/Types/CharacterEquipmentSlotTypes.cs new file mode 100644 index 0000000..194df9c --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/CharacterEquipmentSlotTypes.cs @@ -0,0 +1,10 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class CharacterEquipmentSlotTypes + { + public static int UnknownSlot = 0; + + public static int WeaponSlot = 50; + public static int ArmourSlot = 51; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/DamageTypes.cs b/src/OpenRpg.Genres.Scifi/Types/DamageTypes.cs new file mode 100644 index 0000000..c4f73ac --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/DamageTypes.cs @@ -0,0 +1,11 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class DamageTypes : Genres.Types.DamageTypes + { + public static int Physical = 50; + public static int Ion = 51; + public static int Laser = 52; + public static int Ballistic = 53; + public static int Explosive = 54; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/EffectTypes.cs b/src/OpenRpg.Genres.Scifi/Types/EffectTypes.cs new file mode 100644 index 0000000..601f858 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/EffectTypes.cs @@ -0,0 +1,31 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class EffectTypes + { + // Generic All types + public static int AllDamageBonusAmount = 50; + public static int AllDefenseBonusAmount = 51; + public static int AllAttributeBonusAmount = 52; + public static int AllAttackBonusPercentage = 55; + public static int AllDefenseBonusPercentage = 56; + + // Resource types + public static int EnergyBonusAmount = 70; + public static int EnergyBonusPercentage = 71; + public static int ArmourBonusAmount = 73; + public static int ArmourBonusPercentage = 74; + public static int ShieldBonusAmount = 75; + public static int ShieldBonusPercentage = 76; + + public static int PhysicalDamageAmount = 90; + public static int PhysicalDamagePercentage = 91; + public static int IonDamageAmount = 92; + public static int IonDamagePercentage = 93; + public static int LaserDamageAmount = 94; + public static int LaserDamagePercentage = 95; + public static int BallisticDamageAmount = 96; + public static int BallisticDamagePercentage = 97; + public static int ExplosiveDamageAmount = 98; + public static int ExplosiveDamagePercentage = 99; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/ItemTypes.cs b/src/OpenRpg.Genres.Scifi/Types/ItemTypes.cs new file mode 100644 index 0000000..eddceb3 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/ItemTypes.cs @@ -0,0 +1,9 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class ItemTypes : Genres.Types.ItemTypes + { + public static int Armour = 30; + + public static int Consumable = 50; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/ShipEquipmentSlotTypes.cs b/src/OpenRpg.Genres.Scifi/Types/ShipEquipmentSlotTypes.cs new file mode 100644 index 0000000..a0b7c7d --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/ShipEquipmentSlotTypes.cs @@ -0,0 +1,22 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class ShipEquipmentSlotTypes + { + public static int UnknownSlot = 0; + + public static int EngineSlot = 50; + public static int HullArmourSlot = 51; + public static int ShieldSlot = 52; + public static int WingsSlot = 53; + public static int MiscSlot1 = 54; + public static int MiscSlot2 = 55; + public static int MiscSlot3 = 56; + public static int MiscSlot4 = 57; + public static int WeaponSlot1 = 58; + public static int WeaponSlot2 = 59; + public static int WeaponSlot3 = 60; + public static int WeaponSlot4 = 61; + public static int WeaponSlot5 = 62; + public static int WeaponSlot6 = 63; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/ShipItemTypes.cs b/src/OpenRpg.Genres.Scifi/Types/ShipItemTypes.cs new file mode 100644 index 0000000..553c226 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/ShipItemTypes.cs @@ -0,0 +1,13 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class ShipItemTypes : Genres.Types.ItemTypes + { + public static int Wings = 30; + public static int HullArmour = 31; + public static int Shield = 32; + public static int Engine = 33; + public static int Misc = 34; + + public static int Consumable = 50; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Types/StatsVariableTypes.cs b/src/OpenRpg.Genres.Scifi/Types/StatsVariableTypes.cs new file mode 100644 index 0000000..cf808c9 --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Types/StatsVariableTypes.cs @@ -0,0 +1,26 @@ +namespace OpenRpg.Genres.Scifi.Types +{ + public class StatsVariableTypes : Genres.Types.StatsVariableTypes + { + public static int MaxEnergy = 50; + public static int Energy = 51; + public static int MaxArmour = 52; + public static int Armour = 53; + public static int MaxShield = 54; + public static int Shield = 55; + + // Attack stats + public static int PhysicalDamage = 80; + public static int IonDamage = 81; + public static int LaserDamage = 82; + public static int BallisticDamage = 83; + public static int ExplosiveDamage = 84; + + // Defense stats + public static int PhysicalDefense = 100; + public static int IonDefense = 101; + public static int LaserDefense = 102; + public static int BallisticDefense = 103; + public static int ExplosiveDefense = 104; + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Variables/DefaultShipStats.cs b/src/OpenRpg.Genres.Scifi/Variables/DefaultShipStats.cs new file mode 100644 index 0000000..c2684df --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Variables/DefaultShipStats.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using OpenRpg.Core.Variables; + +namespace OpenRpg.Genres.Scifi.Variables +{ + public class DefaultShipStats : DefaultVariables, IShipStats + { + public DefaultShipStats(IDictionary internalVariables = null) : base(internalVariables) + { + } + } +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.Scifi/Variables/IShipStats.cs b/src/OpenRpg.Genres.Scifi/Variables/IShipStats.cs new file mode 100644 index 0000000..c460fcb --- /dev/null +++ b/src/OpenRpg.Genres.Scifi/Variables/IShipStats.cs @@ -0,0 +1,7 @@ +using OpenRpg.Core.Variables; + +namespace OpenRpg.Genres.Scifi.Variables +{ + public interface IShipStats : IVariables + {} +} \ No newline at end of file diff --git a/src/OpenRpg.Genres.sln b/src/OpenRpg.Genres.sln index f6431b2..84518a9 100644 --- a/src/OpenRpg.Genres.sln +++ b/src/OpenRpg.Genres.sln @@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRpg.Genres.Fantasy", "O EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRpg.Genres", "OpenRpg.Genres\OpenRpg.Genres.csproj", "{2E807C6D-06C6-45AB-9FFC-86797C4A631B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenRpg.Genres.Scifi", "OpenRpg.Genres.Scifi\OpenRpg.Genres.Scifi.csproj", "{682855A0-F455-4C44-B444-FEFADA0754DD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -18,6 +20,10 @@ Global {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E807C6D-06C6-45AB-9FFC-86797C4A631B}.Release|Any CPU.Build.0 = Release|Any CPU + {682855A0-F455-4C44-B444-FEFADA0754DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {682855A0-F455-4C44-B444-FEFADA0754DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {682855A0-F455-4C44-B444-FEFADA0754DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {682855A0-F455-4C44-B444-FEFADA0754DD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution EndGlobalSection