[
  {
    "type": "npc",
    "id": "ranch_bartender",
    "//": "Mission source, shopkeep",
    "name_suffix": "Bartender",
    "class": "NC_BARTENDER",
    "attitude": 0,
    "mission": 3,
    "chat": "TALK_RANCH_BARKEEP",
    "mission_offered": "MISSION_RANCH_BARTENDER_1",
    "faction": "tacoma_commune"
  },
  {
    "id": "TALK_RANCH_BARKEEP",
    "type": "talk_topic",
    "dynamic_line": "Want a drink?",
    "responses": [
      {
        "text": "The doctor needs some help building an anesthetic machine.  Do you have anything that could help?",
        "topic": "TALK_RANCH_GENERIC_ANESTHETIC_FOR_DOCTOR",
        "condition": {
          "and": [
            { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" },
            {
              "not": { "npc_has_var": "doctor_anesthetic_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" }
            }
          ]
        },
        "effect": [ { "npc_add_var": "doctor_anesthetic_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ]
      },
      { "text": "What is your job here?", "topic": "TALK_RANCH_BARKEEP_JOB" },
      { "text": "I'm looking for information.", "topic": "TALK_RANCH_BARKEEP_INFORMATION" },
      { "text": "Do you need any help?", "topic": "TALK_MISSION_LIST" },
      {
        "text": "Let me see what you keep behind the counter.",
        "topic": "TALK_RANCH_BARKEEP",
        "effect": "start_trade"
      },
      { "text": "What do you have on tap?", "topic": "TALK_RANCH_BARKEEP_TAP" },
      {
        "text": "What's this token you gave me?",
        "topic": "RANCH_BARTENDER_ASK_TOKEN",
        "condition": { "u_has_item": "tacoma_drink_token" }
      },
      {
        "text": "I'd like to exchange ten tokens",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": {
          "and": [
            { "u_has_items": { "item": "tacoma_drink_token", "count": 10 } },
            { "u_has_items": { "item": "shot_glass", "count": 10 } }
          ]
        },
        "effect": [
          { "u_sell_item": "tacoma_drink_token", "count": 10 },
          { "u_sell_item": "shot_glass", "count": 10 },
          { "u_spawn_item": "FMCNote", "count": 10 },
          { "u_message": "Thanks for bringing the glasses back.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "I'd like to exchange five tokens",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": {
          "and": [
            { "u_has_items": { "item": "tacoma_drink_token", "count": 5 } },
            { "u_has_items": { "item": "shot_glass", "count": 5 } }
          ]
        },
        "effect": [
          { "u_sell_item": "tacoma_drink_token", "count": 5 },
          { "u_sell_item": "shot_glass", "count": 5 },
          { "u_spawn_item": "FMCNote", "count": 5 },
          { "u_message": "Thanks for bringing the glasses back.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "I'd like to exchange four tokens",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": {
          "and": [
            { "u_has_items": { "item": "tacoma_drink_token", "count": 4 } },
            { "u_has_items": { "item": "shot_glass", "count": 4 } }
          ]
        },
        "effect": [
          { "u_sell_item": "tacoma_drink_token", "count": 4 },
          { "u_sell_item": "shot_glass", "count": 4 },
          { "u_spawn_item": "FMCNote", "count": 4 },
          { "u_message": "Thanks for bringing the glasses back.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "I'd like to exchange three tokens",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": {
          "and": [
            { "u_has_items": { "item": "tacoma_drink_token", "count": 3 } },
            { "u_has_items": { "item": "shot_glass", "count": 3 } }
          ]
        },
        "effect": [
          { "u_sell_item": "tacoma_drink_token", "count": 3 },
          { "u_sell_item": "shot_glass", "count": 3 },
          { "u_spawn_item": "FMCNote", "count": 3 },
          { "u_message": "Thanks for bringing the glasses back.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "I'd like to exchange two tokens",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": {
          "and": [
            { "u_has_items": { "item": "tacoma_drink_token", "count": 2 } },
            { "u_has_items": { "item": "shot_glass", "count": 2 } }
          ]
        },
        "effect": [
          { "u_sell_item": "tacoma_drink_token", "count": 2 },
          { "u_sell_item": "shot_glass", "count": 2 },
          { "u_spawn_item": "FMCNote", "count": 2 },
          { "u_message": "Thanks for bringing the glasses back.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "I'd like to exchange a token.",
        "topic": "TALK_NONE",
        "switch": true,
        "condition": { "and": [ { "u_has_item": "tacoma_drink_token" }, { "u_has_item": "shot_glass" } ] },
        "effect": [
          { "u_sell_item": "tacoma_drink_token" },
          { "u_sell_item": "shot_glass" },
          { "u_spawn_item": "FMCNote" },
          { "u_message": "Thanks for bringing the glass back.", "type": "good", "popup": true }
        ]
      },
      { "text": "I'll be going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_RANCH_BARKEEP_JOB",
    "dynamic_line": "If it isn't obvious, I oversee the bar here.  The scavengers bring in old world alcohol that we sell for special occasions.  For most that come through here though, the drinks we brew ourselves are the only thing they can afford.",
    "responses": [ { "text": "I see.", "topic": "TALK_RANCH_BARKEEP" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_RANCH_BARKEEP_INFORMATION",
    "dynamic_line": "We have a policy of keeping information to ourselves.  Ask the patrons if you want to hear rumors or news.",
    "responses": [ { "text": "Thanks for nothing.", "topic": "TALK_RANCH_BARKEEP" } ]
  },
  {
    "id": "TALK_RANCH_BARKEEP_TAP",
    "type": "talk_topic",
    "dynamic_line": {
      "npc_has_trait": "NPC_WHISKEY",
      "yes": [
        "Take a look at our selection and let me know what you're interested in.",
        "We have a decent variety of drinks.  What interests you?",
        "What are you in the mood for?"
      ],
      "no": "Our selection is a bit limited at the moment.  If you're willing to help out, I can get some more variety in here."
    },
    "responses": [
      {
        "text": "Just a glass of water, please.",
        "topic": "TALK_DONE",
        "effect": [
          { "mapgen_update": "tacoma_commune_glass_water", "om_terrain": "ranch_camp_51" },
          { "u_message": "<npc_name> sets a glass of water on the counter.", "type": "good", "popup": true }
        ]
      },
      {
        "text": "[$8] I'll take a beer.",
        "topic": "TALK_DONE",
        "effect": { "u_buy_item": "beer", "container": "bottle_glass", "count": 2, "cost": 800 }
      },
      {
        "text": "[$12] I'll take a shot of brandy.",
        "topic": "TALK_DONE",
        "condition": { "npc_has_trait": "NPC_BRANDY" },
        "effect": [
          { "u_spend_cash": 1200 },
          { "mapgen_update": "tacoma_commune_shot_brandy", "om_terrain": "ranch_camp_51" },
          { "u_message": "<npc_name> sets a shot and a token on the counter…", "type": "good", "popup": true }
        ]
      },
      {
        "text": "[$12] I'll take a shot of rum.",
        "topic": "TALK_DONE",
        "condition": { "npc_has_trait": "NPC_RUM" },
        "effect": [
          { "u_spend_cash": 1200 },
          { "mapgen_update": "tacoma_commune_shot_rum", "om_terrain": "ranch_camp_51" },
          { "u_message": "<npc_name> sets a shot and a token on the counter…", "type": "good", "popup": true }
        ]
      },
      {
        "text": "[$15] I'll take a shot of whiskey.",
        "topic": "TALK_DONE",
        "condition": { "npc_has_trait": "NPC_WHISKEY" },
        "effect": [
          { "u_spend_cash": 1500 },
          { "mapgen_update": "tacoma_commune_shot_whiskey", "om_terrain": "ranch_camp_51" },
          { "u_message": "<npc_name> sets a shot and a token on the counter…", "type": "good", "popup": true }
        ]
      },
      { "text": "On second thought, don't bother.", "topic": "TALK_RANCH_BARKEEP" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "RANCH_BARTENDER_ASK_TOKEN",
    "dynamic_line": [
      "Bring the token back with your glass and I'll exchange it for a merch.",
      "Oh, that?  There were too many people stealing our glasses, so I started stamping a logo on some bottle caps as a token and raised the drink prices a bit to encourage their return.  I'll give you a merch back when you bring me the token with your glass.",
      "Some people like to hang on to them thinking they'll have value someday, but I'd prefer it if you brought it back with your glass and I'll give you a merch back from your purchase."
    ],
    "responses": [ { "text": "I see.", "topic": "TALK_RANCH_BARKEEP" } ]
  },
  {
    "id": "MISSION_RANCH_BARTENDER_1",
    "type": "mission_definition",
    "name": { "str": "Make 2 Stills" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "still",
    "count": 2,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_BARTENDER_2",
    "dialogue": {
      "describe": "We need help…",
      "offer": "The wine and beer we can brew are sufficient to attract most patrons, but we need something a bit stronger to get them to forget their misery.  Could you build me a pair of stills?",
      "accepted": "This should let us start producing whiskey, rum, and brandy when we get access to the ingredients.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "I'm sure you could find the design for the stills in home brewing books.",
      "inquire": "Do you have the stills?",
      "success": "Thank you for the delivery.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    },
    "end": {
      "update_mapgen": {
        "om_terrain": "ranch_camp_51",
        "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_1" ], "x": 0, "y": 0 } ],
        "place_items": [
          { "item": "cleaning", "x": 11, "y": [ 7, 8 ], "chance": 100, "repeat": [ 1, 2 ], "faction": "tacoma_commune" },
          { "item": "trash", "x": 13, "y": 10, "chance": 80, "repeat": [ 1, 2 ] },
          { "item": "trash", "x": 4, "y": 16, "chance": 80, "repeat": [ 1, 2 ] }
        ]
      }
    }
  },
  {
    "id": "MISSION_RANCH_BARTENDER_2",
    "type": "mission_definition",
    "name": { "str": "Find 20 Yeast" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "yeast",
    "count": 20,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_BARTENDER_3",
    "dialogue": {
      "describe": "We need help…",
      "offer": "The last batch that I brewed was terrible, I'm fairly sure something contaminated the yeast we have been using.  Could you locate a source of fresh yeast for us to use?  I'd need about 20 teaspoons of dry yeast to get started.",
      "accepted": "Thank you for your assistance.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Yeast should be common in homes or bakeries.",
      "inquire": "Do you have the yeast?",
      "success": "Thank you for the delivery.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    },
    "end": {
      "effect": { "npc_add_trait": "NPC_BRANDY" },
      "update_mapgen": {
        "om_terrain": "ranch_camp_51",
        "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_2" ], "x": 0, "y": 0 } ],
        "place_items": [
          { "item": "cleaning", "x": 11, "y": [ 7, 8 ], "chance": 100, "repeat": [ 1, 2 ], "faction": "tacoma_commune" },
          { "item": "trash", "x": 13, "y": 10, "chance": 80, "repeat": [ 1, 2 ] },
          { "item": "trash", "x": 4, "y": 16, "chance": 80, "repeat": [ 1, 2 ] }
        ]
      }
    }
  },
  {
    "id": "MISSION_RANCH_BARTENDER_3",
    "type": "mission_definition",
    "name": { "str": "Find 10 Sugar Beet Seeds" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "seed_sugar_beet",
    "count": 10,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_BARTENDER_4",
    "dialogue": {
      "describe": "We need help…",
      "offer": "Sugar and molasses remains in short supply.  I've put in a request for more, but it is unlikely that I'm going to see a reliable source for some time.  If you are interested, we are going to need sugar beet seeds to meet future demand regardless of what the scavengers can find.  Could you bring me at least enough seeds to plant a small 10 meter long patch?",
      "accepted": "Thank you for your assistance.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Farms or supply stores might have a few seeds…",
      "inquire": "Do you have the sugar beet seeds?",
      "success": "Thank you for the delivery.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    },
    "end": {
      "effect": { "npc_add_trait": "NPC_RUM" },
      "update_mapgen": [
        {
          "om_terrain": "ranch_camp_51",
          "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_3" ], "x": 0, "y": 0 } ],
          "place_items": [
            { "item": "trash", "x": 13, "y": 10, "chance": 80, "repeat": [ 1, 2 ] },
            { "item": "trash", "x": 4, "y": 16, "chance": 80, "repeat": [ 1, 2 ] }
          ]
        },
        {
          "om_terrain": "ranch_camp_52",
          "place_nested": [ { "chunks": [ "tacoma_commune_greenhouse_bartender_beets" ], "x": 2, "y": 10 } ]
        }
      ]
    }
  },
  {
    "id": "MISSION_RANCH_BARTENDER_4",
    "type": "mission_definition",
    "name": { "str": "Find 12 60-Liter Metal Tanks" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "metal_tank",
    "count": 12,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_BARTENDER_5",
    "dialogue": {
      "describe": "We need help…",
      "offer": "The drinks we brew here have become a major draw for visitors and the occasional trader.  Our batches have become larger, but we are still running out of storage space between trading runs.  I've been able to get a few volunteers to help me build a set of standing tanks, but I still need 12 60-liter metal tanks to build them.  I've talked with the scrappers, but we are a low priority at the moment.",
      "accepted": "Thank you for your assistance.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Scrapping vehicles might be your best bet.",
      "inquire": "Do you have the 60-liter metal tanks?",
      "success": "Thank you for the delivery.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    },
    "end": {
      "effect": { "npc_add_trait": "NPC_WHISKEY" },
      "update_mapgen": {
        "om_terrain": "ranch_camp_51",
        "place_nested": [ { "chunks": [ "tacoma_commune_bar_bartender_4" ], "x": 3, "y": 1 } ],
        "place_items": [
          { "item": "trash", "x": 13, "y": 10, "chance": 80, "repeat": [ 1, 2 ] },
          { "item": "trash", "x": 4, "y": 16, "chance": 80, "repeat": [ 1, 2 ] }
        ]
      }
    }
  },
  {
    "id": "MISSION_RANCH_BARTENDER_5",
    "type": "mission_definition",
    "name": { "str": "Find 2 200-Liter Drums" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "55gal_drum",
    "count": 2,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_NULL",
    "dialogue": {
      "describe": "We need help…",
      "offer": "The other survivor outposts that we have contact with have been more than eager to trade for beer or other drinks.  Transporting the drinks to them has presented a number of challenges though.  If you could locate a pair of 200-liter drums, we should be able to keep them supplied while turning a significant profit.",
      "accepted": "Thank you for your assistance.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Factories or junk yards are the only places I know where to look.",
      "inquire": "Do you have the 200-liter drums?",
      "success": "Thank you for the delivery.",
      "success_lie": "What good does this do us?",
      "failure": "It was a lost cause anyways…"
    },
    "end": {
      "update_mapgen": {
        "om_terrain": "ranch_camp_51",
        "place_item": [ { "item": "55gal_drum", "x": 18, "y": 3, "repeat": 2, "faction": "tacoma_commune" } ],
        "place_items": [
          { "item": "trash", "x": 13, "y": 10, "chance": 80, "repeat": [ 1, 2 ] },
          { "item": "trash", "x": 4, "y": 16, "chance": 80, "repeat": [ 1, 2 ] }
        ]
      }
    }
  }
]
