public override void castInner(Map map, Unit u)
        {
            Unit_Saviour saviour = (Unit_Saviour)u;

            saviour.linkedFates = true;

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " publicly throws their support behind your enthralled noble, " + map.overmind.enthralled.getFullName() + ", granting them prestige "
                                                       + "based on how adored The Saviour is." + map.overmind.enthralled.getFullName() + "'s prestige will be affected by how nobles in " + map.overmind.enthralled.society.getName() +
                                                       " view " + u.getName() + ". The more they like them, the higher the prestige boost. However, if their suspicions grow, their prestige change may even become negative.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_SAVIOUR_LINKED_FATES"), 7);
        }
        public override bool castable(Map map, Unit u)
        {
            if (u.location.soc == null)
            {
                return(false);
            }
            if (u is Unit_Saviour == false)
            {
                return(false);
            }
            if (map.overmind.enthralled == null)
            {
                return(false);
            }
            Unit_Saviour self = (Unit_Saviour)u;

            if (self.linkedFates)
            {
                return(false);
            }
            return(true);
        }
        public void clicked(Map map)
        {
            //selector.selected(person,agent);
            map.world.audioStore.playActivate();
            Hex hex = GraphicalMap.selectedHex;

            if (hex != null && hex.location != null)
            {
                if (index == Ab_Over_CreateAgent.VAMPIRE)
                {
                    Unit agent = new Unit_Vampire(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        map.world.wordStore.lookup("ABILITY_CREATE_AGENT"));

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);

                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }

                if (index == Ab_Over_CreateAgent.DOCTOR)
                {
                    Unit agent = new Unit_NecroDoctor(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        map.world.wordStore.lookup("ABILITY_CREATE_AGENT"));

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);

                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }

                if (index == Ab_Over_CreateAgent.SEEKER)
                {
                    Unit agent = new Unit_Seeker(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        map.world.wordStore.lookup("ABILITY_CREATE_AGENT"));

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);

                    Unit_Seeker.addForgottenSecrets(map);

                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }

                if (index == Ab_Over_CreateAgent.PUMPKIN)
                {
                    Unit agent = new Unit_HeadlessHorseman(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        "The horseman rides again!", 3);

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);


                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }
                if (index == Ab_Over_CreateAgent.HEIROPHANT)
                {
                    Unit agent = new Unit_DarkHeirophant(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        "The cult begins, its hidden shrines to the dark powers are raised, and await the worshippers.", 4);

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);


                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }
                if (index == Ab_Over_CreateAgent.REDDEATH)
                {
                    Unit agent = new Unit_RedDeath(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        "The Masque of the Red Death arises, the spirit of the terrible disease. It will spread where the Masque goes, and terrifies commoner and noble alike.",
                        5);

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);


                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }
                if (index == Ab_Over_CreateAgent.SAVIOUR)
                {
                    Unit agent = new Unit_Saviour(hex.location, map.soc_dark);
                    map.world.prefabStore.popImgMsg(
                        "You draw upon the creatures of darkness, and choose one to serve as your instrument in this world",
                        "The Saviour is designed to sabotage one of your strategies to allow another. They can save a small nation you are invading, to make all nobles in the society and in neighbouring settlements adore The Saviour (at the cost of your military)," +
                        "or to cure a disease to also gain liking. Once support is gained, they can exploit it, by influencing votes, by infiltrating effectively, or by granting prestige to your enthralled noble.",
                        7);

                    agent.person       = new Person(map.soc_dark);
                    agent.person.state = Person.personState.enthralledAgent;
                    agent.person.unit  = agent;
                    agent.person.traits.Clear();
                    map.units.Add(agent);


                    Evidence ev = new Evidence(map.turn);
                    ev.pointsTo = agent;
                    ev.weight   = 0.66;
                    agent.location.evidence.Add(ev);

                    agent.task = null;
                    GraphicalMap.selectedSelectable = agent;
                }
                if (!map.overmind.isFirstEnthralledAgent)
                {
                    foreach (Ability a in map.overmind.powers)
                    {
                        if (a is Ab_Over_CreateAgent)
                        {
                            a.turnLastCast = map.turn;
                        }
                    }
                }
                map.overmind.availableEnthrallments -= 1;
                map.hasEnthralledAnAgent             = true;

                AchievementManager.unlockAchievement(SteamManager.achievement_key.FIRST_AGENT);
            }
        }
Exemple #4
0
        public double getTargetPrestige(List <string> reasons)
        {
            double prestige = map.param.person_defaultPrestige;

            if (reasons != null)
            {
                reasons.Add("Basic default: " + (int)(map.param.person_defaultPrestige));
            }

            if (title_land != null)
            {
                prestige += title_land.settlement.getPrestige();
                if (reasons != null)
                {
                    reasons.Add("Land Title: " + (int)(title_land.settlement.getPrestige()));
                }
            }
            foreach (Title t in titles)
            {
                if (reasons != null)
                {
                    reasons.Add(t.getName() + " " + (int)(t.getPrestige()));
                }
                prestige += t.getPrestige();
            }

            foreach (Person p in this.getDirectSubordinates())
            {
                foreach (Trait t in p.traits)
                {
                    if (t.superiorPrestigeChange() != 0)
                    {
                        if (reasons != null)
                        {
                            reasons.Add(p.getFullName() + " (" + t.name + ") " + (int)(t.superiorPrestigeChange()));
                        }
                        prestige += t.superiorPrestigeChange();
                    }
                }
            }

            if (this == map.overmind.enthralled)
            {
                foreach (Unit u in map.units)
                {
                    if (u is Unit_Saviour)
                    {
                        Unit_Saviour sav = (Unit_Saviour)u;
                        if (sav.linkedFates)
                        {
                            double saviourAdd = 0;
                            foreach (Person p2 in society.people)
                            {
                                if (p2 == this)
                                {
                                    continue;
                                }
                                saviourAdd += p2.getRelation(u.person).getLiking() / 66;
                            }
                            if (saviourAdd != 0)
                            {
                                if (reasons != null)
                                {
                                    reasons.Add("Association with " + u.getName() + " " + (int)(saviourAdd));
                                }
                                prestige += saviourAdd;
                            }
                        }
                    }
                }
            }

            if (prestige < 0)
            {
                prestige = 0;
            }
            return(prestige);
        }