public override string getLargeDesc()
        {
            string reply = "Vote to execute " + target.getFullName() + " for the crime of association with dark forces." +
                           "\n\nThis accusation primarily happens if nobles have high suspicion (but can instead be political motivated)." +
                           "This will cause the society to kill the target noble on sight, if they are found guilty.";

            return(reply);
        }
Esempio n. 2
0
        public override void turnTick(Person person)
        {
            if (person.title_land == null)
            {
                person.action = null; return;
            }

            turns += 1;
            if (turns >= World.staticMap.param.action_investigateTurns)
            {
                foreach (Location loc in person.title_land.settlement.location.getNeighbours())
                {
                    if (loc.person() != null)
                    {
                        if (loc.person().state == Person.personState.enthralled && loc.person().evidence != 1)
                        {
                            loc.person().evidence += person.map.param.action_investigateEvidence;
                            if (loc.person().evidence > 1)
                            {
                                loc.person().evidence = 1;
                            }
                            person.map.world.prefabStore.popMsg(person.getFullName() + ", who has an awareness of the dark, has completed an investigation, which revealed your enthralled, adding evidence to them.");
                        }
                    }
                }
                person.action = null;
            }
        }
        public override void turnTick(Person person)
        {
            if (person.title_land == null)
            {
                person.action = null; return;
            }
            if (person.title_land.settlement is Set_University == false)
            {
                person.action = null; return;
            }
            if (person.awareness >= 1)
            {
                person.awareness = 1; person.action = null;
            }

            person.awareness += World.staticMap.param.action_research_expectedAwarenessPerTurn * Eleven.random.NextDouble() * person.map.param.awareness_master_speed;
            if (person.awareness >= 1)
            {
                person.awareness = 1; person.action = null;
            }
            if (person.sanity > 0 && Eleven.random.NextDouble() < World.staticMap.param.action_research_pSanityHit)
            {
                if (person.sanity > 0)
                {
                    person.sanity -= 1;
                }
                if (person.sanity <= 0)
                {
                    person.sanity = 0;
                    World.staticMap.addMessage(person.getFullName() + " has gone insane from what they learnt", MsgEvent.LEVEL_DARK_GREEN, true);
                }
            }
        }
Esempio n. 4
0
        public static double getLikingModifiers(Person me, int themIndex, List <ReasonMsg> reasons)
        {
            Person them = World.staticMap.persons[themIndex];

            if (them == null)
            {
                return(0);
            }
            double u = 0;

            if (me.society.socType.usesHouses() && (me.house == them.house))
            {
                u += me.map.param.society_houseLiking;
                if (reasons != null)
                {
                    reasons.Add(new ReasonMsg("Same House", me.map.param.society_houseLiking));
                }
            }
            if (them.state == Person.personState.enthralled && me.state == Person.personState.broken)
            {
                u += me.map.param.society_houseLiking;
                if (reasons != null)
                {
                    reasons.Add(new ReasonMsg("Cultist Towards Enthralled", me.map.param.society_houseLiking));
                }
            }

            if (them.madness is Insanity_Sane == false)
            {
                u += me.map.param.insanity_relHit;
                if (reasons != null)
                {
                    reasons.Add(new ReasonMsg("Obviously insane", me.map.param.insanity_relHit));
                }
            }
            foreach (Trait t in them.traits)
            {
                if (t.receivedLikingDelta() != 0)
                {
                    u += t.receivedLikingDelta();
                    if (reasons != null)
                    {
                        reasons.Add(new ReasonMsg(them.getFullName() + " is " + t.name, t.receivedLikingDelta()));
                    }
                }
            }
            foreach (Trait t in me.traits)
            {
                if (t.likingChange() != 0)
                {
                    u += t.likingChange();
                    if (reasons != null)
                    {
                        reasons.Add(new ReasonMsg(me.getFullName() + " is " + t.name, t.likingChange()));
                    }
                }
            }

            return(u);
        }
