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