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