[
  {
    "type": "npc",
    "id": "ranch_scavenger_1",
    "//": "Mission source, shopkeep",
    "name_suffix": "Scavenger Boss",
    "class": "NC_JUNK_SHOPKEEP",
    "attitude": 0,
    "mission": 3,
    "chat": "TALK_RANCH_SCAVENGER_1",
    "mission_offered": "MISSION_RANCH_SCAVENGER_1",
    "faction": "tacoma_commune"
  },
  {
    "id": "TALK_RANCH_SCAVENGER_1",
    "type": "talk_topic",
    "dynamic_line": "Welcome to the junk shop.",
    "responses": [
      {
        "text": "The doctor needs some help building an anesthetic machine.  Do you have anything that could help?",
        "topic": "TALK_RANCH_SCAVENGER_ANESTHETIC_FOR_DOCTOR",
        "condition": {
          "and": [
            { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" },
            {
              "not": { "compare_string": [ "yes", { "u_val": "mission_tacoma_ranch_doctor_anesthetic_scavengers_helped" } ] }
            },
            {
              "not": { "compare_string": [ "yes", { "u_val": "mission_tacoma_ranch_scavenger_hospital_raid_started" } ] }
            }
          ]
        },
        "effect": [ { "u_add_var": "mission_tacoma_ranch_scavenger_hospital_raid", "value": "yes" } ]
      },
      { "text": "What is your job here?", "topic": "TALK_RANCH_SCAVENGER_1_JOB" },
      { "text": "Do you need any help?", "topic": "TALK_RANCH_SCAVENGER_1_HIRE" },
      { "text": "Let's see what you've managed to find.", "topic": "TALK_RANCH_SCAVENGER_1", "effect": "start_trade" },
      { "text": "Any lucky find?", "topic": "TALK_RANCH_SCAVENGER_ASK_RESTOCK" },
      { "text": "<end_talking_leave>", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_RANCH_SCAVENGER_ASK_RESTOCK",
    "dynamic_line": "Nope, current run hasn't returned yet.  Come back in <interval>.  You might find something you like.",
    "responses": [ { "text": "Alright, thanks.", "topic": "TALK_RANCH_SCAVENGER_1" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_RANCH_SCAVENGER_1_JOB",
    "dynamic_line": {
      "gendered_line": "I organize scavenging runs to bring in supplies that we can't produce ourselves.  I try and provide incentives to get migrants to join one of the teams… it's dangerous work, but keeps our outpost alive.  Selling anything we can't use helps keep us afloat with the traders.  If you wanted to drop off a companion or two to assist in one of the runs, I'd appreciate it.",
      "relevant_genders": [ "npc" ]
    },
    "responses": [ { "text": "I'll think about it.", "topic": "TALK_RANCH_SCAVENGER_1" } ]
  },
  {
    "id": "TALK_RANCH_SCAVENGER_1_HIRE",
    "type": "talk_topic",
    "dynamic_line": "Are you interested in the scavenging runs or one of the other tasks that I might have for you?",
    "responses": [
      {
        "text": "Tell me more about the scavenging runs.",
        "topic": "TALK_RANCH_SCAVENGER_1",
        "effect": { "companion_mission": "SCAVENGER" }
      },
      { "text": "What kind of tasks do you have for me?", "topic": "TALK_MISSION_LIST" },
      { "text": "No, thanks.", "topic": "TALK_RANCH_SCAVENGER_1" }
    ]
  },
  {
    "id": "TALK_RANCH_SCAVENGER_ANESTHETIC_FOR_DOCTOR",
    "type": "talk_topic",
    "dynamic_line": "We don't have any of the parts needed right now, but we could send out a scavenging party to a hospital if you have anyone willing to go.",
    "responses": [
      {
        "text": "Tell me more about the scavenging runs.",
        "topic": "TALK_RANCH_SCAVENGER_1",
        "effect": { "companion_mission": "SCAVENGER" }
      },
      { "text": "Not right now.", "topic": "TALK_RANCH_SCAVENGER_1" }
    ]
  },
  {
    "id": "MISSION_RANCH_SCAVENGER_1",
    "type": "mission_definition",
    "name": { "str": "Make 12 Simple Knife Spears" },
    "goal": "MGOAL_CONDITION",
    "goal_condition": {
      "u_has_items_sum": [
        { "item": "spear_knife", "amount": 12 },
        { "item": "spear_knife_superior", "amount": 12 },
        { "item": "spear_knife_proper", "amount": 12 }
      ]
    },
    "difficulty": 5,
    "value": 50000,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_SCAVENGER_2",
    "dialogue": {
      "describe": "We need help…",
      "offer": "I can usually use additional survival gear to kit out the new recruits.  The most basic weapon that everyone gets is the simple knife spear… it provides a good mix of range, power, and ease of use when engaging the more common monsters.  Could you make me a dozen of them?  I may need more later, but that should help the first few teams.",
      "accepted": "I'm counting on you.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "You should be able to make them with the most basic of skills.",
      "inquire": "Do you have the simple knife spears?",
      "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_48",
          "set": [
            { "square": "terrain", "id": "t_chainfence", "x": 15, "y": 13, "x2": 15, "y2": 22 },
            { "square": "terrain", "id": "t_chainfence", "x": 16, "y": 13, "x2": 23, "y2": 13 },
            { "square": "terrain", "id": "t_chainfence", "x": 16, "y": 22, "x2": 17, "y2": 22 },
            { "square": "terrain", "id": "t_chainfence", "x": 22, "y": 22, "x2": 23, "y2": 22 },
            { "square": "terrain", "id": "t_dirt", "x": 18, "y": 19, "x2": 21, "y2": 22 }
          ]
        },
        {
          "om_terrain": "ranch_camp_49",
          "set": [
            { "square": "terrain", "id": "t_chainfence", "x": 0, "y": 22, "x2": 1, "y2": 22 },
            { "square": "terrain", "id": "t_dirt", "x": 2, "y": 22, "x2": 3, "y2": 22 },
            { "square": "terrain", "id": "t_chainfence", "x": 4, "y": 22, "x2": 6, "y2": 22 }
          ],
          "place_items": [
            { "chance": 100, "item": "mechanics", "x": [ 8, 9 ], "y": [ 13, 16 ], "repeat": [ 3, 6 ] },
            { "chance": 100, "item": "allsporting", "x": 14, "y": [ 11, 17 ], "repeat": [ 1, 2 ] }
          ],
          "place_item": [ { "item": "30gal_drum", "x": 8, "y": 19, "faction": "tacoma_commune" } ]
        }
      ],
      "effect": [
        {
          "u_consume_item_sum": [
            { "item": "spear_knife", "amount": 12 },
            { "item": "spear_knife_superior", "amount": 12 },
            { "item": "spear_knife_proper", "amount": 12 }
          ]
        }
      ]
    }
  },
  {
    "id": "MISSION_RANCH_SCAVENGER_2",
    "type": "mission_definition",
    "name": { "str": "Make 5 Headlamps" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "wearable_light",
    "count": 5,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_SCAVENGER_3",
    "dialogue": {
      "describe": "We need help…",
      "offer": "Night is the ideal time for my team to go on raids, but they are going to need better light sources to speed up their missions.  Could you craft a set of five headlamps for them?  Keeping both hands free greatly helps during combat.",
      "accepted": "I'm counting on you.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "You should be able to make them with the most basic of skills.",
      "inquire": "Do you have the headlamps?",
      "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_48",
          "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_shed_1" ], "x": 18, "y": 19 } ],
          "place_vehicles": [ { "vehicle": "car_chassis", "chance": 100, "rotation": 0, "x": 20, "y": 15, "faction": "tacoma_commune" } ]
        },
        {
          "om_terrain": "ranch_camp_49",
          "set": [ { "square": "terrain", "id": "t_chaingate_c", "x": 2, "y": 22, "x2": 3, "y2": 22 } ],
          "place_items": [
            { "chance": 100, "item": "mischw", "x": [ 11, 12 ], "y": [ 13, 16 ], "repeat": [ 3, 6 ] },
            { "chance": 100, "item": "allsporting", "x": 14, "y": [ 11, 17 ], "repeat": [ 1, 2 ] }
          ],
          "place_item": [ { "item": "30gal_drum", "x": 8, "y": 20, "faction": "tacoma_commune" } ]
        }
      ]
    }
  },
  {
    "id": "MISSION_RANCH_SCAVENGER_3",
    "type": "mission_definition",
    "name": { "str": "Make 3 Leather Body Armor" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "armor_larmor",
    "count": 3,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_RANCH_SCAVENGER_4",
    "dialogue": {
      "describe": "We need help…",
      "offer": "Clothing that can withstand the wear and tear of climbing through windows and fighting back wild animals is in high demand.  The best that we have been able to find is leather body armor, but it is difficult to make with our limited resources.  Could you craft us three pairs of leather body armor?  The life expectancy of my scavengers would drastically increase if you did.",
      "accepted": "I'm counting on you.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Finding the leather might be easier in town rather than making it yourself.",
      "inquire": "Do you have the leather body armors?",
      "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_48",
          "place_nested": [ { "chunks": [ "tacoma_commune_junk_shop_shed_2" ], "x": 18, "y": 19 } ],
          "set": [
            { "square": "terrain", "id": "t_dirt", "x": 23, "y": 16, "x2": 23, "y2": 17 },
            { "point": "furniture", "id": "f_machinery_light", "x": 23, "y": 16 },
            { "point": "furniture", "id": "f_arcade_machine", "x": 23, "y": 17 }
          ],
          "place_item": [
            { "item": "wheel_wide", "x": 16, "y": 21, "faction": "tacoma_commune" },
            { "item": "wheel_wide", "x": 17, "y": 21, "faction": "tacoma_commune" },
            { "item": "v8_combustion", "x": 23, "y": 18, "faction": "tacoma_commune" }
          ]
        },
        {
          "om_terrain": "ranch_camp_49",
          "set": [
            { "square": "terrain", "id": "t_dirt", "x": 1, "y": 15, "x2": 3, "y2": 15 },
            { "point": "furniture", "id": "f_fridge", "x": 1, "y": 15 },
            { "point": "furniture", "id": "f_washer", "x": 3, "y": 15 }
          ],
          "place_items": [
            { "chance": 100, "item": "mischw", "x": [ 1, 4 ], "y": 10, "repeat": [ 3, 4 ], "faction": "tacoma_commune" },
            {
              "chance": 100,
              "item": "allsporting",
              "x": [ 1, 4 ],
              "y": 10,
              "repeat": [ 2, 4 ],
              "faction": "tacoma_commune"
            },
            {
              "chance": 100,
              "item": "mischw",
              "x": [ 1, 4 ],
              "y": 13,
              "repeat": [ 3, 4 ],
              "faction": "tacoma_commune"
            },
            {
              "chance": 100,
              "item": "allsporting",
              "x": [ 1, 4 ],
              "y": 13,
              "repeat": [ 2, 4 ],
              "faction": "tacoma_commune"
            },
            { "chance": 100, "item": "home_hw", "x": 14, "y": [ 11, 17 ], "repeat": [ 2, 3 ] },
            { "chance": 100, "item": "allsporting", "x": 14, "y": [ 11, 17 ], "repeat": [ 1, 2 ] }
          ],
          "place_item": [ { "item": "hdframe", "x": 2, "y": 15, "faction": "tacoma_commune" } ]
        }
      ]
    }
  },
  {
    "id": "MISSION_RANCH_SCAVENGER_4",
    "type": "mission_definition",
    "name": { "str": "Make 12 Molotov Cocktails" },
    "goal": "MGOAL_FIND_ITEM",
    "difficulty": 5,
    "value": 50000,
    "item": "molotov",
    "count": 12,
    "origins": [ "ORIGIN_SECONDARY" ],
    "followup": "MISSION_NULL",
    "dialogue": {
      "describe": "We need help…",
      "offer": "When outnumbered or forced to pull back, my scavengers have been taught to throw Molotov cocktails to keep monsters from chasing them.  We go through one or two on every mission, so we can always use a few more.  Would you be willing to make us a dozen?  I'm willing to pay you what I can for your assistance.",
      "accepted": "I'm counting on you.",
      "rejected": "Come back when you get a chance.  We need skilled survivors.",
      "advice": "Alcohol or kerosene is probably easier to refine rather than find in large quantities.",
      "inquire": "Do you have the Molotov cocktails?",
      "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_48",
          "set": [
            { "square": "terrain", "id": "t_dirt", "x": 22, "y": 21, "x2": 23, "y2": 21 },
            { "point": "furniture", "id": "f_pinball_machine", "x": 23, "y": 21 }
          ],
          "place_item": [
            { "item": "wheel_motorbike_or", "x": 16, "y": 20, "faction": "tacoma_commune" },
            { "item": "wheel_motorbike_or", "x": 17, "y": 20, "faction": "tacoma_commune" },
            { "item": "v6_diesel", "x": 22, "y": 21, "faction": "tacoma_commune" }
          ]
        },
        {
          "om_terrain": "ranch_camp_49",
          "set": [
            { "point": "terrain", "id": "t_dirt", "x": 0, "y": 21 },
            { "point": "furniture", "id": "f_glass_fridge", "x": 0, "y": 21 }
          ],
          "place_items": [
            { "chance": 100, "item": "mischw", "x": [ 1, 4 ], "y": 10, "repeat": [ 3, 4 ], "faction": "tacoma_commune" },
            {
              "chance": 100,
              "item": "allsporting",
              "x": [ 1, 4 ],
              "y": 10,
              "repeat": [ 2, 4 ],
              "faction": "tacoma_commune"
            },
            {
              "chance": 100,
              "item": "mischw",
              "x": [ 1, 4 ],
              "y": 13,
              "repeat": [ 3, 4 ],
              "faction": "tacoma_commune"
            },
            {
              "chance": 100,
              "item": "allsporting",
              "x": [ 1, 4 ],
              "y": 13,
              "repeat": [ 2, 4 ],
              "faction": "tacoma_commune"
            },
            { "chance": 100, "item": "home_hw", "x": 14, "y": [ 11, 17 ], "repeat": [ 2, 3 ] },
            { "chance": 100, "item": "allsporting", "x": 14, "y": [ 11, 17 ], "repeat": [ 1, 2 ] }
          ],
          "place_item": [ { "item": "frame", "x": 4, "y": 15, "faction": "tacoma_commune" } ]
        }
      ]
    }
  }
]
