---
# 基本建設規則
# 檢查是否被攻擊
- is_Attacked:
    # we are in Peace :D
    0:
      - is_constructing:
         # already building something.
         1: 
         # let's find something to build up
         0:
            # 確認是否為主城
            # 確認是否有學院
            - is_gold_enoughforcargo:
               1: increaseTransporter
            - is_wall_enough:
               0: build_wall
            - is_space_enough:
               0: 
                  - is_resource_enoghforHall:
                     1: build_townHall
            - is_corruption:
               1: build_governorsresidence
            # 倉庫庫存量
            - is_warehouse_enough:
               0: build_warehouse
            - is_risk:
               1: 
                  - is_shipyard:
                     0: 
                        - is_drydock_researched: 
                           0: resaerch_drydock
                           1: build_shipyard
            - is_happiness:
               0: 
                  - is_winepress_researched:
                     0: research_economy
                     1: build_tavern
                     # reduce_trvern
            # 是主城, 可隨意建任一尚未搭建之建築
            # 副城, 不建 ...
    # 採取防禦措施
    1: run_defense
