public VoteOption getVote(VoteSession voteSession)
        {
            double     highestWeight = 0;
            VoteOption bestChoice    = null;

            foreach (VoteOption option in voteSession.issue.options)
            {
                List <ReasonMsg> msgs = new List <ReasonMsg>();
                double           u    = voteSession.issue.computeUtility(this, option, msgs);

                if (forcedVoteSession == voteSession && option == forcedVoteOption)
                {
                    ReasonMsg msg = new ReasonMsg("Obligated to vote for this option", 0);
                    msgs.Add(msg);
                }
                if (u > highestWeight || bestChoice == null)
                {
                    bestChoice    = option;
                    highestWeight = u;
                }
            }

            if (this.forcedVoteSession == voteSession)
            {
                return(forcedVoteOption);
            }
            return(bestChoice);
        }
Esempio n. 2
0
        public void bViewVotes()
        {
            Person p = null;

            if (state == uiState.SOCIETY && GraphicalSociety.focus != null)
            {
                p = GraphicalSociety.focus;
            }
            else
            {
                Hex hex = GraphicalMap.selectedHex;
                if (hex != null && hex.settlement != null && hex.settlement.title != null && hex.settlement.title.heldBy != null)
                {
                    p = hex.settlement.title.heldBy;
                }
            }

            if (p == null)
            {
                return;
            }

            VoteSession vs = p.society.voteSession;

            if (vs == null)
            {
                return;
            }

            world.audioStore.playClick();

            vs.assignVoters();
            addBlocker(world.prefabStore.getScrollSetVotes(p, vs.issue).gameObject);
        }
        public override void castInner(Map map, Unit u)
        {
            Unit_HeadlessHorseman head = (Unit_HeadlessHorseman)u;

            Society soc = (Society)u.location.soc;

            VoteIssue_JudgeSuspect issue   = new VoteIssue_JudgeSuspect(soc, u.location.person(), u.location.person());
            VoteSession            session = new VoteSession();

            session.issue   = issue;
            soc.voteSession = session;
            VoteOption option_0 = new VoteOption();

            option_0.index = 0;
            issue.options.Add(option_0);
            VoteOption option_1 = new VoteOption();

            option_1.index = 1;
            issue.options.Add(option_1);
            session.timeRemaining    = map.param.society_votingDuration;
            issue.reluctanceModifier = 0.66;


            string add = "";

            if (u.location.person().shadow <= 0.3 && u.location.person().state == Person.personState.normal)
            {
                add = "\nAs they are innocent, their head will become a pumpkin the horseman can gather.";
            }
            u.location.map.world.prefabStore.popImgMsg("A trial has begun. " + u.location.person().getFullName() + " is facing judgement. If you can convince enough nobles to vote guilty they will be beheaded." + add,
                                                       u.location.map.world.wordStore.lookup("ABILITY_HEADLESS_BEGIN_TRIAL"), img: 3);
        }
        public PopOptBar getVoteOptBar(VoteOption opt, VoteSession sess)
        {
            GameObject obj  = Instantiate(prefabPopOptBar) as GameObject;
            PopOptBar  part = obj.GetComponent <PopOptBar>();

            part.setTo(opt, sess);
            return(part);
        }
Esempio n. 5
0
        public PopupBoxVote getVoteBox(VoteSession sess, VoteOption option)
        {
            GameObject   obj      = Instantiate(voteBox) as GameObject;
            PopupBoxVote specific = obj.GetComponent <PopupBoxVote>();

            specific.setTo(sess, option);

            return(specific);
        }
Esempio n. 6
0
 public void setTo(VoteSession session, VoteOption option)
 {
     //title.text = session.issue.ToString();
     title.text = option.info(session.issue);
     body.text  = "Voters: " + option.votesFor.Count + " Total Prestige: " + (int)(option.votingWeight);
     if (option.votesFor.Contains(World.staticMap.overmind.enthralled))
     {
         body.text += "\n[Your enthralled is voting for this option]";
     }
     this.option = option;
     this.sess   = session;
     this.sess.assignVoters();
 }
