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