public override bool castable(Map map, Unit u)
        {
            if (u.location.settlement == null)
            {
                return(false);
            }
            if (u.location.settlement.infiltration < map.param.unit_seeker_libraryInfiltrationReq)
            {
                return(false);
            }
            if (u is Unit_Seeker == false)
            {
                return(false);
            }
            Unit_Seeker seeker = (Unit_Seeker)u;

            foreach (Property prop in u.location.properties)
            {
                if (prop.proto is Pr_ForgottenSecret)
                {
                    return(true);
                }
            }



            return(false);
        }
示例#2
0
        public override void castInner(Map map, Unit u)
        {
            Unit_Seeker seeker = (Unit_Seeker)u;

            seeker.secrets -= 1;

            foreach (Location loc in map.locations)
            {
                List <Property> rems = new List <Property>();
                foreach (Property pr in loc.properties)
                {
                    if (pr.proto is Pr_ForgottenSecret)
                    {
                        rems.Add(pr);
                    }
                }
                foreach (Property pr in rems)
                {
                    loc.properties.Remove(pr);
                }
            }


            Unit_Seeker.addForgottenSecrets(map);

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " changes their research direction, to a more promising path, allowing new secrets to be used.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_SEEKER_CHANGE_DIRECTION"), img: 2);
        }
        public override void castInner(Map map, Unit u)
        {
            Unit_Seeker seeker = (Unit_Seeker)u;

            seeker.secrets = 0;

            seeker.knowsTruth = true;

            AchievementManager.unlockAchievement(SteamManager.achievement_key.LEARN_THE_TRUTH);

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " pieces together the truth, from the secrets they have found, and gains dark power from the revelation.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_SEEKER_LEARN_TRUTH"), img: 2);
        }
示例#4
0
        public override bool castable(Map map, Unit u)
        {
            if (u is Unit_Seeker == false)
            {
                return(false);
            }
            Unit_Seeker seeker = (Unit_Seeker)u;

            if (seeker.secrets == 0)
            {
                return(false);
            }
            return(true);
        }
        public override bool castable(Map map, Unit u)
        {
            if (u is Unit_Seeker == false)
            {
                return(false);
            }
            Unit_Seeker seeker = (Unit_Seeker)u;

            if (seeker.secrets < map.param.unit_seeker_nReqSecrets)
            {
                return(false);
            }
            return(true);
        }
        public override bool castable(Map map, Unit u)
        {
            if (u is Unit_Seeker == false)
            {
                return(false);
            }
            Unit_Seeker seeker = (Unit_Seeker)u;

            foreach (Property prop in u.location.properties)
            {
                if (prop.proto is Pr_ForgottenSecret)
                {
                    return(true);
                }
            }

            return(false);
        }
示例#7
0
        public override void turnTick(Unit unit)
        {
            dur += 1;
            if (dur >= unit.location.map.param.unit_seeker_uncoverTime)
            {
                Unit_Seeker seeker = (Unit_Seeker)unit;

                seeker.secrets += nSecrets;

                List <Property> rems = new List <Property>();
                foreach (Property pr in unit.location.properties)
                {
                    if (pr.proto is Pr_ForgottenSecret)
                    {
                        rems.Add(pr);
                    }
                }
                foreach (Property pr in rems)
                {
                    seeker.location.properties.Remove(pr);
                }

                string msg = unit.getName() + " discovers a forgotten secret, they now have " + seeker.secrets + " and need " + seeker.reqSecrets + " to discover the truth.";
                if (seeker.secrets == seeker.reqSecrets)
                {
                    msg = unit.getName() + " learns a forgotten secret, and now knows enough to piece together the truth they have been seeking. Use their ability to do so.";
                }
                if (leaveEvidence)
                {
                    msg += "\nThey left evidence behind.";
                }
                unit.location.map.world.prefabStore.popImgMsg(msg, unit.location.map.world.wordStore.lookup("ABILITY_SEEKER_UNCOVER_SECRET"), img: 2);
                unit.task = null;

                if (leaveEvidence)
                {
                    Evidence e = new Evidence(unit.location.map.turn);
                    e.pointsTo = unit;
                    e.weight   = unit.location.map.param.unit_majorEvidence;
                    unit.location.evidence.Add(e);
                }
            }
        }
        public override bool castable(Map map, Unit u)
        {
            if (u.location.soc == null)
            {
                return(false);
            }
            if (u.location.soc is Society == false)
            {
                return(false);
            }
            if (u.location.person() == null)
            {
                return(false);
            }
            if (u is Unit_Seeker == false)
            {
                return(false);
            }
            Unit_Seeker seeker = (Unit_Seeker)u;

            return(seeker.knowsTruth);
        }
        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);
            }
        }