diff --git a/Fuyu.Backend.BSG/DTO/Services/ItemFactoryService.cs b/Fuyu.Backend.BSG/DTO/Services/ItemFactoryService.cs new file mode 100644 index 00000000..a4d43cd7 --- /dev/null +++ b/Fuyu.Backend.BSG/DTO/Services/ItemFactoryService.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using Fuyu.Backend.BSG.ItemTemplates; +using Fuyu.Backend.BSG.Models.Items; +using Fuyu.Backend.BSG.Models.Responses; +using Fuyu.Common.Hashing; +using Fuyu.Common.IO; +using Fuyu.Common.Serialization; + +namespace Fuyu.Backend.BSG.DTO.Services +{ + // TODO: split UPD factory and Item Factory + public static class ItemFactoryService + { + public static Dictionary ItemTemplates { get; private set; } + + public static void Load() + { + var itemsText = Resx.GetText("eft", "database.client.items.json"); + ItemTemplates = Json.Parse>>(itemsText).data; + } + + public static ItemInstance CreateItem(MongoId tpl, MongoId? id = null) + { + var template = ItemTemplates[tpl]; + var itemId = id.GetValueOrDefault(new MongoId(true)); + ItemUpdatable upd = CreateItemUpdatable(template); + + var item = new ItemInstance + { + Id = itemId, + TemplateId = tpl, + Updatable = upd + }; + + return item; + } + + public static ItemUpdatable CreateItemUpdatable(ItemTemplate template) + { + ItemUpdatable upd = null; + var updProperties = typeof(ItemUpdatable).GetProperties(); + + foreach (var updProperty in updProperties) + { + var component = CreateItemComponent(template, updProperty.PropertyType, false); + if (component != null) + { + if (upd == null) + { + upd = new ItemUpdatable(); + } + + updProperty.SetValue(upd, component); + } + } + + return upd; + } + + public static object CreateItemComponent(ItemTemplate template, Type componentType, bool createDefault) + { + var isItemComponentInterface = typeof(IItemComponent).IsAssignableFrom(componentType); + if (!isItemComponentInterface) + { + return null; + } + + var bindingFlags = BindingFlags.Public | BindingFlags.Static; + var createComponentMethodName = nameof(IItemComponent.CreateComponent); + var createComponentMethod = componentType.GetMethod(createComponentMethodName, bindingFlags); + if (createComponentMethod == null) + { + return null; + } + + var result = createComponentMethod.Invoke(null, [template.Props]); + if (result == null && createDefault) + { + result = Activator.CreateInstance(componentType); + } + + return result; + } + + public static ItemUpdatable CreateItemUpdatable(MongoId tpl) + { + return CreateItemUpdatable(ItemTemplates[tpl]); + } + + public static object CreateItemComponent(MongoId tpl, Type componentType, bool createDefault) + { + return CreateItemComponent(ItemTemplates[tpl], componentType, createDefault); + } + } +} diff --git a/Fuyu.Backend.BSG/IItemComponent.cs b/Fuyu.Backend.BSG/IItemComponent.cs new file mode 100644 index 00000000..d227bd6e --- /dev/null +++ b/Fuyu.Backend.BSG/IItemComponent.cs @@ -0,0 +1,9 @@ +using Newtonsoft.Json.Linq; + +namespace Fuyu.Backend.BSG +{ + public interface IItemComponent + { + static abstract object CreateComponent(JObject templateProperties); + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AmmoBoxItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AmmoBoxItemProperties.cs new file mode 100644 index 00000000..39155e7e --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AmmoBoxItemProperties.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AmmoBoxItemProperties : StackableItemItemProperties + { + [DataMember(Name = "magAnimationIndex")] + public int magAnimationIndex; + + [DataMember(Name = "StackSlots")] + public object[] StackSlots = []; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AmmoItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AmmoItemProperties.cs new file mode 100644 index 00000000..b0552ca6 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AmmoItemProperties.cs @@ -0,0 +1,198 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AmmoItemProperties : StackableItemItemProperties + { + [DataMember(Name = "ammoType")] + public string ammoType; + + [DataMember(Name = "Damage")] + public int Damage; + + [DataMember(Name = "ammoAccr")] + public int ammoAccr; + + [DataMember(Name = "ammoRec")] + public int ammoRec; + + [DataMember(Name = "ammoDist")] + public int ammoDist; + + [DataMember(Name = "buckshotBullets")] + public int buckshotBullets; + + [DataMember(Name = "PenetrationPower")] + public int PenetrationPower = 40; + + [DataMember(Name = "PenetrationPowerDiviation")] + public float PenetrationPowerDiviation; + + [DataMember(Name = "ammoHear")] + public int ammoHear; + + [DataMember(Name = "ammoSfx")] + public string ammoSfx; + + [DataMember(Name = "MisfireChance")] + public float MisfireChance; + + [DataMember(Name = "MinFragmentsCount")] + public int MinFragmentsCount = 2; + + [DataMember(Name = "MaxFragmentsCount")] + public int MaxFragmentsCount = 3; + + [DataMember(Name = "ammoShiftChance")] + public int ammoShiftChance; + + [DataMember(Name = "casingName")] + public string casingName; + + [DataMember(Name = "casingEjectPower")] + public float casingEjectPower; + + [DataMember(Name = "casingMass")] + public float casingMass; + + [DataMember(Name = "casingSounds")] + public string casingSounds; + + [DataMember(Name = "ProjectileCount")] + public int ProjectileCount = 1; + + [DataMember(Name = "InitialSpeed")] + public float InitialSpeed = 700f; + + [DataMember(Name = "PenetrationDamageMod")] + public float PenetrationDamageMod = 0.1f; + + [DataMember(Name = "PenetrationChanceObstacle")] + public float PenetrationChanceObstacle = 0.2f; + + [DataMember(Name = "RicochetChance")] + public float RicochetChance = 0.1f; + + [DataMember(Name = "FragmentationChance")] + public float FragmentationChance = 0.03f; + + [DataMember(Name = "BallisticCoeficient")] + public float BallisticCoeficient = 1f; + + [DataMember(Name = "Tracer")] + public bool Tracer; + + [DataMember(Name = "TracerColor")] + public ETaxonomyColor TracerColor; + + [DataMember(Name = "TracerDistance")] + public float TracerDistance; + + [DataMember(Name = "ArmorDamage")] + public int ArmorDamage; + + [DataMember(Name = "Caliber")] + public string Caliber; + + [DataMember(Name = "StaminaBurnPerDamage")] + public float StaminaBurnPerDamage; + + [DataMember(Name = "HasGrenaderComponent")] + public bool HasGrenaderComponent; + + [DataMember(Name = "FuzeArmTimeSec")] + public float FuzeArmTimeSec; + + [DataMember(Name = "MinExplosionDistance")] + public float MinExplosionDistance; + + [DataMember(Name = "MaxExplosionDistance")] + public float MaxExplosionDistance; + + [DataMember(Name = "FragmentsCount")] + public int FragmentsCount; + + [DataMember(Name = "FragmentType")] + public string FragmentType; + + [DataMember(Name = "ExplosionType")] + public string ExplosionType; + + [DataMember(Name = "ShowHitEffectOnExplode")] + public bool ShowHitEffectOnExplode; + + [DataMember(Name = "ExplosionStrength")] + public float ExplosionStrength; + + [DataMember(Name = "ShowBullet")] + public bool ShowBullet; + + [DataMember(Name = "AmmoLifeTimeSec")] + public float AmmoLifeTimeSec = 2f; + + [DataMember(Name = "MalfMisfireChance")] + public float MalfMisfireChance; + + [DataMember(Name = "MalfFeedChance")] + public float MalfFeedChance; + + [DataMember(Name = "ArmorDistanceDistanceDamage")] + public Vector3 ArmorDistanceDistanceDamage; + + [DataMember(Name = "Contusion")] + public Vector3 Contusion; + + [DataMember(Name = "Blindness")] + public Vector3 Blindness; + + [DataMember(Name = "LightBleedingDelta")] + public float LightBleedingDelta; + + [DataMember(Name = "HeavyBleedingDelta")] + public float HeavyBleedingDelta; + + [DataMember(Name = "IsLightAndSoundShot")] + public bool IsLightAndSoundShot; + + [DataMember(Name = "LightAndSoundShotAngle")] + public float LightAndSoundShotAngle; + + [DataMember(Name = "LightAndSoundShotSelfContusionTime")] + public float LightAndSoundShotSelfContusionTime; + + [DataMember(Name = "LightAndSoundShotSelfContusionStrength")] + public float LightAndSoundShotSelfContusionStrength; + + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "BulletMassGram")] + public float BulletMassGram; + + [DataMember(Name = "BulletDiameterMilimeters")] + public float BulletDiameterMilimeters; + + [DataMember(Name = "RemoveShellAfterFire")] + public bool RemoveShellAfterFire; + + [DataMember(Name = "airDropTemplateId")] + public string airDropTemplateId; + + [DataMember(Name = "FlareTypes")] + public EFlareEventType[] FlareTypes; + } + + public enum EFlareEventType + { + Airdrop, + ExitActivate, + AIFollowEvent, + CallArtilleryOnMyself + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ArmBandItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ArmBandItemProperties.cs new file mode 100644 index 00000000..a1cc5391 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ArmBandItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ArmBandItemProperties : EquipmentItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ArmorItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ArmorItemProperties.cs new file mode 100644 index 00000000..21df70f0 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ArmorItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ArmorItemProperties : ArmoredEquipmentItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ArmorPlateItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ArmorPlateItemProperties.cs new file mode 100644 index 00000000..66a0b865 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ArmorPlateItemProperties.cs @@ -0,0 +1,16 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ArmorPlateItemProperties : ArmoredEquipmentItemProperties + { + [DataMember(Name = "Lower75Prefab")] + public ResourceKey Lower75Prefab; + + [DataMember(Name = "Lower40Prefab")] + public ResourceKey Lower40Prefab; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ArmoredEquipmentItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ArmoredEquipmentItemProperties.cs new file mode 100644 index 00000000..dbe41e4a --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ArmoredEquipmentItemProperties.cs @@ -0,0 +1,71 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ArmoredEquipmentItemProperties : EquipmentItemProperties + { + [DataMember(Name = "FaceShieldComponent")] + public bool FaceShieldComponent; + + [DataMember(Name = "HasHinge")] + public bool HasHinge; + + [DataMember(Name = "Durability")] + public int Durability; + + [DataMember(Name = "MaxDurability")] + public int MaxDurability; + + [DataMember(Name = "armorClass")] + public int armorClass; + + [DataMember(Name = "speedPenaltyPercent")] + public float speedPenaltyPercent; + + [DataMember(Name = "mousePenalty")] + public float mousePenalty; + + [DataMember(Name = "weaponErgonomicPenalty")] + public float weaponErgonomicPenalty; + + [DataMember(Name = "MaterialType")] + public EMaterialType MaterialType; + + [DataMember(Name = "ArmorType")] + public EArmorType ArmorType; + + [DataMember(Name = "BluntThroughput")] + public float BluntThroughput; + + [DataMember(Name = "ArmorMaterial")] + public EArmorMaterial ArmorMaterial; + + [DataMember(Name = "RicochetParams")] + public Vector3 RicochetParams; + + [DataMember(Name = "DeafStrength")] + public EDeafStrength DeafStrength; + + [DataMember(Name = "armorColliders")] + public EBodyPartColliderType[] armorColliders = []; + + [DataMember(Name = "armorPlateColliders")] + public EArmorPlateCollider[] armorPlateColliders = []; + + [DataMember(Name = "FaceShieldMask")] + public EFaceShieldMask FaceShieldMask; + + [DataMember(Name = "BlindnessProtection")] + public float BlindnessProtection; + } + + public enum EFaceShieldMask + { + NoMask, + Narrow, + Wide + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AssaultCarbineItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AssaultCarbineItemProperties.cs new file mode 100644 index 00000000..cfcc491b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AssaultCarbineItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AssaultCarbineItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AssaultRifleItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AssaultRifleItemProperties.cs new file mode 100644 index 00000000..9bfc6aac --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AssaultRifleItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AssaultRifleItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AssaultScopeItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AssaultScopeItemProperties.cs new file mode 100644 index 00000000..7206086a --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AssaultScopeItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AssaultScopeItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/AuxiliaryModItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/AuxiliaryModItemProperties.cs new file mode 100644 index 00000000..91811474 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/AuxiliaryModItemProperties.cs @@ -0,0 +1,20 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class AuxiliaryModItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "ShiftsAimCamera")] + public float ShiftsAimCamera; + + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BackpackItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BackpackItemProperties.cs new file mode 100644 index 00000000..f7fce50b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BackpackItemProperties.cs @@ -0,0 +1,23 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BackpackItemProperties : SearchableItemItemProperties + { + [DataMember(Name = "LeanWeaponAgainstBody")] + public bool LeanWeaponAgainstBody; + + [DataMember(Name = "GridLayoutName")] + public string GridLayoutName; + + [DataMember(Name = "speedPenaltyPercent")] + public float speedPenaltyPercent; + + [DataMember(Name = "mousePenalty")] + public float mousePenalty; + + [DataMember(Name = "weaponErgonomicPenalty")] + public float weaponErgonomicPenalty; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BarrelItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BarrelItemProperties.cs new file mode 100644 index 00000000..bcfd5029 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BarrelItemProperties.cs @@ -0,0 +1,32 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BarrelItemProperties : MasterModItemProperties + { + [DataMember(Name = "IsSilencer")] + public bool IsSilencer; + + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + + [DataMember(Name = "CenterOfImpact")] + public float CenterOfImpact; + + [DataMember(Name = "ShotgunDispersion")] + public float ShotgunDispersion; + + [DataMember(Name = "DeviationMax")] + public float DeviationMax; + + [DataMember(Name = "DeviationCurve")] + public float DeviationCurve; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BarterItemItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BarterItemItemProperties.cs new file mode 100644 index 00000000..c7db2704 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BarterItemItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BarterItemItemProperties : ItemProperties + { + [DataMember(Name = "MaxResource")] + public int MaxResource { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BatteryItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BatteryItemProperties.cs new file mode 100644 index 00000000..b5956d1a --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BatteryItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BatteryItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BipodItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BipodItemProperties.cs new file mode 100644 index 00000000..92581465 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BipodItemProperties.cs @@ -0,0 +1,31 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BipodItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "BipodRecoilMultiplier")] + public float BipodRecoilMultiplier = 0.2f; + + [DataMember(Name = "BipodReturnHandSpeedMultiplier")] + public float BipodReturnHandSpeedMultiplier = 1f; + + [DataMember(Name = "BipodCameraSnapMultiplier")] + public float BipodCameraSnapMultiplier = 1f; + + [DataMember(Name = "BipodOutOfStaminaBreathMultiplier")] + public float BipodOutOfStaminaBreathMultiplier = 0.1f; + + // NOTE: Only X and Y are used for these two, I just made it a + // Vector3 because I'm too lazy to make a Vector2 type right now + // -- nexus4880, 2024-10-18 + [DataMember(Name = "PitchLimitProneBipod")] + public Vector3 PitchLimitProneBipod = new Vector3 { X = -10, Y = 10 }; + + [DataMember(Name = "YawLimitProneBipod")] + public Vector3 YawLimitProneBipod = new Vector3 { X = -10, Y = 10 }; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BuildingMaterialItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BuildingMaterialItemProperties.cs new file mode 100644 index 00000000..0f4c1125 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BuildingMaterialItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BuildingMaterialItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/BuiltInInsertsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/BuiltInInsertsItemProperties.cs new file mode 100644 index 00000000..84bef849 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/BuiltInInsertsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class BuiltInInsertsItemProperties : ArmorPlateItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ChargeItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ChargeItemProperties.cs new file mode 100644 index 00000000..6660e7ff --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ChargeItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ChargeItemProperties : GearModItemProperties + { + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator { get; set; } = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CollimatorItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CollimatorItemProperties.cs new file mode 100644 index 00000000..fb0eb33f --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CollimatorItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CollimatorItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CompactCollimatorItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CompactCollimatorItemProperties.cs new file mode 100644 index 00000000..286ad629 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CompactCollimatorItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CompactCollimatorItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CompassItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CompassItemProperties.cs new file mode 100644 index 00000000..653f3071 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CompassItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CompassItemProperties : SpecItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CompensatorItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CompensatorItemProperties.cs new file mode 100644 index 00000000..236bb252 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CompensatorItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CompensatorItemProperties : MuzzleItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CompoundItemItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CompoundItemItemProperties.cs new file mode 100644 index 00000000..d6124c4b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CompoundItemItemProperties.cs @@ -0,0 +1,146 @@ +using System.Runtime.Serialization; +using System.Runtime.Serialization.DataContracts; +using Fuyu.Common.Hashing; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CompoundItemItemProperties : ItemProperties + { + [DataMember(Name = "Grids")] + public Grid[] Grids = []; + + [DataMember(Name = "Slots")] + public Slot[] Slots = []; + + [DataMember(Name = "CanPutIntoDuringTheRaid")] + public bool CanPutIntoDuringTheRaid; + + [DataMember(Name = "CantRemoveFromSlotsDuringRaid")] + public EEquipmentSlot[] CantRemoveFromSlotsDuringRaid = []; + + [DataMember(Name = "ForbidMissingVitalParts")] + public bool ForbidMissingVitalParts; + + [DataMember(Name = "ForbidNonEmptyContainers")] + public bool ForbidNonEmptyContainers; + } + + public enum EEquipmentSlot + { + FirstPrimaryWeapon, + SecondPrimaryWeapon, + Holster, + Scabbard, + Backpack, + SecuredContainer, + TacticalVest, + ArmorVest, + Pockets, + Eyewear, + FaceCover, + Headwear, + Earpiece, + Dogtag, + ArmBand + } + + [DataContract] + public class Slot + { + [DataMember(Name = "_name")] + public string Name { get; set; } + + [DataMember(Name = "_id")] + public MongoId Id { get; set; } + + [DataMember(Name = "_parent")] + public MongoId Parent { get; set; } + + [DataMember(Name = "_props")] + public SlotProperties Properties { get; set; } + + [DataMember(Name = "_required")] + public bool Required { get; set; } + + [DataMember(Name = "_mergeSlotWithChildren")] + public bool MergeSlotWithChildren { get; set; } + + [DataMember(Name = "_proto")] + // I am hesitant to mark this as MongoId even though it seemingly is + // because I am not nor have I ever been sure of what proto even is + // -- nexus4880, 2024-10-18 + public string Proto { get; set; } + } + + [DataContract] + public class SlotProperties + { + [DataMember(Name = "filters")] + public SlotPropertiesFilter[] Filters { get; set; } + } + + [DataContract] + public class SlotPropertiesFilter + { + [DataMember(Name = "Shift")] + public int Shift { get; set; } + + [DataMember(Name = "Filter")] + public MongoId[] Filter { get; set; } + } + + [DataContract] + public class Grid + { + [DataMember(Name = "_name")] + public string Name { get; set; } + + [DataMember(Name = "_id")] + public MongoId Id { get; set; } + + [DataMember(Name = "_parent")] + public MongoId Parent { get; set; } + + [DataMember(Name = "_props")] + public GridProperties Properties { get; set; } + + [DataMember(Name = "_proto")] + public string Proto { get; set; } + } + + [DataContract] + public class GridProperties + { + [DataMember(Name = "filters")] + public GridPropertiesFilter[] Filters { get; set; } + + [DataMember(Name = "cellsH")] + public int CellsHorizontal { get; set; } + + [DataMember(Name = "cellsV")] + public int CellsVertical { get; set; } + + [DataMember(Name = "minCount")] + public int MinCount { get; set; } + + [DataMember(Name = "maxCount")] + public int MaxCount { get; set; } + + [DataMember(Name = "maxWeight")] + public int MaxWeight { get; set; } + + [DataMember(Name = "isSortingTable")] + public bool IsSortingTable { get; set; } + } + + [DataContract] + public class GridPropertiesFilter + { + [DataMember(Name = "Filter")] + public MongoId[] Filter { get; set; } + + [DataMember(Name = "ExcludedFilter")] + public MongoId[] ExcludedFilter { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CultistAmuletItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CultistAmuletItemProperties.cs new file mode 100644 index 00000000..310bbdb3 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CultistAmuletItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CultistAmuletItemProperties : SpecItemItemProperties + { + [DataMember(Name = "MaxUsages")] + public int MaxUsages { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/CylinderMagazineItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/CylinderMagazineItemProperties.cs new file mode 100644 index 00000000..9d722a6a --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/CylinderMagazineItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class CylinderMagazineItemProperties : MagazineItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/DrinkItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/DrinkItemProperties.cs new file mode 100644 index 00000000..04646f64 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/DrinkItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class DrinkItemProperties : FoodDrinkItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/DrugsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/DrugsItemProperties.cs new file mode 100644 index 00000000..5a9644d4 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/DrugsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class DrugsItemProperties : MedsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ElectronicsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ElectronicsItemProperties.cs new file mode 100644 index 00000000..5a9219f7 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ElectronicsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ElectronicsItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/EquipmentItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/EquipmentItemProperties.cs new file mode 100644 index 00000000..aed9e775 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/EquipmentItemProperties.cs @@ -0,0 +1,20 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class EquipmentItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "BlocksEarpiece")] + public bool BlocksEarpiece; + + [DataMember(Name = "BlocksEyewear")] + public bool BlocksEyewear; + + [DataMember(Name = "BlocksFaceCover")] + public bool BlocksFaceCover; + + [DataMember(Name = "BlocksHeadwear")] + public bool BlocksHeadwear; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FaceCoverItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FaceCoverItemProperties.cs new file mode 100644 index 00000000..80387c77 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FaceCoverItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FaceCoverItemProperties : ArmoredEquipmentItemProperties + { + [DataMember(Name = "IsHalfMask")] + public bool IsHalfMask { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FlashHiderItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FlashHiderItemProperties.cs new file mode 100644 index 00000000..0b2324e7 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FlashHiderItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FlashHiderItemProperties : MuzzleItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FlashlightItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FlashlightItemProperties.cs new file mode 100644 index 00000000..2e408906 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FlashlightItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FlashlightItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "ModesCount")] + public int ModesCount { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FoodDrinkItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FoodDrinkItemProperties.cs new file mode 100644 index 00000000..a2ea6f52 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FoodDrinkItemProperties.cs @@ -0,0 +1,23 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FoodDrinkItemProperties : ItemProperties + { + [DataMember(Name = "MaxResource")] + public float MaxResource { get; set; } + + [DataMember(Name = "foodUseTime")] + public int UseTime { get; set; } + + [DataMember(Name = "effects_health")] + public object HealthEffects { get; set; } + + [DataMember(Name = "effects_damage")] + public object DamageEffects { get; set; } + + [DataMember(Name = "StimulatorBuffs")] + public string StimulatorBuffs { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FoodItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FoodItemProperties.cs new file mode 100644 index 00000000..5ed01d27 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FoodItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FoodItemProperties : FoodDrinkItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ForegripItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ForegripItemProperties.cs new file mode 100644 index 00000000..1da779cc --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ForegripItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ForegripItemProperties : FunctionalModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FuelItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FuelItemProperties.cs new file mode 100644 index 00000000..73e67998 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FuelItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FuelItemProperties : LubricantItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/FunctionalModItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/FunctionalModItemProperties.cs new file mode 100644 index 00000000..1d6e1364 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/FunctionalModItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class FunctionalModItemProperties : ModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/GasblockItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/GasblockItemProperties.cs new file mode 100644 index 00000000..2d69a849 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/GasblockItemProperties.cs @@ -0,0 +1,17 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class GasblockItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator { get; set; } = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor { get; set; } = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor { get; set; } = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/GearModItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/GearModItemProperties.cs new file mode 100644 index 00000000..caa08988 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/GearModItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class GearModItemProperties : ModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/GrenadeLauncherItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/GrenadeLauncherItemProperties.cs new file mode 100644 index 00000000..c17fb200 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/GrenadeLauncherItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class GrenadeLauncherItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/HandguardItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/HandguardItemProperties.cs new file mode 100644 index 00000000..2426faad --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/HandguardItemProperties.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class HandguardItemProperties : MasterModItemProperties + { + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/HeadphonesItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/HeadphonesItemProperties.cs new file mode 100644 index 00000000..94bb2b2f --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/HeadphonesItemProperties.cs @@ -0,0 +1,101 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class HeadphonesItemProperties : EquipmentItemProperties + { + [DataMember(Name = "RolloffMultiplier")] + public float RolloffMultiplier = 1f; + + [DataMember(Name = "GunsCompressorSendLevel")] + public float GunsCompressorSendLevel = -80f; + + [DataMember(Name = "ClientPlayerCompressorSendLevel")] + public float ClientPlayerCompressorSendLevel = -80f; + + [DataMember(Name = "ObservedPlayerCompressorSendLevel")] + public float ObservedPlayerCompressorSendLevel = -80f; + + [DataMember(Name = "NpcCompressorSendLevel")] + public float NpcCompressorSendLevel = -80f; + + [DataMember(Name = "EnvTechnicalCompressorSendLevel")] + public float EnvTechnicalCompressorSendLevel = -80f; + + [DataMember(Name = "EnvNatureCompressorSendLevel")] + public float EnvNatureCompressorSendLevel = -80f; + + [DataMember(Name = "EnvCommonCompressorSendLevel")] + public float EnvCommonCompressorSendLevel = -80f; + + [DataMember(Name = "AmbientCompressorSendLevel")] + public float AmbientCompressorSendLevel = -80f; + + [DataMember(Name = "EffectsReturnsCompressorSendLevel")] + public float EffectsReturnsCompressorSendLevel = -80f; + + [DataMember(Name = "HeadphonesMixerVolume")] + public float HeadphonesMixerVolume; + + [DataMember(Name = "AmbientVolume")] + public float AmbientVolume; + + [DataMember(Name = "DryVolume")] + public float DryVolume; + + [DataMember(Name = "EffectsReturnsGroupVolume")] + public float EffectsReturnsGroupVolume; + + [DataMember(Name = "Distortion")] + public float Distortion; + + [DataMember(Name = "CompressorThreshold")] + public float CompressorThreshold; + + [DataMember(Name = "CompressorAttack")] + public float CompressorAttack; + + [DataMember(Name = "CompressorRelease")] + public float CompressorRelease; + + [DataMember(Name = "CompressorGain")] + public float CompressorGain; + + [DataMember(Name = "HighpassFreq")] + public int HighpassFreq = 100; + + [DataMember(Name = "HighpassResonance")] + public float HighpassResonance; + + [DataMember(Name = "LowpassFreq")] + public int LowpassFreq = 22000; + + [DataMember(Name = "EQBand1Frequency")] + public float EQBand1Frequency = 200f; + + [DataMember(Name = "EQBand1Gain")] + public float EQBand1Gain = 1f; + + [DataMember(Name = "EQBand1Q")] + public float EQBand1Q = 1f; + + [DataMember(Name = "EQBand2Frequency")] + public float EQBand2Frequency = 1000f; + + [DataMember(Name = "EQBand2Gain")] + public float EQBand2Gain = 1f; + + [DataMember(Name = "EQBand2Q")] + public float EQBand2Q = 1f; + + [DataMember(Name = "EQBand3Frequency")] + public float EQBand3Frequency = 8000f; + + [DataMember(Name = "EQBand3Gain")] + public float EQBand3Gain = 1f; + + [DataMember(Name = "EQBand3Q")] + public float EQBand3Q = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/HeadwearItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/HeadwearItemProperties.cs new file mode 100644 index 00000000..0d9db933 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/HeadwearItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class HeadwearItemProperties : ArmoredEquipmentItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/HideoutAreaContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/HideoutAreaContainerItemProperties.cs new file mode 100644 index 00000000..6e738601 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/HideoutAreaContainerItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class HideoutAreaContainerItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "LayoutName")] + public string LayoutName { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/HouseholdGoodsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/HouseholdGoodsItemProperties.cs new file mode 100644 index 00000000..04150c6c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/HouseholdGoodsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class HouseholdGoodsItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/InfoItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/InfoItemProperties.cs new file mode 100644 index 00000000..112871c3 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/InfoItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class InfoItemProperties : ItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/InventoryItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/InventoryItemProperties.cs new file mode 100644 index 00000000..08a3aef5 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/InventoryItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class InventoryItemProperties : CompoundItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/IronSightItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/IronSightItemProperties.cs new file mode 100644 index 00000000..4d492c27 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/IronSightItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class IronSightItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ItemProperties.cs new file mode 100644 index 00000000..5d91aaec --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ItemProperties.cs @@ -0,0 +1,189 @@ +using System; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; +using Fuyu.Common.Hashing; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + [JsonPolymorphic] + public class ItemProperties + { + [DataMember(Name = "Width")] + public int Width { get; set; } + + [DataMember(Name = "AnimationVariantsNumber")] + public int AnimationVariantsNumber { get; set; } + + [DataMember(Name = "BackgroundColor")] + public ETaxonomyColor BackgroundColor { get; set; } + + [DataMember(Name = "CanRequireOnRagfair")] + public bool CanRequireOnRagfair { get; set; } + + [DataMember(Name = "CanSellOnRagfair")] + public bool CanSellOnRagfair { get; set; } + + [DataMember(Name = "ConflictingItems")] + public MongoId[] ConflictingItems { get; set; } = []; + + [DataMember(Name = "CreditsPrice")] + public int CreditsPrice { get; set; } + + [DataMember(Name = "Description")] + public string Description { get; set; } + + [DataMember(Name = "DiscardLimit")] + public int DiscardLimit { get; set; } = -1; + + [DataMember(Name = "DropSoundType")] + public EItemDropSoundType DropSoundType { get; set; } + + [DataMember(Name = "ExaminedByDefault")] + public bool ExaminedByDefault { get; set; } + + [DataMember(Name = "ExamineExperience")] + public int ExamineExperience { get; set; } + + [DataMember(Name = "ExamineTime")] + public float ExamineTime { get; set; } + + [DataMember(Name = "ExtraSizeDown")] + public int ExtraSizeDown { get; set; } + + [DataMember(Name = "ExtraSizeForceAdd")] + public bool ExtraSizeForceAdd { get; set; } + + [DataMember(Name = "ExtraSizeLeft")] + public int ExtraSizeLeft { get; set; } + + [DataMember(Name = "ExtraSizeRight")] + public int ExtraSizeRight { get; set; } + + [DataMember(Name = "ExtraSizeUp")] + public int ExtraSizeUp { get; set; } + + [DataMember(Name = "Height")] + public int Height { get; set; } + + [DataMember(Name = "HideEntrails")] + public bool HideEntrails { get; set; } + + [DataMember(Name = "InsuranceDisabled")] + public bool InsuranceDisabled { get; set; } + + [DataMember(Name = "IsAlwaysAvailableForInsurance")] + public bool IsAlwaysAvailableForInsurance { get; set; } + + [DataMember(Name = "IsSpecialSlotOnly")] + public bool IsSpecialSlotOnly { get; set; } + + [DataMember(Name = "IsUnremovable")] + public bool IsUnremovable { get; set; } + + [DataMember(Name = "ItemSound")] + public string ItemSound { get; set; } + + [DataMember(Name = "LootExperience")] + public int LootExperience { get; set; } + + [DataMember(Name = "MergesWithChildren")] + public bool MergesWithChildren { get; set; } + + [DataMember(Name = "Name")] + public string Name { get; set; } + + [DataMember(Name = "NotShownInSlot")] + public bool NotShownInSlot { get; set; } + + [DataMember(Name = "Prefab")] + public ResourceKey Prefab { get; set; } + + [DataMember(Name = "QuestItem")] + public bool QuestItem { get; set; } + + [DataMember(Name = "RagFairCommissionModifier")] + public float RagFairCommissionModifier { get; set; } = 1f; + + [DataMember(Name = "RarityPvE")] + public ELootRarity RarityPvE { get; set; } + + [DataMember(Name = "RepairCost")] + public int RepairCost { get; set; } + + [DataMember(Name = "RepairSpeed")] + public int RepairSpeed { get; set; } + + [DataMember(Name = "ShortName")] + public string ShortName { get; set; } + + [DataMember(Name = "SpawnChance")] + public float SpawnChance { get; set; } + + [DataMember(Name = "StackMaxSize")] + public int StackMaxSize { get; set; } + + [DataMember(Name = "StackObjectsCount")] + public int StackObjectsCount { get; set; } + + [DataMember(Name = "Unlootable")] + public bool Unlootable { get; set; } + + [DataMember(Name = "UnlootableFromSide")] + public EPlayerSideMask[] UnlootableFromSide { get; set; } + + [DataMember(Name = "UnlootableFromSlot")] + public string UnlootableFromSlot { get; set; } + + [DataMember(Name = "UsePrefab")] + public ResourceKey UsePrefab { get; set; } + + [DataMember(Name = "Weight")] + public float Weight { get; set; } + } + + public enum ETaxonomyColor + { + blue, + yellow, + green, + red, + black, + grey, + violet, + orange, + tracerYellow, + tracerGreen, + tracerRed, + @default + } + + public enum EItemDropSoundType + { + None, + Pistol, + SubMachineGun, + Rifle + } + + public enum ELootRarity + { + Not_exist = -1, + Common, + Rare, + Superrare + } + + [Flags] + public enum EPlayerSideMask + { + None = 0, + Usec = 1, + Bear = 2, + Savage = 4, + Pmc = 3, + All = 7 + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ItemTemplate.cs b/Fuyu.Backend.BSG/ItemTemplates/ItemTemplate.cs new file mode 100644 index 00000000..99867fbc --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ItemTemplate.cs @@ -0,0 +1,37 @@ +using System.Runtime.Serialization; +using Fuyu.Common.Hashing; +using Newtonsoft.Json.Linq; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ItemTemplate + { + [DataMember(Name = "_type")] + public ENodeType Type { get; set; } + + [DataMember(Name = "_id")] + public MongoId Id { get; set; } + + [DataMember(Name = "_name")] + public string Name { get; set; } + + [DataMember(Name = "_parent")] + public string ParentId { get; set; } + + [DataMember(Name = "_props")] + public JObject Props { get; set; } + + [DataMember(Name = "_proto", EmitDefaultValue = false)] + // NOTE: Could be MongoId? + // -- nexus4880, 2024-10-18 + public string Proto { get; set; } + } + + public enum ENodeType + { + Item, + Preset, + Node + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/JewelryItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/JewelryItemProperties.cs new file mode 100644 index 00000000..b726cf69 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/JewelryItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class JewelryItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/KeyItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/KeyItemProperties.cs new file mode 100644 index 00000000..0406814f --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/KeyItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class KeyItemProperties : ItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/KeyMechanicalItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/KeyMechanicalItemProperties.cs new file mode 100644 index 00000000..fc1097b8 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/KeyMechanicalItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class KeyMechanicalItemProperties : KeyItemProperties + { + [DataMember(Name = "MaximumNumberOfUsage")] + public int MaximumNumberOfUsage { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/KeycardItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/KeycardItemProperties.cs new file mode 100644 index 00000000..c14b7855 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/KeycardItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class KeycardItemProperties : KeyItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/KnifeItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/KnifeItemProperties.cs new file mode 100644 index 00000000..806fcf9c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/KnifeItemProperties.cs @@ -0,0 +1,98 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class KnifeItemProperties : ItemProperties + { + [DataMember(Name = "knifeDurab")] + public float knifeDurab; + + [DataMember(Name = "MaxResource")] + public float MaxResource; + + [DataMember(Name = "StimulatorBuffs")] + public string StimulatorBuffs; + + [DataMember(Name = "knifeHitDelay")] + public float knifeHitDelay; + + [DataMember(Name = "knifeHitSlashRate")] + public float knifeHitSlashRate; + + [DataMember(Name = "knifeHitStabRate")] + public float knifeHitStabRate; + + [DataMember(Name = "knifeHitRadius")] + public float knifeHitRadius; + + [DataMember(Name = "knifeHitSlashDam")] + public int knifeHitSlashDam; + + [DataMember(Name = "knifeHitStabDam")] + public int knifeHitStabDam; + + [DataMember(Name = "PrimaryDistance")] + public float PrimaryDistance; + + [DataMember(Name = "SecondryDistance")] + public float SecondryDistance; + + [DataMember(Name = "StabPenetration")] + public int StabPenetration; + + [DataMember(Name = "SlashPenetration")] + public int SlashPenetration; + + [DataMember(Name = "PrimaryConsumption")] + public float PrimaryConsumption; + + [DataMember(Name = "SecondryConsumption")] + public float SecondryConsumption; + + [DataMember(Name = "DeflectionConsumption")] + public float DeflectionConsumption; + + [DataMember(Name = "AppliedTrunkRotation")] + // NOTE: Actually a Vector2 + // -- nexus4880, 2024-10-18 + public Vector3 AppliedTrunkRotation; + + [DataMember(Name = "AppliedHeadRotation")] + // NOTE: Actually a Vector2 + // -- nexus4880, 2024-10-18 + public Vector3 AppliedHeadRotation; + + [DataMember(Name = "DisplayOnModel")] + public bool DisplayOnModel; + + [DataMember(Name = "AdditionalAnimationLayer")] + public int AdditionalAnimationLayer; + + [DataMember(Name = "StaminaBurnRate")] + public float StaminaBurnRate; + + [DataMember(Name = "ColliderScaleMultiplier")] + public Vector3 ColliderScaleMultiplier = new Vector3 { X = 1f, Y = 1f, Z = 1f }; + + [DataMember(Name = "Durability")] + public int Durability; + + [DataMember(Name = "MaxDurability")] + public int MaxDurability; + + [DataMember(Name = "MinRepairDegradation")] + public float MinRepairDegradation; + + [DataMember(Name = "MaxRepairDegradation")] + public float MaxRepairDegradation; + + [DataMember(Name = "MinRepairKitDegradation")] + public float MinRepairKitDegradation; + + [DataMember(Name = "MaxRepairKitDegradation")] + public float MaxRepairKitDegradation; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/LauncherItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/LauncherItemProperties.cs new file mode 100644 index 00000000..4326d4d0 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/LauncherItemProperties.cs @@ -0,0 +1,17 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class LauncherItemProperties : GearModItemProperties + { + [DataMember(Name = "UseAmmoWithoutShell")] + public bool UseAmmoWithoutShell; + + [DataMember(Name = "LinkedWeapon")] + public string LinkedWeapon; + + [DataMember(Name = "Chambers")] + public object[] Chambers = []; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/LightLaserItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/LightLaserItemProperties.cs new file mode 100644 index 00000000..f070f232 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/LightLaserItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class LightLaserItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "ModesCount")] + public int ModesCount { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/LockableContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/LockableContainerItemProperties.cs new file mode 100644 index 00000000..15c5484c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/LockableContainerItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class LockableContainerItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "KeyIds")] + public string[] KeyIds { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/LootContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/LootContainerItemProperties.cs new file mode 100644 index 00000000..c49c6794 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/LootContainerItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class LootContainerItemProperties : SearchableItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/LubricantItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/LubricantItemProperties.cs new file mode 100644 index 00000000..88135452 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/LubricantItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class LubricantItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MachineGunItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MachineGunItemProperties.cs new file mode 100644 index 00000000..9b89b829 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MachineGunItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MachineGunItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MagazineItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MagazineItemProperties.cs new file mode 100644 index 00000000..191c85d6 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MagazineItemProperties.cs @@ -0,0 +1,49 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MagazineItemProperties : GearModItemProperties + { + [DataMember(Name = "magAnimationIndex")] + public int magAnimationIndex; + + [DataMember(Name = "Cartridges")] + public object[] Cartridges; + + [DataMember(Name = "LoadUnloadModifier")] + public float LoadUnloadModifier; + + [DataMember(Name = "CheckTimeModifier")] + public float CheckTimeModifier; + + [DataMember(Name = "CheckOverride")] + public int CheckOverride; + + [DataMember(Name = "ReloadMagType")] + public EReloadMode ReloadMagType; + + [DataMember(Name = "VisibleAmmoRangesString")] + public string VisibleAmmoRangesString; + + [DataMember(Name = "MalfunctionChance")] + public float MalfunctionChance; + + [DataMember(Name = "MagazineWithBelt")] + public bool MagazineWithBelt; + + [DataMember(Name = "BeltMagazineRefreshCount")] + public int BeltMagazineRefreshCount; + + [DataMember(Name = "IsMagazineForStationaryWeapon")] + public bool IsMagazineForStationaryWeapon; + } + + public enum EReloadMode + { + ExternalMagazine, + InternalMagazine, + OnlyBarrel, + ExternalMagazineWithInternalReloadSupport + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MapItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MapItemProperties.cs new file mode 100644 index 00000000..b252e2c4 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MapItemProperties.cs @@ -0,0 +1,20 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MapItemProperties : ItemProperties + { + [DataMember(Name = "ConfigPathStr")] + public string ConfigPathStr; + + [DataMember(Name = "MaxMarkersCount")] + public int MaxMarkersCount; + + [DataMember(Name = "scaleMin")] + public float scaleMin; + + [DataMember(Name = "scaleMax")] + public float scaleMax; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MarkOfUnknownItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MarkOfUnknownItemProperties.cs new file mode 100644 index 00000000..d30df5ea --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MarkOfUnknownItemProperties.cs @@ -0,0 +1,17 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MarkOfUnknownItemProperties : SpecItemItemProperties + { + [DataMember(Name = "TradersDiscount")] + public float TradersDiscount { get; set; } + + [DataMember(Name = "ScavKillExpPenalty")] + public float ScavKillExpPenalty { get; set; } + + [DataMember(Name = "ScavKillStandingPenalty")] + public float ScavKillStandingPenalty { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MarksmanRifleItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MarksmanRifleItemProperties.cs new file mode 100644 index 00000000..c1d5873b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MarksmanRifleItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MarksmanRifleItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MasterModItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MasterModItemProperties.cs new file mode 100644 index 00000000..73c3eaf1 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MasterModItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MasterModItemProperties : ModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MedKitItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MedKitItemProperties.cs new file mode 100644 index 00000000..6cada35a --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MedKitItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MedKitItemProperties : MedsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MedicalItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MedicalItemProperties.cs new file mode 100644 index 00000000..d76befcc --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MedicalItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MedicalItemProperties : MedsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MedicalSuppliesItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MedicalSuppliesItemProperties.cs new file mode 100644 index 00000000..f54671b6 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MedicalSuppliesItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MedicalSuppliesItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MedsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MedsItemProperties.cs new file mode 100644 index 00000000..301c4e90 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MedsItemProperties.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using System.Runtime.Serialization; +using Fuyu.Common.Collections; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MedsItemProperties : ItemProperties + { + [DataMember(Name = "medUseTime")] + public float UseTime; + + [DataMember(Name = "bodyPartTimeMults")] + public KeyValuePair[] BodyPartTimeMults; + + [DataMember(Name = "effects_health")] + public Union, object[]> HealthEffects; + + [DataMember(Name = "effects_damage")] + public Union, object[]> DamageEffects; + + [DataMember(Name = "StimulatorBuffs")] + public string StimulatorBuffs; + + [DataMember(Name = "MaxHpResource")] + public int MaxHpResource; + + [DataMember(Name = "hpResourceRate")] + public float HpResourceRate; + } + + public class HealthEffect + { + } + + public class DamageEffect + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MobContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MobContainerItemProperties.cs new file mode 100644 index 00000000..077c1187 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MobContainerItemProperties.cs @@ -0,0 +1,38 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MobContainerItemProperties : SearchableItemItemProperties + { + [DataMember(Name = "containType")] + public object[] ContainType; + + [DataMember(Name = "sizeWidth")] + public int SizeWidth; + + [DataMember(Name = "sizeHeight")] + public int SizeHeight; + + [DataMember(Name = "isSecured")] + public bool IsSecured; + + [DataMember(Name = "spawnTypes")] + public string SpawnTypes; + + [DataMember(Name = "lootFilter")] + public object[] LootFilter; + + [DataMember(Name = "spawnRarity")] + public string SpawnRarity; + + [DataMember(Name = "minCountSpawn")] + public int MinCountSpawn; + + [DataMember(Name = "maxCountSpawn")] + public int MaxCountSpawn; + + [DataMember(Name = "openedByKeyID")] + public object[] OpenedByKeyID; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ModItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ModItemProperties.cs new file mode 100644 index 00000000..20cb65cf --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ModItemProperties.cs @@ -0,0 +1,53 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ModItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "EffectiveDistance")] + public int EffectiveDistance; + + [DataMember(Name = "Loudness")] + public int Loudness; + + [DataMember(Name = "Accuracy")] + public int Accuracy; + + [DataMember(Name = "DoubleActionAccuracyPenaltyMult")] + public float DoubleActionAccuracyPenaltyMult; + + [DataMember(Name = "Recoil")] + public float Recoil; + + [DataMember(Name = "Ergonomics")] + public float Ergonomics; + + [DataMember(Name = "Velocity")] + public float Velocity; + + [DataMember(Name = "RaidModdable")] + public bool RaidModdable; + + [DataMember(Name = "ToolModdable")] + public bool ToolModdable; + + [DataMember(Name = "BlocksFolding")] + public bool BlocksFolding; + + [DataMember(Name = "BlocksCollapsible")] + public bool BlocksCollapsible; + + [DataMember(Name = "IsAnimated")] + public bool IsAnimated; + + [DataMember(Name = "SightingRange")] + public float SightingRange; + + [DataMember(Name = "UniqueAnimationModID")] + public int UniqueAnimationModID; + + [DataMember(Name = "HasShoulderContact")] + public bool HasShoulderContact; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MoneyItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MoneyItemProperties.cs new file mode 100644 index 00000000..092def0f --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MoneyItemProperties.cs @@ -0,0 +1,31 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MoneyItemProperties : StackableItemItemProperties + { + [DataMember(Name = "type")] + public ECurrencyType type; + + [DataMember(Name = "eqMin")] + public int eqMin; + + [DataMember(Name = "eqMax")] + public int eqMax; + + [DataMember(Name = "rate")] + public float rate; + + [DataMember(Name = "IsRagfairCurrency")] + public bool IsRagfairCurrency; + } + + public enum ECurrencyType + { + RUB, + USD, + EUR, + GP + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MountItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MountItemProperties.cs new file mode 100644 index 00000000..8be0f819 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MountItemProperties.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MountItemProperties : GearModItemProperties + { + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MultitoolsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MultitoolsItemProperties.cs new file mode 100644 index 00000000..cb9cc64f --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MultitoolsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MultitoolsItemProperties : SpecItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MuzzleComboItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MuzzleComboItemProperties.cs new file mode 100644 index 00000000..ab2a4682 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MuzzleComboItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MuzzleComboItemProperties : MuzzleItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/MuzzleItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/MuzzleItemProperties.cs new file mode 100644 index 00000000..5273167b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/MuzzleItemProperties.cs @@ -0,0 +1,29 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class MuzzleItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "muzzleModType")] + public EMuzzleType muzzleModType; + + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + } + + public enum EMuzzleType + { + silencer, + conpensator, + pms, + brake, + muzzleCombo + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/NightVisionItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/NightVisionItemProperties.cs new file mode 100644 index 00000000..ab9e11ea --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/NightVisionItemProperties.cs @@ -0,0 +1,39 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class NightVisionItemProperties : SpecialScopeItemProperties + { + [DataMember(Name = "Intensity")] + public float Intensity; + + [DataMember(Name = "Mask")] + public EGoggleMask Mask; + + [DataMember(Name = "MaskSize")] + public float MaskSize; + + [DataMember(Name = "NoiseIntensity")] + public float NoiseIntensity; + + [DataMember(Name = "NoiseScale")] + public float NoiseScale; + + [DataMember(Name = "Color")] + public Color Color; + + [DataMember(Name = "DiffuseIntensity")] + public float DiffuseIntensity; + } + + public enum EGoggleMask + { + Thermal, + Anvis, + Binocular, + GasMask, + OldMonocular + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/OpticScopeItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/OpticScopeItemProperties.cs new file mode 100644 index 00000000..a786756d --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/OpticScopeItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class OpticScopeItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/OtherItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/OtherItemProperties.cs new file mode 100644 index 00000000..ddb4e31c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/OtherItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class OtherItemProperties : BarterItemItemProperties + { + [DataMember(Name = "DogTagQualities")] + public bool DogTagQualities { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PistolGripItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PistolGripItemProperties.cs new file mode 100644 index 00000000..e6443c8c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PistolGripItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PistolGripItemProperties : MasterModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PistolItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PistolItemProperties.cs new file mode 100644 index 00000000..43052c28 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PistolItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PistolItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PlantingKitsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PlantingKitsItemProperties.cs new file mode 100644 index 00000000..bac1993b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PlantingKitsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PlantingKitsItemProperties : SpecItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PmsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PmsItemProperties.cs new file mode 100644 index 00000000..cb266ea6 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PmsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PmsItemProperties : MuzzleItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PocketsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PocketsItemProperties.cs new file mode 100644 index 00000000..c7b20137 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PocketsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PocketsItemProperties : SearchableItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/PortableRangeFinderItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/PortableRangeFinderItemProperties.cs new file mode 100644 index 00000000..f8dadda6 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/PortableRangeFinderItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class PortableRangeFinderItemProperties : SpecItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/RadioTransmitterItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/RadioTransmitterItemProperties.cs new file mode 100644 index 00000000..4076413d --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/RadioTransmitterItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class RadioTransmitterItemProperties : SpecItemItemProperties + { + [DataMember(Name = "IsEncoded")] + public bool IsEncoded { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/RailCoversItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/RailCoversItemProperties.cs new file mode 100644 index 00000000..2ccb3964 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/RailCoversItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class RailCoversItemProperties : FunctionalModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/RandomLootContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/RandomLootContainerItemProperties.cs new file mode 100644 index 00000000..08961989 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/RandomLootContainerItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class RandomLootContainerItemProperties : SearchableItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ReceiverItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ReceiverItemProperties.cs new file mode 100644 index 00000000..ecd53aa8 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ReceiverItemProperties.cs @@ -0,0 +1,17 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ReceiverItemProperties : MasterModItemProperties + { + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/RepairKitsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/RepairKitsItemProperties.cs new file mode 100644 index 00000000..6faee4b1 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/RepairKitsItemProperties.cs @@ -0,0 +1,28 @@ +using System.Runtime.Serialization; +using Fuyu.Common.Hashing; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class RepairKitsItemProperties : SpecItemItemProperties + { + [DataMember(Name = "MaxRepairResource")] + public int MaxRepairResource; + + [DataMember(Name = "TargetItemFilter")] + public MongoId[] TargetItemFilter; + + [DataMember(Name = "RepairQuality")] + public float RepairQuality; + + [DataMember(Name = "RepairStrategyTypes")] + public ERepairStrategyType[] RepairStrategyTypes; + } + + public enum ERepairStrategyType + { + MeleeWeapon, + Firearms, + Armor + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/RevolverItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/RevolverItemProperties.cs new file mode 100644 index 00000000..f26c27d4 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/RevolverItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class RevolverItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SearchableItemItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SearchableItemItemProperties.cs new file mode 100644 index 00000000..1e6e5695 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SearchableItemItemProperties.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SearchableItemItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "SearchSound")] + public string SearchSound; + + [DataMember(Name = "BlocksArmorVest")] + public bool BlocksArmorVest; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ShaftItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ShaftItemProperties.cs new file mode 100644 index 00000000..f7ace86e --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ShaftItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ShaftItemProperties : GearModItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ShotgunItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ShotgunItemProperties.cs new file mode 100644 index 00000000..153e3f7b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ShotgunItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ShotgunItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SightsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SightsItemProperties.cs new file mode 100644 index 00000000..2d8eda7b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SightsItemProperties.cs @@ -0,0 +1,43 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SightsItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "ScopesCount")] + public int ScopesCount; + + [DataMember(Name = "AimSensitivity")] + public float[][] AimSensitivity; + + [DataMember(Name = "ModesCount")] + public int[] ModesCount; + + [DataMember(Name = "Zooms")] + public float[][] Zooms; + + [DataMember(Name = "CalibrationDistances")] + public int[][] CalibrationDistances; + + [DataMember(Name = "CustomAimPlane")] + public string CustomAimPlane; + + [DataMember(Name = "IsAdjustableOptic")] + public bool IsAdjustableOptic; + + [DataMember(Name = "MinMaxFov")] + public Vector3 MinMaxFov; + + [DataMember(Name = "ZoomSensitivity")] + public float ZoomSensitivity; + + [DataMember(Name = "AdjustableOpticSensitivity")] + public float AdjustableOpticSensitivity; + + [DataMember(Name = "AdjustableOpticSensitivityMax")] + public float AdjustableOpticSensitivityMax; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SilencerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SilencerItemProperties.cs new file mode 100644 index 00000000..7dd23fad --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SilencerItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SilencerItemProperties : MuzzleItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SimpleContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SimpleContainerItemProperties.cs new file mode 100644 index 00000000..d7589115 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SimpleContainerItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SimpleContainerItemProperties : CompoundItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SmgItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SmgItemProperties.cs new file mode 100644 index 00000000..f3426b34 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SmgItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SmgItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SniperRifleItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SniperRifleItemProperties.cs new file mode 100644 index 00000000..59643359 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SniperRifleItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SniperRifleItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SortingTableItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SortingTableItemProperties.cs new file mode 100644 index 00000000..79e09c4d --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SortingTableItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SortingTableItemProperties : StashItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SpecItemItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SpecItemItemProperties.cs new file mode 100644 index 00000000..5cd1f325 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SpecItemItemProperties.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SpecItemItemProperties : ItemProperties + { + [DataMember(Name = "apResource")] + public int apResource; + + [DataMember(Name = "krResource")] + public int krResource; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SpecialScopeItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SpecialScopeItemProperties.cs new file mode 100644 index 00000000..24b201e3 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SpecialScopeItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SpecialScopeItemProperties : SightsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SpecialWeaponItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SpecialWeaponItemProperties.cs new file mode 100644 index 00000000..a40c6bdf --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SpecialWeaponItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SpecialWeaponItemProperties : WeaponItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/SpringDrivenCylinderItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/SpringDrivenCylinderItemProperties.cs new file mode 100644 index 00000000..6d776348 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/SpringDrivenCylinderItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class SpringDrivenCylinderItemProperties : CylinderMagazineItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/StackableItemItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/StackableItemItemProperties.cs new file mode 100644 index 00000000..7cfca20e --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/StackableItemItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class StackableItemItemProperties : ItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/StashItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/StashItemProperties.cs new file mode 100644 index 00000000..8f560501 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/StashItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class StashItemProperties : CompoundItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/StationaryContainerItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/StationaryContainerItemProperties.cs new file mode 100644 index 00000000..f67d29d9 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/StationaryContainerItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class StationaryContainerItemProperties : CompoundItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/StimulatorItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/StimulatorItemProperties.cs new file mode 100644 index 00000000..e72e40da --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/StimulatorItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class StimulatorItemProperties : MedsItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/StockItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/StockItemProperties.cs new file mode 100644 index 00000000..57244250 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/StockItemProperties.cs @@ -0,0 +1,29 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class StockItemProperties : GearModItemProperties + { + [DataMember(Name = "Foldable")] + public bool Foldable; + + [DataMember(Name = "Retractable")] + public bool Retractable; + + [DataMember(Name = "HeatFactor")] + public float HeatFactor = 1f; + + [DataMember(Name = "CoolFactor")] + public float CoolFactor = 1f; + + [DataMember(Name = "DurabilityBurnModificator")] + public float DurabilityBurnModificator = 1f; + + [DataMember(Name = "SizeReduceRight")] + public int SizeReduceRight; + + [DataMember(Name = "FoldedSlot", EmitDefaultValue = false)] + public string FoldedSlot; + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/TacticalComboItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/TacticalComboItemProperties.cs new file mode 100644 index 00000000..6f89ff3e --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/TacticalComboItemProperties.cs @@ -0,0 +1,11 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class TacticalComboItemProperties : FunctionalModItemProperties + { + [DataMember(Name = "ModesCount")] + public int ModesCount { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ThermalVisionItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ThermalVisionItemProperties.cs new file mode 100644 index 00000000..fc6110c5 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ThermalVisionItemProperties.cs @@ -0,0 +1,64 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ThermalVisionItemProperties : SpecialScopeItemProperties + { + [DataMember(Name = "RampPalette")] + public EThermalPalette RampPalette; + + [DataMember(Name = "DepthFade")] + public float DepthFade; + + [DataMember(Name = "MainTexColorCoef")] + public float MainTexColorCoef; + + [DataMember(Name = "MinimumTemperatureValue")] + public float MinimumTemperatureValue; + + [DataMember(Name = "RampShift")] + public float RampShift; + + [DataMember(Name = "HeatMin")] + public float HeatMin; + + [DataMember(Name = "ColdMax")] + public float ColdMax; + + [DataMember(Name = "IsNoisy")] + public bool IsNoisy; + + [DataMember(Name = "NoiseIntensity")] + public float NoiseIntensity; + + [DataMember(Name = "IsFpsStuck")] + public bool IsFpsStuck; + + [DataMember(Name = "IsGlitch")] + public bool IsGlitch; + + [DataMember(Name = "IsMotionBlurred")] + public bool IsMotionBlurred; + + [DataMember(Name = "Mask")] + public EGoggleMask Mask; + + [DataMember(Name = "MaskSize")] + public float MaskSize; + + [DataMember(Name = "IsPixelated")] + public bool IsPixelated; + + [DataMember(Name = "PixelationBlockCount")] + public int PixelationBlockCount; + } + + public enum EThermalPalette + { + Fusion, + Rainbow, + WhiteHot, + BlackHot + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ThrowWeapItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ThrowWeapItemProperties.cs new file mode 100644 index 00000000..6b6ed3cb --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ThrowWeapItemProperties.cs @@ -0,0 +1,72 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ThrowWeapItemProperties : ItemProperties + { + [DataMember(Name = "ThrowType")] + public EThrowWeapType ThrowType; + + [DataMember(Name = "ExplDelay")] + public float ExplDelay; + + [DataMember(Name = "MinExplosionDistance")] + public float MinExplosionDistance; + + [DataMember(Name = "MaxExplosionDistance")] + public float MaxExplosionDistance; + + [DataMember(Name = "FragmentsCount")] + public int FragmentsCount; + + [DataMember(Name = "MinFragmentDamage")] + public float MinFragmentDamage; + + [DataMember(Name = "MaxFragmentDamage")] + public float MaxFragmentDamage; + + [DataMember(Name = "Strength")] + public float Strength; + + [DataMember(Name = "FragmentType")] + public string FragmentType; + + [DataMember(Name = "Blindness")] + public Vector3 Blindness; + + [DataMember(Name = "Contusion")] + public Vector3 Contusion; + + [DataMember(Name = "EmitTime")] + public int EmitTime; + + [DataMember(Name = "CanBeHiddenDuringThrow")] + public bool CanBeHiddenDuringThrow; + + [DataMember(Name = "ArmorDistanceDistanceDamage")] + public Vector3 ArmorDistanceDistanceDamage; + + [DataMember(Name = "MinTimeToContactExplode")] + public float MinTimeToContactExplode = -1f; + + [DataMember(Name = "ExplosionEffectType")] + public string ExplosionEffectType; + + [DataMember(Name = "CanPlantOnGround")] + public bool CanPlantOnGround; + } + + public enum EThrowWeapType + { + frag_grenade, + flash_grenade, + stun_grenade, + smoke_grenade, + gas_grenade, + incendiary_grenade, + sonar + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/ToolItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/ToolItemProperties.cs new file mode 100644 index 00000000..a02e231c --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/ToolItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class ToolItemProperties : BarterItemItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/VestItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/VestItemProperties.cs new file mode 100644 index 00000000..3570f8c3 --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/VestItemProperties.cs @@ -0,0 +1,190 @@ +using System; +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class VestItemProperties : SearchableItemItemProperties + { + [DataMember(Name = "Durability")] + public int Durability; + + [DataMember(Name = "MaxDurability")] + public int MaxDurability; + + [DataMember(Name = "RigLayoutName")] + public string RigLayoutName; + + [DataMember(Name = "armorZone")] + public EBodyPart[] armorZone; + + [DataMember(Name = "armorClass")] + public int armorClass; + + [DataMember(Name = "speedPenaltyPercent")] + public float speedPenaltyPercent; + + [DataMember(Name = "mousePenalty")] + public float mousePenalty; + + [DataMember(Name = "weaponErgonomicPenalty")] + public float weaponErgonomicPenalty; + + [DataMember(Name = "MaterialType")] + public EMaterialType MaterialType; + + [DataMember(Name = "ArmorType")] + public EArmorType ArmorType; + + [DataMember(Name = "BluntThroughput")] + public float BluntThroughput; + + [DataMember(Name = "ArmorMaterial")] + public EArmorMaterial ArmorMaterial; + + [DataMember(Name = "RicochetParams")] + public Vector3 RicochetParams; + + [DataMember(Name = "DeafStrength")] + public EDeafStrength DeafStrength; + + [DataMember(Name = "armorColliders")] + public EBodyPartColliderType[] armorColliders; + + [DataMember(Name = "armorPlateColliders")] + public EArmorPlateCollider[] armorPlateColliders; + } + + public enum EBodyPart + { + Head, + Chest, + Stomach, + LeftArm, + RightArm, + LeftLeg, + RightLeg, + Common + } + + public enum EMaterialType + { + Asphalt = 1, + Body, + Cardboard, + Chainfence, + Concrete, + Fabric, + GarbageMetal, + GarbagePaper, + GenericSoft, + Glass, + GlassShattered, + Grate, + GrassHigh, + GrassLow, + Gravel, + MetalThin, + MetalThick, + Mud, + Pebbles, + Plastic, + Stone, + Soil, + SoilForest, + Tile, + Water, + WaterPuddle, + WoodThin, + WoodThick, + Tyre, + Rubber, + GenericHard, + BodyArmor, + Swamp, + Helmet, + GlassVisor, + HelmetRicochet, + MetalNoDecal, + None = 0 + } + + public enum EArmorType + { + // Token: 0x0400C956 RID: 51542 + None, + // Token: 0x0400C957 RID: 51543 + Light, + // Token: 0x0400C958 RID: 51544 + Heavy + } + + public enum EArmorMaterial + { + UHMWPE, + Aramid, + Combined, + Titan, + Aluminium, + ArmoredSteel, + Ceramic, + Glass + } + + public enum EDeafStrength : byte + { + None, + Low, + High + } + + public enum EBodyPartColliderType + { + None = -1, + HeadCommon, + RibcageUp, + Pelvis = 3, + LeftUpperArm, + LeftForearm, + RightUpperArm, + RightForearm, + LeftThigh, + LeftCalf, + RightThigh, + RightCalf, + ParietalHead, + BackHead, + Ears, + Eyes, + Jaw, + NeckFront, + NeckBack, + RightSideChestUp, + LeftSideChestUp, + SpineTop, + SpineDown, + PelvisBack, + RightSideChestDown, + LeftSideChestDown, + RibcageLow + } + + [Flags] + public enum EArmorPlateCollider : short + { + Plate_Granit_SAPI_chest = 1, + Plate_Granit_SAPI_back = 2, + Plate_Granit_SSAPI_side_left_high = 4, + Plate_Granit_SSAPI_side_left_low = 8, + Plate_Granit_SSAPI_side_right_high = 16, + Plate_Granit_SSAPI_side_right_low = 32, + Plate_Korund_chest = 64, + Plate_6B13_back = 128, + Plate_Korund_side_left_high = 256, + Plate_Korund_side_left_low = 512, + Plate_Korund_side_right_high = 1024, + Plate_Korund_side_right_low = 2048 + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/VisorsItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/VisorsItemProperties.cs new file mode 100644 index 00000000..c504769b --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/VisorsItemProperties.cs @@ -0,0 +1,9 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class VisorsItemProperties : ArmoredEquipmentItemProperties + { + } +} diff --git a/Fuyu.Backend.BSG/ItemTemplates/WeaponItemProperties.cs b/Fuyu.Backend.BSG/ItemTemplates/WeaponItemProperties.cs new file mode 100644 index 00000000..60b0aa8d --- /dev/null +++ b/Fuyu.Backend.BSG/ItemTemplates/WeaponItemProperties.cs @@ -0,0 +1,314 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.DTO.Common; +using Fuyu.Backend.BSG.Models.Common; +using Fuyu.Common.Collections; + +namespace Fuyu.Backend.BSG.ItemTemplates +{ + [DataContract] + public class WeaponItemProperties : CompoundItemItemProperties + { + [DataMember(Name = "ReloadMode")] + public EReloadMode ReloadMode; + + [DataMember(Name = "weapClass")] + public string weapClass; + + [DataMember(Name = "weapUseType")] + public string weapUseType; + + [DataMember(Name = "ammoCaliber")] + public string ammoCaliber; + + [DataMember(Name = "AdjustCollimatorsToTrajectory")] + public bool AdjustCollimatorsToTrajectory; + + [DataMember(Name = "weapAmmoTypes")] + public object[] weapAmmoTypes; + + [DataMember(Name = "Durability")] + public float Durability; + + [DataMember(Name = "MaxDurability")] + public float MaxDurability; + + [DataMember(Name = "RepairComplexity")] + public float RepairComplexity; + + [DataMember(Name = "OperatingResource")] + public float OperatingResource; + + [DataMember(Name = "RecoilCategoryMultiplierHandRotation")] + public float RecoilCategoryMultiplierHandRotation; + + [DataMember(Name = "RecoilReturnSpeedHandRotation")] + public float RecoilReturnSpeedHandRotation; + + [DataMember(Name = "RecoilDampingHandRotation")] + public float RecoilDampingHandRotation; + + [DataMember(Name = "RecoilCamera")] + public float RecoilCamera; + + [DataMember(Name = "RecoilStableIndexShot")] + public int RecoilStableIndexShot; + + [DataMember(Name = "RecoilForceBack")] + public float RecoilForceBack; + + [DataMember(Name = "RecoilForceUp")] + public float RecoilForceUp; + + [DataMember(Name = "RecolDispersion")] + public int RecolDispersion; + + [DataMember(Name = "RecoilPosZMult")] + public float RecoilPosZMult = 1f; + + [DataMember(Name = "RecoilReturnPathDampingHandRotation")] + public float RecoilReturnPathDampingHandRotation; + + [DataMember(Name = "RecoilReturnPathOffsetHandRotation")] + public float RecoilReturnPathOffsetHandRotation; + + [DataMember(Name = "RecoilAngle")] + public int RecoilAngle; + + [DataMember(Name = "RecoilStableAngleIncreaseStep")] + public float RecoilStableAngleIncreaseStep; + + [DataMember(Name = "ProgressRecoilAngleOnStable")] + public Vector3 ProgressRecoilAngleOnStable; + + [DataMember(Name = "RecoilCenter")] + public Vector3 RecoilCenter; + + [DataMember(Name = "PostRecoilVerticalRangeHandRotation")] + public Vector2 PostRecoilVerticalRangeHandRotation; + + [DataMember(Name = "PostRecoilHorizontalRangeHandRotation")] + public Vector2 PostRecoilHorizontalRangeHandRotation; + + [DataMember(Name = "CameraToWeaponAngleSpeedRange")] + public Vector2 CameraToWeaponAngleSpeedRange; + + [DataMember(Name = "CameraToWeaponAngleStep")] + public float CameraToWeaponAngleStep; + + [DataMember(Name = "ShotsGroupSettings")] + public object[] ShotsGroupSettings; + + [DataMember(Name = "CameraSnap")] + public float CameraSnap; + + [DataMember(Name = "MountingPosition")] + public Vector3 MountingPosition; + + [DataMember(Name = "MountVerticalRecoilMultiplier")] + public float MountVerticalRecoilMultiplier; + + [DataMember(Name = "MountHorizontalRecoilMultiplier")] + public float MountHorizontalRecoilMultiplier; + + [DataMember(Name = "MountReturnSpeedHandMultiplier")] + public float MountReturnSpeedHandMultiplier; + + [DataMember(Name = "MountCameraSnapMultiplier")] + public float MountCameraSnapMultiplier; + + [DataMember(Name = "Ergonomics")] + public float Ergonomics; + + [DataMember(Name = "Velocity")] + public float Velocity; + + [DataMember(Name = "durabSpawnMin")] + public int durabSpawnMin; + + [DataMember(Name = "durabSpawnMax")] + public int durabSpawnMax; + + [DataMember(Name = "isFastReload")] + public bool isFastReload; + + [DataMember(Name = "isChamberLoad")] + public bool isChamberLoad; + + [DataMember(Name = "ShotgunDispersion")] + public int ShotgunDispersion; + + [DataMember(Name = "bFirerate")] + public int bFirerate; + + [DataMember(Name = "SingleFireRate")] + public int SingleFireRate = 240; + + [DataMember(Name = "CanQueueSecondShot")] + public bool CanQueueSecondShot = true; + + [DataMember(Name = "bEffDist")] + public int bEffDist; + + [DataMember(Name = "bHearDist")] + public int bHearDist; + + [DataMember(Name = "isBoltCatch")] + public bool isBoltCatch; + + [DataMember(Name = "defMagType")] + public string defMagType; + + [DataMember(Name = "defAmmo")] + public string defAmmo; + + [DataMember(Name = "AimPlane")] + public float AimPlane; + + [DataMember(Name = "Chambers")] + public object[] Chambers; + + [DataMember(Name = "CenterOfImpact")] + public float CenterOfImpact; + + [DataMember(Name = "DoubleActionAccuracyPenalty")] + public float DoubleActionAccuracyPenalty; + + [DataMember(Name = "DeviationMax")] + public float DeviationMax; + + [DataMember(Name = "DeviationCurve")] + public float DeviationCurve; + + [DataMember(Name = "MustBoltBeOpennedForExternalReload")] + public bool MustBoltBeOpennedForExternalReload; + + [DataMember(Name = "MustBoltBeOpennedForInternalReload")] + public bool MustBoltBeOpennedForInternalReload; + + [DataMember(Name = "Foldable")] + public bool Foldable; + + [DataMember(Name = "Retractable")] + public bool Retractable; + + [DataMember(Name = "BoltAction")] + public bool BoltAction; + + [DataMember(Name = "ManualBoltCatch")] + public bool ManualBoltCatch; + + [DataMember(Name = "TacticalReloadStiffnes")] + public Vector3 TacticalReloadStiffnes; + + [DataMember(Name = "TacticalReloadFixation")] + public float TacticalReloadFixation; + + [DataMember(Name = "RotationCenter")] + public Vector3 RotationCenter; + + [DataMember(Name = "RotationCenterNoStock")] + public Vector3 RotationCenterNoStock; + + [DataMember(Name = "IronSightRange")] + public int IronSightRange; + + [DataMember(Name = "HipInnaccuracyGain")] + public float HipInnaccuracyGain; + + [DataMember(Name = "HipAccuracyRestorationDelay")] + public float HipAccuracyRestorationDelay; + + [DataMember(Name = "HipAccuracyRestorationSpeed")] + public float HipAccuracyRestorationSpeed; + + [DataMember(Name = "MountingHorizontalOutOfBreathMultiplier")] + public float MountingHorizontalOutOfBreathMultiplier; + + [DataMember(Name = "MountingVerticalOutOfBreathMultiplier")] + public float MountingVerticalOutOfBreathMultiplier; + + [DataMember(Name = "CompactHandling")] + public bool CompactHandling; + + [DataMember(Name = "SightingRange")] + public float SightingRange; + + [DataMember(Name = "AllowJam")] + public bool AllowJam; + + [DataMember(Name = "AllowFeed")] + public bool AllowFeed; + + [DataMember(Name = "AllowMisfire")] + public bool AllowMisfire; + + [DataMember(Name = "AllowSlide")] + public bool AllowSlide; + + [DataMember(Name = "BaseMalfunctionChance")] + public float BaseMalfunctionChance; + + [DataMember(Name = "AimSensitivity")] + public Union AimSensitivity = 1f; + + [DataMember(Name = "DurabilityBurnRatio")] + public float DurabilityBurnRatio = 1f; + + [DataMember(Name = "HeatFactorGun")] + public float HeatFactorGun; + + [DataMember(Name = "CoolFactorGun")] + public float CoolFactorGun; + + [DataMember(Name = "AllowOverheat")] + public bool AllowOverheat; + + [DataMember(Name = "HeatFactorByShot")] + public float HeatFactorByShot = 1f; + + [DataMember(Name = "CoolFactorGunMods")] + public float CoolFactorGunMods = 1f; + + [DataMember(Name = "IsFlareGun")] + public bool IsFlareGun; + + [DataMember(Name = "IsOneoff")] + public bool IsOneoff; + + [DataMember(Name = "IsGrenadeLauncher")] + public bool IsGrenadeLauncher; + + [DataMember(Name = "NoFiremodeOnBoltcatch")] + public bool NoFiremodeOnBoltcatch; + + [DataMember(Name = "IsStationaryWeapon")] + public bool IsStationaryWeapon; + + [DataMember(Name = "IsBeltMachineGun")] + public bool IsBeltMachineGun; + + [DataMember(Name = "BlockLeftStance")] + public bool BlockLeftStance; + + [DataMember(Name = "WithAnimatorAiming")] + public bool WithAnimatorAiming; + + [DataMember(Name = "MinRepairDegradation")] + public float MinRepairDegradation; + + [DataMember(Name = "MaxRepairDegradation")] + public float MaxRepairDegradation; + + [DataMember(Name = "SizeReduceRight")] + public int SizeReduceRight; + + [DataMember(Name = "FoldedSlot")] + public string FoldedSlot; + + [DataMember(Name = "weapFireType")] + public EFireMode[] weapFireType; + + [DataMember(Name = "BurstShotsCount")] + public int BurstShotsCount = 3; + } +} diff --git a/Fuyu.Backend.BSG/Models/Common/BundleAddress.cs b/Fuyu.Backend.BSG/Models/Common/BundleAddress.cs deleted file mode 100644 index 7c4fb43d..00000000 --- a/Fuyu.Backend.BSG/Models/Common/BundleAddress.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.Serialization; - -namespace Fuyu.Backend.BSG.Models.Common -{ - [DataContract] - public class BundleAddress - { - [DataMember] - public string path; - - [DataMember] - public string rcid; - } -} \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Common/Color.cs b/Fuyu.Backend.BSG/Models/Common/Color.cs new file mode 100644 index 00000000..05e95595 --- /dev/null +++ b/Fuyu.Backend.BSG/Models/Common/Color.cs @@ -0,0 +1,20 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.DTO.Common +{ + [DataContract] + public struct Color + { + [DataMember(Name = "r")] + public byte R { get; set; } + + [DataMember(Name = "g")] + public byte G { get; set; } + + [DataMember(Name = "b")] + public byte B { get; set; } + + [DataMember(Name = "a")] + public byte A { get; set; } + } +} \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Common/EFireMode.cs b/Fuyu.Backend.BSG/Models/Common/EFireMode.cs index bf811432..cbd0ddb7 100644 --- a/Fuyu.Backend.BSG/Models/Common/EFireMode.cs +++ b/Fuyu.Backend.BSG/Models/Common/EFireMode.cs @@ -1,14 +1,29 @@ -namespace Fuyu.Backend.BSG.Models.Common +using System; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Fuyu.Backend.BSG.DTO.Common { - public enum EFireMode : byte - { - fullauto = 0, - single = 1, - doublet = 2, - burst = 3, - doubleaction = 4, - semiauto = 5, - grenadeThrowing = 6, - greanadePlanting = 7 - } + [Flags] + [JsonConverter(typeof(StringEnumConverter))] + public enum EFireMode : byte + { + [EnumMember(Value = "fullauto")] + FullAuto = 0, + [EnumMember(Value = "single")] + Single = 1, + [EnumMember(Value = "doublet")] + Doublet = 2, + [EnumMember(Value = "burst")] + Burst = 3, + [EnumMember(Value = "doubleaction")] + DoubleAction = 4, + [EnumMember(Value = "semiauto")] + SemiAuto = 5, + [EnumMember(Value = "grenadeThrowing")] + GrenadeThrowing = 6, + [EnumMember(Value = "greanadePlanting")] + GrenadePlanting = 7 + } } diff --git a/Fuyu.Backend.BSG/Models/Common/EItemRotation.cs b/Fuyu.Backend.BSG/Models/Common/EItemRotation.cs deleted file mode 100644 index 068e0d6d..00000000 --- a/Fuyu.Backend.BSG/Models/Common/EItemRotation.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Fuyu.Backend.BSG.Models.Common -{ - public enum EItemRotation - { - Horizontal, - Vertical - } -} diff --git a/Fuyu.Backend.BSG/Models/Common/Vector2.cs b/Fuyu.Backend.BSG/Models/Common/Vector2.cs new file mode 100644 index 00000000..6d29a4bf --- /dev/null +++ b/Fuyu.Backend.BSG/Models/Common/Vector2.cs @@ -0,0 +1,14 @@ +using System.Runtime.Serialization; + +namespace Fuyu.Backend.BSG.DTO.Common +{ + [DataContract] + public class Vector2 + { + [DataMember(Name = "x")] + public float X { get; set; } + + [DataMember(Name = "y")] + public float Y { get; set; } + } +} diff --git a/Fuyu.Backend.BSG/Models/Common/Vector3.cs b/Fuyu.Backend.BSG/Models/Common/Vector3.cs index 2d1fdb2a..41069994 100644 --- a/Fuyu.Backend.BSG/Models/Common/Vector3.cs +++ b/Fuyu.Backend.BSG/Models/Common/Vector3.cs @@ -3,15 +3,15 @@ namespace Fuyu.Backend.BSG.Models.Common { [DataContract] - public class Vector3 + public struct Vector3 { - [DataMember] - public float x; + [DataMember(Name = "x")] + public float X { get; set; } - [DataMember] - public float y; + [DataMember(Name = "y")] + public float Y { get; set; } - [DataMember] - public float z; + [DataMember(Name = "z")] + public float Z { get; set; } } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Customization/CustomizationProperties.cs b/Fuyu.Backend.BSG/Models/Customization/CustomizationProperties.cs index 97426631..9b5c7c1b 100644 --- a/Fuyu.Backend.BSG/Models/Customization/CustomizationProperties.cs +++ b/Fuyu.Backend.BSG/Models/Customization/CustomizationProperties.cs @@ -25,7 +25,7 @@ public class CustomizationProperties public object Prefab; // can be String or BundleAddress [DataMember] - public BundleAddress WatchPrefab; + public ResourceKey WatchPrefab; [DataMember] public bool IntegratedArmorVest; diff --git a/Fuyu.Backend.BSG/Models/Items/ItemCultistAmuletComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemCultistAmuletComponent.cs index feb8f124..fed89ce7 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemCultistAmuletComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemCultistAmuletComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemCultistAmuletComponent + public class ItemCultistAmuletComponent : IItemComponent { [DataMember(Name = "NumberOfUsages")] public int NumberOfUsages { get; set; } - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("NumberOfUsages")) + { + return null; + } + + return new ItemCultistAmuletComponent + { + NumberOfUsages = templateProperties.Value("NumberOfUsages") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemFireModeComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemFireModeComponent.cs index 4b196725..70b84c17 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemFireModeComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemFireModeComponent.cs @@ -1,5 +1,5 @@ using System.Runtime.Serialization; -using Fuyu.Backend.BSG.Models.Common; +using Fuyu.Backend.BSG.DTO.Common; namespace Fuyu.Backend.BSG.Models.Items { @@ -7,6 +7,6 @@ namespace Fuyu.Backend.BSG.Models.Items public class ItemFireModeComponent { [DataMember] - public EFireMode FireMode; - } + public EFireMode FireMode { get; set; } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemFoldableComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemFoldableComponent.cs index b2eab8ac..adf22079 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemFoldableComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemFoldableComponent.cs @@ -1,11 +1,24 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemFoldableComponent - { - [DataMember] - public bool Folded; + public class ItemFoldableComponent : IItemComponent + { + [DataMember] + public bool Folded { get; set; } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("Foldable") + || !templateProperties["Foldable"].Value()) + { + return null; + } + + return new ItemFoldableComponent(); + } } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemFoodDrinkComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemFoodDrinkComponent.cs index 8bcb25d8..3a9df3c7 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemFoodDrinkComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemFoodDrinkComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemFoodDrinkComponent + public class ItemFoodDrinkComponent : IItemComponent { [DataMember] - public float HpPercent; - } + public float HpPercent { get; set; } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaxResource")) + { + return null; + } + + return new ItemFoodDrinkComponent + { + HpPercent = templateProperties.Value("MaxResource") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemKeyComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemKeyComponent.cs index 53c01a9a..7a9a4db6 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemKeyComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemKeyComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemKeyComponent + public class ItemKeyComponent : IItemComponent { - [DataMember] - public int NumberOfUsages; - } + [DataMember(Name = "NumberOfUsages")] + public int NumberOfUsages { get; set; } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaximumNumberOfUsage")) + { + return null; + } + + return new ItemKeyComponent + { + NumberOfUsages = templateProperties.Value("MaximumNumberOfUsage") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemLightComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemLightComponent.cs index b6daeff6..7f7f1794 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemLightComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemLightComponent.cs @@ -10,5 +10,5 @@ public class ItemLightComponent [DataMember] public int SelectedMode; - } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemLockableComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemLockableComponent.cs index 8896cf0a..9858667a 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemLockableComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemLockableComponent.cs @@ -1,11 +1,24 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemLockableComponent + public class ItemLockableComponent : IItemComponent { [DataMember] public bool Locked; - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("isSecured") + || !templateProperties.Value("isSecured")) + { + return null; + } + + return new ItemLockableComponent { Locked = true }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemMapComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemMapComponent.cs index fa61ab75..285b064e 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemMapComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemMapComponent.cs @@ -1,12 +1,29 @@ using System.Collections.Generic; using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemMapComponent + public class ItemMapComponent : IItemComponent { [DataMember] public List Markers; - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaxMarkersCount")) + { + return null; + } + + var maxMarkersCount = templateProperties.Value("MaxMarkersCount"); + + return new ItemMapComponent + { + Markers = new List(maxMarkersCount) + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemMedKitComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemMedKitComponent.cs index 6523f110..7de413ce 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemMedKitComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemMedKitComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemMedKitComponent + public class ItemMedKitComponent : IItemComponent { [DataMember] - public float HpResource; - } + public float HpResource { get; set; } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaxHpResource")) + { + return null; + } + + return new ItemMedKitComponent + { + HpResource = templateProperties.Value("MaxHpResource") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemRecodableComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemRecodableComponent.cs index bdac6608..59b5c812 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemRecodableComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemRecodableComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemRecodableComponent + public class ItemRecodableComponent : IItemComponent { [DataMember] public bool IsEncoded; - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("IsEncoded")) + { + return null; + } + + return new ItemRecodableComponent + { + IsEncoded = templateProperties.Value("IsEncoded") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemRepairKitComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemRepairKitComponent.cs index 2812a70b..2863fd2a 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemRepairKitComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemRepairKitComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemRepairKitComponent + public class ItemRepairKitComponent : IItemComponent { [DataMember] public float Resource; - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaxRepairResource")) + { + return null; + } + + return new ItemRepairKitComponent + { + Resource = templateProperties.Value("MaxRepairResource") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemRepairableComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemRepairableComponent.cs index efa051d4..9576d19c 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemRepairableComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemRepairableComponent.cs @@ -1,14 +1,34 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { - [DataContract] - public class ItemRepairableComponent - { - [DataMember] - public float Durability; - - [DataMember] - public float MaxDurability; - } + [DataContract] + public class ItemRepairableComponent : IItemComponent + { + [DataMember] + public float Durability; + + [DataMember] + public float MaxDurability; + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("Durability") + || !templateProperties.ContainsKey("MaxDurability")) + { + return null; + } + + var durability = templateProperties.Value("Durability"); + var maxDurability = templateProperties.Value("MaxDurability"); + + return new ItemRepairableComponent + { + Durability = durability, + MaxDurability = maxDurability + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemSideEffectComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemSideEffectComponent.cs index f235e3f7..0a45efdd 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemSideEffectComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemSideEffectComponent.cs @@ -1,11 +1,26 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG; +using Newtonsoft.Json.Linq; namespace Fuyu.Backend.BSG.Models.Items { [DataContract] - public class ItemSideEffectComponent + public class ItemSideEffectComponent : IItemComponent { [DataMember] public float Value; - } + + public static object CreateComponent(JObject templateProperties) + { + if (!templateProperties.ContainsKey("MaxResource")) + { + return null; + } + + return new ItemSideEffectComponent + { + Value = templateProperties.Value("MaxResource") + }; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/ItemSightComponent.cs b/Fuyu.Backend.BSG/Models/Items/ItemSightComponent.cs index 450434b0..ae59d704 100644 --- a/Fuyu.Backend.BSG/Models/Items/ItemSightComponent.cs +++ b/Fuyu.Backend.BSG/Models/Items/ItemSightComponent.cs @@ -16,5 +16,5 @@ public class ItemSightComponent [DataMember] public int SelectedScope; - } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/MagazineBuild.cs b/Fuyu.Backend.BSG/Models/Items/MagazineBuild.cs new file mode 100644 index 00000000..605d176b --- /dev/null +++ b/Fuyu.Backend.BSG/Models/Items/MagazineBuild.cs @@ -0,0 +1,26 @@ +using System.Runtime.Serialization; +using Fuyu.Backend.BSG.Models.Responses; +using Fuyu.Backend.BSG.Models.Templates; +using Fuyu.Common.Hashing; + +namespace Fuyu.Backend.BSG.Models.Items +{ + [DataContract] + public class MagazineBuild + { + [DataMember(Name = "Id")] + public MongoId Id { get; set; } + + [DataMember(Name = "Name")] + public string Name { get; set; } + + [DataMember(Name = "Caliber")] + public string Caliber { get; set; } + + [DataMember(Name = "BuildType")] + public EEquipmentBuildType BuildType { get; set; } + + [DataMember(Name = "Items")] + public MagazineItem[] Items { get; set; } + } +} \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Items/WeaponBuild.cs b/Fuyu.Backend.BSG/Models/Items/WeaponBuild.cs new file mode 100644 index 00000000..685aa1de --- /dev/null +++ b/Fuyu.Backend.BSG/Models/Items/WeaponBuild.cs @@ -0,0 +1,21 @@ +using System.Runtime.Serialization; +using Fuyu.Common.Hashing; + +namespace Fuyu.Backend.BSG.Models.Items +{ + [DataContract] + public class WeaponBuild + { + [DataMember(Name = "Id")] + public MongoId Id { get; set; } + + [DataMember(Name = "ItemIconName")] + public string ItemIconName { get; set; } + + [DataMember(Name = "HandbookName")] + public string HandbookName { get; set; } + + [DataMember(Name = "FromPreset")] + public bool FromPreset { get; set; } + } +} \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Profiles/InventoryInfo.cs b/Fuyu.Backend.BSG/Models/Profiles/InventoryInfo.cs index 048004c2..6cbbf1bb 100644 --- a/Fuyu.Backend.BSG/Models/Profiles/InventoryInfo.cs +++ b/Fuyu.Backend.BSG/Models/Profiles/InventoryInfo.cs @@ -1,10 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Numerics; using System.Runtime.Serialization; +using System.Text; +using Fuyu.Backend.BSG.DTO.Services; +using Fuyu.Backend.BSG.ItemTemplates; using Fuyu.Backend.BSG.Models.Items; using Fuyu.Backend.BSG.Services; using Fuyu.Common.Hashing; +using Fuyu.Common.IO; namespace Fuyu.Backend.BSG.Models.Profiles { @@ -58,5 +63,197 @@ public List GetItemsByTemplate(MongoId tpl) { return Items.Where(i => i.TemplateId == tpl).ToList(); } - } + + public ItemInstance GetStock(ItemInstance root) + { + var rootItemTemplate = ItemFactoryService.ItemTemplates[root.TemplateId]; + if (!rootItemTemplate.Props.ContainsKey("FoldedSlot")) + { + return null; + } + + var weaponItemProperties = rootItemTemplate.Props.ToObject(); + var subItems = ItemService.GetItemAndChildren(Items, root).Skip(1); + + return subItems.FirstOrDefault(i => i.SlotId == weaponItemProperties.FoldedSlot); + } + + public Vector2 GetItemSize(ItemInstance root) + { + var rootTemplate = ItemFactoryService.ItemTemplates[root.TemplateId]; + var rootProperties = rootTemplate.Props.ToObject(); + var width = rootProperties.Width; + var height = rootProperties.Height; + + var sizeUp = 0; + var sizeDown = 0; + var sizeLeft = 0; + var sizeRight = 0; + var forcedUp = 0; + var forcedDown = 0; + var forcedLeft = 0; + var forcedRight = 0; + + var children = ItemService.GetItemAndChildren(Items, root).Skip(1); + foreach (var child in children) + { + var itemTemplate = ItemFactoryService.ItemTemplates[child.TemplateId]; + var itemProperties = itemTemplate.Props.ToObject(); + if (itemProperties.ExtraSizeForceAdd) + { + forcedUp += itemProperties.ExtraSizeUp; + forcedDown += itemProperties.ExtraSizeDown; + forcedLeft += itemProperties.ExtraSizeLeft; + forcedRight += itemProperties.ExtraSizeRight; + } + else + { + sizeUp = Math.Max(sizeUp, itemProperties.ExtraSizeUp); + sizeDown = Math.Max(sizeDown, itemProperties.ExtraSizeDown); + sizeLeft = Math.Max(sizeLeft, itemProperties.ExtraSizeLeft); + sizeRight = Math.Max(sizeRight, itemProperties.ExtraSizeRight); + } + } + + width += sizeLeft + sizeRight + forcedLeft + forcedRight; + height += sizeUp + sizeDown + forcedUp + forcedDown; + + if (root.Location.IsValue1 && root.Location.Value1.r == EItemRotation.Vertical) + { + return new Vector2 + { + X = height, + Y = width + }; + } + + return new Vector2 + { + X = width, + Y = height + }; + } + + public LocationInGrid GetNextFreeSlot(int width, int height, out string gridName, EItemRotation desiredRotation = EItemRotation.Horizontal) + { + gridName = null; + if (Stash == null) + { + return null; + } + + var stashItem = Items.Find(i => i.Id == Stash.Value); + if (stashItem == null) + { + return null; + } + + var stashItemTemplate = ItemFactoryService.ItemTemplates[stashItem.TemplateId]; + var stashItemProps = stashItemTemplate.Props.ToObject(); + + foreach (var grid in stashItemProps.Grids) + { + gridName = grid.Name; + var gridWidth = grid.Properties.CellsHorizontal; + var gridHeight = grid.Properties.CellsVertical; + var cells = new bool[gridWidth * gridHeight]; + var itemsInThisGrid = ItemService.GetItemAndChildren(Items, stashItem).Skip(1); + + foreach (var itemInThisGrid in itemsInThisGrid) + { + if (!itemInThisGrid.Location.IsValue1) + { + continue; + } + + var itemTemplate = ItemFactoryService.ItemTemplates[itemInThisGrid.TemplateId]; + var itemProps = itemTemplate.Props.ToObject(); + var itemLocation = itemInThisGrid.Location.Value1; + var itemSize = GetItemSize(itemInThisGrid); + var itemWidth = itemSize.X; + var itemHeight = itemSize.Y; + + for (var y = 0; y < itemHeight; y++) + { + for (var x = 0; x < itemWidth; x++) + { + var cellX = itemLocation.x + x; + var cellY = itemLocation.y + y; + if (cells[cellY * gridWidth + cellX]) + { + throw new Exception("Overlap"); + } + + cells[cellY * gridWidth + cellX] = true; + } + } + } + + var builder = new StringBuilder(cells.Length); + for (int i = 0; i < gridHeight; i++) + { + var line = cells.Skip(i * gridWidth).Take(gridWidth); + builder.Append(line.Select(b => b ? 'X' : 'O').ToArray()); + if (i != gridHeight - 1) + { + builder.AppendLine(); + } + } + + Console.Clear(); + Terminal.WriteLine(builder.ToString()); + + for (var idx = 0; idx < cells.Length; idx++) + { + if (cells[idx]) + { + continue; + } + + var x = idx % gridWidth; + var y = idx / gridWidth; + var found = true; + + for (int dy = 0; found && dy < height; dy++) + { + for (int dx = 0; dx < width; dx++) + { + var tempX = x + dx; + if (tempX > gridWidth) + { + found = false; + break; + } + + var tempY = y + dy; + if (tempY > gridHeight) + { + found = false; + break; + } + + var tempIdx = tempY * gridWidth + tempX; + if (cells[tempIdx]) + { + found = false; + break; + } + } + } + + if (found) + { + return new LocationInGrid + { + x = x, + y = y, + r = desiredRotation + }; + } + } + } + + return null; + } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Responses/BuildsListResponse.cs b/Fuyu.Backend.BSG/Models/Responses/BuildsListResponse.cs index 77f885a3..8184438e 100644 --- a/Fuyu.Backend.BSG/Models/Responses/BuildsListResponse.cs +++ b/Fuyu.Backend.BSG/Models/Responses/BuildsListResponse.cs @@ -1,20 +1,30 @@ using System.Runtime.Serialization; +using Fuyu.Backend.BSG.Models.Items; using Fuyu.Backend.BSG.Models.Templates; +using Fuyu.Common.Hashing; namespace Fuyu.Backend.BSG.Models.Responses { [DataContract] public class BuildsListResponse { - [DataMember] - public EquipmentBuild[] equipmentBuild; + [DataMember(Name = "equipmentBuilds")] + public EquipmentBuild[] EquipmentBuild { get; set; } - // TODO: proper type - [DataMember] - public object[] weaponBuilds; + [DataMember(Name = "weaponBuilds")] + public WeaponBuild[] WeaponBuilds { get; set; } - // TODO: proper type - [DataMember] - public object[] magazineBuilds; - } + [DataMember(Name = "magazineBuilds")] + public MagazineBuild[] MagazineBuilds { get; set; } + } + + [DataContract] + public class MagazineItem + { + [DataMember(Name = "TemplateId")] + public MongoId TemplateId { get; set; } + + [DataMember(Name = "Count")] + public ushort Count { get; set; } + } } \ No newline at end of file diff --git a/Fuyu.Backend.BSG/Models/Templates/EquipmentBuild.cs b/Fuyu.Backend.BSG/Models/Templates/EquipmentBuild.cs index 8681add7..4b65fe0c 100644 --- a/Fuyu.Backend.BSG/Models/Templates/EquipmentBuild.cs +++ b/Fuyu.Backend.BSG/Models/Templates/EquipmentBuild.cs @@ -1,27 +1,25 @@ using System.Runtime.Serialization; using Fuyu.Backend.BSG.Models.Items; +using Fuyu.Common.Hashing; namespace Fuyu.Backend.BSG.Models.Templates { [DataContract] public class EquipmentBuild { - [DataMember] - public string Id; + [DataMember(Name = "Id")] + public MongoId Id { get; set; } - [DataMember] - public string Name; + [DataMember(Name = "Name")] + public string Name { get; set; } - [DataMember] - public ItemInstance[] Items; + [DataMember(Name = "Root")] + public MongoId Root { get; set; } - [DataMember] - public string Root; + [DataMember(Name = "Items")] + public ItemInstance[] Items { get; set; } - [DataMember] - public string BuildType; - - [DataMember] - public EEquipmentBuildType type; - } + [DataMember(Name = "BuildType")] + public EEquipmentBuildType BuildType { get; set; } + } } \ No newline at end of file diff --git a/Fuyu.Backend.EFT/Controllers/GetNextFreeSlotController.cs b/Fuyu.Backend.EFT/Controllers/GetNextFreeSlotController.cs new file mode 100644 index 00000000..7d9012fe --- /dev/null +++ b/Fuyu.Backend.EFT/Controllers/GetNextFreeSlotController.cs @@ -0,0 +1,48 @@ +using System.Net; +using System.Runtime.Serialization; +using System.Threading.Tasks; +using Fuyu.Backend.BSG.Models.Items; +using Fuyu.Backend.EFT.Networking; +using Fuyu.Common.Networking; +using Fuyu.Common.Serialization; + +namespace Fuyu.Backend.EFT.Controllers +{ + [DataContract] + public class GetNextFreeSlotRequest + { + [DataMember(Name = "width")] + public int Width { get; set; } + + [DataMember(Name = "height")] + public int Height { get; set; } + + [DataMember(Name = "rotation")] + public EItemRotation Rotation { get; set; } + } + + // TODO: Delete later + // -- nexus4880, 2024-11-26 + public class GetNextFreeSlotController : EftHttpController + { + public GetNextFreeSlotController() : base("/get/next/free/slot") + { + } + + public override Task RunAsync(EftHttpContext context, GetNextFreeSlotRequest body) + { + var profile = EftOrm.GetActiveProfile(context.GetSessionId()); + var freeSlot = profile.Pmc.Inventory.GetNextFreeSlot(body.Width, body.Height, out var gridName, body.Rotation); + if (freeSlot == null) + { + return context.SendStatus(HttpStatusCode.InternalServerError); + } + + return context.SendJsonAsync(Json.Stringify(new + { + freeSlot, + gridName + })); + } + } +} diff --git a/Fuyu.Backend.EFT/Controllers/Http/BuildsListController.cs b/Fuyu.Backend.EFT/Controllers/Http/BuildsListController.cs index b603b621..7fdb51cf 100644 --- a/Fuyu.Backend.EFT/Controllers/Http/BuildsListController.cs +++ b/Fuyu.Backend.EFT/Controllers/Http/BuildsListController.cs @@ -7,14 +7,14 @@ namespace Fuyu.Backend.EFT.Controllers.Http { public class BuildsListController : EftHttpController - { - private readonly ResponseBody _response; + { + private readonly ResponseBody _response; - public BuildsListController() : base("/client/builds/list") - { - var json = Resx.GetText("eft", "database.client.builds.list.json"); - _response = Json.Parse>(json); - } + public BuildsListController() : base("/client/builds/list") + { + var json = Resx.GetText("eft", "database.client.builds.list.json"); + _response = Json.Parse>(json); + } public override Task RunAsync(EftHttpContext context) { diff --git a/Fuyu.Backend.EFT/Servers/EftMainServer.cs b/Fuyu.Backend.EFT/Servers/EftMainServer.cs index d857e732..0b34c9c0 100644 --- a/Fuyu.Backend.EFT/Servers/EftMainServer.cs +++ b/Fuyu.Backend.EFT/Servers/EftMainServer.cs @@ -1,6 +1,7 @@ using Fuyu.Common.Networking; using Fuyu.Backend.EFT.Controllers.Http; using Fuyu.Backend.EFT.Controllers.Websocket; +using Fuyu.Backend.EFT.Controllers; namespace Fuyu.Backend.EFT.Servers { @@ -75,6 +76,7 @@ public void RegisterServices() HttpRouter.AddController(); HttpRouter.AddController(); HttpRouter.AddController(); + HttpRouter.AddController(); // EFT-WS WsRouter.AddController(); diff --git a/Fuyu.Backend.EFT/Services/ProfileService.cs b/Fuyu.Backend.EFT/Services/ProfileService.cs index a4cd2f6d..ebf7e549 100644 --- a/Fuyu.Backend.EFT/Services/ProfileService.cs +++ b/Fuyu.Backend.EFT/Services/ProfileService.cs @@ -31,8 +31,8 @@ public static string CreateProfile(int accountId) profile.Savage._id = savageId; profile.Savage.aid = accountId; - // store profile - EftOrm.SetOrAddProfile(profile); + // store profile + EftOrm.SetOrAddProfile(profile); WriteToDisk(profile); return pmcId; diff --git a/Fuyu.Backend/Program.cs b/Fuyu.Backend/Program.cs index 026d3eb6..407f7be4 100644 --- a/Fuyu.Backend/Program.cs +++ b/Fuyu.Backend/Program.cs @@ -3,18 +3,20 @@ using Fuyu.Backend.Core.Servers; using Fuyu.Backend.EFT; using Fuyu.Backend.EFT.Servers; +using Fuyu.Backend.BSG.DTO.Services; namespace Fuyu.Backend { public class Program { static void Main() - { - CoreDatabase.Load(); - EftDatabase.Load(); + { + CoreDatabase.Load(); + EftDatabase.Load(); TraderDatabase.Load(); + ItemFactoryService.Load(); - var coreServer = new CoreServer(); + var coreServer = new CoreServer(); coreServer.RegisterServices(); coreServer.Start(); @@ -22,7 +24,7 @@ static void Main() eftMainServer.RegisterServices(); eftMainServer.Start(); - Terminal.WaitForInput(); + Terminal.WaitForInput(); } - } + } } \ No newline at end of file