Esempio n. 5
0
        public void lashOut(Person p)
        {
            if (Eleven.random.NextDouble() > p.map.param.insanity_lashOutProbability)
            {
                return;
            }

            int    c      = 0;
            Person victim = null;

            foreach (Person p2 in p.society.people)
            {
                if (p2 == p)
                {
                    continue;
                }
                c += 1;
                if (Eleven.random.Next(c) == 0)
                {
                    victim = p2;
                }
            }
            if (victim != null)
            {
                victim.getRelation(p).addLiking(-30, "Lashed out in madess", p.map.turn);
                if (p.society.hasEnthralled())
                {
                    p.map.addMessage(p.getFullName() + " lashes out against " + victim.getFullName() + " in madness", MsgEvent.LEVEL_DARK_GREEN, p.state != Person.personState.enthralled, p.getLocation().hex);
                }
            }
        }
Esempio n. 6
0
        public void setTo(Person p)
        {
            inner   = p;
            p.outer = this;

            layerBack.sprite = p.getImageBack();
            layerMid.sprite  = p.getImageMid();
            layerFore.sprite = p.getImageFore();

            title.text    = p.getFullName();
            subtitle.text = (p.title_land == null) ? "" : p.title_land.getName();

            if (p.society.getSovreign() == p)
            {
                border.sprite = p.map.world.textureStore.slotKing;
            }
            else if (p.titles.Count > 0)
            {
                border.sprite = p.map.world.textureStore.slotDuke;
            }
            else if (p.title_land != null)
            {
                border.sprite = p.map.world.textureStore.slotCount;
            }
            else
            {
                border.sprite = p.map.world.textureStore.slotBasic;
            }
        }
        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 double computeUtility(Person voter, VoteOption option, List <ReasonMsg> msgs)
        {
            double u      = option.getBaseUtility(voter);
            double localU = 0;

            if (option.group == null)
            {
                //Null case is "remain independent"
                localU = -voter.map.param.utility_vassaliseReluctance;
                msgs.Add(new ReasonMsg("Inherent reluctance", localU));
                u += localU;

                return(u);
            }

            localU = voter.map.param.utility_vassaliseReluctance;
            msgs.Add(new ReasonMsg("Inherent reluctance", localU));
            u += localU;

            Society socTarget = (Society)option.group;

            foreach (KillOrder order in socTarget.killOrders)
            {
                if (order.person == voter)
                {
                    localU = -1000;
                    msgs.Add(new ReasonMsg("Kill order against " + voter.getFullName(), localU));
                    u += localU;
                }
            }

            double awarenessU = society.map.param.utility_lightAllianceMult * voter.awareness;

            msgs.Add(new ReasonMsg("Awareness", awarenessU));
            u += awarenessU;


            double militaryU = option.group.currentMilitary - voter.society.currentMilitary;

            militaryU *= society.map.param.utility_lightAllianceMilMult * voter.awareness;
            msgs.Add(new ReasonMsg("Their military might", militaryU));
            u += militaryU;

            double totalSuspicion = 0;

            foreach (Person p in socTarget.people)
            {
                RelObj rel = voter.getRelation(p);
                totalSuspicion += rel.suspicion;
            }

            double susU = -totalSuspicion;

            susU *= society.map.param.utility_lightAlliancSusMult;
            msgs.Add(new ReasonMsg("Suspicion of their nobles", susU));
            u += susU;

            return(u);
        }
Esempio n. 9
0
        public override void castInner(Map map, Person person)
        {
            map.world.prefabStore.popImgMsg(
                "You cast your shadow over " + person.getFullName() + " and hide away some of the evidence against them.",
                map.world.wordStore.lookup("ABILITY_REDUCE_EVIDENCE"));

            person.evidence /= 2;
        }
