{
  "schema": 3,
  "rules": [
    {
      "id": "paliers-likes",
      "label": "Paliers de likes",
      "on": [
        {
          "type": "hearts",
          "milestones": [
            1000,
            5000,
            10000
          ]
        },
        {
          "type": "platform",
          "platform": "tiktok",
          "event": "like_total",
          "milestones": [
            1000,
            5000,
            10000
          ]
        }
      ],
      "do": [
        {
          "kind": "switch",
          "id": "selon-palier",
          "conditions": [
            {
              "all": [
                {
                  "left": "hearts.palier",
                  "op": ">=",
                  "right": 10000
                }
              ]
            },
            {
              "all": [
                {
                  "left": "hearts.palier",
                  "op": ">=",
                  "right": 5000
                }
              ]
            }
          ],
          "branches": [
            [
              {
                "kind": "repeat",
                "id": "trois-fanfares",
                "times": 3,
                "gapMs": 1500,
                "branches": [
                  [
                    {
                      "kind": "action",
                      "id": "fanfare",
                      "effect": {
                        "type": "sound",
                        "soundId": "34f7bfb4-b51f-11f1-a1b0-920007989f15",
                        "volume": 0.8
                      }
                    }
                  ]
                ]
              }
            ],
            [
              {
                "kind": "action",
                "id": "wow",
                "effect": {
                  "type": "sound",
                  "soundId": "2ebf44c5-b51a-11f1-a1b0-920007989f15"
                }
              }
            ]
          ],
          "else": [
            {
              "kind": "action",
              "id": "merci",
              "effect": {
                "type": "chat",
                "text": "{hearts.palier} likes, merci à tous !",
                "cooldownMs": 10000
              }
            }
          ]
        }
      ]
    },
    {
      "id": "paliers-partages",
      "label": "Paliers de partages",
      "on": {
        "type": "share_total",
        "milestones": [
          10,
          50,
          100
        ]
      },
      "do": [
        {
          "kind": "action",
          "id": "voix",
          "effect": {
            "type": "tts",
            "text": "{shares.total} partages, merci !"
          }
        }
      ]
    },
    {
      "id": "selon-montant",
      "label": "Selon le montant du cadeau",
      "on": {
        "type": "gift",
        "minCoins": 1
      },
      "do": [
        {
          "kind": "switch",
          "id": "selon-pieces",
          "conditions": [
            {
              "all": [
                {
                  "left": "coins",
                  "op": ">=",
                  "right": 500
                }
              ]
            },
            {
              "all": [
                {
                  "left": "coins",
                  "op": ">=",
                  "right": 100
                }
              ]
            }
          ],
          "branches": [
            [
              {
                "kind": "action",
                "id": "gros",
                "effect": {
                  "type": "sound",
                  "soundId": "34f7bfb4-b51f-11f1-a1b0-920007989f15"
                }
              }
            ],
            [
              {
                "kind": "repeat",
                "id": "klaxons",
                "times": 1,
                "gapMs": 600,
                "cases": [
                  {
                    "when": {
                      "all": [
                        {
                          "left": "quantity",
                          "op": ">=",
                          "right": 5
                        }
                      ]
                    },
                    "times": 5
                  }
                ],
                "branches": [
                  [
                    {
                      "kind": "action",
                      "id": "klaxon",
                      "effect": {
                        "type": "sound",
                        "soundId": "301b847c-b529-11f1-a1b0-920007989f15"
                      }
                    }
                  ]
                ]
              }
            ]
          ],
          "else": [
            {
              "kind": "action",
              "id": "petit",
              "effect": {
                "type": "chat",
                "text": "Merci {sender.name} pour {gift.name} !",
                "cooldownMs": 5000
              }
            }
          ]
        }
      ]
    }
  ]
}
