-
This is for anyone willing to write events. There are plenty of examples at the bottom, but here's the general anatomy of a dialogue event:
-
-
case 3: // this is the dialog id, it is determined at the start of the visit
-
switch (currentDialogStage) // this chooses which stage of the dialog the player is in, it is incremented every time the player gives input
-
{
-
case 0: // this is the first stage that appears when the player visits a character
-
-
// you can send messages like this, format: uiHandler.SendDialogMessage(text, color);
-
uiHandler.SendDialogMessage($"You enter {conversationPartner.GetName()}'s house through the front door.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Hello. What brings you here today?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
-
// you can give a two-choice branching option like this
-
uiHandler.SetDialogChoice("Discuss", "Train");
-
// if there is no branching option, the event ends here with no further player input
-
// otherwise, the player chooses an option which moves to the next dialog stage
-
break;
-
case 1:
-
// if you gave the player a branching option, the dialogue will now continue down one of these paths
-
if (leftChoice) // discuss
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I wanted to talk about something. Did you know, that...", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine(); // this displays a row of dashes to signify passage of time
-
-
// give characters skill XP during/after event
-
// all the numbers are pretty arbitrary, you don't need to worry about this if you don't care
-
switch (Random.Range(0, 2)) // this rolls a random number and picks which stat to give XP in
-
{
-
case 0:
-
XpGain(playerCharacter, "FRI", conversationPartner.GetFri() / 3);
-
XpGain(conversationPartner, "FRI", playerCharacter.GetFri() / 3);
-
break;
-
case 1:
-
default:
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 3);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 3);
-
break;
-
}
-
-
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "How time flies when you're having fun! We should stop for today.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
-
}else if (rightChoice) // train
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I want to test your strength. How about we spar for a round?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "POW", conversationPartner.GetPow() / 3);
-
XpGain(conversationPartner, "POW", playerCharacter.GetPow() / 3);
-
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Impressive! You really know how to handle yourself.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "You're not too bad yourself.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
}
-
-
// after the event, progress friendship
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
-
If you want to involve a third character, skill checks, or write an event for a specific character, see the events at the bottom for examples.
-
Here is the entire DialogHandler file, but the part you care about is at the very bottom, see ProgressDialogue(). In the forest of switch statements, there is an empty case where you can start.
-
------
-
using System.Collections;
-
using System.Collections.Generic;
-
using UnityEngine;
-
-
public class DialogHandler : MonoBehaviour
-
{
-
private List<int> officersWithCustomDialog = new List<int>();
-
public OfficerHandler officerHandler;
-
public PlayerHandler playerHandler;
-
public UiHandler uiHandler;
-
public GameHandler gameHandler;
-
private Officer conversationPartner;
-
private Officer playerCharacter;
-
private Officer friend;
-
private int currentDialogId = -1;
-
private int currentDialogStage = -1;
-
private bool leftChoice = true;
-
private bool rightChoice = true;
-
private List<int> genericDialogues = new List<int>();
-
private List<int> commonFriendDialogues = new List<int>();
-
private List<int> uncommonFriendDialogues = new List<int>();
-
private List<int> traitDialogues = new List<int>();
-
private List<int> magDialogues = new List<int>();
-
private List<int> powDialogues = new List<int>();
-
private List<int> friDialogues = new List<int>();
-
-
void Start()
-
{
-
// dialog id
-
genericDialogues.Add(3);
-
genericDialogues.Add(6);
-
-
commonFriendDialogues.Add(4);
-
-
uncommonFriendDialogues.Add(5);
-
uncommonFriendDialogues.Add(7);
-
-
magDialogues.Add(0);
-
magDialogues.Add(9);
-
-
powDialogues.Add(1);
-
powDialogues.Add(8);
-
-
friDialogues.Add(2);
-
-
// officer id
-
officersWithCustomDialog.Add(3);
-
}
-
public void StartDialogue(int officerId, List<string> officerTraits, List<string> officerFriends)
-
{
-
currentDialogStage = 0;
-
if (HasCustomDialogue(officerId) && Random.Range(0, 2) == 1)
-
{
-
-
// custom dialogue path
-
CustomDialogue(officerId);
-
return;
-
}
-
-
bool dialogPathFound = false;
-
while (!dialogPathFound) // randomly pick a dialog path
-
{
-
switch (Random.Range(0, 3))
-
{
-
case 0: // trait based path
-
if (officerTraits.Count != 0)
-
{
-
//dialogPathFound = true;
-
//TraitBasedDialogue(officerId, officerTraits);
-
}
-
break;
-
case 1: // friend based path
-
if (officerFriends.Count != 0)
-
{
-
dialogPathFound = true;
-
FriendBasedDialogue(officerId, officerFriends);
-
}
-
break;
-
case 2: // generic path
-
dialogPathFound = true;
-
GenericDialogue(officerId);
-
break;
-
default:
-
break;
-
}
-
}
-
-
-
}
-
-
bool HasCustomDialogue(int officerId)
-
{
-
return officersWithCustomDialog.Contains(officerId);
-
}
-
-
void TraitBasedDialogue(int officerId, List<string> officerTraits)
-
{
-
conversationPartner = officerHandler.GetOfficerById(officerId);
-
playerCharacter = gameHandler.GetCurrentPlayer().GetFactionLeader();
-
-
switch (officerTraits[Random.Range(0, officerTraits.Count)])
-
{
-
default:
-
// no fitting traits, generic dialog
-
currentDialogId = genericDialogues[Random.Range(0, genericDialogues.Count)];
-
break;
-
}
-
-
ProgressDialogue();
-
}
-
-
void FriendBasedDialogue(int officerId, List<string> officerFriends)
-
{
-
conversationPartner = officerHandler.GetOfficerById(officerId);
-
playerCharacter = gameHandler.GetCurrentPlayer().GetFactionLeader();
-
friend = officerHandler.GetOfficerByName(officerFriends[Random.Range(0, officerFriends.Count)]);
-
-
if (friend == playerCharacter)
-
{
-
// generic path
-
currentDialogId = genericDialogues[Random.Range(0, genericDialogues.Count)];
-
}
-
else if (playerCharacter.friends.Contains(friend.GetName()))
-
{
-
// common friend path
-
currentDialogId = commonFriendDialogues[Random.Range(0, commonFriendDialogues.Count)];
-
}
-
else
-
{
-
// uncommon friend path
-
currentDialogId = uncommonFriendDialogues[Random.Range(0, uncommonFriendDialogues.Count)];
-
}
-
-
ProgressDialogue();
-
}
-
-
void GenericDialogue(int officerId)
-
{
-
conversationPartner = officerHandler.GetOfficerById(officerId);
-
playerCharacter = gameHandler.GetCurrentPlayer().GetFactionLeader();
-
// skill based
-
-
switch (Random.Range(0, 2))
-
{
-
case 0: // skill based
-
switch (conversationPartner.GetHighestStatType())
-
{
-
case "MAG":
-
currentDialogId = magDialogues[Random.Range(0, magDialogues.Count)];
-
break;
-
case "POW":
-
currentDialogId = powDialogues[Random.Range(0, powDialogues.Count)];
-
break;
-
case "FRI":
-
currentDialogId = friDialogues[Random.Range(0, friDialogues.Count)];
-
break;
-
}
-
-
break;
-
case 1:
-
default: // generic
-
currentDialogId = genericDialogues[Random.Range(0, genericDialogues.Count)];
-
break;
-
}
-
-
currentDialogStage = 0;
-
ProgressDialogue();
-
-
}
-
-
void CustomDialogue(int officerId)
-
{
-
conversationPartner = officerHandler.GetOfficerById(officerId);
-
playerCharacter = gameHandler.GetCurrentPlayer().GetFactionLeader();
-
-
switch (officerId)
-
{
-
case 3: // trixie
-
currentDialogId = 10;
-
break;
-
default:
-
// generic
-
currentDialogId = genericDialogues[Random.Range(0, genericDialogues.Count)];
-
break;
-
}
-
ProgressDialogue();
-
}
-
-
public void DialogButtonPressed(string button)
-
{
-
switch (button)
-
{
-
case "left":
-
leftChoice = true;
-
rightChoice = false;
-
break;
-
case "right":
-
leftChoice = false;
-
rightChoice = true;
-
break;
-
}
-
}
-
-
void XpGain(Officer targetOfficer, string stat, int amount)
-
{
-
targetOfficer.AddXp(stat, amount);
-
uiHandler.SendDialogMessage($"{targetOfficer.GetName()} gained {(int)(amount)} {stat} XP!", playerHandler.GetPlayerColor(targetOfficer.GetPlayerId()));
-
}
-
-
void FriendshipGain(Officer officer1, Officer officer2, int amount)
-
{
-
officer1.ProgressFriendship(officer2, amount);
-
officer2.ProgressFriendship(officer1, amount);
-
uiHandler.SendDialogMessage($"Friendship deepened between {officer1.GetName()} and {officer2.GetName()}!", playerHandler.GetPlayerColor(officer1.GetPlayerId()));
-
}
-
-
void EmptyLine()
-
{
-
uiHandler.SendDialogMessage("--------------------------------------------------", Color.white);
-
}
-
-
public void ProgressDialogue()
-
{
-
switch (currentDialogId)
-
{
-
case 0: // mag based generic 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You run into {conversationPartner.GetName()} organizing their library.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Ah, apologies, I didn't notice you there. What brought you here?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("Literature", "Strategy");
-
break;
-
case 1:
-
if (leftChoice) // literature
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I wanted to discuss literature with you. Have you read...", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 3);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 3);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "That was an enlightening discussion. I learned a lot from you.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else if (rightChoice) // strategy
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I wanted to discuss an aspect of military strategy with you. You see, when two armies meet...", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "POW", conversationPartner.GetPow() / 4);
-
XpGain(conversationPartner, "POW", playerCharacter.GetPow() / 4);
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 5);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 5);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "I hadn't considered that. I'll have to keep that in mind in the future.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
case 1: // pow based generic 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You meet {conversationPartner.GetName()} in their armory.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "I've been developing new fighting methods. ", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "How about a duel to hone our skills? Or would you rather discuss strategy over a cup of tea?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("Practice", "Theory");
-
break;
-
case 1:
-
if (leftChoice) // practice
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "Practice sounds great. Let's get to work.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "POW", conversationPartner.GetPow() / 3);
-
XpGain(conversationPartner, "POW", playerCharacter.GetPow() / 3);
-
}
-
-
else if (rightChoice) // theory
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "Let's discuss battle tactics.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "POW", conversationPartner.GetPow() / 4);
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 5);
-
XpGain(conversationPartner, "POW", playerCharacter.GetPow() / 4);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 5);
-
}
-
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "That was great! We should do this again some other time.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
case 2: // fri based generic 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You meet {conversationPartner.GetName()} in front of their house.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Hey! I was thinking we could go to the park. ", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("Park", "Library");
-
break;
-
case 1:
-
if (leftChoice) // park
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "Sure, let's go for a walk.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "FRI", conversationPartner.GetFri() / 3);
-
XpGain(conversationPartner, "FRI", playerCharacter.GetFri() / 3);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "That was great! We should do this again some other time.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
-
else if (rightChoice) // library
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "Why don't we go to the library instead?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "FRI", conversationPartner.GetFri() / 4);
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 5);
-
XpGain(conversationPartner, "FRI", playerCharacter.GetFri() / 4);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 5);
-
}
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "That was fun! I found so many interesting books.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
case 3: // generic 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You enter {conversationPartner.GetName()}'s house through the front door.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Hello. What brings you here today?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("Discuss", "Train");
-
break;
-
case 1:
-
if (leftChoice) // discuss
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I wanted to talk about something. Did you know, that...", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
-
switch (Random.Range(0, 2))
-
{
-
case 0:
-
XpGain(playerCharacter, "FRI", conversationPartner.GetFri() / 3);
-
XpGain(conversationPartner, "FRI", playerCharacter.GetFri() / 3);
-
break;
-
case 1:
-
default:
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 3);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 3);
-
break;
-
}
-
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "How time flies when you're having fun! We should stop for today.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
-
}
-
-
else if (rightChoice) // train
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I want to test your strength. How about we spar for a round?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "POW", conversationPartner.GetPow() / 3);
-
XpGain(conversationPartner, "POW", playerCharacter.GetPow() / 3);
-
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Impressive! You really know how to handle yourself.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "You're not too bad yourself.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
}
-
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
-
if (conversationPartner.factionId == 999) // chance to hire neutral officer after event
-
{
-
switch (Random.Range(0, 3))
-
{
-
case 1:
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "You are pretty talented. I wish to help you.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Will you let me join your forces?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("Hire", "Refuse");
-
break;
-
default:
-
break;
-
}
-
}
-
-
// dialogue ends here if neutral roll was missed
-
break;
-
case 2: // this path only appears if it was rolled earlier
-
if (leftChoice) // hire
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I could use someone of your talent.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "Excellent! I shall serve you with utmost loyalty.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
gameHandler.GetCurrentPlayer().AddOfficer(conversationPartner);
-
uiHandler.OfficerInteractMenu(conversationPartner); // refresh
-
}
-
else if (rightChoice) // refuse
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I have no use for your talents right now.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + "That's a shame. I will be here if you change your mind.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
break;
-
}
-
break;
-
case 4: // common friend 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You meet with {conversationPartner.GetName()} in their garden. {friend.GetName()} is there!", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Hey! We're having an intense discussion with {friend.GetName()}. You see, {friend.GetName()} thinks...", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice($"{conversationPartner.GetName()} is right", $"{friend.GetName()} is right");
-
break;
-
case 1:
-
if (leftChoice) // visitee
-
{
-
EmptyLine();
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I agree with {conversationPartner.GetName()}.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I knew you would! What do you say now, {friend.GetName()}?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"No, it doesn't make any sense! You're wrong!", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"Maybe we should change the subject...", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
EmptyLine();
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
FriendshipGain(playerCharacter, friend, 10);
-
FriendshipGain(conversationPartner, friend, 10);
-
}
-
else if (rightChoice) // friend
-
{
-
EmptyLine();
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"{friend.GetName()} is right!", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"See, even {playerCharacter.GetName()} agrees with me!", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I'm still not entirely convinced... ", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I'll have to think about this. Thanks for your input, {playerCharacter.GetName()}.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
FriendshipGain(playerCharacter, friend, 20);
-
FriendshipGain(playerCharacter, conversationPartner, 10);
-
FriendshipGain(conversationPartner, friend, 10);
-
}
-
break;
-
}
-
break;
-
case 5: // uncommon friend 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You meet with {conversationPartner.GetName()} in their garden.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Have you met my friend, {friend.GetName()}?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
switch (friend.GetHighestStatType())
-
{
-
case "MAG":
-
if (friend.GetMag() > 75)
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is talented in the magical arts.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is adept in the magical arts.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
break;
-
case "FRI":
-
if (friend.GetFri() > 75)
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is always there when I need help.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} helped me out with some chores the other day.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
break;
-
case "POW":
-
if (friend.GetPow() > 75)
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} beat me in a duel a few weeks ago.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} can hold their own in a duel.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
break;
-
}
-
uiHandler.SetDialogChoice("Yes", "No");
-
break;
-
case 1:
-
EmptyLine();
-
if (leftChoice) // Yes
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I've met {friend.GetName()}, but we're not very close.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"That's a shame! Maybe we should go do something together.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else if (rightChoice) // No
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + "I have not. Maybe you could introduce us to each other?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I'll see what I can do!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
EmptyLine();
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
FriendshipGain(friend, conversationPartner, 10);
-
FriendshipGain(playerCharacter, friend, 10);
-
-
break;
-
}
-
break;
-
case 6: // generic, away from home
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You knock on {conversationPartner.GetName()}'s door, but there is no answer.", Color.white);
-
uiHandler.SendDialogMessage($"It looks like they are not home.", Color.white);
-
break;
-
}
-
break;
-
case 7: // in the market with uncommon friend
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You run into {conversationPartner.GetName()} at the local marketplace. They are together with {friend.GetName()}.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Oh, hello, {playerCharacter.GetName()}!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
-
switch (friend.GetHighestStatType())
-
{
-
case "MAG":
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is looking to buy a new magic wand, but we can't choose between these two. Maybe you could help us choose?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("The white one", "The purple one");
-
break;
-
case "FRI":
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is looking to get a new tea set, but we are spoiled for choice. Could you help us choose?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SetDialogChoice("The posh set", "The antique set");
-
break;
-
case "POW":
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"{friend.GetName()} is looking to get a new sword.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"How does this one look to you?", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SetDialogChoice("It's a great blade", "It looks shoddy");
-
break;
-
}
-
break;
-
case 1:
-
switch (friend.GetHighestStatType())
-
{
-
case "MAG":
-
if (leftChoice) // white wand
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"The white one looks very capable.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I agree! You should get the white one, {friend.GetName()}!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"Then it's settled! I'll get the white one.", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"I'm going to go try this wand out. Wanna tag along?", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
}
-
if (rightChoice) // purple wand
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"The purple one looks like it holds great power", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"You know, I was thinking the same thing. I'll get the purple one.", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"We should go test this new wand! You should come too, {playerCharacter.GetName()}!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
EmptyLine();
-
XpGain(friend, "MAG", friend.GetMag() / 4);
-
XpGain(playerCharacter, "MAG", playerCharacter.GetMag() / 4);
-
XpGain(conversationPartner, "MAG", conversationPartner.GetMag() / 4);
-
break;
-
case "FRI":
-
if (leftChoice) // posh set
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"The posh tea set looks most enticing to me", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"It does, doesn't it! Get the posh one, {friend.GetName()}!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"Well, I was on the fence, but you've convinced me. I will get the posh set!", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"We absolutely must test this new tea set in action!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
if (rightChoice) // antique set
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I like the antique set! It looks like it was made by a master craftsman.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I agree! It is a most beautiful tea set!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"Both of you agree, huh? I guess I should get the antiques then.", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"We absolutely must test this new tea set in action!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
EmptyLine();
-
XpGain(friend, "FRI", friend.GetFri() / 4);
-
XpGain(playerCharacter, "FRI", playerCharacter.GetFri() / 4);
-
XpGain(conversationPartner, "FRI", conversationPartner.GetFri() / 4);
-
-
break;
-
case "POW":
-
if (leftChoice) // great blade
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"It looks masterfully crafted. A great blade.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"It is great, isn't it? We should go see how it is in action!", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
}
-
if (rightChoice) // shoddy blade
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I'm not so sure about it. The steel looks fragile.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(friend.GetName() + ": " + $"You think so? Maybe we should keep looking, then.", playerHandler.GetPlayerColor(friend.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Good thing you showed up, or {friend.GetName()} would have bought a shoddy blade!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
EmptyLine();
-
XpGain(friend, "POW", playerCharacter.GetPow() / 3);
-
break;
-
}
-
-
FriendshipGain(playerCharacter, conversationPartner, 15);
-
FriendshipGain(friend, conversationPartner, 15);
-
FriendshipGain(playerCharacter, friend, 15);
-
break;
-
}
-
break;
-
case 8: // generic POW 2 fishing
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You visit {conversationPartner.GetName()}'s home, but they are not present.", Color.white);
-
uiHandler.SendDialogMessage($"A servant informs you that {conversationPartner.GetName()} has gone fishing.", Color.white);
-
uiHandler.SetDialogChoice("Go to the river", "Wait");
-
break;
-
case 1:
-
if (leftChoice) // go to the river
-
{
-
uiHandler.SendDialogMessage($"You set out for the river where {conversationPartner.GetName()} has gone fishing.", Color.white);
-
EmptyLine();
-
uiHandler.SendDialogMessage($"You spot {conversationPartner.GetName()} pulling fish after fish out of the water. It seems the river is bustling with fish today.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Hey, {playerCharacter.GetName()}! The river is overflowing with fish! Come, join me!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
uiHandler.SendDialogMessage($"You spend the rest of the day fishing with {conversationPartner.GetName()}. When all is said and done, you both return home with buckets full of fresh fish.", Color.white);
-
XpGain(playerCharacter, "POW", playerCharacter.GetPow() / 4);
-
XpGain(conversationPartner, "POW", conversationPartner.GetPow() / 4);
-
}
-
if (rightChoice) // wait
-
{
-
uiHandler.SendDialogMessage($"You wait for {conversationPartner.GetName()} to return from their fishing trip.", Color.white);
-
EmptyLine();
-
uiHandler.SendDialogMessage($"A few hours later, {conversationPartner.GetName()} returns with a bucket full of fresh fish.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Hey, {playerCharacter.GetName()}! The river was generous to me today!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Come help me sort out all this fish.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
XpGain(playerCharacter, "FRI", playerCharacter.GetFri() / 4);
-
XpGain(conversationPartner, "POW", conversationPartner.GetPow() / 4);
-
-
}
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
case 9: // generic mag 2 library
-
switch (currentDialogStage)
-
{
-
case 0:
-
uiHandler.SendDialogMessage($"You bump into {conversationPartner.GetName()} at the library.", Color.white);
-
uiHandler.SendDialogMessage($"They seem to be studying classical texts.", Color.white);
-
if (playerCharacter.GetMag() > conversationPartner.GetMag())
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Hey, {playerCharacter.GetName()}! I'm trying to understand this text, but it's all gibberish to me!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"You're better than me at this, could you help me out?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"That was enlightening! Thanks for your help, {playerCharacter.GetName()}!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"No problem! If you need any further help, don't be afraid to ask me!", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
XpGain(playerCharacter, "MAG", conversationPartner.GetMag() / 4);
-
XpGain(conversationPartner, "MAG", playerCharacter.GetMag() / 3);
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Hey, {playerCharacter.GetName()}! I'm trying to understand this text, but it's all gibberish to me!", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"It doesn't make any sense to me, either. Maybe we should look for some lighter reading material.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage($"You look for some reading material that is more intelligible to you.", Color.white);
-
EmptyLine();
-
XpGain(playerCharacter, "MAG", playerCharacter.GetMag() / 5);
-
XpGain(conversationPartner, "MAG", conversationPartner.GetMag() / 4);
-
FriendshipGain(playerCharacter, conversationPartner, 10);
-
}
-
break;
-
}
-
break;
-
case 10: // trixie 1
-
switch (currentDialogStage)
-
{
-
case 0:
-
if (playerCharacter.GetName() != "Starlight Glimmer")
-
{
-
uiHandler.SendDialogMessage($"You knock on the door of Trixie's wagon.", Color.white);
-
uiHandler.SendDialogMessage($"You hear a loud bang. Moments later, the door bursts open, revealing a cloud of smoke. Trixie looks a bit dishevelled.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"The Great and Powerful Trixie was not expecting any visitors today.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"What do you want, {playerCharacter.GetName()}?", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
else
-
{
-
uiHandler.SendDialogMessage($"You knock on the door of Trixie's wagon.", Color.white);
-
uiHandler.SendDialogMessage($"You hear a loud bang. Moments later, the door bursts open, revealing a cloud of smoke. Trixie looks a bit dishevelled.", Color.white);
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"There you are, Starlight! I need your help with the new act, I can't get this trick to work...", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
}
-
uiHandler.SetDialogChoice("Offer help", "Invite for tea");
-
break;
-
case 1:
-
if (leftChoice) // offer help
-
{
-
if (playerCharacter.GetName() != "Starlight Glimmer")
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"It looks like you could use some help. Is there anything I can do for you?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Trixie is working on a new act. Since her usual assistant isn't here, perhaps you could...", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage($"You assist Trixie in her practice. You don't really understand what's happening, but she looks pleased.", Color.white);
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I'm here to help! What do you need, Trix?", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Follow me, and I'll show you. I need you to...", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
uiHandler.SendDialogMessage($"You assist Trixie in her practice. With your help, her new trick could fool even Hoofdini himself.", Color.white);
-
}
-
EmptyLine();
-
}
-
if (rightChoice) // invite for tea
-
{
-
if (playerCharacter.GetName() != "Starlight Glimmer")
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"I was thinking we should go out for tea. You look like you could use a break.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"Trixie does not really have time for tea, but she could use a break...", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
uiHandler.SendDialogMessage($"You enjoy a cup of tea with Trixie. All the while, she boasts about how her new show is going to change the world.", Color.white);
-
}
-
else
-
{
-
uiHandler.SendDialogMessage(playerCharacter.GetName() + ": " + $"Trixie, you need a break. Come, let's go drink some tea.", playerHandler.GetPlayerColor(playerCharacter.GetPlayerId()));
-
uiHandler.SendDialogMessage(conversationPartner.GetName() + ": " + $"I guess you're right, Starlight. Let's go.", playerHandler.GetPlayerColor(conversationPartner.GetPlayerId()));
-
EmptyLine();
-
uiHandler.SendDialogMessage($"You enjoy a cup of tea with Trixie. You discuss the new tricks and come up with some helpful suggestions.", Color.white);
-
}
-
}
-
FriendshipGain(playerCharacter, conversationPartner, 20);
-
break;
-
}
-
break;
-
case 11: // unused
-
switch (currentDialogStage)
-
{
-
case 0:
-
break;
-
case 1:
-
if (leftChoice)
-
{
-
-
}
-
if (rightChoice)
-
{
-
-
}
-
break;
-
}
-
break;
-
default:
-
switch (currentDialogStage)
-
{
-
default:
-
uiHandler.SendDialogMessage($"Sumireko Usami: Something broke, and there is no dialogue event.", Color.white);
-
uiHandler.SendDialogMessage($"Sumireko Usami: Sorry.", Color.white);
-
uiHandler.SendDialogMessage($"Sumireko Usami: The current dialog id is {currentDialogId.ToString()}.", Color.white);
-
uiHandler.SendDialogMessage($"Sumireko Usami: You can pass that along to whoever you downloaded this mess from.", Color.white);
-
break;
-
}
-
break;
-
}
-
-
currentDialogStage += 1;
-
}
-
-
}
TEXT
193
0
3834 52.66 KB 811
3834 52.66 KB 811
by irrel