public void setTo(ThreatItem item)
        {
            titleText.text = item.getTitle();
            if (item.threat > World.staticMap.param.person_fearLevel_terrified)
            {
                titleText.text += "\n[Terrified]";
            }
            else if (item.threat > World.staticMap.param.person_fearLevel_afraid)
            {
                titleText.text += "\n[Afraid]";
            }
            else
            {
                titleText.text += "\n[Modest Concern]";
            }
            if (item.p != null)
            {
                string t = "";

                List <string> list = item.getReasons();
                foreach (string s in list)
                {
                    t += s + "\n\n";
                }

                t += "\nTotal Threat: " + (int)(item.threat);

                mainText.text = t;
            }
            else
            {
                mainText.text = "Average Society-wide Threat Estimate:\n" + (int)(item.threat);
            }
        }
        public override void castInner(Map map, Person other)
        {
            ThreatItem item = other.threatEvaluations[0];

            foreach (Person p2 in other.society.people)
            {
                foreach (ThreatItem item2 in p2.threatEvaluations)
                {
                    if (item2.isSame(item))
                    {
                        item2.temporaryDread += map.param.ability_fearmongerTempThreat;
                    }
                }
                p2.computeThreats();
            }

            map.world.prefabStore.popImgMsg(
                "Your enthralled brings up the fear of " + item.getTitle() + ", causing the nobles of " + other.society.getName() + " to dread it, increasing threat temporarily.",
                map.world.wordStore.lookup("ABILITY_FEARMONGER"));
        }
Beispiel #3
0
        public void setTo(ThreatItem item)
        {
            titleText.text = item.getTitle();
            if (item.p != null)
            {
                string t = "";

                List <string> list = item.getReasons();
                foreach (string s in list)
                {
                    t += s + "\n\n";
                }

                t += "\nTotal Threat: " + (int)(item.threat);
                t += "\n\nResponse: " + ThreatItem.responseNames[item.responseCode];

                mainText.text = t;
            }
            else
            {
                mainText.text = "Average Society-wide Threat Estimate:\n" + (int)(item.threat);
            }
        }
