Skip to content

Commit

Permalink
Merge pull request #27901 from mlangsdorf/npctalk_ally_to_json
Browse files Browse the repository at this point in the history
npctalk: move almost all dialogue into JSON
  • Loading branch information
ZhilkinSerg authored Jan 28, 2019
2 parents e02117f + 6a0277e commit 77d5cf2
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 225 deletions.
143 changes: 137 additions & 6 deletions data/json/npcs/TALK_COMMON_MISSION.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
{ "text": "I don't care.", "topic": "TALK_MISSION_REJECTED" }
]
},
{
"id": "TALK_DESCRIBE_MISSION",
"type": "talk_topic",
"category": "CATEGORY_MISSION",
"responses": [ { "text": "I see.", "topic": "TALK_NONE" }, { "text": "Bye.", "topic": "TALK_DONE" } ]
},
{
"id": "TALK_MISSION_LIST",
"type": "talk_topic",
Expand Down Expand Up @@ -118,6 +112,143 @@
"category": "CATEGORY_MISSION",
"responses": [ { "text": "I'm sorry.", "topic": "TALK_NONE" }, { "text": "Whatever. Bye.", "topic": "TALK_DONE" } ]
},
{
"id": "TALK_MISSION_INQUIRE",
"type": "talk_topic",
"category": "CATEGORY_MISSION",
"responses": [
{
"text": "I'm sorry... I failed.",
"condition": "mission_failed",
"topic": "TALK_MISSION_FAILURE",
"opinion": { "trust": -1, "value": -1, "anger": 1 }
},
{
"text": "Not yet.",
"condition": "mission_failed",
"trial": { "type": "LIE", "difficulty": 10, "mod": [ [ "TRUST", 3 ] ] },
"success": { "topic": "TALK_NONE" },
"failure": { "topic": "TALK_MISSION_FAILURE" }
},
{ "text": "Not yet.", "condition": "mission_incomplete", "topic": "TALK_NONE" },
{
"truefalsetext": { "true": "I killed him.", "false": "I killed it.", "condition": { "mission_goal": "ASSASSINATE" } },
"condition": {
"and": [
"mission_incomplete",
{
"or": [
{ "mission_goal": "ASSASSINATE" },
{ "mission_goal": "KILL_MONSTER" },
{ "mission_goal": "KILL_MONSTER_SPEC" },
{ "mission_goal": "KILL_MONSTER_TYPE" }
]
}
]
},
"trial": { "type": "LIE", "difficulty": 10, "mod": [ [ "TRUST", 3 ] ] },
"success": { "topic": "TALK_NONE" },
"failure": { "topic": "TALK_MISSION_FAILURE" }
},
{ "text": "No. I'll get back to it, bye!", "condition": "mission_incomplete", "topic": "TALK_NONE" },
{
"text": "Yup! Here it is!",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ { "or": [ { "mission_goal": "FIND_ITEM" }, { "mission_goal": "FIND_ANY_ITEM" } ] }, "mission_complete" ] },
"switch": true
},
{
"text": "We're here!",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "GO_TO_TYPE" } ] },
"switch": true
},
{
"text": "Here I am.",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ { "or": [ { "mission_goal": "GO_TO" }, { "mission_goal": "FIND_NPC" } ] }, "mission_complete" ] },
"switch": true
},
{
"text": "Here it is!",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "FIND_MONSTER" } ] },
"switch": true
},
{
"text": "Justice has been served.",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "ASSASSINATE" } ] },
"switch": true
},
{
"text": "I killed it.",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "KILL_MONSTER" } ] },
"switch": true
},
{
"text": "I killed them. All of them.",
"topic": "TALK_MISSION_SUCCESS",
"condition": {
"and": [ { "or": [ { "mission_goal": "KILL_MONSTER_SPEC" }, { "mission_goal": "KILL_MONSTER_TYPE" } ] }, "mission_complete" ]
},
"switch": true
},
{
"text": "I brought 'em.",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "RECRUIT_NPC" }, { "mission_goal": "RECRUIT_NPC_CLASS" } ] },
"switch": true
},
{
"text": "I've taken care of it",
"topic": "TALK_MISSION_SUCCESS",
"condition": { "and": [ "mission_complete", { "mission_goal": "COMPUTER_TOGGLE" } ] },
"switch": true
},
{
"text": "Mission success! I don't know what else to say.",
"topic": "TALK_MISSION_SUCCESS",
"condition": "mission_complete",
"switch": true,
"default": true
}
]
},
{
"id": "TALK_MISSION_SUCCESS",
"type": "talk_topic",
"category": "CATEGORY_MISSION",
"responses": [
{
"text": "Glad to help. I need no payment.",
"topic": "TALK_NONE",
"effect": "clear_mission",
"mission_opinion": { "trust": 4, "value": 3 },
"opinion": { "fear": -1, "anger": -1 }
},
{
"text": "How about some items as payment?",
"topic": "TALK_MISSION_REWARD",
"condition": { "not": "npc_friend" },
"effect": "mission_reward"
},
{
"text": "Maybe you can teach me something as payment?",
"topic": "TALK_TRAIN",
"condition": { "or": [ "npc_train_skills", "npc_train_styles" ] },
"effect": "mission_reward"
},
{
"text": "Glad to help. I need no payment. Bye!",
"topic": "TALK_DONE",
"effect": "clear_mission",
"mission_opinion": { "trust": 4, "value": 3 },
"opinion": { "fear": -1, "anger": -1 }
}
]
},
{
"id": "TALK_MISSION_SUCCESS_LIE",
"type": "talk_topic",
Expand Down
181 changes: 148 additions & 33 deletions data/json/npcs/TALK_COMMON_OTHER.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"category": "CATEGORY_FOLLOW",
"dynamic_line": {
"npc_has_effect": "infected",
"yes": "Not until I get some antibiotics...",
"no": {
"npc_has_effect": "asked_to_follow",
"yes": "You asked me recently; ask again later.",
"no": "Why should I travel with you?"
}
"no": "Why should I travel with you?",
"yes": "You asked me recently; ask again later."
},
"yes": "Not until I get some antibiotics..."
},
"responses": [
{
Expand Down Expand Up @@ -150,6 +150,71 @@
"type": "talk_topic",
"responses": [ { "text": "Okay, okay.", "topic": "TALK_NONE" } ]
},
{
"id": "TALK_DESCRIBE_MISSION",
"type": "talk_topic",
"category": "CATEGORY_MISSION",
"responses": [ { "text": "I see.", "topic": "TALK_NONE" }, { "text": "Bye.", "topic": "TALK_DONE" } ]
},
{
"id": "TALK_TRAIN_START",
"type": "talk_topic",
"dynamic_line": "Alright, let's begin.",
"responses": [
{
"text": "Sounds good.",
"topic": "TALK_DONE",
"condition": "at_safe_space",
"effect": "start_training",
"switch": true
},
{
"text": "Okay. Lead the way.",
"topic": "TALK_DONE",
"switch": true,
"default": true,
"effect": "lead_to_safety"
},
{ "text": "No, we'll be okay here.", "topic": "TALK_TRAIN_FORCE", "switch": true, "default": true },
{ "text": "On second thought, never mind.", "topic": "TALK_NONE" }
]
},
{
"id": "TALK_DENY_TRAIN",
"type": "talk_topic",
"dynamic_line": {
"u_driving": "I can't train you properly while you're operating a vehicle!",
"npc_driving": "I can't train you properly while I'm operating a vehicle!",
"npc_need": "thirst",
"amount": 80,
"no": {
"npc_need": "hunger",
"amount": 160,
"no": {
"npc_need": "fatigue",
"level": "TIRED",
"no": {
"npc_has_effect": "asked_to_train",
"no": "I have some reason for denying you training.",
"yes": "Give it some time, I'll show you something new later..."
},
"yes": "I'm too tired, let me rest first."
},
"yes": "I'm too hungry, give me something to eat."
},
"yes": "I'm too thirsty, give me something to drink."
},
"responses": [ { "text": "Ah, okay.", "topic": "TALK_NONE" } ]
},
{
"id": "TALK_TRAIN_FORCE",
"type": "talk_topic",
"dynamic_line": "Alright, let's begin.",
"responses": [
{ "text": "Sounds good.", "topic": "TALK_DONE", "effect": "start_training" },
{ "text": "On second thought, never mind.", "topic": "TALK_NONE" }
]
},
{
"id": "TALK_DENY_GUARD",
"type": "talk_topic",
Expand Down Expand Up @@ -177,6 +242,82 @@
"dynamic_line": "I'd prefer to keep that to myself.",
"responses": [ { "text": "I understand...", "topic": "TALK_FRIEND" } ]
},
{
"id": "TALK_SHARE_EQUIPMENT",
"type": "talk_topic",
"category": "CATEGORY_EQUIP",
"dynamic_line": {
"npc_has_effect": "infected",
"yes": "You just asked me for stuff; ask later.",
"no": "Why should I share my equipment with you?"
},
"responses": [
{ "text": "Okay, fine.", "topic": "TALK_NONE", "switch": true, "condition": { "npc_has_effect": "asked_for_item" } },
{
"text": "Because I'm holding a thermal detonator!",
"topic": "TALK_GIVE_EQUIPMENT",
"switch": true,
"default": true,
"condition": { "u_has_item": "mininuke" },
"effect": [ { "add_debt": [ [ "TRUST", 1 ], [ "VALUE", 3 ], [ "ALTRUISM", 2 ], [ "TOTAL", 300 ] ] }, "give_equipment" ],
"opinion": { "value": -1 }
},
{
"text": "Because I'm you're friend!",
"switch": true,
"default": true,
"trial": { "type": "PERSUADE", "difficulty": 10, "mod": [ [ "TRUST", 1 ], [ "VALUE", 3 ], [ "ALTRUISM", 2 ] ] },
"success": {
"topic": "TALK_GIVE_EQUIPMENT",
"effect": [ { "add_debt": [ [ "TRUST", 1 ], [ "VALUE", 3 ], [ "ALTRUISM", 2 ], [ "TOTAL", 300 ] ] }, "give_equipment" ],
"opinion": { "value": -1 }
},
"failure": { "topic": "TALK_DENY_EQUIPMENT", "opinion": { "value": -1 } }
},
{
"text": "Well, I am helping you out...",
"switch": true,
"default": true,
"condition": { "or": [ "has_assigned_mission", "has_many_assigned_missions" ] },
"trial": {
"type": "PERSUADE",
"difficulty": 12,
"mod": [ [ "TRUST", 1 ], [ "VALUE", 2 ], [ "ALTRUISM", 1 ], [ "MISSIONS", 1 ] ]
},
"success": { "topic": "TALK_GIVE_EQUIPMENT", "effect": "give_equipment" },
"failure": { "topic": "TALK_DENY_EQUIPMENT", "opinion": { "value": -1 } }
},
{
"text": "I'll give it back!",
"switch": true,
"default": true,
"trial": { "type": "LIE", "difficulty": 10, "mod": [ [ "TRUST", 2 ], [ "VALUE", 5 ], [ "ALTRUISM", 3 ] ] },
"success": {
"topic": "TALK_GIVE_EQUIPMENT",
"effect": [ { "add_debt": [ [ "TRUST", 1 ], [ "VALUE", 3 ], [ "ALTRUISM", 2 ], [ "TOTAL", 300 ] ] }, "give_equipment" ],
"opinion": { "value": -1 }
},
"failure": { "topic": "TALK_DENY_EQUIPMENT", "opinion": { "trust": -1, "value": -1 } }
},
{
"text": "Give it to me, or else!",
"switch": true,
"default": true,
"trial": { "type": "INTIMIDATE", "difficulty": 40 },
"success": {
"topic": "TALK_GIVE_EQUIPMENT",
"effect": [
{ "add_debt": [ [ "U_INTIMIDATE", 1 ], [ "NPC_INTIMIDATE", -1 ], [ "FEAR", 1 ], [ "BRAVERY", -1 ], [ "TOTAL", 500 ] ] },
"give_equipment"
],
"opinion": { "trust": -3, "fear": 2, "value": -2, "anger": 2 }
},
"failure": { "topic": "TALK_DENY_EQUIPMENT", "opinion": { "trust": -3, "fear": 1, "value": -3, "anger": 5 } }
},
{ "text": "Eh, never mind.", "topic": "TALK_NONE" },
{ "text": "Never mind, I'll do without. Bye.", "topic": "TALK_DONE" }
]
},
{
"id": "TALK_GIVE_EQUIPMENT",
"type": "talk_topic",
Expand All @@ -192,42 +333,16 @@
"id": "TALK_DENY_EQUIPMENT",
"type": "talk_topic",
"category": "CATEGORY_EQUIP",
"dynamic_line": [ "<no>, and if you ask again, <ill_kill_you>!", "<no><punc> <fuck_you>!" ],
"responses": [
{ "text": "Okay, okay, sorry.", "topic": "TALK_NONE" },
{ "text": "Seriously, give me more stuff!", "topic": "TALK_SHARE_EQUIPMENT" },
{ "text": "Okay, fine, bye.", "topic": "TALK_DONE" }
]
},
{
"id": "TALK_TRAIN_START",
"id": [ "TALK_SIZE_UP", "TALK_LOOK_AT", "TALK_OPINION", "TALK_SHOUT" ],
"type": "talk_topic",
"dynamic_line": "Alright, let's begin.",
"responses": [
{
"text": "Sounds good.",
"topic": "TALK_DONE",
"condition": "at_safe_space",
"effect": "start_training",
"switch": true
},
{
"text": "Okay. Lead the way.",
"topic": "TALK_DONE",
"switch": true,
"default": true,
"effect": "lead_to_safety"
},
{ "text": "No, we'll be okay here.", "topic": "TALK_TRAIN_FORCE", "switch": true, "default": true },
{ "text": "On second thought, never mind.", "topic": "TALK_NONE" }
]
},
{
"id": "TALK_TRAIN_FORCE",
"type": "talk_topic",
"dynamic_line": "Alright, let's begin.",
"responses": [
{ "text": "Sounds good.", "topic": "TALK_DONE", "effect": "start_training" },
{ "text": "On second thought, never mind.", "topic": "TALK_NONE" }
]
"responses": [ { "text": "Okay", "topic": "TALK_NONE" } ]
}
]
Loading

0 comments on commit 77d5cf2

Please sign in to comment.