30 public static MsgColors colors
34 return EClass.core.refs.msgColors;
39 public static void SetColor()
41 Msg.currentColor =
Msg.colors.Default;
45 public static void SetColor(Color color)
47 Msg.currentColor = color;
51 public static void SetColor(
string id)
53 Msg.currentColor =
Msg.colors.colors[id];
57 public static string GetRawText(
string idLang,
string ref1,
string ref2 =
null,
string ref3 =
null,
string ref4 =
null)
59 Msg.thirdPerson1.Set(ref1);
60 Msg.thirdPerson2.Set(ref2);
61 return GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(ref1), ref1, ref2, ref3, ref4);
65 public static string GetRawText(
string idLang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
67 Msg.thirdPerson1.Set(c1,
false);
68 Msg.thirdPerson2.Set(c2,
false);
69 return GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(c1),
Msg.GetName(c1),
Msg.GetName(c2), ref1, ref2);
73 public static string GetRawText(
string idLang,
Card c1,
string ref1 =
null,
string ref2 =
null,
string ref3 =
null)
75 Msg.thirdPerson1.Set(c1,
false);
76 Msg.thirdPerson2.Set(ref1);
77 return GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(c1),
Msg.GetName(c1), ref1, ref2, ref3);
81 public static string Say(
string idLang,
string ref1,
string ref2 =
null,
string ref3 =
null,
string ref4 =
null)
83 Msg.thirdPerson1.Set(ref1);
84 Msg.thirdPerson2.Set(ref2);
85 return Msg.SayRaw(
GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(ref1), ref1, ref2, ref3, ref4));
89 public static string Say(
string idLang,
Card c1,
Card c2,
string ref1 =
null,
string ref2 =
null)
91 Msg.thirdPerson1.Set(c1,
false);
92 Msg.thirdPerson2.Set(c2,
false);
93 return Msg.SayRaw(
GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(c1),
Msg.GetName(c1),
Msg.GetName(c2), ref1, ref2));
97 public static string Say(
string idLang,
Card c1,
string ref1 =
null,
string ref2 =
null,
string ref3 =
null)
99 Msg.thirdPerson1.Set(c1,
false);
100 Msg.thirdPerson2.Set(ref1);
101 return Msg.SayRaw(
GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(c1),
Msg.GetName(c1), ref1, ref2, ref3));
105 public static string Say(
string idLang,
Card c1,
int i,
string ref1 =
null)
107 Msg.thirdPerson1.Set(c1,
false);
108 Msg.thirdPerson2.Set(ref1);
109 return Msg.SayRaw(
GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(i),
Msg.GetName(c1), i.ToString() ??
"", ref1,
null));
113 public static string Say(
string idLang,
int i,
string ref1 =
null,
string ref2 =
null)
115 return Msg.SayRaw(
GameLang.Parse(
Msg.GetGameText(idLang),
Msg.IsThirdPerson(i), ref1, ref2,
null,
null));
119 public static string Say(
string idLang)
121 return Msg.SayRaw(
Msg.GetGameText(idLang));
125 public static string SayNothingHappen()
127 return Msg.Say(
"nothingHappens");
131 public static void SayGod(
string s,
Card owner =
null)
133 Msg.SetColor(
Msg.colors.TalkGod);
134 Msg.Say(s.Bracket(0));
137 owner.SayRaw(
"@1" + s,
null,
null);
142 public static string SayRaw(
string text)
146 Msg.currentColor =
Msg.colors.Default;
149 Msg.ToUpperFirst(text);
152 Msg.feed.System(text);
156 Msg.mainText.Append(text,
Msg.currentColor,
null);
158 Msg.currentColor =
Msg.colors.Default;
159 Msg.alwaysVisible =
false;
160 EClass.game.log.Add(text,
null);
165 public static void Append(Sprite sprite)
167 Msg.mainText.Append(sprite);
171 public static void AquireItem(
string itemName)
173 Msg.Say(
"getItem", itemName ??
"",
null,
null,
null);
177 public static void Nerun(
string lang,
string idPortrait =
"UN_nerun")
179 string text =
GameLang.Convert(lang.lang());
182 Msg.feed.Nerun(text, idPortrait);
187 Msg.mainText.Append(text.Bracket(1),
Msg.colors.Talk,
null);
192 public static void SayHomeMember(
string lang)
194 string text =
GameLang.Convert(lang.lang());
197 Msg.feed.Nerun(text,
"UN_nerun");
202 Msg.mainText.Append(text.Bracket(1),
Msg.colors.Talk,
null);
207 public static void SayPic(
Card c,
string lang)
213 string text =
GameLang.Convert(lang.lang());
216 Msg.feed.SayRaw(c, text);
221 Msg.mainText.Append(text.Bracket(1),
Msg.colors.Talk,
null);
226 public static void SayPic(
string idPortrait,
string lang,
string _idPop =
null)
228 string text =
GameLang.Convert(lang.lang());
231 Msg.feed.SayRaw(idPortrait, text, _idPop);
236 Msg.mainText.Append(text.Bracket(1),
Msg.colors.Talk,
null);
241 public static PopItem Talk(
Card c,
string id)
243 PopItem result =
null;
248 string text =
GameLang.Convert(c.GetTalkText(
id,
true,
true));
249 if (
Msg.feed && c !=
null)
251 result =
Msg.feed.SayRaw(c, text);
253 else if (
Msg.mainText)
255 Msg.mainText.Append(text.Bracket(1),
Msg.colors.Talk,
null);
261 public static PopItem TalkHomeMemeber(
string id)
264 if (
EClass.Branch !=
null)
266 for (
int i = 0; i < 99; i++)
279 return Msg.Talk(chara,
id);
283 public static PopItem TalkMaid(
string id)
289 int? num = (branch !=
null) ?
new int?(branch.uidMaid) :
null;
290 if (uid == num.GetValueOrDefault() & num !=
null)
292 return Msg.Talk(chara,
id);
295 return Msg.TalkHomeMemeber(
id);
299 public static string GetGameText(
string idLang)
301 LangGame.Row row =
EClass.core.sources.langGame.map.TryGetValue(idLang,
null);
304 return idLang.lang();
306 if (!row.effect.IsEmpty() && row.effect ==
"destroy")
308 Msg.mainText.Append(
Msg.mainText.spriteDestroy);
310 if (!row.color.IsEmpty())
312 Msg.SetColor(
Msg.colors.colors[row.color]);
314 if (!row.sound.IsEmpty())
316 EClass.Sound.Play(row.sound);
318 return row.GetText(
"text",
false).Split(Environment.NewLine.ToCharArray()).RandomItem<
string>();
322 public static string GetName(
Card c)
334 return (c.isChara ?
"someone" :
"something").lang();
340 public static bool IsThirdPerson(
Card c)
342 return c !=
null && !c.IsPC && c.Num <= 1;
346 public static bool IsThirdPerson(
string n)
349 return int.TryParse(n, out i) &&
Msg.IsThirdPerson(i);
353 public static bool IsThirdPerson(
int i)
359 public static void NewLine()
363 Msg.mainText.NewLine();
368 public unsafe
static void ToUpperFirst(
string str)
374 fixed (
string text = str)
379 ptr += RuntimeHelpers.OffsetToStringData / 2;
381 *ptr =
char.ToUpper(*ptr);
392 public static Color currentColor =
Msg.colors.Default;
395 public static bool alwaysVisible;
398 public static bool ignoreAll;