[
  {
    "type": "npc",
    "id": "refugee_beggar2",
    "//": "Schizophrenic beggar in the refugee center.",
    "name_unique": "Dino Dave",
    "gender": "male",
    "name_suffix": "beggar",
    "class": "NC_BEGGAR_2",
    "attitude": 0,
    "mission": 7,
    "chat": "TALK_REFUGEE_BEGGAR_2",
    "faction": "lobby_beggars",
    "mission_offered": "MISSION_BEGGAR_2_BOX_SMALL"
  },
  {
    "type": "npc_class",
    "id": "NC_BEGGAR_2",
    "name": { "str": "Beggar" },
    "job_description": "I'm just trying to survive.",
    "common": false,
    "//": "All the beggars have been camping inside the evac shelter because they're too weak and unskilled to make it on their own.",
    "bonus_str": { "rng": [ -3, -2 ] },
    "bonus_dex": { "rng": [ -5, -1 ] },
    "bonus_int": { "rng": [ -2, 0 ] },
    "bonus_per": { "rng": [ -6, -2 ] },
    "worn_override": "NC_BEGGAR_2_worn",
    "carry_override": "EMPTY_GROUP",
    "weapon_override": "EMPTY_GROUP",
    "traits": [
      { "trait": "GLASSJAW" },
      { "trait": "ADDICTIVE" },
      { "trait": "HOARDER" },
      { "trait": "SLOWHEALER" },
      { "trait": "SLOWRUNNER" },
      { "trait": "CHEMIMBALANCE" },
      { "trait": "HEAVYSLEEPER" },
      { "trait": "FLIMSY2" },
      { "trait": "SCHIZOPHRENIC" },
      { "trait": "SLOWLEARNER" },
      { "trait": "PACIFIST" },
      { "group": "Appearance_demographics" }
    ]
  },
  {
    "type": "item_group",
    "id": "NC_BEGGAR_2_worn",
    "subtype": "collection",
    "entries": [
      { "item": "boxer_shorts" },
      { "item": "socks_wool" },
      { "item": "dinosuit" },
      { "item": "boots_winter" },
      { "item": "coat_winter" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2",
    "dynamic_line": {
      "has_no_available_mission": {
        "has_no_assigned_mission": "We've done it!  We've solved the list!",
        "no": "How's things with you?  My cardboard collection is getting quite impressive."
      },
      "no": "Have I told you about cardboard, friend?  Do you have any?"
    },
    "responses": [
      { "condition": "has_assigned_mission", "text": "About that shopping list of yours…", "topic": "TALK_MISSION_INQUIRE" },
      {
        "condition": {
          "and": [
            { "npc_has_var": "cardboard_donor", "type": "mission", "context": "dinodave", "value": "yes" },
            { "not": "has_no_available_mission" }
          ]
        },
        "text": "Is there anything else I can do for you?",
        "topic": "TALK_MISSION_OFFER"
      },
      {
        "condition": {
          "and": [ "has_no_available_mission", "has_no_assigned_mission", { "not": { "u_has_mission": "MISSION_BEGGAR_2_PERMISSION" } } ]
        },
        "text": "What are you going to do with all that cardboard now?",
        "topic": "TALK_REFUGEE_BEGGAR_2_JOBSDONE",
        "effect": { "u_add_var": "dave_happy", "type": "general", "context": "recruit", "value": "yes" }
      },
      {
        "condition": {
          "and": [
            { "u_has_mission": "MISSION_BEGGAR_2_PERMISSION" },
            { "u_has_var": "Dave_Permission", "type": "mission", "value": "yes" }
          ]
        },
        "text": "We've done it, Dave!  Smokes says you can build yourself a house up on the roof if you want.  You've got to keep it nice and clean, and help out the people down here by looking out for zombies, but you can still use the washrooms and things downstairs when you need to.  What do you say?",
        "topic": "TALK_REFUGEE_BEGGAR_2_PERMISSION"
      },
      { "text": "Cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_CARDBOARD" },
      { "text": "Why are you sitting out here?", "topic": "TALK_REFUGEE_BEGGAR_2_REFUGEE" },
      { "text": "Are you seriously wearing a dinosaur costume?", "topic": "TALK_REFUGEE_BEGGAR_2_DINOSAUR" },
      { "text": "Do you need something to eat?", "topic": "TALK_REFUGEE_BEGGAR_2_GIVE_FOOD" },
      { "text": "Get away from me.", "topic": "TALK_DONE" },
      { "text": "…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_GIVE_FOOD",
    "dynamic_line": {
      "npc_has_effect": "beggar_has_eaten",
      "yes": "Oh nice.  Crunchings and munchings.  That's a cool, a cool thing.",
      "no": "Yeah, I'm real hungry and they put drugs in most of the food.  I can see you're not like that."
    },
    "responses": [
      { "text": "Actually can I ask you something else?", "topic": "TALK_NONE" },
      { "text": "I'm sorry, I was wrong.  I can't help you.", "topic": "TALK_DONE" }
    ],
    "repeat_responses": [
      {
        "for_category": [ "food" ],
        "response": { "text": "Here, you can have this <topic_item>.", "topic": "TALK_REFUGEE_BEGGAR_2_GAVE_FOOD" }
      }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_GAVE_FOOD",
    "dynamic_line": "I can tell when it has stuff in it, it's got a sandy texture.  But this doesn't.  Thanks again.",
    "speaker_effect": [ { "effect": { "npc_add_effect": "beggar_has_eaten", "duration": 3600 } } ],
    "responses": [
      { "text": "What are you doing here?", "topic": "TALK_REFUGEE_BEGGAR_2", "effect": { "u_bulk_donate": 1 } },
      { "text": "No problem.  See you around.", "topic": "TALK_DONE", "effect": { "u_bulk_donate": 1 } }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_CARDBOARD",
    "dynamic_line": "I'm building a house out of cardboard.  The sandman doesn't want me to, but I told him to go fuck himself.",
    "responses": [
      { "text": "Why cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_CARDBOARD2" },
      { "text": "The sandman?", "topic": "TALK_REFUGEE_BEGGAR_2_SANDMAN" },
      { "text": "Would you like me to give you some cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_GIVECARDBOARD" },
      { "text": "Why are you sitting out here?", "topic": "TALK_REFUGEE_BEGGAR_2_REFUGEE" },
      { "text": "Are you seriously wearing a dinosaur costume?", "topic": "TALK_REFUGEE_BEGGAR_2_DINOSAUR" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_CARDBOARD2",
    "dynamic_line": "There's so much of it now, and the zombies are afraid of it.  It's kept me safe so far.  The beta rays come from the center point of the zombie, so it hits the cardboard and can't penetrate.  The reflection can stop any further damage.",
    "responses": [
      { "text": "Would you like me to give you some cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_GIVECARDBOARD" },
      { "text": "Why are you sitting out here?", "topic": "TALK_REFUGEE_BEGGAR_2_REFUGEE" },
      { "text": "Are you seriously wearing a dinosaur costume?", "topic": "TALK_REFUGEE_BEGGAR_2_DINOSAUR" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_GIVECARDBOARD",
    "dynamic_line": "Kind of a question's that?  Yeah man, you got cardboard, I got a whole… a whole shopping list.  Got it here.",
    "speaker_effect": { "effect": { "npc_add_var": "cardboard_donor", "type": "mission", "context": "dinodave", "value": "yes" } },
    "responses": [
      { "text": "What's next on the list?", "topic": "TALK_MISSION_LIST" },
      { "text": "What were you saying before?", "topic": "TALK_NONE" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_SANDMAN",
    "dynamic_line": "If you don't know who he is, I definitely can't tell you.  He talks to everyone, if you didn't hear him that means you can't be trusted, except to help me out.",
    "responses": [
      { "text": "…What were you saying before?", "topic": "TALK_NONE" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_REFUGEE",
    "dynamic_line": "These cowards are afraid of me.  They won't let me into their base.  I'm going to build my new house and I won't let them in.",
    "responses": [
      { "text": "You said you were building a house?", "topic": "TALK_REFUGEE_BEGGAR_2_CARDBOARD" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_DINOSAUR",
    "dynamic_line": "No.",
    "responses": [
      { "text": "I… I can see you wearing it.  Why are you wearing that?", "topic": "TALK_REFUGEE_BEGGAR_2_WEARING" },
      { "text": "What was that about cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_CARDBOARD" },
      { "text": "Why are you sitting out here?", "topic": "TALK_REFUGEE_BEGGAR_2_REFUGEE" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_WEARING",
    "dynamic_line": "You ask me what I can see, but I don't tell you what you see.  Sometimes we have shields up, to protect ourselves.",
    "responses": [
      { "text": "What was that about cardboard?", "topic": "TALK_REFUGEE_BEGGAR_2_CARDBOARD" },
      { "text": "Why are you sitting out here?", "topic": "TALK_REFUGEE_BEGGAR_2_REFUGEE" },
      { "text": "I think I have to get going…", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_JOBSDONE",
    "dynamic_line": {
      "concatenate": [
        "Well… I had it all pretty together,\u0020",
        {
          "u_has_var": "beggars_recruited",
          "type": "general",
          "context": "recruit",
          "value": "yes",
          "yes": "but the others have left, and\u0020",
          "no": "and I feel bad with all the help you've given me already, but\u0020"
        },
        "now the masters won't let me build my sanctuary.  I know I can't build it in here, they wouldn't allow it.  They won't listen to me when I ask for a safe place.  They just want me to disappear, like the others.  Can you help me figure them out?"
      ]
    },
    "responses": [
      {
        "condition": { "not": { "u_has_var": "beggars_recruited", "type": "general", "context": "recruit", "value": "yes" } },
        "text": "Why don't you leave this place?  Come with me, I could use some help out there.",
        "topic": "TALK_REFUGEE_BEGGAR_2_JOIN"
      },
      {
        "text": "Sure, Dave.  One last favor, I think I can talk to Smokes about finding you a place to go.",
        "effect": { "assign_mission": "MISSION_BEGGAR_2_PERMISSION" },
        "topic": "TALK_DONE"
      },
      { "text": "I'll have to think on that, Dave, I've done a lot already.", "topic": "TALK_DONE" }
    ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_PERMISSION",
    "dynamic_line": "The roof!  So high!  So lofty!  I can hardly believe it!  This will be a nicer house than I had before everything went funny.  I can watch out, I'm happy to do that.  And it'll be nice to still have a bathroom!  Come see me there, my friend.  I will not disappoint you.",
    "speaker_effect": {
      "effect": [
        { "finish_mission": "MISSION_BEGGAR_2_PERMISSION", "success": true },
        { "npc_first_topic": "TALK_DINODAVE_1" },
        { "mapgen_update": "cardboard_castle_1_main", "om_terrain": "evac_center_13_z1" },
        { "mapgen_update": "cardboard_castle_1_roof", "om_terrain": "evac_center_13_z2" },
        { "npc_teleport": { "global_val": "dave_castle" } }
      ]
    },
    "responses": [ { "text": "I'll see you on the rooftop.  Good luck, Dave.", "topic": "TALK_DONE" } ]
  },
  {
    "type": "talk_topic",
    "id": "TALK_REFUGEE_BEGGAR_2_JOIN",
    "dynamic_line": "No!  I just got everything together.  I am not leaving, not now.  Everything's finally coming together!",
    "responses": [
      {
        "text": "Well, OK then, Dave.  One last favor, I think I can talk to Smokes about finding you a place to go.",
        "effect": { "assign_mission": "MISSION_BEGGAR_2_PERMISSION" },
        "topic": "TALK_DONE"
      },
      { "text": "I'll have to think on it, Dave, I've done a lot already.", "topic": "TALK_DONE" }
    ]
  },
  {
    "id": "MISSION_BEGGAR_2_BOX_SMALL",
    "type": "mission_definition",
    "name": { "str": "Bring 40 small cardboard boxes" },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_FIND_ITEM",
    "item": "box_small",
    "count": 40,
    "followup": "MISSION_BEGGAR_2_DUCT_TAPE",
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "Gotta start small right?  Little ones for keeping little things safe.  I could use 'em.",
      "offer": "Gotta start small right?  Little ones for keeping little things safe.  I could use 'em.  I need a bunch of 'em.  Little ones, you know?  Can you bring me like… like… forty?",
      "accepted": "Oh man, thanks so much my friend.  You won't regret it.",
      "rejected": "I didn't think so.",
      "advice": "Watch out, he's looking for it too.",
      "inquire": "Got the little ones yet?",
      "success": "Oh this is so great, so great!",
      "success_lie": "Oh this is so great, so great!",
      "failure": "Oh, that's too bad.  Guess they're eating it all."
    }
  },
  {
    "id": "MISSION_BEGGAR_2_DUCT_TAPE",
    "type": "mission_definition",
    "name": { "str": "Bring a roll of duct tape (200 charges)" },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_FIND_ITEM",
    "item": "duct_tape",
    "count": 200,
    "followup": "MISSION_BEGGAR_2_BOX_MEDIUM",
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "These ones are good, good ones.  They need something to, you know, bind them together.  Surround them, light side, dark side.",
      "offer": "These ones are good, good ones.  They need something to, you know, bind them together.  Surround them, light side, dark side.  Bring me the Force!",
      "accepted": "Oh man, thanks so much my friend.  You won't regret it.",
      "rejected": "I didn't think so.",
      "advice": "Watch out, he's looking for it too.",
      "inquire": "It's all around us… but did you get it in a crude matter form?",
      "success": "Oh this is so great, so great!",
      "success_lie": "Oh this is so great, so great!",
      "failure": "Oh, that's too bad.  Guess they're eating it all."
    }
  },
  {
    "id": "MISSION_BEGGAR_2_BOX_MEDIUM",
    "type": "mission_definition",
    "name": { "str": "Bring 10 cardboard boxes" },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_FIND_ITEM",
    "item": "box_medium",
    "count": 10,
    "followup": "MISSION_BEGGAR_2_PLASTIC_SHEET",
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "Ten bigger ones now please.  The list doesn't lie.  You've done so well.",
      "offer": "Ten bigger ones now please.  The list doesn't lie.  You've done so well.  I got a little more on the list, but we're more than half there.",
      "accepted": "Oh man, thanks so much my friend.  You won't regret it.",
      "rejected": "I didn't think so.",
      "advice": "Watch out, he's looking for it too.",
      "inquire": "Any luck?  Bigger ones?",
      "success": "I'm so happy now!",
      "success_lie": "I'm so happy now!",
      "failure": "Oh, that's too bad.  Guess they're eating it all."
    }
  },
  {
    "id": "MISSION_BEGGAR_2_PLASTIC_SHEET",
    "type": "mission_definition",
    "name": { "str": "Bring 10 large plastic sheets" },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_FIND_ITEM",
    "item": "plastic_sheet",
    "count": 10,
    "followup": "MISSION_BEGGAR_2_BOX_LARGE",
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "If I can set it up in here I won't need it, but they might drive me out, so I guess I need some plastic just in case.  I don't like it, the sandman can smell through plastic, but I think the cardboard is stronger.",
      "offer": "If I can set it up in here I won't need it, but they might drive me out, so I guess I need some plastic just in case.  I don't like it, the sandman can smell through plastic, but I think the cardboard is stronger.  Please bring me some plastic sheets.",
      "accepted": "We're almost there, now.",
      "rejected": "I didn't think so.",
      "advice": "They keep a lot of this stuff in hardware stores and lumber yards.",
      "inquire": "I really feel bad sending you on this one, it's dangerous.  Have you found anything?",
      "success": "Nice, this will do perfectly!",
      "success_lie": "Nice, this will do perfectly!",
      "failure": "Oh, that's too bad."
    }
  },
  {
    "id": "MISSION_BEGGAR_2_BOX_LARGE",
    "type": "mission_definition",
    "name": { "str": "Bring 5 large cardboard boxes" },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_FIND_ITEM",
    "item": "box_large",
    "count": 5,
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "This is the last thing I need from you.  I've been collecting the other parts myself, it's been easier with more cardboard around.  Can you bring me five more really big cardboard boxes?",
      "offer": "This is the last thing I need from you.  I've been collecting the other parts myself, it's been easier with more cardboard around.  Can you bring me five more really big cardboard boxes?  Five more cardboard boxes, as big as it gets.  I have a few already stored up, that should be all I need.",
      "accepted": "Yes!  The home stretch!",
      "rejected": "Oh man, but we're so close!",
      "advice": "Try looking in cargo storage areas.",
      "inquire": "Did you bring me those last few boxes?",
      "success": "Brilliant!  You're a true hero.  I'll see if I can find a place to set these up now.",
      "success_lie": "Brilliant!  You're a true hero.  I'll see if I can find a place to set these up now.",
      "failure": "No!  Oh god, no, this can't be happening…"
    }
  },
  {
    "id": "MISSION_BEGGAR_2_PERMISSION",
    "type": "mission_definition",
    "name": { "str": "Talk to Smokes about finding Dave a place to call home." },
    "difficulty": 1,
    "value": 0,
    "goal": "MGOAL_CONDITION",
    "goal_condition": { "u_has_var": "Dave_Permission", "type": "mission", "value": "yes" },
    "count": 5,
    "origins": [ "ORIGIN_SECONDARY" ],
    "dialogue": {
      "describe": "I have it, I have it all, but I can't find a place to put it.  Will you ask the masters?  Maybe?  I've tried but they ignore me.",
      "offer": "I have it, I have it all, but I can't find a place to put it.  Will you ask the masters?  Maybe?  I've tried but they ignore me.  I just need a place to put it all, a place I can be safe, and not make anyone upset.",
      "accepted": "Thank you!  I'm sorry, I thought we were done, but we can do this!",
      "rejected": "Oh man, but we're so close!",
      "advice": "Maybe somewhere they can't see me?  Where I can just be me?",
      "inquire": "Did you ask the masters?",
      "success": "The roof!  So high!  So lofty!  Come see me there, my friend.  I will not disappoint you.",
      "success_lie": "I don't understand.",
      "failure": "No!  Oh god, no, this can't be happening…"
    },
    "end": {
      "effect": [
        { "u_adjust_var": "dave_castle_stage", "adjustment": 1 },
        { "u_adjust_var": "refugee_happiness", "type": "counter", "context": "refugee_center", "adjustment": 1 },
        { "mapgen_update": "refcenter_unlock_roofstairs", "om_terrain": "evac_center_13" }
      ]
    }
  },
  {
    "type": "mapgen",
    "update_mapgen_id": "cardboard_castle_1_main",
    "method": "json",
    "object": {
      "translate_ter": [ { "from": "t_door_metal_locked", "to": "t_door_metal_c", "x": [ 0, 23 ], "y": [ 0, 23 ] } ],
      "place_nested": [ { "chunks": [ "cardboard_castle_1_main" ], "x": 0, "y": 17 } ],
      "set": [ { "point": "variable", "id": "dave_castle", "x": 4, "y": 19 } ]
    }
  },
  {
    "type": "mapgen",
    "update_mapgen_id": "cardboard_castle_1_roof",
    "method": "json",
    "object": { "place_nested": [ { "chunks": [ "cardboard_castle_1_roof" ], "x": 0, "y": 16 } ] }
  },
  {
    "type": "mapgen",
    "method": "json",
    "nested_mapgen_id": "cardboard_castle_1_main",
    "//": "First iteration of Dino Dave's cardboard castle - main floor.",
    "object": {
      "mapgensize": [ 6, 6 ],
      "rows": [
        "||-|||",
        "|__CC|",
        "|____|",
        "||-|||",
        "|__BB|",
        "||||||"
      ],
      "furniture": {
        "|": "f_cardboard_wall",
        "-": "f_cardboard_door",
        "_": "f_cardboard_floor",
        "C": "f_cardboard_box",
        "B": "f_floor_mattress"
      }
    }
  },
  {
    "type": "mapgen",
    "method": "json",
    "nested_mapgen_id": "cardboard_castle_1_roof",
    "//": "First iteration of Dino Dave's cardboard castle - roof.",
    "object": {
      "mapgensize": [ 6, 6 ],
      "rows": [
        "______",
        "______",
        "______",
        "______",
        "______",
        "______"
      ],
      "furniture": { "_": "f_cardboard_roof" }
    }
  },
  {
    "type": "mapgen",
    "update_mapgen_id": "refcenter_unlock_roofstairs",
    "method": "json",
    "object": {
      "set": [
        { "point": "terrain", "id": "t_door_metal_c", "x": 1, "y": 14 },
        { "point": "terrain", "id": "t_door_metal_c", "x": 22, "y": 14 }
      ]
    }
  }
]
