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