// News public void QueueNews(string blurb, string subBlurb, string outcome, bool highlight = false, MediaEventType eventType = MediaEventType.Mundane) { MediaEvent me = new MediaEvent(this, blurb, subBlurb, outcome, highlight); me.EventType = eventType; Parent.NextRoundNews.Add(me); }
public List <RoundAction> MediaActions(MediaEvent e, int mediaIndex) { List <RoundAction> actions = new List <RoundAction>(); if (Dead || InJail) { return(actions); } if (!e.Important || e.Reacted) { return(actions); } // Find what media actions can be applied to this event. for (int i = 0; i < EngineData.MediaActions.Length; i++) { GameAction a = EngineData.MediaActions[i]; if (a.CanUseAction(this, a, e)) { actions.Add(new RoundAction(this, a, i, mediaIndex) { Media = e }); } } return(actions); }
internal void BindNews(MediaEvent newsItem) { News = newsItem; LabelHeader.Content = News.Heading; LabelDescription.Content = News.SubHeading; LabelOutcome.Content = News.OutcomeText; if (newsItem.Important) { RectBackground.Fill = ImportantBrush; } }
void AddNews(GamePlayer p, MediaEvent e) { if (p == null) { return; } List <MediaEvent> playerNews; if (!RoundNews.TryGetValue(p, out playerNews)) { playerNews = new List <MediaEvent>(); RoundNews.Add(p, playerNews); } playerNews.Add(e); }
public void AttemptAssasination(double risk, GamePlayer specificTarget = null) { string[] failedOutcomes = new string[] { "Police nab would-be Assassin\nThe plot was ultimately traced back to {0}, the prosecuting attorney is hoping for a serious penalty in this case" }; if (specificTarget == null) { specificTarget = SelectRandomTarget(); } SetCriminalHeadlines(failedOutcomes); if (DidEvadeCriminalRisk(risk)) { // Success! Kill the target! specificTarget.Kill("{0} was assasinated by " + Name + " at the age of {1}", "...But nobody ever knew. It was covered up very well"); // Add "Mysterious death" news QueueNews($"Mysterious death of {specificTarget.Name}\nAuthorities say there are no signs of foul play, for this unusual death"); SetResult($"Operation was successful, {specificTarget.Name} is no more.", true); } else { string[] failedAttempts = new string[] { "The police informed {0} they captured an assassin on their property\nApparently the would-be murderer fell victim to a number of aggressive dogs in the area", "Local bar-goer narrowly evaded death\n{0} noticed his drink was a very unusual color, a toxicologist who happened to be at the bar identified the poison by scent and alerted the police" }; string failure = failedAttempts[Parent.RandomNext(0, failedAttempts.Length)]; string formattedReason = string.Format(failure, this.Name); string[] parts = formattedReason.Split('\n'); if (parts.Length < 2) { parts = new string[] { formattedReason, "Ha, the editor is on vacation and I can say whatever I want" } } ; // Spectacular failure! Inform the target that they narrowly evaded death MediaEvent me = new MediaEvent(specificTarget, parts[0], parts[1], "We found out who was behind this attempt...", true); me.InstigatingPlayer = this; me.EventType = MediaEventType.Victim; Parent.NextRoundNews.Add(me); } }
public GamePlayer PrepareSinglePlayerGame(string name = null) { if (name == null) { name = GenerateName(); } GamePlayer human = new GamePlayer(this, name, true); Players.Add(human); // Initial values for human. human.Values.Money = 10000000; human.Values.FanCount = 100000; // 100k fans human.Values.PublicSentiment = 0; // Neutral public sentiment human.Values.AffinityProfessional = 0; // Neutral affinities human.Values.AffinityMedia = 0; human.Values.AffinitySocial = 0; human.Values.AffinityCriminal = 0; for (int i = 0; i < 500; i++) { GamePlayer cpu = new GamePlayer(this, GenerateName(), false); Players.Add(cpu); cpu.BaseAge = 20 + r.NextDouble() * 40; cpu.LifeExpectancy = 50 + r.NextDouble() * 40; cpu.Values.Money = (long)(100000 * i * (r.NextDouble() + 0.8)); cpu.Values.FanCount = (int)(20000 * i * (r.NextDouble() + 0.8)); cpu.Values.PublicSentiment = r.Next(-0x5000, 0x5000); cpu.Values.AffinityProfessional = r.Next(0, 0x5000); cpu.Values.AffinityMedia = r.Next(0, 0x5000); cpu.Values.AffinitySocial = r.Next(0, 0x5000); cpu.Values.AffinityCriminal = r.Next(0, 0x5000); } // Queue some intro news for the human. MediaEvent me = new MediaEvent(human, "New star strikes out into the spotlight!", $"After {name}'s smash success last week, everyone is talking about it...", null, false); NextRoundNews.Add(me); return(human); }
public static void DeductCost(GamePlayer Player, GameAction Action, MediaEvent Media) { Player.ThisRound.Money -= Action.MoneyCost; Player.ThisRound.TimeRemaining -= Action.TimeCost; }
public static bool CanUseBase(GamePlayer Player, GameAction Action, MediaEvent Media) { return(Player.ThisRound.Money >= Action.MoneyCost && Player.ThisRound.TimeRemaining >= Action.TimeCost); }
public void SmearCampaign(double effectiveness, double risk, GamePlayer specificTarget = null) { double outcome = Parent.NextPercent(0, 1); GamePlayer Instigator = null; string[] Smears = new string[] { "Anonymous sources allege {0} has a drug problem\nOf course we can't reveal our sources, but they're probably right in our estimation", "{0} is a stalker, sources say\nBlurry footage shows {0} following someone in the dark, you can tell by the hat", "Does {0} have cancer, and are they hiding it?\nWeb denizen diagnoses {0}, claiming he can tell by \"the pixels\"" }; string outcomeString; string myoutcome = ""; if (specificTarget == null) { // Pick a random target with higher rank, or in the top 50 if we are #1 specificTarget = SelectRandomTarget(); } if (outcome < risk) { // Caught! Target will know it was you trying to smear them. Instigator = this; outcomeString = "We found out who was behind these false allegations..."; myoutcome = "Details of your involvement got out, there may be retaliation..."; FailedSmearCampaigns++; SetResult($"Oh no! {specificTarget.Name} found out we were behind the smear campaign!", false); } else { // Not caught outcomeString = "The motive for this smear campaign is unknown"; myoutcome = "The campaign was successful!"; SmearCampaigns++; SetResult($"Success! {specificTarget.Name}'s good name has been rubbed in the dirt.", true); } string smear = Smears[Parent.RandomNext(0, Smears.Length)]; string formattedReason = string.Format(smear, this.Name); string[] parts = formattedReason.Split('\n'); if (parts.Length < 2) { parts = new string[] { formattedReason, "Ha, the editor is on vacation and I can say whatever I want" } } ; specificTarget.MediaAffectPopularity(-effectiveness, 0.1); MediaEvent me = new MediaEvent(specificTarget, parts[0], parts[1], outcomeString, true); me.InstigatingPlayer = Instigator; me.EventType = MediaEventType.Smear; Parent.NextRoundNews.Add(me); // Also queue the smear to this player's feed, for reference. me = new MediaEvent(this, parts[0], parts[1], myoutcome, false); Parent.NextRoundNews.Add(me); }