Esempio n. 10
0
        public override void castInner(Map map, Person person)
        {
            person.action = new Act_Disrupted();

            map.world.prefabStore.popImgMsg(
                "You disrupt the efforts of " + person.getFullName() + ". They will need time to re-establish themselves and undo the chaos you've sown before they can act again.",
                map.world.wordStore.lookup("ABILITY_DISRUPT_ACTION"));
        }
        public override void castInner(Map map, Person person)
        {
            person.getRelation(map.overmind.enthralled).suspicion = 0;

            map.world.prefabStore.popImgMsg(
                person.getFullName() + " forgets all previous suspicions, and trusts " + map.overmind.enthralled.getFullName() + "'s claims of innocence. They may soon notice evidence, if any remains, of course.",
                map.world.wordStore.lookup("ABILITY_TRUSTING_FOOL"));
        }
 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();
 }
        public override void castInner(Map map, Person other)
        {
            other.getRelation(other.society.getSovreign()).addLiking(map.param.ability_sowDissentLikingChange, "Dissent sown", map.turn);


            map.world.prefabStore.popImgMsg(
                other.getFullName() + " gains dislike for their sovreign, " + other.society.getSovreign().getFullName() + ".",
                map.world.wordStore.lookup("ABILITY_SOW_DISSENT"));
        }
 public override void castInner(Map map, Person person)
 {
     map.world.prefabStore.popImgMsg(
         person.getFullName() + "'s suspicions abate, they fear less now. All their suspicions are halved.",
         map.world.wordStore.lookup("ABILITY_REDUCE_SUSPICION"));
     foreach (RelObj rel in person.relations.Values)
     {
         rel.suspicion /= 2;
     }
 }
        public override void castInner(Map map, Person person)
        {
            person.politics_militarism = 1;

            string msgs = "You exploit the terror of " + person.getFullName() + ", causing them to become violent and cruel, as an attempt to defend themselves.";

            map.world.prefabStore.popImgMsg(
                msgs,
                map.world.wordStore.lookup("ABILITY_CALL_TO_VIOLENCE"));
        }
 public void setTo(Person p)
 {
     profileBack.sprite    = p.getImageBack();
     profileMid.sprite     = p.getImageMid();
     profileFore.sprite    = p.getImageFore();
     profileBorder.sprite  = p.getImageBorder();
     textName.text         = p.getFullName();
     textPrestige.text     = "Prestige: " + (int)p.prestige;
     textVotingOption.text = "Voting: " + p.getVote(p.society.voteSession).info(p.society.voteSession.issue);
     voter = p;
 }
Esempio n. 17
0
        public override void castInner(Map map, Person person)
        {
            string msgs = "You shatter the mind of " + person.getFullName() + ", as their fears and terrors overwhelm them. They now see enemies everywhere they look, and desperately seek to defend themselves against these nebulous foes.";

            person.sanity  = 0;
            person.madness = new Insanity_Paranoid();

            map.world.prefabStore.popImgMsg(
                msgs,
                map.world.wordStore.lookup("ABILITY_BREAK_MIND"));
        }
Esempio n. 18
0
 public virtual string getName()
 {
     if (person != null)
     {
         return(person.getFullName());
     }
     else
     {
         return("Agent");
     }
 }
        public override void castInner(Map map, Person person)
        {
            person.shadow = 1;

            map.world.prefabStore.popImgMsg(
                "You enshadow " + person.getFullName() + ". Shadow is the path to your victory over this world. It spreads from person to person, if they like the enshadowed other."
                + " Shadow constantly creates evidence on a person.",
                map.world.wordStore.lookup("ABILITY_ENSHADOW"));

            person.shadow = 1;
        }