Beispiel #4
0
        public override void cast(Map map, Hex hex)
        {
            base.cast(map, hex);


            ThreatItem item = hex.location.person().getGreatestThreat();

            if (item == null)
            {
                return;
            }

            string changes = "";

            foreach (Location loc in hex.location.getNeighbours())
            {
                if (loc.person() != null)
                {
                    Person other = loc.person();
                    foreach (ThreatItem t2 in other.threatEvaluations)
                    {
                        if (t2.isSame(item))
                        {
                            double delta = item.threat - t2.threat;
                            if (delta <= 0)
                            {
                                continue;
                            }
                            double liking = other.getRelation(hex.location.person()).getLiking();
                            if (liking <= 0)
                            {
                                continue;
                            }
                            liking /= 100;

                            double prev = t2.threat;
                            delta *= liking;
                            if (t2.threat + delta > 200)
                            {
                                delta = 200 - t2.threat;
                            }
                            t2.threat         += delta;
                            t2.temporaryDread += delta;

                            changes += other.getFullName() + " " + (int)(prev) + " -> " + (int)(t2.threat) + "; ";
                        }
                    }
                }
            }
            if (changes.Length > 0)
            {
                changes = changes.Substring(0, changes.Length - 2);//Strip the last separator
            }

            string msgs = "You spread " + hex.location.person().getFullName() + "'s fears of " + item.getTitle() + " to any neighbour who will listen. ";

            if (changes.Length > 0)
            {
                msgs += "\n" + changes;
            }
            else
            {
                msgs += "\nBut there are none.";
            }
            map.world.prefabStore.popImgMsg(
                msgs,
                map.world.wordStore.lookup("ABILITY_SPREAD_FEAR"));
        }
        public override void castInner(Map map, Person person)
        {
            ThreatItem item = person.getGreatestThreat();

            if (item == null)
            {
                return;
            }

            double prevThreat = item.threat;
            double addDread   = item.threat * map.param.ability_instillDreadMult;
            bool   hitCap     = false;

            if (item.threat + addDread >= 200)
            {
                hitCap      = true;
                item.threat = 200 - item.threat;//Now at 200
            }
            else
            {
                item.temporaryDread += addDread;
                item.threat         += addDread;
            }

            string msgs = "You draw upon " + person.getFullName() + "'s fears, adding to their dread of " + item.getTitle() + ". Their threat estimate has gone from "
                          + (int)(prevThreat) + " to " + (int)(item.threat) + ".";

            if (hitCap)
            {
                msgs += "\n(It is now at its maximum value)";
            }
            map.world.prefabStore.popImgMsg(
                msgs,
                map.world.wordStore.lookup("ABILITY_INSTILL_DREAD"));
        }
        public override void castInner(Map map, Person person)
        {
            ThreatItem item = person.getGreatestThreat();

            if (item == null)
            {
                return;
            }

            Society soc = person.society;
            Person  sov = soc.getSovreign();

            if (sov == null)
            {
                return;
            }
            int    nAffected = 0;
            double totalV    = 0;
            double sovFear   = 0;

            foreach (ThreatItem ti in sov.threatEvaluations)
            {
                if (item.isSame(ti))
                {
                    sovFear = ti.threat;
                    break;
                }
            }
            foreach (Person p in soc.people)
            {
                double myFear = 0;
                foreach (ThreatItem ti in p.threatEvaluations)
                {
                    if (item.isSame(ti))
                    {
                        myFear = ti.threat;
                        break;
                    }
                }

                double deltaFear = myFear - sovFear;
                if (deltaFear <= 0)
                {
                    continue;
                }

                double deltaLiking = deltaFear * map.param.ability_denounceLeaderLikingMult;
                deltaLiking = Math.Min(deltaLiking, map.param.ability_denounceLeaderMax);

                p.getRelation(sov).addLiking(-deltaLiking, "Doesn't take threat of " + item.getTitle() + " seriously", map.turn);

                nAffected += 1;
                totalV    += deltaFear;
            }

            double avrg = 0;

            if (nAffected > 0)
            {
                avrg = totalV / nAffected;
            }
            map.world.prefabStore.popImgMsg(
                "You rally the people against " + sov.getFullName() + ", denouncing them as unable to defend the people against the threat of " + item.getTitle() + ".\n" +
                nAffected + " nobles agree, with an average liking change of of " + (int)(-avrg),
                map.world.wordStore.lookup("ABILITY_DENOUNCE_LEADER"));
        }
