public override ObjectPicker.ColumnInfo GetValue(SimDescription sim) { int price = 0; KamaSimtra skill = sim.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill != null) { price = skill.GetPayment() * 2; } return(new ObjectPicker.TextColumn(EAText.GetMoneyString(price))); }
public override bool Run() { SimDescription hooker = null; Definition def = base.InteractionDefinition as Definition; if (def == null) { return(false); } try { StandardEntry(); if (!Target.StartComputing(this, SurfaceHeight.Table, true)) { StandardExit(); return(false); } Target.StartVideo(Computer.VideoType.Chat); base.AnimateSim("GenericTyping"); bool succeeded = true; if (base.DoTimedLoop(Computer.CheckWeather.kTimeToBrowse, ~(ExitReason.Replan | ExitReason.PlayIdle | ExitReason.ObjectStateChanged | ExitReason.MidRoutePushRequested | ExitReason.MaxSkillPointsReached | ExitReason.BuffFailureState | ExitReason.MoodFailure))) { Dictionary <int, SimDescription> potentials = GetPotentials(Actor); if (potentials.Values.Count > 0) { if (!def.mRandom) { hooker = new SimSelection(Common.Localize("OrderServices:Title"), Actor.SimDescription, potentials.Values, SimSelection.Type.ProfessionalServices, -1000).SelectSingle(); if (hooker == null) { Common.Notify(Common.Localize("Rendezvous:NoSelect", Actor.IsFemale)); succeeded = false; } } else { int val = 0; if (Actor.IsSelectable) { string text = StringInputDialog.Show(Common.Localize("OrderServices:Title"), Common.Localize("OrderServices:Prompt"), val.ToString()); if (string.IsNullOrEmpty(text)) { succeeded = false; } if (!int.TryParse(text, out val)) { SimpleMessageDialog.Show(Common.Localize("OrderServices:Title"), Common.Localize("Numeric:Error")); succeeded = false; } } else { val = Actor.FamilyFunds * 2 / 100; } if (val > Actor.FamilyFunds || val < Actor.FamilyFunds) { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:NoFunds", Actor.IsFemale)); } succeeded = false; } if (succeeded) { // how much sexy can we afford? bool allAbove = false; foreach (SimDescription sim in potentials.Values) { KamaSimtra skill = sim.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid); if (skill == null) { continue; } if (skill.GetPayment() > Actor.FamilyFunds) { allAbove = true; } else { allAbove = false; } if (skill.GetPayment() > val) { continue; } hooker = sim; } if (hooker == null) { if (!allAbove) { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:StopBeingCheap")); } succeeded = false; } else { if (Actor.IsSelectable) { Common.Notify(Common.Localize("OrderServices:NoFunds", Actor.IsFemale)); } succeeded = false; } } } } } else { Common.Notify(Common.Localize("OrderServices:NoChoices", Actor.IsFemale)); succeeded = false; } } if (succeeded && hooker != null) { GetSimToLotEx(hooker, Actor.LotHome, def.mRandom); } Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); StandardExit(); return(succeeded); } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(Actor, Target, e); return(false); } }