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