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":
740 int num2 = p3.ToInt();
757 case "completeQuest":
798 chara3.renderer.ShowBossText();
832 int num3 = p3.ToInt();
833 thing?.
ModNum((num3 == 0) ? (-1) : (-num3));
859 speed = p3.IsEmpty(
"2").ToFloat()
869 speed = p2.IsEmpty(
"2").ToFloat()
878 pos =
new Point(p2.ToInt(), p3.ToInt()),
879 speed = p4.IsEmpty(
"2").ToFloat()
886 EMono.scene.screenElin.focusOption =
null;
889 case "setAlwaysVisible":
898 Point from =
new Point(p[1].ToInt(), p[2].ToInt());
902 case "effectEmbarkIn":
909 case "effectEmbarkOut":
922 component.transform.position = EMono.scene.cam.transform.position;
926 Point point = new Point(p[1].ToInt(), p[2].ToInt());
927 component.transform.position = point.PositionCenter();
935 GameObject.Find(p2).GetComponent<DramaProp>().Leave();
948 Debug.Log(
"Drama.destroy chara not found:" + p2);
959 if (action ==
"bout_win")
979 EMono.world.date.hour = (int)p0f;
980 EMono.world.date.min = 0;
1011 if (
tg !=
null && (actor ==
"tg" || actor.IsEmpty()))
1013 text = (enableTone ? tg.ApplyTone(text) : text);
1017 lastTalk.center = p2 ==
"center";
1021 case "checkAffinity":
1024 if (!
string.IsNullOrEmpty(jump) && !flag2)
1053 public DramaEvent CustomEvent(Action func,
string step =
null,
float duration = 0f,
bool halt =
false)
1059 customEvents.Add(dramaEventMethod);
1060 return dramaEventMethod;
1063 public void SetDialog(
string id =
"Default")
1065 DialogDrama[] componentsInChildren = GetComponentsInChildren<DialogDrama>(includeInactive:
true);
1066 foreach (
DialogDrama dialogDrama
in componentsInChildren)
1072 dialogDrama.SetActive(enable:
false);
1073 if (dialogDrama.name ==
"Dialog" +
id)
1075 dialog = dialogDrama;
1080 public bool CheckIF(
string IF)
1082 if (IF ==
null || IF.IsEmpty())
1086 string[] array = IF.Split(
',');
1089 case "garden_bloom":
1098 case "duponne_mino":
1100 case "duponne_rescued":
1106 case "duponne_gone":
1112 case "duponne_killed":
1124 case "nerun_nadenade":
1127 return EMono.player.stats.death2 == 0;
1130 case "nerun_nadenade2":
1132 return EMono.player.stats.death2 >= 100;
1137 case "guild_promote":
1139 case "guild_maxpromote":
1141 case "scratch_check":
1143 case "sister_money":
1157 case "hasMelilithCurse":
1166 return Guild.CurrentDrama ==
Guild.
Mage;
1173 case "!hasMiscreation":
1191 case "costRecruitTicket":
1204 if (array.Length > 2)
1209 if (array[1].StartsWith(
"*"))
1211 string text = array[1].TrimStart(
'*');
1213 if (text ==
"guild")
1217 flag = quest !=
null;
1220 value = quest?.
phase ?? (-1);
1227 num = ((!
int.TryParse(array[2], out var result)) ? ((quest !=
null) ? array[2].ToInt(quest.GetType()) : 0) : result);
1231 num =
int.Parse(array[2]);
1236 if (!flag && num == -1)
1240 if (flag && value == num)
1246 if (!flag || value != num)
1252 if (flag && value > num)
1258 if (flag && value >= num)
1264 if (!flag || value < num)
1270 if (!flag || value <= num)
1278 return setup.tag == IF;
1285 layer.SetActive(enable:
true);
1286 layer.cg.alpha = 0f;
1287 layer.
cg.DOFade(1f, 0.3f);
1292 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
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)
bool HasElement(int ele, bool includeNagative=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)
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)
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)