Esempio n. 7
0
        public PopupScrollSet getScrollSet(VoteSession sess, List <VoteOption> votes)
        {
            PopupScrollSet specific = getInnerScrollSet();

            foreach (VoteOption b in votes)
            {
                PopupBoxVote box = getVoteBox(sess, b);
                box.gameObject.transform.SetParent(specific.gameObject.transform);
                specific.scrollables.Add(box);
            }

            return(specific);
        }
Esempio n. 8
0
 public void bDismiss()
 {
     world.audioStore.playClick();
     for (int i = 0; i < voterBars.Count; i++)
     {
         Destroy(voterBars[i].gameObject);
     }
     voterBars.Clear();
     for (int i = 0; i < voteOptBars.Count; i++)
     {
         Destroy(voteOptBars[i].gameObject);
     }
     voteOptBars.Clear();
     world.ui.setToWorld();
     agent = null;
     sess  = null;
 }
 public void populate(Society soc, Person agent)
 {
     this.agent               = agent;
     societyName.text         = soc.getName();
     textVotingIssue.text     = soc.voteSession.issue.ToString();
     textVotingIssueDesc.text = soc.voteSession.issue.getLargeDesc();
     textProposer.text        = "Proposed by: " + soc.voteSession.issue.proposer.getFullName();
     textProposerVote.text    = "Voting For: " + soc.voteSession.issue.proposer.getVote(soc.voteSession).info(soc.voteSession.issue);
     proposerBack.sprite      = soc.voteSession.issue.proposer.getImageBack();
     proposerMid.sprite       = soc.voteSession.issue.proposer.getImageMid();
     proposerFore.sprite      = soc.voteSession.issue.proposer.getImageFore();
     proposerBorder.sprite    = soc.voteSession.issue.proposer.getImageBorder();
     foreach (Person p in soc.people)
     {
         PopVoterBar bar = world.prefabStore.getVoterBar(p);
         //bar.gameObject.transform.parent = this.gameObject.transform;
         voterBars.Add(bar);
     }
     foreach (VoteOption opt in soc.voteSession.issue.options)
     {
         PopOptBar bar = world.prefabStore.getVoteOptBar(opt, soc.voteSession);
         //bar.gameObject.transform.parent = this.gameObject.transform;
         voteOptBars.Add(bar);
     }
     if (agent != null)
     {
         textAgentName.text = "Interacting with:\n" + agent.getFullName();
         agentBack.sprite   = agent.getImageBack();
         agentBorder.sprite = agent.getImageBorder();
         agentFore.sprite   = agent.getImageFore();
         agentMid.sprite    = agent.getImageMid();
         textAgentDesc.text = "You may use the voter's liking for " + agent.getFullName() + " to sway their votes one way or another, spending this liking as political capital.";
     }
     else
     {
         agentBack.sprite   = world.textureStore.icon_mask;
         agentMid.sprite    = world.textureStore.icon_mask;
         agentBorder.sprite = world.textureStore.slotCount;
         agentFore.sprite   = world.textureStore.icon_mask;
         textAgentName.text = "Interacting without character";
         textAgentDesc.text = "If you interact with a society with an enthralled noble, or use an agent, you can spend the liking the voters have towards them to sway their votes.";
     }
     sess = soc.voteSession;
     checkData();
 }
Esempio n. 10
0
        public override void castInner(Map map, Unit u)
        {
            Property.addProperty(map, u.location, "Red Death");
            u.location.map.world.prefabStore.popImgMsg("The nobles of " + u.location.soc.getName() + " are now faced with a terrible choice. One, and only one, noble with the disease can be cure. But who to choose?" +
                                                       " They must vote on who is saved, giving you ample room to cause conflict and resentment, especially if the nobles are corrupt.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_RED_SINGLE_USE_CURE"), 5);

            if (u.location.soc != null && u.location.soc is Society)
            {
                Society     soc   = (Society)u.location.soc;
                VoteSession sess  = new VoteSession();
                VoteIssue   issue = new VoteIssue_Crisis_SingleUseMedicine(soc, u.location.person());
                sess.issue      = issue;
                soc.voteSession = sess;

                foreach (Location loc in map.locations)
                {
                    if (loc.soc != soc)
                    {
                        continue;
                    }
                    if (loc.settlement != null && loc.person() != null)
                    {
                        bool diseased = false;
                        foreach (Property pr in loc.properties)
                        {
                            if (pr.proto.isDisease)
                            {
                                diseased = true;
                                break;
                            }
                        }

                        if (diseased)
                        {
                            VoteOption opt = new VoteOption();
                            opt.person = loc.person();
                            issue.options.Add(opt);
                        }
                    }
                }
            }
        }
