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