예제 #1
0
 public void onClick()
 {
     if (targetHex != null)
     {
         GraphicalMap.panTo(targetHex.x, targetHex.y);
     }
 }
예제 #2
0
        public void agent_Standard()
        {
            overmind.map.overmind.availableEnthrallments -= 1;
            World.log("Spawning tester dark at turn " + overmind.map.turn);
            Location spawn = null;

            foreach (Unit u in overmind.map.units)
            {
                if (u is Unit_TesterDark)
                {
                    spawn = u.location.getNeighbours()[0];
                }
            }
            if (spawn == null)
            {
                spawn = overmind.map.locations[Eleven.random.Next(overmind.map.locations.Count)];
            }

            Unit agent = new Unit_TesterDark(spawn, overmind.map.soc_dark);

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

            Evidence ev = new Evidence(overmind.map.turn);

            ev.pointsTo = agent;
            ev.weight   = 0.66;
            agent.location.evidence.Add(ev);

            agent.task = null;

            GraphicalMap.panTo(spawn.hex.x, spawn.hex.y);
        }
예제 #3
0
        public void bButton()
        {
            List <Unit> freeAgents  = new List <Unit>();
            List <Unit> busyAgents  = new List <Unit>();
            List <Unit> movedAgents = new List <Unit>();

            foreach (Unit u in world.map.units)
            {
                if (u.isEnthralled() && (!u.automated))
                {
                    if (u.movesTaken == 0)
                    {
                        if (u.task == null)
                        {
                            freeAgents.Add(u);
                        }
                        else if (u.task is Task_Disrupted == false)
                        {
                            busyAgents.Add(u);
                        }
                    }
                    else
                    {
                        movedAgents.Add(u);
                    }
                }
            }
            List <Unit> allAgents = new List <Unit>();

            allAgents.AddRange(freeAgents);
            allAgents.AddRange(busyAgents);
            allAgents.AddRange(movedAgents);

            if (allAgents.Count == 0)
            {
                return;
            }

            int index = 0;

            if (GraphicalMap.selectedSelectable is Unit)
            {
                if (allAgents.Contains((Unit)GraphicalMap.selectedSelectable))
                {
                    index = allAgents.IndexOf((Unit)GraphicalMap.selectedSelectable);
                    if (index < allAgents.Count - 1)
                    {
                        index += 1;
                    }
                    else
                    {
                        index = 0;
                    }
                }
            }
            GraphicalMap.selectedSelectable = allAgents[index];
            GraphicalMap.panTo(allAgents[index].location.hex.x, allAgents[index].location.hex.y);
            world.ui.checkData();
        }
예제 #4
0
 public void dismissAgentB()
 {
     GraphicalMap.panTo(agentB.location.hex.x, agentB.location.hex.y);
     if (agentB.location.units.Contains(agentB))
     {
         GraphicalMap.selectedSelectable = agentB;
     }
     ui.removeBlocker(this.gameObject);
 }
 public void clicked(Map map)
 {
     //selector.selected(person,agent);
     if (person.getLocation() != null)
     {
         try
         {
             GraphicalMap.panTo(person.getLocation().hex.x, person.getLocation().hex.y);
         }
         catch
         {
             //Ignore
         }
     }
 }
예제 #6
0
        public void bViewSociety()
        {
            if (state == uiState.SOCIETY)
            {
                if (GraphicalSociety.focus != null)
                {
                    Location loc = GraphicalSociety.focus.getLocation();
                    if (loc != null)
                    {
                        Hex hex = loc.hex;
                        GraphicalMap.panTo(hex.x, hex.y);
                        GraphicalMap.selectedHex = hex;
                    }
                }

                world.audioStore.playClick();
                setToWorld();
            }
            else if (state == uiState.WORLD)
            {
                if (GraphicalMap.selectedHex == null)
                {
                    return;
                }
                if (GraphicalMap.selectedHex.owner == null)
                {
                    return;
                }
                if (GraphicalMap.selectedHex.owner is Society == false)
                {
                    return;
                }

                world.audioStore.playClick();

                GraphicalSociety.focus = GraphicalMap.selectedHex.location.person();
                setToSociety((Society)GraphicalMap.selectedHex.owner);
            }
        }
예제 #7
0
        public void agent_Fog()
        {
            int      c     = 0;
            Location spawn = null;

            foreach (Location loc in map.locations)
            {
                if (loc.hex.cloud is Cloud_Fog)
                {
                    spawn = loc;
                }
            }
            if (spawn == null)
            {
                spawn = overmind.map.locations[Eleven.random.Next(overmind.map.locations.Count)];
            }
            if (spawn != null)
            {
                overmind.map.overmind.availableEnthrallments -= 1;
                World.log("Spawning tester dark at turn " + overmind.map.turn);

                Unit agent = new Unit_TesterDarkFog(spawn, overmind.map.soc_dark);

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

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

                agent.task = null;

                GraphicalMap.panTo(spawn.hex.x, spawn.hex.y);
            }
        }
 public void dismissAgentA()
 {
     GraphicalMap.panTo(agentA.location.hex.x, agentA.location.hex.y);
     GraphicalMap.selectedSelectable = null;
     ui.removeBlocker(this.gameObject);
 }
 public void dismissGoto()
 {
     GraphicalMap.panTo(society.getCapital().hex.x, society.getCapital().hex.y);
     ui.removeBlocker(this.gameObject);
 }