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>();
90 cgCover.SetActive(enable:
false);
91 endroll.SetActive(enable:
false);
101 sequence.lastStep = (sequence.lastlastStep =
setup.
step);
124 string text = CorePath.DramaData + setup.book +
".xlsx";
126 if (excelData !=
null && excelData.
IsModified())
130 if (excelData ==
null)
134 excelData.maxEmptyRows = 10;
135 excelData.path = text;
142 path = CorePath.DramaDataLocal + setup.book +
".xlsx"
145 string text2 =
item[
"id"];
146 if (!text2.IsEmpty() && !
item[
"text"].IsEmpty())
157 for (
int i = 0; i < list.Count; i++)
205 string[] array = (
item.ContainsKey(
"action") ?
item[
"action"].Split(
'/') :
null);
206 string action = ((array !=
null) ? array[0] :
null);
207 string text2 = (
item.ContainsKey(
"step") ?
item[
"step"] :
null);
216 string actor = (
item.ContainsKey(
"actor") ?
item[
"actor"] :
"#1");
217 string[] p = (
item.ContainsKey(
"param") ?
item[
"param"].Split(
',') :
new string[0]);
218 string p2 = ((p.Length != 0) ? p[0] :
"");
219 string p3 = ((p.Length > 1) ? p[1] :
"");
220 string p4 = ((p.Length > 2) ? p[2] :
"");
221 float.TryParse(p2, out var p0f);
222 float.TryParse(p3, out var result);
223 bool flag = !
item[
"text_JP"].IsEmpty();
224 item.TryGetValue(
"text_JP");
230 string key =
item[
"id"];
237 text =
item.TryGetValue(
"text_EN");
245 if (flag && text.StartsWith(
"$") &&
tg !=
null &&
tg.
hasChara)
247 string text3 = text.Split(
' ')[0];
250 string jump = (
item.ContainsKey(
"jump") ?
item[
"jump"] :
null);
251 string text4 = (
item.ContainsKey(
"if") ?
item[
"if"] :
null);
252 string iF = (
item.ContainsKey(
"if2") ?
item[
"if2"] :
null);
253 string cHECK = (
item.ContainsKey(
"check") ?
item[
"check"] :
null);
255 if (text2 !=
null && !
sequence.
steps.ContainsKey(text2) && action !=
"choice" && action !=
"cancel")
271 if (action ==
"reload")
284 case "disableFullPortrait":
287 sequence.fullPortrait =
false;
296 sequence.skipJump = p2;
303 EMono.Sound.haltUpdate =
true;
308 SoundManager.ForceBGM();
314 if (p2.StartsWith(
"*"))
316 Quest quest3 = EMono.game.quests.Get(p2.TrimStart(
'*'));
317 quest3?.ChangePhase(p3.ToInt(quest3.GetType()));
321 EMono.player.dialogFlags[p2] = (p3.IsEmpty() ? 1 : int.Parse(p3));
332 }, 0.01f, halt:
true);
350 lastTalk.canCancel =
true;
351 lastTalk.idCancelJump = jump;
364 if (array.Length > 1)
369 text =
"deQuest".lang();
373 text =
"depart".lang();
377 text =
"letsTalk".lang();
381 text =
"daBuy".lang();
385 text =
"daSell".lang();
389 text =
"daGive".lang();
393 text =
"daTrade".lang();
426 dramaActor.owner.tempName = text;
465 imageBG.enabled = false;
469 imageBG.enabled = true;
470 imageBG.sprite = Resources.Load<Sprite>(
"Media/Graphics/Image/Drama/" + p2);
477 Util.Instantiate<Transform>(
"Media/Graphics/Image/Drama/" + p2,
layer).SetAsFirstSibling();
483 DramaActor.useGlitch =
true;
495 LayerDrama.haltPlaylist =
false;
497 EMono.Sound.currentBGM =
null;
504 List<int> list =
new List<int>();
506 foreach (
string s
in array2)
508 list.Add(
int.Parse(s));
516 LayerDrama.haltPlaylist =
true;
517 LayerDrama.maxBGMVolume =
true;
537 LayerDrama.haltPlaylist =
true;
539 EMono.Sound.currentBGM =
null;
547 SoundManager.current.MuteBGMFor(
float.Parse(p3, CultureInfo.InvariantCulture));
553 LayerDrama.haltPlaylist =
true;
556 LayerDrama.keepBGM =
true;
563 cg.DOFade(0f, p0f).SetDelay(0.1f);
570 cg.DOFade(1f, p0f).SetDelay(0.1f);
578 cg.DOFade(1f, p0f).SetDelay(0.1f);
586 cg.DOFade(0f, p0f).SetDelay(0.1f);
592 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
593 cgCover.SetActive(enable:
true);
595 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
601 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
602 cgCover.SetActive(enable:
true);
604 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
610 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
611 cgCover.SetActive(enable:
true);
613 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
618 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
619 cgCover.SetActive(enable:
true);
621 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
633 dialog.SetActive(enable:
false);
643 imageCover.color =
Color.black;
644 cgCover.SetActive(enable:
true);
646 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
650 dialog.SetActive(enable:
false);
651 imageBG.enabled =
false;
657 cg.DOFade(0f, p0f).SetDelay(0.1f);
664 goSkip.SetActive(value:
true);
669 sequence.canCancel =
bool.Parse(p2);
681 int num =
int.Parse(p2);
707 Msg.Say(
"(Failed DLC check)");
711 EMono.game.quests.Start(quest2);
712 LayerDrama.currentQuest = quest2;
713 if (tg != null && tg.chara != null)
715 Debug.Log(
"Starting Quest:" + quest2?.ToString() +
"/" + tg.chara.quest?.ToString() +
"/" + (quest2 == tg.chara.quest));
720 case "setQuestClient":
725 LayerDrama.currentQuest.SetClient(tg.chara, assignQuest: false);
729 case "updateJournal":
756 case "completeQuest":
819 int num2 = p3.ToInt();
820 thing?.
ModNum((num2 == 0) ? (-1) : (-num2));
846 speed = p3.IsEmpty(
"2").ToFloat()
856 speed = p2.IsEmpty(
"2").ToFloat()
865 pos =
new Point(p2.ToInt(), p3.ToInt()),
866 speed = p4.IsEmpty(
"2").ToFloat()
873 EMono.scene.screenElin.focusOption =
null;
876 case "setAlwaysVisible":
885 Point from =
new Point(p[1].ToInt(), p[2].ToInt());
889 case "effectEmbarkIn":
893 Util.Instantiate(
"UI/Layer/LayerEmbark/EmbarkActor_crystal");
896 case "effectEmbarkOut":
905 DramaProp component =
Util.Instantiate(
"Media/Drama/Prop/" + p2).GetComponent<DramaProp>();
909 component.transform.position = EMono.scene.cam.transform.position;
913 Point point = new Point(p[1].ToInt(), p[2].ToInt());
914 component.transform.position = point.PositionCenter();
922 GameObject.Find(p2).GetComponent<DramaProp>().Leave();
935 Debug.Log(
"Drama.destroy chara not found:" + p2);
946 if (action ==
"bout_win")
966 EMono.world.date.hour = (int)p0f;
967 EMono.world.date.min = 0;
998 if (
tg !=
null && (actor ==
"tg" || actor.IsEmpty()))
1000 text = (enableTone ? tg.ApplyTone(text) : text);
1004 lastTalk.center = p2 ==
"center";
1008 case "checkAffinity":
1011 if (!
string.IsNullOrEmpty(jump) && !flag2)
1040 public DramaEvent CustomEvent(Action func,
string step =
null,
float duration = 0f,
bool halt =
false)
1046 customEvents.Add(dramaEventMethod);
1047 return dramaEventMethod;
1050 public void SetDialog(
string id =
"Default")
1052 DialogDrama[] componentsInChildren = GetComponentsInChildren<DialogDrama>(includeInactive:
true);
1053 foreach (
DialogDrama dialogDrama
in componentsInChildren)
1059 dialogDrama.SetActive(enable:
false);
1060 if (dialogDrama.name ==
"Dialog" +
id)
1062 dialog = dialogDrama;
1067 public bool CheckIF(
string IF)
1069 if (IF ==
null || IF.IsEmpty())
1073 string[] array = IF.Split(
',');
1076 case "garden_bloom":
1085 case "duponne_mino":
1087 case "duponne_rescued":
1093 case "duponne_gone":
1099 case "duponne_killed":
1111 case "nerun_nadenade":
1114 return EMono.player.stats.death2 == 0;
1117 case "nerun_nadenade2":
1119 return EMono.player.stats.death2 >= 100;
1124 case "guild_promote":
1126 case "guild_maxpromote":
1128 case "scratch_check":
1130 case "sister_money":
1144 case "hasMelilithCurse":
1153 return Guild.CurrentDrama ==
Guild.
Mage;
1160 case "!hasMiscreation":
1178 case "costRecruitTicket":
1191 if (array.Length > 2)
1196 if (array[1].StartsWith(
"*"))
1198 string text = array[1].TrimStart(
'*');
1200 if (text ==
"guild")
1204 flag = quest !=
null;
1207 value = quest?.
phase ?? (-1);
1214 num = ((!
int.TryParse(array[2], out var result)) ? ((quest !=
null) ? array[2].ToInt(quest.GetType()) : 0) : result);
1218 num =
int.Parse(array[2]);
1223 if (!flag && num == -1)
1227 if (flag && value == num)
1233 if (!flag || value != num)
1239 if (flag && value > num)
1245 if (flag && value >= num)
1251 if (!flag || value < num)
1257 if (!flag || value <= num)
1265 return setup.tag == IF;
1272 layer.SetActive(enable:
true);
1273 layer.cg.alpha = 0f;
1274 layer.
cg.DOFade(1f, 0.3f);
1279 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
bool HasElement(int ele, int req=1)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
int GetCurrency(string id="money")
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
void PlayAnime(AnimeID id, bool force=false)
void ModNum(int a, bool notify=true)
void Say(string lang, string ref1=null, string ref2=null)
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=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 int rndHalf(int a)
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)
virtual SourceQuest.Row source
static Quest Create(string _id, string _idPerson=null, Chara c=null)
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)
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)