Esempio n. 11
0
        public VoteOption getVote(VoteSession voteSession)
        {
            if (World.logging)
            {
                this.log.takeLine("Voting on " + voteSession.issue);
            }
            double     highestWeight = 0;
            VoteOption bestChoice    = null;

            foreach (VoteOption option in voteSession.issue.options)
            {
                List <ReasonMsg> msgs = new List <ReasonMsg>();
                double           u    = voteSession.issue.computeUtility(this, option, msgs);

                if (forcedVoteSession == voteSession && option == forcedVoteOption)
                {
                    ReasonMsg msg = new ReasonMsg("Obligated to vote for this option", 0);
                    msgs.Add(msg);
                }
                if (u > highestWeight || bestChoice == null)
                {
                    bestChoice    = option;
                    highestWeight = u;
                }
                if (World.logging)
                {
                    log.takeLine(" " + option.fixedLenInfo() + "  " + u);
                    foreach (ReasonMsg msg in msgs)
                    {
                        log.takeLine("     " + Eleven.toFixedLen(msg.value, 5) + msg.msg);
                    }
                }
            }

            if (this.forcedVoteSession == voteSession)
            {
                World.log("Forced voting");
                return(forcedVoteOption);
            }
            return(bestChoice);
        }
        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;
        }
Esempio n. 13
0
        public void populate(Society soc, Person agent)
        {
            this.agent               = agent;
            societyName.text         = soc.getName();
            textVotingIssue.text     = soc.voteSession.issue.ToString();
            textVotingIssueDesc.text = soc.voteSession.issue.getLargeDesc();
            textProposer.text        = "Proposed by: " + soc.voteSession.issue.proposer.getFullName();
            if (soc.voteSession.issue.proposer != null)
            {
                World.log("Proposer: " + soc.voteSession.issue.proposer.getFullName());
                World.log("Text " + textProposerVote);
                textProposerVote.text = "Voting For: " + soc.voteSession.issue.proposer.getVote(soc.voteSession).info(soc.voteSession.issue);
                proposerBack.sprite   = soc.voteSession.issue.proposer.getImageBack();
                proposerMid.sprite    = soc.voteSession.issue.proposer.getImageMid();
                proposerFore.sprite   = soc.voteSession.issue.proposer.getImageFore();
                proposerBorder.sprite = soc.voteSession.issue.proposer.getImageBorder();
            }
            else
            {
                Person arbitrary = soc.getSovereign();
                if (arbitrary == null)
                {
                    arbitrary = soc.people[0];
                }
                if (arbitrary != null)
                {
                    textProposerVote.text = "";
                    proposerBack.sprite   = arbitrary.getImageBack();
                    proposerMid.sprite    = arbitrary.getImageMid();
                    proposerFore.sprite   = arbitrary.getImageFore();
                    proposerBorder.sprite = arbitrary.getImageBorder();
                }
            }
            foreach (Person p in soc.people)
            {
                PopVoterBar bar = world.prefabStore.getVoterBar(p);
                //bar.gameObject.transform.parent = this.gameObject.transform;
                voterBars.Add(bar);
            }
            foreach (VoteOption opt in soc.voteSession.issue.options)
            {
                PopOptBar bar = world.prefabStore.getVoteOptBar(opt, soc.voteSession);
                //bar.gameObject.transform.parent = this.gameObject.transform;
                voteOptBars.Add(bar);
            }
            viewSelf.gameObject.SetActive(false);
            if (agent != null)
            {
                textAgentName.text = "Interacting with:\n" + agent.getFullName();
                agentBack.sprite   = agent.getImageBack();
                agentBorder.sprite = agent.getImageBorder();
                agentFore.sprite   = agent.getImageFore();
                agentMid.sprite    = agent.getImageMid();
                textAgentDesc.text = "You may use the voter's liking for " + agent.getFullName() + " to sway their votes one way or another, spending this liking as political capital.";
            }
            else
            {
                agentBack.sprite   = world.textureStore.icon_mask;
                agentMid.sprite    = world.textureStore.icon_mask;
                agentBorder.sprite = world.textureStore.slotCount;
                agentFore.sprite   = world.textureStore.icon_mask;
                textAgentName.text = "Interacting without character";
                textAgentDesc.text = "If you interact with a society with an enthralled noble, or use an agent, you can spend the liking the voters have towards them to sway their votes.";
            }


            if (World.staticMap.param.option_useAdvancedGraphics == 1 && agent != null)
            {
                Person p = agent;
                if (p.isMale)
                {
                    agentMid.sprite   = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_faces[p.imgAdvFace];
                    agentEyes.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_eyes[p.imgAdvEyes];
                    agentMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_mouths[p.imgAdvMouth];
                    agentHair.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_hair[p.imgAdvHair];
                    agentJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_jewels[p.imgAdvJewel];
                }
                else
                {
                    agentMid.sprite   = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_faces[p.imgAdvFace];
                    agentEyes.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_eyes[p.imgAdvEyes];
                    agentMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_mouths[p.imgAdvMouth];
                    agentHair.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_hair[p.imgAdvHair];
                    agentJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_jewels[p.imgAdvJewel];
                }
                agentFore.sprite = p.getImageFore();
            }
            else
            {
                agentEyes.sprite  = World.self.textureStore.person_advClear;
                agentMouth.sprite = World.self.textureStore.person_advClear;
                agentHair.sprite  = World.self.textureStore.person_advClear;
                agentJewel.sprite = World.self.textureStore.person_advClear;
            }
            lastPos = World.self.ui.uiInputs.scrollwheelTracking;

            sess = soc.voteSession;
            checkData();

            if (agent != null && agent == soc.map.overmind.enthralled)
            {
                bGoToSelf();
                viewSelf.gameObject.SetActive(true);
            }
        }