Esempio n. 20
0
        public override void castInner(Map map, Person person)
        {
            double pastLiking = person.getRelation(map.overmind.enthralled).getLiking();

            person.getRelation(map.overmind.enthralled).addLiking(map.param.ability_addLikingAmount, "Beguilement", map.turn);
            double currentLiking = person.getRelation(map.overmind.enthralled).getLiking();

            map.world.prefabStore.popImgMsg(
                "You beguile " + person.getFullName() + ", causing them to like " + map.overmind.enthralled.getFullName() + " to a greater degree."
                + "\nTheir liking has gone from " + (int)pastLiking + " to " + (int)currentLiking + ".",
                map.world.wordStore.lookup("ABILITY_BEGUILE"));
        }
        public void checkPopulation()
        {
            foreach (Person p in people)
            {
                p.turnTick();
            }

            int nUntitled = 0;

            foreach (Person p in people)
            {
                if (p.title_land == null)
                {
                    nUntitled += 1;
                }
            }
            int nNeeded = map.param.soc_untitledPeople - nUntitled;

            //Insta-add enough to make up the numbers
            for (int i = 0; i < nNeeded; i++)
            {
                Person p = new Person(this);
                log(p.getFullName() + " has risen to note in the society of " + this.getName());
                people.Add(p);
            }

            if (nUntitled > map.param.soc_untitledPeople)
            {
                Person lastUntitled = null;
                foreach (Person p in people)
                {
                    if (p.state == Person.personState.enthralled)
                    {
                        continue;
                    }
                    if (p.title_land == null)
                    {
                        lastUntitled = p;
                    }
                }
                if (lastUntitled != null)
                {
                    string str = lastUntitled.getFullName() + " has no title, and has lost lordship in " + this.getName();
                    log(str);
                    World.log(str);
                    people.Remove(lastUntitled);
                    if (this.hasEnthralled())
                    {
                        map.addMessage(str);
                    }
                }
            }
        }
        public override void castInner(Map map, Person other)
        {
            other.getRelation(map.overmind.enthralled).addLiking(-World.staticMap.param.ability_changePoliticsLikingCost, "Argued about militarism", map.turn);

            double prev = other.politics_militarism;

            other.politics_militarism = Math.Min(1, other.politics_militarism + 0.25);
            double curr = other.politics_militarism;

            map.world.prefabStore.popImgMsg(
                other.getFullName() + "'s miliarism increases, from " + (int)(100 * prev) + "% to " + (int)(100 * curr) + "%",
                map.world.wordStore.lookup("SOC_INCREASE_MILITARISM"));
        }
Esempio n. 23
0
        public override void castInner(Map map, Person other)
        {
            Society soc = map.overmind.enthralled.society;

            soc.voteSession.assignVoters();
            VoteOption enthOpt  = null;
            VoteOption otherOpt = null;

            foreach (VoteOption opt in soc.voteSession.issue.options)
            {
                if (opt.votesFor.Contains(map.overmind.enthralled))
                {
                    enthOpt = opt;
                }
                if (opt.votesFor.Contains(other))
                {
                    otherOpt = opt;
                }
            }
            if (enthOpt == null)
            {
                throw new Exception("Enthralled wasn't voting for some reason");
            }

            if (soc.voteSession.issue.computeUtility(other, enthOpt, new System.Collections.Generic.List <ReasonMsg>()) < -50)
            {
                map.world.prefabStore.popMsg(other.getFullName() + " refuses to change their vote, as they are too opposed to voting for " + enthOpt.info() + ".");
                return;
            }

            other.forcedVoteSession = soc.voteSession;
            other.forcedVoteOption  = enthOpt;
            other.getRelation(map.overmind.enthralled).addLiking(-World.staticMap.param.ability_switchVoteLikingCost, "Asked to change vote", map.turn);


            map.world.prefabStore.popImgMsg(
                other.getFullName() + " is now voting for " + enthOpt.info(soc.voteSession.issue),
                map.world.wordStore.lookup("SOC_CHANGE_VOTE"));
        }
