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();
415 dramaActor.owner.tempName = text;
454 imageBG.enabled = false;
458 imageBG.enabled = true;
459 imageBG.sprite = Resources.Load<Sprite>(
"Media/Graphics/Image/Drama/" + p2);
466 Util.Instantiate<Transform>(
"Media/Graphics/Image/Drama/" + p2,
layer).SetAsFirstSibling();
472 DramaActor.useGlitch =
true;
484 LayerDrama.haltPlaylist =
false;
486 EMono.Sound.currentBGM =
null;
493 List<int> list =
new List<int>();
495 foreach (
string s
in array2)
497 list.Add(
int.Parse(s));
505 LayerDrama.haltPlaylist =
true;
506 LayerDrama.maxBGMVolume =
true;
526 LayerDrama.haltPlaylist =
true;
528 EMono.Sound.currentBGM =
null;
536 SoundManager.current.MuteBGMFor(
float.Parse(p3, CultureInfo.InvariantCulture));
542 LayerDrama.haltPlaylist =
true;
545 LayerDrama.keepBGM =
true;
552 cg.DOFade(0f, p0f).SetDelay(0.1f);
559 cg.DOFade(1f, p0f).SetDelay(0.1f);
567 cg.DOFade(1f, p0f).SetDelay(0.1f);
575 cg.DOFade(0f, p0f).SetDelay(0.1f);
581 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
582 cgCover.SetActive(enable:
true);
584 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
590 imageCover.color = ((p3 !=
null && p3 ==
"white") ?
Color.white :
Color.black);
591 cgCover.SetActive(enable:
true);
593 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
599 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
600 cgCover.SetActive(enable:
true);
602 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
607 imageCover.color = ((p4 !=
null && p4 ==
"white") ?
Color.white :
Color.black);
608 cgCover.SetActive(enable:
true);
610 cgCover.DOFade(0f, p0f).SetDelay(0.1f);
622 dialog.SetActive(enable:
false);
632 imageCover.color =
Color.black;
633 cgCover.SetActive(enable:
true);
635 cgCover.DOFade(1f, p0f).SetDelay(0.1f);
639 dialog.SetActive(enable:
false);
640 imageBG.enabled =
false;
646 cg.DOFade(0f, p0f).SetDelay(0.1f);
653 goSkip.SetActive(value:
true);
658 sequence.canCancel =
bool.Parse(p2);
685 Msg.Say(
"(Failed DLC check)");
689 EMono.game.quests.Start(quest2);
690 LayerDrama.currentQuest = quest2;
691 if (tg != null && tg.chara != null)
693 Debug.Log(
"Starting Quest:" + quest2?.ToString() +
"/" + tg.chara.quest?.ToString() +
"/" + (quest2 == tg.chara.quest));
698 case "setQuestClient":
703 LayerDrama.currentQuest.SetClient(tg.chara, assignQuest: false);
707 case "updateJournal":
734 case "completeQuest":
807 speed = p3.IsEmpty(
"2").ToFloat()
817 speed = p2.IsEmpty(
"2").ToFloat()
826 pos =
new Point(p2.ToInt(), p3.ToInt()),
827 speed = p4.IsEmpty(
"2").ToFloat()
834 EMono.scene.screenElin.focusOption =
null;
837 case "setAlwaysVisible":
846 Point from =
new Point(p[1].ToInt(), p[2].ToInt());
850 case "effectEmbarkIn":
854 Util.Instantiate(
"UI/Layer/LayerEmbark/EmbarkActor_crystal");
857 case "effectEmbarkOut":
866 DramaProp component =
Util.Instantiate(
"Media/Drama/Prop/" + p2).GetComponent<DramaProp>();
870 component.transform.position = EMono.scene.cam.transform.position;
874 Point point = new Point(p[1].ToInt(), p[2].ToInt());
875 component.transform.position = point.PositionCenter();
883 GameObject.Find(p2).GetComponent<DramaProp>().Leave();
896 Debug.Log(
"Drama.destroy chara not found:" + p2);
907 if (action ==
"bout_win")
927 EMono.world.date.hour = (int)p0f;
928 EMono.world.date.min = 0;
959 if (
tg !=
null && (actor ==
"tg" || actor.IsEmpty()))
961 text = tg.ApplyTone(text);
965 lastTalk.center = p2 ==
"center";
970 case "checkAffinity":
973 if (!
string.IsNullOrEmpty(jump) && !flag2)
1002 public DramaEvent CustomEvent(Action func,
string step =
null,
float duration = 0f,
bool halt =
false)
1008 customEvents.Add(dramaEventMethod);
1009 return dramaEventMethod;
1012 public void SetDialog(
string id =
"Default")
1014 DialogDrama[] componentsInChildren = GetComponentsInChildren<DialogDrama>(includeInactive:
true);
1015 foreach (
DialogDrama dialogDrama
in componentsInChildren)
1021 dialogDrama.SetActive(enable:
false);
1022 if (dialogDrama.name ==
"Dialog" +
id)
1024 dialog = dialogDrama;
1029 public bool CheckIF(
string IF)
1031 if (IF ==
null || IF.IsEmpty())
1035 string[] array = IF.Split(
',');
1044 case "guild_promote":
1046 case "guild_maxpromote":
1048 case "scratch_check":
1050 case "sister_money":
1064 case "hasMelilithCurse":
1090 case "costRecruitTicket":
1103 if (array.Length > 2)
1108 if (array[1].StartsWith(
"*"))
1110 string text = array[1].TrimStart(
'*');
1112 if (text ==
"guild")
1116 flag = quest !=
null;
1119 value = quest?.
phase ?? (-1);
1126 num = ((!
int.TryParse(array[2], out var result)) ? ((quest !=
null) ? array[2].ToInt(quest.GetType()) : 0) : result);
1130 num =
int.Parse(array[2]);
1135 if (!flag && num == -1)
1139 if (flag && value == num)
1145 if (!flag || value != num)
1151 if (flag && value > num)
1157 if (flag && value >= num)
1163 if (!flag || value < num)
1169 if (!flag || value <= num)
1177 return setup.tag == IF;
1184 layer.SetActive(enable:
true);
1185 layer.cg.alpha = 0f;
1186 layer.
cg.DOFade(1f, 0.3f);
1191 layer.SetActive(enable:
false);
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
int GetInt(int id, int? defaultInt=null)
static void SetNormalRarity(bool fixedMat=false)
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
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 PlayAnime(AnimeID id, bool force=false)
void Say(string lang, string ref1=null, string ref2=null)
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 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)
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)
Card AddCard(Card t, Point point)