Esempio n. 14
0
 public void setTo(VoteOption option, VoteSession sess)
 {
     this.opt      = option;
     textName.text = option.info(sess.issue);
 }
        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 void processVoting()
        {
            if (voteSession == null)
            {
                if (voteCooldown > 0)
                {
                    voteCooldown -= 1; return;
                }

                Person proposer = null;
                foreach (Person p in people)
                {
                    if (p.state == Person.personState.enthralled)
                    {
                        continue;
                    }
                    if (proposer == null)
                    {
                        proposer = p;
                    }
                    else
                    {
                        int myDelta    = map.turn - p.lastVoteProposalTurn;
                        int theirDelta = map.turn - proposer.lastVoteProposalTurn;
                        if (myDelta > theirDelta)
                        {
                            proposer = p;
                        }
                    }
                }
                if (proposer != null)
                {
                    proposer.lastVoteProposalTurn = map.turn;
                    VoteIssue issue = proposer.proposeVotingIssue();
                    if (issue == null)
                    {
                        return;
                    }

                    bool   positive = true;
                    int    priority = (this.hasEnthralled()) ? 1 : 3;
                    string msg      = this.getName() + " now voting on " + issue.ToString();

                    World.staticMap.addMessage(msg, priority, positive);

                    //Otherwise, on with voting for this new thing
                    voteSession               = new VoteSession();
                    voteSession.issue         = issue;
                    voteSession.timeRemaining = map.param.society_votingDuration;
                }
            }
            else
            {
                if (voteSession.issue.stillValid(map) == false)
                {
                    voteSession = null;
                    World.log("Vote session no longer valid");
                    return;
                }
                if (voteSession.timeRemaining > 0)
                {
                    voteSession.timeRemaining -= 1; return;
                }

                voteSession.assignVoters();

                double     topVote = 0;
                VoteOption winner  = null;
                foreach (VoteOption option in voteSession.issue.options)
                {
                    if (option.votingWeight > topVote || winner == null)
                    {
                        winner  = option;
                        topVote = option.votingWeight;
                    }

                    voteSession.issue.changeLikingForVotes(option);
                }

                voteSession.issue.implement(winner);
                voteSession = null;
            }
        }
