2using System.Collections.Generic;
3using System.Globalization;
15 public CanvasGroup
cg;
49 public List<DramaChoice>
_choices =
new List<DramaChoice>();
53 public Dictionary<string, string>
dictLocalize =
new Dictionary<string, string>();
75 public static Dictionary<string, ExcelData>
dictCache =
new Dictionary<string, ExcelData>();
92 cgCover.SetActive(enable:
false);
93 endroll.SetActive(enable:
false);
103 sequence.lastStep = (sequence.lastlastStep =
setup.
step);
126 string text = CorePath.DramaData + setup.book +
".xlsx";
128 if (excelData !=
null && excelData.
IsModified())
132 if (excelData ==
null)
136 excelData.maxEmptyRows = 10;
137 excelData.path = text;
144 path = CorePath.DramaDataLocal + setup.book +
".xlsx"
147 string text2 =
item[
"id"];
148 if (!text2.IsEmpty() && !
item[
"text"].IsEmpty())
159 for (
int i = 0; i < list.Count; i++)
207 string[] array = (
item.ContainsKey(
"action") ?
item[
"action"].Split(
'/') :
null);
208 string action = ((array !=
null) ? array[0] :
null);
209 string text2 = (
item.ContainsKey(
"step") ?
item[
"step"] :
null);
218 string actor = (
item.ContainsKey(
"actor") ?
item[
"actor"] :
"#1");
219 string[] p = (
item.ContainsKey(
"param") ?
item[
"param"].Split(
',') :
new string[0]);
220 string p2 = ((p.Length != 0) ? p[0] :
"");
221 string p3 = ((p.Length > 1) ? p[1] :
"");
222 string p4 = ((p.Length > 2) ? p[2] :
"");
223 float.TryParse(p2, out var p0f);
224 float.TryParse(p3, out var result);
225 bool flag = !
item[
"text_JP"].IsEmpty();
226 item.TryGetValue(
"text_JP");
232 string key =
item[
"id"];
239 text =
item.TryGetValue(
"text_EN");
247 if (flag && text.StartsWith(
"$") &&
tg !=
null &&
tg.
hasChara)
249 string text3 = text.Split(
' ')[0];
252 string jump = (
item.ContainsKey(
"jump") ?
item[
"jump"] :
null);
253 string text4 = (
item.ContainsKey(
"if") ?
item[
"if"] :
null);
254 string iF = (
item.ContainsKey(
"if2") ?
item[
"if2"] :
null);
255 string cHECK = (
item.ContainsKey(
"check") ?
item[
"check"] :
null);
257 if (text2 !=
null && !
sequence.
steps.ContainsKey(text2) && action !=
"choice" && action !=
"cancel")
273 if (action ==
"reload")
286 case "disableFullPortrait":
289 sequence.fullPortrait =
false;
298 sequence.skipJump = p2;
305 EMono.Sound.haltUpdate =
true;
310 SoundManager.ForceBGM();
316 if (p2.StartsWith(
"*"))
318 Quest quest3 = EMono.game.quests.Get(p2.TrimStart(
'*'));
319 quest3?.ChangePhase(p3.ToInt(quest3.GetType()));
323 EMono.player.dialogFlags[p2] = (p3.IsEmpty() ? 1 : int.Parse(p3));
334 }, 0.01f, halt:
true);
352 lastTalk.canCancel =
true;
353 lastTalk.idCancelJump = jump;
366 if (array.Length > 1)
371 text =
"deQuest".lang();
375 text =
"depart".lang();
379 text =
"letsTalk".lang();
383 text =
"daBuy".lang();
387 text =
"daSell".lang();
391 text =
"daGive".lang();
395 text =
"daTrade".lang();
428 dramaActor.owner.tempName = text;
467 imageBG.enabled = false;
471 imageBG.enabled = true;
472 imageBG.sprite = Resources.Load<Sprite>(
"Media/Graphics/Image/Drama/" + p2);
479 Util.Instantiate<Transform>(
"Media/Graphics/Image/Drama/" + p2,
layer).SetAsFirstSibling();
487 dialog.imageBgAdv.enabled = false;
491 dialog.imageBgAdv.enabled = true;
492 dialog.imageBgAdv.sprite = Resources.Load<Sprite>(
"Media/Graphics/Image/Drama/" + p2);
499 DramaActor.useGlitch =
true;
511 LayerDrama.haltPlaylist =
false;
513 EMono.Sound.currentBGM =
null;
520 List<int> list =
new List<int>();
522 foreach (
string s
in array2)
524 list.Add(
int.Parse(s));
532 LayerDrama.haltPlaylist =
true;
533 LayerDrama.maxBGMVolume =
true;
553 LayerDrama.haltPlaylist =
true;
555 EMono.Sound.currentBGM =
null;
563 SoundManager.current.MuteBGMFor(
float.Parse(p3, CultureInfo.InvariantCulture));
569 LayerDrama.haltPlaylist =
true;
572 LayerDrama.keepBGM =
true;
579 cg.DOFade(0f, p0f).SetDelay(0.1f);
586 cg.DOFade(1f, p0f).SetDelay(0.1f);
594 cg.DOFade(1f, p0f).SetDelay(0.1f);
602 cg.DOFade(0f, p0f).SetDelay(0.1f);
608 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
609 cgCover.SetActive(enable:
true);
611 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
617 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
618 cgCover.SetActive(enable:
true);
620 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
626 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
627 cgCover.SetActive(enable:
true);
629 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
634 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
635 cgCover.SetActive(enable:
true);
637 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
649 dialog.SetActive(enable:
false);
659 imageCover.color =
Color.black;
660 cgCover.SetActive(enable:
true);
662 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
666 dialog.SetActive(enable:
false);
667 imageBG.enabled =
false;
673 cg.DOFade(0f, p0f).SetDelay(0.1f);
680 goSkip.SetActive(value:
true);
685 sequence.canCancel =
bool.Parse(p2);
697 int num =
int.Parse(p2);
723 Msg.Say(
"(Failed DLC check)");
727 EMono.game.quests.Start(quest2);
728 LayerDrama.currentQuest = quest2;
729 if (tg != null && tg.chara != null)
731 Debug.Log(
"Starting Quest:" + quest2?.ToString() +
"/" + tg.chara.quest?.ToString() +
"/" + (quest2 == tg.chara.quest));
736 case "setQuestClient":
741 LayerDrama.currentQuest.SetClient(tg.chara, assignQuest: false);
745 case "updateJournal":
756 int num2 = p3.ToInt();
773 case "completeQuest":
814 chara3.renderer.ShowBossText();
844 int num3 = p3.ToInt();
845 thing?.
ModNum((num3 == 0) ? (-1) : (-num3));
871 speed = p3.IsEmpty(
"2").ToFloat()
881 speed = p2.IsEmpty(
"2").ToFloat()
890 pos =
new Point(p2.ToInt(), p3.ToInt()),
891 speed = p4.IsEmpty(
"2").ToFloat()
898 EMono.scene.screenElin.focusOption =
null;
901 case "setAlwaysVisible":
910 Point from =
new Point(p[1].ToInt(), p[2].ToInt());
914 case "effectEmbarkIn":
921 case "effectEmbarkOut":
934 component.transform.position = EMono.scene.cam.transform.position;
938 Point point = new Point(p[1].ToInt(), p[2].ToInt());
939 component.transform.position = point.PositionCenter();
947 GameObject.Find(p2).GetComponent<DramaProp>().Leave();
960 Debug.Log(
"Drama.destroy chara not found:" + p2);
971 if (action ==
"bout_win")
997 EMono.world.date.hour = (int)p0f;
998 EMono.world.date.min = 0;
1029 if (
tg !=
null && (actor ==
"tg" || actor.IsEmpty()))
1031 text = (enableTone ? tg.ApplyTone(text) : text);
1035 lastTalk.center = p2 ==
"center";
1039 case "checkAffinity":
1042 if (!
string.IsNullOrEmpty(jump) && !flag2)
1071 public DramaEvent CustomEvent(Action func,
string step =
null,
float duration = 0f,
bool halt =
false)
1077 customEvents.Add(dramaEventMethod);
1078 return dramaEventMethod;
1081 public void SetDialog(
string id =
"Default")
1083 DialogDrama[] componentsInChildren = GetComponentsInChildren<DialogDrama>(includeInactive:
true);
1084 foreach (
DialogDrama dialogDrama
in componentsInChildren)
1090 dialogDrama.SetActive(enable:
false);
1091 if (dialogDrama.name ==
"Dialog" +
id)
1093 dialog = dialogDrama;
1098 public bool CheckIF(
string IF)
1100 if (IF ==
null || IF.IsEmpty())
1104 string[] array = IF.Split(
',');
1107 case "garden_bloom":
1116 case "wedding_whoring":
1118 case "duponne_mino":
1120 case "duponne_rescued":
1126 case "duponne_gone":
1132 case "duponne_killed":
1144 case "nerun_nadenade":
1147 return EMono.player.stats.death2 == 0;
1150 case "nerun_nadenade2":
1152 return EMono.player.stats.death2 >= 100;
1157 case "guild_promote":
1159 case "guild_maxpromote":
1161 case "scratch_check":
1163 case "sister_money":
1177 case "hasMelilithCurse":
1186 return Guild.CurrentDrama ==
Guild.
Mage;
1193 case "!hasMiscreation":
1211 case "costRecruitTicket":
1224 if (array.Length > 2)
1229 if (array[1].StartsWith(
"*"))
1231 string text = array[1].TrimStart(
'*');
1233 if (text ==
"guild")
1237 flag = quest !=
null;
1240 value = quest?.
phase ?? (-1);
1247 num = ((!
int.TryParse(array[2], out var result)) ? ((quest !=
null) ? array[2].ToInt(quest.GetType()) : 0) : result);
1251 num =
int.Parse(array[2]);
1256 if (!flag && num == -1)
1260 if (flag && value == num)
1266 if (!flag || value != num)
1272 if (flag && value > num)
1278 if (flag && value >= num)
1284 if (!flag || value < num)
1290 if (!flag || value <= num)
1298 return setup.tag == IF;
1305 layer.SetActive(enable:
true);
1306 layer.cg.alpha = 0f;
1307 layer.
cg.DOFade(1f, 0.3f);
1312 layer.SetActive(enable:
false);
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
int GetInt(int id, int? defaultInt=null)
static void SetNormalRarity(bool fixedMat=false)
GlobalCharaList globalCharas
int GetCurrency(string id="money")
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
void ModNum(int a, bool notify=true)
bool HasElement(int ele, bool includeNagative=false)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
void Slap(Chara c, bool slapToDeath=false)
void MoveZone(string alias)
Dictionary< int, BGMData > dictBGM
int GetRaw(int offsetHours=0)
void AddChoice(DramaChoice choice)
Dictionary< string, string > dictLocalize
DramaEventMethod AddEvent(Action func, float duration=0f, bool halt=false)
DramaEvent CustomEvent(Action func, string step=null, float duration=0f, bool halt=false)
static Dictionary< string, ExcelData > dictCache
void ParseLine(Dictionary< string, string > item)
void AddCustomEvents(string idCustom="Resident")
DramaEventMethod AddEvent(Action func, Func< string > funcJump)
void SetDialog(string id="Default")
List< DramaChoice > _choices
Dictionary< string, string > customTalkTopics
List< DramaEvent > customEvents
DramaSequence Play(DramaSetup setup)
DramaEvent AddEvent(DramaEvent e)
List< DramaEvent > events
DramaActor AddActor(string id, Person person)
DramaActor GetActor(string id)
DramaEvent AddEvent(DramaEvent e)
Dictionary< string, int > steps
static FactionBranch BranchOrHomeBranch
static SoundManager Sound
static FactionBranch Branch
static Effect Get(Effect original)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
List< Dictionary< string, string > > BuildList(string sheetName="_default")
HomeResourceManager resources
bool Save(bool isAutoSave=false, bool silent=false)
static Guild CurrentDrama
static GuildMerchant Merchant
static QuestGuild CurrentQuest
static GuildFighter Fighter
BaseHomeResource Get(string id)
static LayerDrama Instance
static Quest currentQuest
static Religion currentReligion
void ShowScreenLock(string id)
Layer SetOnKill(Action action)
Chara FindChara(string id)
void RevealAll(bool reveal=true)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
bool HasElement(int ele, bool excludePC=false)
Dictionary< string, int > dialogFlags
void ModKeyItem(string alias, int num=1, bool msg=true)
HashSet< string > completedIDs
bool IsCompleted(string id)
Quest Start(string id, string idGlobalChara)
static Quest Create(string _id, string _idPerson=null, Chara c=null, bool assignQuest=true)
virtual SourceQuest.Row source
void JoinFaith(Chara c, ConvertType type=ConvertType.Default)
static void ShakeCam(string id="default", float magnitude=1f)
static bool HasDLC(ID_DLC id)
static Thing Create(string id, int idMat=-1, int lv=-1)
static void Reserve(string idStep, Action onBeforePlay=null)
static void Play(string idStep)
static Transform Instantiate(string path, Component parent=null)
void AddPreEnter(ZonePreEnterEvent e, bool executeIfActiveZone=true)
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Card AddCard(Card t, Point point)
bool IsBelow(int _major, int _minor, int _batch)