public override Sprite getGodBackground(World world)
 {
     return(world.textureStore.painting_monasteryRuins);
 }
 public override Sprite getSprite(World world)
 {
     return world.textureStore.unit_enthralled;
 }
示例#3
0
 public override Sprite getSprite(World world)
 {
     return(world.textureStore.unit_pumpkin);
 }
示例#4
0
 public void setTo(Unit unit, World world)
 {
     this.unit             = unit;
     this.unitLayer.sprite = unit.getSprite(world);
 }
 public abstract Sprite getSprite(World world);
        public virtual void turnTick(Map map)
        {
            if (task == null || (task is Task_Disrupted == false))
            {
                movesTaken = 0;
            }
            if (task != null && this.isEnthralled() && (task is Task_Disrupted == false))
            {
                bool lockedDown = false;
                foreach (Property pr in location.properties)
                {
                    if (pr.proto is Pr_Lockdown)
                    {
                        lockedDown = true;
                        break;
                    }
                }
                if (lockedDown)
                {
                    map.world.prefabStore.popMsg(this.getName() + " has had their task aborted, as the location they are in,  " + this.location.getName() + " is under security lockdown.");
                    task = null;
                }
            }
            if (hp == 0)
            {
                if (map.units.Contains(this))
                {
                    die(map, "Death of unknown cause.");
                }
                return;
            }
            if (checkForDisband(map))
            {
                return;
            }
            if (checkForLocDamage(map))
            {
                return;
            }
            turnTickInner(map);
            if (isEnthralled() == false)
            {
                turnTickAI(map);
            }
            else
            {
                if (automated)
                {
                    AI_WeakReleased(map);
                }
                if (task != null)
                {
                    task.turnTick(this);
                }
            }

            if (person != null && person.title_land != null)
            {
                if (Application.isEditor)
                {
                    World.log("Err data " + this.getName() + " " + person.getFullName());
                    throw new Exception("Editor-Only Exception: Caught a person who belonged to a unit and a nation");
                }

                //Can't remove a person from their nation, but can remove a nation from a person
                person.title_land.heldBy = null;
                person.title_land        = null;
            }
        }