Esempio n. 24
0
        public override void castInner(Map map, Person victim)
        {
            Society soc = victim.society;

            victim.getRelation(map.overmind.enthralled).suspicion = 1;
            victim.sanity = 0;


            map.world.prefabStore.popImgMsg(
                "You share the truth of the world with " + victim.getFullName() + ", a terrible truth which ruins their mind. They are now at 0 sanity," +
                " and will turn insane, but are aware of your enthralled's dark nature.",
                map.world.wordStore.lookup("SOC_REVEAL_TRUTH"));
        }
        public override void castInner(Map map, Person other)
        {
            other.evidence += (map.param.ability_uncannyGlamourEvidence / 100.0);
            other.prestige += map.param.ability_uncannyGlamourGain;
            if (other.evidence > 1)
            {
                other.evidence = 1;
            }

            map.world.prefabStore.popImgMsg(
                other.getFullName() + " gains " + map.param.ability_uncannyGlamourGain + " prestige, and are now at " + (int)other.prestige + ". Their baseline is " + (int)other.targetPrestige
                + " and they will slowly return to that point.",
                map.world.wordStore.lookup("ABILITY_UNCANNY_GLAMOUR"));
        }
        public override double computeUtility(Person voter, VoteOption option, List <ReasonMsg> msgs)
        {
            double u = option.getBaseUtility(voter);

            //Option 1 is "Kill suspect"
            //Multiply values based on this, as they should be symmetric for most parts
            double parityMult = 1;

            if (option.index == 0)
            {
                parityMult = -1;
            }

            RelObj rel    = voter.getRelation(target);
            double apathy = (1 - voter.shadow);

            /*
             * This is actually already covered by liking, but caps out at 100. This adds another bonus, purely from suspicion
             */
            double proKill = rel.suspicion * apathy * voter.map.param.utility_killSuspectFromSuspicion * parityMult;

            msgs.Add(new ReasonMsg("Suspicion towards " + target.getFullName(), proKill));
            u += proKill;

            double reluctance = -voter.map.param.utility_killSuspectRelucatance * parityMult;

            msgs.Add(new ReasonMsg("Base reluctance to kill noble", reluctance));
            u += reluctance;

            double liking = -rel.getLiking() * parityMult;

            msgs.Add(new ReasonMsg("Opinion of " + target.getFullName(), liking));
            u += liking;

            return(u);
        }
Esempio n. 27
0
        public void setTo(Person p)
        {
            inner = p;

            layerBack.sprite = p.getImageBack();
            layerMid.sprite  = p.getImageMid();
            layerFore.sprite = p.getImageFore();

            title.text    = p.getFullName();
            subtitle.text = (p.title_land == null) ? "" : p.title_land.getName();
            // FIXME
            upperRightText.text = lowerRightText.text = riseBox.text = fallBox.text = "";

            targetColor = neutralColor;
        }
        public void movePerson(Person lord, Society receiving)
        {
            if (lord.society.people.Contains(lord) == false)
            {
                throw new Exception("Person attempting to leave society they were not a part of");
            }
            if (receiving.people.Contains(lord))
            {
                throw new Exception("Lord already in group they are attempting to join");
            }

            lord.society.people.Remove(lord);
            receiving.people.Add(lord);
            lord.society = receiving;
            World.log(lord.getFullName() + " now under the rule of " + receiving.getName());
        }
Esempio n. 29
0
        public override double computeUtility(Person voter, VoteOption option, List <ReasonMsg> msgs)
        {
            double u = option.getBaseUtility(voter);

            Person p             = option.person;
            double existingValue = 0;

            if (p.title_land != null)
            {
                existingValue = p.title_land.settlement.getPrestige();
            }

            double newValue = title.settlement.getPrestige();

            double benefitToPerson = newValue - existingValue;

            //We know how much they would be advantaged. We now need to know how much we like them to determine
            //if this is a good thing or not

            double localU = benefitToPerson * voter.getRelation(p).getLiking() * voter.map.param.utility_landedTitleMult;

            msgs.Add(new ReasonMsg("Benefit to " + p.getFullName(), localU));
            u += localU;

            if (title.heldBy == null)
            {
                localU = voter.map.param.utility_landedTitleAssignBaseline;
                msgs.Add(new ReasonMsg("Need to assign the title", localU));
                u += localU;
            }

            //We need to know if someone's going to lose out here
            //(Note this is irrelevant if they're the person who's being voted on)
            if (title.heldBy != null && title.heldBy != p)
            {
                double damageToOther = title.settlement.getPrestige();
                localU = -damageToOther *voter.getRelation(title.heldBy).getLiking() * voter.map.param.utility_landedTitleMult;

                msgs.Add(new ReasonMsg("Harm to " + title.heldBy.getFullName(), localU));
                u += localU;
            }


            return(u);
        }
Esempio n. 30
0
        public void SetInfo(Person p)
        {
            foreground.sprite  = personHead;
            background.sprite  = personFrame;
            background.enabled = true;

            nameTxt.text = p.getFullName();
            if (p.title_land != null)
            {
                infoTxt.text = p.title_land.getName();
            }
            else
            {
                infoTxt.text = "Resident";
            }

            infoTxt.text += "\n" + p.prestige + " Prestige";
        }