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":
838 speed = p3.IsEmpty(
"2").ToFloat()
848 speed = p2.IsEmpty(
"2").ToFloat()
857 pos =
new Point(p2.ToInt(), p3.ToInt()),
858 speed = p4.IsEmpty(
"2").ToFloat()
865 EMono.scene.screenElin.focusOption =
null;
868 case "setAlwaysVisible":
877 Point from =
new Point(p[1].ToInt(), p[2].ToInt());
881 case "effectEmbarkIn":
885 Util.Instantiate(
"UI/Layer/LayerEmbark/EmbarkActor_crystal");
888 case "effectEmbarkOut":
897 DramaProp component =
Util.Instantiate(
"Media/Drama/Prop/" + p2).GetComponent<DramaProp>();
901 component.transform.position = EMono.scene.cam.transform.position;
905 Point point = new Point(p[1].ToInt(), p[2].ToInt());
906 component.transform.position = point.PositionCenter();
914 GameObject.Find(p2).GetComponent<DramaProp>().Leave();
927 Debug.Log(
"Drama.destroy chara not found:" + p2);
938 if (action ==
"bout_win")
958 EMono.world.date.hour = (int)p0f;
959 EMono.world.date.min = 0;
990 if (
tg !=
null && (actor ==
"tg" || actor.IsEmpty()))
992 text = (enableTone ? tg.ApplyTone(text) : text);
996 lastTalk.center = p2 ==
"center";
1000 case "checkAffinity":
1003 if (!
string.IsNullOrEmpty(jump) && !flag2)
1032 public DramaEvent CustomEvent(Action func,
string step =
null,
float duration = 0f,
bool halt =
false)
1038 customEvents.Add(dramaEventMethod);
1039 return dramaEventMethod;
1042 public void SetDialog(
string id =
"Default")
1044 DialogDrama[] componentsInChildren = GetComponentsInChildren<DialogDrama>(includeInactive:
true);
1045 foreach (
DialogDrama dialogDrama
in componentsInChildren)
1051 dialogDrama.SetActive(enable:
false);
1052 if (dialogDrama.name ==
"Dialog" +
id)
1054 dialog = dialogDrama;
1059 public bool CheckIF(
string IF)
1061 if (IF ==
null || IF.IsEmpty())
1065 string[] array = IF.Split(
',');
1068 case "duponne_mino":
1070 case "duponne_rescued":
1076 case "duponne_gone":
1082 case "duponne_killed":
1098 case "guild_promote":
1100 case "guild_maxpromote":
1102 case "scratch_check":
1104 case "sister_money":
1118 case "hasMelilithCurse":
1127 return Guild.CurrentDrama ==
Guild.
Mage;
1150 case "costRecruitTicket":
1163 if (array.Length > 2)
1168 if (array[1].StartsWith(
"*"))
1170 string text = array[1].TrimStart(
'*');
1172 if (text ==
"guild")
1176 flag = quest !=
null;
1179 value = quest?.
phase ?? (-1);
1186 num = ((!
int.TryParse(array[2], out var result)) ? ((quest !=
null) ? array[2].ToInt(quest.GetType()) : 0) : result);
1190 num =
int.Parse(array[2]);
1195 if (!flag && num == -1)
1199 if (flag && value == num)
1205 if (!flag || value != num)
1211 if (flag && value > num)
1217 if (flag && value >= num)
1223 if (!flag || value < num)
1229 if (!flag || value <= num)
1237 return setup.tag == IF;
1244 layer.SetActive(enable:
true);
1245 layer.cg.alpha = 0f;
1246 layer.
cg.DOFade(1f, 0.3f);
1251 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 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)
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)