Esempio n. 17
0
        public void setTo(Person p)
        {
            if (p == null)
            {
                setToNull(); return;
            }

            profileBack.enabled     = true;
            profileMid.enabled      = true;
            profileFore.enabled     = true;
            profileBorder.enabled   = true;
            profileAdvEyes.enabled  = true;
            profileAdvMouth.enabled = true;
            profileAdvHair.enabled  = true;
            profileAdvJewel.enabled = true;
            profileBorder.sprite    = null;
            if (p.society.getSovereign() == 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;
            }

            if (World.staticMap.param.option_useAdvancedGraphics == 1)
            {
                //Null setting done to unfuck the distortion of images which periodically occurs
                profileBack.sprite     = null;
                profileMid.sprite      = null;
                profileAdvEyes.sprite  = null;
                profileAdvMouth.sprite = null;
                profileAdvHair.sprite  = null;
                profileAdvJewel.sprite = null;
                profileFore.sprite     = null;
                profileBack.sprite     = p.getImageBack();
                if (p.isMale)
                {
                    profileMid.sprite      = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_faces[p.imgAdvFace];
                    profileAdvEyes.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_eyes[p.imgAdvEyes];
                    profileAdvMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_mouths[p.imgAdvMouth];
                    profileAdvHair.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_hair[p.imgAdvHair];
                    profileAdvJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].m_jewels[p.imgAdvJewel];
                }
                else
                {
                    profileMid.sprite      = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_faces[p.imgAdvFace];
                    profileAdvEyes.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_eyes[p.imgAdvEyes];
                    profileAdvMouth.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_mouths[p.imgAdvMouth];
                    profileAdvHair.sprite  = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_hair[p.imgAdvHair];
                    profileAdvJewel.sprite = p.map.world.textureStore.cultures[p.culture.graphicsIndex].f_jewels[p.imgAdvJewel];
                }
                profileFore.sprite = p.getImageFore();
            }
            else
            {
                profileAdvEyes.enabled  = false;
                profileAdvMouth.enabled = false;
                profileAdvJewel.enabled = false;
                profileAdvHair.enabled  = false;
                //Null setting 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;
            }

            Society     soc  = p.society;
            VoteSession vote = (soc != null) ? soc.voteSession : null;

            if (vote != null)
            {
                personVoting.text = "Voting: " + p.getVote(vote).info(vote.issue);
            }
            else
            {
                personVoting.text = "Not voting";
            }

            voteSharePrediction.text = "";
            if (p.society.socType.periodicElection())
            {
                Title possibleOpt = null;
                foreach (Title t in soc.titles)
                {
                    if (t is Title_Sovereign)
                    {
                        if (t.getEligibleHolders(p.society).Contains(p))
                        {
                            possibleOpt = t;
                        }
                    }
                    else if (t is Title_ProvinceRuler && possibleOpt == null)
                    {
                        if (t.getEligibleHolders(p.society).Contains(p))
                        {
                            possibleOpt = t;
                        }
                    }
                }
                if (possibleOpt != null)
                {
                    VoteIssue_AssignTitle hypothetical = new VoteIssue_AssignTitle(p.society, p, possibleOpt);
                    foreach (Person p2 in possibleOpt.getEligibleHolders(p.society))
                    {
                        VoteOption opt = new VoteOption();
                        opt.person = p2;
                        hypothetical.options.Add(opt);
                    }
                    VoteSession sess = new VoteSession();
                    sess.issue = hypothetical;
                    sess.assignVoters();
                    double total   = 0;
                    double mine    = 0;
                    double highest = 0;
                    foreach (VoteOption opt in hypothetical.options)
                    {
                        total += opt.votingWeight;
                        if (opt.person == p)
                        {
                            mine = opt.votingWeight;
                        }
                        if (opt.votingWeight > highest)
                        {
                            highest = opt.votingWeight;
                        }
                    }
                    if (total > 0)
                    {
                        if (mine == highest)
                        {
                            voteSharePrediction.color = new Color(0, 0.75f, 0);
                        }
                        else
                        {
                            voteSharePrediction.color = new Color(1, 0.5f, 0.5f);
                        }
                        voteSharePrediction.text = possibleOpt.getName() + "\nPredicted Vote Share: " + (int)(100 * mine / total) + "%";
                    }
                }
            }
        }
        public void processVoting()
        {
            if (voteSession == null)
            {
                if (voteCooldown > 0)
                {
                    voteCooldown -= 1; return;
                }

                Person proposer = null;
                foreach (Person p in people)
                {
                    if (p.state == Person.personState.enthralled)
                    {
                        continue;
                    }
                    if (proposer == null)
                    {
                        proposer = p;
                    }
                    else
                    {
                        int myDelta    = map.turn - p.lastVoteProposalTurn;
                        int theirDelta = map.turn - proposer.lastVoteProposalTurn;
                        if (myDelta > theirDelta)
                        {
                            proposer = p;
                        }
                    }
                }
                if (proposer != null)
                {
                    proposer.lastVoteProposalTurn = map.turn;
                    VoteIssue issue = proposer.proposeVotingIssue();
                    if (issue == null)
                    {
                        return;
                    }

                    bool   positive = true;
                    int    priority = (this.hasEnthralled()) ? 1 : 3;
                    string msg      = this.getName() + " now voting on " + issue.ToString();

                    World.staticMap.addMessage(msg, priority, positive);

                    //Otherwise, on with voting for this new thing
                    voteSession               = new VoteSession();
                    voteSession.issue         = issue;
                    voteSession.timeRemaining = map.param.society_votingDuration;
                    if (World.logging && logbox != null)
                    {
                        logbox.takeLine("Starting voting on " + voteSession.issue.ToString());
                    }

                    if (this.hasEnthralled())
                    {
                        voteSession.assignVoters();
                        VoteOption optionChoice = null;
                        foreach (VoteOption opt in voteSession.issue.options)
                        {
                            if (opt.votesFor.Contains(proposer))
                            {
                                optionChoice = opt;
                                break;
                            }
                        }
                        string str = proposer.getFullName() + " has proposed a measure to be voted on by the nobles of "
                                     + this.getName() + ".\nThey are voting " +
                                     optionChoice.info(issue);

                        map.world.prefabStore.popImgMsg(str, "Voting issue: " + issue.getLargeDesc());
                    }
                }
            }
            else
            {
                if (voteSession.issue.stillValid(map) == false)
                {
                    voteSession = null;
                    World.log("Vote session no longer valid");
                    return;
                }
                if (voteSession.timeRemaining > 0)
                {
                    voteSession.timeRemaining -= 1; return;
                }

                voteSession.assignVoters();

                double     topVote = 0;
                VoteOption winner  = null;
                foreach (VoteOption option in voteSession.issue.options)
                {
                    if (option.votingWeight > topVote || winner == null)
                    {
                        winner  = option;
                        topVote = option.votingWeight;
                    }

                    voteSession.issue.changeLikingForVotes(option, voteSession.issue);
                }

                if (World.logging && logbox != null)
                {
                    logbox.takeLine("End voting on " + voteSession.issue.ToString());
                }
                if (World.logging && logbox != null)
                {
                    logbox.takeLine("    Winning option: " + winner.info());
                }

                if (this.hasEnthralled())
                {
                    string str = "Chosen outcome: " + winner.info(voteSession.issue);
                    str += "\nVotes for: ";
                    foreach (Person p in winner.votesFor)
                    {
                        str += p.getFullName() + ", ";
                    }
                    str = str.Substring(0, str.Length - 2);

                    map.world.prefabStore.popImgMsg(str, "Voting concluded. Issue: " + voteSession.issue.getLargeDesc());
                }

                voteSession.issue.implement(winner);
                if (voteSession.issue is VoteIssue_AssignLandedTitle == false)
                {
                    billsSinceLastSettlementAssignment += 1;
                }
                else
                {
                    billsSinceLastSettlementAssignment = 0;
                }
                voteSession = null;
            }
        }