Elin Decompiled Documentation EA 23.239 Nightly Patch 1
Loading...
Searching...
No Matches
Trait.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using UnityEngine;
5
6public class Trait : EClass
7{
8 public enum TileMode
9 {
10 Default,
11 Door,
16 }
17
18 public enum CopyShopType
19 {
20 None,
21 Item,
23 }
24
26
27 public Card owner;
28
29 protected static List<Point> listRadiusPoints = new List<Point>();
30
31 public string[] Params
32 {
33 get
34 {
35 if (!owner.c_editorTraitVal.IsEmpty())
36 {
37 return ("," + owner.c_editorTraitVal).Split(',');
38 }
39 return owner.sourceCard.trait;
40 }
41 }
42
43 public virtual byte WeightMod => 0;
44
45 public virtual int IdSkin => owner.idSkin;
46
47 public virtual string Name => owner.NameSimple;
48
49 public virtual TileType tileType => owner.TileType;
50
51 public virtual RefCardName RefCardName => RefCardName.Default;
52
53 public virtual bool IsBlockPath => tileType.IsBlockPass;
54
55 public virtual bool IsBlockSight => tileType.IsBlockSight;
56
57 public virtual bool IsDoor => false;
58
59 public virtual bool IsOpenSight => false;
60
61 public virtual bool IsOpenPath => false;
62
63 public virtual bool IsFloating => false;
64
65 public virtual bool IsNoShop => false;
66
67 public virtual bool IsGround => false;
68
69 public virtual bool IsOnlyUsableByPc => false;
70
71 public virtual bool InvertHeldSprite => false;
72
73 public virtual bool IsChangeFloorHeight => owner.Pref.Surface;
74
75 public virtual bool ShouldRefreshTile
76 {
77 get
78 {
79 if (!IsBlockPath && !IsOpenSight)
80 {
81 return IsBlockSight;
82 }
83 return true;
84 }
85 }
86
87 public virtual bool ShouldTryRefreshRoom => IsDoor;
88
89 public virtual int InstallBottomPriority => -1;
90
91 public virtual bool CanHarvest => true;
92
93 public virtual int radius => 0;
94
95 public virtual TraitRadiusType radiusType => TraitRadiusType.Default;
96
97 public virtual bool CanUseRoomRadius => true;
98
99 public virtual int GuidePriotiy => 0;
100
101 public virtual int Electricity
102 {
103 get
104 {
105 if (!owner.isThing)
106 {
107 return 0;
108 }
109 int electricity = owner.Thing.source.electricity;
110 if (electricity > 0 || EClass._zone == null || EClass._zone.branch == null)
111 {
112 return electricity;
113 }
114 return electricity * 100 / (100 + EClass._zone.branch.Evalue(2700) / 2);
115 }
116 }
117
118 public virtual bool IgnoreLastStackHeight => false;
119
120 public virtual int Decay => owner.material.decay;
121
122 public virtual int DecaySpeed => 100;
123
124 public virtual int DecaySpeedChild => 100;
125
126 public virtual bool IsFridge => false;
127
128 public virtual int DefaultStock => 1;
129
130 public virtual bool HoldAsDefaultInteraction => false;
131
132 public virtual int CraftNum => 1;
133
134 public virtual bool ShowOrbit => false;
135
136 public virtual bool HaveUpdate => false;
137
138 public virtual bool IsSpot => radius > 0;
139
140 public virtual bool IsFactory => false;
141
142 public virtual bool CanAutofire => false;
143
144 public virtual bool CanName => false;
145
146 public virtual bool CanPutAway => true;
147
148 public virtual bool CanChangeHeight => true;
149
150 public virtual bool CanStack => owner.category.maxStack > 1;
151
152 public virtual bool CanCopyInBlueprint
153 {
154 get
155 {
156 if (owner.rarity <= Rarity.Superior && owner.sourceCard.value > 0)
157 {
158 return CanBeDestroyed;
159 }
160 return false;
161 }
162 }
163
164 public virtual bool CanBeAttacked => false;
165
166 public virtual bool CanBeTeleported => true;
167
168 public virtual bool CanExtendBuild => false;
169
170 public virtual string langNote => "";
171
172 public virtual string IDInvStyle => "default";
173
174 public virtual string IDActorEx => owner.Thing.source.idActorEx;
175
176 public virtual bool MaskOnBuild => false;
177
178 public virtual bool ShowContextOnPick => false;
179
180 public virtual bool IsThrowMainAction
181 {
182 get
183 {
184 if (!owner.HasTag(CTAG.throwWeapon))
185 {
186 return owner.IsMeleeWeapon;
187 }
188 return true;
189 }
190 }
191
192 public virtual bool LevelAsQuality => false;
193
194 public virtual bool UseDummyTile => true;
195
196 public virtual bool RequireFullStackCheck => false;
197
198 public virtual bool DisableAutoCombat => false;
199
201 {
202 get
203 {
204 if (!owner.IsPC)
205 {
206 return InvGridSize.Default;
207 }
208 return InvGridSize.Backpack;
209 }
210 }
211
212 public virtual bool IsContainer => false;
213
214 public virtual bool CanUseContent => CanSearchContent;
215
216 public virtual bool CanSearchContent
217 {
218 get
219 {
220 if (!owner.isChara)
221 {
222 if (IsContainer)
223 {
224 return owner.c_lockLv == 0;
225 }
226 return false;
227 }
228 return true;
229 }
230 }
231
232 public virtual bool CanOpenContainer
233 {
234 get
235 {
236 if (IsContainer)
237 {
238 return !owner.isNPCProperty;
239 }
240 return false;
241 }
242 }
243
244 public virtual bool IsSpecialContainer => false;
245
246 public virtual ContainerType ContainerType => ContainerType.Default;
247
248 public virtual ThrowType ThrowType => ThrowType.Default;
249
250 public virtual EffectDead EffectDead => EffectDead.Default;
251
252 public virtual bool IsHomeItem => false;
253
254 public virtual bool IsAltar => false;
255
256 public virtual bool IsRestSpot => false;
257
258 public virtual bool CanBeMasked => false;
259
260 public virtual bool IsLocalAct => true;
261
262 public virtual bool IsBlendBase => false;
263
264 public virtual bool CanBeOnlyBuiltInHome => false;
265
266 public virtual bool CanBuildInTown
267 {
268 get
269 {
271 {
273 }
274 return false;
275 }
276 }
277
278 public virtual bool CanBeHeld => ReqHarvest == null;
279
280 public virtual bool CanBeStolen
281 {
282 get
283 {
284 if (!CanOnlyCarry)
285 {
286 return CanBeHeld;
287 }
288 return false;
289 }
290 }
291
292 public virtual bool CanOnlyCarry => false;
293
294 public virtual bool CanBeDestroyed => true;
295
296 public virtual bool CanBeSmashedToDeath => false;
297
298 public virtual bool CanBeHallucinated => true;
299
300 public virtual bool CanBeDropped => true;
301
302 public virtual string ReqHarvest => null;
303
304 public virtual bool CanBeDisassembled
305 {
306 get
307 {
308 if (CanBeDestroyed && !(this is TraitTrap) && owner.things.Count == 0)
309 {
310 return owner.rarity < Rarity.Artifact;
311 }
312 return false;
313 }
314 }
315
316 public virtual bool CanBeShipped
317 {
318 get
319 {
320 if (!owner.IsImportant)
321 {
322 return !owner.IsUnique;
323 }
324 return false;
325 }
326 }
327
328 public virtual bool HasCharges => false;
329
330 public virtual bool ShowCharges => HasCharges;
331
332 public virtual bool ShowChildrenNumber => IsContainer;
333
334 public virtual bool ShowAsTool => false;
335
336 public virtual bool CanBeHeldAsFurniture
337 {
338 get
339 {
340 if (!(this is TraitTool))
341 {
342 return IsThrowMainAction;
343 }
344 return true;
345 }
346 }
347
348 public virtual bool HideInAdv => false;
349
350 public virtual bool NoHeldDir => false;
351
352 public virtual bool AlwaysHideOnLowWall => false;
353
355
356 public virtual bool RenderExtra => false;
357
358 public virtual float DropChance => 0f;
359
360 public virtual string IdNoRestock => owner.id;
361
362 public virtual int IdleUseChance => 3;
363
364 public virtual string RecipeCat => owner.sourceCard.RecipeCat;
365
366 public virtual bool IsTool => false;
367
368 public virtual string LangUse => "actUse";
369
370 public virtual bool IgnoreOnSteppedWhenMoving => false;
371
372 public virtual bool IsOn => owner.isOn;
373
374 public virtual bool IsAnimeOn
375 {
376 get
377 {
378 if (!IsOn)
379 {
380 return !IsToggle;
381 }
382 return true;
383 }
384 }
385
386 public bool IsToggle => ToggleType != ToggleType.None;
387
388 public virtual bool AutoToggle
389 {
390 get
391 {
392 if (IsLighting || ToggleType == ToggleType.Curtain || ToggleType == ToggleType.Electronics)
393 {
394 return !owner.disableAutoToggle;
395 }
396 return false;
397 }
398 }
399
400 public bool IsLighting
401 {
402 get
403 {
404 if (ToggleType != ToggleType.Fire)
405 {
406 return ToggleType == ToggleType.Light;
407 }
408 return true;
409 }
410 }
411
412 public virtual bool IsLightOn
413 {
414 get
415 {
416 if (!owner.isChara)
417 {
418 return owner.isOn;
419 }
420 return true;
421 }
422 }
423
424 public virtual bool IsNightOnlyLight
425 {
426 get
427 {
428 if (ToggleType != ToggleType.Electronics && IsToggle)
429 {
430 return !owner.isRoofItem;
431 }
432 return false;
433 }
434 }
435
436 public virtual TileMode tileMode => TileMode.Default;
437
438 public virtual bool UseAltTiles => owner.isOn;
439
440 public virtual bool UseLowblock => false;
441
442 public virtual bool UseExtra => true;
443
444 public virtual bool UseLightColor => true;
445
446 public virtual Color? ColorExtra => null;
447
448 public virtual int MaxFuel
449 {
450 get
451 {
452 if (ToggleType != ToggleType.Fire)
453 {
454 return 0;
455 }
456 return 100;
457 }
458 }
459
460 public virtual int FuelCost => 1;
461
462 public virtual bool ShowFuelWindow => true;
463
464 public bool IsRequireFuel => MaxFuel > 0;
465
466 public string IdToggleExtra => owner.Thing?.source.idToggleExtra;
467
468 public virtual ToggleType ToggleType
469 {
470 get
471 {
472 if (Electricity >= 0)
473 {
474 return ToggleType.None;
475 }
476 return ToggleType.Electronics;
477 }
478 }
479
480 public virtual string IdSoundToggleOn
481 {
482 get
483 {
484 if (Electricity >= 0)
485 {
486 if (ToggleType != ToggleType.Fire)
487 {
488 return "switch_on";
489 }
490 return "torch_lit";
491 }
492 return "switch_on_electricity";
493 }
494 }
495
496 public virtual string IdSoundToggleOff
497 {
498 get
499 {
500 if (Electricity >= 0)
501 {
502 if (ToggleType != ToggleType.Fire)
503 {
504 return "switch_off";
505 }
506 return "torch_unlit";
507 }
508 return "switch_off_electricity";
509 }
510 }
511
512 public virtual int ShopLv => Mathf.Max(1, EClass._zone.development / 10 + owner.c_invest * (100 + Guild.Merchant.InvestBonus()) / 100 + 1);
513
514 public virtual CopyShopType CopyShop => CopyShopType.None;
515
516 public virtual int NumCopyItem => 2 + Mathf.Min(owner.c_invest / 10, 3);
517
518 public virtual ShopType ShopType => ShopType.None;
519
520 public virtual CurrencyType CurrencyType => CurrencyType.Money;
521
522 public virtual PriceType PriceType => PriceType.Default;
523
524 public virtual bool AllowSell
525 {
526 get
527 {
528 if (CurrencyType != CurrencyType.Money)
529 {
530 return CurrencyType == CurrencyType.None;
531 }
532 return true;
533 }
534 }
535
536 public virtual int CostRerollShop
537 {
538 get
539 {
540 if (CurrencyType == CurrencyType.Money || CurrencyType == CurrencyType.Influence)
541 {
542 return 1;
543 }
544 return 0;
545 }
546 }
547
548 public virtual bool AllowCriminal => owner.isThing;
549
550 public virtual int RestockDay => 5;
551
552 public virtual SlaverType SlaverType => SlaverType.None;
553
554 public virtual string LangBarter => "daBuy";
555
556 public virtual bool RemoveGlobalOnBanish => false;
557
558 public virtual bool CanChangeAffinity => true;
559
560 public string TextNextRestock => GetTextRestock(LangBarter, pet: false);
561
562 public string TextNextRestockPet => GetTextRestock((SlaverType == SlaverType.Slave) ? "daBuySlave" : "daBuyPet", pet: true);
563
564 public string GetParam(int i, string def = null)
565 {
566 if (i < Params.Length)
567 {
568 return Params[i];
569 }
570 return def;
571 }
572
573 public int GetParamInt(int i, int def)
574 {
575 if (i < Params.Length)
576 {
577 return Params[i].ToInt();
578 }
579 return def;
580 }
581
582 public virtual bool Contains(RecipeSource r)
583 {
584 return r.idFactory == ((owner.sourceCard.origin != null) ? owner.sourceCard.origin.id : owner.id);
585 }
586
587 public virtual int GetValue()
588 {
589 return owner.sourceCard.value;
590 }
591
592 public virtual bool CanStackTo(Thing to)
593 {
594 return CanStack;
595 }
596
597 public virtual string GetHoverText()
598 {
599 return null;
600 }
601
602 public virtual Action GetHealAction(Chara c)
603 {
604 return null;
605 }
606
607 public virtual bool CanBlend(Thing t)
608 {
609 return false;
610 }
611
612 public virtual void OnBlend(Thing t, Chara c)
613 {
614 }
615
616 public virtual int GetActDuration(Chara c)
617 {
618 return 0;
619 }
620
622 {
623 return null;
624 }
625
626 public virtual Sprite GetRefSprite()
627 {
628 return null;
629 }
630
631 public virtual void OnRenderExtra(RenderParam p)
632 {
633 }
634
635 public virtual Emo2 GetHeldEmo(Chara c)
636 {
637 return Emo2.none;
638 }
639
640 public virtual void SetOwner(Card _owner)
641 {
642 owner = _owner;
643 OnSetOwner();
644 }
645
646 public virtual bool IdleUse(Chara c, int dist)
647 {
648 return false;
649 }
650
651 public virtual void OnSetOwner()
652 {
653 }
654
655 public virtual void OnImportMap()
656 {
657 }
658
659 public virtual void SetParams(params string[] s)
660 {
661 }
662
663 public virtual void OnCrafted(Recipe recipe, List<Thing> ings)
664 {
665 }
666
667 public virtual void OnCreate(int lv)
668 {
669 }
670
671 public virtual void OnEquip(Chara c, bool onSetOwner)
672 {
673 }
674
675 public virtual void OnUnequip(Chara c)
676 {
677 }
678
679 public virtual void OnChangePlaceState(PlaceState state)
680 {
681 }
682
683 public virtual void OnAddedToZone()
684 {
685 }
686
687 public virtual void OnRemovedFromZone()
688 {
689 }
690
691 public virtual void OnSimulateHour(VirtualDate date)
692 {
693 }
694
695 public virtual string GetName()
696 {
697 return owner.sourceCard.GetText();
698 }
699
700 public virtual void SetName(ref string s)
701 {
702 }
703
704 public virtual void OnRenderTile(Point point, HitResult result, int dir)
705 {
706 if (radius == 0)
707 {
708 return;
709 }
710 Vector3 vector = point.Position();
711 vector.z += EClass.setting.render.thingZ;
712 foreach (Point item in ListPoints(point))
713 {
714 Vector3 vector2 = item.Position();
715 EClass.screen.guide.passGuideFloor.Add(vector2.x, vector2.y, vector2.z, 10f, 0.3f);
716 }
717 }
718
719 public virtual int CompareTo(Card b)
720 {
721 return 0;
722 }
723
724 public virtual bool CanBuiltAt(Point p)
725 {
726 return true;
727 }
728
729 public virtual void Update()
730 {
731 }
732
734 {
735 return owner.pos;
736 }
737
738 public Point GetRandomPoint(Func<Point, bool> func = null, Chara accessChara = null)
739 {
740 if (radius == 0)
741 {
742 return owner.pos;
743 }
744 List<Point> list = ListPoints();
745 for (int i = 0; i < 50; i++)
746 {
747 Point point = list.RandomItem();
748 if (point.IsValid && (func == null || func(point)) && (accessChara == null || accessChara.HasAccess(point)))
749 {
750 return point;
751 }
752 }
753 return list[0];
754 }
755
756 public virtual List<Point> ListPoints(Point center = null, bool onlyPassable = true)
757 {
758 listRadiusPoints.Clear();
759 if (center == null)
760 {
761 center = owner.pos;
762 }
763 if (radius == 0)
764 {
765 listRadiusPoints.Add(center.Copy());
766 return listRadiusPoints;
767 }
768 Room room = center.cell.room;
769 if (room != null && CanUseRoomRadius)
770 {
771 foreach (Point point in room.points)
772 {
773 if (radiusType == TraitRadiusType.Farm)
774 {
775 listRadiusPoints.Add(point.Copy());
776 }
777 else if ((!onlyPassable || !point.cell.blocked) && !point.cell.HasBlock && point.cell.HasFloor)
778 {
779 listRadiusPoints.Add(point.Copy());
780 }
781 }
782 }
783 else
784 {
785 EClass._map.ForeachSphere(center.x, center.z, radius + 1, delegate(Point p)
786 {
787 if (radiusType == TraitRadiusType.Farm)
788 {
789 if (!p.cell.HasBlock || p.cell.HasFence)
790 {
791 listRadiusPoints.Add(p.Copy());
792 }
793 }
794 else if ((!onlyPassable || !p.cell.blocked) && !p.cell.HasBlock && p.cell.HasFloor && (!onlyPassable || Los.IsVisible(center, p)))
795 {
796 listRadiusPoints.Add(p.Copy());
797 }
798 });
799 }
800 if (listRadiusPoints.Count == 0)
801 {
802 listRadiusPoints.Add(center.Copy());
803 }
804 return listRadiusPoints;
805 }
806
807 public virtual Recipe GetRecipe()
808 {
809 return Recipe.Create(owner.Thing);
810 }
811
812 public virtual Recipe GetBuildModeRecipe()
813 {
814 return Recipe.Create(owner.Thing);
815 }
816
817 public virtual bool CanCook(Card c)
818 {
819 if (c == null || !ExistsOnMap || !(c.trait is TraitFood))
820 {
821 return false;
822 }
823 return true;
824 }
825
826 public void CookProgress()
827 {
828 if (!ExistsOnMap)
829 {
830 return;
831 }
832 foreach (Card item in owner.pos.ListCards())
833 {
834 owner.PlaySound("cook");
835 item.renderer.PlayAnime(AnimeID.Jump);
836 }
837 }
838
839 public virtual bool CanOffer(Card tg)
840 {
841 if (tg == null || tg.isChara || tg.trait.CanOnlyCarry)
842 {
843 return false;
844 }
845 if (tg.rarity == Rarity.Artifact)
846 {
847 return false;
848 }
849 return true;
850 }
851
852 public void OfferProcess(Chara cc)
853 {
854 if (!ExistsOnMap)
855 {
856 return;
857 }
858 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(owner.c_idDeity, EClass.sources.religions.map["eyth"]);
859 string @ref = row.GetTextArray("name2")[1];
860 string ref2 = row.GetTextArray("name2")[0];
861 if (EClass.rnd(3) == 0)
862 {
863 cc.Talk("offer", @ref, ref2);
864 }
865 foreach (Card item in owner.pos.ListCards())
866 {
867 if (CanOffer(item))
868 {
869 item.renderer.PlayAnime(AnimeID.Shiver);
870 }
871 }
872 }
873
874 public void Offer(Chara cc)
875 {
876 if (!ExistsOnMap)
877 {
878 return;
879 }
880 foreach (Card item in owner.pos.ListCards())
881 {
882 if (CanOffer(item))
883 {
884 item.Destroy();
885 cc.depression.Mod(100);
886 owner.PlaySound("offering");
887 }
888 }
889 }
890
891 public virtual bool TryProgress(AIProgress p)
892 {
893 return true;
894 }
895
896 public virtual LockOpenState TryOpenLock(Chara cc, bool msgFail = true)
897 {
898 Thing thing = cc.things.FindBest<TraitLockpick>((Thing t) => -t.c_charges);
899 int num = ((thing == null) ? (cc.Evalue(280) / 2 + 2) : (cc.Evalue(280) + 10));
900 int num2 = owner.c_lockLv;
901 bool flag = this is TraitChestPractice;
902 if (flag)
903 {
904 num2 = num / 4 * 3 - 1;
905 }
906 if (num <= num2 && cc.IsPC)
907 {
908 cc.PlaySound("lock");
909 cc.Say("openLockFail2");
910 owner.PlayAnime(AnimeID.Shiver);
911 return LockOpenState.NotEnoughSkill;
912 }
913 if (thing != null && !flag)
914 {
915 thing.ModCharge(-1, destroy: true);
916 }
917 if (EClass.rnd(num + 6) > num2 + 5 || (!cc.IsPC && EClass.rnd(20) == 0) || EClass.rnd(200) == 0)
918 {
919 cc.PlaySound("lock_open");
920 cc.Say("lockpick_success", cc, owner);
921 int num3 = 100 + num2 * 10;
922 if (owner.c_lockedHard)
923 {
924 num3 *= 10;
925 }
926 cc.ModExp(280, num3);
927 owner.c_lockLv = 0;
928 if (owner.c_lockedHard)
929 {
930 owner.c_lockedHard = false;
931 owner.c_priceAdd = 0;
932 }
933 if (cc.IsPC && owner.isLostProperty)
934 {
936 }
937 owner.isLostProperty = false;
938 return LockOpenState.Success;
939 }
940 cc.PlaySound("lock");
941 if (cc.IsPC)
942 {
943 cc.Say("openLockFail");
944 }
945 cc.ModExp(280, (thing != null) ? 50 : 30);
946 if ((thing == null) | (EClass.rnd(2) == 0))
947 {
948 cc.stamina.Mod(-1);
949 }
950 return LockOpenState.Fail;
951 }
952
953 public virtual void WriteNote(UINote n, bool identified)
954 {
955 }
956
958 {
959 _ = 7;
960 return owner.sourceCard._index;
961 }
962
963 public virtual HotItem GetHotItem()
964 {
965 return new HotItemHeld(owner as Thing);
966 }
967
968 public virtual bool CanRead(Chara c)
969 {
970 return false;
971 }
972
973 public virtual void OnRead(Chara c)
974 {
975 }
976
977 public virtual bool CanEat(Chara c)
978 {
979 return owner.HasElement(10);
980 }
981
982 public virtual void OnEat(Chara c)
983 {
984 }
985
986 public virtual bool CanDrink(Chara c)
987 {
988 return false;
989 }
990
991 public virtual void OnDrink(Chara c)
992 {
993 }
994
995 public virtual void OnThrowGround(Chara c, Point p)
996 {
997 }
998
999 public virtual bool CanUse(Chara c)
1000 {
1001 return false;
1002 }
1003
1004 public virtual bool CanUse(Chara c, Card tg)
1005 {
1006 return false;
1007 }
1008
1009 public virtual bool CanUse(Chara c, Point p)
1010 {
1011 return false;
1012 }
1013
1014 public virtual bool OnUse(Chara c)
1015 {
1016 if (c.held != owner)
1017 {
1018 c.TryHoldCard(owner);
1019 }
1020 return true;
1021 }
1022
1023 public virtual bool OnUse(Chara c, Card tg)
1024 {
1025 return true;
1026 }
1027
1028 public virtual bool OnUse(Chara c, Point p)
1029 {
1030 return true;
1031 }
1032
1033 public virtual void TrySetAct(ActPlan p)
1034 {
1035 if (CanUse(owner.Chara))
1036 {
1037 p.TrySetAct(LangUse, () => OnUse(p.cc), owner);
1038 }
1039 }
1040
1041 public virtual void TrySetHeldAct(ActPlan p)
1042 {
1043 }
1044
1045 public virtual void OnHeld()
1046 {
1047 }
1048
1049 public virtual void OnTickHeld()
1050 {
1051 }
1052
1053 public virtual void OnSetCurrentItem()
1054 {
1055 }
1056
1057 public virtual void OnUnsetCurrentItem()
1058 {
1059 }
1060
1061 public virtual bool OnChildDecay(Card c, bool firstDecay)
1062 {
1063 return true;
1064 }
1065
1066 public virtual bool CanChildDecay(Card c)
1067 {
1068 return false;
1069 }
1070
1071 public virtual void OnSetCardGrid(ButtonGrid b)
1072 {
1073 }
1074
1075 public virtual void OnStepped(Chara c)
1076 {
1077 }
1078
1079 public virtual void OnSteppedOut(Chara c)
1080 {
1081 }
1082
1083 public virtual void OnOpenDoor(Chara c)
1084 {
1085 }
1086
1087 public void Install(bool byPlayer)
1088 {
1089 if (Electricity != 0)
1090 {
1091 EClass._zone.dirtyElectricity = true;
1092 if (Electricity > 0)
1093 {
1094 EClass._zone.electricity += Electricity;
1095 EClass.pc.PlaySound("electricity_on");
1096 }
1097 }
1098 TryToggle();
1099 owner.RecalculateFOV();
1100 if (EClass._zone.isStarted && ToggleType == ToggleType.Fire && owner.isOn)
1101 {
1102 owner.PlaySound("fire");
1103 }
1104 OnInstall(byPlayer);
1105 }
1106
1107 public void Uninstall()
1108 {
1109 if (Electricity != 0)
1110 {
1111 if (owner.isOn)
1112 {
1113 Toggle(on: false, silent: true);
1114 }
1115 EClass._zone.dirtyElectricity = true;
1116 if (Electricity > 0)
1117 {
1118 EClass._zone.electricity -= Electricity;
1119 EClass.pc.PlaySound("electricity_off");
1120 }
1121 }
1122 OnUninstall();
1123 }
1124
1125 public virtual void OnInstall(bool byPlayer)
1126 {
1127 }
1128
1129 public virtual void OnUninstall()
1130 {
1131 }
1132
1133 public virtual void TryToggle()
1134 {
1135 if (!owner.IsInstalled)
1136 {
1137 return;
1138 }
1139 if (Electricity < 0 && owner.isOn && EClass._zone.electricity < 0)
1140 {
1141 Toggle(on: false, silent: true);
1142 }
1143 else if (AutoToggle)
1144 {
1145 int num = ((EClass._map.config.hour == -1) ? EClass.world.date.hour : EClass._map.config.hour);
1146 bool on = !IsNightOnlyLight || num >= 17 || num <= 5 || EClass._map.IsIndoor;
1148 {
1149 on = false;
1150 }
1151 Toggle(on, silent: true);
1152 }
1153 }
1154
1155 public virtual void Toggle(bool on, bool silent = false)
1156 {
1157 if (owner.isOn == on)
1158 {
1159 return;
1160 }
1161 if (Electricity < 0)
1162 {
1163 if (on)
1164 {
1165 if (EClass._zone.electricity + Electricity < 0)
1166 {
1168 {
1169 if (!silent)
1170 {
1171 owner.Say("notEnoughElectricity", owner);
1172 }
1173 owner.PlaySound("electricity_insufficient");
1174 }
1175 return;
1176 }
1177 EClass._zone.electricity += Electricity;
1178 }
1179 else
1180 {
1181 EClass._zone.electricity -= Electricity;
1182 }
1183 }
1184 owner.isOn = on;
1185 PlayToggleEffect(silent);
1186 OnToggle();
1187 }
1188
1189 public virtual void PlayToggleEffect(bool silent)
1190 {
1191 bool flag = ToggleType == ToggleType.Fire;
1192 bool isOn = owner.isOn;
1193 switch (ToggleType)
1194 {
1195 case ToggleType.Lever:
1196 if (!silent)
1197 {
1198 owner.Say("lever", EClass.pc, owner);
1199 owner.PlaySound("switch_lever");
1200 }
1201 return;
1202 case ToggleType.Curtain:
1203 if (!silent)
1204 {
1205 owner.Say(isOn ? "close" : "open", EClass.pc, owner);
1206 owner.PlaySound("Material/leather_drop");
1207 }
1208 owner.pos.RefreshNeighborTiles();
1210 return;
1211 case ToggleType.None:
1212 return;
1213 }
1214 if (isOn)
1215 {
1216 if (!silent)
1217 {
1218 owner.Say(flag ? "toggle_fire" : "toggle_ele", EClass.pc, owner);
1219 owner.PlaySound(IdSoundToggleOn);
1220 }
1221 RefreshRenderer();
1222 owner.RecalculateFOV();
1223 }
1224 else
1225 {
1226 if (!silent)
1227 {
1228 owner.PlaySound(IdSoundToggleOff);
1229 }
1230 RefreshRenderer();
1231 owner.RecalculateFOV();
1232 }
1233 }
1234
1235 public virtual void OnToggle()
1236 {
1237 }
1238
1239 public virtual void TrySetToggleAct(ActPlan p)
1240 {
1241 if (!p.IsSelfOrNeighbor)
1242 {
1243 return;
1244 }
1245 switch (ToggleType)
1246 {
1247 case ToggleType.Lever:
1248 p.TrySetAct("ActToggleLever", delegate
1249 {
1250 Toggle(!owner.isOn);
1251 return true;
1252 }, owner);
1253 break;
1254 case ToggleType.Curtain:
1255 p.TrySetAct(owner.isOn ? "actOpen" : "actClose", delegate
1256 {
1257 Toggle(!owner.isOn);
1258 return true;
1259 }, owner);
1260 break;
1261 case ToggleType.Fire:
1262 case ToggleType.Light:
1263 case ToggleType.Electronics:
1264 {
1265 bool flag = ToggleType == ToggleType.Fire;
1266 if (EClass._zone.IsPCFaction || p.altAction || this is TraitCrafter || Electricity < 0)
1267 {
1268 if (owner.isOn)
1269 {
1270 if (p.altAction)
1271 {
1272 p.TrySetAct(flag ? "ActExtinguishTorch" : "ActToggleOff", delegate
1273 {
1274 Toggle(on: false);
1275 return true;
1276 }, owner);
1277 }
1278 }
1279 else if (!(this is TraitFactory) && !(this is TraitIncubator) && (!IsRequireFuel || owner.c_charges > 0))
1280 {
1281 p.TrySetAct(flag ? "ActTorch" : "ActToggleOn", delegate
1282 {
1283 Toggle(on: true);
1284 return true;
1285 }, owner);
1286 }
1287 if (IsRequireFuel && ((p.altAction && owner.c_charges < MaxFuel) || (!owner.isOn && owner.c_charges == 0)) && ShowFuelWindow)
1288 {
1289 p.TrySetAct("ActFuel", delegate
1290 {
1292 return false;
1293 }, owner);
1294 }
1295 }
1296 if (p.altAction)
1297 {
1298 p.TrySetAct("disableAutoToggle".lang((owner.disableAutoToggle ? "off" : "on").lang()), delegate
1299 {
1300 owner.disableAutoToggle = !owner.disableAutoToggle;
1301 SE.Click();
1302 return true;
1303 }, owner);
1304 }
1305 break;
1306 }
1307 }
1308 }
1309
1310 public bool IsFuelEnough(int num = 1, List<Thing> excludes = null, bool tryRefuel = true)
1311 {
1312 if (!IsRequireFuel)
1313 {
1314 return true;
1315 }
1316 if (owner.c_charges >= FuelCost * num)
1317 {
1318 return true;
1319 }
1320 if (owner.autoRefuel)
1321 {
1322 TryRefuel(FuelCost * num - owner.c_charges, excludes);
1323 }
1324 return owner.c_charges >= FuelCost * num;
1325 }
1326
1327 public bool IsFuel(string s)
1328 {
1329 return GetFuelValue(s) > 0;
1330 }
1331
1332 public bool IsFuel(Thing t)
1333 {
1334 return GetFuelValue(t) > 0;
1335 }
1336
1337 public int GetFuelValue(Thing t)
1338 {
1339 if (t.c_isImportant)
1340 {
1341 return 0;
1342 }
1343 return GetFuelValue(t.id);
1344 }
1345
1346 public int GetFuelValue(string id)
1347 {
1348 if (ToggleType == ToggleType.Electronics)
1349 {
1350 if (id == "battery")
1351 {
1352 return 20;
1353 }
1354 }
1355 else
1356 {
1357 if (id == "log")
1358 {
1359 return 20;
1360 }
1361 if (id == "branch")
1362 {
1363 return 5;
1364 }
1365 }
1366 return 0;
1367 }
1368
1369 public void Refuel(Thing t)
1370 {
1371 t.PlaySoundDrop(spatial: false);
1372 owner.ModCharge(t.Num * GetFuelValue(t));
1373 Msg.Say("fueled", t);
1374 if (!owner.isOn)
1375 {
1376 owner.trait.Toggle(on: true);
1377 }
1378 t.Destroy();
1379 owner.renderer.PlayAnime(AnimeID.Shiver);
1380 }
1381
1382 public void TryRefuel(int dest, List<Thing> excludes)
1383 {
1384 if (FindFuel(refuel: false))
1385 {
1386 FindFuel(refuel: true);
1387 }
1388 bool FindFuel(bool refuel)
1389 {
1390 int num = dest;
1391 List<Thing> list = EClass._zone.TryListThingsInSpot<TraitSpotFuel>((Thing t) => IsFuel(t));
1392 EClass.pc.things.Foreach(delegate(Thing t)
1393 {
1394 if (IsFuel(t) && t.tier == 0 && (excludes == null || !excludes.Contains(t)))
1395 {
1396 list.Add(t);
1397 }
1398 });
1399 foreach (Thing item in list)
1400 {
1401 if (num > 0)
1402 {
1403 int num2 = Mathf.Min(item.Num, Mathf.CeilToInt((float)num / (float)GetFuelValue(item)));
1404 num -= GetFuelValue(item) * num2;
1405 if (refuel)
1406 {
1407 Refuel(item.Split(num2));
1408 }
1409 }
1410 }
1411 return num <= 0;
1412 }
1413 }
1414
1415 public virtual void OnEnterScreen()
1416 {
1417 RefreshRenderer();
1418 }
1419
1420 public virtual void RefreshRenderer()
1421 {
1422 if (owner.renderer.isSynced && !IdToggleExtra.IsEmpty())
1423 {
1424 if (owner.isOn)
1425 {
1426 owner.renderer.AddExtra(IdToggleExtra);
1427 }
1428 else
1429 {
1430 owner.renderer.RemoveExtra(IdToggleExtra);
1431 }
1432 }
1433 }
1434
1435 public virtual void SetMainText(UIText t, bool hotitem)
1436 {
1437 if (owner.isThing && !owner.Thing.source.attackType.IsEmpty() && owner.ammoData != null)
1438 {
1439 t.SetText(owner.c_ammo.ToString() ?? "", FontColor.Charge);
1440 t.SetActive(enable: true);
1441 }
1442 else if (owner.Num == 1 && ShowCharges && owner.IsIdentified)
1443 {
1444 t.SetText(owner.c_charges.ToString() ?? "", FontColor.Charge);
1445 t.SetActive(enable: true);
1446 }
1447 else
1448 {
1449 t.SetText(owner.Num.ToShortNumber(), FontColor.ButtonGrid);
1450 t.SetActive(owner.Num > 1);
1451 }
1452 }
1453
1454 public virtual bool CanCopy(Thing t)
1455 {
1456 return false;
1457 }
1458
1459 public string GetTextRestock(string lang, bool pet)
1460 {
1461 int rawDeadLine = 0;
1462 if (pet)
1463 {
1464 SlaverData obj = owner.GetObj<SlaverData>(5);
1465 if (obj != null)
1466 {
1467 rawDeadLine = obj.dateRefresh;
1468 }
1469 }
1470 else
1471 {
1472 rawDeadLine = owner.c_dateStockExpire;
1473 }
1474 int remainingHours = EClass.world.date.GetRemainingHours(rawDeadLine);
1475 if (remainingHours > 0)
1476 {
1477 return "nextRestock".lang(lang.lang(), Date.GetText(remainingHours) ?? "");
1478 }
1479 return lang.lang();
1480 }
1481
1483 {
1484 if (SlaverType != 0)
1485 {
1486 SlaverData obj = owner.GetObj<SlaverData>(5);
1487 if (obj != null && EClass.world.date.IsExpired(obj.dateRefresh))
1488 {
1489 return Emo2.restock;
1490 }
1491 }
1492 int c_dateStockExpire = owner.c_dateStockExpire;
1493 if (c_dateStockExpire != 0 && EClass.world.date.IsExpired(c_dateStockExpire))
1494 {
1495 if (ShopType == ShopType.None)
1496 {
1497 return Emo2.blessing;
1498 }
1499 return Emo2.restock;
1500 }
1501 return Emo2.none;
1502 }
1503
1504 public void OnBarter(bool reroll = false)
1505 {
1506 Thing t = owner.things.Find("chest_merchant");
1507 if (t == null)
1508 {
1509 t = ThingGen.Create("chest_merchant");
1510 owner.AddThing(t);
1511 }
1512 t.c_lockLv = 0;
1514 {
1515 return;
1516 }
1517 owner.c_dateStockExpire = EClass.world.date.GetRaw(24 * RestockDay);
1518 owner.isRestocking = true;
1519 t.things.DestroyAll((Thing _t) => _t.GetInt(101) != 0);
1520 foreach (Thing thing9 in t.things)
1521 {
1522 thing9.invX = -1;
1523 }
1524 switch (ShopType)
1525 {
1526 case ShopType.Plat:
1527 NoRestock(ThingGen.Create("lucky_coin").SetNum(10));
1528 NoRestock(ThingGen.CreateSkillbook(6662));
1529 NoRestock(ThingGen.CreateSkillbook(6664));
1530 break;
1531 case ShopType.Copy:
1532 {
1533 Thing c_copyContainer = owner.c_copyContainer;
1534 if (c_copyContainer == null)
1535 {
1536 break;
1537 }
1538 int num3 = 0;
1539 foreach (Thing thing10 in c_copyContainer.things)
1540 {
1541 if (!owner.trait.CanCopy(thing10))
1542 {
1543 continue;
1544 }
1545 Thing thing3 = thing10.Duplicate(1);
1546 thing3.isStolen = false;
1547 thing3.isCopy = true;
1548 thing3.c_priceFix = 0;
1549 foreach (Element item in thing3.elements.dict.Values.Where((Element e) => e.HasTag("noInherit")).ToList())
1550 {
1551 thing3.elements.Remove(item.id);
1552 }
1553 int num4 = 1;
1554 switch (owner.trait.CopyShop)
1555 {
1556 case CopyShopType.Item:
1557 {
1558 num4 = (1000 + owner.c_invest * 100) / (thing3.GetPrice(CurrencyType.Money, sell: false, PriceType.CopyShop) + 50);
1559 int[] array = new int[3] { 704, 703, 702 };
1560 foreach (int ele in array)
1561 {
1562 if (thing3.HasElement(ele))
1563 {
1564 num4 = 1;
1565 }
1566 }
1567 break;
1568 }
1569 case CopyShopType.Spellbook:
1570 thing3.c_charges = thing10.c_charges;
1571 break;
1572 }
1573 if (num4 > 1 && thing3.trait.CanStack)
1574 {
1575 thing3.SetNum(num4);
1576 }
1577 AddThing(thing3);
1578 num3++;
1579 if (num3 > owner.trait.NumCopyItem)
1580 {
1581 break;
1582 }
1583 }
1584 break;
1585 }
1586 case ShopType.Specific:
1587 {
1588 string id2 = owner.id;
1589 if (!(id2 == "mogu"))
1590 {
1591 if (!(id2 == "felmera"))
1592 {
1593 break;
1594 }
1595 foreach (Thing item2 in new DramaOutcome().ListFelmeraBarter())
1596 {
1597 AddThing(item2);
1598 }
1599 AddThing(ThingGen.Create("crimale2"));
1600 }
1601 else
1602 {
1603 AddThing(ThingGen.Create("casino_coin").SetNum(5000));
1604 }
1605 break;
1606 }
1607 case ShopType.Deed:
1608 Add("deed", 1, 0);
1609 Add("deed_move", 2 + EClass.rnd(5), 0);
1610 Add("license_illumination", 1, 0);
1611 Add("license_void", 1, 0);
1612 Add("license_adv", 1, 0);
1613 break;
1614 case ShopType.RedBook:
1615 {
1616 for (int num7 = 0; num7 < 30; num7++)
1617 {
1618 AddThing(ThingGen.CreateFromCategory((EClass.rnd(2) == 0) ? "_book" : "book"));
1619 }
1620 break;
1621 }
1622 case ShopType.Seed:
1623 {
1624 AddThing(TraitSeed.MakeSeed("rice")).SetNum(4 + EClass.rnd(4));
1625 AddThing(TraitSeed.MakeSeed("cabbage")).SetNum(4 + EClass.rnd(4));
1626 AddThing(TraitSeed.MakeSeed("carrot")).SetNum(4 + EClass.rnd(4));
1627 AddThing(TraitSeed.MakeSeed("potato")).SetNum(4 + EClass.rnd(4));
1628 AddThing(TraitSeed.MakeSeed("corn")).SetNum(4 + EClass.rnd(4));
1629 for (int num8 = 0; num8 < EClass.rnd(3) + 1; num8++)
1630 {
1631 Add("462", 1, 0);
1632 }
1633 for (int num9 = 0; num9 < EClass.rnd(3) + 1; num9++)
1634 {
1635 Add("1167", 1, 0);
1636 }
1637 break;
1638 }
1639 case ShopType.Loytel:
1640 Add("board_map", 1, 0);
1641 Add("board_build", 1, 0);
1642 Add("book_resident", 1, 0);
1643 Add("3", 1, 0);
1644 Add("4", 1, 0);
1645 Add("5", 1, 0);
1646 AddThing(ThingGen.CreatePlan(2512));
1647 AddThing(ThingGen.CreatePlan(2810));
1648 NoRestock(ThingGen.Create("rp_block").SetLv(1).SetNum(10));
1649 if (EClass.game.quests.GetPhase<QuestVernis>() >= 3)
1650 {
1651 NoRestock(ThingGen.CreateRecipe("explosive"));
1652 }
1653 break;
1654 case ShopType.Starter:
1655 case ShopType.StarterEx:
1656 Add("board_home", 1, 0);
1657 Add("board_resident", 1, 0);
1658 Add("1", 1, 0);
1659 Add("2", 1, 0);
1660 if (ShopType == ShopType.StarterEx)
1661 {
1662 Add("board_expedition", 1, 0);
1663 Add("mailpost", 1, 0);
1664 Add("record", 1, 0);
1665 Add("tent2", 1, 0);
1666 Add("tent1", 1, 0);
1667 Add("wagon1", 1, 0);
1668 Add("wagon_big", 1, 0);
1669 Add("wagon_big2", 1, 0);
1670 Add("wagon_big3", 1, 0);
1671 Add("wagon_big4", 1, 0);
1672 Add("wagon_big5", 1, 0);
1673 Add("teleporter", 1, 0);
1674 Add("teleporter2", 1, 0);
1675 Add("recharger", 1, 0);
1676 Add("machine_gene2", 1, 0);
1677 NoRestock(ThingGen.CreateRecipe("torch_wall"));
1678 NoRestock(ThingGen.CreateRecipe("factory_sign"));
1679 NoRestock(ThingGen.CreateRecipe("beehive"));
1680 NoRestock(ThingGen.Create("rp_food").SetNum(5).SetLv(10)
1681 .Thing);
1682 }
1683 else
1684 {
1685 AddThing(ThingGen.CreatePlan(2119));
1686 NoRestock(ThingGen.Create("rp_food").SetNum(5).SetLv(5)
1687 .Thing);
1688 }
1689 break;
1690 case ShopType.Farris:
1691 AddThing(ThingGen.CreateScroll(8220, 4 + EClass.rnd(6)));
1692 AddThing(ThingGen.CreateScroll(8221, 4 + EClass.rnd(6)));
1693 Add("drawing_paper", 10, 0);
1694 Add("drawing_paper2", 10, 0);
1695 Add("stethoscope", 1, 0);
1696 Add("whip_love", 1, 0);
1697 Add("whip_interest", 1, 0);
1698 Add("syringe_blood", 20, 0);
1700 {
1701 Add("chest_tax", 1, 0);
1702 }
1703 break;
1704 case ShopType.Guild:
1705 if (this is TraitClerk_Merchant)
1706 {
1707 Add("flyer", 1, 0).SetNum(99);
1708 }
1709 break;
1710 case ShopType.Influence:
1711 {
1712 bool num5 = owner.id == "big_sister";
1713 TraitTicketFurniture.SetZone(num5 ? EClass.game.spatials.Find("little_garden") : EClass._zone, Add("ticket_furniture", 1, 0).SetNum(99));
1714 if (num5)
1715 {
1716 Add("littleball", 10, 0);
1717 if (!owner.Chara.affinity.CanGiveCard())
1718 {
1719 break;
1720 }
1721 if (!owner.Chara.HasElement(287))
1722 {
1723 owner.Chara.elements.SetBase(287, (!EClass.debug.enable) ? 1 : 50);
1724 }
1725 if (!reroll)
1726 {
1727 for (int m = 0; m < 20; m++)
1728 {
1729 owner.Chara.ModExp(287, 1000);
1730 }
1731 }
1732 Thing thing4 = CraftUtil.MakeLoveLunch(owner.Chara);
1733 thing4.elements.SetBase(1229, 1);
1734 AddThing(thing4);
1735 break;
1736 }
1737 for (int n = 0; n < 10; n++)
1738 {
1739 Thing thing5 = ThingGen.Create(EClass._zone.IsFestival ? "1123" : ((EClass.rnd(3) == 0) ? "1169" : "1160"));
1740 thing5.DyeRandom();
1741 AddThing(thing5);
1742 }
1743 if (EClass._zone is Zone_Exile)
1744 {
1745 for (int num6 = 0; num6 < 30; num6++)
1746 {
1747 Add("1235", 1, -1);
1748 Add("1236", 1, -1);
1749 Add("1237", 1, -1);
1750 Add("1239", 1, -1);
1751 Add("candle9", 1, -1);
1752 Add("candle9", 1, -1);
1753 Add("candle9", 1, -1);
1754 Add("candle8", 1, 0);
1755 Add("candle8b", 1, 0);
1756 Add("candle8c", 1, 0);
1757 }
1758 }
1759 break;
1760 }
1761 case ShopType.Casino:
1762 {
1763 Add("chest_tax", 1, 0);
1764 Add("1165", 1, 0);
1765 Add("monsterball", 1, 0).SetNum(3).SetLv(10);
1766 Add("1175", 1, 0);
1767 Add("1176", 1, 0);
1768 Add("pillow_ehekatl", 1, 0);
1769 Add("grave_dagger1", 1, 0);
1770 Add("grave_dagger2", 1, 0);
1771 Add("434", 1, 0);
1772 Add("433", 1, 0);
1773 Add("714", 1, 0);
1774 Add("1017", 1, 0);
1775 Add("1155", 1, 0);
1776 Add("1287", 1, 0);
1777 Add("1288", 1, 0);
1778 Add("1289", 1, 0);
1779 Add("1290", 1, 0);
1780 Add("1011", 1, 0);
1781 AddThing(ThingGen.CreatePerfume(9500, 5));
1782 AddThing(ThingGen.CreatePerfume(9501, 5));
1783 AddThing(ThingGen.CreatePerfume(9502, 5));
1784 AddThing(ThingGen.CreatePerfume(9503, 5));
1785 for (int k = 0; k < 5; k++)
1786 {
1787 Thing thing2 = ThingGen.CreateFromCategory("seasoning").SetNum(10);
1788 thing2.elements.SetBase(2, 40);
1789 thing2.c_priceFix = 1000;
1790 AddThing(thing2);
1791 }
1792 break;
1793 }
1794 case ShopType.Medal:
1795 NoRestockId("sword_dragon");
1796 Add("sword_dragon", 1, 0).SetReplica(on: true);
1797 NoRestockId("point_stick");
1798 Add("point_stick", 1, 0).SetReplica(on: true);
1799 NoRestockId("blunt_bonehammer");
1800 Add("blunt_bonehammer", 1, 0).SetReplica(on: true);
1801 NoRestockId("pole_gunlance");
1802 Add("pole_gunlance", 1, 0).SetReplica(on: true);
1803 NoRestockId("sword_muramasa");
1804 Add("sword_muramasa", 1, 0).SetReplica(on: true);
1805 NoRestockId("sword_forgetmenot");
1806 Add("sword_forgetmenot", 1, 0).SetReplica(on: true);
1807 NoRestockId("dagger_fish");
1808 Add("dagger_fish", 1, 0).SetReplica(on: true);
1809 NoRestockId("sword_zephir");
1810 Add("sword_zephir", 1, 0).SetReplica(on: true);
1811 Add("ribbon", 1, 0);
1812 Add("helm_sage", 1, 0);
1813 Add("diary_sister", 1, 0);
1814 Add("diary_catsister", 1, 0);
1815 Add("diary_lady", 1, 0);
1816 Add("1165", 1, 0).SetNum(5);
1817 AddThing(ThingGen.CreateScroll(9160).SetNum(5));
1818 Add("1282", 1, 0).SetNum(5);
1819 Add("monsterball", 1, 0).SetNum(3).SetLv(20);
1820 Add("monsterball", 1, 0).SetNum(3).SetLv(40);
1821 Add("bill_tax", 1, 0).c_bill = 1;
1822 Add("bill_tax", 1, 0).c_bill = 1;
1823 Add("bill_tax", 1, 0).c_bill = 1;
1824 AddThing(ThingGen.CreateScroll(8288).SetNum(5));
1825 Add("container_magic", 1, 0);
1826 Add("container_magic", 1, 0).ChangeMaterial("iron").idSkin = 1;
1827 Add("container_magic", 1, 0).ChangeMaterial("bamboo").idSkin = 2;
1828 Add("container_magic", 1, 0).ChangeMaterial("feywood").idSkin = 3;
1829 Add("wrench_tent_elec", 1, 0);
1830 Add("wrench_tent_soil", 1, 0);
1831 Add("wrench_tent_seabed", 1, 0);
1832 Add("wrench_bed", 1, 0).SetNum(20);
1833 Add("wrench_storage", 1, 0).SetNum(10);
1834 Add("wrench_fridge", 1, 0).SetNum(1);
1835 Add("wrench_extend_v", 1, 0).SetNum(2);
1836 Add("wrench_extend_h", 1, 0).SetNum(2);
1837 AddThing(ThingGen.CreateSpellbook(9155, 1, 3));
1838 break;
1839 default:
1840 {
1841 float num = (float)(3 + Mathf.Min(ShopLv / 5, 10)) + Mathf.Sqrt(ShopLv);
1842 int num2 = 300;
1843 switch (ShopType)
1844 {
1845 case ShopType.Ecopo:
1846 num2 = 30;
1847 break;
1848 case ShopType.StrangeGirl:
1849 num2 = 50;
1850 break;
1851 }
1852 num = num * (float)(100 + EClass.pc.Evalue(1406) * 5) / 100f;
1853 num = Mathf.Min(num, num2);
1854 for (int j = 0; (float)j < num; j++)
1855 {
1856 Thing thing = CreateStock();
1857 if ((!thing.trait.IsNoShop || (ShopType == ShopType.LoytelMart && (EClass.debug.enable || EClass.player.flags.loytelMartLv >= 2))) && (!(thing.trait is TraitRod) || thing.c_charges != 0) && thing.GetPrice() > 0)
1858 {
1859 bool tryStack = true;
1860 if (ShopType == ShopType.Curry)
1861 {
1862 tryStack = false;
1863 }
1864 t.AddThing(thing, tryStack);
1865 }
1866 }
1867 break;
1868 }
1869 }
1870 foreach (RecipeSource item3 in RecipeManager.list)
1871 {
1872 if (item3.row.recipeKey.IsEmpty())
1873 {
1874 continue;
1875 }
1876 string[] recipeKey = item3.row.recipeKey;
1877 for (int l = 0; l < recipeKey.Length; l++)
1878 {
1879 if (recipeKey[l] == ShopType.ToString())
1880 {
1881 NoRestock(ThingGen.CreateRecipe(item3.id));
1882 break;
1883 }
1884 }
1885 }
1886 switch (ShopType)
1887 {
1888 case ShopType.Curry:
1889 if (EClass.game.quests.IsCompleted("curry"))
1890 {
1891 AddThing(TraitSeed.MakeSeed("redpepper").SetNum(5));
1892 }
1893 break;
1894 case ShopType.Moyer:
1895 {
1896 for (int num12 = 1; num12 <= 12; num12++)
1897 {
1898 AddAdvWeek(num12);
1899 }
1900 break;
1901 }
1902 case ShopType.StrangeGirl:
1903 {
1904 int num13 = (EClass.debug.enable ? 20 : (EClass._zone.development / 10));
1905 if (num13 > 0)
1906 {
1907 Add("syringe_gene", num13, 0);
1908 Add("diary_little", 1, 0);
1909 }
1910 if (num13 > 10)
1911 {
1912 Add("syringe_heaven", num13 / 5, 0);
1913 Add("1276", 1, 0);
1914 }
1915 Add("medal", 10, 0);
1916 Add("ticket_fortune", 10, 0);
1917 break;
1918 }
1919 case ShopType.GeneralExotic:
1920 Add("tool_talisman", 1, 0);
1921 break;
1922 case ShopType.Healer:
1923 AddThing(ThingGen.CreatePotion(8400).SetNum(4 + EClass.rnd(6)));
1924 AddThing(ThingGen.CreatePotion(8401).SetNum(2 + EClass.rnd(4)));
1925 AddThing(ThingGen.CreatePotion(8402).SetNum(1 + EClass.rnd(3)));
1926 break;
1927 case ShopType.Food:
1928 Add("ration", 2 + EClass.rnd(4), 0);
1929 break;
1930 case ShopType.Ecopo:
1931 Add("ecomark", 5, 0);
1932 Add("whip_egg", 1, 0);
1933 Add("helm_chef", 1, 0);
1934 Add("hammer_strip", 1, 0);
1935 Add("brush_strip", 1, 0);
1936 Add("1165", 1, 0);
1937 Add("plat", 100, 0);
1938 AddThing(ThingGen.CreateScroll(9160).SetNum(5));
1939 AddThing(ThingGen.CreateRune(450, 1, free: true));
1940 break;
1941 case ShopType.Gun:
1942 Add("bullet", 1, 0).SetNum(300 + EClass.rnd(100)).ChangeMaterial("iron");
1943 Add("bullet_energy", 1, 0).SetNum(100 + EClass.rnd(100)).ChangeMaterial("iron");
1944 break;
1945 case ShopType.Magic:
1946 if (!Guild.Mage.IsMember && ((EClass._zone.id == "lumiest" && EClass._zone.lv == 0) || (EClass._zone.id != "lumiest" && EClass.rnd(4) == 0)))
1947 {
1948 t.AddThing(ThingGen.Create("letter_trial"));
1949 }
1950 break;
1951 case ShopType.Festival:
1953 {
1954 Add("1085", 1, 0);
1955 if (EClass._zone.id == "noyel")
1956 {
1957 Add("holyFeather", 1, 0);
1958 }
1959 }
1960 break;
1961 case ShopType.Junk:
1962 case ShopType.LoytelMart:
1963 {
1964 if (ShopType == ShopType.LoytelMart)
1965 {
1966 Add("ticket_massage", 1, 0);
1967 Add("ticket_armpillow", 1, 0);
1968 Add("ticket_champagne", 1, 0);
1969 }
1970 for (int num10 = 0; num10 < 3; num10++)
1971 {
1972 if (EClass.rnd(5) == 0)
1973 {
1974 TreasureType treasureType = ((EClass.rnd(10) == 0) ? TreasureType.BossNefia : ((EClass.rnd(10) == 0) ? TreasureType.Map : TreasureType.RandomChest));
1975 int num11 = EClass.rnd(EClass.rnd(ShopLv + (EClass.debug.enable ? 200 : 50)) + 1) + 1;
1976 Thing thing6 = ThingGen.Create(treasureType switch
1977 {
1978 TreasureType.Map => "chest_treasure",
1979 TreasureType.BossNefia => "chest_boss",
1980 _ => "chest3",
1981 });
1982 thing6.c_lockedHard = true;
1983 thing6.c_lockLv = num11;
1984 thing6.c_priceAdd = 2000 + num11 * 250 * ((treasureType == TreasureType.RandomChest) ? 1 : 5);
1985 thing6.c_revealLock = true;
1986 ThingGen.CreateTreasureContent(thing6, num11, treasureType, clearContent: true);
1987 AddThing(thing6);
1988 }
1989 }
1990 break;
1991 }
1992 }
1993 switch (ShopType)
1994 {
1995 case ShopType.General:
1996 case ShopType.Food:
1997 {
1998 for (int num14 = 0; num14 < (EClass.debug.enable ? 3 : 3); num14++)
1999 {
2000 if (EClass.rnd(3) == 0)
2001 {
2002 int lv = EClass.rnd(EClass.rnd(ShopLv + (EClass.debug.enable ? 200 : 50)) + 1) + 1;
2003 Thing t2 = ThingGen.Create("chest_gamble", -1, lv).SetNum(1 + EClass.rnd(20));
2004 AddThing(t2);
2005 }
2006 }
2007 break;
2008 }
2009 case ShopType.Booze:
2010 if (EClass._zone is Zone_Yowyn && EClass._zone.lv == -1)
2011 {
2012 Add("churyu", EClass.rndHalf(10), 0);
2013 }
2014 break;
2015 }
2016 switch (owner.id)
2017 {
2018 case "rodwyn":
2019 AddThing(ThingGen.CreateSpellbook(8790));
2020 AddThing(ThingGen.CreatePotion(8791).SetNum(3 + EClass.rnd(3)));
2021 AddThing(ThingGen.CreatePotion(8792).SetNum(3 + EClass.rnd(3)));
2022 break;
2023 case "girl_blue":
2024 Add("779", 1 + EClass.rnd(3), 0);
2025 break;
2026 case "nola":
2027 AddThing(ThingGen.CreateRecipe("ic").SetPriceFix(400));
2028 AddThing(ThingGen.CreateRecipe("bullet").SetPriceFix(300));
2029 AddThing(ThingGen.CreateRecipe("break_powder").SetPriceFix(1000));
2030 AddThing(ThingGen.CreateRecipe("quarrel").SetPriceFix(100));
2031 AddThing(ThingGen.CreateRecipe("1099").SetPriceFix(400));
2032 AddThing(ThingGen.CreateRecipe("detector").SetPriceFix(700));
2033 AddThing(ThingGen.CreatePlan(2710)).SetPriceFix(-100);
2034 AddThing(ThingGen.CreatePlan(2711)).SetPriceFix(-100);
2035 AddThing(ThingGen.CreatePlan(2712)).SetPriceFix(200);
2036 break;
2037 }
2039 {
2040 Add("lockpick", 1, 0);
2041 if (EClass.rnd(2) == 0)
2042 {
2043 Add("lockpick", 1, 0);
2044 }
2045 AddThing(ThingGen.CreateScroll(8780, EClass.rndHalf(5)));
2046 }
2047 foreach (Thing thing11 in t.things)
2048 {
2049 thing11.c_idBacker = 0;
2050 if (ShopType != ShopType.Copy)
2051 {
2052 thing11.TryMakeRandomItem(ShopLv);
2053 if (thing11.Num == 1)
2054 {
2055 thing11.SetNum(thing11.trait.DefaultStock);
2056 }
2057 if (thing11.trait is TraitFoodMeal)
2058 {
2059 CraftUtil.MakeDish(thing11, ShopLv, owner.Chara);
2060 }
2061 if (thing11.IsFood && owner.id == "rodwyn")
2062 {
2063 SourceElement.Row row = EClass.sources.elements.rows.Where((SourceElement.Row e) => !e.foodEffect.IsEmpty() && e.category != "feat" && e.chance > 0).RandomItem();
2064 thing11.elements.SetBase(row.id, 10 + EClass.rnd(10));
2065 }
2066 }
2067 if (CurrencyType == CurrencyType.Casino_coin)
2068 {
2069 thing11.noSell = true;
2070 }
2072 {
2073 thing11.isStolen = true;
2074 }
2075 if (!(thing11.trait is TraitErohon))
2076 {
2077 thing11.c_IDTState = 0;
2078 }
2079 if (CurrencyType == CurrencyType.Money && (thing11.category.IsChildOf("meal") || thing11.category.IsChildOf("preserved")) && thing11.id != "ration" && !thing11.IsUnique)
2080 {
2081 thing11.c_priceFix = -70;
2082 }
2083 if (thing11.trait is TraitErohon)
2084 {
2085 thing11.c_IDTState = 5;
2086 }
2087 if (thing11.IsContainer && !thing11.c_revealLock)
2088 {
2089 thing11.RemoveThings();
2090 t.c_lockLv = 0;
2091 }
2092 }
2093 if (t.things.Count <= t.things.GridSize)
2094 {
2095 return;
2096 }
2097 int num15 = t.things.width * 10;
2098 if (t.things.Count > num15)
2099 {
2100 int num16 = t.things.Count - num15;
2101 for (int num17 = 0; num17 < num16; num17++)
2102 {
2103 t.things.LastItem().Destroy();
2104 }
2105 }
2106 t.things.ChangeSize(t.things.width, Mathf.Min(t.things.Count / t.things.width + 1, 10));
2107 Thing Add(string id, int a, int idSkin)
2108 {
2110 Thing thing8 = ThingGen.Create(id, -1, ShopLv).SetNum(a);
2111 thing8.idSkin = ((idSkin == -1) ? EClass.rnd(thing8.source.skins.Length + 1) : idSkin);
2112 return t.AddThing(thing8);
2113 }
2114 void AddAdvWeek(int i)
2115 {
2116 Thing thing7 = ThingGen.CreateRedBook("advweek_" + i);
2117 thing7.c_priceFix = -90;
2118 AddThing(thing7);
2119 }
2120 Thing AddThing(Thing _t)
2121 {
2122 return t.AddThing(_t);
2123 }
2124 void NoRestock(Thing _t)
2125 {
2126 HashSet<string> hashSet = EClass.player.noRestocks.TryGetValue(owner.id);
2127 if (hashSet == null)
2128 {
2129 hashSet = new HashSet<string>();
2130 }
2131 if (!hashSet.Contains(_t.trait.IdNoRestock))
2132 {
2133 hashSet.Add(_t.trait.IdNoRestock);
2134 EClass.player.noRestocks[owner.id] = hashSet;
2135 _t.SetInt(101, 1);
2136 AddThing(_t);
2137 }
2138 }
2139 void NoRestockId(string _id)
2140 {
2141 NoRestock(ThingGen.Create(_id));
2142 }
2143 }
2144
2146 {
2147 switch (ShopType)
2148 {
2149 case ShopType.Dye:
2150 {
2151 Thing thing = ThingGen.Create("dye").SetNum(15 + EClass.rnd(30));
2152 thing.ChangeMaterial(EClass.sources.materials.rows.RandomItem().alias);
2153 return thing;
2154 }
2155 case ShopType.GeneralExotic:
2156 return FromFilter("shop_generalExotic");
2157 case ShopType.VMachine:
2158 if (EClass.rnd(10) == 0)
2159 {
2160 return Create("panty");
2161 }
2162 if (EClass.rnd(5) == 0)
2163 {
2164 return Create("234");
2165 }
2166 return FromFilter("shop_drink");
2167 case ShopType.Furniture:
2168 return FromFilter("shop_furniture");
2169 case ShopType.Book:
2170 return FromFilter("shop_book");
2171 case ShopType.Magic:
2172 return FromFilter("shop_magic");
2173 case ShopType.Ecopo:
2174 {
2175 Thing thing2 = TraitSeed.MakeRandomSeed(enc: true);
2176 if (EClass.rnd(2) == 0)
2177 {
2178 TraitSeed.LevelSeed(thing2, (thing2.trait as TraitSeed).row, 1);
2179 }
2180 return thing2;
2181 }
2182 case ShopType.Healer:
2183 {
2184 Thing thing3 = null;
2185 for (int i = 0; i < 1000; i++)
2186 {
2187 thing3 = FromFilter("shop_healer");
2188 if (thing3.trait is TraitScroll { source: not null } traitScroll)
2189 {
2190 if (!(traitScroll.source.aliasParent != "WIL") && !(traitScroll.source.categorySub == "attack"))
2191 {
2192 break;
2193 }
2194 }
2195 else if (thing3.trait is TraitPotionRandom { source: not null } traitPotionRandom)
2196 {
2197 if (!(traitPotionRandom.source.aliasParent != "WIL") && !(traitPotionRandom.source.categorySub == "attack"))
2198 {
2199 thing3.SetNum(EClass.rnd(5) + 1);
2200 break;
2201 }
2202 }
2203 else if (thing3.trait is TraitRodRandom { source: not null } traitRodRandom && !(traitRodRandom.source.aliasParent != "WIL") && !(traitRodRandom.source.categorySub == "attack"))
2204 {
2205 break;
2206 }
2207 }
2208 return thing3;
2209 }
2210 case ShopType.Milk:
2211 if (EClass._zone is Zone_Nefu && EClass.rnd(2) == 0)
2212 {
2213 Thing thing4 = ThingGen.Create("milk");
2214 thing4.MakeRefFrom(EClass.sources.charas.rows.Where((SourceChara.Row r) => r.race == "mifu" || r.race == "nefu").RandomItem().model);
2215 Debug.Log(thing4);
2216 return thing4;
2217 }
2218 return Create("milk");
2219 case ShopType.Map:
2220 return ThingGen.CreateMap();
2221 case ShopType.Plan:
2222 return Create("book_plan");
2223 case ShopType.Weapon:
2224 return FromFilter("shop_weapon");
2225 case ShopType.Gun:
2226 if (EClass.rnd(8) == 0)
2227 {
2228 return Create("mod_ranged");
2229 }
2230 return FromFilter("shop_gun");
2231 case ShopType.Blackmarket:
2232 case ShopType.Exotic:
2233 {
2234 int num = 30;
2236 {
2237 num = 25;
2238 }
2240 {
2241 num = 15;
2242 }
2243 if (EClass.debug.enable)
2244 {
2245 num = 1;
2246 }
2247 CardBlueprint.SetRarity((EClass.rnd(num * 5) == 0) ? Rarity.Mythical : ((EClass.rnd(num) == 0) ? Rarity.Legendary : ((EClass.rnd(5) == 0) ? Rarity.Superior : Rarity.Normal)));
2248 return FromFilter("shop_blackmarket");
2249 }
2250 case ShopType.Drink:
2251 return FromFilter("shop_drink");
2252 case ShopType.Booze:
2253 return FromFilter("shop_booze");
2254 case ShopType.Fruit:
2255 return FromFilter("shop_fruit");
2256 case ShopType.Fish:
2257 if (EClass.rnd(2) == 0)
2258 {
2259 return Create("bait");
2260 }
2261 if (EClass.rnd(3) == 0)
2262 {
2263 return Create("fishingRod");
2264 }
2265 return FromFilter("shop_fish");
2266 case ShopType.Meat:
2267 if (EClass.rnd(5) == 0)
2268 {
2269 return Create("seasoning");
2270 }
2271 return FromFilter("shop_meat");
2272 case ShopType.Bread:
2273 if (EClass.rnd(3) == 0)
2274 {
2275 return Create("dough");
2276 }
2277 return FromFilter("shop_bread");
2278 case ShopType.Sweet:
2279 if (EClass.rnd(3) == 0)
2280 {
2281 return Create("dough");
2282 }
2283 return FromFilter("shop_sweet");
2284 case ShopType.Curry:
2285 if (EClass.rnd(3) == 0)
2286 {
2287 return Create("seasoning");
2288 }
2289 return Create("693");
2290 case ShopType.Food:
2291 if (EClass.rnd(5) == 0)
2292 {
2293 return Create("seasoning");
2294 }
2295 return FromFilter("shop_food");
2296 case ShopType.Drug:
2297 return FromFilter("shop_drug");
2298 case ShopType.LoytelMart:
2299 {
2300 int loytelMartLv = EClass.player.flags.loytelMartLv;
2301 if (loytelMartLv >= 1)
2302 {
2303 if (EClass.rnd(10) == 0)
2304 {
2305 return Create("monsterball").SetLv(40 + EClass.rnd(ShopLv)).Thing;
2306 }
2307 if (EClass.rnd(30) == 0)
2308 {
2309 return ThingGen.Create("rp_random", -1, ShopLv + 10);
2310 }
2311 if (EClass.rnd(100) == 0)
2312 {
2313 return ThingGen.Create("map_treasure", -1, EClass.rndHalf(ShopLv));
2314 }
2315 if (EClass.rnd(40) == 0)
2316 {
2317 return Create("water").SetPriceFix(1000);
2318 }
2319 if (EClass.rnd(1000) == 0)
2320 {
2321 return Create("1165");
2322 }
2323 }
2324 if ((loytelMartLv >= 2 || EClass.debug.enable) && EClass.rnd(10) == 0)
2325 {
2326 SourceElement.Row row = EClass.sources.elements.rows.Where((SourceElement.Row r) => r.tag.Contains("loytelMart") && ShopLv + 10 >= r.LV).ToList().RandomItemWeighted((SourceElement.Row r) => r.chance);
2327 switch ((from _s in row.thing.ToCharArray()
2328 where _s != ' '
2329 select _s).RandomItem())
2330 {
2331 case 'B':
2332 return ThingGen.CreateSpellbook(row.id);
2333 case 'P':
2334 return ThingGen.CreatePotion(row.id);
2335 case 'R':
2336 return ThingGen.CreateRod(row.id);
2337 case 'S':
2338 return ThingGen.CreateScroll(row.id);
2339 }
2340 }
2341 return FromFilter("shop_junk");
2342 }
2343 case ShopType.Junk:
2344 case ShopType.Moyer:
2345 return FromFilter("shop_junk");
2346 case ShopType.Souvenir:
2347 return FromFilter("shop_souvenir");
2348 case ShopType.StrangeGirl:
2349 return DNA.GenerateGene(SpawnList.Get("chara").Select(ShopLv + 10), DNA.Type.Brain);
2350 case ShopType.Fireworks:
2351 if (EClass.rnd(3) == 0)
2352 {
2353 return Create("firework_launcher");
2354 }
2355 return Create("firework");
2356 case ShopType.Festival:
2357 if (EClass.rnd(3) == 0)
2358 {
2359 if (IsFestival("olvina"))
2360 {
2361 return Create(new string[4] { "1125", "1126", "pillow_truth", "1230" }.RandomItem());
2362 }
2363 if (IsFestival("yowyn"))
2364 {
2365 return Create(new string[3] { "hat_mushroom", "hat_witch", "hat_kumiromi" }.RandomItem());
2366 }
2367 if (IsFestival("noyel"))
2368 {
2369 return Create(new string[9] { "1127", "1128", "xmas_sled", "xmas_bigbag", "xmas_bigbox", "xmas_blackcat", "xmas_blackcat", "xmas_jure", "xmas_crown" }.RandomItem());
2370 }
2371 }
2372 if (EClass.rnd(2) == 0)
2373 {
2374 return Create(new string[4] { "1081", "1082", "1083", "1084" }.RandomItem());
2375 }
2376 if (EClass.rnd(3) == 0)
2377 {
2378 return FromFilter("shop_junk");
2379 }
2380 return FromFilter("shop_souvenir");
2381 case ShopType.Lamp:
2382 if (EClass.rnd(3) != 0)
2383 {
2384 if (IsFestival("kapul"))
2385 {
2386 return Create(new string[6] { "999", "1000", "1001", "1002", "1003", "1004" }.RandomItem());
2387 }
2388 if (IsFestival("yowyn"))
2389 {
2390 return Create(new string[2] { "1072", "1073" }.RandomItem());
2391 }
2392 if (IsFestival("noyel"))
2393 {
2394 return Create(new string[1] { "1069" }.RandomItem());
2395 }
2396 if (IsFestival("olvina"))
2397 {
2398 return Create(new string[2] { "1070", "1071" }.RandomItem());
2399 }
2400 }
2401 if (EClass._zone.IsFestival && EClass.rnd(2) == 0)
2402 {
2403 return Create(new string[4] { "953", "954", "955", "956" }.RandomItem());
2404 }
2405 return FromFilter("shop_lamp");
2406 default:
2407 if (EClass.rnd(100) == 0)
2408 {
2409 return Create("lockpick");
2410 }
2411 return FromFilter("shop_general");
2412 }
2413 Thing Create(string s)
2414 {
2415 return ThingGen.Create(s, -1, ShopLv);
2416 }
2417 Thing FromFilter(string s)
2418 {
2419 return ThingGen.CreateFromFilter(s, ShopLv);
2420 }
2421 static bool IsFestival(string id)
2422 {
2423 if (EClass._zone.id == id)
2424 {
2425 return EClass._zone.IsFestival;
2426 }
2427 return false;
2428 }
2429 }
2430 }
AnimeID
Definition: AnimeID.cs:2
CTAG
Definition: CTAG.cs:2
ContainerType
Definition: ContainerType.cs:2
CurrencyType
Definition: CurrencyType.cs:2
EffectDead
Definition: EffectDead.cs:2
Emo2
Definition: Emo2.cs:2
FontColor
Definition: FontColor.cs:2
HitResult
Definition: HitResult.cs:2
InvGridSize
Definition: InvGridSize.cs:2
LockOpenState
Definition: LockOpenState.cs:2
PlaceState
Definition: PlaceState.cs:2
PriceType
Definition: PriceType.cs:2
Rarity
Definition: Rarity.cs:2
RefCardName
Definition: RefCardName.cs:2
ShopType
Definition: ShopType.cs:2
SlaverType
Definition: SlaverType.cs:2
ThrowType
Definition: ThrowType.cs:2
ToggleType
Definition: ToggleType.cs:2
TraitRadiusType
TreasureType
Definition: TreasureType.cs:2
list. Add(item3)
bool altAction
Definition: ActPlan.cs:156
Chara cc
Definition: ActPlan.cs:202
bool IsSelfOrNeighbor
Definition: ActPlan.cs:176
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
Definition: ActPlan.cs:366
bool CanGiveCard()
Definition: Affinity.cs:63
PointList points
Definition: BaseArea.cs:26
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
ScreenGuide guide
static void SetRarity(Rarity q=Rarity.Normal)
static void SetNormalRarity(bool fixedMat=false)
void PlayAnime(AnimeID id, bool force)
void AddExtra(string id)
void RemoveExtra(string id)
CardRow origin
Definition: CardRow.cs:49
string[] trait
Definition: CardRow.cs:33
string id
Definition: CardRow.cs:7
Definition: Card.cs:11
Thing TryMakeRandomItem(int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
Definition: Card.cs:5437
virtual bool isThing
Definition: Card.cs:2081
bool IsImportant
Definition: Card.cs:2105
virtual Chara Chara
Definition: Card.cs:2070
ElementContainerCard elements
Definition: Card.cs:41
int c_ammo
Definition: Card.cs:1461
string id
Definition: Card.cs:35
bool isNPCProperty
Definition: Card.cs:554
bool IsUnique
Definition: Card.cs:2091
bool HasElement(int ele, int req=1)
Definition: Card.cs:5897
bool isRoofItem
Definition: Card.cs:578
bool c_lockedHard
Definition: Card.cs:1036
bool isLostProperty
Definition: Card.cs:806
SourceMaterial.Row material
Definition: Card.cs:2051
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6129
string c_idDeity
Definition: Card.cs:1581
int c_invest
Definition: Card.cs:1293
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3038
Card MakeRefFrom(string id)
Definition: Card.cs:5702
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7233
Thing ammoData
Definition: Card.cs:1785
int c_lockLv
Definition: Card.cs:964
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3101
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6684
Card SetLv(int a)
Definition: Card.cs:2901
Rarity rarity
Definition: Card.cs:314
bool ExistsOnMap
Definition: Card.cs:2085
bool c_revealLock
Definition: Card.cs:1048
Thing SetNum(int a)
Definition: Card.cs:3492
bool autoRefuel
Definition: Card.cs:626
bool IsFood
Definition: Card.cs:2175
TileType TileType
Definition: Card.cs:2135
virtual SourcePref Pref
Definition: Card.cs:2107
void RecalculateFOV()
Definition: Card.cs:6341
bool HasTag(CTAG tag)
Definition: Card.cs:2595
Point pos
Definition: Card.cs:59
void DyeRandom()
Definition: Card.cs:5970
void Dye(string idMat)
Definition: Card.cs:5975
Trait trait
Definition: Card.cs:53
bool disableAutoToggle
Definition: Card.cs:602
int c_dateStockExpire
Definition: Card.cs:1233
void ModCharge(int a, bool destroy=false)
Definition: Card.cs:3947
void Destroy()
Definition: Card.cs:5067
bool c_isImportant
Definition: Card.cs:1024
ThingContainer things
Definition: Card.cs:38
bool IsInstalled
Definition: Card.cs:2381
virtual bool IsPC
Definition: Card.cs:2143
bool IsMeleeWeapon
Definition: Card.cs:2241
string NameSimple
Definition: Card.cs:2139
virtual bool isChara
Definition: Card.cs:2083
virtual Thing Thing
Definition: Card.cs:2058
int Evalue(int ele)
Definition: Card.cs:2571
int idSkin
Definition: Card.cs:362
bool isOn
Definition: Card.cs:542
Thing SetPriceFix(int a)
Definition: Card.cs:7128
Cell Cell
Definition: Card.cs:2055
Thing Duplicate(int num)
Definition: Card.cs:3441
void PlaySoundDrop(bool spatial=true)
Definition: Card.cs:6114
Thing c_copyContainer
Definition: Card.cs:1809
virtual CardRow sourceCard
Definition: Card.cs:2131
void ModExp(string alias, int a)
Definition: Card.cs:2648
int Num
Definition: Card.cs:158
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6148
SourceCategory.Row category
Definition: Card.cs:2049
bool IsIdentified
Definition: Card.cs:2377
bool IsContainer
Definition: Card.cs:2089
int c_charges
Definition: Card.cs:1269
string c_editorTraitVal
Definition: Card.cs:1713
CardRenderer renderer
Definition: Card.cs:61
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6781
void RemoveThings()
Definition: Card.cs:3307
bool HasBlock
Definition: Cell.cs:643
bool HasRoof
Definition: Cell.cs:648
bool HasFloor
Definition: Cell.cs:645
Definition: Chara.cs:10
Card held
Definition: Chara.cs:70
override bool IsPC
Definition: Chara.cs:612
bool TryHoldCard(Card t, int num=-1, bool pickHeld=false)
Definition: Chara.cs:4405
Stats stamina
Definition: Chara.cs:1146
Affinity affinity
Definition: Chara.cs:314
bool enable
Definition: CoreDebug.cs:286
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:207
static void MakeDish(Thing food, int lv, Chara crafter=null, int seed=-1)
Definition: CraftUtil.cs:61
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:116
Definition: Date.cs:4
int hour
Definition: Date.cs:74
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
bool IsExpired(int time)
Definition: Date.cs:336
string GetText(TextFormat format)
Definition: Date.cs:249
int GetRemainingHours(int rawDeadLine)
Definition: Date.cs:341
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static SourceManager sources
Definition: EClass.cs:42
static BaseGameScreen screen
Definition: EClass.cs:32
static int rndHalf(int a)
Definition: EClass.cs:87
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static GameSetting setting
Definition: EClass.cs:34
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
bool HasTag(string tag)
Definition: ELEMENT.cs:473
int Evalue(int ele)
RenderSetting render
Definition: GameSetting.cs:301
SpatialManager spatials
Definition: Game.cs:152
bool IsSurvival
Definition: Game.cs:275
QuestManager quests
Definition: Game.cs:182
override bool IsCurrentZone
Definition: GuildMerchant.cs:5
override bool IsCurrentZone
Definition: GuildThief.cs:6
Definition: Guild.cs:2
static GuildMerchant Merchant
Definition: Guild.cs:62
static GuildMage Mage
Definition: Guild.cs:58
bool IsMember
Definition: Guild.cs:72
static GuildThief Thief
Definition: Guild.cs:60
static LayerDragGrid Create(InvOwnerDraglet owner, bool refuelFromLayerDragGrid=false)
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167
int hour
Definition: MapConfig.cs:95
bool IsIndoor
Definition: Map.cs:131
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2380
MapConfig config
Definition: Map.cs:37
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
int loytelMartLv
Definition: Player.cs:671
Flags flags
Definition: Player.cs:1094
void ModKarma(int a)
Definition: Player.cs:2511
Dictionary< string, HashSet< string > > noRestocks
Definition: Player.cs:1127
Definition: Point.cs:9
ref Vector3 Position(int height)
Definition: Point.cs:548
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1051
Point Copy()
Definition: Point.cs:491
bool IsValid
Definition: Point.cs:88
void RefreshNeighborTiles()
Definition: Point.cs:1276
Cell cell
Definition: Point.cs:51
bool IsCompleted(string id)
static List< RecipeSource > list
RenderRow row
Definition: RecipeSource.cs:5
Definition: Recipe.cs:7
static Recipe Create(RecipeSource _source, int idMat=-1, Thing ing=null)
Definition: Recipe.cs:325
string RecipeCat
Definition: RenderRow.cs:121
string[] recipeKey
Definition: RenderRow.cs:56
int value
Definition: RenderRow.cs:20
Definition: Room.cs:4
MeshPass passGuideFloor
Definition: ScreenGuide.cs:7
int dateRefresh
Definition: SlaverData.cs:10
string GetText(string id="name", bool returnNull=false)
Definition: SourceData.cs:553
SourceMaterial materials
SourceElement elements
SourceChara charas
SourceReligion religions
bool Surface
Definition: SourcePref.cs:318
Zone Find(string id)
int lv
Definition: Spatial.cs:142
int electricity
Definition: Spatial.cs:250
string id
Definition: Spatial.cs:13
int development
Definition: Spatial.cs:238
static SpawnList Get(string id, string parent=null, CardFilter filter=null)
Definition: SpawnList.cs:18
CardRow Select(int lv=-1, int levelRange=-1)
Definition: SpawnList.cs:139
virtual void Mod(int a)
Definition: Stats.cs:135
void DestroyAll(Func< Thing, bool > funcExclude=null)
Thing Find(int uid)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
static Thing CreateRune(int ele, int v, bool free=false)
Definition: ThingGen.cs:201
static Thing CreatePotion(int ele, int num=1)
Definition: ThingGen.cs:216
static Thing CreateFromFilter(string id, int lv=-1)
Definition: ThingGen.cs:63
static Thing CreateMap(string idSource=null, int lv=-1)
Definition: ThingGen.cs:124
static Thing CreatePerfume(int ele, int num=1)
Definition: ThingGen.cs:223
static Thing CreateRedBook(string id, int num=1)
Definition: ThingGen.cs:167
static void CreateTreasureContent(Thing t, int lv, TreasureType type, bool clearContent)
Definition: ThingGen.cs:263
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151
static Thing CreatePlan(int ele)
Definition: ThingGen.cs:137
static Thing CreateRecipe(string id)
Definition: ThingGen.cs:144
static Thing CreateSkillbook(int ele, int num=1)
Definition: ThingGen.cs:175
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
static Thing CreateRod(int ele, int charge=-1)
Definition: ThingGen.cs:209
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
SourceThing.Row source
Definition: Thing.cs:11
virtual bool IsBlockSight
Definition: TileType.cs:157
virtual bool IsBlockPass
Definition: TileType.cs:153
static Thing MakeRandomSeed(bool enc=false)
Definition: TraitSeed.cs:192
static void LevelSeed(Thing t, SourceObj.Row obj, int num)
Definition: TraitSeed.cs:145
static Thing MakeSeed(string id, PlantData plant=null)
Definition: TraitSeed.cs:88
static void SetZone(Zone zone, Thing t)
Definition: Trait.cs:7
virtual string LangBarter
Definition: Trait.cs:554
virtual void OnImportMap()
Definition: Trait.cs:655
virtual bool IsBlendBase
Definition: Trait.cs:262
virtual bool RequireFullStackCheck
Definition: Trait.cs:196
virtual bool OnUse(Chara c, Card tg)
Definition: Trait.cs:1023
virtual bool CanExtendBuild
Definition: Trait.cs:168
bool IsFuel(string s)
Definition: Trait.cs:1327
virtual bool IsFactory
Definition: Trait.cs:140
virtual bool IsRestSpot
Definition: Trait.cs:256
virtual TileMode tileMode
Definition: Trait.cs:436
void OfferProcess(Chara cc)
Definition: Trait.cs:852
virtual bool IsBlockPath
Definition: Trait.cs:53
virtual bool CanBeMasked
Definition: Trait.cs:258
virtual bool IsBlockSight
Definition: Trait.cs:55
virtual bool HoldAsDefaultInteraction
Definition: Trait.cs:130
virtual int radius
Definition: Trait.cs:93
virtual int GetActDuration(Chara c)
Definition: Trait.cs:616
virtual bool CanBeAttacked
Definition: Trait.cs:164
virtual void Update()
Definition: Trait.cs:729
virtual bool CanBeHallucinated
Definition: Trait.cs:298
virtual string IDActorEx
Definition: Trait.cs:174
virtual void SetMainText(UIText t, bool hotitem)
Definition: Trait.cs:1435
virtual bool CanUse(Chara c)
Definition: Trait.cs:999
virtual bool ShouldRefreshTile
Definition: Trait.cs:76
virtual string GetName()
Definition: Trait.cs:695
virtual bool ShowChildrenNumber
Definition: Trait.cs:332
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true)
Definition: Trait.cs:756
virtual CopyShopType CopyShop
Definition: Trait.cs:514
virtual void OnChangePlaceState(PlaceState state)
Definition: Trait.cs:679
string IdToggleExtra
Definition: Trait.cs:466
virtual bool IsLocalAct
Definition: Trait.cs:260
virtual Recipe GetRecipe()
Definition: Trait.cs:807
virtual bool IsOpenPath
Definition: Trait.cs:61
virtual bool ShowAsTool
Definition: Trait.cs:334
virtual void OnSetCardGrid(ButtonGrid b)
Definition: Trait.cs:1071
virtual string IDInvStyle
Definition: Trait.cs:172
virtual string IdSoundToggleOff
Definition: Trait.cs:497
virtual HotItem GetHotItem()
Definition: Trait.cs:963
virtual bool CanHarvest
Definition: Trait.cs:91
virtual float DropChance
Definition: Trait.cs:358
int GetSortVal(UIList.SortMode m)
Definition: Trait.cs:957
virtual bool Contains(RecipeSource r)
Definition: Trait.cs:582
virtual void OnEquip(Chara c, bool onSetOwner)
Definition: Trait.cs:671
virtual void OnHeld()
Definition: Trait.cs:1045
virtual void OnTickHeld()
Definition: Trait.cs:1049
virtual void WriteNote(UINote n, bool identified)
Definition: Trait.cs:953
int GetParamInt(int i, int def)
Definition: Trait.cs:573
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1079
virtual bool TryProgress(AIProgress p)
Definition: Trait.cs:891
virtual bool CanBeDisassembled
Definition: Trait.cs:305
virtual void OnRead(Chara c)
Definition: Trait.cs:973
virtual bool UseAltTiles
Definition: Trait.cs:438
virtual bool IgnoreLastStackHeight
Definition: Trait.cs:118
virtual bool IsTool
Definition: Trait.cs:366
virtual void TryToggle()
Definition: Trait.cs:1133
Point GetRandomPoint(Func< Point, bool > func=null, Chara accessChara=null)
Definition: Trait.cs:738
virtual void OnInstall(bool byPlayer)
Definition: Trait.cs:1125
virtual bool CanChangeHeight
Definition: Trait.cs:148
virtual bool ShowOrbit
Definition: Trait.cs:134
virtual void TrySetAct(ActPlan p)
Definition: Trait.cs:1033
virtual bool IsAltar
Definition: Trait.cs:254
virtual bool CanSearchContent
Definition: Trait.cs:217
virtual int GetValue()
Definition: Trait.cs:587
virtual int FuelCost
Definition: Trait.cs:460
virtual bool CanChildDecay(Card c)
Definition: Trait.cs:1066
virtual void TrySetHeldAct(ActPlan p)
Definition: Trait.cs:1041
virtual string IdSoundToggleOn
Definition: Trait.cs:481
virtual void OnThrowGround(Chara c, Point p)
Definition: Trait.cs:995
virtual bool RenderExtra
Definition: Trait.cs:356
Thing CreateStock()
Definition: Trait.cs:2145
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:592
virtual string ReqHarvest
Definition: Trait.cs:302
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:370
virtual bool CanBeDestroyed
Definition: Trait.cs:294
bool IsToggle
Definition: Trait.cs:386
virtual bool CanRead(Chara c)
Definition: Trait.cs:968
virtual int RestockDay
Definition: Trait.cs:550
virtual string langNote
Definition: Trait.cs:170
virtual bool AlwaysHideOnLowWall
Definition: Trait.cs:352
virtual bool CanCook(Card c)
Definition: Trait.cs:817
virtual string IdNoRestock
Definition: Trait.cs:360
virtual int CraftNum
Definition: Trait.cs:132
virtual bool CanBuildInTown
Definition: Trait.cs:267
virtual void SetOwner(Card _owner)
Definition: Trait.cs:640
virtual bool AllowSell
Definition: Trait.cs:525
virtual bool OnChildDecay(Card c, bool firstDecay)
Definition: Trait.cs:1061
virtual bool UseLowblock
Definition: Trait.cs:440
virtual bool HasCharges
Definition: Trait.cs:328
void OnBarter(bool reroll=false)
Definition: Trait.cs:1504
virtual void OnRenderTile(Point point, HitResult result, int dir)
Definition: Trait.cs:704
string GetTextRestock(string lang, bool pet)
Definition: Trait.cs:1459
virtual void OnOpenDoor(Chara c)
Definition: Trait.cs:1083
virtual bool NoHeldDir
Definition: Trait.cs:350
virtual LockOpenState TryOpenLock(Chara cc, bool msgFail=true)
Definition: Trait.cs:896
virtual bool IsLightOn
Definition: Trait.cs:413
bool IsRequireFuel
Definition: Trait.cs:464
virtual bool IsNoShop
Definition: Trait.cs:65
virtual bool CanOpenContainer
Definition: Trait.cs:233
virtual int DefaultStock
Definition: Trait.cs:128
bool IsFuel(Thing t)
Definition: Trait.cs:1332
virtual void TrySetToggleAct(ActPlan p)
Definition: Trait.cs:1239
virtual bool ShowCharges
Definition: Trait.cs:330
virtual TileType tileType
Definition: Trait.cs:49
virtual bool IsFloating
Definition: Trait.cs:63
virtual void PlayToggleEffect(bool silent)
Definition: Trait.cs:1189
virtual bool CanUse(Chara c, Card tg)
Definition: Trait.cs:1004
virtual bool CanUseRoomRadius
Definition: Trait.cs:97
virtual bool CanCopy(Thing t)
Definition: Trait.cs:1454
virtual bool CanBeHeld
Definition: Trait.cs:278
virtual bool UseDummyTile
Definition: Trait.cs:194
virtual void OnUnequip(Chara c)
Definition: Trait.cs:675
virtual int DecaySpeedChild
Definition: Trait.cs:124
virtual Sprite GetRefSprite()
Definition: Trait.cs:626
virtual bool CanChangeAffinity
Definition: Trait.cs:558
virtual bool IsOnlyUsableByPc
Definition: Trait.cs:69
virtual bool RemoveGlobalOnBanish
Definition: Trait.cs:556
virtual bool IsHomeItem
Definition: Trait.cs:252
TileMode
Definition: Trait.cs:9
void Offer(Chara cc)
Definition: Trait.cs:874
virtual bool IsDoor
Definition: Trait.cs:57
virtual void OnAddedToZone()
Definition: Trait.cs:683
virtual bool CanName
Definition: Trait.cs:144
virtual void Toggle(bool on, bool silent=false)
Definition: Trait.cs:1155
string GetParam(int i, string def=null)
Definition: Trait.cs:564
virtual int IdSkin
Definition: Trait.cs:45
void Refuel(Thing t)
Definition: Trait.cs:1369
virtual void OnUnsetCurrentItem()
Definition: Trait.cs:1057
virtual void OnRenderExtra(RenderParam p)
Definition: Trait.cs:631
bool ExistsOnMap
Definition: Trait.cs:354
virtual bool IsAnimeOn
Definition: Trait.cs:375
virtual bool CanEat(Chara c)
Definition: Trait.cs:977
virtual bool CanPutAway
Definition: Trait.cs:146
CopyShopType
Definition: Trait.cs:19
virtual bool IsOpenSight
Definition: Trait.cs:59
virtual Recipe GetBuildModeRecipe()
Definition: Trait.cs:812
virtual int CostRerollShop
Definition: Trait.cs:537
virtual void OnSimulateHour(VirtualDate date)
Definition: Trait.cs:691
int GetFuelValue(Thing t)
Definition: Trait.cs:1337
virtual bool OnUse(Chara c, Point p)
Definition: Trait.cs:1028
Point GetPoint()
Definition: Trait.cs:733
virtual bool IsThrowMainAction
Definition: Trait.cs:181
virtual bool HaveUpdate
Definition: Trait.cs:136
virtual bool InvertHeldSprite
Definition: Trait.cs:71
virtual bool HideInAdv
Definition: Trait.cs:348
virtual bool CanBeHeldAsFurniture
Definition: Trait.cs:337
string TextNextRestockPet
Definition: Trait.cs:562
virtual string RecipeCat
Definition: Trait.cs:364
virtual bool UseExtra
Definition: Trait.cs:442
virtual int MaxFuel
Definition: Trait.cs:449
virtual bool IsChangeFloorHeight
Definition: Trait.cs:73
virtual void OnStepped(Chara c)
Definition: Trait.cs:1075
virtual bool CanBeTeleported
Definition: Trait.cs:166
bool IsLighting
Definition: Trait.cs:401
virtual string GetHoverText()
Definition: Trait.cs:597
string TextNextRestock
Definition: Trait.cs:560
virtual bool IsGround
Definition: Trait.cs:67
virtual void RefreshRenderer()
Definition: Trait.cs:1420
virtual bool CanUse(Chara c, Point p)
Definition: Trait.cs:1009
virtual bool CanOffer(Card tg)
Definition: Trait.cs:839
virtual bool DisableAutoCombat
Definition: Trait.cs:198
virtual void OnCreate(int lv)
Definition: Trait.cs:667
virtual bool IsSpot
Definition: Trait.cs:138
virtual ? Color ColorExtra
Definition: Trait.cs:446
string[] Params
Definition: Trait.cs:32
virtual int Electricity
Definition: Trait.cs:102
virtual void OnSetCurrentItem()
Definition: Trait.cs:1053
virtual TraitRadiusType radiusType
Definition: Trait.cs:95
virtual bool CanCopyInBlueprint
Definition: Trait.cs:153
Emo2 GetRestockedIcon()
Definition: Trait.cs:1482
virtual bool OnUse(Chara c)
Definition: Trait.cs:1014
int GetFuelValue(string id)
Definition: Trait.cs:1346
void TryRefuel(int dest, List< Thing > excludes)
Definition: Trait.cs:1382
virtual bool CanBeShipped
Definition: Trait.cs:317
Card owner
Definition: Trait.cs:27
virtual void OnUninstall()
Definition: Trait.cs:1129
virtual bool IsOn
Definition: Trait.cs:372
void CookProgress()
Definition: Trait.cs:826
static List< Point > listRadiusPoints
Definition: Trait.cs:29
virtual void OnSetOwner()
Definition: Trait.cs:651
virtual bool CanBuiltAt(Point p)
Definition: Trait.cs:724
virtual bool CanUseContent
Definition: Trait.cs:214
virtual bool AutoToggle
Definition: Trait.cs:389
virtual bool IsNightOnlyLight
Definition: Trait.cs:425
virtual void OnDrink(Chara c)
Definition: Trait.cs:991
virtual int GuidePriotiy
Definition: Trait.cs:99
virtual bool UseLightColor
Definition: Trait.cs:444
virtual bool MaskOnBuild
Definition: Trait.cs:176
virtual int DecaySpeed
Definition: Trait.cs:122
virtual void OnRemovedFromZone()
Definition: Trait.cs:687
virtual void OnToggle()
Definition: Trait.cs:1235
virtual bool ShouldTryRefreshRoom
Definition: Trait.cs:87
virtual int ShopLv
Definition: Trait.cs:512
virtual bool CanBlend(Thing t)
Definition: Trait.cs:607
virtual Emo2 GetHeldEmo(Chara c)
Definition: Trait.cs:635
virtual bool CanBeDropped
Definition: Trait.cs:300
virtual void OnCrafted(Recipe recipe, List< Thing > ings)
Definition: Trait.cs:663
virtual bool CanBeStolen
Definition: Trait.cs:281
bool IsFuelEnough(int num=1, List< Thing > excludes=null, bool tryRefuel=true)
Definition: Trait.cs:1310
virtual bool CanBeSmashedToDeath
Definition: Trait.cs:296
virtual bool LevelAsQuality
Definition: Trait.cs:192
virtual void OnEat(Chara c)
Definition: Trait.cs:982
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:602
virtual int IdleUseChance
Definition: Trait.cs:362
static TraitSelfFactory SelfFactory
Definition: Trait.cs:25
virtual bool CanStack
Definition: Trait.cs:150
virtual bool ShowContextOnPick
Definition: Trait.cs:178
virtual byte WeightMod
Definition: Trait.cs:43
virtual SourceElement.Row GetRefElement()
Definition: Trait.cs:621
virtual bool IdleUse(Chara c, int dist)
Definition: Trait.cs:646
virtual int Decay
Definition: Trait.cs:120
virtual int NumCopyItem
Definition: Trait.cs:516
virtual void OnEnterScreen()
Definition: Trait.cs:1415
virtual bool IsSpecialContainer
Definition: Trait.cs:244
void Uninstall()
Definition: Trait.cs:1107
virtual bool ShowFuelWindow
Definition: Trait.cs:462
virtual string LangUse
Definition: Trait.cs:368
virtual void SetName(ref string s)
Definition: Trait.cs:700
virtual bool CanBeOnlyBuiltInHome
Definition: Trait.cs:264
virtual bool CanAutofire
Definition: Trait.cs:142
virtual bool IsFridge
Definition: Trait.cs:126
virtual void SetParams(params string[] s)
Definition: Trait.cs:659
virtual int CompareTo(Card b)
Definition: Trait.cs:719
virtual bool IsContainer
Definition: Trait.cs:212
virtual bool CanDrink(Chara c)
Definition: Trait.cs:986
virtual int InstallBottomPriority
Definition: Trait.cs:89
virtual bool CanOnlyCarry
Definition: Trait.cs:292
void Install(bool byPlayer)
Definition: Trait.cs:1087
virtual string Name
Definition: Trait.cs:47
virtual bool AllowCriminal
Definition: Trait.cs:548
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:612
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
Definition: UINote.cs:6
Definition: UIText.cs:6
void SetText(string s)
Definition: UIText.cs:159
bool IsRaining
Definition: Weather.cs:117
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
bool isStarted
Definition: Zone.cs:70
FactionBranch branch
Definition: Zone.cs:34
virtual bool IsFestival
Definition: Zone.cs:206
bool IsPCFaction
Definition: Zone.cs:470