diff --git a/1.4/Assemblies/RimJobWorldWhoring.dll b/1.4/Assemblies/RimJobWorldWhoring.dll index 3028e50..af89fa2 100644 Binary files a/1.4/Assemblies/RimJobWorldWhoring.dll and b/1.4/Assemblies/RimJobWorldWhoring.dll differ diff --git a/1.4/Defs/JobDefs/Jobs_Whoring.xml b/1.4/Defs/JobDefs/Jobs_Whoring.xml index 60eedda..d3e6bed 100644 --- a/1.4/Defs/JobDefs/Jobs_Whoring.xml +++ b/1.4/Defs/JobDefs/Jobs_Whoring.xml @@ -4,14 +4,14 @@ WhoreIsServingVisitors rjwwhoring.JobDriver_WhoreIsServingVisitors - servicing TargetA. + serving visitors false WhoreInvitingVisitors rjwwhoring.JobDriver_WhoreInvitingVisitors - soliciting TargetA. + attempting hookup false \ No newline at end of file diff --git a/1.4/Defs/WhoringTab/PawnColumnDefs/PawnColumns.xml b/1.4/Defs/WhoringTab/PawnColumnDefs/PawnColumns.xml index d6fe0fb..63985a5 100644 --- a/1.4/Defs/WhoringTab/PawnColumnDefs/PawnColumns.xml +++ b/1.4/Defs/WhoringTab/PawnColumnDefs/PawnColumns.xml @@ -49,11 +49,4 @@ rjwwhoring.MainTab.PawnColumnWorker_Mood 100 - - RJW_WhoringPolicy - Trade sex for benefits - - rjwwhoring.MainTab.PawnColumnWorker_WhoringPolicy - 100 - diff --git a/1.4/Defs/WhoringTab/PawnTableDefs.xml b/1.4/Defs/WhoringTab/PawnTableDefs.xml index af172f9..f321b97 100644 --- a/1.4/Defs/WhoringTab/PawnTableDefs.xml +++ b/1.4/Defs/WhoringTab/PawnTableDefs.xml @@ -21,7 +21,6 @@
  • RJW_EarnedMoneyByWhore
  • RJW_AverageMoneyByWhore
  • RJW_PriceRangeOfWhore
  • -
  • RJW_WhoringPolicy
  • RemainingSpace
  • diff --git a/1.4/Languages/English/Keyed/Whoring.xml b/1.4/Languages/English/Keyed/Whoring.xml index e86e4f0..401855b 100644 --- a/1.4/Languages/English/Keyed/Whoring.xml +++ b/1.4/Languages/English/Keyed/Whoring.xml @@ -24,7 +24,7 @@ Assign to whorin' diff --git a/1.4/Source/Mod/Data/DataStore.cs b/1.4/Source/Mod/Data/DataStore.cs index 8241197..1f3566b 100644 --- a/1.4/Source/Mod/Data/DataStore.cs +++ b/1.4/Source/Mod/Data/DataStore.cs @@ -11,7 +11,6 @@ namespace rjwwhoring public class DataStore : WorldComponent { public Dictionary bedData = new Dictionary(); - public Dictionary whoringData = new Dictionary(); public DataStore(World world) : base(world) { @@ -22,16 +21,13 @@ namespace rjwwhoring if (Scribe.mode == LoadSaveMode.Saving) { bedData.RemoveAll(item => item.Value == null || !item.Value.IsValid); - whoringData.RemoveAll(item => item.Value == null || !item.Value.IsValid); } base.ExposeData(); Scribe_Collections.Look(ref bedData, "BedData", LookMode.Value, LookMode.Deep); - Scribe_Collections.Look(ref whoringData, "WhoringData", LookMode.Value, LookMode.Deep); if (Scribe.mode == LoadSaveMode.LoadingVars) { if (bedData == null) bedData = new Dictionary(); - if (whoringData == null) whoringData = new Dictionary(); } } @@ -50,21 +46,5 @@ namespace rjwwhoring } return res; } - - public WhoringData GetWhoringData(Pawn pawn) - { - WhoringData res; - var filled = whoringData.TryGetValue(pawn.thingIDNumber, out res); - if ((res == null) || (!res.IsValid)) - { - if (filled) - { - whoringData.Remove(pawn.thingIDNumber); - } - res = new WhoringData(pawn); - whoringData.Add(pawn.thingIDNumber, res); - } - return res; - } } } \ No newline at end of file diff --git a/1.4/Source/Mod/Data/PawnExtensions.cs b/1.4/Source/Mod/Data/PawnExtensions.cs deleted file mode 100644 index 479ca2e..0000000 --- a/1.4/Source/Mod/Data/PawnExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using RimWorld; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Verse; - -namespace rjwwhoring -{ - public static class PawnExtensions - { - public static WhoringData WhoringData(this Pawn pawn) - { - return WhoringBase.DataStore.GetWhoringData(pawn); - } - } -} diff --git a/1.4/Source/Mod/Data/WhoringData.cs b/1.4/Source/Mod/Data/WhoringData.cs deleted file mode 100644 index b113bb6..0000000 --- a/1.4/Source/Mod/Data/WhoringData.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using Verse; -using System.Linq; -using RimWorld; -using static rjw.xxx; -using System.Collections.ObjectModel; - -namespace rjwwhoring -{ - public class WhoringData : IExposable - { - public Pawn pawn; - public bool allowedForWhoringOwner = true; - public bool allowedForWhoringAll = false; - public int reservedForPawnID = 0; - - public WhoringType WhoringPolicy = WhoringType.Silver; - public enum WhoringType { Silver, Goodwill }; - - public WhoringData() { } - public WhoringData(Pawn pawn) - { - this.pawn = pawn; - } - - public void ExposeData() - { - Scribe_References.Look(ref pawn, "pawn"); - Scribe_Values.Look(ref WhoringPolicy, "WhoringPolicy", WhoringType.Silver, true); - Scribe_Values.Look(ref allowedForWhoringOwner, "allowedForWhoringOwner", true, true); - Scribe_Values.Look(ref allowedForWhoringAll, "allowedForWhoringAll", false, true); - } - - public bool IsValid { get { return pawn != null; } } - } -} diff --git a/1.4/Source/Mod/JobDrivers/JobDriver_WhoreIsServingVisitors.cs b/1.4/Source/Mod/JobDrivers/JobDriver_WhoreIsServingVisitors.cs index 5b5683d..ecd45d2 100644 --- a/1.4/Source/Mod/JobDrivers/JobDriver_WhoreIsServingVisitors.cs +++ b/1.4/Source/Mod/JobDrivers/JobDriver_WhoreIsServingVisitors.cs @@ -143,34 +143,26 @@ namespace rjwwhoring if (!(Partner.IsColonist && (pawn.IsPrisonerOfColony || pawn.IsColonist))) { - if (pawn.WhoringData().WhoringPolicy == WhoringData.WhoringType.Silver) + int netPrice = (int) (basePrice * bedMult); + if (netPrice == 0) + netPrice += 1; + + int bedTip = netPrice - basePrice; + int defect = WhoringHelper.PayPriceToWhore(Partner, netPrice, pawn); + + if (WhoringBase.DebugWhoring) { - int netPrice = (int) (basePrice * bedMult); - if (netPrice == 0) - netPrice += 1; - - int bedTip = netPrice - basePrice; - int defect = WhoringHelper.PayPriceToWhore(Partner, netPrice, pawn); - - if (WhoringBase.DebugWhoring) - { - ModLog.Message($"{GetType()}:afterSex toil - {Partner} tried to pay {basePrice}(whore price) + {bedTip}(room modifier) silver to {pawn}"); + ModLog.Message($"{GetType()}:afterSex toil - {Partner} tried to pay {basePrice}(whore price) + {bedTip}(room modifier) silver to {pawn}"); - if (defect <= 0) - ModLog.Message(" Paid full price"); - else if (defect <= bedTip) - ModLog.Message(" Could not pay full tip"); - else - ModLog.Message(" Failed to pay base price"); - } - WhoringHelper.UpdateRecords(pawn, netPrice - defect); - } - else - { - int bedTip = 1; - ModLog.Message($"{GetType()}:afterSex toil - {Partner} tried to pay {bedTip} goodwill to {pawn}"); - WhoringHelper.PayRespectToWhore(Partner, bedTip, pawn); + if (defect <= 0) + ModLog.Message(" Paid full price"); + else if (defect <= bedTip) + ModLog.Message(" Could not pay full tip"); + else + ModLog.Message(" Failed to pay base price"); } + + WhoringHelper.UpdateRecords(pawn, netPrice - defect); } if (SexUtility.ConsiderCleaning(pawn)) diff --git a/1.4/Source/Mod/JobGivers/JobGiver_WhoreInvitingVisitors.cs b/1.4/Source/Mod/JobGivers/JobGiver_WhoreInvitingVisitors.cs index f6c9a3b..c438e29 100644 --- a/1.4/Source/Mod/JobGivers/JobGiver_WhoreInvitingVisitors.cs +++ b/1.4/Source/Mod/JobGivers/JobGiver_WhoreInvitingVisitors.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using HugsLib.Utils; using RimWorld; using rjw; using Verse; @@ -19,23 +18,6 @@ namespace rjwwhoring return val == null ? false : true; } - public static Thought_Memory GetMemory(Pawn pawn, Pawn target, ThoughtDef thought) - { - Thought_Memory val = pawn.needs.mood.thoughts.memories.Memories.Find( - (Thought_Memory x) => - { - if (x.def != thought) - return false; - - if (x.otherPawn == null || x.otherPawn != target) - return false; - - return true; - } - ); - return val; - } - //[SyncMethod] private static bool Roll_to_skip(Pawn client, Pawn whore) { @@ -150,8 +132,7 @@ namespace rjwwhoring && !x.IsPrisoner && !xxx.is_slave(x) && !x.IsColonist - //&& (!x.IsColonist || x.guest?.GuestStatus == GuestStatus.Guest) - && x.Position.DistanceTo(pos) < 100 + && x.Position.DistanceTo(pos) < 100 && xxx.is_healthy_enough(x)); @@ -165,7 +146,6 @@ namespace rjwwhoring if (!potentialClients.Any()) return null; if (WhoringBase.DebugWhoring) ModLog.Message($" FindAttractivePawn number of all potential clients {potentialClients.Count()}"); - //if (WhoringBase.DebugWhoring) ModLog.Message($" FindAttractivePawn number of all potential clients {potentialClients.ListElements()}"); List valid_targets = new List(); @@ -185,12 +165,11 @@ namespace rjwwhoring } if (WhoringBase.DebugWhoring) ModLog.Message($" number of reachable clients {valid_targets.Count()}"); - //if (WhoringBase.DebugWhoring) ModLog.Message($" number of reachable clients {valid_targets.ListElements()}"); //IEnumerable guestsSpawned = valid_targets.Where(x => x.Faction != whore.Faction // && WhoringHelper.CanAfford(x, whore, priceOfWhore)); - + //if (RJWSettings.DebugWhoring) ModLog.Message($" number of clients can afford {guestsSpawned.Count()}"); //guestsSpawned = valid_targets.Where(x => x.Faction != whore.Faction @@ -202,29 +181,10 @@ namespace rjwwhoring //if (RJWSettings.DebugWhoring) ModLog.Message($" number of clients can memory OK {guestsSpawned.Count()}"); - List guestsSpawned = new List(); - - foreach(Pawn x in valid_targets) - { - bool canAfford = WhoringHelper.CanAfford(x, whore, priceOfWhore); - Thought_Memory refusedMmeory = GetMemory(x, whore, ThoughtDef.Named("RJWFailedSolicitation")); - bool refused = refusedMmeory != null; - DirectPawnRelation relationship = LovePartnerRelationUtility.ExistingLoveRealtionshipBetween(whore, x); - bool relation = relationship != null; - bool differentFaction = x.Faction != whore.Faction; - - bool finalResult = canAfford && !refused && !relation && differentFaction; - - if (WhoringBase.DebugWhoring) - { - ModLog.Message($"Pawn {x.Name} is an {(finalResult ? "acceptable" : "unacceptable")} client for {whore.Name}. Explanation: canAfford {canAfford.ToString()} refused: {refused.ToString()} relation: {relation.ToString()} differentFaction: {differentFaction.ToString()}"); - } - - if (canAfford && !refused && !relation && differentFaction) - guestsSpawned.Add(x); - - } - + IEnumerable guestsSpawned = valid_targets.Where(x => x.Faction != whore.Faction + && !MemoryChecker(x, ThoughtDef.Named("RJWFailedSolicitation")) + && WhoringHelper.CanAfford(x, whore, priceOfWhore) + && x != LovePartnerRelationUtility.ExistingLovePartner(whore)); if (guestsSpawned.Any()) { diff --git a/1.4/Source/Mod/Whoring.csproj b/1.4/Source/Mod/Whoring.csproj index f115507..b213640 100644 --- a/1.4/Source/Mod/Whoring.csproj +++ b/1.4/Source/Mod/Whoring.csproj @@ -78,7 +78,6 @@ - @@ -87,8 +86,6 @@ - - @@ -98,7 +95,6 @@ - diff --git a/1.4/Source/Mod/WhoringTab/PawnColumnWorker_PriceRangeOfWhore.cs b/1.4/Source/Mod/WhoringTab/PawnColumnWorker_PriceRangeOfWhore.cs index 892a249..220713b 100644 --- a/1.4/Source/Mod/WhoringTab/PawnColumnWorker_PriceRangeOfWhore.cs +++ b/1.4/Source/Mod/WhoringTab/PawnColumnWorker_PriceRangeOfWhore.cs @@ -16,16 +16,8 @@ namespace rjwwhoring.MainTab protected override string GetTextFor(Pawn pawn) { - if (pawn.WhoringData().WhoringPolicy == WhoringData.WhoringType.Silver) - { - min = WhoringHelper.WhoreMinPrice(pawn); - max = WhoringHelper.WhoreMaxPrice(pawn); - } - else - { - min = 1; - max = 1; - } + min = WhoringHelper.WhoreMinPrice(pawn); + max = WhoringHelper.WhoreMaxPrice(pawn); return string.Format("{0} - {1}", min, max); } @@ -36,30 +28,23 @@ namespace rjwwhoring.MainTab protected override string GetTip(Pawn pawn) { - if (pawn.WhoringData().WhoringPolicy == WhoringData.WhoringType.Silver) - { - string minPriceTip = string.Format( - " Base: {0}\n Traits: {1}", - WhoringHelper.baseMinPrice, - (WhoringHelper.WhoreTraitAdjustmentMin(pawn) - 1f).ToStringPercent() - ); - string maxPriceTip = string.Format( - " Base: {0}\n Traits: {1}", - WhoringHelper.baseMaxPrice, - (WhoringHelper.WhoreTraitAdjustmentMax(pawn) - 1f).ToStringPercent() - ); - string bothTip = string.Format( - " Gender: {0}\n Age: {1}\n Injuries: {2}", - (WhoringHelper.WhoreGenderAdjustment(pawn) - 1f).ToStringPercent(), - (WhoringHelper.WhoreAgeAdjustment(pawn) - 1f).ToStringPercent(), - (WhoringHelper.WhoreInjuryAdjustment(pawn) - 1f).ToStringPercent() - ); - return string.Format("Min:\n{0}\nMax:\n{1}\nBoth:\n{2}", minPriceTip, maxPriceTip, bothTip); - } - else - { - return string.Format("Raise Goodwill by 1"); - } + string minPriceTip = string.Format( + " Base: {0}\n Traits: {1}", + WhoringHelper.baseMinPrice, + (WhoringHelper.WhoreTraitAdjustmentMin(pawn) -1f).ToStringPercent() + ); + string maxPriceTip = string.Format( + " Base: {0}\n Traits: {1}", + WhoringHelper.baseMaxPrice, + (WhoringHelper.WhoreTraitAdjustmentMax(pawn) -1f).ToStringPercent() + ); + string bothTip = string.Format( + " Gender: {0}\n Age: {1}\n Injuries: {2}", + (WhoringHelper.WhoreGenderAdjustment(pawn) - 1f).ToStringPercent(), + (WhoringHelper.WhoreAgeAdjustment(pawn) - 1f).ToStringPercent(), + (WhoringHelper.WhoreInjuryAdjustment(pawn) - 1f).ToStringPercent() + ); + return string.Format("Min:\n{0}\nMax:\n{1}\nBoth:\n{2}", minPriceTip, maxPriceTip, bothTip); } private int GetValueToCompare(Pawn pawn) diff --git a/1.4/Source/Mod/WhoringTab/PawnColumnWorker_WhoringPolicy.cs b/1.4/Source/Mod/WhoringTab/PawnColumnWorker_WhoringPolicy.cs deleted file mode 100644 index 392bea7..0000000 --- a/1.4/Source/Mod/WhoringTab/PawnColumnWorker_WhoringPolicy.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using RimWorld; -using RimWorld.Planet; -using UnityEngine; -using Verse; -using Verse.Sound; - -namespace rjwwhoring.MainTab -{ - [StaticConstructorOnStartup] - public class PawnColumnWorker_WhoringPolicy : PawnColumnWorker - { - public override void DoCell(Rect rect, Pawn pawn, PawnTable table) - { - if (pawn.drugs != null) - { - WhoringPolicyUIUtility.DoAssignWhoringPolicyButtons(rect, pawn); - } - } - } -} diff --git a/1.4/Source/Mod/WhoringTab/WhoringPolicyUIUtility.cs b/1.4/Source/Mod/WhoringTab/WhoringPolicyUIUtility.cs deleted file mode 100644 index a5af8cc..0000000 --- a/1.4/Source/Mod/WhoringTab/WhoringPolicyUIUtility.cs +++ /dev/null @@ -1,45 +0,0 @@ -using RimWorld; -using System; -using System.Collections.Generic; -using UnityEngine; -using Verse; - -namespace rjwwhoring -{ - public static class WhoringPolicyUIUtility - { - //public const string AssigningDrugsTutorHighlightTag = "ButtonAssignDrugs"; - - public static void DoAssignWhoringPolicyButtons(Rect rect, Pawn pawn) - { - int num = Mathf.FloorToInt(rect.width); - float x = rect.x; - Rect rect2 = new Rect(x, rect.y + 2f, num, rect.height - 4f); - string text = pawn.WhoringData().WhoringPolicy.ToStringSafe(); - - Widgets.Dropdown(rect2, pawn, (Pawn p) => p.WhoringData().WhoringPolicy, Button_GenerateMenu, text.Truncate(rect2.width), paintable: true); - //Widgets.Dropdown(rect2, pawn, (Pawn p) => p.drugs.CurrentPolicy, Button_GenerateMenu, text.Truncate(((Rect)(ref rect2)).get_width()), null, pawn.drugs.CurrentPolicy.label, null, delegate - //{ - // PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.DrugPolicies, KnowledgeAmount.Total); - //}, paintable: true); - x += num; - x += 4f; - //UIHighlighter.HighlightOpportunity(rect2, "ButtonAssignDrugs"); - } - - private static IEnumerable> Button_GenerateMenu(Pawn pawn) - { - foreach (WhoringData.WhoringType option in Enum.GetValues(typeof(WhoringData.WhoringType))) - { - yield return new Widgets.DropdownMenuElement - { - option = new FloatMenuOption(option.ToString(), delegate - { - pawn.WhoringData().WhoringPolicy = option; - }), - payload = option - }; - } - } - } -} diff --git a/1.4/Source/Mod/Whoring_Helper.cs b/1.4/Source/Mod/Whoring_Helper.cs index 72739eb..d313a98 100644 --- a/1.4/Source/Mod/Whoring_Helper.cs +++ b/1.4/Source/Mod/Whoring_Helper.cs @@ -188,8 +188,6 @@ namespace rjwwhoring public static bool CanAfford(Pawn targetPawn, Pawn whore, int priceOfWhore = -1) { //if (targetPawn.Faction == whore.Faction) return true; - if (whore.WhoringData().WhoringPolicy == WhoringData.WhoringType.Goodwill) return true; - if (WhoringBase.MoneyPrinting) return true; //if (RJWSettings.DebugWhoring) ModLog.Message($"CanAfford for client {xxx.get_pawnname(targetPawn)}"); @@ -312,19 +310,6 @@ namespace rjwwhoring return AmountLeft; } - public static int PayRespectToWhore(Pawn targetPawn, int priceOfWhore, Pawn whore) - { - if ((targetPawn.Faction != whore.Faction && targetPawn.GuestStatus != GuestStatus.Guest)) - { - if (WhoringBase.DebugWhoring) ModLog.Message($" No need to pay respect"); - return 0; - } - targetPawn.Faction.TryAffectGoodwillWith(Faction.OfPlayer, priceOfWhore); - if (WhoringBase.DebugWhoring) ModLog.Message($" price: {priceOfWhore}, paid: {priceOfWhore}"); - - return priceOfWhore; - } - //[SyncMethod] public static bool IsHookupAppealing(Pawn target, Pawn whore) { diff --git a/1.4/Source/Mod/harmony_Building_BedPatches.cs b/1.4/Source/Mod/harmony_Building_BedPatches.cs index 78a1794..852b633 100644 --- a/1.4/Source/Mod/harmony_Building_BedPatches.cs +++ b/1.4/Source/Mod/harmony_Building_BedPatches.cs @@ -10,7 +10,7 @@ using rjw; /// /// patches Building_Bed to add stuff for WhoreBeds /// -/// Also contains smaller patches for RoomRoleWorker_Barracks (don't count whore beds) (disabled), Toils_LayDown.ApplyBedThoughts (slept in brothel thought) and RestUtility (don't automatically claim brothel beds) +/// Also contains smaller patches for RoomRoleWorker_Barracks (don't count whore beds) (disabled) and Toils_LayDown.ApplyBedThoughts (slept in brothel thought) /// namespace rjwwhoring @@ -288,29 +288,5 @@ namespace rjwwhoring } } } - - /// - ///Prevents automatic claiming of brothel beds (beds that allow anyone to use for whoring) - ///Note, that intent is not verified here, and this works because bed usage for actual whoring does not rely on IsValidBedFor call. - ///Should above change in future, this patch needs to be removed or adjusted - ///If the bed is already claimed (for example - assigned manually to pawn), it will still be used. - ///Modifies __result to false, if bed is set to allow anyone for whroing AND is not already claimed. - /// - [HarmonyPatch(typeof(RestUtility), nameof(RestUtility.IsValidBedFor))] - public class RestUtility_IsValidBedFor_Patch - { - [HarmonyPostfix] - public static void Postfix(Pawn sleeper, Thing bedThing, ref bool __result) - { - if (!__result) return; - Building_Bed building_Bed = bedThing as Building_Bed; - bool isOwner = sleeper.ownership != null && sleeper.ownership.OwnedBed == bedThing; - if (building_Bed.IsAllowedForWhoringAll() && !isOwner ) __result = false; - - } - - - } - - } + } } \ No newline at end of file diff --git a/About/Manifest.xml b/About/Manifest.xml index 3070f97..98de210 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RimJobWorld Whoring - 1.0.6 + 1.0.2
  • RimJobWorld