[
  {
    "id": "TALK_TRUE_FOODPERSON",
    "type": "talk_topic",
    "dynamic_line": {
      "u_is_wearing": "foodperson_mask",
      "yes": {
        "npc_has_var": "foodperson_has_talked",
        "type": "dialogue",
        "context": "foodperson",
        "value": "yes",
        "no": "What sorcery is this?",
        "yes": {
          "npc_has_var": "foodperson_meeting_solved",
          "type": "dialogue",
          "context": "foodperson",
          "value": "yes",
          "no": "So you're back… Explain yourself!",
          "yes": "Greetings friend, it's nice to see you."
        }
      },
      "no": {
        "u_is_wearing": "foodkid_badge",
        "yes": "Welcome home Foodkid!",
        "no": {
          "npc_has_var": "npc_foodperson_impressed",
          "type": "dialogue",
          "context": "foodperson",
          "value": "yes",
          "yes": "Greetings friend, it's nice to see you.",
          "no": {
            "npc_has_var": "foodperson_has_talked",
            "type": "dialogue",
            "context": "foodperson",
            "value": "yes",
            "no": "Greeting citizen, what brings you to the FoodLair?",
            "yes": "Still here?  Take your time, it's rough out there."
          }
        }
      }
    },
    "speaker_effect": { "effect": { "npc_add_var": "foodperson_has_talked", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [
      {
        "condition": {
          "or": [
            {
              "and": [
                { "npc_has_var": "foodperson_has_talked", "type": "dialogue", "context": "foodperson", "value": "yes" },
                {
                  "not": { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                }
              ]
            },
            {
              "and": [
                { "npc_has_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" },
                {
                  "or": [
                    { "u_has_trait": "PROF_FOODP" },
                    { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                  ]
                }
              ]
            }
          ]
        },
        "text": "Hey.  Let's chat for a second.",
        "topic": "TALK_FOODPERSON_MAIN"
      },
      {
        "condition": {
          "and": [
            { "not": { "npc_has_var": "foodperson_has_talked", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "and": [
                { "not": { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] } },
                { "not": { "u_is_wearing": "foodkid_badge" } }
              ]
            }
          ]
        },
        "text": "Greetings…  Foodperson?",
        "topic": "TALK_FOODPERSON_INTRODUCTION"
      },
      {
        "condition": {
          "and": [
            { "not": { "npc_has_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            { "not": { "u_has_trait": "PROF_FOODP" } },
            { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
          ]
        },
        "text": "I am you but from an alternate reality.",
        "trial": { "type": "LIE", "difficulty": 10, "mod": [ [ "TRUST", 1 ], [ "VALUE", 1 ] ] },
        "success": { "topic": "TALK_FOODPERSON_MULTIVERSE", "opinion": { "trust": 2, "value": 2 } },
        "failure": { "topic": "TALK_FOODPERSON_ONLYONE", "opinion": { "trust": -5, "value": -5 } }
      },
      {
        "condition": {
          "and": [
            { "not": { "npc_has_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] },
            { "u_has_trait": "PROF_FOODP" }
          ]
        },
        "text": "I am Foodperson, who are YOU?",
        "topic": "TALK_FOODPERSON_TWO"
      },
      {
        "condition": {
          "and": [
            { "not": { "npc_has_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] },
            { "u_has_trait": "PROF_FOODP" }
          ]
        },
        "text": "There is only one real Foodperson!",
        "topic": "TALK_FOODPERSON_ONLYONE"
      },
      {
        "condition": {
          "and": [
            { "not": { "npc_has_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] },
            { "not": { "u_has_trait": "PROF_FOODP" } }
          ]
        },
        "text": "I am the REAL Foodperson!",
        "topic": "TALK_FOODPERSON_ONLYONE"
      },
      {
        "text": "So, you are a REAL FOODPERSON, right?  You know my <name_g> over there?  You know that you ruined his legacy?",
        "condition": { "u_has_mission": "MISSION_pizzaiolo_2" },
        "topic": "TALK_TRUE_FOODPERSON_pizzaiolo"
      },
      { "text": "Nevermind me, I'm just going to leave.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_INTRODUCTION",
    "type": "talk_topic",
    "dynamic_line": "Indeed it is I!  The one and only FOODPERSON!",
    "responses": [
      {
        "text": "Wow!  Such an honor to meet you in person!",
        "topic": "TALK_FOODPERSON_MAIN",
        "opinion": { "trust": 1, "value": 1 }
      },
      {
        "text": "Are you joking?  Foodperson is not real, it's a restaurant mascot!",
        "opinion": { "trust": -1, "value": -1 },
        "topic": "TALK_FOODPERSON_DOUBTED"
      },
      {
        "text": "The great Foodperson in the flesh!  Such an honor to finally meet you in person!",
        "trial": { "type": "LIE", "difficulty": 60, "mod": [ [ "TRUST", 2 ], [ "VALUE", 2 ] ] },
        "success": { "topic": "TALK_FOODPERSON_MAIN", "opinion": { "trust": 2, "value": 2 } },
        "failure": { "topic": "TALK_FOODPERSON_VEXED", "opinion": { "trust": -5, "value": -5 } }
      },
      { "text": "Ah…  Well, nice to meet you Foodperson.", "topic": "TALK_FOODPERSON_MAIN" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_VEXED",
    "type": "talk_topic",
    "dynamic_line": "Do not mock me, for my strength is quite real!  Get out of here now!",
    "responses": [
      { "text": "Sheesh, ok, calm down, I'm leaving!", "topic": "TALK_DONE" },
      { "text": "Forgive me, I didn't mean to disrespect you.", "topic": "TALK_FOODPERSON_MAIN" },
      { "text": "Oh yeah?  Show me what you can do!", "topic": "TALK_DONE", "effect": "hostile" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_DOUBTED",
    "type": "talk_topic",
    "dynamic_line": "A common mistake, but I can assure you that I'm very real!",
    "responses": [
      { "text": "Sure, whatever.", "topic": "TALK_DONE" },
      { "text": "Ok…  I believe you.", "topic": "TALK_FOODPERSON_MAIN" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_MAIN",
    "type": "talk_topic",
    "dynamic_line": "Anyway, do you need something?",
    "responses": [
      {
        "text": "Are you interested in some trading?",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_trade", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "not": { "npc_has_var": "npc_success_trade", "type": "dialogue", "context": "foodperson", "value": "yes" }
            },
            {
              "not": {
                "and": [
                  { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                  {
                    "or": [
                      { "u_has_trait": "PROF_FOODP" },
                      { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                    ]
                  }
                ]
              }
            }
          ]
        },
        "trial": { "type": "PERSUADE", "difficulty": 50, "mod": [ [ "TRUST", 2 ], [ "VALUE", 2 ] ] },
        "success": { "topic": "TALK_FOODPERSON_TRADE" },
        "failure": { "topic": "TALK_FOODPERSON_NOTRADE" }
      },
      {
        "text": "Let's trade?",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_trade", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "or": [
                { "npc_has_var": "npc_success_trade", "type": "dialogue", "context": "foodperson", "value": "yes" },
                {
                  "npc_has_var": "npc_foodperson_impressed",
                  "type": "dialogue",
                  "context": "foodperson",
                  "value": "yes"
                },
                {
                  "and": [
                    { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                    {
                      "or": [
                        { "u_has_trait": "PROF_FOODP" },
                        { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        "effect": "start_trade",
        "topic": "TALK_DONE"
      },
      {
        "text": "I'm looking for a place to stay.",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_shelter", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "not": { "npc_has_var": "npc_success_shelter", "type": "dialogue", "context": "foodperson", "value": "yes" }
            },
            {
              "not": {
                "and": [
                  { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                  {
                    "or": [
                      { "u_has_trait": "PROF_FOODP" },
                      { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                    ]
                  }
                ]
              }
            }
          ]
        },
        "trial": { "type": "PERSUADE", "difficulty": 20, "mod": [ [ "TRUST", 2 ], [ "VALUE", 2 ] ] },
        "success": { "topic": "TALK_FOODPERSON_SHELTER" },
        "failure": { "topic": "TALK_FOODPERSON_NOSHELTER" }
      },
      {
        "text": "I want to get stronger.  Please teach me.",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_training", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "not": { "npc_has_var": "npc_success_training", "type": "dialogue", "context": "foodperson", "value": "yes" }
            },
            {
              "not": {
                "and": [
                  { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                  {
                    "or": [
                      { "u_has_trait": "PROF_FOODP" },
                      { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                    ]
                  }
                ]
              }
            }
          ]
        },
        "trial": { "type": "PERSUADE", "difficulty": 20, "mod": [ [ "TRUST", 2 ], [ "VALUE", 2 ] ] },
        "success": { "topic": "TALK_FOODPERSON_TRAINING" },
        "failure": { "topic": "TALK_FOODPERSON_NOTRAINING" }
      },
      {
        "text": "Please share your knowledge.",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_training", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "or": [
                { "npc_has_var": "npc_success_training", "type": "dialogue", "context": "foodperson", "value": "yes" },
                {
                  "npc_has_var": "npc_foodperson_impressed",
                  "type": "dialogue",
                  "context": "foodperson",
                  "value": "yes"
                },
                {
                  "and": [
                    { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                    {
                      "or": [
                        { "u_has_trait": "PROF_FOODP" },
                        { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        "topic": "TALK_TRAIN"
      },
      {
        "text": "I'm building up a team, people with special abilities.",
        "condition": {
          "and": [
            { "not": { "npc_has_var": "npc_failed_team", "type": "dialogue", "context": "foodperson", "value": "yes" } },
            {
              "not": { "npc_has_var": "npc_success_team", "type": "dialogue", "context": "foodperson", "value": "yes" }
            },
            {
              "not": { "npc_has_var": "npc_foodperson_impressed", "type": "dialogue", "context": "foodperson", "value": "yes" }
            },
            {
              "not": {
                "and": [
                  { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
                  {
                    "or": [
                      { "u_has_trait": "PROF_FOODP" },
                      { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
                    ]
                  }
                ]
              }
            }
          ]
        },
        "trial": { "type": "PERSUADE", "difficulty": 0, "mod": [ [ "TRUST", 2 ], [ "VALUE", 2 ] ] },
        "success": {
          "topic": "TALK_FOODPERSON_SIDEKICK",
          "effect": { "npc_add_var": "npc_success_team_team", "type": "dialogue", "context": "foodperson", "value": "yes" }
        },
        "failure": { "topic": "TALK_FOODPERSON_SOLO" }
      },
      {
        "text": "Can you tell me again about this sidekick offer?",
        "condition": {
          "and": [
            { "npc_has_var": "npc_sidekick_offer", "type": "dialogue", "context": "foodperson", "value": "yes" },
            { "not": "has_assigned_mission" }
          ]
        },
        "topic": "TALK_FOODPERSON_SIDEKICK"
      },
      {
        "text": "Alright, I thought about this, what do you say about we team up?",
        "condition": {
          "and": [
            { "npc_has_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" },
            {
              "or": [
                { "u_has_trait": "PROF_FOODP" },
                { "or": [ { "u_is_wearing": "foodperson_mask" }, { "u_is_wearing": "foodperson_mask_on" } ] }
              ]
            }
          ]
        },
        "topic": "TALK_FOODPERSON_TEAMUP"
      },
      { "text": "I'm good, bye.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_NOTRADE",
    "type": "talk_topic",
    "dynamic_line": "I already have everything I need here in the FoodLair!",
    "speaker_effect": { "effect": { "npc_add_var": "npc_failed_trade", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "Fair enough.", "topic": "TALK_NONE" } ]
  },
  {
    "id": "TALK_FOODPERSON_TRADE",
    "type": "talk_topic",
    "dynamic_line": "Alright let's see what you've got.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_success_trade", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "…", "topic": "TALK_DONE", "effect": "start_trade" } ]
  },
  {
    "id": "TALK_FOODPERSON_NOTRAINING",
    "type": "talk_topic",
    "dynamic_line": "You're not ready for this.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_failed_training", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "But I am worthy!", "topic": "TALK_NONE" } ]
  },
  {
    "id": "TALK_FOODPERSON_TRAINING",
    "type": "talk_topic",
    "dynamic_line": "I can teach you a few tricks.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_success_training", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "…", "topic": "TALK_TRAIN" }, { "text": "Nevermind.", "topic": "TALK_DONE" } ]
  },
  {
    "id": "TALK_FOODPERSON_NOSHELTER",
    "type": "talk_topic",
    "dynamic_line": "This is no place for a civilian.  You should go to the refugee center.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_failed_shelter", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "Damn!", "topic": "TALK_NONE" } ]
  },
  {
    "id": "TALK_FOODPERSON_SHELTER",
    "type": "talk_topic",
    "dynamic_line": "Well…  You seem like a decent sort, I might have an offer for you.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_success_shelter", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "I'm listening.", "topic": "TALK_FOODPERSON_SIDEKICK" } ]
  },
  {
    "id": "TALK_FOODPERSON_SOLO",
    "type": "talk_topic",
    "dynamic_line": "Sorry but I work alone.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_failed_team", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [ { "text": "We could really use your help!", "topic": "TALK_NONE" } ]
  },
  {
    "id": "TALK_FOODPERSON_SIDEKICK",
    "type": "talk_topic",
    "dynamic_line": "What about: you prove your worth and join me as my sidekick?",
    "speaker_effect": { "effect": { "npc_add_var": "npc_sidekick_offer", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [
      { "condition": { "not": "has_assigned_mission" }, "text": "That sounds great!", "topic": "TALK_MISSION_LIST" },
      { "condition": { "not": "has_assigned_mission" }, "text": "Ok…", "topic": "TALK_MISSION_LIST" },
      {
        "condition": { "not": "has_assigned_mission" },
        "text": "I need to think about it.",
        "topic": "TALK_FOODPERSON_MAIN"
      },
      { "condition": { "not": "has_assigned_mission" }, "text": "Huh…  No thanks.", "topic": "TALK_DONE" },
      {
        "condition": "has_assigned_mission",
        "text": "There's other things I'd like to discuss.",
        "topic": "TALK_FOODPERSON_MAIN"
      },
      { "condition": "has_assigned_mission", "text": "Alright bye.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_TWO",
    "type": "talk_topic",
    "dynamic_line": "The way you talk, the way you move…  You're…  You're me?  But how?",
    "responses": [
      {
        "text": "I…  I don't know.  It probably has something to do with <the_cataclysm>!  What do you say we team up to find out?",
        "effect": { "npc_add_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" },
        "topic": "TALK_FOODPERSON_TEAMUP"
      },
      {
        "text": "It might have something to do with <the_cataclysm>, mind if I stay here while we try to figure this out?",
        "effect": { "npc_add_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" },
        "topic": "TALK_FOODPERSON_SHARING"
      },
      { "text": "This can't be true, you're trying to trick me!", "topic": "TALK_FOODPERSON_ONLYONE" },
      { "text": "I need time to think.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_MULTIVERSE",
    "type": "talk_topic",
    "dynamic_line": "Wha…  But.  But…  How?",
    "responses": [
      {
        "text": "No time to explain, the world is at an end and we must join forces to save it!",
        "effect": { "npc_add_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" },
        "topic": "TALK_FOODPERSON_TEAMUP"
      },
      {
        "text": "The Cataclysm weakened the space-time continuum, I accidentally fell through a tear in reality and ended up here.  I will need access to your resources to keep fighting.",
        "effect": { "npc_add_var": "foodperson_meeting_solved", "type": "dialogue", "context": "foodperson", "value": "yes" },
        "topic": "TALK_FOODPERSON_SHARING"
      },
      {
        "text": "I am the ultimate Foodperson, I travel the multiverse consuming powers from all the Foodpersons.  And now I've come for you!",
        "topic": "TALK_FOODPERSON_ONLYONE"
      },
      { "text": "Can't tell you now.  In due time all will be revealed.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "TALK_FOODPERSON_SHARING",
    "type": "talk_topic",
    "dynamic_line": "Of course, whatever you need…  Foodperson.",
    "speaker_effect": { "effect": { "npc_add_var": "npc_foodpersons_sharing", "type": "dialogue", "context": "foodperson", "value": "yes" } },
    "responses": [
      {
        "text": "Thank you Foodperson!  It's good to know I have a friend here.",
        "topic": "TALK_FOODPERSON_MAIN",
        "opinion": { "trust": 10, "value": 10 }
      }
    ]
  },
  {
    "id": "TALK_FOODPERSON_TEAMUP",
    "type": "talk_topic",
    "dynamic_line": "It's crazy out there, it's going to be a tough journey but I'm with you!",
    "responses": [
      {
        "text": "Let's go, we have a world to save!",
        "topic": "TALK_DONE",
        "effect": "follow",
        "opinion": { "trust": 20, "value": 20 }
      }
    ]
  },
  {
    "id": "TALK_FOODPERSON_ONLYONE",
    "type": "talk_topic",
    "dynamic_line": "There can be only one!",
    "responses": [
      { "text": "I AM THE ONE!", "topic": "TALK_DONE", "effect": "hostile", "opinion": { "trust": -20, "value": -20 } },
      {
        "condition": { "not": { "u_has_trait": "PROF_FOODP" } },
        "text": "Wow calm down, it's just a prank bro.",
        "topic": "TALK_DONE",
        "opinion": { "trust": -20, "value": -20 }
      },
      {
        "condition": { "u_has_trait": "PROF_FOODP" },
        "text": "WAIT!  There might be another way!",
        "topic": "TALK_NONE"
      },
      {
        "condition": { "u_has_trait": "PROF_FOODP" },
        "text": "I don't want to fight you.  I'm leaving.",
        "topic": "TALK_DONE"
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_TRUE_FOODPERSON_pizzaiolo",
    "dynamic_line": "Umm, I'm not sure I'm following you…",
    "responses": [
      {
        "text": "You know what, <name_b>, I don't want to talk to you anymore.  <kill_npc> <name_b>!",
        "topic": "TALK_DONE",
        "effect": "insult_combat"
      }
    ]
  }
]
