Exemple #1
0
        public override void castInner(Map map, Unit u)
        {
            Unit_NecroDoctor doc = (Unit_NecroDoctor)u;

            Property del = null;

            foreach (Property p in u.location.properties)
            {
                if (p.proto is Pr_RecentHumanBattle)
                {
                    del = p;
                }
            }

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

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

            if (del == null)
            {
                map.world.prefabStore.popMsg("No battlefield to loot");
                return;
            }


            doc.corpses = doc.maxCorpses;

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " loots the bodies from the battlefield, piling high worthy corpses, their dead hands still gripping their weapons of war."
                                                       + "\nThese should be carried to one or more corpseroot patches to preserve them until their next battle.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_ROB_BATTLEFIELD"));
        }
        public override void castInner(Map map, Unit u)
        {
            Unit_NecroDoctor doc = (Unit_NecroDoctor)u;

            Property.addProperty(map, u.location, "Empty Graves");


            doc.corpses += map.param.unit_doctor_lootBodiesAmount;
            if (doc.corpses > doc.maxCorpses)
            {
                doc.corpses = doc.maxCorpses;
            }

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " removes the bodies from " + u.location.getName() + ", using official documents (forged or otherwise) to justify their actions." +
                                                       " Therefore no evidence is left behind. They have " + doc.corpses + "/" + doc.maxCorpses
                                                       + " corpses, these should be carried to a corpseroot field before they decay.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_LEGAL_REMOVAL"));
        }
Exemple #3
0
        public override void castInner(Map map, Unit u)
        {
            Unit_NecroDoctor doc = (Unit_NecroDoctor)u;

            int            nDumped = doc.corpses;
            Set_Corpseroot set     = (Set_Corpseroot)u.location.settlement;


            if (set.embeddedUnit == null)
            {
                set.embeddedUnit = new Unit_ArmyOfTheDead(u.location, u.location.soc);
                u.location.units.Remove(set.embeddedUnit);
            }
            int space = set.embeddedUnit.maxHp - set.embeddedUnit.hp;

            nDumped = Math.Min(space, nDumped);

            doc.corpses         -= nDumped;
            set.embeddedUnit.hp += nDumped;

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " dumps the bodies onto the corpseroot, allowing them to remain in wait for when you call upon them to rise and attack the living.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_DUMP_BODIES"));
        }
Exemple #4
0
        public override void castInner(Map map, Unit u)
        {
            Unit_NecroDoctor doc = (Unit_NecroDoctor)u;

            Property.addProperty(map, u.location, "Empty Graves");


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

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

            int security = 0;

            if (u.location.settlement != null)
            {
                security = u.location.settlement.getSecurity(new System.Collections.Generic.List <ReasonMsg>());
            }
            int nStolen = map.param.unit_doctor_lootBodiesAmount - security;

            if (nStolen < 1)
            {
                nStolen = 1;
            }
            doc.corpses += nStolen;
            if (doc.corpses > doc.maxCorpses)
            {
                doc.corpses = doc.maxCorpses;
            }

            u.location.map.world.prefabStore.popImgMsg(u.getName() + " loots " + nStolen + " bodies from " + u.location.getName() + " (Maximum is " + map.param.unit_doctor_lootBodiesAmount
                                                       + " location security is " + security + "). They have " + doc.corpses + "/" + doc.maxCorpses
                                                       + " corpses, these should be carried to a corpseroot field before they decay.",
                                                       u.location.map.world.wordStore.lookup("ABILITY_DOCTOR_ROB_GRAVES"));
        }
        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);
            }
        }