Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
DramaCustomSequence.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Linq;
5using UnityEngine;
6
8{
9 public Card destCard;
10
12
14
16
17 public string idDefault;
18
19 public string idCustom;
20
22
24
25 public List<DramaEvent> events;
26
28
29 public string StepDefault => idDefault;
30
31 public string StepEnd => "end";
32
33 public void Build(Chara c)
34 {
35 bool flag = idCustom == "Unique";
36 bool flag2 = c.bio.IsUnderAge || EClass.pc.bio.IsUnderAge;
37 bool isInGuild = Guild.Fighter.IsCurrentZone || Guild.Mage.IsCurrentZone || Guild.Thief.IsCurrentZone || Guild.Merchant.IsCurrentZone;
38 string bird = (flag2 ? "bird" : "tail");
39 _ = c.Name;
40 string rumor = (c.IsPCParty ? GetTalk("sup") : GetRumor(c));
41 Layer layer = null;
42 bool flag3 = c.IsHuman || EClass.pc.HasElement(1640);
43 if (!flag)
44 {
45 Step("Resident");
46 _Talk("tg", () => rumor);
47 if (flag3)
48 {
49 DramaChoice choice = Choice2("letsTalk", StepDefault);
50 choice.SetOnClick(delegate
51 {
52 sequence.firstTalk.funcText = () => rumor;
53 List<Hobby> list2 = c.ListHobbies();
54 Hobby hobby = ((list2.Count > 0) ? list2[0] : null);
55 if (EClass.rnd(20) == 0 || EClass.debug.showFav)
56 {
57 if (EClass.rnd(2) == 0 || hobby == null)
58 {
59 GameLang.refDrama1 = c.GetFavCat().GetName().ToLower();
60 GameLang.refDrama2 = c.GetFavFood().GetName();
61 rumor = GetText(c, "general", "talk_fav");
62 c.knowFav = true;
63 }
64 else
65 {
66 GameLang.refDrama1 = hobby.Name.ToLower();
67 rumor = GetText(c, "general", "talk_hobby");
68 }
69 }
70 else
71 {
72 rumor = GetRumor(c);
73 }
75 choice.forceHighlight = true;
76 }).SetCondition(() => c.interest > 0);
77 }
78 }
79 bool flag4 = false;
80 if (!c.IsPCFaction && c.affinity.CanInvite() && !EClass._zone.IsInstance && c.c_bossType == BossType.none)
81 {
82 if ((c.trait.IsUnique || c.IsGlobal) && c.GetInt(111) == 0 && !c.IsPCFaction)
83 {
84 Choice2("daBout", "_bout");
85 flag4 = true;
86 }
87 else
88 {
89 Choice2("daInvite", "_invite");
90 }
91 }
92 foreach (Quest item in EClass.game.quests.list)
93 {
94 Quest _quest = item;
95 if (!item.CanDeliverToClient(c))
96 {
97 continue;
98 }
99 QuestDeliver questDeliver = _quest as QuestDeliver;
100 foreach (Thing item2 in questDeliver.ListDestThing())
101 {
102 Thing _t4 = item2;
103 Choice2("daDeliver".lang(item.GetTitle() ?? "", _t4.GetName(NameStyle.Full, questDeliver.num)), "_deliver").SetOnClick(delegate
104 {
105 destThing = _t4;
106 destQuest = _quest;
107 }).SetOnTooltip(delegate(UITooltip a)
108 {
109 _t4.WriteNote(a.note);
110 });
111 }
112 }
113 if (c.IsPCParty)
114 {
115 if (!c.isSummon)
116 {
117 if (EClass._zone.IsPCFaction && c.homeBranch != EClass._zone.branch)
118 {
119 Choice2("daMakeHome", "_makeHome");
120 }
121 if (c.host == null && c.homeZone != null)
122 {
123 Choice2("daLeaveParty".lang(c.homeZone.Name), "_leaveParty");
124 }
125 }
126 }
127 else if (c.memberType != FactionMemberType.Livestock && !c.IsGuest())
128 {
129 if (c.trait.CanGuide)
130 {
131 foreach (Quest item3 in EClass.game.quests.list)
132 {
133 if (!item3.IsRandomQuest)
134 {
135 continue;
136 }
137 Chara dest = ((item3.chara != null && item3.chara.IsAliveInCurrentZone) ? item3.chara : null);
138 if (dest != null)
139 {
140 Choice2("daGoto".lang(dest.Name, item3.GetTitle() ?? ""), "_goto").SetOnClick(delegate
141 {
142 destCard = dest;
143 });
144 }
145 if (!(item3 is QuestDeliver { IsDeliver: not false } questDeliver2) || questDeliver2.DestZone != EClass._zone || !EClass._zone.dictCitizen.ContainsKey(questDeliver2.uidTarget))
146 {
147 continue;
148 }
149 Chara dest2 = EClass._zone.FindChara(questDeliver2.uidTarget);
150 if (dest2 != null)
151 {
152 Choice2("daGoto".lang(dest2.Name, item3.GetTitle() ?? ""), "_goto").SetOnClick(delegate
153 {
154 destCard = dest2;
155 });
156 }
157 }
158 if (GetListGuide().Count > 0)
159 {
160 Choice2("daGuide", "_Guide");
161 }
162 }
163 Choice2("daQuest".lang(c.quest?.GetTitle() ?? ""), "_quest").SetCondition(() => c.quest != null);
164 if (c.trait is TraitGuard)
165 {
166 EClass.pc.things.Foreach(delegate(Thing _t)
167 {
168 if (_t.isLostProperty)
169 {
170 Choice2("daLostProperty".lang(_t.Name), "_lostProperty").SetOnClick(delegate
171 {
172 destThing = _t;
173 });
174 }
175 });
176 }
177 if (c.trait is TraitGM_Mage && Guild.Mage.relation.rank >= 4)
178 {
179 Choice2("daChangeDomain", "_changeDomain").DisableSound();
180 }
181 if (c.trait.ShopType != 0)
182 {
183 Choice2(c.trait.TextNextRestock, "_buy").DisableSound();
184 }
185 if (c.trait.SlaverType != 0)
186 {
187 Choice2(c.trait.TextNextRestockPet, "_buySlave").DisableSound();
188 }
189 if (c.trait.CopyShop != 0)
190 {
191 Choice2(("daCopy" + c.trait.CopyShop).lang(c.trait.NumCopyItem.ToString() ?? ""), "_copyItem").DisableSound();
192 }
193 if (c.trait.HaveNews && c.GetInt(33) + 10080 < EClass.world.date.GetRaw())
194 {
195 Choice2("daNews", "_news");
196 }
197 if (!flag4 && !EClass._zone.IsInstance && !c.IsPCFaction && c.trait.CanBout && c.IsGlobal && c.GetInt(59) + 10080 < EClass.world.date.GetRaw())
198 {
199 Choice2("daBout", "_bout");
200 }
201 if (c.isDrunk || EClass.debug.enable)
202 {
203 Choice2(flag2 ? "daBird" : "daTail", "_tail");
204 }
205 if (c.trait.CanRevive)
206 {
207 Choice2("daRevive", "_revive").DisableSound();
208 }
209 if (!c.trait.IDTrainer.IsEmpty() && !EClass._zone.IsUserZone && (Guild.GetCurrentGuild() == null || Guild.GetCurrentGuild().relation.IsMember()))
210 {
211 Choice2("daTrain", "_train").DisableSound();
212 }
213 if (c.trait.CanWhore)
214 {
215 Choice2(flag2 ? "daBirdBuy" : "daTailBuy", "_whore");
216 }
217 if (c.trait.CanHeal)
218 {
219 Choice2("daHeal", "_heal");
220 }
221 if (c.trait.CanServeFood)
222 {
223 Choice2("daFood", "_food");
224 }
225 if (c.trait is TraitInformer)
226 {
227 Choice2("daSellFame", "_sellFame");
228 }
230 {
231 if (c.trait.CanInvestTown && Guild.GetCurrentGuild() == null)
232 {
233 Choice2("daInvest", "_investZone");
234 }
235 if (c.trait.CanInvest)
236 {
237 Choice2("daInvest", "_investShop");
238 }
239 }
240 if (c.trait.CanIdentify)
241 {
242 Choice2("daIdentify", "_identify").DisableSound();
243 Choice2("daIdentifyAll", "_identifyAll");
244 Choice2("daIdentifySP", "_identifySP").DisableSound();
245 }
246 if (c.trait.CanPicklock)
247 {
248 if (c.Evalue(280) < 20)
249 {
250 c.elements.SetBase(280, 20);
251 }
252 foreach (Thing item4 in EClass.pc.things.List((Thing a) => a.c_lockLv > 0, onlyAccessible: true))
253 {
254 Thing _t3 = item4;
255 Choice2("daPicklock".lang(_t3.Name), "_picklock").SetOnClick(delegate
256 {
257 destThing = _t3;
258 });
259 }
260 }
261 if (c.trait is TraitBanker)
262 {
263 Choice2("daDeposit", "_deposit");
264 }
265 if (c.IsMaid || (c.trait.CanInvestTown && (EClass._zone.source.faction == "mysilia" || EClass._zone.IsPCFaction)))
266 {
267 Choice2("daExtraTax", "_extraTax");
268 }
269 if ((c.trait is TraitMiko_Mifu || c.trait is TraitMiko_Nefu || c.trait is TraitEureka) && EClass.world.date.IsExpired(c.c_dateStockExpire))
270 {
271 Choice2("daBlessing", "_blessing");
272 }
273 }
274 if (c.IsHomeMember())
275 {
276 if (c.IsMaid)
277 {
279 {
280 Choice2("daMeeting".lang(EClass.Branch.meetings.list.Count.ToString() ?? ""), "_meeting");
281 }
282 Choice2("daBuyLand", "_buyLand");
283 Choice2("daChangeTitle", "_changeTitle");
284 }
285 if (c.noMove)
286 {
287 Choice2("enableMove", "_enableMove");
288 }
289 if (!c.IsPCParty && c.memberType != FactionMemberType.Livestock && c.trait.CanJoinParty)
290 {
291 Choice2("daJoinParty", "_joinParty");
292 }
293 Choice2("daFactionOther", "_factionOther");
294 }
295 if (c.trait is TraitLoytel && EClass.game.quests.Get<QuestDebt>() != null)
296 {
297 Choice2("daGreatDebt", "_greatDebt");
298 }
299 if (!flag)
300 {
301 Choice2("bye", "_bye");
302 EnableCancel();
303 }
304 Step("_factionOther");
305 Talk("what", StepDefault);
306 if (c.trait is TraitLoytel)
307 {
308 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
309 if (questDebt != null && questDebt.gaveBill)
310 {
311 Choice("daGreatDebt2", "_greatDebt2");
312 }
313 }
314 if (c.IsPCParty)
315 {
316 if (!c.isSummon)
317 {
318 Choice((c.GetInt(106) == 0) ? "daShutup" : "daShutup2", "_shutup");
319 if (c.CanInsult())
320 {
321 Choice((c.GetInt(108) == 0) ? "daInsult" : "daInsult2", "_insult");
322 }
323 }
324 }
325 else if (!c.noMove)
326 {
327 Choice("disableMove", "_disableMove");
328 }
329 Choice((c.GetInt(123) == 0) ? "daSleepBeside" : "daSleepBeside2", "_sleepBeside");
330 if (c.GetInt(113) == 0)
331 {
332 Choice("daEquipSharedOff", "_toggleSharedEquip");
333 }
334 else
335 {
336 Choice("daEquipSharedOn", "_toggleSharedEquip");
337 }
338 if (!c.IsMaid && c.homeBranch == EClass.Branch)
339 {
340 Choice("daMakeMaid", "_daMakeMaid");
341 }
342 if (c.trait.CanBeBanished && !c.IsPCParty)
343 {
344 Choice("daBanish", "_depart");
345 }
346 Choice("daNothing", StepDefault, cancel: true);
347 Step("_toggleSharedEquip");
348 Method(delegate
349 {
350 c.SetInt(113, (c.GetInt(113) == 0) ? 1 : 0);
351 });
352 _Talk("tg", GetTopic(c, (c.GetInt(113) == 0) ? "shutup" : "shutup2"));
353 End();
354 Step("_daMakeMaid");
355 Method(delegate
356 {
357 EClass.Branch.uidMaid = c.uid;
358 });
359 _Talk("tg", GetTopic(c, "becomeMaid"));
360 End();
361 Step("_joinParty");
362 Method(delegate
363 {
364 if (!c.trait.CanJoinPartyResident)
365 {
366 GameLang.refDrama1 = c.GetBestAttribute().ToString() ?? "";
367 TempTalkTopic("invite3", StepDefault);
368 }
369 else
370 {
371 EClass.pc.party.AddMemeber(c, showMsg: true);
372 }
373 });
374 Talk("hired", StepEnd);
375 Step("_leaveParty");
376 Method(delegate
377 {
379 if (EClass.game.activeZone != c.homeZone)
380 {
381 EClass.pc.Say("tame_send", c, c.homeZone.Name);
382 c.MoveZone(c.homeZone);
383 }
384 });
385 Goto("_bye");
386 Step("_banish");
387 Goto("_bye");
388 Step("_makeLivestock");
389 Method(delegate
390 {
391 c.memberType = FactionMemberType.Livestock;
392 });
393 Talk("becomeLivestock", StepEnd);
394 Step("_makeResident");
395 Method(delegate
396 {
397 c.memberType = FactionMemberType.Default;
398 });
399 Talk("becomeResident", StepEnd);
400 Step("_depart");
401 Talk("depart_choice", StepDefault);
402 Choice("depart1", "_depart1");
403 Choice("depart2", "_depart2");
404 Step("_depart1");
405 Method(delegate
406 {
408 {
409 c.homeBranch.BanishMember(c);
410 });
411 });
412 Talk("depart1", StepEnd);
413 Step("_depart2");
414 Talk("depart2", StepDefault);
415 Step("_gift");
416 Talk("gift_good", null);
417 End();
418 Step("_goto");
419 Method(delegate
420 {
421 GameLang.refDrama1 = destCard.Name;
422 if (destCard == c)
423 {
424 TempTalkTopic("goto2", StepDefault);
425 }
426 else
427 {
428 TempTalkTopic("goto", "_goto2");
429 }
430 });
431 Step("_goto2");
432 Method(delegate
433 {
435 {
436 destCard.Teleport(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true) ?? EClass.pc.pos, silent: true, force: true);
437 }
439 EInput.Consume(consumeAxis: false, 20);
440 });
441 End();
442 Step("_rumor");
443 Talk("rumor", StepDefault);
444 Step("_lostProperty");
445 Method(delegate
446 {
447 GameLang.refDrama1 = destThing.Name;
450 });
451 _Talk("tg", GetTopic(c, "deliver_purse"), StepEnd);
452 _ = c.quest;
453 string text = ((!setup.forceJump.IsEmpty()) ? StepEnd : StepDefault);
454 Step("_deliver");
455 Method(delegate
456 {
457 GameLang.refDrama1 = destQuest.NameDeliver;
459 });
460 _Talk("tg", () => (destQuest != null) ? destQuest.GetTalkComplete().IsEmpty(GetTopic(c, (destQuest.bonusMoney > 0) ? "questCompleteDeliverExtra" : "questCompleteDeliver")) : "", StepEnd);
461 Step("_quest");
462 _Talk("tg", delegate
463 {
464 if (c.quest == null)
465 {
466 return "";
467 }
468 GameLang.refDrama1 = c.quest.RefDrama1;
469 GameLang.refDrama2 = c.quest.RefDrama2;
470 GameLang.refDrama3 = c.quest.RefDrama3;
471 return (!taken()) ? c.quest.GetDetail() : c.quest.GetTalkProgress().IsEmpty(GetTopic(c, "questInProgress"));
472 }, text);
473 string text2 = "daAccept".lang();
474 if (c.quest != null && c.quest.deadline != 0)
475 {
476 text2 += "hintDeadline".lang(c.quest.TextDeadline).ToLower();
477 }
478 Choice(text2, (c.quest != null && c.quest.UseInstanceZone) ? "_questAccept_instance" : "_questAccept").SetOnClick(delegate
479 {
480 EClass.game.quests.Start(c.quest);
481 }).SetCondition(() => !taken() && EClass.game.quests.CountRandomQuest() < 5);
482 Choice(text2, "_questFull").SetOnClick(delegate
483 {
484 }).SetCondition(() => !taken() && EClass.game.quests.CountRandomQuest() >= 5);
485 Choice("daDecline", text).SetOnClick(RumorChill).SetCondition(() => !taken());
486 if (c.quest != null && EClass.game.quests.Get(c.quest.uid) == null)
487 {
488 QuestSupply supply = c.quest as QuestSupply;
489 if (supply != null)
490 {
491 foreach (Thing item5 in supply.ListDestThing())
492 {
493 Thing _t2 = item5;
494 Choice("daDeliver".lang(supply.GetTitle() ?? "", _t2.GetName(NameStyle.Full, supply.num)), "_deliver").SetOnClick(delegate
495 {
496 EClass.game.quests.Start(c.quest);
497 destThing = _t2;
498 destQuest = supply;
499 }).SetOnTooltip(delegate(UITooltip a)
500 {
501 _t2.WriteNote(a.note);
502 });
503 }
504 }
505 }
506 EnableCancel(text);
507 Step("_questAccept");
508 _Talk("tg", GetTopic(c, "questAccept"), StepEnd);
509 Step("_questAccept_instance");
510 _Talk("tg", GetTopic(c, "questAccept"));
511 Method(delegate
512 {
513 Zone z2 = c.quest.CreateInstanceZone(c);
515 }, null, StepEnd);
516 Step("_questFull");
517 _Talk("tg", GetTopic(c, "questFull"), text);
518 Step("_greatDebt");
519 Method(delegate
520 {
521 QuestDebt questDebt3 = EClass.game.quests.Get<QuestDebt>();
522 if (!questDebt3.CanGiveBill())
523 {
524 TempTalkTopic("loytel_bill_give_wait", StepDefault);
525 }
526 else if (questDebt3.gaveBill)
527 {
528 TempTalkTopic("loytel_bill_give_given", StepDefault);
529 }
530 else
531 {
532 TempTalkTopic(questDebt3.GetIdTalk_GiveBill(), StepEnd);
533 questDebt3.GiveBill();
534 }
535 });
536 Step("_greatDebt2");
537 Method(delegate
538 {
539 QuestDebt questDebt2 = EClass.game.quests.Get<QuestDebt>();
540 TempTalkTopic("loytel_bill_give_lost", StepEnd);
541 questDebt2.GiveBill();
542 });
543 Step("_shutup");
544 Method(delegate
545 {
546 c.SetInt(106, (c.GetInt(106) == 0) ? 1 : 0);
547 });
548 _Talk("tg", GetTopic(c, (c.GetInt(106) == 0) ? "shutup" : "shutup2"));
549 End();
550 Step("_sleepBeside");
551 Method(delegate
552 {
553 if (c.affinity.CanSleepBeside())
554 {
555 c.SetInt(123, (c.GetInt(123) == 0) ? 1 : 0);
556 }
557 else
558 {
559 TempTalkTopic("refuse", StepEnd);
560 }
561 });
562 _Talk("tg", GetTopic(c, (c.GetInt(123) == 0) ? "ok" : "shutup"));
563 End();
564 Step("_insult");
565 Method(delegate
566 {
567 c.SetInt(108, (c.GetInt(108) == 0) ? 1 : 0);
568 });
569 _Talk("tg", GetTopic(c, (c.GetInt(108) == 0) ? "insult" : "insult2"));
570 Method(delegate
571 {
572 if (c.GetInt(108) == 1)
573 {
574 c.Talk("insult");
575 }
576 });
577 End();
578 Step("_makeHome");
579 Method(delegate
580 {
582 });
583 _Talk("tg", GetTopic(c, "ok"));
584 End();
585 Step("_hire");
586 Talk("rumor", StepDefault);
587 Choice("daAccept", StepDefault).SetOnClick(delegate
588 {
589 });
590 Choice("daDecline", StepDefault).SetOnClick(delegate
591 {
592 });
593 Step("_invite");
594 Method(delegate
595 {
596 if (!c.trait.CanInvite)
597 {
598 TempTalkTopic("invite2", StepDefault);
599 }
600 else if (c.GetBestAttribute() > EClass.pc.CHA && !EClass.debug.godMode)
601 {
602 GameLang.refDrama1 = c.GetBestAttribute().ToString() ?? "";
603 TempTalkTopic("invite3", StepDefault);
604 }
605 else
606 {
607 TempTalkTopic("invite", null);
608 Choice("yes", delegate
609 {
610 TempTalk("hired", StepEnd);
611 EClass.Sound.Play("good");
612 c.MakeAlly();
613 });
614 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
615 }
616 });
617 Step("_Guide");
618 Method(delegate
619 {
620 TempTalkTopic("guide", null);
621 foreach (Card guide in GetListGuide())
622 {
623 Choice("daGotoGuide".lang(guide.Name, ""), "_goto").SetOnClick(delegate
624 {
625 destCard = guide;
626 });
627 }
628 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
629 TempCancel();
630 });
631 BackChill();
632 Step("_tail");
633 Method(delegate
634 {
635 TempTalkTopic(bird + "1", null);
636 Choice("yes2", delegate
637 {
638 TempTalkTopic(bird + "2", StepEnd);
640 {
641 target = c,
642 sell = true
643 });
644 });
645 Choice("no2", StepDefault, cancel: true).SetOnClick(RumorChill);
646 });
647 Step("_whore");
648 Method(delegate
649 {
650 int costWhore = CalcMoney.Whore(c, EClass.pc);
651 GameLang.refDrama1 = costWhore.ToString() ?? "";
652 TempTalkTopic(bird + "3", null);
653 Choice("yes2", delegate
654 {
655 if (EClass.pc.GetCurrency() < costWhore)
656 {
657 TempTalkTopic("nomoney", StepDefault);
658 }
659 else
660 {
661 SE.Pay();
662 EClass.pc.ModCurrency(-costWhore);
663 TempTalkTopic(bird + "2", StepEnd);
664 EClass.pc.SetAI(new AI_Fuck
665 {
666 target = c
667 });
668 }
669 });
670 Choice("no2", StepDefault, cancel: true).SetOnClick(RumorChill);
671 });
672 Step("_picklock");
673 Method(delegate
674 {
675 int cost8 = CalcMoney.Picklock(EClass.pc, destThing);
676 GameLang.refDrama1 = cost8.ToString() ?? "";
677 TempTalkTopic("bird3", null);
678 Choice("yes2", delegate
679 {
680 if (destThing.c_lockedHard)
681 {
682 TempTalkTopic("lockTooHard", StepDefault);
683 }
684 else if (EClass.pc.GetCurrency() < cost8)
685 {
686 TempTalkTopic("nomoney", StepDefault);
687 }
688 else
689 {
690 SE.Pay();
691 EClass.pc.ModCurrency(-cost8);
692 manager.layer.SetOnKill(delegate
693 {
694 c.PlaySound("lock_open");
695 c.Say("lockpick_success", c, destThing);
696 c.ModExp(280, 200 + destThing.c_lockLv * 20);
697 destThing.c_lockLv = 0;
698 if (destThing.isLostProperty)
699 {
700 EClass.player.ModKarma(-8);
701 }
702 destThing.isLostProperty = false;
703 });
704 TempTalkTopic(destThing.isLostProperty ? "lockpick_purse" : "bird2", StepEnd);
705 }
706 });
707 Choice("no2", StepDefault, cancel: true).SetOnClick(RumorChill);
708 });
709 Step("_buy");
710 Method(delegate
711 {
712 if (c.id == "miral")
713 {
714 SE.Play("click_chat");
715 if (EClass.pc.GetCurrency("medal") > 0)
716 {
717 TempTalkTopic("miral_medal", null);
718 }
719 else
720 {
721 TempTalkTopic("miral_medal2", StepDefault);
722 }
723 }
724 });
725 Method(delegate
726 {
727 if (EClass.player.IsCriminal && !EClass._zone.AllowCriminal && !EClass._zone.IsPCFaction && !c.trait.AllowCriminal)
728 {
729 SE.Play("click_chat");
730 TempTalkTopic("shop_criminal", StepEnd);
731 }
732 else
733 {
734 sequence.Exit();
735 manager.layer.Close();
736 c.trait.OnBarter();
737 if ((bool)WidgetFeed.Instance)
738 {
739 WidgetFeed.Instance.Talk(c, "barter");
740 }
741 layer = EClass.ui.AddLayer(LayerInventory.CreateBuy(c, c.trait.CurrencyType, c.trait.PriceType));
742 }
743 }, () => !layer, StepDefault);
744 Step("_buyPlan");
745 Method(delegate
746 {
747 List<ResearchPlan> plans = new List<ResearchPlan>();
748 foreach (SourceResearch.Row row in EClass.sources.researches.rows)
749 {
751 {
752 plans.Add(ResearchPlan.Create(row.id));
753 }
754 }
755 EClass.ui.AddLayer<LayerList>().ManualList(delegate(UIList list, LayerList l)
756 {
757 list.moldItem = Resources.Load<ItemGeneral>("UI/Element/Item/ItemGeneralBarter").transform;
758 list.callbacks = new UIList.Callback<ResearchPlan, ItemGeneral>
759 {
760 onInstantiate = delegate(ResearchPlan a, ItemGeneral b)
761 {
762 b.button1.mainText.text = a.Name;
763 UIItem uIItem = Util.Instantiate<UIItem>("UI/Element/Item/Extra/costBarter", b.layout);
765 uIItem.text1.SetText(c2.cost.ToString() ?? "", (c2.resource.value >= c2.cost) ? FontColor.Good : FontColor.Bad);
766 uIItem.image1.sprite = c2.resource.Sprite;
767 b.button1.SetTooltip(delegate(UITooltip t)
768 {
769 a.WriteNote(t.note);
770 });
771 b.button1.onClick.AddListener(delegate
772 {
773 if (c2.resource.value < c2.cost)
774 {
775 SE.Beep();
776 }
777 else
778 {
779 c2.resource.Mod(-c2.cost);
780 plans.Remove(a);
782 SE.Pay();
783 list.List(refreshHighlight: true);
784 }
785 });
786 b.RebuildLayout(recursive: true);
787 },
788 onList = delegate
789 {
790 foreach (ResearchPlan item6 in plans)
791 {
792 list.Add(item6);
793 }
794 }
795 };
796 }).SetSize()
797 .windows[0].AttachCurrency().Build(new UICurrency.Options
798 {
799 branchMoney = true
800 });
801 }, () => !layer, StepDefault);
802 Step("_upgradeHearth");
803 Method(delegate
804 {
805 int cost7 = EClass.Branch.GetUpgradeCost();
806 GameLang.refDrama1 = Lang._currency(cost7, "money");
807 GameLang.refDrama2 = (EClass.Branch.lv + 1).ToString() ?? "";
808 GameLang.refDrama3 = "hearth_dialog".lang(EClass.Branch.GetHearthHint(EClass.Branch.lv + 1));
809 TempTalkTopic("upgrade_heath1", null);
810 Choice("yes", delegate
811 {
812 if (EClass.pc.GetCurrency() < cost7)
813 {
814 TempTalkTopic("nomoney", StepDefault);
815 }
816 else
817 {
818 EClass.pc.ModCurrency(-cost7);
819 SE.Pay();
820 LayerDrama.Instance.SetOnKill(delegate
821 {
822 EClass.Branch.Upgrade();
823 });
824 TempTalkTopic("upgrade_heath2", StepEnd);
825 }
826 });
827 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
828 });
829 Step("_sellFame");
830 Method(delegate
831 {
832 int cost6 = EClass.player.fame / 5;
833 GameLang.refDrama1 = cost6.ToString() ?? "";
834 if (cost6 == 0)
835 {
836 TempTalkTopic("goto2", StepDefault);
837 }
838 else
839 {
840 TempTalkTopic("sellFame1", null);
841 Choice("yes", delegate
842 {
843 EClass.pc.ModCurrency(cost6);
844 SE.Pay();
845 EClass.player.ModFame(-cost6);
846 TempTalkTopic("sellFame2", StepDefault);
847 });
848 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
849 }
850 });
851 Step("_investZone");
852 Method(delegate
853 {
854 int cost5 = CalcMoney.InvestZone(EClass.pc);
855 GameLang.refDrama1 = cost5.ToString() ?? "";
856 GameLang.refDrama2 = EClass._zone.investment.ToString() ?? "";
857 TempTalkTopic("invest1", null);
858 Choice("yes", delegate
859 {
860 Invest(quick: false);
861 });
862 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
863 Choice("quickInvest", delegate
864 {
865 Invest(quick: true);
866 });
867 void Invest(bool quick)
868 {
869 if (EClass.pc.GetCurrency() < cost5)
870 {
871 TempTalkTopic("nomoney", StepDefault);
872 }
873 else
874 {
875 EClass.pc.ModCurrency(-cost5);
876 SE.Pay();
877 EClass._zone.investment += cost5;
880 EClass.pc.ModExp(292, 100 + EClass._zone.development * 2);
881 if (quick)
882 {
883 TempGoto("_investZone");
884 }
885 else
886 {
887 TempTalkTopic("invest2", StepDefault);
888 }
889 }
890 }
891 });
892 Step("_investShop");
893 Method(delegate
894 {
895 int cost4 = CalcMoney.InvestShop(EClass.pc, c);
896 GameLang.refDrama1 = cost4.ToString() ?? "";
897 GameLang.refDrama2 = c.trait.ShopLv.ToString() ?? "";
898 TempTalkTopic("invest_shop1", null);
899 Choice("yes", delegate
900 {
901 Invest(quick: false);
902 });
903 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
904 Choice("quickInvest", delegate
905 {
906 Invest(quick: true);
907 });
908 void Invest(bool quick)
909 {
910 if (EClass.pc.GetCurrency() < cost4)
911 {
912 TempTalkTopic("nomoney", StepDefault);
913 }
914 else
915 {
916 EClass.pc.ModCurrency(-cost4);
917 SE.Pay();
918 c.c_invest++;
920 EClass.pc.ModExp(292, 50 + c.c_invest * 20);
921 Guild.Merchant.AddContribution(5 + c.c_invest);
922 if (quick)
923 {
924 TempGoto("_investShop");
925 }
926 else
927 {
928 TempTalkTopic("invest_shop2", StepDefault);
929 }
930 }
931 }
932 });
933 Step("_changeTitle");
934 Method(delegate
935 {
936 EClass.player.title = WordGen.Get("title");
937 GameLang.refDrama1 = EClass.player.title;
938 TempTalk("changeTitle", StepDefault);
939 }, null, StepDefault);
940 Step("_buyLand");
941 Method(delegate
942 {
943 bool num4 = EClass._map.bounds.CanExpand(1);
944 int costLand = CalcGold.ExpandLand();
945 GameLang.refDrama1 = "";
946 GameLang.refDrama2 = costLand.ToString() ?? "";
947 if (!num4)
948 {
949 TempTalkTopic("expand3", StepDefault);
950 }
951 else
952 {
953 TempTalkTopic("expand1", StepDefault);
954 Choice("yes", delegate
955 {
956 if (EClass.pc.GetCurrency("money2") < costLand)
957 {
958 TempTalkTopic("nomoney", StepDefault);
959 }
960 else
961 {
962 SE.Pay();
963 EClass.pc.ModCurrency(-costLand, "money2");
964 TempTalkTopic("expand2", StepDefault);
965 EClass._map.bounds.Expand(1);
966 SE.Play("good");
967 EClass._map.RefreshAllTiles();
968 ScreenEffect.Play("Firework");
969 }
970 });
971 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
972 }
973 });
974 Step("_meeting");
975 Method(delegate
976 {
977 sequence.Exit();
978 manager.layer.Close();
980 });
981 End();
982 Step("_give");
983 Method(delegate
984 {
985 manager.Hide();
986 layer = LayerDragGrid.CreateGive(c);
987 layer.SetOnKill(manager.Show);
988 }, () => !layer, StepDefault);
989 Step("_blessing");
990 Method(delegate
991 {
992 bool flag6 = c.trait is TraitMiko_Mifu;
993 TempTalkTopic("blessing", StepEnd);
995 {
996 foreach (Chara member in EClass.pc.party.members)
997 {
998 if (c.trait is TraitMiko_Mifu)
999 {
1000 member.AddCondition<ConHolyVeil>()?.SetPerfume();
1001 }
1002 else if (c.trait is TraitMiko_Nefu)
1003 {
1004 member.AddCondition<ConEuphoric>()?.SetPerfume();
1005 }
1006 else
1007 {
1008 member.AddCondition<ConNightVision>()?.SetPerfume();
1009 }
1010 member.Say("blessing", member);
1011 member.PlaySound("pray");
1012 member.PlayEffect("holyveil");
1013 }
1014 c.isRestocking = true;
1015 });
1016 c.c_dateStockExpire = EClass.world.date.GetRaw() + (flag6 ? 180 : 180) * 1440;
1017 });
1018 Step("_train");
1019 Method(delegate
1020 {
1021 layer = EClass.ui.AddLayer<LayerList>().ManualList(delegate(UIList list, LayerList l)
1022 {
1023 list.moldItem = Resources.Load<ButtonElement>("UI/Element/Button/ButtonElementTrain").transform;
1024 list.callbacks = new UIList.Callback<Element, ButtonElement>
1025 {
1026 onClick = delegate(Element a, ButtonElement b)
1027 {
1028 int num3 = (EClass.pc.elements.HasBase(a.id) ? CalcPlat.Train(EClass.pc, a) : CalcPlat.Learn(EClass.pc, a));
1029 if (num3 == 0)
1030 {
1031 SE.Beep();
1032 }
1033 else if (EClass.pc.TryPay(num3, "plat"))
1034 {
1035 if (EClass.pc.elements.HasBase(a.id))
1036 {
1038 }
1039 else
1040 {
1042 }
1043 list.Redraw();
1045 }
1046 },
1047 onRedraw = delegate(Element a, ButtonElement b, int i)
1048 {
1049 bool flag5 = EClass.pc.elements.HasBase(a.id);
1050 b.imagePotential.enabled = flag5;
1052 int plat = EClass.pc.GetCurrency("plat");
1053 int cost3 = (EClass.pc.elements.HasBase(a.id) ? CalcPlat.Train(EClass.pc, a) : CalcPlat.Learn(EClass.pc, a));
1054 b.mainText.text = b.mainText.text + " " + (flag5 ? "" : ("notLearned".lang() + " "));
1055 b.subText2.text = ((cost3 == 0) ? "-" : (cost3.ToString() ?? "")).TagColor(() => plat >= cost3 && cost3 != 0);
1056 b.RebuildLayout();
1057 },
1058 onInstantiate = delegate
1059 {
1060 },
1061 onList = delegate
1062 {
1063 foreach (SourceElement.Row item7 in EClass.sources.elements.rows.Where(delegate(SourceElement.Row a)
1064 {
1065 if (a.tag.Contains("unused"))
1066 {
1067 return false;
1068 }
1069 if (a.tag.Contains("guild"))
1070 {
1071 if (a.tag.Contains("fighter") && Guild.Fighter.IsCurrentZone)
1072 {
1073 return true;
1074 }
1075 if (a.tag.Contains("mage") && Guild.Mage.IsCurrentZone)
1076 {
1077 return true;
1078 }
1079 if (a.tag.Contains("thief") && Guild.Thief.IsCurrentZone)
1080 {
1081 return true;
1082 }
1083 if (a.tag.Contains("merchant") && Guild.Merchant.IsCurrentZone)
1084 {
1085 return true;
1086 }
1087 return false;
1088 }
1089 if (isInGuild)
1090 {
1091 return false;
1092 }
1093 return a.category == "skill" && a.categorySub == c.trait.IDTrainer;
1094 }).ToList())
1095 {
1096 list.Add(Element.Create(item7.id));
1097 }
1098 }
1099 };
1100 }).SetSize()
1101 .SetTitles("wTrain")
1102 .SetOnKill(SE.PopDrama);
1103 layer.windows[0].AttachCurrency().Build(new UICurrency.Options
1104 {
1105 plat = true
1106 });
1107 }, () => !layer, StepDefault);
1108 Step("_changeDomain");
1109 Method(delegate
1110 {
1111 layer = EClass.player.SelectDomain(SE.PopDrama);
1112 }, () => !layer, StepDefault);
1113 Step("_revive");
1114 Method(delegate
1115 {
1116 layer = EClass.ui.AddLayer(LayerPeople.Create<ListPeopleRevive>("h_revive"));
1117 layer.SetOnKill(SE.PopDrama);
1118 layer.windows[0].AttachCurrency().Build(new UICurrency.Options
1119 {
1120 money = true
1121 });
1122 }, () => !layer, StepDefault);
1123 Step("_buySlave");
1124 Method(delegate
1125 {
1126 LayerPeople.slaveToBuy = null;
1127 layer = EClass.ui.AddLayer(LayerPeople.Create<ListPeopleBuySlave>("h_invBuy", c));
1128 layer.SetOnKill(SE.PopDrama);
1129 layer.windows[0].AttachCurrency().Build(new UICurrency.Options
1130 {
1131 money = true
1132 });
1133 manager.Load();
1134 }, () => !layer, "_buySlaveConfirm");
1135 Step("_buySlaveConfirm");
1136 Method(delegate
1137 {
1139 if (tc == null)
1140 {
1141 RumorChill();
1142 }
1143 else
1144 {
1145 int cost2 = CalcMoney.BuySlave(tc);
1146 GameLang.refDrama1 = cost2.ToString() ?? "";
1147 GameLang.refDrama2 = tc.Name;
1148 TempTalkTopic("slave_buy", null);
1149 Choice("yes", delegate
1150 {
1151 if (!EClass.pc.TryPay(cost2))
1152 {
1153 TempTalkTopic("nomoney", StepDefault);
1154 }
1155 else
1156 {
1157 GameLang.refDrama1 = tc.Name;
1158 EClass._zone.AddCard(tc, EClass.pc.pos.GetNearestPoint());
1159 tc.MakeAlly();
1160 c.GetObj<SlaverData>(5).list.Remove(tc);
1161 TempTalkTopic("slave_buy2", StepEnd);
1162 }
1163 }).DisableSound();
1164 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
1165 }
1166 });
1167 Goto(StepDefault);
1168 Step("_trade");
1169 Method(delegate
1170 {
1171 layer = EClass.ui.AddLayer(LayerInventory.CreateContainer(c));
1172 }, () => !layer, StepDefault);
1173 Step("_identify");
1174 Method(delegate
1175 {
1176 manager.Hide();
1177 c.trait.OnBarter();
1178 layer = LayerDragGrid.CreateIdentify(EClass.pc, superior: false, BlessedState.Normal, CalcMoney.Identify(EClass.pc, superior: false), -1);
1179 layer.SetOnKill(manager.Show);
1180 }, () => !layer, StepDefault);
1181 Step("_identifyAll");
1182 Method(delegate
1183 {
1184 int costIdentify = 0;
1185 int numIdentify = 0;
1186 int numSuperior = 0;
1187 EClass.pc.things.Foreach(delegate(Thing t)
1188 {
1189 if (!t.IsIdentified && t.c_IDTState != 1)
1190 {
1191 numIdentify++;
1192 costIdentify += CalcMoney.Identify(EClass.pc, superior: false);
1193 }
1194 });
1195 GameLang.refDrama1 = costIdentify.ToString() ?? "";
1196 GameLang.refDrama2 = numIdentify.ToString() ?? "";
1197 if (numIdentify == 0)
1198 {
1199 TempTalkTopic("appraise3", StepDefault);
1200 }
1201 else
1202 {
1203 TempTalkTopic("appraise1", StepDefault);
1204 Choice("yes", delegate
1205 {
1206 if (EClass.pc.GetCurrency() < costIdentify)
1207 {
1208 TempTalkTopic("nomoney", StepDefault);
1209 }
1210 else
1211 {
1212 SE.Pay();
1213 EClass.pc.ModCurrency(-costIdentify);
1214 foreach (Thing item8 in EClass.pc.things.List((Thing t) => !t.IsIdentified, onlyAccessible: true))
1215 {
1216 item8.Thing.Identify(show: false);
1217 if (!item8.IsInstalled)
1218 {
1219 numSuperior++;
1220 }
1221 }
1222 TempTalkTopic("appraise2", StepDefault);
1223 }
1224 });
1225 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
1226 }
1227 });
1228 Step("_identifySP");
1229 Method(delegate
1230 {
1231 manager.Hide();
1232 c.trait.OnBarter();
1233 layer = LayerDragGrid.CreateIdentify(EClass.pc, superior: true, BlessedState.Normal, CalcMoney.Identify(EClass.pc, superior: true), -1);
1234 layer.SetOnKill(manager.Show);
1235 }, () => !layer, StepDefault);
1236 Step("_bout");
1237 Method(delegate
1238 {
1239 TempTalkTopic("bout1", StepDefault);
1240 Choice("yes", delegate
1241 {
1243 {
1244 uidTarget = c.uid,
1245 targetX = c.pos.x,
1246 targetZ = c.pos.z
1247 });
1248 c.SetGlobal();
1250 {
1251 target = c
1252 });
1253 c.SetInt(59, EClass.world.date.GetRaw());
1255 {
1256 EClass.pc.MoveZone(z, ZoneTransition.EnterState.Center);
1257 });
1258 TempTalkTopic("bout2", StepEnd);
1259 });
1260 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
1261 }, null, StepDefault);
1262 Step("_news");
1263 Method(delegate
1264 {
1266 if (zone == null)
1267 {
1268 TempTalkTopic("news2", null);
1269 }
1270 else
1271 {
1272 zone.isKnown = true;
1273 Msg.Say("discoverZone", zone.Name);
1274 GameLang.refDrama1 = zone.Name;
1275 TempTalkTopic("news1", null);
1276 }
1277 c.SetInt(33, EClass.world.date.GetRaw());
1278 });
1279 Method(delegate
1280 {
1281 manager.Load();
1282 }, null, StepDefault);
1283 Step("_heal");
1284 Method(delegate
1285 {
1286 int costHeal = CalcMoney.Heal(EClass.pc);
1287 GameLang.refDrama1 = costHeal.ToString() ?? "";
1288 TempTalkTopic("healer1", null);
1289 Choice("yes", delegate
1290 {
1291 if (EClass.pc.GetCurrency() < costHeal)
1292 {
1293 TempTalkTopic("nomoney", StepDefault);
1294 }
1295 else
1296 {
1297 SE.Pay();
1298 foreach (Chara member2 in EClass.pc.party.members)
1299 {
1300 ActEffect.Proc(EffectId.HealComplete, member2);
1301 }
1302 EClass.pc.ModCurrency(-costHeal);
1303 TempTalkTopic("healer2", StepEnd);
1304 }
1305 });
1306 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
1307 });
1308 Step("_food");
1309 Method(delegate
1310 {
1311 int cost = CalcMoney.Meal(EClass.pc);
1312 GameLang.refDrama1 = cost.ToString() ?? "";
1313 TempTalkTopic("food1", null);
1314 Choice("yes", delegate
1315 {
1316 if (EClass.pc.hunger.GetPhase() <= 0)
1317 {
1318 TempTalkTopic("alreadyFull", StepDefault);
1319 }
1320 else if (EClass.pc.GetCurrency() < cost)
1321 {
1322 TempTalkTopic("nomoney", StepDefault);
1323 }
1324 else
1325 {
1326 SE.Pay();
1327 EClass.pc.ModCurrency(-cost);
1328 TempTalkTopic("food2", StepDefault);
1329 FoodEffect.Proc(EClass.pc, ThingGen.Create("dish_lunch"));
1330 EClass.pc.hunger.value = 0;
1331 }
1332 });
1333 Choice("no", StepDefault, cancel: true).SetOnClick(RumorChill);
1334 });
1335 int[] bankTier = new int[5] { 100, 1000, 10000, 100000, 1000000 };
1336 Step("_deposit");
1337 Method(delegate
1338 {
1339 sequence.Exit();
1340 manager.layer.Close();
1341 if ((bool)WidgetFeed.Instance)
1342 {
1343 WidgetFeed.Instance.Talk(c, "barter");
1344 }
1345 SE.Play("shop_open");
1347 }, () => !layer, StepDefault);
1348 End();
1349 Step("_copyItem");
1350 Method(delegate
1351 {
1352 sequence.Exit();
1353 manager.layer.Close();
1354 if ((bool)WidgetFeed.Instance)
1355 {
1356 WidgetFeed.Instance.Talk(c, "barter");
1357 }
1358 SE.Play("shop_open");
1359 c.trait.OnBarter();
1360 if (c.c_copyContainer == null)
1361 {
1362 c.c_copyContainer = ThingGen.Create("container_deposit");
1363 }
1364 int numCopyItem = c.trait.NumCopyItem;
1365 c.c_copyContainer.things.SetSize(numCopyItem, 1);
1366 layer = LayerInventory.CreateContainer<InvOwnerCopyShop>(c, c.c_copyContainer);
1367 }, () => !layer, StepDefault);
1368 End();
1369 int[] taxTier = new int[6] { 0, 1000, 2000, 5000, 10000, 20000 };
1370 Step("_extraTax");
1371 Method(delegate
1372 {
1373 GameLang.refDrama1 = Lang._currency(EClass.player.extraTax, "money");
1374 TempTalkTopic("extraTax", null);
1375 int[] array2 = taxTier;
1376 foreach (int num2 in array2)
1377 {
1378 int _i2 = num2;
1379 Choice(Lang._currency(_i2, showUnit: true), delegate
1380 {
1381 EClass.player.extraTax = _i2;
1382 GameLang.refDrama1 = Lang._currency(_i2, "money");
1383 TempTalkTopic("extraTax2", StepDefault);
1384 });
1385 }
1386 Choice("no2", StepDefault, cancel: true).SetOnClick(RumorChill);
1387 });
1388 Step("_withdraw");
1389 Method(delegate
1390 {
1391 int bankMoney = EClass.player.bankMoney;
1392 GameLang.refDrama1 = bankMoney.ToString() ?? "";
1393 TempTalkTopic("banker2", null);
1394 int[] array = bankTier;
1395 foreach (int num in array)
1396 {
1397 int _i = num;
1398 if (EClass.player.bankMoney >= _i)
1399 {
1400 Choice(Lang._currency(_i, showUnit: true), delegate
1401 {
1402 SE.Pay();
1403 EClass.pc.ModCurrency(_i);
1404 EClass.player.bankMoney -= _i;
1405 TempTalkTopic("banker4", StepDefault);
1406 });
1407 }
1408 }
1409 Choice("no2", StepDefault, cancel: true).SetOnClick(RumorChill);
1410 });
1411 Step("_disableMove");
1412 Method(delegate
1413 {
1414 c.noMove = true;
1415 c.orgPos = new Point(c.pos);
1416 c.Talk("ok");
1417 });
1418 End();
1419 Step("_enableMove");
1420 Method(delegate
1421 {
1422 c.noMove = false;
1423 c.orgPos = null;
1424 c.Talk("thanks");
1425 });
1426 End();
1427 Step("_bye");
1428 Method(delegate
1429 {
1430 c.Talk("bye");
1431 });
1432 End();
1433 void BackChill()
1434 {
1435 Method(RumorChill, null, StepDefault);
1436 }
1437 string GetTalk(string id)
1438 {
1439 return c.GetTalkText(id);
1440 }
1441 void RumorChill()
1442 {
1443 rumor = GetTalk("chill");
1444 }
1445 void Talk(string idTalk, string idJump)
1446 {
1447 _Talk("tg", GetTalk(idTalk), idJump);
1448 }
1449 void TempCancel()
1450 {
1451 EnableCancel("back");
1452 }
1453 void TempTalk(string idTalk, string idJump)
1454 {
1455 _TempTalk("tg", GetTalk(idTalk), idJump);
1456 }
1457 void TempTalkTopic(string idTopc, string idJump)
1458 {
1459 _TempTalk("tg", GetTopic(c, idTopc), idJump);
1460 }
1461 bool taken()
1462 {
1463 if (c.quest != null)
1464 {
1465 return EClass.game.quests.list.Contains(c.quest);
1466 }
1467 return false;
1468 }
1469 }
1470
1471 public string GetRumor(Chara c)
1472 {
1473 if (c.interest <= 0)
1474 {
1475 return GetText(c, "rumor", "bored");
1476 }
1477 if (HasTopic("unique", c.id))
1478 {
1479 manager.enableTone = false;
1480 return GetText(c, "unique", c.id);
1481 }
1482 if (EClass.rnd(2) == 0 && !c.trait.IDRumor.IsEmpty())
1483 {
1484 return GetText(c, "rumor", c.trait.IDRumor);
1485 }
1486 if (EClass.rnd(2) == 0 && HasTopic("zone", EClass._zone.id))
1487 {
1488 return GetText(c, "zone", EClass._zone.id);
1489 }
1490 if (EClass.rnd(2) == 0)
1491 {
1492 return GetText(c, "rumor", "interest_" + c.bio.idInterest.ToEnum<Interest>());
1493 }
1494 if (EClass.rnd(2) == 0)
1495 {
1496 return c.GetTalkText("rumor");
1497 }
1498 if (EClass.rnd(4) == 0)
1499 {
1500 return GetText(c, "rumor", "hint");
1501 }
1502 return GetText(c, "rumor", "default");
1503 }
1504
1505 public bool HasTopic(string idSheet, string idTopic)
1506 {
1507 string path = CorePath.CorePackage.TextDialog + "dialog.xlsx";
1508 if (!File.Exists(path))
1509 {
1510 return false;
1511 }
1512 ExcelData excelData = new ExcelData();
1513 excelData.path = path;
1514 excelData.BuildMap(idSheet);
1515 return excelData.sheets[idSheet].map.ContainsKey(idTopic);
1516 }
1517
1518 public string GetText(Chara c, string idSheet, string idTopic)
1519 {
1520 if (!idTopic.IsEmpty() && manager.customTalkTopics.ContainsKey(idTopic))
1521 {
1522 return manager.customTalkTopics[idTopic];
1523 }
1524 string[] dialog = Lang.GetDialog(idSheet, idTopic);
1525 if (!manager.enableTone && !(idSheet == "general"))
1526 {
1527 return dialog.RandomItem();
1528 }
1529 return c.ApplyTone(dialog.RandomItem());
1530 }
1531
1532 public string GetTopic(Chara c, string idTopic = null)
1533 {
1534 return GetText(c, "general", idTopic);
1535 }
1536
1537 public void BuildTextData()
1538 {
1539 Step("import");
1540 string[] array = setup.textData.Split(new string[1] { Environment.NewLine + Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
1541 foreach (string text in array)
1542 {
1543 if (!(text == Environment.NewLine))
1544 {
1545 _Talk("", text.TrimStart(Environment.NewLine.ToCharArray()).TrimEnd(Environment.NewLine.ToCharArray()));
1546 }
1547 }
1548 End();
1549 }
1550
1552 {
1553 events.Add(e);
1554 e.sequence = sequence;
1555 return e;
1556 }
1557
1558 public void Step(string step)
1559 {
1560 Event(new DramaEvent
1561 {
1562 step = step
1563 });
1564 }
1565
1566 public void Method(Action action, Func<bool> endFunc = null, string idJump = null)
1567 {
1568 Event(new DramaEventMethod(action)
1569 {
1570 endFunc = endFunc
1571 });
1572 if (!idJump.IsEmpty())
1573 {
1574 Event(new DramaEventGoto(idJump));
1575 }
1576 }
1577
1578 public void End()
1579 {
1580 Event(new DramaEventGoto("end"));
1581 }
1582
1583 public void Goto(string idJump)
1584 {
1585 Event(new DramaEventGoto(idJump));
1586 }
1587
1588 public void GotoDefault()
1589 {
1590 Event(new DramaEventGoto(StepDefault));
1591 }
1592
1593 public void _Talk(string idActor, string text, string idJump = null)
1594 {
1595 manager.lastTalk = Event(new DramaEventTalk
1596 {
1597 idActor = idActor,
1598 idJump = idJump,
1599 text = text
1600 }) as DramaEventTalk;
1601 }
1602
1603 public void _Talk(string idActor, Func<string> funcText, string idJump = null)
1604 {
1605 manager.lastTalk = Event(new DramaEventTalk
1606 {
1607 idActor = idActor,
1608 idJump = idJump,
1609 funcText = funcText
1610 }) as DramaEventTalk;
1611 }
1612
1613 public void _TempTalk(string idActor, string text, string idJump = null)
1614 {
1615 manager.lastTalk = Event(new DramaEventTalk
1616 {
1617 idActor = idActor,
1618 idJump = idJump,
1619 text = text,
1620 temp = true
1621 }) as DramaEventTalk;
1622 sequence.tempEvents.Add(manager.lastTalk);
1623 }
1624
1625 public void TempGoto(string idJump = null)
1626 {
1627 sequence.tempEvents.Clear();
1628 sequence.Play(idJump);
1629 }
1630
1631 public DramaChoice Choice(string lang, string idJump, bool cancel = false)
1632 {
1633 DramaChoice dramaChoice = new DramaChoice(lang.lang(), idJump);
1634 manager.lastTalk.AddChoice(dramaChoice);
1635 if (cancel)
1636 {
1637 EnableCancel(idJump);
1638 }
1639 return dramaChoice;
1640 }
1641
1642 public DramaChoice Choice(string lang, Action onJump)
1643 {
1644 DramaChoice dramaChoice = new DramaChoice(lang.lang(), null);
1645 dramaChoice.onJump = onJump;
1646 manager.lastTalk.AddChoice(dramaChoice);
1647 return dramaChoice;
1648 }
1649
1650 public DramaChoice Choice2(string lang, string idJump)
1651 {
1652 DramaChoice dramaChoice = new DramaChoice(lang.lang(), idJump);
1653 manager.lastTalk.AddChoice(dramaChoice);
1654 sequence.manager._choices.Add(dramaChoice);
1655 return dramaChoice;
1656 }
1657
1658 public void EnableCancel(string idCancelJump = null)
1659 {
1660 manager.lastTalk.canCancel = true;
1661 manager.lastTalk.idCancelJump = idCancelJump;
1662 }
1663
1664 public List<Card> GetListGuide()
1665 {
1666 List<Card> list = new List<Card>();
1667 foreach (Thing thing in EClass._map.things)
1668 {
1669 if (thing.IsInstalled && thing.trait.GuidePriotiy > 0)
1670 {
1671 list.Add(thing);
1672 }
1673 }
1674 foreach (Chara chara in EClass._map.charas)
1675 {
1676 if (!chara.IsPCParty && chara.trait.GuidePriotiy > 0)
1677 {
1678 list.Add(chara);
1679 }
1680 }
1681 list.Sort((Card a, Card b) => b.trait.GuidePriotiy - a.trait.GuidePriotiy);
1682 return list;
1683 }
1684}
BlessedState
Definition: BlessedState.cs:2
BossType
Definition: BossType.cs:2
FactionMemberType
FontColor
Definition: FontColor.cs:2
Interest
Definition: Interest.cs:2
NameStyle
Definition: NameStyle.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool CanInvite()
Definition: Affinity.cs:54
void OnTalkRumor()
Definition: Affinity.cs:140
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
int idInterest
Definition: Biography.cs:245
bool IsUnderAge
Definition: Biography.cs:278
void SetElement(Element _e, ElementContainer _owner, Mode _mode=Mode.Skill)
static int ExpandLand()
Definition: CalcGold.cs:3
static int Picklock(Chara c, Thing t)
Definition: CalcMoney.cs:25
static int Heal(Chara c)
Definition: CalcMoney.cs:20
static int InvestZone(Chara c)
Definition: CalcMoney.cs:67
static int Identify(Chara c, bool superior)
Definition: CalcMoney.cs:30
static int BuySlave(Chara c)
Definition: CalcMoney.cs:40
static int InvestShop(Chara c, Chara tc)
Definition: CalcMoney.cs:62
static int Whore(Chara seller, Chara buyer)
Definition: CalcMoney.cs:50
static int Meal(Chara c)
Definition: CalcMoney.cs:15
static int Learn(Chara c, Element e)
Definition: CalcPlat.cs:5
static int Train(Chara c, Element _e)
Definition: CalcPlat.cs:15
Thing container_deposit
Definition: CardManager.cs:58
Definition: Card.cs:11
ElementContainerCard elements
Definition: Card.cs:37
string id
Definition: Card.cs:31
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214
bool c_lockedHard
Definition: Card.cs:996
bool isLostProperty
Definition: Card.cs:778
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
int c_lockLv
Definition: Card.cs:924
Biography bio
Definition: Card.cs:40
string Name
Definition: Card.cs:2013
int CHA
Definition: Card.cs:2207
int GetCurrency(string id="money")
Definition: Card.cs:3652
int c_IDTState
Definition: Card.cs:1193
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
Definition: Card.cs:6073
Point pos
Definition: Card.cs:55
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5438
Trait trait
Definition: Card.cs:49
void ModCurrency(int a, string id="money")
Definition: Card.cs:3638
bool TryPay(int a, string id="money")
Definition: Card.cs:3602
void Destroy()
Definition: Card.cs:4538
ThingContainer things
Definition: Card.cs:34
bool IsInstalled
Definition: Card.cs:2241
virtual bool isChara
Definition: Card.cs:1959
void ModExp(string alias, int a)
Definition: Card.cs:2508
bool IsIdentified
Definition: Card.cs:2237
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6092
Definition: Chara.cs:10
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7274
override bool IsAliveInCurrentZone
Definition: Chara.cs:546
new TraitChara trait
Definition: Chara.cs:488
override bool IsGlobal
Definition: Chara.cs:595
override bool IsPCParty
Definition: Chara.cs:600
Party party
Definition: Chara.cs:43
int interest
Definition: Chara.cs:302
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
Stats hunger
Definition: Chara.cs:951
override bool IsPCFaction
Definition: Chara.cs:656
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8077
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8136
SourceThing.Row GetFavFood()
Definition: Chara.cs:7254
Affinity affinity
Definition: Chara.cs:299
void MoveZone(string alias)
Definition: Chara.cs:3010
bool godMode
Definition: CoreDebug.cs:172
bool showFav
Definition: CoreDebug.cs:225
bool enable
Definition: CoreDebug.cs:285
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
bool IsExpired(int time)
Definition: Date.cs:332
DramaChoice SetCondition(Func< bool > condition)
Definition: DramaChoice.cs:62
DramaChoice DisableSound()
Definition: DramaChoice.cs:44
DramaChoice SetOnClick(Action action)
Definition: DramaChoice.cs:56
void _TempTalk(string idActor, string text, string idJump=null)
void Method(Action action, Func< bool > endFunc=null, string idJump=null)
void EnableCancel(string idCancelJump=null)
DramaChoice Choice(string lang, Action onJump)
void Goto(string idJump)
void _Talk(string idActor, string text, string idJump=null)
DramaChoice Choice2(string lang, string idJump)
List< DramaEvent > events
DramaEvent Event(DramaEvent e)
string GetTopic(Chara c, string idTopic=null)
void _Talk(string idActor, Func< string > funcText, string idJump=null)
bool HasTopic(string idSheet, string idTopic)
DramaChoice Choice(string lang, string idJump, bool cancel=false)
void TempGoto(string idJump=null)
string GetText(Chara c, string idSheet, string idTopic)
void Step(string step)
void AddChoice(DramaChoice choice)
LayerDrama layer
Definition: DramaManager.cs:13
DramaSequence Load()
List< DramaChoice > _choices
Definition: DramaManager.cs:49
Dictionary< string, string > customTalkTopics
Definition: DramaManager.cs:51
DramaEventTalk lastTalk
Definition: DramaManager.cs:61
void Play(string id)
DramaManager manager
List< DramaEvent > tempEvents
string textData
Definition: DramaSetup.cs:11
string forceJump
Definition: DramaSetup.cs:13
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static int rnd(int a)
Definition: EClass.cs:50
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static FactionBranch Branch
Definition: EClass.cs:22
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static FactionBranch BranchOrHomeBranch
Definition: EClass.cs:24
static CoreDebug debug
Definition: EClass.cs:48
static UI ui
Definition: EClass.cs:16
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
void Train(int ele, int a=10)
void Learn(int ele, int v=1)
bool HasBase(int ele)
Element GetElement(string alias)
int id
Definition: ELEMENT.cs:240
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:913
Dictionary< string, Sheet > sheets
Definition: ExcelData.cs:25
virtual void BuildMap(string sheetName="_default")
Definition: ExcelData.cs:77
MeetingManager meetings
ResearchManager researches
string GetHearthHint(int a)
HomeResourceManager resources
void AddMemeber(Chara c)
void AddContribution(int a)
Definition: FACTION.cs:316
FactionRelation relation
Definition: FACTION.cs:124
static string refDrama1
Definition: GameLang.cs:6
static string refDrama2
Definition: GameLang.cs:8
static string refDrama3
Definition: GameLang.cs:10
CardManager cards
Definition: Game.cs:155
Zone activeZone
Definition: Game.cs:245
QuestManager quests
Definition: Game.cs:179
override bool IsCurrentZone
Definition: GuildFighter.cs:6
override bool IsCurrentZone
Definition: GuildMage.cs:6
override bool IsCurrentZone
Definition: GuildMerchant.cs:5
override bool IsCurrentZone
Definition: GuildThief.cs:6
Definition: Guild.cs:2
static GuildMerchant Merchant
Definition: Guild.cs:29
static GuildMage Mage
Definition: Guild.cs:25
static GuildFighter Fighter
Definition: Guild.cs:23
static GuildThief Thief
Definition: Guild.cs:27
static Guild GetCurrentGuild()
Definition: Guild.cs:41
Definition: Hobby.cs:4
string Name
Definition: Hobby.cs:9
LayoutGroup layout
Definition: ItemGeneral.cs:13
Definition: Lang.cs:6
static string[] GetDialog(string idSheet, string idTopic)
Definition: Lang.cs:205
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
static LayerDragGrid CreateGive(Chara c)
static LayerDragGrid CreateIdentify(Chara cc, bool superior=false, BlessedState state=BlessedState.Normal, int price=0, int count=1)
static LayerDrama Instance
Definition: LayerDrama.cs:20
static LayerInventory CreateContainer(Card owner)
static LayerInventory CreateBuy(Card c, CurrencyType currency=CurrencyType.Money, PriceType price=PriceType.Default)
static LayerPeople Create(Mode mode)
Definition: LayerPeople.cs:94
static Chara slaveToBuy
Definition: LayerPeople.cs:22
Definition: Layer.cs:9
Layer SetTitles(string langList, string idHeaderRow=null)
Definition: Layer.cs:688
List< Window > windows
Definition: Layer.cs:116
virtual void Close()
Definition: Layer.cs:463
Layer SetOnKill(Action action)
Definition: Layer.cs:579
bool CanExpand(int a)
Definition: MapBounds.cs:138
List< Thing > things
Definition: Map.cs:49
List< Chara > charas
Definition: Map.cs:81
MapBounds bounds
Definition: Map.cs:52
List< Meeting > list
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
void RemoveMember(Chara c)
Definition: Party.cs:84
List< Chara > members
Definition: Party.cs:18
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
static PathManager Instance
Definition: PathManager.cs:16
bool IsCriminal
Definition: Player.cs:1138
Layer SelectDomain(Action onKill=null)
Definition: Player.cs:1342
void ModFame(int a)
Definition: Player.cs:1879
void ModKarma(int a)
Definition: Player.cs:2289
int extraTax
Definition: Player.cs:739
string title
Definition: Player.cs:805
int bankMoney
Definition: Player.cs:721
Definition: Point.cs:9
bool CanGiveBill()
Definition: QuestDebt.cs:42
string GetIdTalk_GiveBill()
Definition: QuestDebt.cs:95
bool gaveBill
Definition: QuestDebt.cs:6
void GiveBill()
Definition: QuestDebt.cs:58
List< Thing > ListDestThing(bool onlyFirst=false)
List< Quest > list
Definition: QuestManager.cs:11
int CountRandomQuest()
Quest Start(string id, string idGlobalChara)
Definition: QuestManager.cs:41
Quest Get(string id)
Definition: Quest.cs:7
virtual bool IsRandomQuest
Definition: Quest.cs:237
virtual string GetTalkComplete()
Definition: Quest.cs:680
int bonusMoney
Definition: Quest.cs:55
Chara chara
Definition: Quest.cs:105
virtual string GetTitle()
Definition: Quest.cs:608
virtual string NameDeliver
Definition: Quest.cs:239
virtual bool Deliver(Chara c, Thing t=null)
Definition: Quest.cs:706
Zone CreateRandomSite(Zone center, int radius=8, string idSource=null, bool updateMesh=true, int lv=0)
Definition: Region.cs:104
void AddPlan(string id)
bool IsListBarter(string idPlan)
void WriteNote(UINote n)
Definition: ResearchPlan.cs:54
static ResearchPlan Create(string id)
SourceResearch.Row source
Definition: ResearchPlan.cs:23
SourceResearch researches
SourceElement elements
static Zone CreateInstance(string id, ZoneInstance instance)
Definition: SpatialGen.cs:39
int investment
Definition: Spatial.cs:226
virtual string Name
Definition: Spatial.cs:495
SourceZone.Row source
Definition: Spatial.cs:441
string id
Definition: Spatial.cs:13
int development
Definition: Spatial.cs:238
override int GetPhase()
Definition: Stats.cs:117
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
Definition: Thing.cs:8
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Thing.cs:837
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:494
virtual string IDRumor
Definition: TraitChara.cs:135
virtual bool IsUnique
Definition: TraitChara.cs:33
virtual int GuidePriotiy
Definition: Trait.cs:94
void SetTooltip(Action< UITooltip > onShowTooltip=null, bool enable=true)
Definition: UIButton.cs:361
static void TryShowTip(Transform root=null, bool highlight=true, bool ignoreWhenRightClick=true)
Definition: UIButton.cs:778
Definition: UIItem.cs:5
UIButton button1
Definition: UIItem.cs:18
UIText text1
Definition: UIItem.cs:6
Definition: UIList.cs:9
override void Add(object item)
Definition: UIList.cs:302
void Sort()
Definition: UIList.cs:697
override void Redraw()
Definition: UIList.cs:740
override void List()
Definition: UIList.cs:717
void SetText(string s)
Definition: UIText.cs:159
UINote note
Definition: UITooltip.cs:21
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
static WidgetFeed Instance
Definition: WidgetFeed.cs:14
Region region
Definition: World.cs:23
GameDate date
Definition: World.cs:6
void AddPreEnter(ZonePreEnterEvent e, bool executeIfActiveZone=true)
Definition: Zone.cs:12
Dictionary< int, string > dictCitizen
Definition: Zone.cs:49
ZoneEventManager events
Definition: Zone.cs:40
FactionBranch branch
Definition: Zone.cs:34
virtual bool IsUserZone
Definition: Zone.cs:264
bool IsInstance
Definition: Zone.cs:480
virtual bool AllowInvest
Definition: Zone.cs:245
Chara FindChara(string id)
Definition: Zone.cs:2805
virtual bool AllowCriminal
Definition: Zone.cs:242
void ModInfluence(int a)
Definition: Zone.cs:3301
bool IsPCFaction
Definition: Zone.cs:464
void ModDevelopment(int a)
Definition: Zone.cs:3311