diff --git a/Assemblies/CombatRealism.dll b/Assemblies/CombatRealism.dll index d6710f2..f9476ff 100644 Binary files a/Assemblies/CombatRealism.dll and b/Assemblies/CombatRealism.dll differ diff --git a/Assemblies/Source/CombatRealism/Combat_Realism.csproj b/Assemblies/Source/CombatRealism/Combat_Realism.csproj deleted file mode 100644 index 4ec2207..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Debug - AnyCPU - {AABEDCF4-2B5E-450E-B855-89595E67DC8D} - Library - Properties - Combat_Realism - CombatRealism - v3.5 - 512 - - False - OnBuildSuccess - False - False - False - obj\$(Configuration)\ - - - true - None - False - ..\..\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - False - obj\ - - - 4194304 - AnyCPU - False - False - Auto - - - - ..\..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\Assembly-CSharp.dll - False - - - ..\..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\Community Core Library.dll - False - - - - - - - - - ..\..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\UnityEngine.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/BulletCR.cs b/Assemblies/Source/CombatRealism/Combat_Realism/BulletCR.cs deleted file mode 100644 index 10335a5..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/BulletCR.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using Verse; -using Verse.Sound; -using RimWorld; - -namespace Combat_Realism -{ - public class BulletCR : ProjectileCR - { - private const float StunChance = 0.1f; - protected override void Impact(Thing hitThing) - { - base.Impact(hitThing); - if (hitThing != null) - { - int damageAmountBase = this.def.projectile.damageAmountBase; - BodyPartDamageInfo value = new BodyPartDamageInfo(null, null); - DamageInfo dinfo = new DamageInfo(this.def.projectile.damageDef, damageAmountBase, this.launcher, this.ExactRotation.eulerAngles.y, new BodyPartDamageInfo?(value), this.equipmentDef); - hitThing.TakeDamage(dinfo); - } - else - { - SoundDefOf.BulletImpactGround.PlayOneShot(base.Position); - MoteThrower.ThrowStatic(this.ExactPosition, ThingDefOf.Mote_ShotHit_Dirt, 1f); - } - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompAP.cs b/Assemblies/Source/CombatRealism/Combat_Realism/CompAP.cs deleted file mode 100644 index 9c3eac2..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompAP.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using RimWorld; -using Verse; -using UnityEngine; - -namespace Combat_Realism -{ - class CompProperties_AP : CompProperties - { - public float armorPenetration = 0f; - - public CompProperties_AP() - { - this.compClass = typeof(CompProperties_AP); - } - } - - class CompAP : ThingComp - { - new public CompProperties_AP props; - - public override void Initialize(CompProperties props) - { - base.Initialize(props); - CompProperties_AP cprops = props as CompProperties_AP; - if (cprops != null) - { - this.props = cprops; - } - } - - public override string GetDescriptionPart() - { - return "Armor penetration: " + GenText.AsPercent(props.armorPenetration); - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompExplosive.cs b/Assemblies/Source/CombatRealism/Combat_Realism/CompExplosive.cs deleted file mode 100644 index e1d1364..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompExplosive.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using RimWorld; -using Verse; -using UnityEngine; - -namespace Combat_Realism -{ - class CompProperties_Explosive : CompProperties - { - public float explosionDamage = -1; - public DamageDef explosionDamageDef = null; - - public CompProperties_Explosive() - { - this.compClass = typeof(CompProperties_Explosive); - } - } - - class CompExplosive : ThingComp - { - new public CompProperties_Explosive props; - - public override void Initialize(CompProperties props) - { - base.Initialize(props); - CompProperties_Explosive cprops = props as CompProperties_Explosive; - if (cprops != null) - { - this.props = cprops; - } - } - - /// - /// Produces a secondary explosion on impact using the explosion values from the projectile's projectile def. Requires the projectile's launcher to be passed on due to protection level, - /// only works when parent can be cast as ProjectileCR. Intended use is for HEAT and similar weapons that spawn secondary explosions while also penetrating, NOT explosive ammo of - /// anti-materiel rifles as the explosion just spawns on top of the pawn, not inside the hit body part. - /// - /// Additionally handles fragmentation effects if defined. - /// - /// Launcher of the projectile calling the method - protected virtual void Explode(Thing launcher) - { - ProjectileCR parentProjectile = this.parent as ProjectileCR; - - if (parentProjectile != null) - { - // Regular explosion stuff - if (this.props.explosionDamageDef != null && this.props.explosionDamage > 0) - { - BodyPartDamageInfo value = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside)); - ExplosionInfo explosionInfo = default(ExplosionInfo); - explosionInfo.center = parentProjectile.Position; - explosionInfo.radius = parentProjectile.def.projectile.explosionRadius; - explosionInfo.dinfo = new DamageInfo(this.props.explosionDamageDef, 999, launcher, new BodyPartDamageInfo?(value), null); - explosionInfo.postExplosionSpawnThingDef = parentProjectile.def.projectile.postExplosionSpawnThingDef; - explosionInfo.explosionSpawnChance = parentProjectile.def.projectile.explosionSpawnChance; - explosionInfo.explosionSound = parentProjectile.def.projectile.soundExplode; - explosionInfo.projectile = parentProjectile.def; - explosionInfo.DoExplosion(); - } - - // Fragmentation stuff - // --TODO-- - } - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompGizmos.cs b/Assemblies/Source/CombatRealism/Combat_Realism/CompGizmos.cs deleted file mode 100644 index a62dc1c..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompGizmos.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; -using Verse; -using UnityEngine; - -namespace Combat_Realism -{ - public class GizmoAmmoStatus : Command - { - //Link - public CompReloader compAmmo; - - private static readonly Texture2D FullTex = - SolidColorMaterials.NewSolidColorTexture(new Color(0.2f, 0.2f, 0.24f)); - private static readonly Texture2D EmptyTex = SolidColorMaterials.NewSolidColorTexture(Color.clear); - - public override float Width - { - get - { - return 120; - } - } - - public override GizmoResult GizmoOnGUI(Vector2 topLeft) - { - var overRect = new Rect(topLeft.x, topLeft.y, Width, Height); - Widgets.DrawBox(overRect); - GUI.DrawTexture(overRect, BGTex); - - var inRect = overRect.ContractedBy(6); - - //Item label - var textRect = inRect; - textRect.height = overRect.height / 2; - Text.Font = GameFont.Tiny; - Widgets.Label(textRect, compAmmo.parent.def.LabelCap); - - //Bar - var barRect = inRect; - barRect.yMin = overRect.y + overRect.height / 2f; - var ePct = (float)compAmmo.count / compAmmo.reloaderProp.roundPerMag; - Widgets.FillableBar(barRect, ePct, FullTex, EmptyTex, false); - Text.Font = GameFont.Small; - Text.Anchor = TextAnchor.MiddleCenter; - Widgets.Label(barRect, compAmmo.count + " / " + compAmmo.reloaderProp.roundPerMag); - Text.Anchor = TextAnchor.UpperLeft; - - return new GizmoResult(GizmoState.Clear); - } - } - - // God comp to handle generating gizmos for all the different comps, need this since CCL does not display gizmos from more than one comp - public class CompGizmos : CommunityCoreLibrary.CompRangedGizmoGiver - { - public override IEnumerable CompGetGizmosExtra() - { - // Reloader gizmos - CompReloader compReloader = this.parent.TryGetComp(); - if (compReloader != null) - { - var ammoStatusGizmo = new GizmoAmmoStatus { compAmmo = compReloader }; - yield return ammoStatusGizmo; - - if (compReloader.wielder != null) - { - var reloadCommandGizmo = new Command_Action - { - action = compReloader.StartReload, - defaultLabel = "CR_ReloadLabel".Translate(), - defaultDesc = "CR_ReloadDesc".Translate(), - icon = ContentFinder.Get("UI/Buttons/Reload", true) - }; - yield return reloadCommandGizmo; - } - } - - // Fire mode gizmos - CompFireModes compFireModes = this.parent.TryGetComp(); - if (compFireModes != null && compFireModes.casterPawn != null && compFireModes.casterPawn.Faction.Equals(Faction.OfColony)) - { - var toggleFireModeGizmo = new Command_Action - { - action = compFireModes.ToggleFireMode, - defaultLabel = ("CR_" + compFireModes.currentFireMode.ToString() + "Label").Translate(), - defaultDesc = "CR_ToggleFireModeDesc".Translate(), - icon = ContentFinder.Get(("UI/Buttons/" + compFireModes.currentFireMode.ToString()), true) - }; - yield return toggleFireModeGizmo; - - var toggleAimModeGizmo = new Command_Action - { - action = compFireModes.ToggleAimMode, - defaultLabel = ("CR_" + compFireModes.currentAimMode.ToString() + "Label").Translate(), - defaultDesc = "CR_ToggleAimModeDesc".Translate(), - icon = ContentFinder.Get(("UI/Buttons/" + compFireModes.currentAimMode.ToString()), true) - }; - yield return toggleAimModeGizmo; - } - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/DetourInjector.cs b/Assemblies/Source/CombatRealism/Combat_Realism/DetourInjector.cs deleted file mode 100644 index 0e4343e..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/DetourInjector.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; -using RimWorld; -using Verse; -using UnityEngine; -using CommunityCoreLibrary; - -namespace Combat_Realism -{ - class DetourInjector : SpecialInjector - { - public override void Inject() - { - // Detour VerbsTick - Log.Message("Attempting detour from VerbsTick to VerbsTickCR"); - Detours.TryDetourFromTo(typeof(VerbTracker).GetMethod("VerbsTick", BindingFlags.Instance | BindingFlags.Public), - typeof(VerbTrackerCR).GetMethod("VerbsTickCR", BindingFlags.Instance | BindingFlags.Public)); - - // Detour TooltipUtility - Log.Message("Attempting detour from ShotCalculationTipString to ShotCalculationTipStringCR"); - Detours.TryDetourFromTo(typeof(TooltipUtility).GetMethod("ShotCalculationTipString", BindingFlags.Static | BindingFlags.Public), - typeof(TooltipUtilityCR).GetMethod("ShotCalculationTipStringCR", BindingFlags.Static | BindingFlags.Public)); - - // Detour CalculateBleedingRate - Log.Message("Attempting detour from CalculateBleedingRate to CalculateBleedingRateCR"); - Detours.TryDetourFromTo(typeof(HediffSet).GetMethod("CalculateBleedingRate", BindingFlags.Instance | BindingFlags.NonPublic), - typeof(DetourUtility).GetMethod("CalculateBleedingRateCR", BindingFlags.Static | BindingFlags.Public)); - - // Detour DrawTurret - Log.Message("Attempting detour from DrawTurret to DrawTurretCR"); - Detours.TryDetourFromTo(typeof(TurretTop).GetMethod("DrawTurret", BindingFlags.Instance | BindingFlags.Public), - typeof(DetourUtility).GetMethod("DrawTurretCR", BindingFlags.Static | BindingFlags.Public)); - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/DetourUtility.cs b/Assemblies/Source/CombatRealism/Combat_Realism/DetourUtility.cs deleted file mode 100644 index 7656540..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/DetourUtility.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Reflection; -using RimWorld; -using Verse; -using UnityEngine; - -namespace Combat_Realism -{ - public static class DetourUtility - { - public static float CalculateBleedingRateCR(this HediffSet _this) - { - if (!_this.pawn.RaceProps.isFlesh || _this.pawn.health.Dead) - { - return 0f; - } - float bleedAmount = 0f; - for (int i = 0; i < _this.hediffs.Count; i++) - { - float hediffBleedRate = _this.hediffs[i].BleedRate; - if (_this.hediffs[i].Part != null) - { - hediffBleedRate *= _this.hediffs[i].Part.def.bleedingRateMultiplier; - } - bleedAmount += hediffBleedRate; - } - float value = 0.0142857144f * bleedAmount * 2 / _this.pawn.HealthScale; - return Mathf.Max(0, value); - } - - private static FieldInfo parentTurretFieldInfo = typeof(TurretTop).GetField("parentTurret", BindingFlags.Instance | BindingFlags.NonPublic); - private static PropertyInfo curRotationPropertyInfo = typeof(TurretTop).GetProperty("CurRotation", BindingFlags.Instance | BindingFlags.NonPublic); - - public static void DrawTurretCR(this TurretTop _this) - { - Matrix4x4 matrix = default(Matrix4x4); - Vector3 vec = new Vector3(1, 1, 1); - Building_Turret parentTurret = (Building_Turret)parentTurretFieldInfo.GetValue(_this); - float curRotation = (float)curRotationPropertyInfo.GetValue(_this, null); - Material topMat = parentTurret.def.building.turretTopMat; - if (topMat.mainTexture.height >= 256 || topMat.mainTexture.width >= 256) - { - vec.x = 2; - vec.z = 2; - } - matrix.SetTRS(parentTurret.DrawPos + Altitudes.AltIncVect, curRotation.ToQuat(), vec); - Graphics.DrawMesh(MeshPool.plane20, matrix, parentTurret.def.building.turretTopMat, 0); - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Explosive.cs b/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Explosive.cs deleted file mode 100644 index 4c77a47..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Explosive.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using Verse; - -namespace Combat_Realism -{ - //Cloned from vanilla, completely unmodified - public class ProjectileCR_Explosive : ProjectileCR - { - private int ticksToDetonation; - public override void ExposeData() - { - base.ExposeData(); - Scribe_Values.LookValue(ref this.ticksToDetonation, "ticksToDetonation", 0, false); - } - public override void Tick() - { - base.Tick(); - if (this.ticksToDetonation > 0) - { - this.ticksToDetonation--; - if (this.ticksToDetonation <= 0) - { - this.Explode(); - } - } - } - protected override void Impact(Thing hitThing) - { - if (this.def.projectile.explosionDelay == 0) - { - this.Explode(); - return; - } - this.landed = true; - this.ticksToDetonation = this.def.projectile.explosionDelay; - } - protected virtual void Explode() - { - this.Destroy(DestroyMode.Vanish); - BodyPartDamageInfo value = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside)); - ExplosionInfo explosionInfo = default(ExplosionInfo); - explosionInfo.center = base.Position; - explosionInfo.radius = this.def.projectile.explosionRadius; - explosionInfo.dinfo = new DamageInfo(this.def.projectile.damageDef, 999, this.launcher, new BodyPartDamageInfo?(value), null); - explosionInfo.postExplosionSpawnThingDef = this.def.projectile.postExplosionSpawnThingDef; - explosionInfo.explosionSpawnChance = this.def.projectile.explosionSpawnChance; - explosionInfo.explosionSound = this.def.projectile.soundExplode; - explosionInfo.projectile = this.def; - explosionInfo.DoExplosion(); - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Frag.cs b/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Frag.cs deleted file mode 100644 index 4a8bd8a..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR_Frag.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; // Always needed -using RimWorld; // RimWorld specific functions are found here -using Verse; // RimWorld universal objects are here -//using Verse.AI; // Needed when you do something with the AI -using Verse.Sound; // Needed when you do something with the Sound - -namespace Combat_Realism -{ - /// - /// Explosive with fragmentation effect - /// - public class ProjectileCR_Frag : ProjectileCR_Explosive - { - private Thing equipment = null; - - //frag variables - private int fragAmountSmall = 0; - private int fragAmountMedium = 0; - private int fragAmountLarge = 0; - - private float fragRange = 0; - - private ThingDef fragProjectileSmall = null; - private ThingDef fragProjectileMedium = null; - private ThingDef fragProjectileLarge = null; - - /// - /// Read parameters from XML file - /// - /// True if parameters are in order, false otherwise - public bool getParameters() - { - ThingDef_ProjectileFrag projectileDef = this.def as ThingDef_ProjectileFrag; - if (projectileDef.fragAmountSmall + projectileDef.fragAmountMedium + projectileDef.fragAmountLarge > 0 - && projectileDef.fragRange > 0 - && projectileDef.fragProjectileSmall != null - && projectileDef.fragProjectileMedium != null - && projectileDef.fragProjectileLarge != null) - { - this.fragAmountSmall = projectileDef.fragAmountSmall; - this.fragAmountMedium = projectileDef.fragAmountMedium; - this.fragAmountLarge = projectileDef.fragAmountLarge; - - this.fragRange = projectileDef.fragRange; - - this.fragProjectileSmall = projectileDef.fragProjectileSmall; - this.fragProjectileMedium = projectileDef.fragProjectileMedium; - this.fragProjectileLarge = projectileDef.fragProjectileLarge; - - return true; - } - return false; - } - - /// - /// Scatters fragments around - /// - protected virtual void ScatterFragments(ThingDef projectileDef) - { - ProjectileCR projectile = (ProjectileCR)ThingMaker.MakeThing(projectileDef, null); - projectile.canFreeIntercept = true; - /* - projectile.shotAngle = Random.Range(-3.0f, 0.5f); - projectile.shotHeight = 0.1f; - */ - - Vector3 exactTarget = this.ExactPosition + (new Vector3(1, 0, 1) * Random.Range(0, this.fragRange)).RotatedBy(Random.Range(0, 360)); - TargetInfo targetCell = exactTarget.ToIntVec3(); - GenSpawn.Spawn(projectile, this.Position); - - projectile.Launch(this, this.ExactPosition, targetCell, exactTarget, equipment); - } - - /// - /// Explode and scatter fragments around - /// - protected override void Explode() - { - if (this.getParameters()) - { - //Spawn projectiles - for (int i = 0; i < fragAmountSmall; i++) - { - this.ScatterFragments(this.fragProjectileSmall); - } - for (int i = 0; i < fragAmountMedium; i++) - { - this.ScatterFragments(this.fragProjectileMedium); - } - for (int i = 0; i < fragAmountLarge; i++) - { - this.ScatterFragments(this.fragProjectileLarge); - } - } - base.Explode(); - } - - public override void Launch(Thing launcher, Vector3 origin, TargetInfo targ, Thing equipment = null) - { - base.Launch(launcher, origin, targ, equipment); - this.equipment = equipment; - } - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ThingDef_ProjectileFrag.cs b/Assemblies/Source/CombatRealism/Combat_Realism/ThingDef_ProjectileFrag.cs deleted file mode 100644 index eb51baf..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ThingDef_ProjectileFrag.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; // Always needed -using RimWorld; // RimWorld specific functions are found here -using Verse; // RimWorld universal objects are here -//using Verse.AI; // Needed when you do something with the AI -using Verse.Sound; // Needed when you do something with the Sound - -namespace Combat_Realism -{ - class ThingDef_ProjectileFrag : ThingDef - { - public int fragAmountSmall = 0; //Amount of fragments to scatter - public int fragAmountMedium = 0; - public int fragAmountLarge = 0; - - public float fragRange = 0; //How far the fragments fly - - public ThingDef fragProjectileSmall = null; //What projectiles to use for fragments - public ThingDef fragProjectileMedium = null; - public ThingDef fragProjectileLarge = null; - } -} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/VerbTrackerCR.cs b/Assemblies/Source/CombatRealism/Combat_Realism/VerbTrackerCR.cs deleted file mode 100644 index a2c60ce..0000000 --- a/Assemblies/Source/CombatRealism/Combat_Realism/VerbTrackerCR.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; -using Verse; -using UnityEngine; - -namespace Combat_Realism -{ - class VerbTrackerCR : VerbTracker - { - /// - /// This is a hacky way of getting access to cachedVerbs, which is private - /// - private List cachedVerbsCR - { - get - { - return this.AllVerbs; - } - } - - /// - /// VerbsTick is detoured to here. Mimicks all the functionality of the vanilla method while also calling custom CR ticker method from CR verbs. - /// - public void VerbsTickCR() - { - if (this.cachedVerbsCR == null) - { - return; - } - for (int i = 0; i < this.cachedVerbsCR.Count; i++) - { - this.cachedVerbsCR[i].VerbTick(); - Verb_LaunchProjectileCR verbCR = this.cachedVerbsCR[i] as Verb_LaunchProjectileCR; - if (verbCR != null) - { - verbCR.VerbTickCR(); - } - } - } - } -} diff --git a/Assemblies/Source/CombatRealism/Projectile_Laser/Projectile_LaserRifle.cs b/Assemblies/Source/CombatRealism/Projectile_Laser/Projectile_LaserRifle.cs deleted file mode 100644 index 131592c..0000000 --- a/Assemblies/Source/CombatRealism/Projectile_Laser/Projectile_LaserRifle.cs +++ /dev/null @@ -1,376 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; // Always needed -using RimWorld; // RimWorld specific functions are found here -using Verse; // RimWorld universal objects are here -//using Verse.AI; // Needed when you do something with the AI -using Verse.Sound; // Needed when you do something with the Sound - -namespace Projectile_Laser -{ - /// - /// Common laser type projectile class. - /// - /// Rikiki - /// Use this code as you want, just remember to add a link to the corresponding Ludeon forum mod release thread. - /// Remember learning is always better than just copy/paste... - public class Projectile_LaserRifle : Projectile - { - // Variables. - public int tickCounter = 0; - public Thing hitThing = null; - - // Miscellaneous. - public const float stunChance = 0.1f; - - // Draw variables. - public Material preFiringTexture; - public Material postFiringTexture; - public Matrix4x4 drawingMatrix = default(Matrix4x4); - public Vector3 drawingScale; - public Vector3 drawingPosition; - public float drawingIntensity = 0f; - public Material drawingTexture = null; - - // Custom XML variables. - // Miscellaneous. - public bool isWarmupProjectile = false; - public string warmupProjectileDefName = null; - public int preFiringDuration = 0; - public int postFiringDuration = 0; - // Draw. - public float preFiringInitialIntensity = 0f; - public float preFiringFinalIntensity = 0f; - public float postFiringInitialIntensity = 0f; - public float postFiringFinalIntensity = 0f; - public Material warmupTexture = null; - // Sound. - public SoundDef warmupSound = null; - - /// - /// Get parameters from XML. - /// - public void GetParametersFromXml() - { - Projectile_Laser.ThingDef_LaserProjectile additionalParameters = def as Projectile_Laser.ThingDef_LaserProjectile; - - // Miscellaneous. - if (additionalParameters.warmupProjectileDefName != null) - { - warmupProjectileDefName = additionalParameters.warmupProjectileDefName; - } - isWarmupProjectile = additionalParameters.isWarmupProjectile; - preFiringDuration = additionalParameters.preFiringDuration; - postFiringDuration = additionalParameters.postFiringDuration; - - // Draw. - preFiringInitialIntensity = additionalParameters.preFiringInitialIntensity; - preFiringFinalIntensity = additionalParameters.preFiringFinalIntensity; - postFiringInitialIntensity = additionalParameters.postFiringInitialIntensity; - postFiringFinalIntensity = additionalParameters.postFiringFinalIntensity; - if (additionalParameters.warmupGraphicPathSingle != null) - { - warmupTexture = MaterialPool.MatFrom(additionalParameters.warmupGraphicPathSingle, ShaderDatabase.Transparent); - } - - // Sound. - if (additionalParameters.warmupSound != null) - { - warmupSound = SoundDef.Named(additionalParameters.warmupSound); - } - } - - /// - /// Save/load data from a savegame file (apparently not used for projectile for now). - /// - public override void ExposeData() - { - base.ExposeData(); - Scribe_Values.LookValue(ref tickCounter, "tickCounter", 0); - - if (Scribe.mode == LoadSaveMode.PostLoadInit) - { - GetParametersFromXml(); - } - } - - /// - /// Main projectile sequence. - /// - public override void Tick() - { - // Directly call the Projectile base Tick function (we want to completely override the Projectile Tick() function). - //((ThingWithComponents)this).Tick(); // Does not work... - - if (tickCounter == 0) - { - GetParametersFromXml(); - PerformPreFiringTreatment(); - } - - // Pre firing. - if (tickCounter < preFiringDuration) - { - GetPreFiringDrawingParameters(); - } - // Firing. - else if (tickCounter == this.preFiringDuration) - { - Fire(); - GetPostFiringDrawingParameters(); - } - // Post firing. - else - { - GetPostFiringDrawingParameters(); - } - - if (tickCounter == (this.preFiringDuration + this.postFiringDuration)) - { - this.Destroy(DestroyMode.Vanish); - } - if (this.launcher is Pawn) - { - Pawn launcherPawn = this.launcher as Pawn; - if (((launcherPawn.stances.curStance is Stance_Warmup) == false) - && ((launcherPawn.stances.curStance is Stance_Cooldown) == false)) - { - this.Destroy(DestroyMode.Vanish); - } - } - - tickCounter++; - } - - /// - /// Performs prefiring treatment: data initalization. - /// - public virtual void PerformPreFiringTreatment() - { - drawingTexture = this.def.DrawMatSingle; - DetermineImpactExactPosition(); - Vector3 cannonMouthOffset = ((this.destination - this.origin).normalized * 0.9f); - drawingScale = new Vector3(1f, 1f, (this.destination - this.origin).magnitude - cannonMouthOffset.magnitude); - drawingPosition = this.origin + (cannonMouthOffset / 2) + ((this.destination - this.origin) / 2) + Vector3.up * this.def.Altitude; - drawingMatrix.SetTRS(drawingPosition, this.ExactRotation, drawingScale); - } - - /// - /// Gets the prefiring drawing parameters. - /// - public virtual void GetPreFiringDrawingParameters() - { - if (preFiringDuration != 0) - { - drawingIntensity = preFiringInitialIntensity + (preFiringFinalIntensity - preFiringInitialIntensity) * (float)tickCounter / (float)preFiringDuration; - } - } - - /// - /// Gets the postfiring drawing parameters. - /// - public virtual void GetPostFiringDrawingParameters() - { - if (postFiringDuration != 0) - { - drawingIntensity = postFiringInitialIntensity + (postFiringFinalIntensity - postFiringInitialIntensity) * (((float)tickCounter - (float)preFiringDuration) / (float)postFiringDuration); - } - } - - /// - /// Checks for colateral targets (cover, neutral animal, pawn) along the trajectory. - /// - protected void DetermineImpactExactPosition() - { - // We split the trajectory into small segments of approximatively 1 cell size. - Vector3 trajectory = (this.destination - this.origin); - int numberOfSegments = (int)trajectory.magnitude; - Vector3 trajectorySegment = (trajectory / trajectory.magnitude); - - Vector3 temporaryDestination = this.origin; // Last valid tested position in case of an out of boundaries shot. - Vector3 exactTestedPosition = this.origin; - IntVec3 testedPosition = exactTestedPosition.ToIntVec3(); - - for (int segmentIndex = 1; segmentIndex <= numberOfSegments; segmentIndex++) - { - exactTestedPosition += trajectorySegment; - testedPosition = exactTestedPosition.ToIntVec3(); - - if (!exactTestedPosition.InBounds()) - { - this.destination = temporaryDestination; - break; - } - - if (!this.def.projectile.flyOverhead && this.canFreeIntercept && segmentIndex >= 5) - { - //foreach (Thing current in Find.ThingGrid.ThingsAt(testedPosition)) - List list = Find.ThingGrid.ThingsListAt(base.Position); - for (int i = 0; i < list.Count; i++) - { - Thing current = list[i]; - - // Check impact on a wall. - if (current.def.Fillage == FillCategory.Full) - { - this.destination = testedPosition.ToVector3Shifted() + new Vector3(Rand.Range(-0.3f, 0.3f), 0f, Rand.Range(-0.3f, 0.3f)); - this.hitThing = current; - break; - } - - // Check impact on a pawn. - if (current is Pawn) - { - Pawn pawn = current as Pawn; - float chanceToHitCollateralTarget = 0.45f; - if (pawn.GetPosture() != PawnPosture.Standing) - { - chanceToHitCollateralTarget *= 0.1f; - } - float targetDistanceFromShooter = (this.ExactPosition - this.origin).MagnitudeHorizontal(); - if (targetDistanceFromShooter < 4f) - { - chanceToHitCollateralTarget *= 0f; - } - else - { - if (targetDistanceFromShooter < 7f) - { - chanceToHitCollateralTarget *= 0.5f; - } - else - { - if (targetDistanceFromShooter < 10f) - { - chanceToHitCollateralTarget *= 0.75f; - } - } - } - chanceToHitCollateralTarget *= pawn.BodySize; - - if (Rand.Value < chanceToHitCollateralTarget) - { - this.destination = testedPosition.ToVector3Shifted() + new Vector3(Rand.Range(-0.3f, 0.3f), 0f, Rand.Range(-0.3f, 0.3f)); - this.hitThing = (Thing)pawn; - break; - } - } - } - } - - temporaryDestination = exactTestedPosition; - } - } - - /// - /// Manages the projectile damage application. - /// - public virtual void Fire() - { - ApplyDamage(this.hitThing); - } - - /// - /// Applies damage on a collateral pawn or an object. - /// - protected void ApplyDamage(Thing hitThing) - { - if (hitThing != null) - { - // Impact collateral target. - this.Impact(hitThing); - } - else - { - this.ImpactSomething(); - } - } - - /// - /// Computes what should be impacted in the DestinationCell. - /// - protected void ImpactSomething() - { - // Check impact on a thick mountain. - if (this.def.projectile.flyOverhead) - { - RoofDef roofDef = Find.RoofGrid.RoofAt(this.DestinationCell); - if (roofDef != null && roofDef.isThickRoof) - { - this.def.projectile.soundHitThickRoof.PlayOneShot(this.DestinationCell); - return; - } - } - - // Impact the initial targeted pawn. - if (this.assignedTarget != null) - { - Pawn pawn = this.assignedTarget as Pawn; - if (pawn != null && pawn.Downed && (this.origin - this.destination).magnitude > 5f && Rand.Value < 0.2f) - { - this.Impact(null); - return; - } - this.Impact(this.assignedTarget); - return; - } - else - { - // Impact a pawn in the destination cell if present. - Thing thing = Find.ThingGrid.ThingAt(this.DestinationCell, ThingCategory.Pawn); - if (thing != null) - { - this.Impact(thing); - return; - } - // Impact any cover object. - foreach (Thing current in Find.ThingGrid.ThingsAt(this.DestinationCell)) - { - if (current.def.fillPercent > 0f || current.def.passability != Traversability.Standable) - { - this.Impact(current); - return; - } - } - this.Impact(null); - return; - } - } - - /// - /// Impacts a pawn/object or the ground. - /// - protected override void Impact(Thing hitThing) - { - if (hitThing != null) - { - int damageAmountBase = this.def.projectile.damageAmountBase; - BodyPartDamageInfo value = new BodyPartDamageInfo(null, null); - DamageInfo dinfo = new DamageInfo(this.def.projectile.damageDef, damageAmountBase, this.launcher, this.ExactRotation.eulerAngles.y, new BodyPartDamageInfo?(value), this.equipmentDef); - hitThing.TakeDamage(dinfo); - hitThing.def.soundImpactDefault.PlayOneShot(this.DestinationCell); - Pawn pawn = hitThing as Pawn; - if (pawn != null && !pawn.Downed && Rand.Value < Projectile_LaserRifle.stunChance) - { - hitThing.TakeDamage(new DamageInfo(DamageDefOf.Stun, 10, this.launcher, null, null)); - } - } - else - { - MoteThrower.ThrowStatic(this.destination, ThingDefOf.Mote_MicroSparks); - } - } - - /// - /// Draws the laser ray. - /// - public override void Draw() - { - this.Comps_PostDraw(); - UnityEngine.Graphics.DrawMesh(MeshPool.plane10, drawingMatrix, FadedMaterialPool.FadedVersionOf(drawingTexture, drawingIntensity), 0); - } - } -} diff --git a/Assemblies/Source/CombatRealism/Projectile_Laser/ThingDef_LaserProjectile.cs b/Assemblies/Source/CombatRealism/Projectile_Laser/ThingDef_LaserProjectile.cs deleted file mode 100644 index 12ac059..0000000 --- a/Assemblies/Source/CombatRealism/Projectile_Laser/ThingDef_LaserProjectile.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using UnityEngine; // Always needed -using RimWorld; // RimWorld specific functions are found here -using Verse; // RimWorld universal objects are here -//using Verse.AI; // Needed when you do something with the AI -using Verse.Sound; // Needed when you do something with the Sound - -namespace Projectile_Laser -{ - /// - /// Laser projectile ThingDef custom variables class. - /// - /// Rikiki - /// Use this code as you want, just remember to add a link to the corresponding Ludeon forum mod release thread. - /// Remember learning is always better than just copy/paste... - public class ThingDef_LaserProjectile : ThingDef - { - // Draw. - public float preFiringInitialIntensity = 0f; - public float preFiringFinalIntensity = 0f; - public float postFiringInitialIntensity = 0f; - public float postFiringFinalIntensity = 0f; - public string warmupGraphicPathSingle = null; - - // Sound. - public string warmupSound; - - // Miscellaneous. - public bool isWarmupProjectile = false; - public string warmupProjectileDefName = null; - public int preFiringDuration = 0; - public int postFiringDuration = 0; - } -} diff --git a/Assemblies/Source/CombatRealism/Reload/CompReloader.cs b/Assemblies/Source/CombatRealism/Reload/CompReloader.cs deleted file mode 100644 index 15e4f13..0000000 --- a/Assemblies/Source/CombatRealism/Reload/CompReloader.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Generic; -using RimWorld; -using UnityEngine; -using Verse; -using Verse.AI; -using Verse.Sound; - -namespace Combat_Realism -{ - public class CompProperties_Reloader : CompProperties - { - public int roundPerMag = 1; - public int reloadTick = 300; - public bool throwMote = true; - } - - public class CompReloader : CommunityCoreLibrary.CompRangedGizmoGiver - { - public int count; - public bool needReload; - public CompProperties_Reloader reloaderProp; - - public CompEquippable compEquippable - { - get { return parent.GetComp< CompEquippable >(); } - } - - public Pawn wielder - { - get { return compEquippable.PrimaryVerb.CasterPawn; } - } - - private TargetInfo storedTarget = null; - private JobDef storedJobDef = null; - - public override void Initialize( CompProperties vprops ) - { - base.Initialize( vprops ); - - reloaderProp = vprops as CompProperties_Reloader; - if ( reloaderProp != null ) - { - count = reloaderProp.roundPerMag; - } - else - { - Log.Warning( "Could not find a CompProperties_Reloader for CompReloader." ); - count = 9876; - } - } - - public override void PostExposeData() - { - base.PostExposeData(); - - Scribe_Values.LookValue( ref count, "count", 1 ); - } - - private void AssignJobToWielder(Job job) - { - if (wielder.drafter != null) - { - wielder.drafter.TakeOrderedJob(job); - } - else - { - ExternalPawnDrafter.TakeOrderedJob(wielder, job); - } - } - - public void StartReload() - { - count = 0; - needReload = true; -#if DEBUG - if ( wielder == null ) - { - Log.ErrorOnce( "Wielder of " + parent + " is null!", 7381889 ); - FinishReload(); - return; - } -#endif - if ( reloaderProp.throwMote ) - { - MoteThrower.ThrowText( wielder.Position.ToVector3Shifted(), "CR_ReloadingMote".Translate() ); - } - - var reloadJob = new Job( DefDatabase< JobDef >.GetNamed( "ReloadWeapon" ), wielder, parent ) - { - playerForced = true - }; - - //Store the current job so we can reassign it later - if (this.wielder.drafter != null - && this.wielder.CurJob != null - && (this.wielder.CurJob.def == JobDefOf.AttackStatic || this.wielder.CurJob.def == JobDefOf.Goto)) - { - this.storedTarget = this.wielder.CurJob.targetA.HasThing ? new TargetInfo(this.wielder.CurJob.targetA.Thing) : new TargetInfo(this.wielder.CurJob.targetA.Cell); - this.storedJobDef = this.wielder.CurJob.def; - } - this.AssignJobToWielder(reloadJob); - } - - public void FinishReload() - { - parent.def.soundInteract.PlayOneShot(SoundInfo.InWorld(wielder.Position)); - if ( reloaderProp.throwMote ) - { - MoteThrower.ThrowText(wielder.Position.ToVector3Shifted(), "CR_ReloadedMote".Translate()); - } - count = reloaderProp.roundPerMag; - needReload = false; - } - - public void TryContinuePreviousJob() - { - //If a job is stored, assign it - if (this.storedTarget != null && this.storedJobDef != null) - { - this.AssignJobToWielder(new Job(this.storedJobDef, this.storedTarget)); - - //Clear out stored job after assignment - this.storedTarget = null; - this.storedJobDef = null; - } - } - - public override IEnumerable< Command > CompGetGizmosExtra() - { - var ammoStat = new GizmoAmmoStatus - { - compAmmo = this - }; - - yield return ammoStat; - - if (this.wielder != null) - { - var com = new Command_Action - { - action = StartReload, - defaultLabel = "CR_ReloadLabel".Translate(), - defaultDesc = "CR_ReloadDesc".Translate(), - icon = ContentFinder.Get("UI/Buttons/Reload", true) - }; - - yield return com; - } - } - - public override string GetDescriptionPart() - { - return "Magazine size: " + GenText.ToStringByStyle(this.reloaderProp.roundPerMag, ToStringStyle.Integer) + - "\nReload time: " + GenText.ToStringByStyle((this.reloaderProp.reloadTick / 60), ToStringStyle.Integer) + " s"; - } - } -} diff --git a/Assemblies/Source/CombatRealism/Reload/Verb_ShootCRReload.cs b/Assemblies/Source/CombatRealism/Reload/Verb_ShootCRReload.cs deleted file mode 100644 index 6af66d2..0000000 --- a/Assemblies/Source/CombatRealism/Reload/Verb_ShootCRReload.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Combat_Realism; -using Verse; - -namespace Combat_Realism -{ - public class Verb_ShootCRReload : Verb_ShootCR - { - private bool done; - private CompReloader compAmmo; - - protected override bool TryCastShot() - { - if ( !done ) - { - compAmmo = ownerEquipment.GetComp< CompReloader >(); - done = true; - } - - if ( compAmmo == null ) - { - Log.ErrorOnce( "No compAmmo found!", 12423 ); - return base.TryCastShot(); - } - - if ( compAmmo.needReload || compAmmo.count <= 0) - { - compAmmo.StartReload(); - return false; - } - - if ( !base.TryCastShot() ) - { - return false; - } - - compAmmo.count--; - if ( compAmmo.count <= 0 ) - { - compAmmo.StartReload(); - } - - return true; - } - - public override void Notify_Dropped() - { - base.Notify_Dropped(); - caster = null; - } - } -} diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_Advanced.xml b/Defs/AmmoCategoryDefs/AmmoCategories_Advanced.xml new file mode 100644 index 0000000..798a5ea --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_Advanced.xml @@ -0,0 +1,42 @@ + + + + + Charged + + The charged particle coating disrupts armor and tissue in equal measure. + + + + ChargedAP + + Focuses charged particles around the tip of the core for improved armor penetration at the cost of stopping power. + + + + Ionized + + Designed to combat mechanoids, the round creates an electrical current on impact, disrupting electronic systems temporarily. + + + + IncendiaryFuel + + Filled with incendiary agent that ignites after impact. + + + + ThermobaricFuel + + Filled with high-explosive aerosol that causes a large explosion and ignites flammable materials. + true + + + + FoamFuel + + Special round designed for civilian fire-fighting purposes. Filled with fire-retardant foam to suppress fires in a large area. + true + + + \ No newline at end of file diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_General.xml b/Defs/AmmoCategoryDefs/AmmoCategories_General.xml new file mode 100644 index 0000000..d535ae9 --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_General.xml @@ -0,0 +1,41 @@ + + + + + FullMetalJacket + + The soft lead core is encased in a harder metal coating, combining a medium amount of stopping power and armor penetration. + + + + ArmorPiercing + + Features a hardened steel penetrator core for increased armor penetration. + + + + HollowPoint + + A hollowed out tip causes the bullet to expand on impact, increasing tissue damage at the cost of armor penetration. + + + + Sabot + + Uses a discarding sabot to fire an undersized projectile at higher muzzle velocities, greatly improving armor penetration. + + + + IncendiaryAP + + Filled with an incendiary compound that ignites on impact, doing additional damage and potentially igniting targets. + + + + ExplosiveAP + + Filled with high-explosives that detonate on impact for additional damage. + true + + + \ No newline at end of file diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_Grenades.xml b/Defs/AmmoCategoryDefs/AmmoCategories_Grenades.xml new file mode 100644 index 0000000..faa3c24 --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_Grenades.xml @@ -0,0 +1,17 @@ + + + + + GrenadeHE + + The high-explosive charge detonates on impact, scattering lethal shell fragments in a large area. + + + + GrenadeEMP + + Creates an electro-magnetic burst on impact, temporarily disrupting electronic systems and Mechanoids. + true + + + \ No newline at end of file diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_Neolithic.xml b/Defs/AmmoCategoryDefs/AmmoCategories_Neolithic.xml new file mode 100644 index 0000000..eedbd46 --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_Neolithic.xml @@ -0,0 +1,10 @@ + + + + + StoneArrow + + A sharpened stone is attached as an arrow head. Cuts exposed tissue fairly well but is ineffective against any kind of armor. + + + \ No newline at end of file diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_Rockets.xml b/Defs/AmmoCategoryDefs/AmmoCategories_Rockets.xml new file mode 100644 index 0000000..84fc176 --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_Rockets.xml @@ -0,0 +1,23 @@ + + + + + RocketHEAT + + Shaped charge warhead. Detonates on impact, creating a super-heated stream of molten metal that punches through enemy armor. + + + + RocketThermobaric + + Disperses and subsequently ignites a fuel-air explosive mix, creating a powerful explosion and potentially igniting flammable objects. + true + + + + RocketFrag + + Designed to explode into a cloud of deadly shrapnel, shredding soft targets in a large area. + + + \ No newline at end of file diff --git a/Defs/AmmoCategoryDefs/AmmoCategories_Shotgun.xml b/Defs/AmmoCategoryDefs/AmmoCategories_Shotgun.xml new file mode 100644 index 0000000..12cfeb8 --- /dev/null +++ b/Defs/AmmoCategoryDefs/AmmoCategories_Shotgun.xml @@ -0,0 +1,35 @@ + + + + + BuckShot + + Filled with several buckshot pellets which spread in a tight pattern. + + + + BirdShot + + Filled with a large number of very small birdshot pellets which spread over a large area. + + + + Slug + + The single large projectile offers better damage potential and armor penetration compared to regular shot but is inaccurate over large distances. + + + + Beanbag + + Non-lethal rubber round originally designed for riot control. Accurate over short ranges only. Designed to temporarily incapacitate a target, it does not cause bleeding or damage to internal organs. + + + + ElectroSlug + + Designed to combat mechanoids, the projectile is accurate over short range only and delivers an electro-magnetic pulse on impact, temporarily disabling electronics. + true + + + \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Advanced.xml b/Defs/AmmoSetDefs/AmmoSets_Advanced.xml new file mode 100644 index 0000000..26137cd --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Advanced.xml @@ -0,0 +1,57 @@ + + + + + + + AmmoSet_30x64mmFuel + + +
  • Ammo_30x64mmFuel_Incendiary
  • +
  • Ammo_30x64mmFuel_Thermobaric
  • +
    +
    + + + + + AmmoSet_80x256mmFuel + + +
  • Ammo_80x256mmFuel_Thermobaric
  • +
    +
    + + + + + AmmoSet_6x24mmCharged + + +
  • Ammo_6x24mmCharged
  • +
  • Ammo_6x24mmCharged_AP
  • +
  • Ammo_6x24mmCharged_Ion
  • +
    +
    + + + + + AmmoSet_5x35mmCharged + + +
  • Ammo_5x35mmCharged
  • +
    +
    + + + + + AmmoSet_12x64mmCharged + + +
  • Ammo_12x64mmCharged
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Grenades.xml b/Defs/AmmoSetDefs/AmmoSets_Grenades.xml new file mode 100644 index 0000000..0793b46 --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Grenades.xml @@ -0,0 +1,26 @@ + + + + + + + AmmoSet_30x29mmGrenade + + +
  • Ammo_30x29mmGrenade_HE
  • +
  • Ammo_30x29mmGrenade_EMP
  • +
    +
    + + + + + AmmoSet_40x46mmGrenade + + +
  • Ammo_40x46mmGrenade_HE
  • +
  • Ammo_40x46mmGrenade_EMP
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_HighCaliber.xml b/Defs/AmmoSetDefs/AmmoSets_HighCaliber.xml new file mode 100644 index 0000000..b1b3973 --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_HighCaliber.xml @@ -0,0 +1,17 @@ + + + + + + + AmmoSet_50BMG + + +
  • Ammo_50BMG_FMJ
  • +
  • Ammo_50BMG_AP
  • +
  • Ammo_50BMG_HE
  • +
  • Ammo_50BMG_Incendiary
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Neolithic.xml b/Defs/AmmoSetDefs/AmmoSets_Neolithic.xml new file mode 100644 index 0000000..c769b8c --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Neolithic.xml @@ -0,0 +1,24 @@ + + + + + + + AmmoSet_Arrow + + +
  • Ammo_Arrow
  • +
    +
    + + + + + AmmoSet_GreatArrow + + +
  • Ammo_GreatArrow
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Pistols.xml b/Defs/AmmoSetDefs/AmmoSets_Pistols.xml new file mode 100644 index 0000000..28cad36 --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Pistols.xml @@ -0,0 +1,75 @@ + + + + + + + AmmoSet_40Rimfire + + +
  • Ammo_40Rimfire
  • +
    +
    + + + + + AmmoSet_32ACP + + +
  • Ammo_32ACP_FMJ
  • + +
    +
    + + + + + AmmoSet_762x25mmTokarev + + +
  • Ammo_762x25mmTokarev_FMJ
  • +
  • Ammo_762x25mmTokarev_AP
  • +
  • Ammo_762x25mmTokarev_HP
  • +
    +
    + + + + + AmmoSet_9x19mmPara + + +
  • Ammo_9x19mmPara_FMJ
  • +
  • Ammo_9x19mmPara_AP
  • +
  • Ammo_9x19mmPara_HP
  • +
    +
    + + + + + AmmoSet_45ACP + + +
  • Ammo_45ACP_FMJ
  • +
  • Ammo_45ACP_AP
  • +
  • Ammo_45ACP_HP
  • +
    +
    + + + + + AmmoSet_45Colt + + +
  • Ammo_45Colt_FMJ
  • +
  • Ammo_45Colt_AP
  • +
  • Ammo_45Colt_HP
  • +
  • Ammo_410Bore_Buck
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Rifles.xml b/Defs/AmmoSetDefs/AmmoSets_Rifles.xml new file mode 100644 index 0000000..e2328bc --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Rifles.xml @@ -0,0 +1,64 @@ + + + + + + + AmmoSet_556x45mmNATO + + +
  • Ammo_556x45mmNATO_FMJ
  • +
  • Ammo_556x45mmNATO_AP
  • +
  • Ammo_556x45mmNATO_HP
  • +
    +
    + + + + + AmmoSet_762x39mmSoviet + + +
  • Ammo_762x39mmSoviet_FMJ
  • +
  • Ammo_762x39mmSoviet_AP
  • +
  • Ammo_762x39mmSoviet_HP
  • +
    +
    + + + + + AmmoSet_303British + + +
  • Ammo_303British_FMJ
  • +
  • Ammo_303British_AP
  • +
  • Ammo_303British_HP
  • +
    +
    + + + + + AmmoSet_762x51mmNATO + + +
  • Ammo_762x51mmNATO_FMJ
  • +
  • Ammo_762x51mmNATO_AP
  • +
  • Ammo_762x51mmNATO_HP
  • +
    +
    + + + + + AmmoSet_762x54mmR + + +
  • Ammo_762x54mmR_FMJ
  • +
  • Ammo_762x54mmR_AP
  • +
  • Ammo_762x54mmR_HP
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Rockets.xml b/Defs/AmmoSetDefs/AmmoSets_Rockets.xml new file mode 100644 index 0000000..aa250df --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Rockets.xml @@ -0,0 +1,15 @@ + + + + + + + AmmoSet_RPG7Grenade + + +
  • Ammo_RPG7Grenade_HEAT
  • +
  • Ammo_RPG7Grenade_Thermobaric
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/AmmoSetDefs/AmmoSets_Shotgun.xml b/Defs/AmmoSetDefs/AmmoSets_Shotgun.xml new file mode 100644 index 0000000..c57494f --- /dev/null +++ b/Defs/AmmoSetDefs/AmmoSets_Shotgun.xml @@ -0,0 +1,18 @@ + + + + + + + AmmoSet_12Gauge + + +
  • Ammo_12Gauge_Buck
  • +
  • Ammo_12Gauge_Bird
  • +
  • Ammo_12Gauge_Slug
  • +
  • Ammo_12Gauge_Beanbag
  • +
  • Ammo_12Gauge_ElectroSlug
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/BodyDefs/Bodies_Mechanoid.xml b/Defs/BodyDefs/Bodies_Mechanoid.xml index 3c06544..c43a585 100644 --- a/Defs/BodyDefs/Bodies_Mechanoid.xml +++ b/Defs/BodyDefs/Bodies_Mechanoid.xml @@ -13,13 +13,6 @@
  • CoveredByNaturalArmor
  • -
  • - MechanicalMeleeCombatModule - 0.04 - -
  • HeadAttackTool
  • - -
  • MechanicalPrimaryCapacitor 0.0875 @@ -30,6 +23,7 @@ 0.08 Top +
  • HeadAttackTool
  • CoveredByNaturalArmor
  • diff --git a/Defs/BodyPartDefs/BodyParts_Humanoid.xml.del b/Defs/BodyPartDefs/BodyParts_Humanoid.xml.del deleted file mode 100644 index 87786ad..0000000 --- a/Defs/BodyPartDefs/BodyParts_Humanoid.xml.del +++ /dev/null @@ -1,27 +0,0 @@ - - - - - Torso - - 60 - 0.08 - true - true - - - - - - Pelvis - - 35 - 0 - false - true - -
  • Moving_pelvis
  • -
    -
    - -
    \ No newline at end of file diff --git a/Defs/DamageDefs/Damages_LocalInjury.xml b/Defs/DamageDefs/Damages_LocalInjury.xml index d2ac84b..8997a99 100644 --- a/Defs/DamageDefs/Damages_LocalInjury.xml +++ b/Defs/DamageDefs/Damages_LocalInjury.xml @@ -1,7 +1,7 @@  - + Combat_Realism.DamageWorker_AddInjuryCR @@ -16,6 +16,7 @@ true Slice Sharp + true @@ -29,9 +30,10 @@ true Blunt Blunt + true - + Blunt true @@ -44,6 +46,21 @@ true Blunt Blunt + true + + + + Beanbag + + {0} has been shot to death. + +
  • + MuscleSpasms + 0.035 +
  • +
    + Blunt + true
    @@ -57,9 +74,10 @@ true Slice Sharp + true - + Bullet true @@ -69,6 +87,16 @@ true Bullet Sharp + true + + + + Fragment + + {0} has been shredded to death. + Shredded + Crack + true @@ -82,6 +110,7 @@ true Bullet Sharp + true @@ -95,6 +124,8 @@ true Slice Sharp + true + true @@ -108,6 +139,7 @@ true Slice Sharp + true @@ -119,16 +151,18 @@ 0.001 + true + true - + Bomb true true true {0} has died in an explosion. - Shredded + Blast Crack true Blunt @@ -141,19 +175,69 @@ Mote_BlastDry Explosion_Bomb + + + Bomb_Secondary + false + false + true + - - Fragment - + + Flame + Combat_Realism.DamageWorker_FlameCR + + false + false + 1.5 + false true - true - {0} has been shredded to death. - Shredded - Crack + {0} has burned to death. + Burn + Heat + true + 10 + 15 + Mote_BlastFlame + Explosion_Flame + + + + Flame_Secondary + false + false + true + + + + Frostbite + + false + false + {0} has succumbed to frostbite. + Frostbite true - Bullet - Sharp + Heat + + + + Electrical + + false + false + 1.5 + true + {0} has been electrocuted. + ElectricalBurn + Electric + Electric true + 10 + 10 + Mote_BlastEMP + Mote_ElectricalSpark + Explosion_EMP + true
    \ No newline at end of file diff --git a/Defs/DamageDefs/Damages_Misc.xml b/Defs/DamageDefs/Damages_Misc.xml new file mode 100644 index 0000000..d952826 --- /dev/null +++ b/Defs/DamageDefs/Damages_Misc.xml @@ -0,0 +1,23 @@ + + + + + + + false + false + + + + Stun + + true + {0} has been stunned to death. + Electric + 35 + 0 + Mote_BlastEMP + MortarEMP_Explode + + + \ No newline at end of file diff --git a/Defs/FactionDefs/Factions.xml b/Defs/FactionDefs/Factions.xml index 50eb0a7..7e79f0e 100644 --- a/Defs/FactionDefs/Factions.xml +++ b/Defs/FactionDefs/Factions.xml @@ -1,6 +1,99 @@  + + + Outlander + + A small community of survivors.\n\nThese people have lived here for decades or centuries, and have lost most of the technology that brought them to this world. They usually work with simple mechanical tools and defend themselves with advanced gunpowder weapons.\n\nThey are concerned with the practical matters of trade, trust, and survival. + outlanders + 1 + true + 100 + true + true + Mayor + + -40 + 40 + + NamerFactionOutlander + Midworld + Civil + +
  • Rural
  • +
    + + -60 + 0 + + +
  • Caravan_Outlander_BulkGoods
  • +
  • Caravan_Outlander_CombatSupplier
  • +
  • Caravan_Outlander_Exotic
  • +
  • Caravan_Outlander_PirateMerchant
  • +
    + + +
  • + +
  • + 50 + Villager +
  • +
  • + 250 + TownGuard +
  • +
  • + 250 + TownCouncilman +
  • +
  • + 100 + MercenaryGunner +
  • +
  • + 100 + MercenarySlasher +
  • + + +
  • + +
  • + 1 + TownTrader +
  • + + +
  • + 1 + PackMuffalo +
  • +
    + +
  • + 250 + TownGuard +
  • +
  • + 100 + MercenaryGunner +
  • +
  • + 100 + MercenarySlasher +
  • +
    + +
    + World/FactionHomes/DefaultHome + (150,150,255) +
    + Pirate @@ -30,7 +123,7 @@ -80 -
  • +
  • 100
  • @@ -41,14 +134,6 @@ 70 Thrasher
  • -
  • - 100 - GrenadierDestructive -
  • -
  • - 50 - GrenadierEMP -
  • 100 Scavenger @@ -87,7 +172,7 @@
  • -
  • +
  • 50
  • Siege
  • @@ -121,7 +206,7 @@ true false Ultra - 90 + 45 -100 -100 @@ -132,7 +217,7 @@ -100 -
  • +
  • 75 diff --git a/Defs/HediffDefs/Hediffs_GlobalMisc.xml b/Defs/HediffDefs/Hediffs_GlobalMisc.xml index 8cf2321..1292775 100644 --- a/Defs/HediffDefs/Hediffs_GlobalMisc.xml +++ b/Defs/HediffDefs/Hediffs_GlobalMisc.xml @@ -3,7 +3,6 @@ - Hediff_Staged BloodLoss 1 @@ -17,7 +16,7 @@
  • Consciousness - -0.2 + -0.25
  • @@ -27,7 +26,7 @@
  • Consciousness - -0.4 + -0.5
  • @@ -37,7 +36,7 @@
  • Consciousness - 0.3 + 0.25
  • @@ -56,5 +55,71 @@ - + + MuscleSpasms + + +
  • + +
  • +
  • + 0.2 + + +
  • + Moving + -0.25 +
  • +
  • + Manipulation + -0.25 +
  • + + +
  • + 0.40 + + +
  • + Moving + -0.5 +
  • +
  • + Manipulation + -0.5 +
  • + + +
  • + 0.6 + + +
  • + Moving + 0.1 +
  • +
  • + Manipulation + 0.1 +
  • + + +
  • + 0.8 + + true + +
  • + Moving + 0.0 +
  • +
  • + Manipulation + 0.0 +
  • + + +
    +
    + \ No newline at end of file diff --git a/Defs/HediffDefs/Hediffs_Injuries.xml b/Defs/HediffDefs/Hediffs_Injuries.xml index 93d1a5e..0312dbe 100644 --- a/Defs/HediffDefs/Hediffs_Injuries.xml +++ b/Defs/HediffDefs/Hediffs_Injuries.xml @@ -13,21 +13,19 @@ Burn true - 0.028125 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.20 + 0.40
  • HediffComp_GetsOld @@ -35,6 +33,37 @@
  • + 0.028125 + 0.00625 + 0 + true + Burned off + Burned out + + + + + ElectricalBurn + + true + +
  • + HediffComp_Tendable + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set +
  • +
  • + HediffComp_GetsOld + burn scar +
  • +
    + + 0.028125 + 0.00625 0 true Burned off @@ -46,21 +75,19 @@ Crush true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.10 + 0.20
  • HediffComp_GetsOld @@ -68,7 +95,9 @@
  • - 0.4 + 0.01875 + 0.00625 + 0.8 true Crushed @@ -78,20 +107,20 @@ Crack true - 0.015 - 0.00625
  • HediffComp_Tendable - healed - poorly healed - healed - poorly healed - set - poorly set + healed + poorly healed + healed + poorly healed + set + poorly set
  • + 0.02 + 0.00625 0 Shattered @@ -101,21 +130,19 @@ Cut true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.20 + 0.40
  • HediffComp_GetsOld @@ -123,32 +150,60 @@
  • - 1 + 0.01875 + 0.00625 + 2 false Cut off Cut out
    + + SurgicalCut + + true + +
  • + HediffComp_Tendable + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set +
  • +
  • + HediffComp_GetsOld + cut scar +
  • +
    + + 0.01875 + 0.00625 + 2 + false + true + +
    + Scratch true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.20 + 0.40
  • HediffComp_GetsOld @@ -156,7 +211,9 @@
  • - 0.4 + 0.01875 + 0.00625 + 0.8 false Torn off Torn out @@ -167,21 +224,19 @@ Bite true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.525 + 0.7
  • HediffComp_GetsOld @@ -189,7 +244,9 @@
  • - 0.4 + 0.01875 + 0.00625 + 0.8 false Bitten off Bitten out @@ -200,21 +257,19 @@ Stab true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.30 + 0.45
  • HediffComp_GetsOld @@ -222,7 +277,9 @@
  • - 1.2 + 0.01875 + 0.00625 + 2.8 false Cut off Cut out @@ -233,31 +290,32 @@ Gunshot true - 0.025 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.30 + 0.45
  • HediffComp_GetsOld old gunshot + permanent gunshot injury
  • - 1.38 + 0.025 + 0.00625 + 2.8 false - true + true Shot off Shot out @@ -267,21 +325,19 @@ Shredded true - 0.01875 - 0.00625
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.30 + 0.45
  • HediffComp_GetsOld @@ -289,45 +345,71 @@
  • - 1 + 0.03 + 0.00625 + 3.2 true Torn off Torn out
    - - - - - Hediff_MissingPart - MissingBodyPart - - 0.025 - 0.00625 - (0.5, 0.5, 0.5, 1) + + + Blast + + true
  • HediffComp_Tendable - bandaged - poorly bandaged - sutured - poorly sutured - set - poorly set + bandaged + poorly bandaged + sutured + poorly sutured + set + poorly set
  • HediffComp_Infecter - 0.45 + 0.60
  • HediffComp_GetsOld - missing body part + scar
  • - 3 + 0.03 + 0.00625 + 2 + true + Torn off + Torn out
    + + + + + Hediff_MissingPart + MissingBodyPart + + false + (0.5, 0.5, 0.5, 1) + +
  • + HediffComp_Tendable +
  • +
  • + HediffComp_GetsOld +
  • +
    + + 0.04 + 0.00625 + 4 + true + +
    diff --git a/Defs/MainTabDefs/OutfitsAndLoadouts.xml b/Defs/MainTabDefs/OutfitsAndLoadouts.xml new file mode 100644 index 0000000..88bd3be --- /dev/null +++ b/Defs/MainTabDefs/OutfitsAndLoadouts.xml @@ -0,0 +1,13 @@ + + + + + Assign + + Configure what each colonist is allowed to wear, how they react to danger and what they carry into battle + Combat_Realism.MainTabWindow_OutfitsAndLoadouts + 30 + F3 + + + \ No newline at end of file diff --git a/Defs/ModHelperDefs/ModHelper.xml b/Defs/ModHelperDefs/ModHelper.xml index 87404ff..3a154bb 100644 --- a/Defs/ModHelperDefs/ModHelper.xml +++ b/Defs/ModHelperDefs/ModHelper.xml @@ -4,14 +4,16 @@ CombatRealism CombatRealism - 0.12.5 + 0.13.0 -
  • Combat_Realism.DetourInjector
  • +
  • Combat_Realism.Detours.DetourInjector
  • +
  • Combat_Realism.ITabInjector
  • +
  • Combat_Realism.AmmoInjector
  • - CommunityCoreLibrary.CompPawnGizmo + CommunityCoreLibrary.CompPawnGizmo
  • Human
  • @@ -19,14 +21,102 @@
  • - Combat_Realism.CompSuppressable + Combat_Realism.CompSuppressable
  • Human
  • +
  • + + Combat_Realism.CompInventory + + +
  • Human
  • +
  • Mechanoid_Centipede
  • +
  • Mechanoid_Scyther
  • + + +
  • + + CommunityCoreLibrary.CompMilkableRenameable + Chemical fullness + 5 + 5 + FSX + false + + +
  • Boomalope
  • + +
    - + +
  • + Orbital_Misc_PirateMerchant + +
  • + CR_Ammo + + 500 + 1000 + + + -1 + 4 + +
  • + + +
  • + Caravan_Outlander_PirateMerchant + +
  • + CR_Ammo + + 100 + 200 + + + -1 + 2 + +
  • + + +
  • + Orbital_Misc_CombatSupplier + +
  • + CR_Ammo + + 2000 + 5000 + + + 3 + 9 + +
  • + + +
  • + Caravan_Outlander_CombatSupplier + +
  • + CR_Ammo + + 500 + 2000 + + + 2 + 5 + +
  • + + +
    diff --git a/Defs/PawnKindDefs/PawnKinds_Mechanoid.xml b/Defs/PawnKindDefs/PawnKinds_Mechanoid.xml index 86d4484..d8a0166 100644 --- a/Defs/PawnKindDefs/PawnKinds_Mechanoid.xml +++ b/Defs/PawnKindDefs/PawnKinds_Mechanoid.xml @@ -14,7 +14,7 @@ Centipede Mechanoid_Centipede - 650 + 870 Mechanoid true @@ -36,6 +36,9 @@
  • MechanoidGunHeavy
  • + + 1 + @@ -65,6 +68,9 @@
  • MechanoidGunMedium
  • + + 1 + \ No newline at end of file diff --git a/Defs/PawnKindDefs/PawnKinds_Mercenary.xml b/Defs/PawnKindDefs/PawnKinds_Mercenary.xml index f7a9612..fea9c3d 100644 --- a/Defs/PawnKindDefs/PawnKinds_Mercenary.xml +++ b/Defs/PawnKindDefs/PawnKinds_Mercenary.xml @@ -6,11 +6,11 @@ MercenaryGunner Human - 90 + 80 Pirate 80 Raider - 1 + 3 Normal 0.25 58 @@ -28,8 +28,8 @@ 0.5 - 500 - 900 + 300 + 750
  • Gun
  • @@ -42,28 +42,159 @@
  • Advanced
  • 0.003 - - 0.8 - -
  • - Silver - - 50 - 200 - -
  • -
  • - Medicine - - 1 - 1 - -
  • -
    -
    + + 1 + 1 + + + + + + MercenarySniper + + Human + 90 + Pirate + 70 + Raider + 3 + Normal + 0.25 + 58 + + 0.7 + 2.3 + + +
  • Outlander
  • +
  • Military
  • +
    + + 1500 + 2500 + + 0.5 + + 1200 + 1800 + + +
  • SniperRifle
  • +
    + + 1000 + 1500 + + +
  • Advanced
  • +
    + 0.003 + + 1 + 1 + 1 + 1 + +
    + + + + + MercenarySlasher + + 135 + Human + Pirate + 80 + Raider + 3 + 0.25 + 50 + + 0.5 + 2.3 + + +
  • Outlander
  • +
  • Military
  • +
    + +
  • Apparel_PersonalShield
  • +
    + + 1000 + 2600 + + 0.75 + + 1200 + 2000 + + +
  • Melee
  • +
    + + 2000 + 3000 + + +
  • Advanced
  • +
    + 0.08 +
    + + + + + + MercenaryHeavy + + 185 + Human + +
  • GunHeavy
  • +
    + Pirate + 80 + Raider + 3 + 0.25 + 90 + + 0.5 + 1.4 + + +
  • Outlander
  • +
  • Military
  • +
    + + 200 + 350 + + 0.5 + + 1600 + 2000 + + + 2000 + 3000 + + +
  • Advanced
  • +
    + 0.08 + + 1 + 1 + 1 +
    + + Human Pirate @@ -98,39 +229,26 @@
  • Advanced
  • 0.08 - - 0.8 - -
  • - Silver - - 120 - 480 - -
  • -
  • - Medicine - - 1 - 2 - -
  • -
    -
    PirateBoss - 260 + 520 true
  • AdvancedGun
  • - - 1800 - 2000 - + + 5000 + 8400 + + + 1 + 1 + 1 + 1 +
    @@ -141,10 +259,12 @@
  • AdvancedGun
  • - - 1800 - 2000 - + + 1 + 1 + 1 + 1 + @@ -153,8 +273,12 @@ 220 -
  • MachineGun
  • +
  • CR_MachineGun
  • + + 1 + 1 + diff --git a/Defs/PawnKindDefs/PawnKinds_Outlander.xml b/Defs/PawnKindDefs/PawnKinds_Outlander.xml new file mode 100644 index 0000000..34b6982 --- /dev/null +++ b/Defs/PawnKindDefs/PawnKinds_Outlander.xml @@ -0,0 +1,110 @@ + + + + + Villager + + Human + 25 + 60 + Civil + Outlander + Poor + 0.1 + false + + 0.2 + 2.0 + + + 300 + 900 + + +
  • Outlander
  • +
    + 0.4 + + 0 + 250 + + +
  • Gun
  • +
  • Melee
  • +
    + + 200 + 300 + + +
  • Simple
  • +
    + 0.001 + 3 + + 1 + 1 + 1 + +
    + + + TownCouncilman + + true + 40 + 100 + + + + TownTrader + + true + + + + TownGuard + + Human + 50 + Outlander + 60 + Raider + 0.1 + 58 + + 0.5 + 1.8 + + + 300 + 900 + + +
  • Outlander
  • +
    + 0.4 + + 200 + 600 + + +
  • Gun
  • +
    + + 200 + 300 + + +
  • Simple
  • +
    + 0.001 + 3 + + 1 + 1 + 1 + +
    + +
    diff --git a/Defs/PawnKindDefs/PawnKinds_Pirate.xml b/Defs/PawnKindDefs/PawnKinds_Pirate.xml new file mode 100644 index 0000000..e7da265 --- /dev/null +++ b/Defs/PawnKindDefs/PawnKinds_Pirate.xml @@ -0,0 +1,193 @@ + + + + + + + Drifter + + Human + 25 + Pirate + 50 + Raider + 0.1 + + 0.2 + 0.6 + + Shoddy + + 90 + 280 + + +
  • Outlander
  • +
    + 0.2 + + 60 + 100 + + +
  • Gun
  • +
  • Melee
  • +
    + + 0 + 35 + + +
  • Poor
  • +
    + 0.1 + + 1 + +
    + + + + + + Scavenger + + Human + 38 + Pirate + 60 + Raider + + 0.2 + 0.9 + + 3 + Poor + 0.1 + + 300 + 500 + + +
  • Outlander
  • +
    + 0.3 + + 250 + 450 + + +
  • Gun
  • +
    + + 0 + 35 + + +
  • Poor
  • +
    + 0.1 + + 1 + +
    + + + + + Thrasher + + Human + 36 + Pirate + 60 + Raider + 3 + Poor + 0.2 + 48 + true + + 0.4 + 1.1 + + + 300 + 800 + + +
  • PersonalShield
  • +
  • Outlander
  • +
    + 0.8 + + 60 + 150 + + +
  • Melee
  • +
    + + 0 + 35 + + +
  • Poor
  • +
    + 0.1 +
    + + + + + + + + Pirate + + Human + 56 + Pirate + 70 + Raider + 3 + 0.2 + 50 + true + + 0.4 + 1.5 + + + 500 + 1100 + + +
  • Outlander
  • +
    + 0.7 + + 450 + 600 + + +
  • Gun
  • +
    + + 0 + 35 + + +
  • Poor
  • +
    + 0.1 + + 1 + 1 + +
    + + + + +
    \ No newline at end of file diff --git a/Defs/PawnKindDefs/PawnKinds_Spacer.xml b/Defs/PawnKindDefs/PawnKinds_Spacer.xml new file mode 100644 index 0000000..3d708aa --- /dev/null +++ b/Defs/PawnKindDefs/PawnKinds_Spacer.xml @@ -0,0 +1,49 @@ + + + + + SpaceSoldier + + Human + 100 + 30 + Civil + SpacerHostile + 1 + 58 + Good + + 0 + 4000 + + +
  • Spacer
  • +
    + true + 0.5 + + 300 + 900 + + +
  • Gun
  • +
    + + 1000 + 5000 + + +
  • Advanced
  • +
    + 0.3 + + 1 + 1 + 1 + 1 + +
    + + + +
    \ No newline at end of file diff --git a/Defs/PawnKindDefs/PawnKinds_Tribal.xml b/Defs/PawnKindDefs/PawnKinds_Tribal.xml new file mode 100644 index 0000000..77a4f7d --- /dev/null +++ b/Defs/PawnKindDefs/PawnKinds_Tribal.xml @@ -0,0 +1,132 @@ + + + + + TribalWarrior + + Human + 38 + Tribe + 90 + Tribal + 3 + 0.01 + 40 + + 0.5 + 1.8 + + + 180 + 350 + + +
  • Tribal
  • +
    + + 90 + 400 + + +
  • NeolithicMelee
  • +
    +
    + + + + + Human + 48 + Tribe + 90 + Tribal + 3 + 0.01 + 40 + + 0.5 + 1.8 + + + 180 + 350 + + +
  • Tribal
  • +
    + + 400 + 400 + +
    + + + + TribalArcher + +
  • CR_Bow
  • +
    + + 1 + 1 + +
    + + + + TribalArcherPila + +
  • CR_Pila
  • +
    + + 1 + 1 + +
    + + + + TribalChief + + Human + 70 + Tribe + 95 + Tribal + 3 + Superior + 0.01 + 35 + true + + 0.7 + 3.0 + + + 600 + 1600 + + +
  • Tribal
  • +
    + + 800 + 1000 + + +
  • NeolithicRanged
  • +
    + + 1 + 1 + 1 + +
    + + + TribalTrader + + true + + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs/Recipes_Production.xml b/Defs/RecipeDefs/Recipes_Production.xml new file mode 100644 index 0000000..c343838 --- /dev/null +++ b/Defs/RecipeDefs/Recipes_Production.xml @@ -0,0 +1,43 @@ + + + + + MakeComponent + + Make a component. + Making component. + SmithingSpeed + Cook + Recipe_Machining + 10000 + +
  • + + +
  • Steel
  • + + + 6 + +
    + + +
  • Steel
  • +
    +
    + + 1 + + +
  • + Crafting + 10 +
  • +
    + Crafting +
    + + + + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs/Recipes_Turret.xml b/Defs/RecipeDefs/Recipes_Turret.xml.disabled similarity index 97% rename from Defs/RecipeDefs/Recipes_Turret.xml rename to Defs/RecipeDefs/Recipes_Turret.xml.disabled index 6a5d2c2..da66e87 100644 --- a/Defs/RecipeDefs/Recipes_Turret.xml +++ b/Defs/RecipeDefs/Recipes_Turret.xml.disabled @@ -19,7 +19,7 @@
  • Steel
  • - 150 + 75 diff --git a/Defs/RecipeDefs_Ammo/Recipes_AmmoAdvanced.xml b/Defs/RecipeDefs_Ammo/Recipes_AmmoAdvanced.xml new file mode 100644 index 0000000..0a38896 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_AmmoAdvanced.xml @@ -0,0 +1,227 @@ + + + + + SmithingSpeed + Cook + Recipe_Machining + true + 2500 + 5 + Crafting + + + + + + + + + MakeAmmo_30x64mmFuel_Incendiary + + Craft 50 30x64mm incendiary fuel cells. + Making incendiary fuel cells. + +
  • + + +
  • Steel
  • + + + 9 + +
  • + + +
  • Prometheum
  • + + + 5 + +
    + + +
  • Steel
  • +
  • Prometheum
  • +
    +
    + + 50 + +
    + + + MakeAmmo_30x64mmFuel_Thermobaric + + Craft 50 30x64mm thermobaric fuel cells. + Making thermobaric fuel cells. + +
  • + + +
  • Steel
  • + + + 9 + +
  • + + +
  • FSX
  • + + + 5 + +
    + + +
  • Steel
  • +
  • FSX
  • +
    +
    + + 50 + +
    + + + MakeAmmo_30x64mmFuel_Foam + + Craft 50 30x64mm foam fuel cells. + Making foam fuel cells. + +
  • + + +
  • Steel
  • + + + 9 + +
  • + + +
  • MeatRaw
  • + + + 2 + +
    + + +
  • Steel
  • +
    + +
  • MeatRaw
  • +
    +
    + + 50 + +
    + + + + + MakeAmmo_6x24mmCharged + + Craft 500 6x24mm Charged cartridges. + Making 6x24mm Charged cartridges. + +
  • + + +
  • Plasteel
  • + + + 5 + +
  • + + +
  • Components
  • + + + 5 + +
    + + +
  • Plasteel
  • +
  • Components
  • +
    +
    + + 500 + +
    + + + MakeAmmo_6x24mmCharged_AP + + Craft 500 6x24mm Charged (Conc.) cartridges. + Making 6x24mm Charged (Conc.) cartridges. + +
  • + + +
  • Plasteel
  • + + + 5 + +
  • + + +
  • Components
  • + + + 5 + +
    + + +
  • Plasteel
  • +
  • Components
  • +
    +
    + + 500 + +
    + + + MakeAmmo_6x24mmCharged_Ion + + Craft 500 6x24mm Charged (Ion) cartridges. + Making 6x24mm Charged (Ion) cartridges. + +
  • + + +
  • Plasteel
  • + + + 5 + +
  • + + +
  • Components
  • + + + 5 + +
    + + +
  • Plasteel
  • +
  • Components
  • +
    +
    + + 500 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_AmmoHighCaliber.xml b/Defs/RecipeDefs_Ammo/Recipes_AmmoHighCaliber.xml new file mode 100644 index 0000000..2481d24 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_AmmoHighCaliber.xml @@ -0,0 +1,133 @@ + + + + + + + MakeAmmo_50BMG_FMJ + + Craft 100 .50 BMG (FMJ) cartridges. + Making .50 BMG (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 17 + +
    + + +
  • Steel
  • +
    +
    + + 100 + +
    + + + MakeAmmo_50BMG_AP + + Craft 100 .50 BMG (Sabot) cartridges. + Making .50 BMG (Sabot) cartridges. + +
  • + + +
  • Steel
  • + + + 12 + +
  • + + +
  • Uranium
  • + + + 2 + +
    + + +
  • Steel
  • +
  • Uranium
  • +
    +
    + + 100 + +
    + + + MakeAmmo_50BMG_HE + + Craft 100 .50 BMG (HE) cartridges. + Making .50 BMG (HE) cartridges. + +
  • + + +
  • Steel
  • + + + 12 + +
  • + + +
  • FSX
  • + + + 2 + +
    + + +
  • Steel
  • +
  • FSX
  • +
    +
    + + 100 + +
    + + + MakeAmmo_50BMG_Incendiary + + Craft 100 .50 BMG (AP-I) cartridges. + Making .50 BMG (AP-I) cartridges. + +
  • + + +
  • Steel
  • + + + 14 + +
  • + + +
  • Prometheum
  • + + + 2 + +
    + + +
  • Steel
  • +
  • Prometheum
  • +
    +
    + + 100 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_AmmoPistols.xml b/Defs/RecipeDefs_Ammo/Recipes_AmmoPistols.xml new file mode 100644 index 0000000..c903865 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_AmmoPistols.xml @@ -0,0 +1,366 @@ + + + + + + + MakeAmmo_40Rimfire + + Craft 500 .40 Rimfire cartridges. + Making .40 Rimfire cartridges. + +
  • + + +
  • Steel
  • + + + 4 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_32ACP_FMJ + + Craft 500 .32 ACP cartridges. + Making .32 ACP cartridges. + +
  • + + +
  • Steel
  • + + + 5 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_762x25mmTokarev_FMJ + + Craft 500 7.62x25mm Tokarev (FMJ) cartridges. + Making 7.62x25mm Tokarev (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 5 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x25mmTokarev_AP + + Craft 500 7.62x25mm Tokarev (AP) cartridges. + Making 7.62x25mm Tokarev (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 6 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x25mmTokarev_HP + + Craft 500 7.62x25mm Tokarev (HP) cartridges. + Making 7.62x25mm Tokarev (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 6 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_9x19mmPara_FMJ + + Craft 500 9x19mm Parabellum (FMJ) cartridges. + Making 9x19mm Parabellum (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 9 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_9x19mmPara_AP + + Craft 500 9x19mm Parabellum (AP) cartridges. + Making 9x19mm Parabellum (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 11 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_9x19mmPara_HP + + Craft 500 9x19mm Parabellum (HP) cartridges. + Making 9x19mm Parabellum (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 11 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_45ACP_FMJ + + Craft 500 .45 ACP (FMJ) cartridges. + Making .45 ACP (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 10 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_45ACP_AP + + Craft 500 .45 ACP (AP) cartridges. + Making .45 ACP (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 14 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_45ACP_HP + + Craft 500 .45 ACP (HP) cartridges. + Making .45 ACP (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 14 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_45Colt_FMJ + + Craft 500 .45 Colt (FMJ) cartridges. + Making .45 Colt (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 10 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_45Colt_AP + + Craft 500 .45 Colt (AP) cartridges. + Making .45 Colt (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 14 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_45Colt_HP + + Craft 500 .45 Colt (HP) cartridges. + Making .45 Colt (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 14 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_AmmoRifles.xml b/Defs/RecipeDefs_Ammo/Recipes_AmmoRifles.xml new file mode 100644 index 0000000..e94cc6a --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_AmmoRifles.xml @@ -0,0 +1,389 @@ + + + + + + + MakeAmmo_556x45mmNATO_FMJ + + Craft 500 5.56x45mm NATO (FMJ) cartridges. + Making 5.56x45mm NATO (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 9 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_556x45mmNATO_AP + + Craft 500 5.56x45mm NATO (AP) cartridges. + Making 5.56x45mm NATO (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 11 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_556x45mmNATO_HP + + Craft 500 5.56x45mm NATO (HP) cartridges. + Making 5.56x45mm NATO (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 11 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_762x39mmSoviet_FMJ + + Craft 500 7.62x39mm Soviet (FMJ) cartridges. + Making 7.62x39mm Soviet (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 12 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x39mmSoviet_AP + + Craft 500 7.62x39mm Soviet (AP) cartridges. + Making 7.62x39mm Soviet (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 15 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x39mmSoviet_HP + + Craft 500 7.62x39mm Soviet (HP) cartridges. + Making 7.62x39mm Soviet (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 15 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_303British_FMJ + + Craft 500 .303 British (FMJ) cartridges. + Making .303 British (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 17 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_303British_AP + + Craft 500 .303 British (AP) cartridges. + Making .303 British (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 21 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_303British_HP + + Craft 500 .303 British (HP) cartridges. + Making .303 British (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 21 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_762x51mmNATO_FMJ + + Craft 500 7.62x51mm NATO (FMJ) cartridges. + Making 7.62x51mm NATO (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 19 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x51mmNATO_AP + + Craft 500 7.62x51mm NATO (AP) cartridges. + Making 7.62x51mm NATO (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 24 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x51mmNATO_HP + + Craft 500 7.62x51mm NATO (HP) cartridges. + Making 7.62x51mm NATO (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 24 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + + + MakeAmmo_762x54mmR_FMJ + + Craft 500 7.62x54mmR (FMJ) cartridges. + Making 7.62x54mmR (FMJ) cartridges. + +
  • + + +
  • Steel
  • + + + 17 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x54mmR_AP + + Craft 500 7.62x54mmR (AP) cartridges. + Making 7.62x54mmR (AP) cartridges. + +
  • + + +
  • Steel
  • + + + 21 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + + + MakeAmmo_762x54mmR_HP + + Craft 500 7.62x54mmR (HP) cartridges. + Making 7.62x54mmR (HP) cartridges. + +
  • + + +
  • Steel
  • + + + 21 + +
    + + +
  • Steel
  • +
    +
    + + 500 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_AmmoShotgun.xml b/Defs/RecipeDefs_Ammo/Recipes_AmmoShotgun.xml new file mode 100644 index 0000000..8d090d0 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_AmmoShotgun.xml @@ -0,0 +1,176 @@ + + + + + + + MakeAmmo_410Bore_Buck + + Craft 100 .410 Bore (Buck) shells. + Making .410 Bore (Buck) shells. + +
  • + + +
  • Steel
  • + + + 6 + +
    + + +
  • Steel
  • +
    +
    + + 100 + +
    + + + + + MakeAmmo_12Gauge_Buck + + Craft 100 12 gauge (Buck) shells. + Making 12 gauge (Buck) shells. + +
  • + + +
  • Steel
  • + + + 8 + +
    + + +
  • Steel
  • +
    +
    + + 100 + +
    + + + MakeAmmo_12Gauge_Bird + + Craft 100 12 gauge (Bird) shells. + Making 12 gauge (Bird) shells. + +
  • + + +
  • Steel
  • + + + 8 + +
    + + +
  • Steel
  • +
    +
    + + 100 + +
    + + + MakeAmmo_12Gauge_Slug + + Craft 100 12 gauge (Slug) shells. + Making 12 gauge (Slug) shells. + +
  • + + +
  • Steel
  • + + + 10 + +
    + + +
  • Steel
  • +
    +
    + + 100 + +
    + + + MakeAmmo_12Gauge_Beanbag + + Craft 100 12 gauge (Beanbag) shells. + Making 12 gauge (Beanbag) shells. + +
  • + + +
  • Steel
  • + + + 5 + +
  • + + +
  • Cloth
  • + + + 3 + +
    + + +
  • Steel
  • +
  • Cloth
  • +
    +
    + + 100 + +
    + + + MakeAmmo_12Gauge_ElectroSlug + + Craft 100 12 gauge (EMP) shells. + Making 12 gauge (EMP) shells. + +
  • + + +
  • Steel
  • + + + 50 + +
  • + + +
  • Components
  • + + + 2 + +
    + + +
  • Steel
  • +
  • Components
  • +
    +
    + + 100 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_Grenades.xml b/Defs/RecipeDefs_Ammo/Recipes_Grenades.xml new file mode 100644 index 0000000..d999df7 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_Grenades.xml @@ -0,0 +1,162 @@ + + + + + + + MakeAmmo_30x29mmGrenade_HE + + Craft 10 30x29mm HE grenades. + Making 30x29mm HE grenades. + +
  • + + +
  • Steel
  • + + + 18 + +
  • + + +
  • FSX
  • + + + 4 + +
  • + + +
  • Components
  • + + + 1 + +
    + + +
  • Steel
  • +
  • FSX
  • +
  • Components
  • +
    +
    + + 10 + +
    + + + MakeAmmo_30x29mmGrenade_EMP + + Craft 10 30x29mm EMP grenades. + Making 30x29mm EMP grenades. + +
  • + + +
  • Steel
  • + + + 18 + +
  • + + +
  • Components
  • + + + 6 + +
    + + +
  • Steel
  • +
  • Components
  • +
    +
    + + 10 + +
    + + + + + MakeAmmo_40x46mmGrenade_HE + + Craft 10 40x46mm HE grenades. + Making 40x46mm HE grenades. + +
  • + + +
  • Steel
  • + + + 26 + +
  • + + +
  • FSX
  • + + + 6 + +
  • + + +
  • Components
  • + + + 1 + +
    + + +
  • Steel
  • +
  • FSX
  • +
  • Components
  • +
    +
    + + 10 + +
    + + + MakeAmmo_40x46mmGrenade_EMP + + Craft 10 40x46mm EMP grenades. + Making 40x46mm EMP grenades. + +
  • + + +
  • Steel
  • + + + 26 + +
  • + + +
  • Components
  • + + + 8 + +
    + + +
  • Steel
  • +
  • Components
  • +
    +
    + + 10 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_HandGrenades.xml b/Defs/RecipeDefs_Ammo/Recipes_HandGrenades.xml new file mode 100644 index 0000000..3107a06 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_HandGrenades.xml @@ -0,0 +1,164 @@ + + + + + +
  • TableMachining
  • +
    +
    + + + MakeFragGrenade + + Craft 10 frag grenades. + Making frag grenades. + +
  • + + +
  • Steel
  • + + + 10 + +
  • + + +
  • FSX
  • + + + 1 + +
  • + + +
  • Components
  • + + + 1 + +
    + + +
  • Steel
  • +
  • FSX
  • +
  • Components
  • +
    +
    + + 10 + +
    + + + MakeMolotovCocktail + + Craft 10 molotov cocktails. + Making frag grenades. + +
  • + + +
  • Cloth
  • + + + 10 + +
  • + + +
  • Prometheum
  • + + + 2 + +
    + + +
  • Steel
  • +
  • Prometheum
  • +
    +
    + + 10 + +
    + + + MakeEMPGrenade + + Craft 10 EMP grenades. + Making EMP grenades. + +
  • + + +
  • Steel
  • + + + 10 + +
  • + + +
  • Components
  • + + + 3 + +
    + + +
  • Steel
  • +
  • Components
  • +
    +
    + + 10 + +
    + + + MakeFlashbangGrenade + + Craft 10 flashbang grenades. + Making flashbang grenades. + +
  • + + +
  • Steel
  • + + + 10 + +
  • + + +
  • Prometheum
  • + + + 1 + +
  • + + +
  • Components
  • + + + 1 + +
    + + +
  • Steel
  • +
  • Prometheum
  • +
  • Components
  • +
    +
    + + 10 + +
    + +
    \ No newline at end of file diff --git a/Defs/RecipeDefs_Ammo/Recipes_Rockets.xml b/Defs/RecipeDefs_Ammo/Recipes_Rockets.xml new file mode 100644 index 0000000..788d3f9 --- /dev/null +++ b/Defs/RecipeDefs_Ammo/Recipes_Rockets.xml @@ -0,0 +1,140 @@ + + + + + + + MakeAmmo_RPG7Grenade_HEAT + + Craft 5 RPG-7 HEAT grenades. + Making RPG-7 HEAT grenades. + 7500 + +
  • + + +
  • Steel
  • + + + 10 + +
  • + + +
  • FSX
  • + + + 2 + +
  • + + +
  • Components
  • + + + 2 + +
    + + +
  • Steel
  • +
  • FSX
  • +
  • Components
  • +
    +
    + + 5 + +
    + + + MakeAmmo_RPG7Grenade_Thermobaric + + Craft 5 RPG-7 thermobaric grenades. + Making RPG-7 thermobaric grenades. + 7500 + +
  • + + +
  • Steel
  • + + + 10 + +
  • + + +
  • FSX
  • + + + 7 + +
  • + + +
  • Components
  • + + + 2 + +
    + + +
  • Steel
  • +
  • FSX
  • +
  • Components
  • +
    +
    + + 5 + +
    + + + +
    \ No newline at end of file diff --git a/Defs/ResearchProjectDefs/ResearchProjects_Tier2_Misc.xml b/Defs/ResearchProjectDefs/ResearchProjects_Tier2_Misc.xml new file mode 100644 index 0000000..c8859a2 --- /dev/null +++ b/Defs/ResearchProjectDefs/ResearchProjects_Tier2_Misc.xml @@ -0,0 +1,18 @@ + + + + + LargeRockets + + Allows you to build doomsday rocket launchers and triple rocket launchers, one-shot assault weapons that pack a massive punch. + 2200 + +
  • MicroelectronicsBasics
  • +
    + HiTechResearchBench + +
  • MultiAnalyzer
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Apparel.xml b/Defs/StatDefs/Stats_Apparel.xml new file mode 100644 index 0000000..2f5610e --- /dev/null +++ b/Defs/StatDefs/Stats_Apparel.xml @@ -0,0 +1,80 @@ + + + + + WornWeight + + The effective weight of clothing when worn. + Apparel + 0 + 0 + 0 + + + + WornBulk + + How bulky this apparel is to wear. + Apparel + 0 + 0 + 0 + + + + Apparel + 0 + 0 + 0 + PercentOne + +
  • + 0.7 + 0.8 + 0.9 + 1 + 1.06 + 1.12 + 1.18 + 1.24 + 1.3 +
  • +
  • + + +
  • (0,0.25)
  • +
  • (0.70,1)
  • + + + +
    +
    + + + + ArmorRating_Blunt + + Armor against blunt damage like club attacks, rock falls, and explosions. + + + + ArmorRating_Sharp + + Armor against sharp damage like bullets, knife stabs, and animal bites. + + + + ArmorRating_Heat + + Armor against temperature-related damage like burns. + + + + ArmorRating_Electric + + Armor against electric damage like EMP pulses. + + + + +
    \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Basics_Inventory.xml b/Defs/StatDefs/Stats_Basics_Inventory.xml new file mode 100644 index 0000000..89a8603 --- /dev/null +++ b/Defs/StatDefs/Stats_Basics_Inventory.xml @@ -0,0 +1,27 @@ + + + + + Weight + + The weight of an object when carried in a bag or pocket. + BasicsNonPawn + 1 + 0.001 + FloatTwo + {0} kg + 10 + + + + Bulk + + The amount of inventory space an item takes up when carried in bag or pocket. + BasicsNonPawn + 1 + 0.001 + FloatTwo + 10 + + + \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Pawns_Combat.xml b/Defs/StatDefs/Stats_Pawns_Combat.xml index 4e9e0c0..5497f8c 100644 --- a/Defs/StatDefs/Stats_Pawns_Combat.xml +++ b/Defs/StatDefs/Stats_Pawns_Combat.xml @@ -104,5 +104,28 @@ + + + ReloadSpeed + + The speed at which firearms are reloaded. + PawnCombat + 60 + 1 + 0.001 + PercentZero + false + false + +
  • + Consciousness + 1 +
  • +
  • + Manipulation + 1 +
  • +
    +
    \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Pawns_General.xml b/Defs/StatDefs/Stats_Pawns_General.xml new file mode 100644 index 0000000..807bb28 --- /dev/null +++ b/Defs/StatDefs/Stats_Pawns_General.xml @@ -0,0 +1,27 @@ + + + + + MoveSpeed + + Speed of movement through the world in cells per second. + Combat_Realism.StatWorker_MoveSpeed + BasicsPawn + 2.8 + FloatTwo + {0} c/s + 90 + +
  • + Consciousness + 1 +
  • +
  • + Moving + 1 +
  • +
    +
    + + +
    \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Pawns_Inventory.xml b/Defs/StatDefs/Stats_Pawns_Inventory.xml new file mode 100644 index 0000000..51ebf15 --- /dev/null +++ b/Defs/StatDefs/Stats_Pawns_Inventory.xml @@ -0,0 +1,38 @@ + + + + + CarryWeight + + The amount of weight this creature can carry in pockets, bags or otherwise attached to its body. + BasicsPawn + 40 + {0} kg + +
  • + + +
  • + Moving + 1 +
  • + + 10 + false +
    + + + CarryBulk + + The volume of items this creature can carry in pockets, bags or otherwise attached to its body. + BasicsPawn + 20 + 10 + false + +
  • + + + + + \ No newline at end of file diff --git a/Defs/StatDefs/Stats_Pawns_WorkGeneral.xml b/Defs/StatDefs/Stats_Pawns_WorkGeneral.xml new file mode 100644 index 0000000..b82fc14 --- /dev/null +++ b/Defs/StatDefs/Stats_Pawns_WorkGeneral.xml @@ -0,0 +1,29 @@ + + + + + + WorkSpeedGlobal + + A multiplier on someone's speed at doing any work. + Combat_Realism.StatWorker_WorkSpeedGlobal + PawnWork + 100 + 1 + PercentZero + +
  • + + +
  • (0,0.75)
  • +
  • (0.45,1.00)
  • +
  • (0.55,1.00)
  • +
  • (1.00,1.25)
  • + + + +
    +
    + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories.xml b/Defs/ThingCategoryDefs/ThingCategories.xml index cb6d562..70940d6 100644 --- a/Defs/ThingCategoryDefs/ThingCategories.xml +++ b/Defs/ThingCategoryDefs/ThingCategories.xml @@ -7,4 +7,10 @@ Weapons + + Ammo + + Weapons + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Advanced.xml b/Defs/ThingCategoryDefs/ThingCategories_Advanced.xml new file mode 100644 index 0000000..bdb9b24 --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Advanced.xml @@ -0,0 +1,40 @@ + + + + + AmmoAdvanced + + Ammo + + + + Ammo30x64mmFuelCell + + AmmoAdvanced + + + + Ammo80x128mmFuelCell + + AmmoAdvanced + + + + Ammo6x24mmCharged + + AmmoAdvanced + + + + Ammo5x35mmCharged + + AmmoAdvanced + + + + Ammo12x64mmCharged + + AmmoAdvanced + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Grenades.xml b/Defs/ThingCategoryDefs/ThingCategories_Grenades.xml new file mode 100644 index 0000000..446b92a --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Grenades.xml @@ -0,0 +1,22 @@ + + + + + AmmoGrenades + + Ammo + + + + Ammo30x29mmGrenades + + AmmoGrenades + + + + Ammo40x46mmGrenades + + AmmoGrenades + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_HighCaliber.xml b/Defs/ThingCategoryDefs/ThingCategories_HighCaliber.xml new file mode 100644 index 0000000..68076ec --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_HighCaliber.xml @@ -0,0 +1,16 @@ + + + + + AmmoHighCaliber + + Ammo + + + + Ammo50BMG + + AmmoHighCaliber + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Neolithic.xml b/Defs/ThingCategoryDefs/ThingCategories_Neolithic.xml new file mode 100644 index 0000000..e9b7f49 --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Neolithic.xml @@ -0,0 +1,22 @@ + + + + + AmmoNeolithic + + Ammo + + + + AmmoArrows + + AmmoNeolithic + + + + AmmoGreatArrows + + AmmoNeolithic + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Pistols.xml b/Defs/ThingCategoryDefs/ThingCategories_Pistols.xml new file mode 100644 index 0000000..33987a9 --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Pistols.xml @@ -0,0 +1,46 @@ + + + + + AmmoPistols + + Ammo + + + + Ammo40Rimfire + + AmmoPistols + + + + Ammo32ACP + + AmmoPistols + + + + Ammo762x25mmTokarev + + AmmoPistols + + + + Ammo9x19mmPara + + AmmoPistols + + + + Ammo45ACP + + AmmoPistols + + + + Ammo45Colt + + AmmoPistols + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Rifles.xml b/Defs/ThingCategoryDefs/ThingCategories_Rifles.xml new file mode 100644 index 0000000..b7339b0 --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Rifles.xml @@ -0,0 +1,40 @@ + + + + + AmmoRifles + + Ammo + + + + Ammo556x45mmNATO + + AmmoRifles + + + + Ammo762x39mmSoviet + + AmmoRifles + + + + Ammo303British + + AmmoRifles + + + + Ammo762x51mmNATO + + AmmoRifles + + + + Ammo762x54mmR + + AmmoRifles + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Rockets.xml b/Defs/ThingCategoryDefs/ThingCategories_Rockets.xml new file mode 100644 index 0000000..9a5d76b --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Rockets.xml @@ -0,0 +1,16 @@ + + + + + AmmoRockets + + Ammo + + + + AmmoRPG7Grenades + + AmmoRockets + + + \ No newline at end of file diff --git a/Defs/ThingCategoryDefs/ThingCategories_Shotgun.xml b/Defs/ThingCategoryDefs/ThingCategories_Shotgun.xml new file mode 100644 index 0000000..8f97f11 --- /dev/null +++ b/Defs/ThingCategoryDefs/ThingCategories_Shotgun.xml @@ -0,0 +1,22 @@ + + + + + AmmoShotguns + + Ammo + + + + Ammo410Bore + + AmmoShotguns + + + + Ammo12Gauge + + AmmoShotguns + + + \ No newline at end of file diff --git a/Defs/ThingDefs/Apparel_Carrying.xml b/Defs/ThingDefs/Apparel_Carrying.xml new file mode 100644 index 0000000..a939cb9 --- /dev/null +++ b/Defs/ThingDefs/Apparel_Carrying.xml @@ -0,0 +1,155 @@ + + + + + Apparel + Item + True + 10 + True + + 35 + + true + + 100 + 1.0 + 2 + 0.5 + + Item + True + Never + +
  • + + + + TailoringSpeed + Crafting + Tailor + Recipe_Tailor + +
  • ElectricTailoringBench
  • +
  • HandTailoringBench
  • + + UnfinishedApparel + +
    + + + + + + Apparel_TacVest + + Combat_Realism.Apparel_TacVest + A loadbearing vest with a number of pouches to store magazines and other equipment.\n\nSpeeds up reloading but is quite bulky to wear. + + Things/Apparel/TacRigging/TacRigging + Graphic_Single + + + 120 + 125 + 8000 + 2 + 10 + 2 + 8 + + + 30 + 0.1 + + + 1 + 60 + + + +
  • Shoulders
  • +
    + +
  • Accessory
  • +
    + 1 + +
  • Outlander
  • +
  • Military
  • +
    + +
  • Soldier
  • +
    + +
    + + + + Apparel_Backpack + + Combat_Realism.Apparel_Backpack + A comfortable and spacious backpack for storing all kinds of items. + + Things/Apparel/Backpack/Milpack + Graphic_Single + + + 120 + 125 + 8000 + 1 + 3 + 0 + + + 30 + + + 1 + 60 + + + +
  • Torso
  • +
    + +
  • Accessory
  • +
    + 1 + +
  • Outlander
  • +
  • Military
  • +
    + +
  • Soldier
  • +
    + +
    + + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs/Apparel_Hats.xml b/Defs/ThingDefs/Apparel_Hats.xml new file mode 100644 index 0000000..7e603fb --- /dev/null +++ b/Defs/ThingDefs/Apparel_Hats.xml @@ -0,0 +1,205 @@ + + + + + +
  • Headgear
  • +
    +
    + + + +
  • Headgear
  • +
    +
    + + + Apparel_PowerArmorHelmet + + A part of power armor set, mostly used by heavy infantry.\n\nIntegrated servo-motors assist the wearer's muscles in holding the weight of the helmet while the integrated combat HUD improves weapon accuracy. + Spacer + + UnfinishedTechArmor + PoweredArmor + + + Things/Pawn/Humanlike/Apparel/PowerArmorHelmet/PowerArmorHelmet + Graphic_Single + + + 22000 + 180 + 2000 + 0.35 + 0.6 + 0.5 + 0 + -3 + 3 + 4 + 5 + 0 + 1 + + + -0.15 + 1.15 + + + 7 + 50 + 20 + + + +
  • FullHead
  • +
    + Things/Pawn/Humanlike/Apparel/PowerArmorHelmet/PowerArmorHelmet + +
  • Overhead
  • +
    + 0.5 + +
  • Military
  • +
    + +
  • Soldier
  • +
    +
    + + +
  • + 10 + RGBA(0.33,0.33,0.33,1) +
  • +
  • + 10 + RGBA(0.65,0.65,0.65,1) +
  • +
  • + 6 + RGBA(0.3,0.3,0.3,1) + RGBA(0.5,0.5,0.5,1) +
  • +
  • + 10 + RGBA(0.9,0.9,0.9,1) +
  • +
    +
    +
    + + + Apparel_KevlarHelmet + + A lightweight combat helmet. + Midworld + + UnfinishedTechArmor + + + Things/Pawn/Humanlike/Apparel/KevlarHelmet/KevlarHelmet + Graphic_Single + + + 8000 + 130 + 260 + 0.15 + 0.45 + 1.4 + 4 + 1.4 + 0 + + + 20 + 15 + + + +
  • UpperHead
  • +
    + Things/Pawn/Humanlike/Apparel/KevlarHelmet/KevlarHelmet + +
  • Overhead
  • +
    + 2 + +
  • Military
  • +
    + +
  • Soldier
  • +
    + + +
  • + 10 + RGBA(0.33,0.33,0.33,1) +
  • +
  • + 10 + RGBA(0.65,0.65,0.65,1) +
  • +
  • + 6 + RGBA(0.3,0.3,0.3,1) + RGBA(0.5,0.5,0.5,1) +
  • +
  • + 10 + RGBA(0.9,0.9,0.9,1) +
  • +
    +
    +
    + + + Apparel_MilitaryHelmet + + Old-looking and heavy, but effective. Protects against low-velocity projectiles, shrapnel, falling debris, and cuts to the head. + Midworld + + Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet + Graphic_Single + + 40 + +
  • Steeled
  • +
    + + 7000 + 100 + 0.1 + 0.30 + 2 + 4 + 2 + 0 + + + -0.10 + + + +
  • UpperHead
  • +
    + Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet + +
  • Overhead
  • +
    + 2 + +
  • Military
  • +
    + +
  • Soldier
  • +
    +
    +
    + + + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs/Apparel_Shield.xml b/Defs/ThingDefs/Apparel_Shield.xml index bbabb21..0715252 100644 --- a/Defs/ThingDefs/Apparel_Shield.xml +++ b/Defs/ThingDefs/Apparel_Shield.xml @@ -1,45 +1,7 @@  - - Apparel - Item - True - 10 - True - - 35 - - true - - 100 - 1.0 - 1 - 0.5 - - Item - True - Never - -
  • Apparel
  • -
    - -
  • - CompForbiddable -
  • -
  • - CompColorable -
  • -
  • - CompQuality -
  • -
    -
    - - - - - + PersonalShield Apparel_PersonalShield @@ -49,12 +11,19 @@ Graphic_Single Normal - - 1200 - 0.2 - 1.65 + + 1200 + 0.15 + 1.5 + 5 + 10 + 5 + 4 - + +
  • Apparel
  • +
    +
  • Torso
  • diff --git a/Defs/ThingDefs/Apparel_Armour.xml b/Defs/ThingDefs/Apparel_Various.xml similarity index 62% rename from Defs/ThingDefs/Apparel_Armour.xml rename to Defs/ThingDefs/Apparel_Various.xml index e00a2db..1d8b7c7 100644 --- a/Defs/ThingDefs/Apparel_Armour.xml +++ b/Defs/ThingDefs/Apparel_Various.xml @@ -14,19 +14,14 @@ 100 1.0 - 1 + 2 0.5 Item True Never - -
  • Apparel
  • -
    -
  • - CompForbiddable -
  • +
  • CompColorable
  • @@ -35,48 +30,53 @@
    - - + + SmithingSpeed Crafting Smith - Recipe_Smith + Recipe_Machining -
  • TableSmithing
  • +
  • TableMachining
  • UnfinishedApparel
    - - - - - - + + + Apparel_VestPlate A vest with armor plates inserted on the chest and back. Protects against gunfire. + Midworld + + UnfinishedTechArmor + Things/Pawn/Humanlike/Apparel/VestPlate/VestPlate Graphic_Single - 100 + 80
  • Steeled
  • - 10000 + 9500 200 0.20 - 0.65 + 0.55 + 13 + 5 + 13 + 5 - - -0.16 - + +
  • Apparel
  • +
  • Torso
  • @@ -92,89 +92,116 @@
  • Soldier
  • -
    - - -
  • - 10 - RGBA(0.33,0.33,0.33,1) -
  • -
  • - 10 - RGBA(0.65,0.65,0.65,1) -
  • -
  • - 6 - RGBA(0.3,0.3,0.3,1) - RGBA(0.5,0.5,0.5,1) -
  • -
    -
    + +
    - - - Apparel_MilitaryHelmet - - Old-looking and heavy, but effective. Protects against low-velocity projectiles, shrapnel, falling debris, and cuts to the head. + + + Apparel_CompositeVest + + A vest with armor plates inserted on the chest and back. Composite plating offers superior protection against gunfire compared to regular vests. + Midworld + + UnfinishedTechArmor + - Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet + Things/Pawn/Humanlike/Apparel/VestPlate/VestPlate Graphic_Single - 40 - -
  • Steeled
  • -
    - 4000 - 100 - 0.1 - 0.35 + 9500 + 150 + 430 + 0.3 + 0.7 + 12 + 5 + 12 + 5 - - -0.08 - -0.10 - + +
  • Apparel
  • +
    + + 60 + 20 + -
  • UpperHead
  • +
  • Torso
  • - Things/Pawn/Humanlike/Apparel/MilitaryHelmet/MilitaryHelmet + Things/Pawn/Humanlike/Apparel/VestPlate/VestPlate -
  • Overhead
  • +
  • Middle
  • - 1 + 0.7 +
  • Outlander
  • Military
  • Soldier
  • + + +
  • + 10 + RGBA(0.33,0.33,0.33,1) +
  • +
  • + 10 + RGBA(0.65,0.65,0.65,1) +
  • +
  • + 6 + RGBA(0.3,0.3,0.3,1) + RGBA(0.5,0.5,0.5,1) +
  • +
    +
    - - - + Apparel_PowerArmor - Powered armor usually used by assault troops from advanced glitterworld planets. + Powered armor usually used by assault troops from advanced glitterworld planets.\n\nBulky and heavy, but the advanced servo-motors greatly increase the wearer's load bearing capacity and assist in weapon-handling. + Spacer + + UnfinishedTechArmor + PoweredArmor + Things/Pawn/Humanlike/Apparel/PowerArmor/PowerArmor Graphic_Single + 40000 400 4500 0.35 - 0.75 + 0.80 0.30 -45 + 25 + 60 + 100 + 60 + 15 - -0.10 - -0.10 + 80 + 10 + 1.15 + +
  • Apparel
  • +
    + + 18 + 135 +
  • Torso
  • diff --git a/Defs/ThingDefs/Buildings_Structure.xml b/Defs/ThingDefs/Buildings_Structure.xml deleted file mode 100644 index b0fec4c..0000000 --- a/Defs/ThingDefs/Buildings_Structure.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - Building - BulletImpactMetal - true - MapMeshAndRealTime - Light - Repair - true - BuildingRubble - - - - - - - - - - Wall - - Building - Building - An impassable wall. Capable of holding up a roof. - - Things/Building/Linked/Wall - Graphic_Appearances - CornerFiller - -
  • Wall
  • -
  • Rock
  • -
    -
    - - Things/Building/Linked/Wall_Blueprint_Atlas - - Things/Building/Linked/WallSmooth_MenuIcon - - 350 - 150 - 1.0 - - 5 - false - BuildingTall - Impassable - true - 1 - true - 1 - Never - false - true - true - Heavy - true - Structure - 1.0 - true - -
  • Metallic
  • -
  • Woody
  • -
  • Stony
  • -
    - - true - true - - -
  • - Bomb - 1.5 -
  • -
  • - Bullet - 0.03 -
  • -
  • - Fragment - 0.03 -
  • -
    - B -
    - -
    \ No newline at end of file diff --git a/Defs/ThingDefs/Items_Resource_Stuff.xml b/Defs/ThingDefs/Items_Resource_Stuff.xml deleted file mode 100644 index 05e0ae8..0000000 --- a/Defs/ThingDefs/Items_Resource_Stuff.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - ThingWithComps - - Item - Middle - true - true - Item - 75 - -
  • - CompForbiddable -
  • -
    - true - true - false - 15 -
    - - - Primary - Neolithic - -
  • - CompEquippable -
  • -
    -
    - - - - - - - - - Steel - - An iron-carbon metal alloy used for building structures, tools, and weapons. - - Things/Item/Resource/Metal - Graphic_Random - (255,255,255) - - Metal_Drop - Metal_Drop - - 2.0 - 1 - 1 - - false - ChunkSlagSteel - -
  • ResourcesRaw
  • -
    - - -
  • Metallic
  • -
  • Steeled
  • -
    - ConstructMetal - (102,102,105) - BulletImpactMetal - MeleeHit_Metal_Sharp - MeleeHit_Metal_Blunt - - 1 - 1 - 0.2 - 1 - - true -
    -
    - - - - - Plasteel - - Advanced spacer tech structural material. Plasteel is extremely strong due to its unique molecular structure. - - Things/Item/Resource/Plasteel - Graphic_Single - - Metal_Drop - Metal_Drop - false - - 27 - 1.2 - 1.0 - - -
  • ResourcesRaw
  • -
    - - -
  • Metallic
  • -
  • Steeled
  • -
    - ConstructMetal - (160,178,181) - BulletImpactMetal - MeleeHit_Metal_Sharp - MeleeHit_Metal_Blunt - - 1.0 - 1.2 - 2.8 - 1.2 - 0.1 - 2.0 - 0.8 - - true -
    -
    - -
    \ No newline at end of file diff --git a/Defs/ThingDefs/Kits_Turrets.xml b/Defs/ThingDefs/Kits_Turrets.xml index 4d44bb8..0041e12 100644 --- a/Defs/ThingDefs/Kits_Turrets.xml +++ b/Defs/ThingDefs/Kits_Turrets.xml @@ -11,9 +11,7 @@ RealtimeOnly -
  • - CompForbiddable -
  • +
  • true false diff --git a/Defs/ThingDefs/Plants_Cultivated.xml b/Defs/ThingDefs/Plants_Cultivated.xml new file mode 100644 index 0000000..a72c97c --- /dev/null +++ b/Defs/ThingDefs/Plants_Cultivated.xml @@ -0,0 +1,82 @@ + + + + + + + Plant + Plant + LowPlant + True + + 0.8 + + Long + False + True + MapMeshOnly + + CutoutPlant + + + true + Harvest_Standard + Harvest_Standard_Finish + 150 + 150 + 0.5 + 1.0 + 0.1 + + 0.3 + 1.00 + + + + + + + PlantBlazebulb + Combat_Realism.Plant_Blazebulb + + Genetically engineered plant designed to yield pyrophoric compounds for use in incendiary weapons.\n\nGreat care must be taken in cultivating these as the incendiary compounds inside the bulbs can self-ignite at room temperature, requiring constant cooling to maintain optimal growth temperatures. + + 65 + 1 + 1 + + + Things/Plant/Blazebulb + Graphic_Random + + true + 10 + + Plant + NeverForNutrition + 0.02 + + + true + false + Standard + Prometheum + true + 1 + +
  • Ground
  • +
  • Hydroponic
  • + + 0.1 + 0.5 + 0.4 + + 0.3 + 1.0 + + +
    + + + + \ No newline at end of file diff --git a/Defs/ThingDefs/Races_Humanlike.xml b/Defs/ThingDefs/Races_Humanlike.xml new file mode 100644 index 0000000..0f346e0 --- /dev/null +++ b/Defs/ThingDefs/Races_Humanlike.xml @@ -0,0 +1,131 @@ + + + + + + + + + Human + + A baseline human, mostly unmodified by gene engineering and mostly unchanged by evolutionary pressures on non-Earth planets. + Things/Pawn/Humanlike/UI/IconHuman + + 1750 + 4.61 + 1.0 + 12 + 32 + 20 + + +
  • + Verb_MeleeAttack + 100 + 5 + Blunt + LeftHand +
  • +
  • + Verb_MeleeAttack + 100 + 5 + Blunt + RightHand +
  • +
    + + Humanlike + HumanlikeConstant + Humanlike + true + 80 + (211,194,143) + 0.01 + 0.95 + 15 + HumanStandard + DesperateOnly + Human + 1 + 1 + OmnivoreHuman + 45 + + +
  • (0.5, 0)
  • +
  • (1, 1)
  • +
  • (1.01, 0.02)
  • +
  • (3.5, 0)
  • +
    +
    + +
  • + HumanlikeBaby + 0 +
  • +
  • + HumanlikeToddler + 1.2 +
  • +
  • + HumanlikeChild + 4 +
  • +
  • + HumanlikeTeenager + 13 +
  • +
  • + HumanlikeAdult + 18 +
  • +
    + Pawn_Melee_Punch_HitPawn + Pawn_Melee_Punch_HitBuilding + Pawn_Melee_Punch_Miss + + (0.3, 0.8, 0.4) + (0,0,-0.3) + + + +
  • (14,0)
  • +
  • (16,100)
  • +
  • (50,100)
  • +
  • (60,30)
  • +
  • (70,18)
  • +
  • (80,10)
  • +
  • (90,3)
  • +
  • (100,0)
  • +
    +
    + +
  • OrganicStandard
  • +
    +
    + +
  • InstallPowerClaw
  • +
  • InstallScytherBlade
  • +
  • InstallBionicEye
  • +
  • InstallBionicArm
  • +
  • InstallBionicLeg
  • +
  • InstallSimpleProstheticArm
  • +
  • InstallSimpleProstheticLeg
  • +
  • InstallPegLeg
  • +
  • InstallDenture
  • +
  • InstallJoywire
  • +
  • InstallPainstopper
  • +
  • InstallNaturalHeart
  • +
  • InstallNaturalLung
  • +
  • InstallNaturalKidney
  • +
  • InstallNaturalLiver
  • +
  • ExciseCarcinoma
  • +
  • RemoveBodyPart
  • +
  • Euthanize
  • +
    +
    + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs/Races_Mechanoid.xml b/Defs/ThingDefs/Races_Mechanoid.xml index 2ae6615..d440ad8 100644 --- a/Defs/ThingDefs/Races_Mechanoid.xml +++ b/Defs/ThingDefs/Races_Mechanoid.xml @@ -35,16 +35,16 @@ BulletImpactMetal + 0 0 -100 250 - true + Mechanoid false false - false - NeverEats + None @@ -58,8 +58,11 @@ 1.33 0.35 - 0.75 - 30 + 0.85 + 0 + 500 + 100 + 0.9
  • @@ -72,11 +75,10 @@ ToolUser - true - Mechanoid + Mechanoid MechanicalCentipede 2.0 - 1.8 + 2.0
  • MechanoidFullyFormed @@ -101,6 +103,7 @@ 80 50 + 2 @@ -109,12 +112,15 @@ Mechanoid_Scyther - Fast, spindly, human-sized combat mechanoids. They usually carry one primary ranged weapon, and their bodies are adorned with two articulated blades to make them deadly in melee combat. They don't use cover. Best handled by concentrated, overwhelming force. + Fast, spindly, human-sized combat mechanoids. They usually carry one primary ranged weapon, and their bodies are adorned with two articulated blades to make them deadly in melee combat. Best handled by concentrated, overwhelming force. 6.6 0.2 0.45 30 + 50 + 20 + 0.9
  • @@ -134,8 +140,7 @@ ToolUser - true - Mechanoid + Mechanoid Scyther 1.0 1.0 @@ -162,8 +167,9 @@
  • ShutDownMechanoid
  • - 45 + 40 25 + 1
    diff --git a/Defs/ThingDefs/Things_Special.xml b/Defs/ThingDefs/Things_Special.xml index 29d17a0..44fddbf 100644 --- a/Defs/ThingDefs/Things_Special.xml +++ b/Defs/ThingDefs/Things_Special.xml @@ -1,7 +1,25 @@  - - + + + Puddle_Fuel + + Combat_Realism.IncendiaryFuel + Item + + Things/Item/Special/LiquidFuel + Graphic_Single + Transparent + + LowPlant + true + + 75 + 5.0 + + Normal + Burns on the ground. + ArtilleryMarker diff --git a/Defs/ThingDefs/Various_Stone.xml b/Defs/ThingDefs/Various_Stone.xml index 5177687..5e0385c 100644 --- a/Defs/ThingDefs/Various_Stone.xml +++ b/Defs/ThingDefs/Various_Stone.xml @@ -27,74 +27,67 @@
  • Bomb - 1.5 + 2
  • Bullet - 0.03 + 0.05
  • Fragment - 0.03 + 0.05
  • - - Building - true - MapMeshOnly - - - - Mineable + + Blocks of stone. Mostly useful for building long-lasting, simple structures. - Things/Building/Linked/Rock_Atlas + Things/Item/Resource/StoneBlocks Graphic_Single - CornerFiller - -
  • Rock
  • -
  • MapEdge
  • -
    - BuildingTall - Impassable - true - 1 - true - true - false - true - RockRubble - true - 1.0 - true - true + Stone_Drop + Stone_Drop + false + + 1.9 + 0.6 + 1.6 + 4.0 + 1.0 + + +
  • StoneBlocks
  • +
    + + +
  • Stony
  • +
    + Bricks + + 140 + 2 + + + 1.2 + 0.4 + 2.4 + 0 + 4.5 + 0.45 + 0.9 + 1.35 + 2.0 + +
    +
    + + 0 -2 - - true - true - CollapseRock - false - - -
  • - Bomb - 1.5 -
  • -
  • - Bullet - 0.03 -
  • -
  • - Fragment - 0.03 -
  • -
    @@ -126,7 +119,7 @@ - + Sandstone A sedimentary rock composed of sand particles compressed together. @@ -158,11 +151,36 @@ 20 + + + BlocksSandstone + + Blocks of solid sandstone. Sandstone is a relatively soft rock and chips easily. + + (126,104,94) + + + 1.9 + 0.5 + + + (126,104,94) + BulletImpactGround + MeleeHit_Stone + MeleeHit_Stone + sandstone + + 1.1 + 0.4 + 1.4 + + + - + Granite A very hard igneous rock. @@ -195,12 +213,36 @@ + + BlocksGranite + + Blocks of solid granite. Granite is a very hard stone. + + (105,95,97) + + + 2.1 + 0.65 + + + (105,95,97) + BulletImpactGround + MeleeHit_Stone + MeleeHit_Stone + granite + + 0.5 + 1.7 + + + + - + Limestone A sedimentary rock formed from the compacted remains of ancient seashells. @@ -233,10 +275,33 @@ + + BlocksLimestone + + Blocks of solid limestone. + + (158,153,135) + + + 1.9 + + + (158,153,135) + BulletImpactGround + MeleeHit_Stone + MeleeHit_Stone + limestone + + 0.4 + 1.55 + + + + - + Slate A dark-colored metamorphic rock. Its fine layers are emblematic of slaty cleavage. @@ -269,10 +334,34 @@ + + BlocksSlate + + Blocks of solid slate. A dull-looking rock that chips easily. + + (70,70,70) + + + 1.9 + + + (70,70,70) + BulletImpactGround + MeleeHit_Stone + MeleeHit_Stone + slate + + 1.1 + 0.38 + 1.3 + + + + - + Marble A soft metamorphic rock. @@ -306,5 +395,29 @@ + + BlocksMarble + + Blocks of solid marble. Marble is a soft, beautiful stone, known for being easy to sculpt. + + (132,135,132) + + + 1.9 + + + (132,135,132) + BulletImpactGround + MeleeHit_Stone + MeleeHit_Stone + marble + + 1.35 + 0.45 + 1.2 + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs/Weapons_Artillery.xml b/Defs/ThingDefs/Weapons_Artillery.xml index db6afda..9603885 100644 --- a/Defs/ThingDefs/Weapons_Artillery.xml +++ b/Defs/ThingDefs/Weapons_Artillery.xml @@ -1,40 +1,19 @@ - + - - + + Item ThingWithComps - + Primary - 10 - True - True - true - - 100 - 1.0 - 0.5 - - Item - True Never Midworld - -
  • Weapons
  • -
    - -
  • Gun
  • -
    -
  • - CompForbiddable -
  • CompEquippable
  • - Combat_Realism.CompCharges
  • (29,85)
  • (72,300)
  • @@ -44,19 +23,6 @@
    - - Projectile - Normal - Projectile - Combat_Realism.BulletCR - - False - True - - Transparent - - - @@ -70,14 +36,14 @@ Graphic_Single TransparentPostLight - Combat_Realism.ProjectileCR_Explosive + Projectile_Explosive Flame 50 100 - 4.8 - Puddle_Fuel - 0.3 + 4.5 + Puddle_Fuel + 0.5 true ArtilleryHitThickRoof MortarIncendiary_Explode @@ -85,7 +51,7 @@ MortarRound_Ambient
    - + Artillery_MortarIncendiary Incendiary mortar launcher. Lobs fire-starting bombs over walls. Very inaccurate but long-ranged. @@ -124,7 +90,7 @@ - + Bullet_MortarBomb @@ -132,33 +98,33 @@ Graphic_Single TransparentPostLight - Combat_Realism.ProjectileCR_Frag + Combat_Realism.ProjectileCR_Explosive Bomb - 240 + 150 100 - 3 + 1 true ArtilleryHitThickRoof - MortarBomb_Explode MortarRound_PreImpact MortarRound_Ambient - 10.0 - Fragment_MortarSmall - 150 - Fragment_MortarMedium - 90 - Fragment_MortarLarge - 30 - -
  • - Combat_Realism.CompAP - 0.55 -
  • -
    + +
  • + 100 + Bomb + 3 + MortarBomb_Explode + + 150 + 90 + 30 + + 10 +
  • +
    - + Artillery_MortarBomb Mortar launcher. Lobs bombs over walls. Very inaccurate but long-ranged. @@ -169,7 +135,7 @@ 1500 0.5 - 10 + 34
  • Artillery
  • @@ -203,20 +169,27 @@ Graphic_Single TransparentPostLight - Combat_Realism.ProjectileCR_Explosive + Projectile_Explosive EMP - 360 + 200 100 - 17 + 8.5 true ArtilleryHitThickRoof - MortarEMP_Explode MortarRound_PreImpact MortarRound_Ambient + +
  • + 50 + Electrical + 8.5 + MortarEMP_Explode +
  • +
    - + Artillery_MortarEMP Mortar launcher. Lobs EMP bombs over walls. Very inaccurate but long-ranged. @@ -227,7 +200,7 @@ 1500 0.5 - 10 + 34
  • Artillery
  • @@ -250,4 +223,4 @@
    -
    + \ No newline at end of file diff --git a/Defs/ThingDefs/Weapons_Grenades.xml b/Defs/ThingDefs/Weapons_Grenades.xml index 25958fe..669aae1 100644 --- a/Defs/ThingDefs/Weapons_Grenades.xml +++ b/Defs/ThingDefs/Weapons_Grenades.xml @@ -1,31 +1,26 @@ - + - Secondary + Primary ThingWithComps Item true true - - 35 - true 100 1.0 - 1 + 2 0.5 Item Equipment lacks desc. -
  • - CompForbiddable -
  • +
  • CompEquippable
  • @@ -34,6 +29,9 @@ Never
    + + 75 + Projectile @@ -46,7 +44,7 @@ Transparent - + 24 false @@ -56,50 +54,46 @@ - + Proj_GrenadeFrag - Combat_Realism.ProjectileCR_Frag - Things/Projectile/Grenade + Things/Projectile/Grenades/Frag Graphic_Single - 1 + 1.5 Bomb - 70 + 80 60 - 5.0 - Fragment_GrenadeFragSmall - 90 - Fragment_GrenadeFragMedium - 30 - Fragment_GrenadeFragLarge - 20 - -
  • - Combat_Realism.CompAP - 0.55 + +
  • + 4.0 + + 75 + 50 + 15 +
  • -
    +
    - + Weapon_GrenadeFrag Primary - - Old-school fragmentation grenades. + + Old-school fragmentation grenade. - Things/Item/Equipment/WeaponRanged/Grenades - Graphic_Single + Things/Ammo/HandGrenades/Frag + Graphic_StackCount InteractGrenade Midworld + 5.25 0.15 - 200 - 1.0 + 1
  • GrenadeDestructive
  • @@ -110,11 +104,10 @@
  • - Combat_Realism.Verb_LaunchProjectileCR + Combat_Realism.Verb_ShootCROneUse true - 10 - 1.0 - 120 + 10.0 + 90 4 true ThrowGrenade @@ -125,7 +118,7 @@
  • - 10 + 2
    @@ -137,32 +130,32 @@ Proj_GrenadeMolotov - Things/Projectile/Molotov + Things/Projectile/Grenades/Molotov Graphic_Single - 1.1 + 1.5 Flame - 10 - Puddle_Fuel + 30 + Puddle_Fuel
    - + Weapon_GrenadeMolotov Primary - - Glass bottles filled with flammable liquid, with a burning cloth in the neck. A favorite weapon of hooligans and desperate warriors from rim to rim. + + Glass bottle filled with flammable liquid, with a burning cloth in the neck. A favorite weapon of hooligans and desperate warriors from rim to rim. - Things/Item/Equipment/WeaponRanged/Molotov - Graphic_Single + Things/Ammo/HandGrenades/Molotov + Graphic_StackCount InteractMolotovCocktail Midworld + 2.10 0.15 - 100 - 1.0 + 1
  • GrenadeDestructive
  • @@ -173,11 +166,10 @@
  • - Combat_Realism.Verb_LaunchProjectileCR + Combat_Realism.Verb_ShootCROneUse true 10 - 2.9 - 120 + 90 4 true true @@ -196,32 +188,40 @@ Proj_GrenadeEMP - Things/Projectile/GrenadeEMP + Things/Projectile/Grenades/EMP Graphic_Single - 3.5 + 4 EMP 80 60 + +
  • + 20 + Electrical + 4 + MortarEMP_Explode +
  • +
    - + Weapon_GrenadeEMP Primary - - Electromagnetic pulse grenades damaging to electronic equipment. + + Electromagnetic pulse grenade damaging to electronic equipment. - Things/Item/Equipment/WeaponRanged/EMPGrenades - Graphic_Single + Things/Ammo/HandGrenades/EMP + Graphic_StackCount InteractGrenade Midworld + 7.65 0.15 - 250 - 1.0 + 1
  • GrenadeEMP
  • @@ -232,11 +232,10 @@
  • - Combat_Realism.Verb_LaunchProjectileCR + Combat_Realism.Verb_ShootCROneUse true 10 - 1.0 - 120 + 90 4 false ThrowGrenade @@ -247,8 +246,69 @@
  • - 10 + 2 + +
    + + + + + Proj_GrenadeFlashbang + + + Things/Projectile/Grenades/Flashbang + Graphic_Single + + + 3.5 + Stun + 50 + 60 + Explosion_Stun + + + + + Weapon_GrenadeFlashbang + Primary + + Electromagnetic pulse grenades damaging to electronic equipment. + + Things/Ammo/HandGrenades/Flashbang + Graphic_StackCount + + InteractGrenade + Midworld + + 4.85 + 0.15 + 1 + + +
  • CR_GrenadeFlashbang
  • +
    + +
  • Grenades
  • +
    + +
  • + + Combat_Realism.Verb_ShootCROneUse + true + 10 + 90 + 4 + false + ThrowGrenade + + true + + Proj_GrenadeFlashbang +
  • +
    + + 2
    -
    + \ No newline at end of file diff --git a/Defs/ThingDefs/Weapons_Guns.xml b/Defs/ThingDefs/Weapons_Guns.xml index 5638360..5f4beb9 100644 --- a/Defs/ThingDefs/Weapons_Guns.xml +++ b/Defs/ThingDefs/Weapons_Guns.xml @@ -16,7 +16,7 @@ 100 1.0 - 1 + 2 0.5 Item @@ -30,70 +30,54 @@
  • ITab_Art
  • -
  • - CompForbiddable -
  • +
  • CompEquippable
  • CompQuality
  • -
  • - CompArt - NamerGun - ArtWeaponGun +
  • + ArtName_WeaponGun + ArtDescription_WeaponGun Excellent
  • -
  • - Combat_Realism.CompGizmos -
  • 20 + + + SmithingSpeed + Crafting + Smith + Recipe_Smith + +
  • TableMachining
  • +
    + UnfinishedGun +
    +
    +
  • Gun
  • - - - - Projectile - Normal - Projectile - Combat_Realism.BulletCR - - False - True - - Transparent - + + + +
  • Gun
  • +
    - - Bullet_Pistol - - - Things/Projectile/Bullet_Small - Graphic_Single - - - false - Bullet - 12 - 55 - - - - + Gun_Pistol Ancient pattern automatic pistol. Weak and short range, but quick. @@ -103,19 +87,29 @@ InteractPistol + 6000 200 0.35 0.16 - 2.05 + 1.55 0.25 + 2.10 + 1.00 + + 30 + 2 + + +
  • CR_Sidearm
  • +
  • - (0.0,0.0) - (0.0,0.0) - Combat_Realism.Verb_ShootCRReload + (0.0,0.0) + (0.0,0.0) + Combat_Realism.Verb_ShootCR true - Bullet_Pistol + Bullet_45ACP_FMJ 20 10 ShotPistol @@ -123,46 +117,22 @@ 9
  • - - -0.10 - -0.02 - - -
  • - Combat_Realism.CompFireModes - FALSE - FALSE -
  • -
  • - Combat_Realism.CompReloader - 7 - 180 -
  • -
  • - Combat_Realism.CompAP - 0.425 -
  • -
    + +
  • + 7 + 180 + AmmoSet_45ACP +
  • +
  • + FALSE + FALSE +
  • +
    - - - Bullet_PumpShotgun - - - Things/Projectile/Shotgun_Pellet - Graphic_Single - - - Bullet - 8 - 70 - - - - + Gun_PumpShotgun Ancient design. Deadly, but short range. @@ -172,20 +142,25 @@ InteractShotgun + 7500 400 - 0.50 - 2.5 + 0.5 1.54 + 8.10 + 3.00 1.5 + + 90 + 3 +
  • - (0.0, 0.0) - (0.0, 0.0) - 8 - Combat_Realism.Verb_ShootCRReload + (0.0, 0.0) + (0.0, 0.0) + Combat_Realism.Verb_ShootCR true - Bullet_PumpShotgun + Bullet_12Gauge_Buck 35 15 ShotShotgun @@ -193,47 +168,24 @@ 9
  • - - -0.30 - -0.06 - - -
  • - Combat_Realism.CompFireModes - FALSE - FALSE -
  • -
  • - Combat_Realism.CompReloader - 5 - 240 -
  • -
  • - Combat_Realism.CompAP - 0.3 -
  • -
    + +
  • + 5 + 240 + AmmoSet_12Gauge +
  • +
  • + FALSE + FALSE +
  • +
    - - Bullet_SurvivalRifle - - - Bullet - 18 - 150 - - - Things/Projectile/Bullet_big - Graphic_Single - - - - + Gun_SurvivalRifle Ancient bolt-action rifle. Good range, Good power, low rate of fire. @@ -243,19 +195,26 @@ InteractRifle + 8000 400 - 0.50 - 0.08 - 1.92 + 0.50 + 0.08 + 1.42 + 9.50 + 4.00 1.2 + + 90 + 3 +
  • - (0.0,0.0) - (0.0,0.0) - Combat_Realism.Verb_ShootCRReload + (0.0,0.0) + (0.0,0.0) + Combat_Realism.Verb_ShootCR true - Bullet_SurvivalRifle + Bullet_303British_FMJ 75 67 ShotSurvivalRifle @@ -263,45 +222,22 @@ 9
  • - - -0.41 - -0.08 - - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
  • - Combat_Realism.CompReloader - 10 - 180 -
  • -
  • - Combat_Realism.CompAP - 0.55 -
  • -
    + +
  • + 10 + 180 + AmmoSet_303British +
  • +
  • + FALSE + TRUE +
  • +
    - - Bullet_AssaultRifle - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 14 - 188 - - - - + Gun_AssaultRifle A general-purpose military weapon for field or urban combat. It fires a three-round burst. Good range, low power, high rate of fire. @@ -311,19 +247,26 @@ InteractRifle + 10500 650 - 0.50 - 0.08 - 1.78 + 0.50 + 0.08 + 1.28 + 10.03 + 3.40 0.4 + + 100 + 4 +
  • - (0.0, 0.43) - (0.0, 0.14) - Combat_Realism.Verb_ShootCRReload + (0.0, 0.32) + (0.0, 0.96) + Combat_Realism.Verb_ShootCR true - Bullet_AssaultRifle + Bullet_556x45mmNATO_FMJ 75 73 6 @@ -333,46 +276,23 @@ 9
  • - - -0.39 - -0.08 - - -
  • - Combat_Realism.CompFireModes - TRUE - TRUE - 3 -
  • -
  • - Combat_Realism.CompReloader - 30 - 300 -
  • -
  • - Combat_Realism.CompAP - 0.65 -
  • -
    + +
  • + 30 + 300 + AmmoSet_556x45mmNATO +
  • +
  • + 3 + TRUE + TRUE +
  • +
    - - Bullet_SniperRifle - - - Things/Projectile/Bullet_Big - Graphic_Single - - - Bullet - 18 - 167 - - - - + Gun_SniperRifle Ancient pattern military sniper rifle. Bolt action. Long range, great accuracy and power. @@ -382,19 +302,26 @@ InteractRifle + 13000 850 - 1.25 - 0.04 - 2.09 + 1.25 + 0.04 + 2.09 + 10.92 + 7.30 0.5 + + 100 + 6 +
  • - (0.0,0.0) - (0.0,0.0) - Combat_Realism.Verb_ShootCRReload + (0.0,0.0) + (0.0,0.0) + Combat_Realism.Verb_ShootCR true - Bullet_SniperRifle + Bullet_762x51mmNATO_FMJ 85 107 ShotSniperRifle @@ -402,26 +329,17 @@ 9
  • - - -0.73 - -0.15 - - -
  • - Combat_Realism.CompFireModes - FALSE + +
  • + 5 + 300 + AmmoSet_762x51mmNATO +
  • +
  • + FALSE TRUE -
  • -
  • - Combat_Realism.CompReloader - 5 - 300 -
  • -
  • - Combat_Realism.CompAP - 0.70 -
  • -
    + +
  • SniperRifle
  • @@ -429,21 +347,7 @@ - - Bullet_PDW - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 9 - 78 - - - - + Gun_PDW A personal defense weapon is a micro-submachine gun. Short range, low power, high rate of fire. Very quick to aim and fire. @@ -453,19 +357,26 @@ InteractSMG + 9000 550 - 0.50 - 0.12 - 1.48 + 0.50 + 0.12 + 0.98 + 5.44 + 3.50 0.33 + + 90 + 3 +
  • - (0.0, 0.19) - (0.0, 0.06) - Combat_Realism.Verb_ShootCRReload + (0.0, 0.10) + (0.0, 0.29) + Combat_Realism.Verb_ShootCR true - Bullet_PDW + Bullet_9x19mmPara_FMJ 45 20 6 @@ -475,47 +386,24 @@ 9
  • - - -0.38 - -0.08 - - -
  • - Combat_Realism.CompFireModes - FALSE - FALSE - 3 -
  • -
  • - Combat_Realism.CompReloader - 32 - 240 -
  • -
  • - Combat_Realism.CompAP - 0.425 -
  • -
    + +
  • + 32 + 240 + AmmoSet_9x19mmPara +
  • +
  • + 3 + FALSE + FALSE +
  • +
    - - Bullet_HeavySMG - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 12 - 55 - - - - + Gun_HeavySMG A compact, wide-caliber slug-thrower. Very short range, but it packs a punch and handles quite well. @@ -525,19 +413,26 @@ InteractSMG + 10500 600 - 0.35 - 0.12 - 3.40 + 0.35 + 0.12 + 0.66 + 5.00 + 1.40 0.33 + + 130 + 4 +
  • - (0.0, 0.47) - (0.0, 0.16) - Combat_Realism.Verb_ShootCRReload + (0.0, 0.23) + (0.0, 0.70) + Combat_Realism.Verb_ShootCR true - Bullet_HeavySMG + Bullet_45ACP_FMJ 45 14 6 @@ -547,51 +442,23 @@ 9
  • - - -0.16 - -0.03 - - -
  • - Combat_Realism.CompFireModes - FALSE - FALSE - 3 -
  • -
  • - Combat_Realism.CompReloader - 20 - 240 -
  • -
  • - Combat_Realism.CompAP - 0.425 -
  • -
    + +
  • + 20 + 240 + AmmoSet_45ACP +
  • +
  • + 3 + FALSE + FALSE +
  • +
    - - Bullet_IncendiaryLauncher - - - Things/Projectile/InfernoCannonShot - Graphic_Single - TransparentPostLight - - Combat_Realism.ProjectileCR_Explosive - - 60 - Flame - 15 - 1.1 - Puddle_Fuel - 0.7 - - - - + Gun_IncendiaryLauncher Incendiary bolt launcher. Starts fires. @@ -601,19 +468,26 @@ InteractRifle + 13000 630 - 0.50 - 0.17 - 2.05 + 0.50 + 0.17 + 1.26 + 11.25 + 4.20 0.4 + + 140 + 4 +
  • - (0.0,0.0) - (0.0,0.0) - Combat_Realism.Verb_ShootCRReload + (0.0,0.0) + (0.0,0.0) + Combat_Realism.Verb_ShootCR true - Bullet_IncendiaryLauncher + Bullet_30x64mmFuel_Incendiary true 75 53 @@ -623,41 +497,24 @@ 14
  • - - -0.42 - -0.08 - - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
  • - Combat_Realism.CompReloader - 5 - 300 -
  • -
    + +
  • + 5 + 300 + AmmoSet_30x64mmFuel +
  • +
  • + FALSE + TRUE +
  • +
    - - Bullet_LMG - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 19 - 140 - - - + + Gun_LMG A light machine gun. @@ -667,24 +524,30 @@ InteractRifle + 22000 1600 - 0.50 - 0.08 - 2.8 + 0.50 + 0.08 + 2.60 + 11.00 + 9.00 1 - Spacer + + 150 + 4 + -
  • MachineGun
  • +
  • CR_MachineGun
  • - (-0.27,0.52) - (-0.09,0.18) - Combat_Realism.Verb_ShootCRReload + (-0.07,0.22) + (-0.22,0.67) + Combat_Realism.Verb_ShootCR true - Bullet_LMG - 95 + Bullet_762x51mmNATO_FMJ + 180 113 5 20 @@ -693,47 +556,24 @@ 9
  • - - -0.90 - -0.18 - - -
  • - Combat_Realism.CompFireModes - FALSE - FALSE - 5 -
  • -
  • - Combat_Realism.CompReloader - 100 - 600 -
  • -
  • - Combat_Realism.CompAP - 0.70 -
  • -
    + +
  • + 100 + 600 + AmmoSet_762x51mmNATO +
  • +
  • + 5 + FALSE + FALSE +
  • +
    - - Bullet_ChargeRifle - - - Things/Projectile/Charge_Small - Graphic_Single - - - Bullet - 19 - 170 - - - - + Gun_ChargeRifle Charged-shot energy/projectile rifle. @@ -743,23 +583,34 @@ InteractChargeRifle - 1800 - 0.50 - 0.05 - 1.63 + 24000 + 1600 + 0.50 + 0.05 + 1.20 + 11.00 + 3.50 0.4 + + ChargedShot + + + 120 + 30 + 6 + Spacer
  • AdvancedGun
  • - (0.0, 0.37) - (0.0, 0.12) - Combat_Realism.Verb_ShootCRReload + (0.0, 0.25) + (0.0, 0.75) + Combat_Realism.Verb_ShootCR true - Bullet_ChargeRifle + Bullet_6x24mmCharged 75 73 5 @@ -769,27 +620,18 @@ 9
  • - - -0.35 - -0.07 - - -
  • - Combat_Realism.CompFireModes - TRUE - TRUE - 3 -
  • -
  • - Combat_Realism.CompReloader - 60 - 300 -
  • -
  • - Combat_Realism.CompAP - 0.775 -
  • -
    + +
  • + 60 + 300 + AmmoSet_6x24mmCharged +
  • +
  • + 3 + TRUE + TRUE +
  • +
    @@ -799,20 +641,7 @@ - - Bullet_TurretImprovised - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 9 - 170 - - - + - - Bullet_Minigun - - - Things/Projectile/Bullet_Small - Graphic_Single - - - Bullet - 18 - 167 - - - + + Gun_Minigun A multi-barrel machine gun with an extremely high rate of fire. Mechanoid-built. @@ -893,26 +698,29 @@ InteractRifle + 30000 2200 - 1.25 - 0.08 - 3.2 + 1.25 + 0.08 + 3.70 + 16.00 + 20.00 1.5 Never - Spacer True True + Spacer
  • MechanoidGunHeavy
  • - (-0.27,0.27) - (-0.18,0.18) + (-0.30,0.30) + (-0.30,0.90) Combat_Realism.Verb_ShootCR true - Bullet_Minigun + Bullet_762x51mmNATO_FMJ 2.4 180 107 @@ -923,17 +731,17 @@ 9
  • - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
  • - Combat_Realism.CompAP - 0.70 -
  • -
    + +
  • + 600 + 60 + AmmoSet_762x51mmNATO +
  • +
  • + FALSE + TRUE +
  • +
    @@ -945,10 +753,10 @@ Graphic_Single TransparentPostLight - Combat_Realism.ProjectileCR_Explosive + Projectile_DoomsdayRocket Bomb - 240 + 250 7.8 100 @@ -962,12 +770,23 @@ Graphic_Single + 18000 2000 - 1.25 - 0.2 - 6.00 - 4.5 + 1.25 + 0.2 + 3.90 + 17.50 + 11.00 + 1.5 + + LargeRockets + + + 170 + 15 + 5 + Spacer false @@ -979,8 +798,8 @@
  • - (0.0,0.0) - (0.0,0.0) + (0.0,0.0) + (0.0,0.0) Combat_Realism.Verb_ShootCROneUse true Bullet_DoomsdayRocket @@ -997,18 +816,12 @@ 14
  • - - -1.50 - -0.30 - - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE - 1 -
  • -
    + +
  • + FALSE + TRUE +
  • +
    @@ -1020,11 +833,11 @@ Graphic_Single TransparentPostLight - Combat_Realism.ProjectileCR_Explosive + Projectile_Explosive Bomb 180 - 3 + 3.0 100
    @@ -1037,12 +850,23 @@ Graphic_Single + 15000 1000 - 1.25 - 0.2 - 3.80 - 4.5 + 1.25 + 0.2 + 3.50 + 17.50 + 9.00 + 1.5 + + LargeRockets + + + 120 + 8 + 3 + Spacer false @@ -1054,8 +878,8 @@
  • - (0.0,0.0) - (0.0,0.0) + (0.0,0.0) + (0.0,0.0) Combat_Realism.Verb_ShootCROneUse true Bullet_Rocket @@ -1074,38 +898,21 @@ 14
  • - - -1.40 - -0.28 - - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE + +
  • + 1 + FALSE + TRUE true -
  • -
    + +
    - - - Bullet_ChargeBlasterHeavy - - - Things/Projectile/Charge_Small - Graphic_Single - TransparentPostLight - - - Bullet - 22 - 190 - - + + Gun_ChargeBlasterHeavy @@ -1116,9 +923,11 @@ 2400 - 1.25 - 0.04 - 5 + 1.25 + 0.04 + 4.50 + 24.00 + 25.00 1.5 Never @@ -1130,53 +939,36 @@
  • - (-0.27,0.27) - (-0.18,0.18) + (-0.18,0.18) + (-0.18,0.54) Combat_Realism.Verb_ShootCR true - Bullet_ChargeBlasterHeavy + Bullet_12x64mmCharged 2.9 120 93 5 - 40 + 20 ShotChargeBlaster GunTail_Heavy 9
  • - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
  • - Combat_Realism.CompAP - 1.20 -
  • -
    - - - - - Bullet_InfernoCannon - - - Things/Projectile/InfernoCannonShot - Graphic_Single - TransparentPostLight - - Combat_Realism.ProjectileCR_Explosive - - Flame - 60 - 180 - 2.4 - Puddle_Fuel - 0.3 - + +
  • + 100 + 60 + AmmoSet_12x64mmCharged +
  • +
  • + 10 + FALSE + TRUE +
  • +
    + + Gun_InfernoCannon @@ -1187,10 +979,12 @@ 2400 - 1.25 - 0.1 - 2.50 - 6 + 1.25 + 0.1 + 3.50 + 37.50 + 10.00 + 2 Never Spacer @@ -1201,14 +995,14 @@
  • - (0.0,0.0) - (0.0,0.0) + (0.0,0.0) + (0.0,0.0) Combat_Realism.Verb_ShootCR true - Bullet_InfernoCannon + Bullet_80x256mmFuel_Thermobaric 3.5 true - 100 + 180 80 1 InfernoCannon_Fire @@ -1216,31 +1010,19 @@ 14
  • - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
    -
    - - - - Bullet_ChargeLance - - - Things/Projectile/ChargeLanceShot - Graphic_Single - TransparentPostLight - (3,3) - - - Bullet - 19 - 200 - + +
  • + 1 + AmmoSet_80x256mmFuel +
  • +
  • + FALSE + TRUE +
  • +
    + + Gun_ChargeLance @@ -1251,9 +1033,11 @@ 2000 - 1.25 - 0.017 - 2.60 + 1.25 + 0.017 + 4.10 + 18.00 + 7.00 0.5 Never @@ -1265,12 +1049,12 @@
  • - (0.0,0.0) - (0.0,0.0) + (0.0,0.0) + (0.0,0.0) Combat_Realism.Verb_ShootCR true - Bullet_ChargeLance - 85 + Bullet_5x35mmCharged + 120 120 1 ChargeLance_Fire @@ -1278,17 +1062,16 @@ 9
  • - -
  • - Combat_Realism.CompFireModes - FALSE - TRUE -
  • -
  • - Combat_Realism.CompAP - 0.90 -
  • -
    + +
  • + 0 + AmmoSet_5x35mmCharged +
  • +
  • + FALSE + TRUE +
  • +
    diff --git a/Defs/ThingDefs/Weapons_Melee.xml b/Defs/ThingDefs/Weapons_Melee.xml index 0f54660..32666e9 100644 --- a/Defs/ThingDefs/Weapons_Melee.xml +++ b/Defs/ThingDefs/Weapons_Melee.xml @@ -15,7 +15,7 @@ 100 1.0 - 0.5 + 1 0.5 Item @@ -29,19 +29,16 @@
  • WeaponsMelee
  • -
  • - CompForbiddable -
  • +
  • CompEquippable
  • CompQuality
  • -
  • - CompArt - NamerMeleeWeapon - ArtWeaponMelee +
  • + ArtName_WeaponMelee + ArtDescription_WeaponMelee Excellent
  • @@ -51,7 +48,8 @@ Smith Recipe_Smith -
  • TableSmithing
  • +
  • ElectricSmithy
  • +
  • FueledSmithy
  • UnfinishedWeapon @@ -110,7 +108,7 @@ 50 20000 - 12 + 18 0.975 -65 @@ -125,12 +123,6 @@ Cut - -
  • - Combat_Realism.CompAP - 0.25 -
  • -
    @@ -147,7 +139,7 @@ 120 40000 - 15 + 20 1.25 -65 @@ -162,12 +154,6 @@ Cut - -
  • - Combat_Realism.CompAP - 0.275 -
  • -
    @@ -181,11 +167,14 @@ Things/Item/Equipment/WeaponMelee/Knife Graphic_Single + +
  • CR_Sidearm_Melee
  • +
    InteractPistol 40 6000 - 9 + 12 0.83 -65 @@ -199,12 +188,6 @@ Cut - -
  • - Combat_Realism.CompAP - 0.225 -
  • -
    @@ -215,13 +198,16 @@ Things/Item/Equipment/WeaponMelee/Shiv Graphic_Single + +
  • CR_Sidearm_Melee
  • +
    InteractPistol Sellable 10 300 - 8 - 0.25 + 11 + 0.5 0.83 -65 @@ -230,6 +216,13 @@
  • Woody
  • Stony
  • + + +
  • ElectricSmithy
  • +
  • FueledSmithy
  • +
  • CraftingSpot
  • +
    +
  • Verb_MeleeAttack @@ -237,12 +230,6 @@ Cut
  • - -
  • - Combat_Realism.CompAP - 0.2 -
  • -
    @@ -261,7 +248,7 @@ 90 25000 - 14 + 18 1.15 -25 @@ -276,12 +263,6 @@ Stab - -
  • - Combat_Realism.CompAP - 0.275 -
  • -
    @@ -296,7 +277,7 @@ 75 15000 - 14 + 20 1.05 -65 @@ -327,13 +308,14 @@
  • Neolithic
  • NeolithicMelee
  • +
  • CR_Sidearm_Tribal
  • Sellable 40 500 - 10 - 0.25 + 16 + 0.5 1.35 -65 @@ -342,6 +324,13 @@
  • Woody
  • Stony
  • + + +
  • ElectricSmithy
  • +
  • FueledSmithy
  • +
  • CraftingSpot
  • +
    +
  • Verb_MeleeAttack diff --git a/Defs/ThingDefs/Weapons_RangedNeolithic.xml b/Defs/ThingDefs/Weapons_RangedNeolithic.xml index fb8ef80..3a8a012 100644 --- a/Defs/ThingDefs/Weapons_RangedNeolithic.xml +++ b/Defs/ThingDefs/Weapons_RangedNeolithic.xml @@ -16,7 +16,7 @@ 100 1.0 - 1 + 2 0.5 Item @@ -30,24 +30,20 @@
  • WeaponsRanged
  • -
  • - CompForbiddable -
  • +
  • CompEquippable
  • CompQuality
  • -
  • - Combat_Realism.CompGizmos -
  • SmithingSpeed Crafting -
  • TableSmithing
  • +
  • ElectricSmithy
  • +
  • FueledSmithy
  • Smelt
    @@ -66,6 +62,7 @@ Transparent + @@ -83,8 +80,9 @@ false Arrow - 9 - 88 + 10 + 44 + 0.15 @@ -102,37 +100,46 @@ 1200 60 - 0.2 - 1 - 1.0 + 0.35 + 2 + 1 + 4.00 + 2.00 1
  • NeolithicRanged
  • +
  • CR_Bow
  • + + +
  • ElectricSmithy
  • +
  • FueledSmithy
  • +
  • CraftingSpot
  • +
    +
  • Combat_Realism.Verb_ShootCR true - Arrow_Short + Projectile_Arrow 60 27 BowSmall
  • - -
  • - Combat_Realism.CompFireModes -
  • -
  • - Combat_Realism.CompAP - 0.275 -
  • -
    - - -0.20 - -0.04 - + +
  • + 1 + 30 + AmmoSet_Arrow + false +
  • +
  • + false + false +
  • +
    @@ -146,56 +153,56 @@ false Stab - 12 - 52 + 16 + 26 + 0.25 Pila - - A bundle of pila, non-reusable throwing spears. + + A non-reusable throwing spear. - Things/Item/Equipment/WeaponRanged/Pilum - Graphic_Single + Things/Ammo/Neolithic/Pilum + Graphic_StackCount Interact_BeatFire - 120 + 1 + 1 1400 90 - 0.2 - 1 - 1.0 + 0.25 + 2.5 + 2 + 6.00 + 3.00 1 + 30 + 75
  • NeolithicRanged
  • +
  • CR_Pila
  • - Combat_Realism.Verb_ShootCR + Combat_Realism.Verb_ShootCROneUse true Pilum_Thrown 90 - 8 - Interact_BeatFire + 6 +
  • - -
  • - Combat_Realism.CompFireModes -
  • -
  • - Combat_Realism.CompAP - 0.275 -
  • -
    - - -0.20 - -0.04 - + +
  • + false + false +
  • +
    @@ -210,11 +217,10 @@ false Arrow - 11 - 98 + 13 + 49 + 0.2 - - Bow_Great @@ -231,37 +237,39 @@ 1700 110 - 0.2 - 1 - 1.0 + 0.35 + 2 + 1 + 6.00 + 2.00 1
  • NeolithicRanged
  • +
  • CR_Bow
  • Combat_Realism.Verb_ShootCR true - Arrow_Great + Projectile_GreatArrow 80 27 BowGreat
  • - -
  • - Combat_Realism.CompFireModes -
  • -
  • - Combat_Realism.CompAP - 0.3 -
  • -
    - - -0.20 - -0.04 - + +
  • + 1 + 30 + AmmoSet_GreatArrow + false +
  • +
  • + false + false +
  • +
    diff --git a/Defs/ThingDefs/Weapons_Spotting.xml b/Defs/ThingDefs/Weapons_Spotting.xml index cfcddb3..609b40f 100644 --- a/Defs/ThingDefs/Weapons_Spotting.xml +++ b/Defs/ThingDefs/Weapons_Spotting.xml @@ -1,77 +1,6 @@ - - - Item - ThingWithComps - Primary - 10 - True - True - - 35 - - true - - 100 - 1.0 - 1 - 0.5 - - Item - True - Never - Midworld - -
  • WeaponsRanged
  • -
    - -
  • ITab_Art
  • -
    - -
  • - CompForbiddable -
  • -
  • - CompEquippable -
  • -
  • - CompQuality -
  • -
  • - CompArt - NamerGun - ArtWeaponGun - Excellent -
  • -
    - - 20 - -
    - - - - -
  • Gun
  • -
    -
    - - - - Projectile - Normal - Projectile - Combat_Realism.BulletCR - - False - True - - Transparent - - - diff --git a/Defs/ThingDefs_Ammo/Ammo_Advanced.xml b/Defs/ThingDefs_Ammo/Ammo_Advanced.xml new file mode 100644 index 0000000..440b28e --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Advanced.xml @@ -0,0 +1,229 @@ + + + + + Combat_Realism.AmmoThing + + Item + Middle + true + true + Item + 500 + Metal_Drop + Metal_Drop + +
  • + + true + true + false + 15 + +
  • CR_Ammo
  • + + Sellable +
    + + + + + Container holding fuel for incendiary shot firearms. + + 0.3 + 0.5 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo30x64mmFuelCell
  • +
    +
    + + + Ammo_30x64mmFuel_Incendiary + + + Things/Ammo/FuelCell/Incendiary + Graphic_StackCount + + + 1.13 + + Bullet_30x64mmFuel_Incendiary + IncendiaryFuel + + + + Ammo_30x64mmFuel_Thermobaric + + + Things/Ammo/FuelCell/Thermobaric + Graphic_StackCount + + + 1.6 + + Bullet_30x64mmFuel_Thermobaric + ThermobaricFuel + + + + Ammo_30x64mmFuel_Foam + + + Things/Ammo/FuelCell/Foam + Graphic_StackCount + + + 0.52 + + Bullet_30x64mmFuel_Foam + FoamFuel + false + + + + + + Large fuel container for incendiary shot cannons. + + 3.0 + 8 + + +
  • Ammo80x128mmFuelCell
  • +
    +
    + + + Ammo_80x256mmFuel_Thermobaric + + + Things/Ammo/FuelCell/Large + Graphic_StackCount + + + 10.88 + + Bullet_80x256mmFuel_Thermobaric + ThermobaricFuel + + + + + + Charged shot ammo used by advanced assault rifle designs. + + 0.01 + 0.03 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo6x24mmCharged
  • +
    +
    + + + Ammo_6x24mmCharged + + + Things/Ammo/Charged/Regular + Graphic_StackCount + + + 0.49 + + Bullet_6x24mmCharged + Charged + + + + Ammo_6x24mmCharged_AP + + + Things/Ammo/Charged/Concentrated + Graphic_StackCount + + + 0.49 + + Bullet_6x24mmCharged_AP + ChargedAP + + + + Ammo_6x24mmCharged_Ion + + + Things/Ammo/Charged/Ion + Graphic_StackCount + + + 0.49 + + Bullet_6x24mmCharged_Ion + Ionized + false + + + + + + Mechanoid-built charged shot ammo designed for high-velocity fire and armor penetration. + + 0.012 + 0.01 + + +
  • Ammo5x35mmCharged
  • +
    +
    + + + Ammo_5x35mmCharged + + + Things/Ammo/Charged/Concentrated + Graphic_StackCount + + + 0.59 + + Bullet_5x35mmCharged + Charged + + + + + + Mechanoid-built high-caliber charged shot ammo used in heavy weapons. + + 0.1 + 0.1 + + +
  • Ammo12x64mmCharged
  • +
    +
    + + + Ammo_12x64mmCharged + + + Things/Ammo/Charged/Large + Graphic_StackCount + + + 2.96 + + Bullet_12x64mmCharged + Charged + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Grenades.xml b/Defs/ThingDefs_Ammo/Ammo_Grenades.xml new file mode 100644 index 0000000..fb884a4 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Grenades.xml @@ -0,0 +1,94 @@ + + + + + + + Relatively small, low velocity grenade for use in grenade launchers. + + 0.2 + 0.3 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo30x29mmGrenades
  • +
    +
    + + + Ammo_30x29mmGrenade_HE + + + Things/Ammo/GrenadeLauncher/HE + Graphic_StackCount + + + 1.07 + + Bullet_30x29mmGrenade_HE + GrenadeHE + + + + Ammo_30x29mmGrenade_EMP + + + Things/Ammo/GrenadeLauncher/EMP + Graphic_StackCount + + + 1.07 + + Bullet_30x29mmGrenade_EMP + GrenadeEMP + + + + + + Low velocity grenade fired from handheld grenade launchers. + + 0.3 + 0.4 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo40x46mmGrenades
  • +
    +
    + + + Ammo_40x46mmGrenade_HE + + + Things/Ammo/GrenadeLauncher/HE + Graphic_StackCount + + + 1.49 + + Bullet_40x46mmGrenade_HE + GrenadeHE + + + + Ammo_40x46mmGrenade_EMP + + + Things/Ammo/GrenadeLauncher/EMP + Graphic_StackCount + + + 2.02 + + Bullet_40x46mmGrenade_EMP + GrenadeEMP + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_HighCaliber.xml b/Defs/ThingDefs_Ammo/Ammo_HighCaliber.xml new file mode 100644 index 0000000..4fdb7c6 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_HighCaliber.xml @@ -0,0 +1,77 @@ + + + + + + + Large caliber bullet used by many heavy machine guns and anti-materiel rifles. + + 0.11 + 0.1 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo50BMG
  • +
    +
    + + + Ammo_50BMG_FMJ + + + Things/Ammo/HighCaliber/FMJ + Graphic_StackCount + + + 0.40 + + Bullet_50BMG_FMJ + FullMetalJacket + + + + Ammo_50BMG_AP + + + Things/Ammo/HighCaliber/Sabot + Graphic_StackCount + + + 0.40 + + Bullet_50BMG_Sabot + Sabot + + + + Ammo_50BMG_HE + + + Things/Ammo/HighCaliber/HE + Graphic_StackCount + + + 0.52 + + Bullet_50BMG_HE + ExplosiveAP + + + + Ammo_50BMG_Incendiary + + + Things/Ammo/HighCaliber/Incendiary + Graphic_StackCount + + + 0.47 + + Bullet_50BMG_Incendiary + IncendiaryAP + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Neolithic.xml b/Defs/ThingDefs_Ammo/Ammo_Neolithic.xml new file mode 100644 index 0000000..763dbaa --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Neolithic.xml @@ -0,0 +1,64 @@ + + + + + + + Simple arrow design with a cutting head attached to a wooden shaft. + + 0.11 + 0.11 + + +
  • CR_AutoEnableTrade
  • +
    + +
  • AmmoArrows
  • +
    +
    + + + Ammo_Arrow + + + Things/Ammo/Neolithic/Arrow + Graphic_StackCount + + + 0.07 + + Projectile_Arrow + StoneArrow + + + + + + Heavy arrow designed to be fired from a great bow. + + 0.17 + 0.17 + + +
  • CR_AutoEnableTrade
  • +
    + +
  • AmmoGreatArrows
  • +
    +
    + + + Ammo_GreatArrow + + + Things/Ammo/Neolithic/Arrow + Graphic_StackCount + + + 0.09 + + Projectile_GreatArrow + StoneArrow + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Pistols.xml b/Defs/ThingDefs_Ammo/Ammo_Pistols.xml new file mode 100644 index 0000000..971d605 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Pistols.xml @@ -0,0 +1,325 @@ + + + + + + + Ammo_40Rimfire + + Ultra-light cartridge for use in derringer pistols. + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo40Rimfire
  • +
    + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.01 + 0.012 + 0.01 + + Bullet_40Rimfire + FullMetalJacket +
    + + + + + Low caliber handgun cartridge lacking in stopping power. + + 0.01 + 0.02 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo32ACP
  • +
    +
    + + + Ammo_32ACP_FMJ + + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.02 + + Bullet_32ACP_FMJ + FullMetalJacket + + + + + + + + Common pistol cartridge used by a variety of handguns and SMGs. + + 0.01 + 0.02 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo762x25mmTokarev
  • +
    +
    + + + Ammo_762x25mmTokarev_FMJ + + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.02 + + Bullet_762x25mmTokarev_FMJ + FullMetalJacket + + + + Ammo_762x25mmTokarev_AP + + + Things/Ammo/Pistol/AP + Graphic_StackCount + + + 0.03 + + Bullet_762x25mmTokarev_AP + ArmorPiercing + + + + Ammo_762x25mmTokarev_HP + + + Things/Ammo/Pistol/HP + Graphic_StackCount + + + 0.03 + + Bullet_762x25mmTokarev_HP + HollowPoint + + + + + + Common pistol cartridge used by a variety of handguns and SMGs. + + 0.012 + 0.02 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo9x19mmPara
  • +
    +
    + + + Ammo_9x19mmPara_FMJ + + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.04 + + Bullet_9x19mmPara_FMJ + FullMetalJacket + + + + Ammo_9x19mmPara_AP + + + Things/Ammo/Pistol/AP + Graphic_StackCount + + + 0.05 + + Bullet_9x19mmPara_AP + ArmorPiercing + + + + Ammo_9x19mmPara_HP + + + Things/Ammo/Pistol/HP + Graphic_StackCount + + + 0.05 + + Bullet_9x19mmPara_HP + HollowPoint + + + + + + Pistol cartridge favoured for its above average stopping power. + + 0.02 + 0.03 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo45ACP
  • +
    +
    + + + Ammo_45ACP_FMJ + + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.07 + + Bullet_45ACP_FMJ + FullMetalJacket + + + + Ammo_45ACP_AP + + + Things/Ammo/Pistol/AP + Graphic_StackCount + + + 0.09 + + Bullet_45ACP_AP + ArmorPiercing + + + + Ammo_45ACP_HP + + + Things/Ammo/Pistol/HP + Graphic_StackCount + + + 0.09 + + Bullet_45ACP_HP + HollowPoint + + + + + + Ancient pistol cartridge originally designed for revolvers. + + 0.02 + 0.03 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo45Colt
  • +
    +
    + + + Ammo_45Colt_FMJ + + + Things/Ammo/Pistol/FMJ + Graphic_StackCount + + + 0.07 + + Bullet_45Colt_FMJ + FullMetalJacket + + + + Ammo_45Colt_AP + + + Things/Ammo/Pistol/AP + Graphic_StackCount + + + 0.09 + + Bullet_45Colt_AP + ArmorPiercing + + + + Ammo_45Colt_HP + + + Things/Ammo/Pistol/HP + Graphic_StackCount + + + 0.09 + + Bullet_45Colt_HP + HollowPoint + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Rifles.xml b/Defs/ThingDefs_Ammo/Ammo_Rifles.xml new file mode 100644 index 0000000..90f177e --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Rifles.xml @@ -0,0 +1,299 @@ + + + + + + + Small, high-velocity rifle bullet used in a variety of assault rifles. + + 0.012 + 0.03 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo556x45mmNATO
  • +
    +
    + + + Ammo_556x45mmNATO_FMJ + + + Things/Ammo/Rifle/FMJ + Graphic_StackCount + + + 0.04 + + Bullet_556x45mmNATO_FMJ + FullMetalJacket + + + + Ammo_556x45mmNATO_AP + + + Things/Ammo/Rifle/AP + Graphic_StackCount + + + 0.05 + + Bullet_556x45mmNATO_AP + ArmorPiercing + + + + Ammo_556x45mmNATO_HP + + + Things/Ammo/Rifle/HP + Graphic_StackCount + + + 0.05 + + Bullet_556x45mmNATO_HP + HollowPoint + + + + + + Intermediate rifle cartridge used by certain older assault rifles. + + 0.016 + 0.04 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo762x39mmSoviet
  • +
    +
    + + + Ammo_762x39mmSoviet_FMJ + + + Things/Ammo/Rifle/FMJ + Graphic_StackCount + + + 0.06 + + Bullet_762x39mmSoviet_FMJ + FullMetalJacket + + + + Ammo_762x39mmSoviet_AP + + + Things/Ammo/Rifle/AP + Graphic_StackCount + + + 0.08 + + Bullet_762x39mmSoviet_AP + ArmorPiercing + + + + Ammo_762x39mmSoviet_HP + + + Things/Ammo/Rifle/HP + Graphic_StackCount + + + 0.08 + + Bullet_762x39mmSoviet_HP + HollowPoint + + + + + + Large rifle bullet found mostly in outdated bolt-action firearms. + + 0.022 + 0.05 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo303British
  • +
    +
    + + + Ammo_303British_FMJ + + + Things/Ammo/Rifle/FMJ + Graphic_StackCount + + + 0.08 + + Bullet_303British_FMJ + FullMetalJacket + + + + Ammo_303British_AP + + + Things/Ammo/Rifle/AP + Graphic_StackCount + + + 0.10 + + Bullet_303British_AP + ArmorPiercing + + + + Ammo_303British_HP + + + Things/Ammo/Rifle/HP + Graphic_StackCount + + + 0.10 + + Bullet_303British_HP + HollowPoint + + + + + + Large rifle bullet used in machine guns, sniper rifles and the occasional assault rifle. + + 0.025 + 0.05 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo762x51mmNATO
  • +
    +
    + + + Ammo_762x51mmNATO_FMJ + + + Things/Ammo/Rifle/FMJ + Graphic_StackCount + + + 0.09 + + Bullet_762x51mmNATO_FMJ + FullMetalJacket + + + + Ammo_762x51mmNATO_AP + + + Things/Ammo/Rifle/AP + Graphic_StackCount + + + 0.11 + + Bullet_762x51mmNATO_AP + ArmorPiercing + + + + Ammo_762x51mmNATO_HP + + + Things/Ammo/Rifle/HP + Graphic_StackCount + + + 0.11 + + Bullet_762x51mmNATO_HP + HollowPoint + + + + + + Rimmed rifle cartridge used by many machine guns, bolt-action and sniper rifles. + + 0.022 + 0.05 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo762x54mmR
  • +
    +
    + + + Ammo_762x54mmR_FMJ + + + Things/Ammo/Rifle/FMJ + Graphic_StackCount + + + 0.08 + + Bullet_762x54mmR_FMJ + FullMetalJacket + + + + Ammo_762x54mmR_AP + + + Things/Ammo/Rifle/AP + Graphic_StackCount + + + 0.10 + + Bullet_762x54mmR_AP + ArmorPiercing + + + + Ammo_762x54mmR_HP + + + Things/Ammo/Rifle/HP + Graphic_StackCount + + + 0.10 + + Bullet_762x54mmR_HP + HollowPoint + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Rockets.xml b/Defs/ThingDefs_Ammo/Ammo_Rockets.xml new file mode 100644 index 0000000..59933d6 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Rockets.xml @@ -0,0 +1,50 @@ + + + + + + + Relatively small, low velocity grenade for use in grenade launchers. + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • AmmoRPG7Grenades
  • +
    + 25 +
    + + + Ammo_RPG7Grenade_HEAT + + + Things/Ammo/RPG/HEAT + Graphic_StackCount + + + 12.94 + 2.6 + 4 + + Bullet_RPG7Grenade_HEAT + RocketHEAT + + + + Ammo_RPG7Grenade_Thermobaric + + + Things/Ammo/RPG/Thermobaric + Graphic_StackCount + + + 24.70 + 4.5 + 6 + + Bullet_RPG7Grenade_Thermobaric + RocketThermobaric + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Shells.xml.todo b/Defs/ThingDefs_Ammo/Ammo_Shells.xml.todo new file mode 100644 index 0000000..fbb25df --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Shells.xml.todo @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Ammo_Shotgun.xml b/Defs/ThingDefs_Ammo/Ammo_Shotgun.xml new file mode 100644 index 0000000..f6944ca --- /dev/null +++ b/Defs/ThingDefs_Ammo/Ammo_Shotgun.xml @@ -0,0 +1,124 @@ + + + + + + + Low caliber shotgun shell. Its small diameter allows it to be fired from many of the same firearms as the .45 Colt cartridge. + + 0.06 + 0.11 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo410Bore
  • +
    +
    + + + Ammo_410Bore_Buck + + + Things/Ammo/Shotgun/Shot + Graphic_StackCount + + + 0.14 + + Bullet_410Bore_Buck + BuckShot + + + + + + Extremely common shotgun caliber used in almost every application, from hunting over riot control to military firearms. + + 0.08 + 0.15 + + +
  • CR_AutoEnableTrade
  • +
  • CR_AutoEnableCrafting
  • +
    + +
  • Ammo12Gauge
  • +
    +
    + + + Ammo_12Gauge_Buck + + + Things/Ammo/Shotgun/Shot + Graphic_StackCount + + + 0.19 + + Bullet_12Gauge_Buck + BuckShot + + + + Ammo_12Gauge_Bird + + + Things/Ammo/Shotgun/Shot + Graphic_StackCount + + + 0.19 + + Bullet_12Gauge_Bird + BirdShot + + + + Ammo_12Gauge_Slug + + + Things/Ammo/Shotgun/Slug + Graphic_StackCount + + + 0.1 + 0.24 + + Bullet_12Gauge_Slug + Slug + + + + Ammo_12Gauge_Beanbag + + false + + Things/Ammo/Shotgun/Beanbag + Graphic_StackCount + + + 0.16 + + Bullet_12Gauge_Beanbag + Beanbag + + + + Ammo_12Gauge_ElectroSlug + + + Things/Ammo/Shotgun/EMP + Graphic_StackCount + + + 0.47 + + Bullet_12Gauge_ElectroSlug + ElectroSlug + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Ammo/Projectiles_Advanced.xml b/Defs/ThingDefs_Ammo/Projectiles_Advanced.xml new file mode 100644 index 0000000..829e103 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Advanced.xml @@ -0,0 +1,210 @@ + + + + + Projectile + Normal + Projectile + Combat_Realism.BulletCR + + False + True + + Transparent + + + + + + + + Combat_Realism.ProjectileCR_Explosive + + Things/Projectile/InfernoCannonShot + Graphic_Single + TransparentPostLight + + + 60 + + + + + Bullet_30x64mmFuel_Incendiary + + + Flame + 50 + 3.0 + + + + + Bullet_30x64mmFuel_Thermobaric + + + Bomb + 150 + 3.0 + + +
  • + 20 + Flame + 3.0 + MortarBomb_Explode +
  • +
    +
    + + + Bullet_30x64mmFuel_Foam + + + Extinguish + 50 + 5.0 + FilthFireFoam + 1 + + + + + + + Bullet_80x256mmFuel_Thermobaric + + Combat_Realism.ProjectileCR_Explosive + + Things/Projectile/InfernoCannonShot + Graphic_Single + TransparentPostLight + + + 180 + Bomb + 250 + 6.0 + + +
  • + 40 + Flame + 6.0 + MortarBomb_Explode +
  • +
    +
    + + + + + + Things/Projectile/Charge_Small + Graphic_Single + + + Bullet + 180 + + + + + Bullet_6x24mmCharged + + + 15 + +
  • + Bomb_Secondary + 7 +
  • +
    + 0.8 +
    +
    + + + Bullet_6x24mmCharged_AP + + + 15 + +
  • + Bomb_Secondary + 3 +
  • +
    + 0.9 +
    +
    + + + Bullet_6x24mmCharged_Ion + + + 15 + +
  • + Electrical + 3 +
  • +
  • + EMP + 6 +
  • +
    + 0.8 +
    +
    + + + + + Bullet_5x35mmCharged + + + Things/Projectile/ChargeLanceShot + Graphic_Single + TransparentPostLight + (3,3) + + + Bullet + 14 + 260 + +
  • + Bomb_Secondary + 3 +
  • +
    + 1.0 +
    +
    + + + + + Bullet_12x64mmCharged + + + Things/Projectile/Charge_Small + Graphic_Single + TransparentPostLight + + + Bullet + 30 + 220 + +
  • + Bomb_Secondary + 25 +
  • +
    + 1.2 +
    +
    + +
    diff --git a/Defs/ThingDefs/Projectiles_Fragments.xml b/Defs/ThingDefs_Ammo/Projectiles_Fragments.xml similarity index 64% rename from Defs/ThingDefs/Projectiles_Fragments.xml rename to Defs/ThingDefs_Ammo/Projectiles_Fragments.xml index 2102235..db4f35d 100644 --- a/Defs/ThingDefs/Projectiles_Fragments.xml +++ b/Defs/ThingDefs_Ammo/Projectiles_Fragments.xml @@ -1,18 +1,7 @@ - - - Projectile - Normal - Projectile - Combat_Realism.BulletCR - - False - True - - Transparent - + true @@ -22,181 +11,193 @@ - + Fragment_Grenade40mmFragSmall - Things/Projectile/Fragment_Small + Things/Projectile/Fragments/Fragment_Small Graphic_Single Fragment - 8 + 24 160 + 0.4 - + Fragment_Grenade40mmFragMedium - Things/Projectile/Fragment_Medium + Things/Projectile/Fragments/Fragment_Medium Graphic_Single Fragment - 12 + 36 140 + 0.3 - + Fragment_Grenade40mmFragLarge - Things/Projectile/Fragment_Large + Things/Projectile/Fragments/Fragment_Large Graphic_Single false Fragment - 16 + 48 120 + 0.2 - + Fragment_MortarSmall - Things/Projectile/Fragment_Small + Things/Projectile/Fragments/Fragment_Small Graphic_Single Fragment - 12 + 36 160 + 0.4 - + Fragment_MortarMedium - Things/Projectile/Fragment_Medium + Things/Projectile/Fragments/Fragment_Medium Graphic_Single Fragment - 18 + 48 140 + 0.3 - + Fragment_MortarLarge - Things/Projectile/Fragment_Large + Things/Projectile/Fragments/Fragment_Large Graphic_Single false Fragment - 24 + 60 120 + 0.2 - + Fragment_HeatSmall - Things/Projectile/Fragment_Small + Things/Projectile/Fragments/Fragment_Small Graphic_Single Fragment - 12 + 36 160 + 0.4 - + Fragment_HeatMedium - Things/Projectile/Fragment_Medium + Things/Projectile/Fragments/Fragment_Medium Graphic_Single Fragment - 18 + 48 140 + 0.3 - + Fragment_HeatLarge - Things/Projectile/Fragment_Large + Things/Projectile/Fragments/Fragment_Large Graphic_Single false Fragment - 24 + 60 120 + 0.2 - + Fragment_GrenadeFragSmall - Things/Projectile/Fragment_Small + Things/Projectile/Fragments/Fragment_Small Graphic_Single Fragment - 6 + 24 160 + 0.4 - + Fragment_GrenadeFragMedium - Things/Projectile/Fragment_Medium + Things/Projectile/Fragments/Fragment_Medium Graphic_Single Fragment - 9 + 36 140 + 0.3 - + Fragment_GrenadeFragLarge - Things/Projectile/Fragment_Large + Things/Projectile/Fragments/Fragment_Large Graphic_Single false Fragment - 12 + 48 120 + 0.2 diff --git a/Defs/ThingDefs_Ammo/Projectiles_Grenades.xml b/Defs/ThingDefs_Ammo/Projectiles_Grenades.xml new file mode 100644 index 0000000..1d2cda1 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Grenades.xml @@ -0,0 +1,105 @@ + + + + + + + + Things/Projectile/Bullet_Big + Graphic_Single + + + 74 + + + + + Bullet_30x29mmGrenade_HE + + + 1.0 + Bomb + 60 + + +
  • + 2.5 + + 40 + 30 + 8 + +
  • +
    +
    + + + Bullet_30x29mmGrenade_EMP + + + 2.5 + EMP + 40 + + +
  • + 10 + Electrical + 2.5 + MortarEMP_Explode +
  • +
    +
    + + + + + + Things/Projectile/Bullet_Big + Graphic_Single + + + 30 + + + + + Bullet_40x46mmGrenade_HE + + + 1.5 + Bomb + 80 + + +
  • + 3 + + 45 + 35 + 10 + +
  • +
    +
    + + + Bullet_40x46mmGrenade_EMP + + + 3.0 + EMP + 60 + + +
  • + 15 + Electrical + 3.0 + MortarEMP_Explode +
  • +
    +
    + + +
    diff --git a/Defs/ThingDefs_Ammo/Projectiles_HighCaliber.xml b/Defs/ThingDefs_Ammo/Projectiles_HighCaliber.xml new file mode 100644 index 0000000..8e2df6d --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_HighCaliber.xml @@ -0,0 +1,69 @@ + + + + + + + + + + Things/Projectile/Bullet_Big + Graphic_Single + + + Bullet + 186 + + + + + Bullet_50BMG_FMJ + + + 40 + 0.9 + + + + + Bullet_50BMG_Sabot + + + 25 + 1.1 + 244 + + + + + Bullet_50BMG_HE + + + 25 + 0.9 + +
  • + Bomb_Secondary + 25 +
  • +
    +
    +
    + + + Bullet_50BMG_Incendiary + + + 35 + 1.1 + +
  • + Flame_Secondary + 5 +
  • +
    +
    +
    + + +
    diff --git a/Defs/ThingDefs_Ammo/Projectiles_Neolithic.xml b/Defs/ThingDefs_Ammo/Projectiles_Neolithic.xml new file mode 100644 index 0000000..0f625b8 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Neolithic.xml @@ -0,0 +1,68 @@ + + + + + + + + + + Things/Projectile/Arrow_Small + Graphic_Single + + + Arrow + 88 + + + + + Projectile_Arrow + + + 10 + 0.1 + + + + + + + + Things/Projectile/Arrow_Small + Graphic_Single + + + Arrow + 98 + + + + + Projectile_GreatArrow + + + 12 + 0.15 + + + + + + + Pilum_Thrown + + + Things/Projectile/Pilum + Graphic_Single + + + Stab + 14 + 52 + 0.20 + + + + + diff --git a/Defs/ThingDefs_Ammo/Projectiles_Pistols.xml b/Defs/ThingDefs_Ammo/Projectiles_Pistols.xml new file mode 100644 index 0000000..016f844 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Pistols.xml @@ -0,0 +1,222 @@ + + + + + + + Bullet_40Rimfire + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 71 + 6 + 0.1 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 62 + + + + + Bullet_32ACP_FMJ + + + 8 + 0.25 + + + + + Bullet_32ACP_AP + + + 6 + 0.3 + + + + + Bullet_32ACP_HP + + + 11 + 0.2 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 82 + + + + + Bullet_762x25mmTokarev_FMJ + + + 11 + 0.35 + + + + + Bullet_762x25mmTokarev_AP + + + 8 + 0.45 + + + + + Bullet_762x25mmTokarev_HP + + + 14 + 0.275 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 78 + + + + + Bullet_9x19mmPara_FMJ + + + 12 + 0.325 + + + + + Bullet_9x19mmPara_AP + + + 9 + 0.425 + + + + + Bullet_9x19mmPara_HP + + + 15 + 0.25 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 67 + + + + + Bullet_45ACP_FMJ + + + 14 + 0.3 + + + + + Bullet_45ACP_AP + + + 11 + 0.4 + + + + + Bullet_45ACP_HP + + + 17 + 0.225 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 50 + + + + + Bullet_45Colt_FMJ + + + 14 + 0.3 + + + + + Bullet_45Colt_AP + + + 11 + 0.4 + + + + + Bullet_45Colt_HP + + + 17 + 0.225 + + + + + diff --git a/Defs/ThingDefs_Ammo/Projectiles_Rifles.xml b/Defs/ThingDefs_Ammo/Projectiles_Rifles.xml new file mode 100644 index 0000000..975373c --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Rifles.xml @@ -0,0 +1,230 @@ + + + + + + + + + Bullet_556x45mmNATO_FMJ + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 14 + 188 + 0.525 + + + + + Bullet_556x45mmNATO_AP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 11 + 188 + 0.625 + + + + + Bullet_556x45mmNATO_HP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + false + Bullet + 17 + 188 + 0.375 + + + + + + + Bullet_762x39mmSoviet_FMJ + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 16 + 146 + 0.55 + + + + + Bullet_762x39mmSoviet_AP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 13 + 146 + 0.65 + + + + + Bullet_762x39mmSoviet_HP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 19 + 146 + 0.4 + + + + + + + Bullet_303British_FMJ + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 18 + 169 + 0.6 + + + + + Bullet_303British_AP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 15 + 169 + 0.7 + + + + + Bullet_303British_HP + + + Things/Projectile/Bullet_Small + Graphic_Single + + + false + Bullet + 21 + 169 + 0.45 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 167 + + + + + Bullet_762x51mmNATO_FMJ + + + 18 + 0.6 + + + + + Bullet_762x51mmNATO_AP + + + 15 + 0.7 + + + + + Bullet_762x51mmNATO_HP + + + 21 + 0.45 + + + + + + + + Things/Projectile/Bullet_Small + Graphic_Single + + + Bullet + 157 + + + + + Bullet_762x54mmR_FMJ + + + 18 + 0.6 + + + + + Bullet_762x54mmR_AP + + + 15 + 0.7 + + + + + Bullet_762x54mmR_HP + + + 21 + 0.45 + + + + + diff --git a/Defs/ThingDefs_Ammo/Projectiles_Rockets.xml b/Defs/ThingDefs_Ammo/Projectiles_Rockets.xml new file mode 100644 index 0000000..d4e7b09 --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Rockets.xml @@ -0,0 +1,81 @@ + + + + + + + + 60 + + + + + Bullet_RPG7Grenade_HEAT + + + Things/Projectile/RPG/HEAT + Graphic_Single + + + Bullet + 150 + 10 + + +
  • + 30 + Bomb + 1.0 + Explosion_Bomb +
  • +
    +
    + + + Bullet_RPG7Grenade_Thermobaric + + + Things/Projectile/RPG/Thermobaric + Graphic_Single + + + 7.5 + Bomb + 300 + + +
  • + 50 + Flame + 7.5 + MortarBomb_Explode +
  • +
    +
    + + + Bullet_RPG7Grenade_Frag + + + Things/Projectile/RPG/Thermobaric + Graphic_Single + + + 1.5 + Bomb + 50 + + +
  • + 10 + + 150 + 90 + 30 + +
  • +
    +
    + + +
    diff --git a/Defs/ThingDefs_Ammo/Projectiles_Shotgun.xml b/Defs/ThingDefs_Ammo/Projectiles_Shotgun.xml new file mode 100644 index 0000000..a938a8c --- /dev/null +++ b/Defs/ThingDefs_Ammo/Projectiles_Shotgun.xml @@ -0,0 +1,113 @@ + + + + + + + + Bullet + 70 + + + + + Bullet_410Bore_Buck + + + Things/Projectile/Shotgun_Pellet + Graphic_Single + + + 12 + 5 + 0.3 + 8.5 + + + + + + + + Bullet + 70 + + + + + Bullet_12Gauge_Buck + + + Things/Projectile/Shotgun_Pellet + Graphic_Single + + + 10 + 8 + 0.3 + 5 + + + + + Bullet_12Gauge_Bird + + + Things/Projectile/Shotgun_Pellet + Graphic_Single + + + 4 + 40 + 8.5 + 0.1 + + + + + Bullet_12Gauge_Slug + + + Things/Projectile/Bullet_big + Graphic_Single + + + 110 + 30 + 0.3 + + + + + Bullet_12Gauge_Beanbag + + + Things/Projectile/Bullet_big + Graphic_Single + + + Beanbag + 6 + + + + + Bullet_12Gauge_ElectroSlug + + + Things/Projectile/Bullet_big + Graphic_Single + + + EMP + 20 + +
  • + Electrical + 5 +
  • +
    +
    +
    + +
    diff --git a/Defs/ThingDefs_Buildings/Buildings_Exotic.xml b/Defs/ThingDefs_Buildings/Buildings_Exotic.xml new file mode 100644 index 0000000..d9e92f9 --- /dev/null +++ b/Defs/ThingDefs_Buildings/Buildings_Exotic.xml @@ -0,0 +1,163 @@ + + + + + Building + Building + BulletImpactMetal + true + MapMeshAndRealTime + Light + Repair + true + BuildingRubble + +
  • + Bomb + 2 +
  • +
  • + Bullet + 0.1 +
  • +
  • + Fragment + 0.1 +
  • +
  • + Electrical + 0.5 +
  • +
    +
    + + + CrashedPsychicEmanatorShipPart + + A mysterious crashed piece of a spaceship. It may contain exotic materials, computers, even AI personas. This kind of technology can be dangerous. + Building_PsychicEmanator + Building + + Things/Building/Exotic/CrashedShipPart + Graphic_Single + (6,3) + + BuildingTall + 150 + Impassable + 1.0 + (6,3) + + 1200 + 0 + -100 + + Normal + false + + 1 + 280 + 140 + 2 + + true + true + true + Light + BulletImpactMetal + MapMeshOnly + ConstructMetal + false + 1.0 + true + + CrashedShipPart_Ambience + + + + + CrashedPoisonShipPart + + A mysterious crashed piece of a spaceship. It may contain exotic materials, computers, even AI personas. This one seems to be poisoning the ground around it. + Building_PoisonShipPart + Building + + Things/Building/Exotic/CrashedPoisonShipPart + Graphic_Single + (6,3) + + BuildingTall + 150 + Impassable + 1.0 + (6,3) + + 1000 + 0 + -100 + + Normal + false + + 230 + 120 + 2 + + true + true + true + Light + BulletImpactMetal + MapMeshOnly + ConstructMetal + false + 1.0 + true + + CrashedShipPart_Ambience + + + + + ShipChunk + + A chunk of a spacecraft. Can be deconstructed to yield useful steel and components. + Building + + Things/Building/Exotic/ShipChunk + Graphic_Random + (2,2) + + (0.1,0.1,1.8,1.8) + + + (1.6,0.5,1.25) + (0,0,-0.13) + + + BuildingTall + 35 + PassThroughOnly + 0.8 + (2,2) + + 300 + 0 + -20 + 12000 + + false + + 2 + + + 11 + 40 + + true + BulletImpactMetal + MapMeshOnly + ConstructMetal + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs/Buildings_Natural.xml b/Defs/ThingDefs_Buildings/Buildings_Natural.xml similarity index 62% rename from Defs/ThingDefs/Buildings_Natural.xml rename to Defs/ThingDefs_Buildings/Buildings_Natural.xml index 808d891..d5e5748 100644 --- a/Defs/ThingDefs/Buildings_Natural.xml +++ b/Defs/ThingDefs_Buildings/Buildings_Natural.xml @@ -9,15 +9,19 @@
  • Bomb - 1.5 + 2
  • Bullet - 0.03 + 0.05
  • Fragment - 0.03 + 0.05 +
  • +
  • + Electrical + 0.0
  • @@ -221,5 +225,121 @@
    + + + MineableJade + + + Things/Building/Linked/RockFlecked_Atlas + Graphic_Single + CutoutComplex + (68,83,68) + (30,173,25) + + + 1500 + + Rock containing bits of jade. + + true + Jade + 35 + 0.065 + + 1 + 6 + + + + + + + MineableComponents + + + Things/Building/Linked/CompactedMachinery_Atlas + Graphic_Single + CutoutComplex + + + 2000 + + Ancient machinery, compacted over time. Can be mined for useful components. + + true + Components + 2 + 1.00 + + 3 + 6 + + + + + + + + Ethereal + + SteamGeyser + SteamGeyser + + Things/Building/Natural/SteamGeyser + Graphic_Single + Transparent + (4,4) + + Floor + false + false + Normal + true + Natural steam source. + (2,2) + true + true + + + + Hive + + A bug hive. Will spawn additional bugs and hives over time. + Hive + + Things/Building/Natural/Hive + Graphic_Single + 1.6 + + BuildingTall + false + + 300 + 1.0 + + 10 + Rare + PassThroughOnly + +
  • + InsectJelly + 20 + 26000 + 100 + true +
  • +
  • + 7 + 38 +
  • +
  • + + -20 + 9999 + + 8 +
  • +
    +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Buildings/Buildings_Power.xml b/Defs/ThingDefs_Buildings/Buildings_Power.xml new file mode 100644 index 0000000..863f823 --- /dev/null +++ b/Defs/ThingDefs_Buildings/Buildings_Power.xml @@ -0,0 +1,229 @@ + + + + + + + + + + SolarGenerator + + Building_PowerPlantSolar + + Things/Building/Power/SolarCollector + Graphic_Single + (4,4) + + (0,0.6,4,2.8) + + + Waist + PassThroughOnly + 70 + 0.5 + true + + 300 + 2500 + 1.0 + + Normal + Produces electricity from sunlight. Does not work in the dark. + (4,4) + + true + + + 100 + 3 + + +
  • + CompPowerTrader + -1 + true +
  • +
  • + + Light + Power + 0.20 + L + ConstructMetal + + + + + GeothermalGenerator + + Building_PowerPlantSteam + + Things/Building/Power/GeothermalPlant + Graphic_Single + (6,6) + + (0.3,0,5.4,6) + + + BuildingTall + Impassable + true + 1 + true + + 500 + 6000 + 1.0 + -40 + + Normal + Produces electricity from geothermal steam geysers. Must be placed on a geyser. + (6,6) + + 400 + 8 + + +
  • + CompPowerTrader + -3600 + true +
  • +
  • + + false + Heavy + Power + 1.0 + +
  • PlaceWorker_OnSteamGeyser
  • + + + GeothermalPlant_Ambience + true + + ConstructMetal + G +
  • GeothermalPower
  • +
    + + + + FueledGenerator + + Building_PowerPlant + + Things/Building/Power/FueledGenerator + Graphic_Single + (2,2) + + BuildingTall + Impassable + 150 + 1.0 + false + false + + 300 + 2500 + 1.0 + + Normal + Produces power by consuming wood fuel. Must be fueled by hand. + (2,2) + + true + + + 100 + 2 + + +
  • + CompPowerTrader + -1000 + true +
  • +
  • +
  • + 12.0 + 100.0 + + +
  • WoodLog
  • +
    + + +
  • + 6 + (217,112,33,0) +
  • +
  • + CompHeatPusherPowered + 4 +
  • +
  • + + Heavy + Power + 0.5 + F + ConstructMetal + + + + Battery + + Building_Battery + + Things/Building/Power/Battery + Graphic_Multi + (2,3) + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + + + BuildingTall + PassThroughOnly + 70 + true + 0.40 + Normal + MinifiedFurniture + + 100 + 800 + 1.0 + -18 + + Stores electricity when there is excess power and yields it when there is not. Warning - charged batteries tend to explode when heated or wet. + (1,2) + + true + + + 50 + 2 + + +
  • + 1000 + 0.5 + true + true +
  • +
  • + + Light + Power + 0.5 + ConstructMetal + B + + + + \ No newline at end of file diff --git a/Defs/ThingDefs_Buildings/Buildings_Power_WindTurbine.xml b/Defs/ThingDefs_Buildings/Buildings_Power_WindTurbine.xml new file mode 100644 index 0000000..0a64410 --- /dev/null +++ b/Defs/ThingDefs_Buildings/Buildings_Power_WindTurbine.xml @@ -0,0 +1,56 @@ + + + + + WindTurbine + Building_WindTurbine + + A wind-powered electrical generator. Requires a large clear space in front and behind for optimal air flow. + + Things/Building/Power/WindTurbine/WindTurbineBody + Graphic_Single + (5,2) + + (0.2, 1.0, 0.8) + + + (2,0.15,1,1.4) + + + BuildingTall + Impassable + 0.5 + + 150 + 3300 + 0.4 + -12 + + Normal + (5,2) + true + true + true + Power + + true + + + 100 + 2 + + ConstructMetal + +
  • PlaceWorker_WindTurbine
  • + + +
  • + CompPowerTrader + -2000 + true +
  • +
  • + + + + \ No newline at end of file diff --git a/Defs/ThingDefs/Buildings_Security.xml b/Defs/ThingDefs_Buildings/Buildings_Security.xml similarity index 57% rename from Defs/ThingDefs/Buildings_Security.xml rename to Defs/ThingDefs_Buildings/Buildings_Security.xml index 9f0dccd..cb003d5 100644 --- a/Defs/ThingDefs/Buildings_Security.xml +++ b/Defs/ThingDefs_Buildings/Buildings_Security.xml @@ -1,20 +1,6 @@  - - Building - BulletImpactMetal - true - MapMeshAndRealTime - Light - Repair - true - BuildingRubble - - - - - Sandbags @@ -25,7 +11,7 @@ Graphic_Single Basic -
  • Custom1
  • +
  • Sandbags
  • @@ -46,16 +32,6 @@ true - -
  • - Bullet - 0.3 -
  • -
  • - Fragment - 0.3 -
  • -
    Cover from gunfire. 1 @@ -84,50 +60,52 @@ Things/Building/Security/TurretImprovised Graphic_Single (3,3) + + (0.2,0.2,0.6,0.6) + - TurretGun_Kit Waist - 110 + 100 1.0 2500 -60 - -
  • - Bomb - 2 -
  • -
    Normal + TurretGun_Kit -
  • - CompForbiddable +
  • + 3.9 + Bomb
  • -
  • +
  • +
  • CompPowerTrader 350
  • -
  • - Combat_Realism.CompTurretInit -
  • +
  • +
  • - A weak improvised turret that automatically fires at nearby enemies. + An improvised turret that automatically fires at nearby enemies. Explodes when damaged. Its hacked-together AI brain isn't very smart, and can't be directly controlled, so beware of friendly fire. PassThroughOnly 50 - 0.75 + 0.4 true true
  • Metallic
  • - 150 - true + 75 + + 100 + 3 + Light + 25.9 true Gun_TurretImprovised - 180 + 410 Things/Building/Security/TurretImprovised_Top U @@ -143,6 +121,10 @@ Things/Building/Security/TurretMortarBase Graphic_Single (4,4) + + (0.38,0.2,0.56375,0.8) + Damage/Corner + Waist True @@ -155,11 +137,8 @@ Normal -
  • - CompForbiddable -
  • -
  • - CompMannable +
  • +
  • Violent
  • @@ -167,7 +146,7 @@ (2,2) PassThroughOnly 50 - 0.6 + 0.4 true
  • Metallic
  • @@ -176,7 +155,6 @@ 150 - false Light Security @@ -194,7 +172,7 @@
  • PlaceWorker_NotUnderRoof
  • - Mortars +
  • Mortars
  • @@ -207,6 +185,10 @@ Things/Building/Security/TurretMortarBase Graphic_Single (4,4) + + (0.38,0.2,0.56375,0.8) + Damage/Corner + Waist True @@ -219,11 +201,8 @@ Normal -
  • - CompForbiddable -
  • -
  • - CompMannable +
  • +
  • Violent
  • @@ -231,7 +210,7 @@ (2,2) PassThroughOnly 50 - 0.6 + 0.4 true
  • Metallic
  • @@ -240,7 +219,6 @@ 150 - false Light Security @@ -258,7 +236,7 @@
  • PlaceWorker_NotUnderRoof
  • - Mortars +
  • Mortars
  • @@ -272,6 +250,10 @@ Things/Building/Security/TurretMortarBase Graphic_Single (4,4) + + (0.38,0.2,0.56375,0.8) + Damage/Corner + Waist True @@ -284,11 +266,8 @@ Normal -
  • - CompForbiddable -
  • -
  • - CompMannable +
  • +
  • Violent
  • @@ -296,7 +275,7 @@ (2,2) PassThroughOnly 50 - 0.6 + 0.4 true
  • Metallic
  • @@ -305,7 +284,6 @@ 150 - false Light Security @@ -322,7 +300,145 @@
  • PlaceWorker_NotUnderRoof
  • - Mortars +
  • Mortars
  • + + + + + + TrapDeadfall + + Building_TrapRearmable + + Things/Building/Security/DeadfallArmed + Graphic_Single + + (0,0,1,0.15) + + + Waist + RealtimeOnly + false + Normal + + 40 + 2000 + -4 + 60 + 0.8 + + A suspended spiked weight held up by a delicate trigger. When the victim disturbs the trigger, the weight is released and falls on his head or torso. + +
  • Metallic
  • +
  • Woody
  • +
  • Stony
  • +
    + 70 + Security + L + + true + Sharp + + Things/Building/Security/DeadfallUnarmed + Graphic_Single + Cutout + + +
    + + + + + TrapIEDBomb + + Building_TrapExplosive + + Things/Building/Security/IEDBomb + Graphic_Single + + (0.1,0,0.8,0.3) + + + Waist + RealtimeOnly + false + Normal + + 40 + 2000 + -4 + 0.8 + + An artillery shell connected to a homemade trigger. When someone disturbs the trigger, the shell explodes. The improvised trigger has a random delay that might allow a nimble enemy to escape. + + 1 + 1 + + Security + M + + true + + +
  • + 2.9 + Bomb + 0.2 + + 15 + 70 + +
  • +
    +
  • IEDBomb
  • +
    + + + + + TrapIEDIncendiary + + Building_TrapExplosive + + Things/Building/Security/IEDIncendiary + Graphic_Single + + (0.1,0,0.8,0.3) + + + Waist + RealtimeOnly + false + Normal + + 40 + 2000 + -4 + 0.8 + + Explosives mixed into an incendiary paste with a chemical trigger for dispersal. Its chemical trigger is simple and reliable. + + 1 + 1 + + Security + N + + true + + +
  • + 2.9 + Flame + 0.2 + + 10 + 50 + +
  • +
    +
  • IEDIncendiary
  • diff --git a/Defs/ThingDefs_Buildings/Buildings_Ship.xml b/Defs/ThingDefs_Buildings/Buildings_Ship.xml new file mode 100644 index 0000000..07a334e --- /dev/null +++ b/Defs/ThingDefs_Buildings/Buildings_Ship.xml @@ -0,0 +1,285 @@ + + + + + + + Ship_Beam + + Building + + Things/Building/Ship/ShipBeam + Graphic_Multi + (3,7) + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + + + BuildingTall + Impassable + true + 1 + true + + 8000 + 400 + 1.0 + + Normal + A structural beam around which a ship can be constructed. + (1,5) + Ship + +
  • + CompPowerTransmitter + true +
  • +
  • + + +
  • PlaceWorker_NotUnderRoof
  • + + + true + true + + + 200 + 150 + 2 + + Heavy + 1.0 + +
  • ShipBasics
  • +
    +
    + + + + + + + + + + + Ship_CryptosleepCasket + + Building_CryptosleepCasket + + Things/Building/Ship/ShipCryptosleepCasket + Graphic_Multi + (2,3) + +
  • ShipCryptosleep
  • + BuildingTall + PassThroughOnly + 70 + true + 0.5 + + 8000 + 200 + 1.0 + + Normal + A cryptosleep casket hardened against the dangers of space. Capable of maintaining a person in cryptosleep for centuries in a space environment and surviving atmospheric re-entry. + (1,2) + Ship + true + (1,0,0) + +
  • + CompPowerTransmitter + true +
  • +
  • +
  • + 2.66 + Flame +
  • +
    + +
  • PlaceWorker_HeadOnShipBeam
  • +
  • PlaceWorker_NotUnderRoof
  • +
    + + true + true + true + + + 500 + 4 + + Heavy + 1.0 +
    + + + + + + Ship_ComputerCore + + Building_ShipComputerCore + + Things/Building/Ship/ShipComputerCore + Graphic_Multi + (3,3) + +
  • ShipComputerCore
  • + BuildingTall + Impassable + true + 1 + true + + 16000 + 150 + 1.0 + + Normal + A computer core capable of housing a superhumanlike AI who can guide a ship through any challenge. + (1,1) + Ship + +
  • +
  • + CompPowerTransmitter + true +
  • +
    + +
  • PlaceWorker_NotUnderRoof
  • +
    + + true + true + + + 800 + 5 + 1 + + Heavy + 1.0 +
    + + + + + + + + Ship_Reactor + + Building + + Things/Building/Ship/ShipReactor + Graphic_Multi + (7,7) + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + + +
  • ShipReactor
  • + BuildingTall + Impassable + true + 1 + true + + 50000 + 500 + 1.0 + + Normal + Powers a ship on its journey through space. + (5,5) + Ship + + true + true + + + 500 + 500 + 10 + + +
  • + CompPowerTrader + -1000 + true +
  • +
  • + + +
  • PlaceWorker_NotUnderRoof
  • + + Heavy + 1.0 +
    + + + + + + Ship_Engine + + Building + + Things/Building/Ship/ShipEngine + Graphic_Multi + (4,5) + +
  • ShipEngine
  • + BuildingTall + Impassable + true + 1 + true + + 40000 + 400 + 1.0 + + Normal + An antimatter-powered engine capable of launching a ship into orbit and on interstellar trajectories. + (2,3) + Ship + +
  • + CompPowerTransmitter + true +
  • +
  • + + +
  • PlaceWorker_NotUnderRoof
  • + + + true + true + + + 400 + 200 + 6 + + Heavy + 1.0 +
    + + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Buildings/Buildings_Structure.xml b/Defs/ThingDefs_Buildings/Buildings_Structure.xml new file mode 100644 index 0000000..4b9b6d9 --- /dev/null +++ b/Defs/ThingDefs_Buildings/Buildings_Structure.xml @@ -0,0 +1,173 @@ + + + + + + + + Building_Door + Blueprint_Door + Building + + Things/Building/Door/Door_Blueprint + + DoorMoveable + 1 + true + +
  • Metallic
  • +
  • Woody
  • +
  • Stony
  • +
    + + 250 + 1.0 + + false + true + Normal + false + BulletImpactMetal + Light + Structure + true + 1.0 + true + RealtimeOnly + + DoorOpenPowered + DoorClosePowered + DoorOpenManual + DoorCloseManual + true + true + + +
  • + + + + + + + Door + + Divides rooms. Must be manually opened and closed, which slows people down. + + 850 + + + Things/Building/Door/DoorSimple_Mover + Graphic_Single + + (0,0.1,1,0.8) + + + Things/Building/Door/DoorSimple_MenuIcon + 25 + P + + + + + Autodoor + + Divides rooms. Powered operation allows people to move through the door without slowing down. + + 1100 + + + Things/Building/Door/Autodoor_Mover + Graphic_Single + + (0,0.1,1,0.8) + + + Things/Building/Door/Autodoor_MenuIcon + + 40 + 2 + + 25 + +
  • + CompPowerTrader + 50 +
  • +
  • + + O + + + + + + + + + + + + Wall + + Building + Building + An impassable wall. Capable of holding up a roof. + + Things/Building/Linked/Wall + Graphic_Appearances + CornerFiller + +
  • Wall
  • +
  • Rock
  • + + + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Corner + Damage/Edge + Damage/Edge + Damage/Edge + Damage/Edge + + + + Things/Building/Linked/Wall_Blueprint_Atlas + + Things/Building/Linked/WallSmooth_MenuIcon + + 350 + 150 + 1.0 + + 5 + false + BuildingTall + Impassable + true + 1 + true + 1 + Never + false + true + true + Heavy + true + Structure + 1.0 + true + +
  • Metallic
  • +
  • Woody
  • +
  • Stony
  • +
    + + true + true + + B +
    + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Items/Items_Meals.xml b/Defs/ThingDefs_Items/Items_Meals.xml new file mode 100644 index 0000000..d269464 --- /dev/null +++ b/Defs/ThingDefs_Items/Items_Meals.xml @@ -0,0 +1,170 @@ + + + + + + Meal + Item + true + true + + 50 + 1.0 + 1.0 + 4 + + Item + 10 + Rare + "Meal lacks desc." + true + +
  • FoodMeals
  • +
    + true + +
  • + + 15 + Last + true + + Meal, Processed + 1 + + + + + +
  • + 4 + true +
  • +
    +
    + + + + + + + + + + MealSurvivalPack + + A high-quality packaged meal, manufactured for use in survival situations. + + Things/Item/Meal/SurvivalPack + Graphic_Single + + + 0.5 + 30 + + + Fine + 0.90 + 0.02 + EatVegetarian + Meal_Eat + + + + + + MealNutrientPaste + + A synthetic mixture of protein, carbohydrates, and vitamins, amino acids and minerals. Everything the body needs, and absolutely disgusting. + + Things/Item/Meal/NutrientPaste + Graphic_Single + + + 20 + 15 + + + Awful + 0.90 + -0.04 + AteNutrientPasteMeal + EatVegetarian + Meal_Eat + + + + + + MealSimple + + A simple meal quickly cooked from a few ingredients. + + Things/Item/Meal/Simple + Graphic_Single + + + 20 + 25 + 300 + + + Simple + 0.85 + 0.02 + EatVegetarian + Meal_Eat + + + + + + MealFine + + A complex dish assembled with care from a wide selection of ingredients. + + Things/Item/Meal/Fine + Graphic_Single + + + 20 + 28 + 450 + + + Fine + 0.90 + 0.045 + AteFineMeal + EatVegetarian + Meal_Eat + + + + + + MealLavish + + A masterpiece of the culinary arts, this meal nourishes the body, mind, and soul. + + Things/Item/Meal/Lavish + Graphic_Single + + + 20 + 40 + 800 + + + Lavish + 1.00 + 0.065 + AteLavishMeal + EatVegetarian + Meal_Eat + + + + + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Items/Items_Resource_Manufactured.xml b/Defs/ThingDefs_Items/Items_Resource_Manufactured.xml new file mode 100644 index 0000000..1d8fd7a --- /dev/null +++ b/Defs/ThingDefs_Items/Items_Resource_Manufactured.xml @@ -0,0 +1,180 @@ + + + + + + + HerbalMedicine + + A pack of herbal concoctions typically extracted from the healroot plant. Less potent than industrial pharmaceuticals, but much better than nothing. + Medicine + + Things/Item/Resource/MedicineHerbal + Graphic_Single + + Standard_Drop + Standard_Drop + + 100 + 5 + 1.0 + 0.75 + 10 + 0.2 + 1.0 + + +
  • Medicine
  • +
    + Rare + +
  • + 150 +
  • +
    +
    + + + + Medicine + + Medical staff use these supplies to heal the wounded. + Medicine + + Things/Item/Resource/Medicine + Graphic_Single + + Standard_Drop + Standard_Drop + + 100 + 18 + 1.0 + 1.0 + 2 + 0.2 + 1.0 + + +
  • Medicine
  • +
    +
    + + + + GlitterworldMedicine + + Advanced medical supplies from a high-tech glitterworld. + Medicine + + Things/Item/Resource/MedicineGlitterworld + Graphic_Single + + Standard_Drop + Standard_Drop + + 100 + 1.0 + 1.6 + 0.2 + 1.0 + + +
  • Medicine
  • +
    + +
  • Exotic
  • +
    +
    + + + + + + + ArtilleryShell + + Fired from artillery cannons. + + Things/Item/Resource/Shell + Graphic_Single + + Metal_Drop + Standard_Drop + Normal + 25 + + 70 + 14 + 1.0 + 2 + 3.25 + 5 + + +
  • Manufactured
  • +
    + +
  • + 2.9 + Bomb + 0.4 + 0.333 + + 10 + 30 + +
  • +
    +
    + + + + + + Prometheum + + Military-grade incendiary agent, ignites on contact with oxygen. The raw resource is used to craft incendiary ammo of all kinds. + + Things/Resources/Prometheum + Graphic_StackCount + + Metal_Drop + Standard_Drop + 25 + + 70 + 6 + 1.0 + 1.5 + 5 + + +
  • Manufactured
  • +
    +
    + + + FSX + + High-explosive chemical extracted from Boomalope sacks, it is used in a variety of industrial and military applications. + + Things/Resources/FSX + Graphic_StackCount + + Metal_Drop + Standard_Drop + 25 + + 70 + 10 + 1.0 + 2 + 5 + + +
  • Manufactured
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_Items/Items_Resource_Stuff.xml b/Defs/ThingDefs_Items/Items_Resource_Stuff.xml new file mode 100644 index 0000000..a8b348a --- /dev/null +++ b/Defs/ThingDefs_Items/Items_Resource_Stuff.xml @@ -0,0 +1,466 @@ + + + + + + + + Silver + + This metal is mostly used as a commodity currency. It can also be used for making attractive decorations. + + Things/Item/Resource/Silver + Graphic_Single + + First + Silver_Drop + Silver_Drop + false + true + + 1 + 0.05 + 0.01 + 0.5 + 1.1 + + +
  • ResourcesRaw
  • +
    + 500 + true + + +
  • Metallic
  • +
    + (180,173,150) + ConstructMetal + BulletImpactMetal + MeleeHit_Metal_Sharp + MeleeHit_Metal_Blunt + + 6 + + + 0.7 + 0.2 + 3 + 1.2 + 1 + + true +
    +
    + + + + Gold + + The most seductive metal of them all. Millions have died in attempting to feed the endless human thirst for gold. This soft metal is little use on its own, but is strikingly beautiful and very rare. + + Things/Item/Resource/Gold + Graphic_Single + + Silver_Drop + Silver_Drop + false + + 15 + 0.1 + 0.01 + 0.3 + 1.15 + + +
  • ResourcesRaw
  • +
    + 500 + true + + golden + +
  • Metallic
  • +
    + (255,235,122) + ConstructMetal + BulletImpactMetal + MeleeHit_Metal_Sharp + MeleeHit_Metal_Blunt + + 18 + + + 0.6 + 0.2 + 6 + 1.3 + 1.1 + + true +
    +
    + + + + + Steel + + An iron-carbon metal alloy used for building structures, tools, and weapons. + + Things/Item/Resource/Metal + Graphic_Random + (255,255,255) + + Metal_Drop + Metal_Drop + + 2.0 + 1.0 + 0.3 + 1 + 1 + + false + ChunkSlagSteel + +
  • ResourcesRaw
  • +
    + + +
  • Metallic
  • +
  • Steeled
  • +
    + ConstructMetal + (102,102,105) + BulletImpactMetal + MeleeHit_Metal_Sharp + MeleeHit_Metal_Blunt + + 1 + 1 + 0.2 + 1 + + true +
    +
    + + + + + Plasteel + + Advanced spacer tech structural material. Plasteel is extremely strong due to its unique molecular structure. + + Things/Item/Resource/Plasteel + Graphic_Single + + Metal_Drop + Metal_Drop + false + + 27 + 0.8 + 0.3 + 1.2 + 1.0 + + +
  • ResourcesRaw
  • +
    + + +
  • Metallic
  • +
  • Steeled
  • +
    + ConstructMetal + (160,178,181) + BulletImpactMetal + MeleeHit_Metal_Sharp + MeleeHit_Metal_Blunt + + 0.0 + 0.18 + 0 + 0.0 + + + 2.8 + 1.2 + 0.1 + 2.0 + 0.8 + 0.8 + 0.8 + 1.0 + 1.15 + + true +
    +
    + + + + + WoodLog + + Wood from trees or other fibrous plants. Useful for building structures, weapons, and even simple prosthetics. A raw stick of wood can be used as a weapon in a pinch. + + Things/Item/Resource/WoodLog + Graphic_StackCount + + -20 + Wood_Drop + Wood_Drop + + 1.4 + 150 + 1.0 + 2 + 8 + 2.2 + 0.7 + 0.3 + 0.1 + 0.3 + + + wooden + +
  • Woody
  • +
    + (133,97,67) + ConstructWood + Planks + BulletImpactWood + MeleeHit_Wood + MeleeHit_Wood + + 2 + + + 0.5 + 1.25 + 1 + 0.7 + 1.2 + 0.9 + 0.1 + +
    + true + +
  • ResourcesRaw
  • +
    + +
  • Poor
  • +
    + +
  • + Verb_MeleeAttack + true + Blunt +
  • +
    +
    + + + + Uranium + + An extremely hard, dense metal. While it is best known for its use powering nuclear reactors, its physical properties also make it excellent in some roles as a tool, weapon, or armor. + + Things/Item/Resource/Uranium + Graphic_Single + + Metal_Drop + Metal_Drop + + 5 + 2.5 + 0.3 + 1.1 + 1.4 + + +
  • ResourcesRaw
  • +
    + 500 + true + + +
  • Metallic
  • +
    + (100,100,100) + ConstructMetal + BulletImpactMetal + MeleeHit_Metal_Sharp + MeleeHit_Metal_Blunt + + 2.5 + 1.9 + 0.4 + 0.0 + 0.9 + 1.35 + + true +
    +
    + + + + Jade + + A hard, green stone. Because of its beauty and rarity, jade is often used for ornaments and decorations. It's hardness and density also makes it a good material for blunt weapons. + + Things/Item/Resource/Jade + Graphic_Single + + ChunkRock_Drop + ChunkRock_Drop + + 5 + 1.0 + 0.3 + 0.8 + 1.5 + + +
  • ResourcesRaw
  • +
    + 500 + true + + +
  • Stony
  • +
    + (85,118,69) + ConstructMetal + BulletImpactMetal + MeleeHit_Stone + MeleeHit_Stone + + 9 + + + 0.5 + 1.5 + 3 + 0.2 + 1.3 + 1.3 + + false +
    +
    + + + + + + + + + + + + DevilstrandCloth + + Fabric spun from microfibers extracted from silk-producing Devilstrand mushrooms. Very tough, but insulates no better than cloth. + + Things/Item/Resource/Cloth + Graphic_Single + (180,60,60) + + + 100 + 12 + 1.0 + 3 + 0.1 + 0.3 + + + +
  • Fabric
  • +
    + (180,60,60) + + 0.05 + 0.05 + 0 + 0.05 + 0.5 + 0.5 + 0.5 + + + 1.3 + 1.3 + 1.8 + 1 + 3 + 1.5 + 1.5 + 1.5 + +
    + +
  • Textiles
  • +
    + +
  • + CompColorable +
  • +
    +
    + + + + + Hyperweave + + High-tech nano-fibers woven into sheets. It is somewhat heavy, but is incredibly difficult to break. The secrets of its production are known only to the most advanced glitterworld cultures. + + Things/Item/Resource/Hyperweave + Graphic_Single + + + 45 + 1.0 + 0.3 + 0.3 + + + +
  • Fabric
  • +
    + (0,106,126) + + 0.03 + 0.03 + 0.03 + 0.75 + 0.75 + 0.5 + + + 1.8 + 1.6 + 4.0 + 2.0 + 0 + 1.1 + 1.1 + 1.8 + 1.8 + 1.8 + +
    + +
  • Textiles
  • +
    +
    + +
    \ No newline at end of file diff --git a/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mechanoid.xml b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mechanoid.xml new file mode 100644 index 0000000..e21fe3a --- /dev/null +++ b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mechanoid.xml @@ -0,0 +1,37 @@ + + + + + Combat_Realism.LoadoutGeneratorThing + Loadout creation dummy. If you're seeing this, it means something probably went horribly wrong. + Item + false + Never + true + true + false + + 0 + 0 + + + Things/Item/Special/LiquidFuel + Graphic_Single + Transparent + + Item + Never + + + + LoadoutGen_MechanoidAmmo + + + 0 + 10000 + 10000 + + 0 + + + \ No newline at end of file diff --git a/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mercenary.xml b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mercenary.xml new file mode 100644 index 0000000..b7396a1 --- /dev/null +++ b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Mercenary.xml @@ -0,0 +1,108 @@ + + + + + LoadoutGen_MercAmmoPrimary + + + 0 + 150 + 300 + + 0 + + + + LoadoutGen_MercAmmoPrimaryDouble + + + 0 + 300 + 600 + + 0 + + + + LoadoutGen_MercHeavyAmmoPrimary + + + 0 + 6 + 30 + + 40 + + + + LoadoutGen_MercSidearmMelee + + + 0.5 + CR_Sidearm_Melee + + 0 + 500 + + 1 + 1 + + 10 + + + + LoadoutGen_MercSidearm + + + 0.5 + CR_Sidearm + + 0 + 500 + + 1 + 1 + + 10 + + + + LoadoutGen_MercSidearmSMG + + + 0.0 + CR_SMG + + 0 + 1000 + + 1 + 1 + + 10 + + + + LoadoutGen_MercSidearmAmmo + + + 0 + 15 + 40 + + 20 + + + + LoadoutGen_MercSidearmSMGAmmo + + + 0 + 100 + 200 + + 20 + + + + \ No newline at end of file diff --git a/Defs/ThingDefs_LoadoutGen/LoadoutGen_Outlander.xml b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Outlander.xml new file mode 100644 index 0000000..bfbc379 --- /dev/null +++ b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Outlander.xml @@ -0,0 +1,44 @@ + + + + + LoadoutGen_OutlanderAmmoPrimary + + + 0 + 50 + 100 + + 0 + + + + LoadoutGen_OutlanderSidearmMelee + + + 0.75 + CR_Sidearm_Melee + + 0 + 500 + + 1 + 1 + + 10 + + + + LoadoutGen_OutlanderSilver + + + 0.75 + Silver + 30 + 100 + + 20 + + + + \ No newline at end of file diff --git a/Defs/ThingDefs_LoadoutGen/LoadoutGen_Pirate.xml b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Pirate.xml new file mode 100644 index 0000000..5fb22ae --- /dev/null +++ b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Pirate.xml @@ -0,0 +1,15 @@ + + + + + LoadoutGen_PirateAmmoPrimary + + + 0 + 30 + 60 + + 0 + + + \ No newline at end of file diff --git a/Defs/ThingDefs_LoadoutGen/LoadoutGen_Tribal.xml b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Tribal.xml new file mode 100644 index 0000000..12fc88e --- /dev/null +++ b/Defs/ThingDefs_LoadoutGen/LoadoutGen_Tribal.xml @@ -0,0 +1,44 @@ + + + + + LoadoutGen_TribalAmmo + + + 0 + 50 + 150 + + 10 + + + + LoadoutGen_TribalPila + + + 0 + Pila + 2 + 5 + + 10 + + + + LoadoutGen_TribalSidearm + + + 0 + CR_Sidearm_Tribal + + 0 + 1000 + + 1 + 1 + + 0 + + + + \ No newline at end of file diff --git a/Defs/ThinkTreeDefs/SubTrees_CR.xml b/Defs/ThinkTreeDefs/SubTrees_CR.xml index 3485b40..b16dca2 100644 --- a/Defs/ThinkTreeDefs/SubTrees_CR.xml +++ b/Defs/ThinkTreeDefs/SubTrees_CR.xml @@ -6,7 +6,7 @@ SuppressionResponse - Humanlike_PostBroken + Humanlike_PostMentalState 100 @@ -29,6 +29,20 @@ + + + + UpdateLoadout + Humanlike_PreMain + 100 + + +
  • + + + + + diff --git a/Languages/English/Keyed/BulkAndWeight.xml b/Languages/English/Keyed/BulkAndWeight.xml new file mode 100644 index 0000000..7149e01 --- /dev/null +++ b/Languages/English/Keyed/BulkAndWeight.xml @@ -0,0 +1,31 @@ + + + + Outfits + Edit {0} + Current loadout + Loadouts + Weight + Bulk + outfit + loadout + Current weight: {1}\nCapacity: {0}\n\nMove speed factor: {2}\nEncumbrance penalty: {3} + Current bulk: {1}\nCapacity: {0}\n\nWork speed factor: {2} + Nothing + Select loadout... + New loadout + Delete loadout... + No loadout selected + Loadout {0} + Select ranged weapons + Select melee weapons + Select ammo + Select all + Filter selection + Drag handle to reorder + Count: {0} + Delete + Add ammo for {0} + + + diff --git a/Languages/English/Keyed/Descriptions.xml b/Languages/English/Keyed/Descriptions.xml new file mode 100644 index 0000000..78d3275 --- /dev/null +++ b/Languages/English/Keyed/Descriptions.xml @@ -0,0 +1,12 @@ + + + + Damage + Explosion radius + Secondary explosion + Frag range + Armor penetration + Pellet count + Spread factor + + diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml index 068fa87..3fef2f7 100644 --- a/Languages/English/Keyed/Keys.xml +++ b/Languages/English/Keyed/Keys.xml @@ -14,7 +14,37 @@ Single Snapshot Aimed shot + Suppress + Hold fire Toggle fire mode. Toggle aim mode. + Marked for artillery, expires in + + Visibility error + Lead error + Range error + Sway + Spread + Miss radius + Indirect fire + Cover height + Target height + Target width + + Carried weight + Carried bulk + Encumbered + Final modifier + Inventory is full + Pick up + Cannot pick up + Magazine size + Reload time + Caliber + Fire modes + Burst shot count + Out of ammo + Put away {0} + diff --git a/Assemblies/Source/CombatRealism.sln b/Source/CombatRealism.sln similarity index 100% rename from Assemblies/Source/CombatRealism.sln rename to Source/CombatRealism.sln diff --git a/Source/CombatRealism/Combat_Realism.csproj b/Source/CombatRealism/Combat_Realism.csproj new file mode 100644 index 0000000..70601aa --- /dev/null +++ b/Source/CombatRealism/Combat_Realism.csproj @@ -0,0 +1,164 @@ + + + + + Debug + AnyCPU + {AABEDCF4-2B5E-450E-B855-89595E67DC8D} + Library + Properties + Combat_Realism + CombatRealism + v3.5 + 512 + + False + OnBuildSuccess + False + False + False + obj\$(Configuration)\ + + + true + None + False + ..\..\Assemblies\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + False + obj\ + + + 4194304 + AnyCPU + False + False + Auto + + + + ..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\Assembly-CSharp.dll + False + + + ..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\Community Core Library.dll + False + + + + + + + + + ..\..\..\..\..\..\Documents\Visual Studio 2013\Source-DLLs\UnityEngine.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/AimMode.cs b/Source/CombatRealism/Combat_Realism/AimMode.cs similarity index 83% rename from Assemblies/Source/CombatRealism/Combat_Realism/AimMode.cs rename to Source/CombatRealism/Combat_Realism/AimMode.cs index c8480b9..bc7066f 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/AimMode.cs +++ b/Source/CombatRealism/Combat_Realism/AimMode.cs @@ -9,5 +9,7 @@ public enum AimMode : byte { Snapshot, AimedShot, + SuppressFire, + HoldFire } } diff --git a/Source/CombatRealism/Combat_Realism/AmmoInjector.cs b/Source/CombatRealism/Combat_Realism/AmmoInjector.cs new file mode 100644 index 0000000..29a335f --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/AmmoInjector.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; +using CommunityCoreLibrary; + +namespace Combat_Realism +{ + public class AmmoInjector : SpecialInjector + { + private const string enableTradeTag = "CR_AutoEnableTrade"; // The trade tag which designates ammo defs for being automatically switched to Tradeability.Stockable + private const string enableCraftingTag = "CR_AutoEnableCrafting"; // The trade tag which designates ammo defs for having their crafting recipes automatically added to the crafting table + private static ThingDef ammoCraftingStationInt; // The crafting station to which ammo will be automatically added + private static ThingDef ammoCraftingStation + { + get + { + if (ammoCraftingStationInt == null) + ammoCraftingStationInt = ThingDef.Named("TableMachining"); + return ammoCraftingStationInt; + } + } + + public override bool Inject() + { + // Initialize list of all weapons so we don't have to iterate through all the defs, all the time + Utility.allWeaponDefs.Clear(); + foreach (ThingDef def in DefDatabase.AllDefsListForReading) + { + if (def.IsWeapon && (def.canBeSpawningInventory || def.tradeability == Tradeability.Stockable)) + Utility.allWeaponDefs.Add(def); + } + if (Utility.allWeaponDefs.NullOrEmpty()) + { + Log.Warning("CR Ammo Injector found no weapon defs"); + return true; + } + + // Find all ammo using guns + foreach (ThingDef weaponDef in Utility.allWeaponDefs) + { + CompProperties_AmmoUser props = weaponDef.GetCompProperty(); + if (props != null && props.ammoSet != null && !props.ammoSet.ammoTypes.NullOrEmpty()) + { + foreach(ThingDef curDef in props.ammoSet.ammoTypes) + { + AmmoDef ammoDef = curDef as AmmoDef; + if(ammoDef != null) + { + // Enable trading + if (ammoDef.tradeTags.Contains(enableTradeTag)) + ammoDef.tradeability = Tradeability.Stockable; + + // Enable recipe + if (ammoDef.tradeTags.Contains(enableCraftingTag)) + { + RecipeDef recipe = DefDatabase.GetNamed(("Make" + ammoDef.defName), false); + if (recipe == null) + { + Log.Error("CR ammo injector found no recipe named Make" + ammoDef.defName); + } + else + { + if (ammoCraftingStation == null) + { + Log.ErrorOnce("CR ammo injector crafting station is null", 84653201); + } + else + { + if (!recipe.recipeUsers.Contains(ammoCraftingStation)) + { + recipe.recipeUsers.Add(ammoCraftingStation); + } + } + } + } + } + } + } + } + return true; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompAmmoUser.cs b/Source/CombatRealism/Combat_Realism/Comps/CompAmmoUser.cs new file mode 100644 index 0000000..e23655f --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompAmmoUser.cs @@ -0,0 +1,346 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; +using Verse.AI; +using Verse.Sound; + +namespace Combat_Realism +{ + public class CompAmmoUser : CommunityCoreLibrary.CompRangedGizmoGiver + { + public CompProperties_AmmoUser Props + { + get + { + return (CompProperties_AmmoUser)this.props; + } + } + + private int curMagCountInt; + public int curMagCount + { + get + { + return curMagCountInt; + } + } + public CompEquippable compEquippable + { + get { return parent.GetComp(); } + } + public Pawn wielder + { + get { return compEquippable.PrimaryVerb.CasterPawn; } + } + private TargetInfo storedTarget = null; + private JobDef storedJobDef = null; + + // Ammo consumption variables + public bool useAmmo + { + get + { + return Props.ammoSet != null; + } + } + public bool hasAmmo + { + get + { + if (compInventory == null) + return false; + return compInventory.ammoList.Any(x => Props.ammoSet.ammoTypes.Contains(x.def)); + } + } + public bool hasMagazine => Props.magazineSize > 0; + private AmmoDef currentAmmoInt = null; + public AmmoDef currentAmmo + { + get + { + return currentAmmoInt; + } + } + public AmmoDef selectedAmmo; + public CompInventory compInventory + { + get + { + return wielder.TryGetComp(); + } + } + + public override void Initialize(CompProperties vprops) + { + base.Initialize(vprops); + + curMagCountInt = Props.magazineSize; + + // Initialize ammo with default if none is set + if (useAmmo) + { + if (Props.ammoSet.ammoTypes.NullOrEmpty()) + { + Log.Error(this.parent.Label + " has no available ammo types"); + } + else + { + if(currentAmmoInt == null) + currentAmmoInt = (AmmoDef)Props.ammoSet.ammoTypes[0]; + if (selectedAmmo == null) + selectedAmmo = currentAmmoInt; + } + } + } + + public override void PostExposeData() + { + base.PostExposeData(); + + Scribe_Values.LookValue(ref curMagCountInt, "count", 0); + Scribe_Defs.LookDef(ref currentAmmoInt, "currentAmmo"); + Scribe_Defs.LookDef(ref selectedAmmo, "selectedAmmo"); + } + + private void AssignJobToWielder(Job job) + { + if (wielder.drafter != null) + { + wielder.drafter.TakeOrderedJob(job); + } + else + { + ExternalPawnDrafter.TakeOrderedJob(wielder, job); + } + } + + /// + /// Reduces ammo count and updates inventory if necessary, call this whenever ammo is consumed by the gun (e.g. firing a shot, clearing a jam) + /// + public bool TryReduceAmmoCount() + { + // Mag-less weapons feed directly from inventory + if (!hasMagazine) + { + if (useAmmo) + { + Thing ammo; + + if (!TryFindAmmoInInventory(out ammo)) + { + return false; + } + + if (ammo.stackCount > 1) + ammo = ammo.SplitOff(1); + + ammo.Destroy(); + compInventory.UpdateInventory(); + } + return true; + } + // If magazine is empty, return false + else if (curMagCountInt <= 0) + { + curMagCountInt = 0; + return false; + } + // Reduce ammo count and update inventory + curMagCountInt--; + if (compInventory != null) + { + compInventory.UpdateInventory(); + } + return true; + } + + public void StartReload() + { + if (wielder == null) + { + Log.ErrorOnce("Wielder of " + parent + " is null!", 7381889); + FinishReload(); + return; + } + + if (!hasMagazine) + { + return; + } + + if (useAmmo) + { + // Add remaining ammo back to inventory + if (curMagCountInt > 0) + { + Thing ammoThing = ThingMaker.MakeThing(currentAmmoInt); + ammoThing.stackCount = curMagCountInt; + curMagCountInt = 0; + + if (compInventory != null) + { + compInventory.UpdateInventory(); + compInventory.container.TryAdd(ammoThing, ammoThing.stackCount); + } + else + { + Thing outThing; + GenThing.TryDropAndSetForbidden(ammoThing, wielder.Position, ThingPlaceMode.Near, out outThing, true); + } + } + // Check for ammo + if (!hasAmmo) + { + this.DoOutOfAmmoAction(); + return; + } + } + + // Throw mote + if (Props.throwMote) + { + MoteThrower.ThrowText(wielder.Position.ToVector3Shifted(), "CR_ReloadingMote".Translate()); + } + + // Issue reload job + var reloadJob = new Job(DefDatabase.GetNamed("ReloadWeapon"), wielder, parent) + { + playerForced = true + }; + + // Store the current job so we can reassign it later + if (this.wielder.drafter != null + && this.wielder.CurJob != null + && (this.wielder.CurJob.def == JobDefOf.AttackStatic || this.wielder.CurJob.def == JobDefOf.Goto)) + { + this.storedTarget = this.wielder.CurJob.targetA.HasThing ? new TargetInfo(this.wielder.CurJob.targetA.Thing) : new TargetInfo(this.wielder.CurJob.targetA.Cell); + this.storedJobDef = this.wielder.CurJob.def; + } + this.AssignJobToWielder(reloadJob); + } + + private void DoOutOfAmmoAction() + { + if(Props.throwMote) + MoteThrower.ThrowText(wielder.Position.ToVector3Shifted(), "CR_OutOfAmmo".Translate() + "!"); + if (compInventory != null) + compInventory.SwitchToNextViableWeapon(); + if (wielder != null && wielder.jobs != null) + wielder.jobs.StopAll(); + } + + public void FinishReload() + { + if (useAmmo) + { + // Check for inventory + if (compInventory != null) + { + Thing ammoThing; + this.TryFindAmmoInInventory(out ammoThing); + + if (ammoThing == null) + { + this.DoOutOfAmmoAction(); + return; + } + currentAmmoInt = (AmmoDef)ammoThing.def; + if (Props.magazineSize < ammoThing.stackCount) + { + curMagCountInt = Props.magazineSize; + ammoThing.stackCount -= Props.magazineSize; + compInventory.UpdateInventory(); + } + else + { + curMagCountInt = ammoThing.stackCount; + compInventory.container.Remove(ammoThing); + } + } + } + else + { + curMagCountInt = Props.magazineSize; + } + parent.def.soundInteract.PlayOneShot(SoundInfo.InWorld(wielder.Position)); + if (Props.throwMote) + { + MoteThrower.ThrowText(wielder.Position.ToVector3Shifted(), "CR_ReloadedMote".Translate()); + } + } + + private bool TryFindAmmoInInventory(out Thing ammoThing) + { + ammoThing = null; + if (compInventory == null) + { + return false; + } + + // Try finding suitable ammoThing for currently set ammo first + ammoThing = compInventory.ammoList.Find(thing => thing.def == selectedAmmo); + if (ammoThing != null) + { + return true; + } + + // Try finding ammo from different type + foreach (AmmoDef ammoDef in Props.ammoSet.ammoTypes) + { + ammoThing = compInventory.ammoList.Find(thing => thing.def == ammoDef); + if (ammoThing != null) + { + selectedAmmo = ammoDef; + return true; + } + } + return false; + } + + public void TryContinuePreviousJob() + { + //If a job is stored, assign it + if (this.storedTarget != null && this.storedJobDef != null) + { + this.AssignJobToWielder(new Job(this.storedJobDef, this.storedTarget)); + + //Clear out stored job after assignment + this.storedTarget = null; + this.storedJobDef = null; + } + } + + public override IEnumerable CompGetGizmosExtra() + { + var ammoStatusGizmo = new GizmoAmmoStatus { compAmmo = this }; + yield return ammoStatusGizmo; + + if (this.wielder != null) + { + var reloadCommandGizmo = new Command_Reload + { + compAmmo = this, + action = this.StartReload, + defaultLabel = hasMagazine ? "CR_ReloadLabel".Translate() : "", + defaultDesc = "CR_ReloadDesc".Translate(), + icon = this.currentAmmo == null ? ContentFinder.Get("UI/Buttons/Reload", true) : CommunityCoreLibrary.Def_Extensions.IconTexture(this.selectedAmmo) + }; + yield return reloadCommandGizmo; + } + } + + public override string GetDescriptionPart() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.AppendLine("CR_MagazineSize".Translate() + ": " + GenText.ToStringByStyle(this.Props.magazineSize, ToStringStyle.Integer)); + stringBuilder.AppendLine("CR_ReloadTime".Translate() + ": " + GenText.ToStringByStyle((this.Props.reloadTicks / 60), ToStringStyle.Integer) + " s"); + if (Props.ammoSet != null) + stringBuilder.AppendLine("CR_AmmoSet".Translate() + ": " + Props.ammoSet.LabelCap); + return stringBuilder.ToString(); + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompCharges.cs b/Source/CombatRealism/Combat_Realism/Comps/CompCharges.cs similarity index 50% rename from Assemblies/Source/CombatRealism/Combat_Realism/CompCharges.cs rename to Source/CombatRealism/Combat_Realism/Comps/CompCharges.cs index 186457e..5835762 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompCharges.cs +++ b/Source/CombatRealism/Combat_Realism/Comps/CompCharges.cs @@ -8,40 +8,25 @@ namespace Combat_Realism { - class CompProperties_Charges : CompProperties - { - // Charges are paired as velocity / range - public List charges = new List(); - - public CompProperties_Charges() - { - this.compClass = typeof(CompProperties_Charges); - } - } - public class CompCharges : ThingComp { - private CompProperties_Charges cprops; - - public override void Initialize(CompProperties props) + public CompProperties_Charges Props { - base.Initialize(props); - CompProperties_Charges cprops = props as CompProperties_Charges; - if (cprops != null) + get { - this.cprops = cprops; + return (CompProperties_Charges)this.props; } } public bool GetChargeBracket(float range, out Vector2 bracket) { bracket = new Vector2(0, 0); - if (this.cprops == null || cprops.charges.Count <= 0) + if (Props.charges.Count <= 0) { Log.Error("Tried getting charge bracket from empty list."); return false; } - foreach (Vector2 vec in cprops.charges) + foreach (Vector2 vec in Props.charges) { if (range <= vec.y) { diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompExplosiveCR.cs b/Source/CombatRealism/Combat_Realism/Comps/CompExplosiveCR.cs new file mode 100644 index 0000000..07b70a8 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompExplosiveCR.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompExplosiveCR : ThingComp + { + public CompProperties_ExplosiveCR Props + { + get + { + return (CompProperties_ExplosiveCR)this.props; + } + } + + /// + /// Produces a secondary explosion on impact using the explosion values from the projectile's projectile def. Requires the projectile's launcher to be passed on due to protection level, + /// only works when parent can be cast as ProjectileCR. Intended use is for HEAT and similar weapons that spawn secondary explosions while also penetrating, NOT explosive ammo of + /// anti-materiel rifles as the explosion just spawns on top of the pawn, not inside the hit body part. + /// + /// Additionally handles fragmentation effects if defined. + /// + /// Launcher of the projectile calling the method + public virtual void Explode(Thing instigator) + { + // Regular explosion stuff + if(this.Props.explosionRadius > 0 && this.Props.explosionDamage > 0) + GenExplosion.DoExplosion(this.parent.Position, + Props.explosionRadius, + Props.explosionDamageDef, + this.parent, + Props.soundExplode, + this.parent.def, + instigator.def, + Props.postExplosionSpawnThingDef, + Props.explosionSpawnChance, + false, + Props.preExplosionSpawnThingDef, + Props.explosionSpawnChance); + + // Fragmentation stuff + if (!Props.fragments.NullOrEmpty()) + { + if (Props.fragRange <= 0) + { + Log.Error(this.parent.LabelCap + " has fragments but no fragRange"); + } + else + { + foreach (ThingCount fragment in Props.fragments) + { + for (int i = 0; i < fragment.count; i++) + { + ProjectileCR projectile = (ProjectileCR)ThingMaker.MakeThing(fragment.thingDef, null); + projectile.canFreeIntercept = true; + Vector3 exactOrigin = new Vector3(0,0,0); + exactOrigin.x = this.parent.DrawPos.x; + exactOrigin.z = this.parent.DrawPos.z; + Vector3 exactTarget = exactOrigin + (new Vector3(1, 0, 1) * UnityEngine.Random.Range(0, Props.fragRange)).RotatedBy(UnityEngine.Random.Range(0, 360)); + TargetInfo targetCell = exactTarget.ToIntVec3(); + GenSpawn.Spawn(projectile, this.parent.Position); + projectile.Launch(instigator, exactOrigin, targetCell, exactTarget, null); + } + } + } + } + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompFireModes.cs b/Source/CombatRealism/Combat_Realism/Comps/CompFireModes.cs similarity index 71% rename from Assemblies/Source/CombatRealism/Combat_Realism/CompFireModes.cs rename to Source/CombatRealism/Combat_Realism/Comps/CompFireModes.cs index 4465a12..3b8103f 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompFireModes.cs +++ b/Source/CombatRealism/Combat_Realism/Comps/CompFireModes.cs @@ -8,26 +8,15 @@ namespace Combat_Realism { - public class CompPropertiesFireModes : CompProperties + public class CompFireModes : CommunityCoreLibrary.CompRangedGizmoGiver { - public int aimedBurstShotCount = -1; //will default to regular burst setting if not specified in def - public bool aiUseAimMode = false; - public bool aiUseBurstMode = false; - public bool noSingleShot = false; - - public CompPropertiesFireModes() - : base() - { - } - public CompPropertiesFireModes(Type compClass) - : base(compClass) + public CompProperties_FireModes Props { + get + { + return (CompProperties_FireModes)this.props; + } } - } - - public class CompFireModes : CommunityCoreLibrary.CompRangedGizmoGiver - { - new public CompPropertiesFireModes props; // Fire mode variables private Verb verbInt = null; @@ -65,7 +54,7 @@ public Pawn casterPawn } } private List availableFireModes = new List(); - private List availableAimModes = new List { AimMode.Snapshot, AimMode.AimedShot }; + private List availableAimModes = new List { AimMode.Snapshot, AimMode.AimedShot, AimMode.HoldFire }; private FireMode currentFireModeInt; public FireMode currentFireMode @@ -87,20 +76,15 @@ public AimMode currentAimMode public override void Initialize(CompProperties props) { base.Initialize(props); - CompPropertiesFireModes cprops = props as CompPropertiesFireModes; - if (cprops != null) - { - this.props = cprops; - } // Calculate available fire modes - if (this.verb.verbProps.burstShotCount > 1 || this.props.noSingleShot) + if (this.verb.verbProps.burstShotCount > 1 || this.Props.noSingleShot) { this.availableFireModes.Add(FireMode.AutoFire); } - if (this.props.aimedBurstShotCount > 1) + if (this.Props.aimedBurstShotCount > 1) { - if (this.props.aimedBurstShotCount >= this.verb.verbProps.burstShotCount) + if (this.Props.aimedBurstShotCount >= this.verb.verbProps.burstShotCount) { Log.Warning(this.parent.LabelBaseCap + " burst fire shot count is same or higher than auto fire"); } @@ -109,7 +93,7 @@ public override void Initialize(CompProperties props) this.availableFireModes.Add(FireMode.BurstFire); } } - if (!this.props.noSingleShot) + if (!this.Props.noSingleShot) { this.availableFireModes.Add(FireMode.SingleFire); } @@ -154,19 +138,43 @@ public void ResetModes() this.currentAimModeInt = this.availableAimModes.ElementAt(0); } + public override IEnumerable CompGetGizmosExtra() + { + if (this.casterPawn != null && this.casterPawn.Faction.Equals(Faction.OfColony)) + { + var toggleFireModeGizmo = new Command_Action + { + action = this.ToggleFireMode, + defaultLabel = ("CR_" + this.currentFireMode.ToString() + "Label").Translate(), + defaultDesc = "CR_ToggleFireModeDesc".Translate(), + icon = ContentFinder.Get(("UI/Buttons/" + this.currentFireMode.ToString()), true) + }; + yield return toggleFireModeGizmo; + + var toggleAimModeGizmo = new Command_Action + { + action = this.ToggleAimMode, + defaultLabel = ("CR_" + this.currentAimMode.ToString() + "Label").Translate(), + defaultDesc = "CR_ToggleAimModeDesc".Translate(), + icon = ContentFinder.Get(("UI/Buttons/" + this.currentAimMode.ToString()), true) + }; + yield return toggleAimModeGizmo; + } + } + public override string GetDescriptionPart() { StringBuilder stringBuilder = new StringBuilder(); if (this.availableFireModes.Count > 0) { - stringBuilder.AppendLine("Fire modes: "); + stringBuilder.AppendLine("CR_FireModes".Translate() + ": "); foreach (FireMode fireMode in this.availableFireModes) { stringBuilder.AppendLine(" -" + ("CR_" + fireMode.ToString() + "Label").Translate()); } - if (this.props.aimedBurstShotCount > 0 && this.availableFireModes.Contains(FireMode.BurstFire)) + if (this.Props.aimedBurstShotCount > 0 && this.availableFireModes.Contains(FireMode.BurstFire)) { - stringBuilder.AppendLine("Burst shot count: " + GenText.ToStringByStyle(this.props.aimedBurstShotCount, ToStringStyle.Integer)); + stringBuilder.AppendLine("CR_AimedBurstCount" + ": " + GenText.ToStringByStyle(this.Props.aimedBurstShotCount, ToStringStyle.Integer)); } } return stringBuilder.ToString(); diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompInventory.cs b/Source/CombatRealism/Combat_Realism/Comps/CompInventory.cs new file mode 100644 index 0000000..f0d5e21 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompInventory.cs @@ -0,0 +1,404 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using Verse.Sound; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompInventory : ThingComp + { + public CompProperties_Inventory Props + { + get + { + return (CompProperties_Inventory)this.props; + } + } + + private float currentWeightCached; + private float currentBulkCached; + public float currentWeight + { + get + { + return currentWeightCached; + } + } + public float currentBulk + { + get + { + return currentBulkCached; + } + } + private float availableWeight + { + get + { + return this.parentPawn.GetStatValue(StatDef.Named("CarryWeight")) - currentWeight; + } + } + private float availableBulk + { + get + { + return capacityBulk - currentBulk; + } + } + public float capacityBulk + { + get + { + return this.parentPawn.GetStatValue(StatDef.Named("CarryBulk")); + } + } + public float capacityWeight + { + get + { + return this.parentPawn.GetStatValue(StatDef.Named("CarryWeight")); + } + } + private Pawn parentPawnInt = null; + private Pawn parentPawn + { + get + { + if (parentPawnInt == null) + { + parentPawnInt = this.parent as Pawn; + } + return parentPawnInt; + } + } + public float moveSpeedFactor + { + get + { + return Mathf.Lerp(1f, 0.75f, currentWeight / this.parentPawn.GetStatValue(StatDef.Named("CarryWeight"))); + } + } + public float workSpeedFactor + { + get + { + return Mathf.Lerp(1f, 0.75f, currentWeight / 40f); + } + } + public float encumberPenalty + { + get + { + float penalty = 0f; + if (availableWeight < 0) + { + penalty = currentWeight / this.parentPawn.GetStatValue(StatDef.Named("CarryWeight")) - 1; + } + return penalty; + } + } + public ThingContainer container + { + get + { + if (parentPawn.inventory != null) + { + return parentPawn.inventory.container; + } + return null; + } + } + private List ammoListCached = new List(); + public List ammoList + { + get + { + return ammoListCached; + } + } + private List meleeWeaponListCached = new List(); + public List meleeWeaponList => meleeWeaponListCached; + private List rangedWeaponListCached = new List(); + public List rangedWeaponList => rangedWeaponListCached; + private bool initializedLoadouts = false; + private int ticksToInitLoadout = 5; // Generate loadouts this many ticks after spawning + + public override void Initialize(CompProperties props) + { + base.Initialize(props); + this.UpdateInventory(); + } + + /// + /// Refreshes the cached bulk and weight. Call this whenever items are added/removed from inventory + /// + public void UpdateInventory() + { + if (parentPawn == null) + { + Log.Error("CompInventory on non-pawn " + this.parent.ToString()); + return; + } + float newBulk = 0f; + float newWeight = 0f; + + // Add equipped weapon + if (parentPawn.equipment != null && parentPawn.equipment.Primary != null) + { + GetEquipmentStats(parentPawn.equipment.Primary, out newWeight, out newBulk); + } + + // Add apparel + if (parentPawn.apparel != null && parentPawn.apparel.WornApparelCount > 0) + { + foreach (Thing apparel in parentPawn.apparel.WornApparel) + { + float apparelBulk = apparel.GetStatValue(StatDef.Named("WornBulk")); + float apparelWeight = apparel.GetStatValue(StatDef.Named("WornWeight")); + newBulk += apparelBulk; + newWeight += apparelWeight; + } + } + + // Add inventory items + if (parentPawn.inventory != null && parentPawn.inventory.container != null) + { + ammoListCached.Clear(); + meleeWeaponListCached.Clear(); + rangedWeaponListCached.Clear(); + foreach (Thing thing in parentPawn.inventory.container) + { + // Check for weapons + ThingWithComps eq = thing as ThingWithComps; + CompEquippable compEq = thing.TryGetComp(); + if (eq != null && compEq != null) + { + if (compEq.PrimaryVerb != null) + { + rangedWeaponListCached.Add(eq); + } + else + { + meleeWeaponListCached.Add(eq); + } + // Calculate equipment weight + float eqWeight; + float eqBulk; + GetEquipmentStats(eq, out eqWeight, out eqBulk); + newWeight += eqWeight; + newBulk += eqBulk; + } + else + { + // Update ammo list + if (thing.def is AmmoDef) + { + ammoListCached.Add(thing); + } + // Add item weight + newBulk += thing.GetStatValue(StatDef.Named("Bulk")) * thing.stackCount; + newWeight += thing.GetStatValue(StatDef.Named("Weight")) * thing.stackCount; + } + } + } + this.currentBulkCached = newBulk; + this.currentWeightCached = newWeight; + } + + /// + /// Determines if and how many of an item currently fit into the inventory with regards to weight/bulk constraints. + /// + /// Thing to check + /// Maximum amount of that item that can fit into the inventory + /// Whether to include currently equipped weapons when calculating current weight/bulk + /// Whether to use calculations for worn apparel. This will factor in equipped stat offsets boosting inventory space and use the worn bulk and weight. + /// True if one or more items fit into the inventory + public bool CanFitInInventory(Thing thing, out int count, bool ignoreEquipment = false, bool useApparelCalculations = false) + { + float thingWeight; + float thingBulk; + + if (useApparelCalculations) + { + thingWeight = thing.GetStatValue(StatDef.Named("WornWeight")); + thingBulk = thing.GetStatValue(StatDef.Named("WornBulk")); + if(thingWeight <= 0 && thingBulk <= 0) + { + count = 1; + return true; + } + // Subtract the stat offsets we get from wearing this + thingWeight -= thing.def.equippedStatOffsets.GetStatOffsetFromList(StatDef.Named("CarryWeight")); + thingBulk -= thing.def.equippedStatOffsets.GetStatOffsetFromList(StatDef.Named("CarryBulk")); + } + else + { + thingWeight = thing.GetStatValue(StatDef.Named("Weight")); + thingBulk = thing.GetStatValue(StatDef.Named("Bulk")); + } + // Subtract weight of currently equipped weapon + float eqBulk = 0f; + float eqWeight = 0f; + if (ignoreEquipment && this.parentPawn.equipment != null && this.parentPawn.equipment.Primary != null) + { + ThingWithComps eq = this.parentPawn.equipment.Primary; + GetEquipmentStats(eq, out eqWeight, out eqBulk); + } + // Calculate how many items we can fit into our inventory + float amountByWeight = thingWeight <= 0 ? thing.stackCount : (availableWeight + eqWeight) / thingWeight; + float amountByBulk = thingBulk <= 0 ? thing.stackCount : (availableBulk + eqBulk) / thingBulk; + count = Mathf.FloorToInt(Mathf.Min(amountByBulk, amountByWeight, thing.stackCount)); + return count > 0; + } + + private void GetEquipmentStats(ThingWithComps eq, out float weight, out float bulk) + { + weight = eq.GetStatValue(StatDef.Named("Weight")); + bulk = eq.GetStatValue(StatDef.Named("Bulk")); + CompAmmoUser comp = eq.TryGetComp(); + if (comp != null && comp.currentAmmo != null) + { + weight += comp.currentAmmo.GetStatValueAbstract(StatDef.Named("Weight")) * comp.curMagCount; + bulk += comp.currentAmmo.GetStatValueAbstract(StatDef.Named("Bulk")) * comp.curMagCount; + } + } + + /// + /// Attempts to equip a weapon from the inventory, puts currently equipped weapon into inventory if it exists + /// + /// Whether to put the currently equipped weapon away even if no replacement is found + public void SwitchToNextViableWeapon(bool useFists = true) + { + ThingWithComps newEq = null; + + // Stop current job + if (parentPawn.jobs != null) + parentPawn.jobs.StopAll(); + + // Cycle through available ranged weapons + foreach(ThingWithComps gun in rangedWeaponListCached) + { + CompAmmoUser compAmmo = gun.TryGetComp(); + if (compAmmo == null + || !compAmmo.useAmmo + || compAmmo.curMagCount > 0 + || compAmmo.hasAmmo) + { + newEq = gun; + break; + } + } + // If no ranged weapon was found, use first available melee weapons + if(newEq == null) + newEq = meleeWeaponListCached.FirstOrDefault(); + + // Equip the weapon + if(newEq != null) + { + this.TrySwitchToWeapon(newEq); + } + else if (useFists && parentPawn.equipment?.Primary != null) + { + ThingWithComps oldEq; + parentPawn.equipment.TryTransferEquipmentToContainer(parentPawn.equipment.Primary, container, out oldEq); + } + } + + public void TrySwitchToWeapon(ThingWithComps newEq) + { + if (newEq == null || !this.container.Contains(newEq)) + { + return; + } + if (parentPawn.equipment.Primary != null) + { + ThingWithComps oldEq; + parentPawn.equipment.TryDropEquipment(parentPawn.equipment.Primary, out oldEq, parentPawn.Position.InBounds() ? parentPawn.Position : IntVec3.Zero); + + int count; + if (CanFitInInventory(oldEq, out count)) + { + container.TryAdd(oldEq); + } + } + // Split stack if our weapon has a stack count + if (newEq.stackCount > 1) + { + newEq = (ThingWithComps)newEq.SplitOff(1); + } + container.Remove(newEq); + parentPawn.equipment.AddEquipment(newEq); + newEq.def.soundInteract.PlayOneShot(parent.Position); + } + + public override void CompTick() + { + // Initialize loadouts on first tick + if (ticksToInitLoadout > 0) + { + ticksToInitLoadout--; + } + else if (!initializedLoadouts) + { + // Find all loadout generators + List genList = new List(); + foreach(Thing thing in container) + { + LoadoutGeneratorThing lGenThing = thing as LoadoutGeneratorThing; + if (lGenThing != null && lGenThing.loadoutGenerator != null) + genList.Add(lGenThing); + } + + // Sort list by execution priority + genList.Sort(delegate (LoadoutGeneratorThing x, LoadoutGeneratorThing y) + { + return x.priority.CompareTo(y.priority); + }); + + // Generate loadouts + foreach(LoadoutGeneratorThing thing in genList) + { + thing.loadoutGenerator.GenerateLoadout(this); + container.Remove(thing); + } + UpdateInventory(); + initializedLoadouts = true; + } + + base.CompTick(); + + // Remove items from inventory if we're over the bulk limit + while(availableBulk < 0 && container.Count > 0) + { + if (this.parent.Position.InBounds()) + { + Thing droppedThing; + container.TryDrop(container.Last(), this.parent.Position, ThingPlaceMode.Near, 1, out droppedThing); + } + else + { + container.Remove(container.Last()); + UpdateInventory(); + } + } + + // Debug validation - checks to make sure the inventory cache is being refreshed properly, remove before final release + /* + if(ticksToInitLoadout <= 2) + { + float lastWeight = this.currentWeightCached; + float lastBulk = this.currentBulkCached; + this.UpdateInventory(); + if (lastWeight != this.currentWeightCached || lastBulk != this.currentBulkCached) + { + Log.Error(this.parent.ToString() + " failed inventory validation"); + } + } + */ + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompJamming.cs b/Source/CombatRealism/Combat_Realism/Comps/CompJamming.cs similarity index 67% rename from Assemblies/Source/CombatRealism/Combat_Realism/CompJamming.cs rename to Source/CombatRealism/Combat_Realism/Comps/CompJamming.cs index effccf6..e395439 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompJamming.cs +++ b/Source/CombatRealism/Combat_Realism/Comps/CompJamming.cs @@ -8,23 +8,15 @@ namespace Combat_Realism { - class CompProperties_Jamming : CompProperties + public class CompJamming : ThingComp { - public float baseMalfunctionChance = 0f; - public bool canExplode = false; - public float explosionDamage = 0f; - public float explosionRadius = 1f; - public SoundDef explosionSound = null; - - public CompProperties_Jamming() + public CompProperties_Jamming Props { - this.compClass = typeof(CompProperties_Jamming); + get + { + return (CompProperties_Jamming)this.props; + } } - } - - class CompJamming : ThingComp - { - new public CompProperties_Jamming props; private Verb verbInt = null; private Verb verb @@ -47,16 +39,6 @@ private Verb verb } } - public override void Initialize(CompProperties props) - { - base.Initialize(props); - CompProperties_Jamming cprops = props as CompProperties_Jamming; - if (cprops != null) - { - this.props = cprops; - } - } - /// /// Returns a factor to scale malfunction chance by quality. If the parent doesn't have a CompQuality it will return a factor of 1. /// @@ -93,10 +75,10 @@ private float GetQualityFactor() public void DoMalfunction() { - float jamChance = this.props.baseMalfunctionChance * (1 - this.parent.HitPoints / this.parent.MaxHitPoints) * this.GetQualityFactor(); + float jamChance = this.Props.baseMalfunctionChance * (1 - this.parent.HitPoints / this.parent.MaxHitPoints) * this.GetQualityFactor(); float explodeChance = Mathf.Clamp01(jamChance); - if (this.props.canExplode && UnityEngine.Random.value < explodeChance) + if (this.Props.canExplode && UnityEngine.Random.value < explodeChance) { this.Explode(); } @@ -115,13 +97,7 @@ private void Explode() { this.parent.Destroy(DestroyMode.Vanish); } - BodyPartDamageInfo value = new BodyPartDamageInfo(null, new BodyPartDepth?(BodyPartDepth.Outside)); - ExplosionInfo explosionInfo = default(ExplosionInfo); - explosionInfo.center = this.parent.Position; - explosionInfo.radius = this.props.explosionRadius; - explosionInfo.dinfo = new DamageInfo(DamageDefOf.Bomb, 999, this.parent, new BodyPartDamageInfo?(value), null); - explosionInfo.explosionSound = this.props.explosionSound; - explosionInfo.DoExplosion(); + // TODO } } } diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_AmmoUser.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_AmmoUser.cs new file mode 100644 index 0000000..9b4179f --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_AmmoUser.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_AmmoUser : CompProperties + { + public int magazineSize = 0; + public int reloadTicks = 300; + public bool throwMote = true; + public AmmoSetDef ammoSet = null; + + public CompProperties_AmmoUser() + { + this.compClass = typeof(CompAmmoUser); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Charges.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Charges.cs new file mode 100644 index 0000000..f910970 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Charges.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_Charges : CompProperties + { + // Charges are paired as velocity / range + public List charges = new List(); + + public CompProperties_Charges() + { + this.compClass = typeof(CompCharges); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_ExplosiveCR.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_ExplosiveCR.cs new file mode 100644 index 0000000..0bc02f0 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_ExplosiveCR.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_ExplosiveCR : CompProperties + { + public float explosionDamage = -1; + public DamageDef explosionDamageDef; + public float explosionRadius = 0f; + public ThingDef preExplosionSpawnThingDef; + public ThingDef postExplosionSpawnThingDef; + public float explosionSpawnChance = 1f; + public SoundDef soundExplode; + public List fragments = new List(); + public float fragRange = 0f; + + public CompProperties_ExplosiveCR() + { + this.compClass = typeof(CompExplosiveCR); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_FireModes.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_FireModes.cs new file mode 100644 index 0000000..5490710 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_FireModes.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_FireModes : CompProperties + { + public int aimedBurstShotCount = -1; //will default to regular burst setting if not specified in def + public bool aiUseAimMode = false; + public bool aiUseBurstMode = false; + public bool noSingleShot = false; + + public CompProperties_FireModes() + { + this.compClass = typeof(CompFireModes); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Inventory.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Inventory.cs new file mode 100644 index 0000000..49da6a5 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Inventory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_Inventory : CompProperties + { + public CompProperties_Inventory() + { + this.compClass = typeof(CompInventory); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Jamming.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Jamming.cs new file mode 100644 index 0000000..b92b637 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Jamming.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_Jamming : CompProperties + { + public float baseMalfunctionChance = 0f; + public bool canExplode = false; + public float explosionDamage = 0f; + public float explosionRadius = 1f; + public SoundDef explosionSound = null; + + public CompProperties_Jamming() + { + this.compClass = typeof(CompJamming); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Suppressable.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Suppressable.cs new file mode 100644 index 0000000..efcc9a7 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_Suppressable.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_Suppressable : CompProperties + { + public CompProperties_Suppressable() + { + this.compClass = typeof(CompSuppressable); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Comps/CompProperties_TurretInit.cs b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_TurretInit.cs new file mode 100644 index 0000000..3c95a09 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Comps/CompProperties_TurretInit.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class CompProperties_TurretInit : CompProperties + { + public CompProperties_TurretInit() + { + this.compClass = typeof(CompTurretInit); + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompSuppressable.cs b/Source/CombatRealism/Combat_Realism/Comps/CompSuppressable.cs similarity index 88% rename from Assemblies/Source/CombatRealism/Combat_Realism/CompSuppressable.cs rename to Source/CombatRealism/Combat_Realism/Comps/CompSuppressable.cs index fe026e4..5f711b9 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompSuppressable.cs +++ b/Source/CombatRealism/Combat_Realism/Comps/CompSuppressable.cs @@ -9,15 +9,22 @@ namespace Combat_Realism { - class CompSuppressable : ThingComp + public class CompSuppressable : ThingComp { + public CompProperties_Suppressable Props + { + get + { + return (CompProperties_Suppressable)this.props; + } + } // --------------- Global constants --------------- - public const float minSuppressionDist = 10f; //Minimum distance to be suppressed from, so melee won't be suppressed if it closes within this distance - private const float maxSuppression = 150f; //Cap to prevent suppression from building indefinitely - private const float suppressionDecayRate = 10f; //How much suppression decays per second - private const int ticksPerMote = 150; //How many ticks between throwing a mote + public const float minSuppressionDist = 10f; //Minimum distance to be suppressed from, so melee won't be suppressed if it closes within this distance + private const float maxSuppression = 100f; //Cap to prevent suppression from building indefinitely + private const float suppressionDecayRate = 7.5f; //How much suppression decays per second + private const int ticksPerMote = 150; //How many ticks between throwing a mote // --------------- Location calculations --------------- @@ -83,7 +90,7 @@ private float suppressionThreshold if (pawn != null) { //Get morale - float hardBreakThreshold = pawn.mindState != null && pawn.mindState.breaker != null ? pawn.mindState.breaker.SoftBreakThreshold : 0f; + float hardBreakThreshold = pawn.GetStatValue(StatDefOf.MentalBreakThreshold) + 0.15f; float currentMood = pawn.needs != null && pawn.needs.mood != null ? pawn.needs.mood.CurLevel : 0.5f; threshold = Mathf.Max(0, (currentMood - hardBreakThreshold)); } @@ -158,7 +165,7 @@ public void AddSuppression(float amount, IntVec3 origin) } else { - Log.Error("Trying to suppress non-pawn, this should never happen"); + Log.Error("Trying to suppress non-pawn " + this.parent.ToString() + ", this should never happen"); } } } diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/CompTurretInit.cs b/Source/CombatRealism/Combat_Realism/Comps/CompTurretInit.cs similarity index 83% rename from Assemblies/Source/CombatRealism/Combat_Realism/CompTurretInit.cs rename to Source/CombatRealism/Combat_Realism/Comps/CompTurretInit.cs index cc2be44..d52f7fd 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/CompTurretInit.cs +++ b/Source/CombatRealism/Combat_Realism/Comps/CompTurretInit.cs @@ -10,6 +10,13 @@ namespace Combat_Realism { public class CompTurretInit : ThingComp { + public CompProperties_TurretInit Props + { + get + { + return (CompProperties_TurretInit)this.props; + } + } public Thing gun; public override void Initialize(Verse.CompProperties props) @@ -20,7 +27,6 @@ public override void Initialize(Verse.CompProperties props) { gun = (Thing)ThingMaker.MakeThing(parent.def.building.turretGunDef); turret.gun = gun; - turret.GunCompEq.verbTracker.InitVerbs(); } } diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/DamageWorker_AddInjuryCR.cs b/Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_AddInjuryCR.cs similarity index 68% rename from Assemblies/Source/CombatRealism/Combat_Realism/DamageWorker_AddInjuryCR.cs rename to Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_AddInjuryCR.cs index 4d7d7eb..488630c 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/DamageWorker_AddInjuryCR.cs +++ b/Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_AddInjuryCR.cs @@ -7,29 +7,39 @@ namespace Combat_Realism { + /// + /// Custom damage worker using new armor system, cloned from DamageWorker_AddInjury + /// public class DamageWorker_AddInjuryCR : DamageWorker { private struct LocalInjuryResult { public bool wounded; public bool headshot; - public bool deflected; + public bool deflected; + public bool absorbed; public BodyPartRecord lastHitPart; public float totalDamageDealt; + public static DamageWorker_AddInjuryCR.LocalInjuryResult MakeNew() { return new DamageWorker_AddInjuryCR.LocalInjuryResult { wounded = false, headshot = false, - deflected = false, + deflected = false, + absorbed = false, lastHitPart = null, totalDamageDealt = 0f }; } } + private const float SpreadDamageChance = 0.5f; + private static Func cache0; // Populated by CheckPropagateDamageToInnerSolidParts, returns absoluteFleshCoverage of a BodyPartRecord + private static Func cache1; // Populated by PlayWoundedVoiceSound, returns soundWounded of LifeStageAge + public override float Apply(DamageInfo dinfo, Thing thing) { Pawn pawn = thing as Pawn; @@ -42,7 +52,6 @@ public override float Apply(DamageInfo dinfo, Thing thing) private float ApplyToPawn(DamageInfo dinfo, Pawn pawn) { - //Sanity checks if (dinfo.Amount <= 0) { return 0f; @@ -55,10 +64,7 @@ private float ApplyToPawn(DamageInfo dinfo, Pawn pawn) { dinfo.SetPart(new BodyPartDamageInfo(null, null)); } - DamageWorker_AddInjuryCR.LocalInjuryResult localInjuryResult = DamageWorker_AddInjuryCR.LocalInjuryResult.MakeNew(); - - //Code for damage sources which spread out if (dinfo.Def.spreadOut) { if (pawn.apparel != null) @@ -90,14 +96,22 @@ private float ApplyToPawn(DamageInfo dinfo, Pawn pawn) if (localInjuryResult.wounded) { DamageWorker_AddInjuryCR.PlayWoundedVoiceSound(dinfo, pawn); - pawn.drawer.Notify_DamageApplied(dinfo); + pawn.Drawer.Notify_DamageApplied(dinfo); DamageWorker_AddInjuryCR.InformPsychology(dinfo, pawn); } - if (localInjuryResult.headshot && pawn.SpawnedInWorld) + if (localInjuryResult.headshot && pawn.Spawned) { MoteThrower.ThrowText(new Vector3((float)pawn.Position.x + 1f, (float)pawn.Position.y, (float)pawn.Position.z + 1f), "Headshot".Translate(), Color.white, -1); + if (dinfo.Instigator != null) + { + Pawn pawn2 = dinfo.Instigator as Pawn; + if (pawn2 != null) + { + pawn2.records.Increment(RecordDefOf.Headshots); + } + } } - if (localInjuryResult.deflected) + if (localInjuryResult.absorbed) { if (pawn.health.deflectionEffecter == null) { @@ -112,11 +126,6 @@ private float ApplyToPawn(DamageInfo dinfo, Pawn pawn) return localInjuryResult.totalDamageDealt; } - /// - /// Reduces damage applied on spread out damage by random amount - /// - /// - /// private void CheckApplySpreadDamage(DamageInfo dinfo, Thing t) { if (UnityEngine.Random.value < 0.5f) @@ -126,13 +135,6 @@ private void CheckApplySpreadDamage(DamageInfo dinfo, Thing t) } } - /// - /// Distributes damage over multiple body parts on damage types which spread out - /// - /// - /// - /// - /// private bool FragmentDamageForDamageType(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { if (!dinfo.AllowDamagePropagation) @@ -156,72 +158,72 @@ private bool FragmentDamageForDamageType(DamageInfo dinfo, Pawn pawn, ref Damage } return true; } + private void CheckDuplicateSmallPawnDamageToPartParent(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { if (!dinfo.AllowDamagePropagation) { return; } - if (result.lastHitPart != null && dinfo.Def.harmsHealth && result.lastHitPart != pawn.RaceProps.body.corePart && result.lastHitPart.parent != null && pawn.health.hediffSet.GetPartHealth(result.lastHitPart.parent) > 0f && dinfo.Amount >= 10 && pawn.HealthScale <= 0.5001f) + if (result.lastHitPart != null + && dinfo.Def.harmsHealth + && result.lastHitPart != pawn.RaceProps.body.corePart + && result.lastHitPart.parent != null + && pawn.health.hediffSet.GetPartHealth(result.lastHitPart.parent) > 0f + && dinfo.Amount >= 10 + && pawn.HealthScale <= 0.5001f) { DamageInfo dinfo2 = dinfo; - BodyPartDamageInfo part = new BodyPartDamageInfo(result.lastHitPart.parent, false); + BodyPartDamageInfo part = new BodyPartDamageInfo(result.lastHitPart.parent, false, (HediffDef)null); dinfo2.SetPart(part); this.ApplyDamagePartial(dinfo2, pawn, ref result); } } - /// - /// Handles damage and armor calculations - /// - /// - /// - /// private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { BodyPartRecord exactPartFromDamageInfo = DamageWorker_AddInjuryCR.GetExactPartFromDamageInfo(dinfo, pawn); if (exactPartFromDamageInfo == null) { return; - } - bool flag = true; - if (dinfo.InstantOldInjury) - { - flag = false; - } + } + + // Only apply armor if we propagate damage to the outside or the body part itself is outside, secondary damage types should directly damage organs, bypassing armor + bool involveArmor = !dinfo.InstantOldInjury + && !result.deflected + && (dinfo.Def.harmAllLayersUntilOutside || exactPartFromDamageInfo.depth == BodyPartDepth.Outside); int damageAmount = dinfo.Amount; - bool shotAbsorbed = false; - if (!result.deflected && flag) - { - //damageAmount = ArmorUtility.GetAfterArmorDamage(pawn, dinfo.Amount, exactPartFromDamageInfo, dinfo.Def); - damageAmount = Utility.GetAfterArmorDamage(pawn, dinfo.Amount, exactPartFromDamageInfo, dinfo, true, ref shotAbsorbed); - } + + if (involveArmor) + { + damageAmount = Utility.GetAfterArmorDamage(pawn, dinfo.Amount, exactPartFromDamageInfo, dinfo, true, ref result.deflected); + } if ((double)damageAmount < 0.001) { - result.deflected = true; + result.absorbed = true; return; - } + } - //Shot absorbed and converted into blunt - if (shotAbsorbed) + // Shot absorbed and converted into blunt + DamageDef_CR damageDefCR = dinfo.Def as DamageDef_CR; + if (damageDefCR != null + && damageDefCR.deflectable + && result.deflected + && dinfo.Def != Utility.absorbDamageDef) { - result.deflected = true; - if (dinfo.Def != Utility.absorbDamageDef) + // Get outer parent of struck part + BodyPartRecord currentPart = exactPartFromDamageInfo; + while (currentPart != null && currentPart.parent != null && currentPart.depth != BodyPartDepth.Outside) { - //Get outer parent of struck part - BodyPartRecord parentPart = exactPartFromDamageInfo; - while (parentPart != null && parentPart.parent != null && parentPart.depth != BodyPartDepth.Outside) - { - parentPart = parentPart.parent; - } - DamageInfo dinfo2 = new DamageInfo(Utility.absorbDamageDef, damageAmount, dinfo.Instigator, new BodyPartDamageInfo(parentPart, false), dinfo.Source); - this.ApplyDamagePartial(dinfo2, pawn, ref result); - return; + currentPart = currentPart.parent; } + DamageInfo dinfo2 = new DamageInfo(Utility.absorbDamageDef, damageAmount, dinfo.Instigator, new BodyPartDamageInfo(currentPart, false), dinfo.Source); + this.ApplyDamagePartial(dinfo2, pawn, ref result); + return; } //Creating the Hediff - HediffDef hediffDefFromDamage = HealthUtility.GetHediffDefFromDamage(dinfo.Def, pawn, exactPartFromDamageInfo); + HediffDef hediffDefFromDamage = HealthUtility.GetHediffDefFromDamage(dinfo.Def, pawn, exactPartFromDamageInfo); Hediff_Injury hediff_Injury = (Hediff_Injury)HediffMaker.MakeHediff(hediffDefFromDamage, pawn, null); hediff_Injury.Part = exactPartFromDamageInfo; hediff_Injury.source = dinfo.Source; @@ -233,7 +235,7 @@ private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_Ad HediffComp_GetsOld hediffComp_GetsOld = hediff_Injury.TryGetComp(); if (hediffComp_GetsOld != null) { - hediffComp_GetsOld.isOld = dinfo.InstantOldInjury; + hediffComp_GetsOld.IsOld = true; } else { @@ -257,14 +259,14 @@ private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_Ad return; } this.FinalizeAndAddInjury(pawn, hediff_Injury, dinfo, ref result); - this.CheckPropagateDamageToInnerSolidParts(dinfo, pawn, hediff_Injury, flag, ref result); - this.CheckDuplicateDamageToOuterParts(dinfo, pawn, hediff_Injury, flag, ref result); + this.CheckPropagateDamageToInnerSolidParts(dinfo, pawn, hediff_Injury, !dinfo.InstantOldInjury, damageAmount, ref result); + this.CheckDuplicateDamageToOuterParts(dinfo, pawn, hediff_Injury, !dinfo.InstantOldInjury, damageAmount, ref result); } private void FinalizeAndAddInjury(Pawn pawn, Hediff_Injury injury, DamageInfo dinfo, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { this.CalculateOldInjuryDamageThreshold(pawn, injury); - result.totalDamageDealt += injury.Severity; + result.totalDamageDealt += Mathf.Min(injury.Severity, pawn.health.hediffSet.GetPartHealth(injury.Part)); pawn.health.AddHediff(injury, null, new DamageInfo?(dinfo)); } @@ -279,8 +281,8 @@ private void CalculateOldInjuryDamageThreshold(Pawn pawn, Hediff_Injury injury) { return; } - bool flag = injury.Part.def.oldInjuryBaseChance >= 0.8f; - if ((Rand.Value <= injury.Part.def.oldInjuryBaseChance * hediffCompProperties.becomeOldChance && injury.Severity >= injury.Part.def.GetMaxHealth(pawn) * 0.25f && injury.Severity >= 7f) || flag) + bool isDelicate = injury.Part.def.IsDelicate; + if ((Rand.Value <= injury.Part.def.oldInjuryBaseChance * hediffCompProperties.becomeOldChance && injury.Severity >= injury.Part.def.GetMaxHealth(pawn) * 0.25f && injury.Severity >= 7f) || isDelicate) { HediffComp_GetsOld hediffComp_GetsOld = injury.TryGetComp(); float num = 1f; @@ -289,37 +291,33 @@ private void CalculateOldInjuryDamageThreshold(Pawn pawn, Hediff_Injury injury) { hediffComp_GetsOld.oldDamageThreshold = Rand.Range(num, num2); } - if (flag) + if (isDelicate) { hediffComp_GetsOld.oldDamageThreshold = injury.Severity; - hediffComp_GetsOld.isOld = true; + hediffComp_GetsOld.IsOld = true; } } } - private void CheckPropagateDamageToInnerSolidParts(DamageInfo dinfo, Pawn pawn, Hediff_Injury injury, bool involveArmor, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) + + private void CheckPropagateDamageToInnerSolidParts(DamageInfo dinfo, Pawn pawn, Hediff_Injury injury, bool involveArmor, int postArmorDamage, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { if (!dinfo.AllowDamagePropagation) { return; } - if (result.deflected && injury.Part.IsInGroup(DefDatabase.GetNamed("CoveredByNaturalArmor"))) - { - return; - } if (Rand.Value >= HealthTunings.ChanceToAdditionallyDamageInnerSolidPart) { return; } - if (dinfo.Def.hasChanceToAdditionallyDamageInnerSolidParts - && !injury.Part.def.IsSolid(injury.Part, pawn.health.hediffSet.hediffs) - && injury.Part.depth == BodyPartDepth.Outside) + if (dinfo.Def.hasChanceToAdditionallyDamageInnerSolidParts && !injury.Part.def.IsSolid(injury.Part, pawn.health.hediffSet.hediffs) && injury.Part.depth == BodyPartDepth.Outside) { - IEnumerable source = - from x in pawn.health.hediffSet.GetNotMissingParts(null, null) - where x.parent == injury.Part && x.def.IsSolid(x, pawn.health.hediffSet.hediffs) && x.depth == BodyPartDepth.Inside - select x; - BodyPartRecord part; - if (source.TryRandomElementByWeight((BodyPartRecord x) => x.absoluteFleshCoverage, out part)) + IEnumerable enumerable = pawn.health.hediffSet.GetNotMissingParts(null, null).Where(x => x.parent == injury.Part && x.def.IsSolid(x, pawn.health.hediffSet.hediffs) && x.depth == BodyPartDepth.Inside); + BodyPartRecord part; + if (DamageWorker_AddInjuryCR.cache0 == null) + { + DamageWorker_AddInjuryCR.cache0 = delegate(BodyPartRecord x) { return x.absoluteFleshCoverage; }; + } + if (enumerable.TryRandomElementByWeight(DamageWorker_AddInjuryCR.cache0, out part)) { HediffDef hediffDefFromDamage = HealthUtility.GetHediffDefFromDamage(dinfo.Def, pawn, part); Hediff_Injury hediff_Injury = (Hediff_Injury)HediffMaker.MakeHediff(hediffDefFromDamage, pawn, null); @@ -328,9 +326,9 @@ from x in pawn.health.hediffSet.GetNotMissingParts(null, null) hediff_Injury.sourceBodyPartGroup = injury.sourceBodyPartGroup; hediff_Injury.Severity = (float)(dinfo.Amount / 2); if (involveArmor) - { - hediff_Injury.Severity = (float)Utility.GetAfterArmorDamage(pawn, dinfo.Amount / 2, part, dinfo); - } + { + hediff_Injury.Severity = (float)postArmorDamage; + } if (hediff_Injury.Severity <= 0f) { return; @@ -340,7 +338,8 @@ from x in pawn.health.hediffSet.GetNotMissingParts(null, null) } } } - private void CheckDuplicateDamageToOuterParts(DamageInfo dinfo, Pawn pawn, Hediff_Injury injury, bool involveArmor, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) + + private void CheckDuplicateDamageToOuterParts(DamageInfo dinfo, Pawn pawn, Hediff_Injury injury, bool involveArmor, int postArmorDamage, ref DamageWorker_AddInjuryCR.LocalInjuryResult result) { if (!dinfo.AllowDamagePropagation) { @@ -360,9 +359,9 @@ private void CheckDuplicateDamageToOuterParts(DamageInfo dinfo, Pawn pawn, Hedif hediff_Injury.sourceBodyPartGroup = injury.sourceBodyPartGroup; hediff_Injury.Severity = (float)dinfo.Amount; if (involveArmor) - { - hediff_Injury.Severity = (float)Utility.GetAfterArmorDamage(pawn, dinfo.Amount, parent, dinfo); - } + { + hediff_Injury.Severity = (float)postArmorDamage; + } if (hediff_Injury.Severity <= 0f) { hediff_Injury.Severity = 1f; @@ -379,6 +378,7 @@ private void CheckDuplicateDamageToOuterParts(DamageInfo dinfo, Pawn pawn, Hedif while (parent != null); } } + private static void InformPsychology(DamageInfo dinfo, Pawn pawn) { if (!pawn.Dead && pawn.needs.mood != null && pawn.thinker != null && dinfo.Def.battleWound) @@ -386,12 +386,13 @@ private static void InformPsychology(DamageInfo dinfo, Pawn pawn) pawn.needs.mood.thoughts.TryGainThought(ThoughtDefOf.BattleWounded); } } + private static bool IsHeadshot(DamageInfo dinfo, Hediff_Injury injury, Pawn pawn) { return !dinfo.InstantOldInjury && injury.Part.groups.Contains(BodyPartGroupDefOf.FullHead) && dinfo.Def == DamageDefOf.Bullet; } - private static BodyPartRecord GetExactPartFromDamageInfo(DamageInfo dinfo, Pawn pawn) + internal static BodyPartRecord GetExactPartFromDamageInfo(DamageInfo dinfo, Pawn pawn) { if (dinfo.Part.Value.Part == null) { @@ -403,18 +404,16 @@ private static BodyPartRecord GetExactPartFromDamageInfo(DamageInfo dinfo, Pawn return randomNotMissingPart; } if (!dinfo.Part.Value.CanMissBodyPart) - { - return ( - from x in pawn.health.hediffSet.GetNotMissingParts(null, null) - where x == dinfo.Part.Value.Part - select x).FirstOrDefault(); + { + BodyPartRecord part = pawn.health.hediffSet.GetNotMissingParts(null, null).Where(x => x == dinfo.Part.Value.Part).FirstOrDefault(); + return part; } BodyPartRecord randomNotMissingPart2 = pawn.health.hediffSet.GetRandomNotMissingPart(null, null); if (randomNotMissingPart2 == null) { Log.Warning("GetRandomNotMissingPart returned null (specified part)."); - } - return randomNotMissingPart2; + } + return randomNotMissingPart2; } private static void PlayWoundedVoiceSound(DamageInfo dinfo, Pawn pawn) @@ -429,7 +428,11 @@ private static void PlayWoundedVoiceSound(DamageInfo dinfo, Pawn pawn) } if (dinfo.Def.externalViolence) { - LifeStageUtility.PlayNearestLifestageSound(pawn, (LifeStageAge ls) => ls.soundWounded); + if (DamageWorker_AddInjuryCR.cache1 == null) + { + DamageWorker_AddInjuryCR.cache1 = delegate(LifeStageAge ls) { return ls.soundWounded; }; + } + LifeStageUtility.PlayNearestLifestageSound(pawn, DamageWorker_AddInjuryCR.cache1); } } } diff --git a/Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_FlameCR.cs b/Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_FlameCR.cs new file mode 100644 index 0000000..d27bd5b --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/DamageWorkers/DamageWorker_FlameCR.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; + +namespace Combat_Realism +{ + // Cloned from vanilla DamageWorker_Flame, only change is inheritance from DamageWorker_AddInjuryCR so we can have the new armor system apply to this as well + public class DamageWorker_FlameCR : DamageWorker_AddInjuryCR + { + public class DamageWorker_Flame : DamageWorker_AddInjury + { + public override float Apply(DamageInfo dinfo, Thing victim) + { + if (!dinfo.InstantOldInjury) + { + victim.TryAttachFire(Rand.Range(0.15f, 0.25f)); + } + Pawn pawn = victim as Pawn; + if (pawn != null && pawn.Faction == Faction.OfColony) + { + Find.TickManager.slower.SignalForceNormalSpeedShort(); + } + return base.Apply(dinfo, victim); + } + + public override void ExplosionAffectCell(Explosion explosion, IntVec3 c, List damagedThings, bool canThrowMotes) + { + base.ExplosionAffectCell(explosion, c, damagedThings, canThrowMotes); + if (this.def == DamageDefOf.Flame) + { + FireUtility.TryStartFireIn(c, Rand.Range(0.2f, 0.6f)); + } + } + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Defs/AmmoCategoryDef.cs b/Source/CombatRealism/Combat_Realism/Defs/AmmoCategoryDef.cs new file mode 100644 index 0000000..d6ed2b2 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Defs/AmmoCategoryDef.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Verse; + +namespace Combat_Realism +{ + public class AmmoCategoryDef : Def + { + public bool advanced = false; + } +} diff --git a/Source/CombatRealism/Combat_Realism/Defs/AmmoDef.cs b/Source/CombatRealism/Combat_Realism/Defs/AmmoDef.cs new file mode 100644 index 0000000..773456b --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Defs/AmmoDef.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class AmmoDef : ThingDef + { + public ThingDef linkedProjectile; + public AmmoCategoryDef ammoClass; + public int defaultAmmoCount = 1; + } +} diff --git a/Source/CombatRealism/Combat_Realism/Defs/AmmoSetDef.cs b/Source/CombatRealism/Combat_Realism/Defs/AmmoSetDef.cs new file mode 100644 index 0000000..73ecd0a --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Defs/AmmoSetDef.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class AmmoSetDef : Def + { + public List ammoTypes; + } +} diff --git a/Source/CombatRealism/Combat_Realism/Defs/DamageDef_CR.cs b/Source/CombatRealism/Combat_Realism/Defs/DamageDef_CR.cs new file mode 100644 index 0000000..82ff5a9 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Defs/DamageDef_CR.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class DamageDef_CR : DamageDef + { + public bool deflectable = false; + public bool absorbable = false; + } +} diff --git a/Source/CombatRealism/Combat_Realism/Defs/LoadoutGeneratorDef.cs b/Source/CombatRealism/Combat_Realism/Defs/LoadoutGeneratorDef.cs new file mode 100644 index 0000000..088236e --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Defs/LoadoutGeneratorDef.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class LoadoutGeneratorDef : ThingDef + { + public LoadoutGenerator loadoutGenerator; + public int priority = 0; + } +} diff --git a/Source/CombatRealism/Combat_Realism/Dialog_ManageLoadouts.cs b/Source/CombatRealism/Combat_Realism/Dialog_ManageLoadouts.cs new file mode 100644 index 0000000..9eead4a --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Dialog_ManageLoadouts.cs @@ -0,0 +1,567 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public enum SourceSelection + { + Ranged, + Melee, + Ammo, + All + } + + public class Dialog_ManageLoadouts : Window + { + #region Fields + + private static Texture2D + _arrowBottom = ContentFinder.Get( "UI/Icons/arrowBottom" ), + _arrowDown = ContentFinder.Get( "UI/Icons/arrowDown" ), + _arrowTop = ContentFinder.Get( "UI/Icons/arrowTop" ), + _arrowUp = ContentFinder.Get( "UI/Icons/arrowUp" ), + _darkBackground = SolidColorMaterials.NewSolidColorTexture(0f, 0f, 0f, .2f), + _iconEdit = ContentFinder.Get( "UI/Icons/edit" ), + _iconClear = ContentFinder.Get( "UI/Icons/clear" ), + _iconAmmo = ContentFinder.Get( "UI/Icons/ammo" ), + _iconRanged = ContentFinder.Get( "UI/Icons/ranged" ), + _iconMelee = ContentFinder.Get( "UI/Icons/melee" ), + _iconAll = ContentFinder.Get( "UI/Icons/all" ), + _iconAmmoAdd = ContentFinder.Get( "UI/Icons/ammoAdd"), + _iconSearch = ContentFinder.Get( "UI/Icons/search" ), + _iconMove = ContentFinder.Get( "UI/Icons/move" ); + + private static Regex validNameRegex = new Regex("^[a-zA-Z0-9 '\\-]*$"); + private Vector2 _availableScrollPosition = Vector2.zero; + private float _barHeight = 24f; + private Vector2 _countFieldSize = new Vector2( 40f, 24f ); + private Loadout _currentLoadout; + private LoadoutSlot _draggedSlot; + private bool _dragging; + private string _filter = ""; + private float _iconSize = 16f; + private float _margin = 6f; + private float _rowHeight = 30f; + private Vector2 _slotScrollPosition = Vector2.zero; + private List _source; + private SourceSelection _sourceType = SourceSelection.Ranged; + private float _topAreaHeight = 30f; + + #endregion Fields + + #region Constructors + + public Dialog_ManageLoadouts( Loadout loadout ) + { + CurrentLoadout = loadout; + SetSource( SourceSelection.Ranged ); + doCloseX = true; + closeOnClickedOutside = true; + closeOnEscapeKey = true; + } + + #endregion Constructors + + #region Properties + + public Loadout CurrentLoadout + { + get + { + return _currentLoadout; + } + set + { + _currentLoadout = value; + } + } + + public LoadoutSlot Dragging + { + get + { + if ( _dragging ) + return _draggedSlot; + return null; + } + set + { + if ( value == null ) + _dragging = false; + else + _dragging = true; + _draggedSlot = value; + } + } + + public override Vector2 InitialWindowSize + { + get + { + return new Vector2( 700, 700 ); + } + } + + #endregion Properties + + #region Methods + + public override void DoWindowContents( Rect canvas ) + { + // fix weird zooming bug + Text.Font = GameFont.Small; + + // SET UP RECTS + // top buttons + Rect selectRect = new Rect( 0f, 0f, canvas.width * .2f, _topAreaHeight ); + Rect newRect = new Rect( selectRect.xMax + _margin, 0f, canvas.width * .2f, _topAreaHeight ); + Rect deleteRect = new Rect( newRect.xMax + _margin, 0f, canvas.width * .2f, _topAreaHeight ); + + // main areas + Rect nameRect = new Rect( + 0f, + _topAreaHeight + _margin * 2, + ( canvas.width - _margin ) / 2f, + 24f ); + + Rect slotListRect = new Rect( + 0f, + nameRect.yMax + _margin, + ( canvas.width - _margin ) / 2f, + canvas.height - _topAreaHeight - nameRect.height - _barHeight * 2 - _margin * 5 ); + + Rect weightBarRect = new Rect( slotListRect.xMin, slotListRect.yMax + _margin, slotListRect.width, _barHeight ); + Rect bulkBarRect = new Rect( weightBarRect.xMin, weightBarRect.yMax + _margin, weightBarRect.width, _barHeight ); + + Rect sourceButtonRect = new Rect( + slotListRect.xMax + _margin, + _topAreaHeight + _margin * 2, + ( canvas.width - _margin ) /2f, + 24f ); + + Rect selectionRect = new Rect( + slotListRect.xMax + _margin, + sourceButtonRect.yMax + _margin, + ( canvas.width - _margin ) / 2f, + canvas.height - 24f - _topAreaHeight - _margin * 3 ); + + var loadouts = LoadoutManager.Loadouts; + + // DRAW CONTENTS + // buttons + // select loadout + if ( Widgets.TextButton( selectRect, "CR.SelectLoadout".Translate() ) ) + { + List options = new List(); + + if ( loadouts.Count == 0 ) + options.Add( new FloatMenuOption( "CR.NoLoadouts".Translate(), null ) ); + else + { + for ( int i = 0; i < loadouts.Count; i++ ) + { + int local_i = i; + options.Add( new FloatMenuOption( loadouts[i].LabelCap, delegate + { CurrentLoadout = loadouts[local_i]; } ) ); + } + } + + Find.WindowStack.Add( new FloatMenu( options ) ); + } + // create loadout + if ( Widgets.TextButton( newRect, "CR.NewLoadout".Translate() ) ) + { + var loadout = new Loadout(); + LoadoutManager.AddLoadout( loadout ); + CurrentLoadout = loadout; + } + // delete loadout + if ( loadouts.Any( l => l.canBeDeleted ) && Widgets.TextButton( deleteRect, "CR.DeleteLoadout".Translate() ) ) + { + List options = new List(); + + for ( int i = 0; i < loadouts.Count; i++ ) + { + int local_i = i; + + // don't allow deleting the default loadout + if ( !loadouts[i].canBeDeleted ) + continue; + options.Add( new FloatMenuOption( loadouts[i].LabelCap, + delegate + { + if ( CurrentLoadout == loadouts[local_i] ) + CurrentLoadout = null; + loadouts.Remove( loadouts[local_i] ); + } ) ); + } + + Find.WindowStack.Add( new FloatMenu( options ) ); + } + + // draw notification if no loadout selected + if ( CurrentLoadout == null ) + { + Text.Anchor = TextAnchor.MiddleCenter; + GUI.color = Color.grey; + Widgets.Label( canvas, "CR.NoLoadoutSelected".Translate() ); + GUI.color = Color.white; + Text.Anchor = TextAnchor.UpperLeft; + + // and stop further drawing + return; + } + + // name + DrawNameField( nameRect ); + + // source selection + DrawSourceSelection( sourceButtonRect ); + + // selection area + DrawSlotSelection( selectionRect ); + + // current slots + DrawSlotList( slotListRect ); + + // bars + if ( CurrentLoadout != null ) + { + Utility_Loadouts.DrawBar( weightBarRect, CurrentLoadout.Weight, StatDef.Named( "CarryWeight" ).defaultBaseValue, "CR.Weight".Translate() ); + Utility_Loadouts.DrawBar( bulkBarRect, CurrentLoadout.Bulk, StatDef.Named( "CarryBulk" ).defaultBaseValue, "CR.Bulk".Translate() ); + } + + // done! + } + + public void DrawSourceSelection( Rect canvas ) + { + Rect button = new Rect( canvas.xMin, canvas.yMin + ( canvas.height - 24f ) / 2f, 24f, 24f ); + + // Ranged weapons + GUI.color = _sourceType == SourceSelection.Ranged ? GenUI.MouseoverColor : Color.white; + if ( Widgets.ImageButton( button, _iconRanged ) ) + SetSource( SourceSelection.Ranged ); + TooltipHandler.TipRegion( button, "CR.SourceRangedTip".Translate() ); + button.x += 24f + _margin; + + // Melee weapons + GUI.color = _sourceType == SourceSelection.Melee ? GenUI.MouseoverColor : Color.white; + if ( Widgets.ImageButton( button, _iconMelee ) ) + SetSource( SourceSelection.Melee ); + TooltipHandler.TipRegion( button, "CR.SourceMeleeTip".Translate() ); + button.x += 24f + _margin; + + // Ammo + GUI.color = _sourceType == SourceSelection.Ammo ? GenUI.MouseoverColor : Color.white; + if ( Widgets.ImageButton( button, _iconAmmo ) ) + SetSource( SourceSelection.Ammo ); + TooltipHandler.TipRegion( button, "CR.SourceAmmoTip".Translate() ); + button.x += 24f + _margin; + + // All + GUI.color = _sourceType == SourceSelection.All ? GenUI.MouseoverColor : Color.white; + if ( Widgets.ImageButton( button, _iconAll ) ) + SetSource( SourceSelection.All ); + TooltipHandler.TipRegion( button, "CR.SourceAllTip".Translate() ); + + // filter input field + Rect filter = new Rect( canvas.xMax - 75f, canvas.yMin + ( canvas.height - 24f ) / 2f, 75f, 24f ); + DrawFilterField( filter ); + TooltipHandler.TipRegion( filter, "CR.SourceFilterTip".Translate() ); + + // search icon + button.x = filter.xMin - _margin * 2 - _iconSize; + GUI.DrawTexture( button, _iconSearch ); + TooltipHandler.TipRegion( button, "CR.SourceFilterTip".Translate() ); + + // reset color + GUI.color = Color.white; + } + + public void FilterSource( string filter ) + { + // reset source + SetSource( _sourceType, true ); + + // filter + _source = _source.Where( td => td.label.ToUpperInvariant().Contains( _filter.ToUpperInvariant() ) ).ToList(); + } + + public void SetSource( SourceSelection source, bool preserveFilter = false ) + { + _source = DefDatabase.AllDefsListForReading; + if ( !preserveFilter ) + _filter = ""; + + switch ( source ) + { + case SourceSelection.Ranged: + _source = _source.Where( td => td.IsRangedWeapon ).ToList(); + _sourceType = SourceSelection.Ranged; + break; + + case SourceSelection.Melee: + _source = _source.Where( td => td.IsMeleeWeapon ).ToList(); + _sourceType = SourceSelection.Melee; + break; + + case SourceSelection.Ammo: + _source = _source.Where( td => td is AmmoDef ).ToList(); + _sourceType = SourceSelection.Ammo; + break; + + case SourceSelection.All: + default: + _source = _source.Where( td => td.alwaysHaulable && td.thingClass != typeof( Corpse ) ).ToList(); + _sourceType = SourceSelection.All; + break; + } + + if ( !_source.NullOrEmpty() ) + _source = _source.OrderBy( td => td.label ).ToList(); + } + + private void DrawCountField( Rect canvas, LoadoutSlot slot ) + { + if ( slot == null ) + return; + string count = GUI.TextField( canvas, slot.Count.ToString() ); + TooltipHandler.TipRegion( canvas, "CR.CountFieldTip".Translate( slot.Count ) ); + int countInt; + if ( int.TryParse( count, out countInt ) ) + { + slot.Count = countInt; + } + } + + private void DrawFilterField( Rect canvas ) + { + string filter = GUI.TextField( canvas, _filter ); + if ( filter != _filter ) + { + _filter = filter; + FilterSource( _filter ); + } + } + + private void DrawNameField( Rect canvas ) + { + string label = GUI.TextField( canvas, CurrentLoadout.label ); + if ( validNameRegex.IsMatch( label ) ) + { + CurrentLoadout.label = label; + } + } + + private void DrawSlot( Rect row, LoadoutSlot slot, bool slotDraggable = true ) + { + // set up rects + // dragging handle (square) | label (fill) | count (50px) | delete (iconSize) + Rect draggingHandle = new Rect( row ); + draggingHandle.width = row.height; + + Rect labelRect = new Rect( row ); + if ( slotDraggable ) + labelRect.xMin = draggingHandle.xMax; + labelRect.xMax = row.xMax - _countFieldSize.x - _iconSize - 2 * _margin; + + Rect countRect = new Rect( + row.xMax - _countFieldSize.x - _iconSize - 2 * _margin, + row.yMin + ( row.height - _countFieldSize.y ) / 2f, + _countFieldSize.x, + _countFieldSize.y ); + + Rect ammoRect = new Rect( + countRect.xMin - _iconSize - _margin, + row.yMin + ( row.height - _iconSize ) / 2f, + _iconSize, _iconSize ); + + Rect deleteRect = new Rect( countRect.xMax + _margin, row.yMin + ( row.height - _iconSize ) /2f, _iconSize, _iconSize ); + + // dragging on dragHandle + if ( slotDraggable ) + { + TooltipHandler.TipRegion( draggingHandle, "CR.DragToReorder".Translate() ); + GUI.DrawTexture( draggingHandle, _iconMove ); + + if ( Mouse.IsOver( draggingHandle ) && Input.GetMouseButtonDown( 0 ) ) + Dragging = slot; + } + + // interactions (main row rect) + if ( !Mouse.IsOver( deleteRect ) ) + { + Widgets.DrawHighlightIfMouseover( row ); + TooltipHandler.TipRegion( row, slot.Def.LabelCap ); + } + + // label + Text.Anchor = TextAnchor.MiddleLeft; + Widgets.Label( labelRect, slot.Def.LabelCap ); + Text.Anchor = TextAnchor.UpperLeft; + + // easy ammo adder, ranged weapons only + if ( slot.Def.IsRangedWeapon ) + { + // make sure there's an ammoset defined + AmmoSetDef ammoSet = slot.Def.GetCompProperties()?.ammoSet; + + if ( ( !ammoSet?.ammoTypes.NullOrEmpty() ) ?? false ) + { + if ( Widgets.ImageButton( ammoRect, _iconAmmoAdd ) ) + { + List options = new List(); + + foreach ( var ammo in ammoSet?.ammoTypes ) + { + options.Add( new FloatMenuOption( ammo.LabelCap, delegate + { + CurrentLoadout.AddSlot( new LoadoutSlot( ammo ) ); + } ) ); + } + + Find.WindowStack.Add( new FloatMenu( options, "CR.AddAmmoFor".Translate( slot.Def.LabelCap ) ) ); + } + } + } + + // count + DrawCountField( countRect, slot ); + + // delete + if ( Mouse.IsOver( deleteRect ) ) + GUI.DrawTexture( row, TexUI.HighlightTex ); + if ( Widgets.ImageButton( deleteRect, _iconClear ) ) + CurrentLoadout.RemoveSlot( slot ); + TooltipHandler.TipRegion( deleteRect, "CR.DeleteFilter".Translate() ); + } + + private void DrawSlotList( Rect canvas ) + { + // set up content canvas + Rect viewRect = new Rect( 0f, 0f, canvas.width, _rowHeight * CurrentLoadout.SlotCount + 1 ); + + // create some extra height if we're dragging + if ( Dragging != null ) + viewRect.height += _rowHeight; + + // leave room for scrollbar if necessary + if ( viewRect.height > canvas.height ) + viewRect.width -= 16f; + + // darken whole area + GUI.DrawTexture( canvas, _darkBackground ); + + Widgets.BeginScrollView( canvas, ref _slotScrollPosition, viewRect ); + int i = 0; + float curY = 0f; + for ( ; i < CurrentLoadout.SlotCount; i++ ) + { + // create row rect + Rect row = new Rect( 0f, curY, viewRect.width, _rowHeight ); + curY += _rowHeight; + + // if we're dragging, and currently on this row, and this row is not the row being dragged - draw a ghost of the slot here + if ( Dragging != null && Mouse.IsOver( row ) && Dragging != CurrentLoadout.Slots[i] ) + { + // draw ghost + GUI.color = new Color( .7f, .7f, .7f, .5f ); + DrawSlot( row, Dragging ); + GUI.color = Color.white; + + // catch mouseUp + if ( Input.GetMouseButtonUp( 0 ) ) + { + CurrentLoadout.MoveSlot( Dragging, i ); + Dragging = null; + } + + // ofset further slots down + row.y += _rowHeight; + curY += _rowHeight; + } + + // alternate row background + if ( i % 2 == 0 ) + GUI.DrawTexture( row, _darkBackground ); + + // draw the slot - grey out if draggin this, but only when dragged over somewhere else + if ( Dragging == CurrentLoadout.Slots[i] && !Mouse.IsOver( row ) ) + GUI.color = new Color( .6f, .6f, .6f, .4f ); + DrawSlot( row, CurrentLoadout.Slots[i], CurrentLoadout.SlotCount > 1 ); + GUI.color = Color.white; + } + + // if we're dragging, create an extra invisible row to allow moving stuff to the bottom + if ( Dragging != null ) + { + Rect row = new Rect( 0f, curY, viewRect.width, _rowHeight ); + + if ( Mouse.IsOver( row ) ) + { + // draw ghost + GUI.color = new Color( .7f, .7f, .7f, .5f ); + DrawSlot( row, Dragging ); + GUI.color = Color.white; + + // catch mouseUp + if ( Input.GetMouseButtonUp( 0 ) ) + { + CurrentLoadout.MoveSlot( Dragging, CurrentLoadout.Slots.Count - 1 ); + Dragging = null; + } + } + } + + // cancel drag when mouse leaves the area, or on mouseup. + if ( !Mouse.IsOver( viewRect ) || Input.GetMouseButtonUp( 0 ) ) + Dragging = null; + + Widgets.EndScrollView(); + } + + private void DrawSlotSelection( Rect canvas ) + { + GUI.DrawTexture( canvas, _darkBackground ); + + if ( _source.NullOrEmpty() ) + return; + + Rect viewRect = new Rect( canvas ); + viewRect.width -= 16f; + viewRect.height = _source.Count * _rowHeight; + + Widgets.BeginScrollView( canvas, ref _availableScrollPosition, viewRect.AtZero() ); + for ( int i = 0; i < _source.Count; i++ ) + { + Rect row = new Rect( 0f, i * _rowHeight, canvas.width, _rowHeight ); + Rect labelRect = new Rect( row ); + + labelRect.xMin += _margin; + if ( i % 2 == 0 ) + GUI.DrawTexture( row, _darkBackground ); + + Text.Anchor = TextAnchor.MiddleLeft; + Widgets.Label( labelRect, _source[i].LabelCap ); + Text.Anchor = TextAnchor.UpperLeft; + + Widgets.DrawHighlightIfMouseover( row ); + if ( Widgets.InvisibleButton( row ) ) + { + var slot = new LoadoutSlot( _source[i], 1 ); + CurrentLoadout.AddSlot( slot ); + } + } + Widgets.EndScrollView(); + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/FireMode.cs b/Source/CombatRealism/Combat_Realism/FireMode.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/FireMode.cs rename to Source/CombatRealism/Combat_Realism/FireMode.cs diff --git a/Source/CombatRealism/Combat_Realism/Gizmos/Command_Reload.cs b/Source/CombatRealism/Combat_Realism/Gizmos/Command_Reload.cs new file mode 100644 index 0000000..48b74c2 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Gizmos/Command_Reload.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; +using CommunityCoreLibrary; + +namespace Combat_Realism +{ + public class Command_Reload : Command_Action + { + public CompAmmoUser compAmmo; + + public override void ProcessInput(Event ev) + { + if (ev.button == 1 && compAmmo.useAmmo && compAmmo.compInventory != null) + Find.WindowStack.Add(MakeAmmoMenu()); + else + base.ProcessInput(ev); + } + + private FloatMenu MakeAmmoMenu() + { + List ammoList = new List(); // List of all ammo types the gun can use and the pawn has in his inventory + if (compAmmo.compInventory == null) + { + // If we have no inventory available (e.g. manned turret), add all possible ammo types to the selection + ammoList.AddRange(compAmmo.Props.ammoSet.ammoTypes); + } + else + { + // Iterate through all suitable ammo types and check if they're in our inventory + foreach (ThingDef curAmmoDef in compAmmo.Props.ammoSet.ammoTypes) + { + if (compAmmo.compInventory.ammoList.Any(x => x.def == curAmmoDef)) + ammoList.Add(curAmmoDef); + } + } + + // Append float menu options for every available ammo type + List floatOptionList = new List(); + if (ammoList.NullOrEmpty()) + { + floatOptionList.Add(new FloatMenuOption("CR_OutOfAmmo".Translate(), null)); + } + else + { + foreach (ThingDef curDef in ammoList) + { + AmmoDef ammoDef = (AmmoDef)curDef; + floatOptionList.Add(new FloatMenuOption(ammoDef.ammoClass.LabelCap, new Action(delegate { compAmmo.selectedAmmo = ammoDef; }))); + } + } + return new FloatMenu(floatOptionList); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Gizmos/GizmoAmmoStatus.cs b/Source/CombatRealism/Combat_Realism/Gizmos/GizmoAmmoStatus.cs new file mode 100644 index 0000000..e0d6410 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Gizmos/GizmoAmmoStatus.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class GizmoAmmoStatus : Command + { + private static bool initialized; + //Link + public CompAmmoUser compAmmo; + + private static Texture2D FullTex; + private static Texture2D EmptyTex; + private static Texture2D BGTex; + + public override float Width + { + get + { + return 120; + } + } + + public override GizmoResult GizmoOnGUI(Vector2 topLeft) + { + if (!initialized) + InitializeTextures(); + + var overRect = new Rect(topLeft.x, topLeft.y, Width, Height); + Widgets.DrawBox(overRect); + GUI.DrawTexture(overRect, BGTex); + + var inRect = overRect.ContractedBy(6); + + // Ammo type + var textRect = inRect; + textRect.height = overRect.height / 2; + Text.Font = GameFont.Tiny; + Widgets.Label(textRect, compAmmo.currentAmmo == null ? compAmmo.parent.def.LabelCap : compAmmo.currentAmmo.ammoClass.LabelCap); + + // Bar + if (compAmmo.hasMagazine) + { + var barRect = inRect; + barRect.yMin = overRect.y + overRect.height / 2f; + var ePct = (float)compAmmo.curMagCount / compAmmo.Props.magazineSize; + Widgets.FillableBar(barRect, ePct); + Text.Font = GameFont.Small; + Text.Anchor = TextAnchor.MiddleCenter; + Widgets.Label(barRect, compAmmo.curMagCount + " / " + compAmmo.Props.magazineSize); + Text.Anchor = TextAnchor.UpperLeft; + } + + return new GizmoResult(GizmoState.Clear); + } + + private void InitializeTextures() + { + if (FullTex == null) + FullTex = SolidColorMaterials.NewSolidColorTexture(new Color(0.2f, 0.2f, 0.24f)); + if (EmptyTex == null) + EmptyTex = SolidColorMaterials.NewSolidColorTexture(Color.clear); + if (BGTex == null) + BGTex = ContentFinder.Get("UI/Widgets/DesButBG", true); + initialized = true; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/ITabInjector.cs b/Source/CombatRealism/Combat_Realism/ITabInjector.cs new file mode 100644 index 0000000..371522b --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/ITabInjector.cs @@ -0,0 +1,37 @@ +using CommunityCoreLibrary; +using RimWorld; +using Verse; + +namespace Combat_Realism +{ + public class ITabInjector : SpecialInjector + { + #region Methods + + public override bool Inject() + { + // get reference to lists of itabs + var itabs = ThingDefOf.Human.inspectorTabs; + var itabsResolved = ThingDefOf.Human.inspectorTabsResolved; + + // replace ITab in the unresolved list + var index = itabs.IndexOf( typeof( ITab_Pawn_Gear ) ); + if ( index != -1 ) + { + itabs.Remove( typeof( ITab_Pawn_Gear ) ); + itabs.Insert( index, typeof( ITab_Inventory ) ); + } + + // re-resolve all the tabs. + itabsResolved.Clear(); + foreach ( var tab in itabs ) + { + itabsResolved.Add( ITabManager.GetSharedInstance( tab ) ); + } + + return true; + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Source/CombatRealism/Combat_Realism/ITab_Inventory.cs b/Source/CombatRealism/Combat_Realism/ITab_Inventory.cs new file mode 100644 index 0000000..2d6e75f --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/ITab_Inventory.cs @@ -0,0 +1,240 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class ITab_Inventory : ITab_Pawn_Gear + { + #region Fields + + private const float _barHeight = 20f; + private const float _margin = 6f; + private const float _thingIconSize = 28f; + private const float _thingLeftX = 36f; + private const float _thingRowHeight = 28f; + private const float _topPadding = 20f; + private static readonly Color _highlightColor = new Color(0.5f, 0.5f, 0.5f, 1f); + private static readonly Color _thingLabelColor = new Color(0.9f, 0.9f, 0.9f, 1f); + private Vector2 _scrollPosition = Vector2.zero; + + private float _scrollViewHeight; + + #endregion Fields + + #region Constructors + + public ITab_Inventory() : base() + { + } + + #endregion Constructors + + #region Properties + + private bool CanEdit + { + get + { + return this.SelPawnForGear.IsColonistPlayerControlled; + } + } + + private Pawn SelPawnForGear + { + get + { + if ( base.SelPawn != null ) + { + return base.SelPawn; + } + Corpse corpse = base.SelThing as Corpse; + if ( corpse != null ) + { + return corpse.innerPawn; + } + throw new InvalidOperationException( "Gear tab on non-pawn non-corpse " + base.SelThing ); + } + } + + #endregion Properties + + #region Methods + + protected override void FillTab() + { + // get the inventory comp + CompInventory comp = SelPawn.TryGetComp(); + + // set up rects + Rect listRect = new Rect( + _margin, + _topPadding, + size.x - 2 * _margin, + size.y - _topPadding - _margin ); + + if ( comp != null ) + { + // adjust rects if comp found + listRect.height -= ( _margin + _barHeight ) * 2; + Rect weightRect = new Rect( _margin, listRect.yMax + _margin, listRect.width, _barHeight ); + Rect bulkRect = new Rect( _margin, weightRect.yMax + _margin, listRect.width, _barHeight ); + + Utility_Loadouts.DrawBar( bulkRect, comp.currentBulk, comp.capacityBulk, "CR.Bulk".Translate(), "CR.ITabBulkTip".Translate( comp.capacityBulk, comp.currentBulk, comp.workSpeedFactor ) ); + Utility_Loadouts.DrawBar( weightRect, comp.currentWeight, comp.capacityWeight, "CR.Weight".Translate(), "CR.ITabWeightTip".Translate( comp.capacityWeight, comp.currentWeight, comp.moveSpeedFactor, comp.encumberPenalty ) ); + } + + // start drawing list (rip from ITab_Pawn_Gear) + GUI.BeginGroup( listRect ); + Text.Font = GameFont.Small; + GUI.color = Color.white; + Rect outRect = new Rect( 0f, 0f, listRect.width, listRect.height ); + Rect viewRect = new Rect( 0f, 0f, listRect.width - 16f, this._scrollViewHeight ); + Widgets.BeginScrollView( outRect, ref this._scrollPosition, viewRect ); + float curY = 0f; + if ( this.SelPawnForGear.equipment != null ) + { + Widgets.ListSeparator( ref curY, viewRect.width, "Equipment".Translate() ); + foreach ( ThingWithComps current in this.SelPawnForGear.equipment.AllEquipment ) + { + this.DrawThingRow( ref curY, viewRect.width, current ); + } + } + if ( this.SelPawnForGear.apparel != null ) + { + Widgets.ListSeparator( ref curY, viewRect.width, "Apparel".Translate() ); + foreach ( Apparel current2 in from ap in this.SelPawnForGear.apparel.WornApparel + orderby ap.def.apparel.bodyPartGroups[0].listOrder descending + select ap ) + { + this.DrawThingRow( ref curY, viewRect.width, current2 ); + } + } + if ( this.SelPawnForGear.inventory != null ) + { + Widgets.ListSeparator( ref curY, viewRect.width, "Inventory".Translate() ); + foreach ( Thing current3 in this.SelPawnForGear.inventory.container ) + { + this.DrawThingRow( ref curY, viewRect.width, current3 ); + } + } + if ( Event.current.type == EventType.Layout ) + { + this._scrollViewHeight = curY + 30f; + } + Widgets.EndScrollView(); + GUI.EndGroup(); + + GUI.color = Color.white; + Text.Anchor = TextAnchor.UpperLeft; + } + + private void DrawThingRow( ref float y, float width, Thing thing ) + { + Rect rect = new Rect( 0f, y, width, 28f ); + if ( Mouse.IsOver( rect ) ) + { + GUI.color = _highlightColor; + GUI.DrawTexture( rect, TexUI.HighlightTex ); + } + if ( Widgets.InvisibleButton( rect ) && Event.current.button == 1 ) + { + List floatOptionList = new List(); + floatOptionList.Add( new FloatMenuOption( "ThingInfo".Translate(), delegate + { + Find.WindowStack.Add( new Dialog_InfoCard( thing ) ); + }, MenuOptionPriority.Medium, null, null ) ); + if ( this.CanEdit ) + { + // Equip option + ThingWithComps eq = thing as ThingWithComps; + if (eq != null && eq.TryGetComp() != null) + { + CompInventory compInventory = SelPawnForGear.TryGetComp(); + if (compInventory != null) + { + FloatMenuOption equipOption; + string eqLabel = GenLabel.ThingLabel(eq.def, eq.Stuff, 1); + if (SelPawnForGear.equipment.AllEquipment.Contains(eq) && SelPawnForGear.inventory != null) + { + equipOption = new FloatMenuOption("CR_PutAway".Translate(new object[] { eqLabel }), + new Action(delegate + { + ThingWithComps oldEq; + SelPawnForGear.equipment.TryTransferEquipmentToContainer(SelPawnForGear.equipment.Primary, SelPawnForGear.inventory.container, out oldEq); + })); + } + else if (!SelPawnForGear.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) + { + equipOption = new FloatMenuOption("CannotEquip".Translate(new object[] { eqLabel }), null); + } + else + { + string equipOptionLabel = "Equip".Translate(new object[] { eqLabel }); + if (eq.def.IsRangedWeapon && SelPawnForGear.story != null && SelPawnForGear.story.traits.HasTrait(TraitDefOf.Brawler)) + { + equipOptionLabel = equipOptionLabel + " " + "EquipWarningBrawler".Translate(); + } + equipOption = new FloatMenuOption(equipOptionLabel, new Action(delegate + { + compInventory.TrySwitchToWeapon(eq); + })); + } + floatOptionList.Add(equipOption); + } + } + + // Drop option + Action action = null; + Apparel ap = thing as Apparel; + if ( ap != null && SelPawnForGear.apparel.WornApparel.Contains(ap)) + { + Apparel unused; + action = delegate + { + this.SelPawnForGear.apparel.TryDrop( ap, out unused, this.SelPawnForGear.Position, true ); + }; + } + else if ( eq != null && this.SelPawnForGear.equipment.AllEquipment.Contains( eq ) ) + { + ThingWithComps unused; + action = delegate + { + this.SelPawnForGear.equipment.TryDropEquipment( eq, out unused, this.SelPawnForGear.Position, true ); + }; + } + else if ( !thing.def.destroyOnDrop ) + { + Thing unused; + action = delegate + { + this.SelPawnForGear.inventory.container.TryDrop( thing, this.SelPawnForGear.Position, ThingPlaceMode.Near, out unused ); + }; + } + floatOptionList.Add( new FloatMenuOption( "DropThing".Translate(), action, MenuOptionPriority.Medium, null, null ) ); + } + FloatMenu window = new FloatMenu( floatOptionList, thing.LabelCap, false, false ); + Find.WindowStack.Add( window ); + } + if ( thing.def.DrawMatSingle != null && thing.def.DrawMatSingle.mainTexture != null ) + { + Widgets.ThingIcon( new Rect( 4f, y, 28f, 28f ), thing ); + } + Text.Anchor = TextAnchor.MiddleLeft; + GUI.color = _thingLabelColor; + Rect rect2 = new Rect( 36f, y, width - 36f, 28f ); + string text = thing.LabelCap; + if ( thing is Apparel && this.SelPawnForGear.outfits != null && this.SelPawnForGear.outfits.forcedHandler.IsForced( (Apparel)thing ) ) + { + text = text + ", " + "ApparelForcedLower".Translate(); + } + Widgets.Label( rect2, text ); + y += 28f; + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Reload/ExternalPawnDrafter.cs b/Source/CombatRealism/Combat_Realism/Jobs/ExternalPawnDrafter.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Reload/ExternalPawnDrafter.cs rename to Source/CombatRealism/Combat_Realism/Jobs/ExternalPawnDrafter.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/JobDriver_HunkerDown.cs b/Source/CombatRealism/Combat_Realism/Jobs/JobDriver_HunkerDown.cs similarity index 96% rename from Assemblies/Source/CombatRealism/Combat_Realism/JobDriver_HunkerDown.cs rename to Source/CombatRealism/Combat_Realism/Jobs/JobDriver_HunkerDown.cs index b351ca3..f301efc 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/JobDriver_HunkerDown.cs +++ b/Source/CombatRealism/Combat_Realism/Jobs/JobDriver_HunkerDown.cs @@ -23,7 +23,7 @@ public override PawnPosture Posture protected override IEnumerable MakeNewToils() { - this.FailOnBroken(TargetIndex.A); + this.FailOnDespawnedOrNull(TargetIndex.A); //Define Toil Toil toilWait = new Toil(); diff --git a/Assemblies/Source/CombatRealism/Reload/JobDriver_Reload.cs b/Source/CombatRealism/Combat_Realism/Jobs/JobDriver_Reload.cs similarity index 72% rename from Assemblies/Source/CombatRealism/Reload/JobDriver_Reload.cs rename to Source/CombatRealism/Combat_Realism/Jobs/JobDriver_Reload.cs index 314d3c2..8aba301 100644 --- a/Assemblies/Source/CombatRealism/Reload/JobDriver_Reload.cs +++ b/Source/CombatRealism/Combat_Realism/Jobs/JobDriver_Reload.cs @@ -1,27 +1,31 @@ using System.Collections.Generic; +using RimWorld; using Verse; using Verse.AI; +using UnityEngine; namespace Combat_Realism { public class JobDriver_Reload : JobDriver { - private CompReloader compReloader + private CompAmmoUser compReloader { get { - return TargetThingB.TryGetComp(); + return TargetThingB.TryGetComp(); } } + protected override IEnumerable< Toil > MakeNewToils() { - this.FailOnBroken( TargetIndex.A ); + this.FailOnDespawnedOrNull( TargetIndex.A ); + this.FailOnMentalState(TargetIndex.A); //Toil of do-nothing var waitToil = new Toil(); waitToil.initAction = () => waitToil.actor.pather.StopDead(); waitToil.defaultCompleteMode = ToilCompleteMode.Delay; - waitToil.defaultDuration = compReloader.reloaderProp.reloadTick; + waitToil.defaultDuration = Mathf.CeilToInt(compReloader.Props.reloadTicks / pawn.GetStatValue(StatDef.Named("ReloadSpeed"))); yield return waitToil; //Actual reloader diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/JobGiver_HunkerDown.cs b/Source/CombatRealism/Combat_Realism/Jobs/JobGiver_HunkerDown.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/JobGiver_HunkerDown.cs rename to Source/CombatRealism/Combat_Realism/Jobs/JobGiver_HunkerDown.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/JobGiver_RunForCover.cs b/Source/CombatRealism/Combat_Realism/Jobs/JobGiver_RunForCover.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/JobGiver_RunForCover.cs rename to Source/CombatRealism/Combat_Realism/Jobs/JobGiver_RunForCover.cs diff --git a/Source/CombatRealism/Combat_Realism/Jobs/JobGiver_UpdateLoadout.cs b/Source/CombatRealism/Combat_Realism/Jobs/JobGiver_UpdateLoadout.cs new file mode 100644 index 0000000..35b9b68 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Jobs/JobGiver_UpdateLoadout.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using Verse.AI; +using UnityEngine; + +namespace Combat_Realism +{ + public class JobGiver_UpdateLoadout : ThinkNode_JobGiver + { + protected override Job TryGiveTerminalJob(Pawn pawn) + { + // Get inventory + CompInventory inventory = pawn.TryGetComp(); + if (inventory == null) + return null; + + // Find missing items + Loadout loadout = pawn.GetLoadout(); + if (loadout != null) + { + foreach (LoadoutSlot slot in loadout.Slots) + { + int numContained = inventory.container.NumContained(slot.Def); + if (numContained < slot.Count) + { + Thing thing = GenClosest.ClosestThingReachable(pawn.Position, + ThingRequest.ForDef(slot.Def), + PathEndMode.ClosestTouch, + TraverseParms.For(pawn, Danger.None, TraverseMode.ByPawn), + 80, + x => !x.IsForbidden(pawn) && pawn.CanReserve(x)); + if (thing != null) + { + int maxFit; + if (inventory.CanFitInInventory(thing, out maxFit)) + { + return new Job(JobDefOf.TakeInventory, thing) { maxNumToCarry = Mathf.Min(thing.stackCount, slot.Count - numContained, maxFit) }; + } + } + } + } + } + return null; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Loadout.cs b/Source/CombatRealism/Combat_Realism/Loadout.cs new file mode 100644 index 0000000..7611596 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Loadout.cs @@ -0,0 +1,143 @@ +using CommunityCoreLibrary; +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class Loadout : IExposable, ILoadReferenceable + { + #region Fields + + public bool canBeDeleted = true; + public bool defaultLoadout = false; + public string label; + internal int uniqueID; + private List _slots = new List(); + + #endregion Fields + + #region Constructors + + public Loadout() + { + // this constructor is also used by the scribe, in which case defaults generated here will get overwritten. + + // create a unique default name. + label = LoadoutManager.GetUniqueLabel(); + + // create a unique ID. + uniqueID = LoadoutManager.GetUniqueID(); + } + + public Loadout( string label ) + { + this.label = label; + + // create a unique ID. + uniqueID = LoadoutManager.GetUniqueID(); + } + + public Loadout( string label, int uniqueID ) + { + this.label = label; + this.uniqueID = uniqueID; + } + + #endregion Constructors + + #region Properties + + public float Bulk + { + get + { + return _slots.Select( slot => slot.Def.GetStatValueAbstract( StatDef.Named( "Bulk" ) ) * slot.Count ).Sum(); + } + } + + public string LabelCap => label.CapitalizeFirst(); + + public int SlotCount => _slots.Count; + + public List Slots => _slots; + + public float Weight + { + get + { + return _slots.Select( slot => slot.Def.GetStatValueAbstract( StatDef.Named( "Weight" ) ) * slot.Count ).Sum(); + } + } + + #endregion Properties + + #region Methods + + public void AddSlot( LoadoutSlot slot ) + { + _slots.Add( slot ); + } + + public void ExposeData() + { + // basic info about this loadout + Scribe_Values.LookValue( ref label, "label" ); + Scribe_Values.LookValue( ref uniqueID, "uniqueID" ); + Scribe_Values.LookValue( ref canBeDeleted, "canBeDeleted", true ); + Scribe_Values.LookValue( ref defaultLoadout, "defaultLoadout", false ); + + // slots + Scribe_Collections.LookList( ref _slots, "slots", LookMode.Deep ); + } + + public string GetUniqueLoadID() + { + return "Loadout_" + label + "_" + uniqueID; + } + + public void MoveSlot( LoadoutSlot slot, int toIndex ) + { + int fromIndex = _slots.IndexOf( slot ); + MoveTo( fromIndex, toIndex ); + } + + public void RemoveSlot( LoadoutSlot slot ) + { + _slots.Remove( slot ); + } + + public void RemoveSlot( int index ) + { + _slots.RemoveAt( index ); + } + + private int MoveTo( int fromIndex, int toIndex ) + { + if ( fromIndex < 0 || fromIndex >= _slots.Count || toIndex < 0 || toIndex >= _slots.Count ) + { + throw new Exception( "Attempted to move i " + fromIndex + " to " + toIndex + ", bounds are [0," + ( _slots.Count-1 ) + "]." ); + } + + // fetch the filter we're moving + var temp = _slots[fromIndex]; + + // remove from old location + _slots.RemoveAt( fromIndex ); + + // this may have changed the toIndex + if ( fromIndex + 1 < toIndex ) + toIndex--; + + // insert at new location + _slots.Insert( toIndex, temp ); + return toIndex; + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Source/CombatRealism/Combat_Realism/LoadoutAssignment.cs b/Source/CombatRealism/Combat_Realism/LoadoutAssignment.cs new file mode 100644 index 0000000..4e91226 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutAssignment.cs @@ -0,0 +1,33 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutAssignment : IExposable + { + #region Fields + + internal Loadout loadout; + internal Pawn pawn; + + #endregion Fields + + #region Methods + + public void ExposeData() + { + Scribe_References.LookReference( ref pawn, "pawn" ); + Scribe_References.LookReference( ref loadout, "loadout" ); + +#if DEBUG + Log.Message( Scribe.mode + ", pawn: " + ( pawn == null ? "NULL" : pawn.NameStringShort ) + ", loadout: " + ( loadout == null ? "NULL" : loadout.label ) ); +#endif + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator.cs b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator.cs new file mode 100644 index 0000000..a190aae --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutGenerator + { + public float skipChance = 0f; + public ThingDef thingDef; + public int minCount = 0; + public int maxCount = 0; + protected CompInventory compInvInt = null; + protected ThingDef thingToMake; + + /// + /// Generates a loadout from available ThingDefs with respect to inventory constraints and deposits items straight into inventory + /// + /// Inventory comp to fill + public virtual void GenerateLoadout(CompInventory inventory) + { + if (inventory == null) + { + Log.Error("Tried generating loadout without inventory"); + return; + } + if (UnityEngine.Random.value < skipChance) + { + return; + } + compInvInt = inventory; + + // Calculate thing count + int thingsToMake = UnityEngine.Random.Range(minCount, maxCount); + + // Make things + while (thingsToMake > 0) + { + Thing thing = GenerateLoadoutThing(UnityEngine.Random.Range(1, thingsToMake)); + if (thing == null) + { + return; + } + int maxCount; + if(compInvInt.CanFitInInventory(thing, out maxCount)) + { + IntVec3 spawnPos = inventory.parent.Position.InBounds() ? inventory.parent.Position : IntVec3.Zero; + GenSpawn.Spawn(thing, spawnPos); + + // If we cant fit the whole stack, fit as much as we can and return + if(maxCount < thing.stackCount) + { + thing.stackCount = maxCount; + compInvInt.container.TryAdd(thing, thing.stackCount); + return; + } + compInvInt.container.TryAdd(thing, thing.stackCount); + thingsToMake -= maxCount; + } + else + { + return; + } + } + } + + /// + /// Generates a random thing from the available things list + /// + /// Maximum stack count to generate + protected virtual Thing GenerateLoadoutThing(int max) + { + if (thingToMake == null) + { + if(thingDef == null) + { + Log.Error("Tried to make thing from null def"); + return null; + } + thingToMake = thingDef; + } + ThingDef stuff = null; + if (thingToMake.MadeFromStuff) + { + stuff = GenStuff.RandomStuffFor(thingToMake); + } + Thing thing = ThingMaker.MakeThing(thingToMake, stuff); + thing.stackCount = UnityEngine.Random.Range(1, Mathf.Min(thing.def.stackLimit, max)); + return thing; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoPrimary.cs b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoPrimary.cs new file mode 100644 index 0000000..fb98f5a --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoPrimary.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutGenerator_AmmoPrimary : LoadoutGenerator_List + { + /// + /// Initializes availableDefs and adds all available ammo types of the currently equipped weapon + /// + protected override void InitAvailableDefs() + { + Pawn pawn = compInvInt.parent as Pawn; + if(pawn == null) + { + Log.Error("Tried generating ammo loadout defs with null pawn"); + return; + } + if (pawn.equipment != null && pawn.equipment.Primary != null) + { + ThingWithComps eq = pawn.equipment.Primary; + availableDefs = new List(); + AddAvailableAmmoFor(eq); + } + } + + protected void AddAvailableAmmoFor(ThingWithComps eq) + { + if (eq == null || availableDefs == null) + { + return; + } + CompAmmoUser compAmmo = eq.TryGetComp(); + if (compAmmo != null && !compAmmo.Props.ammoSet.ammoTypes.NullOrEmpty()) + { + foreach (ThingDef ammo in compAmmo.Props.ammoSet.ammoTypes) + { + if (ammo.canBeSpawningInventory) + availableDefs.Add(ammo); + } + } + } + + protected override float GetWeightForDef(ThingDef def) + { + float weight = 1; + AmmoDef ammo = def as AmmoDef; + if (ammo != null && ammo.ammoClass.advanced) + weight *= 0.2f; + return weight; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoSecondary.cs b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoSecondary.cs new file mode 100644 index 0000000..df560fe --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_AmmoSecondary.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + class LoadoutGenerator_AmmoSecondary : LoadoutGenerator_AmmoPrimary + { + /// + /// Initializes availableDefs and adds the ammo types of all currently equipped sidearms + /// + protected override void InitAvailableDefs() + { + availableDefs = new List(); + foreach (ThingWithComps eq in compInvInt.rangedWeaponList) + { + AddAvailableAmmoFor(eq); + } + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_List.cs b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_List.cs new file mode 100644 index 0000000..a76897c --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_List.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public abstract class LoadoutGenerator_List : LoadoutGenerator + { + protected List availableDefs; + + public override void GenerateLoadout(CompInventory inventory) + { + compInvInt = inventory; + // Initialize available ThingDefs + InitAvailableDefs(); + if (this.availableDefs.NullOrEmpty()) + { + return; + } + base.GenerateLoadout(inventory); + } + + protected abstract void InitAvailableDefs(); + + protected abstract float GetWeightForDef(ThingDef def); + + protected override Thing GenerateLoadoutThing(int max) + { + ThingDef def = availableDefs.RandomElementByWeight(GetWeightForDef); + thingToMake = def; + return base.GenerateLoadoutThing(max); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_WeaponByTag.cs b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_WeaponByTag.cs new file mode 100644 index 0000000..aaeb1be --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutGen/LoadoutGenerator_WeaponByTag.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutGenerator_WeaponByTag : LoadoutGenerator_List + { + public string tag; + public FloatRange baseMoney = FloatRange.Zero; + private static Dictionary> tagListDict = new Dictionary>(); + + protected override void InitAvailableDefs() + { + // Initialize and cache list of all weapons with our tag so we can use them in the future + if (!tagListDict.ContainsKey(tag)) + { + List taggedWeaponList = new List(); + foreach(ThingDef def in Utility.allWeaponDefs) + { + if (!def.weaponTags.NullOrEmpty() && def.weaponTags.Contains(tag)) + { + taggedWeaponList.Add(def); + } + } + tagListDict.Add(tag, taggedWeaponList); + } + // Fetch cached list from dictionary + tagListDict.TryGetValue(tag, out availableDefs); + } + + protected override float GetWeightForDef(ThingDef def) + { + if (!baseMoney.Includes(def.BaseMarketValue)) + { + return 0; + } + return 1; + } + + protected override Thing GenerateLoadoutThing(int max) + { + Thing thing = base.GenerateLoadoutThing(max); + Pawn pawn = compInvInt.parent as Pawn; + if (pawn != null) + PawnGenerator.PostProcessGeneratedGear(thing, compInvInt.parent as Pawn); + return thing; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/LoadoutSlot.cs b/Source/CombatRealism/Combat_Realism/LoadoutSlot.cs new file mode 100644 index 0000000..f8380c0 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/LoadoutSlot.cs @@ -0,0 +1,61 @@ +using CommunityCoreLibrary; +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + // this has been reduced to a thingCount at this point, with the exception of the added default count bit + // -- Fluffy + public class LoadoutSlot : IExposable + { + #region Fields + + private const int _defaultCount = 1; + private int _count; + private ThingDef _def; + + #endregion Fields + + #region Constructors + + public LoadoutSlot( ThingDef def, int count = 1 ) + { + Count = count; + Def = def; + + // increase default ammo count + if ( def is AmmoDef ) + Count = ( (AmmoDef)def ).defaultAmmoCount; + } + + public LoadoutSlot() + { + // for scribe; if Count is set default will be overwritten. Def is always stored/loaded. + Count = _defaultCount; + } + + #endregion Constructors + + #region Properties + + public int Count { get { return _count; } set { _count = value; } } + public ThingDef Def { get { return _def; } set { _def = value; } } + + #endregion Properties + + #region Methods + + public void ExposeData() + { + Scribe_Values.LookValue( ref _count, "count", _defaultCount ); + Scribe_Defs.LookDef( ref _def, "def" ); + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Source/CombatRealism/Combat_Realism/MainTabWindow_OutfitsAndLoadouts.cs b/Source/CombatRealism/Combat_Realism/MainTabWindow_OutfitsAndLoadouts.cs new file mode 100644 index 0000000..5510785 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/MainTabWindow_OutfitsAndLoadouts.cs @@ -0,0 +1,248 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public enum OutfitWindow + { + Outfits, + Loadouts + } + + public class MainTabWindow_OutfitsAndLoadouts : MainTabWindow_PawnList + { + #region Fields + + private static Texture2D _iconClearForced = ContentFinder.Get( "UI/Icons/clear" ); + private static Texture2D _iconEdit = ContentFinder.Get( "UI/Icons/edit" ); + private float _buttonSize = 16f; + private float _margin = 6f; + private float _rowHeight = 30f; + private float _topArea = 45f; + + #endregion Fields + + #region Properties + + public override Vector2 RequestedTabSize + { + get + { + return new Vector2( 1010f, 45f + (float)base.PawnsCount * _rowHeight + 65f ); + } + } + + #endregion Properties + + #region Methods + + public override void DoWindowContents( Rect canvas ) + { + // fix weird zooming bug + Text.Font = GameFont.Small; + + base.DoWindowContents( canvas ); + + // available space + Rect header = new Rect( 175f + 24f + _margin, _topArea - _rowHeight, canvas.width - 175f - 24f - _margin - 16f, _rowHeight ); + + // label + buttons for outfit + Rect outfitRect = new Rect( header.xMin, + header.yMin, + header.width * ( 1f/3f ) + ( _margin + _buttonSize ) / 2f, + header.height ); + Rect labelOutfitRect = new Rect( outfitRect.xMin, + outfitRect.yMin, + outfitRect.width - _margin * 3 - _buttonSize * 2, + outfitRect.height ) + .ContractedBy( _margin / 2f ); + Rect editOutfitRect = new Rect( labelOutfitRect.xMax + _margin, + outfitRect.yMin + ( ( outfitRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + Rect forcedOutfitRect = new Rect( labelOutfitRect.xMax + _buttonSize + _margin * 2, + outfitRect.yMin + ( ( outfitRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + + // label + button for loadout + Rect loadoutRect = new Rect( outfitRect.xMax, + header.yMin, + header.width * ( 1f/3f ) - ( _margin + _buttonSize ) / 2f, + header.height ); + Rect labelLoadoutRect = new Rect( loadoutRect.xMin, + loadoutRect.yMin, + loadoutRect.width - _margin * 2 - _buttonSize, + loadoutRect.height ) + .ContractedBy( _margin / 2f ); + Rect editLoadoutRect = new Rect( labelLoadoutRect.xMax + _margin, + loadoutRect.yMin + ( ( loadoutRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + + // weight + bulk indicators + Rect weightRect = new Rect( loadoutRect.xMax, header.yMin, header.width * ( 1f/6f ) - _margin, header.height ).ContractedBy( _margin / 2f ); + Rect bulkRect = new Rect( weightRect.xMax, header.yMin, header.width * ( 1f/6f ) - _margin, header.height ).ContractedBy( _margin / 2f ); + + // draw headers + Text.Anchor = TextAnchor.LowerCenter; + Widgets.Label( labelOutfitRect, "CurrentOutfit".Translate() ); + TooltipHandler.TipRegion( editOutfitRect, "CR.EditX".Translate( "CR.Outfits".Translate() ) ); + if ( Widgets.ImageButton( editOutfitRect, _iconEdit ) ) + { + Find.WindowStack.Add( new Dialog_ManageOutfits( null ) ); + } + Widgets.Label( labelLoadoutRect, "CR.CurrentLoadout".Translate() ); + TooltipHandler.TipRegion( editLoadoutRect, "CR.EditX".Translate( "CR.Loadouts".Translate() ) ); + if ( Widgets.ImageButton( editLoadoutRect, _iconEdit ) ) + { + Find.WindowStack.Add( new Dialog_ManageLoadouts( null ) ); + } + Widgets.Label( weightRect, "CR.Weight".Translate() ); + Widgets.Label( bulkRect, "CR.Bulk".Translate() ); + Text.Anchor = TextAnchor.UpperLeft; + + // draw the rows + canvas.yMin += 45f; + base.DrawRows( canvas ); + } + + protected override void DrawPawnRow( Rect rect, Pawn p ) + { + // available space for row + Rect rowRect = new Rect( rect.x + 175f, rect.y, rect.width - 175f, rect.height ); + + // response button rect + Vector2 responsePos = new Vector2( rowRect.xMin, rowRect.yMin + ( rowRect.height - 24f ) /2f ); + + // offset rest of row for that button, so we don't have to mess with all the other rect calculations + rowRect.xMin += 24f + _margin; + + // label + buttons for outfit + Rect outfitRect = new Rect( rowRect.xMin, + rowRect.yMin, + rowRect.width * ( 1f/3f ) + ( _margin + _buttonSize ) / 2f, + rowRect.height ); + + Rect labelOutfitRect = new Rect( outfitRect.xMin, + outfitRect.yMin, + outfitRect.width - _margin * 3 - _buttonSize * 2, + outfitRect.height ) + .ContractedBy( _margin / 2f ); + Rect editOutfitRect = new Rect( labelOutfitRect.xMax + _margin, + outfitRect.yMin + ( ( outfitRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + Rect forcedOutfitRect = new Rect( labelOutfitRect.xMax + _buttonSize + _margin * 2, + outfitRect.yMin + ( ( outfitRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + + // label + button for loadout + Rect loadoutRect = new Rect( outfitRect.xMax, + rowRect.yMin, + rowRect.width * ( 1f/3f ) - ( _margin + _buttonSize ) / 2f, + rowRect.height ); + Rect labelLoadoutRect = new Rect( loadoutRect.xMin, + loadoutRect.yMin, + loadoutRect.width - _margin * 2 - _buttonSize, + loadoutRect.height ) + .ContractedBy( _margin / 2f ); + Rect editLoadoutRect = new Rect( labelLoadoutRect.xMax + _margin, + loadoutRect.yMin + ( ( loadoutRect.height - _buttonSize ) / 2 ), + _buttonSize, + _buttonSize ); + + // fight or flight button + HostilityResponseModeUtility.DrawResponseButton( responsePos, p ); + + // weight + bulk indicators + Rect weightRect = new Rect( loadoutRect.xMax, rowRect.yMin, rowRect.width * ( 1f/6f ) - _margin, rowRect.height ).ContractedBy( _margin / 2f ); + Rect bulkRect = new Rect( weightRect.xMax, rowRect.yMin, rowRect.width * ( 1f/6f ) - _margin, rowRect.height ).ContractedBy( _margin / 2f ); + + // OUTFITS + // main button + if ( Widgets.TextButton( labelOutfitRect, p.outfits.CurrentOutfit.label, true, false ) ) + { + List options = new List(); + foreach ( Outfit outfit in Find.Map.outfitDatabase.AllOutfits ) + { + // need to create a local copy for delegate + Outfit localOutfit = outfit; + options.Add( new FloatMenuOption( localOutfit.label, delegate + { + p.outfits.CurrentOutfit = localOutfit; + }, MenuOptionPriority.Medium, null, null ) ); + } + Find.WindowStack.Add( new FloatMenu( options, false ) ); + } + + // edit button + TooltipHandler.TipRegion( editOutfitRect, "CR.EditX".Translate( "CR.outfit".Translate() + " " + p.outfits.CurrentOutfit.label ) ); + if ( Widgets.ImageButton( editOutfitRect, _iconEdit ) ) + { + Find.WindowStack.Add( new Dialog_ManageOutfits( p.outfits.CurrentOutfit ) ); + } + + // clear forced button + if ( p.outfits.forcedHandler.SomethingIsForced ) + { + TooltipHandler.TipRegion( forcedOutfitRect, "CR.ClearForced".Translate() ); + if ( Widgets.ImageButton( forcedOutfitRect, _iconClearForced ) ) + { + p.outfits.forcedHandler.Reset(); + } + TooltipHandler.TipRegion( forcedOutfitRect, new TipSignal( delegate + { + string text = "ForcedApparel".Translate() + ":\n"; + foreach ( Apparel current2 in p.outfits.forcedHandler.ForcedApparel ) + { + text = text + "\n " + current2.LabelCap; + } + return text; + }, p.GetHashCode() * 612 ) ); + } + + // LOADOUTS + // main button + if ( Widgets.TextButton( labelLoadoutRect, p.GetLoadout().LabelCap, true, false ) ) + { + List options = new List(); + foreach ( Loadout loadout in LoadoutManager.Loadouts ) + { + // need to create a local copy for delegate + Loadout localLoadout = loadout; + options.Add( new FloatMenuOption( localLoadout.LabelCap, delegate + { + p.SetLoadout( localLoadout ); + }, MenuOptionPriority.Medium, null, null ) ); + } + Find.WindowStack.Add( new FloatMenu( options, false ) ); + } + + // edit button + TooltipHandler.TipRegion( editLoadoutRect, "CR.EditX".Translate( "CR.loadout".Translate() + " " + p.GetLoadout().LabelCap ) ); + if ( Widgets.ImageButton( editLoadoutRect, _iconEdit ) ) + { + Find.WindowStack.Add( new Dialog_ManageLoadouts( p.GetLoadout() ) ); + } + + // STATUS BARS + // fetch the comp + CompInventory comp = p.TryGetComp(); + + if ( comp != null ) + { + Utility_Loadouts.DrawBar( bulkRect, comp.currentBulk, comp.capacityBulk, "", "CR.ITabBulkTip".Translate( comp.capacityBulk, comp.currentBulk, comp.workSpeedFactor ) ); + Utility_Loadouts.DrawBar( weightRect, comp.currentWeight, comp.capacityWeight, "", "CR.ITabWeightTip".Translate( comp.capacityWeight, comp.currentWeight, comp.moveSpeedFactor, comp.encumberPenalty ) ); + } + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Source/CombatRealism/Combat_Realism/MapComp_LoadoutManager.cs b/Source/CombatRealism/Combat_Realism/MapComp_LoadoutManager.cs new file mode 100644 index 0000000..33695d9 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/MapComp_LoadoutManager.cs @@ -0,0 +1,112 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutManager : MapComponent + { + #region Fields + + private static LoadoutManager _instance; + private Dictionary _assignedLoadouts = new Dictionary(); + private List _assignedLoadoutsScribeHelper = new List(); + private List _loadouts = new List(); + + #endregion Fields + + #region Constructors + + public LoadoutManager() + { + // create a default empty loadout + // there needs to be at least one default tagged loadout at all times + _loadouts.Add( new Loadout( "CR.EmptyLoadoutName".Translate(), 1 ) { canBeDeleted = false, defaultLoadout = true } ); + } + + #endregion Constructors + + #region Properties + + public static LoadoutManager Instance + { + get + { + if ( _instance == null ) + _instance = new LoadoutManager(); + return _instance; + } + } + + public static Dictionary AssignedLoadouts => Instance._assignedLoadouts; + + public static Loadout DefaultLoadout => Instance._loadouts.First( l => l.defaultLoadout ); + + public static List Loadouts => Instance._loadouts; + + #endregion Properties + + #region Methods + + public static void AddLoadout( Loadout loadout ) + { + Instance._loadouts.Add( loadout ); + } + + public static void RemoveLoadout( Loadout loadout ) + { + Instance._loadouts.Remove( loadout ); + + // assign default loadout to pawns that used to use this loadout + var obsolete = AssignedLoadouts.Where( a => a.Value == loadout ).Select( a => a.Key ); + foreach ( var id in obsolete ) + { + AssignedLoadouts[id] = DefaultLoadout; + } + } + + public override void ExposeData() + { + // scribe available loadouts + Scribe_Collections.LookList( ref Instance._loadouts, "loadouts", LookMode.Deep ); + + //scribe loadout assignments (for some reason using the dictionary directly doesn't work -- Fluffy) + // create list of scribe helper objects + if ( Scribe.mode == LoadSaveMode.Saving ) + Instance._assignedLoadoutsScribeHelper = Instance._assignedLoadouts.Select( pair => new LoadoutAssignment() { pawn = pair.Key, loadout = pair.Value } ).ToList(); + + //scribe that list + Scribe_Collections.LookList( ref Instance._assignedLoadoutsScribeHelper, "assignments", LookMode.Deep ); + + // convert back into useable dictionary + if ( Scribe.mode == LoadSaveMode.PostLoadInit ) + Instance._assignedLoadouts = Instance._assignedLoadoutsScribeHelper.ToDictionary( k => k.pawn, v => v.loadout ); + } + + internal static int GetUniqueID() + { + if ( Loadouts.Any() ) + return Loadouts.Max( l => l.uniqueID ) + 1; + else + return 1; + } + + internal static string GetUniqueLabel() + { + string label; + int i = 1; + do + { + label = "CR.DefaultLoadoutName".Translate() + i++; + } + while ( Loadouts.Any( l => l.label == label ) ); + return label; + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ArtilleryMarker.cs b/Source/CombatRealism/Combat_Realism/Projectiles/ArtilleryMarker.cs similarity index 94% rename from Assemblies/Source/CombatRealism/Combat_Realism/ArtilleryMarker.cs rename to Source/CombatRealism/Combat_Realism/Projectiles/ArtilleryMarker.cs index c4161db..c85bce7 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ArtilleryMarker.cs +++ b/Source/CombatRealism/Combat_Realism/Projectiles/ArtilleryMarker.cs @@ -21,7 +21,7 @@ class ArtilleryMarker : AttachableThing public override string InspectStringAddon { - get { return "Marked for artillery, expires in " + ((int)(lifetimeTicks / 60)).ToString() + " s"; } + get { return "CR_MarkedForArtillery".Translate() + " " + ((int)(lifetimeTicks / 60)).ToString() + " s"; } } public override void ExposeData() diff --git a/Source/CombatRealism/Combat_Realism/Projectiles/BulletCR.cs b/Source/CombatRealism/Combat_Realism/Projectiles/BulletCR.cs new file mode 100644 index 0000000..edd1bc1 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Projectiles/BulletCR.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Verse; +using Verse.Sound; +using RimWorld; + +namespace Combat_Realism +{ + public class BulletCR : ProjectileCR + { + private const float StunChance = 0.1f; + protected override void Impact(Thing hitThing) + { + base.Impact(hitThing); + if (hitThing != null) + { + int damageAmountBase = this.def.projectile.damageAmountBase; + BodyPartDamageInfo value = new BodyPartDamageInfo(null, null); + DamageInfo dinfo = new DamageInfo(this.def.projectile.damageDef, damageAmountBase, this.launcher, this.ExactRotation.eulerAngles.y, new BodyPartDamageInfo?(value), this.def); + + ProjectilePropertiesCR propsCR = def.projectile as ProjectilePropertiesCR; + if (propsCR != null && !propsCR.secondaryDamage.NullOrEmpty()) + { + // Get the correct body part + Pawn pawn = hitThing as Pawn; + if (pawn != null && def.projectile.damageDef.workerClass == typeof(DamageWorker_AddInjuryCR)) + { + dinfo = new DamageInfo(dinfo.Def, + dinfo.Amount, + dinfo.Instigator, + dinfo.Angle, + new BodyPartDamageInfo(DamageWorker_AddInjuryCR.GetExactPartFromDamageInfo(dinfo, pawn), false, (HediffDef)null), + dinfo.Source); + } + List dinfoList = new List() { dinfo }; + foreach(SecondaryDamage secDamage in propsCR.secondaryDamage) + { + dinfoList.Add(new DamageInfo(secDamage.def, secDamage.amount, dinfo.Instigator, dinfo.Part, dinfo.Source)); + } + foreach(DamageInfo curDinfo in dinfoList) + { + hitThing.TakeDamage(curDinfo); + } + } + else + { + hitThing.TakeDamage(dinfo); + } + } + else + { + SoundDefOf.BulletImpactGround.PlayOneShot(base.Position); + MoteThrower.ThrowStatic(this.ExactPosition, ThingDefOf.Mote_ShotHit_Dirt, 1f); + } + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR.cs b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR.cs similarity index 98% rename from Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR.cs rename to Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR.cs index 04f1038..8017373 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ProjectileCR.cs +++ b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR.cs @@ -309,8 +309,8 @@ private bool ImpactThroughBodySize(Thing thing, float height) if (compSuppressable != null) { float suppressionAmount = this.def.projectile.damageAmountBase; - CompAP compAP = this.TryGetComp(); - float penetrationAmount = compAP == null ? 0f : compAP.props.armorPenetration; + ProjectilePropertiesCR propsCR = def.projectile as ProjectilePropertiesCR; + float penetrationAmount = propsCR == null ? 0f : propsCR.armorPenetration; suppressionAmount *= 1 - Mathf.Clamp(compSuppressable.parentArmor - penetrationAmount, 0, 1); compSuppressable.AddSuppression(suppressionAmount, this.origin.ToIntVec3()); } @@ -446,6 +446,11 @@ public override void Draw() //Unmodified protected virtual void Impact(Thing hitThing) { + CompExplosiveCR comp = this.TryGetComp(); + if (comp != null) + { + comp.Explode(this.launcher); + } this.Destroy(DestroyMode.Vanish); } diff --git a/Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR_Explosive.cs b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR_Explosive.cs new file mode 100644 index 0000000..59e5963 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectileCR_Explosive.cs @@ -0,0 +1,61 @@ +using System; +using Verse; + +namespace Combat_Realism +{ + //Cloned from vanilla, completely unmodified + public class ProjectileCR_Explosive : ProjectileCR + { + private int ticksToDetonation; + public override void ExposeData() + { + base.ExposeData(); + Scribe_Values.LookValue(ref this.ticksToDetonation, "ticksToDetonation", 0, false); + } + public override void Tick() + { + base.Tick(); + if (this.ticksToDetonation > 0) + { + this.ticksToDetonation--; + if (this.ticksToDetonation <= 0) + { + this.Explode(); + } + } + } + protected override void Impact(Thing hitThing) + { + if (this.def.projectile.explosionDelay == 0) + { + this.Explode(); + return; + } + this.landed = true; + this.ticksToDetonation = this.def.projectile.explosionDelay; + } + protected virtual void Explode() + { + this.Destroy(DestroyMode.Vanish); + ThingDef preExplosionSpawnThingDef = this.def.projectile.preExplosionSpawnThingDef; + GenExplosion.DoExplosion(base.Position, + this.def.projectile.explosionRadius, + this.def.projectile.damageDef, + this.launcher, + this.def.projectile.soundExplode, + this.def, + this.equipmentDef, + this.def.projectile.postExplosionSpawnThingDef, + this.def.projectile.explosionSpawnChance, + false, + preExplosionSpawnThingDef, + this.def.projectile.explosionSpawnChance); + + CompExplosiveCR comp = this.TryGetComp(); + if (comp != null) + { + comp.Explode(launcher); + } + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Projectiles/ProjectilePropertiesCR.cs b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectilePropertiesCR.cs new file mode 100644 index 0000000..9443ae5 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Projectiles/ProjectilePropertiesCR.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class ProjectilePropertiesCR : ProjectileProperties + { + public float armorPenetration = 0; + public int pelletCount = 1; + public float spreadMult = 1; + public List secondaryDamage = new List(); + } +} diff --git a/Source/CombatRealism/Combat_Realism/SecondaryDamage.cs b/Source/CombatRealism/Combat_Realism/SecondaryDamage.cs new file mode 100644 index 0000000..1a52ccb --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/SecondaryDamage.cs @@ -0,0 +1,12 @@ +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class SecondaryDamage + { + public DamageDef def; + public int amount; + } +} \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ShiftVecReport.cs b/Source/CombatRealism/Combat_Realism/ShiftVecReport.cs similarity index 77% rename from Assemblies/Source/CombatRealism/Combat_Realism/ShiftVecReport.cs rename to Source/CombatRealism/Combat_Realism/ShiftVecReport.cs index 2791619..dce515d 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/ShiftVecReport.cs +++ b/Source/CombatRealism/Combat_Realism/ShiftVecReport.cs @@ -125,7 +125,6 @@ public ShiftVecReport(ShiftVecReport report) public ShiftVecReport() { - // TODO: Complete member initialization } public Vector2 GetRandCircularVec() @@ -153,9 +152,7 @@ public Vector3 GetRandLeadVec() public Vector2 GetRandSpreadVec() { - //Vector2 vec = Utility.GenRandInCircle(spreadDegrees); - Vector2 vec = UnityEngine.Random.insideUnitCircle; - vec.y *= 0.5f; + Vector2 vec = UnityEngine.Random.insideUnitCircle * spreadDegrees; return vec; } @@ -164,7 +161,7 @@ public string GetTextReadout() StringBuilder stringBuilder = new StringBuilder(); if (visibilityShift > 0) { - stringBuilder.AppendLine(" " + "Visibility error" + "\t" + GenText.ToStringByStyle(visibilityShift, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_VisibilityError".Translate() + "\t" + GenText.ToStringByStyle(visibilityShift, ToStringStyle.FloatTwo) + " c"); if (lightingShift > 0) { @@ -177,39 +174,39 @@ public string GetTextReadout() } if (leadShift > 0) { - stringBuilder.AppendLine(" " + "Lead error" + "\t" + GenText.ToStringByStyle(leadShift, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_LeadError".Translate() + "\t" + GenText.ToStringByStyle(leadShift, ToStringStyle.FloatTwo) + " c"); } if(distShift > 0) { - stringBuilder.AppendLine(" " + "Range error" + "\t" + GenText.ToStringByStyle(distShift, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_RangeError".Translate() + "\t" + GenText.ToStringByStyle(distShift, ToStringStyle.FloatTwo) + " c"); } if (swayDegrees > 0) { - stringBuilder.AppendLine(" " + "Sway" + "\t\t" + GenText.ToStringByStyle(swayDegrees, ToStringStyle.FloatTwo) + "°"); + stringBuilder.AppendLine(" " + "CR_Sway".Translate() + "\t\t" + GenText.ToStringByStyle(swayDegrees, ToStringStyle.FloatTwo) + "°"); } if (spreadDegrees > 0) { - stringBuilder.AppendLine(" " + "Spread" + "\t\t" + GenText.ToStringByStyle(spreadDegrees, ToStringStyle.FloatTwo) + "°"); + stringBuilder.AppendLine(" " + "CR_Spread".Translate() + "\t\t" + GenText.ToStringByStyle(spreadDegrees, ToStringStyle.FloatTwo) + "°"); } // Don't display cover and target size if our weapon has a CEP if (circularMissRadius > 0) { - stringBuilder.AppendLine(" " + "Miss radius" + "\t" + GenText.ToStringByStyle(circularMissRadius, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_MissRadius".Translate() + "\t" + GenText.ToStringByStyle(circularMissRadius, ToStringStyle.FloatTwo) + " c"); if (indirectFireShift > 0) { - stringBuilder.AppendLine(" " + "Indirect fire" + "\t" + GenText.ToStringByStyle(indirectFireShift, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_IndirectFire".Translate() + "\t" + GenText.ToStringByStyle(indirectFireShift, ToStringStyle.FloatTwo) + " c"); } } else { if (cover != null) { - stringBuilder.AppendLine(" " + "Cover height" + "\t" + GenText.ToStringByStyle(Utility.GetCollisionHeight(cover), ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_CoverHeight".Translate() + "\t" + GenText.ToStringByStyle(Utility.GetCollisionHeight(cover), ToStringStyle.FloatTwo) + " c"); } if (target.Thing != null) { - stringBuilder.AppendLine(" " + "Target height" + "\t" + GenText.ToStringByStyle(Utility.GetCollisionHeight(target.Thing), ToStringStyle.FloatTwo) + " c"); - stringBuilder.AppendLine(" " + "Target width" + "\t" + GenText.ToStringByStyle(Utility.GetCollisionWidth(target.Thing) * 2, ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_TargetHeight".Translate() + "\t" + GenText.ToStringByStyle(Utility.GetCollisionHeight(target.Thing), ToStringStyle.FloatTwo) + " c"); + stringBuilder.AppendLine(" " + "CR_TargetWidth".Translate() + "\t" + GenText.ToStringByStyle(Utility.GetCollisionWidth(target.Thing) * 2, ToStringStyle.FloatTwo) + " c"); } } return stringBuilder.ToString(); diff --git a/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_MoveSpeed.cs b/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_MoveSpeed.cs new file mode 100644 index 0000000..1a11c77 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_MoveSpeed.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + class StatWorker_MoveSpeed : StatWorker + { + public override string GetExplanation(StatRequest req, ToStringNumberSense numberSense) + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(base.GetExplanation(req, numberSense)); + if (req.HasThing) + { + CompInventory comp = req.Thing.TryGetComp(); + if (comp != null) + { + stringBuilder.AppendLine(); + stringBuilder.AppendLine("CR_CarriedWeight".Translate() + ": x" + comp.moveSpeedFactor.ToStringPercent()); + if (comp.encumberPenalty > 0) + { + stringBuilder.AppendLine("CR_Encumbered".Translate() + ": -" + comp.encumberPenalty.ToStringPercent()); + stringBuilder.AppendLine("CR_FinalModifier".Translate() + ": x" + GetStatFactor(req.Thing).ToStringPercent()); + } + } + } + + return stringBuilder.ToString(); + } + + public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true) + { + float value = base.GetValueUnfinalized(req, applyPostProcess); + if (req.HasThing) + { + value *= GetStatFactor(req.Thing); + } + return value; + } + + private float GetStatFactor(Thing thing) + { + float factor = 1f; + CompInventory comp = thing.TryGetComp(); + if (comp != null) + { + factor = Mathf.Clamp(comp.moveSpeedFactor - comp.encumberPenalty, 0.01f, 1f); + } + return factor; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_WorkSpeedGlobal.cs b/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_WorkSpeedGlobal.cs new file mode 100644 index 0000000..3fd7d9d --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/StatWorkers/StatWorker_WorkSpeedGlobal.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class StatWorker_WorkSpeedGlobal : StatWorker + { + public override string GetExplanation(StatRequest req, ToStringNumberSense numberSense) + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(base.GetExplanation(req, numberSense)); + if (req.HasThing) + { + CompInventory comp = req.Thing.TryGetComp(); + if (comp != null) + { + stringBuilder.AppendLine(); + stringBuilder.AppendLine("CR_CarriedBulk".Translate() + ": x" + comp.workSpeedFactor.ToStringPercent()); + } + } + + return stringBuilder.ToString(); + } + + public override float GetValueUnfinalized(StatRequest req, bool applyPostProcess = true) + { + float value = base.GetValueUnfinalized(req, applyPostProcess); + if (req.HasThing) + { + CompInventory comp = req.Thing.TryGetComp(); + if (comp != null) + { + value *= comp.workSpeedFactor; + } + } + return value; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/AmmoThing.cs b/Source/CombatRealism/Combat_Realism/Things/AmmoThing.cs new file mode 100644 index 0000000..f71bc34 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/AmmoThing.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class AmmoThing : ThingWithComps + { + AmmoDef ammoDef => def as AmmoDef; + + public override string GetDescription() + { + if(ammoDef != null && ammoDef.ammoClass != null && ammoDef.linkedProjectile != null) + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.AppendLine(base.GetDescription()); + + // Append ammo class description + if (!string.IsNullOrEmpty(ammoDef.ammoClass.description)) + stringBuilder.AppendLine("\n" + + (string.IsNullOrEmpty(ammoDef.ammoClass.LabelCap) ? "" : ammoDef.ammoClass.LabelCap + ":\n") + + ammoDef.ammoClass.description); + + // Append ammo stats + ProjectilePropertiesCR props = ammoDef.linkedProjectile.projectile as ProjectilePropertiesCR; + if (props != null) + { + // Damage type/amount + stringBuilder.AppendLine("\n" + "CR_DescDamage".Translate() + ": "); + stringBuilder.AppendLine(" " + GenText.ToStringByStyle(props.damageAmountBase, ToStringStyle.Integer) + " (" + props.damageDef.LabelCap + ")"); + if (!props.secondaryDamage.NullOrEmpty()) + { + foreach(SecondaryDamage sec in props.secondaryDamage) + { + stringBuilder.AppendLine(" " + GenText.ToStringByStyle(sec.amount, ToStringStyle.Integer) + " (" + sec.def.LabelCap + ")"); + } + } + // Explosion radius + if (props.explosionRadius > 0) + stringBuilder.AppendLine("CR_DescExplosionRadius".Translate() + ": " + GenText.ToStringByStyle(props.explosionRadius, ToStringStyle.FloatOne)); + + // Secondary explosion + CompProperties_ExplosiveCR secExpProps = ammoDef.GetCompProperties(); + if (secExpProps != null) + { + if (secExpProps.explosionRadius > 0) + { + stringBuilder.AppendLine("CR_DescSecondaryExplosion".Translate()); + stringBuilder.AppendLine(" " + "CR_DescExplosionRadius".Translate() + ": " + GenText.ToStringByStyle(secExpProps.explosionRadius, ToStringStyle.FloatOne)); + stringBuilder.AppendLine(" " + "CR_DescDamage".Translate() + ": " + + GenText.ToStringByStyle(secExpProps.explosionDamage, ToStringStyle.Integer) + " (" + secExpProps.explosionDamageDef.LabelCap + ")"); + } + if (secExpProps.fragRange > 0) + stringBuilder.AppendLine("CR_DescFragRange".Translate() + GenText.ToStringByStyle(secExpProps.fragRange, ToStringStyle.FloatTwo)); + } + + // CR stats + stringBuilder.AppendLine("CR_DescArmorPenetration".Translate() + ": " + GenText.ToStringByStyle(props.armorPenetration, ToStringStyle.PercentOne)); + if (props.pelletCount > 1) + stringBuilder.AppendLine("CR_DescPelletCount".Translate() + ": " + GenText.ToStringByStyle(props.pelletCount, ToStringStyle.Integer)); + if (props.spreadMult != 1) + stringBuilder.AppendLine("CR_DescSpreadMult".Translate() + ": " + GenText.ToStringByStyle(props.spreadMult, ToStringStyle.PercentZero)); + } + + return stringBuilder.ToString(); + } + return base.GetDescription(); + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/Apparel_Backpack.cs b/Source/CombatRealism/Combat_Realism/Things/Apparel_Backpack.cs new file mode 100644 index 0000000..41b747e --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/Apparel_Backpack.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class Apparel_Backpack : Apparel_VisibleAccessory + { + protected override float GetAltitudeOffset(Rot4 rotation) + { + float offset = 0.001f; + if (rotation == Rot4.North) + { + return 0.06f; + } + offset += 0.035f; + if (wearer.apparel.WornApparel.Any(x => x.def.apparel.LastLayer == ApparelLayer.Shell)) + { + offset += 0.006f; + } + return offset; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/Apparel_TacVest.cs b/Source/CombatRealism/Combat_Realism/Things/Apparel_TacVest.cs new file mode 100644 index 0000000..8bb494d --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/Apparel_TacVest.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class Apparel_TacVest : Apparel_VisibleAccessory + { + protected override float GetAltitudeOffset(Rot4 rotation) + { + float offset = 0.033f; + if (wearer.apparel.WornApparel.Any(x => x.def.apparel.LastLayer == ApparelLayer.Shell)) + { + offset += 0.006f; + if (rotation == Rot4.North) + { + offset += 0.02f; + } + } + else if (rotation == Rot4.North) + { + offset -= 0.005f; + } + return offset; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/Apparel_VisibleAccessory.cs b/Source/CombatRealism/Combat_Realism/Things/Apparel_VisibleAccessory.cs new file mode 100644 index 0000000..3fa78ed --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/Apparel_VisibleAccessory.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public abstract class Apparel_VisibleAccessory : Apparel + { + public override void DrawWornExtras() + { + Vector3 drawVec = this.wearer.Drawer.DrawPos; + drawVec.y = Altitudes.AltitudeFor(AltitudeLayer.Pawn); + Vector3 s = new Vector3(1.5f, 1.5f, 1.5f); + + // Get the graphic path + string path = def.graphicData.texPath + "_" + wearer?.story.BodyType.ToString(); + Graphic graphic = GraphicDatabase.Get(path, ShaderDatabase.Cutout, def.graphicData.drawSize, DrawColor); + ApparelGraphicRecord apparelGraphic = new ApparelGraphicRecord(graphic, this); + + // Downed check + Rot4 rotation = wearer.Rotation; + float angle = 0; + if(wearer.GetPosture() != PawnPosture.Standing) + { + float? newAngle = wearer.Drawer?.renderer?.wiggler?.downedAngle; + if (newAngle != null) + angle = (float)newAngle; + rotation = LayingFacing(); + } + drawVec.y += GetAltitudeOffset(rotation); + Material mat = apparelGraphic.graphic.MatAt(rotation); + + mat.shader = ShaderDatabase.Cutout; + mat.color = DrawColor; + Matrix4x4 matrix = default(Matrix4x4); + matrix.SetTRS(drawVec, Quaternion.AngleAxis(angle, Vector3.up), s); + Graphics.DrawMesh(rotation == Rot4.West ? MeshPool.plane10Flip : MeshPool.plane10, matrix, mat, 0); + } + + protected abstract float GetAltitudeOffset(Rot4 rotation); + + // Copied from PawnRenderer + private Rot4 LayingFacing() + { + if (wearer == null) + { + return Rot4.Random; + } + if (wearer.GetPosture() == PawnPosture.LayingFaceUp) + { + return Rot4.South; + } + if (wearer.RaceProps.Humanlike) + { + switch (wearer.thingIDNumber % 4) + { + case 0: + return Rot4.South; + case 1: + return Rot4.South; + case 2: + return Rot4.East; + case 3: + return Rot4.West; + } + } + else + { + switch (wearer.thingIDNumber % 4) + { + case 0: + return Rot4.South; + case 1: + return Rot4.East; + case 2: + return Rot4.West; + case 3: + return Rot4.West; + } + } + return Rot4.Random; + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/IncendiaryFuel.cs b/Source/CombatRealism/Combat_Realism/Things/IncendiaryFuel.cs new file mode 100644 index 0000000..1163381 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/IncendiaryFuel.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + public class IncendiaryFuel : Thing + { + private const float maxFireSize = 1.75f; + + public override void SpawnSetup() + { + base.SpawnSetup(); + List list = new List(Position.GetThingList()); + foreach (Thing thing in list) + { + if (thing.HasAttachment(ThingDefOf.Fire)) + { + Fire fire = (Fire)thing.GetAttachment(ThingDefOf.Fire); + if (fire != null) + fire.fireSize = maxFireSize; + } + else + { + thing.TryAttachFire(maxFireSize); + } + } + } + + public override void Tick() + { + if(Position.GetThingList().Any(x => x.def == ThingDefOf.FilthFireFoam)) + { + if (!Destroyed) + Destroy(); + } + else + { + FireUtility.TryStartFireIn(Position, maxFireSize); + } + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/LoadoutGeneratorThing.cs b/Source/CombatRealism/Combat_Realism/Things/LoadoutGeneratorThing.cs new file mode 100644 index 0000000..a7afd46 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/LoadoutGeneratorThing.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Verse; + +namespace Combat_Realism +{ + public class LoadoutGeneratorThing : Thing + { + public int priority + { + get + { + LoadoutGeneratorDef lDef = def as LoadoutGeneratorDef; + if (lDef != null) + return lDef.priority; + return 0; + } + } + public LoadoutGenerator loadoutGenerator + { + get + { + LoadoutGeneratorDef lDef = def as LoadoutGeneratorDef; + if (lDef != null) + return lDef.loadoutGenerator; + return null; + } + } + } +} diff --git a/Source/CombatRealism/Combat_Realism/Things/Plant_Blazebulb.cs b/Source/CombatRealism/Combat_Realism/Things/Plant_Blazebulb.cs new file mode 100644 index 0000000..19196e6 --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Things/Plant_Blazebulb.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism +{ + class Plant_Blazebulb : Plant + { + private const int ignitionTemp = 21; // Temperature (in Celsius) above which the plant will start catching fire + private const string fuelDefName = "Puddle_Fuel"; // Name of the def to use for fuel puddles spawned when damaged + + public override void TickLong() + { + base.TickLong(); + float temperature = base.Position.GetTemperature(); + if (temperature > ignitionTemp) + { + float ignitionChance = 0.005f * Mathf.Pow((temperature - ignitionTemp), 2); + float rand = UnityEngine.Random.value; + if(UnityEngine.Random.value < ignitionChance) + { + FireUtility.TryStartFireIn(Position, 0.1f); + } + } + } + + public override void PostApplyDamage(DamageInfo dinfo, float totalDamageDealt) + { + base.PostApplyDamage(dinfo, totalDamageDealt); + if(dinfo.Def != DamageDefOf.Rotting) + { + // Find existing fuel puddle or spawn one if needed + Thing fuel = Position.GetThingList().FirstOrDefault(x => x.def == ThingDef.Named(fuelDefName)); + int fuelHPFromDamage = Mathf.CeilToInt(fuel.MaxHitPoints * Mathf.Clamp01(totalDamageDealt / MaxHitPoints)); + if (fuel != null) + { + fuel.HitPoints = Mathf.Min(fuel.MaxHitPoints, fuel.HitPoints + fuelHPFromDamage); + } + else + { + fuel = ThingMaker.MakeThing(ThingDef.Named(fuelDefName)); + GenSpawn.Spawn(fuel, Position); + fuel.HitPoints = fuelHPFromDamage; + } + } + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ThinkNode_ConditionalHunkering.cs b/Source/CombatRealism/Combat_Realism/ThinkNodes/ThinkNode_ConditionalHunkering.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/ThinkNode_ConditionalHunkering.cs rename to Source/CombatRealism/Combat_Realism/ThinkNodes/ThinkNode_ConditionalHunkering.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ThinkNode_ConditionalSuppressed.cs b/Source/CombatRealism/Combat_Realism/ThinkNodes/ThinkNode_ConditionalSuppressed.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/ThinkNode_ConditionalSuppressed.cs rename to Source/CombatRealism/Combat_Realism/ThinkNodes/ThinkNode_ConditionalSuppressed.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/ThoughtWorker_Suppressed.cs b/Source/CombatRealism/Combat_Realism/ThoughtWorkers/ThoughtWorker_Suppressed.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/ThoughtWorker_Suppressed.cs rename to Source/CombatRealism/Combat_Realism/ThoughtWorkers/ThoughtWorker_Suppressed.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Utility.cs b/Source/CombatRealism/Combat_Realism/Utility.cs similarity index 81% rename from Assemblies/Source/CombatRealism/Combat_Realism/Utility.cs rename to Source/CombatRealism/Combat_Realism/Utility.cs index 0ce6ed9..396b2bc 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/Utility.cs +++ b/Source/CombatRealism/Combat_Realism/Utility.cs @@ -11,6 +11,10 @@ namespace Combat_Realism { static class Utility { + #region Misc + + public static List allWeaponDefs = new List(); + /// /// Generates a random Vector2 in a circle with given radius /// @@ -87,7 +91,9 @@ public static Pawn TryGetTurretOperator(Thing thing) return manningPawn; } - //------------------------------ Physics Calculations ------------------------------ + #endregion Misc + + #region Physics public const float gravityConst = 9.8f; public const float collisionHeightFactor = 1.0f; @@ -132,52 +138,38 @@ public static float GetCollisionWidth(Thing thing) return pawn.BodySize * (Utility.humanoidBodyList.Contains(pawn.RaceProps.body.defName) ? collisionWidthFactorHumanoid : collisionWidthFactor); } - //------------------------------ Armor Calculations ------------------------------ + #endregion Physics + + #region Armor public static readonly DamageDef absorbDamageDef = DamageDefOf.Blunt; //The damage def to convert absorbed shots into /// /// Calculates deflection chance and damage through armor /// - public static int GetAfterArmorDamage(Pawn pawn, int amountInt, BodyPartRecord part, DamageInfo dinfo, bool damageArmor, ref bool deflected) + public static int GetAfterArmorDamage(Pawn pawn, int damAmountInt, BodyPartRecord part, DamageInfo dinfo, bool damageArmor, ref bool deflected) { DamageDef damageDef = dinfo.Def; if (damageDef.armorCategory == DamageArmorCategory.IgnoreArmor) { - return amountInt; + return damAmountInt; } - float damageAmount = (float)amountInt; + float damageAmount = (float)damAmountInt; StatDef deflectionStat = damageDef.armorCategory.DeflectionStat(); - float pierceAmount = 0f; - //Check if the projectile has the armor-piercing comp - CompProperties_AP props = null; + // Get armor penetration value + float pierceAmount = 0f; if (dinfo.Source != null) { - VerbProperties verbProps = dinfo.Source.Verbs.Where(x => x.isPrimary).First(); - if (verbProps != null) - { - ThingDef projectile = verbProps.projectileDef; - if (projectile != null && projectile.HasComp(typeof(CompAP))) - { - props = (CompProperties_AP)projectile.GetCompProperties(typeof(CompAP)); - } - } - - //Check weapon for comp if projectile doesn't have it - if (props == null && dinfo.Source.HasComp(typeof(CompAP))) + ProjectilePropertiesCR projectileProps = dinfo.Source.projectile as ProjectilePropertiesCR; + if (projectileProps != null) { - props = (CompProperties_AP)dinfo.Source.GetCompProperties(typeof(CompAP)); + pierceAmount = projectileProps.armorPenetration; } } - if (props != null) - { - pierceAmount = props.armorPenetration; - } - - //Run armor calculations on all apparel + // Run armor calculations on all apparel if (pawn.apparel != null) { List wornApparel = new List(pawn.apparel.WornApparel); @@ -240,20 +232,14 @@ public static int GetAfterArmorDamage(Pawn pawn, int amountInt, BodyPartRecord p return Mathf.RoundToInt(damageAmount); } - /// - /// For use with misc DamageWorker functions - /// - public static int GetAfterArmorDamage(Pawn pawn, int amountInt, BodyPartRecord part, DamageInfo dinfo) - { - bool flag = false; - return Utility.GetAfterArmorDamage(pawn, amountInt, part, dinfo, false, ref flag); - } - private static bool ApplyArmor(ref float damAmount, ref float pierceAmount, float armorRating, Thing armorThing, DamageDef damageDef) { float originalDamage = damAmount; bool deflected = false; - float penetrationChance = Mathf.Clamp((pierceAmount - armorRating) * 4, 0, 1); + DamageDef_CR damageDefCR = damageDef as DamageDef_CR; + float penetrationChance = 1; + if(damageDefCR != null && damageDefCR.deflectable) + penetrationChance = Mathf.Clamp((pierceAmount - armorRating) * 6, 0, 1); //Shot is deflected if (penetrationChance == 0 || Rand.Value > penetrationChance) @@ -261,7 +247,23 @@ private static bool ApplyArmor(ref float damAmount, ref float pierceAmount, floa deflected = true; } //Damage calculations - damAmount *= 1 - Mathf.Clamp(2 * armorRating - pierceAmount, 0, 1); + float dMult = 1; + if (damageDefCR != null) + { + if (damageDefCR.absorbable && deflected) + { + dMult = 0; + } + else if (damageDefCR.deflectable) + { + dMult = Mathf.Clamp01(0.5f + (pierceAmount - armorRating) * 3); + } + } + else + { + dMult = Mathf.Clamp01(1 - armorRating); + } + damAmount *= dMult; //Damage armor if (armorThing != null && armorThing as Pawn == null) @@ -274,9 +276,34 @@ private static bool ApplyArmor(ref float damAmount, ref float pierceAmount, floa armorThing.TakeDamage(new DamageInfo(damageDef, Mathf.CeilToInt(absorbedDamage), null, null, null)); } - pierceAmount *= Mathf.Max(0, 1 - armorRating); + pierceAmount *= dMult; return deflected; } + #endregion Armor + + #region Inventory + + public static void TryUpdateInventory(Pawn pawn) + { + if (pawn != null) + { + CompInventory comp = pawn.TryGetComp(); + if (comp != null) + { + comp.UpdateInventory(); + } + } + } + + public static void TryUpdateInventory(Pawn_InventoryTracker tracker) + { + if (tracker != null && tracker.pawn != null) + { + TryUpdateInventory(tracker.pawn); + } + } + + #endregion Inventory } } diff --git a/Source/CombatRealism/Combat_Realism/Utility_Loadouts.cs b/Source/CombatRealism/Combat_Realism/Utility_Loadouts.cs new file mode 100644 index 0000000..024f3cc --- /dev/null +++ b/Source/CombatRealism/Combat_Realism/Utility_Loadouts.cs @@ -0,0 +1,126 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using Verse; + +namespace Combat_Realism +{ + public static class Utility_Loadouts + { + #region Fields + + private static float _labelSize = -1f; + private static float _margin = 6f; + private static Texture2D _overburdenedTex; + + #endregion Fields + + #region Properties + + public static float LabelSize + { + get + { + if ( _labelSize < 0 ) + { + // get size of label + _labelSize = ( _margin + Math.Max( Text.CalcSize( "CR.Weight".Translate() ).x, Text.CalcSize( "CR.Bulk".Translate() ).x ) ); + } + return _labelSize; + } + } + + public static Texture2D OverburdenedTex + { + get + { + if ( _overburdenedTex == null ) + _overburdenedTex = SolidColorMaterials.NewSolidColorTexture( Color.red ); + return _overburdenedTex; + } + } + + #endregion Properties + + #region Methods + + public static void DrawBar( Rect canvas, float current, float capacity, string label = "", string tooltip = "" ) + { + // rects + Rect labelRect = new Rect( canvas ); + Rect barRect = new Rect( canvas ); + if ( label != "" ) + barRect.xMin += LabelSize; + labelRect.width = LabelSize; + + // label + if ( label != "" ) + Widgets.Label( labelRect, label ); + + // bar + bool overburdened = current > capacity; + float fillPercentage = overburdened ? 1f : current / capacity; + if ( overburdened ) + { + Widgets.FillableBar( barRect, fillPercentage, OverburdenedTex ); + DrawBarThreshold( barRect, capacity / current, 1f ); + } + else + Widgets.FillableBar( barRect, fillPercentage ); + + // tooltip + if ( tooltip != "" ) + TooltipHandler.TipRegion( canvas, tooltip ); + } + + public static void DrawBarThreshold( Rect barRect, float pct, float curLevel = 1f ) + { + float thresholdBarWidth = (float)( ( barRect.width <= 60f ) ? 1 : 2 ); + + Rect position = new Rect( barRect.x + barRect.width * pct - ( thresholdBarWidth - 1f ), barRect.y + barRect.height / 2f, thresholdBarWidth, barRect.height / 2f ); + Texture2D image; + if ( pct < curLevel ) + { + image = BaseContent.BlackTex; + GUI.color = new Color( 1f, 1f, 1f, 0.9f ); + } + else + { + image = BaseContent.GreyTex; + GUI.color = new Color( 1f, 1f, 1f, 0.5f ); + } + GUI.DrawTexture( position, image ); + GUI.color = Color.white; + } + + public static Loadout GetLoadout( this Pawn pawn ) + { + if ( pawn == null ) + throw new ArgumentNullException( "pawn" ); + + Loadout loadout; + if ( !LoadoutManager.AssignedLoadouts.TryGetValue( pawn, out loadout ) ) + { + LoadoutManager.AssignedLoadouts.Add( pawn, LoadoutManager.DefaultLoadout ); + loadout = LoadoutManager.DefaultLoadout; + } + return loadout; + } + + public static void SetLoadout( this Pawn pawn, Loadout loadout ) + { + if ( pawn == null ) + throw new ArgumentNullException( "pawn" ); + + if ( LoadoutManager.AssignedLoadouts.ContainsKey( pawn ) ) + LoadoutManager.AssignedLoadouts[pawn] = loadout; + else + LoadoutManager.AssignedLoadouts.Add( pawn, loadout ); + } + + #endregion Methods + } +} \ No newline at end of file diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/VerbPropertiesCR.cs b/Source/CombatRealism/Combat_Realism/Verbs/VerbPropertiesCR.cs similarity index 66% rename from Assemblies/Source/CombatRealism/Combat_Realism/VerbPropertiesCR.cs rename to Source/CombatRealism/Combat_Realism/Verbs/VerbPropertiesCR.cs index fd58145..e5c0161 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/VerbPropertiesCR.cs +++ b/Source/CombatRealism/Combat_Realism/Verbs/VerbPropertiesCR.cs @@ -9,11 +9,11 @@ namespace Combat_Realism { - public class VerbPropertiesCR : Verse.VerbProperties + public class VerbPropertiesCR : VerbProperties { public Vector2 recoilOffsetX = new Vector2(0, 0); // Recoil will shift targeting on the x axis within this range public Vector2 recoilOffsetY = new Vector2(0, 0); // Recoil will shift targeting on the y axis within this range - public int pelletCount = 1; // The amount of projectiles to create per shot - public float indirectFirePenalty = 0f; + public float indirectFirePenalty = 0; + public float meleeArmorPenetration = 0; } } diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_LaunchProjectileCR.cs b/Source/CombatRealism/Combat_Realism/Verbs/Verb_LaunchProjectileCR.cs similarity index 91% rename from Assemblies/Source/CombatRealism/Combat_Realism/Verb_LaunchProjectileCR.cs rename to Source/CombatRealism/Combat_Realism/Verbs/Verb_LaunchProjectileCR.cs index c08e5c5..330ec39 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_LaunchProjectileCR.cs +++ b/Source/CombatRealism/Combat_Realism/Verbs/Verb_LaunchProjectileCR.cs @@ -18,6 +18,13 @@ public VerbPropertiesCR verbPropsCR return this.verbProps as VerbPropertiesCR; } } + public ProjectilePropertiesCR projectilePropsCR + { + get + { + return this.projectileDef.projectile as ProjectilePropertiesCR; + } + } // Returns either the pawn aiming the weapon or in case of turret guns the turret operator or null if neither exists public Pawn ShooterPawn @@ -118,13 +125,41 @@ protected virtual float swayAmplitude } } + // Ammo variables + protected CompAmmoUser compAmmoInt = null; + protected CompAmmoUser compAmmo + { + get + { + if (compAmmoInt == null && this.ownerEquipment != null) + { + compAmmoInt = this.ownerEquipment.TryGetComp(); + } + return compAmmoInt; + } + } + private ThingDef projectileDef + { + get + { + if (compAmmo != null) + { + if (compAmmo.currentAmmo != null) + { + return compAmmo.currentAmmo.linkedProjectile; + } + } + return this.verbPropsCR.projectileDef; + } + } + /// /// Highlights explosion radius of the projectile if it has one /// /// Projectile explosion radius public override float HighlightFieldRadiusAroundTarget() { - return this.verbPropsCR.projectileDef.projectile.explosionRadius; + return projectileDef.projectile.explosionRadius; } /// @@ -138,7 +173,7 @@ private float GetShotAngle(float velocity, float range, float heightDifference) { const float gravity = Utility.gravityConst; float angle = 0; - angle = (float)Math.Atan((Math.Pow(velocity, 2) + (this.verbPropsCR.projectileDef.projectile.flyOverhead ? 1 : -1) * Math.Sqrt(Math.Pow(velocity, 4) - gravity * (gravity * Math.Pow(range, 2) + 2 * heightDifference * Math.Pow(velocity, 2)))) / (gravity * range)); + angle = (float)Math.Atan((Math.Pow(velocity, 2) + (projectileDef.projectile.flyOverhead ? 1 : -1) * Math.Sqrt(Math.Pow(velocity, 4) - gravity * (gravity * Math.Pow(range, 2) + 2 * heightDifference * Math.Pow(velocity, 2)))) / (gravity * range)); return angle; } @@ -206,7 +241,7 @@ protected virtual Vector3 ShiftTarget(ShiftVecReport report) float targetableHeight = 0; // Projectiles with flyOverhead target the ground below the target and ignore cover - if (!this.verbPropsCR.projectileDef.projectile.flyOverhead) + if (!projectileDef.projectile.flyOverhead) { targetableHeight = Utility.GetCollisionHeight(this.currentTarget.Thing); if (report.cover != null) @@ -248,7 +283,7 @@ private Vector2 GetRecoilVec() { Vector2 recoilVec = new Vector2(0, 0); recoilVec.Set(UnityEngine.Random.Range(this.verbPropsCR.recoilOffsetX.x, this.verbPropsCR.recoilOffsetX.y), UnityEngine.Random.Range(this.verbPropsCR.recoilOffsetY.x, this.verbPropsCR.recoilOffsetY.y)); - recoilVec *= (float)Math.Sqrt((5 - shootingAccuracy) * Mathf.Min(20, this.numShotsFired)); + recoilVec *= (float)Math.Sqrt((5 - shootingAccuracy) * Mathf.Min(15, this.numShotsFired)); return recoilVec; } @@ -280,7 +315,7 @@ public virtual ShiftVecReport ShiftVecReportFor(TargetInfo target) } report.shotSpeed = this.shotSpeed; report.swayDegrees = this.swayAmplitude; - report.spreadDegrees = this.ownerEquipment.GetStatValue(StatDef.Named("ShotSpread")); + report.spreadDegrees = this.ownerEquipment.GetStatValue(StatDef.Named("ShotSpread")) * this.projectilePropsCR.spreadMult; Thing cover; this.GetPartialCoverBetween(this.caster.Position.ToVector3Shifted(), targetCell.ToVector3Shifted(), out cover); report.cover = cover; @@ -342,7 +377,7 @@ private bool GetPartialCoverBetween(Vector3 sourceLoc, Vector3 targetLoc, out Th public override bool CanHitTargetFrom(IntVec3 root, TargetInfo targ) { //Sanity check for flyOverhead projectiles, they should not attack things under thick roofs - if (this.verbPropsCR.projectileDef.projectile.flyOverhead) + if (projectileDef.projectile.flyOverhead) { RoofDef roofDef = Find.RoofGrid.RoofAt(targ.Cell); if (roofDef != null && roofDef.isThickRoof) @@ -394,15 +429,15 @@ protected override bool TryCastShot() { return false; } - if (this.verbPropsCR.pelletCount < 1) + if (this.projectilePropsCR.pelletCount < 1) { Log.Error(this.ownerEquipment.LabelBaseCap + " tried firing with pelletCount less than 1."); return false; } - for (int i = 0; i < this.verbPropsCR.pelletCount; i++) + for (int i = 0; i < this.projectilePropsCR.pelletCount; i++) { Vector3 casterExactPosition = this.caster.DrawPos; - ProjectileCR projectile = (ProjectileCR)ThingMaker.MakeThing(this.verbPropsCR.projectileDef, null); + ProjectileCR projectile = (ProjectileCR)ThingMaker.MakeThing(projectileDef, null); GenSpawn.Spawn(projectile, shootLine.Source); float lengthHorizontalSquared = (this.currentTarget.Cell - this.caster.Position).LengthHorizontalSquared; diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_MarkForArtilleryCR.cs b/Source/CombatRealism/Combat_Realism/Verbs/Verb_MarkForArtilleryCR.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/Verb_MarkForArtilleryCR.cs rename to Source/CombatRealism/Combat_Realism/Verbs/Verb_MarkForArtilleryCR.cs diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCR.cs b/Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCR.cs similarity index 58% rename from Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCR.cs rename to Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCR.cs index 028d477..e65c934 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCR.cs +++ b/Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCR.cs @@ -19,10 +19,10 @@ protected override int ShotsPerBurst { return 1; } - if ((this.compFireModes.currentFireMode == FireMode.BurstFire || (useDefaultModes && this.compFireModes.props.aiUseBurstMode)) - && this.compFireModes.props.aimedBurstShotCount > 0) + if ((this.compFireModes.currentFireMode == FireMode.BurstFire || (useDefaultModes && this.compFireModes.Props.aiUseBurstMode)) + && this.compFireModes.Props.aimedBurstShotCount > 0) { - return this.compFireModes.props.aimedBurstShotCount; + return this.compFireModes.Props.aimedBurstShotCount; } } return this.verbPropsCR.burstShotCount; @@ -42,18 +42,35 @@ private CompFireModes compFireModes } } - private bool isAiming + private bool shouldAim { get { - return this.compFireModes != null - && (this.compFireModes.currentAimMode == AimMode.AimedShot || (useDefaultModes && this.compFireModes.props.aiUseAimMode)) - && this.CasterIsPawn; + if(this.CasterIsPawn) + { + // Check for hunting job + if (CasterPawn.jobs != null && CasterPawn.jobs.curJob != null && CasterPawn.jobs.curJob.def == JobDefOf.Hunt) + return true; + + // Check for suppression + CompSuppressable comp = this.caster.TryGetComp(); + if (comp != null) + { + if (comp.isSuppressed) + { + return false; + } + } + return this.compFireModes != null && (this.compFireModes.currentAimMode == AimMode.AimedShot || (useDefaultModes && this.compFireModes.Props.aiUseAimMode)); + } + return false; } } - private int aimTicks = -1; // Tracks how much time is left to aim before firing, set to -1 when not aiming - private int xpTicks = 0; // Tracker to see how much xp should be awarded for time spent aiming + bursting - private const int aimTicksMin = 30; // How much time to spend on aiming + private bool isAiming = false; + private int xpTicks = 0; // Tracker to see how much xp should be awarded for time spent aiming + bursting + + // How much time to spend on aiming + private const int aimTicksMin = 30; private const int aimTicksMax = 240; // XP amounts @@ -66,7 +83,7 @@ protected override float swayAmplitude get { float sway = base.swayAmplitude; - if (this.isAiming) + if (this.shouldAim) { sway *= Mathf.Max(0, 1 - aimingAccuracy); } @@ -88,58 +105,36 @@ private bool useDefaultModes /// public override void WarmupComplete() { - if (this.isAiming && this.aimTicks < 0) + if (xpTicks <= 0) + xpTicks = Mathf.CeilToInt(verbProps.warmupTicks * 0.5f); + + if (this.shouldAim && !this.isAiming) { float targetDist = (this.currentTarget.Cell - this.caster.Position).LengthHorizontal; - this.aimTicks = (int)Mathf.Lerp(aimTicksMin, aimTicksMax, (targetDist / 100)); - this.CasterPawn.stances.SetStance(new Stance_Cooldown(this.aimTicks, this.currentTarget)); - this.xpTicks += this.aimTicks; + int aimTicks = (int)Mathf.Lerp(aimTicksMin, aimTicksMax, (targetDist / 100)); + this.CasterPawn.stances.SetStance(new Stance_Warmup(aimTicks, this.currentTarget, this)); + this.isAiming = true; return; } // Shooty stuff base.WarmupComplete(); - this.aimTicks = -1; + this.isAiming = false; } - /*/// - /// Calculates whether or not the current weapon sway is small enough to hit the target with a fudge factor based on shooter skill. Does not account for inaccuracy from sources other than sway, - /// such as shotVariation or range estimation errors. - /// - /// True if current sway position will hit target - private bool IsSwayOnTarget() - { - if (this.currentTarget.Thing == null) - { - return true; - } - Vector2 swayVec = base.GetSwayVec(); - float targDist = (this.caster.Position - this.currentTarget.Cell).LengthHorizontal; - float targHeight = Utility.GetCollisionHeight(this.currentTarget.Thing); - float targWidth = Utility.GetCollisionWidth(this.currentTarget.Thing); - - float skillAreaMod = Mathf.Pow(2f / shootingAccuracy, 2f); - float targAreaHor = Mathf.Atan(targWidth / targDist) * skillAreaMod; - float targAreaVert = Mathf.Atan(targHeight * 0.5f / targDist) * skillAreaMod; - - float xRadians = (float)(Mathf.Abs(swayVec.x) * (Math.PI / 180)); - float yRadians = (float)(Mathf.Abs(swayVec.y) * (Math.PI / 180)); - - float shootChance = ((targAreaHor * skillAreaMod / xRadians) + (targAreaVert * skillAreaMod / yRadians)) * 0.001f; - return Rand.Value <= shootChance; - - //return Mathf.Abs(swayVec.x) * (Math.PI / 180) <= a && Mathf.Abs(swayVec.y) * (Math.PI / 180) <= b; - }*/ - public override void VerbTickCR() { - if (this.aimTicks > 0) + if (this.isAiming) { - this.aimTicks--; - if (this.aimTicks <= 0 || !this.isAiming) + this.xpTicks++; + if (!this.shouldAim) { this.WarmupComplete(); } + if (this.CasterPawn.stances.curStance.GetType() != typeof(Stance_Warmup)) + { + this.isAiming = false; + } } // Increase shootTicks while bursting so we can calculate XP afterwards else if (this.state == VerbState.Bursting) @@ -180,6 +175,31 @@ public override void Notify_Dropped() { this.compFireModes.ResetModes(); } + caster = null; + } + + /// + /// Checks to see if fire mode is set to hold fire before doing the base check + /// + public override bool CanHitTargetFrom(IntVec3 root, TargetInfo targ) + { + if (this.compFireModes != null && this.compFireModes.currentAimMode == AimMode.HoldFire) + return false; + return base.CanHitTargetFrom(root, targ); + } + + protected override bool TryCastShot() + { + if (compAmmo != null) + { + if (!compAmmo.TryReduceAmmoCount()) + { + if (compAmmo.hasMagazine) + compAmmo.StartReload(); + return false; + } + } + return base.TryCastShot(); } - } + } } diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCROneUse.cs b/Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCROneUse.cs similarity index 57% rename from Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCROneUse.cs rename to Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCROneUse.cs index 42241c1..09c52ba 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootCROneUse.cs +++ b/Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootCROneUse.cs @@ -16,7 +16,11 @@ protected override bool TryCastShot() } return true; } - if (this.burstShotsLeft < this.verbProps.burstShotCount) + if(compAmmo!=null && compAmmo.hasMagazine && compAmmo.curMagCount <= 0) + { + this.SelfConsume(); + } + else if (this.burstShotsLeft < this.verbProps.burstShotCount) { this.SelfConsume(); } @@ -33,6 +37,14 @@ private void SelfConsume() { if (this.ownerEquipment != null && !this.ownerEquipment.Destroyed) { + if (CasterIsPawn) + { + CompInventory inventory = CasterPawn.TryGetComp(); + if (inventory != null) + { + inventory.SwitchToNextViableWeapon(); + } + } this.ownerEquipment.Destroy(DestroyMode.Vanish); } } diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootMortarCR.cs b/Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootMortarCR.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Combat_Realism/Verb_ShootMortarCR.cs rename to Source/CombatRealism/Combat_Realism/Verbs/Verb_ShootMortarCR.cs diff --git a/Source/CombatRealism/Detours/DetourInjector.cs b/Source/CombatRealism/Detours/DetourInjector.cs new file mode 100644 index 0000000..b259628 --- /dev/null +++ b/Source/CombatRealism/Detours/DetourInjector.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +using RimWorld; +using Verse; +using UnityEngine; +using CommunityCoreLibrary; + +namespace Combat_Realism.Detours +{ + class DetourInjector : SpecialInjector + { + public override bool Inject() + { + // Detour VerbsTick + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(VerbTracker).GetMethod("VerbsTick", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_VerbTracker).GetMethod("VerbsTick", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + // Detour TooltipUtility + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(TooltipUtility).GetMethod("ShotCalculationTipString", BindingFlags.Static | BindingFlags.Public), + typeof(Detours_TooltipUtility).GetMethod("ShotCalculationTipString", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + // Detour DrawTurret + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(TurretTop).GetMethod("DrawTurret", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_TurretTop).GetMethod("DrawTurret", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + // Detour FloatMenuMaker + if(!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(FloatMenuMaker).GetMethod("ChoicesAtFor", BindingFlags.Static | BindingFlags.Public), + typeof(Detours_FloatMenuMaker).GetMethod("ChoicesAtFor", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + // ************************************* + // *** Detour Inventory methods *** + // ************************************* + + // ThingContainer + + MethodInfo tryAddSource = typeof(ThingContainer).GetMethod("TryAdd", BindingFlags.Instance | BindingFlags.Public, null, new Type[] { typeof(Thing) }, null); + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(tryAddSource, typeof(Detours_ThingContainer).GetMethod("TryAdd", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + MethodInfo tryDrop1Source = typeof(ThingContainer).GetMethod("TryDrop", + BindingFlags.Instance | BindingFlags.Public, + null, + new Type[] { typeof(Thing), typeof(IntVec3), typeof(ThingPlaceMode), typeof(Thing).MakeByRefType() }, + null); + + MethodInfo tryDrop1Dest = typeof(Detours_ThingContainer).GetMethod("TryDrop", + BindingFlags.Static | BindingFlags.NonPublic, + null, + new Type[] { typeof(ThingContainer), typeof(Thing), typeof(IntVec3), typeof(ThingPlaceMode), typeof(Thing).MakeByRefType() }, + null); + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(tryDrop1Source, tryDrop1Dest)) + return false; + + MethodInfo tryDrop2Source = typeof(ThingContainer).GetMethod("TryDrop", + BindingFlags.Instance | BindingFlags.Public, + null, + new Type[] { typeof(Thing), typeof(IntVec3), typeof(ThingPlaceMode), typeof(int), typeof(Thing).MakeByRefType() }, + null); + + MethodInfo tryDrop2Dest = typeof(Detours_ThingContainer).GetMethod("TryDrop", + BindingFlags.Static | BindingFlags.NonPublic, + null, + new Type[] { typeof(ThingContainer), typeof(Thing), typeof(IntVec3), typeof(ThingPlaceMode), typeof(int), typeof(Thing).MakeByRefType() }, + null); + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(tryDrop2Source, tryDrop2Dest)) + return false; + + // Pawn_ApparelTracker + + MethodInfo tryDrop3Source = typeof(Pawn_ApparelTracker).GetMethod("TryDrop", + BindingFlags.Instance | BindingFlags.Public, + null, + new Type[] { typeof(Apparel), typeof(Apparel).MakeByRefType(), typeof(IntVec3), typeof(bool) }, + null); + + MethodInfo tryDrop3Dest = typeof(Detours_Pawn_ApparelTracker).GetMethod("TryDrop", + BindingFlags.Static | BindingFlags.NonPublic, + null, + new Type[] { typeof(Pawn_ApparelTracker), typeof(Apparel), typeof(Apparel).MakeByRefType(), typeof(IntVec3), typeof(bool) }, + null); + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(tryDrop3Source, tryDrop3Dest)) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_ApparelTracker).GetMethod("Wear", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_Pawn_ApparelTracker).GetMethod("Wear", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_ApparelTracker).GetMethod("Notify_WornApparelDestroyed", BindingFlags.Instance | BindingFlags.NonPublic), + typeof(Detours_Pawn_ApparelTracker).GetMethod("Notify_WornApparelDestroyed", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + // Pawn_EquipmentTracker + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_EquipmentTracker).GetMethod("AddEquipment", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_Pawn_EquipmentTracker).GetMethod("AddEquipment", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_EquipmentTracker).GetMethod("Notify_PrimaryDestroyed", BindingFlags.Instance | BindingFlags.NonPublic), + typeof(Detours_Pawn_EquipmentTracker).GetMethod("Notify_PrimaryDestroyed", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_EquipmentTracker).GetMethod("TryDropEquipment", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_Pawn_EquipmentTracker).GetMethod("TryDropEquipment", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_EquipmentTracker).GetMethod("TryTransferEquipmentToContainer", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_Pawn_EquipmentTracker).GetMethod("TryTransferEquipmentToContainer", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + if (!CommunityCoreLibrary.Detours.TryDetourFromTo(typeof(Pawn_EquipmentTracker).GetMethod("TryStartAttack", BindingFlags.Instance | BindingFlags.Public), + typeof(Detours_Pawn_EquipmentTracker).GetMethod("TryStartAttack", BindingFlags.Static | BindingFlags.NonPublic))) + return false; + + return true; + } + } +} diff --git a/Source/CombatRealism/Detours/Detours_FloatMenuMaker.cs b/Source/CombatRealism/Detours/Detours_FloatMenuMaker.cs new file mode 100644 index 0000000..ea74c09 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_FloatMenuMaker.cs @@ -0,0 +1,822 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using Verse.AI; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal class Detours_FloatMenuMaker + { + internal static List ChoicesAtFor(Vector3 clickPos, Pawn pawn) + { + IntVec3 clickCell = IntVec3.FromVector3(clickPos); + DangerUtility.NotifyDirectOrderingThisFrame(pawn); + List list = new List(); + if (!clickCell.InBounds()) + { + return list; + } + + // ***** Beginning of drafted options ***** + + if (pawn.Drafted) + { + foreach (TargetInfo attackTarg in GenUI.TargetsAt(clickPos, TargetingParameters.ForAttackHostile(), true)) + { + // *** Fire at option *** + + if (pawn.equipment.Primary != null && !pawn.equipment.PrimaryEq.PrimaryVerb.verbProps.MeleeRange) + { + string str; + Action rangedAct = FloatMenuUtility.GetRangedAttackAction(pawn, attackTarg, out str); + string text = "FireAt".Translate(new object[] + { + attackTarg.Thing.LabelCap + }); + FloatMenuOption floatMenuOption = new FloatMenuOption(); + floatMenuOption.priority = MenuOptionPriority.High; + if (rangedAct == null) + { + text = text + " (" + str + ")"; + } + else + { + floatMenuOption.autoTakeable = true; + floatMenuOption.action = new Action(delegate + { + MoteThrower.ThrowStatic(attackTarg.Thing.DrawPos, ThingDefOf.Mote_FeedbackAttack, 1f); + rangedAct(); + }); + } + floatMenuOption.label = text; + list.Add(floatMenuOption); + } + + // *** Melee attack option *** + + string str2; + Action meleeAct = FloatMenuUtility.GetMeleeAttackAction(pawn, attackTarg, out str2); + Pawn pawn2 = attackTarg.Thing as Pawn; + string text2; + if (pawn2 != null && pawn2.Downed) + { + text2 = "MeleeAttackToDeath".Translate(new object[] + { + attackTarg.Thing.LabelCap + }); + } + else + { + text2 = "MeleeAttack".Translate(new object[] + { + attackTarg.Thing.LabelCap + }); + } + Thing thing = attackTarg.Thing; + FloatMenuOption floatMenuOption2 = new FloatMenuOption(string.Empty, null, MenuOptionPriority.High, null, thing); + if (meleeAct == null) + { + text2 = text2 + " (" + str2 + ")"; + } + else + { + floatMenuOption2.action = new Action(delegate + { + MoteThrower.ThrowStatic(attackTarg.Thing.DrawPos, ThingDefOf.Mote_FeedbackAttack, 1f); + meleeAct(); + }); + } + floatMenuOption2.label = text2; + list.Add(floatMenuOption2); + } + + // *** Arrest option *** + + if (pawn.RaceProps.Humanlike && !pawn.Downed) + { + foreach (TargetInfo current2 in GenUI.TargetsAt(clickPos, TargetingParameters.ForArrest(pawn), true)) + { + TargetInfo dest = current2; + if (!pawn.CanReach(dest, PathEndMode.OnCell, Danger.Deadly, false, TraverseMode.ByPawn)) + { + list.Add(new FloatMenuOption("CannotArrest".Translate() + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null)); + } + else if (!pawn.CanReserve(dest.Thing, 1)) + { + list.Add(new FloatMenuOption("CannotArrest".Translate() + ": " + "Reserved".Translate(), null, MenuOptionPriority.Medium, null, null)); + } + else + { + Pawn pTarg = (Pawn)dest.Thing; + Action action = new Action(delegate + { + Building_Bed building_Bed = RestUtility.FindBedFor(pTarg, pawn, true, false, false); + if (building_Bed == null) + { + Messages.Message("CannotArrest".Translate() + ": " + "NoPrisonerBed".Translate(), pTarg, MessageSound.RejectInput); + return; + } + Job job = new Job(JobDefOf.Arrest, pTarg, building_Bed); + job.playerForced = true; + job.maxNumToCarry = 1; + pawn.drafter.TakeOrderedJob(job); + TutorUtility.DoModalDialogIfNotKnown(ConceptDefOf.ArrestingCreatesEnemies); + }); + List arg_3F1_0 = list; + Thing thing = dest.Thing; + arg_3F1_0.Add(new FloatMenuOption("TryToArrest".Translate(new object[] + { + dest.Thing.LabelCap + }), action, MenuOptionPriority.Medium, null, thing)); + } + } + } + + // *** Goto option *** + + int num = GenRadial.NumCellsInRadius(2.9f); + for (int i = 0; i < num; i++) + { + IntVec3 curLoc = GenRadial.RadialPattern[i] + clickCell; + if (curLoc.Standable()) + { + if (curLoc != pawn.Position) + { + if (!pawn.CanReach(curLoc, PathEndMode.OnCell, Danger.Deadly, false, TraverseMode.ByPawn)) + { + FloatMenuOption item = new FloatMenuOption("CannotGoNoPath".Translate(), null, MenuOptionPriority.Low, null, null); + list.Add(item); + } + else + { + Action action2 = new Action(delegate + { + IntVec3 dest = Pawn_DraftController.BestGotoDestNear(curLoc, pawn); + Job job = new Job(JobDefOf.Goto, dest); + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + MoteThrower.ThrowStatic(dest, ThingDefOf.Mote_FeedbackGoto, 1f); + }); + list.Add(new FloatMenuOption("GoHere".Translate(), action2, MenuOptionPriority.Low, null, null) + { + autoTakeable = true + }); + } + } + break; + } + } + } + + // *** End of drafted options *** + + // *** Beginning of humanlike options *** + + if (pawn.RaceProps.Humanlike) + { + int num2 = 0; + if (pawn.story != null) + { + num2 = pawn.story.traits.DegreeOfTrait(TraitDefOf.DrugDesire); + } + + // *** Consume option *** + + foreach (Thing current3 in clickCell.GetThingList()) + { + Thing t = current3; + if (t.def.ingestible != null && pawn.RaceProps.CanEverEat(t) && t.IngestibleNow) + { + FloatMenuOption item2; + if (t.def.ingestible.isPleasureDrug && num2 < 0) + { + item2 = new FloatMenuOption("ConsumeThing".Translate(new object[] + { + t.LabelBaseShort + }) + " (" + "Teetotaler".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.CanReach(t, PathEndMode.OnCell, Danger.Deadly, false, TraverseMode.ByPawn)) + { + item2 = new FloatMenuOption("ConsumeThing".Translate(new object[] + { + t.LabelBaseShort + }) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.CanReserve(t, 1)) + { + item2 = new FloatMenuOption("ConsumeThing".Translate(new object[] + { + t.LabelBaseShort + }) + " (" + "ReservedBy".Translate(new object[] + { + Find.Reservations.FirstReserverOf(t, pawn.Faction).LabelBaseShort + }) + ")", null, MenuOptionPriority.Medium, null, null); + } + else + { + item2 = new FloatMenuOption("ConsumeThing".Translate(new object[] + { + t.LabelBaseShort + }), new Action(delegate + { + t.SetForbidden(false, true); + Job job = new Job(JobDefOf.Ingest, t); + job.maxNumToCarry = t.def.ingestible.maxNumToIngestAtOnce; + pawn.drafter.TakeOrderedJob(job); + }), MenuOptionPriority.Medium, null, null); + } + list.Add(item2); + } + } + + // *** Rescue/Capture downed option *** + + foreach (TargetInfo current4 in GenUI.TargetsAt(clickPos, TargetingParameters.ForRescue(pawn), true)) + { + Pawn victim = (Pawn)current4.Thing; + if (!victim.InBed() && pawn.CanReserveAndReach(victim, PathEndMode.OnCell, Danger.Deadly, 1) && !victim.IsPrisonerOfColony) + { + if ((victim.Faction == Faction.OfColony && victim.MentalStateDef == null) || (victim.Faction != Faction.OfColony && victim.MentalStateDef == null && !victim.IsPrisonerOfColony && (victim.Faction == null || !victim.Faction.HostileTo(Faction.OfColony)))) + { + List arg_8E1_0 = list; + Pawn victim2 = victim; + arg_8E1_0.Add(new FloatMenuOption("Rescue".Translate(new object[] + { + victim2.LabelCap + }), new Action(delegate + { + Building_Bed building_Bed = RestUtility.FindBedFor(victim, pawn, false, false, false); + if (building_Bed == null) + { + string str; + if (victim.RaceProps.Animal) + { + str = "NoAnimalBed".Translate(); + } + else + { + str = "NoNonPrisonerBed".Translate(); + } + Messages.Message("CannotRescue".Translate() + ": " + str, victim, MessageSound.RejectInput); + return; + } + Job job = new Job(JobDefOf.Rescue, victim, building_Bed); + job.maxNumToCarry = 1; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.Rescuing, KnowledgeAmount.Total); + }), MenuOptionPriority.Medium, null, victim2)); + } + if (victim.MentalStateDef != null || (victim.RaceProps.Humanlike && victim.Faction != Faction.OfColony)) + { + List arg_962_0 = list; + Pawn victim2 = victim; + arg_962_0.Add(new FloatMenuOption("Capture".Translate(new object[] + { + victim2.LabelCap + }), new Action(delegate + { + Building_Bed building_Bed = RestUtility.FindBedFor(victim, pawn, true, false, false); + if (building_Bed == null) + { + Messages.Message("CannotCapture".Translate() + ": " + "NoPrisonerBed".Translate(), victim, MessageSound.RejectInput); + return; + } + Job job = new Job(JobDefOf.Capture, victim, building_Bed); + job.maxNumToCarry = 1; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.Capturing, KnowledgeAmount.Total); + }), MenuOptionPriority.Medium, null, victim2)); + } + } + } + + // *** Carry to cryosleep option *** + + foreach (TargetInfo current5 in GenUI.TargetsAt(clickPos, TargetingParameters.ForRescue(pawn), true)) + { + TargetInfo targetInfo = current5; + Pawn victim = (Pawn)targetInfo.Thing; + if (victim.Downed && pawn.CanReserveAndReach(victim, PathEndMode.OnCell, Danger.Deadly, 1) && Building_CryptosleepCasket.FindCryptosleepCasketFor(victim, pawn) != null) + { + string label = "CarryToCryptosleepCasket".Translate(new object[] + { + targetInfo.Thing.LabelCap + }); + JobDef jDef = JobDefOf.CarryToCryptosleepCasket; + Action action3 = new Action(delegate + { + Building_CryptosleepCasket building_CryptosleepCasket = Building_CryptosleepCasket.FindCryptosleepCasketFor(victim, pawn); + if (building_CryptosleepCasket == null) + { + Messages.Message("CannotCarryToCryptosleepCasket".Translate() + ": " + "NoCryptosleepCasket".Translate(), victim, MessageSound.RejectInput); + return; + } + Job job = new Job(jDef, victim, building_CryptosleepCasket); + job.maxNumToCarry = 1; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + }); + List arg_A80_0 = list; + Pawn victim2 = victim; + arg_A80_0.Add(new FloatMenuOption(label, action3, MenuOptionPriority.Medium, null, victim2)); + } + } + + // *** Strip option *** + + foreach (TargetInfo current6 in GenUI.TargetsAt(clickPos, TargetingParameters.ForStrip(pawn), true)) + { + TargetInfo stripTarg = current6; + FloatMenuOption item3; + if (!pawn.CanReach(stripTarg, PathEndMode.ClosestTouch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + item3 = new FloatMenuOption("CannotStrip".Translate(new object[] + { + stripTarg.Thing.LabelCap + }) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.CanReserveAndReach(stripTarg, PathEndMode.ClosestTouch, Danger.Deadly, 1)) + { + item3 = new FloatMenuOption("CannotStrip".Translate(new object[] + { + stripTarg.Thing.LabelCap + }) + " (" + "ReservedBy".Translate(new object[] + { + Find.Reservations.FirstReserverOf(stripTarg, pawn.Faction).LabelBaseShort + }) + ")", null, MenuOptionPriority.Medium, null, null); + } + else + { + item3 = new FloatMenuOption("Strip".Translate(new object[] + { + stripTarg.Thing.LabelCap + }), new Action(delegate + { + stripTarg.Thing.SetForbidden(false, false); + Job job = new Job(JobDefOf.Strip, stripTarg); + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + }), MenuOptionPriority.Medium, null, null); + } + list.Add(item3); + } + + // *** Equip option *** + + CompInventory compInventory = pawn.TryGetComp(); // Need compInventory here for equip and wear options + + if (pawn.equipment != null) + { + ThingWithComps equipment = null; + List thingList = clickCell.GetThingList(); + for (int j = 0; j < thingList.Count; j++) + { + if (thingList[j].TryGetComp() != null) + { + equipment = (ThingWithComps)thingList[j]; + break; + } + } + if (equipment != null) + { + string eqLabel = GenLabel.ThingLabel(equipment.def, equipment.Stuff, 1); + FloatMenuOption equipOption; + if (!pawn.CanReach(equipment, PathEndMode.ClosestTouch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + equipOption = new FloatMenuOption("CannotEquip".Translate(new object[] + { + eqLabel + }) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.CanReserve(equipment, 1)) + { + equipOption = new FloatMenuOption("CannotEquip".Translate(new object[] + { + eqLabel + }) + " (" + "ReservedBy".Translate(new object[] + { + Find.Reservations.FirstReserverOf(equipment, pawn.Faction).LabelBaseShort + }) + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation)) + { + equipOption = new FloatMenuOption("CannotEquip".Translate(new object[] + { + eqLabel + }) + " (" + "Incapable".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else + { + // Added check for inventory space here + int count; + if (compInventory != null && !compInventory.CanFitInInventory(equipment, out count, true)) + { + equipOption = new FloatMenuOption("CannotEquip".Translate(new object[] { eqLabel }) + " (" + "CR_InventoryFull".Translate() + ")", null); + } + else + { + string equipOptionLabel = "Equip".Translate(new object[] + { + eqLabel + }); + if (equipment.def.IsRangedWeapon && pawn.story != null && pawn.story.traits.HasTrait(TraitDefOf.Brawler)) + { + equipOptionLabel = equipOptionLabel + " " + "EquipWarningBrawler".Translate(); + } + equipOption = new FloatMenuOption(equipOptionLabel, new Action(delegate + { + equipment.SetForbidden(false, true); + Job job = new Job(JobDefOf.Equip, equipment); + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + MoteThrower.ThrowStatic(equipment.DrawPos, ThingDefOf.Mote_FeedbackEquip, 1f); + ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.EquippingWeapons, KnowledgeAmount.Total); + }), MenuOptionPriority.Medium, null, null); + } + } + list.Add(equipOption); + } + } + + // *** Wear option *** + + if (pawn.apparel != null) + { + Apparel apparel = Find.ThingGrid.ThingAt(clickCell); + if (apparel != null) + { + FloatMenuOption wearOption; + if (!pawn.CanReach(apparel, PathEndMode.ClosestTouch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + wearOption = new FloatMenuOption("CannotWear".Translate(new object[] + { + apparel.Label + }) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!pawn.CanReserve(apparel, 1)) + { + Pawn pawn3 = Find.Reservations.FirstReserverOf(apparel, pawn.Faction); + wearOption = new FloatMenuOption("CannotWear".Translate(new object[] + { + apparel.Label + }) + " (" + "ReservedBy".Translate(new object[] + { + pawn3.LabelBaseShort + }) + ")", null, MenuOptionPriority.Medium, null, null); + } + else if (!ApparelUtility.HasPartsToWear(pawn, apparel.def)) + { + wearOption = new FloatMenuOption("CannotWear".Translate(new object[] + { + apparel.Label + }) + " (" + "CannotWearBecauseOfMissingBodyParts".Translate() + ")", null, MenuOptionPriority.Medium, null, null); + } + else + { + // Added check for inventory capacity + int count; + if (compInventory != null && !compInventory.CanFitInInventory(apparel, out count, false, true)) + { + wearOption = new FloatMenuOption("CannotWear".Translate(new object[] { apparel.Label }) + " (" + "CR_InventoryFull".Translate() + ")", null); + } + else + { + wearOption = new FloatMenuOption("ForceWear".Translate(new object[] { apparel.LabelBaseShort }), + new Action(delegate + { + apparel.SetForbidden(false, true); + Job job = new Job(JobDefOf.Wear, apparel); + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + }), + MenuOptionPriority.Medium, null, null); + } + } + list.Add(wearOption); + } + } + + // *** NEW: Pick up option *** + + if (compInventory != null) + { + List thingList = clickCell.GetThingList(); + if (!thingList.NullOrEmpty()) + { + Thing item = thingList.FirstOrDefault(thing => thing.def.alwaysHaulable && !(thing is Corpse)); + if (item != null) + { + FloatMenuOption pickUpOption; + int count = 0; + if (!pawn.CanReach(item, PathEndMode.Touch, Danger.Deadly)) + { + pickUpOption = new FloatMenuOption("CR_CannotPickUp".Translate() + " " + item.LabelBaseShort + " (" + "NoPath".Translate() + ")", null); + } + else if (!pawn.CanReserve(item)) + { + pickUpOption = new FloatMenuOption("CR_CannotPickUp".Translate() + " " + item.LabelBaseShort + " (" + "ReservedBy".Translate(new object[] { Find.Reservations.FirstReserverOf(item, pawn.Faction) }), null); + } + else if (!compInventory.CanFitInInventory(item, out count)) + { + pickUpOption = new FloatMenuOption("CR_CannotPickUp".Translate() + " " + item.LabelBaseShort + " (" + "CR_InventoryFull".Translate() + ")", null); + } + else + { + pickUpOption = new FloatMenuOption("CR_PickUp".Translate() + " " + item.LabelBaseShort, + new Action(delegate + { + item.SetForbidden(false); + Job job = new Job(JobDefOf.TakeInventory, item) { maxNumToCarry = 1 }; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + })); + } + list.Add(pickUpOption); + if (count > 1 && item.stackCount > 1) + { + int numToCarry = Math.Min(count, item.stackCount); + FloatMenuOption pickUpStackOption = new FloatMenuOption("CR_PickUp".Translate() + " " + item.LabelBaseShort + " x" + numToCarry.ToString(), + new Action(delegate + { + item.SetForbidden(false); + Job job = new Job(JobDefOf.TakeInventory, item) { maxNumToCarry = numToCarry }; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + })); + list.Add(pickUpStackOption); + } + } + } + } + + // *** Deposit/drop equipment options *** + + if (pawn.equipment != null && pawn.equipment.Primary != null) + { + Thing thing2 = Find.ThingGrid.ThingAt(clickCell, ThingDefOf.EquipmentRack); + if (thing2 != null) + { + if (!pawn.CanReach(thing2, PathEndMode.ClosestTouch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + list.Add(new FloatMenuOption("CannotDeposit".Translate(new object[] + { + pawn.equipment.Primary.LabelCap, + thing2.def.label + }) + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null)); + } + else + { + using (IEnumerator enumerator7 = GenAdj.CellsOccupiedBy(thing2).GetEnumerator()) + { + while (enumerator7.MoveNext()) + { + IntVec3 c = enumerator7.Current; + if (c.GetStorable() == null && pawn.CanReserveAndReach(c, PathEndMode.ClosestTouch, Danger.Deadly, 1)) + { + Action action4 = new Action(delegate + { + ThingWithComps t; + if (pawn.equipment.TryDropEquipment(pawn.equipment.Primary, out t, pawn.Position, true)) + { + t.SetForbidden(false, true); + Job job = new Job(JobDefOf.HaulToCell, t, c); + job.haulMode = HaulMode.ToCellStorage; + job.maxNumToCarry = 1; + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + } + }); + list.Add(new FloatMenuOption("Deposit".Translate(new object[] + { + pawn.equipment.Primary.LabelCap, + thing2.def.label + }), action4, MenuOptionPriority.Medium, null, null)); + break; + } + } + } + } + } + if (pawn.equipment != null && GenUI.TargetsAt(clickPos, TargetingParameters.ForSelf(pawn), true).Any()) + { + Action action5 = new Action(delegate + { + ThingWithComps thingWithComps; + pawn.equipment.TryDropEquipment(pawn.equipment.Primary, out thingWithComps, pawn.Position, true); + pawn.drafter.TakeOrderedJob(new Job(JobDefOf.Wait, 20, false)); + } + ); + list.Add(new FloatMenuOption("Drop".Translate(new object[] + { + pawn.equipment.Primary.LabelCap + }), action5, MenuOptionPriority.Medium, null, null)); + } + } + + // *** Trade with option *** + + foreach (TargetInfo current7 in GenUI.TargetsAt(clickPos, TargetingParameters.ForTrade(), true)) + { + TargetInfo dest2 = current7; + if (!pawn.CanReach(dest2, PathEndMode.OnCell, Danger.Deadly, false, TraverseMode.ByPawn)) + { + list.Add(new FloatMenuOption("CannotTrade".Translate() + " (" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null)); + } + else if (!pawn.CanReserve(dest2.Thing, 1)) + { + list.Add(new FloatMenuOption("CannotTrade".Translate() + " (" + "Reserved".Translate() + ")", null, MenuOptionPriority.Medium, null, null)); + } + else + { + Pawn pTarg = (Pawn)dest2.Thing; + Action action6 = new Action(delegate + { + Job job = new Job(JobDefOf.TradeWithPawn, pTarg); + job.playerForced = true; + pawn.drafter.TakeOrderedJob(job); + ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.InteractingWithTraders, KnowledgeAmount.Total); + }); + string str3 = string.Empty; + if (pTarg.Faction != null) + { + str3 = " (" + pTarg.Faction.name + ")"; + } + List arg_142E_0 = list; + Thing thing = dest2.Thing; + arg_142E_0.Add(new FloatMenuOption("TradeWith".Translate(new object[] + { + pTarg.LabelBaseShort + }) + str3, action6, MenuOptionPriority.Medium, null, thing)); + } + } + foreach (Thing current8 in Find.ThingGrid.ThingsAt(clickCell)) + { + foreach (FloatMenuOption current9 in current8.GetFloatMenuOptions(pawn)) + { + list.Add(current9); + } + } + } + + // *** End of humanlike options *** + + // *** Beginning of non-drafted options *** + + if (!pawn.Drafted) + { + bool flag = false; + bool flag2 = false; + foreach (Thing current10 in Find.ThingGrid.ThingsAt(clickCell)) + { + flag2 = true; + if (pawn.CanReach(current10, PathEndMode.Touch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + flag = true; + break; + } + } + if (flag2 && !flag) + { + list.Add(new FloatMenuOption("(" + "NoPath".Translate() + ")", null, MenuOptionPriority.Medium, null, null)); + return list; + } + foreach (Thing current11 in Find.ThingGrid.ThingsAt(clickCell)) + { + Pawn pawn4 = Find.Reservations.FirstReserverOf(current11, pawn.Faction); + if (pawn4 != null && pawn4 != pawn) + { + list.Add(new FloatMenuOption("IsReservedBy".Translate(new object[] + { + current11.LabelBaseShort.CapitalizeFirst(), + pawn4.LabelBaseShort + }), null, MenuOptionPriority.Medium, null, null)); + } + else + { + JobGiver_Work jobGiver_Work = pawn.thinker.TryGetMainTreeThinkNode(); + if (jobGiver_Work != null) + { + foreach (WorkTypeDef current12 in DefDatabase.AllDefsListForReading) + { + for (int k = 0; k < current12.workGiversByPriority.Count; k++) + { + WorkGiver_Scanner workGiver_Scanner = current12.workGiversByPriority[k].Worker as WorkGiver_Scanner; + if (workGiver_Scanner != null) + { + if (workGiver_Scanner.def.directOrderable) + { + if (!workGiver_Scanner.ShouldSkip(pawn)) + { + JobFailReason.Clear(); + Job job; + if (!workGiver_Scanner.HasJobOnThingForced(pawn, current11)) + { + job = null; + } + else + { + job = workGiver_Scanner.JobOnThingForced(pawn, current11); + } + if (workGiver_Scanner.PotentialWorkThingRequest.Accepts(current11) || (workGiver_Scanner.PotentialWorkThingsGlobal(pawn) != null && workGiver_Scanner.PotentialWorkThingsGlobal(pawn).Contains(current11))) + { + if (job == null) + { + if (JobFailReason.HaveReason) + { + string label2 = "CannotGenericWork".Translate(new object[] + { + workGiver_Scanner.def.verb, + current11.LabelBaseShort + }) + " (" + JobFailReason.Reason + ")"; + list.Add(new FloatMenuOption(label2, null, MenuOptionPriority.Medium, null, null)); + } + } + else + { + string label; + WorkTypeDef workType = workGiver_Scanner.def.workType; + Action action7 = null; + PawnCapacityDef pawnCapacityDef = workGiver_Scanner.MissingRequiredCapacity(pawn); + if (pawnCapacityDef != null) + { + label = "CannotMissingHealthActivities".Translate(new object[] + { + pawnCapacityDef.label + }); + } + else if (pawn.jobs.curJob != null && pawn.jobs.curJob.JobIsSameAs(job)) + { + label = "CannotGenericAlreadyAm".Translate(new object[] + { + workType.gerundLabel, + current11.LabelBaseShort + }); + } + else if (pawn.workSettings.GetPriority(workType) == 0) + { + label = "CannotPrioritizeIsNotA".Translate(new object[] + { + pawn.NameStringShort, + workType.pawnLabel + }); + } + else if (job.def == JobDefOf.Research && current11 is Building_ResearchBench) + { + label = "CannotPrioritizeResearch".Translate(); + } + else if (current11.IsForbidden(pawn)) + { + label = "CannotPrioritizeForbidden".Translate(new object[] + { + current11.Label + }); + } + else if (!pawn.CanReach(current11, PathEndMode.Touch, Danger.Deadly, false, TraverseMode.ByPawn)) + { + label = current11.Label + ": " + "NoPath".Translate(); + } + else + { + label = "PrioritizeGeneric".Translate(new object[] + { + workGiver_Scanner.def.gerund, + current11.Label + }); + Job localJob = job; + WorkTypeDef localWorkTypeDef = workType; + action7 = new Action(delegate { pawn.thinker.GetMainTreeThinkNode().TryStartPrioritizedWorkOn(pawn, localJob, localWorkTypeDef); }); + } + if (!list.Any(op => op.label == label)) + { + list.Add(new FloatMenuOption(label, action7, MenuOptionPriority.Medium, null, null)); + } + } + } + } + } + } + } + } + } + } + } + } + + // *** End of non-drafted options *** + + foreach (FloatMenuOption current13 in pawn.GetExtraFloatMenuOptionsFor(clickCell)) + { + list.Add(current13); + } + DangerUtility.DoneDirectOrdering(); + return list; + } + + } +} diff --git a/Source/CombatRealism/Detours/Detours_Pawn_ApparelTracker.cs b/Source/CombatRealism/Detours/Detours_Pawn_ApparelTracker.cs new file mode 100644 index 0000000..33b0673 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_Pawn_ApparelTracker.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal static class Detours_Pawn_ApparelTracker + { + internal static bool TryDrop(this Pawn_ApparelTracker _this, Apparel ap, out Apparel resultingAp, IntVec3 pos, bool forbid = true) + { + if (!_this.WornApparel.Contains(ap)) + { + Log.Warning(_this.pawn.LabelCap + " tried to drop apparel he didn't have: " + ap.LabelCap); + resultingAp = null; + return false; + } + _this.WornApparel.Remove(ap); + ap.wearer = null; + Thing thing = null; + bool flag = GenThing.TryDropAndSetForbidden(ap, pos, ThingPlaceMode.Near, out thing, forbid); + resultingAp = (thing as Apparel); + _this.pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); + if (flag && _this.pawn.outfits != null) + { + _this.pawn.outfits.forcedHandler.SetForced(ap, false); + } + Utility.TryUpdateInventory(_this.pawn); // Apparel was dropped, update inventory + return flag; + } + + internal static void Wear(this Pawn_ApparelTracker _this, Apparel newApparel, bool dropReplacedApparel = true) + { + SlotGroupUtility.Notify_TakingThing(newApparel); + if (newApparel.Spawned) + { + newApparel.DeSpawn(); + } + if (!ApparelUtility.HasPartsToWear(_this.pawn, newApparel.def)) + { + Log.Warning(string.Concat(new object[] + { + _this.pawn, + " tried to wear ", + newApparel, + " but he has no body parts required to wear it." + })); + return; + } + for (int i = _this.WornApparel.Count - 1; i >= 0; i--) + { + Apparel apparel = _this.WornApparel[i]; + if (!ApparelUtility.CanWearTogether(newApparel.def, apparel.def)) + { + bool forbid = _this.pawn.Faction.HostileTo(Faction.OfColony); + if (dropReplacedApparel) + { + Apparel apparel2; + if (!_this.TryDrop(apparel, out apparel2, _this.pawn.Position, forbid)) + { + Log.Error(_this.pawn + " could not drop " + apparel); + return; + } + } + else + { + _this.WornApparel.Remove(apparel); + } + } + } + _this.WornApparel.Add(newApparel); + newApparel.wearer = _this.pawn; + + Utility.TryUpdateInventory(_this.pawn); // Apparel was added, update inventory + MethodInfo methodInfo = typeof(Pawn_ApparelTracker).GetMethod("SortWornApparelIntoDrawOrder", BindingFlags.Instance | BindingFlags.NonPublic); + methodInfo.Invoke(_this, new object[] { }); + + LongEventHandler.ExecuteWhenFinished(new Action(_this.pawn.Drawer.renderer.graphics.ResolveApparelGraphics)); + } + + internal static void Notify_WornApparelDestroyed(this Pawn_ApparelTracker _this, Apparel apparel) + { + _this.WornApparel.Remove(apparel); + LongEventHandler.ExecuteWhenFinished(new Action(_this.pawn.Drawer.renderer.graphics.ResolveApparelGraphics)); + if (_this.pawn.outfits != null && _this.pawn.outfits.forcedHandler != null) + { + _this.pawn.outfits.forcedHandler.Notify_Destroyed(apparel); + } + Utility.TryUpdateInventory(_this.pawn); // Apparel was destroyed, update inventory + } + } +} diff --git a/Source/CombatRealism/Detours/Detours_Pawn_EquipmentTracker.cs b/Source/CombatRealism/Detours/Detours_Pawn_EquipmentTracker.cs new file mode 100644 index 0000000..68cf251 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_Pawn_EquipmentTracker.cs @@ -0,0 +1,189 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal static class Detours_Pawn_EquipmentTracker + { + private static readonly FieldInfo pawnFieldInfo = typeof(Pawn_EquipmentTracker).GetField("pawn", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly FieldInfo primaryIntFieldInfo = typeof(Pawn_EquipmentTracker).GetField("primaryInt", BindingFlags.Instance | BindingFlags.NonPublic); + + internal static void AddEquipment(this Pawn_EquipmentTracker _this, ThingWithComps newEq) + { + SlotGroupUtility.Notify_TakingThing(newEq); + + // Fetch private fields + Pawn pawn = (Pawn)pawnFieldInfo.GetValue(_this); + ThingWithComps primaryInt = (ThingWithComps)primaryIntFieldInfo.GetValue(_this); + + SlotGroupUtility.Notify_TakingThing(newEq); + if (_this.AllEquipment.Where(eq => eq.def == newEq.def).Any()) + { + Log.Error(string.Concat(new object[] + { + "Pawn ", + pawn.LabelCap, + " got equipment ", + newEq, + " while already having it." + })); + return; + } + if (newEq.def.equipmentType == EquipmentType.Primary && primaryInt != null) + { + Log.Error(string.Concat(new object[] + { + "Pawn ", + pawn.LabelCap, + " got primaryInt equipment ", + newEq, + " while already having primaryInt equipment ", + primaryInt + })); + return; + } + if (newEq.def.equipmentType == EquipmentType.Primary) + { + primaryIntFieldInfo.SetValue(_this, newEq); // Changed assignment to SetValue() since we're fetching a private variable through reflection + } + foreach (Verb current in newEq.GetComp().AllVerbs) + { + current.caster = pawn; + current.Notify_PickedUp(); + } + + Utility.TryUpdateInventory(pawn); // Added equipment, update inventory + } + + internal static void Notify_PrimaryDestroyed(this Pawn_EquipmentTracker _this) + { + // Fetch private fields + Pawn pawn = (Pawn)pawnFieldInfo.GetValue(_this); + ThingWithComps primaryInt = (ThingWithComps)primaryIntFieldInfo.GetValue(_this); + + primaryIntFieldInfo.SetValue(_this, null); + pawn.meleeVerbs.Notify_EquipmentLost(); + if (pawn.Spawned) + pawn.stances.CancelBusyStanceSoft(); + + Utility.TryUpdateInventory(pawn); // Equipment was destroyed, update inventory + } + + internal static bool TryDropEquipment(this Pawn_EquipmentTracker _this, ThingWithComps eq, out ThingWithComps resultingEq, IntVec3 pos, bool forbid = true) + { + // Fetch private fields + Pawn pawn = (Pawn)pawnFieldInfo.GetValue(_this); + ThingWithComps primaryInt = (ThingWithComps)primaryIntFieldInfo.GetValue(_this); + + if (!_this.AllEquipment.Contains(eq)) + { + Log.Warning(pawn.LabelCap + " tried to drop equipment they didn't have: " + eq); + resultingEq = null; + return false; + } + if (!pos.IsValid) + { + Log.Error(string.Concat(new object[] + { + pawn, + " tried to drop ", + eq, + " at invalid cell." + })); + resultingEq = null; + return false; + } + if (primaryInt == eq) + { + primaryIntFieldInfo.SetValue(_this, null); // Changed assignment to SetValue() since we're fetching a private variable through reflection + } + Thing thing = null; + bool flag = GenThing.TryDropAndSetForbidden(eq, pos, ThingPlaceMode.Near, out thing, forbid); + resultingEq = (thing as ThingWithComps); + if (flag && resultingEq != null) + { + resultingEq.GetComp().Notify_Dropped(); + } + pawn.meleeVerbs.Notify_EquipmentLost(); + + Utility.TryUpdateInventory(pawn); // Dropped equipment, update inventory + + return flag; + } + + internal static bool TryTransferEquipmentToContainer(this Pawn_EquipmentTracker _this, ThingWithComps eq, ThingContainer container, out ThingWithComps resultingEq) + { + // Fetch private fields + Pawn pawn = (Pawn)pawnFieldInfo.GetValue(_this); + ThingWithComps primaryInt = (ThingWithComps)primaryIntFieldInfo.GetValue(_this); + + if (!_this.AllEquipment.Contains(eq)) + { + Log.Warning(pawn.LabelCap + " tried to transfer equipment he didn't have: " + eq); + resultingEq = null; + return false; + } + if (container.TryAdd(eq)) + { + resultingEq = null; + } + else + { + resultingEq = eq; + } + if (primaryInt == eq) + { + primaryIntFieldInfo.SetValue(_this, null); // Changed assignment to SetValue() since we're fetching a private variable through reflection + } + pawn.meleeVerbs.Notify_EquipmentLost(); + + Utility.TryUpdateInventory(pawn); // Equipment was stored away, update inventory + + return resultingEq == null; + } + + internal static bool TryStartAttack(this Pawn_EquipmentTracker _this, TargetInfo targ) + { + Pawn pawn = (Pawn)pawnFieldInfo.GetValue(_this); + if (pawn.stances.FullBodyBusy) + { + return false; + } + if (pawn.story != null && pawn.story.DisabledWorkTags.Contains(WorkTags.Violent)) + { + return false; + } + bool allowManualCastWeapons = !pawn.IsColonist; + Verb verb = pawn.TryGetAttackVerb(allowManualCastWeapons); + + // Check for reload before attacking + if (_this.PrimaryEq != null && verb != null && verb == _this.PrimaryEq.PrimaryVerb) + { + if (_this.Primary != null) + { + CompAmmoUser compAmmo = _this.Primary.TryGetComp(); + if (compAmmo != null) + { + if(!compAmmo.hasMagazine) + { + if (compAmmo.useAmmo && !compAmmo.hasAmmo) + return false; + } + else if(compAmmo.curMagCount <= 0) + { + compAmmo.StartReload(); + return false; + } + } + } + } + return verb != null && verb.TryStartCastOn(targ, false); + } + } +} diff --git a/Source/CombatRealism/Detours/Detours_ThingContainer.cs b/Source/CombatRealism/Detours/Detours_ThingContainer.cs new file mode 100644 index 0000000..1ad83f9 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_ThingContainer.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal static class Detours_ThingContainer + { + private static readonly FieldInfo innerListFieldInfo = typeof(ThingContainer).GetField("innerList", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly FieldInfo maxStacksFieldInfo = typeof(ThingContainer).GetField("maxStacks", BindingFlags.Instance | BindingFlags.NonPublic); + + internal static bool TryAdd(this ThingContainer _this, Thing item) + { + if (item.stackCount > _this.AvailableStackSpace) + { + Log.Error(string.Concat(new object[] + { + "Add item with stackCount=", + item.stackCount, + " with only ", + _this.AvailableStackSpace, + " in container. Splitting and adding..." + })); + return _this.TryAdd(item, _this.AvailableStackSpace); + } + + // Check if item actually fits into inventory + Pawn_InventoryTracker tracker = _this.owner as Pawn_InventoryTracker; + if (tracker != null) + { + CompInventory comp = tracker.pawn.TryGetComp(); + if (comp != null) + { + int count; + if (!comp.CanFitInInventory(item, out count)) + { + return false; + } + } + } + + List innerList = (List)innerListFieldInfo.GetValue(_this); // Fetch innerList through reflection + + SlotGroupUtility.Notify_TakingThing(item); + if (item.def.stackLimit > 1) + { + for (int i = 0; i < innerList.Count; i++) + { + if (innerList[i].def == item.def) + { + int num = item.stackCount; + if (num > _this.AvailableStackSpace) + { + num = _this.AvailableStackSpace; + } + Thing other = item.SplitOff(num); + if (!innerList[i].TryAbsorbStack(other, false)) + { + Log.Error("ThingContainer did TryAbsorbStack " + item + " but could not absorb stack."); + } + } + if (item.Destroyed) + { + Utility.TryUpdateInventory(_this.owner as Pawn_InventoryTracker); // Item has been added, notify CompInventory + return true; + } + } + } + + int maxStacks = (int)maxStacksFieldInfo.GetValue(_this); // Fetch maxStacks through reflection + + if (innerList.Count >= maxStacks) + { + return false; + } + if (item.Spawned) + { + item.DeSpawn(); + } + if (item.HasAttachment(ThingDefOf.Fire)) + { + item.GetAttachment(ThingDefOf.Fire).Destroy(DestroyMode.Vanish); + } + item.holder = _this; + innerList.Add(item); + + Utility.TryUpdateInventory(_this.owner as Pawn_InventoryTracker); // Item has been added, notify CompInventory + + return true; + } + + internal static bool TryDrop(this ThingContainer _this, Thing thing, IntVec3 dropLoc, ThingPlaceMode mode, out Thing lastResultingThing) + { + List innerList = (List)innerListFieldInfo.GetValue(_this); // Fetch innerList through reflection + + if (!innerList.Contains(thing)) + { + Log.Error(string.Concat(new object[] + { + _this.owner, + " container tried to drop ", + thing, + " which it didn't contain." + })); + lastResultingThing = null; + return false; + } + if (GenDrop.TryDropSpawn(thing, dropLoc, mode, out lastResultingThing)) + { + _this.Remove(thing); + Utility.TryUpdateInventory(_this.owner as Pawn_InventoryTracker); + return true; + } + return false; + } + + internal static bool TryDrop(this ThingContainer _this, Thing thing, IntVec3 dropLoc, ThingPlaceMode mode, int count, out Thing resultingThing) + { + if (thing.stackCount < count) + { + Log.Error(string.Concat(new object[] + { + "Tried to drop ", + count, + " of ", + thing, + " while only having ", + thing.stackCount + })); + count = thing.stackCount; + } + if (count == thing.stackCount) + { + if (GenDrop.TryDropSpawn(thing, dropLoc, mode, out resultingThing)) + { + _this.Remove(thing); + Utility.TryUpdateInventory(_this.owner as Pawn_InventoryTracker); // Thing dropped, update inventory + return true; + } + return false; + } + else + { + Thing thing2 = thing.SplitOff(count); + if (GenDrop.TryDropSpawn(thing2, dropLoc, mode, out resultingThing)) + { + Utility.TryUpdateInventory(_this.owner as Pawn_InventoryTracker); // Thing dropped, update inventory + return true; + } + thing.stackCount += thing2.stackCount; + return false; + } + } + } +} diff --git a/Assemblies/Source/CombatRealism/Combat_Realism/TooltipUtilityCR.cs b/Source/CombatRealism/Detours/Detours_TooltipUtility.cs similarity index 91% rename from Assemblies/Source/CombatRealism/Combat_Realism/TooltipUtilityCR.cs rename to Source/CombatRealism/Detours/Detours_TooltipUtility.cs index abd5b84..d76da0f 100644 --- a/Assemblies/Source/CombatRealism/Combat_Realism/TooltipUtilityCR.cs +++ b/Source/CombatRealism/Detours/Detours_TooltipUtility.cs @@ -6,11 +6,11 @@ using Verse; using UnityEngine; -namespace Combat_Realism +namespace Combat_Realism.Detours { - public static class TooltipUtilityCR + internal static class Detours_TooltipUtility { - public static string ShotCalculationTipStringCR(Thing target) + internal static string ShotCalculationTipString(Thing target) { StringBuilder stringBuilder = new StringBuilder(); if (Find.Selector.SingleSelectedThing != null) @@ -23,9 +23,9 @@ public static string ShotCalculationTipStringCR(Thing target) { stringBuilder.AppendLine(); stringBuilder.Append("ShotBy".Translate(new object[] - { - pawn.LabelBaseShort - }) + ":"); + { + pawn.LabelBaseShort + }) + ":"); if (verb_LaunchProjectile.CanHitTarget(target)) { HitReport hitReport = verb_LaunchProjectile.HitReportFor(target); diff --git a/Source/CombatRealism/Detours/Detours_TurretTop.cs b/Source/CombatRealism/Detours/Detours_TurretTop.cs new file mode 100644 index 0000000..83df325 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_TurretTop.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Reflection; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal static class Detours_TurretTop + { + // *** Turret rendering *** + + private static readonly FieldInfo parentTurretFieldInfo = typeof(TurretTop).GetField("parentTurret", BindingFlags.Instance | BindingFlags.NonPublic); + private static readonly PropertyInfo curRotationPropertyInfo = typeof(TurretTop).GetProperty("CurRotation", BindingFlags.Instance | BindingFlags.NonPublic); + + internal static void DrawTurret(this TurretTop _this) + { + Matrix4x4 matrix = default(Matrix4x4); + Vector3 vec = new Vector3(1, 1, 1); + Building_Turret parentTurret = (Building_Turret)parentTurretFieldInfo.GetValue(_this); + float curRotation = (float)curRotationPropertyInfo.GetValue(_this, null); + Material topMat = parentTurret.def.building.turretTopMat; + if (topMat.mainTexture.height >= 256 || topMat.mainTexture.width >= 256) + { + vec.x = 2; + vec.z = 2; + } + matrix.SetTRS(parentTurret.DrawPos + Altitudes.AltIncVect, curRotation.ToQuat(), vec); + Graphics.DrawMesh(MeshPool.plane20, matrix, parentTurret.def.building.turretTopMat, 0); + } + } +} diff --git a/Source/CombatRealism/Detours/Detours_VerbTracker.cs b/Source/CombatRealism/Detours/Detours_VerbTracker.cs new file mode 100644 index 0000000..93f2c73 --- /dev/null +++ b/Source/CombatRealism/Detours/Detours_VerbTracker.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using RimWorld; +using Verse; +using UnityEngine; + +namespace Combat_Realism.Detours +{ + internal static class Detours_VerbTracker + { + internal static void VerbsTick(this VerbTracker _this) + { + if (_this.AllVerbs == null) + { + return; + } + foreach (Verb verb in _this.AllVerbs) + { + verb.VerbTick(); + + // If we have a CR verb, call custom VerbTicker + Verb_LaunchProjectileCR verbCR = verb as Verb_LaunchProjectileCR; + if (verbCR != null) + verbCR.VerbTickCR(); + } + } + } +} diff --git a/Assemblies/Source/CombatRealism/Properties/AssemblyInfo.cs b/Source/CombatRealism/Properties/AssemblyInfo.cs similarity index 100% rename from Assemblies/Source/CombatRealism/Properties/AssemblyInfo.cs rename to Source/CombatRealism/Properties/AssemblyInfo.cs diff --git a/Textures/Things/Ammo/Charged/Concentrated/Concentrated_a.png b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_a.png new file mode 100644 index 0000000..353f20e Binary files /dev/null and b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_a.png differ diff --git a/Textures/Things/Ammo/Charged/Concentrated/Concentrated_b.png b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_b.png new file mode 100644 index 0000000..105085c Binary files /dev/null and b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_b.png differ diff --git a/Textures/Things/Ammo/Charged/Concentrated/Concentrated_c.png b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_c.png new file mode 100644 index 0000000..9b89a08 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Concentrated/Concentrated_c.png differ diff --git a/Textures/Things/Ammo/Charged/Ion/Ion_a.png b/Textures/Things/Ammo/Charged/Ion/Ion_a.png new file mode 100644 index 0000000..6bc03d7 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Ion/Ion_a.png differ diff --git a/Textures/Things/Ammo/Charged/Ion/Ion_b.png b/Textures/Things/Ammo/Charged/Ion/Ion_b.png new file mode 100644 index 0000000..4614973 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Ion/Ion_b.png differ diff --git a/Textures/Things/Ammo/Charged/Ion/Ion_c.png b/Textures/Things/Ammo/Charged/Ion/Ion_c.png new file mode 100644 index 0000000..090b004 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Ion/Ion_c.png differ diff --git a/Textures/Things/Ammo/Charged/Large/Large_a.png b/Textures/Things/Ammo/Charged/Large/Large_a.png new file mode 100644 index 0000000..d456f08 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Large/Large_a.png differ diff --git a/Textures/Things/Ammo/Charged/Large/Large_b.png b/Textures/Things/Ammo/Charged/Large/Large_b.png new file mode 100644 index 0000000..c56c747 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Large/Large_b.png differ diff --git a/Textures/Things/Ammo/Charged/Large/Large_c.png b/Textures/Things/Ammo/Charged/Large/Large_c.png new file mode 100644 index 0000000..83836c5 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Large/Large_c.png differ diff --git a/Textures/Things/Ammo/Charged/Regular/Regular_a.png b/Textures/Things/Ammo/Charged/Regular/Regular_a.png new file mode 100644 index 0000000..50ac9b0 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Regular/Regular_a.png differ diff --git a/Textures/Things/Ammo/Charged/Regular/Regular_b.png b/Textures/Things/Ammo/Charged/Regular/Regular_b.png new file mode 100644 index 0000000..0dece39 Binary files /dev/null and b/Textures/Things/Ammo/Charged/Regular/Regular_b.png differ diff --git a/Textures/Things/Ammo/Charged/Regular/Regular_c.png b/Textures/Things/Ammo/Charged/Regular/Regular_c.png new file mode 100644 index 0000000..e28911c Binary files /dev/null and b/Textures/Things/Ammo/Charged/Regular/Regular_c.png differ diff --git a/Textures/Things/Ammo/FuelCell/Foam/Foam_a.png b/Textures/Things/Ammo/FuelCell/Foam/Foam_a.png new file mode 100644 index 0000000..353907a Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Foam/Foam_a.png differ diff --git a/Textures/Things/Ammo/FuelCell/Foam/Foam_b.png b/Textures/Things/Ammo/FuelCell/Foam/Foam_b.png new file mode 100644 index 0000000..a7b260f Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Foam/Foam_b.png differ diff --git a/Textures/Things/Ammo/FuelCell/Foam/Foam_c.png b/Textures/Things/Ammo/FuelCell/Foam/Foam_c.png new file mode 100644 index 0000000..762c0dd Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Foam/Foam_c.png differ diff --git a/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_a.png b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_a.png new file mode 100644 index 0000000..23fd141 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_a.png differ diff --git a/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_b.png b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_b.png new file mode 100644 index 0000000..34f8bdf Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_b.png differ diff --git a/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_c.png b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_c.png new file mode 100644 index 0000000..eb3271b Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Incendiary/Incendiary_c.png differ diff --git a/Textures/Things/Ammo/FuelCell/Large/Large_a.png b/Textures/Things/Ammo/FuelCell/Large/Large_a.png new file mode 100644 index 0000000..fd17063 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Large/Large_a.png differ diff --git a/Textures/Things/Ammo/FuelCell/Large/Large_b.png b/Textures/Things/Ammo/FuelCell/Large/Large_b.png new file mode 100644 index 0000000..facfd71 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Large/Large_b.png differ diff --git a/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_a.png b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_a.png new file mode 100644 index 0000000..723558b Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_a.png differ diff --git a/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_b.png b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_b.png new file mode 100644 index 0000000..e555116 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_b.png differ diff --git a/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_c.png b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_c.png new file mode 100644 index 0000000..ebd7b67 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/Thermobaric/Thermobaric_c.png differ diff --git a/Textures/Things/Ammo/FuelCell/empty shell.png b/Textures/Things/Ammo/FuelCell/empty shell.png new file mode 100644 index 0000000..5da4619 Binary files /dev/null and b/Textures/Things/Ammo/FuelCell/empty shell.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_a.png b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_a.png new file mode 100644 index 0000000..c126eda Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_a.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_b.png b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_b.png new file mode 100644 index 0000000..5feb04d Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_b.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_c.png b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_c.png new file mode 100644 index 0000000..2fa8953 Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/EMP/EMP_c.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/HE/HE_a.png b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_a.png new file mode 100644 index 0000000..417c78b Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_a.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/HE/HE_b.png b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_b.png new file mode 100644 index 0000000..c817166 Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_b.png differ diff --git a/Textures/Things/Ammo/GrenadeLauncher/HE/HE_c.png b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_c.png new file mode 100644 index 0000000..29fee82 Binary files /dev/null and b/Textures/Things/Ammo/GrenadeLauncher/HE/HE_c.png differ diff --git a/Textures/Things/Ammo/HandGrenades/EMP/EMP_a.png b/Textures/Things/Ammo/HandGrenades/EMP/EMP_a.png new file mode 100644 index 0000000..150894c Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/EMP/EMP_a.png differ diff --git a/Textures/Things/Ammo/HandGrenades/EMP/EMP_b.png b/Textures/Things/Ammo/HandGrenades/EMP/EMP_b.png new file mode 100644 index 0000000..ac81aa1 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/EMP/EMP_b.png differ diff --git a/Textures/Things/Ammo/HandGrenades/EMP/EMP_c.png b/Textures/Things/Ammo/HandGrenades/EMP/EMP_c.png new file mode 100644 index 0000000..a98d5ff Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/EMP/EMP_c.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_a.png b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_a.png new file mode 100644 index 0000000..b6b521d Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_a.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_b.png b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_b.png new file mode 100644 index 0000000..ba565a3 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_b.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_c.png b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_c.png new file mode 100644 index 0000000..7bf9297 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Flashbang/Flashbang_c.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Frag/Frag_a.png b/Textures/Things/Ammo/HandGrenades/Frag/Frag_a.png new file mode 100644 index 0000000..d46173d Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Frag/Frag_a.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Frag/Frag_b.png b/Textures/Things/Ammo/HandGrenades/Frag/Frag_b.png new file mode 100644 index 0000000..9eb981d Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Frag/Frag_b.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Frag/Frag_c.png b/Textures/Things/Ammo/HandGrenades/Frag/Frag_c.png new file mode 100644 index 0000000..84abdcc Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Frag/Frag_c.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_a.png b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_a.png new file mode 100644 index 0000000..93e51d5 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_a.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_b.png b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_b.png new file mode 100644 index 0000000..ed94762 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_b.png differ diff --git a/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_c.png b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_c.png new file mode 100644 index 0000000..ab7d005 Binary files /dev/null and b/Textures/Things/Ammo/HandGrenades/Molotov/Molotov_c.png differ diff --git a/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_a.png b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_a.png new file mode 100644 index 0000000..e6176cd Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_a.png differ diff --git a/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_b.png b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_b.png new file mode 100644 index 0000000..6bd02f2 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_b.png differ diff --git a/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_c.png b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_c.png new file mode 100644 index 0000000..ebdf91e Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/FMJ/FMJ_c.png differ diff --git a/Textures/Things/Ammo/HighCaliber/HE/HE_a.png b/Textures/Things/Ammo/HighCaliber/HE/HE_a.png new file mode 100644 index 0000000..8db602f Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/HE/HE_a.png differ diff --git a/Textures/Things/Ammo/HighCaliber/HE/HE_b.png b/Textures/Things/Ammo/HighCaliber/HE/HE_b.png new file mode 100644 index 0000000..aba473a Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/HE/HE_b.png differ diff --git a/Textures/Things/Ammo/HighCaliber/HE/HE_c.png b/Textures/Things/Ammo/HighCaliber/HE/HE_c.png new file mode 100644 index 0000000..9a6db34 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/HE/HE_c.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_a.png b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_a.png new file mode 100644 index 0000000..7ccb18b Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_a.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_b.png b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_b.png new file mode 100644 index 0000000..08842c9 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_b.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_c.png b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_c.png new file mode 100644 index 0000000..2f1b846 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Incendiary/Incendiary_c.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_a.png b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_a.png new file mode 100644 index 0000000..65112df Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_a.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_b.png b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_b.png new file mode 100644 index 0000000..dae5266 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_b.png differ diff --git a/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_c.png b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_c.png new file mode 100644 index 0000000..0736bb1 Binary files /dev/null and b/Textures/Things/Ammo/HighCaliber/Sabot/Sabot_c.png differ diff --git a/Textures/Things/Ammo/Mortar/EMP.png b/Textures/Things/Ammo/Mortar/EMP.png new file mode 100644 index 0000000..adb0462 Binary files /dev/null and b/Textures/Things/Ammo/Mortar/EMP.png differ diff --git a/Textures/Things/Ammo/Mortar/HE.png b/Textures/Things/Ammo/Mortar/HE.png new file mode 100644 index 0000000..2725c51 Binary files /dev/null and b/Textures/Things/Ammo/Mortar/HE.png differ diff --git a/Textures/Things/Ammo/Mortar/Illumination.png b/Textures/Things/Ammo/Mortar/Illumination.png new file mode 100644 index 0000000..ac2d4a1 Binary files /dev/null and b/Textures/Things/Ammo/Mortar/Illumination.png differ diff --git a/Textures/Things/Ammo/Mortar/Incendiary.png b/Textures/Things/Ammo/Mortar/Incendiary.png new file mode 100644 index 0000000..5f3d127 Binary files /dev/null and b/Textures/Things/Ammo/Mortar/Incendiary.png differ diff --git a/Textures/Things/Ammo/Neolithic/Arrow/Arrow_a.png b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_a.png new file mode 100644 index 0000000..bde5f25 Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_a.png differ diff --git a/Textures/Things/Ammo/Neolithic/Arrow/Arrow_b.png b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_b.png new file mode 100644 index 0000000..cc89e17 Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_b.png differ diff --git a/Textures/Things/Ammo/Neolithic/Arrow/Arrow_c.png b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_c.png new file mode 100644 index 0000000..56c1520 Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Arrow/Arrow_c.png differ diff --git a/Textures/Things/Ammo/Neolithic/Pilum/Pilum_a.png b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_a.png new file mode 100644 index 0000000..73914f9 Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_a.png differ diff --git a/Textures/Things/Ammo/Neolithic/Pilum/Pilum_b.png b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_b.png new file mode 100644 index 0000000..385000b Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_b.png differ diff --git a/Textures/Things/Ammo/Neolithic/Pilum/Pilum_c.png b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_c.png new file mode 100644 index 0000000..385000b Binary files /dev/null and b/Textures/Things/Ammo/Neolithic/Pilum/Pilum_c.png differ diff --git a/Textures/Things/Ammo/Pistol/AP/AP_a.png b/Textures/Things/Ammo/Pistol/AP/AP_a.png new file mode 100644 index 0000000..1dd5b71 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/AP/AP_a.png differ diff --git a/Textures/Things/Ammo/Pistol/AP/AP_b.png b/Textures/Things/Ammo/Pistol/AP/AP_b.png new file mode 100644 index 0000000..437227b Binary files /dev/null and b/Textures/Things/Ammo/Pistol/AP/AP_b.png differ diff --git a/Textures/Things/Ammo/Pistol/AP/AP_c.png b/Textures/Things/Ammo/Pistol/AP/AP_c.png new file mode 100644 index 0000000..0f4295f Binary files /dev/null and b/Textures/Things/Ammo/Pistol/AP/AP_c.png differ diff --git a/Textures/Things/Ammo/Pistol/FMJ/FMJ_a.png b/Textures/Things/Ammo/Pistol/FMJ/FMJ_a.png new file mode 100644 index 0000000..fc9ef41 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/FMJ/FMJ_a.png differ diff --git a/Textures/Things/Ammo/Pistol/FMJ/FMJ_b.png b/Textures/Things/Ammo/Pistol/FMJ/FMJ_b.png new file mode 100644 index 0000000..4da1d04 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/FMJ/FMJ_b.png differ diff --git a/Textures/Things/Ammo/Pistol/FMJ/FMJ_c.png b/Textures/Things/Ammo/Pistol/FMJ/FMJ_c.png new file mode 100644 index 0000000..75828a3 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/FMJ/FMJ_c.png differ diff --git a/Textures/Things/Ammo/Pistol/HP/HP_a.png b/Textures/Things/Ammo/Pistol/HP/HP_a.png new file mode 100644 index 0000000..cfc1880 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/HP/HP_a.png differ diff --git a/Textures/Things/Ammo/Pistol/HP/HP_b.png b/Textures/Things/Ammo/Pistol/HP/HP_b.png new file mode 100644 index 0000000..d4b6ee3 Binary files /dev/null and b/Textures/Things/Ammo/Pistol/HP/HP_b.png differ diff --git a/Textures/Things/Ammo/Pistol/HP/HP_c.png b/Textures/Things/Ammo/Pistol/HP/HP_c.png new file mode 100644 index 0000000..5aa17dd Binary files /dev/null and b/Textures/Things/Ammo/Pistol/HP/HP_c.png differ diff --git a/Textures/Things/Ammo/RPG/HEAT/HEAT_a.png b/Textures/Things/Ammo/RPG/HEAT/HEAT_a.png new file mode 100644 index 0000000..912e381 Binary files /dev/null and b/Textures/Things/Ammo/RPG/HEAT/HEAT_a.png differ diff --git a/Textures/Things/Ammo/RPG/HEAT/HEAT_b.png b/Textures/Things/Ammo/RPG/HEAT/HEAT_b.png new file mode 100644 index 0000000..c1ef5f7 Binary files /dev/null and b/Textures/Things/Ammo/RPG/HEAT/HEAT_b.png differ diff --git a/Textures/Things/Ammo/RPG/HEAT/HEAT_c.png b/Textures/Things/Ammo/RPG/HEAT/HEAT_c.png new file mode 100644 index 0000000..c8f4d97 Binary files /dev/null and b/Textures/Things/Ammo/RPG/HEAT/HEAT_c.png differ diff --git a/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_a.png b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_a.png new file mode 100644 index 0000000..e070598 Binary files /dev/null and b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_a.png differ diff --git a/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_b.png b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_b.png new file mode 100644 index 0000000..8b766c5 Binary files /dev/null and b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_b.png differ diff --git a/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_c.png b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_c.png new file mode 100644 index 0000000..20bdd4a Binary files /dev/null and b/Textures/Things/Ammo/RPG/Thermobaric/Thermobaric_c.png differ diff --git a/Textures/Things/Ammo/Rifle/AP/AP_a.png b/Textures/Things/Ammo/Rifle/AP/AP_a.png new file mode 100644 index 0000000..f1543c4 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/AP/AP_a.png differ diff --git a/Textures/Things/Ammo/Rifle/AP/AP_b.png b/Textures/Things/Ammo/Rifle/AP/AP_b.png new file mode 100644 index 0000000..5254c6f Binary files /dev/null and b/Textures/Things/Ammo/Rifle/AP/AP_b.png differ diff --git a/Textures/Things/Ammo/Rifle/AP/AP_c.png b/Textures/Things/Ammo/Rifle/AP/AP_c.png new file mode 100644 index 0000000..6b2db24 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/AP/AP_c.png differ diff --git a/Textures/Things/Ammo/Rifle/FMJ/FMJ_a.png b/Textures/Things/Ammo/Rifle/FMJ/FMJ_a.png new file mode 100644 index 0000000..907fc37 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/FMJ/FMJ_a.png differ diff --git a/Textures/Things/Ammo/Rifle/FMJ/FMJ_b.png b/Textures/Things/Ammo/Rifle/FMJ/FMJ_b.png new file mode 100644 index 0000000..a8e940e Binary files /dev/null and b/Textures/Things/Ammo/Rifle/FMJ/FMJ_b.png differ diff --git a/Textures/Things/Ammo/Rifle/FMJ/FMJ_c.png b/Textures/Things/Ammo/Rifle/FMJ/FMJ_c.png new file mode 100644 index 0000000..225d73b Binary files /dev/null and b/Textures/Things/Ammo/Rifle/FMJ/FMJ_c.png differ diff --git a/Textures/Things/Ammo/Rifle/HP/HP_a.png b/Textures/Things/Ammo/Rifle/HP/HP_a.png new file mode 100644 index 0000000..51a79d1 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/HP/HP_a.png differ diff --git a/Textures/Things/Ammo/Rifle/HP/HP_b.png b/Textures/Things/Ammo/Rifle/HP/HP_b.png new file mode 100644 index 0000000..f982df2 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/HP/HP_b.png differ diff --git a/Textures/Things/Ammo/Rifle/HP/HP_c.png b/Textures/Things/Ammo/Rifle/HP/HP_c.png new file mode 100644 index 0000000..7f8cc44 Binary files /dev/null and b/Textures/Things/Ammo/Rifle/HP/HP_c.png differ diff --git a/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_a.png b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_a.png new file mode 100644 index 0000000..cd6d33a Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_a.png differ diff --git a/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_b.png b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_b.png new file mode 100644 index 0000000..1b149de Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_b.png differ diff --git a/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_c.png b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_c.png new file mode 100644 index 0000000..bba08d9 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Beanbag/Beanbag_c.png differ diff --git a/Textures/Things/Ammo/Shotgun/EMP/EMP_a.png b/Textures/Things/Ammo/Shotgun/EMP/EMP_a.png new file mode 100644 index 0000000..21886f2 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/EMP/EMP_a.png differ diff --git a/Textures/Things/Ammo/Shotgun/EMP/EMP_b.png b/Textures/Things/Ammo/Shotgun/EMP/EMP_b.png new file mode 100644 index 0000000..d11c890 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/EMP/EMP_b.png differ diff --git a/Textures/Things/Ammo/Shotgun/EMP/EMP_c.png b/Textures/Things/Ammo/Shotgun/EMP/EMP_c.png new file mode 100644 index 0000000..bb77103 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/EMP/EMP_c.png differ diff --git a/Textures/Things/Ammo/Shotgun/Shot/Shot_a.png b/Textures/Things/Ammo/Shotgun/Shot/Shot_a.png new file mode 100644 index 0000000..1f8d3d1 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Shot/Shot_a.png differ diff --git a/Textures/Things/Ammo/Shotgun/Shot/Shot_b.png b/Textures/Things/Ammo/Shotgun/Shot/Shot_b.png new file mode 100644 index 0000000..aa85f48 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Shot/Shot_b.png differ diff --git a/Textures/Things/Ammo/Shotgun/Shot/Shot_c.png b/Textures/Things/Ammo/Shotgun/Shot/Shot_c.png new file mode 100644 index 0000000..782b336 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Shot/Shot_c.png differ diff --git a/Textures/Things/Ammo/Shotgun/Slug/Slug_a.png b/Textures/Things/Ammo/Shotgun/Slug/Slug_a.png new file mode 100644 index 0000000..a1b39a4 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Slug/Slug_a.png differ diff --git a/Textures/Things/Ammo/Shotgun/Slug/Slug_b.png b/Textures/Things/Ammo/Shotgun/Slug/Slug_b.png new file mode 100644 index 0000000..7a7fdaa Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Slug/Slug_b.png differ diff --git a/Textures/Things/Ammo/Shotgun/Slug/Slug_c.png b/Textures/Things/Ammo/Shotgun/Slug/Slug_c.png new file mode 100644 index 0000000..96b7463 Binary files /dev/null and b/Textures/Things/Ammo/Shotgun/Slug/Slug_c.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack.png b/Textures/Things/Apparel/Backpack/Milpack.png new file mode 100644 index 0000000..b92a4b2 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Fat_back.png b/Textures/Things/Apparel/Backpack/Milpack_Fat_back.png new file mode 100644 index 0000000..383d822 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Fat_back.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Fat_front.png b/Textures/Things/Apparel/Backpack/Milpack_Fat_front.png new file mode 100644 index 0000000..12492a5 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Fat_front.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Fat_side.png b/Textures/Things/Apparel/Backpack/Milpack_Fat_side.png new file mode 100644 index 0000000..2ed5924 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Fat_side.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Female_back.png b/Textures/Things/Apparel/Backpack/Milpack_Female_back.png new file mode 100644 index 0000000..a8547eb Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Female_back.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Female_front.png b/Textures/Things/Apparel/Backpack/Milpack_Female_front.png new file mode 100644 index 0000000..394157e Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Female_front.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Female_side.png b/Textures/Things/Apparel/Backpack/Milpack_Female_side.png new file mode 100644 index 0000000..9ccdf49 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Female_side.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Hulk_back.png b/Textures/Things/Apparel/Backpack/Milpack_Hulk_back.png new file mode 100644 index 0000000..38894d5 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Hulk_back.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Hulk_front.png b/Textures/Things/Apparel/Backpack/Milpack_Hulk_front.png new file mode 100644 index 0000000..324517f Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Hulk_front.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Hulk_side.png b/Textures/Things/Apparel/Backpack/Milpack_Hulk_side.png new file mode 100644 index 0000000..a996f23 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Hulk_side.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Male_back.png b/Textures/Things/Apparel/Backpack/Milpack_Male_back.png new file mode 100644 index 0000000..01b97c2 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Male_back.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Male_front.png b/Textures/Things/Apparel/Backpack/Milpack_Male_front.png new file mode 100644 index 0000000..acb22af Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Male_front.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Male_side.png b/Textures/Things/Apparel/Backpack/Milpack_Male_side.png new file mode 100644 index 0000000..b6a2ef8 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Male_side.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Thin_back.png b/Textures/Things/Apparel/Backpack/Milpack_Thin_back.png new file mode 100644 index 0000000..a8547eb Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Thin_back.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Thin_front.png b/Textures/Things/Apparel/Backpack/Milpack_Thin_front.png new file mode 100644 index 0000000..5a8d4d8 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Thin_front.png differ diff --git a/Textures/Things/Apparel/Backpack/Milpack_Thin_side.png b/Textures/Things/Apparel/Backpack/Milpack_Thin_side.png new file mode 100644 index 0000000..dda7559 Binary files /dev/null and b/Textures/Things/Apparel/Backpack/Milpack_Thin_side.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging.png b/Textures/Things/Apparel/TacRigging/TacRigging.png new file mode 100644 index 0000000..a96d6a7 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Fat_back.png b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_back.png new file mode 100644 index 0000000..b66a7c1 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_back.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Fat_front.png b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_front.png new file mode 100644 index 0000000..05b9276 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_front.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Fat_side.png b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_side.png new file mode 100644 index 0000000..a58dbbf Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Fat_side.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Female_back.png b/Textures/Things/Apparel/TacRigging/TacRigging_Female_back.png new file mode 100644 index 0000000..6c02a8c Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Female_back.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Female_front.png b/Textures/Things/Apparel/TacRigging/TacRigging_Female_front.png new file mode 100644 index 0000000..75d7d76 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Female_front.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Female_side.png b/Textures/Things/Apparel/TacRigging/TacRigging_Female_side.png new file mode 100644 index 0000000..66f6094 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Female_side.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_back.png b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_back.png new file mode 100644 index 0000000..b66a7c1 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_back.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_front.png b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_front.png new file mode 100644 index 0000000..05b9276 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_front.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_side.png b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_side.png new file mode 100644 index 0000000..a58dbbf Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Hulk_side.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Male_back.png b/Textures/Things/Apparel/TacRigging/TacRigging_Male_back.png new file mode 100644 index 0000000..6c02a8c Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Male_back.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Male_front.png b/Textures/Things/Apparel/TacRigging/TacRigging_Male_front.png new file mode 100644 index 0000000..7122d9c Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Male_front.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Male_side.png b/Textures/Things/Apparel/TacRigging/TacRigging_Male_side.png new file mode 100644 index 0000000..66f6094 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Male_side.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Thin_back.png b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_back.png new file mode 100644 index 0000000..a7ac003 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_back.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Thin_front.png b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_front.png new file mode 100644 index 0000000..668be8d Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_front.png differ diff --git a/Textures/Things/Apparel/TacRigging/TacRigging_Thin_side.png b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_side.png new file mode 100644 index 0000000..c5dee53 Binary files /dev/null and b/Textures/Things/Apparel/TacRigging/TacRigging_Thin_side.png differ diff --git a/Textures/Things/Plant/Blazebulb/Blazebulb.png b/Textures/Things/Plant/Blazebulb/Blazebulb.png new file mode 100644 index 0000000..f5bd451 Binary files /dev/null and b/Textures/Things/Plant/Blazebulb/Blazebulb.png differ diff --git a/Textures/Things/Projectile/Charged/ChargeLanceShot.png b/Textures/Things/Projectile/Charged/ChargeLanceShot.png new file mode 100644 index 0000000..27011fa Binary files /dev/null and b/Textures/Things/Projectile/Charged/ChargeLanceShot.png differ diff --git a/Textures/Things/Projectile/Charged/Charge_concentrated.png b/Textures/Things/Projectile/Charged/Charge_concentrated.png new file mode 100644 index 0000000..ab15177 Binary files /dev/null and b/Textures/Things/Projectile/Charged/Charge_concentrated.png differ diff --git a/Textures/Things/Projectile/Charged/Charge_ion.png b/Textures/Things/Projectile/Charged/Charge_ion.png new file mode 100644 index 0000000..3be3fe2 Binary files /dev/null and b/Textures/Things/Projectile/Charged/Charge_ion.png differ diff --git a/Textures/Things/Projectile/Charged/charge_regular.png b/Textures/Things/Projectile/Charged/charge_regular.png new file mode 100644 index 0000000..9a698c0 Binary files /dev/null and b/Textures/Things/Projectile/Charged/charge_regular.png differ diff --git a/Textures/Things/Projectile/Fragment_Large.png b/Textures/Things/Projectile/Fragments/Fragment_Large.png similarity index 100% rename from Textures/Things/Projectile/Fragment_Large.png rename to Textures/Things/Projectile/Fragments/Fragment_Large.png diff --git a/Textures/Things/Projectile/Fragment_Medium.png b/Textures/Things/Projectile/Fragments/Fragment_Medium.png similarity index 100% rename from Textures/Things/Projectile/Fragment_Medium.png rename to Textures/Things/Projectile/Fragments/Fragment_Medium.png diff --git a/Textures/Things/Projectile/Fragment_Small.png b/Textures/Things/Projectile/Fragments/Fragment_Small.png similarity index 100% rename from Textures/Things/Projectile/Fragment_Small.png rename to Textures/Things/Projectile/Fragments/Fragment_Small.png diff --git a/Textures/Things/Projectile/Grenades/EMP.png b/Textures/Things/Projectile/Grenades/EMP.png new file mode 100644 index 0000000..b6b52ef Binary files /dev/null and b/Textures/Things/Projectile/Grenades/EMP.png differ diff --git a/Textures/Things/Projectile/Grenades/Flashbang.png b/Textures/Things/Projectile/Grenades/Flashbang.png new file mode 100644 index 0000000..0d6f454 Binary files /dev/null and b/Textures/Things/Projectile/Grenades/Flashbang.png differ diff --git a/Textures/Things/Projectile/Grenades/Frag.png b/Textures/Things/Projectile/Grenades/Frag.png new file mode 100644 index 0000000..5b7bd11 Binary files /dev/null and b/Textures/Things/Projectile/Grenades/Frag.png differ diff --git a/Textures/Things/Projectile/Grenades/Molotov.png b/Textures/Things/Projectile/Grenades/Molotov.png new file mode 100644 index 0000000..d074c3f Binary files /dev/null and b/Textures/Things/Projectile/Grenades/Molotov.png differ diff --git a/Textures/Things/Projectile/RPG/HEAT.png b/Textures/Things/Projectile/RPG/HEAT.png new file mode 100644 index 0000000..b81e0c1 Binary files /dev/null and b/Textures/Things/Projectile/RPG/HEAT.png differ diff --git a/Textures/Things/Projectile/RPG/Thermobaric.png b/Textures/Things/Projectile/RPG/Thermobaric.png new file mode 100644 index 0000000..47b69c8 Binary files /dev/null and b/Textures/Things/Projectile/RPG/Thermobaric.png differ diff --git a/Textures/Things/Resources/FSX/FSX_a.png b/Textures/Things/Resources/FSX/FSX_a.png new file mode 100644 index 0000000..9fc8b0a Binary files /dev/null and b/Textures/Things/Resources/FSX/FSX_a.png differ diff --git a/Textures/Things/Resources/FSX/FSX_b.png b/Textures/Things/Resources/FSX/FSX_b.png new file mode 100644 index 0000000..da30e35 Binary files /dev/null and b/Textures/Things/Resources/FSX/FSX_b.png differ diff --git a/Textures/Things/Resources/Prometheum/Prometheum_a.png b/Textures/Things/Resources/Prometheum/Prometheum_a.png new file mode 100644 index 0000000..a6160c8 Binary files /dev/null and b/Textures/Things/Resources/Prometheum/Prometheum_a.png differ diff --git a/Textures/Things/Resources/Prometheum/Prometheum_b.png b/Textures/Things/Resources/Prometheum/Prometheum_b.png new file mode 100644 index 0000000..725b30c Binary files /dev/null and b/Textures/Things/Resources/Prometheum/Prometheum_b.png differ diff --git a/Textures/UI/Buttons/HoldFire.png b/Textures/UI/Buttons/HoldFire.png new file mode 100644 index 0000000..8aaceac Binary files /dev/null and b/Textures/UI/Buttons/HoldFire.png differ diff --git a/Textures/UI/Buttons/Reload.png b/Textures/UI/Buttons/Reload.png index 68dbe76..883f1b7 100644 Binary files a/Textures/UI/Buttons/Reload.png and b/Textures/UI/Buttons/Reload.png differ diff --git a/Textures/UI/Buttons/Reload.png.bak b/Textures/UI/Buttons/Reload.png.bak new file mode 100644 index 0000000..68dbe76 Binary files /dev/null and b/Textures/UI/Buttons/Reload.png.bak differ diff --git a/Textures/UI/Buttons/SuppressFire.png b/Textures/UI/Buttons/SuppressFire.png new file mode 100644 index 0000000..7253fc2 Binary files /dev/null and b/Textures/UI/Buttons/SuppressFire.png differ diff --git a/Textures/UI/Icons/all.png b/Textures/UI/Icons/all.png new file mode 100644 index 0000000..98b002e Binary files /dev/null and b/Textures/UI/Icons/all.png differ diff --git a/Textures/UI/Icons/ammo.png b/Textures/UI/Icons/ammo.png new file mode 100644 index 0000000..07eb330 Binary files /dev/null and b/Textures/UI/Icons/ammo.png differ diff --git a/Textures/UI/Icons/ammoAdd.png b/Textures/UI/Icons/ammoAdd.png new file mode 100644 index 0000000..8033da0 Binary files /dev/null and b/Textures/UI/Icons/ammoAdd.png differ diff --git a/Textures/UI/Icons/arrowBottom.png b/Textures/UI/Icons/arrowBottom.png new file mode 100644 index 0000000..dc4bdc6 Binary files /dev/null and b/Textures/UI/Icons/arrowBottom.png differ diff --git a/Textures/UI/Icons/arrowDown.png b/Textures/UI/Icons/arrowDown.png new file mode 100644 index 0000000..68da02e Binary files /dev/null and b/Textures/UI/Icons/arrowDown.png differ diff --git a/Textures/UI/Icons/arrowTop.png b/Textures/UI/Icons/arrowTop.png new file mode 100644 index 0000000..8b22eda Binary files /dev/null and b/Textures/UI/Icons/arrowTop.png differ diff --git a/Textures/UI/Icons/arrowUp.png b/Textures/UI/Icons/arrowUp.png new file mode 100644 index 0000000..b40503b Binary files /dev/null and b/Textures/UI/Icons/arrowUp.png differ diff --git a/Textures/UI/Icons/clear.png b/Textures/UI/Icons/clear.png new file mode 100644 index 0000000..aa5d4c2 Binary files /dev/null and b/Textures/UI/Icons/clear.png differ diff --git a/Textures/UI/Icons/cog.png b/Textures/UI/Icons/cog.png new file mode 100644 index 0000000..3e35baa Binary files /dev/null and b/Textures/UI/Icons/cog.png differ diff --git a/Textures/UI/Icons/edit.png b/Textures/UI/Icons/edit.png new file mode 100644 index 0000000..70c1f37 Binary files /dev/null and b/Textures/UI/Icons/edit.png differ diff --git a/Textures/UI/Icons/melee.png b/Textures/UI/Icons/melee.png new file mode 100644 index 0000000..42c6f3d Binary files /dev/null and b/Textures/UI/Icons/melee.png differ diff --git a/Textures/UI/Icons/move.png b/Textures/UI/Icons/move.png new file mode 100644 index 0000000..56af9e7 Binary files /dev/null and b/Textures/UI/Icons/move.png differ diff --git a/Textures/UI/Icons/ranged.png b/Textures/UI/Icons/ranged.png new file mode 100644 index 0000000..dc26f27 Binary files /dev/null and b/Textures/UI/Icons/ranged.png differ diff --git a/Textures/UI/Icons/search.png b/Textures/UI/Icons/search.png new file mode 100644 index 0000000..d5b8ffc Binary files /dev/null and b/Textures/UI/Icons/search.png differ