Elin Decompiled Documentation EA 23.153 Nightly
Loading...
Searching...
No Matches
Card.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.Serialization;
5using System.Text;
6using Newtonsoft.Json;
7using UnityEngine;
8using UnityEngine.UI;
9
11{
12 public enum MoveResult
13 {
14 Fail,
15 Success,
16 Door
17 }
18
19 public enum MoveType
20 {
21 Walk,
22 Force
23 }
24
25 public const int MaxWeight = 10000000;
26
27 [JsonProperty(PropertyName = "A")]
28 public int[] _ints = new int[30];
29
30 [JsonProperty(PropertyName = "B")]
31 public string id = "";
32
33 [JsonProperty(PropertyName = "C")]
35
36 [JsonProperty(PropertyName = "D")]
38
39 [JsonProperty(PropertyName = "E")]
40 public Biography bio;
41
42 [JsonProperty(PropertyName = "SC")]
43 public List<int> sockets;
44
46
47 public Props props;
48
49 public Trait trait;
50
52
53 public Fov fov;
54
55 public Point pos = new Point();
56
58
59 public CardRow hat;
60
61 public int turn;
62
63 public int _colorInt;
64
65 public float roundTimer;
66
67 public float angle = 180f;
68
69 public float animeCounter;
70
71 public bool isDestroyed;
72
74
76
78
80
81 public bool dirtyWeight = true;
82
83 private int _childrenWeight;
84
86
88
89 private static Color _randColor;
90
91 public Emo lastEmo;
92
94
95 private Sprite _paintSprite;
96
97 public int sortVal;
98
99 public Card parentCard => parent as Card;
100
102
103 public int colorInt
104 {
105 get
106 {
107 if (_colorInt == 0)
108 {
109 RefreshColor();
110 }
111 return _colorInt;
112 }
113 }
114
115 public bool IsHotItem => invY == 1;
116
117 public int uid
118 {
119 get
120 {
121 return _ints[1];
122 }
123 set
124 {
125 _ints[1] = value;
126 }
127 }
128
129 public int idMaterial
130 {
131 get
132 {
133 return _ints[4];
134 }
135 set
136 {
137 _ints[4] = value;
138 }
139 }
140
141 public int dir
142 {
143 get
144 {
145 return _ints[5];
146 }
147 set
148 {
149 _ints[5] = value;
150 }
151 }
152
153 public int Num
154 {
155 get
156 {
157 return _ints[6];
158 }
159 set
160 {
161 _ints[6] = value;
162 }
163 }
164
165 public int _x
166 {
167 get
168 {
169 return _ints[7];
170 }
171 set
172 {
173 _ints[7] = value;
174 }
175 }
176
177 public int _z
178 {
179 get
180 {
181 return _ints[9];
182 }
183 set
184 {
185 _ints[9] = value;
186 }
187 }
188
189 public int refVal
190 {
191 get
192 {
193 return _ints[11];
194 }
195 set
196 {
197 _ints[11] = value;
198 }
199 }
200
201 public int decay
202 {
203 get
204 {
205 return _ints[12];
206 }
207 set
208 {
209 _ints[12] = value;
210 }
211 }
212
213 public int altitude
214 {
215 get
216 {
217 return _ints[13];
218 }
219 set
220 {
221 _ints[13] = value;
222 }
223 }
224
225 public int hp
226 {
227 get
228 {
229 return _ints[14];
230 }
231 set
232 {
233 _ints[14] = value;
234 }
235 }
236
237 public float fx
238 {
239 get
240 {
241 return 0.001f * (float)_ints[15];
242 }
243 set
244 {
245 _ints[15] = (int)(value * 1000f);
246 }
247 }
248
249 public float fy
250 {
251 get
252 {
253 return 0.001f * (float)_ints[16];
254 }
255 set
256 {
257 _ints[16] = (int)(value * 1000f);
258 }
259 }
260
262 {
263 get
264 {
265 return _ints[17].ToEnum<BlessedState>();
266 }
267 set
268 {
269 _ints[17] = (int)value;
270 }
271 }
272
274 {
275 get
276 {
277 return _ints[18].ToEnum<PlaceState>();
278 }
279 set
280 {
281 _ints[18] = (int)value;
282 }
283 }
284
285 public int rarityLv
286 {
287 get
288 {
289 return _ints[19];
290 }
291 set
292 {
293 _ints[19] = value;
294 }
295 }
296
298 {
299 get
300 {
301 return (_ints[19] / 100).ToEnum<Rarity>();
302 }
303 set
304 {
305 _ints[19] = (int)value * 100;
306 }
307 }
308
309 public int encLV
310 {
311 get
312 {
313 return _ints[20];
314 }
315 set
316 {
317 _ints[20] = value;
318 }
319 }
320
321 public int posInvX
322 {
323 get
324 {
325 return _ints[21];
326 }
327 set
328 {
329 _ints[21] = value;
330 }
331 }
332
333 public int posInvY
334 {
335 get
336 {
337 return _ints[22];
338 }
339 set
340 {
341 _ints[22] = value;
342 }
343 }
344
345 public int idSkin
346 {
347 get
348 {
349 return _ints[23];
350 }
351 set
352 {
353 _ints[23] = value;
354 }
355 }
356
357 public int feat
358 {
359 get
360 {
361 return _ints[24];
362 }
363 set
364 {
365 _ints[24] = value;
366 }
367 }
368
369 public int LV
370 {
371 get
372 {
373 return _ints[25];
374 }
375 set
376 {
377 _ints[25] = value;
378 }
379 }
380
381 public int exp
382 {
383 get
384 {
385 return _ints[26];
386 }
387 set
388 {
389 _ints[26] = value;
390 }
391 }
392
393 public int tier
394 {
395 get
396 {
397 return _ints[27];
398 }
399 set
400 {
401 _ints[27] = value;
402 }
403 }
404
405 public int version
406 {
407 get
408 {
409 return _ints[29];
410 }
411 set
412 {
413 _ints[29] = value;
414 }
415 }
416
417 public bool isCensored
418 {
419 get
420 {
421 return _bits1[1];
422 }
423 set
424 {
425 _bits1[1] = value;
426 }
427 }
428
430 {
431 get
432 {
433 return _bits1[2];
434 }
435 set
436 {
437 _bits1[2] = value;
438 }
439 }
440
441 public bool isDyed
442 {
443 get
444 {
445 return _bits1[3];
446 }
447 set
448 {
449 _bits1[3] = value;
450 }
451 }
452
453 public bool isModified
454 {
455 get
456 {
457 return _bits1[4];
458 }
459 set
460 {
461 _bits1[4] = value;
462 }
463 }
464
465 public bool isNew
466 {
467 get
468 {
469 return _bits1[5];
470 }
471 set
472 {
473 _bits1[5] = value;
474 }
475 }
476
478 {
479 get
480 {
481 return _bits1[6];
482 }
483 set
484 {
485 _bits1[6] = value;
486 }
487 }
488
489 public bool ignoreAutoPick
490 {
491 get
492 {
493 return _bits1[7];
494 }
495 set
496 {
497 _bits1[7] = value;
498 }
499 }
500
501 public bool freePos
502 {
503 get
504 {
505 return _bits1[8];
506 }
507 set
508 {
509 _bits1[8] = value;
510 }
511 }
512
513 public bool isHidden
514 {
515 get
516 {
517 return _bits1[9];
518 }
519 set
520 {
521 _bits1[9] = value;
522 }
523 }
524
525 public bool isOn
526 {
527 get
528 {
529 return _bits1[10];
530 }
531 set
532 {
533 _bits1[10] = value;
534 }
535 }
536
537 public bool isNPCProperty
538 {
539 get
540 {
541 return _bits1[11];
542 }
543 set
544 {
545 _bits1[11] = value;
546 }
547 }
548
549 public bool isRestrained
550 {
551 get
552 {
553 return _bits1[12];
554 }
555 set
556 {
557 _bits1[12] = value;
558 }
559 }
560
561 public bool isRoofItem
562 {
563 get
564 {
565 return _bits1[13];
566 }
567 set
568 {
569 _bits1[13] = value;
570 }
571 }
572
573 public bool isMasked
574 {
575 get
576 {
577 return _bits1[14];
578 }
579 set
580 {
581 _bits1[14] = value;
582 }
583 }
584
586 {
587 get
588 {
589 return _bits1[15];
590 }
591 set
592 {
593 _bits1[15] = value;
594 }
595 }
596
597 public bool isImported
598 {
599 get
600 {
601 return _bits1[16];
602 }
603 set
604 {
605 _bits1[16] = value;
606 }
607 }
608
609 public bool autoRefuel
610 {
611 get
612 {
613 return _bits1[17];
614 }
615 set
616 {
617 _bits1[17] = value;
618 }
619 }
620
622 {
623 get
624 {
625 return _bits1[18];
626 }
627 set
628 {
629 _bits1[18] = value;
630 }
631 }
632
633 public bool isFloating
634 {
635 get
636 {
637 return _bits1[19];
638 }
639 set
640 {
641 _bits1[19] = value;
642 }
643 }
644
645 public bool isWeightChanged
646 {
647 get
648 {
649 return _bits1[20];
650 }
651 set
652 {
653 _bits1[20] = value;
654 }
655 }
656
657 public bool isFireproof
658 {
659 get
660 {
661 return _bits1[21];
662 }
663 set
664 {
665 _bits1[21] = value;
666 }
667 }
668
669 public bool isAcidproof
670 {
671 get
672 {
673 return _bits1[22];
674 }
675 set
676 {
677 _bits1[22] = value;
678 }
679 }
680
681 public bool isReplica
682 {
683 get
684 {
685 return _bits1[23];
686 }
687 set
688 {
689 _bits1[23] = value;
690 }
691 }
692
693 public bool isSummon
694 {
695 get
696 {
697 return _bits1[24];
698 }
699 set
700 {
701 _bits1[24] = value;
702 }
703 }
704
705 public bool isElemental
706 {
707 get
708 {
709 return _bits1[25];
710 }
711 set
712 {
713 _bits1[25] = value;
714 }
715 }
716
717 public bool isBroken
718 {
719 get
720 {
721 return _bits1[26];
722 }
723 set
724 {
725 _bits1[26] = value;
726 }
727 }
728
729 public bool isSubsetCard
730 {
731 get
732 {
733 return _bits1[27];
734 }
735 set
736 {
737 _bits1[27] = value;
738 }
739 }
740
741 public bool noSnow
742 {
743 get
744 {
745 return _bits1[28];
746 }
747 set
748 {
749 _bits1[28] = value;
750 }
751 }
752
753 public bool noMove
754 {
755 get
756 {
757 return _bits1[29];
758 }
759 set
760 {
761 _bits1[29] = value;
762 }
763 }
764
765 public bool isGifted
766 {
767 get
768 {
769 return _bits1[30];
770 }
771 set
772 {
773 _bits1[30] = value;
774 }
775 }
776
777 public bool isCrafted
778 {
779 get
780 {
781 return _bits1[31];
782 }
783 set
784 {
785 _bits1[31] = value;
786 }
787 }
788
789 public bool isLostProperty
790 {
791 get
792 {
793 return _bits2[0];
794 }
795 set
796 {
797 _bits2[0] = value;
798 }
799 }
800
801 public bool noShadow
802 {
803 get
804 {
805 return _bits2[1];
806 }
807 set
808 {
809 _bits2[1] = value;
810 }
811 }
812
813 public bool noSell
814 {
815 get
816 {
817 return _bits2[2];
818 }
819 set
820 {
821 _bits2[2] = value;
822 }
823 }
824
825 public bool isLeashed
826 {
827 get
828 {
829 return _bits2[3];
830 }
831 set
832 {
833 _bits2[3] = value;
834 }
835 }
836
837 public bool isStolen
838 {
839 get
840 {
841 return _bits2[4];
842 }
843 set
844 {
845 _bits2[4] = value;
846 }
847 }
848
849 public bool isSale
850 {
851 get
852 {
853 return _bits2[5];
854 }
855 set
856 {
857 _bits2[5] = value;
858 }
859 }
860
861 public bool isCopy
862 {
863 get
864 {
865 return _bits2[6];
866 }
867 set
868 {
869 _bits2[6] = value;
870 }
871 }
872
873 public bool isRestocking
874 {
875 get
876 {
877 return _bits2[7];
878 }
879 set
880 {
881 _bits2[7] = value;
882 }
883 }
884
885 public bool hasSpawned
886 {
887 get
888 {
889 return _bits2[8];
890 }
891 set
892 {
893 _bits2[8] = value;
894 }
895 }
896
897 public bool isBackerContent => c_idBacker != 0;
898
900 {
901 get
902 {
903 if (!isBackerContent)
904 {
905 return null;
906 }
907 return EClass.sources.backers.map.TryGetValue(c_idBacker);
908 }
909 }
910
912 {
913 get
914 {
915 return GetInt(9).ToEnum<BedType>();
916 }
917 set
918 {
919 SetInt(9, (int)value);
920 }
921 }
922
923 public int c_equippedSlot
924 {
925 get
926 {
927 return GetInt(6);
928 }
929 set
930 {
931 SetInt(6, value);
932 }
933 }
934
935 public int c_lockLv
936 {
937 get
938 {
939 return GetInt(50);
940 }
941 set
942 {
943 SetInt(50, value);
944 }
945 }
946
948 {
949 get
950 {
951 return GetInt(12).ToEnum<Hostility>();
952 }
953 set
954 {
955 SetInt(12, (int)value);
956 }
957 }
958
960 {
961 get
962 {
963 return GetInt(61).ToEnum<MinionType>();
964 }
965 set
966 {
967 SetInt(61, (int)value);
968 }
969 }
970
971 public int c_vomit
972 {
973 get
974 {
975 return GetInt(13);
976 }
977 set
978 {
979 SetInt(13, value);
980 }
981 }
982
983 public bool c_wasInPcParty
984 {
985 get
986 {
987 return GetInt(103) != 0;
988 }
989 set
990 {
991 SetInt(103, value ? 1 : 0);
992 }
993 }
994
995 public bool c_isImportant
996 {
997 get
998 {
999 return GetInt(109) != 0;
1000 }
1001 set
1002 {
1003 SetInt(109, value ? 1 : 0);
1004 }
1005 }
1006
1007 public bool c_lockedHard
1008 {
1009 get
1010 {
1011 return GetInt(63) != 0;
1012 }
1013 set
1014 {
1015 SetInt(63, value ? 1 : 0);
1016 }
1017 }
1018
1019 public bool c_revealLock
1020 {
1021 get
1022 {
1023 return GetInt(64) != 0;
1024 }
1025 set
1026 {
1027 SetInt(64, value ? 1 : 0);
1028 }
1029 }
1030
1031 public bool c_isTrained
1032 {
1033 get
1034 {
1035 return GetInt(120) != 0;
1036 }
1037 set
1038 {
1039 SetInt(120, value ? 1 : 0);
1040 }
1041 }
1042
1043 public bool c_isPrayed
1044 {
1045 get
1046 {
1047 return GetInt(121) != 0;
1048 }
1049 set
1050 {
1051 SetInt(121, value ? 1 : 0);
1052 }
1053 }
1054
1056 {
1057 get
1058 {
1059 return GetInt(122) != 0;
1060 }
1061 set
1062 {
1063 SetInt(122, value ? 1 : 0);
1064 }
1065 }
1066
1067 public int c_lightColor
1068 {
1069 get
1070 {
1071 return GetInt(5);
1072 }
1073 set
1074 {
1075 Mod();
1076 SetInt(5, value);
1077 }
1078 }
1079
1080 public Color LightColor => new Color((float)(c_lightColor / 1024 * 8) / 256f, (float)(c_lightColor % 1024 / 32 * 8) / 256f, (float)(c_lightColor % 32 * 8) / 256f, 1f);
1081
1082 public int c_uidZone
1083 {
1084 get
1085 {
1086 return GetInt(10);
1087 }
1088 set
1089 {
1090 Mod();
1091 SetInt(10, value);
1092 }
1093 }
1094
1095 public int c_uidRefCard
1096 {
1097 get
1098 {
1099 return GetInt(11);
1100 }
1101 set
1102 {
1103 Mod();
1104 SetInt(11, value);
1105 }
1106 }
1107
1108 public int c_priceFix
1109 {
1110 get
1111 {
1112 return GetInt(21);
1113 }
1114 set
1115 {
1116 SetInt(21, value);
1117 }
1118 }
1119
1120 public int c_priceAdd
1121 {
1122 get
1123 {
1124 return GetInt(29);
1125 }
1126 set
1127 {
1128 SetInt(29, value);
1129 }
1130 }
1131
1132 public int c_priceCopy
1133 {
1134 get
1135 {
1136 return GetInt(124);
1137 }
1138 set
1139 {
1140 SetInt(124, value);
1141 }
1142 }
1143
1144 public int c_fixedValue
1145 {
1146 get
1147 {
1148 return GetInt(131);
1149 }
1150 set
1151 {
1152 SetInt(131, value);
1153 }
1154 }
1155
1156 public int c_dyeMat
1157 {
1158 get
1159 {
1160 return GetInt(3);
1161 }
1162 set
1163 {
1164 SetInt(3, value);
1165 }
1166 }
1167
1169 {
1170 get
1171 {
1172 return GetInt(4).ToEnum<VisitorState>();
1173 }
1174 set
1175 {
1176 SetInt(4, (int)value);
1177 }
1178 }
1179
1181 {
1182 get
1183 {
1184 return GetInt(53).ToEnum<RescueState>();
1185 }
1186 set
1187 {
1188 SetInt(53, (int)value);
1189 }
1190 }
1191
1193 {
1194 get
1195 {
1196 return GetInt(65).ToEnum<BossType>();
1197 }
1198 set
1199 {
1200 SetInt(65, (int)value);
1201 }
1202 }
1203
1205 {
1206 get
1207 {
1208 return GetInt(22);
1209 }
1210 set
1211 {
1212 SetInt(22, value);
1213 }
1214 }
1215
1217 {
1218 get
1219 {
1220 return GetInt(130);
1221 }
1222 set
1223 {
1224 SetInt(130, value);
1225 }
1226 }
1227
1228 public int c_IDTState
1229 {
1230 get
1231 {
1232 return GetInt(2);
1233 }
1234 set
1235 {
1236 SetInt(2, value);
1237 }
1238 }
1239
1240 public int c_charges
1241 {
1242 get
1243 {
1244 return GetInt(7);
1245 }
1246 set
1247 {
1248 SetInt(7, value);
1249 }
1250 }
1251
1252 public int c_bill
1253 {
1254 get
1255 {
1256 return GetInt(23);
1257 }
1258 set
1259 {
1260 SetInt(23, value);
1261 }
1262 }
1263
1264 public int c_invest
1265 {
1266 get
1267 {
1268 return GetInt(28);
1269 }
1270 set
1271 {
1272 SetInt(28, value);
1273 }
1274 }
1275
1276 public int c_seed
1277 {
1278 get
1279 {
1280 return GetInt(33);
1281 }
1282 set
1283 {
1284 SetInt(33, value);
1285 }
1286 }
1287
1288 public int c_allowance
1289 {
1290 get
1291 {
1292 return GetInt(114);
1293 }
1294 set
1295 {
1296 SetInt(114, value);
1297 }
1298 }
1299
1300 public int c_fur
1301 {
1302 get
1303 {
1304 return GetInt(62);
1305 }
1306 set
1307 {
1308 SetInt(62, value);
1309 }
1310 }
1311
1312 public int c_dateCooked
1313 {
1314 get
1315 {
1316 return GetInt(66);
1317 }
1318 set
1319 {
1320 SetInt(66, value);
1321 }
1322 }
1323
1325 {
1326 get
1327 {
1328 return GetInt(8);
1329 }
1330 set
1331 {
1332 SetInt(8, value);
1333 }
1334 }
1335
1336 public int c_weight
1337 {
1338 get
1339 {
1340 return GetInt(1);
1341 }
1342 set
1343 {
1344 SetInt(1, value);
1345 }
1346 }
1347
1348 public int c_diceDim
1349 {
1350 get
1351 {
1352 return GetInt(14);
1353 }
1354 set
1355 {
1356 SetInt(14, value);
1357 }
1358 }
1359
1361 {
1362 get
1363 {
1364 return GetInt(15);
1365 }
1366 set
1367 {
1368 SetInt(15, value);
1369 }
1370 }
1371
1373 {
1374 get
1375 {
1376 return GetInt(16);
1377 }
1378 set
1379 {
1380 SetInt(16, value);
1381 }
1382 }
1383
1385 {
1386 get
1387 {
1388 return GetInt(17);
1389 }
1390 set
1391 {
1392 SetInt(17, value);
1393 }
1394 }
1395
1396 public int c_idBacker
1397 {
1398 get
1399 {
1400 return GetInt(52);
1401 }
1402 set
1403 {
1404 SetInt(52, value);
1405 }
1406 }
1407
1408 public int c_uidMaster
1409 {
1410 get
1411 {
1412 return GetInt(54);
1413 }
1414 set
1415 {
1416 SetInt(54, value);
1417 }
1418 }
1419
1420 public int c_ammo
1421 {
1422 get
1423 {
1424 return GetInt(27);
1425 }
1426 set
1427 {
1428 SetInt(27, value);
1429 }
1430 }
1431
1432 public int c_daysWithGod
1433 {
1434 get
1435 {
1436 return GetInt(57);
1437 }
1438 set
1439 {
1440 SetInt(57, value);
1441 }
1442 }
1443
1444 public int c_daysWithPC
1445 {
1446 get
1447 {
1448 return GetInt(67);
1449 }
1450 set
1451 {
1452 SetInt(67, value);
1453 }
1454 }
1455
1456 public string c_idPortrait
1457 {
1458 get
1459 {
1460 return GetStr(9);
1461 }
1462 set
1463 {
1464 SetStr(9, value);
1465 }
1466 }
1467
1468 public string c_idRace
1469 {
1470 get
1471 {
1472 return GetStr(3);
1473 }
1474 set
1475 {
1476 SetStr(3, value);
1477 }
1478 }
1479
1480 public string c_idJob
1481 {
1482 get
1483 {
1484 return GetStr(4);
1485 }
1486 set
1487 {
1488 SetStr(4, value);
1489 }
1490 }
1491
1492 public string c_idTone
1493 {
1494 get
1495 {
1496 return GetStr(22);
1497 }
1498 set
1499 {
1500 SetStr(22, value);
1501 }
1502 }
1503
1504 public string c_color
1505 {
1506 get
1507 {
1508 return GetStr(8);
1509 }
1510 set
1511 {
1512 SetStr(8, value);
1513 }
1514 }
1515
1517 {
1518 get
1519 {
1520 return GetStr(13);
1521 }
1522 set
1523 {
1524 SetStr(13, value);
1525 }
1526 }
1527
1528 public string c_idTalk
1529 {
1530 get
1531 {
1532 return GetStr(21);
1533 }
1534 set
1535 {
1536 SetStr(21, value);
1537 }
1538 }
1539
1540 public string c_idDeity
1541 {
1542 get
1543 {
1544 return GetStr(26);
1545 }
1546 set
1547 {
1548 SetStr(26, value);
1549 }
1550 }
1551
1552 public string c_altName
1553 {
1554 get
1555 {
1556 return GetStr(1);
1557 }
1558 set
1559 {
1560 SetStr(1, value);
1561 }
1562 }
1563
1564 public string c_altName2
1565 {
1566 get
1567 {
1568 return GetStr(2);
1569 }
1570 set
1571 {
1572 SetStr(2, value);
1573 }
1574 }
1575
1576 public string c_extraNameRef
1577 {
1578 get
1579 {
1580 return GetStr(12);
1581 }
1582 set
1583 {
1584 SetStr(12, value);
1585 }
1586 }
1587
1588 public string c_refText
1589 {
1590 get
1591 {
1592 return GetStr(10);
1593 }
1594 set
1595 {
1596 SetStr(10, value);
1597 }
1598 }
1599
1600 public string c_idRefName
1601 {
1602 get
1603 {
1604 return GetStr(7);
1605 }
1606 set
1607 {
1608 SetStr(7, value);
1609 }
1610 }
1611
1612 public string c_idRidePCC
1613 {
1614 get
1615 {
1616 return GetStr(55);
1617 }
1618 set
1619 {
1620 SetStr(55, value);
1621 }
1622 }
1623
1624 public string c_idAbility
1625 {
1626 get
1627 {
1628 return GetStr(50);
1629 }
1630 set
1631 {
1632 SetStr(50, value);
1633 }
1634 }
1635
1636 public string c_context
1637 {
1638 get
1639 {
1640 return GetStr(20);
1641 }
1642 set
1643 {
1644 SetStr(20, value);
1645 }
1646 }
1647
1648 public string c_idEditor
1649 {
1650 get
1651 {
1652 return GetStr(27);
1653 }
1654 set
1655 {
1656 SetStr(27, value);
1657 }
1658 }
1659
1660 public string c_editorTags
1661 {
1662 get
1663 {
1664 return GetStr(28);
1665 }
1666 set
1667 {
1668 SetStr(28, value);
1669 }
1670 }
1671
1672 public string c_editorTraitVal
1673 {
1674 get
1675 {
1676 return GetStr(25);
1677 }
1678 set
1679 {
1680 SetStr(25, value);
1681 }
1682 }
1683
1684 public string c_idTrait
1685 {
1686 get
1687 {
1688 return GetStr(29);
1689 }
1690 set
1691 {
1692 SetStr(29, value);
1693 }
1694 }
1695
1696 public string c_idRefCard
1697 {
1698 get
1699 {
1700 return GetStr(5);
1701 }
1702 set
1703 {
1704 SetStr(5, value);
1705 }
1706 }
1707
1708 public string c_idRefCard2
1709 {
1710 get
1711 {
1712 return GetStr(6);
1713 }
1714 set
1715 {
1716 SetStr(6, value);
1717 }
1718 }
1719
1720 public string c_note
1721 {
1722 get
1723 {
1724 return GetStr(51);
1725 }
1726 set
1727 {
1728 SetStr(51, value);
1729 }
1730 }
1731
1733 {
1734 get
1735 {
1736 return GetObj<UniqueData>(6);
1737 }
1738 set
1739 {
1740 SetObj(6, value);
1741 }
1742 }
1743
1745 {
1746 get
1747 {
1748 return GetObj<Thing>(9);
1749 }
1750 set
1751 {
1752 SetObj(9, value);
1753 }
1754 }
1755
1756 public List<SocketData> socketList
1757 {
1758 get
1759 {
1760 return GetObj<List<SocketData>>(17);
1761 }
1762 set
1763 {
1764 SetObj(17, value);
1765 }
1766 }
1767
1769 {
1770 get
1771 {
1772 return GetObj<Thing>(10);
1773 }
1774 set
1775 {
1776 SetObj(10, value);
1777 }
1778 }
1779
1781 {
1782 get
1783 {
1784 return GetObj<Window.SaveData>(2);
1785 }
1786 set
1787 {
1788 SetObj(2, value);
1789 }
1790 }
1791
1793 {
1794 get
1795 {
1796 return GetObj<CharaUpgrade>(11);
1797 }
1798 set
1799 {
1800 SetObj(11, value);
1801 }
1802 }
1803
1805 {
1806 get
1807 {
1808 return GetObj<CharaGenes>(15);
1809 }
1810 set
1811 {
1812 SetObj(15, value);
1813 }
1814 }
1815
1816 public List<int> c_corruptionHistory
1817 {
1818 get
1819 {
1820 return GetObj<List<int>>(16);
1821 }
1822 set
1823 {
1824 SetObj(16, value);
1825 }
1826 }
1827
1829 {
1830 get
1831 {
1832 return GetObj<ContainerUpgrade>(12) ?? (c_containerUpgrade = new ContainerUpgrade());
1833 }
1834 set
1835 {
1836 SetObj(12, value);
1837 }
1838 }
1839
1840 public DNA c_DNA
1841 {
1842 get
1843 {
1844 return GetObj<DNA>(14);
1845 }
1846 set
1847 {
1848 SetObj(14, value);
1849 }
1850 }
1851
1853 {
1854 get
1855 {
1856 return GetObj<CharaList>(13);
1857 }
1858 set
1859 {
1860 SetObj(13, value);
1861 }
1862 }
1863
1864 public byte[] c_textureData
1865 {
1866 get
1867 {
1868 return GetObj<byte[]>(4);
1869 }
1870 set
1871 {
1872 SetObj(4, value);
1873 }
1874 }
1875
1877
1878 public int invX
1879 {
1880 get
1881 {
1882 return pos.x;
1883 }
1884 set
1885 {
1886 pos.x = value;
1887 }
1888 }
1889
1890 public int invY
1891 {
1892 get
1893 {
1894 return pos.z;
1895 }
1896 set
1897 {
1898 pos.z = value;
1899 }
1900 }
1901
1903 {
1904 get
1905 {
1906 object obj;
1907 if (!c_idRefCard.IsEmpty())
1908 {
1909 obj = EClass.sources.cards.map.TryGetValue(c_idRefCard);
1910 if (obj == null)
1911 {
1912 return EClass.sources.cards.map["ash3"];
1913 }
1914 }
1915 else
1916 {
1917 obj = null;
1918 }
1919 return (CardRow)obj;
1920 }
1921 }
1922
1924 {
1925 get
1926 {
1927 object obj;
1928 if (!c_idRefCard2.IsEmpty())
1929 {
1930 obj = EClass.sources.cards.map.TryGetValue(c_idRefCard2);
1931 if (obj == null)
1932 {
1933 return EClass.sources.cards.map["ash3"];
1934 }
1935 }
1936 else
1937 {
1938 obj = null;
1939 }
1940 return (CardRow)obj;
1941 }
1942 }
1943
1944 public int ExpToNext => (50 + LV * 30) * (100 - Evalue(403)) / 100;
1945
1946 public int DefaultLV => sourceCard.LV;
1947
1949 {
1950 get
1951 {
1952 if (dirtyWeight)
1953 {
1954 _childrenWeight = 0;
1955 if (!(trait is TraitMagicChest))
1956 {
1957 foreach (Thing thing in things)
1958 {
1960 }
1961 dirtyWeight = false;
1962 (parent as Card)?.SetDirtyWeight();
1963 if (isChara && IsPCFaction)
1964 {
1965 Chara.CalcBurden();
1966 }
1967 if (_childrenWeight < 0 || _childrenWeight > 10000000)
1968 {
1969 _childrenWeight = 10000000;
1970 }
1971 }
1972 }
1973 return _childrenWeight * Mathf.Max(100 - Evalue(404), 0) / 100;
1974 }
1975 }
1976
1978
1980
1981 public virtual int SelfWeight => 1000;
1982
1983 public virtual int WeightLimit => 500000;
1984
1986
1988
1989 public virtual string AliasMaterialOnCreate => DefaultMaterial.alias;
1990
1991 public Cell Cell => pos.cell;
1992
1993 public virtual Thing Thing
1994 {
1995 get
1996 {
1997 if (!isThing)
1998 {
1999 return null;
2000 }
2001 return (Thing)this;
2002 }
2003 }
2004
2005 public virtual Chara Chara
2006 {
2007 get
2008 {
2009 if (!isChara)
2010 {
2011 return null;
2012 }
2013 return (Chara)this;
2014 }
2015 }
2016
2017 public virtual bool isThing => false;
2018
2019 public virtual bool isChara => false;
2020
2021 public bool ExistsOnMap => parent == EClass._zone;
2022
2023 public virtual bool isSynced => renderer.isSynced;
2024
2026
2027 public bool IsUnique => rarity == Rarity.Artifact;
2028
2029 public bool IsPowerful
2030 {
2031 get
2032 {
2033 if (rarity >= Rarity.Legendary || trait is TraitAdventurer)
2034 {
2035 return !IsPCFaction;
2036 }
2037 return false;
2038 }
2039 }
2040
2041 public bool IsImportant => sourceCard.HasTag(CTAG.important);
2042
2043 public virtual SourcePref Pref => sourceCard.pref;
2044
2045 public virtual bool IsDeadOrSleeping => false;
2046
2047 public virtual bool IsDisabled => false;
2048
2049 public virtual bool IsMoving => false;
2050
2051 public virtual bool flipX
2052 {
2053 get
2054 {
2055 if (Tiles.Length == 1)
2056 {
2057 return dir % 2 == 1;
2058 }
2059 return false;
2060 }
2061 }
2062
2063 public virtual bool IsAliveInCurrentZone => ExistsOnMap;
2064
2065 public virtual string actorPrefab => "ThingActor";
2066
2067 public virtual CardRow sourceCard => null;
2068
2070
2072
2073 public string Name => GetName(NameStyle.Full);
2074
2075 public string NameSimple => GetName(NameStyle.Simple);
2076
2077 public string NameOne => GetName(NameStyle.Full, 1);
2078
2079 public virtual bool IsPC => false;
2080
2081 public bool _IsPC => GetInt(56) != 0;
2082
2083 public virtual bool IsPCC => false;
2084
2085 public virtual bool IsPCParty => false;
2086
2087 public virtual bool IsMinion => false;
2088
2089 public virtual bool IsPCPartyMinion => false;
2090
2091 public virtual bool IsPCFactionMinion => false;
2092
2093 public virtual bool IsMultisize
2094 {
2095 get
2096 {
2098 {
2099 return IsInstalled;
2100 }
2101 return false;
2102 }
2103 }
2104
2105 public bool IsToolbelt => category.slot == 44;
2106
2107 public bool IsLightsource => category.slot == 45;
2108
2109 public bool IsEquipment => category.slot != 0;
2110
2111 public bool IsFood => category.IsChildOf("food");
2112
2114 {
2115 get
2116 {
2117 if (!IsFood && !category.IsChildOf("seed") && !category.IsChildOf("drink") && !(id == "pasture"))
2118 {
2119 return id == "grass";
2120 }
2121 return true;
2122 }
2123 }
2124
2125 public bool ShowFoodEnc
2126 {
2127 get
2128 {
2130 {
2131 if (Evalue(10) > 0)
2132 {
2134 }
2135 return false;
2136 }
2137 return true;
2138 }
2139 }
2140
2141 public bool IsWeapon
2142 {
2143 get
2144 {
2145 if (!IsMeleeWeapon)
2146 {
2147 return IsRangedWeapon;
2148 }
2149 return true;
2150 }
2151 }
2152
2154 {
2155 get
2156 {
2157 if (category.slot == 0)
2158 {
2159 return IsRangedWeapon;
2160 }
2161 return true;
2162 }
2163 }
2164
2166 {
2167 get
2168 {
2169 if (category.slot == 0 && !IsRangedWeapon)
2170 {
2171 return IsAmmo;
2172 }
2173 return true;
2174 }
2175 }
2176
2177 public bool IsMeleeWeapon => category.IsChildOf("melee");
2178
2180
2181 public bool IsThrownWeapon => sourceCard.HasTag(CTAG.throwWeapon);
2182
2183 public bool IsAmmo => trait is TraitAmmo;
2184
2185 public bool IsAgent => this == EClass.player.Agent;
2186
2187 public bool IsFurniture => category.IsChildOf("furniture");
2188
2189 public bool IsBlessed => blessedState >= BlessedState.Blessed;
2190
2191 public bool IsCursed => blessedState <= BlessedState.Cursed;
2192
2194 {
2195 get
2196 {
2197 if (isRestrained)
2198 {
2199 return IsPCFaction;
2200 }
2201 return false;
2202 }
2203 }
2204
2205 public virtual bool IsPCFaction => false;
2206
2208 {
2209 get
2210 {
2211 if (!IsPCFaction)
2212 {
2213 return IsPCFactionMinion;
2214 }
2215 return true;
2216 }
2217 }
2218
2219 public virtual bool IsGlobal => false;
2220
2221 public virtual int MaxDecay => 1000;
2222
2223 public bool IsDecayed => decay > MaxDecay;
2224
2225 public bool IsRotting => decay >= MaxDecay / 4 * 3;
2226
2227 public bool IsFresn => decay < MaxDecay / 4;
2228
2229 public virtual int MaxHP => 100;
2230
2231 public virtual int Power => Mathf.Max(20, EClass.curve(GetTotalQuality() * 10, 400, 100));
2232
2233 public int FameLv
2234 {
2235 get
2236 {
2237 if (!IsPC)
2238 {
2239 return LV;
2240 }
2241 return EClass.player.fame / 100 + 1;
2242 }
2243 }
2244
2245 public virtual int[] Tiles => sourceCard._tiles;
2246
2247 public virtual int PrefIndex
2248 {
2249 get
2250 {
2251 if (Tiles.Length < 3)
2252 {
2253 return dir % 2;
2254 }
2255 return dir;
2256 }
2257 }
2258
2259 public bool IsVariation => sourceCard.origin != null;
2260
2261 public virtual int DV => elements.Value(64);
2262
2263 public virtual int PV => elements.Value(65);
2264
2265 public int HIT => elements.Value(66);
2266
2267 public int DMG => elements.Value(67);
2268
2269 public int STR => elements.Value(70);
2270
2271 public int DEX => elements.Value(72);
2272
2273 public int END => elements.Value(71);
2274
2275 public int PER => elements.Value(73);
2276
2277 public int LER => elements.Value(74);
2278
2279 public int WIL => elements.Value(75);
2280
2281 public int MAG => elements.Value(76);
2282
2283 public int CHA => elements.Value(77);
2284
2285 public int INT => elements.Value(80);
2286
2287 public int LUC => elements.Value(78);
2288
2289 public int W
2290 {
2291 get
2292 {
2293 if (dir % 2 != 0)
2294 {
2295 return sourceCard.H;
2296 }
2297 return sourceCard.W;
2298 }
2299 }
2300
2301 public int H
2302 {
2303 get
2304 {
2305 if (dir % 2 != 0)
2306 {
2307 return sourceCard.W;
2308 }
2309 return sourceCard.H;
2310 }
2311 }
2312
2313 public bool IsIdentified => c_IDTState == 0;
2314
2315 public string TextRarity => Lang.GetList("quality")[Mathf.Clamp((int)(rarity + 1), 0, 5)];
2316
2317 public bool IsInstalled => placeState == PlaceState.installed;
2318
2319 public bool IsMale
2320 {
2321 get
2322 {
2323 if (bio != null)
2324 {
2325 return bio.gender == 2;
2326 }
2327 return false;
2328 }
2329 }
2330
2331 public bool IsNegativeGift
2332 {
2333 get
2334 {
2335 if (!HasTag(CTAG.neg))
2336 {
2337 return blessedState <= BlessedState.Cursed;
2338 }
2339 return true;
2340 }
2341 }
2342
2344
2346 {
2347 get
2348 {
2349 if (!IsPC)
2350 {
2351 return null;
2352 }
2354 }
2355 }
2356
2358
2359 public virtual bool HasHost => false;
2360
2361 public int Quality => Evalue(2);
2362
2363 public int QualityLv => Quality / 10;
2364
2366 {
2367 get
2368 {
2369 if (_LightData == null)
2370 {
2371 return _LightData = ((!sourceCard.lightData.IsEmpty()) ? EClass.Colors.lightColors[sourceCard.lightData] : null);
2372 }
2373 return _LightData;
2374 }
2375 }
2376
2378 {
2379 get
2380 {
2381 if (!isChara || Chara.host == null)
2382 {
2383 return renderer;
2384 }
2385 return Chara.host.renderer;
2386 }
2387 }
2388
2389 public bool ShouldShowMsg
2390 {
2391 get
2392 {
2393 if (IsPC || parent == EClass.pc || isSynced)
2394 {
2395 if (isChara)
2396 {
2397 return !Chara.isDead;
2398 }
2399 return true;
2400 }
2401 return false;
2402 }
2403 }
2404
2405 public bool CanInspect
2406 {
2407 get
2408 {
2409 if (!isDestroyed)
2410 {
2411 return ExistsOnMap;
2412 }
2413 return false;
2414 }
2415 }
2416
2417 public string InspectName => Name;
2418
2420
2422
2423 public override string ToString()
2424 {
2425 return Name + "/" + pos?.ToString() + "/" + parent;
2426 }
2427
2428 public bool CanReserve(AIAct act)
2429 {
2430 if (reservedAct != null && reservedAct != act)
2431 {
2432 return !reservedAct.IsRunning;
2433 }
2434 return true;
2435 }
2436
2437 public bool TryReserve(AIAct act)
2438 {
2439 if (CanReserve(act))
2440 {
2441 reservedAct = act;
2442 return true;
2443 }
2444 return false;
2445 }
2446
2447 public void Mod()
2448 {
2449 isModified = true;
2450 }
2451
2453 {
2454 if (IsPC)
2455 {
2456 return Window.dictData.TryGetValue("LayerInventoryFloatMain0");
2457 }
2459 {
2460 return Window.dictData.TryGetValue("ChestMerchant");
2461 }
2462 return c_windowSaveData;
2463 }
2464
2466 {
2467 if (IsUnique || c_isImportant)
2468 {
2469 return true;
2470 }
2471 if (parent is Card card)
2472 {
2473 if (card.trait is TraitChestMerchant)
2474 {
2475 return true;
2476 }
2477 if (card.isSale || !card.trait.CanUseContent)
2478 {
2479 return true;
2480 }
2481 Window.SaveData windowSaveData = card.GetWindowSaveData();
2482 if (windowSaveData != null)
2483 {
2484 return windowSaveData.excludeCraft;
2485 }
2486 }
2487 return false;
2488 }
2489
2490 public void SetDirtyWeight()
2491 {
2493 {
2494 EClass.player.wasDirtyWeight = true;
2495 }
2496 dirtyWeight = true;
2497 (parent as Card)?.SetDirtyWeight();
2498 }
2499
2500 public void ChangeWeight(int a)
2501 {
2502 c_weight = a;
2503 isWeightChanged = true;
2505 }
2506
2507 public int Evalue(int ele)
2508 {
2509 return elements.Value(ele);
2510 }
2511
2512 public int Evalue(int ele, bool ignoreGlobalElement)
2513 {
2514 if (!ignoreGlobalElement || !HasGlobalElement(ele))
2515 {
2516 return elements.Value(ele);
2517 }
2518 return 0;
2519 }
2520
2521 public int EvalueMax(int ele, int min = 0)
2522 {
2523 return Mathf.Max(elements.Value(ele), min);
2524 }
2525
2526 public int Evalue(string alias)
2527 {
2528 return elements.Value(EClass.sources.elements.alias[alias].id);
2529 }
2530
2531 public bool HasTag(CTAG tag)
2532 {
2533 return sourceCard.tag.Contains(tag.ToString());
2534 }
2535
2536 public bool HasEditorTag(EditorTag tag)
2537 {
2538 return c_editorTags?.Contains(tag.ToString()) ?? false;
2539 }
2540
2541 public void AddEditorTag(EditorTag tag)
2542 {
2543 c_editorTags = (c_editorTags.IsEmpty() ? tag.ToString() : (c_editorTags + "," + tag));
2544 }
2545
2547 {
2548 c_editorTags = (c_editorTags.IsEmpty() ? null : c_editorTags.Replace(tag.ToString(), "").Replace(",,", ","));
2549 }
2550
2551 public virtual string GetName(NameStyle style, int num = -1)
2552 {
2553 return "Card";
2554 }
2555
2556 public virtual string GetExtraName()
2557 {
2558 return "";
2559 }
2560
2561 public virtual string GetDetail()
2562 {
2563 return sourceCard.GetText("detail", returnNull: true);
2564 }
2565
2566 public int GetBestAttribute()
2567 {
2568 int num = 1;
2569 foreach (Element item in elements.dict.Values.Where((Element a) => Element.List_MainAttributesMajor.Contains(a.id)))
2570 {
2571 int num2 = item.Value;
2572 if (isChara && Chara.tempElements != null)
2573 {
2574 num2 -= Chara.tempElements.Value(item.id);
2575 }
2576 if (num2 > num)
2577 {
2578 num = num2;
2579 }
2580 }
2581 return num;
2582 }
2583
2584 public void ModExp(string alias, int a)
2585 {
2586 ModExp(EClass.sources.elements.alias[alias].id, a);
2587 }
2588
2589 public void ModExp(int ele, int a)
2590 {
2591 if (isChara)
2592 {
2593 elements.ModExp(ele, a);
2594 }
2595 }
2596
2597 public bool IsChildOf(Card c)
2598 {
2599 return GetRootCard() == c;
2600 }
2601
2602 public T FindTool<T>() where T : Trait
2603 {
2604 if (IsPC)
2605 {
2606 return Tool?.trait as T;
2607 }
2608 return things.Find<T>()?.trait as T;
2609 }
2610
2612 private void _OnSerializing(StreamingContext context)
2613 {
2614 _x = pos.x;
2615 _z = pos.z;
2616 _ints[0] = _bits1.ToInt();
2617 _ints[2] = _bits2.ToInt();
2619 version = 1;
2620 OnSerializing();
2621 }
2622
2623 protected virtual void OnSerializing()
2624 {
2625 }
2626
2628 private void _OnDeserialized(StreamingContext context)
2629 {
2630 _bits1.SetInt(_ints[0]);
2631 _bits2.SetInt(_ints[2]);
2633 pos.Set(_x, _z);
2634 SetSource();
2635 things.SetOwner(this);
2636 elements.SetOwner(this, applyFeat: false);
2638 ApplyTrait();
2639 ApplyMaterialElements(remove: false);
2641 foreach (Thing thing in things)
2642 {
2643 thing.parent = this;
2644 }
2645 if (isThing && Num <= 0)
2646 {
2647 isDestroyed = true;
2648 }
2649 }
2650
2651 protected virtual void OnDeserialized()
2652 {
2653 }
2654
2655 public string ReferenceId()
2656 {
2657 return "c" + uid;
2658 }
2659
2660 public void Create(string _id, int _idMat = -1, int genLv = -1)
2661 {
2662 if (CardBlueprint.current != null)
2663 {
2665 CardBlueprint.current = null;
2666 }
2667 else
2668 {
2670 }
2671 id = _id;
2672 Num = 1;
2673 autoRefuel = true;
2674 EClass.game.cards.AssignUID(this);
2675 isNew = true;
2676 SetSource();
2678 if (sourceCard.quality != 0)
2679 {
2680 rarity = sourceCard.quality.ToEnum<Rarity>();
2681 }
2682 else if (bp.rarity != Rarity.Random)
2683 {
2684 rarity = bp.rarity;
2685 }
2686 else if (category.slot != 0 && category.slot != 45 && category.slot != 44)
2687 {
2688 if (EClass.rnd(10) == 0)
2689 {
2690 rarity = Rarity.Crude;
2691 }
2692 else if (EClass.rnd(10) == 0)
2693 {
2694 rarity = Rarity.Superior;
2695 }
2696 else if (EClass.rnd(80) == 0)
2697 {
2698 rarity = Rarity.Legendary;
2699 }
2700 else if (EClass.rnd(250) == 0)
2701 {
2702 rarity = Rarity.Mythical;
2703 }
2704 }
2705 if (rarity != 0 && category.tag.Contains("fixedRarity"))
2706 {
2707 rarity = Rarity.Normal;
2708 }
2709 LV = DefaultLV;
2710 if (bp.lv != -999)
2711 {
2712 LV = bp.lv;
2713 }
2714 if (id == "microchip")
2715 {
2716 Debug.Log(id + "/" + _idMat + "/" + sourceCard.fixedMaterial);
2717 }
2719 {
2721 }
2722 else
2723 {
2724 bool flag = (bp != null && bp.fixedMat) || sourceCard.quality == 4 || sourceCard.tierGroup.IsEmpty();
2725 if (_idMat != -1)
2726 {
2727 _material = EClass.sources.materials.rows[_idMat];
2728 }
2729 else if (!flag)
2730 {
2731 if (sourceCard.tierGroup == "wood")
2732 {
2733 Debug.Log(id);
2734 }
2736 }
2737 else
2738 {
2740 }
2741 }
2742 idMaterial = _material.id;
2743 things.SetOwner(this);
2744 elements.SetOwner(this, applyFeat: true);
2745 ApplyTrait();
2747 {
2748 tier = Mathf.Clamp(EClass.rnd(5) + 1, 1, 3);
2749 LV = LV + tier * 10 + (LV - 1) * (125 + tier * 25) / 100;
2750 }
2751 ApplyMaterial();
2752 OnCreate(genLv);
2754 trait.OnCreate(genLv);
2755 hp = MaxHP;
2756 if (HasTag(CTAG.hidden))
2757 {
2758 SetHidden();
2759 }
2761 }
2762
2763 public virtual void OnBeforeCreate()
2764 {
2765 }
2766
2767 public virtual void OnCreate(int genLv)
2768 {
2769 }
2770
2771 public virtual void SetSource()
2772 {
2773 }
2774
2775 public virtual void ApplyEditorTags(EditorTag tag)
2776 {
2777 switch (tag)
2778 {
2779 case EditorTag.Hidden:
2780 SetHidden();
2781 break;
2782 case EditorTag.Empty:
2783 RemoveThings();
2784 break;
2785 case EditorTag.IsOn:
2786 isOn = true;
2787 break;
2788 case EditorTag.IsOff:
2789 isOn = false;
2790 break;
2791 case EditorTag.NoSnow:
2792 noSnow = true;
2793 break;
2794 case EditorTag.Boss:
2795 EClass._zone.Boss = Chara;
2796 break;
2797 }
2798 }
2799
2800 public void ApplyTrait()
2801 {
2802 string str = c_idTrait;
2803 if (str.IsEmpty())
2804 {
2805 if (sourceCard.trait.IsEmpty())
2806 {
2807 trait = (isChara ? new TraitChara() : new Trait());
2808 }
2809 else
2810 {
2811 trait = ClassCache.Create<Trait>("Trait" + sourceCard.trait[0], "Elin");
2812 }
2813 }
2814 else
2815 {
2816 trait = ClassCache.Create<Trait>(str, "Elin");
2817 }
2818 trait.SetOwner(this);
2819 }
2820
2821 public Card SetLv(int a)
2822 {
2823 bool flag = a > LV;
2824 LV = a;
2825 if (!isChara)
2826 {
2827 return this;
2828 }
2829 Rand.SetSeed(uid);
2830 ElementContainer elementContainer = new ElementContainer();
2831 elementContainer.ApplyElementMap(uid, SourceValueType.Chara, Chara.job.elementMap, LV);
2832 elementContainer.ApplyElementMap(uid, SourceValueType.Chara, Chara.race.elementMap, LV);
2833 elementContainer.ApplyElementMap(uid, SourceValueType.Chara, Chara.source.elementMap, 1, invert: false, applyFeat: true);
2834 foreach (Element value in elements.dict.Values)
2835 {
2836 int num = elementContainer.Value(value.id);
2837 if (num != 0)
2838 {
2839 int num2 = num - value.ValueWithoutLink;
2840 if (num2 != 0)
2841 {
2842 elements.ModBase(value.id, num2);
2843 }
2844 }
2845 }
2846 if (flag)
2847 {
2849 }
2850 Rand.SetSeed();
2851 hp = MaxHP;
2852 Chara.mana.value = Chara.mana.max;
2855 return this;
2856 }
2857
2858 public void ClampInitialSkill()
2859 {
2860 if (elements.Base(286) > 50)
2861 {
2862 elements.SetTo(286, 50 + (int)Mathf.Sqrt(elements.Base(286) - 50));
2863 }
2864 }
2865
2866 public void AddExp(int a)
2867 {
2868 a = a * GetExpMtp() / 100;
2869 exp += a;
2870 while (exp >= ExpToNext)
2871 {
2872 exp -= ExpToNext;
2873 LevelUp();
2874 }
2875 }
2876
2877 public int GetExpMtp()
2878 {
2879 int num = 100;
2880 if (!IsPC)
2881 {
2882 num *= 2;
2883 if (IsPCFaction)
2884 {
2885 num = num * GetAffinityExpBonus() / 100;
2887 {
2888 num = num * (50 + EClass.game.principal.petFeatExpMtp * 50) / 100;
2889 }
2890 }
2891 }
2892 return num * (100 + Evalue(1237) * 30) / 100;
2893 }
2894
2896 {
2897 return Mathf.Clamp(100 + Chara.affinity.value / 10, 50, 200);
2898 }
2899
2901 {
2903 {
2904 return 100;
2905 }
2906 return 100 + EClass.curve(c_daysWithPC / 100 * 3, 100, 20, 70);
2907 }
2908
2909 public void LevelUp()
2910 {
2911 if (IsPC)
2912 {
2914 {
2915 Msg.Say("demoLimit");
2916 return;
2917 }
2919 Tutorial.Reserve("feat");
2920 }
2921 feat++;
2922 LV++;
2923 Say("dingExp", this);
2924 PlaySound("jingle_lvup");
2925 PlayEffect("aura_heaven");
2926 if (HasElement(1415) && Evalue(1415) < 9 && LV >= Evalue(1415) * 5 + 10)
2927 {
2928 Chara.SetFeat(1415, Evalue(1415) + 1, msg: true);
2929 }
2930 if (IsPC)
2931 {
2932 return;
2933 }
2934 if (Chara.race.id == "mutant")
2935 {
2936 int num = Mathf.Min(1 + LV / 5, 20);
2937 for (int i = 0; i < num; i++)
2938 {
2939 if (Evalue(1644) < i + 1)
2940 {
2941 Chara.SetFeat(1644, i + 1);
2942 }
2943 }
2944 }
2945 Chara.TryUpgrade();
2946 }
2947
2948 public virtual void ApplyMaterialElements(bool remove)
2949 {
2950 }
2951
2952 public virtual void ApplyMaterial(bool remove = false)
2953 {
2954 _colorInt = 0;
2955 }
2956
2957 public Card ChangeMaterial(int idNew, bool ignoreFixedMaterial = false)
2958 {
2959 return ChangeMaterial(EClass.sources.materials.map[idNew], ignoreFixedMaterial);
2960 }
2961
2962 public Card ChangeMaterial(string idNew, bool ignoreFixedMaterial = false)
2963 {
2964 return ChangeMaterial(EClass.sources.materials.alias[idNew], ignoreFixedMaterial);
2965 }
2966
2967 public Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial = false)
2968 {
2969 if (sourceCard.fixedMaterial && !ignoreFixedMaterial)
2970 {
2971 return this;
2972 }
2973 ApplyMaterial(remove: true);
2974 _material = row;
2975 idMaterial = row.id;
2976 decay = 0;
2977 dirtyWeight = true;
2978 Card rootCard = GetRootCard();
2979 if (rootCard != null && rootCard.IsPC)
2980 {
2982 }
2983 if (isThing)
2984 {
2986 }
2987 ApplyMaterial();
2988 return this;
2989 }
2990
2991 public void SetReplica(bool on)
2992 {
2993 isReplica = true;
2994 ChangeMaterial("granite");
2995 }
2996
2997 public Thing Add(string id, int num = 1, int lv = 1)
2998 {
2999 if (num == 0)
3000 {
3001 num = 1;
3002 }
3003 return AddCard(ThingGen.Create(id, -1, lv).SetNum(num)) as Thing;
3004 }
3005
3007 {
3008 return AddThing(c as Thing);
3009 }
3010
3011 public void RemoveCard(Card c)
3012 {
3013 RemoveThing(c as Thing);
3014 }
3015
3016 public void NotifyAddThing(Thing t, int num)
3017 {
3018 }
3019
3020 public Thing AddThing(string id, int lv = -1)
3021 {
3022 return AddThing(ThingGen.Create(id, -1, (lv == -1) ? LV : lv));
3023 }
3024
3025 public Thing AddThing(Thing t, bool tryStack = true, int destInvX = -1, int destInvY = -1)
3026 {
3027 if (t.Num == 0 || t.isDestroyed)
3028 {
3029 Debug.LogWarning("tried to add destroyed thing:" + t.Num + "/" + t.isDestroyed + "/" + t?.ToString() + "/" + this);
3030 return t;
3031 }
3032 if (t.parent == this)
3033 {
3034 Debug.LogWarning("already child:" + t);
3035 return t;
3036 }
3037 if (things.Contains(t))
3038 {
3039 Debug.Log("already in the list" + t);
3040 return t;
3041 }
3042 _ = t.parent;
3043 _ = EClass._zone;
3044 bool flag = IsPC && t.GetRootCard() == EClass.pc;
3045 if (t.parent != null)
3046 {
3047 t.parent.RemoveCard(t);
3048 }
3049 if (t.trait.ToggleType == ToggleType.Fire && destInvY == 0)
3050 {
3051 t.trait.Toggle(on: false);
3052 }
3053 t.isMasked = false;
3054 t.ignoreAutoPick = false;
3055 t.parent = this;
3056 t.noShadow = false;
3057 t.isSale = false;
3058 if (t.IsContainer)
3059 {
3060 t.RemoveEditorTag(EditorTag.PreciousContainer);
3061 }
3062 t.invX = -1;
3063 if (destInvY == -1)
3064 {
3065 t.invY = 0;
3066 }
3067 if (t.IsUnique && t.HasTag(CTAG.godArtifact) && t.GetRootCard() is Chara { IsPCFactionOrMinion: not false })
3068 {
3070 }
3071 Thing thing = (tryStack ? things.TryStack(t, destInvX, destInvY) : t);
3072 if (t == thing)
3073 {
3074 things.Add(t);
3075 things.OnAdd(t);
3076 }
3077 if (thing == t && IsPC && EClass.core.IsGameStarted && EClass._map != null && parent == EClass.game.activeZone && pos.IsValid && !flag)
3078 {
3079 NotifyAddThing(t, t.Num);
3080 }
3081 if (t == thing && isThing && parent == EClass._zone && placeState != 0)
3082 {
3084 }
3087 {
3089 LayerInventory.SetDirty(thing);
3090 }
3091 if (IsPC)
3092 {
3093 goto IL_029f;
3094 }
3095 if (IsContainer)
3096 {
3097 Card rootCard = GetRootCard();
3098 if (rootCard != null && rootCard.IsPC)
3099 {
3100 goto IL_029f;
3101 }
3102 }
3103 goto IL_0345;
3104 IL_0345:
3105 return thing;
3106 IL_029f:
3107 t.isNPCProperty = false;
3108 t.isGifted = false;
3109 int count = 0;
3110 HashSet<string> ings = EClass.player.recipes.knownIngredients;
3111 TryAdd(t);
3112 if (t.CanSearchContents)
3113 {
3114 t.things.Foreach(delegate(Thing _t)
3115 {
3116 TryAdd(_t);
3117 });
3118 }
3119 if (count > 0 && EClass.core.IsGameStarted)
3120 {
3121 Msg.Say((count == 1) ? "newIng" : "newIngs", count.ToString() ?? "");
3122 }
3123 goto IL_0345;
3124 void TryAdd(Thing a)
3125 {
3126 if (!ings.Contains(a.id))
3127 {
3128 ings.Add(a.id);
3129 count++;
3130 if (a.sourceCard.origin != null && !ings.Contains(a.sourceCard.origin.id))
3131 {
3132 ings.Add(a.sourceCard.origin.id);
3133 }
3134 }
3135 }
3136 }
3137
3139 {
3140 List<Chara> list = new List<Chara>();
3141 foreach (FactionBranch child in EClass.pc.faction.GetChildren())
3142 {
3143 foreach (Chara member in child.members)
3144 {
3145 list.Add(member);
3146 }
3147 }
3148 foreach (Chara chara in EClass._map.charas)
3149 {
3150 list.Add(chara);
3151 }
3152 foreach (Chara item in list)
3153 {
3154 if (!item.IsPCFactionOrMinion)
3155 {
3156 continue;
3157 }
3158 List<Thing> list2 = item.things.List((Thing t) => t.id == af.id && t != af);
3159 if (list2.Count == 0)
3160 {
3161 continue;
3162 }
3163 foreach (Thing item2 in list2)
3164 {
3165 Msg.Say("destroyed_inv_", item2, item);
3166 item2.Destroy();
3167 }
3168 }
3169 }
3170
3171 public void RemoveThings()
3172 {
3173 for (int num = things.Count - 1; num >= 0; num--)
3174 {
3175 RemoveThing(things[num]);
3176 }
3177 }
3178
3179 public void RemoveThing(Thing thing)
3180 {
3181 Card rootCard = GetRootCard();
3182 if (rootCard != null && rootCard.isChara && (rootCard.Chara.held == thing || (rootCard.IsPC && thing.things.Find((Thing t) => EClass.pc.held == t) != null)))
3183 {
3184 rootCard.Chara.held = null;
3185 if (rootCard.IsPC)
3186 {
3188 if ((bool)instance && instance.selected != -1 && instance.selectedButton.card != null && instance.selectedButton.card == thing)
3189 {
3190 instance.selectedButton.card = null;
3191 }
3193 ActionMode.AdvOrRegion.updatePlans = true;
3194 LayerInventory.SetDirty(thing);
3195 }
3197 }
3198 dirtyWeight = true;
3199 if (thing.c_equippedSlot != 0 && isChara)
3200 {
3201 Chara.body.Unequip(thing);
3202 }
3203 things.Remove(thing);
3204 things.OnRemove(thing);
3205 if (isSale && things.Count == 0 && IsContainer)
3206 {
3207 isSale = false;
3208 EClass._map.props.sales.Remove(this);
3209 }
3210 if (thing.invY == 1)
3211 {
3212 WidgetCurrentTool.dirty = true;
3213 }
3214 thing.invX = -1;
3215 thing.invY = 0;
3216 if (thing.props != null)
3217 {
3218 thing.props.Remove(thing);
3219 }
3222 {
3223 LayerInventory.SetDirty(thing);
3224 WidgetHotbar.dirtyCurrentItem = true;
3225 thing.parent = null;
3226 if (thing.trait.IsContainer)
3227 {
3228 foreach (LayerInventory item in LayerInventory.listInv.Copy())
3229 {
3230 if (item.invs[0].owner.Container.GetRootCard() != EClass.pc && item.floatInv)
3231 {
3232 EClass.ui.layerFloat.RemoveLayer(item);
3233 }
3234 }
3235 }
3236 }
3237 thing.parent = null;
3238 }
3239
3241 {
3242 if (EClass.player.chara != null)
3243 {
3244 if (!IsPC && GetRootCard() != EClass.pc)
3245 {
3246 return EClass.ui.layers.Count > 0;
3247 }
3248 return true;
3249 }
3250 return false;
3251 }
3252
3253 public virtual bool CanStackTo(Thing to)
3254 {
3255 return false;
3256 }
3257
3258 public bool TryStackTo(Thing to)
3259 {
3260 if (isDestroyed || to.isDestroyed || !CanStackTo(to))
3261 {
3262 return false;
3263 }
3264 to.decay = (to.decay * to.Num + decay * Num) / (to.Num + Num);
3265 to.ModNum(Num);
3266 if (c_isImportant)
3267 {
3268 to.c_isImportant = true;
3269 }
3271 {
3272 to.isNew = true;
3273 }
3274 Destroy();
3275 return true;
3276 }
3277
3279 {
3280 if (parent == null)
3281 {
3282 return this;
3283 }
3284 return parent.GetRoot();
3285 }
3286
3288 {
3289 if (!(parent is Card card))
3290 {
3291 return this;
3292 }
3293 return card.GetRootCard();
3294 }
3295
3296 public bool IsStackable(Thing tg)
3297 {
3298 if (id != tg.id || material != tg.material)
3299 {
3300 return false;
3301 }
3302 return true;
3303 }
3304
3305 public Thing Duplicate(int num)
3306 {
3307 Thing thing = ThingGen.Create(id);
3308 thing.ChangeMaterial(idMaterial, ignoreFixedMaterial: true);
3309 thing._bits1 = _bits1;
3310 thing._bits2 = _bits2;
3311 thing.dir = dir;
3312 thing.refVal = refVal;
3313 thing.altitude = altitude;
3314 thing.idSkin = idSkin;
3315 thing.blessedState = blessedState;
3316 thing.rarityLv = rarityLv;
3317 thing.tier = tier;
3318 thing.LV = LV;
3319 thing.exp = exp;
3320 thing.encLV = encLV;
3321 thing.decay = decay;
3322 thing.mapInt.Clear();
3323 thing.mapStr.Clear();
3324 foreach (KeyValuePair<int, int> item in mapInt)
3325 {
3326 thing.mapInt[item.Key] = item.Value;
3327 }
3328 foreach (KeyValuePair<int, string> item2 in mapStr)
3329 {
3330 thing.mapStr[item2.Key] = item2.Value;
3331 }
3332 elements.CopyTo(thing.elements);
3333 thing.SetNum(num);
3334 if (thing.IsRangedWeapon)
3335 {
3336 thing.sockets = IO.DeepCopy(sockets);
3337 }
3338 if (thing.c_containerSize != 0)
3339 {
3340 thing.things.SetOwner(thing);
3341 }
3342 return thing;
3343 }
3344
3345 public Thing Split(int a)
3346 {
3347 if (a == Num)
3348 {
3349 return Thing;
3350 }
3351 Thing result = Duplicate(a);
3352 ModNum(-a, notify: false);
3353 return result;
3354 }
3355
3356 public Thing SetNum(int a)
3357 {
3358 if (!isThing)
3359 {
3360 return null;
3361 }
3362 if (a == Num)
3363 {
3364 return this as Thing;
3365 }
3366 ModNum(a - Num);
3367 return this as Thing;
3368 }
3369
3371 {
3372 noSell = true;
3373 return this as Thing;
3374 }
3375
3376 public void ModNum(int a, bool notify = true)
3377 {
3378 if (Num + a < 0)
3379 {
3380 a = -Num;
3381 }
3382 Num += a;
3383 if (props != null)
3384 {
3385 props.OnNumChange(this, a);
3386 }
3387 if (parent != null)
3388 {
3390 }
3391 if (a > 0 && EClass.core.IsGameStarted && GetRootCard() == EClass.pc && notify)
3392 {
3394 }
3396 if (Num <= 0)
3397 {
3398 Destroy();
3399 }
3400 }
3401
3402 public void AddSocket()
3403 {
3404 if (sockets == null)
3405 {
3406 sockets = new List<int>();
3407 }
3408 sockets.Add(0);
3409 }
3410
3411 public void ApplySocket(Thing t)
3412 {
3413 if (t.trait is TraitMod traitMod && sockets != null)
3414 {
3415 ApplySocket(traitMod.source.id, traitMod.owner.encLV, traitMod.owner);
3416 }
3417 }
3418
3419 public void ApplySocket(int id, int lv, Card mod = null)
3420 {
3421 for (int i = 0; i < sockets.Count; i++)
3422 {
3423 if (sockets[i] == 0)
3424 {
3425 if (lv >= 100)
3426 {
3427 lv = 99;
3428 }
3429 sockets[i] = id * 100 + lv;
3430 elements.ModBase(id, lv);
3431 mod?.Destroy();
3432 break;
3433 }
3434 }
3435 }
3436
3437 public void EjectSockets()
3438 {
3439 for (int i = 0; i < sockets.Count; i++)
3440 {
3441 int num = sockets[i];
3442 if (num != 0)
3443 {
3444 Thing thing = ThingGen.Create(isCopy ? "ash3" : "mod_ranged");
3445 int ele = num / 100;
3446 int num2 = num % 100;
3447 elements.ModBase(ele, -num2);
3448 if (!isCopy)
3449 {
3450 thing.refVal = ele;
3451 thing.encLV = num2;
3452 }
3454 sockets[i] = 0;
3455 }
3456 }
3457 }
3458
3460 {
3461 return AddRune(rune.refVal, rune.encLV);
3462 }
3463
3464 public SocketData AddRune(int idEle, int v)
3465 {
3466 if (socketList == null)
3467 {
3468 socketList = new List<SocketData>();
3469 }
3470 SourceElement.Row row = EClass.sources.elements.map[idEle];
3471 SocketData socketData = new SocketData
3472 {
3473 idEle = idEle,
3474 value = v,
3475 type = SocketData.Type.Rune
3476 };
3477 socketList.Add(socketData);
3478 if (IsWeapon || !row.IsWeaponEnc)
3479 {
3480 elements.SetTo(idEle, v);
3481 }
3482 return socketData;
3483 }
3484
3485 public SocketData GetRuneEnc(int idEle)
3486 {
3487 if (socketList != null)
3488 {
3489 foreach (SocketData socket in socketList)
3490 {
3491 if (socket.type == SocketData.Type.Rune && socket.idEle == idEle)
3492 {
3493 return socket;
3494 }
3495 }
3496 }
3497 return null;
3498 }
3499
3500 public int CountRune()
3501 {
3502 int num = 0;
3503 if (socketList != null)
3504 {
3505 foreach (SocketData socket in socketList)
3506 {
3507 if (socket.type == SocketData.Type.Rune)
3508 {
3509 num++;
3510 }
3511 }
3512 }
3513 return num;
3514 }
3515
3516 public int MaxRune()
3517 {
3518 return ((!IsUnique) ? 1 : 0) + Evalue(484);
3519 }
3520
3522 {
3523 if (category.slot == 0)
3524 {
3525 return false;
3526 }
3527 if (material.HasEnc(row.id))
3528 {
3529 return false;
3530 }
3531 if (!IsWeapon && row.IsWeaponEnc)
3532 {
3533 return false;
3534 }
3535 if (row.category == "resist")
3536 {
3537 foreach (Element item in elements.ListElements())
3538 {
3539 if (item.source.category == "resist" && (item.vBase != 0 || item.vSource != 0))
3540 {
3541 return false;
3542 }
3543 }
3544 }
3545 string encSlot = row.encSlot;
3546 if (encSlot == null || encSlot.Length != 0)
3547 {
3548 switch (encSlot)
3549 {
3550 default:
3551 {
3552 bool flag = false;
3553 string[] array = row.encSlot.Split(',');
3554 foreach (string key in array)
3555 {
3556 if (EClass.sources.elements.alias[key].id == category.slot)
3557 {
3558 flag = true;
3559 }
3560 }
3561 if (!flag)
3562 {
3563 return false;
3564 }
3565 break;
3566 }
3567 case "global":
3568 case "all":
3569 case "weapon":
3570 break;
3571 }
3572 }
3573 return CountRune() < MaxRune();
3574 }
3575
3576 public bool HasRune()
3577 {
3578 return CountRune() > 0;
3579 }
3580
3581 public void OnChildNumChange(Card c)
3582 {
3584 {
3587 }
3588 }
3589
3590 public Card Install()
3591 {
3592 SetPlaceState(PlaceState.installed);
3593 return this;
3594 }
3595
3596 public void SetPlaceState(PlaceState newState, bool byPlayer = false)
3597 {
3598 if (this.placeState == newState)
3599 {
3600 return;
3601 }
3602 if (parent != EClass._zone)
3603 {
3604 Debug.Log("tried to change placestate of non-root card:" + this);
3605 return;
3606 }
3608 Area area = pos.area;
3609 if (placeState == PlaceState.installed)
3610 {
3611 area?.OnUninstallCard(this);
3612 if (!isRoofItem)
3613 {
3614 altitude = 0;
3615 freePos = false;
3616 float num2 = (fy = 0f);
3617 fx = num2;
3618 }
3619 trait.Uninstall();
3620 }
3621 if (placeState == PlaceState.installed || newState == PlaceState.installed)
3622 {
3623 ForeachPoint(delegate(Point p, bool main)
3624 {
3625 p.cell.RemoveCard(this);
3626 });
3627 this.placeState = newState;
3628 ForeachPoint(delegate(Point p, bool main)
3629 {
3630 p.cell.AddCard(this);
3631 });
3632 }
3633 else
3634 {
3635 this.placeState = newState;
3636 }
3637 if (newState == PlaceState.none)
3638 {
3639 this.placeState = PlaceState.roaming;
3640 if (props != null)
3641 {
3642 props.Remove(this);
3643 }
3644 }
3645 else
3646 {
3648 if (this.placeState == PlaceState.installed)
3649 {
3650 if (isThing)
3651 {
3652 if (trait.InstallBottomPriority != -1)
3653 {
3655 }
3656 else
3657 {
3659 }
3660 }
3661 area?.OnInstallCard(this);
3662 isRoofItem = false;
3663 trait.Install(byPlayer);
3664 }
3665 }
3667 {
3669 }
3670 if (trait.ShouldTryRefreshRoom && (placeState == PlaceState.installed || this.placeState == PlaceState.installed))
3671 {
3673 }
3674 trait.OnChangePlaceState(newState);
3676 {
3678 }
3679 }
3680
3681 public int GetTotalQuality(bool applyBonus = true)
3682 {
3683 int num = 5 + LV + material.quality;
3684 if (applyBonus)
3685 {
3686 num = num * (100 + Quality) / 100;
3687 }
3688 return num;
3689 }
3690
3691 public void ModEncLv(int a)
3692 {
3693 ApplyMaterialElements(remove: true);
3694 encLV += a;
3695 ApplyMaterialElements(remove: false);
3697 {
3698 if (IsWeapon || IsAmmo)
3699 {
3700 elements.ModBase(67, a);
3701 }
3702 else
3703 {
3704 elements.ModBase(65, a * 2);
3705 }
3706 }
3707 }
3708
3709 public void SetEncLv(int a)
3710 {
3711 ModEncLv(a - encLV);
3712 }
3713
3714 public void SetTier(int a, bool setTraits = true)
3715 {
3716 if (a < 0)
3717 {
3718 a = 0;
3719 }
3720 tier = a;
3721 if (setTraits)
3722 {
3723 int num = ((a == 1) ? 180 : ((a == 2) ? 400 : ((a >= 3) ? 600 : 0)));
3724 if (a > 0)
3725 {
3726 foreach (Element value in elements.dict.Values)
3727 {
3728 if (value.IsFoodTrait || value.IsTrait)
3729 {
3730 elements.SetTo(value.id, value.Value * num / 100);
3731 }
3732 }
3733 }
3734 elements.SetBase(2, a * 30);
3735 elements.SetBase(759, (a > 1) ? a : 0);
3736 }
3738 }
3739
3740 public virtual void SetBlessedState(BlessedState s)
3741 {
3742 int num = 0;
3743 if (s == BlessedState.Blessed && blessedState < BlessedState.Blessed)
3744 {
3745 num = 1;
3746 }
3747 if (s < BlessedState.Blessed && blessedState == BlessedState.Blessed)
3748 {
3749 num = -1;
3750 }
3751 if (num != 0 && IsEquipmentOrRangedOrAmmo)
3752 {
3753 if (IsWeapon || IsAmmo)
3754 {
3755 elements.ModBase(67, num);
3756 }
3757 else
3758 {
3759 elements.ModBase(65, num * 2);
3760 }
3761 }
3762 blessedState = s;
3763 }
3764
3765 public virtual void ChangeRarity(Rarity q)
3766 {
3767 rarity = q;
3768 }
3769
3770 public bool TryPay(int a, string id = "money")
3771 {
3772 if (GetCurrency(id) < a)
3773 {
3774 if (IsPC)
3775 {
3776 SE.Beep();
3777 Msg.Say((id == "ration") ? "notEnoughFood" : "notEnoughMoney");
3778 }
3779 return false;
3780 }
3781 if (IsPC && !(id == "ration"))
3782 {
3783 SE.Pay();
3784 }
3785 ModCurrency(-a, id);
3786 return true;
3787 }
3788
3789 public void SetCharge(int a)
3790 {
3791 c_charges = a;
3793 }
3794
3795 public void ModCharge(int a, bool destroy = false)
3796 {
3797 c_charges += a;
3799 if (c_charges <= 0 && destroy)
3800 {
3801 Say("spellbookCrumble", this);
3802 ModNum(-1);
3803 }
3804 }
3805
3806 public void ModCurrency(int a, string id = "money")
3807 {
3808 if (a != 0)
3809 {
3810 if (id == "influence")
3811 {
3813 return;
3814 }
3815 SourceMaterial.Row mat = null;
3816 things.AddCurrency(this, id, a, mat);
3817 }
3818 }
3819
3820 public int GetCurrency(string id = "money")
3821 {
3822 if (id == "influence")
3823 {
3824 return EClass._zone.influence;
3825 }
3826 int sum = 0;
3827 SourceMaterial.Row mat = null;
3828 things.GetCurrency(id, ref sum, mat);
3829 return sum;
3830 }
3831
3832 public virtual void HealHPHost(int a, HealSource origin = HealSource.None)
3833 {
3834 if (isChara)
3835 {
3836 if (Chara.parasite != null)
3837 {
3839 }
3840 if (Chara.ride != null)
3841 {
3842 Chara.ride.HealHP(a);
3843 }
3844 }
3845 HealHP(a, origin);
3846 }
3847
3848 public virtual void HealHP(int a, HealSource origin = HealSource.None)
3849 {
3850 long num = a;
3851 if (origin == HealSource.Magic)
3852 {
3853 num = (long)a * (long)Mathf.Max(100 - Evalue(93), 1) / 100;
3854 }
3855 if (num > 100000000)
3856 {
3857 num = 100000000L;
3858 }
3859 hp += (int)num;
3860 if (hp > MaxHP)
3861 {
3862 hp = MaxHP;
3863 }
3864 switch (origin)
3865 {
3866 case HealSource.Magic:
3867 case HealSource.Item:
3868 PlaySound("heal");
3869 PlayEffect("heal");
3870 break;
3871 case HealSource.HOT:
3872 PlaySound("heal_tick");
3873 PlayEffect("heal_tick");
3874 break;
3875 }
3876 }
3877
3878 public virtual int GetArmorSkill()
3879 {
3880 return 0;
3881 }
3882
3883 public virtual int ApplyProtection(int dmg, int mod = 100)
3884 {
3885 int armorSkill = GetArmorSkill();
3886 Element orCreateElement = elements.GetOrCreateElement(armorSkill);
3887 int num = PV + orCreateElement.Value + DEX / 10;
3888 int num2 = 1;
3889 int sides = 1;
3890 int bonus = 0;
3891 if (num > 0)
3892 {
3893 int num3 = num / 4;
3894 num2 = num3 / 10 + 1;
3895 sides = num3 / num2 + 1;
3896 bonus = 0;
3897 dmg = dmg * 100 / (100 + num);
3898 }
3899 int num4 = Dice.Roll(num2, sides, bonus, this);
3900 dmg -= num4 * mod / 100;
3901 if (dmg < 0)
3902 {
3903 dmg = 0;
3904 }
3905 return dmg;
3906 }
3907
3908 public void DamageHP(int dmg, AttackSource attackSource = AttackSource.None, Card origin = null)
3909 {
3910 DamageHP(dmg, 0, 0, attackSource, origin);
3911 }
3912
3913 public void DamageHP(int dmg, int ele, int eleP = 100, AttackSource attackSource = AttackSource.None, Card origin = null, bool showEffect = true, Thing weapon = null)
3914 {
3915 if (hp < 0)
3916 {
3917 return;
3918 }
3919 Element e;
3920 if (ele == 0 || ele == 926)
3921 {
3922 e = Element.Void;
3923 if (origin != null)
3924 {
3925 dmg = dmg * Mathf.Max(100 + origin.Evalue(93) / 2, 10) / 100;
3926 }
3927 }
3928 else
3929 {
3930 e = Element.Create(ele);
3931 if (attackSource != AttackSource.Condition && showEffect)
3932 {
3933 ActEffect.TryDelay(delegate
3934 {
3935 PlayEffect(e.id, useRenderPos: true, 0.25f);
3936 EClass.Sound.Play("atk_" + e.source.alias);
3937 });
3938 }
3939 if (!e.source.aliasRef.IsEmpty() && attackSource != AttackSource.ManaBackfire)
3940 {
3941 int num = ((origin != null) ? origin.Evalue(1238) : 0);
3942 if (attackSource == AttackSource.MagicSword)
3943 {
3944 num += 2;
3945 }
3946 dmg = Element.GetResistDamage(dmg, Evalue(e.source.aliasRef), num);
3947 dmg = dmg * 100 / (100 + Mathf.Clamp(Evalue(961) * 5, -50, 200));
3948 dmg = dmg * Mathf.Max(100 - Evalue(93), 10) / 100;
3949 }
3950 switch (e.id)
3951 {
3952 case 910:
3953 {
3954 Chara chara2 = Chara;
3955 if (chara2 != null && chara2.isWet)
3956 {
3957 dmg /= 3;
3958 }
3959 break;
3960 }
3961 case 912:
3962 {
3963 Chara chara = Chara;
3964 if (chara != null && chara.isWet)
3965 {
3966 dmg = dmg * 150 / 100;
3967 }
3968 break;
3969 }
3970 }
3971 }
3972 if (origin != null && origin.isChara && origin.Chara.HasCondition<ConSupress>())
3973 {
3974 dmg = dmg * 2 / 3;
3975 }
3976 if (attackSource != AttackSource.Finish)
3977 {
3978 if (!IsPCFaction && LV > 50)
3979 {
3980 dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(LV - 50) * 2.5f)) / 100;
3981 }
3982 if (origin != null && origin.HasCondition<ConBerserk>())
3983 {
3984 dmg = dmg * 3 / 2;
3985 }
3987 {
3988 int num2 = ((origin != null) ? origin.LV : EClass._zone.DangerLv);
3989 if (num2 > 50)
3990 {
3991 dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num2 - 50))) / 100;
3992 }
3993 }
3994 dmg = dmg * Mathf.Max(0, 100 - Evalue((e == Element.Void || e.id == 926) ? 55 : 56)) / 100;
3995 if (origin != null && origin.IsPC && EClass.player.codex.Has(id))
3996 {
3997 dmg = dmg * (100 + Mathf.Min(10, EClass.player.codex.GetOrCreate(id).weakspot)) / 100;
3998 }
3999 if (isChara && Chara.body.GetAttackStyle() == AttackStyle.Shield && elements.ValueWithoutLink(123) >= 5 && (e == Element.Void || e.id == 926))
4000 {
4001 dmg = dmg * 90 / 100;
4002 }
4003 if (Evalue(971) > 0)
4004 {
4005 dmg = dmg * 100 / Mathf.Clamp(100 + Evalue(971), 25, 1000);
4006 }
4007 if (HasElement(1305))
4008 {
4009 dmg = dmg * 90 / 100;
4010 }
4011 if (EClass.pc.HasElement(1207) && isChara)
4012 {
4013 int num3 = 0;
4014 int num4 = 0;
4015 foreach (Condition condition2 in Chara.conditions)
4016 {
4017 if (condition2.Type == ConditionType.Buff)
4018 {
4019 num3++;
4020 }
4021 else if (condition2.Type == ConditionType.Debuff)
4022 {
4023 num4++;
4024 }
4025 }
4026 if (IsPCParty)
4027 {
4028 dmg = dmg * 100 / Mathf.Min(100 + num3 * 5, 120);
4029 }
4030 else
4031 {
4032 dmg = dmg * Mathf.Min(100 + num4 * 5, 120) / 100;
4033 }
4034 }
4036 {
4037 dmg = dmg * 100 / Mathf.Clamp(105 + EClass.pc.Evalue(135) / 10, 10, 110);
4038 }
4039 if (HasElement(1218) && attackSource != AttackSource.ManaBackfire && (hp > 0 || Evalue(1421) <= 0))
4040 {
4041 dmg = dmg * (1000 - Evalue(1218)) / 1000;
4042 if (dmg <= 0 && EClass.rnd(4) == 0)
4043 {
4044 dmg++;
4045 }
4046 }
4047 if (dmg >= MaxHP / 10 && Evalue(68) > 0)
4048 {
4049 int num5 = MaxHP / 10;
4050 int num6 = dmg - num5;
4051 num6 = num6 * 100 / (200 + Evalue(68) * 10);
4052 dmg = num5 + num6;
4053 }
4054 }
4055 if (origin != null && origin.IsPC && EClass.pc.Evalue(654) > 0)
4056 {
4057 dmg = 0;
4058 }
4059 if (dmg < 0)
4060 {
4061 dmg = 0;
4062 }
4063 int num7 = Mathf.Clamp(dmg * 6 / MaxHP, 0, 4) + ((dmg > 0) ? 1 : 0);
4064 if (Evalue(1421) > 0)
4065 {
4066 int num8 = 0;
4067 int num9 = dmg;
4068 if (hp > 0)
4069 {
4070 num9 = dmg - hp;
4071 hp -= dmg;
4072 num8 += dmg;
4073 if (hp < 0 && Chara.mana.value >= 0)
4074 {
4075 num8 += hp;
4076 hp = 0;
4077 }
4078 }
4079 if (hp <= 0)
4080 {
4081 if (Evalue(1421) >= 2)
4082 {
4083 num9 /= 2;
4084 }
4085 dmg = num9;
4086 if (Chara.mana.value > 0)
4087 {
4088 num9 -= Chara.mana.value;
4089 Chara.mana.value -= dmg;
4090 num8 += dmg;
4091 }
4092 if (Chara.mana.value <= 0)
4093 {
4094 hp -= num9;
4095 num8 += num9;
4096 }
4097 }
4098 dmg = num8;
4099 }
4100 else
4101 {
4102 hp -= dmg;
4103 }
4104 if (isSynced && dmg != 0)
4105 {
4106 float ratio = (float)dmg / (float)MaxHP;
4107 Card c = ((parent is Chara) ? (parent as Chara) : this);
4108 ActEffect.TryDelay(delegate
4109 {
4110 c.PlayEffect("blood").SetParticleColor(EClass.Colors.matColors[material.alias].main).Emit(20 + (int)(30f * ratio));
4112 {
4113 EClass.scene.damageTextRenderer.Add(this, c, dmg, e);
4114 }
4115 });
4116 }
4117 if (EClass.pc.ai is AI_PracticeDummy { IsRunning: not false } aI_PracticeDummy && aI_PracticeDummy.target == this && (origin == null || origin.IsPC))
4118 {
4119 aI_PracticeDummy.hit++;
4120 aI_PracticeDummy.totalDamage += dmg;
4121 }
4122 ZoneInstanceBout zoneInstanceBout = EClass._zone.instance as ZoneInstanceBout;
4123 bool flag = false;
4124 if (hp < 0 && Religion.recentWrath == null)
4125 {
4127 {
4128 EvadeDeath();
4129 if (Chara.stamina.value > 0 && (EClass.rnd(2) == 0 || !IsPC))
4130 {
4131 Chara.stamina.Mod(-1);
4132 }
4133 }
4134 else if (IsInstalled && pos.HasBlock && trait.IsDoor)
4135 {
4136 EvadeDeath();
4137 }
4138 else if (!trait.CanBeDestroyed)
4139 {
4140 EvadeDeath();
4141 }
4142 else if (HasEditorTag(EditorTag.Invulnerable) || (HasEditorTag(EditorTag.InvulnerableToMobs) && (origin == null || !origin.IsPCParty)))
4143 {
4144 EvadeDeath();
4145 }
4146 else if (isChara)
4147 {
4149 {
4150 EvadeDeath();
4151 }
4152 else if (IsPC && EClass.debug.godMode)
4153 {
4154 EvadeDeath();
4155 }
4156 else if (Chara.host != null || (weapon != null && weapon.HasElement(485)))
4157 {
4158 EvadeDeath();
4159 flag = true;
4160 }
4161 else if (zoneInstanceBout != null && (bool)LayerDrama.Instance)
4162 {
4163 EvadeDeath();
4164 }
4165 else if (LayerDrama.IsActive() && IsPC)
4166 {
4167 EvadeDeath();
4168 }
4169 else
4170 {
4171 if (attackSource != AttackSource.Finish && IsPCParty && Chara.host == null)
4172 {
4173 if (EClass.pc.ai is GoalAutoCombat && !EClass.player.invlunerable && (EClass.pc.ai as GoalAutoCombat).listHealthy.Contains(Chara))
4174 {
4175 EClass.core.actionsNextFrame.Add(delegate
4176 {
4177 Msg.Say(IsPC ? "abort_damage" : "abort_damgeAlly");
4178 });
4179 EClass.player.invlunerable = true;
4182 }
4184 {
4185 EvadeDeath();
4186 goto IL_0bcf;
4187 }
4188 }
4189 if (IsPC && Evalue(1220) > 0 && Chara.stamina.value >= Chara.stamina.max / 2)
4190 {
4193 EvadeDeath();
4194 }
4195 }
4196 }
4197 }
4198 goto IL_0bcf;
4199 IL_0bcf:
4200 if (trait.CanBeAttacked)
4201 {
4202 renderer.PlayAnime(AnimeID.HitObj);
4203 hp = MaxHP;
4205 {
4206 hp = -1;
4207 }
4208 }
4209 Chara target;
4210 if (hp < 0)
4211 {
4212 if ((attackSource == AttackSource.Melee || attackSource == AttackSource.Range) && origin != null && (origin.isSynced || IsPC))
4213 {
4214 string text = "";
4215 if (IsPC && Lang.setting.combatTextStyle == 0)
4216 {
4217 if (e != Element.Void && e != null)
4218 {
4219 text = "dead_" + e.source.alias;
4220 }
4221 if (text == "" || !LangGame.Has(text))
4222 {
4223 text = "dead_attack";
4224 }
4225 EClass.pc.Say(text, this, "");
4226 }
4227 else
4228 {
4229 if (e != Element.Void && e != null)
4230 {
4231 text = "kill_" + e.source.alias;
4232 }
4233 if (text == "" || !LangGame.Has(text))
4234 {
4235 text = "kill_attack";
4236 }
4237 (IsPC ? EClass.pc : origin).Say(text, origin, this);
4238 }
4239 }
4240 if (isChara && Religion.recentWrath == null)
4241 {
4242 if (HasElement(1410) && !Chara.HasCooldown(1410))
4243 {
4244 Chara.AddCooldown(1410);
4245 Say("reboot", this);
4246 PlaySound("reboot");
4247 Chara.Cure(CureType.Boss);
4248 hp = MaxHP / 3;
4250 return;
4251 }
4252 if (HasCondition<ConRebirth>())
4253 {
4254 Say("rebirth", this);
4255 hp = Mathf.Min(MaxHP * (int)(5f + Mathf.Sqrt(Chara.GetCondition<ConRebirth>().power)) / 100, MaxHP);
4257 Chara.RemoveCondition<ConRebirth>();
4258 PlayEffect("revive");
4259 PlaySound("revive");
4260 return;
4261 }
4262 foreach (Chara chara3 in EClass._map.charas)
4263 {
4264 if (Chara.IsFriendOrAbove(chara3) && chara3.HasElement(1408) && chara3.faith == EClass.game.religions.Healing && EClass.world.date.GetRawDay() != chara3.GetInt(58) && (!chara3.IsPCFaction || IsPCFaction))
4265 {
4266 Msg.alwaysVisible = true;
4267 Msg.Say("layhand", chara3, this);
4268 Msg.Say("pray_heal", this);
4269 hp = MaxHP;
4271 PlayEffect("revive");
4272 PlaySound("revive");
4273 chara3.SetInt(58, EClass.world.date.GetRawDay());
4274 return;
4275 }
4276 }
4277 }
4278 if (zoneInstanceBout != null)
4279 {
4280 target = EClass._map.FindChara(zoneInstanceBout.uidTarget);
4281 if (target != null)
4282 {
4283 if (IsPC)
4284 {
4285 EClass.pc.hp = 0;
4286 Heal();
4287 EClass.player.ModFame(-10 - (int)((float)EClass.player.fame * 0.05f));
4288 target.ShowDialog("_chara", "bout_lose");
4289 return;
4290 }
4291 if (target == this)
4292 {
4293 hp = 0;
4294 Heal();
4295 target.ModAffinity(EClass.pc, 10);
4296 target.ShowDialog("_chara", "bout_win");
4297 return;
4298 }
4299 }
4300 }
4301 if (!isDestroyed)
4302 {
4303 Die(e, origin, attackSource);
4305 {
4306 Rand.SetSeed(uid);
4307 if (EClass.rnd(3) == 0 && !isCrafted && !isCopy)
4308 {
4309 string text2 = new int[18]
4310 {
4311 233, 235, 236, 236, 236, 1170, 1143, 1144, 727, 728,
4312 237, 869, 1178, 1179, 1180, 1243, 1244, 1245
4313 }.RandomItem().ToString();
4314 if (EClass.rnd(10) == 0)
4315 {
4316 text2 = "casino_coin";
4317 }
4318 if (EClass.rnd(10) == 0)
4319 {
4320 text2 = "scratchcard";
4321 }
4322 if (EClass.rnd(3) == 0)
4323 {
4324 text2 = "money";
4325 }
4326 if (EClass.rnd(5) == 0)
4327 {
4328 text2 = "plat";
4329 }
4330 if (EClass.rnd(10) == 0)
4331 {
4332 text2 = "money2";
4333 }
4334 if (EClass.rnd(20) == 0 || EClass.debug.enable)
4335 {
4336 text2 = "medal";
4337 }
4338 EClass._zone.AddCard(ThingGen.Create(text2).SetNum((!(text2 == "money")) ? 1 : EClass.rndHalf(100)).SetHidden(hide: false), pos);
4339 }
4340 Rand.SetSeed();
4341 }
4342 ProcAbsorb();
4343 if (EClass.pc.Evalue(1355) > 0 && isChara && (IsPCFactionOrMinion || (origin != null && origin.IsPCParty)))
4344 {
4345 ((EClass.pc.AddCondition<ConStrife>() as ConStrife) ?? EClass.pc.GetCondition<ConStrife>())?.AddKill(Chara);
4346 }
4347 }
4348 if (origin != null && origin.isChara)
4349 {
4350 if (origin.IsPCFactionOrMinion && isChara && !isCopy)
4351 {
4353 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
4354 {
4355 q.OnKillChara(Chara);
4356 });
4359 {
4361 }
4363 {
4364 int a2 = EClass.rndHalf(200 + LV * 20);
4365 Msg.Say("bounty", Chara, a2.ToString() ?? "");
4366 EClass.pc.ModCurrency(a2);
4367 SE.Pay();
4368 }
4369 }
4370 if (origin.GetInt(106) == 0)
4371 {
4372 origin.Chara.TalkTopic("kill");
4373 }
4374 }
4375 Msg.SetColor();
4376 }
4377 else if ((attackSource == AttackSource.Melee || attackSource == AttackSource.Range) && origin != null)
4378 {
4379 (IsPC ? EClass.pc : origin).Say("dmgMelee" + num7 + (IsPC ? "pc" : ""), origin, this);
4380 }
4381 else if (isChara)
4382 {
4383 int num10 = ((attackSource != AttackSource.Condition && attackSource != AttackSource.WeaponEnchant) ? 1 : 2);
4384 if (num7 >= num10)
4385 {
4386 if (e != Element.Void)
4387 {
4388 Say("dmg_" + e.source.alias, this);
4389 }
4390 if (e == Element.Void || num7 >= 2)
4391 {
4392 Say("dmg" + num7, this);
4393 }
4394 }
4395 }
4396 if (isChara)
4397 {
4398 if (flag)
4399 {
4400 if (!Chara.HasCondition<ConFaint>())
4401 {
4402 Chara.AddCondition<ConFaint>(200, force: true);
4403 }
4404 return;
4405 }
4406 if (origin != null && origin.IsAliveInCurrentZone && origin.isChara)
4407 {
4408 if (e.id == 916)
4409 {
4410 origin.HealHP(Mathf.Clamp(EClass.rnd(dmg * (50 + eleP) / 500 + 5), 1, origin.MaxHP / 5 + EClass.rnd(10)));
4411 }
4412 if ((attackSource == AttackSource.Melee || attackSource == AttackSource.Range) && origin.Dist(this) <= 1)
4413 {
4414 if (attackSource == AttackSource.Melee && HasElement(1221))
4415 {
4416 int ele2 = ((Chara.MainElement == Element.Void) ? 924 : Chara.MainElement.id);
4417 if (id == "hedgehog_ether")
4418 {
4419 ele2 = 922;
4420 }
4421 Say("reflect_thorne", this, origin);
4422 origin.DamageHP(Mathf.Clamp(dmg / 20, 1, MaxHP / 20), ele2, Power, AttackSource.Condition);
4423 }
4424 if (HasElement(1223))
4425 {
4426 int ele3 = ((Chara.MainElement == Element.Void) ? 923 : Chara.MainElement.id);
4427 Say("reflect_acid", this, origin);
4428 origin.DamageHP(Mathf.Clamp(dmg / 20, 1, MaxHP / 20), ele3, Power * 2, AttackSource.Condition);
4429 }
4430 }
4431 ProcAbsorb();
4432 }
4433 }
4434 if (hp < 0 || !isChara)
4435 {
4436 return;
4437 }
4438 if (dmg > 0)
4439 {
4440 int a3 = (int)(100L * (long)(dmg * 100 / MaxHP) / 100) + 1;
4441 a3 = Mathf.Min(a3, Chara.isRestrained ? 15 : 200);
4442 if (a3 > 0)
4443 {
4445 if (Chara.body.GetAttackStyle() == AttackStyle.Shield)
4446 {
4447 elements.ModExp(123, a3);
4448 }
4449 }
4450 }
4451 int num11 = ((EClass.rnd(2) == 0) ? 1 : 0);
4452 if (attackSource == AttackSource.Condition)
4453 {
4454 num11 = 1 + EClass.rnd(2);
4455 }
4456 if (num11 > 0)
4457 {
4458 bool flag2 = Chara.HasCondition<ConPoison>() || ((e.id == 915 || e.id == 923) && ResistLv(Evalue(955)) < 4);
4459 AddBlood(num11, flag2 ? 6 : (-1));
4460 }
4461 bool flag3 = true;
4462 switch (e.id)
4463 {
4464 case 910:
4465 if (Chance(30 + eleP / 5, 100))
4466 {
4468 }
4469 break;
4470 case 911:
4471 if (Chara.isWet)
4472 {
4473 if (Chance(30 + eleP / 10, 100))
4474 {
4476 }
4477 }
4478 else if (Chance(50 + eleP / 10, 100))
4479 {
4480 Chara.AddCondition<ConWet>(eleP);
4481 }
4482 break;
4483 case 912:
4484 if (Chance(75 + eleP / 20, 100) && EClass.rnd(3) == 0)
4485 {
4486 Chara.AddCondition<ConParalyze>(1, force: true);
4487 }
4488 break;
4489 case 915:
4490 if (Chance(30 + eleP / 5, 100))
4491 {
4493 }
4494 break;
4495 case 913:
4496 if (Chance(30 + eleP / 5, 100))
4497 {
4499 }
4500 break;
4501 case 918:
4502 flag3 = false;
4503 if (Chance(30 + eleP / 5, 100))
4504 {
4506 }
4507 break;
4508 case 914:
4509 flag3 = false;
4510 if (EClass.rnd(3) != 0)
4511 {
4512 if (Chance(30 + eleP / 5, 100))
4513 {
4515 }
4516 }
4517 else if (Chance(30 + eleP / 5, 100))
4518 {
4520 }
4521 break;
4522 case 917:
4523 if (Chance(50 + eleP / 10, 100))
4524 {
4525 Chara.AddCondition<ConDim>(eleP);
4526 }
4527 break;
4528 case 925:
4529 if (EClass.rnd(3) == 0)
4530 {
4531 if (Chance(30 + eleP / 5, 100))
4532 {
4533 Chara.AddCondition<ConDim>(eleP);
4534 }
4535 }
4536 else if (EClass.rnd(2) == 0)
4537 {
4538 if (EClass.rnd(3) == 0)
4539 {
4540 Chara.AddCondition<ConParalyze>(1, force: true);
4541 }
4542 }
4543 else if (EClass.rnd(2) == 0)
4544 {
4545 Chara.AddCondition<ConConfuse>(1 + EClass.rnd(3), force: true);
4546 }
4547 break;
4548 case 920:
4549 flag3 = false;
4550 if (Chance(5 + eleP / 25, 40))
4551 {
4552 Chara.AddCondition<ConBlind>(eleP / 2);
4553 }
4554 if (Chance(5 + eleP / 25, 40))
4555 {
4556 Chara.AddCondition<ConParalyze>(eleP / 2);
4557 }
4558 if (Chance(5 + eleP / 25, 40))
4559 {
4560 Chara.AddCondition<ConConfuse>(eleP / 2);
4561 }
4562 if (Chance(5 + eleP / 25, 40))
4563 {
4564 Chara.AddCondition<ConPoison>(eleP / 2);
4565 }
4566 if (Chance(5 + eleP / 25, 40))
4567 {
4568 Chara.AddCondition<ConSleep>(eleP / 2);
4569 }
4570 if (Chance(5 + eleP / 25, 40))
4571 {
4572 Chara.AddCondition<ConDim>(eleP / 2);
4573 }
4574 if (Chance(30 + eleP / 10, 100))
4575 {
4576 Chara.SAN.Mod(EClass.rnd(2));
4577 }
4578 break;
4579 case 924:
4580 if (Chance(50 + eleP / 10, 100))
4581 {
4583 }
4584 break;
4585 case 923:
4586 if (Chance(50 + eleP / 10, 100) && EClass.rnd(4) == 0)
4587 {
4589 }
4590 break;
4591 case 922:
4592 Chara.ModCorruption(EClass.rnd(eleP / 50 + 10));
4593 break;
4594 }
4595 if (origin != null && origin.HasElement(1411) && !Chara.HasCondition<ConGravity>())
4596 {
4597 Condition.ignoreEffect = true;
4599 Condition.ignoreEffect = false;
4600 }
4601 if (Chara.conSleep != null && flag3)
4602 {
4604 }
4605 if (IsPC)
4606 {
4607 float num12 = (float)hp / (float)MaxHP;
4608 if (Evalue(1421) > 0)
4609 {
4610 num12 = (float)Chara.mana.value / (float)Chara.mana.max;
4611 }
4612 if (num12 < 0.3f)
4613 {
4614 PlaySound("heartbeat", 1f - num12 * 2f);
4615 }
4616 }
4617 if (!IsPC && hp < MaxHP / 5 && Evalue(423) <= 0 && dmg * 100 / MaxHP + 10 > EClass.rnd(IsPowerful ? 400 : 150) && !HasCondition<ConFear>())
4618 {
4619 Chara.AddCondition<ConFear>(100 + EClass.rnd(100));
4620 }
4621 if (Chara.ai.Current.CancelWhenDamaged && attackSource != AttackSource.Hunger && attackSource != AttackSource.Fatigue)
4622 {
4623 Chara.ai.Current.TryCancel(origin);
4624 }
4626 {
4627 ConWeapon condition = Chara.GetCondition<ConWeapon>();
4628 if (e.source.aliasRef == condition.sourceElement.aliasRef)
4629 {
4630 condition.Mod(-1);
4631 }
4632 }
4633 if (Chara.HasElement(1222) && (dmg >= MaxHP / 10 || EClass.rnd(20) == 0))
4634 {
4635 ActEffect.Proc(EffectId.Duplicate, this);
4636 }
4637 if (hp < MaxHP / 3 && HasElement(1409) && !Chara.HasCooldown(1409))
4638 {
4639 Chara.AddCooldown(1409);
4641 Chara.Cure(CureType.Boss);
4642 Chara.HealHP(MaxHP / 2);
4643 }
4644 if (origin != null && origin.isChara && attackSource != AttackSource.Finish)
4645 {
4647 {
4648 Chara.TrySetEnemy(origin.Chara);
4649 }
4650 if ((weapon == null || !weapon.HasElement(486)) && origin.Evalue(428) > 0 && !IsPCFactionOrMinion && EClass.rnd(dmg) >= EClass.rnd(MaxHP / 10) + MaxHP / 100 + 1)
4651 {
4652 origin.Chara.TryNeckHunt(Chara, origin.Evalue(428) * 20, harvest: true);
4653 }
4654 }
4655 bool Chance(int a, int max)
4656 {
4657 if (dmg > 0 || (origin != null && origin.HasElement(1345)))
4658 {
4659 return Mathf.Min(a, max) > EClass.rnd(100);
4660 }
4661 return false;
4662 }
4663 void EvadeDeath()
4664 {
4665 hp = 0;
4666 if (Evalue(1421) > 0 && isChara && Chara.mana.value < 0)
4667 {
4668 Chara.mana.value = 0;
4669 }
4670 }
4671 void Heal()
4672 {
4673 target.Cure(CureType.Death);
4674 foreach (Chara member in EClass.pc.party.members)
4675 {
4676 member.Cure(CureType.Death);
4677 }
4678 }
4679 void ProcAbsorb()
4680 {
4681 if (origin != null && origin.isChara && isChara && (weapon == null || !weapon.HasElement(486)))
4682 {
4683 int valueOrDefault = (origin.Evalue(662) + weapon?.Evalue(662, ignoreGlobalElement: true)).GetValueOrDefault();
4684 int valueOrDefault2 = (origin.Evalue(661) + weapon?.Evalue(661, ignoreGlobalElement: true)).GetValueOrDefault();
4685 if (valueOrDefault > 0 && attackSource == AttackSource.Melee && origin.isChara && !origin.Chara.ignoreSPAbsorb && Chara.IsHostile(origin as Chara))
4686 {
4687 int num13 = EClass.rnd(3 + Mathf.Clamp(dmg / 100, 0, valueOrDefault / 10));
4688 origin.Chara.stamina.Mod(num13);
4690 {
4691 Chara.stamina.Mod(-num13);
4692 }
4693 }
4694 if (origin.HasElement(1350) && attackSource == AttackSource.Melee)
4695 {
4696 int num14 = EClass.rndHalf(2 + Mathf.Clamp(dmg / 10, 0, origin.Chara.GetPietyValue() + 10));
4697 origin.Chara.mana.Mod(num14);
4699 {
4700 Chara.mana.Mod(-num14);
4701 }
4702 }
4703 if (valueOrDefault2 > 0 && attackSource == AttackSource.Melee)
4704 {
4705 int num15 = EClass.rnd(2 + Mathf.Clamp(dmg / 10, 0, valueOrDefault2 + 10));
4706 origin.Chara.mana.Mod(num15);
4708 {
4709 Chara.mana.Mod(-num15);
4710 }
4711 }
4712 }
4713 }
4714 }
4715
4716 public virtual void Die(Element e = null, Card origin = null, AttackSource attackSource = AttackSource.None)
4717 {
4718 Card rootCard = GetRootCard();
4719 Point _pos = rootCard?.pos ?? pos;
4720 if (_pos != null && !_pos.IsValid)
4721 {
4722 _pos = null;
4723 }
4724 if (trait.EffectDead == EffectDead.Default && _pos != null)
4725 {
4726 _pos.PlaySound(material.GetSoundDead(sourceCard));
4727 _pos.PlayEffect("mine").SetParticleColor(material.GetColor()).Emit(10 + EClass.rnd(10));
4728 material.AddBlood(_pos, trait.CanBeSmashedToDeath ? (12 + EClass.rnd(8)) : 6);
4729 if (_pos.IsSync)
4730 {
4731 string text = ((rootCard != this) ? "destroyed_inv_" : "destroyed_ground_");
4732 if (e != null && LangGame.Has(text + e.source.alias))
4733 {
4734 text += e.source.alias;
4735 }
4736 if (attackSource != AttackSource.Throw)
4737 {
4738 Msg.Say(text, this, rootCard);
4739 }
4740 }
4741 else if (attackSource != AttackSource.Throw)
4742 {
4743 Msg.Say("destroyed", this);
4744 }
4745 }
4746 if (_pos != null && !EClass._zone.IsUserZone)
4747 {
4748 things.ForeachReverse(delegate(Thing t)
4749 {
4750 if (!(t.trait is TraitChestMerchant))
4751 {
4752 EClass._zone.AddCard(t, _pos);
4753 }
4754 });
4755 }
4756 Destroy();
4757 if (e != null && _pos != null && e.id == 21)
4758 {
4759 EClass._zone.AddCard(ThingGen.Create((EClass.rnd(2) == 0) ? "ash" : "ash2"), _pos);
4760 }
4761 if (trait.ThrowType == ThrowType.Explosive)
4762 {
4763 Explode(pos, origin);
4764 }
4765 }
4766
4767 public void Explode(Point p, Card origin)
4768 {
4769 ActEffect.ProcAt(EffectId.Explosive, 100, blessedState, this, null, p, isNeg: true, new ActRef
4770 {
4771 origin = origin?.Chara,
4772 refThing = Thing,
4773 aliasEle = "eleImpact"
4774 });
4775 }
4776
4777 public void Deconstruct()
4778 {
4779 PlaySound(material.GetSoundDead(sourceCard));
4780 Destroy();
4781 }
4782
4783 public void Destroy()
4784 {
4785 if (isDestroyed)
4786 {
4787 Debug.Log(Name + " is already destroyed.");
4788 return;
4789 }
4790 if (isChara)
4791 {
4792 if (IsPCFaction && !Chara.isSummon)
4793 {
4794 Debug.Log(this);
4795 return;
4796 }
4797 Chara.DropHeld();
4798 Chara.isDead = true;
4799 if (IsPCParty)
4800 {
4802 }
4803 if (IsGlobal)
4804 {
4806 }
4807 }
4808 if (renderer.hasActor)
4809 {
4810 renderer.KillActor();
4811 }
4812 if (parent != null)
4813 {
4814 parent.RemoveCard(this);
4815 }
4816 for (int num = things.Count - 1; num >= 0; num--)
4817 {
4818 things[num].Destroy();
4819 }
4820 isDestroyed = true;
4821 }
4822
4823 public void SpawnLoot(Card origin)
4824 {
4825 if (!isChara || IsPCFactionMinion || (isCopy && EClass.rnd(10) != 0))
4826 {
4827 return;
4828 }
4829 bool isUserZone = EClass._zone.IsUserZone;
4830 bool flag = EClass._zone is Zone_Music;
4831 List<Card> list = new List<Card>();
4832 SourceRace.Row race = Chara.race;
4833 if (!IsPCFaction && !isUserZone && sourceCard.idActor.IsEmpty())
4834 {
4835 int i2 = 500;
4836 if (this.rarity >= Rarity.Legendary)
4837 {
4838 i2 = ((!EClass.player.codex.DroppedCard(id)) ? 1 : 10);
4840 }
4841 if (trait is TraitAdventurerBacker)
4842 {
4843 i2 = 10;
4844 }
4845 if (chance(i2))
4846 {
4847 Thing thing = ThingGen.Create("figure");
4848 thing.MakeFigureFrom(id);
4849 list.Add(thing);
4850 }
4851 if (chance(i2))
4852 {
4853 Thing thing2 = ThingGen.Create("figure3");
4854 thing2.MakeFigureFrom(id);
4855 list.Add(thing2);
4856 }
4857 }
4858 bool flag2 = Chara.race.corpse[1].ToInt() > EClass.rnd(1500) || (Chara.IsPowerful && !IsPCFaction) || EClass.debug.godFood;
4859 int num = 1;
4860 if (!IsMinion && Chara.race.IsAnimal && EClass.rnd(EClass._zone.IsPCFaction ? 3 : 5) == 0)
4861 {
4862 flag2 = true;
4863 }
4865 {
4866 flag2 = true;
4867 num = EClass.rndHalf(4 + 10 * (50 + Mathf.Max(0, (int)MathF.Sqrt(EClass.pc.Evalue(290) * 10))) / 100);
4868 }
4869 else if (origin != null && origin.HasElement(290) && !IsMinion)
4870 {
4871 if (!flag2 && Chara.race.corpse[1].ToInt() > EClass.rnd(150000 / (100 + (int)Mathf.Sqrt(origin.Evalue(290)) * 5)))
4872 {
4873 flag2 = true;
4874 origin.elements.ModExp(290, 100);
4875 }
4876 else
4877 {
4878 origin.elements.ModExp(290, 5);
4879 }
4880 }
4881 if (id == "littleOne" && IsPCFactionOrMinion)
4882 {
4883 flag2 = false;
4884 }
4885 if (flag2 && !isUserZone)
4886 {
4887 string text = Chara.race.corpse[0];
4888 bool num2 = text == "_meat";
4889 int num3 = 10;
4891 {
4892 num3 += (int)Mathf.Min(Mathf.Sqrt(EClass.pc.Evalue(290)), 20f);
4893 }
4894 if (EClass.rnd((Act.CurrentAct is ActMeleeBladeStorm || (origin != null && (origin.HasElement(1556) || origin.HasCondition<ConTransmuteCat>()))) ? 2 : 100) == 0)
4895 {
4896 text = "dattamono";
4897 }
4898 if (num2 && num3 > EClass.rnd(100))
4899 {
4900 text = "meat_marble";
4901 }
4902 Thing thing3 = ThingGen.Create(text).SetNum(num);
4903 if (thing3.source._origin == "meat")
4904 {
4905 thing3.MakeFoodFrom(this);
4906 }
4907 else
4908 {
4910 }
4911 list.Add(thing3);
4912 }
4913 if (!IsPCFaction && (!isUserZone || !EClass.game.principal.disableUsermapBenefit) && chance(200))
4914 {
4915 list.Add(Chara.MakeGene());
4916 }
4917 if (!IsPCFaction && !isUserZone)
4918 {
4919 foreach (string item2 in sourceCard.loot.Concat(Chara.race.loot).ToList())
4920 {
4921 string[] array = item2.Split('/');
4922 int num4 = array[1].ToInt();
4923 if (num4 >= 1000 || num4 > EClass.rnd(1000) || EClass.debug.godMode)
4924 {
4925 list.Add(ThingGen.Create(array[0]).SetNum((num4 < 1000) ? 1 : (num4 / 1000 + ((EClass.rnd(1000) > num4 % 1000) ? 1 : 0))));
4926 }
4927 }
4928 if (race.IsMachine)
4929 {
4930 if (chance(20))
4931 {
4932 list.Add(ThingGen.Create("microchip"));
4933 }
4934 if (chance(15))
4935 {
4936 list.Add(ThingGen.Create("battery"));
4937 }
4938 }
4939 else
4940 {
4941 if (race.IsAnimal)
4942 {
4943 if (chance(15))
4944 {
4945 list.Add(ThingGen.Create("fang"));
4946 }
4947 if (chance(10))
4948 {
4949 list.Add(ThingGen.Create("skin"));
4950 }
4951 }
4952 if (chance(20))
4953 {
4954 list.Add(ThingGen.Create("offal"));
4955 }
4956 if (chance(20))
4957 {
4958 list.Add(ThingGen.Create("heart"));
4959 }
4960 }
4961 if (!isBackerContent && !flag)
4962 {
4963 switch (id)
4964 {
4965 case "isca":
4966 list.Add(ThingGen.Create("blood_angel"));
4967 break;
4968 case "golem_wood":
4969 if (chance(30))
4970 {
4971 list.Add(ThingGen.Create("crystal_earth"));
4972 }
4973 break;
4974 case "golem_fish":
4975 case "golem_stone":
4976 if (chance(30))
4977 {
4978 list.Add(ThingGen.Create("crystal_sun"));
4979 }
4980 break;
4981 case "golem_steel":
4982 if (chance(30))
4983 {
4984 list.Add(ThingGen.Create("crystal_mana"));
4985 }
4986 break;
4987 case "golem_gold":
4988 list.Add(ThingGen.Create("money2"));
4989 break;
4990 }
4991 int num5 = ((EClass._zone.Boss == this) ? 2 : ((this.rarity >= Rarity.Legendary) ? 1 : 0));
4992 if (EClass._zone is Zone_Void)
4993 {
4994 num5++;
4995 }
4996 if (EClass.rnd(5) == 0)
4997 {
4998 num5++;
4999 }
5000 string text2 = id;
5001 if (text2 == "big_daddy" || text2 == "santa")
5002 {
5003 num5 += 2;
5004 }
5005 if (num5 > 0 && EClass.game.principal.dropRate)
5006 {
5007 num5 = Mathf.Max(1, num5 * (50 + EClass.game.principal.dropRateMtp * 50) / 100);
5008 }
5009 List<Thing> list2 = new List<Thing>();
5010 foreach (Thing thing4 in things)
5011 {
5012 if (thing4.HasTag(CTAG.gift) || thing4.trait is TraitChestMerchant)
5013 {
5014 continue;
5015 }
5016 if (thing4.isGifted || thing4.rarity >= Rarity.Artifact || thing4.trait.DropChance > EClass.rndf(1f))
5017 {
5018 list.Add(thing4);
5019 }
5020 else if (thing4.IsEquipmentOrRanged)
5021 {
5022 if (thing4.rarity >= Rarity.Legendary)
5023 {
5024 list2.Add(thing4);
5025 }
5026 else if (EClass.rnd(100) == 0)
5027 {
5028 list.Add(thing4);
5029 }
5030 }
5031 else if (EClass.rnd(5) == 0)
5032 {
5033 list.Add(thing4);
5034 }
5035 }
5036 if (num5 > 0 && list2.Count > 0)
5037 {
5038 list2.Shuffle();
5039 for (int j = 0; j < list2.Count && j < num5; j++)
5040 {
5041 list.Add(list2[j]);
5042 num5--;
5043 }
5044 }
5045 if (this.rarity >= Rarity.Legendary && !IsUnique && c_bossType != BossType.Evolved)
5046 {
5047 int num6 = 0;
5048 foreach (Card item3 in list)
5049 {
5050 if (item3.rarity >= Rarity.Legendary || item3.IsContainer)
5051 {
5052 num6++;
5053 }
5054 }
5055 if (num6 == 0)
5056 {
5057 int num7 = ((!(EClass._zone is Zone_Void)) ? 1 : 2);
5058 if (num5 < num7)
5059 {
5060 num5 = num7;
5061 }
5062 for (int k = 0; k < num5; k++)
5063 {
5064 Rand.SetSeed(uid + k);
5065 if (EClass.rnd((EClass._zone.events.GetEvent<ZoneEventDefenseGame>() != null) ? 3 : 2) == 0)
5066 {
5067 Rarity rarity = ((EClass.rnd(20) == 0) ? Rarity.Mythical : Rarity.Legendary);
5069 {
5070 rarity = rarity
5071 });
5072 Thing item = ThingGen.CreateFromFilter("eq", LV);
5073 list.Add(item);
5074 }
5075 else if (EClass.rnd(3) == 0)
5076 {
5077 list.Add(ThingGen.Create("medal"));
5078 }
5079 Rand.SetSeed();
5080 }
5081 }
5082 }
5083 }
5084 }
5085 foreach (Thing thing5 in things)
5086 {
5087 if (thing5.GetInt(116) != 0)
5088 {
5089 list.Add(thing5);
5090 }
5091 }
5092 Point nearestPoint = GetRootCard().pos;
5093 if (nearestPoint.IsBlocked)
5094 {
5095 nearestPoint = nearestPoint.GetNearestPoint();
5096 }
5097 foreach (Card item4 in list)
5098 {
5099 if (item4.parent == EClass._zone)
5100 {
5101 continue;
5102 }
5103 item4.isHidden = false;
5104 item4.SetInt(116);
5105 EClass._zone.AddCard(item4, nearestPoint);
5106 if (!item4.IsEquipment || item4.rarity < Rarity.Superior || item4.IsCursed)
5107 {
5108 continue;
5109 }
5110 foreach (Chara chara in EClass._map.charas)
5111 {
5112 if (chara.HasElement(1412) && chara.Dist(nearestPoint) < 3)
5113 {
5114 item4.Thing.TryLickEnchant(chara);
5115 break;
5116 }
5117 }
5118 }
5119 bool chance(int i)
5120 {
5121 i = i * 100 / (100 + EClass.player.codex.GetOrCreate(id).BonusDropLv * 10);
5122 if (i < 1)
5123 {
5124 i = 1;
5125 }
5126 if (IsMinion)
5127 {
5128 i *= 5;
5129 }
5130 if (EClass.rnd(i) == 0)
5131 {
5132 return true;
5133 }
5134 return false;
5135 }
5136 }
5137
5138 public Thing TryMakeRandomItem(int lv = -1)
5139 {
5140 if (lv == -1)
5141 {
5142 lv = EClass._zone.DangerLv;
5143 }
5144 switch (id)
5145 {
5146 case "gene":
5148 break;
5149 case "log":
5150 ChangeMaterial(EClass.sources.materials.rows.Where((SourceMaterial.Row m) => m.category == "wood").RandomItem());
5151 break;
5152 case "ore_gem":
5154 break;
5155 case "ore":
5157 break;
5158 case "milk":
5159 case "_egg":
5160 case "egg_fertilized":
5161 case "_meat":
5162 case "meat_marble":
5163 {
5164 string text = "c_wilds";
5165 if (id == "_meat" || id == "meat_marble")
5166 {
5167 text = "c_animal";
5168 }
5169 for (int i = 0; i < 20; i++)
5170 {
5171 CardRow cardRow = SpawnList.Get(text).Select(lv);
5172 if (cardRow.model.Chara.race.corpse[0] != "_meat" && id != "milk" && id != "_egg" && id != "egg_fertilized")
5173 {
5174 continue;
5175 }
5176 if (id == "milk")
5177 {
5178 if (c_idRefCard.IsEmpty())
5179 {
5180 MakeRefFrom(cardRow.model);
5181 }
5182 }
5183 else
5184 {
5185 MakeFoodFrom(cardRow.model);
5186 }
5187 break;
5188 }
5189 break;
5190 }
5191 }
5192 return this as Thing;
5193 }
5194
5195 public Card MakeFoodFrom(string _id)
5196 {
5197 return MakeFoodFrom(EClass.sources.cards.map[_id].model);
5198 }
5199
5201 {
5202 MakeRefFrom(c);
5204 if (!c.isChara)
5205 {
5206 return this;
5207 }
5208 SourceRace.Row race = c.Chara.race;
5209 int num = race.food[0].ToInt();
5210 bool flag = id == "meat_marble";
5211 int num2 = 1;
5212 bool flag2 = category.IsChildOf("meat");
5213 bool flag3 = category.IsChildOf("egg");
5214 if (flag)
5215 {
5216 num += 100;
5217 }
5218 if (flag2)
5219 {
5220 if (c.IsPCFaction && c.IsUnique)
5221 {
5222 num = -100;
5223 }
5224 elements.SetBase(70, race.STR * race.STR / 5 * num / 100 - 10 + num / 10);
5225 if (flag)
5226 {
5227 elements.SetBase(440, race.END * race.END / 5 * num / 100 - 10 + num / 10);
5228 }
5229 elements.SetBase(71, (int)Mathf.Clamp((float)(num / 10) + Mathf.Sqrt(race.height) - 10f, 1f, 60f));
5230 }
5231 else if (flag3)
5232 {
5233 elements.SetBase(444, race.LER * race.LER / 5 * num / 100 - 10 + num / 10);
5234 num2 = 2;
5235 }
5236 else
5237 {
5238 num2 = 3;
5239 }
5240 if (flag2)
5241 {
5242 if (race.IsHuman)
5243 {
5244 elements.SetBase(708, 1);
5245 }
5246 if (race.IsUndead)
5247 {
5248 elements.SetBase(709, 1);
5249 }
5250 }
5251 foreach (Element value in c.elements.dict.Values)
5252 {
5253 if ((!flag3 || value.id != 1229) && (value.source.category == "food" || value.source.tag.Contains("foodEnc") || value.IsTrait))
5254 {
5255 elements.SetBase(value.id, value.Value);
5256 }
5257 }
5258 List<Tuple<int, int>> list = new List<Tuple<int, int>>();
5259 foreach (KeyValuePair<int, int> item in race.elementMap)
5260 {
5261 if (EClass.sources.elements.map[item.Key].tag.Contains("primary"))
5262 {
5263 list.Add(new Tuple<int, int>(item.Key, item.Value));
5264 }
5265 }
5266 list.Sort((Tuple<int, int> a, Tuple<int, int> b) => b.Item2 - a.Item2);
5267 for (int i = 0; i < num2 && i < list.Count; i++)
5268 {
5269 Tuple<int, int> tuple = list[i];
5270 elements.SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
5271 }
5272 if (race.IsUndead)
5273 {
5274 elements.ModBase(73, -20);
5275 }
5276 isWeightChanged = true;
5277 c_weight = race.height * 4 + 100;
5278 c_idMainElement = c.c_idMainElement;
5279 SetBlessedState(BlessedState.Normal);
5280 int num3 = c.LV - c.sourceCard.LV;
5281 if (num3 < 0)
5282 {
5283 num3 = 0;
5284 }
5285 num3 = EClass.curve(num3, 10, 10, 80);
5286 if (c.rarity >= Rarity.Legendary || c.IsUnique)
5287 {
5288 num3 += 60;
5289 }
5290 if (flag2 && c.IsPCFaction && c.IsUnique)
5291 {
5292 num3 = 0;
5293 }
5294 if (num3 > 0)
5295 {
5296 elements.ModBase(2, num3);
5297 }
5298 return this;
5299 }
5300
5301 public void MakeFoodRef(Card c1, Card c2 = null)
5302 {
5303 Card card = c1;
5304 Card card2 = c2;
5305 if (IsIgnoreName(card))
5306 {
5307 card = null;
5308 }
5309 if (IsIgnoreName(card2))
5310 {
5311 card2 = null;
5312 }
5313 if (card == null && card2 != null)
5314 {
5315 card = card2;
5316 card2 = null;
5317 }
5318 if (card != null)
5319 {
5320 MakeRefFrom(card, card2);
5321 if (card.c_idRefCard != null)
5322 {
5323 c_idRefCard = card.c_idRefCard;
5324 c_altName = TryGetFoodName(card);
5325 }
5326 if (card2 != null && card2.c_idRefCard != null)
5327 {
5328 c_idRefCard2 = card2.c_idRefCard;
5329 c_altName2 = TryGetFoodName(card2);
5330 }
5331 }
5332 static bool IsIgnoreName(Card c)
5333 {
5334 if (c == null)
5335 {
5336 return true;
5337 }
5338 switch (c.id)
5339 {
5340 case "dough_cake":
5341 case "dough_bread":
5342 case "noodle":
5343 case "flour":
5344 case "rice":
5345 return true;
5346 default:
5347 return false;
5348 }
5349 }
5350 }
5351
5352 public string TryGetFoodName(Card c)
5353 {
5354 if (c.c_idRefCard.IsEmpty())
5355 {
5356 return c.c_altName;
5357 }
5358 if (!(c.refCard is SourceChara.Row { isChara: not false } row))
5359 {
5360 return c.c_altName;
5361 }
5362 if (!row.aka.IsEmpty())
5363 {
5364 if (row.name == "*r" && row.aka == "*r")
5365 {
5366 return "corpseGeneral".lang();
5367 }
5368 if (row.name == "*r")
5369 {
5370 return row.GetText("aka");
5371 }
5372 }
5373 return row.GetName();
5374 }
5375
5376 public string GetFoodName(string s)
5377 {
5378 return s.Replace("_corpseFrom".lang(), "_corpseTo".lang());
5379 }
5380
5381 public void MakeFigureFrom(string id)
5382 {
5383 MakeRefFrom(id);
5384 }
5385
5386 public void MakeRefFrom(string id)
5387 {
5388 c_idRefCard = id;
5389 }
5390
5391 public void MakeRefFrom(Card c1, Card c2 = null)
5392 {
5393 c_idRefCard = c1.id;
5394 c_altName = (c1.IsPC ? c1.c_altName : c1.GetName(NameStyle.Ref, (!c1.isChara) ? 1 : 0));
5395 if (c2 != null)
5396 {
5397 c_idRefCard2 = c2.id;
5398 c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName(NameStyle.Ref, (!c2.isChara) ? 1 : 0));
5399 }
5400 c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.c_extraNameRef);
5401 }
5402
5403 public Thing MakeEgg(bool effect = true, int num = 1, bool addToZone = true, int fertChance = 20, BlessedState? state = null)
5404 {
5405 Thing thing = ThingGen.Create((EClass.rnd(EClass.debug.enable ? 1 : fertChance) == 0) ? "egg_fertilized" : "_egg").SetNum(num);
5406 thing.MakeFoodFrom(this);
5407 thing.c_idMainElement = c_idMainElement;
5408 if (state.HasValue)
5409 {
5410 thing.SetBlessedState(state.Value);
5411 }
5412 if (!addToZone)
5413 {
5414 return thing;
5415 }
5416 return GiveBirth(thing, effect);
5417 }
5418
5419 public Thing MakeMilk(bool effect = true, int num = 1, bool addToZone = true, BlessedState? state = null)
5420 {
5421 Thing thing = ThingGen.Create("milk").SetNum(num);
5422 thing.MakeRefFrom(this);
5423 if (state.HasValue)
5424 {
5425 thing.SetBlessedState(state.Value);
5426 }
5427 int num2 = LV - sourceCard.LV;
5428 if (!IsPCFaction && EClass._zone.IsUserZone)
5429 {
5430 num2 = 0;
5431 }
5432 if (num2 >= 10)
5433 {
5434 thing.SetEncLv(num2 / 10);
5435 }
5436 if (!addToZone)
5437 {
5438 return thing;
5439 }
5440 return GiveBirth(thing, effect);
5441 }
5442
5443 public Thing GiveBirth(Thing t, bool effect)
5444 {
5445 Card card = (ExistsOnMap ? this : (GetRootCard() ?? EClass.pc));
5446 EClass.player.forceTalk = true;
5447 card.Talk("giveBirth");
5448 EClass._zone.TryAddThing(t, card.pos);
5449 if (effect)
5450 {
5451 card.pos.PlayEffect("revive");
5452 card.pos.PlaySound("egg");
5453 PlayAnime(AnimeID.Shiver);
5454 if (isChara)
5455 {
5457 }
5458 }
5459 return t;
5460 }
5461
5462 public Card SetHidden(bool hide = true)
5463 {
5464 isHidden = hide;
5465 pos.cell.Refresh();
5466 return this;
5467 }
5468
5469 public virtual MoveResult _Move(Point p, MoveType type = MoveType.Walk)
5470 {
5471 EClass._map.MoveCard(p, this);
5472 if (isChara)
5473 {
5474 Chara.SyncRide();
5475 }
5476 return MoveResult.Success;
5477 }
5478
5479 public void MoveImmediate(Point p, bool focus = true, bool cancelAI = true)
5480 {
5481 if (p == null)
5482 {
5483 return;
5484 }
5485 EClass._map.MoveCard(p, this);
5486 if (!IsPC || focus)
5487 {
5488 renderer.SetFirst(first: true, p.PositionCenter());
5489 }
5490 if (isChara)
5491 {
5492 if (cancelAI)
5493 {
5494 Chara.ai.Cancel();
5495 }
5496 Chara.SyncRide();
5497 }
5498 if (IsPC && focus)
5499 {
5502 }
5503 }
5504
5505 public void Teleport(Point point, bool silent = false, bool force = false)
5506 {
5507 if (EClass._zone.IsRegion)
5508 {
5509 SayNothingHappans();
5510 return;
5511 }
5512 PlayEffect("teleport");
5513 if (!force && (trait is TraitNewZone || elements.Has(400) || (isChara && Chara.HasCondition<ConGravity>())))
5514 {
5515 Say("antiTeleport", this);
5516 PlaySound("gravity");
5517 return;
5518 }
5519 if (!silent)
5520 {
5521 PlaySound("teleport");
5522 Say("teleported", this);
5523 }
5524 _Move(point);
5525 renderer.SetFirst(first: true, pos.PositionCenter());
5526 if (isChara)
5527 {
5528 Chara.ai.Cancel();
5529 foreach (Chara chara in EClass._map.charas)
5530 {
5531 if (chara.enemy == this)
5532 {
5533 chara.SetEnemy();
5534 }
5535 }
5536 Chara.RemoveCondition<ConEntangle>();
5537 }
5538 if (IsPC)
5539 {
5542 EClass.player.haltMove = true;
5543 }
5544 PlayEffect("teleport", useRenderPos: false);
5545 }
5546
5547 public virtual void OnLand()
5548 {
5550 {
5551 PlayEffect("ripple");
5552 PlaySound("Footstep/water");
5553 }
5554 }
5555
5556 public int ResistLvFrom(int ele)
5557 {
5558 return ResistLv(EClass.sources.elements.alias.TryGetValue(EClass.sources.elements.map[ele].aliasRef)?.id ?? 0);
5559 }
5560
5561 public int ResistLv(int res)
5562 {
5563 return Element.GetResistLv(Evalue(res));
5564 }
5565
5566 public bool HasElement(int ele, int req = 1)
5567 {
5568 return elements.Value(ele) >= req;
5569 }
5570
5571 public bool HasElement(string id, int req = 1)
5572 {
5573 return HasElement(EClass.sources.elements.alias[id].id, req);
5574 }
5575
5576 public bool HasGlobalElement(int ele)
5577 {
5578 return elements.GetElement(ele)?.IsGlobalElement ?? false;
5579 }
5580
5581 public bool HasElementNoCopy()
5582 {
5583 if (HasElement(759))
5584 {
5585 return true;
5586 }
5587 if (HasElement(703))
5588 {
5589 return true;
5590 }
5591 return false;
5592 }
5593
5595 {
5596 renderer = new CardRenderer();
5597 renderer.SetOwner(this);
5598 return renderer;
5599 }
5600
5601 public void AddBlood(int a = 1, int id = -1)
5602 {
5603 if (!EClass._zone.IsRegion)
5604 {
5605 for (int i = 0; i < a; i++)
5606 {
5607 EClass._map.AddDecal(pos.x + ((EClass.rnd(2) != 0) ? (EClass.rnd(3) - 1) : 0), pos.z + ((EClass.rnd(2) != 0) ? (EClass.rnd(3) - 1) : 0), (id == -1) ? (isChara ? Chara.race.blood : material.decal) : id);
5608 }
5609 PlaySound("blood");
5610 }
5611 }
5612
5614 {
5616 shared.color = 11010048f;
5617 shared.liquidLv = 0;
5618 shared.cell = null;
5619 SetRenderParam(shared);
5620 return shared;
5621 }
5622
5623 public virtual void SetRenderParam(RenderParam p)
5624 {
5625 }
5626
5627 public void DyeRandom()
5628 {
5629 Dye(EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.matColor.r != r.matColor.g || r.matColor.g != r.matColor.b || r.matColor.b != r.matColor.r).RandomItem().alias);
5630 }
5631
5632 public void Dye(string idMat)
5633 {
5634 Dye(EClass.sources.materials.alias[idMat]);
5635 }
5636
5637 public void Dye(SourceMaterial.Row mat)
5638 {
5639 isDyed = mat != null;
5640 c_dyeMat = mat?.id ?? 0;
5641 _colorInt = 0;
5642 }
5643
5644 public void RefreshColor()
5645 {
5646 if (isChara)
5647 {
5648 if (isDyed)
5649 {
5650 _colorInt = BaseTileMap.GetColorInt(ref DyeMat.matColor, sourceRenderCard.colorMod);
5651 }
5652 else if (isElemental)
5653 {
5654 _colorInt = BaseTileMap.GetColorInt(ref EClass.setting.elements[Chara.MainElement.source.alias].colorSprite, sourceRenderCard.colorMod);
5655 }
5656 else
5657 {
5658 _colorInt = 104025;
5659 }
5660 }
5661 else if (isDyed)
5662 {
5663 if (sourceRenderCard.useAltColor)
5664 {
5665 _colorInt = BaseTileMap.GetColorInt(ref DyeMat.altColor, sourceRenderCard.colorMod);
5666 }
5667 else
5668 {
5669 _colorInt = BaseTileMap.GetColorInt(ref DyeMat.matColor, sourceRenderCard.colorMod);
5670 }
5671 }
5672 else if (sourceRenderCard.useRandomColor)
5673 {
5674 _colorInt = BaseTileMap.GetColorInt(ref GetRandomColor(), sourceRenderCard.colorMod);
5675 }
5676 else if (sourceRenderCard.useAltColor)
5677 {
5678 _colorInt = BaseTileMap.GetColorInt(ref material.altColor, sourceRenderCard.colorMod);
5679 }
5680 else
5681 {
5682 _colorInt = BaseTileMap.GetColorInt(ref material.matColor, sourceRenderCard.colorMod);
5683 }
5684 }
5685
5687 {
5688 int num = EClass.game.seed + refVal;
5689 num += id[0] % 10000;
5690 if (id.Length > 1)
5691 {
5692 num += id[1] % 1000;
5693 if (id.Length > 2)
5694 {
5695 num += id[2] % 1000;
5696 if (id.Length > 3)
5697 {
5698 num += id[3] % 1000;
5699 if (id.Length > 4)
5700 {
5701 num += id[4] % 1000;
5702 }
5703 }
5704 }
5705 }
5706 Rand.UseSeed(num, delegate
5707 {
5708 _randColor = EClass.sources.materials.rows[EClass.rnd(90)].matColor;
5709 });
5710 return ref _randColor;
5711 }
5712
5713 public virtual Sprite GetSprite(int dir = 0)
5714 {
5715 if (trait is TraitAbility)
5716 {
5717 return (trait as TraitAbility).CreateAct()?.GetSprite() ?? EClass.core.refs.icons.defaultAbility;
5718 }
5719 return sourceCard.GetSprite(dir, trait.IdSkin, (IsInstalled && pos != null && pos.IsValid && pos.cell.IsSnowTile) ? true : false);
5720 }
5721
5722 public virtual Sprite GetImageSprite()
5723 {
5724 return null;
5725 }
5726
5727 public void SetImage(Image image, int dir, int idSkin = 0)
5728 {
5729 sourceRenderCard.SetImage(image, GetSprite(dir), colorInt, setNativeSize: true, dir, idSkin, this);
5730 }
5731
5732 public virtual void SetImage(Image image)
5733 {
5734 if (trait is TraitAbility)
5735 {
5736 (trait as TraitAbility).act.SetImage(image);
5737 }
5738 else
5739 {
5740 sourceRenderCard.SetImage(image, GetSprite(), colorInt, setNativeSize: true, 0, 0, this);
5741 }
5742 }
5743
5744 public void ShowEmo(Emo _emo = Emo.none, float duration = 0f, bool skipSame = true)
5745 {
5746 if ((!isChara || Chara.host == null) && !(_emo == lastEmo && skipSame))
5747 {
5748 if (_emo != 0)
5749 {
5750 renderer.ShowEmo(_emo, duration);
5751 }
5752 lastEmo = _emo;
5753 }
5754 }
5755
5756 public void PlaySoundHold(bool spatial = true)
5757 {
5758 PlaySound(material.GetSoundDrop(sourceCard), 1f, spatial);
5759 }
5760
5761 public void PlaySoundDrop(bool spatial = true)
5762 {
5763 PlaySound(material.GetSoundDrop(sourceCard), 1f, spatial);
5764 }
5765
5766 public void PlaySoundImpact(bool spatial = true)
5767 {
5768 PlaySound(material.GetSoundImpact(sourceCard), 1f, spatial);
5769 }
5770
5771 public void PlaySoundDead(bool spatial = true)
5772 {
5773 PlaySound(material.GetSoundDead(sourceCard), 1f, spatial);
5774 }
5775
5776 public SoundSource PlaySound(string id, float v = 1f, bool spatial = true)
5777 {
5778 Card rootCard = GetRootCard();
5779 if (rootCard.IsPC)
5780 {
5781 spatial = false;
5782 }
5783 if (rootCard.Dist(EClass.pc) < EClass.player.lightRadius + 1 || !spatial)
5784 {
5785 return rootCard.pos.PlaySound(id, isSynced || !spatial, v, spatial);
5786 }
5787 return null;
5788 }
5789
5790 public void KillAnime()
5791 {
5792 renderer.KillAnime();
5793 }
5794
5795 public void PlayAnime(AnimeID id, bool force = false)
5796 {
5797 renderer.PlayAnime(id, force);
5798 }
5799
5800 public void PlayAnime(AnimeID id, Point dest, bool force = false)
5801 {
5802 renderer.PlayAnime(id, dest);
5803 }
5804
5805 public void PlayAnimeLoot()
5806 {
5807 renderer.PlayAnime(AnimeID.Loot);
5808 }
5809
5810 public Effect PlayEffect(string id, bool useRenderPos = true, float range = 0f, Vector3 fix = default(Vector3))
5811 {
5812 if (id.IsEmpty())
5813 {
5814 return null;
5815 }
5816 Card rootCard = GetRootCard();
5817 return Effect.Get(id)._Play(rootCard.pos, fix + ((isSynced && useRenderPos) ? rootCard.renderer.position : rootCard.pos.Position()) + new Vector3(Rand.Range(0f - range, range), Rand.Range(0f - range, range), 0f));
5818 }
5819
5820 public void PlayEffect(int ele, bool useRenderPos = true, float range = 0f)
5821 {
5822 Effect effect = Effect.Get("Element/" + EClass.sources.elements.map[ele].alias);
5823 if (effect == null)
5824 {
5825 Debug.Log(ele);
5826 return;
5827 }
5828 Card rootCard = GetRootCard();
5829 effect._Play(rootCard.pos, ((isSynced && useRenderPos) ? rootCard.renderer.position : rootCard.pos.Position()) + new Vector3(Rand.Range(0f - range, range), Rand.Range(0f - range, range), 0f));
5830 }
5831
5832 public virtual void SetDir(int d)
5833 {
5834 dir = d;
5835 renderer.RefreshSprite();
5836 }
5837
5838 public void SetRandomDir()
5839 {
5840 SetDir(EClass.rnd(4));
5841 }
5842
5843 public virtual void LookAt(Card c)
5844 {
5845 }
5846
5847 public virtual void LookAt(Point p)
5848 {
5849 }
5850
5851 public virtual void Rotate(bool reverse = false)
5852 {
5853 int num = 4;
5854 if (sourceCard.tiles.Length > 4)
5855 {
5856 num = sourceCard.tiles.Length;
5857 }
5858 if (TileType == TileType.Door)
5859 {
5860 num = 2;
5861 }
5862 if (reverse)
5863 {
5864 dir--;
5865 }
5866 else
5867 {
5868 dir++;
5869 }
5870 if (dir < 0)
5871 {
5872 dir = num - 1;
5873 }
5874 if (dir == num)
5875 {
5876 dir = 0;
5877 }
5878 SetDir(dir);
5879 renderer.RefreshSprite();
5880 }
5881
5882 public void ChangeAltitude(int a)
5883 {
5884 altitude += a;
5885 if (altitude < 0)
5886 {
5887 altitude = 0;
5888 }
5889 if (altitude > TileType.MaxAltitude)
5890 {
5891 altitude = TileType.MaxAltitude;
5892 }
5893 }
5894
5896 {
5897 return SubPassData.Default;
5898 }
5899
5900 public void SetFreePos(Point point)
5901 {
5902 freePos = EClass.game.config.FreePos && isThing && TileType.FreeStyle && !sourceCard.multisize && !EClass.scene.actionMode.IsRoofEditMode(this);
5903 if (freePos)
5904 {
5905 Vector3 vector = point.Position();
5906 Vector3 thingPosition = EClass.screen.tileMap.GetThingPosition(this, point);
5907 fx = EInput.mposWorld.x + EClass.setting.render.freePosFix.x;
5908 fy = EInput.mposWorld.y + EClass.setting.render.freePosFix.y;
5910 {
5911 fx -= fx % 0.2f;
5912 fy -= fy % 0.1f;
5913 }
5914 fx = fx - vector.x + thingPosition.x;
5915 fy = fy - vector.y + thingPosition.y;
5916 }
5917 else
5918 {
5919 float num2 = (fy = 0f);
5920 fx = num2;
5921 }
5922 }
5923
5924 public void RenderMarker(Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition = false)
5925 {
5926 if (dir != -1)
5927 {
5928 this.dir = dir;
5929 }
5930 Vector3 v = point.Position();
5931 bool skipRender = point.cell.skipRender;
5932 if (result != 0 && EClass.screen.guide.isActive && !skipRender)
5933 {
5934 EClass.screen.guide.passGuideBlock.Add(ref v, (point.HasObj || point.HasChara) ? 5 : 0);
5935 }
5936 if (!main)
5937 {
5938 return;
5939 }
5940 RenderParam renderParam = GetRenderParam();
5942 {
5943 renderParam.x = v.x;
5944 renderParam.y = v.y;
5945 renderParam.z = v.z;
5946 EClass.screen.tileMap.SetRoofHeight(renderParam, point.cell, point.x, point.z);
5947 v.x = renderParam.x;
5948 v.y = renderParam.y;
5949 v.z = renderParam.z;
5950 }
5952 {
5953 TileType.GetMountHeight(ref v, point, this.dir, this);
5954 }
5955 v.z += EClass.setting.render.thingZ;
5956 if (!skipRender)
5957 {
5958 Vector3 thingPosition = EClass.screen.tileMap.GetThingPosition(this, point);
5959 if (freePos)
5960 {
5961 v.x += fx;
5962 v.y += fy;
5963 v.z += thingPosition.z;
5964 }
5965 else
5966 {
5967 v += thingPosition;
5968 }
5969 }
5970 if (useCurrentPosition)
5971 {
5972 v = renderer.position;
5973 v.z += -0.01f;
5974 }
5975 if (TileType == TileType.Door)
5976 {
5977 v.z -= 0.5f;
5978 }
5979 renderParam.matColor = (active ? EClass.Colors.blockColors.Active : EClass.Colors.blockColors.Inactive);
5980 point.ApplyAnime(ref v);
5981 if (renderer.hasActor)
5982 {
5983 renderer.actor.RefreshSprite();
5984 }
5985 renderer.Draw(renderParam, ref v, drawShadow: false);
5986 }
5987
5988 public void RecalculateFOV()
5989 {
5990 if (fov != null)
5991 {
5992 ClearFOV();
5993 fov = null;
5994 if (IsPC)
5995 {
5996 EClass.player.lightRadius = 1;
5997 }
5998 }
5999 CalculateFOV();
6000 }
6001
6002 public bool HasLight()
6003 {
6004 return GetLightRadius() > 0;
6005 }
6006
6007 public float GetLightPower()
6008 {
6009 float num = (isChara ? EClass.scene.profile.light.fovCurveChara.Evaluate(EClass.scene.timeRatio) : EClass.scene.profile.global.fovPower);
6010 if (LightData != null)
6011 {
6012 return 0.01f * LightData.color.a * 256f * 1.12f;
6013 }
6014 if (IsPCFaction && !IsPC)
6015 {
6016 num *= 4f;
6017 }
6018 return num;
6019 }
6020
6021 public int GetSightRadius()
6022 {
6023 if (IsPC)
6024 {
6025 return EClass.player.lightRadius;
6026 }
6027 return (EClass._map.IsIndoor ? 4 : 5) + (IsPCFaction ? 1 : 0);
6028 }
6029
6030 public int GetLightRadius()
6031 {
6032 if (isThing)
6033 {
6034 if (!IsInstalled && EClass.pc.held != this)
6035 {
6036 return 0;
6037 }
6038 if (trait is TraitLightSource && Thing.isEquipped)
6039 {
6040 return (trait as TraitLightSource).LightRadius;
6041 }
6042 if (LightData == null || !trait.IsLightOn)
6043 {
6044 return 0;
6045 }
6046 return LightData.radius;
6047 }
6048 int num = ((LightData != null) ? LightData.radius : 0);
6049 int num2 = 0;
6050 if (IsPC)
6051 {
6052 if (Chara.isBlind)
6053 {
6054 return 1;
6055 }
6056 num = ((EClass._map.IsIndoor || EClass.world.date.IsNight) ? 2 : ((EClass.world.date.periodOfDay == PeriodOfDay.Day) ? 6 : 5));
6057 num2 = 2;
6058 }
6059 else
6060 {
6062 {
6063 return 0;
6064 }
6065 if (LightData == null && !EClass._map.IsIndoor && !EClass.world.date.IsNight)
6066 {
6067 return 0;
6068 }
6069 }
6070 if (IsPCFaction)
6071 {
6072 Thing equippedThing = Chara.body.GetEquippedThing(45);
6073 if (equippedThing != null && equippedThing.trait is TraitLightSource traitLightSource)
6074 {
6075 num2 = traitLightSource.LightRadius;
6076 }
6077 if (Chara.held != null && IsPC)
6078 {
6079 int lightRadius = Chara.held.GetLightRadius();
6080 if (lightRadius > 0)
6081 {
6082 if (lightRadius > num2)
6083 {
6084 num2 = Chara.held.GetLightRadius() - 1;
6085 }
6086 if (num2 < 3)
6087 {
6088 num2 = 3;
6089 }
6090 }
6091 }
6092 if (num < num2)
6093 {
6094 num = num2;
6095 }
6096 }
6097 return num;
6098 }
6099
6100 public void CalculateFOV()
6101 {
6102 int radius = GetLightRadius();
6103 if (radius == 0 || !IsAliveInCurrentZone || !EClass._zone.isStarted)
6104 {
6105 return;
6106 }
6107 float power = GetLightPower();
6108 if (IsPC)
6109 {
6110 if (Chara.held != null && Chara.held.GetLightRadius() > 0)
6111 {
6112 power += Chara.held.GetLightPower();
6113 }
6114 if (radius <= 2)
6115 {
6116 power = 0f;
6117 }
6118 foreach (Condition condition in Chara.conditions)
6119 {
6120 condition.OnCalculateFov(fov, ref radius, ref power);
6121 }
6122 if (power > EClass.scene.profile.global.playerLightPowerLimit)
6123 {
6124 power = EClass.scene.profile.global.playerLightPowerLimit;
6125 }
6126 power *= EClass.scene.profile.light.playerLightMod + (float)EClass.player.customLightMod * EClass.scene.profile.light.playerLightCustomMod;
6127 EClass.player.lightRadius = radius;
6128 EClass.player.lightPower = power;
6129 }
6130 if (fov == null)
6131 {
6132 fov = CreateFov();
6133 }
6134 fov.Perform(pos.x, pos.z, radius, power * 2f);
6135 }
6136
6138 {
6139 c_lightColor = (byte)(EClass.rnd(8) + 1) * 1024 + (byte)(EClass.rnd(8) + 1) * 32 + (byte)(EClass.rnd(8) + 1);
6140 }
6141
6143 {
6144 Fov fov = new Fov();
6145 int num = (trait.UseLightColor ? c_lightColor : 0);
6146 if (num != 0)
6147 {
6148 fov.r = (byte)(num / 1024);
6149 fov.g = (byte)(num % 1024 / 32);
6150 fov.b = (byte)(num % 32);
6151 }
6152 else if (LightData != null)
6153 {
6154 fov.r = (byte)(LightData.color.r * 16f);
6155 fov.g = (byte)(LightData.color.g * 16f);
6156 fov.b = (byte)(LightData.color.b * 16f);
6157 }
6158 else if (isChara)
6159 {
6160 fov.r = 0;
6161 fov.g = 0;
6162 fov.b = 0;
6163 }
6164 else
6165 {
6166 fov.r = 3;
6167 fov.g = 2;
6168 fov.b = 1;
6169 }
6170 if (isChara && Chara.held != null && Chara.held.GetLightRadius() > 0)
6171 {
6172 Fov fov2 = Chara.held.CreateFov();
6173 fov.r += fov2.r;
6174 fov.g += fov2.g;
6175 fov.b += fov2.b;
6176 }
6177 if (IsPC)
6178 {
6179 fov.isPC = true;
6180 foreach (Condition condition in Chara.conditions)
6181 {
6182 condition.OnCreateFov(fov);
6183 }
6184 }
6185 fov.limitGradient = IsPCParty && EClass.scene.profile.global.limitGradient;
6186 return fov;
6187 }
6188
6189 public void ClearFOV()
6190 {
6191 if (fov != null && fov.lastPoints.Count != 0)
6192 {
6193 fov.Perform(pos.x, pos.z, 0);
6194 }
6195 }
6196
6197 public virtual void OnSimulateHour(VirtualDate date)
6198 {
6199 trait.OnSimulateHour(date);
6200 if (date.IsRealTime)
6201 {
6202 DecayNatural();
6203 }
6204 }
6205
6206 public void DecayNatural(int hour = 1)
6207 {
6208 if (!isNPCProperty)
6209 {
6210 things.ForeachReverse(delegate(Thing t)
6211 {
6212 t.DecayNatural(hour);
6213 });
6214 if (sourceCard._origin == "dish")
6215 {
6216 CheckJustCooked();
6217 }
6218 if (parent is Card && (parent as Card).trait.CanChildDecay(this))
6219 {
6220 Decay(10 * hour);
6221 }
6222 else if (!isChara && trait.Decay != 0)
6223 {
6224 Decay(trait.Decay * hour);
6225 }
6226 }
6227 }
6228
6229 public void CheckJustCooked()
6230 {
6231 if (HasElement(757) && c_dateCooked <= EClass.world.date.GetRaw() - 120)
6232 {
6233 c_dateCooked = 0;
6234 elements.Remove(757);
6235 }
6236 }
6237
6238 public void Decay(int a = 10)
6239 {
6240 Card card = parent as Card;
6241 int num = 200;
6242 int num2 = MaxDecay / 4 * 3;
6243 if (a > 0)
6244 {
6245 if (card != null)
6246 {
6247 num = card.trait.DecaySpeedChild;
6248 }
6249 num = num * trait.DecaySpeed / 100;
6250 int num3 = Evalue(405);
6251 if (num3 != 0)
6252 {
6253 num = num * (100 - num3 * 2) / 100;
6254 }
6255 if (num < 0)
6256 {
6257 num = 0;
6258 }
6259 }
6260 else
6261 {
6262 num = 100;
6263 }
6264 a = a * num / 100;
6265 if (decay + a > MaxDecay)
6266 {
6267 if (card != null && !card.trait.OnChildDecay(this, !IsDecayed))
6268 {
6269 return;
6270 }
6271 if (!IsDecayed)
6272 {
6273 if (EClass.pc.HasElement(1325) && GetRootCard() is Chara && category.IsChildOf("food"))
6274 {
6275 Thing thing = TraitSeed.MakeRandomSeed(enc: true).SetNum(Mathf.Min(Num, 3));
6276 card.AddCard(thing);
6277 if (!IsParentLocked())
6278 {
6279 GetRootCard().Say("seed_rot", GetRootCard(), this, thing.Name);
6280 }
6281 Destroy();
6282 return;
6283 }
6284 if (parent == EClass._zone)
6285 {
6286 Say("rot", this);
6287 }
6288 else if (GetRootCard() == EClass.pc)
6289 {
6290 if (!IsParentLocked())
6291 {
6292 EClass.pc.Say("rotInv", this, EClass.pc);
6293 }
6295 }
6296 if (IsFood)
6297 {
6298 elements.ModBase(73, -10);
6299 }
6300 }
6301 }
6302 else if (decay < num2 && decay + a >= num2 && GetRootCard() == EClass.pc)
6303 {
6304 if (!IsParentLocked())
6305 {
6306 EClass.pc.Say("rottingInv", this, EClass.pc);
6307 }
6309 }
6310 decay += a;
6311 bool IsParentLocked()
6312 {
6313 if (parent is Thing)
6314 {
6315 return (parent as Thing).c_lockLv > 0;
6316 }
6317 return false;
6318 }
6319 }
6320
6321 public bool HasTalk(string idTopic)
6322 {
6323 return !MOD.listTalk.GetTalk(c_idTalk.IsEmpty(id), idTopic, useDefault: true).IsEmpty();
6324 }
6325
6326 public void Talk(string idTopic, string ref1 = null, string ref2 = null, bool forceSync = false)
6327 {
6328 if (IsPC && !EClass.player.forceTalk && idTopic != "goodBoy" && idTopic != "insane")
6329 {
6330 EClass.player.forceTalk = false;
6331 Msg.SetColor();
6332 return;
6333 }
6334 EClass.player.forceTalk = false;
6335 if (!isSynced && !forceSync)
6336 {
6337 Msg.SetColor();
6338 return;
6339 }
6340 GameLang.refDrama1 = ref1;
6341 GameLang.refDrama2 = ref2;
6342 string text = GetTalkText(idTopic, stripPun: true);
6343 if (HasElement(1232) && idTopic != "baby")
6344 {
6345 BackerContent.GakiConvert(ref text, "babu");
6346 }
6347 else
6348 {
6349 string text2 = id;
6350 if (!(text2 == "adv_gaki"))
6351 {
6352 if (text2 == "corgon")
6353 {
6354 BackerContent.GakiConvert(ref text, "mokyu");
6355 }
6356 }
6357 else
6358 {
6359 BackerContent.GakiConvert(ref text);
6360 }
6361 }
6362 TalkRaw(text, ref1, ref2, forceSync);
6363 }
6364
6365 public void TalkRaw(string text, string ref1 = null, string ref2 = null, bool forceSync = false)
6366 {
6367 if ((!isSynced && !forceSync) || text.IsEmpty())
6368 {
6369 Msg.SetColor();
6370 return;
6371 }
6372 if (ref1 != null)
6373 {
6374 text = text.Replace("#1", ref1);
6375 }
6376 if (ref2 != null)
6377 {
6378 text = text.Replace("#2", ref2);
6379 }
6380 HostRenderer.Say(ApplyNewLine(text));
6381 bool flag = text.StartsWith("*");
6382 Msg.SetColor(text.StartsWith("(") ? Msg.colors.Thinking : (flag ? Msg.colors.Ono : Msg.colors.Talk));
6383 if (!flag)
6384 {
6385 text = text.Bracket();
6386 }
6387 Msg.Say(text.Replace("&", ""));
6388 }
6389
6390 public string ApplyNewLine(string text)
6391 {
6392 if (text.Contains("&"))
6393 {
6394 string text2 = "_comma".lang();
6395 text = text.Replace(text2 + " &", Environment.NewLine ?? "");
6396 text = text.Replace(text2 + "&", Environment.NewLine ?? "");
6397 text = text.Replace("&", Environment.NewLine ?? "");
6398 }
6399 return text;
6400 }
6401
6402 public void SayRaw(string text, string ref1 = null, string ref2 = null)
6403 {
6404 if (isSynced && !text.IsEmpty())
6405 {
6406 if (ref1 != null)
6407 {
6408 text = text.Replace("#1", ref1);
6409 }
6410 if (ref2 != null)
6411 {
6412 text = text.Replace("#2", ref2);
6413 }
6414 HostRenderer.Say(text);
6415 }
6416 }
6417
6418 public void SayNothingHappans()
6419 {
6420 Say("nothingHappens");
6421 }
6422
6423 public void Say(string lang, string ref1 = null, string ref2 = null)
6424 {
6425 if (ShouldShowMsg)
6426 {
6427 Msg.Say(IsPC ? Lang.Game.TryGetId(lang + "_pc", lang) : lang, ref1, ref2);
6428 }
6429 Msg.SetColor();
6430 }
6431
6432 public void Say(string lang, Card c1, Card c2, string ref1 = null, string ref2 = null)
6433 {
6434 if (ShouldShowMsg)
6435 {
6436 Msg.Say(IsPC ? Lang.Game.TryGetId(lang + "_pc", lang) : lang, c1, c2, ref1, ref2);
6437 }
6438 Msg.SetColor();
6439 }
6440
6441 public void Say(string lang, Card c1, string ref1 = null, string ref2 = null)
6442 {
6443 if (ShouldShowMsg)
6444 {
6445 Msg.Say(IsPC ? Lang.Game.TryGetId(lang + "_pc", lang) : lang, c1, ref1, ref2);
6446 }
6447 Msg.SetColor();
6448 }
6449
6450 public string GetTalkText(string idTopic, bool stripPun = false, bool useDefault = true)
6451 {
6452 bool flag = isChara && Chara.IsHumanSpeak;
6453 string text = MOD.listTalk.GetTalk(c_idTalk.IsEmpty(id), idTopic, useDefault, flag);
6454 if (!text.IsEmpty())
6455 {
6456 text = text.Split('|').RandomItem();
6457 if (!flag || (IsDeadOrSleeping && IsAliveInCurrentZone))
6458 {
6459 if (!text.StartsWith("(") && !text.StartsWith("*"))
6460 {
6461 text = "(" + text + ")";
6462 }
6463 text = text.Replace("。)", ")");
6464 }
6465 }
6466 return ApplyTone(text, stripPun);
6467 }
6468
6469 public string ApplyTone(string text, bool stripPun = false)
6470 {
6471 text = GameLang.ConvertDrama(text, Chara);
6472 return ApplyTone(Chara, ref text, c_idTone, bio?.gender ?? 0, stripPun);
6473 }
6474
6475 public static string ApplyTone(Chara c, ref string text, string _tones, int gender, bool stripPun = false)
6476 {
6477 if (text.IsEmpty())
6478 {
6479 return text;
6480 }
6481 string[] array = _tones.IsEmpty("").Split('|');
6482 string key = array[0];
6483 string text2 = "";
6485 if (!Lang.setting.useTone || MOD.tones.list.Count == 0)
6486 {
6487 text2 = text.Replace("{", "").Replace("}", "");
6488 }
6489 else
6490 {
6491 if (array[0].IsEmpty())
6492 {
6493 key = "default";
6494 }
6495 if (MOD.tones.all.ContainsKey(key))
6496 {
6497 StringBuilder stringBuilder = MOD.tones.ApplyTone(key, ref text, gender);
6498 if (Lang.isJP && c != null && c.trait.EnableTone)
6499 {
6500 if (array.Length >= 2)
6501 {
6502 stringBuilder.Replace("_toneI".lang(), array[1]);
6503 }
6504 if (array.Length >= 3)
6505 {
6506 stringBuilder.Replace("_toneYou".lang(), array[2]);
6507 }
6508 }
6509 text2 = stringBuilder.ToString();
6510 }
6511 else
6512 {
6513 text2 = text.Replace("{", "").Replace("}", "");
6514 }
6515 }
6516 if (c != null)
6517 {
6518 text2 = text2.Replace("#me", c.NameSimple);
6519 }
6520 if (!stripPun || !Lang.setting.stripPuns)
6521 {
6522 return text2;
6523 }
6524 return text2.StripLastPun();
6525 }
6526
6527 public void SetRandomTalk()
6528 {
6530 if (!MOD.listTalk.list[0].ContainsKey(id))
6531 {
6532 c_idTalk = MOD.listTalk.GetRandomID("human");
6533 }
6534 }
6535
6536 public void SetRandomTone()
6537 {
6539 List<Dictionary<string, string>> list = MOD.tones.list;
6540 if (list.Count != 0)
6541 {
6542 int mtp = EClass.core.config.test.extraToneMTP switch
6543 {
6544 4 => 10,
6545 3 => 5,
6546 2 => 2,
6547 1 => 1,
6548 0 => 0,
6549 _ => 0,
6550 };
6551 if (EClass.debug.enable)
6552 {
6553 mtp *= 100;
6554 }
6555 string text = list.RandomItem()["id"];
6556 text = list.RandomItemWeighted((Dictionary<string, string> a) => a["chance"].ToInt() * ((!a["tag"].Contains("meta")) ? 1 : mtp))["id"];
6557 c_idTone = MOD.tones.GetToneID(text, bio?.gender ?? 0);
6558 }
6559 }
6560
6562 {
6563 return ListCraftBonusTraits().Count > 0;
6564 }
6565
6566 public List<Element> ListCraftBonusTraits()
6567 {
6568 List<Element> list = new List<Element>();
6569 string[] tag = sourceCard.tag;
6570 for (int i = 0; i < tag.Length; i++)
6571 {
6572 string[] array = tag[i].Split('/');
6573 if (!(array[0] != "craft_bonus"))
6574 {
6575 Element item = Element.Create(array[1], array[2].ToInt());
6576 list.Add(item);
6577 }
6578 }
6579 return list;
6580 }
6581
6582 public void TryStack(Thing t)
6583 {
6584 if (t == this)
6585 {
6586 return;
6587 }
6588 ThingContainer.DestData dest = things.GetDest(t);
6589 if (dest.stack != null)
6590 {
6591 if (IsPC)
6592 {
6593 Say("stack_thing", t, dest.stack);
6594 }
6595 t.TryStackTo(dest.stack);
6596 }
6597 }
6598
6599 public void ApplyBacker(int bid)
6600 {
6601 ChangeRarity(Rarity.Normal);
6602 SourceBacker.Row row = EClass.sources.backers.map.TryGetValue(bid);
6603 if (row == null)
6604 {
6605 return;
6606 }
6607 c_idBacker = row.id;
6608 if (row.type == 4)
6609 {
6611 Chara chara = Chara;
6612 Hostility hostility2 = (Chara.c_originalHostility = Hostility.Neutral);
6613 chara.hostility = hostility2;
6614 }
6615 if (row.type == 6)
6616 {
6619 Chara.idFaith = row.deity.ToLower();
6620 }
6621 if (row.type == 4 || row.type == 5 || row.type == 7)
6622 {
6623 idSkin = ((row.skin == 0) ? EClass.rnd(sourceCard._tiles.Length) : row.skin);
6624 if (id == "putty_snow")
6625 {
6626 idSkin = 0;
6627 }
6628 }
6629 if (bid == 164)
6630 {
6631 Chara.EQ_ID("amulet_moonnight");
6632 }
6633 }
6634
6635 public void RemoveBacker()
6636 {
6637 if (c_idBacker == 164)
6638 {
6639 Chara.things.Find("amulet_moonnight")?.Destroy();
6640 }
6641 c_idBacker = 0;
6642 }
6643
6644 public void SetPaintData()
6645 {
6646 EClass.ui.Hide(0f);
6648 {
6649 ClearPaintSprite();
6650 c_textureData = GetPaintData();
6652 {
6653 EClass.ui.Show(0f);
6654 });
6655 });
6656 }
6657
6658 public byte[] GetPaintData()
6659 {
6660 Sprite sprite = GetSprite();
6661 Texture2D texture2D = ScreenCapture.CaptureScreenshotAsTexture();
6662 int num = sprite.texture.width * 2;
6663 int num2 = sprite.texture.height * 2;
6664 int x = (int)Mathf.Clamp(Input.mousePosition.x - (float)(num / 2), 1f, texture2D.width - num - 1);
6665 int y = (int)Mathf.Clamp(Input.mousePosition.y - (float)(num2 / 2), 1f, texture2D.height - num2 - 1);
6666 Color[] pixels = texture2D.GetPixels(x, y, num, num2);
6667 Texture2D texture2D2 = new Texture2D(num, num2, TextureFormat.ARGB32, mipChain: false);
6668 texture2D2.SetPixels(pixels);
6669 texture2D2.Apply();
6670 byte[] result = texture2D2.EncodeToJPG();
6671 UnityEngine.Object.Destroy(texture2D);
6672 UnityEngine.Object.Destroy(texture2D2);
6673 return result;
6674 }
6675
6676 public void ClearPaintSprite()
6677 {
6678 if ((bool)_paintSprite)
6679 {
6680 UnityEngine.Object.Destroy(_paintSprite.texture);
6681 UnityEngine.Object.Destroy(_paintSprite);
6682 _paintSprite = null;
6683 }
6684 }
6685
6686 public Sprite GetPaintSprite()
6687 {
6688 if (!_paintSprite)
6689 {
6690 byte[] data = c_textureData;
6691 Texture2D texture2D = new Texture2D(1, 1);
6692 texture2D.LoadImage(data);
6693 _paintSprite = Sprite.Create(texture2D, new Rect(0f, 0f, texture2D.width, texture2D.height), new Vector2(0.5f, 0.5f), 200f);
6694 EClass.game.loadedTextures.Add(texture2D);
6695 if (trait is TraitCanvas traitCanvas)
6696 {
6697 texture2D.filterMode = ((!traitCanvas.PointFilter) ? FilterMode.Bilinear : FilterMode.Point);
6698 }
6699 }
6700 return _paintSprite;
6701 }
6702
6703 public void TryUnrestrain(bool force = false, Chara c = null)
6704 {
6705 if (!(GetRestrainer() == null || force))
6706 {
6707 return;
6708 }
6709 isRestrained = false;
6710 Say("unrestrained", this);
6711 if (this != c)
6712 {
6713 Talk("thanks");
6714 }
6715 MoveImmediate(pos.GetNearestPoint());
6716 renderer.SetFirst(first: true);
6717 if (c == null)
6718 {
6719 return;
6720 }
6721 if (c_rescueState == RescueState.WaitingForRescue)
6722 {
6723 c_rescueState = RescueState.Rescued;
6724 if (c.IsPC)
6725 {
6727 }
6728 }
6730 {
6731 return;
6732 }
6733 foreach (Chara item in c.pos.ListCharasInRadius(c, 5, (Chara _c) => _c.id == "fanatic" && _c.faith != Chara.faith))
6734 {
6735 c.DoHostileAction(item, immediate: true);
6736 }
6737 }
6738
6740 {
6741 foreach (Card item in pos.ListCards())
6742 {
6743 if (item.trait is TraitShackle && item.c_uidRefCard == uid)
6744 {
6745 return item.trait as TraitShackle;
6746 }
6747 }
6748 return null;
6749 }
6750
6751 public virtual void Tick()
6752 {
6753 }
6754
6755 public static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
6756 {
6757 int result = 0;
6758 if (row.id == 0)
6759 {
6760 return result;
6761 }
6762 result = row.value * mat.value / 100;
6763 if (result < 0)
6764 {
6765 result = 1;
6766 }
6767 return result;
6768 }
6769
6770 public Thing SetPriceFix(int a)
6771 {
6772 c_priceFix = a;
6773 return Thing;
6774 }
6775
6776 public int GetEquipValue()
6777 {
6778 return GetValue();
6779 }
6780
6781 public void SetSale(bool sale)
6782 {
6783 if (isSale != sale)
6784 {
6785 isSale = sale;
6786 if (isSale)
6787 {
6788 EClass._map.props.sales.Add(this);
6789 }
6790 else
6791 {
6792 EClass._map.props.sales.Remove(this);
6793 }
6794 }
6795 }
6796
6797 public int GetValue(PriceType priceType = PriceType.Default, bool sell = false)
6798 {
6799 int num = ((c_fixedValue == 0) ? trait.GetValue() : c_fixedValue);
6800 if (id == "plat" && !sell)
6801 {
6802 num = 10000;
6803 }
6804 if (num == 0)
6805 {
6806 return 0;
6807 }
6808 float num2 = num;
6809 if (priceType == PriceType.CopyShop)
6810 {
6811 num2 += (float)c_priceCopy * 0.2f;
6812 num2 = num2 * (float)Mathf.Max(150 + rarityLv, 150) / 100f;
6813 }
6814 else
6815 {
6816 num2 = num2 * (float)Mathf.Max(100 + rarityLv + Mathf.Min(QualityLv * 10, 200), 80) / 100f;
6817 }
6818 if (IsFood && !material.tag.Contains("food"))
6819 {
6820 num2 *= 0.5f;
6821 }
6822 float num3;
6823 if (IsEquipmentOrRangedOrAmmo || trait is TraitMod)
6824 {
6825 if (sell)
6826 {
6827 num2 *= 0.3f;
6828 }
6829 num3 = 2f;
6830 }
6831 else
6832 {
6833 num3 = 0.5f;
6834 }
6835 if (isReplica)
6836 {
6837 num2 *= 0.15f;
6838 }
6839 if (!IsUnique)
6840 {
6841 if (IsEquipmentOrRanged && rarity >= Rarity.Legendary)
6842 {
6843 num2 = Mathf.Max(num2, 1800f + num2 / 5f);
6844 }
6845 num2 = num2 * (100f + num3 * (float)(material.value - 100)) / 100f;
6846 if (IsEquipmentOrRanged)
6847 {
6848 int num4 = 0;
6849 foreach (Element value in elements.dict.Values)
6850 {
6851 num4 += value.source.value;
6852 }
6853 num2 = num2 * (float)(100 + (sell ? ((int)MathF.Sqrt(num4) * 10) : num4)) / 100f;
6854 if (rarity >= Rarity.Legendary)
6855 {
6856 num2 = Mathf.Max(num2, 3600f + num2 / 5f);
6857 }
6858 }
6859 }
6860 if (trait is TraitRecipe && sell)
6861 {
6862 num2 *= 0.1f;
6863 }
6864 if (encLV != 0 && !category.tag.Contains("noEnc"))
6865 {
6866 num2 = (category.tag.Contains("enc") ? (num2 * (0.7f + (float)(encLV - 1) * 0.2f)) : ((!IsFood) ? (num2 * (1f + (float)encLV * 0.01f)) : ((!(id == "honey")) ? (num2 * Mathf.Min(1f + 0.1f * (float)encLV, 2f) + (float)(encLV * 100)) : (num2 + (float)(encLV * 10)))));
6867 }
6868 if (tier > 0)
6869 {
6870 num2 *= (float)(tier + 1);
6871 }
6872 return (int)num2;
6873 }
6874
6875 public virtual int GetPrice(CurrencyType currency = CurrencyType.Money, bool sell = false, PriceType priceType = PriceType.Default, Chara c = null)
6876 {
6877 if (priceType == PriceType.CopyShop && sell)
6878 {
6879 return 0;
6880 }
6881 if (!sell)
6882 {
6883 if (id == "littleball")
6884 {
6885 return 0;
6886 }
6887 switch (currency)
6888 {
6889 case CurrencyType.Ecopo:
6890 {
6891 string text = id;
6892 if (!(text == "plat"))
6893 {
6894 if (!(text == "whip_egg"))
6895 {
6896 break;
6897 }
6898 return 3000;
6899 }
6900 return 500;
6901 }
6902 case CurrencyType.Plat:
6903 {
6904 string text = id;
6905 if (!(text == "lucky_coin"))
6906 {
6907 if (!(text == "book_skill"))
6908 {
6909 break;
6910 }
6911 return 50;
6912 }
6913 return 100;
6914 }
6915 case CurrencyType.Medal:
6916 switch (id)
6917 {
6918 case "bill_tax":
6919 return 3;
6920 case "water":
6921 return 3;
6922 case "bill":
6923 return 3;
6924 case "1165":
6925 return 10;
6926 case "diary_sister":
6927 return 12;
6928 case "diary_lady":
6929 return 25;
6930 case "diary_catsister":
6931 return 85;
6932 case "container_magic":
6933 return 20;
6934 case "wrench_tent_elec":
6935 return 3;
6936 case "wrench_tent_soil":
6937 return 3;
6938 case "wrench_bed":
6939 return 3;
6940 case "wrench_storage":
6941 return 4;
6942 case "wrench_fridge":
6943 return 15;
6944 case "wrench_extend_v":
6945 return 6;
6946 case "wrench_extend_h":
6947 return 6;
6948 case "monsterball":
6949 return LV / 8;
6950 }
6951 break;
6952 }
6953 }
6954 if (sell && noSell)
6955 {
6956 return 0;
6957 }
6958 if (!sell && id == "casino_coin")
6959 {
6960 return 20;
6961 }
6962 int value = GetValue(priceType, sell);
6963 if (value == 0)
6964 {
6965 return 0;
6966 }
6967 if (c == null)
6968 {
6969 c = EClass.pc;
6970 }
6971 double p = value;
6972 Trait trait = this.trait;
6973 if (!(trait is TraitBed))
6974 {
6975 if (trait is TraitContainer traitContainer)
6976 {
6977 p *= 1f + 4f * (float)(things.width - traitContainer.Width) + 4f * (float)(things.height - traitContainer.Height);
6978 }
6979 }
6980 else
6981 {
6982 p *= 1f + 0.5f * (float)c_containerSize;
6983 }
6984 p += c_priceAdd;
6985 if (c_priceFix != 0)
6986 {
6987 p = (int)((float)p * (float)Mathf.Clamp(100 + c_priceFix, 0, 1000000) / 100f);
6988 if (p == 0.0)
6989 {
6990 return 0;
6991 }
6992 }
6993 if (isStolen)
6994 {
6995 if (sell && priceType == PriceType.PlayerShop && EClass.Branch != null && EClass.Branch.policies.IsActive(2824))
6996 {
6997 p = p * 100.0 / (double)Mathf.Max(110f, 170f - Mathf.Sqrt(EClass.Branch.Evalue(2824) * 5));
6998 }
6999 else if (sell && Guild.Thief.IsMember)
7000 {
7001 p = Guild.Thief.SellStolenPrice((int)p);
7002 }
7003 else
7004 {
7005 p *= 0.5;
7006 }
7007 }
7008 if (!sell && category.id == "spellbook")
7009 {
7010 p = Guild.Mage.BuySpellbookPrice((int)p);
7011 }
7012 bool flag = priceType == PriceType.CopyShop;
7013 int num = ((!flag) ? 1 : 5);
7014 float num2 = Mathf.Min(0.01f * (float)Evalue(752), 1f);
7015 float num3 = Mathf.Min(0.01f * (float)Evalue(751), 1f);
7016 float num4 = Mathf.Min(0.02f * (float)Evalue(759), 2f);
7017 if (num3 > 0f)
7018 {
7019 num3 *= (float)num;
7020 }
7021 float num5 = Mathf.Clamp(1f + num2 + num3, 0.5f, 5f) + num4;
7022 p *= num5;
7023 p *= 0.20000000298023224;
7024 if (sell)
7025 {
7026 p *= 0.20000000298023224;
7027 if (isCopy)
7028 {
7029 p *= 0.20000000298023224;
7030 }
7031 if (currency == CurrencyType.Money && (category.IsChildOf("meal") || category.IsChildOf("preserved")))
7032 {
7033 p *= 0.5;
7034 }
7035 if ((uint)(priceType - 1) <= 1u)
7036 {
7037 if (category.IsChildOf("fish"))
7038 {
7039 p *= ((EClass.pc.faith == EClass.game.religions.Luck) ? 1.5f : 1f);
7040 }
7041 if (category.IsChildOf("vegi") || category.IsChildOf("fruit"))
7042 {
7043 p *= ((EClass.pc.faith == EClass.game.religions.Harvest) ? 3f : 2f);
7044 }
7045 }
7046 }
7047 if (id == "rod_wish")
7048 {
7049 p *= (sell ? 0.01f : 50f);
7050 }
7051 switch (currency)
7052 {
7053 case CurrencyType.Ecopo:
7054 if (this.trait is TraitSeed)
7055 {
7056 p *= 2.0;
7057 }
7058 else if (this.trait is TraitEcoMark)
7059 {
7060 p *= 1.0;
7061 }
7062 else
7063 {
7064 p *= 0.20000000298023224;
7065 }
7066 break;
7067 case CurrencyType.Casino_coin:
7068 p *= 0.10000000149011612;
7069 break;
7070 case CurrencyType.Influence:
7071 p *= 0.0020000000949949026;
7072 break;
7073 case CurrencyType.Medal:
7074 p *= 0.00019999999494757503;
7075 break;
7076 case CurrencyType.Money2:
7077 p *= 0.004999999888241291;
7078 break;
7079 default:
7080 if (IsIdentified || (this.trait is TraitErohon && !sell) || priceType == PriceType.Tourism)
7081 {
7082 if (blessedState == BlessedState.Blessed)
7083 {
7084 p *= 1.25;
7085 }
7086 else if (blessedState <= BlessedState.Cursed)
7087 {
7088 p *= (flag ? 1.25f : 0.3f);
7089 }
7090 if (this.trait.HasCharges)
7091 {
7092 p = p * 0.05000000074505806 + p * (double)(0.5f + Mathf.Clamp(0.1f * (float)c_charges, 0f, 1.5f));
7093 }
7094 if (IsDecayed)
7095 {
7096 p *= (flag ? 0.9f : 0.5f);
7097 }
7098 }
7099 else
7100 {
7101 Rand.UseSeed(uid, delegate
7102 {
7103 p = (sell ? (1 + EClass.rnd(15)) : (50 + EClass.rnd(500)));
7104 });
7105 }
7106 if (!sell)
7107 {
7108 p *= 1f + 0.2f * (float)c.Evalue(1406);
7109 }
7110 break;
7111 }
7112 float num6 = Math.Clamp(Mathf.Sqrt(c.EvalueMax(291) + ((!sell && EClass._zone.IsPCFaction) ? (EClass.Branch.Evalue(2800) * 2) : 0)), 0f, 25f);
7113 switch (priceType)
7114 {
7115 case PriceType.Tourism:
7116 num6 = 0f;
7117 break;
7118 case PriceType.Shipping:
7119 if (sell)
7120 {
7121 p *= 1.100000023841858;
7122 }
7123 break;
7124 case PriceType.PlayerShop:
7125 {
7126 if (!sell)
7127 {
7128 break;
7129 }
7130 float num7 = 1.25f;
7131 if (EClass.Branch != null)
7132 {
7133 if (EClass.Branch.policies.IsActive(2817))
7134 {
7135 num7 += 0.1f + 0.01f * Mathf.Sqrt(EClass.Branch.Evalue(2817));
7136 }
7137 if (EClass.Branch.policies.IsActive(2816))
7138 {
7139 num7 += 0.2f + 0.02f * Mathf.Sqrt(EClass.Branch.Evalue(2816));
7140 }
7141 if (isChara)
7142 {
7143 if (EClass.Branch.policies.IsActive(2828))
7144 {
7145 num7 += 0.1f + 0.01f * Mathf.Sqrt(EClass.Branch.Evalue(2828));
7146 }
7147 }
7148 else if (category.IsChildOf("food") || category.IsChildOf("drink"))
7149 {
7150 if (EClass.Branch.policies.IsActive(2818))
7151 {
7152 num7 += 0.05f + 0.005f * Mathf.Sqrt(EClass.Branch.Evalue(2818));
7153 }
7154 }
7155 else if (category.IsChildOf("furniture"))
7156 {
7157 if (EClass.Branch.policies.IsActive(2819))
7158 {
7159 num7 += 0.05f + 0.005f * Mathf.Sqrt(EClass.Branch.Evalue(2819));
7160 }
7161 }
7162 else if (EClass.Branch.policies.IsActive(2820))
7163 {
7164 num7 += 0.05f + 0.005f * Mathf.Sqrt(EClass.Branch.Evalue(2820));
7165 }
7166 }
7167 p *= num7;
7168 break;
7169 }
7170 }
7171 if ((uint)currency > 1u)
7172 {
7173 num6 = 0f;
7174 }
7175 p *= (sell ? (1f + num6 * 0.02f) : (1f - num6 * 0.02f));
7176 if (sell)
7177 {
7178 p = EClass.curve((int)p, 10000, 10000, 80);
7179 }
7180 if (p < 1.0)
7181 {
7182 p = ((!sell) ? 1 : 0);
7183 }
7184 if (!sell)
7185 {
7186 if (currency == CurrencyType.Casino_coin)
7187 {
7188 if (p > 100000.0)
7189 {
7190 p = Mathf.CeilToInt((float)p / 100000f) * 100000;
7191 }
7192 else if (p > 10000.0)
7193 {
7194 p = Mathf.CeilToInt((float)p / 10000f) * 10000;
7195 }
7196 else if (p > 1000.0)
7197 {
7198 p = Mathf.CeilToInt((float)p / 1000f) * 1000;
7199 }
7200 else if (p > 100.0)
7201 {
7202 p = Mathf.CeilToInt((float)p / 100f) * 100;
7203 }
7204 else if (p > 10.0)
7205 {
7206 p = Mathf.CeilToInt((float)p / 10f) * 10;
7207 }
7208 }
7209 if (this.trait is TraitDeed)
7210 {
7211 p *= Mathf.Pow(2f, EClass.player.flags.landDeedBought);
7212 }
7213 }
7214 if (p > (double)(sell ? 500000000 : 1000000000))
7215 {
7216 if (!sell)
7217 {
7218 return 1000000000;
7219 }
7220 return 500000000;
7221 }
7222 return (int)p;
7223 }
7224
7225 public virtual string GetHoverText()
7226 {
7227 return Name + GetExtraName();
7228 }
7229
7230 public virtual string GetHoverText2()
7231 {
7232 return "";
7233 }
7234
7235 public int Dist(Card c)
7236 {
7237 if (!IsMultisize && !c.IsMultisize)
7238 {
7239 return pos.Distance(c.pos);
7240 }
7241 if (IsMultisize)
7242 {
7243 int dist = 99;
7244 ForeachPoint(delegate(Point p, bool main)
7245 {
7246 int num2 = DistMulti(p, c);
7247 if (num2 < dist)
7248 {
7249 dist = num2;
7250 }
7251 });
7252 return dist;
7253 }
7254 return DistMulti(pos, c);
7255 static int DistMulti(Point p1, Card c)
7256 {
7257 if (!c.IsMultisize)
7258 {
7259 return p1.Distance(c.pos);
7260 }
7261 int dist2 = 99;
7262 c.ForeachPoint(delegate(Point p, bool main)
7263 {
7264 int num = p1.Distance(p);
7265 if (num < dist2)
7266 {
7267 dist2 = num;
7268 }
7269 });
7270 return dist2;
7271 }
7272 }
7273
7274 public int Dist(Point p)
7275 {
7276 return pos.Distance(p);
7277 }
7278
7279 public bool IsInMutterDistance(int d = 10)
7280 {
7281 return pos.Distance(EClass.pc.pos) < d;
7282 }
7283
7284 public void SetCensored(bool enable)
7285 {
7286 isCensored = enable;
7288 {
7289 isCensored = false;
7290 }
7291 renderer.SetCensored(isCensored);
7292 }
7293
7294 public void SetDeconstruct(bool deconstruct)
7295 {
7296 if (isDeconstructing != deconstruct)
7297 {
7298 if (deconstruct)
7299 {
7300 EClass._map.props.deconstructing.Add(this);
7301 }
7302 else
7303 {
7304 EClass._map.props.deconstructing.Remove(this);
7305 }
7306 isDeconstructing = deconstruct;
7307 }
7308 }
7309
7310 public virtual bool MatchEncSearch(string s)
7311 {
7312 return false;
7313 }
7314
7316 {
7317 switch (m)
7318 {
7319 case UIList.SortMode.ByEquip:
7320 sortVal = ((c_equippedSlot == 0) ? (category.sortVal * 1000) : 0);
7321 break;
7322 case UIList.SortMode.ByValue:
7323 sortVal = -GetPrice(currency) * 1000;
7324 break;
7325 case UIList.SortMode.ByNumber:
7326 sortVal = -Num * 1000;
7327 break;
7328 case UIList.SortMode.ByCategory:
7329 sortVal = category.sortVal * 1000;
7330 break;
7331 case UIList.SortMode.ByWeight:
7332 sortVal = -ChildrenAndSelfWeight * 1000;
7333 break;
7334 case UIList.SortMode.ByWeightSingle:
7335 sortVal = -ChildrenAndSelfWeightSingle * 1000;
7336 break;
7337 case UIList.SortMode.ByPrice:
7338 sortVal = -GetPrice(currency) * 1000;
7339 break;
7340 default:
7341 sortVal = sourceCard._index * 1000;
7342 break;
7343 }
7344 }
7345
7346 public virtual int SecondaryCompare(UIList.SortMode m, Card c)
7347 {
7348 int num = 0;
7349 if (num == 0)
7350 {
7351 num = id.CompareTo(c.id);
7352 }
7353 if (num == 0)
7354 {
7355 num = trait.CompareTo(c);
7356 }
7357 if (num == 0)
7358 {
7359 num = Lang.comparer.Compare(GetName(NameStyle.Full, 1), c.GetName(NameStyle.Full, 1));
7360 }
7361 if (num == 0)
7362 {
7363 num = refVal - c.refVal;
7364 }
7365 if (num == 0)
7366 {
7367 num = c_charges - c.c_charges;
7368 }
7369 if (num == 0)
7370 {
7371 num = encLV - c.encLV;
7372 }
7373 if (num == 0)
7374 {
7375 num = Num - c.Num;
7376 }
7377 if (num == 0)
7378 {
7379 num = uid - c.uid;
7380 }
7381 return num;
7382 }
7383
7384 public void ForeachFOV(Func<Point, bool> func)
7385 {
7386 if (fov == null)
7387 {
7388 return;
7389 }
7390 foreach (KeyValuePair<int, byte> lastPoint in fov.lastPoints)
7391 {
7392 Point arg = new Point().Set(lastPoint.Key);
7393 if (func(arg))
7394 {
7395 break;
7396 }
7397 }
7398 }
7399
7400 public void ForeachPoint(Action<Point, bool> action)
7401 {
7402 if (IsMultisize)
7403 {
7404 pos.ForeachMultiSize(W, H, action);
7405 }
7406 else
7407 {
7408 action(pos, arg2: true);
7409 }
7410 }
7411
7412 public void OnInspect()
7413 {
7414 }
7415
7416 public virtual void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
7417 {
7418 }
7419
7420 public void Inspect()
7421 {
7422 SE.Play("pop_paper");
7423 if (isChara)
7424 {
7425 LayerChara layerChara = EClass.ui.AddLayerDontCloseOthers<LayerChara>();
7426 layerChara.windows[0].SetRect(EClass.core.refs.rects.center);
7427 layerChara.SetChara(Chara);
7428 }
7429 else
7430 {
7431 EClass.ui.AddLayerDontCloseOthers<LayerInfo>().SetThing(Thing);
7432 }
7433 }
7434
7435 public virtual bool HasCondition<T>() where T : Condition
7436 {
7437 return false;
7438 }
7439
7440 public bool HaveFur()
7441 {
7442 if (!isChara)
7443 {
7444 return false;
7445 }
7446 string text = id;
7447 if (text == "putty_snow" || text == "putty_snow_gold")
7448 {
7449 return true;
7450 }
7451 return !Chara.race.fur.IsEmpty();
7452 }
7453
7454 public bool CanBeSheared()
7455 {
7457 {
7458 return false;
7459 }
7460 if (!HaveFur() || c_fur < 0)
7461 {
7462 return false;
7463 }
7464 return true;
7465 }
7466}
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
AttackStyle
Definition: AttackStyle.cs:2
BedType
Definition: BedType.cs:2
BlessedState
Definition: BlessedState.cs:2
BossType
Definition: BossType.cs:2
CTAG
Definition: CTAG.cs:2
@ currency
ConditionType
Definition: ConditionType.cs:2
CureType
Definition: CureType.cs:2
CurrencyType
Definition: CurrencyType.cs:2
EditorTag
Definition: EditorTag.cs:2
EffectDead
Definition: EffectDead.cs:2
EffectId
Definition: EffectId.cs:2
@ ChangeMaterial
Emo
Definition: Emo.cs:2
@ harvest
HealSource
Definition: HealSource.cs:2
HitResult
Definition: HitResult.cs:2
Hostility
Definition: Hostility.cs:2
MinionType
Definition: MinionType.cs:2
NameStyle
Definition: NameStyle.cs:2
PeriodOfDay
Definition: PeriodOfDay.cs:2
PlaceState
Definition: PlaceState.cs:2
PriceType
Definition: PriceType.cs:2
Rarity
Definition: Rarity.cs:2
RescueState
Definition: RescueState.cs:2
SourceValueType
ThrowType
Definition: ThrowType.cs:2
ToggleType
Definition: ToggleType.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
VisitorState
Definition: VisitorState.cs:2
Definition: AIAct.cs:6
AIAct Current
Definition: AIAct.cs:103
bool TryCancel(Card c)
Definition: AIAct.cs:266
virtual bool IsRunning
Definition: AIAct.cs:31
virtual Status Cancel()
Definition: AIAct.cs:291
virtual bool CancelWhenDamaged
Definition: AIAct.cs:94
static bool ignoreDamage
Definition: AI_PlayMusic.cs:14
static bool slaughtering
Definition: AI_Slaughter.cs:6
static void TryDelay(Action a)
Definition: ActEffect.cs:23
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:830
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:407
void Add(Act a, string s="")
Definition: ActPlan.cs:11
Definition: ACT.cs:62
static Act CurrentAct
Definition: ACT.cs:89
virtual bool IsRoofEditMode(Card c=null)
Definition: ActionMode.cs:311
int value
Definition: Affinity.cs:26
Definition: Area.cs:4
virtual void OnInstallCard(Card t)
Definition: Area.cs:59
virtual void OnUninstallCard(Card t)
Definition: Area.cs:63
static void GakiConvert(ref string text, string idLang="zako")
Dictionary< int, int > mapInt
Definition: BaseCard.cs:10
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
void SetObj(int id, object o)
Definition: BaseCard.cs:91
string GetStr(int id, string defaultStr=null)
Definition: BaseCard.cs:54
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
Dictionary< int, string > mapStr
Definition: BaseCard.cs:13
void Mod(int a, bool force=false)
SourceElement.Row sourceElement
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
List< Action > actionsNextFrame
Definition: BaseCore.cs:31
Version version
Definition: BaseCore.cs:17
ScreenGuide guide
BaseTileMap tileMap
virtual void RefreshPosition()
virtual ConditionType Type
Definition: BaseStats.cs:19
static int GetColorInt(ref Color matColor, int p)
void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h=0, int altitude=0, int dirWall=-1, bool ignoreAltitudeY=false)
Vector3 GetThingPosition(Card tg, Point p)
void SetGender(int g)
Definition: Biography.cs:454
void SetPortrait(Chara c)
Definition: Biography.cs:463
Card card
Definition: ButtonGrid.cs:24
virtual void RefreshSprite()
Definition: CardActor.cs:224
static void Set(CardBlueprint _bp)
static CardBlueprint current
bool tryLevelMatTier
static CardBlueprint _Default
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void AssignUID(Card c)
Definition: CardManager.cs:78
void ShowEmo(Emo emo, float duration=0f)
void PlayAnime(AnimeID id, bool force)
virtual void KillAnime()
override void Draw(RenderParam p)
Definition: CardRenderer.cs:49
Vector3 position
Definition: CardRenderer.cs:21
void RefreshSprite()
virtual void SetOwner(Card c)
Definition: CardRenderer.cs:38
virtual void SetFirst(bool first, Vector3 pos)
CardActor actor
Definition: CardRenderer.cs:11
void KillActor()
void SetCensored(bool enable)
string[] idActor
Definition: CardRow.cs:35
Card model
Definition: CardRow.cs:60
int quality
Definition: CardRow.cs:19
CardRow origin
Definition: CardRow.cs:49
string[] trait
Definition: CardRow.cs:33
string _origin
Definition: CardRow.cs:15
string id
Definition: CardRow.cs:7
string tierGroup
Definition: CardRow.cs:11
string lightData
Definition: CardRow.cs:13
string[] loot
Definition: CardRow.cs:29
Definition: Card.cs:11
float angle
Definition: Card.cs:67
bool IsNegativeGift
Definition: Card.cs:2332
CharaList c_charaList
Definition: Card.cs:1853
void SetTier(int a, bool setTraits=true)
Definition: Card.cs:3714
bool isDestroyed
Definition: Card.cs:71
MinionType c_minionType
Definition: Card.cs:960
int FameLv
Definition: Card.cs:2234
int c_priceFix
Definition: Card.cs:1109
void ModExp(int ele, int a)
Definition: Card.cs:2589
virtual string AliasMaterialOnCreate
Definition: Card.cs:1989
Props props
Definition: Card.cs:47
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2551
int DMG
Definition: Card.cs:2267
bool IsPCFactionOrMinion
Definition: Card.cs:2208
int GetBestAttribute()
Definition: Card.cs:2566
bool isCrafted
Definition: Card.cs:778
virtual MoveResult _Move(Point p, MoveType type=MoveType.Walk)
Definition: Card.cs:5469
virtual string GetHoverText()
Definition: Card.cs:7225
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5505
string ReferenceId()
Definition: Card.cs:2655
virtual string GetExtraName()
Definition: Card.cs:2556
ContainerUpgrade c_containerUpgrade
Definition: Card.cs:1829
bool CanAddRune(SourceElement.Row row)
Definition: Card.cs:3521
virtual bool IsMultisize
Definition: Card.cs:2094
void PurgeDuplicateArtifact(Thing af)
Definition: Card.cs:3138
BitArray32 _bits1
Definition: Card.cs:75
int tier
Definition: Card.cs:394
void RemoveEditorTag(EditorTag tag)
Definition: Card.cs:2546
void ApplySocket(int id, int lv, Card mod=null)
Definition: Card.cs:3419
bool IsDecayed
Definition: Card.cs:2223
string c_idPortrait
Definition: Card.cs:1457
virtual bool IsPCC
Definition: Card.cs:2083
virtual int PV
Definition: Card.cs:2263
virtual bool isThing
Definition: Card.cs:2017
bool IsAmmo
Definition: Card.cs:2183
bool IsVariation
Definition: Card.cs:2259
SocketData AddRune(Card rune)
Definition: Card.cs:3459
string c_note
Definition: Card.cs:1721
bool isImported
Definition: Card.cs:598
bool IsImportant
Definition: Card.cs:2041
bool isSummon
Definition: Card.cs:694
void MakeRefFrom(string id)
Definition: Card.cs:5386
bool HasRune()
Definition: Card.cs:3576
bool isElemental
Definition: Card.cs:706
void Say(string lang, Card c1, Card c2, string ref1=null, string ref2=null)
Definition: Card.cs:6432
int idMaterial
Definition: Card.cs:130
virtual Chara Chara
Definition: Card.cs:2006
int version
Definition: Card.cs:406
virtual void ApplyMaterialElements(bool remove)
Definition: Card.cs:2948
int posInvY
Definition: Card.cs:334
int INT
Definition: Card.cs:2285
Thing Split(int a)
Definition: Card.cs:3345
virtual void OnSimulateHour(VirtualDate date)
Definition: Card.cs:6197
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2521
bool IsAgent
Definition: Card.cs:2185
bool isMasked
Definition: Card.cs:574
void MakeFigureFrom(string id)
Definition: Card.cs:5381
int c_idMainElement
Definition: Card.cs:1373
void SetPlaceState(PlaceState newState, bool byPlayer=false)
Definition: Card.cs:3596
void AddSocket()
Definition: Card.cs:3402
void SetCensored(bool enable)
Definition: Card.cs:7284
ElementContainerCard elements
Definition: Card.cs:37
int END
Definition: Card.cs:2273
CardRow refCard
Definition: Card.cs:1903
void _OnDeserialized(StreamingContext context)
Definition: Card.cs:2628
bool c_wasInPcParty
Definition: Card.cs:984
int c_ammo
Definition: Card.cs:1421
bool IsFresn
Definition: Card.cs:2227
string id
Definition: Card.cs:31
float GetLightPower()
Definition: Card.cs:6007
int ChildrenWeight
Definition: Card.cs:1949
bool isNPCProperty
Definition: Card.cs:538
virtual void SetSource()
Definition: Card.cs:2771
int GetSightRadius()
Definition: Card.cs:6021
bool IsUnique
Definition: Card.cs:2027
bool IsRestrainedResident
Definition: Card.cs:2194
int c_equippedSlot
Definition: Card.cs:924
SourceBacker.Row sourceBacker
Definition: Card.cs:900
bool TryReserve(AIAct act)
Definition: Card.cs:2437
Hostility c_originalHostility
Definition: Card.cs:948
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3908
bool isFloating
Definition: Card.cs:634
int _childrenWeight
Definition: Card.cs:83
bool isSubsetCard
Definition: Card.cs:730
Thing AddThing(Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
Definition: Card.cs:3025
void PlaySoundHold(bool spatial=true)
Definition: Card.cs:5756
bool HasElement(int ele, int req=1)
Definition: Card.cs:5566
bool IsInheritFoodTraits
Definition: Card.cs:2114
ICardParent GetRoot()
Definition: Card.cs:3278
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5601
virtual bool IsMoving
Definition: Card.cs:2049
bool isRoofItem
Definition: Card.cs:562
void SetRandomLightColors()
Definition: Card.cs:6137
bool isRestrained
Definition: Card.cs:550
bool c_lockedHard
Definition: Card.cs:1008
CardRenderer HostRenderer
Definition: Card.cs:2378
virtual bool IsDisabled
Definition: Card.cs:2047
bool IsThrownWeapon
Definition: Card.cs:2181
bool isLostProperty
Definition: Card.cs:790
string TextRarity
Definition: Card.cs:2315
int ExpToNext
Definition: Card.cs:1944
void OnChildNumChange(Card c)
Definition: Card.cs:3581
int Evalue(int ele, bool ignoreGlobalElement)
Definition: Card.cs:2512
bool IsStackable(Thing tg)
Definition: Card.cs:3296
bool HasElement(string id, int req=1)
Definition: Card.cs:5571
float fy
Definition: Card.cs:250
void Explode(Point p, Card origin)
Definition: Card.cs:4767
bool noSell
Definition: Card.cs:814
bool isCensored
Definition: Card.cs:418
bool CanInspect
Definition: Card.cs:2406
CardBlueprint bp
Definition: Card.cs:73
virtual int Power
Definition: Card.cs:2231
int Evalue(string alias)
Definition: Card.cs:2526
SourceMaterial.Row DyeMat
Definition: Card.cs:1876
bool isBroken
Definition: Card.cs:718
int PER
Definition: Card.cs:2275
SourceMaterial.Row material
Definition: Card.cs:1987
bool IsRotting
Definition: Card.cs:2225
int c_summonDuration
Definition: Card.cs:1385
int c_indexContainerIcon
Definition: Card.cs:1361
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5776
string c_idDeity
Definition: Card.cs:1541
int c_invest
Definition: Card.cs:1265
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:2957
int HIT
Definition: Card.cs:2265
string c_extraNameRef
Definition: Card.cs:1577
bool isCopy
Definition: Card.cs:862
string c_idTrait
Definition: Card.cs:1685
string c_altName
Definition: Card.cs:1553
string TryGetFoodName(Card c)
Definition: Card.cs:5352
int c_weight
Definition: Card.cs:1337
string ApplyNewLine(string text)
Definition: Card.cs:6390
virtual void LookAt(Point p)
Definition: Card.cs:5847
void ClampInitialSkill()
Definition: Card.cs:2858
Thing Tool
Definition: Card.cs:2346
bool isRestocking
Definition: Card.cs:874
string NameOne
Definition: Card.cs:2077
string InspectName
Definition: Card.cs:2417
string c_idJob
Definition: Card.cs:1481
virtual SourceMaterial.Row DefaultMaterial
Definition: Card.cs:2357
int c_priceAdd
Definition: Card.cs:1121
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:6875
virtual void HealHPHost(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3832
Thing ammoData
Definition: Card.cs:1745
bool IsExcludeFromCraft()
Definition: Card.cs:2465
virtual bool IsPCParty
Definition: Card.cs:2085
virtual void SetDir(int d)
Definition: Card.cs:5832
int c_lockLv
Definition: Card.cs:936
bool ignoreAutoPick
Definition: Card.cs:490
int GetEquipValue()
Definition: Card.cs:6776
BitArray32 _bits2
Definition: Card.cs:77
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3848
virtual int SelfWeight
Definition: Card.cs:1981
int c_uidRefCard
Definition: Card.cs:1096
bool IsEquipmentOrRangedOrAmmo
Definition: Card.cs:2166
int DefaultLV
Definition: Card.cs:1946
Fov fov
Definition: Card.cs:53
int GetAffinityExpBonus()
Definition: Card.cs:2895
int c_dyeMat
Definition: Card.cs:1157
void Say(string lang, Card c1, string ref1=null, string ref2=null)
Definition: Card.cs:6441
Card AddCard(Card c)
Definition: Card.cs:3006
int invY
Definition: Card.cs:1891
Point InspectPoint
Definition: Card.cs:2419
static int GetTilePrice(TileRow row, SourceMaterial.Row mat)
Definition: Card.cs:6755
string c_refText
Definition: Card.cs:1589
bool IsMale
Definition: Card.cs:2320
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:5594
bool IsCursed
Definition: Card.cs:2191
int c_dateCooked
Definition: Card.cs:1313
bool isSale
Definition: Card.cs:850
void CalculateFOV()
Definition: Card.cs:6100
int c_uidMaster
Definition: Card.cs:1409
int c_dateDeathLock
Definition: Card.cs:1217
Biography bio
Definition: Card.cs:40
int c_fixedValue
Definition: Card.cs:1145
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3020
virtual bool MatchEncSearch(string s)
Definition: Card.cs:7310
void SetCharge(int a)
Definition: Card.cs:3789
virtual string GetDetail()
Definition: Card.cs:2561
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6326
Card SetLv(int a)
Definition: Card.cs:2821
int hp
Definition: Card.cs:226
Rarity rarity
Definition: Card.cs:298
int c_vomit
Definition: Card.cs:972
float fx
Definition: Card.cs:238
string Name
Definition: Card.cs:2073
void SetRandomTone()
Definition: Card.cs:6536
void PlaySoundImpact(bool spatial=true)
Definition: Card.cs:5766
int c_seed
Definition: Card.cs:1277
bool IsRangedWeapon
Definition: Card.cs:2179
const int MaxWeight
Definition: Card.cs:25
virtual string actorPrefab
Definition: Card.cs:2065
int CHA
Definition: Card.cs:2283
virtual int DV
Definition: Card.cs:2261
ICardParent parent
Definition: Card.cs:51
bool ExistsOnMap
Definition: Card.cs:2021
bool dirtyWeight
Definition: Card.cs:81
bool hasSpawned
Definition: Card.cs:886
void EjectSockets()
Definition: Card.cs:3437
virtual void OnBeforeCreate()
Definition: Card.cs:2763
bool IsHotItem
Definition: Card.cs:115
void NotifyAddThing(Thing t, int num)
Definition: Card.cs:3016
virtual int WeightLimit
Definition: Card.cs:1983
Sprite GetPaintSprite()
Definition: Card.cs:6686
virtual bool IsMinion
Definition: Card.cs:2087
bool c_isPrayed
Definition: Card.cs:1044
bool c_revealLock
Definition: Card.cs:1020
void AddEditorTag(EditorTag tag)
Definition: Card.cs:2541
string c_idAbility
Definition: Card.cs:1625
virtual string GetHoverText2()
Definition: Card.cs:7230
void ApplySocket(Thing t)
Definition: Card.cs:3411
string c_idTone
Definition: Card.cs:1493
virtual bool IsDeadOrSleeping
Definition: Card.cs:2045
Thing SetNum(int a)
Definition: Card.cs:3356
int c_priceCopy
Definition: Card.cs:1133
int GetCurrency(string id="money")
Definition: Card.cs:3820
void SetReplica(bool on)
Definition: Card.cs:2991
void ForeachPoint(Action< Point, bool > action)
Definition: Card.cs:7400
void Dye(SourceMaterial.Row mat)
Definition: Card.cs:5637
void Deconstruct()
Definition: Card.cs:4777
virtual bool IsPCPartyMinion
Definition: Card.cs:2089
string c_idSpriteReplacer
Definition: Card.cs:1517
void DamageHP(int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null)
Definition: Card.cs:3913
SourceMaterial.Row _material
Definition: Card.cs:87
bool HasLight()
Definition: Card.cs:6002
virtual void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
Definition: Card.cs:4716
int decay
Definition: Card.cs:202
Thing GiveBirth(Thing t, bool effect)
Definition: Card.cs:5443
CardRow refCard2
Definition: Card.cs:1924
string c_altName2
Definition: Card.cs:1565
Thing parentThing
Definition: Card.cs:101
virtual Sprite GetImageSprite()
Definition: Card.cs:5722
int LER
Definition: Card.cs:2277
void MakeRefFrom(Card c1, Card c2=null)
Definition: Card.cs:5391
Sprite _paintSprite
Definition: Card.cs:95
bool autoRefuel
Definition: Card.cs:610
bool IsFurniture
Definition: Card.cs:2187
virtual void ApplyMaterial(bool remove=false)
Definition: Card.cs:2952
bool IsFood
Definition: Card.cs:2111
Fov CreateFov()
Definition: Card.cs:6142
PlaceState placeState
Definition: Card.cs:79
CharaUpgrade c_upgrades
Definition: Card.cs:1793
void ChangeAltitude(int a)
Definition: Card.cs:5882
List< SocketData > socketList
Definition: Card.cs:1757
int c_IDTState
Definition: Card.cs:1229
bool HasContainerSize
Definition: Card.cs:2343
void PlayAnime(AnimeID id, Point dest, bool force=false)
Definition: Card.cs:5800
int c_daysWithGod
Definition: Card.cs:1433
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3740
int WIL
Definition: Card.cs:2279
RenderParam GetRenderParam()
Definition: Card.cs:5613
virtual SourcePref Pref
Definition: Card.cs:2043
bool isAcidproof
Definition: Card.cs:670
void RecalculateFOV()
Definition: Card.cs:5988
bool IsToolbelt
Definition: Card.cs:2105
int MaxRune()
Definition: Card.cs:3516
string c_idEditor
Definition: Card.cs:1649
int STR
Definition: Card.cs:2269
string c_idRace
Definition: Card.cs:1469
bool HasTalk(string idTopic)
Definition: Card.cs:6321
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
Definition: Card.cs:6450
bool HasTag(CTAG tag)
Definition: Card.cs:2531
Point pos
Definition: Card.cs:55
int DEX
Definition: Card.cs:2271
void DecayNatural(int hour=1)
Definition: Card.cs:6206
bool IsInMutterDistance(int d=10)
Definition: Card.cs:7279
virtual void OnCreate(int genLv)
Definition: Card.cs:2767
void DyeRandom()
Definition: Card.cs:5627
string c_editorTags
Definition: Card.cs:1661
void SetDirtyWeight()
Definition: Card.cs:2490
virtual void LookAt(Card c)
Definition: Card.cs:5843
LightData _LightData
Definition: Card.cs:93
void Decay(int a=10)
Definition: Card.cs:6238
void RenderMarker(Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
Definition: Card.cs:5924
int sortVal
Definition: Card.cs:97
void MakeFoodRef(Card c1, Card c2=null)
Definition: Card.cs:5301
string c_idRefCard2
Definition: Card.cs:1709
int LUC
Definition: Card.cs:2287
int c_containerSize
Definition: Card.cs:1325
void ClearFOV()
Definition: Card.cs:6189
int c_lightColor
Definition: Card.cs:1068
static Color _randColor
Definition: Card.cs:89
virtual void OnDeserialized()
Definition: Card.cs:2651
void _OnSerializing(StreamingContext context)
Definition: Card.cs:2612
virtual CardRow sourceRenderCard
Definition: Card.cs:2069
int ChildrenAndSelfWeightSingle
Definition: Card.cs:1979
int[] _ints
Definition: Card.cs:28
void SetPaintData()
Definition: Card.cs:6644
int uid
Definition: Card.cs:118
virtual void SetRenderParam(RenderParam p)
Definition: Card.cs:5623
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5810
bool IsEquipmentOrRanged
Definition: Card.cs:2154
int Quality
Definition: Card.cs:2361
virtual int ApplyProtection(int dmg, int mod=100)
Definition: Card.cs:3883
void Dye(string idMat)
Definition: Card.cs:5632
virtual SubPassData GetSubPassData()
Definition: Card.cs:5895
List< int > c_corruptionHistory
Definition: Card.cs:1817
override string ToString()
Definition: Card.cs:2423
void TryStack(Thing t)
Definition: Card.cs:6582
int refVal
Definition: Card.cs:190
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:5744
void ApplyTrait()
Definition: Card.cs:2800
void OnInspect()
Definition: Card.cs:7412
virtual Sprite GetSprite(int dir=0)
Definition: Card.cs:5713
string c_context
Definition: Card.cs:1637
Trait trait
Definition: Card.cs:49
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2452
virtual int MaxDecay
Definition: Card.cs:2221
void ModCurrency(int a, string id="money")
Definition: Card.cs:3806
bool IsPowerful
Definition: Card.cs:2030
string c_idTalk
Definition: Card.cs:1529
static string ApplyTone(Chara c, ref string text, string _tones, int gender, bool stripPun=false)
Definition: Card.cs:6475
bool ShouldTrySetDirtyInventory()
Definition: Card.cs:3240
void LevelUp()
Definition: Card.cs:2909
string c_idRidePCC
Definition: Card.cs:1613
virtual void ApplyEditorTags(EditorTag tag)
Definition: Card.cs:2775
int encLV
Definition: Card.cs:310
int altitude
Definition: Card.cs:214
int c_diceDim
Definition: Card.cs:1349
bool IsEquipment
Definition: Card.cs:2109
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2063
int c_allowance
Definition: Card.cs:1289
bool isDeconstructing
Definition: Card.cs:430
MoveType
Definition: Card.cs:20
bool disableAutoToggle
Definition: Card.cs:586
virtual int[] Tiles
Definition: Card.cs:2245
Thing MakeMilk(bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
Definition: Card.cs:5419
CardRow hat
Definition: Card.cs:59
virtual int SecondaryCompare(UIList.SortMode m, Card c)
Definition: Card.cs:7346
virtual void OnLand()
Definition: Card.cs:5547
int exp
Definition: Card.cs:382
void RemoveBacker()
Definition: Card.cs:6635
CharaGenes c_genes
Definition: Card.cs:1805
virtual int MaxHP
Definition: Card.cs:2229
void ChangeWeight(int a)
Definition: Card.cs:2500
void ModEncLv(int a)
Definition: Card.cs:3691
void RemoveThing(Thing thing)
Definition: Card.cs:3179
void SetEncLv(int a)
Definition: Card.cs:3709
Card MakeFoodFrom(string _id)
Definition: Card.cs:5195
SocketData GetRuneEnc(int idEle)
Definition: Card.cs:3485
int c_dateStockExpire
Definition: Card.cs:1205
void PlaySoundDead(bool spatial=true)
Definition: Card.cs:5771
int c_idBacker
Definition: Card.cs:1397
bool CanBeSheared()
Definition: Card.cs:7454
float roundTimer
Definition: Card.cs:65
bool TryPay(int a, string id="money")
Definition: Card.cs:3770
void SayNothingHappans()
Definition: Card.cs:6418
void ModCharge(int a, bool destroy=false)
Definition: Card.cs:3795
bool isDyed
Definition: Card.cs:442
bool isNew
Definition: Card.cs:466
void PlayAnimeLoot()
Definition: Card.cs:5805
int MAG
Definition: Card.cs:2281
bool isWeightChanged
Definition: Card.cs:646
void Destroy()
Definition: Card.cs:4783
bool HasGlobalElement(int ele)
Definition: Card.cs:5576
int feat
Definition: Card.cs:358
bool c_isImportant
Definition: Card.cs:996
MoveResult
Definition: Card.cs:13
bool noMove
Definition: Card.cs:754
bool HaveFur()
Definition: Card.cs:7440
bool HasEditorTag(EditorTag tag)
Definition: Card.cs:2536
Card ChangeMaterial(string idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:2962
ThingContainer things
Definition: Card.cs:34
BossType c_bossType
Definition: Card.cs:1193
bool HasCraftBonusTrait()
Definition: Card.cs:6561
bool IsInstalled
Definition: Card.cs:2317
virtual void Rotate(bool reverse=false)
Definition: Card.cs:5851
virtual bool IsPC
Definition: Card.cs:2079
int GetExpMtp()
Definition: Card.cs:2877
int c_daysWithPC
Definition: Card.cs:1445
bool IsMeleeWeapon
Definition: Card.cs:2177
string c_color
Definition: Card.cs:1505
Card SetHidden(bool hide=true)
Definition: Card.cs:5462
string NameSimple
Definition: Card.cs:2075
void SetSale(bool sale)
Definition: Card.cs:6781
bool isFireproof
Definition: Card.cs:658
void SetRandomTalk()
Definition: Card.cs:6527
bool IsChildOf(Card c)
Definition: Card.cs:2597
int rarityLv
Definition: Card.cs:286
void SetFreePos(Point point)
Definition: Card.cs:5900
virtual bool isChara
Definition: Card.cs:2019
int GetDaysTogetherBonus()
Definition: Card.cs:2900
void RefreshColor()
Definition: Card.cs:5644
virtual Thing Thing
Definition: Card.cs:1994
BedType c_bedType
Definition: Card.cs:912
int CountRune()
Definition: Card.cs:3500
int turn
Definition: Card.cs:61
Card GetRootCard()
Definition: Card.cs:3287
virtual void SetImage(Image image)
Definition: Card.cs:5732
int Evalue(int ele)
Definition: Card.cs:2507
virtual bool CanStackTo(Thing to)
Definition: Card.cs:3253
int Dist(Card c)
Definition: Card.cs:7235
SocketData AddRune(int idEle, int v)
Definition: Card.cs:3464
TraitShackle GetRestrainer()
Definition: Card.cs:6739
Thing SetNoSell()
Definition: Card.cs:3370
int c_bill
Definition: Card.cs:1253
void Mod()
Definition: Card.cs:2447
void CheckJustCooked()
Definition: Card.cs:6229
byte[] c_textureData
Definition: Card.cs:1865
virtual void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
Definition: Card.cs:7416
int colorInt
Definition: Card.cs:104
int invX
Definition: Card.cs:1879
bool isHidden
Definition: Card.cs:514
int idSkin
Definition: Card.cs:346
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5479
Thing TryMakeRandomItem(int lv=-1)
Definition: Card.cs:5138
bool CanReserve(AIAct act)
Definition: Card.cs:2428
bool isOn
Definition: Card.cs:526
virtual void OnSerializing()
Definition: Card.cs:2623
Thing SetPriceFix(int a)
Definition: Card.cs:6770
virtual bool IsPCFaction
Definition: Card.cs:2205
Window.SaveData c_windowSaveData
Definition: Card.cs:1781
bool isGifted
Definition: Card.cs:766
int ResistLv(int res)
Definition: Card.cs:5561
bool IsLightsource
Definition: Card.cs:2107
bool isPlayerCreation
Definition: Card.cs:478
int _z
Definition: Card.cs:178
virtual bool HasHost
Definition: Card.cs:2359
BlessedState blessedState
Definition: Card.cs:262
int H
Definition: Card.cs:2302
Thing Duplicate(int num)
Definition: Card.cs:3305
int _colorInt
Definition: Card.cs:63
virtual int PrefIndex
Definition: Card.cs:2248
bool isStolen
Definition: Card.cs:838
virtual bool IsGlobal
Definition: Card.cs:2219
void PlaySoundDrop(bool spatial=true)
Definition: Card.cs:5761
PlaceState _placeState
Definition: Card.cs:274
ref Color GetRandomColor()
Definition: Card.cs:5686
int dir
Definition: Card.cs:142
int c_uidZone
Definition: Card.cs:1083
int W
Definition: Card.cs:2290
bool TryStackTo(Thing to)
Definition: Card.cs:3258
virtual bool IsPCFactionMinion
Definition: Card.cs:2091
bool IsBlessed
Definition: Card.cs:2189
Card Install()
Definition: Card.cs:3590
void ApplyBacker(int bid)
Definition: Card.cs:6599
Thing c_copyContainer
Definition: Card.cs:1769
bool ShouldShowMsg
Definition: Card.cs:2390
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:6703
Card parentCard
Definition: Card.cs:99
bool c_isDisableStockUse
Definition: Card.cs:1056
RescueState c_rescueState
Definition: Card.cs:1181
Emo lastEmo
Definition: Card.cs:91
bool noSnow
Definition: Card.cs:742
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5727
virtual CardRow sourceCard
Definition: Card.cs:2067
void ModExp(string alias, int a)
Definition: Card.cs:2584
List< Element > ListCraftBonusTraits()
Definition: Card.cs:6566
string c_idRefName
Definition: Card.cs:1601
void SetRandomDir()
Definition: Card.cs:5838
bool noShadow
Definition: Card.cs:802
int GetLightRadius()
Definition: Card.cs:6030
DNA c_DNA
Definition: Card.cs:1841
int ChildrenAndSelfWeight
Definition: Card.cs:1977
int GetTotalQuality(bool applyBonus=true)
Definition: Card.cs:3681
bool isModified
Definition: Card.cs:454
float animeCounter
Definition: Card.cs:69
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:2997
virtual void Tick()
Definition: Card.cs:6751
int Num
Definition: Card.cs:154
int _x
Definition: Card.cs:166
Color LightColor
Definition: Card.cs:1080
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:5795
SourceCategory.Row category
Definition: Card.cs:1985
void SetDeconstruct(bool deconstruct)
Definition: Card.cs:7294
bool c_isTrained
Definition: Card.cs:1032
int posInvX
Definition: Card.cs:322
void Inspect()
Definition: Card.cs:7420
virtual void SetSortVal(UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
Definition: Card.cs:7315
byte[] GetPaintData()
Definition: Card.cs:6658
UniqueData c_uniqueData
Definition: Card.cs:1733
bool IsWeapon
Definition: Card.cs:2142
Vector3 InspectPosition
Definition: Card.cs:2421
void AddExp(int a)
Definition: Card.cs:2866
void ModNum(int a, bool notify=true)
Definition: Card.cs:3376
bool isLeashed
Definition: Card.cs:826
T FindTool< T >()
Definition: Card.cs:2602
virtual void ChangeRarity(Rarity q)
Definition: Card.cs:3765
bool IsIdentified
Definition: Card.cs:2313
bool IsContainer
Definition: Card.cs:2025
bool isReplica
Definition: Card.cs:682
bool freePos
Definition: Card.cs:502
int c_charges
Definition: Card.cs:1241
SourceCategory.Row _category
Definition: Card.cs:85
void SayRaw(string text, string ref1=null, string ref2=null)
Definition: Card.cs:6402
virtual int GetArmorSkill()
Definition: Card.cs:3878
int GetValue(PriceType priceType=PriceType.Default, bool sell=false)
Definition: Card.cs:6797
void PlayEffect(int ele, bool useRenderPos=true, float range=0f)
Definition: Card.cs:5820
List< int > sockets
Definition: Card.cs:43
bool _IsPC
Definition: Card.cs:2081
void RemoveCard(Card c)
Definition: Card.cs:3011
string c_editorTraitVal
Definition: Card.cs:1673
CardRenderer renderer
Definition: Card.cs:57
int c_fur
Definition: Card.cs:1301
void KillAnime()
Definition: Card.cs:5790
virtual bool flipX
Definition: Card.cs:2052
void SpawnLoot(Card origin)
Definition: Card.cs:4823
void ClearPaintSprite()
Definition: Card.cs:6676
string GetFoodName(string s)
Definition: Card.cs:5376
VisitorState visitorState
Definition: Card.cs:1169
void TalkRaw(string text, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6365
int LV
Definition: Card.cs:370
bool isBackerContent
Definition: Card.cs:897
Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial=false)
Definition: Card.cs:2967
virtual bool isSynced
Definition: Card.cs:2023
bool ignoreStackHeight
Definition: Card.cs:622
void ForeachFOV(Func< Point, bool > func)
Definition: Card.cs:7384
void Create(string _id, int _idMat=-1, int genLv=-1)
Definition: Card.cs:2660
AIAct reservedAct
Definition: Card.cs:45
int ResistLvFrom(int ele)
Definition: Card.cs:5556
int QualityLv
Definition: Card.cs:2363
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6423
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6469
string c_idRefCard
Definition: Card.cs:1697
Card MakeFoodFrom(Card c)
Definition: Card.cs:5200
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5403
int Dist(Point p)
Definition: Card.cs:7274
bool ShowFoodEnc
Definition: Card.cs:2126
bool HasElementNoCopy()
Definition: Card.cs:5581
void RemoveThings()
Definition: Card.cs:3171
void MoveThingToBottom(Thing t)
Definition: CellDetail.cs:45
void MoveThingToTop(Thing t)
Definition: CellDetail.cs:58
Definition: Cell.cs:7
void RemoveCard(Card c)
Definition: Cell.cs:1566
bool IsSnowTile
Definition: Cell.cs:782
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
void Refresh()
Definition: Cell.cs:1152
bool skipRender
Definition: Cell.cs:270
void AddCard(Card c)
Definition: Cell.cs:1550
void Unequip(Thing thing, bool refresh=true)
Definition: CharaBody.cs:49
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:433
Thing GetEquippedThing(int elementId)
Definition: CharaBody.cs:378
Definition: Chara.cs:10
bool IsHumanSpeak
Definition: Chara.cs:881
Element MainElement
Definition: Chara.cs:713
new TraitChara trait
Definition: Chara.cs:499
CharaBody body
Definition: Chara.cs:94
Card held
Definition: Chara.cs:70
AIAct ai
Definition: Chara.cs:198
bool isWet
Definition: Chara.cs:142
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8559
Faction faction
Definition: Chara.cs:423
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7360
Chara host
Definition: Chara.cs:33
SourceJob.Row job
Definition: Chara.cs:462
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9114
void ShowDialog()
Definition: Chara.cs:6532
override string ToString()
Definition: Chara.cs:1024
Party party
Definition: Chara.cs:43
ElementContainer tempElements
Definition: Chara.cs:36
List< Condition > conditions
Definition: Chara.cs:207
bool HasCondition(string alias)
Definition: Chara.cs:8716
override bool IsPCFaction
Definition: Chara.cs:667
void CalculateMaxStamina()
Definition: Chara.cs:1804
void TryUpgrade(bool msg=true)
Definition: Chara.cs:7940
ConSleep conSleep
Definition: Chara.cs:102
bool IsFriendOrAbove()
Definition: Chara.cs:6122
Stats SAN
Definition: Chara.cs:1010
SourceChara.Row source
Definition: Chara.cs:154
Stats mana
Definition: Chara.cs:1006
Stats stamina
Definition: Chara.cs:998
Chara parasite
Definition: Chara.cs:30
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4310
Chara ride
Definition: Chara.cs:27
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8033
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:7546
Affinity affinity
Definition: Chara.cs:310
void ModCorruption(int a)
Definition: Chara.cs:9056
Religion faith
Definition: Chara.cs:435
Chara enemy
Definition: Chara.cs:86
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:5808
void SyncRide()
Definition: Chara.cs:3655
bool isBlind
Definition: Chara.cs:130
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:4666
bool IsHostile()
Definition: Chara.cs:6034
bool isDead
Definition: Chara.cs:385
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:8795
void TrySetEnemy(Chara c)
Definition: Chara.cs:5825
bool HasCooldown(int idEle)
Definition: Chara.cs:8051
void CalcBurden()
Definition: Chara.cs:1627
SourceRace.Row race
Definition: Chara.cs:460
bool Has(string id)
Definition: CodexManager.cs:36
bool DroppedCard(string id)
Definition: CodexManager.cs:46
CodexCreature GetOrCreate(string id)
Definition: CodexManager.cs:9
void AddKill(string id)
Definition: CodexManager.cs:55
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
BlockColors blockColors
UD_String_LightData lightColors
UD_String_MatData matColors
Definition: ConDim.cs:2
Definition: ConWet.cs:2
virtual void OnCalculateFov(Fov fov, ref int radius, ref float power)
Definition: Condition.cs:75
void Kill(bool silent=false)
Definition: Condition.cs:91
virtual void OnCreateFov(Fov fov)
Definition: Condition.cs:79
new GameConfig game
Definition: CoreConfig.cs:600
GraphicSetting graphic
Definition: CoreConfig.cs:598
OtherSetting other
Definition: CoreConfig.cs:610
bool godMode
Definition: CoreDebug.cs:172
bool godFood
Definition: CoreDebug.cs:182
bool enable
Definition: CoreDebug.cs:285
bool testThingQuality
Definition: CoreDebug.cs:214
Sprite defaultAbility
Definition: CoreRef.cs:116
RectData center
Definition: CoreRef.cs:164
Icons icons
Definition: CoreRef.cs:345
Rects rects
Definition: CoreRef.cs:351
CoreRef refs
Definition: Core.cs:51
bool IsGameStarted
Definition: Core.cs:84
CoreConfig config
Definition: Core.cs:70
Definition: DNA.cs:8
static Thing CopyDNA(Thing from, Thing to)
Definition: DNA.cs:130
static Thing GenerateRandomGene(int lv=-1, int seed=-1)
Definition: DNA.cs:138
void Add(Card target, Card attacker, int dmg, Element e=null)
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
bool IsNight
Definition: Date.cs:112
int GetRawDay()
Definition: Date.cs:327
PeriodOfDay periodOfDay
Definition: Date.cs:124
Definition: Dice.cs:4
static int Roll(int num, int sides, int bonus=0, Card card=null)
Definition: Dice.cs:15
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
static ColorProfile Colors
Definition: EClass.cs:38
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:63
static int rnd(int a)
Definition: EClass.cs:58
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static SourceManager sources
Definition: EClass.cs:42
static float rndf(float a)
Definition: EClass.cs:87
static FactionBranch Branch
Definition: EClass.cs:22
static BaseGameScreen screen
Definition: EClass.cs:32
static int rndHalf(int a)
Definition: EClass.cs:82
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
static CoreDebug debug
Definition: EClass.cs:48
static SoundManager Sound
Definition: EClass.cs:46
static UI ui
Definition: EClass.cs:16
static GameSetting setting
Definition: EClass.cs:34
Definition: Effect.cs:7
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:115
Effect Emit(int num)
Definition: Effect.cs:279
static Effect Get(Effect original)
Definition: Effect.cs:85
Effect SetParticleColor(Color c)
Definition: Effect.cs:289
void SetOwner(Card c, bool applyFeat)
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Dictionary< int, Element > dict
bool Has(int ele)
int Value(int ele)
void CopyTo(ElementContainer container)
int ValueWithoutLink(int ele)
void ModExp(int ele, int a, bool chain=false)
Element ModBase(int ele, int v)
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
void SetTo(int id, int v)
Element SetBase(string alias, int v, int potential=0)
void Remove(int id)
Element GetOrCreateElement(Element ele)
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:292
static int GetResistDamage(int dmg, int v, int power=0)
Definition: ELEMENT.cs:1135
int id
Definition: ELEMENT.cs:248
SourceElement.Row source
Definition: ELEMENT.cs:271
static int GetResistLv(int v)
Definition: ELEMENT.cs:1121
int Value
Definition: ELEMENT.cs:290
bool IsFoodTrait
Definition: ELEMENT.cs:362
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1097
static Element Void
Definition: ELEMENT.cs:236
bool IsGlobalElement
Definition: ELEMENT.cs:343
bool IsTrait
Definition: ELEMENT.cs:360
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:240
Dictionary< string, Dictionary< string, string > > all
Definition: ExcelDataList.cs:8
List< Dictionary< string, string > > list
virtual void Initialize()
int Evalue(int ele)
List< Chara > members
PolicyManager policies
HomeResourceManager resources
List< FactionBranch > GetChildren()
Definition: FACTION.cs:202
void AddContribution(int a)
Definition: FACTION.cs:318
Definition: Fov.cs:6
byte b
Definition: Fov.cs:30
byte g
Definition: Fov.cs:28
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
void Perform(int _x, int _z, int _range, float power=1f)
Definition: Fov.cs:139
byte r
Definition: Fov.cs:26
static string ConvertDrama(string text, Chara c=null)
Definition: GameLang.cs:14
bool enableDamageReduction
bool disableUsermapBenefit
RenderSetting render
Definition: GameSetting.cs:301
UD_String_ElementRef elements
Definition: GameSetting.cs:315
bool snapFreePos
Definition: Game.cs:33
HashSet< Texture2D > loadedTextures
Definition: Game.cs:251
ReligionManager religions
Definition: Game.cs:158
GamePrincipal principal
Definition: Game.cs:221
CardManager cards
Definition: Game.cs:155
Zone activeZone
Definition: Game.cs:245
Config config
Definition: Game.cs:215
QuestManager quests
Definition: Game.cs:179
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
bool CanGiveContribution(Chara c)
Definition: GuildFighter.cs:26
int BuySpellbookPrice(int a)
Definition: GuildMage.cs:17
int SellStolenPrice(int a)
Definition: GuildThief.cs:17
Definition: Guild.cs:2
static GuildMage Mage
Definition: Guild.cs:25
static GuildFighter Fighter
Definition: Guild.cs:23
bool IsMember
Definition: Guild.cs:39
static GuildThief Thief
Definition: Guild.cs:27
virtual Thing Thing
Definition: HotItem.cs:38
static bool Has(string id)
Definition: LangGame.cs:46
bool stripPuns
Definition: LangSetting.cs:44
int combatTextStyle
Definition: LangSetting.cs:50
bool useTone
Definition: LangSetting.cs:40
Definition: Lang.cs:6
static LangSetting setting
Definition: Lang.cs:54
static NaturalStringComparer comparer
Definition: Lang.cs:22
static string[] GetList(string id)
Definition: Lang.cs:114
static LangGame Game
Definition: Lang.cs:48
static bool isJP
Definition: Lang.cs:38
LayerChara SetChara(Chara c)
Definition: LayerChara.cs:9
static bool IsActive()
Definition: LayerDrama.cs:34
static LayerDrama Instance
Definition: LayerDrama.cs:20
static void SetDirty(Thing t)
static List< LayerInventory > listInv
List< Window > windows
Definition: Layer.cs:116
int radius
Definition: LightData.cs:10
Color color
Definition: LightData.cs:7
static SourceMaterial.Row GetRandomMaterial(int lv, string group=null, bool tryLevelMatTier=false)
Definition: MATERIAL.cs:43
static SourceMaterial.Row GetRandomMaterialFromCategory(int lv, string cat, SourceMaterial.Row fallback)
Definition: MATERIAL.cs:81
Definition: MOD.cs:7
static TalkDataList listTalk
Definition: MOD.cs:10
static ToneDataList tones
Definition: MOD.cs:12
bool IsIndoor
Definition: Map.cs:131
Chara FindChara(string id)
Definition: Map.cs:2546
void TrySmoothPick(Cell cell, Thing t, Chara c)
Definition: Map.cs:1791
void MoveCard(Point p, Card t)
Definition: Map.cs:835
PropsManager props
Definition: Map.cs:91
void OnSetBlockOrDoor(int x, int z)
Definition: Map.cs:1018
PropsStocked Stocked
Definition: Map.cs:121
List< Chara > charas
Definition: Map.cs:81
void AddDecal(int x, int z, int id, int amount=1, bool refresh=true)
Definition: Map.cs:2007
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
void RemoveMember(Chara c)
Definition: Party.cs:89
List< Chara > members
Definition: Party.cs:18
int landDeedBought
Definition: Player.cs:522
int kills
Definition: Player.cs:76
Flags flags
Definition: Player.cs:910
CodexManager codex
Definition: Player.cs:931
RecipeManager recipes
Definition: Player.cs:913
void ModFame(int a)
Definition: Player.cs:1900
void ModKarma(int a)
Definition: Player.cs:2311
float lightPower
Definition: Player.cs:1013
Stats stats
Definition: Player.cs:832
int lightRadius
Definition: Player.cs:1005
bool invlunerable
Definition: Player.cs:989
int customLightMod
Definition: Player.cs:778
int totalFeat
Definition: Player.cs:724
bool forceTalk
Definition: Player.cs:967
HotItem currentHotItem
Definition: Player.cs:916
Chara Agent
Definition: Player.cs:1090
Chara chara
Definition: Player.cs:1019
int fame
Definition: Player.cs:700
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2205
void RefreshCurrentHotItem()
Definition: Player.cs:1998
Definition: Point.cs:9
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1365
ref Vector3 Position(int height)
Definition: Point.cs:536
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1031
RenderParam ApplyAnime(RenderParam p)
Definition: Point.cs:1305
override string ToString()
Definition: Point.cs:512
Point Set(int _x, int _z)
Definition: Point.cs:491
CellDetail detail
Definition: Point.cs:71
bool IsBlocked
Definition: Point.cs:351
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsSync
Definition: Point.cs:332
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1233
ref Vector3 PositionCenter()
Definition: Point.cs:575
bool IsValid
Definition: Point.cs:88
Effect PlayEffect(string id)
Definition: Point.cs:1228
bool HasObj
Definition: Point.cs:137
void RefreshNeighborTiles()
Definition: Point.cs:1256
Area area
Definition: Point.cs:73
int Distance(Point p)
Definition: Point.cs:969
bool HasBlock
Definition: Point.cs:141
Cell cell
Definition: Point.cs:51
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
Definition: Point.cs:607
bool HasChara
Definition: Point.cs:226
bool IsActive(int id, int days=-1)
List< Card > sales
Definition: PropsManager.cs:14
void OnCardAddedToZone(Card c)
Definition: PropsManager.cs:25
List< Card > deconstructing
Definition: PropsManager.cs:12
Definition: Props.cs:7
void Add(Card t)
Definition: Props.cs:63
void OnNumChange(Card c, int a)
Definition: Props.cs:160
void Remove(Card t)
Definition: Props.cs:115
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnKillChara(Chara c)
Definition: Quest.cs:543
Definition: Rand.cs:4
static int Range(int min, int max)
Definition: Rand.cs:42
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22
static void SetSeed(int a=-1)
Definition: Rand.cs:37
HashSet< string > knownIngredients
Definition: Recipe.cs:7
ReligionHarvest Harvest
ReligionLuck Luck
ReligionHealing Healing
static Religion recentWrath
Definition: Religion.cs:22
static RenderParam shared
Definition: RenderParam.cs:5
bool multisize
Definition: RenderRow.cs:64
string[] tag
Definition: RenderRow.cs:58
SourcePref pref
Definition: RenderRow.cs:68
bool HasTag(CTAG _tag)
Definition: RenderRow.cs:125
bool useAltColor
Definition: RenderRow.cs:80
string category
Definition: RenderRow.cs:46
bool useRandomColor
Definition: RenderRow.cs:83
TileType tileType
Definition: RenderRow.cs:77
int[] _tiles
Definition: RenderRow.cs:12
void SetImage(Image image, Sprite sprite=null, int matCol=0, bool setNativeSize=true, int dir=0, int idSkin=0, Card card=null)
Definition: RenderRow.cs:351
int[] tiles
Definition: RenderRow.cs:10
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:261
SourceMaterial.Row DefaultMaterial
Definition: RenderRow.cs:86
int colorMod
Definition: RenderRow.cs:16
int LV
Definition: RenderRow.cs:22
bool fixedMaterial
Definition: RenderRow.cs:66
AnimationCurve fovCurveChara
SceneGlobalProfile global
Definition: SceneProfile.cs:6
SceneLightProfile light
Definition: SceneProfile.cs:10
DamageTextRenderer damageTextRenderer
Definition: Scene.cs:109
float timeRatio
Definition: Scene.cs:130
ActionMode actionMode
Definition: Scene.cs:79
SceneProfile profile
Definition: Scene.cs:75
bool isActive
Definition: ScreenGuide.cs:15
MeshPass passGuideBlock
Definition: ScreenGuide.cs:5
Type type
Definition: SocketData.cs:18
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
bool IsChildOf(string id)
string GetText(string id="name", bool returnNull=false)
Definition: SourceData.cs:553
string TryGetId(string id, string id2)
Definition: SourceLang.cs:34
SourceMaterial materials
SourceCard cards
SourceBacker backers
SourceCategory categories
SourceElement elements
bool Float
Definition: SourcePref.cs:312
string[] food
Definition: SourceRace.cs:89
virtual bool IsRegion
Definition: Spatial.cs:501
int influence
Definition: Spatial.cs:214
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
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
static SubPassData Default
Definition: SubPassData.cs:7
string GetTalk(string id, string idTopic, bool useDefault=false, bool human=true)
Definition: TalkDataList.cs:23
string GetRandomID(string tag)
Definition: TalkDataList.cs:58
void SetOwner(Card owner)
Thing Find(int uid)
void OnAdd(Thing t)
Thing TryStack(Thing target, int destInvX=-1, int destInvY=-1)
void AddCurrency(Card owner, string id, int a, SourceMaterial.Row mat=null)
DestData GetDest(Thing t, bool tryStack=true)
void OnRemove(Thing t)
void Foreach(Action< Thing > action, bool onlyAccessible=true)
int GetCurrency(string id, ref int sum, SourceMaterial.Row mat=null)
static Thing CreateFromFilter(string id, int lv=-1)
Definition: ThingGen.cs:63
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
bool isEquipped
Definition: Thing.cs:17
void TryLickEnchant(Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
Definition: Thing.cs:1913
bool CanSearchContents
Definition: Thing.cs:80
override CardRow sourceCard
Definition: Thing.cs:47
int id
Definition: TileRow.cs:8
virtual void GetMountHeight(ref Vector3 v, Point p, int d, Card target=null)
Definition: TileType.cs:369
virtual int MaxAltitude
Definition: TileType.cs:207
virtual bool UseMountHeight
Definition: TileType.cs:211
static TileTypeDoor Door
Definition: TileType.cs:95
StringBuilder ApplyTone(string id, ref string text, int gender)
Definition: ToneDataList.cs:11
string GetToneID(string id, int gender)
Definition: ToneDataList.cs:58
virtual bool EnableTone
Definition: TraitChara.cs:101
static Thing MakeRandomSeed(bool enc=false)
Definition: TraitSeed.cs:187
Definition: Trait.cs:7
virtual bool CanBeAttacked
Definition: Trait.cs:163
virtual bool ShouldRefreshTile
Definition: Trait.cs:75
virtual void OnChangePlaceState(PlaceState state)
Definition: Trait.cs:668
virtual float DropChance
Definition: Trait.cs:353
virtual int GetValue()
Definition: Trait.cs:576
virtual bool CanChildDecay(Card c)
Definition: Trait.cs:1055
virtual bool CanBeDestroyed
Definition: Trait.cs:289
virtual void SetOwner(Card _owner)
Definition: Trait.cs:629
virtual bool HasCharges
Definition: Trait.cs:323
virtual bool IsLightOn
Definition: Trait.cs:406
virtual bool IsDoor
Definition: Trait.cs:56
virtual void Toggle(bool on, bool silent=false)
Definition: Trait.cs:1144
virtual int IdSkin
Definition: Trait.cs:44
virtual void OnSimulateHour(VirtualDate date)
Definition: Trait.cs:680
virtual EffectDead EffectDead
Definition: Trait.cs:247
virtual void OnCreate(int lv)
Definition: Trait.cs:656
virtual ToggleType ToggleType
Definition: Trait.cs:462
virtual bool ShouldTryRefreshRoom
Definition: Trait.cs:86
virtual bool CanBeSmashedToDeath
Definition: Trait.cs:291
virtual bool LevelAsQuality
Definition: Trait.cs:189
virtual int Decay
Definition: Trait.cs:119
void Uninstall()
Definition: Trait.cs:1096
virtual int CompareTo(Card b)
Definition: Trait.cs:708
virtual bool IsContainer
Definition: Trait.cs:209
virtual ThrowType ThrowType
Definition: Trait.cs:245
virtual int InstallBottomPriority
Definition: Trait.cs:88
void Install(bool byPlayer)
Definition: Trait.cs:1076
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27
Definition: UINote.cs:6
bool IsRealTime
Definition: VirtualDate.cs:7
static WidgetCurrentTool Instance
static void RefreshCurrentHotItem()
ButtonGrid selectedButton
bool excludeCraft
Definition: Window.cs:379
Definition: Window.cs:13
static Dictionary< string, SaveData > dictData
Definition: Window.cs:594
GameDate date
Definition: World.cs:6
ZoneEventManager events
Definition: Zone.cs:40
bool isStarted
Definition: Zone.cs:70
virtual bool IsUserZone
Definition: Zone.cs:266
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
Definition: Zone.cs:2150
void ModInfluence(int a)
Definition: Zone.cs:3405
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:466
Card AddCard(Card t, Point point)
Definition: Zone.cs:1910
void RemoveCard(Card c)
void OnChildNumChange(Card c)
ICardParent GetRoot()
NoteMode
Definition: IInspect.cs:7
Definition: ActRef.cs:2
void SetInt(int i)
Definition: BitArray32.cs:89
int ToInt()
Definition: BitArray32.cs:84
bool demo
Definition: Version.cs:14