コード例 #1
0
 public void Revolt()
 {
     _anarchy   = (short)((HasWonder <Pyramids>() && !Game.WonderObsolete <Pyramids>()) ? 0 : 4 - (Game.GameTurn % 4) - 1);
     Government = new Anarchy();
     if (!IsHuman)
     {
         return;
     }
     GameTask.Enqueue(Message.Newspaper(null, $"The {Game.Instance.HumanPlayer.TribeNamePlural} are", "revolting! Citizens", "demand new govt."));
 }
コード例 #2
0
    void placeTiles()
    {
        Anarchy anarchy = GetComponent <Anarchy>();

        for (int x = 0; x < size.x; x += 1)
        {
            for (int y = 0; y < size.y; y += 1)
            {
                int   i = x * size.x + y;
                ulong s = anarchy.cohort_shuffle(
                    (ulong)i,
                    (ulong)(size.x * size.y),
                    seed
                    );

                int xx = where.x + (int)s % size.x;
                int yy = where.y + (int)s / size.x;

                Tile which = common;
                if (i == 0)
                {
                    which = rare;
                }
                else if (i < 6)
                {
                    which = uncommon;
                }

                Tilemap tilemap = gameObject.GetComponent <Tilemap>();
                if (tilemap != null)
                {
                    tilemap.SetTile(new Vector3Int(xx, yy, 0), which);
                }
            }
        }
    }
コード例 #3
0
ファイル: Warehouse.cs プロジェクト: siggame/Joueur.cs
 /// <summary>
 /// Bribes the Warehouse to light a Building on fire. This adds this building's fireAdded to their fire, and then this building's exposure is increased based on the Manhatten distance between the two buildings.
 /// </summary>
 /// <param name="building">The Building you want to light on fire.</param>
 /// <returns>The exposure added to this Building's exposure. -1 is returned if there was an error.</returns>
 public int Ignite(Anarchy.Building building)
 {
     return this.RunOnServer<int>("ignite", new Dictionary<string, object> {
         {"building", building}
     });
 }
コード例 #4
0
ファイル: FireDepartment.cs プロジェクト: siggame/Joueur.cs
 /// <summary>
 /// Bribes this FireDepartment to extinguish the some of the fire in a building.
 /// </summary>
 /// <param name="building">The Building you want to extinguish.</param>
 /// <returns>true if the bribe worked, false otherwise</returns>
 public bool Extinguish(Anarchy.Building building)
 {
     return this.RunOnServer<bool>("extinguish", new Dictionary<string, object> {
         {"building", building}
     });
 }