示例#7
0
        public void hotkeys()
        {
            if (Input.GetKeyDown(KeyCode.Backspace) && Input.GetKey(KeyCode.LeftControl))
            {
                world.ui.uiMidTop.cheatField.gameObject.SetActive(!world.ui.uiMidTop.cheatField.gameObject.activeSelf);
            }

            if (world.ui.blocker != null)
            {
                return;
            }


            if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.Tab))
            {
            }
            else if (Input.GetKeyDown(KeyCode.LeftControl))
            {
            }
            else if (Input.GetKeyDown(KeyCode.Q))
            {
            }
            else if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (world.ui.state == UIMaster.uiState.VOTING)
                {
                    world.ui.uiVoting.bDismiss();
                }
                world.ui.setToMainMenu();
            }

            if (world.ui.state == UIMaster.uiState.WORLD || world.ui.state == UIMaster.uiState.BACKGROUND)
            {
                if (Input.GetKey(KeyCode.Alpha0))
                {
                    world.map.masker.mask = MapMaskManager.maskType.NONE;
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha1))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.NATION)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        World.log("Set to nation");
                        world.map.masker.mask = MapMaskManager.maskType.NATION;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha2))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.PROVINCE)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.PROVINCE;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha3))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.VOTE_EFFECT)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.VOTE_EFFECT;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha4))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.THREAT)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.THREAT;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha5))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.LIKING_ME)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.LIKING_ME;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha6))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.LIKING_THEM)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.LIKING_THEM;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha7))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.AWARENESS)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.AWARENESS;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha8))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.SUSPICION)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.SUSPICION;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.Alpha9))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.SUSPICION_FROM)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.SUSPICION_FROM;
                    }
                    GraphicalMap.checkData();
                }
                else if (Input.GetKeyDown(KeyCode.End))
                {
                    if (world.map.masker.mask == MapMaskManager.maskType.TESTING)
                    {
                        world.map.masker.mask = MapMaskManager.maskType.NONE;
                    }
                    else
                    {
                        world.map.masker.mask = MapMaskManager.maskType.TESTING;
                    }
                    GraphicalMap.checkData();
                }
            }
        }
        public override void implement(VoteOption option)
        {
            base.implement(option);

            society.lastEvidenceResponse = society.map.turn;
            foreach (Evidence ev in foundEvidence)
            {
                society.handledEvidence.Add(ev);
            }

            if (option.index == DEFEND_PROVINCE)
            {
                World.log(society.getName() + " implements crisis legislation, increasing security to " + society.map.provinces[option.province].name);
                foreach (Location loc in society.map.locations)
                {
                    if (loc.province.index == option.province && loc.soc == society)
                    {
                        Property.addProperty(society.map, loc, "Major Security Boost");
                    }
                }
                society.map.addMessage(society.getName() + " raises " + society.map.provinces[option.province].name + " security level", MsgEvent.LEVEL_ORANGE, false, society.map.provinces[option.province].coreHex);
            }
            if (option.index == NATIONWIDE_SECURITY)
            {
                World.log(society.getName() + " implements crisis legislation, increasing security nationwide");
                foreach (Location loc in society.map.locations)
                {
                    if (loc.province.index == option.province && loc.soc == society)
                    {
                        Property.addProperty(society.map, loc, "Minor Security Boost");
                    }
                }
                society.map.addMessage(society.getName() + " raises its security level nationwide", MsgEvent.LEVEL_ORANGE, false, society.getCapitalHex());
            }
            if (option.index == NO_RESPONSE)
            {
                World.log(society.getName() + " implements crisis legislation, does nothing");
            }
            if (option.index == EXPELL_ALL_FOREIGN_AGENTS)
            {
                bool agentsExpelled = false;
                foreach (Unit u in society.map.units)
                {
                    if (u.society != society && society.enemies.Contains(u) == false)
                    {
                        society.enemies.Add(u);
                        if (u.isEnthralled())
                        {
                            agentsExpelled = true;
                        }
                    }
                }
                if (agentsExpelled)
                {
                    society.map.world.prefabStore.popMsg(society.getName() + " expells all foreign agents, in response to evidence discovered." +
                                                         " All your existing agents will now be attacked on sight if they enter or are in its lands. New agents will still be acceptable.");
                }
                World.log(society.getName() + " implements crisis legislation, expelling all foreign agents");
                society.map.addMessage(society.getName() + " outlaws all foreign agents", MsgEvent.LEVEL_RED, false, society.getCapitalHex());
            }
            if (option.index == INVESTIGATOR_HOSTILITY)
            {
                foreach (Evidence ev in foundEvidence)
                {
                    if (ev.discoveredBy.society == society && ev.discoveredBy != null && ev.pointsTo != null && (ev.discoveredBy.hostileTo(ev.pointsTo) == false))
                    {
                        ev.discoveredBy.hostility.Add(ev.pointsTo);
                        society.map.addMessage(ev.discoveredBy.getName() + " permitted to attack " + ev.pointsTo.getName(), MsgEvent.LEVEL_RED, !ev.pointsTo.isEnthralled());
                        if (ev.pointsTo.isEnthralled())
                        {
                            society.map.world.prefabStore.popMsg("The nobles of " + society.getName() + " have given permission their agent, " + ev.discoveredBy.getName()
                                                                 + " to attack " + ev.pointsTo.getName() + " on sight, if they encounter them during investigations.");
                        }
                    }
                }
            }
            if (option.index == LOCKDOWN_PROVINCE)
            {
                World.log(society.getName() + " implements crisis legislation, fully locking down " + society.map.provinces[option.province].name);
                Unit enthralledVic = null;
                foreach (Location loc in society.map.locations)
                {
                    if (loc.province.index == option.province && loc.soc == society)
                    {
                        Property.addProperty(society.map, loc, "Lockdown");
                        foreach (Unit u in loc.units)
                        {
                            if (u.isEnthralled())
                            {
                                enthralledVic = u;
                            }
                        }
                    }
                }
                society.map.addMessage(society.getName() + " locks down " + society.map.provinces[option.province].name, MsgEvent.LEVEL_ORANGE, false, society.map.provinces[option.province].coreHex);
                if (enthralledVic != null)
                {
                    society.map.world.prefabStore.popMsg(society.getName() + " has imposed a complete lockdown in the province " + society.map.provinces[option.province].name +
                                                         " which impacts your agent " + enthralledVic.getName() + "'s ability to operate until the lockdown is over.");
                }
            }

            if (option.index == AGENT_TO_INVESTIGATOR)
            {
                Unit_Investigator inv = (Unit_Investigator)option.unit;
                inv.changeState(Unit_Investigator.unitState.investigator);
                World.self.prefabStore.popMsgAgent(option.unit, option.unit, option.unit.getName() + " has been assigned the role of Investigator, by the nobles of " + option.unit.society.getName() +
                                                   " in response to external threats. Investigators are experts at combatting your agents. They can recognise evidence and spot your agents if they are in the same location.");
            }
            if (option.index == AGENT_TO_BASIC)
            {
                Unit_Investigator inv = (Unit_Investigator)option.unit;
                inv.changeState(Unit_Investigator.unitState.basic);
                if (inv.person.isWatched())
                {
                    World.self.prefabStore.popMsgAgent(option.unit, option.unit, option.unit.getName() + " has been assigned the role of Agent, by the nobles of " + option.unit.society.getName() +
                                                       " in response to external threats. Standard agents are general-purpose units. They can investigate your agents' evidence, and can assist in wars. They can be promoted "
                                                       + " to specalists by vote.");
                }
            }
        }