{
  "GS2TemplateFormatVersion": "2019-05-01",
  "Description": "Adventure tutorial: characters.json",
  "Resources": {
    "Characters": {
      "Type": "GS2::Inventory::Namespace",
      "Properties": {
        "Name": "adventure-character",
        "TransactionSettingV2": {
          "DistributorNamespaceId": "grn:gs2:{region}:{ownerId}:distributor:default",
          "EnableParallelExecution": false
        }
      }
    },
    "CharacterMaster": {
      "Type": "GS2::Inventory::CurrentItemModelMaster",
      "Properties": {
        "NamespaceName": "adventure-character",
        "Settings": {
          "version": "2019-02-05",
          "inventoryModels": [
            {
              "name": "Character",
              "initialCapacity": 20,
              "maxCapacity": 100,
              "itemModels": [
                {
                  "name": "knight",
                  "sortValue": 1,
                  "stackingLimit": 1,
                  "allowMultipleStacks": true
                },
                {
                  "name": "mage",
                  "sortValue": 2,
                  "stackingLimit": 1,
                  "allowMultipleStacks": true
                }
              ]
            }
          ]
        },
        "Mode": "direct"
      },
      "DependsOn": [
        "Characters"
      ]
    },
    "Experience": {
      "Type": "GS2::Experience::Namespace",
      "Properties": {
        "Name": "adventure-character-experience",
        "TransactionSettingV2": {
          "DistributorNamespaceId": "grn:gs2:{region}:{ownerId}:distributor:default",
          "EnableParallelExecution": false
        }
      }
    },
    "ExperienceMaster": {
      "Type": "GS2::Experience::CurrentExperienceMaster",
      "Properties": {
        "NamespaceName": "adventure-character-experience",
        "Settings": {
          "version": "2019-01-11",
          "experienceModels": [
            {
              "name": "Experience",
              "defaultExperience": 0,
              "defaultRankCap": 4,
              "maxRankCap": 4,
              "rankThreshold": {
                "values": [
                  1,
                  10,
                  20
                ]
              }
            }
          ]
        },
        "Mode": "direct"
      },
      "DependsOn": [
        "Experience"
      ]
    },
    "Formation": {
      "Type": "GS2::Formation::Namespace",
      "Properties": {
        "Name": "adventure-character-formation",
        "TransactionSettingV2": {
          "DistributorNamespaceId": "grn:gs2:{region}:{ownerId}:distributor:default",
          "EnableParallelExecution": false
        }
      }
    },
    "FormationMaster": {
      "Type": "GS2::Formation::CurrentFormMaster",
      "Properties": {
        "NamespaceName": "adventure-character-formation",
        "Settings": {
          "version": "2019-09-09",
          "moldModels": [
            {
              "name": "CharacterFormation",
              "initialMaxCapacity": 1,
              "maxCapacity": 1,
              "formModel": {
                "name": "CharacterFormation",
                "slots": [
                  {
                    "name": "slot1",
                    "propertyRegex": ".*"
                  },
                  {
                    "name": "slot2",
                    "propertyRegex": ".*"
                  },
                  {
                    "name": "slot3",
                    "propertyRegex": ".*"
                  }
                ]
              }
            }
          ]
        },
        "Mode": "direct"
      },
      "DependsOn": [
        "Formation"
      ]
    },
    "Lottery": {
      "Type": "GS2::Lottery::Namespace",
      "Properties": {
        "Name": "adventure-character-gacha",
        "TransactionSettingV2": {
          "DistributorNamespaceId": "grn:gs2:{region}:{ownerId}:distributor:default",
          "EnableParallelExecution": false
        }
      }
    },
    "LotteryMaster": {
      "Type": "GS2::Lottery::CurrentLotteryMaster",
      "Properties": {
        "NamespaceName": "adventure-character-gacha",
        "Settings": {
          "version": "2019-02-21",
          "lotteryModels": [
            {
              "name": "normal",
              "mode": "normal",
              "method": "prize_table",
              "prizeTableName": "normal"
            }
          ],
          "prizeTables": [
            {
              "name": "normal",
              "prizes": [
                {
                  "prizeId": "knight",
                  "type": "action",
                  "weight": 1,
                  "acquireActions": [
                    {
                      "action": "Gs2Inventory:AcquireItemSetByUserId",
                      "request": "{\"namespaceName\":\"adventure-character\",\"userId\":\"#{userId}\",\"inventoryName\":\"Character\",\"itemName\":\"knight\",\"acquireCount\":1}"
                    }
                  ]
                },
                {
                  "prizeId": "mage",
                  "type": "action",
                  "weight": 1,
                  "acquireActions": [
                    {
                      "action": "Gs2Inventory:AcquireItemSetByUserId",
                      "request": "{\"namespaceName\":\"adventure-character\",\"userId\":\"#{userId}\",\"inventoryName\":\"Character\",\"itemName\":\"mage\",\"acquireCount\":1}"
                    }
                  ]
                }
              ]
            }
          ]
        },
        "Mode": "direct"
      },
      "DependsOn": [
        "Lottery"
      ]
    },
    "Showcase": {
      "Type": "GS2::Showcase::Namespace",
      "Properties": {
        "Name": "adventure-character-gacha",
        "TransactionSettingV2": {
          "DistributorNamespaceId": "grn:gs2:{region}:{ownerId}:distributor:default",
          "EnableParallelExecution": false
        }
      }
    },
    "ShowcaseMaster": {
      "Type": "GS2::Showcase::CurrentShowcaseMaster",
      "Properties": {
        "NamespaceName": "adventure-character-gacha",
        "Settings": {
          "version": "2019-04-04",
          "showcases": [
            {
              "name": "Showcase",
              "displayItems": [
                {
                  "displayItemId": "normal",
                  "type": "salesItem",
                  "salesItem": {
                    "name": "normal",
                    "consumeActions": [
                      {
                        "action": "Gs2Money2:WithdrawByUserId",
                        "request": "{\"namespaceName\":\"adventure-coin\",\"userId\":\"#{userId}\",\"slot\":0,\"withdrawCount\":20,\"paidOnly\":false}"
                      }
                    ],
                    "acquireActions": [
                      {
                        "action": "Gs2Lottery:DrawByUserId",
                        "request": "{\"namespaceName\":\"adventure-character-gacha\",\"userId\":\"#{userId}\",\"lotteryName\":\"normal\",\"count\":1}"
                      }
                    ]
                  }
                }
              ]
            }
          ]
        },
        "Mode": "direct"
      },
      "DependsOn": [
        "Showcase"
      ]
    }
  }
}
