Elin Decompiled Documentation EA 23.355 Stable
Loading...
Searching...
No Matches
FactionBranch.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Newtonsoft.Json;
5using UnityEngine;
6
7public class FactionBranch : EClass
8{
9 public class Statistics : EClass
10 {
11 [JsonProperty]
12 public int inn;
13
14 [JsonProperty]
15 public int tourism;
16
17 [JsonProperty]
18 public int shop;
19
20 [JsonProperty]
21 public int numSold;
22
23 [JsonProperty]
24 public int visitor;
25
26 [JsonProperty]
27 public int tax;
28
29 [JsonProperty]
30 public long ship;
31 }
32
33 [JsonProperty]
34 public int lv = 1;
35
36 [JsonProperty]
37 public int rank;
38
39 [JsonProperty]
40 public int exp;
41
42 [JsonProperty]
43 public int seedPlan;
44
45 [JsonProperty]
46 public int temper;
47
48 [JsonProperty]
49 public int uidMaid;
50
51 [JsonProperty]
53
54 [JsonProperty]
55 public int incomeShop;
56
57 [JsonProperty]
58 public bool luckyMonth;
59
60 [JsonProperty]
61 public bool luckyMonthDone;
62
63 [JsonProperty]
65 {
66 value = 1
67 };
68
69 [JsonProperty]
71
72 [JsonProperty]
74
75 [JsonProperty]
77
78 [JsonProperty]
80
81 [JsonProperty]
83
84 [JsonProperty]
85 public Thing stash;
86
87 [JsonProperty]
88 public MsgLog log = new MsgLog
89 {
90 id = "log"
91 };
92
93 [JsonProperty]
95
96 [JsonProperty]
98
99 [JsonProperty]
100 public List<HireInfo> listRecruit = new List<HireInfo>();
101
102 [JsonProperty]
103 public int dateFound;
104
105 [JsonProperty]
106 public int tourism;
107
108 [JsonProperty]
110
111 [JsonProperty]
113
114 public Zone owner;
115
116 public int incomeInn;
117
118 public int incomeTourism;
119
120 public int efficiency = 100;
121
122 public List<Chara> members = new List<Chara>();
123
124 public int Money => resources.money.value;
125
126 public int Worth => resources.worth.value;
127
128 public int NumHeirloom => 4 + Evalue(2120);
129
130 public int MaxAP => 4 + Evalue(2115) + Evalue(3900) * 5 + Evalue(3709) * lv;
131
132 public int MaxPopulation => 5 + Evalue(2204);
133
134 public int MaxSoil => ((int)(Mathf.Sqrt(EClass._map.bounds.Width * EClass._map.bounds.Height) * 3f) + Evalue(2200) * 5) * (100 + Evalue(3700) * 25) / 100;
135
136 public int ContentLV => Mathf.Max(1, lv * 4 + EClass.scene.elomap.GetRoadDist(EClass._zone.x, EClass._zone.y) - 4 + (int)Mathf.Sqrt(Evalue(2706)) * 4);
137
138 public int DangerLV => Mathf.Max(1, ContentLV - (int)Mathf.Sqrt(Evalue(2704)) * 2);
139
140 public bool HasItemProtection => lv >= 3;
141
142 public bool HasNetwork => lv >= 5;
143
144 public bool IsTaxFree => policies.IsActive(2514);
145
146 public string RankText => (0.01f * (float)exp + (float)rank).ToString("F2");
147
148 public string TextLv => lv + " (" + (100f * (float)exp / (float)GetNextExp()).ToString("F1") + ")";
149
150 public bool IsStartBranch => owner.id == "startSite";
151
153
154 public int MaxLv => 7;
155
156 public int GetNextExp(int _lv = -1)
157 {
158 if (_lv == -1)
159 {
160 _lv = lv;
161 }
162 return _lv * _lv * 100 + 100;
163 }
164
165 public int Evalue(int ele)
166 {
168 if (row.category == "policy")
169 {
170 return policies.GetValue(ele);
171 }
172 if (HasNetwork && row.tag.Contains("network"))
173 {
174 return EClass.pc.faction.elements.Value(ele) + elements.Value(ele);
175 }
176 return elements.Value(ele);
177 }
178
179 public int GetProductBonus(Chara c)
180 {
181 if (c.isDead || c.IsPCParty)
182 {
183 return 0;
184 }
185 if (c.memberType == FactionMemberType.Livestock)
186 {
187 return 100;
188 }
189 return Mathf.Max(1, (90 + Evalue(2116) / 2) * efficiency / 100);
190 }
191
192 public void RefreshEfficiency()
193 {
194 int num = 100;
195 int num2 = CountMembers(FactionMemberType.Default);
196 int ration = 0;
197 foreach (Chara member in members)
198 {
199 if (member.memberType != FactionMemberType.Default || member.IsPCParty || member.homeBranch == null || member.homeBranch.owner == null)
200 {
201 continue;
202 }
203 foreach (Hobby item in member.ListHobbies())
204 {
205 TryAdd(item);
206 }
207 foreach (Hobby item2 in member.ListWorks())
208 {
209 TryAdd(item2);
210 }
211 }
212 if (num2 > MaxPopulation)
213 {
214 num -= (num2 - MaxPopulation) * 20 * 100 / (100 + 20 * (int)Mathf.Sqrt(ration));
215 }
216 if (efficiency < 0)
217 {
218 efficiency = 0;
219 }
220 efficiency = num;
221 void TryAdd(Hobby h)
222 {
223 if (!h.source.elements.IsEmpty())
224 {
225 for (int i = 0; i < h.source.elements.Length; i += 2)
226 {
227 if (h.source.elements[i] == 2207)
228 {
229 ration += h.source.elements[i + 1];
230 }
231 }
232 }
233 }
234 }
235
236 public void Abandon()
237 {
238 }
239
240 public void OnCreate(Zone zone)
241 {
242 SetOwner(zone);
243 stash = ThingGen.Create("container_salary");
247 }
248
249 public void SetOwner(Zone zone)
250 {
251 owner = zone;
252 resources.SetOwner(this);
253 researches.SetOwner(this);
254 policies.SetOwner(this);
255 happiness.SetOwner(this);
256 expeditions.SetOwner(this);
257 meetings.SetOwner(this);
258 foreach (Chara value in EClass.game.cards.globalCharas.Values)
259 {
260 if (value == null)
261 {
262 Debug.LogError("exception: c==null");
263 }
264 else if (EClass.pc == null)
265 {
266 Debug.LogError("exception: pc==null");
267 }
268 else if (value.homeZone == zone && value.faction == EClass.pc.faction)
269 {
270 members.Add(value);
272 }
273 }
275 }
276
277 public void OnActivateZone()
278 {
279 incomeInn = 0;
280 incomeTourism = 0;
281 foreach (Chara member in members)
282 {
283 if (member.IsAliveInCurrentZone && !member.pos.IsInBounds)
284 {
286 }
288 }
290 }
291
292 public void OnAfterSimulate()
293 {
294 if (!EClass.game.isLoading)
295 {
297 }
298 foreach (Chara chara in EClass._map.charas)
299 {
300 if (!chara.IsPCParty && !chara.noMove)
301 {
302 if ((chara.pos.cell.HasBlock || chara.pos.cell.hasDoor) && !chara.isRestrained && !chara.HasCondition<ConSuspend>())
303 {
304 chara.MoveImmediate(chara.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? chara.pos);
305 }
307 {
308 EClass.pc.party.AddMemeber(chara, showMsg: true);
309 }
310 }
311 }
312 }
313
314 public void OnUnloadMap()
315 {
316 }
317
318 public void OnSimulateHour(VirtualDate date)
319 {
320 int num = CountMembers(FactionMemberType.Default, onlyAlive: true);
321 int starveChance = Mathf.Max(num - MaxPopulation, 0);
322 members.ForeachReverse(delegate(Chara c)
323 {
324 if (!c.IsPCParty && c.IsAliveInCurrentZone && !c.noMove)
325 {
326 if (EClass.rnd(24 * members.Count) < starveChance)
327 {
328 starveChance--;
329 }
330 else
331 {
332 c.TickWork(date);
333 }
334 if (!date.IsRealTime && EClass.rnd(3) != 0 && c.memberType == FactionMemberType.Default)
335 {
336 c.hunger.Mod(1);
337 if (c.hunger.GetPhase() >= 3)
338 {
339 Thing meal = GetMeal(c);
340 if (meal != null)
341 {
342 FoodEffect.Proc(c, meal);
343 }
344 else
345 {
346 c.hunger.Mod(-50);
347 }
348 }
349 }
350 }
351 });
352 expeditions.OnSimulateHour();
353 meetings.OnSimulateHour(date);
354 policies.OnSimulateHour(date);
355 int num2 = Evalue(3707);
356 int num3 = Evalue(3705) + Evalue(3710) * 2;
357 int num4 = 4 + num3 * 4;
358 int num5 = Mathf.Max(1, (100 + Evalue(2205) * 5 + Evalue(3703) * 100 - num2 * 80) / 10);
359 int num6 = 10;
360 if (policies.IsActive(2709))
361 {
362 num6 = 0;
363 }
365 {
366 num5 /= 2;
367 }
368 if ((date.IsRealTime || num2 > 0) && !EClass.debug.enable && EClass.rnd(num5) == 0 && !EClass.pc.IsDeadOrSleeping && EClass._map.CountHostile() < num4)
369 {
370 int num7 = 1 + EClass.rnd(num2 + num3 + 1);
371 for (int num8 = 0; num8 < num7; num8++)
372 {
373 Chara chara = EClass._zone.SpawnMob(null, SpawnSetting.HomeEnemy(DangerLV));
374 if (chara == null)
375 {
376 break;
377 }
378 if (chara.IsAnimal && policies.IsActive(2709))
379 {
380 chara.Destroy();
381 }
382 }
383 }
384 if ((date.IsRealTime || num2 == 0) && num6 != 0 && EClass.rnd(num6) == 0 && EClass._map.CountWildAnimal() < num4)
385 {
387 }
388 if (EClass.rnd(5) == 0 && policies.IsActive(2810))
389 {
390 int num9 = 3 + lv + Evalue(2206) / 5 + Evalue(3702) * 2 + Evalue(2202) / 2;
391 num9 = num9 * (100 + Evalue(3702) * 20 + Evalue(2206)) / 100;
392 num9 = num9 * (100 + (int)Mathf.Sqrt(Evalue(2811)) * 3) / 100;
393 if (luckyMonth)
394 {
395 num9 = num9 * 2 + 5;
396 }
397 if (EClass._map.CountGuest() < num9)
398 {
399 Chara chara2;
400 if (luckyMonth || (policies.IsActive(2822) && Mathf.Sqrt(Evalue(2822) / 2) + 5f >= (float)EClass.rnd(100)))
401 {
402 chara2 = CharaGen.CreateWealthy(ContentLV);
404 }
405 else
406 {
408 }
409 if (chara2 != null && (chara2.id == "nun_mother" || chara2.id == "prostitute") && policies.IsActive(2710))
410 {
411 chara2.Destroy();
412 chara2 = null;
413 }
414 if (chara2 != null)
415 {
416 statistics.visitor++;
417 chara2.memberType = FactionMemberType.Guest;
418 chara2.SetInt(34, EClass.world.date.GetRaw());
419 chara2.c_allowance = chara2.LV * 100;
420 if (chara2.IsWealthy)
421 {
422 chara2.c_allowance *= 10;
423 }
424 if (date.IsRealTime)
425 {
426 Msg.Say("guestArrive", chara2.Name);
427 }
428 else
429 {
430 chara2.TryAssignBed();
431 }
432 }
433 }
434 }
435 foreach (Chara chara4 in EClass._map.charas)
436 {
437 if (chara4.memberType != FactionMemberType.Guest || ((chara4.c_allowance > 0 || EClass.rnd(2) != 0) && chara4.GetInt(34) + 10080 >= EClass.world.date.GetRaw()))
438 {
439 continue;
440 }
441 foreach (Chara item in EClass._zone.ListMinions(chara4))
442 {
443 item.Destroy();
444 }
445 if (!chara4.IsGlobal)
446 {
447 chara4.Destroy();
448 }
449 chara4.ClearBed();
450 break;
451 }
452 if (date.hour == 5)
453 {
454 for (int num10 = 0; num10 < ((!luckyMonth) ? 1 : 2); num10++)
455 {
456 DailyOutcome(date);
457 }
458 GenerateGarbage(date);
459 if (!date.IsRealTime)
460 {
461 AutoClean();
462 }
463 CalcTourismIncome();
464 CalcInnIncome();
465 if (date.IsRealTime)
466 {
467 GetDailyIncome();
468 }
469 }
470 if (!EClass.player.simulatingZone && date.hour == 6)
471 {
472 ReceivePackages(date);
473 }
474 if (!date.IsRealTime && date.hour % 8 == 0)
475 {
476 foreach (Chara item2 in EClass._map.charas.Where((Chara c) => c.memberType == FactionMemberType.Guest).ToList())
477 {
478 for (int num11 = 0; num11 < 3; num11++)
479 {
480 AI_Shopping.TryShop(item2, realtime: false);
481 }
482 }
483 AI_Shopping.TryRestock(EClass.pc, realtime: false);
484 }
485 if (EClass.rnd(24) == 0 || EClass.debug.enable)
486 {
487 foreach (Thing thing in EClass._map.things)
488 {
489 if (EClass.rnd(20) == 0 && thing.trait is TraitFoodEggFertilized && thing.pos.FindThing<TraitBed>() != null)
490 {
491 Chara chara3 = TraitFoodEggFertilized.Incubate(thing, thing.pos);
492 thing.ModNum(-1);
493 if (date.IsRealTime)
494 {
495 chara3.PlaySound("egg");
496 }
497 break;
498 }
499 }
500 }
501 resources.SetDirty();
502 }
503
504 public void AutoClean()
505 {
506 List<Thing> list = AI_Haul.ListThingsToClean(new List<Thing>());
507 if (list.Count == 0)
508 {
509 return;
510 }
511 Dictionary<string, Thing> dictionary = new Dictionary<string, Thing>();
512 HashSet<string> hashSet = new HashSet<string>();
513 List<Thing> list2 = new List<Thing>(1);
514 bool flag = false;
515 foreach (Thing container in EClass._map.props.installed.containers)
516 {
517 Window.SaveData windowSaveData = container.GetWindowSaveData();
518 if (windowSaveData != null && windowSaveData.userFilter)
519 {
520 flag = true;
521 break;
522 }
523 }
524 foreach (Chara member in members)
525 {
526 if (member.IsPCParty || !member.ExistsOnMap || member.memberType != FactionMemberType.Default)
527 {
528 continue;
529 }
530 Hobby hobby = member.GetWork("Clean") ?? member.GetWork("Chore");
531 if (hobby == null)
532 {
533 continue;
534 }
535 int num = (5 + EClass.rnd(5)) * hobby.GetEfficiency(member) / 100;
536 if (num <= 0)
537 {
538 continue;
539 }
540 Point origin = member.pos;
541 list.Sort((Thing a, Thing b) => origin.Distance(a.pos) - origin.Distance(b.pos));
542 int num2 = 0;
543 int num3 = 0;
544 int num4 = num * 10;
545 for (; num3 < list.Count; num3++)
546 {
547 if (num2 >= num)
548 {
549 break;
550 }
551 if (num3 >= num4)
552 {
553 break;
554 }
555 Thing thing = list[num3];
556 if (thing.isDestroyed || thing.placeState != PlaceState.roaming)
557 {
558 continue;
559 }
560 string text = (flag ? (thing.id + "|" + thing.IsDecayed + "|" + thing.GetName(NameStyle.Full, 1)) : (thing.id + "|" + thing.IsDecayed));
561 if (hashSet.Contains(text))
562 {
563 continue;
564 }
565 Thing thing2 = null;
566 if (dictionary.TryGetValue(text, out var value) && !value.isDestroyed)
567 {
568 list2.Clear();
569 list2.Add(value);
570 thing2 = EClass._zone.FindSharedContainer(thing, list2);
571 }
572 if (thing2 == null)
573 {
574 thing2 = EClass._zone.FindSharedContainer(thing);
575 if (thing2 != null)
576 {
577 dictionary[text] = thing2;
578 }
579 else
580 {
581 hashSet.Add(text);
582 }
583 }
584 if (thing2 != null)
585 {
586 thing2.AddThing(thing);
587 num2++;
588 }
589 }
590 list.RemoveRange(0, num3);
591 if (list.Count == 0)
592 {
593 break;
594 }
595 }
596 }
597
598 public void OnSimulateDay(VirtualDate date)
599 {
600 if (owner == null || owner.mainFaction != EClass.Home)
601 {
602 return;
603 }
604 researches.OnSimulateDay();
605 resources.OnSimulateDay();
606 happiness.OnSimulateDay();
607 if (!date.IsRealTime)
608 {
609 BranchMap branchMap = date.GetBranchMap();
610 foreach (Chara member in members)
611 {
612 if (!member.IsPCParty && member.memberType != FactionMemberType.Livestock && !member.faith.IsEyth && !member.c_isPrayed && branchMap.altarMap.Contains(member.faith.id))
613 {
614 AI_Pray.Pray(member, silent: true);
615 }
616 }
617 }
618 foreach (Chara member2 in members)
619 {
620 member2.c_isPrayed = false;
621 member2.c_isTrained = false;
622 }
623 if (date.day != 1)
624 {
625 return;
626 }
627 luckyMonth = false;
628 if (date.month == 1)
629 {
630 luckyMonthDone = false;
631 }
632 if (!luckyMonthDone)
633 {
634 bool flag = EClass.pc.faith == EClass.game.religions.Luck;
635 luckyMonth = (float)(flag ? 30 : 5) + Mathf.Sqrt(Evalue(2118)) * (float)(flag ? 4 : 2) > (float)EClass.rnd(720);
636 if (EClass.debug.enable)
637 {
638 luckyMonth = true;
639 }
640 if (luckyMonth)
641 {
642 Log("lucky_month", EClass._zone.Name);
643 Msg.Say("lucky_month", EClass._zone.Name);
644 Msg.Say("umi");
645 SE.Play("godbless");
646 EClass.world.SendPackage(ThingGen.Create("book_kumiromi"));
647 luckyMonthDone = true;
648 }
649 }
650 }
651
652 public void OnAdvanceDay()
653 {
654 int num = 0;
655 foreach (Chara member in members)
656 {
657 if (member.IsPC || member.isDead)
658 {
659 continue;
660 }
661 if (member.IsPCParty || member.currentZone == EClass.pc.currentZone)
662 {
663 member.c_daysWithPC++;
664 }
665 if (member.memberType == FactionMemberType.Default)
666 {
667 if (EClass.rnd(3) == 0)
668 {
669 num++;
670 }
671 if (member.GetWork("Pioneer") != null)
672 {
673 num += 3;
674 }
675 }
676 }
677 ModExp(num);
678 }
679
680 public void OnSimulateMonth(VirtualDate date)
681 {
682 lastStatistics = statistics;
683 statistics = new Statistics();
684 }
685
686 public void GenerateGarbage(VirtualDate date)
687 {
688 int sortChance = 40 + GetCivility();
689 int unsortedCount = 0;
690 foreach (Chara member in members)
691 {
692 if (!member.IsPCParty && member.ExistsOnMap)
693 {
694 Hobby hobby = member.GetWork("Clean") ?? member.GetWork("Chore");
695 if (hobby != null)
696 {
697 sortChance += 20 * hobby.GetEfficiency(member) / 100;
698 }
699 }
700 }
701 int num = Evalue(2702);
702 int num2 = EClass.rnd(2);
703 for (int i = 0; i < num2; i++)
704 {
705 if (num == 0 || EClass.rnd(num + (EClass.debug.enable ? 100000 : 10)) == 0)
706 {
707 Generate(null);
708 }
709 }
710 foreach (Chara member2 in members)
711 {
712 if (!member2.IsPCParty && member2.ExistsOnMap && (num == 0 || EClass.rnd(num + (EClass.debug.enable ? 100000 : 10)) == 0))
713 {
714 Generate(member2);
715 }
716 }
717 void Generate(Chara c)
718 {
719 if (c == null || EClass.rnd(5) == 0)
720 {
721 if (EClass.rnd(80) == 0)
722 {
723 Add(ThingGen.CreateFromCategory("junk"));
724 }
725 else if (EClass.rnd(40) == 0)
726 {
727 Thing thing;
728 Add(thing = ThingGen.CreateFromTag("garbage"));
729 }
730 else
731 {
732 string id = "trash2";
733 if (EClass.rnd(3) == 0)
734 {
735 id = "trash1";
736 }
737 if (EClass.rnd(10) == 0)
738 {
739 id = ((EClass.rnd(3) == 0) ? "529" : "1170");
740 }
741 if (c != null && (!c.IsUnique || c.memberType == FactionMemberType.Livestock) && EClass.rnd((c.memberType == FactionMemberType.Livestock) ? 2 : 50) == 0)
742 {
743 id = "_poop";
744 }
745 if (EClass.rnd(200000) == 0)
746 {
747 id = "goodness";
748 }
749 Add(ThingGen.Create(id));
750 }
751 }
752 void Add(Thing t)
753 {
754 if (sortChance < EClass.rnd(100))
755 {
756 EClass._zone.TryAddThing(t, (c != null) ? (c.pos.GetRandomPoint(2) ?? c.pos).GetNearestPoint() : EClass._zone.bounds.GetRandomSurface(), destroyIfFail: true);
757 }
758 else
759 {
760 if (t.id == "_poop" && EClass.rnd(150) == 0)
761 {
762 t.ChangeMaterial((EClass.rnd(2) == 0) ? "silver" : "gold");
763 }
764 if (!TryTrash(t))
765 {
766 unsortedCount++;
767 if (unsortedCount >= 5)
768 {
769 Tutorial.Reserve("garbage");
770 }
771 }
772 }
773 }
774 }
775 }
776
777 public bool TryTrash(Thing t)
778 {
779 Thing thing = ((t.id == "_poop" || t.source._origin == "dish") ? EClass._map.props.installed.FindEmptyContainer<TraitContainerCompost>(t) : (t.isFireproof ? EClass._map.props.installed.FindEmptyContainer<TraitContainerUnburnable>(t) : EClass._map.props.installed.FindEmptyContainer<TraitContainerBurnable>(t)));
780 if (thing != null)
781 {
782 thing.AddCard(t);
783 return true;
784 }
785 return EClass._zone.TryAddThingInSpot<TraitSpotGarbage>(t, useContainer: false);
786 }
787
788 public void ReceivePackages(VirtualDate date)
789 {
791 {
792 return;
793 }
794 List<Thing> listPackage = EClass.game.cards.listPackage;
795 if (EClass.player.stats.days >= 2 && !EClass.player.flags.elinGift && Steam.HasDLC(ID_DLC.BackerReward))
796 {
797 listPackage.Add(ThingGen.Create("gift"));
798 EClass.player.flags.elinGift = true;
799 }
800 if (listPackage.Count == 0)
801 {
802 return;
803 }
804 SE.Play("notice");
805 int num = 0;
806 foreach (Thing item in listPackage)
807 {
808 if (item.id != "bill")
809 {
810 num++;
811 }
812 PutInMailBox(item, item.id == "cardboard_box" || item.id == "gift");
813 WidgetPopText.Say("popDeliver".lang(item.Name));
814 }
815 Msg.Say("deliver_arrive", num.ToString() ?? "");
816 listPackage.Clear();
817 }
818
819 public void DailyOutcome(VirtualDate date)
820 {
821 Thing thing = null;
822 foreach (Chara member in members)
823 {
824 Chara m = member;
825 if (EClass.rnd(EClass.debug.enable ? 2 : (360 * members.Count)) == 0 && !m.IsPC && EClass.pc.faction.IsGlobalPolicyActive(2712) && m.things.Find((Thing thing4) => thing4.id == "panty" && thing4.c_idRefCard == m.id) == null && !m.things.IsFull())
826 {
827 Thing thing2 = ThingGen.Create("panty");
828 thing2.c_idRefCard = m.id;
829 m.AddThing(thing2);
830 }
831 if (m.IsPCParty || !m.ExistsOnMap)
832 {
833 continue;
834 }
835 m.RefreshWorkElements(elements);
836 if (m.memberType == FactionMemberType.Livestock)
837 {
838 if (thing == null)
839 {
840 thing = EClass._map.Stocked.Find("pasture", -1, -1, shared: true) ?? EClass._map.Installed.Find("pasture");
841 }
842 if (thing == null)
843 {
844 continue;
845 }
846 if (m.race.breeder >= EClass.rnd(2500 - (int)Mathf.Sqrt(Evalue(2827) * 100)))
847 {
848 if (EClass.rnd(3) != 0)
849 {
850 Thing t = m.MakeEgg(date.IsRealTime, 1, date.IsRealTime);
851 if (!date.IsRealTime)
852 {
853 m.TryPutShared(t);
854 }
855 }
856 else
857 {
858 Thing t2 = m.MakeMilk(date.IsRealTime, 1, date.IsRealTime);
859 if (!date.IsRealTime)
860 {
861 m.TryPutShared(t2);
862 }
863 }
864 }
865 if (m.HaveFur())
866 {
867 if (m.HasElement(1533))
868 {
869 m.c_fur = 0;
870 }
871 else
872 {
873 m.c_fur++;
874 if (EClass.rnd(4) == 0 && m.HasElement(1532))
875 {
876 m.c_fur++;
877 }
878 }
879 }
880 thing.ModNum(-1);
881 if (thing.isDestroyed || thing.Num == 0)
882 {
883 thing = null;
884 }
885 continue;
886 }
887 foreach (Hobby item in m.ListHobbies().ToList())
888 {
889 GetOutcome(item);
890 }
891 foreach (Hobby item2 in m.ListWorks().ToList())
892 {
893 GetOutcome(item2);
894 }
895 void GetOutcome(Hobby h)
896 {
897 int num3 = h.GetEfficiency(m) * GetProductBonus(m) / 100;
898 int num4 = h.GetLv(m);
899 int id = EClass.sources.elements.alias[h.source.skill].id;
900 if (!m.elements.HasBase(id))
901 {
902 m.elements.SetBase(id, 1);
903 }
904 m.ModExp(id, 100);
905 for (int i = 0; i < h.source.things.Length; i += 2)
906 {
907 string text = h.source.things[i];
908 int num5 = Mathf.Max(1, h.source.things[i + 1].ToInt() * num3 / 1000);
909 int num6 = num5 / 1000;
910 if (num5 % 1000 > EClass.rnd(1000))
911 {
912 num6++;
913 }
914 if (num6 != 0)
915 {
916 if (!(text == "_egg"))
917 {
918 if (text == "_milk")
919 {
920 m.MakeMilk(date.IsRealTime, num6);
921 }
922 else
923 {
924 Thing thing4 = ((!text.StartsWith("#")) ? ThingGen.Create(h.source.things[i], -1, num4) : ThingGen.CreateFromCategory(text.Replace("#", ""), num4));
925 if (thing4 != null)
926 {
927 num6 *= thing4.trait.CraftNum;
928 if (thing4.category.id == "fish" && EClass.rnd(EClass.debug.enable ? 1 : 5) == 0)
929 {
930 int num7 = Mathf.Min(EClass.rnd(EClass.rnd(EClass.rnd(EClass.curve(num4, 100, 50, 70) + 50))) / 50, 3);
931 if (num7 > 0)
932 {
933 thing4.SetTier(num7);
934 num6 /= num7 + 1;
935 }
936 }
937 if (num6 < 1)
938 {
939 num6 = 1;
940 }
941 if (!thing4.trait.CanStack)
942 {
943 num6 = 1;
944 }
945 thing4.SetNum(num6);
946 thing4.SetBlessedState(BlessedState.Normal);
947 thing4.TryMakeRandomItem(num4);
948 if (thing4.IsAmmo)
949 {
950 thing4.ChangeMaterial("iron");
951 thing4.c_IDTState = 0;
952 }
953 bool flag = thing4.category.id == "garbage";
954 if (thing4.trait is TraitFoodMeal)
955 {
956 if (thing4.HasTag(CTAG.dish_fail))
957 {
958 flag = true;
959 }
960 else
961 {
962 CraftUtil.MakeDish(thing4, num4 + 10, m);
963 if (thing4.id == "lunch_dystopia")
964 {
965 flag = true;
966 }
967 }
968 }
969 if (flag)
970 {
971 TryTrash(thing4);
972 }
973 else
974 {
975 m.TryPutShared(thing4);
976 }
977 }
978 }
979 }
980 else
981 {
982 m.MakeEgg(date.IsRealTime, num6);
983 }
984 }
985 }
986 switch (h.source.alias)
987 {
988 case "Nurse":
989 {
990 foreach (Chara member2 in members)
991 {
992 if (!member2.IsPCParty)
993 {
994 if (member2.isDead && member2.CanRevive() && EClass.rnd(num3) > EClass.rnd(100))
995 {
996 Log("bNurse", m, member2);
997 member2.Revive(member2.pos, msg: true);
998 if (date.IsRealTime && member2.c_wasInPcParty)
999 {
1000 EClass.pc.party.AddMemeber(member2, showMsg: true);
1001 }
1002 break;
1003 }
1004 if (EClass.rnd(num3) > EClass.rnd(100))
1005 {
1006 member2.CureHost(CureType.HealComplete);
1007 }
1008 }
1009 }
1010 break;
1011 }
1012 case "Chore":
1013 case "Clean":
1014 {
1015 for (int num8 = 0; num8 < num3 / 2; num8++)
1016 {
1017 Point randomPoint = EClass._map.bounds.GetRandomPoint();
1018 if (randomPoint.HasDecal)
1019 {
1020 EClass._map.SetDecal(randomPoint.x, randomPoint.z);
1021 }
1022 }
1023 break;
1024 }
1025 case "TreasureHunt":
1026 if (EClass.rnd(num3) > EClass.rnd(EClass.debug.enable ? 100 : 5000))
1027 {
1029 if (thing5 != null)
1030 {
1031 Thing thing6 = ThingGen.CreateTreasure("chest_treasure", thing5.LV);
1032 m.TryPutShared(thing6);
1033 thing5.Destroy();
1034 WidgetPopText.Say("foundTreasure".lang(thing6.Name));
1035 }
1036 }
1037 break;
1038 }
1039 }
1040 }
1041 int soilCost = EClass._zone.GetSoilCost();
1042 int num = Mathf.Min(100, 70 + (MaxSoil - soilCost));
1043 int flower = 5;
1044 int lv = 1;
1045 EClass._map.bounds.ForeachCell(delegate(Cell cell)
1046 {
1047 if (cell.obj != 0 && cell.sourceObj.tag.Contains("flower"))
1048 {
1049 PlantData plantData = cell.TryGetPlant();
1050 if (plantData != null && plantData.seed != null)
1051 {
1052 lv += plantData.seed.encLV + 1;
1053 }
1054 else
1055 {
1056 lv++;
1057 }
1058 flower++;
1059 }
1060 });
1061 lv /= flower;
1062 int num2 = 0;
1063 foreach (Thing thing7 in EClass._map.things)
1064 {
1065 if (thing7.IsInstalled && thing7.trait is TraitBeekeep && !thing7.things.IsFull())
1066 {
1067 flower -= 3 + EClass.rnd(5 + num2 * 4);
1068 num2++;
1069 if (flower < 0)
1070 {
1071 break;
1072 }
1073 if (EClass.rnd(100) <= num)
1074 {
1075 Thing thing3 = ThingGen.Create("honey");
1076 thing3.SetEncLv(lv / 10);
1077 thing3.elements.SetBase(2, EClass.curve(lv, 50, 10, 80));
1078 thing7.AddThing(thing3);
1079 }
1080 }
1081 }
1082 }
1083
1084 public void PutInMailBox(Thing t, bool outside = false, bool install = true)
1085 {
1086 if (!outside)
1087 {
1088 Thing mailBox = GetMailBox();
1089 if (mailBox != null)
1090 {
1091 mailBox.AddCard(t);
1092 return;
1093 }
1094 }
1095 Point mailBoxPos = GetMailBoxPos();
1096 EClass._zone.AddCard(t, mailBoxPos);
1097 if (install)
1098 {
1099 t.Install();
1100 }
1101 }
1102
1104 {
1105 return EClass._map.props.installed.FindEmptyContainer<TraitMailPost>();
1106 }
1107
1109 {
1110 Thing thing = GetMailBox();
1111 if (thing == null)
1112 {
1114 }
1115 if (thing != null)
1116 {
1117 return thing.pos.GetNearestPoint(allowBlock: false, allowChara: true, allowInstalled: false, ignoreCenter: true).Clamp(useBounds: true);
1118 }
1119 return EClass._map.GetCenterPos();
1120 }
1121
1122 public int GetResidentTax()
1123 {
1124 if (!policies.IsActive(2512, 30))
1125 {
1126 return 0;
1127 }
1128 int num = 0;
1129 int num2 = (policies.IsActive(2500, 30) ? Evalue(2500) : 0);
1130 int num3 = (policies.IsActive(2501, 30) ? Evalue(2501) : 0);
1131 int num4 = 50 + (int)Mathf.Sqrt(Evalue(2512)) * 5;
1132 foreach (Chara member in members)
1133 {
1134 if (member.IsPC || member.memberType != FactionMemberType.Default)
1135 {
1136 continue;
1137 }
1138 bool isWealthy = member.IsWealthy;
1139 int num5 = 0;
1140 foreach (Hobby item in member.ListWorks().Concat(member.ListHobbies()))
1141 {
1142 int num6 = item.source.tax * 100 / 100;
1143 if (num6 > num5)
1144 {
1145 num5 = num6;
1146 }
1147 }
1148 int num7 = (int)(((isWealthy ? 50 : 10) + (long)member.LV * 2L) * num5 / 100 * num4 / 100);
1149 if (isWealthy && num2 > 0)
1150 {
1151 num7 = num7 * (150 + (int)Mathf.Sqrt(num2) * 5) / 100;
1152 }
1153 if (num3 > 0)
1154 {
1155 num7 += (80 + (int)Mathf.Sqrt(num3) * 5) * member.faith.source.tax / 100;
1156 }
1157 num7 = num7 * efficiency / (IsTaxFree ? 100 : 1000);
1158 num += num7;
1159 if (num7 > 0)
1160 {
1161 Log("bTax", num7.ToString() ?? "", member.Name);
1162 }
1163 }
1164 statistics.tax += num;
1165 return num;
1166 }
1167
1168 public void CalcInnIncome()
1169 {
1170 int num = CountGuests();
1171 if (num == 0)
1172 {
1173 return;
1174 }
1175 int num2 = 0;
1176 int num3 = 0;
1177 foreach (Thing thing in EClass._map.things)
1178 {
1179 if (thing.IsInstalled && thing.trait is TraitBed traitBed && traitBed.owner.c_bedType == BedType.guest)
1180 {
1181 int maxHolders = traitBed.MaxHolders;
1182 num2 += maxHolders;
1183 num3 += traitBed.owner.LV * (100 + traitBed.owner.Quality / 2 + traitBed.owner.Evalue(750) / 2) / 100 * maxHolders;
1184 }
1185 }
1186 num = Mathf.Min(num, num2);
1187 if (num != 0)
1188 {
1189 num3 /= num2;
1190 num3 = num3 * (100 + 5 * (int)Mathf.Sqrt(Evalue(2812))) / 100;
1191 float num4 = 10f + Mathf.Sqrt(num) * 10f;
1192 if (policies.IsActive(2813))
1193 {
1194 num4 += Mathf.Sqrt(CountWealthyGuests()) * 50f * (80f + 5f * Mathf.Sqrt(Evalue(2813))) / 100f;
1195 }
1196 if (policies.IsActive(2812))
1197 {
1198 num4 = num4 * (float)(100 + num3) / 100f;
1199 }
1200 num4 = Mathf.Min(num4, Mathf.Sqrt(Worth) / 15f + 5f);
1201 incomeInn += EClass.rndHalf((int)num4) + EClass.rndHalf((int)num4);
1202 }
1203 }
1204
1205 public void CalcTourismIncome()
1206 {
1207 int num = CountGuests();
1208 if (num != 0)
1209 {
1210 float num2 = 10f + Mathf.Sqrt(num) * 10f;
1211 if (policies.IsActive(2815))
1212 {
1213 num2 += Mathf.Sqrt(CountWealthyGuests()) * 50f * (80f + 5f * Mathf.Sqrt(Evalue(2815))) / 100f;
1214 }
1215 num2 = Mathf.Min(num2, Mathf.Sqrt(tourism) / 5f);
1216 incomeTourism += EClass.rndHalf((int)num2) + EClass.rndHalf((int)num2);
1217 }
1218 }
1219
1220 public void GetDailyIncome()
1221 {
1222 GetIncome(ref incomeShop, ref statistics.shop, "getIncomeShop", tax: false);
1223 GetIncome(ref incomeInn, ref statistics.inn, "getIncomeInn", tax: true);
1224 GetIncome(ref incomeTourism, ref statistics.tourism, "getIncomeTourism", tax: true);
1225 void GetIncome(ref int n, ref int stat, string lang, bool tax)
1226 {
1227 if (tax && !IsTaxFree)
1228 {
1229 n = n * 10 / 100;
1230 }
1231 if (n != 0)
1232 {
1233 Msg.Say(lang, Lang._currency(n, "money"), owner.Name);
1234 Thing t = ThingGen.Create("money").SetNum(n);
1235 EClass.pc.Pick(t);
1236 stat += n;
1237 n = 0;
1238 }
1239 }
1240 }
1241
1243 {
1244 if (c.things.IsFull())
1245 {
1246 return null;
1247 }
1248 if (c.memberType == FactionMemberType.Livestock && policies.IsActive(2715))
1249 {
1250 return null;
1251 }
1252 Thing thing = EClass._zone.TryGetThingFromSharedContainer((Thing t) => c.CanEat(t, shouldEat: true) && !t.c_isImportant);
1253 if (thing != null)
1254 {
1255 thing = thing.Split(1);
1256 }
1257 return thing;
1258 }
1259
1260 public void OnClaimZone()
1261 {
1263 {
1264 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == "tech"))
1265 {
1266 elements.SetBase(item.id, 1);
1267 }
1268 foreach (SourceElement.Row item2 in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == "policy" && !a.tag.Contains("hidden")))
1269 {
1270 policies.AddPolicy(item2.id);
1271 }
1272 }
1273 else
1274 {
1275 elements.SetBase(2003, 1);
1276 elements.SetBase(4002, 1);
1277 elements.SetBase(2115, 1);
1278 elements.SetBase(2204, 1);
1279 elements.SetBase(2120, 1);
1280 policies.AddPolicy(2512);
1281 policies.AddPolicy(2702);
1282 policies.AddPolicy(2703);
1283 policies.AddPolicy(2516);
1284 policies.AddPolicy(2515);
1285 policies.AddPolicy(2514);
1286 }
1288 {
1289 policies.Activate(2514);
1290 }
1291 Element element = EClass._zone.ListLandFeats()[0];
1292 elements.SetBase(element.id, 1);
1293 switch (element.id)
1294 {
1295 case 3604:
1296 elements.SetBase(2206, 10);
1297 break;
1298 case 3602:
1299 elements.SetBase(2206, 15);
1300 break;
1301 }
1302 if (EClass.game.StartZone == owner || owner is Zone_Vernis)
1303 {
1304 AddMemeber(EClass.pc);
1305 }
1307 {
1308 foreach (SourceElement.Row item3 in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == "policy"))
1309 {
1310 policies.AddPolicy(item3.id);
1311 }
1312 }
1313 ValidateUpgradePolicies();
1314 }
1315
1316 public void OnUnclaimZone()
1317 {
1318 List<Element> source = owner.ListLandFeats();
1319 if (lv >= 5)
1320 {
1321 foreach (Element item in source.Where((Element a) => a.HasTag("network")).ToList())
1322 {
1324 }
1325 }
1326 Element[] array = elements.dict.Values.ToArray();
1327 foreach (Element element in array)
1328 {
1329 elements.SetBase(element.id, 0);
1330 }
1331 owner.landFeats = null;
1332 owner.ListLandFeats();
1333 owner.branch = null;
1334 }
1335
1337 {
1338 if (lv >= 2)
1339 {
1340 if (!policies.HasPolicy(2705))
1341 {
1342 policies.AddPolicy(2705);
1344 }
1345 if (!policies.HasPolicy(2708))
1346 {
1347 policies.AddPolicy(2708);
1349 }
1350 if (!policies.HasPolicy(2707))
1351 {
1352 policies.AddPolicy(2707);
1353 }
1354 if (!policies.HasPolicy(2709))
1355 {
1356 policies.AddPolicy(2709);
1357 }
1358 if (!policies.HasPolicy(2715))
1359 {
1360 policies.AddPolicy(2715);
1361 }
1362 }
1363 foreach (int globalPolicy in EClass.pc.faction.globalPolicies)
1364 {
1365 if (!policies.HasPolicy(globalPolicy))
1366 {
1367 policies.AddPolicy(globalPolicy, show: false);
1369 }
1370 }
1371 }
1372
1373 public void Upgrade()
1374 {
1375 List<Element> list = owner.ListLandFeats();
1376 if (owner.IsActiveZone)
1377 {
1378 TraitCoreZone traitCoreZone = EClass._map.FindThing<TraitCoreZone>();
1379 if (traitCoreZone != null)
1380 {
1381 SE.Play("godbless");
1382 traitCoreZone.owner.PlayEffect("aura_heaven");
1383 }
1384 }
1385 lv++;
1386 exp = 0;
1387 int admin = 4;
1388 int food = 4;
1389 Set(4, 3);
1390 switch (list[0].id)
1391 {
1392 case 3500:
1393 Set(5, 3);
1394 break;
1395 case 3604:
1396 Set(4, 3);
1397 break;
1398 case 3600:
1399 Set(5, 3);
1400 break;
1401 case 3601:
1402 Set(4, 4);
1403 break;
1404 case 3603:
1405 Set(6, 2);
1406 break;
1407 case 3602:
1408 Set(5, 2);
1409 break;
1410 }
1411 elements.SetBase(2003, Mathf.Min((lv - 1) * 2 + 1, 10));
1412 elements.SetBase(2115, (lv - 1) * admin + 1);
1413 elements.SetBase(2204, (lv - 1) * food + 1);
1414 elements.GetElement(2003).CheckLevelBonus(elements);
1415 ValidateUpgradePolicies();
1416 if (lv == 4)
1417 {
1418 elements.SetBase(list[1].id, 1);
1419 }
1420 if (lv == 7)
1421 {
1422 elements.SetBase(list[2].id, 1);
1423 }
1424 if (lv >= 5)
1425 {
1426 List<Element> list2 = elements.dict.Values.Where((Element a) => a.source.category == "landfeat" && a.HasTag("network")).ToList();
1427 foreach (Element item in list2)
1428 {
1430 }
1431 foreach (Element item2 in list2)
1432 {
1433 elements.Remove(item2.id);
1434 }
1435 }
1436 Msg.Say("upgrade_hearth", lv.ToString() ?? "", owner.Name);
1437 LogRaw("upgrade_hearth".langGame(lv.ToString() ?? "", owner.Name), "Good");
1438 Tutorial.Reserve("stone");
1439 void Set(int a, int f)
1440 {
1441 admin = a;
1442 food = f;
1443 }
1444 }
1445
1446 public bool CanUpgrade()
1447 {
1448 if (lv < MaxLv)
1449 {
1450 if (exp < GetNextExp())
1451 {
1452 return EClass.debug.enable;
1453 }
1454 return true;
1455 }
1456 return false;
1457 }
1458
1459 public int GetUpgradeCost()
1460 {
1461 return lv * lv * lv * 1000;
1462 }
1463
1464 public void ModExp(int a)
1465 {
1466 if (policies.IsActive(2515))
1467 {
1468 return;
1469 }
1470 if (policies.IsActive(2516))
1471 {
1472 a = a * 150 / 100 + EClass.rnd(2);
1473 }
1474 exp += a;
1475 if (exp >= GetNextExp() && CanUpgrade())
1476 {
1477 if (EClass.core.version.demo && lv >= 3)
1478 {
1479 exp = 0;
1480 Msg.Say("demoLimit2");
1481 }
1482 else
1483 {
1484 Upgrade();
1485 }
1486 }
1487 }
1488
1489 public string GetHearthHint(int a)
1490 {
1491 if (a <= 1)
1492 {
1493 return "hearth1".lang();
1494 }
1495 string text = "";
1496 for (int i = 1; i < a; i++)
1497 {
1498 string text2 = ("hearth" + (i + 1)).lang();
1499 if (!text2.IsEmpty())
1500 {
1501 text = text + text2 + Environment.NewLine;
1502 }
1503 }
1504 return text.TrimEnd(Environment.NewLine.ToCharArray());
1505 }
1506
1507 public void AddFeat(int ele, int v)
1508 {
1509 elements.ModBase(ele, v);
1510 WidgetPopText.Say("rewardElement".lang(EClass.sources.elements.map[ele].GetName()));
1511 }
1512
1513 public void AddMemeber(Chara c)
1514 {
1515 if (members.Contains(c))
1516 {
1517 return;
1518 }
1521 c.SetGlobal();
1523 c.SetHomeZone(owner);
1524 foreach (Thing item in c.things.List((Thing a) => a.HasTag(CTAG.godArtifact)).Copy())
1525 {
1527 }
1528 if (c.OriginalHostility <= Hostility.Ally)
1529 {
1530 c.c_originalHostility = Hostility.Ally;
1531 }
1532 c.hostility = Hostility.Ally;
1533 c.enemy = null;
1534 c.orgPos = null;
1535 if (c.memberType != FactionMemberType.Default && c.memberType != FactionMemberType.Livestock)
1536 {
1537 c.memberType = FactionMemberType.Default;
1538 }
1539 if (c.hp > c.MaxHP)
1540 {
1541 c.hp = c.MaxHP;
1542 }
1543 if (c.mana.value > c.mana.max)
1544 {
1545 c.mana.value = c.mana.max;
1546 }
1547 if (c.stamina.value > c.stamina.max)
1548 {
1549 c.stamina.value = c.stamina.max;
1550 }
1551 members.Add(c);
1553 RefreshEfficiency();
1554 c.RefreshWorkElements(elements);
1555 if (uidMaid == 0 && c.id == "maid")
1556 {
1557 uidMaid = c.uid;
1558 }
1559 switch (c.id)
1560 {
1561 case "lomias":
1563 break;
1564 case "larnneire":
1566 break;
1567 case "melilith":
1569 break;
1570 case "priest":
1571 case "priest2":
1573 break;
1574 }
1575 }
1576
1578 {
1579 c.ClearBed();
1580 c.memberType = type;
1581 c.c_wasInPcParty = false;
1582 RefreshEfficiency();
1583 c.RefreshWorkElements(elements);
1584 policies.Validate();
1585 }
1586
1587 public void BanishMember(Chara c, bool skipMsg = false)
1588 {
1589 RemoveMemeber(c);
1590 if (!skipMsg)
1591 {
1592 Msg.Say("banish", c, EClass._zone.Name);
1593 }
1595 {
1596 c.RemoveGlobal();
1597 }
1598 if (c.IsGlobal)
1599 {
1600 c.OnBanish();
1601 }
1602 else
1603 {
1604 c.Destroy();
1605 }
1606 }
1607
1608 public void RemoveMemeber(Chara c)
1609 {
1610 c.isSale = false;
1611 if (c.currentZone != null && c.currentZone.map != null)
1612 {
1614 c.currentZone.map.props.sales.Remove(c);
1615 }
1617 if (!(c.trait is TraitUniqueChara) && !c.IsUnique && !EClass.game.cards.listAdv.Contains(c))
1618 {
1619 c.RemoveGlobal();
1620 }
1621 members.Remove(c);
1624 policies.Validate();
1625 RefreshEfficiency();
1626 }
1627
1629 {
1630 float num = 0f;
1631 if (members.Count == 0)
1632 {
1633 return 0;
1634 }
1635 foreach (Chara member in members)
1636 {
1637 num += (float)member.happiness;
1638 }
1639 return (int)(num / (float)members.Count);
1640 }
1641
1642 public bool IsAllDead()
1643 {
1644 foreach (Chara member in members)
1645 {
1646 if (!member.isDead)
1647 {
1648 return false;
1649 }
1650 }
1651 return true;
1652 }
1653
1654 public void Recruit(Chara c)
1655 {
1656 RemoveRecruit(c);
1657 AddMemeber(c);
1658 c.isRestrained = false;
1659 if (c.currentZone != EClass._zone && !c.isDead)
1660 {
1662 EClass._zone.AddCard(c, point);
1663 }
1664 RefreshEfficiency();
1666 Msg.Say("hire".langGame(c.Name));
1667 }
1668
1670 {
1671 foreach (Chara member in members)
1672 {
1673 if (member.IsAliveInCurrentZone && member.IsMaid)
1674 {
1675 return member;
1676 }
1677 }
1678 return null;
1679 }
1680
1681 public string GetRandomName()
1682 {
1683 if (EClass.rnd(4) == 0 || members.Count == 0)
1684 {
1685 return EClass.player.title;
1686 }
1687 return members.RandomItem().Name;
1688 }
1689
1690 public int CountMembers(FactionMemberType type, bool onlyAlive = false)
1691 {
1692 int num = 0;
1693 foreach (Chara member in members)
1694 {
1695 if (member.memberType == type && (!onlyAlive || !member.isDead) && (type != FactionMemberType.Default || member.trait.IsCountAsResident))
1696 {
1697 num++;
1698 }
1699 }
1700 return num;
1701 }
1702
1703 public int CountGuests()
1704 {
1705 int num = 0;
1706 foreach (Chara chara in EClass._map.charas)
1707 {
1708 if (chara.memberType == FactionMemberType.Guest)
1709 {
1710 num++;
1711 }
1712 }
1713 return num;
1714 }
1715
1717 {
1718 int num = 0;
1719 foreach (Chara chara in EClass._map.charas)
1720 {
1721 if (chara.memberType == FactionMemberType.Guest && chara.IsWealthy)
1722 {
1723 num++;
1724 }
1725 }
1726 return num;
1727 }
1728
1729 public void UpdateReqruits(bool clear = false)
1730 {
1731 resources.Refresh();
1732 if (clear)
1733 {
1734 listRecruit.ForeachReverse(delegate(HireInfo i)
1735 {
1736 if (!i.chara.IsGlobal)
1737 {
1738 i.chara.Destroy();
1739 }
1740 if (i.chara.isDestroyed)
1741 {
1742 listRecruit.Remove(i);
1743 }
1744 });
1745 listRecruit.Clear();
1746 lastUpdateReqruit = -1;
1747 }
1748 else
1749 {
1750 listRecruit.ForeachReverse(delegate(HireInfo i)
1751 {
1752 if (i.Hours < 0)
1753 {
1754 if (!i.chara.IsGlobal)
1755 {
1756 i.chara.Destroy();
1757 }
1758 listRecruit.Remove(i);
1759 }
1760 });
1761 }
1762 if (lastUpdateReqruit == EClass.world.date.day)
1763 {
1764 return;
1765 }
1766 lastUpdateReqruit = EClass.world.date.day;
1767 int num = 2 + (int)Mathf.Sqrt(Evalue(2513)) / 2;
1768 int num2 = EClass.rnd(3 + (int)Mathf.Sqrt(Evalue(2513)) / 2) + num - listRecruit.Count;
1769 if (num2 <= 0)
1770 {
1771 return;
1772 }
1773 new List<Chara>(EClass.game.cards.globalCharas.Values).Shuffle();
1774 for (int num3 = 0; num3 < num2; num3++)
1775 {
1776 Chara chara = CharaGen.CreateFromFilter("c_neutral", ContentLV + Mathf.Min(EClass.player.stats.days, 10));
1777 if (chara.isBackerContent || chara.source.quality != 0)
1778 {
1779 num3--;
1780 }
1781 else
1782 {
1783 AddRecruit(chara);
1784 }
1785 }
1787 {
1789 }
1790 }
1791
1792 public void AddRecruit(Chara c)
1793 {
1794 HireInfo hireInfo = new HireInfo
1795 {
1796 chara = c,
1797 isNew = true
1798 };
1799 hireInfo.deadline = EClass.world.date.GetRaw() + (EClass.rnd(5) + 1) * 1440 + EClass.rnd(24) * 60;
1800 listRecruit.Add(hireInfo);
1801 }
1802
1803 public void RemoveRecruit(Chara c)
1804 {
1805 listRecruit.ForeachReverse(delegate(HireInfo i)
1806 {
1807 if (i.chara == c)
1808 {
1809 listRecruit.Remove(i);
1810 }
1811 });
1812 }
1813
1814 public int CountNewRecruits()
1815 {
1816 int num = 0;
1817 foreach (HireInfo item in listRecruit)
1818 {
1819 if (item.isNew)
1820 {
1821 num++;
1822 }
1823 }
1824 return num;
1825 }
1826
1827 public void ClearNewRecruits()
1828 {
1829 foreach (HireInfo item in listRecruit)
1830 {
1831 item.isNew = false;
1832 }
1833 }
1834
1835 public bool IsRecruit(Chara c)
1836 {
1837 foreach (HireInfo item in listRecruit)
1838 {
1839 if (item.chara == c)
1840 {
1841 return true;
1842 }
1843 }
1844 return false;
1845 }
1846
1847 public int CountPasture()
1848 {
1849 return EClass._map.Stocked.GetNum("pasture", onlyShared: true) + EClass._map.Installed.GetNum("pasture");
1850 }
1851
1852 public int GetPastureCost()
1853 {
1854 return CountMembers(FactionMemberType.Livestock);
1855 }
1856
1857 public int GetCivility()
1858 {
1859 int num = 10 + Evalue(2203);
1860 if (Evalue(2701) > 0)
1861 {
1862 num += 10 + (int)Mathf.Sqrt(Evalue(2701));
1863 }
1864 if (Evalue(2702) > 0)
1865 {
1866 num -= 10 + (int)Mathf.Sqrt(Evalue(2702));
1867 }
1868 return num;
1869 }
1870
1871 public float GetHearthIncome()
1872 {
1873 float num = 0f;
1874 foreach (Element value in elements.dict.Values)
1875 {
1876 if (value.source.category == "culture")
1877 {
1878 num += GetHearthIncome(value.source.alias);
1879 }
1880 }
1881 return num;
1882 }
1883
1884 public float GetHearthIncome(string id)
1885 {
1886 int num = 0;
1887 foreach (KeyValuePair<int, Element> item in elements.dict)
1888 {
1889 if (item.Value.source.aliasParent == id)
1890 {
1891 num++;
1892 }
1893 }
1894 return 0.2f * (float)num;
1895 }
1896
1898 {
1899 int valueWithoutLink = e.ValueWithoutLink;
1900 valueWithoutLink += e.CostLearn;
1901 if (e.source.max != 0 && e.ValueWithoutLink >= e.source.max)
1902 {
1903 return 0;
1904 }
1905 return valueWithoutLink;
1906 }
1907
1908 public string Log(string idLang, string ref1 = null, string ref2 = null, string ref3 = null, string ref4 = null)
1909 {
1910 Msg.alwaysVisible = true;
1911 return LogRaw(Msg.GetRawText(idLang, ref1, ref2, ref3, ref4), EClass.sources.langGame.map[idLang].logColor);
1912 }
1913
1914 public string Log(string idLang, Card c1, Card c2, string ref1 = null, string ref2 = null)
1915 {
1916 Msg.alwaysVisible = true;
1917 return LogRaw(Msg.GetRawText(idLang, c1, c2, ref1, ref2), EClass.sources.langGame.map[idLang].logColor);
1918 }
1919
1920 public string Log(string idLang, Card c1, string ref1 = null, string ref2 = null, string ref3 = null)
1921 {
1922 Msg.alwaysVisible = true;
1923 return LogRaw(Msg.GetRawText(idLang, c1, ref1, ref2, ref3), EClass.sources.langGame.map[idLang].logColor);
1924 }
1925
1926 public string LogRaw(string text, string col = null)
1927 {
1928 log.Add(text, col.IsEmpty() ? null : col);
1929 Msg.alwaysVisible = false;
1930 Msg.SetColor();
1931 return text;
1932 }
1933}
BedType
Definition: BedType.cs:2
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
@ tourism
CureType
Definition: CureType.cs:2
if(!match.Success)
FactionMemberType
Hostility
Definition: Hostility.cs:2
ID_Achievement
ID_DLC
Definition: ID_DLC.cs:2
NameStyle
Definition: NameStyle.cs:2
PlaceState
Definition: PlaceState.cs:2
SpawnPosition
Definition: SpawnPosition.cs:2
static List< Thing > ListThingsToClean(List< Thing > result)
Definition: AI_Haul.cs:69
static void Pray(Chara c, bool silent=false)
Definition: AI_Pray.cs:52
static bool TryRestock(Chara c, bool realtime)
Definition: AI_Shopping.cs:129
static bool TryShop(Chara c, bool realtime)
Definition: AI_Shopping.cs:16
void Add(Act a, string s="")
Definition: ActPlan.cs:11
Version version
Definition: BaseCore.cs:17
List< Chara > listAdv
Definition: CardManager.cs:64
GlobalCharaList globalCharas
Definition: CardManager.cs:46
List< Thing > listPackage
Definition: CardManager.cs:61
Definition: Card.cs:11
void SetTier(int a, bool setTraits=true)
Definition: Card.cs:4050
bool isDestroyed
Definition: Card.cs:78
Thing TryMakeRandomItem(int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
Definition: Card.cs:5758
void PurgeDuplicateArtifact(Thing af)
Definition: Card.cs:3398
bool IsDecayed
Definition: Card.cs:2357
bool IsAmmo
Definition: Card.cs:2301
Thing Split(int a)
Definition: Card.cs:3665
ElementContainerCard elements
Definition: Card.cs:42
bool c_wasInPcParty
Definition: Card.cs:1039
string id
Definition: Card.cs:36
bool IsUnique
Definition: Card.cs:2143
bool isRestrained
Definition: Card.cs:569
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6645
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3217
void SetInt(string id, int value=0)
Definition: Card.cs:2586
Card AddCard(Card c)
Definition: Card.cs:3266
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3280
int hp
Definition: Card.cs:245
string Name
Definition: Card.cs:2191
bool ExistsOnMap
Definition: Card.cs:2137
bool c_isPrayed
Definition: Card.cs:1099
Thing SetNum(int a)
Definition: Card.cs:3676
PlaceState placeState
Definition: Card.cs:86
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4076
bool HasTag(CTAG tag)
Definition: Card.cs:2728
Point pos
Definition: Card.cs:60
int uid
Definition: Card.cs:125
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6679
Trait trait
Definition: Card.cs:54
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2649
int c_allowance
Definition: Card.cs:1357
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:6068
void SetEncLv(int a)
Definition: Card.cs:4045
void Destroy()
Definition: Card.cs:5314
bool c_isImportant
Definition: Card.cs:1051
bool noMove
Definition: Card.cs:773
bool HaveFur()
Definition: Card.cs:8451
ThingContainer things
Definition: Card.cs:39
bool IsInstalled
Definition: Card.cs:2451
int c_daysWithPC
Definition: Card.cs:1525
BedType c_bedType
Definition: Card.cs:967
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:6168
Card Install()
Definition: Card.cs:3922
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3257
int Num
Definition: Card.cs:161
SourceCategory.Row category
Definition: Card.cs:2101
void ModNum(int a, bool notify=true)
Definition: Card.cs:3696
int c_fur
Definition: Card.cs:1369
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6383
int LV
Definition: Card.cs:389
bool isBackerContent
Definition: Card.cs:952
string c_idRefCard
Definition: Card.cs:1777
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:6045
void RemoveThings()
Definition: Card.cs:3491
Definition: Cell.cs:7
bool HasBlock
Definition: Cell.cs:679
int obj
Definition: Cell.cs:50
SourceObj.Row sourceObj
Definition: Cell.cs:1112
bool hasDoor
Definition: Cell.cs:279
static Chara CreateWealthy(int lv=-1)
Definition: CharaGen.cs:53
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:569
new TraitChara trait
Definition: Chara.cs:511
Hostility OriginalHostility
Definition: Chara.cs:477
void RemoveGlobal()
Definition: Chara.cs:1574
bool IsWealthy
Definition: Chara.cs:1104
bool CanRevive()
Definition: Chara.cs:5477
void TryPutShared(Thing t, List< Thing > containers=null, bool dropIfFail=true)
Definition: Chara.cs:4746
void CureHost(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10145
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9626
Faction faction
Definition: Chara.cs:433
override bool IsPC
Definition: Chara.cs:632
bool IsMaid
Definition: Chara.cs:1076
override bool IsGlobal
Definition: Chara.cs:630
override bool IsPCParty
Definition: Chara.cs:635
Party party
Definition: Chara.cs:45
TraitBed TryAssignBed()
Definition: Chara.cs:7829
bool HasCondition(string alias)
Definition: Chara.cs:10053
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1500
Chara SetFaction(Faction f)
Definition: Chara.cs:1492
int happiness
Definition: Chara.cs:112
Chara SetGlobal(Zone _home, int x, int z)
Definition: Chara.cs:1546
bool IsAnimal
Definition: Chara.cs:916
void OnBanish()
Definition: Chara.cs:1514
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:8095
override int MaxHP
Definition: Chara.cs:728
Zone currentZone
Definition: Chara.cs:261
override bool IsDeadOrSleeping
Definition: Chara.cs:581
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9587
SourceChara.Row source
Definition: Chara.cs:164
Stats mana
Definition: Chara.cs:1215
FactionMemberType memberType
Definition: Chara.cs:48
Stats stamina
Definition: Chara.cs:1207
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9560
void Revive(Point p=null, bool msg=false)
Definition: Chara.cs:5503
Zone homeZone
Definition: Chara.cs:273
Hobby GetWork(string id)
Definition: Chara.cs:9607
Religion faith
Definition: Chara.cs:445
void ClearBed(Map map=null)
Definition: Chara.cs:7802
FactionBranch homeBranch
Definition: Chara.cs:1115
bool isDead
Definition: Chara.cs:395
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:4612
SourceRace.Row race
Definition: Chara.cs:470
bool allPolicy
Definition: CoreDebug.cs:253
bool allHomeSkill
Definition: CoreDebug.cs:211
bool enable
Definition: CoreDebug.cs:302
static void MakeDish(Thing food, int lv, Chara crafter=null, int seed=-1)
Definition: CraftUtil.cs:62
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
int day
Definition: Date.cs:62
bool IsNight
Definition: Date.cs:112
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
static Scene scene
Definition: EClass.cs:31
static Faction Home
Definition: EClass.cs:27
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static int rndHalf(int a)
Definition: EClass.cs:97
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
static CoreDebug debug
Definition: EClass.cs:49
int Value(int ele)
Element ModBase(int ele, int v)
Element SetBase(string alias, int v, int potential=0)
int ValueWithoutLink
Definition: ELEMENT.cs:303
int id
Definition: ELEMENT.cs:259
SourceElement.Row source
Definition: ELEMENT.cs:282
bool HasTag(string tag)
Definition: ELEMENT.cs:482
virtual int CostLearn
Definition: ELEMENT.cs:323
int GetRoadDist(int gx, int gy)
Definition: EloMap.cs:466
void SetOwner(FactionBranch _branch)
MeetingManager meetings
string GetRandomName()
int GetProductBonus(Chara c)
void OnAfterSimulate()
string Log(string idLang, Card c1, Card c2, string ref1=null, string ref2=null)
void AddRecruit(Chara c)
ExpeditionManager expeditions
Thing GetMailBox()
void RefreshEfficiency()
void DailyOutcome(VirtualDate date)
Thing GetMeal(Chara c)
HappinessManager happiness
string Log(string idLang, Card c1, string ref1=null, string ref2=null, string ref3=null)
void RemoveRecruit(Chara c)
void OnSimulateMonth(VirtualDate date)
int CountNewRecruits()
int CountMembers(FactionMemberType type, bool onlyAlive=false)
void OnActivateZone()
void ChangeMemberType(Chara c, FactionMemberType type)
void AddFeat(int ele, int v)
void CalcInnIncome()
GStability stability
Point GetMailBoxPos()
int Evalue(int ele)
void OnCreate(Zone zone)
void ModExp(int a)
bool IsRecruit(Chara c)
void ClearNewRecruits()
bool TryTrash(Thing t)
Statistics lastStatistics
ResearchManager researches
Religion faith
string GetHearthHint(int a)
float GetHearthIncome()
Statistics statistics
void OnUnclaimZone()
int GetTechUpgradeCost(Element e)
void OnSimulateDay(VirtualDate date)
int GetNextExp(int _lv=-1)
float GetHearthIncome(string id)
void CalcTourismIncome()
List< Chara > members
void GenerateGarbage(VirtualDate date)
void RemoveMemeber(Chara c)
void SetOwner(Zone zone)
void UpdateReqruits(bool clear=false)
void OnSimulateHour(VirtualDate date)
void OnAdvanceDay()
List< HireInfo > listRecruit
int CountWealthyGuests()
string LogRaw(string text, string col=null)
void Recruit(Chara c)
void PutInMailBox(Thing t, bool outside=false, bool install=true)
PolicyManager policies
void OnUnloadMap()
void ReceivePackages(VirtualDate date)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
bool HasItemProtection
HomeResourceManager resources
int GetHappiness(FactionMemberType type)
ElementContainerZone elements
void GetDailyIncome()
void BanishMember(Chara c, bool skipMsg=false)
void AddMemeber(Chara c)
void ValidateUpgradePolicies()
new Faction Wilds
FactionBranch FindBranch(Chara c)
Definition: FACTION.cs:436
ElementContainerFaction charaElements
Definition: FACTION.cs:146
bool IsGlobalPolicyActive(int id)
Definition: FACTION.cs:478
int CountTaxFreeLand()
Definition: FACTION.cs:585
ElementContainerZone elements
Definition: FACTION.cs:141
HashSet< int > globalPolicies
Definition: FACTION.cs:144
void RemoveReserve(Chara c)
Definition: FACTION.cs:368
void SetGlobalPolicyActive(int id, bool active)
Definition: FACTION.cs:491
bool isLoading
Definition: Game.cs:242
SurvivalManager survival
Definition: Game.cs:228
ReligionManager religions
Definition: Game.cs:159
CardManager cards
Definition: Game.cs:156
bool IsSurvival
Definition: Game.cs:276
FactionManager factions
Definition: Game.cs:162
Zone StartZone
Definition: Game.cs:278
void SetOwner(FactionBranch _owner)
Chara chara
Definition: HireInfo.cs:6
int Hours
Definition: HireInfo.cs:26
Definition: Hobby.cs:5
SourceHobby.Row source
Definition: Hobby.cs:8
int GetEfficiency(Chara c)
Definition: Hobby.cs:31
int GetLv(Chara c)
Definition: Hobby.cs:22
void SetOwner(FactionBranch _owner)
HomeResourceWorth worth
Definition: Lang.cs:7
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:161
Definition: Log.cs:4
void ForeachCell(Action< Cell > action)
Definition: MapBounds.cs:279
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
Definition: MapBounds.cs:182
int Width
Definition: MapBounds.cs:26
Point GetCenterPos()
Definition: MapBounds.cs:52
int Height
Definition: MapBounds.cs:28
Point GetRandomPoint()
Definition: MapBounds.cs:97
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2778
PropsInstalled Installed
Definition: Map.cs:128
void SetDecal(int x, int z, int id=0, int amount=1, bool refresh=true)
Definition: Map.cs:2191
int CountHostile()
Definition: Map.cs:2653
List< Thing > things
Definition: Map.cs:52
int CountGuest()
Definition: Map.cs:2640
PropsManager props
Definition: Map.cs:94
int CountWildAnimal()
Definition: Map.cs:2666
PropsStocked Stocked
Definition: Map.cs:126
List< Chara > charas
Definition: Map.cs:84
MapBounds bounds
Definition: Map.cs:55
void OnSimulateHour(VirtualDate date)
void SetOwner(FactionBranch _branch)
Definition: MsgLog.cs:7
void Add(Data data)
Definition: MsgLog.cs:53
Definition: Msg.cs:5
static string GetRawText(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:37
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:71
bool elinGift
Definition: Player.cs:412
int days
Definition: Player.cs:75
Flags flags
Definition: Player.cs:1164
Stats stats
Definition: Player.cs:1086
string title
Definition: Player.cs:1074
bool simulatingZone
Definition: Player.cs:1252
Definition: Point.cs:9
bool HasDecal
Definition: Point.cs:139
int x
Definition: Point.cs:36
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
int z
Definition: Point.cs:39
int Distance(Point p)
Definition: Point.cs:995
Point Clamp(bool useBounds=false)
Definition: Point.cs:1014
bool IsInBounds
Definition: Point.cs:104
Cell cell
Definition: Point.cs:51
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1146
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:774
int GetValue(int id)
void Activate(int id)
void AddPolicy(string id)
bool HasPolicy(int id)
bool IsActive(int id, int days=-1)
void OnSimulateHour(VirtualDate date)
void SetOwner(FactionBranch _owner)
PropsInstalled installed
Definition: PropsManager.cs:8
List< Card > sales
Definition: PropsManager.cs:14
TraitManager traits
Definition: Props.cs:18
Thing Find(int uid)
Definition: Props.cs:395
List< Thing > containers
Definition: Props.cs:22
int GetNum(string id, bool onlyShared=false)
Definition: Props.cs:433
ReligionEyth Eyth
ReligionLuck Luck
bool IsEyth
Definition: Religion.cs:65
SourceReligion.Row source
Definition: Religion.cs:40
virtual string id
Definition: Religion.cs:33
void SetOwner(FactionBranch _branch)
EloMap elomap
Definition: Scene.cs:149
LangGame langGame
SourceElement elements
virtual string Name
Definition: Spatial.cs:509
Faction mainFaction
Definition: Spatial.cs:442
int y
Definition: Spatial.cs:106
int x
Definition: Spatial.cs:94
static SpawnSetting HomeWild(int lv)
static SpawnSetting HomeEnemy(int lv)
static SpawnSetting HomeGuest(int lv)
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
Definition: Steam.cs:12
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:53
static bool HasDLC(ID_DLC id)
Definition: Steam.cs:43
void OnUpdateRecruit(FactionBranch branch)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
Thing Find(int uid)
bool IsFull(int y=0)
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:264
static Thing CreateFromTag(string idTag, int lv=-1)
Definition: ThingGen.cs:80
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:536
virtual bool IsCountAsResident
Definition: TraitChara.cs:70
static Chara Incubate(Thing egg, Point pos, Card incubator=null)
TraitSet GetTraitSet(Type t)
Definition: TraitManager.cs:94
virtual int CraftNum
Definition: Trait.cs:135
virtual bool RemoveGlobalOnBanish
Definition: Trait.cs:583
Point GetPoint()
Definition: Trait.cs:845
Card owner
Definition: Trait.cs:28
virtual bool CanStack
Definition: Trait.cs:163
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
BranchMap GetBranchMap()
Definition: VirtualDate.cs:44
bool IsRealTime
Definition: VirtualDate.cs:7
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
bool userFilter
Definition: Window.cs:132
GameDate date
Definition: World.cs:6
void SendPackage(Thing p)
Definition: World.cs:68
Definition: Zone.cs:12
List< Chara > ListMinions(Chara c)
Definition: Zone.cs:4023
Thing TryGetThingFromSharedContainer(Func< Thing, bool > func)
Definition: Zone.cs:2442
ElementContainerZone elements
Definition: Zone.cs:46
Thing FindSharedContainer(Thing t, List< Thing > containers=null, bool sharedOnly=true)
Definition: Zone.cs:2334
MapBounds bounds
Definition: Zone.cs:52
Chara SpawnMob(string id, Point pos=null)
Definition: Zone.cs:2988
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
Definition: Zone.cs:2416
bool IsActiveZone
Definition: Zone.cs:502
List< Element > ListLandFeats()
Definition: Zone.cs:3412
int GetSoilCost()
Definition: Zone.cs:4049
Card AddCard(Card t, Point point)
Definition: Zone.cs:2159
Map map
Definition: Zone.cs:66
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1500
bool demo
Definition: Version.cs:15