From e1daf011b22b48f590f36579912d57182bebf880 Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Mon, 2 May 2022 14:40:57 -0500 Subject: [PATCH 1/8] Port Tacoma doctor updates --- data/json/mapgen/looted_buildings.json | 2 +- .../npcs/tacoma_ranch/NPC_ranch_barber.json | 13 + .../tacoma_ranch/NPC_ranch_bartender.json | 13 + .../tacoma_ranch/NPC_ranch_carpenter1.json | 17 +- .../tacoma_ranch/NPC_ranch_carpenter2.json | 13 + .../tacoma_ranch/NPC_ranch_crop_overseer.json | 13 + .../npcs/tacoma_ranch/NPC_ranch_doctor.json | 277 +++++++++++++++++- .../npcs/tacoma_ranch/NPC_ranch_farmer1.json | 13 + .../npcs/tacoma_ranch/NPC_ranch_farmer2.json | 13 + .../npcs/tacoma_ranch/NPC_ranch_foreman.json | 63 ++++ .../npcs/tacoma_ranch/NPC_ranch_generic.json | 14 + .../npcs/tacoma_ranch/NPC_ranch_nurse.json | 13 + .../tacoma_ranch/NPC_ranch_scavenger.json | 29 ++ .../npcs/tacoma_ranch/NPC_ranch_scrapper.json | 88 ++++++ .../NPC_ranch_sickly_laborer.json | 19 ++ .../tacoma_ranch/NPC_ranch_woodcutter1.json | 13 + .../tacoma_ranch/NPC_ranch_woodcutter2.json | 13 + .../mission_mapgen_tacoma_commune.json | 5 + .../overmap_terrain/overmap_terrain.json | 18 ++ data/mods/alt_map_key/overmap_terrain.json | 16 + src/mission_companion.cpp | 164 +++++++++++ src/mission_companion.h | 2 + 22 files changed, 824 insertions(+), 7 deletions(-) create mode 100644 data/json/npcs/tacoma_ranch/NPC_ranch_generic.json diff --git a/data/json/mapgen/looted_buildings.json b/data/json/mapgen/looted_buildings.json index 142d2a5e9bf3e..7998149cb8b44 100644 --- a/data/json/mapgen/looted_buildings.json +++ b/data/json/mapgen/looted_buildings.json @@ -3,7 +3,7 @@ "type": "mapgen", "method": "json", "//": "Pseudo terrain used for Tacoma companion raids", - "om_terrain": [ "looted_house", "looted_house_roof", "looted_house_basement" ], + "om_terrain": [ "looted_house", "looted_house_roof", "looted_house_basement", "looted_hospital", "looted_hospital_roof" ], "object": { "fill_ter": "t_floor" } } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_barber.json b/data/json/npcs/tacoma_ranch/NPC_ranch_barber.json index c1013f36d73ca..e4c53dbc1ebd6 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_barber.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_barber.json @@ -15,6 +15,19 @@ "type": "talk_topic", "dynamic_line": "Can I interest you in a trim? It'll cost you 6 merch for a haircut or 3 for a beard trim. I can do color and styling too.", "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_BARBER_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_BARBER_HIRE" }, { diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json b/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json index fed6193025ccd..053cda6029523 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_bartender.json @@ -16,6 +16,19 @@ "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" }, diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter1.json b/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter1.json index 93a656771124e..369f57a4743c6 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter1.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter1.json @@ -14,6 +14,21 @@ "type": "talk_topic", "id": "TALK_RANCH_CONSTRUCTION_1", "dynamic_line": "My partner is in charge of fortifying this place, you should ask him about what needs to be done.", - "responses": [ { "text": "I'll talk to him then…", "topic": "TALK_DONE" } ] + "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": "I'll talk to him then…", "topic": "TALK_DONE" } + ] } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter2.json b/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter2.json index 56e71b1c256d4..b36e1502ada00 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter2.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_carpenter2.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_CONSTRUCTION_2", "dynamic_line": "Howdy.", "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 are you doing here?", "topic": "TALK_RANCH_CONSTRUCTION_2_JOB" }, { "text": "I've got to go…", "topic": "TALK_DONE" } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_crop_overseer.json b/data/json/npcs/tacoma_ranch/NPC_ranch_crop_overseer.json index 7335565510490..292af2992a264 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_crop_overseer.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_crop_overseer.json @@ -15,6 +15,19 @@ "type": "talk_topic", "dynamic_line": "I hope you are here to do business.", "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 are you doing here?", "topic": "TALK_RANCH_CROP_OVERSEER_JOB" }, { "text": "I figured you might be looking for some help…", diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json index 83c4a03ad0caa..155646533c5c4 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json @@ -13,23 +13,290 @@ { "type": "talk_topic", "id": "TALK_RANCH_DOCTOR", - "dynamic_line": "I'm sorry, I don't have time to see you at the moment.", + "dynamic_line": { + "u_has_var": "doctor_provides_aid", + "type": "dialogue", + "context": "tacoma_ranch", + "value": "yes", + "yes": "How can I help you today?", + "no": "I'm sorry, I don't have time to see you at the moment." + }, "responses": [ - { "text": "For the right price could I borrow your services?", "topic": "TALK_RANCH_DOCTOR_BIONICS" }, + { + "text": "Is there anything else I can help with?", + "topic": "TALK_MISSION_LIST", + "condition": { + "and": [ { "u_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] + } + }, + { + "text": "Maybe I could help you with something?", + "topic": "TALK_RANCH_DOCTOR_SUPPLIES", + "condition": { + "and": [ + { "not": { "u_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } }, + { "not": { "u_has_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" } } + ] + }, + "effect": [ + { "add_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" }, + { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } + ] + }, + { + "text": "I have the supplies you asked for.", + "topic": "TALK_RANCH_DOCTOR", + "condition": { + "and": [ + { "u_has_items": { "item": "book_binder", "count": 10 } }, + { "u_has_items": { "item": "paper", "count": 500 } }, + { "u_has_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" } + ] + }, + "effect": [ "mission_success", "clear_mission" ] + }, + { + "text": "I have the anesthetic you asked for.", + "topic": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC_DELIVERED", + "condition": { + "and": [ + { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, + { + "not": { "u_has_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + }, + { "u_has_items": { "item": "anesthetic", "count": 3000 } } + ] + }, + "effect": [ + { "u_sell_item": "anesthetic", "count": 3000 }, + { "npc_consume_item": "anesthetic", "count": 3000 }, + { "u_add_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + ] + }, + { "text": "Could you help me with some bionics?", "topic": "TALK_RANCH_DOCTOR_BIONICS" }, + { "text": "I could use your medical assistance.", "topic": "TALK_RANCH_DOCTOR_AID" }, { "text": "…", "topic": "TALK_DONE" } ] }, + { + "id": "TALK_RANCH_DOCTOR_AID", + "type": "talk_topic", + "dynamic_line": { + "u_has_var": "doctor_provides_aid", + "type": "dialogue", + "context": "tacoma_ranch", + "value": "yes", + "yes": { + "npc_has_effect": "currently_busy", + "yes": "I have other patients to attend to. Come back later.", + "no": "What can I help you with?" + }, + "no": "I can't right now, I have other matters to attend to." + }, + "responses": [ + { + "text": "[$200, 30m] I need you to patch me up.", + "topic": "TALK_RANCH_DOCTOR_AID_DONE", + "effect": [ "give_aid", { "u_spend_cash": 20000 } ], + "condition": { + "and": [ + { "npc_service": true }, + { "u_has_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + ] + } + }, + { + "text": "[$500, 1h] I need you to patch my friends up.", + "topic": "TALK_RANCH_DOCTOR_AID_DONE", + "effect": [ "give_all_aid", { "u_spend_cash": 50000 } ], + "condition": { + "and": [ + { "npc_service": true }, + { "u_has_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + ] + } + }, + { "text": "Never mind.", "topic": "TALK_NONE" }, + { "text": "I've got to go…", "topic": "TALK_DONE" } + ] + }, + { + "type": "talk_topic", + "id": "TALK_RANCH_DOCTOR_AID_DONE", + "dynamic_line": "Take it easy now. Wouldn't want you coming back here too soon.", + "responses": [ { "text": "…", "topic": "TALK_DONE" } ] + }, { "id": "TALK_RANCH_DOCTOR_BIONICS", "type": "talk_topic", - "dynamic_line": "I imagine we might be able to work something out.", + "dynamic_line": { + "u_has_var": "doctor_provides_bionics", + "type": "dialogue", + "context": "tacoma_ranch", + "value": "yes", + "yes": "What can I help you with?", + "no": "We don't have the medical equipment to do that right now." + }, "responses": [ { "text": "I was wondering if you could install a cybernetic implant…", "topic": "TALK_DONE", - "effect": "bionic_install" + "effect": "bionic_install", + "condition": { + "and": [ + { "npc_service": true }, + { "u_has_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + ] + } + }, + { + "text": "I need help removing an implant…", + "topic": "TALK_DONE", + "effect": "bionic_remove", + "condition": { + "and": [ + { "npc_service": true }, + { "u_has_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + ] + } + }, + { "text": "Never mind.", "topic": "TALK_NONE" }, + { "text": "I've got to go…", "topic": "TALK_DONE" } + ] + }, + { + "id": "TALK_RANCH_DOCTOR_SUPPLIES", + "type": "talk_topic", + "dynamic_line": "There's too much to keep track of right now and nobody has any kind of office supplies around here. I need to be able to keep track of medical records and keep them organized so that I can focus on helping people. Ten binders and a ream of paper should get us started.", + "responses": [ + { + "text": "I'll see what I can find.", + "topic": "TALK_RANCH_DOCTOR", + "effect": [ { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } ] }, - { "text": "I need help removing an implant…", "topic": "TALK_DONE", "effect": "bionic_remove" } + { "text": "Never mind.", "topic": "TALK_NONE" }, + { "text": "I've got to go…", "topic": "TALK_DONE" } ] + }, + { + "id": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC_DELIVERED", + "type": "talk_topic", + "dynamic_line": "Thanks, this will help a lot.", + "responses": [ { "text": "Glad to help.", "topic": "TALK_NONE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } ] + }, + { + "id": "MISSION_RANCH_DOCTOR_SUPPLIES", + "type": "mission_definition", + "name": { "str": "Collect Office Supplies" }, + "description": "The doctor needs office supplies to keep track of medical records. Bring them 10 Book binders and 500 paper", + "goal": "MGOAL_CONDITION", + "goal_condition": { "npc_has_var": "-", "type": "-", "context": "-", "value": "-" }, + "difficulty": 1, + "value": 50000, + "origins": [ "ORIGIN_SECONDARY" ], + "followup": "MISSION_RANCH_DOCTOR_MEDICAL_GLOVES", + "dialogue": { + "describe": "-", + "offer": "-", + "accepted": "-", + "rejected": "-", + "advice": "-", + "inquire": "-", + "success": "-", + "success_lie": "-", + "failure": "-" + }, + "end": { + "update_mapgen": [ + { + "om_terrain": "ranch_camp_59", + "set": [ + { "square": "furniture", "id": "f_filing_cabinet", "x": 5, "y": 0, "x2": 8, "y2": 0 }, + { "square": "furniture", "id": "f_filing_cabinet", "x": 5, "y": 2, "x2": 8, "y2": 2 } + ], + "place_items": [ + { "item": "ranch_doctor_filing_cabinets", "x": [ 5, 8 ], "chance": 100, "y": 0, "repeat": 5 }, + { "item": "ranch_doctor_filing_cabinets", "x": [ 5, 8 ], "chance": 100, "y": 2, "repeat": 5 } + ] + } + ], + "effect": [ + { "u_sell_item": "book_binder", "count": 10 }, + { "npc_consume_item": "book_binder", "count": 10 }, + { "u_sell_item": "paper", "count": 500 }, + { "npc_consume_item": "paper", "count": 500 }, + { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + ] + } + }, + { + "id": "MISSION_RANCH_DOCTOR_MEDICAL_GLOVES", + "type": "mission_definition", + "name": { "str": "Find 10 Pairs of Medical Gloves" }, + "description": "Bring the doctor 10 pairs of medical gloves.", + "goal": "MGOAL_FIND_ITEM", + "difficulty": 5, + "value": 50000, + "item": "gloves_medical", + "count": 10, + "origins": [ "ORIGIN_SECONDARY" ], + "followup": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC", + "dialogue": { + "describe": "We need help…", + "offer": "If we need to perform any serious surgery, I'm going to need some more medical gloves to help prevent infections. Can you bring me 10 pairs?", + "accepted": "I'm counting on you.", + "rejected": "Come back when you get a chance. We need skilled survivors.", + "advice": "Hospitals or clinics might have a few sitting around.", + "inquire": "Do you have the medical gloves?", + "success": "Thank you for your assistance.", + "success_lie": "What good does this do us?", + "failure": "It was a lost cause anyways…" + }, + "end": { "effect": [ { "u_add_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } + }, + { + "id": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC", + "type": "mission_definition", + "name": { "str": "Anesthetic for the Doctor" }, + "description": "Bring the doctor 3000 units of anesthetic. Ask around the commune for assistance in building an anesthetic machine.", + "goal": "MGOAL_CONDITION", + "goal_condition": { + "and": [ + { "u_has_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + { + "u_has_var": "doctor_anesthetic_scavengers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + }, + { + "u_has_var": "doctor_anesthetic_scrappers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } + ] + }, + "difficulty": 5, + "value": 50000, + "item": "anesthetic", + "count": 3000, + "origins": [ "ORIGIN_SECONDARY" ], + "followup": "MISSION_NULL", + "dialogue": { + "describe": "We need help…", + "offer": "We only have basic painkillers right now. For longer surgeries, we're going to need some anesthetic to prevent pain. Can you bring me 3000 units to start? We're also going to need an anesthetic machine to deliver it. Maybe some people around the commune can help with that?", + "accepted": "I'm counting on you.", + "rejected": "Come back when you get a chance. We need skilled survivors.", + "advice": "Hospitals or clinics might have some. Labs could have some as well.", + "inquire": "Any progress on getting some anesthetic or parts? Make sure to take the anesthetic out of a kit first as well.", + "success": "The scavengers found more medical equipment than I expected and with the help from the scrappers, I've been able to get most of it up and running. I should be able to perform more operations now and could even help with some bionics if you have any.", + "success_lie": "What good does this do us?", + "failure": "It was a lost cause anyways…" + }, + "end": { + "update_mapgen": [ { "om_terrain": "ranch_camp_50", "set": [ { "point": "furniture", "id": "f_anesthetic", "x": 19, "y": 19 } ] } ], + "effect": { "u_add_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + } } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_farmer1.json b/data/json/npcs/tacoma_ranch/NPC_ranch_farmer1.json index bffd745625cec..502bfb501d491 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_farmer1.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_farmer1.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_FARMER_1", "dynamic_line": "…", "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 are you doing here?", "topic": "TALK_RANCH_FARMER_1_JOB" }, { "text": "I'd like to hire your services.", "topic": "TALK_RANCH_FARMER_1_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_farmer2.json b/data/json/npcs/tacoma_ranch/NPC_ranch_farmer2.json index 5173797b48b19..e6b4b22f3e808 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_farmer2.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_farmer2.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_FARMER_2", "dynamic_line": "You mind?", "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 are you doing here?", "topic": "TALK_RANCH_FARMER_2_JOB" }, { "text": "I'd like to hire your services.", "topic": "TALK_RANCH_FARMER_2_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json index 8a8c031da8048..d4313a2d315b7 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_foreman.json @@ -25,6 +25,11 @@ "topic": "TALK_RANCH_FOREMAN_PROSPECTUS", "condition": { "and": [ { "u_has_mission": "MISSION_FREE_MERCHANTS_EVAC_3" }, { "not": { "u_has_effect": "has_prospectus" } } ] } }, + { + "text": "The doctor needs some help building an anesthetic machine. Do you have anything that could help?", + "topic": "TALK_RANCH_FOREMAN_ANESTHETIC_FOR_DOCTOR", + "condition": { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" } + }, { "text": "I heard you were setting up an outpost out here.", "topic": "TALK_RANCH_FOREMAN_OUTPOST" }, { "text": "What's your job here?", "topic": "TALK_RANCH_FOREMAN_JOB" }, { "text": "What do you need done?", "topic": "TALK_MISSION_LIST" }, @@ -53,6 +58,64 @@ } ] }, + { + "id": "TALK_RANCH_FOREMAN_ANESTHETIC_FOR_DOCTOR", + "type": "talk_topic", + "dynamic_line": { + "u_has_var": "doctor_anesthetic_scavengers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes", + "no": { + "u_has_var": "doctor_anesthetic_scrappers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes", + "no": "I don't have anything to offer, but you could talk to the scavenger boss and the scrappers; They might be able to help.", + "yes": "I don't have anything to offer, but maybe the scavenger boss could help find some materials." + }, + "yes": { + "u_has_var": "doctor_anesthetic_scrappers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes", + "no": "I don't have anything to offer, but maybe the scrappers could help find some materials.", + "yes": "I'm afraid I don't have anything to offer." + } + }, + "responses": [ + { + "text": "Thanks.", + "topic": "TALK_RANCH_FOREMAN", + "condition": { + "or": [ + { + "not": { "u_has_var": "doctor_anesthetic_scavengers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + }, + { + "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + ] + } + }, + { + "text": "Thanks anyway.", + "topic": "TALK_RANCH_FOREMAN", + "condition": { + "and": [ + { "u_has_var": "doctor_anesthetic_scavengers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + { + "u_has_var": "doctor_anesthetic_scrappers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } + ] + } + }, + { "text": "I've got to go…", "topic": "TALK_DONE" } + ] + }, { "type": "talk_topic", "id": "TALK_RANCH_FOREMAN_OUTPOST", diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_generic.json b/data/json/npcs/tacoma_ranch/NPC_ranch_generic.json new file mode 100644 index 0000000000000..88ca167531f6b --- /dev/null +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_generic.json @@ -0,0 +1,14 @@ +[ + { + "type": "talk_topic", + "id": "TALK_RANCH_GENERIC_ANESTHETIC_FOR_DOCTOR", + "dynamic_line": [ + "Unfortunately, I don't have anything that can help.", + "I don't know what I could offer.", + "Afraid not. Maybe somebody else could help.", + "Have you asked the scavenger boss if they'd have anything?", + "Maybe the scrapper would have some spare parts?" + ], + "responses": [ { "text": "OK.", "topic": "TALK_NONE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } ] + } +] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json b/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json index 6e45cf60234c4..066d341fea349 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_nurse.json @@ -17,6 +17,19 @@ "id": "TALK_RANCH_NURSE", "dynamic_line": "How can I help you?", "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_NURSE_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_NURSE_HIRE" }, { "text": "I could use your medical assistance.", "topic": "TALK_RANCH_NURSE_AID" }, diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json index 3db3b096c77bc..0cf3415538f17 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json @@ -16,6 +16,22 @@ "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": { "u_has_var": "doctor_anesthetic_scavengers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + }, + { + "not": { "u_has_var": "scavenger_hospital_raid_started", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + ] + }, + "effect": [ { "u_add_var": "scavenger_hospital_raid", "type": "mission", "context": "tacoma_ranch", "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" }, @@ -42,6 +58,19 @@ { "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 lab 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", diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json index 3e238342387c8..778b27d1596f5 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json @@ -15,6 +15,56 @@ "id": "TALK_RANCH_SCRAPPER", "dynamic_line": "Don't mind me.", "responses": [ + { + "text": "The doctor needs some help building an anesthetic machine. Do you have anything that could help?", + "topic": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR", + "condition": { + "and": [ + { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, + { + "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + ] + } + }, + { + "text": "Here's the tools you asked for.", + "topic": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR_TOOLS", + "condition": { + "and": [ + { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, + { + "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + }, + { + "u_has_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + }, + { "u_has_item": "angle_grinder" }, + { "u_has_item": "hacksaw" } + ] + }, + "effect": [ + { "u_sell_item": "angle_grinder" }, + { "npc_consume_item": "angle_grinder" }, + { "u_sell_item": "hacksaw" }, + { "npc_consume_item": "hacksaw" }, + { + "u_add_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "no" + }, + { + "u_add_var": "doctor_anesthetic_scrappers_helped", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } + ] + }, { "text": "What is your job here?", "topic": "TALK_RANCH_SCRAPPER_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_SCRAPPER_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } @@ -31,5 +81,43 @@ "id": "TALK_RANCH_SCRAPPER_HIRE", "dynamic_line": "I don't personally, the teams we send out to recover the vehicles usually need a hand, but can be hard to catch since they spend most of their time outside the outpost.", "responses": [ { "text": "OK.", "topic": "TALK_RANCH_SCRAPPER" } ] + }, + { + "type": "talk_topic", + "id": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR_TOOLS", + "dynamic_line": "Thanks, these will certainly help. I found the parts that you needed and can work with the doctor to build the equipment whenever they are ready.", + "responses": [ { "text": "Thanks.", "topic": "TALK_RANCH_SCRAPPER" } ] + }, + { + "id": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR", + "type": "talk_topic", + "dynamic_line": { + "u_has_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes", + "yes": "I'm still looking for the parts you need. Do you have the angle grinder and hacksaw that I asked for?", + "no": "Hmm, let me think. There might be a few things I could scrounge up to help, but it's going to take some time to sort through the scrap to find exactly what you need. How about this… some of my tools are getting a bit worn and are in need of replacement. If you could bring me a new angle grinder and a hacksaw, I should be able to find all the parts you need by the time you get back." + }, + "responses": [ + { + "text": "An angle grinder and a hacksaw? I'll see what I can do.", + "topic": "TALK_RANCH_SCAVENGER_1", + "effect": { "u_add_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + "condition": { + "not": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + }, + { + "text": "Not yet…", + "topic": "TALK_RANCH_SCAVENGER_1", + "condition": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + }, + { + "text": "I've got to go…", + "topic": "TALK_DONE", + "condition": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + ] } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json b/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json index 830cdcc352de0..2f85ccaa9b5f3 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_ILL_1", "dynamic_line": "Please leave me alone…", "responses": [ + { + "text": "The doctor needs some help building an anesthetic machine. Do you have anything that could help?", + "topic": "TALK_RANCH_SICKLY_LABORER_ANESTHETIC_FOR_DOCTOR", + "condition": { + "and": [ + { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, + { + "not": { "u_has_var": "doctor_anesthetic_sickly_laborer_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + } + ] + }, + "effect": [ { "u_add_var": "doctor_anesthetic_nurse_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] + }, { "text": "What is your job here?", "topic": "TALK_RANCH_ILL_1_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_ILL_1_HIRE" }, { "text": "What's wrong?", "topic": "TALK_RANCH_ILL_1_SICK" }, @@ -38,5 +51,11 @@ "id": "TALK_RANCH_ILL_1_SICK", "dynamic_line": "I keep getting sick! At first I thought it was something I ate, but now it seems like I can't keep anything down…", "responses": [ { "text": "Uhm.", "topic": "TALK_RANCH_ILL_1" } ] + }, + { + "type": "talk_topic", + "id": "TALK_RANCH_SICKLY_LABORER_ANESTHETIC_FOR_DOCTOR", + "dynamic_line": "What could I possibly have that could help?", + "responses": [ { "text": "Never mind.", "topic": "TALK_RANCH_ILL_1" } ] } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json index 659a2c5e5c944..f7493127174f4 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter1.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_WOODCUTTER", "dynamic_line": "You need something?", "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 are you doing here?", "topic": "TALK_RANCH_WOODCUTTER_JOB" }, { "text": "I'd like to hire your services.", "topic": "TALK_RANCH_WOODCUTTER_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter2.json b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter2.json index a6747203d7581..77ed490be7fc2 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter2.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_woodcutter2.json @@ -15,6 +15,19 @@ "id": "TALK_RANCH_WOODCUTTER_2", "dynamic_line": "Don't have much time to talk.", "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_WOODCUTTER_2_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_WOODCUTTER_2_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } diff --git a/data/json/npcs/tacoma_ranch/mission_mapgen_tacoma_commune.json b/data/json/npcs/tacoma_ranch/mission_mapgen_tacoma_commune.json index bb2bdb4bf93d7..1a62bdaef8633 100644 --- a/data/json/npcs/tacoma_ranch/mission_mapgen_tacoma_commune.json +++ b/data/json/npcs/tacoma_ranch/mission_mapgen_tacoma_commune.json @@ -4,6 +4,11 @@ "id": "ranch_nurse_clinic_aspirin", "items": [ { "item": "aspirin", "prob": 1, "charges": 20 } ] }, + { + "type": "item_group", + "id": "ranch_doctor_filing_cabinets", + "items": [ { "item": "book_binder", "prob": 1, "charges": [ 25, 50 ] } ] + }, { "type": "item_group", "//": "Subset of surgery item_group with only basic and non quest conflicting items", diff --git a/data/json/overmap/overmap_terrain/overmap_terrain.json b/data/json/overmap/overmap_terrain/overmap_terrain.json index 1d83da2ed05ed..a5d29b00a9633 100644 --- a/data/json/overmap/overmap_terrain/overmap_terrain.json +++ b/data/json/overmap/overmap_terrain/overmap_terrain.json @@ -487,6 +487,24 @@ "color": "white", "flags": [ "NO_ROTATE", "SHOULD_NOT_SPAWN" ] }, + { + "type": "overmap_terrain", + "//": "Pseudo terrain used for Tacoma companion raids", + "id": "looted_hospital", + "name": "looted hospital", + "sym": "%", + "color": "white", + "flags": [ "NO_ROTATE", "SHOULD_NOT_SPAWN" ] + }, + { + "type": "overmap_terrain", + "//": "Pseudo terrain used for Tacoma companion raids", + "id": "looted_hospital_roof", + "name": "looted hospital roof", + "sym": "%", + "color": "white", + "flags": [ "NO_ROTATE", "SHOULD_NOT_SPAWN" ] + }, { "type": "overmap_terrain", "id": [ "campsite", "campsite_a" ], diff --git a/data/mods/alt_map_key/overmap_terrain.json b/data/mods/alt_map_key/overmap_terrain.json index 04a3c59440dab..e64d1e7e346d0 100644 --- a/data/mods/alt_map_key/overmap_terrain.json +++ b/data/mods/alt_map_key/overmap_terrain.json @@ -6258,6 +6258,22 @@ "sym": "%", "color": "white" }, + { + "type": "overmap_terrain", + "id": "looted_hospital", + "copy-from": "looted_hospital", + "name": "looted hospital", + "sym": "%", + "color": "white" + }, + { + "type": "overmap_terrain", + "id": "looted_hospital_roof", + "copy-from": "looted_hospital_roof", + "name": "looted hospital roof", + "sym": "%", + "color": "white" + }, { "type": "overmap_terrain", "id": "football_field_a1", diff --git a/src/mission_companion.cpp b/src/mission_companion.cpp index 3f4c4cdfbdcb8..96f57dbca8547 100644 --- a/src/mission_companion.cpp +++ b/src/mission_companion.cpp @@ -77,6 +77,8 @@ static const itype_id itype_FMCNote( "FMCNote" ); static const itype_id itype_fungal_seeds( "fungal_seeds" ); static const itype_id itype_marloss_seed( "marloss_seed" ); +static const oter_str_id oter_looted_hospital( "looted_hospital" ); +static const oter_str_id oter_looted_hospital_roof( "looted_hospital_roof" ); static const oter_str_id oter_looted_house( "looted_house" ); static const oter_str_id oter_looted_house_basement( "looted_house_basement" ); static const oter_str_id oter_looted_house_roof( "looted_house_roof" ); @@ -102,8 +104,14 @@ static const trait_id trait_DEBUG_HS( "DEBUG_HS" ); static const trait_id trait_NPC_CONSTRUCTION_LEV_2( "NPC_CONSTRUCTION_LEV_2" ); static const trait_id trait_NPC_MISSION_LEV_1( "NPC_MISSION_LEV_1" ); +static const std::string var_DOCTOR_ANESTHETIC_SCAVENGERS_HELPED = + "npctalk_var_mission_tacoma_ranch_doctor_anesthetic_scavengers_helped"; static const std::string var_PURCHASED_FIELD_1_FENCE = "npctalk_var_dialogue_tacoma_ranch_purchased_field_1_fence"; +static const std::string var_SCAVENGER_HOSPITAL_RAID = + "npctalk_var_mission_tacoma_ranch_scavenger_hospital_raid"; +static const std::string var_SCAVENGER_HOSPITAL_RAID_STARTED = + "npctalk_var_mission_tacoma_ranch_scavenger_hospital_raid_started"; static const std::string role_id_faction_camp = "FACTION_CAMP"; @@ -139,6 +147,10 @@ static const miss_data miss_info[Camp_Harvest + 1] = { "Scavenging_Raid_Job", no_translation( "" ) }, + { + "Hospital_Raid_Job", + no_translation( "" ) + }, { "Menial_Job", no_translation( "" ) @@ -464,6 +476,7 @@ namespace talk_function { void scavenger_patrol( mission_data &mission_key, npc &p ); void scavenger_raid( mission_data &mission_key, npc &p ); +void hospital_raid( mission_data &mission_key, npc &p ); void commune_menial( mission_data &mission_key, npc &p ); void commune_carpentry( mission_data &mission_key, npc &p ); void commune_forage( mission_data &mission_key, npc &p ); @@ -484,6 +497,11 @@ void talk_function::companion_mission( npc &p ) if( p.has_trait( trait_NPC_MISSION_LEV_1 ) ) { scavenger_raid( mission_key, p ); } + + Character &player_character = get_player_character(); + if( player_character.get_value( var_SCAVENGER_HOSPITAL_RAID ) == "yes" ) { + hospital_raid( mission_key, p ); + } } else if( role_id == "COMMUNE CROPS" ) { title = _( "Agricultural Missions" ); commune_forage( mission_key, p ); @@ -576,6 +594,42 @@ void talk_function::scavenger_raid( mission_data &mission_key, npc &p ) } } +void talk_function::hospital_raid( mission_data &mission_key, npc &p ) +{ + const mission_id miss_id = {Hospital_Raid_Job, "", cata::nullopt}; + if( get_player_character().get_value( var_SCAVENGER_HOSPITAL_RAID_STARTED ) != "yes" ) { + const std::string entry_assign = + _( "Profit: hospital equipment, some items\nDanger: High\nTime: 20 hour mission\n\n" + "Scavenging raid targeting a hospital to search for hospital equipment and as many " + "valuable items as possible before being surrounded by the undead. " + "Combat is to be expected and assistance from the rest of the party " + "can't be guaranteed. This will be an extremely dangerous mission, " + "so make sure everyone is prepared before they go." ); + mission_key.add_start( miss_id, _( "Assign Hospital Raid" ), entry_assign ); + } + std::vector npc_list = companion_list( p, miss_id ); + if( !npc_list.empty() ) { + std::string entry_return = _( "Profit: hospital materials\nDanger: High\nTime: 20 hour missions\n\n" + "Raid Roster:\n" ); + bool avail = false; + + for( auto &elem : npc_list ) { + const bool done = calendar::turn >= elem->companion_mission_time + 20_hours; + avail |= done; + if( done ) { + entry_return += " " + elem->get_name() + _( " [DONE]\n" ); + } else { + entry_return += " " + elem->get_name() + " [" + std::to_string( to_hours( calendar::turn - + elem->companion_mission_time ) ) + _( " hours / 20 hours]\n" ); + } + } + if( avail ) { + entry_return += _( return_ally_question_string ); + } + mission_key.add_return( miss_id, _( "Retrieve Hospital Raid" ), entry_return, avail ); + } +} + void talk_function::commune_menial( mission_data &mission_key, npc &p ) { std::string entry = _( "Profit: 3 merch/hour\nDanger: None\nTime: 1 hour minimum\n\n" @@ -1038,6 +1092,17 @@ bool talk_function::handle_outpost_mission( const mission_entry &cur_key, npc &p } break; + case Hospital_Raid_Job: + if( cur_key.id.ret ) { + hospital_raid_return( p ); + } else { + npc_ptr npc = individual_mission( p, _( "departs on the hospital raid…" ), cur_key.id.id ); + if( npc != nullptr ) { + get_player_character().set_value( var_SCAVENGER_HOSPITAL_RAID_STARTED, "yes" ); + } + } + break; + case Menial_Job: if( cur_key.id.ret ) { labor_return( p ); @@ -1772,6 +1837,105 @@ bool talk_function::scavenging_raid_return( npc &p ) return true; } +bool talk_function::hospital_raid_return( npc &p ) +{ + npc_ptr comp = companion_choose_return( p, { Hospital_Raid_Job, "", cata::nullopt}, + calendar::turn - 20_hours ); + if( comp == nullptr ) { + return false; + } + int experience = rng( 20, 40 ); + if( one_in( 2 ) ) { + popup( _( "While scavenging, %s's party suddenly found itself set upon by a large mob of " + "undead…" ), comp->get_name() ); + int skill = scavenging_combat_skill( *comp, 4, true ); + if( one_in( 10 ) ) { + popup( _( "Through quick thinking the group was able to evade combat!" ) ); + } else { + popup( _( "Combat took place in close quarters, focusing on melee skills…" ) ); + int monsters = rng( 12, 30 ); + if( skill * rng_float( .60, 1.4 ) > ( .35 * monsters * rng_float( .6, 1.4 ) ) ) { + popup( _( "Through brute force the party smashed through the group of %d " + "undead!" ), monsters ); + experience += rng( 2, 10 ); + } else { + popup( _( "Unfortunately they were overpowered by the undead… I'm sorry." ) ); + overmap_buffer.remove_npc( comp->getID() ); + + // Let the player retry if everybody dies + get_player_character().set_value( var_SCAVENGER_HOSPITAL_RAID_STARTED, "no" ); + return false; + } + } + } + Character &player_character = get_player_character(); + tripoint_abs_omt loot_location = player_character.global_omt_location(); + std::set all_returned_items; + for( int i = 0; i < rng( 2, 3 ); i++ ) { + tripoint_abs_omt site = overmap_buffer.find_closest( + loot_location, "hospital", 0, false, ot_match_type::prefix ); + if( site == overmap::invalid_tripoint ) { + debugmsg( "No hospitals found." ); + } else { + // Search the entire height of the hospital, including the roof + for( int z = 0; z <= OVERMAP_HEIGHT; z++ ) { + site.z() = z; + + const oter_id &omt_ref = overmap_buffer.ter( site ); + // We're past the roof, so we can stop + if( omt_ref == oter_open_air ) { + break; + } + const std::string om_cur = omt_ref.id().c_str(); + + oter_str_id looted_replacement = oter_looted_hospital; + if( om_cur.find( "_roof" ) != std::string::npos ) { + looted_replacement = oter_looted_hospital_roof; + } + + overmap_buffer.reveal( site, 2 ); + std::set returned_items = loot_building( site, looted_replacement ); + all_returned_items.insert( returned_items.begin(), returned_items.end() ); + } + } + } + + companion_skill_trainer( *comp, "combat", experience * 10_minutes, 10 ); + popup( _( "%s returns from the raid having a fair bit of experience…" ), + comp->get_name() ); + + if( one_in( 2 ) ) { + item_group_id itemlist( "npc_misc" ); + if( one_in( 8 ) ) { + itemlist = Item_spawn_data_npc_weapon_random; + } + item result = item_group::item_from( itemlist ); + if( !result.is_null() ) { + popup( _( "%s returned with a %s for you!" ), comp->get_name(), result.tname() ); + player_character.i_add_or_drop( result ); + } + } + + for( item i : all_returned_items ) { + // One time mission, so the loot gets split evenly + if( one_in( 2 ) ) { + player_character.i_drop_at( i ); + } else { + i.set_owner( p ); + p.i_add_or_drop( i ); + } + } + + player_character.set_value( var_DOCTOR_ANESTHETIC_SCAVENGERS_HELPED, "yes" ); + player_character.set_value( var_SCAVENGER_HOSPITAL_RAID, "no" ); + + popup( _( "%s returned with some medical equipment that should help the doctor!" ), + comp->get_name() ); + + companion_return( *comp ); + return true; +} + bool talk_function::labor_return( npc &p ) { npc_ptr comp = companion_choose_return( p, { Menial_Job, "", cata::nullopt}, calendar::turn - diff --git a/src/mission_companion.h b/src/mission_companion.h index 5ad6aff7cdc21..7053cd5da9831 100644 --- a/src/mission_companion.h +++ b/src/mission_companion.h @@ -39,6 +39,7 @@ enum mission_kind : int { // Jobs assigned to companions for external parties Scavenging_Patrol_Job, Scavenging_Raid_Job, + Hospital_Raid_Job, Menial_Job, Carpentry_Job, Forage_Job, @@ -182,6 +183,7 @@ void field_plant( npc &p, const std::string &place ); void field_harvest( npc &p, const std::string &place ); bool scavenging_patrol_return( npc &p ); bool scavenging_raid_return( npc &p ); +bool hospital_raid_return( npc &p ); bool labor_return( npc &p ); bool carpenter_return( npc &p ); bool forage_return( npc &p ); From 774dfad34d9a625108632e1a9754d59e059415b2 Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Mon, 2 May 2022 22:36:55 -0500 Subject: [PATCH 2/8] Add spawns for crutches --- data/json/itemgroups/Locations_MapExtras/locations.json | 6 ++++-- data/json/itemgroups/SUS/domestic.json | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/data/json/itemgroups/Locations_MapExtras/locations.json b/data/json/itemgroups/Locations_MapExtras/locations.json index 6e64ae82b420d..bb401a3deeeae 100644 --- a/data/json/itemgroups/Locations_MapExtras/locations.json +++ b/data/json/itemgroups/Locations_MapExtras/locations.json @@ -215,7 +215,8 @@ { "item": "chem_hydrogen_peroxide", "prob": 5, "charges-min": 1 }, [ "strong_antibiotic", 1 ], [ "antibiotics", 5 ], - [ "weak_antibiotic", 15 ] + [ "weak_antibiotic", 15 ], + [ "crutches", 5 ] ] }, { @@ -263,7 +264,8 @@ [ "survnote", 1 ], [ "badge_doctor", 1 ], [ "tourist_table", 1 ], - [ "thermos", 10 ] + [ "thermos", 10 ], + [ "crutches", 5 ] ] }, { diff --git a/data/json/itemgroups/SUS/domestic.json b/data/json/itemgroups/SUS/domestic.json index 2ed2962fe8a46..e079dfb872463 100644 --- a/data/json/itemgroups/SUS/domestic.json +++ b/data/json/itemgroups/SUS/domestic.json @@ -842,7 +842,8 @@ { "group": "suits_mens", "prob": 10 }, { "group": "bags_unisex", "prob": 20 }, { "group": "hats_unisex", "prob": 20 }, - { "group": "scarfs_unisex", "prob": 30 } + { "group": "scarfs_unisex", "prob": 30 }, + { "item": "crutches", "prob": 1 } ] }, { @@ -869,7 +870,8 @@ { "group": "suits_womens", "prob": 50 }, { "group": "bags_unisex", "prob": 20 }, { "group": "hats_unisex", "prob": 20 }, - { "group": "scarfs_unisex", "prob": 20 } + { "group": "scarfs_unisex", "prob": 20 }, + { "item": "crutches", "prob": 1 } ] }, { From e7cbd62408d295fa20f2083f1a30281cf1916b03 Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Mon, 2 May 2022 23:11:14 -0500 Subject: [PATCH 3/8] Add crutches quest and cleanup quests/dialog --- .../npcs/tacoma_ranch/NPC_ranch_doctor.json | 71 ++++++++++++++----- .../tacoma_ranch/NPC_ranch_scavenger.json | 2 +- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json index 155646533c5c4..dc856ce1053d8 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json @@ -19,7 +19,7 @@ "context": "tacoma_ranch", "value": "yes", "yes": "How can I help you today?", - "no": "I'm sorry, I don't have time to see you at the moment." + "no": "I'm sorry, I don't have time to help you at the moment." }, "responses": [ { @@ -53,7 +53,26 @@ { "u_has_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" } ] }, - "effect": [ "mission_success", "clear_mission" ] + "effect": [ + { "u_message": "Thanks! This should help keep things organized for a while.", "type": "good", "popup": true }, + "mission_success", "clear_mission" + ] + }, + { + "text": "I couldn't find any crutches, but I made these. Will they work?", + "topic": "TALK_RANCH_DOCTOR", + "condition": { + "and": [ + { "u_has_items": { "item": "makeshift_crutches", "count": 1 } }, + { "u_has_mission": "MISSION_RANCH_DOCTOR_CRUTCHES" } + ] + }, + "effect": [ + { "u_consume_item": "makeshift_crutches", "count": 1 }, + { "u_message": "These will have to do…", "type": "good", "popup": true }, + "mission_success", + "clear_mission" + ] }, { "text": "I have the anesthetic you asked for.", @@ -167,7 +186,7 @@ { "id": "TALK_RANCH_DOCTOR_SUPPLIES", "type": "talk_topic", - "dynamic_line": "There's too much to keep track of right now and nobody has any kind of office supplies around here. I need to be able to keep track of medical records and keep them organized so that I can focus on helping people. Ten binders and a ream of paper should get us started.", + "dynamic_line": "I'm running out of office supplies. I know… of all the things to need at a time like this! I just need to be able to keep track of and organize medical records so that I can focus on helping people. Ten binders and a ream of paper should tide me over until some shipments come in.", "responses": [ { "text": "I'll see what I can find.", @@ -194,7 +213,7 @@ "difficulty": 1, "value": 50000, "origins": [ "ORIGIN_SECONDARY" ], - "followup": "MISSION_RANCH_DOCTOR_MEDICAL_GLOVES", + "followup": "MISSION_RANCH_DOCTOR_CRUTCHES", "dialogue": { "describe": "-", "offer": "-", @@ -221,29 +240,51 @@ } ], "effect": [ - { "u_sell_item": "book_binder", "count": 10 }, - { "npc_consume_item": "book_binder", "count": 10 }, - { "u_sell_item": "paper", "count": 500 }, - { "npc_consume_item": "paper", "count": 500 }, + { "u_consume_item": "paper", "count": 500 }, + { "u_consume_item": "book_binder", "count": 10 }, { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] } }, + { + "id": "MISSION_RANCH_DOCTOR_CRUTCHES", + "type": "mission_definition", + "name": { "str": "A Crutch to Lean on" }, + "description": "Bring the doctor some crutches.", + "goal": "MGOAL_FIND_ITEM", + "difficulty": 5, + "value": 50000, + "item": "crutches", + "count": 1, + "origins": [ "ORIGIN_SECONDARY" ], + "followup": "MISSION_RANCH_DOCTOR_MEDICAL_GLOVES", + "dialogue": { + "describe": "We need help…", + "offer": "One of the laborers injured their foot pretty badly and I don't want them walking on it for a few days at least. Do you think you could find a pair of crutches?", + "accepted": "I'm counting on you.", + "rejected": "Come back when you get a chance. We need skilled survivors.", + "advice": "You might be able to find some in hospitals, but some makeshift crutches would be better than nothing.", + "inquire": "Do you have the crutches?", + "success": "Thank you for your assistance.", + "success_lie": "What good does this do us?", + "failure": "It was a lost cause anyways…" + } + }, { "id": "MISSION_RANCH_DOCTOR_MEDICAL_GLOVES", "type": "mission_definition", - "name": { "str": "Find 10 Pairs of Medical Gloves" }, - "description": "Bring the doctor 10 pairs of medical gloves.", + "name": { "str": "Find 5 Pairs of Medical Gloves" }, + "description": "Bring the doctor 5 pairs of medical gloves.", "goal": "MGOAL_FIND_ITEM", "difficulty": 5, "value": 50000, "item": "gloves_medical", - "count": 10, + "count": 5, "origins": [ "ORIGIN_SECONDARY" ], "followup": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC", "dialogue": { "describe": "We need help…", - "offer": "If we need to perform any serious surgery, I'm going to need some more medical gloves to help prevent infections. Can you bring me 10 pairs?", + "offer": "We're getting a lot of scrapes and bruises coming in right now, but it's only a matter of time before we see a serious injury. I'm not prepared for when that happens and I'm hoping you can help. To start off, I'm going to need some more medical gloves to help prevent infections. Can you bring me 5 pairs?", "accepted": "I'm counting on you.", "rejected": "Come back when you get a chance. We need skilled survivors.", "advice": "Hospitals or clinics might have a few sitting around.", @@ -279,17 +320,15 @@ }, "difficulty": 5, "value": 50000, - "item": "anesthetic", - "count": 3000, "origins": [ "ORIGIN_SECONDARY" ], "followup": "MISSION_NULL", "dialogue": { "describe": "We need help…", - "offer": "We only have basic painkillers right now. For longer surgeries, we're going to need some anesthetic to prevent pain. Can you bring me 3000 units to start? We're also going to need an anesthetic machine to deliver it. Maybe some people around the commune can help with that?", + "offer": "I want to make sure we are setup to handle any major surgeries that come our way, but pain management is going to be an issue. For longer surgeries, we're going to need some anesthetic. Can you bring me 3000 units to start? We're also going to need an anesthetic machine to deliver it. Maybe some people around the commune can help with that?", "accepted": "I'm counting on you.", "rejected": "Come back when you get a chance. We need skilled survivors.", "advice": "Hospitals or clinics might have some. Labs could have some as well.", - "inquire": "Any progress on getting some anesthetic or parts? Make sure to take the anesthetic out of a kit first as well.", + "inquire": "Any progress on getting some anesthetic or parts?", "success": "The scavengers found more medical equipment than I expected and with the help from the scrappers, I've been able to get most of it up and running. I should be able to perform more operations now and could even help with some bionics if you have any.", "success_lie": "What good does this do us?", "failure": "It was a lost cause anyways…" diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json index 0cf3415538f17..9104c9af006d7 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scavenger.json @@ -61,7 +61,7 @@ { "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 lab if you have anyone willing to go.", + "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.", From 580c360131ebfdd6c673907142c1e8e4c75d97dd Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Mon, 2 May 2022 23:19:27 -0500 Subject: [PATCH 4/8] Fix sickly laborer anesthetic vars --- data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json b/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json index 2f85ccaa9b5f3..22443a933f949 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_sickly_laborer.json @@ -22,11 +22,11 @@ "and": [ { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, { - "not": { "u_has_var": "doctor_anesthetic_sickly_laborer_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "not": { "npc_has_var": "doctor_anesthetic_asked", "type": "mission", "context": "tacoma_ranch", "value": "yes" } } ] }, - "effect": [ { "u_add_var": "doctor_anesthetic_nurse_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_ILL_1_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_ILL_1_HIRE" }, From 2655ac9da90547585935bdfe4f239f49cc95ce8d Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Tue, 3 May 2022 07:52:08 -0500 Subject: [PATCH 5/8] Move some vars to npc --- .../npcs/tacoma_ranch/NPC_ranch_doctor.json | 18 +++++++++--------- .../npcs/tacoma_ranch/NPC_ranch_scrapper.json | 14 +++++++------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json index dc856ce1053d8..5e1bfe7a859ba 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json @@ -14,7 +14,7 @@ "type": "talk_topic", "id": "TALK_RANCH_DOCTOR", "dynamic_line": { - "u_has_var": "doctor_provides_aid", + "npc_has_var": "provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes", @@ -101,7 +101,7 @@ "id": "TALK_RANCH_DOCTOR_AID", "type": "talk_topic", "dynamic_line": { - "u_has_var": "doctor_provides_aid", + "npc_has_var": "provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes", @@ -120,7 +120,7 @@ "condition": { "and": [ { "npc_service": true }, - { "u_has_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + { "npc_has_var": "provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } }, @@ -131,7 +131,7 @@ "condition": { "and": [ { "npc_service": true }, - { "u_has_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + { "npc_has_var": "provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } }, @@ -149,7 +149,7 @@ "id": "TALK_RANCH_DOCTOR_BIONICS", "type": "talk_topic", "dynamic_line": { - "u_has_var": "doctor_provides_bionics", + "npc_has_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes", @@ -164,7 +164,7 @@ "condition": { "and": [ { "npc_service": true }, - { "u_has_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + { "npc_has_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } }, @@ -175,7 +175,7 @@ "condition": { "and": [ { "npc_service": true }, - { "u_has_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + { "npc_has_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } }, @@ -293,7 +293,7 @@ "success_lie": "What good does this do us?", "failure": "It was a lost cause anyways…" }, - "end": { "effect": [ { "u_add_var": "doctor_provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } + "end": { "effect": [ { "npc_add_var": "provides_aid", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } ] } }, { "id": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC", @@ -335,7 +335,7 @@ }, "end": { "update_mapgen": [ { "om_terrain": "ranch_camp_50", "set": [ { "point": "furniture", "id": "f_anesthetic", "x": 19, "y": 19 } ] } ], - "effect": { "u_add_var": "doctor_provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + "effect": { "npc_add_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } } } ] diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json index 778b27d1596f5..15cde1f46de79 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json @@ -37,7 +37,7 @@ "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } }, { - "u_has_var": "doctor_anesthetic_scrapper_needs_tools", + "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" @@ -52,7 +52,7 @@ { "u_sell_item": "hacksaw" }, { "npc_consume_item": "hacksaw" }, { - "u_add_var": "doctor_anesthetic_scrapper_needs_tools", + "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "no" @@ -92,7 +92,7 @@ "id": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR", "type": "talk_topic", "dynamic_line": { - "u_has_var": "doctor_anesthetic_scrapper_needs_tools", + "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes", @@ -103,20 +103,20 @@ { "text": "An angle grinder and a hacksaw? I'll see what I can do.", "topic": "TALK_RANCH_SCAVENGER_1", - "effect": { "u_add_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + "effect": { "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, "condition": { - "not": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "not": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } } }, { "text": "Not yet…", "topic": "TALK_RANCH_SCAVENGER_1", - "condition": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "condition": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } }, { "text": "I've got to go…", "topic": "TALK_DONE", - "condition": { "u_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "condition": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } } ] } From c025f08a62d1250cb75efcb33dd7a545cb72569f Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Tue, 3 May 2022 08:03:55 -0500 Subject: [PATCH 6/8] json style + consume anesthetic directly --- .../npcs/tacoma_ranch/NPC_ranch_doctor.json | 6 ++-- .../npcs/tacoma_ranch/NPC_ranch_scrapper.json | 28 ++++++++++++++++--- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json index 5e1bfe7a859ba..fce86d383aba0 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json @@ -55,7 +55,8 @@ }, "effect": [ { "u_message": "Thanks! This should help keep things organized for a while.", "type": "good", "popup": true }, - "mission_success", "clear_mission" + "mission_success", + "clear_mission" ] }, { @@ -87,8 +88,7 @@ ] }, "effect": [ - { "u_sell_item": "anesthetic", "count": 3000 }, - { "npc_consume_item": "anesthetic", "count": 3000 }, + { "u_consume_item": "anesthetic", "count": 3000 }, { "u_add_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] }, diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json index 15cde1f46de79..d59d04325f2de 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json @@ -103,20 +103,40 @@ { "text": "An angle grinder and a hacksaw? I'll see what I can do.", "topic": "TALK_RANCH_SCAVENGER_1", - "effect": { "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + "effect": { + "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + }, "condition": { - "not": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "not": { + "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } } }, { "text": "Not yet…", "topic": "TALK_RANCH_SCAVENGER_1", - "condition": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "condition": { + "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } }, { "text": "I've got to go…", "topic": "TALK_DONE", - "condition": { "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + "condition": { + "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", + "type": "mission", + "context": "tacoma_ranch", + "value": "yes" + } } ] } From 9bd56925085501aec073612ccdaf90aae1032399 Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Wed, 4 May 2022 22:33:27 -0500 Subject: [PATCH 7/8] Make scrapper subquest an actual mission --- .../npcs/tacoma_ranch/NPC_ranch_scrapper.json | 123 ++++++------------ 1 file changed, 39 insertions(+), 84 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json index d59d04325f2de..aa90bb5992633 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_scrapper.json @@ -21,50 +21,13 @@ "condition": { "and": [ { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, + { "not": { "u_has_mission": "MISSION_RANCH_SCRAPPER_TOOLS_FOR_SCRAP" } }, { "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } } ] } }, - { - "text": "Here's the tools you asked for.", - "topic": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR_TOOLS", - "condition": { - "and": [ - { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, - { - "not": { "u_has_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } - }, - { - "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes" - }, - { "u_has_item": "angle_grinder" }, - { "u_has_item": "hacksaw" } - ] - }, - "effect": [ - { "u_sell_item": "angle_grinder" }, - { "npc_consume_item": "angle_grinder" }, - { "u_sell_item": "hacksaw" }, - { "npc_consume_item": "hacksaw" }, - { - "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "no" - }, - { - "u_add_var": "doctor_anesthetic_scrappers_helped", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes" - } - ] - }, { "text": "What is your job here?", "topic": "TALK_RANCH_SCRAPPER_JOB" }, { "text": "Do you need any help?", "topic": "TALK_RANCH_SCRAPPER_HIRE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } @@ -82,62 +45,54 @@ "dynamic_line": "I don't personally, the teams we send out to recover the vehicles usually need a hand, but can be hard to catch since they spend most of their time outside the outpost.", "responses": [ { "text": "OK.", "topic": "TALK_RANCH_SCRAPPER" } ] }, - { - "type": "talk_topic", - "id": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR_TOOLS", - "dynamic_line": "Thanks, these will certainly help. I found the parts that you needed and can work with the doctor to build the equipment whenever they are ready.", - "responses": [ { "text": "Thanks.", "topic": "TALK_RANCH_SCRAPPER" } ] - }, { "id": "TALK_RANCH_SCRAPPER_ANESTHETIC_FOR_DOCTOR", "type": "talk_topic", - "dynamic_line": { - "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes", - "yes": "I'm still looking for the parts you need. Do you have the angle grinder and hacksaw that I asked for?", - "no": "Hmm, let me think. There might be a few things I could scrounge up to help, but it's going to take some time to sort through the scrap to find exactly what you need. How about this… some of my tools are getting a bit worn and are in need of replacement. If you could bring me a new angle grinder and a hacksaw, I should be able to find all the parts you need by the time you get back." - }, + "dynamic_line": "Hmm, let me think. There might be a few things I could scrounge up to help, but it's going to take some time to sort through the scrap to find exactly what you need. How about this… some of my tools are getting a bit worn and are in need of replacement. If you could bring me a new angle grinder and a hacksaw, I should be able to find all the parts you need by the time you get back.", "responses": [ { "text": "An angle grinder and a hacksaw? I'll see what I can do.", - "topic": "TALK_RANCH_SCAVENGER_1", - "effect": { - "npc_add_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes" - }, - "condition": { - "not": { - "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes" - } - } - }, - { - "text": "Not yet…", - "topic": "TALK_RANCH_SCAVENGER_1", - "condition": { - "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", - "type": "mission", - "context": "tacoma_ranch", - "value": "yes" - } - }, - { - "text": "I've got to go…", "topic": "TALK_DONE", - "condition": { - "npc_has_var": "doctor_anesthetic_scrapper_needs_tools", + "effect": [ { "add_mission": "MISSION_RANCH_SCRAPPER_TOOLS_FOR_SCRAP" } ] + }, + { "text": "Never mind.", "topic": "TALK_NONE" }, + { "text": "I've got to go…", "topic": "TALK_DONE" } + ] + }, + { + "id": "MISSION_RANCH_SCRAPPER_TOOLS_FOR_SCRAP", + "type": "mission_definition", + "name": { "str": "Tools for Scrap" }, + "description": "The scrapper is willing to part with some scrap to help build an anesthetic machine in exchange for an angle grinder and a hacksaw.", + "goal": "MGOAL_CONDITION", + "goal_condition": { "and": [ { "u_has_item": "angle_grinder" }, { "u_has_item": "hacksaw" } ] }, + "difficulty": 1, + "value": 0, + "origins": [ "ORIGIN_SECONDARY" ], + "followup": "MISSION_NULL", + "has_generic_rewards": false, + "dialogue": { + "describe": "…", + "offer": "…", + "accepted": "…", + "rejected": "…", + "advice": "…", + "inquire": "Have you found the tools yet?", + "success": "These will be very useful, thanks! I found the parts that you needed and can work with the doctor to build the equipment whenever they are ready.", + "success_lie": "…", + "failure": "…" + }, + "end": { + "effect": [ + { "u_consume_item": "angle_grinder" }, + { "u_consume_item": "hacksaw" }, + { + "u_add_var": "doctor_anesthetic_scrappers_helped", "type": "mission", "context": "tacoma_ranch", "value": "yes" } - } - ] + ] + } } ] From 6e73f97dfe58e62bf62f64ead06e96320f245a13 Mon Sep 17 00:00:00 2001 From: Ryan Breuer Date: Wed, 4 May 2022 22:37:24 -0500 Subject: [PATCH 8/8] Cleanup doctor quests --- .../npcs/tacoma_ranch/NPC_ranch_doctor.json | 102 ++++++++---------- 1 file changed, 45 insertions(+), 57 deletions(-) diff --git a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json index fce86d383aba0..1481809e16170 100644 --- a/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json +++ b/data/json/npcs/tacoma_ranch/NPC_ranch_doctor.json @@ -26,7 +26,7 @@ "text": "Is there anything else I can help with?", "topic": "TALK_MISSION_LIST", "condition": { - "and": [ { "u_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] + "and": [ { "npc_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] } }, { @@ -34,29 +34,13 @@ "topic": "TALK_RANCH_DOCTOR_SUPPLIES", "condition": { "and": [ - { "not": { "u_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } }, + { "not": { "npc_has_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } }, { "not": { "u_has_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" } } ] }, "effect": [ { "add_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" }, - { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } - ] - }, - { - "text": "I have the supplies you asked for.", - "topic": "TALK_RANCH_DOCTOR", - "condition": { - "and": [ - { "u_has_items": { "item": "book_binder", "count": 10 } }, - { "u_has_items": { "item": "paper", "count": 500 } }, - { "u_has_mission": "MISSION_RANCH_DOCTOR_SUPPLIES" } - ] - }, - "effect": [ - { "u_message": "Thanks! This should help keep things organized for a while.", "type": "good", "popup": true }, - "mission_success", - "clear_mission" + { "npc_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } ] }, { @@ -75,23 +59,6 @@ "clear_mission" ] }, - { - "text": "I have the anesthetic you asked for.", - "topic": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC_DELIVERED", - "condition": { - "and": [ - { "u_has_mission": "MISSION_RANCH_DOCTOR_MEDICAL_ANESTHETIC" }, - { - "not": { "u_has_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" } - }, - { "u_has_items": { "item": "anesthetic", "count": 3000 } } - ] - }, - "effect": [ - { "u_consume_item": "anesthetic", "count": 3000 }, - { "u_add_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" } - ] - }, { "text": "Could you help me with some bionics?", "topic": "TALK_RANCH_DOCTOR_BIONICS" }, { "text": "I could use your medical assistance.", "topic": "TALK_RANCH_DOCTOR_AID" }, { "text": "…", "topic": "TALK_DONE" } @@ -190,8 +157,8 @@ "responses": [ { "text": "I'll see what I can find.", - "topic": "TALK_RANCH_DOCTOR", - "effect": [ { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } ] + "topic": "TALK_DONE", + "effect": [ { "npc_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "no" } ] }, { "text": "Never mind.", "topic": "TALK_NONE" }, { "text": "I've got to go…", "topic": "TALK_DONE" } @@ -209,21 +176,24 @@ "name": { "str": "Collect Office Supplies" }, "description": "The doctor needs office supplies to keep track of medical records. Bring them 10 Book binders and 500 paper", "goal": "MGOAL_CONDITION", - "goal_condition": { "npc_has_var": "-", "type": "-", "context": "-", "value": "-" }, + "goal_condition": { + "and": [ { "u_has_items": { "item": "book_binder", "count": 10 } }, { "u_has_items": { "item": "paper", "count": 500 } } ] + }, "difficulty": 1, - "value": 50000, + "value": 0, "origins": [ "ORIGIN_SECONDARY" ], "followup": "MISSION_RANCH_DOCTOR_CRUTCHES", + "has_generic_rewards": false, "dialogue": { - "describe": "-", - "offer": "-", - "accepted": "-", - "rejected": "-", - "advice": "-", - "inquire": "-", - "success": "-", - "success_lie": "-", - "failure": "-" + "describe": "…", + "offer": "…", + "accepted": "…", + "rejected": "…", + "advice": "…", + "inquire": "Have you found the supplies yet?", + "success": "Thanks! This should help keep things organized for a while.", + "success_lie": "…", + "failure": "…" }, "end": { "update_mapgen": [ @@ -234,15 +204,29 @@ { "square": "furniture", "id": "f_filing_cabinet", "x": 5, "y": 2, "x2": 8, "y2": 2 } ], "place_items": [ - { "item": "ranch_doctor_filing_cabinets", "x": [ 5, 8 ], "chance": 100, "y": 0, "repeat": 5 }, - { "item": "ranch_doctor_filing_cabinets", "x": [ 5, 8 ], "chance": 100, "y": 2, "repeat": 5 } + { + "item": "ranch_doctor_filing_cabinets", + "x": [ 5, 8 ], + "chance": 100, + "y": 0, + "repeat": 5, + "faction": "tacoma_commune" + }, + { + "item": "ranch_doctor_filing_cabinets", + "x": [ 5, 8 ], + "chance": 100, + "y": 2, + "repeat": 5, + "faction": "tacoma_commune" + } ] } ], "effect": [ { "u_consume_item": "paper", "count": 500 }, { "u_consume_item": "book_binder", "count": 10 }, - { "u_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } + { "npc_add_var": "doctor_completed_supplies", "type": "mission", "context": "tacoma_ranch", "value": "yes" } ] } }, @@ -253,7 +237,7 @@ "description": "Bring the doctor some crutches.", "goal": "MGOAL_FIND_ITEM", "difficulty": 5, - "value": 50000, + "value": 2500, "item": "crutches", "count": 1, "origins": [ "ORIGIN_SECONDARY" ], @@ -277,7 +261,7 @@ "description": "Bring the doctor 5 pairs of medical gloves.", "goal": "MGOAL_FIND_ITEM", "difficulty": 5, - "value": 50000, + "value": 3500, "item": "gloves_medical", "count": 5, "origins": [ "ORIGIN_SECONDARY" ], @@ -303,7 +287,7 @@ "goal": "MGOAL_CONDITION", "goal_condition": { "and": [ - { "u_has_var": "doctor_anesthetic_delivered", "type": "mission", "context": "tacoma_ranch", "value": "yes" }, + { "u_has_items": { "item": "anesthetic", "count": 3000 } }, { "u_has_var": "doctor_anesthetic_scavengers_helped", "type": "mission", @@ -319,9 +303,10 @@ ] }, "difficulty": 5, - "value": 50000, + "value": 0, "origins": [ "ORIGIN_SECONDARY" ], "followup": "MISSION_NULL", + "has_generic_rewards": false, "dialogue": { "describe": "We need help…", "offer": "I want to make sure we are setup to handle any major surgeries that come our way, but pain management is going to be an issue. For longer surgeries, we're going to need some anesthetic. Can you bring me 3000 units to start? We're also going to need an anesthetic machine to deliver it. Maybe some people around the commune can help with that?", @@ -335,7 +320,10 @@ }, "end": { "update_mapgen": [ { "om_terrain": "ranch_camp_50", "set": [ { "point": "furniture", "id": "f_anesthetic", "x": 19, "y": 19 } ] } ], - "effect": { "npc_add_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + "effect": [ + { "u_consume_item": "anesthetic", "count": 3000 }, + { "npc_add_var": "provides_bionics", "type": "dialogue", "context": "tacoma_ranch", "value": "yes" } + ] } } ]