Beispiel #7
0
        public override double computeUtility(Person voter, VoteOption option, List <ReasonMsg> msgs)
        {
            double     u = option.getBaseUtility(voter);
            ThreatItem greatestThreat = voter.getGreatestThreat();


            double ourStr = 1 + (voter.society.currentMilitary + (voter.society.maxMilitary / 2));
            double offStr = 1;
            double defStr = 1;

            if (voter.society.offensiveTarget != null)
            {
                offStr = voter.society.offensiveTarget.currentMilitary + (voter.society.offensiveTarget.maxMilitary / 2);
            }
            if (voter.society.defensiveTarget != null)
            {
                defStr = voter.society.defensiveTarget.currentMilitary + (voter.society.defensiveTarget.maxMilitary / 2);
            }

            double defUtility        = 0;
            double defGreatestThreat = 0;

            if (voter.society.defensiveTarget != null)
            {
                //Negative if we are stronger than the one we fear
                defUtility += (defStr - ourStr) / (ourStr + defStr) * voter.map.param.utility_militaryTargetRelStrengthDefensive;

                if (defUtility < -50)
                {
                    defUtility = -50;
                }

                if (greatestThreat != null)
                {
                    if (greatestThreat.group != null && greatestThreat.group.currentMilitary > voter.society.currentMilitary)
                    {
                        defGreatestThreat = World.staticMap.param.utility_greatestThreatDelta;
                        defUtility       += defGreatestThreat;
                        if (option.index == 0)
                        {
                            msgs.Add(new ReasonMsg("Our greatest threat (" + greatestThreat.group.getName() + ") is stronger than us, we must defend", defGreatestThreat));
                        }
                    }
                }
            }
            double offUtility            = 0;
            double offUtilityStr         = 0;
            double offUtilityPersonality = 0;
            double offUtilityTerritory   = 0;
            double offUtilityInstab      = 0;
            double offGreatestThreat     = 0;

            if (voter.society.offensiveTarget != null)
            {
                //Negative if the offensive target is stronger
                offUtilityStr += (ourStr - offStr) / (ourStr + offStr) * voter.map.param.utility_militaryTargetRelStrengthOffensive;
                if (voter.society.offensiveTarget is Society)
                {
                    offUtilityStr = Math.Min(offUtilityStr, voter.map.param.utility_militaryTargetRelStrengthOffensive);//Capped to prevent insanity snowballing
                }
                offUtilityPersonality += voter.getMilitarism() * voter.map.param.utility_militarism;

                //We want to expand into territory we already partially own
                bool hasOurTerritory = false;
                foreach (Location loc in voter.society.offensiveTarget.lastTurnLocs)
                {
                    if (loc.province == voter.getLocation().province)
                    {
                        hasOurTerritory = true;
                        break;
                    }
                }
                if (hasOurTerritory)
                {
                    offUtilityTerritory += society.map.param.utility_militaryTargetCompleteProvince * society.data_societalStability;
                }

                if (offUtilityStr > 0 && society.offensiveTarget is Society)
                {
                    //Counters expansion desire. Value always negative or zero
                    //u = off*stability
                    //u = off + (off*(stability-1))  (Because we are removing 1 from stability mult)
                    //If stab == 0 it's off - off
                    //If stab < 0 it's less than off
                    offUtilityInstab = offUtilityInstab * (society.data_societalStability - 1);
                }

                if (greatestThreat != null)
                {
                    if (greatestThreat.group != null && greatestThreat.group.currentMilitary < voter.society.currentMilitary)
                    {
                        offGreatestThreat += World.staticMap.param.utility_greatestThreatDelta;
                        if (option.index == 1)
                        {
                            msgs.Add(new ReasonMsg("Our greatest threat (" + greatestThreat.group.getName() + ") is weaker than us, we must attack", offGreatestThreat));
                        }
                    }
                }
                offUtility += offGreatestThreat;
                offUtility += offUtilityStr;
                offUtility += offUtilityPersonality;
                offUtility += offUtilityTerritory;
                offUtility += offUtilityInstab;
            }
            double introUtility          = 0;
            double introUtilityStability = 0;

            if (society.data_societalStability < 0.66)
            {
                introUtilityStability = -(society.data_societalStability - 1);  //0 if stability is 1, increasing to 1 if civil war is imminent, to 2 if every single person is a traitor
            }
            double introGreatestThreat = 0;

            if (greatestThreat != null)
            {
                if (greatestThreat.form == ThreatItem.formTypes.AGENTS || greatestThreat.form == ThreatItem.formTypes.ENSHADOWED_NOBLES)
                {
                    introGreatestThreat = World.staticMap.param.utility_greatestThreatDelta;
                    introUtility       += introGreatestThreat;
                    if (option.index == 2)
                    {
                        msgs.Add(new ReasonMsg("Our greatest threat (" + greatestThreat.getTitle() + ") requires internal security", introGreatestThreat));
                    }
                }
            }
            introUtilityStability *= voter.map.param.utility_introversionFromInstability;
            double introFromInnerThreat = voter.threat_enshadowedNobles.threat * voter.map.param.utility_introversionFromSuspicion;

            introUtility += introUtilityStability;
            introUtility += introFromInnerThreat;
            introUtility += 10;

            //Option 0 is DEFENSIVE
            //Option 1 is OFFENSIVE
            //Option 2 is INTROSPECTIVE
            if (voter.society.posture == Society.militaryPosture.defensive && option.index != 0)
            {
                u -= defUtility;
                msgs.Add(new ReasonMsg("Switching away from defensive", -defUtility));
            }
            if (voter.society.posture == Society.militaryPosture.offensive && option.index != 1)
            {
                u -= offUtility;
                msgs.Add(new ReasonMsg("Switching away from offensive", -offUtility));
            }
            if (voter.society.posture == Society.militaryPosture.introverted && option.index != 2)
            {
                u -= introUtility;
                msgs.Add(new ReasonMsg("Switching away from introversion", -introUtility));
            }

            if (option.index == 0)
            {
                if (society.posture != Society.militaryPosture.defensive)
                {
                    u += defUtility;
                    msgs.Add(new ReasonMsg("Our relative strength against defensive target", defUtility));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(-100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                }
                else
                {
                    u += defUtility;
                    msgs.Add(new ReasonMsg("Our relative strength against defensive target", defUtility));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(-100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                    msgs.Add(new ReasonMsg("No need to change: It is our current stance", -u));
                    u = 0;
                }
            }
            if (option.index == 1)
            {
                if (society.posture != Society.militaryPosture.offensive)
                {
                    u += offUtility;
                    msgs.Add(new ReasonMsg("Our relative strength against offensive target", offUtilityStr));
                    msgs.Add(new ReasonMsg("Risk of instability from expansion", offUtilityInstab));
                    msgs.Add(new ReasonMsg("Militarism personality", offUtilityPersonality));
                    msgs.Add(new ReasonMsg("Desire for territory", offUtilityTerritory));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                }
                else
                {
                    u += offUtility;
                    msgs.Add(new ReasonMsg("Our relative strength against offensive target", offUtilityStr));
                    msgs.Add(new ReasonMsg("Risk of instability from expansion", offUtilityInstab));
                    msgs.Add(new ReasonMsg("Militarism personality", offUtilityPersonality));
                    msgs.Add(new ReasonMsg("Desire for territory", offUtilityTerritory));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                    msgs.Add(new ReasonMsg("No need to change: It is our current stance", -u));
                    u = 0;
                }
            }
            if (option.index == 2)
            {
                msgs.Add(new ReasonMsg("Default position", 10));
                if (society.posture != Society.militaryPosture.introverted)
                {
                    u += introUtility;
                    msgs.Add(new ReasonMsg("Instability internally", introUtilityStability));
                    msgs.Add(new ReasonMsg("Suspicion of nobles' darkness", introFromInnerThreat));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(-100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                }
                else
                {
                    u += introUtility;
                    msgs.Add(new ReasonMsg("Instability internally", introUtilityStability));
                    msgs.Add(new ReasonMsg("Suspicion of nobles' darkness", introFromInnerThreat));
                    if (voter.society.isDarkEmpire)
                    {
                        int value = (int)(-100 * voter.shadow);
                        u += value;
                        msgs.Add(new ReasonMsg("We must expand the Dark Empire", value));
                    }
                    msgs.Add(new ReasonMsg("No need to change: It is our current stance", -u));
                    u = 0;
                }
            }


            return(u);
        }
        public void showPersonInfo(Person p)
        {
            uiPerson.setTo(p);

            //I'm sure there was a reason why this info assignment done in two separate classes
            //And I'm sure the reason is 'I was too lazy to do a full migration and left it till later'
            //As I am doing now

            prestigeText.text = "Prestige: " + (int)(p.prestige) + "\nPrestige Moving towards: " + (int)(p.getTargetPrestige(null));
            personShadowAndEvidenceVals.text = (int)(p.shadow * 100) + "%\n" + (int)(p.evidence * 100) + "%";


            personAwarenss.text = (int)(p.awareness * 100) + "%";
            if (p.action == null)
            {
                actionText.text = "Not Taking Action";
                actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high.";
                actionDesc.text = "\n\nThis character is not taking an action.";
            }
            else
            {
                actionText.text = p.action.getShort();
                actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high.";
                actionDesc.text = "\n\n" + p.action.getLong();
            }

            string bodyText = "";
            //if (p.getDirectSuperiorIfAny() != null)
            //{
            //    bodyText += "\nDirect Superior: " + p.getDirectSuperiorIfAny().getFullName();
            //}
            //else
            //{
            //    bodyText += "\nDirect Superior: None";
            //}
            //bodyText += "\n";
            //bodyText += "\n";
            ThreatItem threat = p.getGreatestThreat();

            if (threat != null)
            {
                bodyText += "\nBelieved Greatest Threat: " + threat.getTitle();
                bodyText += "\nFear of threat: " + (int)threat.threat;
                if (threat.threat > World.staticMap.param.person_fearLevel_terrified)
                {
                    bodyText += "\n[Terrified]";
                }
                else if (threat.threat > World.staticMap.param.person_fearLevel_afraid)
                {
                    bodyText += "\n[Afraid]";
                }
                else
                {
                    bodyText += "\n[Moderate Concern]";
                }
            }
            else
            {
                bodyText += "\nNot feeling threatened.";
            }

            personBody.text = bodyText;


            insanityText.text  = "Sanity state: " + p.madness.name;
            insanityText.text += "\nSanity: " + ((int)p.sanity) + " Maximum: " + p.maxSanity;

            insanityDescText.text = p.madness.desc + "\n\n" +
                                    "Characters have a sanity score. If this value drops to zero, they become insane, and begin to act in an erratic and dangerous manner. "
                                    + "Characters will dislike insane characters to a moderate degree, and insane characters will occasionally lash out, further reducing their relationships."
                                    + "\nYou can cause reduce sanity using certain abilities.";

            personAwarenssDesc.text = "A person's awareness is how much they have realised about the threat their world faces.\nIt allows them to take actions against the darkenss directly." +
                                      "\nSome nobles gain awareness each time you expend power, they can also gain awareness by gaining suspicion as they seen evidence, and can be warned by their fellow nobles, especially neighbours."
                                      + "\nAwareness gain can be increased by being in a place of learning, or increased or decreased by traits."
                                      + "\n\nThis noble has an awareness rate of " + (int)(100 * p.getAwarenessMult()) + "%";

            prestigeDescText.text = "";
            List <string> prestigeReasons = new List <string>();

            p.getTargetPrestige(prestigeReasons);
            foreach (string s in prestigeReasons)
            {
                prestigeDescText.text += "*" + s + "\n";
            }

            for (int i = 0; i < traits.Length; i++)
            {
                traits[i].SetActive(false);
                traitDescBoxes[i].SetActive(false);
            }
            for (int i = 0; i < p.traits.Count; i++)
            {
                traits[i].SetActive(true);
                traitNames[i].text = p.traits[i].name;
                traitDescs[i].text = p.traits[i].desc;
            }
        }
        public void showPersonInfo(Person p)
        {
            profileBack.enabled   = true;
            profileMid.enabled    = true;
            profileFore.enabled   = true;
            profileBorder.enabled = true;
            //Done to unfuck the distortion of images which periodically occurs
            profileBack.sprite   = null;
            profileMid.sprite    = null;
            profileFore.sprite   = null;
            profileBorder.sprite = null;
            profileBack.sprite   = p.getImageBack();
            profileMid.sprite    = p.getImageMid();
            profileFore.sprite   = p.getImageFore();
            if (p.society.getSovreign() == p)
            {
                profileBorder.sprite = p.map.world.textureStore.slotKing;
            }
            else if (p.titles.Count > 0)
            {
                profileBorder.sprite = p.map.world.textureStore.slotDuke;
            }
            else
            {
                profileBorder.sprite = p.map.world.textureStore.slotCount;
            }

            personTitle.text = p.getFullName();
            TitleLanded title = p.title_land;

            if (title == null)
            {
                locText.text = "No Landed Title";
            }
            else
            {
                locText.text = "of " + title.settlement.name;
            }
            string bodyText = "";

            if (p.getDirectSuperiorIfAny() != null)
            {
                bodyText += "\nDirect Superior: " + p.getDirectSuperiorIfAny().getFullName();
            }
            else
            {
                bodyText += "\nDirect Superior: None";
            }
            prestigeText.text = "Prestige: " + (int)(p.prestige) + "\nPrestige Moving towards: " + (int)(p.getTargetPrestige(null));
            bodyText         += "\nShadow: " + (int)(p.shadow * 100) + "%";
            bodyText         += "\nEvidence: " + (int)(p.evidence * 100) + "%";
            bodyText         += "\nMilitarism: " + (int)(p.politics_militarism * 100) + "%";
            bodyText         += " (" + p.getMilitarismInfo() + ")";

            bodyText += "\n";

            personAwarenss.text = (int)(p.awareness * 100) + "%";
            if (p.action == null)
            {
                actionText.text = "Not Taking Action";
                actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high.";
                actionDesc.text = "\n\nThis character is not taking an action.";
            }
            else
            {
                actionText.text = p.action.getShort();
                actionDesc.text = "Characters can take actions if they become aware and world panic is sufficiently high.";
                actionDesc.text = "\n\n" + p.action.getLong();
            }

            Society     soc  = getSociety(GraphicalMap.selectedHex);
            VoteSession vote = (soc != null) ? soc.voteSession : null;

            if (vote != null)
            {
                bodyText += "\nVoting on: " + vote.issue.ToString();

                VoteOption vo = p.getVote(vote);
                bodyText += "\n\tto " + vo.info(vote.issue);
            }
            else
            {
                bodyText += "\nNot voting.";
            }

            bodyText += "\n";

            ThreatItem threat = p.getGreatestThreat();

            if (threat != null)
            {
                bodyText += "\nBelieved Greatest Threat: " + threat.getTitle();
                bodyText += "\nFear of threat: " + (int)threat.threat;
                if (threat.threat > World.staticMap.param.person_fearLevel_terrified)
                {
                    bodyText += "\n[Terrified]";
                }
                else if (threat.threat > World.staticMap.param.person_fearLevel_afraid)
                {
                    bodyText += "\n[Afraid]";
                }
                else
                {
                    bodyText += "\n[Moderate Concern]";
                }
            }
            else
            {
                bodyText += "\nNot feeling threatened.";
            }

            personBody.text = bodyText;


            insanityText.text  = "Sanity state: " + p.madness.name;
            insanityText.text += "\nSanity: " + ((int)p.sanity) + " Maximum: " + p.maxSanity;

            insanityDescText.text = p.madness.desc + "\n\n" +
                                    "Characters have a sanity score. If this value drops to zero, they become insane, and begin to act in an erratic and dangerous manner. "
                                    + "Characters will dislike insane characters to a moderate degree, and insane characters will occasionally lash out, further reducing their relationships."
                                    + "\nYou can cause reduce sanity using certain abilities.";

            personAwarenssDesc.text = "A person's awareness is how much they have realised about the threat their world faces.\nIt allows them to take actions against the darkenss directly." +
                                      "\nSome nobles gain awareness each time you expend power, they can also gain awareness by gaining suspicion as they seen evidence, and can be warned by their fellow nobles, especially neighbours."
                                      + "\nAwareness gain can be increased by being in a place of learning, or increased or decreased by traits."
                                      + "\n\nThis noble has an awareness rate of " + (int)(100 * p.getAwarenessMult()) + "%";

            prestigeDescText.text = "";
            List <string> prestigeReasons = new List <string>();

            p.getTargetPrestige(prestigeReasons);
            foreach (string s in prestigeReasons)
            {
                prestigeDescText.text += "*" + s + "\n";
            }

            for (int i = 0; i < traits.Length; i++)
            {
                traits[i].SetActive(false);
                traitDescBoxes[i].SetActive(false);
            }
            for (int i = 0; i < p.traits.Count; i++)
            {
                traits[i].SetActive(true);
                traitNames[i].text = p.traits[i].name;
                traitDescs[i].text = p.traits[i].desc;
            }
        }
        public override void castInner(Map map, Person person)
        {
            Society soc = person.society;

            int    nAffected = 0;
            double totalV    = 0;

            foreach (Person p in soc.people)
            {
                bool       affected = false;
                ThreatItem t        = p.getGreatestThreat();
                foreach (Person p2 in soc.people)
                {
                    if (p2 == p)
                    {
                        continue;
                    }
                    if (p2.state == Person.personState.enthralled)
                    {
                        continue;
                    }
                    foreach (ThreatItem t2 in p2.threatEvaluations)
                    {
                        if (t2.isSame(t))
                        {
                            double delta = t.threat - t2.threat;
                            if (delta > 0)
                            {
                                affected = true;
                                delta   *= map.param.ability_polariseByFearMult;
                                p.getRelation(p2).addLiking(-delta, "Polarised by fear of " + t.getTitle(), map.turn);
                                totalV += delta;
                            }
                            break;
                        }
                    }
                }
                if (affected)
                {
                    nAffected += 1;
                }
            }

            double avrg = 0;

            if (nAffected > 0)
            {
                avrg = totalV / nAffected;
            }
            map.world.prefabStore.popImgMsg(
                "You turn the people of " + soc.getName() + " against each other, causing nobles to hate those who do not share their fears.\n" +
                nAffected + " nobles are affected, with an average liking change of of " + (int)(-avrg),
                map.world.wordStore.lookup("ABILITY_POLARISE_BY_FEAR"));
        }
        public void showPersonInfo(Person p)
        {
            profileBack.enabled = true;
            profileMid.enabled  = true;
            profileFore.enabled = true;
            //Done to unfuck the distortion of images which periodically occurs
            profileBack.sprite = null;
            profileMid.sprite  = null;
            profileFore.sprite = null;
            profileBack.sprite = p.getImageBack();
            profileMid.sprite  = p.getImageMid();
            profileFore.sprite = p.getImageFore();
            personTitle.text   = p.getFullName();
            TitleLanded title = p.title_land;

            if (title == null)
            {
                locText.text = "No Landed Title";
            }
            else
            {
                locText.text = "of " + title.settlement.name;
            }
            string bodyText = "Prestige: " + (int)(p.prestige);

            bodyText += "\nPrestige Moving towards: " + (int)(p.targetPrestige);
            bodyText += "\nShadow: " + (int)(p.shadow * 100) + "%";
            bodyText += "\nEvidence: " + (int)(p.evidence * 100) + "%";
            bodyText += "\nMilitarism: " + (int)(p.politics_militarism * 100) + "%";
            bodyText += " (" + p.getMilitarismInfo() + ")";

            bodyText += "\n";

            Society     soc  = getSociety(GraphicalMap.selectedHex);
            VoteSession vote = (soc != null) ? soc.voteSession : null;

            if (vote != null)
            {
                bodyText += "\nVoting on: " + vote.issue.ToString();

                VoteOption vo = p.getVote(vote);
                bodyText += "\n\tto " + vo.info(vote.issue);
            }
            else
            {
                bodyText += "\nNot voting.";
            }

            bodyText += "\n";

            ThreatItem threat = p.getGreatestThreat();

            if (threat != null)
            {
                bodyText += "\nBelieved Greatest Threat: " + threat.getTitle();
            }
            else
            {
                bodyText += "\nNot feeling threatened.";
            }

            personBody.text = bodyText;
        }