diff --git a/Source/Harmony/First.cs b/Source/Harmony/First.cs index b2ec976985fd3c3b985a86aa827fd9d9f0619cef..4107a871b7196f62d51364d35003865c8b3ff9b6 100644 --- a/Source/Harmony/First.cs +++ b/Source/Harmony/First.cs @@ -253,18 +253,11 @@ namespace rjw xxx.SimpleSlaveryIsActive = true; if (RJWSettings.DevMode) Log.Message("[RJW]Unofficial Simple Slavery is detected."); } - //Simple Slavery Renewed - else if (IsLoaded("Simple Slavery[1.1] Renewed")) - { - xxx.SimpleSlaveryIsActive = true; - if (RJWSettings.DevMode) Log.Message("[RJW]Simple Slavery[1.1] Renewed."); - } else { xxx.SimpleSlaveryIsActive = false; } - //DubsBadHygiene if (IsLoaded("Dubs Bad Hygiene")) { diff --git a/Source/JobGivers/JobGiver_DoQuickie.cs b/Source/JobGivers/JobGiver_DoQuickie.cs index 54194fbd6999ab67f35c858816ae947d47ed4f43..2bfa8bc8ba5e003af32a87fff3f46286afec1fc0 100644 --- a/Source/JobGivers/JobGiver_DoQuickie.cs +++ b/Source/JobGivers/JobGiver_DoQuickie.cs @@ -11,13 +11,6 @@ namespace rjw { private const int MaxDistanceSquaredToFuck = 10000; - // List of jobs that can be interrupted by quickies. - public static readonly List<JobDef> quickieAllowedJobs = new List<JobDef> { null, JobDefOf.Wait_Wander, JobDefOf.GotoWander, JobDefOf.Clean, JobDefOf.ClearSnow, - JobDefOf.CutPlant, JobDefOf.HaulToCell, JobDefOf.Deconstruct, JobDefOf.LayDown, JobDefOf.Research, JobDefOf.SmoothFloor, JobDefOf.SmoothWall, - JobDefOf.SocialRelax, JobDefOf.StandAndBeSociallyActive, JobDefOf.RemoveApparel, JobDefOf.Strip, JobDefOf.Wait, JobDefOf.FillFermentingBarrel, - JobDefOf.Sow, JobDefOf.Shear, JobDefOf.DeliverFood, JobDefOf.Hunt, JobDefOf.Mine, JobDefOf.RearmTurret, JobDefOf.RemoveFloor, JobDefOf.RemoveRoof, - JobDefOf.Repair, JobDefOf.TakeBeerOutOfFermentingBarrel, JobDefOf.Uninstall, xxx.Masturbate_Bed}; - private static bool CanFuck(Pawn target) { return xxx.can_fuck(target) || xxx.can_be_fucked(target); @@ -106,7 +99,9 @@ namespace rjw //interruptible jobs if (target.jobs?.curJob !=null && - (target.jobs.curJob.playerForced || quickieAllowedJobs.Contains(target.jobs.curJob.def))) + (target.jobs.curJob.playerForced || + !JobDriver_WhoreInvitingVisitors.allowedJobs.Contains(target.jobs.curJob.def) + )) { if (RJWSettings.DebugLogJoinInBed) Log.Message($"[RJWQ] find_pawn_to_fuck({pawnName}): lover has important job, skipping"); continue; @@ -171,8 +166,10 @@ namespace rjw //interruptible jobs if (targetPawn.jobs?.curJob != null && - (targetPawn.jobs.curJob.playerForced || quickieAllowedJobs.Contains(targetPawn.jobs.curJob.def))) - { + (targetPawn.jobs.curJob.playerForced || + !JobDriver_WhoreInvitingVisitors.allowedJobs.Contains(targetPawn.jobs.curJob.def) + )) + { if (RJWSettings.DebugLogJoinInBed) Log.Message($"[RJWQ] FindBestPartner({pawnName}): targetPawn has important job, skipping"); continue; } diff --git a/Source/MainTab/PawnColumnCheckbox_Whore.cs b/Source/MainTab/PawnColumnCheckbox_Whore.cs deleted file mode 100644 index befbfe6ad13244f2c9baca05266864cedcafb577..0000000000000000000000000000000000000000 --- a/Source/MainTab/PawnColumnCheckbox_Whore.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Verse; -using UnityEngine; -using RimWorld; -using Verse.Sound; - -namespace rjw.MainTab -{ - public abstract class PawnColumnCheckbox_Whore : PawnColumnWorker - { - public const int HorizontalPadding = 2; - - public override void DoCell(Rect rect, Pawn pawn, PawnTable table) - { - if (!this.HasCheckbox(pawn)) - { - return; - } - int num = (int)((rect.width - 24f) / 2f); - int num2 = Mathf.Max(3, 0); - Vector2 vector = new Vector2(rect.x + (float)num, rect.y + (float)num2); - Rect rect2 = new Rect(vector.x, vector.y, 24f, 24f); - bool disabled = this.GetDisabled(pawn); - bool value; - if (disabled) - { - value = false; - } - else - { - value = this.GetValue(pawn); - } - - bool flag = value; - Vector2 topLeft = vector; - WhoreCheckbox.Checkbox(topLeft, ref value, 24f, disabled, WhoreCheckbox.WhoreCheckboxOnTex,WhoreCheckbox.WhoreCheckboxOffTex,WhoreCheckbox.WhoreCheckboxDisabledTex); - if (Mouse.IsOver(rect2)) - { - string tip = this.GetTip(pawn); - if (!tip.NullOrEmpty()) - { - TooltipHandler.TipRegion(rect2, tip); - } - } - if (value != flag) - { - this.SetValue(pawn, value); - } - } - - public override int GetMinWidth(PawnTable table) - { - return Mathf.Max(base.GetMinWidth(table), 28); - } - - public override int GetMaxWidth(PawnTable table) - { - return Mathf.Min(base.GetMaxWidth(table), this.GetMinWidth(table)); - } - - public override int GetMinCellHeight(Pawn pawn) - { - return Mathf.Max(base.GetMinCellHeight(pawn), 24); - } - - public override int Compare(Pawn a, Pawn b) - { - return this.GetValueToCompare(a).CompareTo(this.GetValueToCompare(b)); - } - - private int GetValueToCompare(Pawn pawn) - { - if (!this.HasCheckbox(pawn)) - { - return 0; - } - if (!this.GetValue(pawn)) - { - return 1; - } - return 2; - } - - protected virtual string GetTip(Pawn pawn) - { - return null; - } - - protected virtual bool HasCheckbox(Pawn pawn) - { - return true; - } - - protected abstract bool GetValue(Pawn pawn); - - protected abstract void SetValue(Pawn pawn, bool value); - - protected abstract bool GetDisabled(Pawn pawn); - - protected override void HeaderClicked(Rect headerRect, PawnTable table) - { - base.HeaderClicked(headerRect, table); - if (Event.current.shift) - { - List<Pawn> pawnsListForReading = table.PawnsListForReading; - for (int i = 0; i < pawnsListForReading.Count; i++) - { - if (this.HasCheckbox(pawnsListForReading[i])) - { - if (Event.current.button == 0) - { - if (!this.GetValue(pawnsListForReading[i])) - { - this.SetValue(pawnsListForReading[i], true); - } - } - else if (Event.current.button == 1 && this.GetValue(pawnsListForReading[i])) - { - this.SetValue(pawnsListForReading[i], false); - } - } - } - if (Event.current.button == 0) - { - SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); - } - else if (Event.current.button == 1) - { - SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); - } - } - } - - protected override string GetHeaderTip(PawnTable table) - { - return base.GetHeaderTip(table) + "\n" + "CheckboxShiftClickTip".Translate(); - } - } -} - diff --git a/Source/MainTab/PawnColumnWorker_IsWhore.cs b/Source/MainTab/PawnColumnWorker_IsWhore.cs index d9e0bfc8c92deeaa6934d3ca183712d29b53d9db..3b40586b0aa66926e49a7294ae33ddf6299b84e5 100644 --- a/Source/MainTab/PawnColumnWorker_IsWhore.cs +++ b/Source/MainTab/PawnColumnWorker_IsWhore.cs @@ -9,31 +9,14 @@ using Verse; namespace rjw.MainTab { [StaticConstructorOnStartup] - public class PawnColumnWorker_IsWhore : PawnColumnCheckbox_Whore + public class PawnColumnWorker_IsWhore : PawnColumnWorker_Icon { - protected override bool GetDisabled(Pawn pawn) - { - return !pawn.CanDesignateService(); - } - - protected override bool GetValue(Pawn pawn) - { - return pawn.IsDesignatedService() && xxx.is_human(pawn); - } - - protected override void SetValue(Pawn pawn, bool value) - { - if (value == this.GetValue(pawn)) return; - - pawn.ToggleService(); - } - /* private static readonly Texture2D serviceOn = ContentFinder<Texture2D>.Get("UI/Tab/Service_on"); private static readonly Texture2D serviceOff = ContentFinder<Texture2D>.Get("UI/Tab/Service_off"); protected override Texture2D GetIconFor(Pawn pawn) { return pawn.IsDesignatedService() ? serviceOn : null; - }*/ + } } } diff --git a/Source/MainTab/WhoreCheckbox.cs b/Source/MainTab/WhoreCheckbox.cs deleted file mode 100644 index 137941cb1d579dc3b6d4f967ab2cda29ae626257..0000000000000000000000000000000000000000 --- a/Source/MainTab/WhoreCheckbox.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Verse; -using UnityEngine; -using RimWorld; -using Verse.Sound; - -namespace rjw.MainTab -{ - [StaticConstructorOnStartup] - public static class WhoreCheckbox - { - public static readonly Texture2D WhoreCheckboxOnTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_on"); - public static readonly Texture2D WhoreCheckboxOffTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_off"); - public static readonly Texture2D WhoreCheckboxDisabledTex = ContentFinder<Texture2D>.Get("UI/Commands/Service_Refuse"); - - private static bool checkboxPainting; - private static bool checkboxPaintingState; - - public static void Checkbox(Vector2 topLeft, ref bool checkOn, float size = 24f, bool disabled = false, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) - { - WhoreCheckbox.Checkbox(topLeft.x, topLeft.y, ref checkOn, size, disabled, texChecked, texUnchecked); - } - - public static void Checkbox(float x, float y, ref bool checkOn, float size = 24f, bool disabled = false, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) - { - Rect rect = new Rect(x, y, size, size); - WhoreCheckbox.CheckboxDraw(x, y, checkOn, disabled, size, texChecked, texUnchecked,texDisabled); - if (!disabled) - { - MouseoverSounds.DoRegion(rect); - bool flag = false; - Widgets.DraggableResult draggableResult = Widgets.ButtonInvisibleDraggable(rect, false); - if (draggableResult == Widgets.DraggableResult.Pressed) - { - checkOn = !checkOn; - flag = true; - } - else if (draggableResult == Widgets.DraggableResult.Dragged) - { - checkOn = !checkOn; - flag = true; - WhoreCheckbox.checkboxPainting = true; - WhoreCheckbox.checkboxPaintingState = checkOn; - } - if (Mouse.IsOver(rect) && WhoreCheckbox.checkboxPainting && Input.GetMouseButton(0) && checkOn != WhoreCheckbox.checkboxPaintingState) - { - checkOn = WhoreCheckbox.checkboxPaintingState; - flag = true; - } - if (flag) - { - if (checkOn) - { - SoundDefOf.Checkbox_TurnedOn.PlayOneShotOnCamera(null); - } - else - { - SoundDefOf.Checkbox_TurnedOff.PlayOneShotOnCamera(null); - } - } - } - } - - private static void CheckboxDraw(float x, float y, bool active, bool disabled, float size = 24f, Texture2D texChecked = null, Texture2D texUnchecked = null, Texture2D texDisabled = null) - { - Texture2D image; - if (disabled) - { - image = ((!(texDisabled != null)) ? WhoreCheckbox.WhoreCheckboxDisabledTex : texDisabled); - } - else if (active) - { - image = ((!(texChecked != null)) ? WhoreCheckbox.WhoreCheckboxOnTex : texChecked); - } - else - { - image = ((!(texUnchecked != null)) ? WhoreCheckbox.WhoreCheckboxOffTex : texUnchecked); - } - Rect position = new Rect(x, y, size, size); - GUI.DrawTexture(position, image); - } - - } -} diff --git a/Source/Modules/Whoring/Whoring_Helper.cs b/Source/Modules/Whoring/Whoring_Helper.cs index 9fd7ac7867e14eaf3255a0df20ee18371298d90d..aa5f506b24c68a52a68981670281f2fc7b816464 100644 --- a/Source/Modules/Whoring/Whoring_Helper.cs +++ b/Source/Modules/Whoring/Whoring_Helper.cs @@ -308,7 +308,7 @@ namespace rjw num *= 0.8f + ((float)whore.skills.GetSkill(SkillDefOf.Social).Level / 40); // 0.8 to 1.3 num *= Mathf.InverseLerp(-100f, 0f, target.relations.OpinionOf(whore)); // 1 to 0 reduce score by negative opinion/relations to whore - Log.Message("IsHookupAppealing - score: " + num); + //Log.Message("IsHookupAppealing - score: " + num); //Rand.PopState(); //Rand.PushState(RJW_Multiplayer.PredictableSeed()); return Rand.Range(0.05f, 1f) < num;