Example #1
0
        public override void castInner(Map map, Unit u)
        {
            u.task = new Task_Vamp_Insanity();

            Unit_Vampire vamp = (Unit_Vampire)u;

            vamp.blood -= World.staticMap.param.ability_unit_bloodCostInsanity;

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " beings imposing their dark will on the mind of " + u.location.person().getFullName() + ". Each turn, they will lose sanity" +
                                                       " until their mind snaps.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_VAMP_INSANITY"));
        }
        public override void castInner(Map map, Unit u)
        {
            u.task = new Task_Vamp_Infiltrate();

            Unit_Vampire vamp = (Unit_Vampire)u;

            vamp.blood -= World.staticMap.param.ability_unit_bloodCostInfiltrate;

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " begins infiltrating " + u.location.person().getFullName() + ". If successful your infiltration level will increase by " +
                                                       (int)(100 * Task_Vamp_Infiltrate.getEffectiveness(u)) + "%." +
                                                       " Security will reduce the amount of infiltration gained. No evidence will be left behind."
                                                       + " If the noble likes your vampire this infiltration will be more effective, but will reduce if they dislike them.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_UNIT_INFILTRATE"));
        }
        public override void castInner(Map map, Unit u)
        {
            Unit_Vampire vamp = (Unit_Vampire)u;

            vamp.blood = vamp.maxBlood;

            double   amount = map.param.unit_minorEvidence;
            Evidence e2     = new Evidence(map.turn);

            e2.pointsTo = u;
            e2.weight   = amount;
            u.location.evidence.Add(e2);

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " drinks from the blood of the living. They leave behind evidence of strength " + (int)(100 * amount) + "%",
                                                       u.location.map.world.wordStore.lookup("ABILITY_VAMP_DRINK"));
        }
        public override void turnTick(Unit unit)
        {
            if (unit.location.soc == null || (unit.location.soc is Society == false))
            {
                unit.task = null; return;
            }
            if (unit.location.settlement == null)
            {
                unit.task = null;  return;
            }
            if (unit.location.person() == null)
            {
                unit.task = null; return;
            }

            Unit_Vampire vampire = (Unit_Vampire)unit;

            bool wasInsane = unit.location.person().sanity == 0;

            unit.location.person().sanity -= 1;

            if (unit.location.person().sanity < 1)
            {
                if (!wasInsane)
                {
                    if (unit.location.person().society.sovereign.heldBy == unit.location.person())
                    {
                        if (unit.location.person().society.getLevel() > 0)
                        {
                            AchievementManager.unlockAchievement(SteamManager.achievement_key.ROYAL_BLOOD);
                        }
                    }
                }
                unit.location.person().sanity = 0;
                unit.location.map.world.prefabStore.popImgMsg(unit.getName() + " breaks the mind of " + unit.location.person().getFullName() +
                                                              ". They are now driven to madness.",
                                                              unit.location.map.world.wordStore.lookup("ABILITY_VAMP_INSANITY"));
                unit.task = null;
            }
        }
        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);
            }
        }