Elin Modding Docs Doc
Loading...
Searching...
No Matches
Chara.cs
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Linq;
5using System.Runtime.CompilerServices;
6using Algorithms;
7using Newtonsoft.Json;
8using UnityEngine;
9
10// Token: 0x0200029B RID: 667
11public class Chara : Card, IPathfindWalker
12{
13 // Token: 0x170005A2 RID: 1442
14 // (get) Token: 0x06001403 RID: 5123 RVA: 0x000837F7 File Offset: 0x000819F7
15 public string Aka
16 {
17 get
18 {
19 return this._alias.IsEmpty(this.source.GetText("aka", true) ?? "");
20 }
21 }
22
23 // Token: 0x170005A3 RID: 1443
24 // (get) Token: 0x06001404 RID: 5124 RVA: 0x0008381E File Offset: 0x00081A1E
25 // (set) Token: 0x06001405 RID: 5125 RVA: 0x00083828 File Offset: 0x00081A28
26 public string _alias
27 {
28 get
29 {
30 return this._strs[0];
31 }
32 set
33 {
34 this._strs[0] = value;
35 }
36 }
37
38 // Token: 0x170005A4 RID: 1444
39 // (get) Token: 0x06001406 RID: 5126 RVA: 0x00083833 File Offset: 0x00081A33
40 // (set) Token: 0x06001407 RID: 5127 RVA: 0x0008383D File Offset: 0x00081A3D
41 public string idFaith
42 {
43 get
44 {
45 return this._strs[1];
46 }
47 set
48 {
49 this._strs[1] = value;
50 }
51 }
52
53 // Token: 0x170005A5 RID: 1445
54 // (get) Token: 0x06001408 RID: 5128 RVA: 0x00083848 File Offset: 0x00081A48
55 // (set) Token: 0x06001409 RID: 5129 RVA: 0x00083852 File Offset: 0x00081A52
56 public string idFaction
57 {
58 get
59 {
60 return this._strs[2];
61 }
62 set
63 {
64 this._strs[2] = value;
65 }
66 }
67
68 // Token: 0x170005A6 RID: 1446
69 // (get) Token: 0x0600140A RID: 5130 RVA: 0x0008385D File Offset: 0x00081A5D
70 // (set) Token: 0x0600140B RID: 5131 RVA: 0x0008386C File Offset: 0x00081A6C
71 public Zone currentZone
72 {
73 get
74 {
75 return RefZone.Get(this._cints[1]);
76 }
77 set
78 {
79 this._cints[1] = RefZone.Set(value);
80 }
81 }
82
83 // Token: 0x170005A7 RID: 1447
84 // (get) Token: 0x0600140C RID: 5132 RVA: 0x0008387C File Offset: 0x00081A7C
85 // (set) Token: 0x0600140D RID: 5133 RVA: 0x0008388B File Offset: 0x00081A8B
86 public Zone homeZone
87 {
88 get
89 {
90 return RefZone.Get(this._cints[2]);
91 }
92 set
93 {
94 this._cints[2] = RefZone.Set(value);
95 }
96 }
97
98 // Token: 0x170005A8 RID: 1448
99 // (get) Token: 0x0600140E RID: 5134 RVA: 0x0008389B File Offset: 0x00081A9B
100 // (set) Token: 0x0600140F RID: 5135 RVA: 0x000838AA File Offset: 0x00081AAA
101 public GoalListType goalListType
102 {
103 get
104 {
105 return this._cints[3].ToEnum<GoalListType>();
106 }
107 set
108 {
109 this._cints[3] = (int)value;
110 }
111 }
112
113 // Token: 0x170005A9 RID: 1449
114 // (get) Token: 0x06001410 RID: 5136 RVA: 0x000838B5 File Offset: 0x00081AB5
115 // (set) Token: 0x06001411 RID: 5137 RVA: 0x000838C4 File Offset: 0x00081AC4
116 public Hostility hostility
117 {
118 get
119 {
120 return this._cints[4].ToEnum<Hostility>();
121 }
122 set
123 {
124 this._cints[4] = (int)value;
125 }
126 }
127
128 // Token: 0x170005AA RID: 1450
129 // (get) Token: 0x06001412 RID: 5138 RVA: 0x000838CF File Offset: 0x00081ACF
130 // (set) Token: 0x06001413 RID: 5139 RVA: 0x000838D9 File Offset: 0x00081AD9
131 public int _affinity
132 {
133 get
134 {
135 return this._cints[5];
136 }
137 set
138 {
139 this._cints[5] = value;
140 }
141 }
142
143 // Token: 0x170005AB RID: 1451
144 // (get) Token: 0x06001414 RID: 5140 RVA: 0x000838E4 File Offset: 0x00081AE4
145 public Affinity affinity
146 {
147 get
148 {
149 return Affinity.Get(this);
150 }
151 }
152
153 // Token: 0x170005AC RID: 1452
154 // (get) Token: 0x06001415 RID: 5141 RVA: 0x000838EC File Offset: 0x00081AEC
155 // (set) Token: 0x06001416 RID: 5142 RVA: 0x000838F6 File Offset: 0x00081AF6
156 public int interest
157 {
158 get
159 {
160 return this._cints[6];
161 }
162 set
163 {
164 this._cints[6] = value;
165 }
166 }
167
168 // Token: 0x170005AD RID: 1453
169 // (get) Token: 0x06001417 RID: 5143 RVA: 0x00083901 File Offset: 0x00081B01
170 // (set) Token: 0x06001418 RID: 5144 RVA: 0x0008390B File Offset: 0x00081B0B
171 public int daysStarved
172 {
173 get
174 {
175 return this._cints[7];
176 }
177 set
178 {
179 this._cints[7] = value;
180 }
181 }
182
183 // Token: 0x170005AE RID: 1454
184 // (get) Token: 0x06001419 RID: 5145 RVA: 0x00083916 File Offset: 0x00081B16
185 // (set) Token: 0x0600141A RID: 5146 RVA: 0x00083921 File Offset: 0x00081B21
186 public int _idTimeTable
187 {
188 get
189 {
190 return this._cints[9];
191 }
192 set
193 {
194 this._cints[9] = value;
195 }
196 }
197
198 // Token: 0x170005AF RID: 1455
199 // (get) Token: 0x0600141B RID: 5147 RVA: 0x0008392D File Offset: 0x00081B2D
200 // (set) Token: 0x0600141C RID: 5148 RVA: 0x00083938 File Offset: 0x00081B38
201 public int uidEditor
202 {
203 get
204 {
205 return this._cints[10];
206 }
207 set
208 {
209 this._cints[10] = value;
210 }
211 }
212
213 // Token: 0x170005B0 RID: 1456
214 // (get) Token: 0x0600141D RID: 5149 RVA: 0x00083944 File Offset: 0x00081B44
215 // (set) Token: 0x0600141E RID: 5150 RVA: 0x0008394F File Offset: 0x00081B4F
216 public int _maxStamina
217 {
218 get
219 {
220 return this._cints[20];
221 }
222 set
223 {
224 this._cints[20] = value;
225 }
226 }
227
228 // Token: 0x170005B1 RID: 1457
229 // (get) Token: 0x0600141F RID: 5151 RVA: 0x0008395B File Offset: 0x00081B5B
230 // (set) Token: 0x06001420 RID: 5152 RVA: 0x00083966 File Offset: 0x00081B66
231 public int corruption
232 {
233 get
234 {
235 return this._cints[21];
236 }
237 set
238 {
239 this._cints[21] = value;
240 }
241 }
242
243 // Token: 0x170005B2 RID: 1458
244 // (get) Token: 0x06001421 RID: 5153 RVA: 0x00083972 File Offset: 0x00081B72
245 // (set) Token: 0x06001422 RID: 5154 RVA: 0x00083980 File Offset: 0x00081B80
246 public bool isDead
247 {
248 get
249 {
250 return this._cbits1[0];
251 }
252 set
253 {
254 this._cbits1[0] = value;
255 }
256 }
257
258 // Token: 0x170005B3 RID: 1459
259 // (get) Token: 0x06001423 RID: 5155 RVA: 0x0008398F File Offset: 0x00081B8F
260 // (set) Token: 0x06001424 RID: 5156 RVA: 0x0008399D File Offset: 0x00081B9D
261 public bool isAlawysVisible
262 {
263 get
264 {
265 return this._cbits1[1];
266 }
267 set
268 {
269 this._cbits1[1] = value;
270 }
271 }
272
273 // Token: 0x170005B4 RID: 1460
274 // (get) Token: 0x06001425 RID: 5157 RVA: 0x000839AC File Offset: 0x00081BAC
275 // (set) Token: 0x06001426 RID: 5158 RVA: 0x000839BA File Offset: 0x00081BBA
276 public bool knowFav
277 {
278 get
279 {
280 return this._cbits1[3];
281 }
282 set
283 {
284 this._cbits1[3] = value;
285 }
286 }
287
288 // Token: 0x170005B5 RID: 1461
289 // (get) Token: 0x06001427 RID: 5159 RVA: 0x000839CC File Offset: 0x00081BCC
290 public CharaAbility ability
291 {
292 get
293 {
294 CharaAbility result;
295 if ((result = this._ability) == null)
296 {
297 result = (this._ability = new CharaAbility(this));
298 }
299 return result;
300 }
301 }
302
303 // Token: 0x170005B6 RID: 1462
304 // (get) Token: 0x06001428 RID: 5160 RVA: 0x000839F4 File Offset: 0x00081BF4
305 // (set) Token: 0x06001429 RID: 5161 RVA: 0x00083A2F File Offset: 0x00081C2F
306 public Faction faction
307 {
308 get
309 {
310 Faction result;
311 if ((result = this._faction) == null)
312 {
313 result = (this._faction = EClass.game.factions.dictAll.TryGetValue(this.idFaction, null));
314 }
315 return result;
316 }
317 set
318 {
319 this.idFaction = ((value != null) ? value.uid : null);
320 }
321 }
322
323 // Token: 0x170005B7 RID: 1463
324 // (get) Token: 0x0600142A RID: 5162 RVA: 0x00083A43 File Offset: 0x00081C43
325 // (set) Token: 0x0600142B RID: 5163 RVA: 0x00083A7D File Offset: 0x00081C7D
326 public Religion faith
327 {
328 get
329 {
330 return EClass.game.religions.dictAll.TryGetValue(this.idFaith, null) ?? EClass.game.religions.dictAll["eyth"];
331 }
332 set
333 {
334 this.idFaith = ((value != null) ? value.id : null);
335 }
336 }
337
338 // Token: 0x170005B8 RID: 1464
339 // (get) Token: 0x0600142C RID: 5164 RVA: 0x00083A91 File Offset: 0x00081C91
340 public override CardRow sourceCard
341 {
342 get
343 {
344 return this.source;
345 }
346 }
347
348 // Token: 0x170005B9 RID: 1465
349 // (get) Token: 0x0600142D RID: 5165 RVA: 0x00083A99 File Offset: 0x00081C99
350 public override CardRow sourceRenderCard
351 {
352 get
353 {
354 if (this.pccData != null && !(this.source.renderData is RenderDataPcc))
355 {
356 return SourceChara.rowDefaultPCC;
357 }
358 return this.source;
359 }
360 }
361
362 // Token: 0x170005BA RID: 1466
363 // (get) Token: 0x0600142E RID: 5166 RVA: 0x00083AC4 File Offset: 0x00081CC4
364 public SourceRace.Row race
365 {
366 get
367 {
368 SourceRace.Row result;
369 if ((result = this._race) == null)
370 {
371 result = (this._race = EClass.sources.races.map[base.c_idRace.IsEmpty(this.source.race)]);
372 }
373 return result;
374 }
375 }
376
377 // Token: 0x170005BB RID: 1467
378 // (get) Token: 0x0600142F RID: 5167 RVA: 0x00083B10 File Offset: 0x00081D10
379 public SourceJob.Row job
380 {
381 get
382 {
383 SourceJob.Row result;
384 if ((result = this._job) == null)
385 {
386 result = (this._job = EClass.sources.jobs.map[base.c_idJob.IsEmpty(this.source.job)]);
387 }
388 return result;
389 }
390 }
391
392 // Token: 0x170005BC RID: 1468
393 // (get) Token: 0x06001430 RID: 5168 RVA: 0x00083B5A File Offset: 0x00081D5A
394 public string idTimeTable
395 {
396 get
397 {
398 return Chara.IDTimeTable[this._idTimeTable];
399 }
400 }
401
402 // Token: 0x170005BD RID: 1469
403 // (get) Token: 0x06001431 RID: 5169 RVA: 0x00083B68 File Offset: 0x00081D68
404 public Hostility OriginalHostility
405 {
406 get
407 {
408 if (EClass.pc != null && this.IsPCFaction)
409 {
410 return Hostility.Ally;
411 }
412 if (base.c_originalHostility != (Hostility)0)
413 {
414 return base.c_originalHostility;
415 }
416 if (!this.source.hostility.IsEmpty())
417 {
418 return this.source.hostility.ToEnum(true);
419 }
420 return Hostility.Enemy;
421 }
422 }
423
424 // Token: 0x170005BE RID: 1470
425 // (get) Token: 0x06001432 RID: 5170 RVA: 0x00083BBA File Offset: 0x00081DBA
426 public string IDPCCBodySet
427 {
428 get
429 {
430 if (this.source.idActor.Length <= 1)
431 {
432 return "female";
433 }
434 return this.source.idActor[1];
435 }
436 }
437
438 // Token: 0x170005BF RID: 1471
439 // (get) Token: 0x06001433 RID: 5171 RVA: 0x00083BDF File Offset: 0x00081DDF
440 // (set) Token: 0x06001434 RID: 5172 RVA: 0x00083BEC File Offset: 0x00081DEC
441 public new TraitChara trait
442 {
443 get
444 {
445 return this.trait as TraitChara;
446 }
447 set
448 {
449 this.trait = value;
450 }
451 }
452
453 // Token: 0x06001435 RID: 5173 RVA: 0x00083BF8 File Offset: 0x00081DF8
454 public override string ToString()
455 {
456 string[] array = new string[9];
457 array[0] = base.Name;
458 array[1] = "(";
459 int num = 2;
460 AIAct aiact = this.ai;
461 array[num] = ((aiact != null) ? aiact.ToString() : null);
462 array[3] = ")";
463 int num2 = 4;
464 Point pos = this.pos;
465 array[num2] = ((pos != null) ? pos.ToString() : null);
466 array[5] = "/";
467 array[6] = base.ExistsOnMap.ToString();
468 array[7] = "/";
469 array[8] = this.isDead.ToString();
470 return string.Concat(array);
471 }
472
473 // Token: 0x170005C0 RID: 1472
474 // (get) Token: 0x06001436 RID: 5174 RVA: 0x00083C86 File Offset: 0x00081E86
475 public string NameBraced
476 {
477 get
478 {
479 return this.GetName(NameStyle.Full, -1);
480 }
481 }
482
483 // Token: 0x170005C1 RID: 1473
484 // (get) Token: 0x06001437 RID: 5175 RVA: 0x00083C90 File Offset: 0x00081E90
485 public string NameTitled
486 {
487 get
488 {
489 return ((EClass.game.idDifficulty == 0) ? "" : ((EClass.game.idDifficulty == 1) ? "☆" : "★")) + this.NameBraced;
490 }
491 }
492
493 // Token: 0x170005C2 RID: 1474
494 // (get) Token: 0x06001438 RID: 5176 RVA: 0x00083CC9 File Offset: 0x00081EC9
495 public override string actorPrefab
496 {
497 get
498 {
499 if (this.IsPCC)
500 {
501 return "CharaActorPCC";
502 }
503 return "CharaActor";
504 }
505 }
506
507 // Token: 0x170005C3 RID: 1475
508 // (get) Token: 0x06001439 RID: 5177 RVA: 0x00083CDE File Offset: 0x00081EDE
509 public override int PrefIndex
510 {
511 get
512 {
513 if (this.sourceCard._tiles.Length == 0 && this.renderer.replacer == null)
514 {
515 return base.dir;
516 }
517 if (base.dir != 1 && base.dir != 2)
518 {
519 return 0;
520 }
521 return 1;
522 }
523 }
524
525 // Token: 0x170005C4 RID: 1476
526 // (get) Token: 0x0600143A RID: 5178 RVA: 0x00083D17 File Offset: 0x00081F17
527 public override bool flipX
528 {
529 get
530 {
531 return base.dir == 1 || base.dir == 2;
532 }
533 }
534
535 // Token: 0x170005C5 RID: 1477
536 // (get) Token: 0x0600143B RID: 5179 RVA: 0x00083D2D File Offset: 0x00081F2D
537 public override string AliasMaterialOnCreate
538 {
539 get
540 {
541 return this.race.material;
542 }
543 }
544
545 // Token: 0x170005C6 RID: 1478
546 // (get) Token: 0x0600143C RID: 5180 RVA: 0x00083D3A File Offset: 0x00081F3A
547 public override bool IsAliveInCurrentZone
548 {
549 get
550 {
551 return !this.isDead && base.ExistsOnMap;
552 }
553 }
554
555 // Token: 0x170005C7 RID: 1479
556 // (get) Token: 0x0600143D RID: 5181 RVA: 0x00083D4C File Offset: 0x00081F4C
557 public override bool IsDeadOrSleeping
558 {
559 get
560 {
561 return this.isDead || this.conSleep != null || this.conSuspend != null || this.isFainted;
562 }
563 }
564
565 // Token: 0x170005C8 RID: 1480
566 // (get) Token: 0x0600143E RID: 5182 RVA: 0x00083D6E File Offset: 0x00081F6E
567 public override bool IsDisabled
568 {
569 get
570 {
571 return this.isDead || this.conSleep != null || this.isFainted || this.isParalyzed;
572 }
573 }
574
575 // Token: 0x0600143F RID: 5183 RVA: 0x00083D90 File Offset: 0x00081F90
576 public bool IsCriticallyWounded(bool includeRide = false)
577 {
578 if (this.host != null && !includeRide)
579 {
580 return false;
581 }
582 if (base.Evalue(1421) <= 0)
583 {
584 return base.hp < this.MaxHP / 5;
585 }
586 return base.hp + this.mana.value < (this.MaxHP + this.mana.max) / 5;
587 }
588
589 // Token: 0x170005C9 RID: 1481
590 // (get) Token: 0x06001440 RID: 5184 RVA: 0x00083DF1 File Offset: 0x00081FF1
591 public override bool IsMoving
592 {
593 get
594 {
595 return this.idleTimer > 0f;
596 }
597 }
598
599 // Token: 0x170005CA RID: 1482
600 // (get) Token: 0x06001441 RID: 5185 RVA: 0x00083E00 File Offset: 0x00082000
601 public override bool IsGlobal
602 {
603 get
604 {
605 return this.global != null;
606 }
607 }
608
609 // Token: 0x170005CB RID: 1483
610 // (get) Token: 0x06001442 RID: 5186 RVA: 0x00083E0B File Offset: 0x0008200B
611 public override bool IsPC
612 {
613 get
614 {
615 return this == EClass.player.chara;
616 }
617 }
618
619 // Token: 0x170005CC RID: 1484
620 // (get) Token: 0x06001443 RID: 5187 RVA: 0x00083E1A File Offset: 0x0008201A
621 public override bool IsPCParty
622 {
623 get
624 {
625 return this.party != null && this.party.leader == EClass.pc;
626 }
627 }
628
629 // Token: 0x170005CD RID: 1485
630 // (get) Token: 0x06001444 RID: 5188 RVA: 0x00083E38 File Offset: 0x00082038
631 public override bool IsMinion
632 {
633 get
634 {
635 return this.master != null || base.c_uidMaster != 0;
636 }
637 }
638
639 // Token: 0x170005CE RID: 1486
640 // (get) Token: 0x06001445 RID: 5189 RVA: 0x00083E4D File Offset: 0x0008204D
641 public override bool IsPCPartyMinion
642 {
643 get
644 {
645 return this.master != null && (this.master.IsPCParty || this.master.IsPCPartyMinion);
646 }
647 }
648
649 // Token: 0x170005CF RID: 1487
650 // (get) Token: 0x06001446 RID: 5190 RVA: 0x00083E73 File Offset: 0x00082073
651 public override bool IsPCFactionMinion
652 {
653 get
654 {
655 return this.master != null && (this.master.IsPCFaction || this.master.IsPCFactionMinion);
656 }
657 }
658
659 // Token: 0x170005D0 RID: 1488
660 // (get) Token: 0x06001447 RID: 5191 RVA: 0x00083E99 File Offset: 0x00082099
661 public override bool IsPCFaction
662 {
663 get
664 {
665 return EClass.pc != null && this.faction == EClass.pc.faction;
666 }
667 }
668
669 // Token: 0x170005D1 RID: 1489
670 // (get) Token: 0x06001448 RID: 5192 RVA: 0x00083EB6 File Offset: 0x000820B6
671 public override bool IsPCC
672 {
673 get
674 {
675 return this.pccData != null;
676 }
677 }
678
679 // Token: 0x170005D2 RID: 1490
680 // (get) Token: 0x06001449 RID: 5193 RVA: 0x00083EC1 File Offset: 0x000820C1
681 public override bool isThing
682 {
683 get
684 {
685 return false;
686 }
687 }
688
689 // Token: 0x170005D3 RID: 1491
690 // (get) Token: 0x0600144A RID: 5194 RVA: 0x00083EC4 File Offset: 0x000820C4
691 public override bool isChara
692 {
693 get
694 {
695 return true;
696 }
697 }
698
699 // Token: 0x170005D4 RID: 1492
700 // (get) Token: 0x0600144B RID: 5195 RVA: 0x00083EC7 File Offset: 0x000820C7
701 public override bool HasHost
702 {
703 get
704 {
705 return this.host != null;
706 }
707 }
708
709 // Token: 0x170005D5 RID: 1493
710 // (get) Token: 0x0600144C RID: 5196 RVA: 0x00083ED2 File Offset: 0x000820D2
711 public override bool isSynced
712 {
713 get
714 {
715 return this.renderer.isSynced || (this.host != null && this.host.renderer.isSynced);
716 }
717 }
718
719 // Token: 0x170005D6 RID: 1494
720 // (get) Token: 0x0600144D RID: 5197 RVA: 0x00083EFD File Offset: 0x000820FD
721 public override bool IsMultisize
722 {
723 get
724 {
725 return this.sourceCard.multisize;
726 }
727 }
728
729 // Token: 0x170005D7 RID: 1495
730 // (get) Token: 0x0600144E RID: 5198 RVA: 0x00083F0C File Offset: 0x0008210C
731 public override int MaxHP
732 {
733 get
734 {
735 return Mathf.Max(1, ((base.END * 2 + base.STR + base.WIL / 2) * Mathf.Min(base.LV, 25) / 25 + base.END + 10) * base.Evalue(60) / 100 * (int)((this.IsPCFaction ? ((Rarity)100) : ((Rarity)100 + (int)(base.rarity * (Rarity)300))) + (this.IsPC ? (EClass.player.lastEmptyAlly * base.Evalue(1646)) : 0)) / 100);
736 }
737 }
738
739 // Token: 0x170005D8 RID: 1496
740 // (get) Token: 0x0600144F RID: 5199 RVA: 0x00083FA0 File Offset: 0x000821A0
741 public override int WeightLimit
742 {
743 get
744 {
745 return (base.STR * 500 + base.END * 250 + base.Evalue(207) * 2000) * (base.HasElement(1411, 1) ? 5 : 1) + 45000;
746 }
747 }
748
749 // Token: 0x170005D9 RID: 1497
750 // (get) Token: 0x06001450 RID: 5200 RVA: 0x00083FF1 File Offset: 0x000821F1
751 public override int SelfWeight
752 {
753 get
754 {
755 return this.bio.weight * 1000;
756 }
757 }
758
759 // Token: 0x170005DA RID: 1498
760 // (get) Token: 0x06001451 RID: 5201 RVA: 0x00084004 File Offset: 0x00082204
761 public int MaxSummon
762 {
763 get
764 {
765 return (int)(Mathf.Max((int)Mathf.Sqrt((float)base.CHA), 1) + base.Evalue(1647) + ((!base.IsPCFactionOrMinion) ? (base.rarity * (Rarity)5) : Rarity.Normal));
766 }
767 }
768
769 // Token: 0x170005DB RID: 1499
770 // (get) Token: 0x06001452 RID: 5202 RVA: 0x00084039 File Offset: 0x00082239
771 public Element MainElement
772 {
773 get
774 {
775 if (base.c_idMainElement == 0)
776 {
777 return Element.Void;
778 }
779 return this.elements.GetElement(base.c_idMainElement);
780 }
781 }
782
783 // Token: 0x170005DC RID: 1500
784 // (get) Token: 0x06001453 RID: 5203 RVA: 0x0008405C File Offset: 0x0008225C
785 public override int DV
786 {
787 get
788 {
789 if (this.IsPCFaction)
790 {
791 return this.elements.Value(64) / (this.HasCondition<ConWeakness>() ? 2 : 1);
792 }
793 int num = base.LV;
794 if (num > 50)
795 {
796 num = 50 + (num - 50) / 10;
797 }
798 return (num + this.elements.Value(64) * (100 + num + this.race.DV * 5) / 100) / (this.HasCondition<ConWeakness>() ? 2 : 1);
799 }
800 }
801
802 // Token: 0x170005DD RID: 1501
803 // (get) Token: 0x06001454 RID: 5204 RVA: 0x000840D8 File Offset: 0x000822D8
804 public override int PV
805 {
806 get
807 {
808 if (this.IsPCFaction)
809 {
810 return this.elements.Value(65) / (this.HasCondition<ConWeakness>() ? 2 : 1);
811 }
812 int num = base.LV;
813 if (num > 50)
814 {
815 num = 50 + (num - 50) / 10;
816 }
817 return (num + this.elements.Value(65) * (100 + num + this.race.PV * 5) / 100) / (this.HasCondition<ConWeakness>() ? 2 : 1);
818 }
819 }
820
821 // Token: 0x170005DE RID: 1502
822 // (get) Token: 0x06001455 RID: 5205 RVA: 0x00084151 File Offset: 0x00082351
823 public bool CanOpenDoor
824 {
825 get
826 {
827 return base.INT >= 5 || (this.IsPCFaction && this.memberType == FactionMemberType.Default);
828 }
829 }
830
831 // Token: 0x06001456 RID: 5206 RVA: 0x00084174 File Offset: 0x00082374
832 public bool HasHigherGround(Card c)
833 {
834 if (c == null)
835 {
836 return false;
837 }
838 float num = this.renderer.position.y - this.pos.Position(0).y + (this.isLevitating ? 0.4f : 0f);
839 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara.isLevitating) ? 0.4f : 0f);
840 return num > num2 + 0.1f;
841 }
842
843 // Token: 0x06001457 RID: 5207 RVA: 0x0008420B File Offset: 0x0008240B
844 public bool CanSeeSimple(Point p)
845 {
846 return p.IsValid && !p.IsHidden && (!this.IsPC || (this.fov != null && this.fov.lastPoints.ContainsKey(p.index)));
847 }
848
849 // Token: 0x06001458 RID: 5208 RVA: 0x0008424C File Offset: 0x0008244C
850 public bool CanSee(Card c)
851 {
852 if (c == this)
853 {
854 return true;
855 }
856 if (!c.pos.IsValid)
857 {
858 return false;
859 }
860 if (c.isChara)
861 {
862 if (this.hasTelepathy && c.Chara.race.visibleWithTelepathy)
863 {
864 return true;
865 }
866 if (c.isHidden && c != this && !this.canSeeInvisible)
867 {
868 return false;
869 }
870 }
871 return !this.IsPC || (this.fov != null && this.fov.lastPoints.ContainsKey(c.pos.index));
872 }
873
874 // Token: 0x06001459 RID: 5209 RVA: 0x000842D8 File Offset: 0x000824D8
875 public bool CanSeeLos(Card c, int dist = -1, bool includeTelepathy = false)
876 {
877 return (c.isChara && includeTelepathy && this.hasTelepathy && c.Chara.race.visibleWithTelepathy) || ((!c.isHidden || this.canSeeInvisible) && this.CanSeeLos(c.pos, dist));
878 }
879
880 // Token: 0x0600145A RID: 5210 RVA: 0x0008432C File Offset: 0x0008252C
881 public bool CanSeeLos(Point p, int dist = -1)
882 {
883 if (dist == -1)
884 {
885 dist = this.pos.Distance(p);
886 }
887 if (dist > base.GetSightRadius())
888 {
889 return false;
890 }
891 if (this.IsPC)
892 {
893 return this.fov != null && this.fov.lastPoints.ContainsKey(p.index);
894 }
895 return Los.IsVisible(this.pos, p, null);
896 }
897
898 // Token: 0x170005DF RID: 1503
899 // (get) Token: 0x0600145B RID: 5211 RVA: 0x0008438C File Offset: 0x0008258C
900 public Tactics tactics
901 {
902 get
903 {
904 Tactics result;
905 if ((result = this._tactics) == null)
906 {
907 result = (this._tactics = new Tactics(this));
908 }
909 return result;
910 }
911 }
912
913 // Token: 0x170005E0 RID: 1504
914 // (get) Token: 0x0600145C RID: 5212 RVA: 0x000843B2 File Offset: 0x000825B2
915 public TimeTable.Span CurrentSpan
916 {
917 get
918 {
919 return TimeTable.GetSpan(this.idTimeTable, EClass.world.date.hour);
920 }
921 }
922
923 // Token: 0x170005E1 RID: 1505
924 // (get) Token: 0x0600145D RID: 5213 RVA: 0x000843CE File Offset: 0x000825CE
925 public bool IsInActiveZone
926 {
927 get
928 {
929 return this.currentZone == EClass.game.activeZone;
930 }
931 }
932
933 // Token: 0x170005E2 RID: 1506
934 // (get) Token: 0x0600145E RID: 5214 RVA: 0x000843E2 File Offset: 0x000825E2
935 public bool IsLocalChara
936 {
937 get
938 {
939 return !this.IsGlobal && !base.isSubsetCard && this.homeZone == EClass._zone;
940 }
941 }
942
943 // Token: 0x170005E3 RID: 1507
944 // (get) Token: 0x0600145F RID: 5215 RVA: 0x00084403 File Offset: 0x00082603
945 public bool IsIdle
946 {
947 get
948 {
949 return !this.IsDeadOrSleeping && this.ai.Current.IsIdle;
950 }
951 }
952
953 // Token: 0x170005E4 RID: 1508
954 // (get) Token: 0x06001460 RID: 5216 RVA: 0x0008441F File Offset: 0x0008261F
955 public bool IsInCombat
956 {
957 get
958 {
959 return this.ai is GoalCombat;
960 }
961 }
962
963 // Token: 0x170005E5 RID: 1509
964 // (get) Token: 0x06001461 RID: 5217 RVA: 0x0008442F File Offset: 0x0008262F
965 public int DestDist
966 {
967 get
968 {
969 return this.tactics.DestDist;
970 }
971 }
972
973 // Token: 0x170005E6 RID: 1510
974 // (get) Token: 0x06001462 RID: 5218 RVA: 0x0008443C File Offset: 0x0008263C
975 public bool HasNoGoal
976 {
977 get
978 {
979 return this.ai.IsNoGoal;
980 }
981 }
982
983 // Token: 0x170005E7 RID: 1511
984 // (get) Token: 0x06001463 RID: 5219 RVA: 0x00084449 File Offset: 0x00082649
985 public bool CanWitness
986 {
987 get
988 {
989 return this.race.IsHuman || this.race.IsFairy || this.race.IsGod || this.race.id == "mutant";
990 }
991 }
992
993 // Token: 0x170005E8 RID: 1512
994 // (get) Token: 0x06001464 RID: 5220 RVA: 0x00084489 File Offset: 0x00082689
995 public bool IsHuman
996 {
997 get
998 {
999 return this.race.tag.Contains("human");
1000 }
1001 }
1002
1003 // Token: 0x170005E9 RID: 1513
1004 // (get) Token: 0x06001465 RID: 5221 RVA: 0x000844A0 File Offset: 0x000826A0
1005 public bool IsHumanSpeak
1006 {
1007 get
1008 {
1009 return this.IsHuman || this.race.tag.Contains("humanSpeak");
1010 }
1011 }
1012
1013 // Token: 0x170005EA RID: 1514
1014 // (get) Token: 0x06001466 RID: 5222 RVA: 0x000844C1 File Offset: 0x000826C1
1015 public bool IsMaid
1016 {
1017 get
1018 {
1019 return EClass.Branch != null && EClass.Branch.uidMaid == base.uid;
1020 }
1021 }
1022
1023 // Token: 0x170005EB RID: 1515
1024 // (get) Token: 0x06001467 RID: 5223 RVA: 0x000844DE File Offset: 0x000826DE
1025 public bool IsPrisoner
1026 {
1027 get
1028 {
1029 return false;
1030 }
1031 }
1032
1033 // Token: 0x170005EC RID: 1516
1034 // (get) Token: 0x06001468 RID: 5224 RVA: 0x000844E1 File Offset: 0x000826E1
1035 public bool IsAdventurer
1036 {
1037 get
1038 {
1039 return this.global != null && this.faction != EClass.pc.faction && this.IsPCC;
1040 }
1041 }
1042
1043 // Token: 0x170005ED RID: 1517
1044 // (get) Token: 0x06001469 RID: 5225 RVA: 0x00084505 File Offset: 0x00082705
1045 public bool IsEyth
1046 {
1047 get
1048 {
1049 return this.faith.id == "eyth";
1050 }
1051 }
1052
1053 // Token: 0x0600146A RID: 5226 RVA: 0x0008451C File Offset: 0x0008271C
1054 public bool CanSleep()
1055 {
1056 return EClass._zone.events.GetEvent<ZoneEventQuest>() == null && (EClass.debug.godMode || this.sleepiness.GetPhase() != 0 || this.stamina.GetPhase() <= 1);
1057 }
1058
1059 // Token: 0x170005EE RID: 1518
1060 // (get) Token: 0x0600146B RID: 5227 RVA: 0x00084568 File Offset: 0x00082768
1061 public bool IsWealthy
1062 {
1063 get
1064 {
1065 return this.source.works.Contains("Rich") || this.source.hobbies.Contains("Rich");
1066 }
1067 }
1068
1069 // Token: 0x170005EF RID: 1519
1070 // (get) Token: 0x0600146C RID: 5228 RVA: 0x00084598 File Offset: 0x00082798
1071 public FactionBranch homeBranch
1072 {
1073 get
1074 {
1075 Zone homeZone = this.homeZone;
1076 if (homeZone == null)
1077 {
1078 return null;
1079 }
1080 return homeZone.branch;
1081 }
1082 }
1083
1084 // Token: 0x170005F0 RID: 1520
1085 // (get) Token: 0x0600146D RID: 5229 RVA: 0x000845AB File Offset: 0x000827AB
1086 public int MaxGene
1087 {
1088 get
1089 {
1090 return 3;
1091 }
1092 }
1093
1094 // Token: 0x0600146F RID: 5231 RVA: 0x00084638 File Offset: 0x00082838
1095 protected override void OnSerializing()
1096 {
1097 if (this.enemy != null)
1098 {
1099 base.SetInt(55, this.enemy.uid);
1100 }
1101 this._cints[0] = (int)this._cbits1.Bits;
1102 List<BodySlot> slots = this.body.slots;
1103 this.rawSlots = new int[slots.Count];
1104 for (int i = 0; i < slots.Count; i++)
1105 {
1106 this.rawSlots[i] = slots[i].elementId;
1107 }
1108 }
1109
1110 // Token: 0x06001470 RID: 5232 RVA: 0x000846B8 File Offset: 0x000828B8
1111 protected override void OnDeserialized()
1112 {
1113 this.isCreated = true;
1114 this._cbits1.Bits = (uint)this._cints[0];
1115 this.InitStats(true);
1116 this.body.SetOwner(this, true);
1117 this.elements.ApplyElementMap(base.uid, SourceValueType.Chara, this.job.elementMap, base.DefaultLV, false, false);
1118 this.elements.ApplyElementMap(base.uid, SourceValueType.Chara, this.race.elementMap, base.DefaultLV, false, false);
1119 if (this.global != null && this.global.goal != null)
1120 {
1121 this.global.goal.SetOwner(this);
1122 }
1123 if (this.IsPCC)
1124 {
1125 this.pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1126 }
1127 if (this.tempElements != null)
1128 {
1129 this.tempElements.SetParent(this);
1130 }
1131 this.UpdateAngle();
1132 this.RefreshFaithElement();
1133 this.Refresh(false);
1134 if (this.source.tag.Contains("boss"))
1135 {
1136 this.bossText = true;
1137 }
1138 this.sharedCheckTurn = EClass.rnd(200);
1139 }
1140
1141 // Token: 0x06001471 RID: 5233 RVA: 0x000847D8 File Offset: 0x000829D8
1142 public override string GetName(NameStyle style, int num = -1)
1143 {
1144 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1145 {
1146 if (this.id == "follower" && !this.IsGlobal)
1147 {
1148 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, this.faith.Name, null, null, null);
1149 }
1150 return EClass.sources.backers.map[base.c_idBacker].Name;
1151 }
1152 else
1153 {
1154 string text = base.c_altName ?? this.source.GetName(this, false);
1155 text = text.Replace("#ele4", this.MainElement.source.GetAltname(2)).Replace("#ele3", this.MainElement.source.GetAltname(1)).Replace("#ele2", this.MainElement.source.GetAltname(0)).Replace("#ele", this.MainElement.source.GetName().ToLower());
1156 if (base.c_bossType == BossType.Evolved)
1157 {
1158 text = "_evolved".lang(text.ToTitleCase(true), null, null, null, null);
1159 }
1160 this.trait.SetName(ref text);
1161 if (text.Length > 0 && char.IsLower(text[0]))
1162 {
1163 if (base.rarity >= Rarity.Legendary)
1164 {
1165 text = text.ToTitleCase(false);
1166 }
1167 else if (num != 0)
1168 {
1169 text = text.AddArticle();
1170 }
1171 }
1172 if (style == NameStyle.Simple)
1173 {
1174 return text;
1175 }
1176 int num2 = (base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!this._alias.IsEmpty()) ? 1 : -1));
1177 if (this.trait is TraitAdventurer)
1178 {
1179 num2 = 1;
1180 }
1181 if (!this.Aka.IsEmpty())
1182 {
1183 text = ((num2 == 1) ? "_aka3" : ((num2 == -1) ? "_aka" : "_aka2")).lang((num2 == -1) ? this.Aka : this.Aka.ToTitleCase(true), text.Bracket(num2), null, null, null);
1184 }
1185 else
1186 {
1187 text = text.Bracket(num2);
1188 }
1189 string str = base.isSale ? "forSale".lang(Lang._currency(this.GetPrice(CurrencyType.Money, true, PriceType.PlayerShop, null), "money"), null, null, null, null) : "";
1190 return text + str;
1191 }
1192 }
1193
1194 // Token: 0x06001472 RID: 5234 RVA: 0x00084A39 File Offset: 0x00082C39
1195 public override void ChangeRarity(Rarity r)
1196 {
1197 if (r == base.rarity)
1198 {
1199 return;
1200 }
1201 base.rarity = r;
1202 if (this.renderer != null && this.renderer.isSynced)
1203 {
1204 this.renderer.RefreshExtra();
1205 }
1206 base.hp = this.MaxHP;
1207 }
1208
1209 // Token: 0x06001473 RID: 5235 RVA: 0x00084A78 File Offset: 0x00082C78
1210 public void SetFaction(Faction f)
1211 {
1212 this._faction = null;
1213 this.faction = f;
1214 this.hostility = this.faction.GetHostility();
1215 }
1216
1217 // Token: 0x06001474 RID: 5236 RVA: 0x00084A99 File Offset: 0x00082C99
1218 public void SetHomeZone(Zone zone)
1219 {
1220 this.homeZone = zone;
1221 this.SetGlobal();
1222 }
1223
1224 // Token: 0x06001475 RID: 5237 RVA: 0x00084AAC File Offset: 0x00082CAC
1225 public Chara SetGlobal(Zone _home, int x, int z)
1226 {
1227 this.SetGlobal();
1228 this.homeZone = _home;
1229 _home.AddCard(this, x, z);
1230 this.global.transition = new ZoneTransition
1231 {
1232 state = ZoneTransition.EnterState.Exact,
1233 x = x,
1234 z = z
1235 };
1236 this.orgPos = new Point(x, z);
1237 return this;
1238 }
1239
1240 // Token: 0x06001476 RID: 5238 RVA: 0x00084B05 File Offset: 0x00082D05
1241 public Chara SetGlobal()
1242 {
1243 if (!this.IsGlobal)
1244 {
1245 EClass.game.cards.globalCharas.Add(this);
1246 this.global = new GlobalData();
1247 base.isSubsetCard = false;
1248 this.enemy = null;
1249 base.c_uidMaster = 0;
1250 }
1251 return this;
1252 }
1253
1254 // Token: 0x06001477 RID: 5239 RVA: 0x00084B48 File Offset: 0x00082D48
1255 public void RemoveGlobal()
1256 {
1257 if (!this.IsGlobal || this.trait is TraitUniqueChara || base.IsUnique || EClass.game.cards.listAdv.Contains(this))
1258 {
1259 return;
1260 }
1261 this.global = null;
1262 EClass.game.cards.globalCharas.Remove(this);
1263 }
1264
1265 // Token: 0x06001478 RID: 5240 RVA: 0x00084BA8 File Offset: 0x00082DA8
1266 public override void OnBeforeCreate()
1267 {
1268 if (this.source.job == "*r")
1269 {
1270 base.c_idJob = (from j in EClass.sources.jobs.rows
1271 where j.playable < 4
1272 select j).RandomItem<SourceJob.Row>().id;
1273 }
1274 if (this.bp.idJob != null)
1275 {
1276 base.c_idJob = this.bp.idJob;
1277 }
1278 if (this.bp.idRace != null)
1279 {
1280 base.c_idRace = this.bp.idRace;
1281 }
1282 }
1283
1284 // Token: 0x06001479 RID: 5241 RVA: 0x00084C4C File Offset: 0x00082E4C
1285 public override void OnCreate(int genLv)
1286 {
1287 if (this.source.tag.Contains("boss"))
1288 {
1289 this.bossText = true;
1290 }
1291 int num = (this.bp.lv != -999) ? this.bp.lv : base.LV;
1292 if (this.trait.AdvType == TraitChara.Adv_Type.Adv || this.trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1293 {
1294 if (Chara.ListAdvRace.Count == 0)
1295 {
1296 Chara.ListAdvRace = (from a in EClass.sources.races.rows
1297 where a.playable <= 1 && a.id != "fairy"
1298 select a).ToList<SourceRace.Row>();
1299 Chara.ListAdvJob = (from a in EClass.sources.jobs.rows
1300 where a.playable <= 4
1301 select a).ToList<SourceJob.Row>();
1302 }
1303 if (this.trait.AdvType == TraitChara.Adv_Type.Adv)
1304 {
1305 base.c_idRace = Chara.ListAdvRace.RandomItem<SourceRace.Row>().id;
1306 }
1307 base.c_idJob = Chara.ListAdvJob.RandomItem<SourceJob.Row>().id;
1308 this._race = null;
1309 this._job = null;
1310 num = 10 + EClass.rnd(40);
1311 }
1312 this.bio = new Biography();
1313 this.bio.Generate(this);
1314 if (this.source.idActor.Length != 0 && this.source.idActor[0] == "pcc" && this.pccData == null)
1315 {
1316 this.pccData = PCCData.Create(this.IDPCCBodySet);
1317 if (this.source.idActor.Length > 2)
1318 {
1319 this.pccData.SetPart("body", this.IDPCCBodySet, this.source.idActor[2], null);
1320 }
1321 else
1322 {
1323 this.pccData.Randomize(this.IDPCCBodySet, null, true);
1324 }
1325 }
1326 if (this.source.mainElement.Length != 0)
1327 {
1328 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1329 string[] mainElement = this.source.mainElement;
1330 for (int i = 0; i < mainElement.Length; i++)
1331 {
1332 string[] array = mainElement[i].Split('/', StringSplitOptions.None);
1333 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1334 int num2 = this.source.LV * row.eleP / 100 + base.LV - this.source.LV;
1335 if (list.Count == 0 || num2 < genLv)
1336 {
1337 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1338 }
1339 }
1340 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => (float)(10000 / (100 + (genLv - a.Item3) * 25)));
1341 if (!this.bp.idEle.IsEmpty())
1342 {
1343 tuple = (from a in list
1344 where a.Item1 == this.bp.idEle
1345 select a).First<Tuple<string, int, int>>();
1346 }
1347 this.SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, true);
1348 num = tuple.Item3;
1349 }
1350 if (this.source.name == "*r")
1351 {
1352 base.c_altName = NameGen.getRandomName();
1353 }
1354 if (this.source.GetText("aka", false) == "*r" || this.trait.UseRandomAlias)
1355 {
1356 this._alias = AliasGen.GetRandomAlias();
1357 }
1358 this.happiness = EClass.rnd(100);
1359 this.contribution = EClass.rnd(100);
1360 this.RerollHobby(true);
1361 this._idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1362 this.ApplyRace(false);
1363 this.ApplyJob(false);
1364 if (num != this.source.LV)
1365 {
1366 base.SetLv(num);
1367 }
1368 if (base.LV > 5 && this.race.id == "mutant")
1369 {
1370 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1371 {
1372 this.SetFeat(1644, j + 1, false);
1373 }
1374 }
1375 this.InitStats(false);
1376 this.body.SetOwner(this, false);
1377 this.hostility = this.OriginalHostility;
1378 if (this.race.EQ.Length != 0)
1379 {
1380 this.TryRestock(true);
1381 }
1382 string id = this.id;
1383 uint num3 = <PrivateImplementationDetails>.ComputeStringHash(id);
1384 if (num3 <= 2331752522U)
1385 {
1386 if (num3 != 108289031U)
1387 {
1388 if (num3 != 1020922669U)
1389 {
1390 if (num3 != 2331752522U)
1391 {
1392 goto IL_633;
1393 }
1394 if (!(id == "snail"))
1395 {
1396 goto IL_633;
1397 }
1398 base.idSkin = 5;
1399 goto IL_633;
1400 }
1401 else
1402 {
1403 if (!(id == "dodo"))
1404 {
1405 goto IL_633;
1406 }
1407 base.idSkin = EClass.rnd(4);
1408 goto IL_633;
1409 }
1410 }
1411 else if (!(id == "cat"))
1412 {
1413 goto IL_633;
1414 }
1415 }
1416 else if (num3 <= 3253821027U)
1417 {
1418 if (num3 != 2629043432U)
1419 {
1420 if (num3 != 3253821027U)
1421 {
1422 goto IL_633;
1423 }
1424 if (!(id == "sister_undead"))
1425 {
1426 goto IL_633;
1427 }
1428 }
1429 else
1430 {
1431 if (!(id == "olderyoungersister"))
1432 {
1433 goto IL_633;
1434 }
1435 base.idSkin = 1;
1436 goto IL_633;
1437 }
1438 }
1439 else if (num3 != 3352919697U)
1440 {
1441 if (num3 != 3865623817U)
1442 {
1443 goto IL_633;
1444 }
1445 if (!(id == "dog"))
1446 {
1447 goto IL_633;
1448 }
1449 }
1450 else
1451 {
1452 if (!(id == "putty_snow"))
1453 {
1454 goto IL_633;
1455 }
1456 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1457 {
1458 base.idSkin = EClass.rnd(4);
1459 goto IL_633;
1460 }
1461 goto IL_633;
1462 }
1463 base.idSkin = EClass.rnd(this.sourceCard.tiles.Length);
1464 if (this.id == "sister_undead" && EClass.rnd(10) == 0)
1465 {
1466 SourceBacker.Row row2 = EClass.sources.backers.listSister.NextItem(ref BackerContent.indexSister);
1467 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1468 {
1469 base.ApplyBacker(row2.id);
1470 }
1471 }
1472 IL_633:
1473 if (this.source.tag.Contains("random_color"))
1474 {
1475 base.DyeRandom();
1476 }
1477 this.SetAI(new NoGoal());
1478 if (!this.source.faith.IsEmpty())
1479 {
1480 this.SetFaith(this.source.faith);
1481 }
1482 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1483 {
1484 this.SetFaith(EClass.game.religions.Trickery);
1485 }
1486 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1487 {
1488 this.SetFaith(EClass.game.religions.MoonShadow);
1489 }
1490 else
1491 {
1492 this.SetFaith(EClass.game.religions.GetRandomReligion(true, EClass.rnd(10) == 0));
1493 }
1494 this._affinity = 0;
1495 this.interest = 100;
1496 this.CalculateMaxStamina();
1497 this.Refresh(false);
1498 this.stamina.value = this.stamina.max;
1499 this.mana.value = this.mana.max;
1500 this.isCreated = true;
1501 }
1502
1503 // Token: 0x0600147A RID: 5242 RVA: 0x000853CB File Offset: 0x000835CB
1504 public void SetFaith(string id)
1505 {
1506 this.SetFaith(EClass.game.religions.dictAll[id]);
1507 }
1508
1509 // Token: 0x0600147B RID: 5243 RVA: 0x000853E8 File Offset: 0x000835E8
1510 public void SetFaith(Religion r)
1511 {
1512 this.faith = r;
1513 this.RefreshFaithElement();
1514 }
1515
1516 // Token: 0x0600147C RID: 5244 RVA: 0x000853F8 File Offset: 0x000835F8
1517 public void HealAll()
1518 {
1519 this.Cure(CureType.Death, 100, BlessedState.Normal);
1520 base.hp = this.MaxHP;
1521 this.mana.value = this.mana.max;
1522 this.stamina.value = this.stamina.max;
1523 this.Refresh(false);
1524 }
1525
1526 // Token: 0x0600147D RID: 5245 RVA: 0x00085450 File Offset: 0x00083650
1527 public void Refresh(bool calledRecursive = false)
1528 {
1529 if (this.ride != null)
1530 {
1531 this.ride.Refresh(true);
1532 }
1533 this.hasTelepathy = false;
1534 this.isWet = false;
1535 this.isLevitating = (base.HasElement(401, 1) || (this.ride != null && this.ride.isLevitating));
1536 this.canSeeInvisible = base.HasElement(416, 1);
1537 base.isHidden = base.HasElement(415, 1);
1538 foreach (Condition condition in this.conditions)
1539 {
1540 condition.OnRefresh();
1541 }
1542 if (this.isWet)
1543 {
1544 base.isHidden = false;
1545 }
1546 this.SetDirtySpeed();
1547 if (this.host != null && !calledRecursive)
1548 {
1549 this.host.Refresh(true);
1550 }
1551 }
1552
1553 // Token: 0x0600147E RID: 5246 RVA: 0x00085540 File Offset: 0x00083740
1554 public Chara Duplicate()
1555 {
1556 Chara chara = CharaGen.Create(this.id, -1);
1557 chara.mana.value = this.mana.value;
1558 chara.stamina.value = this.stamina.value;
1559 foreach (KeyValuePair<int, Element> keyValuePair in this.elements.dict)
1560 {
1561 Element element = chara.elements.GetElement(keyValuePair.Key);
1562 if (element != null)
1563 {
1564 element.vBase = keyValuePair.Value.ValueWithoutLink - element.vSource;
1565 }
1566 }
1567 chara.SetFaith(this.faith);
1568 chara.bio = IO.DeepCopy<Biography>(this.bio);
1569 chara.hp = Mathf.Max(0, (int)((float)chara.MaxHP * ((float)base.hp / (float)this.MaxHP) * 0.99f));
1570 chara.isCopy = true;
1571 if (base.HaveFur())
1572 {
1573 chara.c_fur = -1;
1574 }
1575 return chara;
1576 }
1577
1578 // Token: 0x0600147F RID: 5247 RVA: 0x00085658 File Offset: 0x00083858
1579 public int GetBurden(Card t = null, int num = -1)
1580 {
1581 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / this.WeightLimit;
1582 if (num2 < 0)
1583 {
1584 num2 = 1000;
1585 }
1586 if (EClass.debug.ignoreWeight && this.IsPC)
1587 {
1588 num2 = 0;
1589 }
1590 int num3 = (num2 < 100) ? 0 : ((num2 - 100) / 10 + 1);
1591 if (num3 > 9)
1592 {
1593 num3 = 9;
1594 }
1595 return num3;
1596 }
1597
1598 // Token: 0x06001480 RID: 5248 RVA: 0x000856CC File Offset: 0x000838CC
1599 public void CalcBurden()
1600 {
1601 int num = base.ChildrenWeight * 100 / this.WeightLimit;
1602 if (num < 0)
1603 {
1604 num = 1000;
1605 }
1606 if (EClass.debug.ignoreWeight && this.IsPC)
1607 {
1608 num = 0;
1609 }
1610 this.burden.Set(num);
1611 this.SetDirtySpeed();
1612 }
1613
1614 // Token: 0x06001481 RID: 5249 RVA: 0x0008571C File Offset: 0x0008391C
1615 public void Stumble(int mtp = 100)
1616 {
1617 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1618 base.Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this, null, null);
1619 int num = this.MaxHP;
1620 if (base.Evalue(1421) > 0)
1621 {
1622 num = this.mana.max;
1623 }
1624 int num2 = (num * (base.ChildrenWeight * 100 / this.WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1625 if (base.hp <= 0)
1626 {
1627 num2 *= 2;
1628 }
1629 base.DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown, null);
1630 }
1631
1632 // Token: 0x170005F1 RID: 1521
1633 // (get) Token: 0x06001482 RID: 5250 RVA: 0x000857D4 File Offset: 0x000839D4
1634 public int Speed
1635 {
1636 get
1637 {
1638 if (this.dirtySpeed)
1639 {
1640 this.RefreshSpeed();
1641 }
1642 return this._Speed;
1643 }
1644 }
1645
1646 // Token: 0x06001483 RID: 5251 RVA: 0x000857EA File Offset: 0x000839EA
1647 public void SetDirtySpeed()
1648 {
1649 this.dirtySpeed = true;
1650 if (this.host != null)
1651 {
1652 this.host.SetDirtySpeed();
1653 }
1654 }
1655
1656 // Token: 0x06001484 RID: 5252 RVA: 0x00085808 File Offset: 0x00083A08
1657 public void RefreshSpeed()
1658 {
1659 if (this.ride != null && !this.ride.IsDeadOrSleeping)
1660 {
1661 this.ride.RefreshSpeed();
1662 this._Speed = this.ride._Speed;
1663 }
1664 else if (this.host != null)
1665 {
1666 if (this.host.ride == this)
1667 {
1668 this._Speed = base.Evalue(79);
1669 this._Speed = this._Speed * 100 / Mathf.Clamp(100 + this._Speed * (this.race.tag.Contains("noRide") ? 5 : 1) - base.STR - this.host.EvalueRiding() * 2 - (this.race.tag.Contains("ride") ? 50 : 0), 100, 1000);
1670 }
1671 else
1672 {
1673 this._Speed = (base.Evalue(79) + this.host.Evalue(79)) / 2;
1674 }
1675 }
1676 else
1677 {
1678 this._Speed = base.Evalue(79) + base.Evalue(407) / 2;
1679 }
1680 BodySlot slot = this.body.GetSlot(37, false, false);
1681 if (((slot != null) ? slot.thing : null) != null && base.HasElement(1209, 1))
1682 {
1683 this._Speed -= 25;
1684 }
1685 int num = 100;
1686 if (this.parasite != null)
1687 {
1688 this._Speed = this._Speed * 100 / Mathf.Clamp(120 + this.parasite.LV * 2 - base.STR - base.Evalue(227) * 2, 100, 1000);
1689 }
1690 if (this.IsPCFaction)
1691 {
1692 switch (this.burden.GetPhase())
1693 {
1694 case 1:
1695 num -= 10;
1696 break;
1697 case 2:
1698 num -= 20;
1699 break;
1700 case 3:
1701 num -= 30;
1702 break;
1703 case 4:
1704 num -= (this.IsPC ? 50 : 100);
1705 break;
1706 }
1707 if (this.IsPC)
1708 {
1709 int phase = this.stamina.GetPhase();
1710 if (phase != 0)
1711 {
1712 if (phase == 1)
1713 {
1714 num -= 10;
1715 }
1716 }
1717 else
1718 {
1719 num -= 20;
1720 }
1721 phase = this.sleepiness.GetPhase();
1722 if (phase != 2)
1723 {
1724 if (phase == 3)
1725 {
1726 num -= 20;
1727 }
1728 }
1729 else
1730 {
1731 num -= 10;
1732 }
1733 switch (this.hunger.GetPhase())
1734 {
1735 case 3:
1736 case 4:
1737 num -= 10;
1738 break;
1739 case 5:
1740 num -= 30;
1741 break;
1742 }
1743 num += EClass.player.lastEmptyAlly * base.Evalue(1646);
1744 }
1745 if (this.IsPCParty && EClass.player.lastEmptyAlly < 0)
1746 {
1747 num += EClass.player.lastEmptyAlly * 10 - 10;
1748 }
1749 }
1750 this._Speed = this._Speed * num / 100;
1751 if (this.HasCondition<ConGravity>())
1752 {
1753 this._Speed = this._Speed * 2 / 3;
1754 }
1755 if (this._Speed < 10)
1756 {
1757 this._Speed = 10;
1758 }
1759 this.dirtySpeed = false;
1760 }
1761
1762 // Token: 0x06001485 RID: 5253 RVA: 0x00085B0C File Offset: 0x00083D0C
1763 public void CalculateMaxStamina()
1764 {
1765 int num = base.END;
1766 foreach (Element element in this.elements.dict.Values)
1767 {
1768 if (element.source.category == "skill")
1769 {
1770 if (this.IsPC)
1771 {
1772 num += Mathf.Max(element.vBase, 0);
1773 }
1774 else
1775 {
1776 num += Mathf.Max(element.ValueWithoutLink, 0);
1777 }
1778 }
1779 }
1780 int num2 = EClass.curve(num, 30, 10, 60);
1781 if (num2 < 10)
1782 {
1783 num2 = 10;
1784 }
1785 this._maxStamina = num2 + 10;
1786 }
1787
1788 // Token: 0x06001486 RID: 5254 RVA: 0x00085BCC File Offset: 0x00083DCC
1789 public override void ApplyEditorTags(EditorTag tag)
1790 {
1791 switch (tag)
1792 {
1793 case EditorTag.HostilityNeutral:
1794 this.hostility = (base.c_originalHostility = Hostility.Neutral);
1795 break;
1796 case EditorTag.HostilityFriend:
1797 this.hostility = (base.c_originalHostility = Hostility.Friend);
1798 break;
1799 case EditorTag.HostilityEnemy:
1800 this.hostility = (base.c_originalHostility = Hostility.Enemy);
1801 break;
1802 default:
1803 if (tag != EditorTag.Male)
1804 {
1805 if (tag == EditorTag.Female)
1806 {
1807 this.bio.SetGender(1);
1808 base.c_idPortrait = Portrait.GetRandomPortrait(1, this.GetIdPortraitCat());
1809 }
1810 }
1811 else
1812 {
1813 this.bio.SetGender(2);
1814 base.c_idPortrait = Portrait.GetRandomPortrait(2, this.GetIdPortraitCat());
1815 }
1816 break;
1817 }
1818 base.ApplyEditorTags(tag);
1819 }
1820
1821 // Token: 0x06001487 RID: 5255 RVA: 0x00085C78 File Offset: 0x00083E78
1822 public override void SetSource()
1823 {
1824 this.source = EClass.sources.charas.map.TryGetValue(this.id, null);
1825 if (this.source == null)
1826 {
1827 Debug.LogWarning("Chara " + this.id + " not found");
1828 this.id = "begger";
1829 this.source = EClass.sources.charas.map[this.id];
1830 }
1831 this.path.walker = this;
1832 }
1833
1834 // Token: 0x06001488 RID: 5256 RVA: 0x00085CFF File Offset: 0x00083EFF
1835 public void SetMainElement(string id, int v = 0, bool elemental = false)
1836 {
1837 if (!id.StartsWith("ele"))
1838 {
1839 id = "ele" + id;
1840 }
1841 this.SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
1842 }
1843
1844 // Token: 0x06001489 RID: 5257 RVA: 0x00085D40 File Offset: 0x00083F40
1845 public void SetMainElement(int id, int v = 0, bool elemental = false)
1846 {
1847 if (base.c_idMainElement != 0)
1848 {
1849 this.elements.SetBase(base.c_idMainElement, 0, 0);
1850 this.elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[base.c_idMainElement].aliasRef].id, -20);
1851 base.c_idMainElement = 0;
1852 }
1853 if (id == 0)
1854 {
1855 return;
1856 }
1857 SourceElement.Row row = EClass.sources.elements.map[id];
1858 base.c_idMainElement = id;
1859 this.elements.ModBase(id, (v == 0) ? 10 : v);
1860 this.elements.ModBase(EClass.sources.elements.alias[row.aliasRef].id, 20);
1861 if (elemental)
1862 {
1863 base.isElemental = true;
1864 this._colorInt = 0;
1865 Color colorSprite = EClass.setting.elements[this.MainElement.source.alias].colorSprite;
1866 base.c_lightColor = (int)((byte)Mathf.Clamp(colorSprite.r * 3f, 1f, 31f)) * 1024 + (int)((byte)Mathf.Clamp(colorSprite.g * 3f, 1f, 31f) * 32) + (int)((byte)Mathf.Clamp(colorSprite.b * 3f, 1f, 31f));
1867 }
1868 this._ability = null;
1869 }
1870
1871 // Token: 0x0600148A RID: 5258 RVA: 0x00085EC0 File Offset: 0x000840C0
1872 public void ApplyJob(bool remove = false)
1873 {
1874 this.elements.ApplyElementMap(base.uid, SourceValueType.Chara, this.job.elementMap, base.DefaultLV, remove, true);
1875 if (this.IsPCC)
1876 {
1877 EClass.game.uniforms.Apply(this.pccData, this.job.id, base.IsMale, true);
1878 }
1879 }
1880
1881 // Token: 0x0600148B RID: 5259 RVA: 0x00085F21 File Offset: 0x00084121
1882 public void ChangeJob(string idNew)
1883 {
1884 this.ApplyJob(true);
1885 base.c_idJob = idNew;
1886 this._job = null;
1887 this.ApplyJob(false);
1888 if (this.IsPCC)
1889 {
1890 PCC.Get(this.pccData).Build(false);
1891 }
1892 }
1893
1894 // Token: 0x0600148C RID: 5260 RVA: 0x00085F58 File Offset: 0x00084158
1895 private int ParseBodySlot(string s)
1896 {
1897 uint num = <PrivateImplementationDetails>.ComputeStringHash(s);
1898 if (num <= 2451230377U)
1899 {
1900 if (num <= 656231480U)
1901 {
1902 if (num != 44370790U)
1903 {
1904 if (num == 656231480U)
1905 {
1906 if (s == "é ­")
1907 {
1908 return 30;
1909 }
1910 }
1911 }
1912 else if (s == "指")
1913 {
1914 return 36;
1915 }
1916 }
1917 else if (num != 1212265771U)
1918 {
1919 if (num == 2451230377U)
1920 {
1921 if (s == "首")
1922 {
1923 return 31;
1924 }
1925 }
1926 }
1927 else if (s == "背")
1928 {
1929 return 33;
1930 }
1931 }
1932 else if (num <= 3467005066U)
1933 {
1934 if (num != 3039685058U)
1935 {
1936 if (num == 3467005066U)
1937 {
1938 if (s == "手")
1939 {
1940 return 35;
1941 }
1942 }
1943 }
1944 else if (s == "è¶³")
1945 {
1946 return 39;
1947 }
1948 }
1949 else if (num != 3477141168U)
1950 {
1951 if (num != 3596583458U)
1952 {
1953 if (num == 4097913071U)
1954 {
1955 if (s == "è…°")
1956 {
1957 return 37;
1958 }
1959 }
1960 }
1961 else if (s == "体")
1962 {
1963 return 32;
1964 }
1965 }
1966 else if (s == "è…•")
1967 {
1968 return 34;
1969 }
1970 return -1;
1971 }
1972
1973 // Token: 0x0600148D RID: 5261 RVA: 0x00086098 File Offset: 0x00084298
1974 public void AddRandomBodyPart(bool msg = false)
1975 {
1976 int num = new int[]
1977 {
1978 30,
1979 31,
1980 33,
1981 35,
1982 35,
1983 36,
1984 34,
1985 37,
1986 39
1987 }.RandomItem<int>();
1988 this.body.AddBodyPart(num, null);
1989 if (msg)
1990 {
1991 base.Say("gain_bodyparts", this, Element.Get(num).GetName().ToLower(), null);
1992 base.PlaySound("offering", 1f, true);
1993 }
1994 }
1995
1996 // Token: 0x0600148E RID: 5262 RVA: 0x000860FC File Offset: 0x000842FC
1997 public void ApplyRace(bool remove = false)
1998 {
1999 foreach (string s in this.race.figure.Split('|', StringSplitOptions.None))
2000 {
2001 int num = this.ParseBodySlot(s);
2002 if (num != -1)
2003 {
2004 if (remove)
2005 {
2006 this.body.RemoveBodyPart(num);
2007 }
2008 else
2009 {
2010 this.body.AddBodyPart(num, null);
2011 }
2012 }
2013 }
2014 this.elements.ApplyElementMap(base.uid, SourceValueType.Chara, this.race.elementMap, base.DefaultLV, remove, true);
2015 }
2016
2017 // Token: 0x0600148F RID: 5263 RVA: 0x0008617E File Offset: 0x0008437E
2018 public void ChangeRace(string idNew)
2019 {
2020 this.ApplyRace(true);
2021 base.c_idRace = idNew;
2022 this._race = null;
2023 this.ApplyRace(false);
2024 base.ChangeMaterial(this.race.material);
2025 }
2026
2027 // Token: 0x06001490 RID: 5264 RVA: 0x000861AE File Offset: 0x000843AE
2028 public void MakePartyMemeber()
2029 {
2030 this._MakeAlly();
2031 EClass.pc.party.AddMemeber(this);
2032 }
2033
2034 // Token: 0x06001491 RID: 5265 RVA: 0x000861C8 File Offset: 0x000843C8
2035 public void MakeAlly(bool msg = true)
2036 {
2037 if (this.IsLocalChara && !base.IsUnique)
2038 {
2039 Debug.Log("Creating Replacement NPC for:" + ((this != null) ? this.ToString() : null));
2040 EClass._map.deadCharas.Add(this.CreateReplacement());
2041 }
2042 if (EClass.pc.homeBranch != null)
2043 {
2044 EClass.pc.homeBranch.AddMemeber(this);
2045 this.orgPos = null;
2046 this.ReleaseMinion();
2047 this.hostility = (base.c_originalHostility = Hostility.Ally);
2048 }
2049 else
2050 {
2051 this._MakeAlly();
2052 }
2053 if (msg)
2054 {
2055 EClass.pc.Say("hire", this, null, null);
2056 EClass.Sound.Play("good");
2057 }
2058 EClass.pc.party.AddMemeber(this);
2059 if (EClass._zone.IsTown)
2060 {
2061 EClass._zone.RefreshListCitizen();
2062 }
2063 }
2064
2065 // Token: 0x06001492 RID: 5266 RVA: 0x000862A4 File Offset: 0x000844A4
2066 public void _MakeAlly()
2067 {
2068 this.SetGlobal();
2069 this.hostility = (base.c_originalHostility = Hostility.Ally);
2070 this.SetFaction(EClass.Home);
2071 this.orgPos = null;
2072 this.ReleaseMinion();
2073 base.SetInt(32, 0);
2074 this.Refresh(false);
2075 }
2076
2077 // Token: 0x06001493 RID: 5267 RVA: 0x000862F0 File Offset: 0x000844F0
2078 public bool CanBeTempAlly(Chara c)
2079 {
2080 return !this.IsPCFaction && !this.IsGlobal && !this.IsMinion && !this.IsMultisize && EClass._zone.CountMinions(c) <= c.MaxSummon && base.rarity < Rarity.Legendary && !base.HasElement(1222, 1);
2081 }
2082
2083 // Token: 0x06001494 RID: 5268 RVA: 0x0008634C File Offset: 0x0008454C
2084 public void MakeMinion(Chara _master, MinionType type = MinionType.Default)
2085 {
2086 this.ReleaseMinion();
2087 this.hostility = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2088 base.c_uidMaster = _master.uid;
2089 base.c_minionType = type;
2090 this.master = _master;
2091 this.Refresh(false);
2092 }
2093
2094 // Token: 0x06001495 RID: 5269 RVA: 0x000863A0 File Offset: 0x000845A0
2095 public void ReleaseMinion()
2096 {
2097 Debug.Log("released:" + ((this != null) ? this.ToString() : null));
2098 base.c_uidMaster = 0;
2099 this.master = null;
2100 this.enemy = null;
2101 foreach (Chara chara in EClass._map.charas)
2102 {
2103 if (chara.enemy == this)
2104 {
2105 chara.SetEnemy(null);
2106 chara.ai.Cancel();
2107 }
2108 }
2109 this.ai.Cancel();
2110 this.Refresh(false);
2111 }
2112
2113 // Token: 0x06001496 RID: 5270 RVA: 0x00086454 File Offset: 0x00084654
2114 public void SetSummon(int duration)
2115 {
2116 base.c_summonDuration = duration;
2117 base.isSummon = true;
2118 }
2119
2120 // Token: 0x06001497 RID: 5271 RVA: 0x00086464 File Offset: 0x00084664
2121 public Chara FindMaster()
2122 {
2123 if (this.IsMinion)
2124 {
2125 this.master = EClass._map.FindChara(base.c_uidMaster);
2126 }
2127 return this.master;
2128 }
2129
2130 // Token: 0x06001498 RID: 5272 RVA: 0x0008648C File Offset: 0x0008468C
2131 public bool IsEscorted()
2132 {
2133 if (!this.IsPCPartyMinion)
2134 {
2135 return false;
2136 }
2137 foreach (Quest quest in EClass.game.quests.list)
2138 {
2139 QuestEscort questEscort = quest as QuestEscort;
2140 if (questEscort != null && questEscort.uidChara == base.uid)
2141 {
2142 return true;
2143 }
2144 }
2145 return false;
2146 }
2147
2148 // Token: 0x06001499 RID: 5273 RVA: 0x00086508 File Offset: 0x00084708
2149 public bool CanDestroyPath()
2150 {
2151 return this.IsMultisize || (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && this.ai is GoalCombat && !EClass._zone.IsPCFaction && !(EClass._zone is Zone_Town));
2152 }
2153
2154 // Token: 0x0600149A RID: 5274 RVA: 0x0008655C File Offset: 0x0008475C
2155 public bool CanMoveTo(Point p, bool allowDestroyPath = true)
2156 {
2157 if (!p.IsValid)
2158 {
2159 return false;
2160 }
2161 int num = (p.z < this.pos.z) ? 0 : ((p.x > this.pos.x) ? 1 : ((p.z > this.pos.z) ? 2 : 3));
2162 if (allowDestroyPath && this.CanDestroyPath())
2163 {
2164 if (!p.IsInBounds)
2165 {
2166 return false;
2167 }
2168 }
2169 else
2170 {
2171 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[this.pos.x, this.pos.z].weights[num] == 0)
2172 {
2173 return false;
2174 }
2175 if (p.x != this.pos.x && p.z != this.pos.z)
2176 {
2177 Cell[,] cells = EClass._map.cells;
2178 int x = p.x;
2179 int z = this.pos.z;
2180 int num2 = (z < this.pos.z) ? 0 : ((x > this.pos.x) ? 1 : ((z > this.pos.z) ? 2 : 3));
2181 if (cells[this.pos.x, this.pos.z].weights[num2] == 0)
2182 {
2183 return false;
2184 }
2185 if (cells[x, z].blocked)
2186 {
2187 return false;
2188 }
2189 num2 = ((z < p.z) ? 0 : ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)));
2190 if (cells[p.x, p.z].weights[num2] == 0)
2191 {
2192 return false;
2193 }
2194 x = this.pos.x;
2195 z = p.z;
2196 num2 = ((z < this.pos.z) ? 0 : ((x > this.pos.x) ? 1 : ((z > this.pos.z) ? 2 : 3)));
2197 if (cells[this.pos.x, this.pos.z].weights[num2] == 0)
2198 {
2199 return false;
2200 }
2201 if (cells[x, z].blocked)
2202 {
2203 return false;
2204 }
2205 num2 = ((z < p.z) ? 0 : ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)));
2206 if (cells[p.x, p.z].weights[num2] == 0)
2207 {
2208 return false;
2209 }
2210 }
2211 }
2212 if (this.IsPC)
2213 {
2214 if (this.IsEnemyOnPath(p, true))
2215 {
2216 return false;
2217 }
2218 }
2219 else if (p.HasChara && !this.IsMultisize && !this.CanReplace(p.FirstChara))
2220 {
2221 return false;
2222 }
2223 return true;
2224 }
2225
2226 // Token: 0x0600149B RID: 5275 RVA: 0x0008681C File Offset: 0x00084A1C
2227 public bool IsEnemyOnPath(Point p, bool cancelAI = true)
2228 {
2229 if (!this.currentZone.IsRegion && p.IsValid)
2230 {
2231 CellDetail detail = p.detail;
2232 if (detail != null && detail.charas.Count > 0)
2233 {
2234 foreach (Chara chara in p.detail.charas)
2235 {
2236 if (chara.IsHostile(this) || !chara.trait.CanBePushed)
2237 {
2238 if (cancelAI && EClass.pc.ai is GoalManualMove)
2239 {
2240 EClass.pc.ai.Cancel();
2241 }
2242 return true;
2243 }
2244 }
2245 return false;
2246 }
2247 }
2248 return false;
2249 }
2250
2251 // Token: 0x0600149C RID: 5276 RVA: 0x000868E8 File Offset: 0x00084AE8
2252 public bool CanInteractTo(Card c)
2253 {
2254 return this.CanInteractTo(c.pos);
2255 }
2256
2257 // Token: 0x0600149D RID: 5277 RVA: 0x000868F8 File Offset: 0x00084AF8
2258 public bool CanInteractTo(Point p)
2259 {
2260 if (!p.IsValid)
2261 {
2262 return false;
2263 }
2264 if (EClass._map.cells[p.x, p.z].blocked)
2265 {
2266 return true;
2267 }
2268 int num = (p.z < this.pos.z) ? 0 : ((p.x > this.pos.x) ? 1 : ((p.z > this.pos.z) ? 2 : 3));
2269 if (EClass._map.cells[this.pos.x, this.pos.z].weights[num] == 0)
2270 {
2271 return false;
2272 }
2273 if (p.x != this.pos.x && p.z != this.pos.z)
2274 {
2275 Cell[,] cells = EClass._map.cells;
2276 int x = p.x;
2277 int z = this.pos.z;
2278 int num2 = (z < this.pos.z) ? 0 : ((x > this.pos.x) ? 1 : ((z > this.pos.z) ? 2 : 3));
2279 if (cells[this.pos.x, this.pos.z].weights[num2] == 0)
2280 {
2281 return false;
2282 }
2283 num2 = ((z < p.z) ? 0 : ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)));
2284 if (cells[p.x, p.z].weights[num2] == 0)
2285 {
2286 return false;
2287 }
2288 x = this.pos.x;
2289 z = p.z;
2290 num2 = ((z < this.pos.z) ? 0 : ((x > this.pos.x) ? 1 : ((z > this.pos.z) ? 2 : 3)));
2291 if (cells[this.pos.x, this.pos.z].weights[num2] == 0)
2292 {
2293 return false;
2294 }
2295 num2 = ((z < p.z) ? 0 : ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)));
2296 if (cells[p.x, p.z].weights[num2] == 0)
2297 {
2298 return false;
2299 }
2300 }
2301 return true;
2302 }
2303
2304 // Token: 0x0600149E RID: 5278 RVA: 0x00086B4B File Offset: 0x00084D4B
2305 public Point GetFirstStep(Point newPoint, PathManager.MoveType moveType = PathManager.MoveType.Default)
2306 {
2307 return PathManager.Instance.GetFirstStep(this.pos, newPoint, this, this.IsPC ? 40 : 10, this.IsMultisize ? PathManager.MoveType.Default : moveType);
2308 }
2309
2310 // Token: 0x0600149F RID: 5279 RVA: 0x00086B7C File Offset: 0x00084D7C
2311 public bool MoveRandom()
2312 {
2313 Point randomNeighbor = this.pos.GetRandomNeighbor();
2314 return !randomNeighbor.Equals(this.pos) && !randomNeighbor.HasChara && this.TryMove(randomNeighbor, true) == Card.MoveResult.Success;
2315 }
2316
2317 // Token: 0x060014A0 RID: 5280 RVA: 0x00086BB8 File Offset: 0x00084DB8
2318 public bool MoveNeighborDefinitely()
2319 {
2320 List<Point> list = new List<Point>();
2321 this.pos.ForeachNeighbor(delegate(Point p)
2322 {
2323 list.Add(p.Copy());
2324 }, true);
2325 list.Shuffle<Point>();
2326 foreach (Point point in list)
2327 {
2328 if (!point.Equals(this.pos) && !point.HasChara && this.TryMove(point, true) == Card.MoveResult.Success)
2329 {
2330 return true;
2331 }
2332 }
2333 return false;
2334 }
2335
2336 // Token: 0x060014A1 RID: 5281 RVA: 0x00086C64 File Offset: 0x00084E64
2337 public void MoveByForce(Point newPoint, Card c = null, bool checkWall = false)
2338 {
2339 if (newPoint.sourceBlock.tileType.IsBlockPass)
2340 {
2341 return;
2342 }
2343 if (checkWall && (base.Dist(newPoint) > 1 || !this.CanMoveTo(newPoint, false)))
2344 {
2345 return;
2346 }
2347 if (this._Move(newPoint, Card.MoveType.Force) == Card.MoveResult.Success && this.ai.Current.CancelWhenMoved)
2348 {
2349 this.ai.Current.TryCancel(c);
2350 }
2351 }
2352
2353 // Token: 0x060014A2 RID: 5282 RVA: 0x00086CCC File Offset: 0x00084ECC
2354 public Card.MoveResult TryMoveTowards(Point p)
2355 {
2356 if (p.Equals(this.pos))
2357 {
2358 return Card.MoveResult.Success;
2359 }
2360 if (this.IsPC && EClass.player.TooHeavyToMove())
2361 {
2362 return Card.MoveResult.Fail;
2363 }
2364 Chara._sharedPos.Set(p);
2365 if (this.CanDestroyPath())
2366 {
2367 this.TryMove(this.pos.GetPointTowards(Chara._sharedPos), true);
2368 }
2369 int num = this.pos.Distance(p);
2370 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(this.pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2371 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2372 {
2373 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2374 if (this.TryMove(new Point(pathFinderNode.X, pathFinderNode.Z), true) == Card.MoveResult.Success)
2375 {
2376 return Card.MoveResult.Success;
2377 }
2378 }
2379 pathProgress = PathManager.Instance.RequestPathImmediate(this.pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2380 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2381 {
2382 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2383 if (this.TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z), true) == Card.MoveResult.Success)
2384 {
2385 return Card.MoveResult.Success;
2386 }
2387 }
2388 pathProgress = PathManager.Instance.RequestPathImmediate(this.pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2389 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2390 {
2391 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2392 if (this.TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z), true) == Card.MoveResult.Success)
2393 {
2394 return Card.MoveResult.Success;
2395 }
2396 }
2397 pathProgress = PathManager.Instance.RequestPathImmediate(this.pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2398 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2399 {
2400 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2401 if (this.TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z), true) == Card.MoveResult.Success)
2402 {
2403 return Card.MoveResult.Success;
2404 }
2405 }
2406 return Card.MoveResult.Fail;
2407 }
2408
2409 // Token: 0x060014A3 RID: 5283 RVA: 0x00086F08 File Offset: 0x00085108
2410 public Card.MoveResult TryMoveFrom(Point p)
2411 {
2412 if (this.IsPC && EClass.player.TooHeavyToMove())
2413 {
2414 return Card.MoveResult.Fail;
2415 }
2416 Point point = p.Copy();
2417 int num = p.x - this.pos.x;
2418 int num2 = p.z - this.pos.z;
2419 if (num > 1)
2420 {
2421 num = 1;
2422 }
2423 else if (num < -1)
2424 {
2425 num = -1;
2426 }
2427 if (num2 > 1)
2428 {
2429 num2 = 1;
2430 }
2431 else if (num2 < -1)
2432 {
2433 num2 = -1;
2434 }
2435 if (num == 0 && num2 == 0)
2436 {
2437 num = EClass.rnd(3) - 1;
2438 num2 = EClass.rnd(3) - 1;
2439 }
2440 point.Set(this.pos);
2441 point.x -= num;
2442 point.z -= num2;
2443 if (point.IsValid && !point.HasChara)
2444 {
2445 return this.TryMove(point, false);
2446 }
2447 return Card.MoveResult.Fail;
2448 }
2449
2450 // Token: 0x060014A4 RID: 5284 RVA: 0x00086FD0 File Offset: 0x000851D0
2451 public Card.MoveResult TryMove(Point newPoint, bool allowDestroyPath = true)
2452 {
2453 using (List<Condition>.Enumerator enumerator = this.conditions.GetEnumerator())
2454 {
2455 while (enumerator.MoveNext())
2456 {
2457 if (!enumerator.Current.TryMove(newPoint))
2458 {
2459 return Card.MoveResult.Fail;
2460 }
2461 }
2462 }
2463 if (base.isRestrained)
2464 {
2465 if (!this.IsPC)
2466 {
2467 return Card.MoveResult.Fail;
2468 }
2469 base.isRestrained = false;
2470 }
2471 if (!this.CanMoveTo(newPoint, allowDestroyPath))
2472 {
2473 return Card.MoveResult.Fail;
2474 }
2475 return this._Move(newPoint, Card.MoveType.Walk);
2476 }
2477
2478 // Token: 0x060014A5 RID: 5285 RVA: 0x00087058 File Offset: 0x00085258
2479 public override Card.MoveResult _Move(Point newPoint, Card.MoveType type = Card.MoveType.Walk)
2480 {
2481 if (this.isDead)
2482 {
2483 return Card.MoveResult.Fail;
2484 }
2485 if (this.IsPC)
2486 {
2487 float num = EClass.setting.defaultActPace;
2488 switch (this.burden.GetPhase())
2489 {
2490 case 3:
2491 num *= 1.5f;
2492 break;
2493 case 4:
2494 num *= 2f;
2495 break;
2496 }
2497 if (this.currentZone.IsRegion)
2498 {
2499 int num2 = 30;
2500 if (!EClass.pc.HasElement(408, 1))
2501 {
2502 switch (EClass.world.weather.CurrentCondition)
2503 {
2504 case Weather.Condition.Rain:
2505 num2 += 5;
2506 break;
2507 case Weather.Condition.RainHeavy:
2508 num2 += 10;
2509 num *= 1.5f;
2510 break;
2511 case Weather.Condition.Snow:
2512 num2 += 10;
2513 break;
2514 case Weather.Condition.SnowHeavy:
2515 num2 += 15;
2516 num *= 1.5f;
2517 break;
2518 }
2519 }
2520 if (newPoint.matFloor.id == 48)
2521 {
2522 num2 += 20;
2523 num *= 1.8f;
2524 }
2525 num2 = num2 * 100 / (100 + base.Evalue(240) + base.Evalue(407) * 5);
2526 EClass.world.date.AdvanceMin(num2 * 6);
2527 EClass.player.lastZonePos = null;
2528 EClass.player.distanceTravel++;
2529 int hp = base.hp;
2530 for (int i = 0; i < num2 * 4; i++)
2531 {
2532 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2533 {
2534 if (!m.isDead)
2535 {
2536 m.TickConditions();
2537 }
2538 });
2539 if (base.hp < this.MaxHP / 5 && base.hp < hp && !EClass.player.regionMoveWarned)
2540 {
2541 EClass.player.regionMoveWarned = true;
2542 Msg.Say("regionAbortMove");
2543 EInput.Consume(true, 1);
2544 this.SetAI(new NoGoal());
2545 return Card.MoveResult.Fail;
2546 }
2547 }
2548 if (newPoint.cell.CanSuffocate())
2549 {
2550 this.AddCondition<ConSuffocation>((EClass.pc.Evalue(200) > 0) ? (2000 / (100 + base.Evalue(200) * 10)) : 30, false);
2551 ConSuffocation condition = this.GetCondition<ConSuffocation>();
2552 int num3 = (condition != null) ? condition.GetPhase() : 0;
2553 if (num3 >= 2)
2554 {
2555 base.DamageHP(EClass.rndHalf(10 + this.MaxHP / 5), AttackSource.Condition, null);
2556 }
2557 if (!this.isDead)
2558 {
2559 base.ModExp(200, 8 + num3 * 12);
2560 }
2561 }
2562 EClass.player.regionMoveWarned = false;
2563 if (this.isDead)
2564 {
2565 return Card.MoveResult.Fail;
2566 }
2567 }
2568 if (num > EClass.setting.defaultActPace * 3f)
2569 {
2570 num = EClass.setting.defaultActPace * 3f;
2571 }
2572 this.actTime = num;
2573 }
2574 Chara chara = (this.ride == null) ? this : this.ride;
2575 if ((!EClass._zone.IsRegion || chara.IsPC) && ((chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(this.IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215, 1))) && newPoint.Distance(this.pos) <= 1)
2576 {
2577 Point randomNeighbor = this.pos.GetRandomNeighbor();
2578 if (this.CanMoveTo(randomNeighbor, false))
2579 {
2580 newPoint = randomNeighbor;
2581 if (this.isDrunk)
2582 {
2583 base.Talk("drunk", null, null, false);
2584 }
2585 }
2586 }
2587 if (newPoint.x != this.pos.x || newPoint.z != this.pos.z)
2588 {
2589 this.LookAt(newPoint);
2590 }
2591 CellEffect effect = base.Cell.effect;
2592 if (effect != null && effect.id == 7)
2593 {
2594 CellEffect effect2 = base.Cell.effect;
2595 if (this.race.height < 500 && !this.race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2596 {
2597 base.Say("abWeb_caught", this, null, null);
2598 base.PlaySound("web", 1f, true);
2599 effect2.power = effect2.power * 3 / 4;
2600 this.renderer.PlayAnime(AnimeID.Shiver, default(Vector3), false);
2601 return Card.MoveResult.Fail;
2602 }
2603 base.Say("abWeb_pass", this, null, null);
2604 EClass._map.SetEffect((int)base.Cell.x, (int)base.Cell.z, null);
2605 }
2606 if (this.IsPC)
2607 {
2608 if (EClass._zone.IsRegion)
2609 {
2610 this.actTime *= EClass.setting.render.anime.regionSpeed;
2611 }
2612 else if ((newPoint.x > this.pos.x && newPoint.z > this.pos.z) || (newPoint.x < this.pos.x && newPoint.z < this.pos.z))
2613 {
2614 this.actTime += this.actTime * EClass.setting.render.anime.diagonalSpeed;
2615 }
2616 }
2617 if (newPoint.cell.hasDoor)
2618 {
2619 foreach (Thing thing in this.pos.Things)
2620 {
2621 TraitDoor traitDoor = thing.trait as TraitDoor;
2622 if (traitDoor != null && traitDoor.owner.c_lockLv > 0)
2623 {
2624 if (base.INT < 10)
2625 {
2626 return Card.MoveResult.Fail;
2627 }
2628 traitDoor.TryOpenLock(this, true);
2629 return Card.MoveResult.Door;
2630 }
2631 }
2632 }
2633 Cell cell = newPoint.cell;
2634 Cell cell2 = this.pos.cell;
2635 bool flag = cell.HasLiquid && !this.isLevitating;
2636 bool hasBridge = cell.HasBridge;
2637 bool hasRamp = cell.HasRamp;
2638 bool flag2 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2639 TileRow tileRow = hasRamp ? cell.sourceBlock : (hasBridge ? cell.sourceBridge : cell.sourceFloor);
2640 SourceMaterial.Row row = hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor);
2641 bool flag3 = cell.IsTopWater && !cell.isFloating;
2642 if (!EClass._zone.IsRegion)
2643 {
2644 if (cell.hasDoorBoat)
2645 {
2646 tileRow = FLOOR.sourceWood;
2647 row = MATERIAL.sourceOak;
2648 flag3 = false;
2649 }
2650 else if (flag2 && !tileRow.ignoreSnow)
2651 {
2652 if (tileRow.tileType.IsWater)
2653 {
2654 tileRow = FLOOR.sourceIce;
2655 row = MATERIAL.sourceIce;
2656 }
2657 else
2658 {
2659 tileRow = FLOOR.sourceSnow;
2660 row = MATERIAL.sourceSnow;
2661 }
2662 flag3 = false;
2663 }
2664 }
2665 if ((this.pos.sourceFloor.isBeach || cell2.IsSnowTile) && !this.pos.HasObj)
2666 {
2667 EClass._map.SetFoormark(this.pos, 1, (int)Util.GetAngle((float)(this.pos.x - newPoint.x), (float)(this.pos.z - newPoint.z)), cell2.IsSnowTile ? 312 : 304);
2668 }
2669 if (this.isSynced)
2670 {
2671 string text = (flag || flag3) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default"));
2672 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2673 {
2674 text = cell.matObj.soundFoot;
2675 }
2676 if (!text.IsEmpty())
2677 {
2678 SoundManager.altLastData = this.IsPC;
2679 base.PlaySound("Footstep/" + text, this.IsPC ? 1f : 0.9f, true);
2680 }
2681 if (!flag3)
2682 {
2683 Scene scene = EClass.scene;
2684 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2685 bool flag4 = scene.actionMode.gameSpeed > 1f;
2686 scene.psFoot.transform.position = this.renderer.position + pcOrbit.footPos;
2687 scene.psFoot.startColor = row.matColor;
2688 scene.psFoot.Emit(pcOrbit.emitFoot * (flag4 ? 2 : 1));
2689 if (flag4 && this.IsPC)
2690 {
2691 scene.psSmoke.transform.position = this.renderer.position + pcOrbit.smokePos;
2692 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2693 }
2694 }
2695 if (flag || flag3)
2696 {
2697 Effect.Get("ripple").Play(0.4f * this.actTime * EClass.scene.actionMode.gameSpeed, newPoint, 0f, null, null);
2698 }
2699 }
2700 this.lastPos.Set(this.pos);
2701 if (type != Card.MoveType.Force)
2702 {
2703 if (newPoint.HasChara && this.ai.Current.PushChara)
2704 {
2705 this.TryPush(newPoint);
2706 }
2707 if (newPoint.HasChara && newPoint.Charas.Count == 1)
2708 {
2709 Chara chara2 = newPoint.Charas[0];
2710 if (this.CanReplace(chara2))
2711 {
2712 chara2.MoveByForce(this.lastPos, this, false);
2713 if (chara.IsPC)
2714 {
2715 base.Say("replace_pc", chara, chara2, null, null);
2716 }
2717 }
2718 }
2719 }
2720 if (cell.hasDoor)
2721 {
2722 foreach (Thing thing2 in newPoint.Things)
2723 {
2724 TraitDoor traitDoor2 = thing2.trait as TraitDoor;
2725 if (traitDoor2 != null)
2726 {
2727 traitDoor2.TryOpen(this);
2728 }
2729 }
2730 }
2731 EClass._zone.map.MoveCard(newPoint, this);
2732 this.SyncRide();
2733 if (this.IsPC && EClass._zone.PetFollow && (!EClass._zone.KeepAllyDistance || !EClass.game.config.tactics.allyKeepDistance) && !EClass._zone.IsRegion)
2734 {
2735 foreach (Chara chara3 in EClass.pc.party.members)
2736 {
2737 if (chara3.isLeashed && !chara3.IsPC && chara3.host == null && !chara3.IsDisabled && !chara3.HasCondition<ConEntangle>() && !chara3.IsInCombat && chara3.Dist(EClass.pc) > 1)
2738 {
2739 chara3.TryMoveTowards(EClass.pc.pos);
2740 }
2741 }
2742 }
2743 if (EClass.core.config.test.animeFramePCC == 0 && this.isSynced && this.renderer.hasActor && this.renderer.actor.isPCC)
2744 {
2745 this.renderer.NextFrame();
2746 }
2747 if (this.IsPC)
2748 {
2749 base.PlaySound("Footstep/Extra/pcfootstep", 1f, true);
2750 if (this.pos.HasThing)
2751 {
2752 foreach (Card card in this.pos.ListCards(false))
2753 {
2754 if (card.isThing && card.placeState == PlaceState.roaming && !card.ignoreAutoPick)
2755 {
2756 this.Pick(card.Thing, true, true);
2757 }
2758 }
2759 }
2760 if (EClass._zone.IsRegion)
2761 {
2762 EloMap.Cell cell3 = EClass.scene.elomap.GetCell(EClass.pc.pos);
2763 if (((cell3 != null) ? cell3.zone : null) != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
2764 {
2765 Msg.Say((!cell3.zone.source.GetText("textFlavor", false).IsEmpty()) ? cell3.zone.source.GetText("textFlavor", false) : (cell3.zone.ShowDangerLv ? "seeZoneDanger" : "seeZone"), cell3.zone.Name, cell3.zone.DangerLv.ToString() ?? "", null, null);
2766 }
2767 if (this.pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
2768 {
2769 Msg.SetColor(Msg.colors.Ono);
2770 Msg.Say(Lang.GetList("walk_snow").RandomItem<string>());
2771 }
2772 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
2773 {
2774 Msg.SetColor(Msg.colors.Ono);
2775 Msg.Say(Lang.GetList("walk_storm").RandomItem<string>());
2776 }
2777 }
2778 ActWait.Search(EClass.pc, false);
2779 }
2780 if (this.IsPCC)
2781 {
2782 int num4 = Mathf.Abs((int)(cell2.topHeight - cell.topHeight));
2783 if ((num4 >= 3 && this.lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
2784 {
2785 this.renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num4 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall), default(Vector3), false);
2786 }
2787 else
2788 {
2789 float surfaceHeight = cell2.GetSurfaceHeight();
2790 float surfaceHeight2 = cell.GetSurfaceHeight();
2791 num4 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
2792 if (num4 >= 15)
2793 {
2794 this.renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num4 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall), default(Vector3), false);
2795 }
2796 }
2797 }
2798 this.lastPos.Things.ForeachReverse(delegate(Thing t)
2799 {
2800 t.trait.OnSteppedOut(this);
2801 });
2802 if (!this.IsPC)
2803 {
2804 this.pos.Things.ForeachReverse(delegate(Thing t)
2805 {
2806 t.trait.OnStepped(this);
2807 });
2808 }
2809 if (this.CanDestroyPath())
2810 {
2811 this.DestroyPath(this.pos);
2812 }
2813 if (this.IsPC)
2814 {
2815 if (this.renderer.anime == null && this.renderer.replacer != null)
2816 {
2817 this.renderer.PlayAnime(AnimeID.Hop, default(Vector3), false);
2818 }
2819 if (EClass.player.flags.isShoesOff)
2820 {
2821 if (!FLOOR.IsTatami(this.pos.cell.sourceSurface.id) && this.pos.cell.room == null)
2822 {
2823 EClass.player.flags.isShoesOff = false;
2824 EClass.pc.Say("shoes_on", EClass.pc, null, null);
2825 EClass.pc.SetPCCState(PCCState.Normal);
2826 }
2827 }
2828 else if (FLOOR.IsTatami(this.pos.cell.sourceSurface.id) && this.pos.cell.room != null)
2829 {
2830 EClass.player.flags.isShoesOff = true;
2831 EClass.pc.Say("shoes_off", EClass.pc, null, null);
2832 EClass.pc.SetPCCState(PCCState.ShoesOff);
2833 }
2834 }
2835 this.hasMovedThisTurn = true;
2836 return Card.MoveResult.Success;
2837 }
2838
2839 // Token: 0x060014A6 RID: 5286 RVA: 0x0008802C File Offset: 0x0008622C
2840 public void DestroyPath(Point pos)
2841 {
2842 bool broke = false;
2843 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
2844 {
2845 if (!_p.IsValid)
2846 {
2847 return;
2848 }
2849 if (_p.HasBlock)
2850 {
2851 EClass._map.MineBlock(_p, false, this);
2852 if (_p.HasObj)
2853 {
2854 EClass._map.MineObj(_p, null, this);
2855 }
2856 broke = true;
2857 }
2858 if (_p.HasObj && _p.IsBlocked)
2859 {
2860 EClass._map.MineObj(_p, null, this);
2861 broke = true;
2862 }
2863 _p.Things.ForeachReverse(delegate(Thing t)
2864 {
2865 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
2866 {
2867 if (t.isNPCProperty && t.trait.CanBeDestroyed)
2868 {
2869 t.Destroy();
2870 return;
2871 }
2872 t.SetPlaceState(PlaceState.roaming, false);
2873 }
2874 });
2875 });
2876 if (broke)
2877 {
2878 Msg.Say("stomp");
2879 Shaker.ShakeCam("stomp", 1f);
2880 }
2881 }
2882
2883 // Token: 0x060014A7 RID: 5287 RVA: 0x00088090 File Offset: 0x00086290
2884 public void TryPush(Point point)
2885 {
2886 point.Charas.ForeachReverse(delegate(Chara c)
2887 {
2888 if (c.ai.IsMoveAI || c.IsPC || !c.trait.CanBePushed || c == this || c.noMove)
2889 {
2890 return;
2891 }
2892 List<Point> list = new List<Point>();
2893 for (int i = point.x - 1; i <= point.x + 1; i++)
2894 {
2895 for (int j = point.z - 1; j <= point.z + 1; j++)
2896 {
2897 if (i != point.x || j != point.z)
2898 {
2899 Point point2 = new Point(i, j);
2900 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
2901 {
2902 list.Add(point2);
2903 }
2904 }
2905 }
2906 }
2907 if (list.Count > 0)
2908 {
2909 if (list.Count > 1)
2910 {
2911 list.ForeachReverse(delegate(Point p)
2912 {
2913 if (p.Equals(new Point(point.x + point.x - this.pos.x, point.z + point.z - this.pos.z)))
2914 {
2915 list.Remove(p);
2916 }
2917 });
2918 }
2919 Point newPoint = list.RandomItem<Point>();
2920 if (this.IsPC)
2921 {
2922 this.Say("displace", this, c, null, null);
2923 this.PlaySound("push", 1f, true);
2924 }
2925 else if (c.isSynced)
2926 {
2927 c.PlayEffect("push", true, 0f, default(Vector3));
2928 }
2929 c.MoveByForce(newPoint, this, true);
2930 if (this.IsPC && !c.IsPCParty && !c.IsUnique && c.IsHuman && EClass.rnd(5) == 0)
2931 {
2932 c.Talk("pushed", null, null, false);
2933 }
2934 }
2935 });
2936 }
2937
2938 // Token: 0x060014A8 RID: 5288 RVA: 0x000880D0 File Offset: 0x000862D0
2939 public bool CanReplace(Chara c)
2940 {
2941 if (c.IsMultisize || !c.trait.CanBePushed || c.noMove || this.IsHostile(c) || this.IsMinion)
2942 {
2943 return false;
2944 }
2945 if (this.IsPC)
2946 {
2947 return true;
2948 }
2949 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
2950 {
2951 return false;
2952 }
2953 if (!this.IsHostile(c))
2954 {
2955 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || this.IsEscorted())
2956 {
2957 return true;
2958 }
2959 if (this.DestDist < c.DestDist)
2960 {
2961 return true;
2962 }
2963 if (this.IsPCParty && !c.IsPCParty)
2964 {
2965 return true;
2966 }
2967 if (this.IsPCFaction && c.IsPCFaction && !c.IsPCParty)
2968 {
2969 return true;
2970 }
2971 }
2972 return false;
2973 }
2974
2975 // Token: 0x060014A9 RID: 5289 RVA: 0x000881A8 File Offset: 0x000863A8
2976 public void MoveZone(string alias)
2977 {
2978 this.MoveZone(EClass.game.spatials.Find(alias), ZoneTransition.EnterState.Auto);
2979 }
2980
2981 // Token: 0x060014AA RID: 5290 RVA: 0x000881C1 File Offset: 0x000863C1
2982 public void MoveZone(Zone z, ZoneTransition.EnterState state = ZoneTransition.EnterState.Auto)
2983 {
2984 this.MoveZone(z, new ZoneTransition
2985 {
2986 state = state
2987 });
2988 }
2989
2990 // Token: 0x060014AB RID: 5291 RVA: 0x000881D8 File Offset: 0x000863D8
2991 public void MoveZone(Zone z, ZoneTransition transition)
2992 {
2993 if (z == this.currentZone)
2994 {
2995 return;
2996 }
2997 if (this.IsPC)
2998 {
2999 EClass.player.nextZone = z;
3000 if (this.IsInActiveZone && !EClass.player.simulatingZone)
3001 {
3002 if (this.held != null && this.held.trait.CanOnlyCarry)
3003 {
3004 this.DropHeld(null);
3005 }
3006 if (z.instance == null && this.currentZone.instance == null && !EClass.player.deathZoneMove && !EClass.pc.isDead && (z.IsPCFaction || z.WillAutoSave) && z.GetTopZone() != EClass._zone.GetTopZone())
3007 {
3008 if (EClass.player.returnInfo != null)
3009 {
3010 EClass.player.returnInfo.turns += 5;
3011 }
3012 if (!EClass.debug.ignoreAutoSave)
3013 {
3014 EClass.game.Save(true, null, false);
3015 }
3016 }
3017 EClass.player.deathZoneMove = false;
3018 }
3019 this.currentZone.events.OnLeaveZone();
3020 if (this.currentZone.instance != null)
3021 {
3022 ZoneInstance instance = this.currentZone.instance;
3023 z = EClass.game.spatials.Find(instance.uidZone);
3024 transition = new ZoneTransition
3025 {
3026 state = instance.ReturnState,
3027 x = instance.x,
3028 z = instance.z
3029 };
3030 instance.OnLeaveZone();
3031 Debug.Log(z);
3032 }
3033 EInput.Consume(true, 1);
3034 EClass.player.uidLastZone = this.currentZone.uid;
3035 if (!EClass.player.simulatingZone)
3036 {
3037 if (this.currentZone.IsRegion)
3038 {
3039 Msg.Say("enterZone", z.Name, null, null, null);
3040 }
3041 else
3042 {
3043 if (z.IsRegion)
3044 {
3045 Msg.Say("leaveZone", this.currentZone.Name, null, null, null);
3046 }
3047 else if (z.id != this.currentZone.id)
3048 {
3049 Msg.Say("enterZone", z.Name, null, null, null);
3050 }
3051 EClass.player.lastZonePos = this.pos.Copy();
3052 }
3053 EClass.player.lastTransition = transition;
3054 }
3055 foreach (Chara t in (from c in EClass._map.charas
3056 where c.IsPCPartyMinion && c.master != EClass.pc
3057 select c).ToList<Chara>())
3058 {
3059 EClass._zone.RemoveCard(t);
3060 }
3061 EClass.player.listSummon = (from c in EClass._map.charas
3062 where c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default
3063 select c).ToList<Chara>();
3064 foreach (Chara t2 in EClass.player.listSummon)
3065 {
3066 EClass._zone.RemoveCard(t2);
3067 }
3068 }
3069 if (this.party != null && this.party.leader == this)
3070 {
3071 foreach (Chara chara in this.party.members)
3072 {
3073 if (chara != this && !chara.isDead && chara.parent is Zone)
3074 {
3075 chara.MoveZone(z, ZoneTransition.EnterState.Auto);
3076 }
3077 }
3078 }
3079 if (this.global == null)
3080 {
3081 Debug.Log(base.Name);
3082 return;
3083 }
3084 ZoneTransition zoneTransition = transition;
3085 Zone currentZone = this.currentZone;
3086 zoneTransition.uidLastZone = ((currentZone != null) ? currentZone.uid : 0);
3087 this.global.transition = transition;
3088 if (z.IsActiveZone)
3089 {
3090 Point spawnPos = z.GetSpawnPos(this, ZoneTransition.EnterState.Auto);
3091 this.global.transition = null;
3092 if (this.IsPC)
3093 {
3094 EClass.player.lastTransition = null;
3095 }
3096 z.AddCard(this, spawnPos);
3097 if (this.IsBranchMember())
3098 {
3099 EClass._map.rooms.AssignCharas();
3100 return;
3101 }
3102 }
3103 else
3104 {
3105 z.AddCard(this);
3106 }
3107 }
3108
3109 // Token: 0x060014AC RID: 5292 RVA: 0x0008861C File Offset: 0x0008681C
3110 public void MoveHome(string id, int x = -1, int z = -1)
3111 {
3112 this.MoveHome(EClass.game.world.FindZone(id), x, z);
3113 }
3114
3115 // Token: 0x060014AD RID: 5293 RVA: 0x00088638 File Offset: 0x00086838
3116 public void MoveHome(Zone zone, int x = -1, int z = -1)
3117 {
3118 if (this.isDead)
3119 {
3120 this.Revive(null, false);
3121 }
3122 else
3123 {
3124 this.Cure(CureType.Death, 100, BlessedState.Normal);
3125 }
3126 this.CureCondition<ConSuspend>(99999);
3127 if (this.IsPCParty)
3128 {
3129 EClass.pc.party.RemoveMember(this);
3130 }
3131 FactionBranch homeBranch = this.homeBranch;
3132 if (x == -1)
3133 {
3134 x = 50;
3135 }
3136 if (z == -1)
3137 {
3138 z = 50;
3139 }
3140 Point point = new Point(x, z);
3141 if (zone.IsActiveZone)
3142 {
3143 point = point.GetNearestPoint(false, false, true, false);
3144 }
3145 zone.AddCard(this, point);
3146 this.SetHomeZone(zone);
3147 this.global.transition = new ZoneTransition
3148 {
3149 state = ZoneTransition.EnterState.Dead,
3150 x = point.x,
3151 z = point.z
3152 };
3153 this.orgPos = new Point(x, z);
3154 if (homeBranch != null)
3155 {
3156 this.RefreshWorkElements(null);
3157 homeBranch.policies.Validate();
3158 }
3159 }
3160
3161 // Token: 0x060014AE RID: 5294 RVA: 0x00088718 File Offset: 0x00086918
3162 public void FallFromZone()
3163 {
3164 Msg.Say("skyFall", EClass.pc, EClass._zone.Name, null, null);
3165 Zone zone = EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1);
3166 zone = (zone ?? EClass.world.region);
3167 this.MoveZone(zone ?? EClass.world.region, new ZoneTransition
3168 {
3169 state = ZoneTransition.EnterState.Fall,
3170 x = this.pos.x,
3171 z = this.pos.z
3172 });
3173 }
3174
3175 // Token: 0x060014AF RID: 5295 RVA: 0x000887C0 File Offset: 0x000869C0
3176 public override void SetDir(int d)
3177 {
3178 base.dir = d;
3179 this.UpdateAngle();
3180 this.renderer.RefreshSprite();
3181 }
3182
3183 // Token: 0x060014B0 RID: 5296 RVA: 0x000887DC File Offset: 0x000869DC
3184 public override void Rotate(bool reverse = false)
3185 {
3186 if (this.renderer.hasActor)
3187 {
3188 base.dir = (base.dir + (reverse ? -1 : 1)).Clamp(0, 3, true);
3189 }
3190 else
3191 {
3192 base.dir = ((base.dir == 0) ? 1 : 0);
3193 }
3194 this.UpdateAngle();
3195 this.renderer.RefreshSprite();
3196 }
3197
3198 // Token: 0x060014B1 RID: 5297 RVA: 0x00088837 File Offset: 0x00086A37
3199 public override void LookAt(Card c)
3200 {
3201 this.LookAt(c.pos);
3202 }
3203
3204 // Token: 0x060014B2 RID: 5298 RVA: 0x00088848 File Offset: 0x00086A48
3205 public override void LookAt(Point p)
3206 {
3207 this.angle = Util.GetAngle((float)(p.x - this.pos.x), (float)(p.z - this.pos.z));
3208 if (EClass._zone.IsRegion)
3209 {
3210 if (this.angle > 100f && this.angle < 170f)
3211 {
3212 base.dir = 2;
3213 }
3214 else if (this.angle > 170f && this.angle < 190f)
3215 {
3216 base.dir = 0;
3217 }
3218 else if (this.angle > 190f || (this.angle < -10f && this.angle > -100f))
3219 {
3220 base.dir = 3;
3221 }
3222 else
3223 {
3224 base.dir = 1;
3225 }
3226 this.angle -= 45f;
3227 }
3228 else if (this.angle > 170f && this.angle < 235f)
3229 {
3230 base.dir = 0;
3231 }
3232 else if (this.angle > 80f && this.angle < 145f)
3233 {
3234 base.dir = 1;
3235 }
3236 else if (this.angle > -100f && this.angle < -35f)
3237 {
3238 base.dir = 3;
3239 }
3240 else if (this.angle > -10f && this.angle < 55f)
3241 {
3242 base.dir = 2;
3243 }
3244 this.renderer.RefreshSprite();
3245 }
3246
3247 // Token: 0x060014B3 RID: 5299 RVA: 0x000889C0 File Offset: 0x00086BC0
3248 public void UpdateAngle()
3249 {
3250 if (this.IsPCC)
3251 {
3252 if (base.dir == 0)
3253 {
3254 this.angle = 225f;
3255 return;
3256 }
3257 if (base.dir == 1)
3258 {
3259 this.angle = 135f;
3260 return;
3261 }
3262 if (base.dir == 2)
3263 {
3264 this.angle = 45f;
3265 return;
3266 }
3267 if (base.dir == 3)
3268 {
3269 this.angle = -45f;
3270 return;
3271 }
3272 }
3273 else
3274 {
3275 if (base.dir == 0)
3276 {
3277 this.angle = 165f;
3278 return;
3279 }
3280 if (base.dir == 1)
3281 {
3282 this.angle = 300f;
3283 return;
3284 }
3285 if (base.dir == 2)
3286 {
3287 this.angle = 0f;
3288 return;
3289 }
3290 if (base.dir == 3)
3291 {
3292 this.angle = 120f;
3293 }
3294 }
3295 }
3296
3297 // Token: 0x060014B4 RID: 5300 RVA: 0x00088A7C File Offset: 0x00086C7C
3298 public int GetCurrentDir()
3299 {
3300 Debug.Log(this.angle);
3301 if (this.renderer.hasActor)
3302 {
3303 return this.renderer.actor.currentDir;
3304 }
3305 if (this.angle == 0f || this.angle == 45f || this.angle == 90f)
3306 {
3307 return 2;
3308 }
3309 if (this.angle == -135f || this.angle == 180f || this.angle == -90f)
3310 {
3311 return 1;
3312 }
3313 if (this.angle == 135f)
3314 {
3315 return 0;
3316 }
3317 return 3;
3318 }
3319
3320 // Token: 0x060014B5 RID: 5301 RVA: 0x00088B1C File Offset: 0x00086D1C
3321 public void UpdateSight()
3322 {
3323 int num = 4;
3324 for (int i = -num; i < num + 1; i++)
3325 {
3326 for (int j = -num; j < num + 1; j++)
3327 {
3328 Chara.shared.Set(this.pos.x + i, this.pos.z + j);
3329 if (!Chara.shared.IsValid || Chara.shared.cell.isSeen || i < -1 || i > 1 || j >= -1)
3330 {
3331 }
3332 }
3333 }
3334 }
3335
3336 // Token: 0x060014B6 RID: 5302 RVA: 0x00088B9C File Offset: 0x00086D9C
3337 public bool WillConsumeTurn()
3338 {
3339 for (int i = this.conditions.Count - 1; i >= 0; i--)
3340 {
3341 if (this.conditions[i].ConsumeTurn)
3342 {
3343 return true;
3344 }
3345 }
3346 return false;
3347 }
3348
3349 // Token: 0x060014B7 RID: 5303 RVA: 0x00088BD8 File Offset: 0x00086DD8
3350 public void TickConditions()
3351 {
3352 if (this._cooldowns != null)
3353 {
3354 this.TickCooldown();
3355 }
3356 this.turn++;
3357 Chara.consumeTurn = false;
3358 Chara.preventRegen = false;
3359 this.emoIcon = Emo2.none;
3360 if (base.isSummon)
3361 {
3362 int c_summonDuration = base.c_summonDuration;
3363 base.c_summonDuration = c_summonDuration - 1;
3364 if (base.c_summonDuration <= 0)
3365 {
3366 this.Die(null, null, AttackSource.None);
3367 return;
3368 }
3369 }
3370 if (EClass.world.weather.IsRaining && !EClass._map.IsIndoor && !this.pos.cell.HasRoof)
3371 {
3372 this.AddCondition<ConWet>(20, false);
3373 }
3374 switch (this.turn % 50)
3375 {
3376 case 0:
3377 this.happiness = (this.hunger.value + this.stamina.value + this.depression.value + this.bladder.value + this.hygiene.value) / 5;
3378 break;
3379 case 1:
3380 if (!this.IsPC || !EClass.debug.godMode)
3381 {
3382 if (EClass.rnd(2) == 0)
3383 {
3384 this.sleepiness.Mod(1);
3385 }
3386 if (EClass.rnd(3) == 0)
3387 {
3388 this.hunger.Mod(1);
3389 }
3390 if (this.IsPC && (this.sleepiness.GetPhase() != 0 || this.stamina.GetPhase() <= 1))
3391 {
3392 Tutorial.Play("sleep");
3393 }
3394 }
3395 break;
3396 case 2:
3397 if (this.parasite != null)
3398 {
3399 base.ModExp(227, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (this.elements.Base(227) - this.parasite.LV) * 25));
3400 }
3401 if (this.ride != null)
3402 {
3403 base.ModExp(226, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (this.elements.Base(226) - this.ride.LV) * 25));
3404 }
3405 break;
3406 }
3407 if (this.turn % 500 == 0)
3408 {
3409 this.DiminishTempElements(1);
3410 }
3411 if (this.IsPCParty)
3412 {
3413 if (this.dirtyWeight)
3414 {
3415 this.CalcBurden();
3416 }
3417 int phase = this.burden.GetPhase();
3418 int phase2 = this.hunger.GetPhase();
3419 if (phase2 >= 4)
3420 {
3421 Chara.preventRegen = true;
3422 }
3423 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase >= 3)
3424 {
3425 base.Say("dmgBurden", this, null, null);
3426 base.DamageHP(this.MaxHP * (base.ChildrenWeight * 100 / this.WeightLimit) / 1000 + 1, AttackSource.Burden, null);
3427 if (this.isDead)
3428 {
3429 return;
3430 }
3431 }
3432 if (EClass.rnd(12) == 0)
3433 {
3434 if (this.IsPC)
3435 {
3436 if (phase > 0)
3437 {
3438 base.ModExp(207, 1 + phase * phase);
3439 }
3440 }
3441 else
3442 {
3443 base.ModExp(207, 5);
3444 }
3445 }
3446 if (this.IsPC)
3447 {
3448 if (phase2 >= 5 && !(this.ai is AI_Eat) && EClass.rnd(5) == 0)
3449 {
3450 base.DamageHP(1 + EClass.rnd(2) + this.MaxHP / 50, AttackSource.Hunger, null);
3451 }
3452 if (this.isDead)
3453 {
3454 return;
3455 }
3456 phase2 = this.stamina.GetPhase();
3457 if (phase2 <= 0)
3458 {
3459 Chara.preventRegen = true;
3460 }
3461 if (this.currentZone.IsRegion && EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && !EClass.pc.HasElement(408, 1))
3462 {
3463 if (EClass.rnd(100) == 0 && !this.isConfused)
3464 {
3465 Msg.Say("rain_confuse");
3466 this.AddCondition<ConConfuse>(500, false);
3467 }
3468 if (EClass.rnd(300) == 0 && !this.isBlind)
3469 {
3470 Msg.Say("rain_confuse");
3471 this.AddCondition<ConBlind>(200, false);
3472 }
3473 }
3474 if (this.turn % (150000 / (100 + base.Evalue(409) * 10)) == 0)
3475 {
3476 this.ModCorruption(1);
3477 }
3478 }
3479 }
3480 if (!this.IsPC)
3481 {
3482 int num = base.Evalue(409);
3483 if (num > 0 && this.turn % 1500 * 100 / (100 + num * 10) == 0)
3484 {
3485 this.ModCorruption(1);
3486 }
3487 }
3488 for (int i = this.conditions.Count - 1; i >= 0; i--)
3489 {
3490 Condition condition = this.conditions[i];
3491 if (!condition.TimeBased)
3492 {
3493 condition.Tick();
3494 }
3495 if (!condition.IsKilled)
3496 {
3497 if (condition.ConsumeTurn)
3498 {
3499 Chara.consumeTurn = true;
3500 }
3501 if (condition.PreventRegen)
3502 {
3503 Chara.preventRegen = true;
3504 }
3505 if (condition.EmoIcon != Emo2.none && condition.EmoIcon > this.emoIcon)
3506 {
3507 this.emoIcon = condition.EmoIcon;
3508 }
3509 }
3510 if (this.isDead)
3511 {
3512 return;
3513 }
3514 }
3515 if (!Chara.preventRegen)
3516 {
3517 if (EClass.rnd(25) == 0 && base.hp < this.MaxHP)
3518 {
3519 this.HealHP(EClass.rnd(base.Evalue(300) / 3 + 1) + 1, HealSource.None);
3520 this.elements.ModExp(300, 8, false);
3521 }
3522 if (EClass.rnd(8) == 0 && this.mana.value < this.mana.max)
3523 {
3524 this.mana.Mod(EClass.rnd(base.Evalue(301) / 2 + 1) + 1);
3525 this.elements.ModExp(301, 8, false);
3526 }
3527 if (EClass.rnd(20) == 0 && !this.IsPC && this.stamina.value < this.stamina.max)
3528 {
3529 this.stamina.Mod(EClass.rnd(5) + 1);
3530 }
3531 }
3532 }
3533
3534 // Token: 0x060014B8 RID: 5304 RVA: 0x0008918C File Offset: 0x0008738C
3535 public void SyncRide()
3536 {
3537 if (this.host != null)
3538 {
3539 this.host.SyncRide();
3540 }
3541 if (this.ride != null)
3542 {
3543 this.SyncRide(this.ride);
3544 }
3545 if (this.parasite != null)
3546 {
3547 this.SyncRide(this.parasite);
3548 }
3549 }
3550
3551 // Token: 0x060014B9 RID: 5305 RVA: 0x000891CC File Offset: 0x000873CC
3552 public void SyncRide(Chara c)
3553 {
3554 if (!c.pos.Equals(this.pos))
3555 {
3556 if (!this.pos.IsValid)
3557 {
3558 string str = "exception: pos is not valid:";
3559 Point pos = this.pos;
3560 Debug.LogError(str + ((pos != null) ? pos.ToString() : null) + "/" + ((this != null) ? this.ToString() : null));
3561 this.pos = new Point();
3562 }
3563 EClass._map.MoveCard(this.pos, c);
3564 }
3565 }
3566
3567 // Token: 0x060014BA RID: 5306 RVA: 0x00089248 File Offset: 0x00087448
3568 public override void Tick()
3569 {
3570 Chara.<>c__DisplayClass332_0 CS$<>8__locals1 = new Chara.<>c__DisplayClass332_0();
3571 CS$<>8__locals1.<>4__this = this;
3572 this.SyncRide();
3573 this.combatCount--;
3574 if (this.IsPC)
3575 {
3576 if (this.hasMovedThisTurn)
3577 {
3578 this.pos.Things.ForeachReverse(delegate(Thing t)
3579 {
3580 t.trait.OnStepped(CS$<>8__locals1.<>4__this);
3581 });
3582 if (this.isDead)
3583 {
3584 return;
3585 }
3586 this.hasMovedThisTurn = false;
3587 if (EClass.player.haltMove)
3588 {
3589 EClass.player.haltMove = false;
3590 ActionMode.Adv.TryCancelInteraction(false);
3591 EInput.Consume(1);
3592 return;
3593 }
3594 if (EClass._zone.IsRegion)
3595 {
3596 foreach (Chara chara in EClass.pc.party.members)
3597 {
3598 if (chara.hunger.value > 65)
3599 {
3600 chara.InstantEat(null, false);
3601 }
3602 }
3603 if (EClass.player.safeTravel <= 0)
3604 {
3605 EloMap.Cell cell = EClass.scene.elomap.GetCell(EClass.pc.pos);
3606 if (cell != null && cell.zone == null && !EClass.debug.ignoreEncounter)
3607 {
3608 bool isRoad = EClass.scene.elomap.GetTileInfo(EClass.pc.pos.eloX, EClass.pc.pos.eloY).isRoad;
3609 bool flag = EClass.pc.HasCondition<ConWardMonster>();
3610 bool flag2 = EClass.pc.HasCondition<ConDrawMonster>();
3611 bool flag3 = EClass.game.quests.Get<QuestEscort>() != null;
3612 int num = isRoad ? 22 : 12;
3613 if (flag3)
3614 {
3615 num = (isRoad ? 16 : 10);
3616 }
3617 if (flag)
3618 {
3619 num *= (flag3 ? 2 : 20);
3620 }
3621 if (flag2)
3622 {
3623 num /= 2;
3624 }
3625 if (EClass.rnd(num) == 0)
3626 {
3627 Msg.Say("encounter");
3628 if (!flag2)
3629 {
3630 EClass.player.safeTravel = 5 + EClass.rnd(5);
3631 }
3632 EClass.player.EnterLocalZone(true);
3633 }
3634 }
3635 }
3636 else
3637 {
3638 EClass.player.safeTravel--;
3639 }
3640 }
3641 }
3642 EClass.player.pickupDelay = 0f;
3643 if (EClass.player.returnInfo != null)
3644 {
3645 EClass.player.returnInfo.turns--;
3646 if (EClass.player.returnInfo.turns <= 0)
3647 {
3648 if (EClass.pc.burden.GetPhase() != 4 || EClass.debug.ignoreWeight)
3649 {
3650 int uidDest = EClass.player.returnInfo.uidDest;
3651 Zone zone = null;
3652 if (uidDest != 0)
3653 {
3654 zone = (EClass.game.spatials.map.TryGetValue(uidDest, null) as Zone);
3655 }
3656 if (zone == null || zone.destryoed)
3657 {
3658 zone = EClass.world.region;
3659 }
3660 if (zone == EClass.game.activeZone || EClass.game.activeZone.IsRegion)
3661 {
3662 Msg.Say("returnFail");
3663 }
3664 else
3665 {
3666 Msg.Say("returnComplete");
3667 EClass.player.uidLastTravelZone = 0;
3668 EClass.pc.MoveZone(zone, ZoneTransition.EnterState.Return);
3669 EClass.player.lastZonePos = null;
3670 }
3671 EClass.player.returnInfo = null;
3672 return;
3673 }
3674 EClass.player.returnInfo = null;
3675 Msg.Say("returnOverweight");
3676 }
3677 }
3678 if ((this.HasNoGoal || !this.ai.IsRunning) && !this.WillConsumeTurn())
3679 {
3680 this.SetAI(Chara._NoGoalPC);
3681 return;
3682 }
3683 EClass.player.stats.turns++;
3684 if (EClass.core.config.game.alwaysUpdateRecipe)
3685 {
3686 RecipeUpdater.dirty = true;
3687 }
3688 this.actTime = EClass.player.baseActTime;
3689 }
3690 else
3691 {
3692 this.actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)this.Speed);
3693 this.hasMovedThisTurn = false;
3694 }
3695 this.TickConditions();
3696 if (!this.IsAliveInCurrentZone)
3697 {
3698 return;
3699 }
3700 this.renderer.RefreshStateIcon();
3701 if (this.host != null && !Chara.consumeTurn)
3702 {
3703 if (this.host.ride == this && (this.host.hasMovedThisTurn || (this.enemy != null && this.turn % 3 != 0)))
3704 {
3705 Chara.consumeTurn = true;
3706 }
3707 if (this.host.parasite == this && this.enemy != null && EClass.rnd(10) > EClass.rnd(this.host.Evalue(227) + 10))
3708 {
3709 if (base.Dist(this.enemy) < 3 && EClass.rnd(2) == 0)
3710 {
3711 base.Say("parasite_fail", this, this.host, null, null);
3712 if (EClass.rnd(2) == 0 && base.GetInt(106, null) == 0)
3713 {
3714 base.Talk("parasite_fail", null, null, false);
3715 }
3716 }
3717 Chara.consumeTurn = true;
3718 }
3719 }
3720 if (Chara.consumeTurn)
3721 {
3722 if (this.IsPC)
3723 {
3724 ActionMode.Adv.SetTurbo(-1);
3725 }
3726 }
3727 else
3728 {
3729 if (base.isRestrained)
3730 {
3731 base.TryUnrestrain(false, null);
3732 }
3733 if (this.enemy != null)
3734 {
3735 if (!this.enemy.IsAliveInCurrentZone)
3736 {
3737 this.enemy = null;
3738 }
3739 else if (!this.IsPC && ((!(this.ai is GoalCombat) && !(this.ai is AI_Trolley)) || !this.ai.IsRunning))
3740 {
3741 this.SetAIAggro();
3742 }
3743 }
3744 if (this.HasNoGoal || !this.ai.IsRunning)
3745 {
3746 this.ChooseNewGoal();
3747 }
3748 this.ai.Tick();
3749 }
3750 CS$<>8__locals1.cell = base.Cell;
3751 if (CS$<>8__locals1.cell.IsTopWaterAndNoSnow && !CS$<>8__locals1.cell.isFloating)
3752 {
3753 this.AddCondition<ConWet>(50, false);
3754 }
3755 if (this.IsPC && !EClass._zone.IsRegion && CS$<>8__locals1.cell.CanSuffocate())
3756 {
3757 this.AddCondition<ConSuffocation>(800 / (100 + base.Evalue(200) * 10), false);
3758 }
3759 if (CS$<>8__locals1.cell.effect != null)
3760 {
3761 Chara.<>c__DisplayClass332_1 CS$<>8__locals2;
3762 CS$<>8__locals2.e = CS$<>8__locals1.cell.effect;
3763 switch (CS$<>8__locals2.e.id)
3764 {
3765 case 1:
3766 case 2:
3767 case 4:
3768 if (this.isLevitating)
3769 {
3770 base.Say("levitating", null, null);
3771 }
3772 else
3773 {
3774 this.AddCondition<ConWet>(50, false);
3775 CS$<>8__locals1.<Tick>g__ProcEffect|2(ref CS$<>8__locals2);
3776 }
3777 break;
3778 case 3:
3779 base.PlaySound("fire_step", 1f, true);
3780 this.AddCondition<ConBurning>(30, false);
3781 break;
3782 case 5:
3783 if (!this.isWet)
3784 {
3785 base.PlaySound("bubble", 1f, true);
3786 this.AddCondition<ConWet>(30, false);
3787 CS$<>8__locals1.<Tick>g__ProcEffect|2(ref CS$<>8__locals2);
3788 }
3789 break;
3790 case 6:
3791 if (this.hasMovedThisTurn)
3792 {
3793 base.Say("abMistOfDarkness_step", this, null, null);
3794 }
3795 break;
3796 }
3797 }
3798 if (this.IsPC)
3799 {
3800 if (EClass.player.currentHotItem.Thing != null)
3801 {
3802 EClass.player.currentHotItem.Thing.trait.OnTickHeld();
3803 }
3804 EClass.screen.OnEndPlayerTurn();
3805 }
3806 }
3807
3808 // Token: 0x060014BB RID: 5307 RVA: 0x0008998C File Offset: 0x00087B8C
3809 public bool CanLift(Card c)
3810 {
3811 return true;
3812 }
3813
3814 // Token: 0x060014BC RID: 5308 RVA: 0x0008998F File Offset: 0x00087B8F
3815 public bool CanAutoPick(Card c)
3816 {
3817 return true;
3818 }
3819
3820 // Token: 0x060014BD RID: 5309 RVA: 0x00089994 File Offset: 0x00087B94
3821 public bool CanPick(Card c)
3822 {
3823 if (c.isDestroyed)
3824 {
3825 return false;
3826 }
3827 Card rootCard = c.GetRootCard();
3828 return !rootCard.isDestroyed && (!rootCard.ExistsOnMap || rootCard.pos.Distance(this.pos) <= 1) && (rootCard == this || !this.things.IsFull(c.Thing, true, true));
3829 }
3830
3831 // Token: 0x060014BE RID: 5310 RVA: 0x000899F4 File Offset: 0x00087BF4
3832 public void PickOrDrop(Point p, string idThing, int idMat = -1, int num = 1, bool msg = true)
3833 {
3834 if (num == 0)
3835 {
3836 return;
3837 }
3838 this.PickOrDrop(p, ThingGen.Create(idThing, idMat, -1).SetNum(num), msg);
3839 }
3840
3841 // Token: 0x060014BF RID: 5311 RVA: 0x00089A14 File Offset: 0x00087C14
3842 public void PickOrDrop(Point p, Thing t, bool msg = true)
3843 {
3844 if (this.things.GetDest(t, true).IsValid)
3845 {
3846 this.Pick(t, msg, true);
3847 return;
3848 }
3849 EClass._zone.AddCard(t, p);
3850 }
3851
3852 // Token: 0x060014C0 RID: 5312 RVA: 0x00089A50 File Offset: 0x00087C50
3853 public Thing Pick(Thing t, bool msg = true, bool tryStack = true)
3854 {
3855 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard)
3856 {
3857 ContentCodex.Collect(t);
3858 return t;
3859 }
3860 if (t.parent == this)
3861 {
3862 return t;
3863 }
3864 ThingContainer.DestData dest = this.things.GetDest(t, tryStack);
3865 if (!dest.IsValid)
3866 {
3867 if (t.parent != EClass._zone)
3868 {
3869 if (this.IsPC)
3870 {
3871 base.Say("backpack_full_drop", t, null, null);
3872 SE.Drop();
3873 }
3874 return EClass._zone.AddCard(t, this.pos).Thing;
3875 }
3876 if (this.IsPC)
3877 {
3878 base.Say("backpack_full", t, null, null);
3879 }
3880 return t;
3881 }
3882 else
3883 {
3884 if (dest.stack != null)
3885 {
3886 if (msg)
3887 {
3888 base.PlaySound("pick_thing", 1f, true);
3889 base.Say("pick_thing", this, t, null, null);
3890 }
3891 t.TryStackTo(dest.stack);
3892 return dest.stack;
3893 }
3894 if (t.trait is TraitRod && EClass.rnd(2) == 0 && t.c_charges > 0 && base.HasElement(1564, 1))
3895 {
3896 base.Say("absorbRod", this, t, null, null);
3897 TraitRod rod = t.trait as TraitRod;
3898 bool flag = false;
3899 if (rod.source != null)
3900 {
3901 IEnumerable<SourceElement.Row> rows = EClass.sources.elements.rows;
3902 Func<SourceElement.Row, bool> predicate;
3903 Func<SourceElement.Row, bool> <>9__0;
3904 if ((predicate = <>9__0) == null)
3905 {
3906 predicate = (<>9__0 = ((SourceElement.Row a) => a.id == rod.source.id));
3907 }
3908 using (IEnumerator<SourceElement.Row> enumerator = rows.Where(predicate).GetEnumerator())
3909 {
3910 if (enumerator.MoveNext())
3911 {
3912 SourceElement.Row row = enumerator.Current;
3913 if (this.IsPC)
3914 {
3915 this.GainAbility(row.id, t.c_charges * 100);
3916 flag = true;
3917 }
3918 }
3919 }
3920 }
3921 if (!flag)
3922 {
3923 this.mana.Mod(-50 * t.c_charges);
3924 }
3925 t.c_charges = 0;
3926 }
3927 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && base.HasElement(1565, 1))
3928 {
3929 string id = (from a in EClass.sources.things.rows
3930 where a._origin == "potion" && a.tag.Contains("neg")
3931 select a).RandomItem<SourceThing.Row>().id;
3932 base.Say("poisonDrip", this, null, null);
3933 int num = t.Num;
3934 t.Destroy();
3935 t = ThingGen.Create(id, -1, -1).SetNum(num);
3936 }
3937 if (msg)
3938 {
3939 base.PlaySound("pick_thing", 1f, true);
3940 base.Say("pick_thing", this, t, null, null);
3941 }
3942 this.TryReservePickupTutorial(t);
3943 return dest.container.AddThing(t, tryStack, -1, -1);
3944 }
3945 }
3946
3947 // Token: 0x060014C1 RID: 5313 RVA: 0x00089D50 File Offset: 0x00087F50
3948 public void TryReservePickupTutorial(Thing t)
3949 {
3950 if (t.id == "axe")
3951 {
3952 Tutorial.Reserve("tool", null);
3953 }
3954 if (t.category.id == "mushroom")
3955 {
3956 Tutorial.Reserve("food", null);
3957 }
3958 if (t.category.id == "herb")
3959 {
3960 Tutorial.Reserve("herb", null);
3961 }
3962 if (t.id == "pasture")
3963 {
3964 Tutorial.Reserve("pasture", null);
3965 }
3966 if (t.id == "log")
3967 {
3968 Tutorial.Reserve("process", null);
3969 }
3970 }
3971
3972 // Token: 0x060014C2 RID: 5314 RVA: 0x00089DF8 File Offset: 0x00087FF8
3973 public void TryPickGroundItem()
3974 {
3975 foreach (Card card in this.pos.ListCards(false))
3976 {
3977 if (!this.IsPC)
3978 {
3979 AI_UseCrafter ai_UseCrafter = EClass.pc.ai as AI_UseCrafter;
3980 if (ai_UseCrafter != null && ai_UseCrafter.ings.Contains(card))
3981 {
3982 continue;
3983 }
3984 }
3985 if (card.isThing && card.placeState == PlaceState.roaming && this.CanPick(card))
3986 {
3987 Thing thing = this.Pick(card.Thing, true, true);
3988 if (thing != null && !this.IsPC)
3989 {
3990 thing.isNPCProperty = true;
3991 }
3992 break;
3993 }
3994 }
3995 }
3996
3997 // Token: 0x060014C3 RID: 5315 RVA: 0x00089EB0 File Offset: 0x000880B0
3998 public void TryPutShared(Thing t, List<Thing> containers = null, bool dropIfFail = true)
3999 {
4000 if (EClass._zone.TryAddThingInSharedContainer(t, containers, true, false, null, true))
4001 {
4002 return;
4003 }
4004 if (dropIfFail)
4005 {
4006 EClass._zone.AddCard(t, this.pos);
4007 }
4008 }
4009
4010 // Token: 0x060014C4 RID: 5316 RVA: 0x00089EDC File Offset: 0x000880DC
4011 public bool TryHoldCard(Card t, int num = -1, bool pickHeld = false)
4012 {
4013 if (this.held == t)
4014 {
4015 return true;
4016 }
4017 if (t.isDestroyed || t.Num <= 0)
4018 {
4019 return false;
4020 }
4021 if (!this.CanPick(t))
4022 {
4023 if (t.parent == null)
4024 {
4025 EClass._zone.AddCard(t, this.pos);
4026 }
4027 return false;
4028 }
4029 this.HoldCard(t, num);
4030 return true;
4031 }
4032
4033 // Token: 0x060014C5 RID: 5317 RVA: 0x00089F38 File Offset: 0x00088138
4034 public void HoldCard(Card t, int num = -1)
4035 {
4036 if (this.held == t || t.isDestroyed || t.Num <= 0)
4037 {
4038 return;
4039 }
4040 if (this.IsPC && t.isNPCProperty)
4041 {
4042 t.isNPCProperty = false;
4043 EClass.player.ModKarma(-1);
4044 this.pos.TryWitnessCrime(this, null, 4, null);
4045 }
4046 this.PickHeld(false);
4047 if (t.isChara)
4048 {
4049 if (t.IsAliveInCurrentZone)
4050 {
4051 t.ShowEmo(Emo.love, 0f, true);
4052 }
4053 EClass.player.altHeldPos = (t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0);
4054 }
4055 else
4056 {
4057 if (num == -1 || num > t.Num)
4058 {
4059 num = t.Num;
4060 }
4061 if (num < t.Num)
4062 {
4063 t = t.Split(num);
4064 }
4065 }
4066 if (t.GetRootCard() != this)
4067 {
4068 t = this.Pick(t.Thing, false, true);
4069 if (t.GetRootCard() != this)
4070 {
4071 return;
4072 }
4073 }
4074 this.held = t;
4075 if (this.held.GetLightRadius() > 0)
4076 {
4077 base.RecalculateFOV();
4078 }
4079 if (this.IsPC)
4080 {
4081 LayerInventory.SetDirty(t.Thing);
4082 WidgetHotbar.dirtyCurrentItem = true;
4083 }
4084 }
4085
4086 // Token: 0x060014C6 RID: 5318 RVA: 0x0008A060 File Offset: 0x00088260
4087 public void PickHeld(bool msg = false)
4088 {
4089 if (this.held == null)
4090 {
4091 return;
4092 }
4093 Card card = this.held;
4094 if (this.IsPC && this.held.invY == 1)
4095 {
4096 WidgetHotbar.dirtyCurrentItem = true;
4097 LayerInventory.SetDirty(this.held.Thing);
4098 this.held = null;
4099 return;
4100 }
4101 if (this.held.isChara)
4102 {
4103 this.DropHeld(null);
4104 return;
4105 }
4106 if (this.IsPC && !this.held.IsHotItem && this.held.trait.CanOnlyCarry)
4107 {
4108 base.Say("canOnlyCarry", this.held, null, null);
4109 this.DropHeld(null);
4110 return;
4111 }
4112 bool flag = this.held != this.things.TryStack(this.held.Thing, -1, -1);
4113 if (!flag && this.things.IsOverflowing())
4114 {
4115 if (this.IsPC)
4116 {
4117 base.Say("backpack_full_drop", this.held, null, null);
4118 SE.Drop();
4119 }
4120 this.DropHeld(null);
4121 return;
4122 }
4123 if (msg)
4124 {
4125 base.PlaySound("pick_thing", 1f, true);
4126 base.Say("pick_held", this, card, null, null);
4127 if (this.IsPC && card.id == "statue_weird")
4128 {
4129 base.Say("statue_pick", null, null);
4130 }
4131 }
4132 if (this.IsPC)
4133 {
4134 WidgetHotbar.dirtyCurrentItem = true;
4135 if (!flag)
4136 {
4137 LayerInventory.SetDirty(this.held.Thing);
4138 if (this.held.GetRootCard() != EClass.pc)
4139 {
4140 this.Pick(this.held.Thing, false, true);
4141 }
4142 }
4143 }
4144 this.held = null;
4145 }
4146
4147 // Token: 0x060014C7 RID: 5319 RVA: 0x0008A200 File Offset: 0x00088400
4148 public Card SplitHeld(int a)
4149 {
4150 return this.held.Split(a);
4151 }
4152
4153 // Token: 0x060014C8 RID: 5320 RVA: 0x0008A210 File Offset: 0x00088410
4154 public Card DropHeld(Point dropPos = null)
4155 {
4156 if (this.held == null)
4157 {
4158 return null;
4159 }
4160 if (this.IsPC)
4161 {
4162 WidgetHotbar.dirtyCurrentItem = true;
4163 LayerInventory.SetDirty(this.held.Thing);
4164 }
4165 Card card = EClass._zone.AddCard(this.held, dropPos ?? this.pos);
4166 card.OnLand();
4167 if (card.trait.CanOnlyCarry)
4168 {
4169 card.SetPlaceState(PlaceState.installed, false);
4170 }
4171 return card;
4172 }
4173
4174 // Token: 0x060014C9 RID: 5321 RVA: 0x0008A280 File Offset: 0x00088480
4175 public void DropThing(Thing t, int num = -1)
4176 {
4177 if (t.c_isImportant)
4178 {
4179 Msg.Say("markedImportant");
4180 return;
4181 }
4182 if (!t.trait.CanBeDropped)
4183 {
4184 Msg.Say("cantDrop", t, null, null, null);
4185 return;
4186 }
4187 if (t.trait is TraitAbility)
4188 {
4189 SE.Trash();
4190 t.Destroy();
4191 return;
4192 }
4193 Msg.Say("dropItem", t.Name, null, null, null);
4194 t.ignoreAutoPick = true;
4195 base.PlaySound("drop", 1f, true);
4196 EClass._zone.AddCard(t, this.pos);
4197 }
4198
4199 // Token: 0x060014CA RID: 5322 RVA: 0x0008A318 File Offset: 0x00088518
4200 public AttackStyle GetFavAttackStyle()
4201 {
4202 int num = base.Evalue(131);
4203 int num2 = base.Evalue(130);
4204 int num3 = base.Evalue(123);
4205 if (num > num2 && num > num3)
4206 {
4207 return AttackStyle.TwoWield;
4208 }
4209 if (num2 > num && num2 > num3)
4210 {
4211 return AttackStyle.TwoHand;
4212 }
4213 if (num3 > num && num3 > num2)
4214 {
4215 return AttackStyle.Shield;
4216 }
4217 return AttackStyle.Default;
4218 }
4219
4220 // Token: 0x060014CB RID: 5323 RVA: 0x0008A368 File Offset: 0x00088568
4221 public Element GetFavWeaponSkill()
4222 {
4223 return this.elements.ListElements((Element e) => e.source.categorySub == "weapon" && !e.HasTag("ranged"), null).FindMax((Element a) => a.Value);
4224 }
4225
4226 // Token: 0x060014CC RID: 5324 RVA: 0x0008A3C4 File Offset: 0x000885C4
4227 public Element GetFavArmorSkill()
4228 {
4229 if (this.elements.Value(122) > this.elements.Value(120))
4230 {
4231 return this.elements.GetElement(122);
4232 }
4233 return this.elements.GetElement(120);
4234 }
4235
4236 // Token: 0x060014CD RID: 5325 RVA: 0x0008A400 File Offset: 0x00088600
4237 public void TryRestock(bool onCreate)
4238 {
4239 Chara.isOnCreate = onCreate;
4240 if (onCreate || (!this.IsPCFaction && (base.IsUnique || this.trait is TraitAdventurer || this.trait is TraitGuard)))
4241 {
4242 this.RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4243 }
4244 this.RestockInventory(onCreate);
4245 }
4246
4247 // Token: 0x060014CE RID: 5326 RVA: 0x0008A46C File Offset: 0x0008866C
4248 public void RestockEquip(bool onCreate)
4249 {
4250 string equip = this.source.equip;
4251 if (equip.IsEmpty())
4252 {
4253 equip = this.job.equip;
4254 }
4255 string id = this.id;
4256 uint num = <PrivateImplementationDetails>.ComputeStringHash(id);
4257 if (num <= 1337759161U)
4258 {
4259 if (num <= 646060618U)
4260 {
4261 if (num != 511800731U)
4262 {
4263 if (num != 613794712U)
4264 {
4265 if (num != 646060618U)
4266 {
4267 goto IL_4A0;
4268 }
4269 if (!(id == "seeker"))
4270 {
4271 goto IL_4A0;
4272 }
4273 if (onCreate)
4274 {
4275 this.EQ_ID("helm_seeker", -1, Rarity.Random);
4276 }
4277 this.EQ_ID("robe_pope", -1, Rarity.Random);
4278 this.EQ_ID("sword_katana", -1, Rarity.Random);
4279 this.EQ_ID("staff", -1, Rarity.Random);
4280 this.EQ_ID("sword_katana", -1, Rarity.Random);
4281 if (onCreate)
4282 {
4283 this.EQ_ID("boots_seven", -1, Rarity.Random);
4284 }
4285 if (onCreate)
4286 {
4287 for (int i = 0; i < 20; i++)
4288 {
4289 base.AddThing(ThingGen.CreateFromCategory("book", 50), true, -1, -1);
4290 }
4291 this.EQ_Item("panty", 1);
4292 base.AddThing("plat", -1).SetNum(6);
4293 goto IL_4A0;
4294 }
4295 goto IL_4A0;
4296 }
4297 else
4298 {
4299 if (!(id == "adv_ivory"))
4300 {
4301 goto IL_4A0;
4302 }
4303 this.EQ_ID("dagger", -1, Rarity.Legendary);
4304 base.AddThing("60", -1);
4305 goto IL_4A0;
4306 }
4307 }
4308 else
4309 {
4310 if (!(id == "adv_gaki"))
4311 {
4312 goto IL_4A0;
4313 }
4314 if (onCreate)
4315 {
4316 this.EQ_ID("dagger_gaki", -1, Rarity.Random);
4317 }
4318 if (onCreate)
4319 {
4320 this.EQ_ID("dagger_ninto", -1, Rarity.Random);
4321 goto IL_4A0;
4322 }
4323 goto IL_4A0;
4324 }
4325 }
4326 else if (num <= 1184812370U)
4327 {
4328 if (num != 1052270088U)
4329 {
4330 if (num != 1184812370U)
4331 {
4332 goto IL_4A0;
4333 }
4334 if (!(id == "ashland"))
4335 {
4336 goto IL_4A0;
4337 }
4338 if (onCreate)
4339 {
4340 base.AddThing("guitar_ash", -1);
4341 goto IL_4A0;
4342 }
4343 goto IL_4A0;
4344 }
4345 else
4346 {
4347 if (!(id == "swordkeeper"))
4348 {
4349 goto IL_4A0;
4350 }
4351 if (onCreate)
4352 {
4353 this.EQ_ID("EtherDagger", -1, Rarity.Random);
4354 goto IL_4A0;
4355 }
4356 goto IL_4A0;
4357 }
4358 }
4359 else if (num != 1188679840U)
4360 {
4361 if (num != 1337759161U)
4362 {
4363 goto IL_4A0;
4364 }
4365 if (!(id == "adv_verna"))
4366 {
4367 goto IL_4A0;
4368 }
4369 if (onCreate)
4370 {
4371 this.EQ_ID("staff_long", -1, Rarity.Legendary);
4372 }
4373 if (onCreate)
4374 {
4375 this.EQ_ID("cloak_wing", -1, Rarity.Mythical);
4376 goto IL_4A0;
4377 }
4378 goto IL_4A0;
4379 }
4380 else if (!(id == "loytel"))
4381 {
4382 goto IL_4A0;
4383 }
4384 }
4385 else if (num <= 2936881100U)
4386 {
4387 if (num <= 1491226603U)
4388 {
4389 if (num != 1488976522U)
4390 {
4391 if (num != 1491226603U)
4392 {
4393 goto IL_4A0;
4394 }
4395 if (!(id == "adv_mesherada"))
4396 {
4397 goto IL_4A0;
4398 }
4399 if (onCreate)
4400 {
4401 this.EQ_ID("dagger_hathaway", -1, Rarity.Random);
4402 goto IL_4A0;
4403 }
4404 goto IL_4A0;
4405 }
4406 else if (!(id == "quru"))
4407 {
4408 goto IL_4A0;
4409 }
4410 }
4411 else if (num != 1808495106U)
4412 {
4413 if (num != 2936881100U)
4414 {
4415 goto IL_4A0;
4416 }
4417 if (!(id == "shojo"))
4418 {
4419 goto IL_4A0;
4420 }
4421 }
4422 else if (!(id == "kettle"))
4423 {
4424 goto IL_4A0;
4425 }
4426 }
4427 else if (num <= 3538562634U)
4428 {
4429 if (num != 3099445666U)
4430 {
4431 if (num != 3538562634U)
4432 {
4433 goto IL_4A0;
4434 }
4435 if (!(id == "adv_wini"))
4436 {
4437 goto IL_4A0;
4438 }
4439 if (onCreate)
4440 {
4441 this.EQ_ID("staff_Cat", -1, Rarity.Mythical);
4442 }
4443 for (int j = 0; j < 5; j++)
4444 {
4445 base.AddCard(ThingGen.CreateSpellbook(9150, 1));
4446 }
4447 if (onCreate)
4448 {
4449 base.AddThing("1071", -1);
4450 goto IL_4A0;
4451 }
4452 goto IL_4A0;
4453 }
4454 else
4455 {
4456 if (!(id == "big_sister"))
4457 {
4458 goto IL_4A0;
4459 }
4460 if (onCreate)
4461 {
4462 this.EQ_ID("sword_muramasa", -1, Rarity.Random);
4463 goto IL_4A0;
4464 }
4465 goto IL_4A0;
4466 }
4467 }
4468 else if (num != 3590419257U)
4469 {
4470 if (num != 4273125121U)
4471 {
4472 goto IL_4A0;
4473 }
4474 if (!(id == "adv_kiria"))
4475 {
4476 goto IL_4A0;
4477 }
4478 if (onCreate)
4479 {
4480 this.EQ_ID("sword_zephir", -1, Rarity.Random);
4481 goto IL_4A0;
4482 }
4483 goto IL_4A0;
4484 }
4485 else
4486 {
4487 if (!(id == "ephrond"))
4488 {
4489 goto IL_4A0;
4490 }
4491 if (onCreate)
4492 {
4493 base.AddThing("guitar_efrond", -1);
4494 goto IL_4A0;
4495 }
4496 goto IL_4A0;
4497 }
4498 this.EQ_ID("staff_long", 1, Rarity.Random);
4499 this.EQ_CAT("head");
4500 this.EQ_CAT("torso");
4501 this.EQ_CAT("arm");
4502 return;
4503 IL_4A0:
4504 if (!(equip == "archer"))
4505 {
4506 if (!(equip == "inquisitor") && !(equip == "gunner"))
4507 {
4508 if (!(equip == "predator") && !(equip == "none"))
4509 {
4510 }
4511 }
4512 else if (onCreate || !this.TryEquipRanged())
4513 {
4514 this.EQ_CAT("gun");
4515 }
4516 }
4517 else if (onCreate || !this.TryEquipRanged())
4518 {
4519 this.EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4520 }
4521 int num2 = (base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV);
4522 if (this.trait is TraitAdventurer)
4523 {
4524 num2 *= 3;
4525 }
4526 if (this.race.id == "asura")
4527 {
4528 for (int k = 0; k < 4; k++)
4529 {
4530 this.EQ_CAT(this.job.weapon.RandomItem<string>());
4531 }
4532 }
4533 for (int l = 0; l < ((this.race.id == "mutant") ? (2 + base.LV / 30) : 1); l++)
4534 {
4535 if (!this.job.weapon.IsEmpty())
4536 {
4537 if (this.race.id == "mutant" || (this.body.slotMainHand != null && this.body.slotMainHand.thing == null))
4538 {
4539 this.EQ_CAT(this.job.weapon.RandomItem<string>());
4540 }
4541 if (this.race.id == "mutant" || (base.Evalue(131) > 0 && EClass.rnd(2) == 0))
4542 {
4543 this.EQ_CAT(this.job.weapon.RandomItem<string>());
4544 }
4545 }
4546 this.EQ_CAT("torso");
4547 if (EClass.rnd(num2) > 5)
4548 {
4549 this.EQ_CAT("arm");
4550 }
4551 if (EClass.rnd(num2) > 10)
4552 {
4553 this.EQ_CAT("head");
4554 }
4555 if (EClass.rnd(num2) > 15)
4556 {
4557 this.EQ_CAT("back");
4558 }
4559 if (EClass.rnd(num2) > 20)
4560 {
4561 this.EQ_CAT("ring");
4562 }
4563 if (EClass.rnd(num2) > 25)
4564 {
4565 this.EQ_CAT("amulet");
4566 }
4567 if (EClass.rnd(num2) > 30)
4568 {
4569 this.EQ_CAT("foot");
4570 }
4571 if (EClass.rnd(num2) > 35)
4572 {
4573 this.EQ_CAT("waist");
4574 }
4575 if (EClass.rnd(num2) > 40)
4576 {
4577 this.EQ_CAT("ring");
4578 }
4579 }
4580 if (this.trait is TraitBard)
4581 {
4582 base.AddThing(ThingGen.Create("lute", -1, -1), true, -1, -1);
4583 }
4584 }
4585
4586 // Token: 0x060014CF RID: 5327 RVA: 0x0008ABC8 File Offset: 0x00088DC8
4587 public void RestockInventory(bool onCreate)
4588 {
4589 string id = this.id;
4590 if (id == "fiama")
4591 {
4592 this.<RestockInventory>g__Restock|354_0("book_story", 1);
4593 return;
4594 }
4595 if (id == "rock_thrower")
4596 {
4597 this.<RestockInventory>g__Restock|354_0("stone", 10 + EClass.rnd(10));
4598 return;
4599 }
4600 if (!(id == "giant"))
4601 {
4602 if (!(id == "begger"))
4603 {
4604 if (!(id == "farris"))
4605 {
4606 return;
4607 }
4608 this.<RestockInventory>g__Restock|354_0("lute", 1);
4609 }
4610 return;
4611 }
4612 this.<RestockInventory>g__Restock|354_0("rock", 2 + EClass.rnd(10));
4613 }
4614
4615 // Token: 0x060014D0 RID: 5328 RVA: 0x0008AC64 File Offset: 0x00088E64
4616 private void SetEQQuality()
4617 {
4618 CardBlueprint.Set(CardBlueprint.CharaGenEQ);
4619 Rarity rarity = Rarity.Normal;
4620 int num = (base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0))));
4621 Rarity rarity2 = base.rarity;
4622 if (this.id == "big_sister")
4623 {
4624 num = (Chara.isOnCreate ? 8 : 4);
4625 }
4626 if (!Chara.isOnCreate && EClass.rnd(10) != 0)
4627 {
4628 num /= 2;
4629 }
4630 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4631 {
4632 rarity = Rarity.Superior;
4633 }
4634 else if (rarity2 == Rarity.Legendary)
4635 {
4636 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4637 }
4638 else if (rarity2 >= Rarity.Mythical)
4639 {
4640 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) <= num) ? Rarity.Legendary : Rarity.Superior));
4641 }
4642 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4643 {
4644 rarity = Rarity.Legendary;
4645 }
4646 CardBlueprint.current.rarity = rarity;
4647 }
4648
4649 // Token: 0x060014D1 RID: 5329 RVA: 0x0008AD74 File Offset: 0x00088F74
4650 public Thing EQ_ID(string s, int mat = -1, Rarity r = Rarity.Random)
4651 {
4652 this.SetEQQuality();
4653 if (r != Rarity.Random)
4654 {
4655 CardBlueprint.current.rarity = r;
4656 }
4657 Thing thing = ThingGen.Create(s, mat, base.LV);
4658 base.AddThing(thing, true, -1, -1);
4659 if (!this.body.Equip(thing, null, true))
4660 {
4661 thing.Destroy();
4662 }
4663 return thing;
4664 }
4665
4666 // Token: 0x060014D2 RID: 5330 RVA: 0x0008ADCC File Offset: 0x00088FCC
4667 public void EQ_CAT(string s)
4668 {
4669 int slot = EClass.sources.categories.map[s].slot;
4670 BodySlot bodySlot = (slot == 0) ? null : this.body.GetSlot(slot, true, false);
4671 if (slot != 0 && bodySlot == null)
4672 {
4673 return;
4674 }
4675 if (slot == 37 && base.HasElement(1209, 1))
4676 {
4677 return;
4678 }
4679 this.SetEQQuality();
4680 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
4681 base.AddThing(thing, true, -1, -1);
4682 if (bodySlot != null && !this.body.Equip(thing, bodySlot, true))
4683 {
4684 thing.Destroy();
4685 }
4686 }
4687
4688 // Token: 0x060014D3 RID: 5331 RVA: 0x0008AE5C File Offset: 0x0008905C
4689 public void EQ_Item(string s, int num = 1)
4690 {
4691 this.SetEQQuality();
4692 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
4693 base.AddThing(t, true, -1, -1);
4694 }
4695
4696 // Token: 0x060014D4 RID: 5332 RVA: 0x0008AE90 File Offset: 0x00089090
4697 public void Drink(Card t)
4698 {
4699 base.Say("drink", this, t.Duplicate(1), null, null);
4700 base.Say("quaff", null, null);
4701 base.PlaySound("drink", 1f, true);
4702 this.hunger.Mod(-2);
4703 t.ModNum(-1, true);
4704 t.trait.OnDrink(this);
4705 bool isPC = this.IsPC;
4706 }
4707
4708 // Token: 0x060014D5 RID: 5333 RVA: 0x0008AEFC File Offset: 0x000890FC
4709 public void GetRevived()
4710 {
4711 this.Revive(EClass.pc.pos.GetNearestPoint(false, false, true, false), true);
4712 if (!this.IsPCFaction)
4713 {
4714 return;
4715 }
4716 if (!this.IsPC && !this.trait.CanJoinPartyResident)
4717 {
4718 if (this.homeZone != null && EClass._zone != this.homeZone)
4719 {
4720 Msg.Say("returnHome", this, this.homeZone.Name, null, null);
4721 this.MoveZone(this.homeZone, ZoneTransition.EnterState.Auto);
4722 }
4723 return;
4724 }
4725 if (!EClass._zone.IsPCFaction || this.homeBranch != EClass.Branch || base.GetInt(103, null) != 0)
4726 {
4727 EClass.pc.party.AddMemeber(this);
4728 }
4729 }
4730
4731 // Token: 0x060014D6 RID: 5334 RVA: 0x0008AFBC File Offset: 0x000891BC
4732 public void Revive(Point p = null, bool msg = false)
4733 {
4734 if (!this.isDead)
4735 {
4736 return;
4737 }
4738 this.isDead = false;
4739 base.hp = this.MaxHP / 3;
4740 this.mana.value = 0;
4741 this.stamina.value = 0;
4742 this.hunger.value = 30;
4743 this.sleepiness.value = 0;
4744 this.hostility = this.OriginalHostility;
4745 if (this.IsPC)
4746 {
4747 if (EClass.player.preventDeathPenalty)
4748 {
4749 Msg.Say("noDeathPenalty2", this, null, null, null);
4750 }
4751 else if (EClass.player.stats.days <= 90 && !EClass.debug.enable)
4752 {
4753 Msg.Say("noDeathPenalty", this, null, null, null);
4754 }
4755 else
4756 {
4757 EClass.pc.ApplyDeathPenalty();
4758 }
4759 List<Thing> dropList = new List<Thing>();
4760 EClass.pc.things.Foreach(delegate(Thing t)
4761 {
4762 if (!t.IsContainer && t.SelfWeight > EClass.pc.WeightLimit)
4763 {
4764 t.ignoreAutoPick = true;
4765 dropList.Add(t);
4766 }
4767 }, true);
4768 foreach (Thing thing in dropList)
4769 {
4770 EClass._zone.AddCard(thing, EClass.pc.pos);
4771 Msg.Say("backpack_full_drop", thing, null, null, null);
4772 }
4773 EClass.player.preventDeathPenalty = false;
4774 }
4775 if (this.IsPCFaction && this.homeBranch != null)
4776 {
4777 this.homeBranch.Log("bRevive", this, null, null, null);
4778 }
4779 if (p == null)
4780 {
4781 return;
4782 }
4783 if (!p.IsInBounds)
4784 {
4785 p.Set(EClass._map.GetCenterPos().GetNearestPoint(false, true, true, false) ?? EClass._map.GetCenterPos());
4786 }
4787 EClass._zone.AddCard(this, p);
4788 if (msg)
4789 {
4790 SE.Play("revive");
4791 Msg.Say("revive", this, null, null, null);
4792 base.PlayEffect("revive", true, 0f, default(Vector3));
4793 }
4794 }
4795
4796 // Token: 0x060014D7 RID: 5335 RVA: 0x0008B1C0 File Offset: 0x000893C0
4797 public void MakeGrave(string lastword)
4798 {
4799 if (EClass._zone.IsRegion)
4800 {
4801 return;
4802 }
4803 List<string> list = new List<string>
4804 {
4805 "930",
4806 "931",
4807 "947",
4808 "948",
4809 "949",
4810 "950",
4811 "951",
4812 "952"
4813 };
4814 if (this.IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will", -1, -1) != null)
4815 {
4816 list = new List<string>
4817 {
4818 "944",
4819 "946",
4820 "backerGrave",
4821 "backerGrave2"
4822 };
4823 }
4824 Thing thing = ThingGen.Create(list.RandomItem<string>(), -1, -1);
4825 thing.MakeRefFrom(this, null);
4826 if (!lastword.IsEmpty())
4827 {
4828 thing.c_note = lastword;
4829 }
4830 thing.isModified = true;
4831 EClass._zone.AddCard(thing, this.pos).Install();
4832 }
4833
4834 // Token: 0x060014D8 RID: 5336 RVA: 0x0008B2D8 File Offset: 0x000894D8
4835 public void ApplyDeathPenalty()
4836 {
4837 if (this.IsPC)
4838 {
4839 int currency = base.GetCurrency("money");
4840 if (currency > 0)
4841 {
4842 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
4843 if (num <= 0)
4844 {
4845 num = 1;
4846 }
4847 Msg.Say("panaltyMoney", this, Lang._currency(num, false, 14), null, null);
4848 base.ModCurrency(-num, "money");
4849 EClass._zone.AddCard(ThingGen.CreateCurrency(num, "money"), EClass.pc.pos);
4850 foreach (Element element in EClass.pc.elements.dict.Values)
4851 {
4852 if (EClass.rnd(5) == 0 && element.IsMainAttribute)
4853 {
4854 EClass.pc.elements.ModExp(element.id, -500, false);
4855 }
4856 }
4857 }
4858 }
4859 }
4860
4861 // Token: 0x060014D9 RID: 5337 RVA: 0x0008B3D4 File Offset: 0x000895D4
4862 public void Vomit()
4863 {
4864 int c_vomit = base.c_vomit;
4865 base.c_vomit = c_vomit + 1;
4866 base.Say("vomit", this, null, null);
4867 base.PlaySound("vomit", 1f, true);
4868 if (!EClass._zone.IsRegion)
4869 {
4870 Thing thing = ThingGen.Create("731", -1, -1);
4871 if (!EClass._zone.IsPCFaction)
4872 {
4873 thing.MakeRefFrom(this, null);
4874 }
4875 EClass._zone.AddCard(thing, this.pos);
4876 }
4877 if (this.HasCondition<ConAnorexia>())
4878 {
4879 base.ModExp(70, -50);
4880 base.ModExp(71, -75);
4881 base.ModExp(77, -100);
4882 }
4883 else if (base.c_vomit > 10)
4884 {
4885 this.AddCondition<ConAnorexia>(100, false);
4886 }
4887 this.AddCondition<ConDim>(100, false);
4888 if (this.HasCondition<ConAnorexia>())
4889 {
4890 this.ModWeight(-1 * (1 + EClass.rnd(5)), false);
4891 }
4892 if (this.hunger.GetPhase() >= 4)
4893 {
4894 base.DamageHP(9999, AttackSource.Hunger, null);
4895 }
4896 this.hunger.Mod(30);
4897 }
4898
4899 // Token: 0x060014DA RID: 5338 RVA: 0x0008B4D8 File Offset: 0x000896D8
4900 public override void Die(Element e = null, Card origin = null, AttackSource attackSource = AttackSource.None)
4901 {
4902 this.combatCount = 0;
4903 if (this.isDead || this.host != null)
4904 {
4905 return;
4906 }
4907 bool isInActiveZone = this.IsInActiveZone;
4908 if (isInActiveZone)
4909 {
4910 if (this.IsPC)
4911 {
4912 EClass._zone.ResetHostility();
4913 }
4914 if (base.isSummon)
4915 {
4916 base.Say("summon_vanish", this, null, null);
4917 this.pos.PlayEffect("vanish");
4918 this.pos.PlaySound("vanish", true, 1f, true);
4919 base.Destroy();
4920 return;
4921 }
4922 Effect.Get("blood").Play((this.parent is Chara) ? (this.parent as Chara).pos : this.pos, 0f, null, null).SetParticleColor(EClass.Colors.matColors[base.material.alias].main).Emit(50);
4923 base.AddBlood(2 + EClass.rnd(2), -1);
4924 this.renderer.RefreshSprite();
4925 this.renderer.RefreshStateIcon();
4926 base.ClearFOV();
4927 base.PlaySound(base.material.GetSoundDead(this.source), 1f, true);
4928 }
4929 string text = "";
4930 if (LangGame.Has("dead_" + attackSource.ToString()))
4931 {
4932 text = "dead_" + attackSource.ToString();
4933 }
4934 else
4935 {
4936 if (e != Element.Void && e != null)
4937 {
4938 text = "dead_" + e.source.alias;
4939 }
4940 if (text == "" || !LangGame.Has(text))
4941 {
4942 text = "dead";
4943 }
4944 }
4945 if (this.IsPC)
4946 {
4947 string s = (origin == null) ? text : "dead_by";
4948 "dead_in".langGame(EClass._zone.Name, null, null, null);
4949 Msg.thirdPerson1.Set(EClass.pc, false);
4950 EClass.player.deathMsg = GameLang.Parse(s.langGame(), true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name, null, null, null), (origin == null) ? "" : origin.GetName(NameStyle.Full, -1), null);
4951 Debug.Log(EClass.player.deathMsg);
4952 ZoneInstanceRandomQuest zoneInstanceRandomQuest = EClass._zone.instance as ZoneInstanceRandomQuest;
4953 if (zoneInstanceRandomQuest != null)
4954 {
4955 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
4956 }
4957 }
4958 if (isInActiveZone)
4959 {
4960 if (origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
4961 {
4962 Msg.Say(text, this, "", null, null);
4963 }
4964 string text2 = this.TalkTopic("dead");
4965 if (!text2.IsEmpty())
4966 {
4967 text2 = text2.StripBrackets();
4968 }
4969 bool flag = base.rarity >= Rarity.Legendary && !this.IsPCFaction;
4970 if (!this.IsPC && flag)
4971 {
4972 this.MakeGrave(text2);
4973 }
4974 Msg.SetColor();
4975 base.SpawnLoot(origin);
4976 if (this.held != null && this.held.trait.CanOnlyCarry)
4977 {
4978 this.DropHeld(null);
4979 }
4980 }
4981 if (this.IsPCFaction)
4982 {
4983 if (this.homeBranch != null)
4984 {
4985 this.homeBranch.Log(text, this, "", null, null);
4986 }
4987 WidgetPopText.Say("popDead".lang(base.Name, null, null, null, null), FontColor.Bad, null);
4988 if (!this.IsPC)
4989 {
4990 if (EClass.player.stats.allyDeath == 0)
4991 {
4992 Tutorial.Reserve("death_pet", null);
4993 }
4994 EClass.player.stats.allyDeath++;
4995 }
4996 }
4997 if (this.id == "mandrake")
4998 {
4999 base.Say("a_scream", this, null, null);
5000 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, this.pos, true, default(ActRef));
5001 }
5002 this.daysStarved = 0;
5003 this.isDead = true;
5004 this.enemy = null;
5005 this._cooldowns = null;
5006 base.isSale = false;
5007 EClass._map.props.sales.Remove(this);
5008 this.Cure(CureType.Death, 100, BlessedState.Normal);
5009 this.SetAI(new NoGoal());
5010 this.TryDropBossLoot();
5011 if (isInActiveZone && EClass._zone.HasLaw && this.IsHuman && this.OriginalHostility >= Hostility.Neutral)
5012 {
5013 this.pos.TalkWitnesses((origin != null) ? origin.Chara : null, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique, 3);
5014 }
5015 if (this.IsPC)
5016 {
5017 EClass.player.returnInfo = null;
5018 EClass.player.uidLastTravelZone = 0;
5019 foreach (Chara chara in EClass._map.charas)
5020 {
5021 if (chara.IsHostile())
5022 {
5023 chara.hostility = chara.OriginalHostility;
5024 }
5025 if (chara.enemy == EClass.pc)
5026 {
5027 chara.enemy = null;
5028 }
5029 }
5030 if (EClass.pc.things.Find("letter_will", -1, -1) != null && EClass.rnd(10) == 0)
5031 {
5032 EClass.player.preventDeathPenalty = true;
5033 }
5034 }
5035 else
5036 {
5037 if (this.currentZone.IsActiveZone && this.IsLocalChara)
5038 {
5039 EClass._map.deadCharas.Add(this);
5040 }
5041 this.currentZone.RemoveCard(this);
5042 }
5043 if ((origin != null && origin.IsPCParty) || this.IsPCParty)
5044 {
5045 this.ModAffinity(EClass.pc, -10, false);
5046 }
5047 if (origin != null)
5048 {
5049 if (origin.IsPCParty || origin.IsPCPartyMinion)
5050 {
5051 int num = 0;
5052 if (this.OriginalHostility >= Hostility.Friend && this.IsHuman && !this.IsPCFaction && !this.IsPCFactionMinion)
5053 {
5054 num = -5;
5055 }
5056 else if (this.race.id == "cat" && this.OriginalHostility >= Hostility.Neutral)
5057 {
5058 EClass.pc.Say("killcat", null, null);
5059 num = -1;
5060 }
5061 if (EClass.pc.party.HasElement(1563) && num < 0)
5062 {
5063 num = num * 30 / 100;
5064 }
5065 if (num != 0)
5066 {
5067 EClass.player.ModKarma(num);
5068 }
5069 }
5070 if (origin == EClass.pc)
5071 {
5072 EClass.pc.faith.Revelation("kill", 10);
5073 }
5074 else if (origin.IsPCFaction)
5075 {
5076 origin.Chara.ModAffinity(EClass.pc, 1, false);
5077 origin.Chara.ShowEmo(Emo.love, 0f, true);
5078 }
5079 }
5080 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5081 {
5082 EClass.player.doneBackers.Add(base.sourceBacker.id);
5083 }
5084 base.SetInt(103, this.IsPCParty ? 1 : 0);
5085 if (this.IsPCParty)
5086 {
5087 if (!this.IsPC)
5088 {
5089 EClass.pc.party.RemoveMember(this);
5090 EClass.pc.Say("allyDead", null, null);
5091 if (EClass.game.config.autoCombat.abortOnAllyDead && EClass.player.TryAbortAutoCombat())
5092 {
5093 Msg.Say("abort_allyDead");
5094 }
5095 }
5096 }
5097 else if (EClass.game.config.autoCombat.abortOnEnemyDead && EClass.player.TryAbortAutoCombat())
5098 {
5099 Msg.Say("abort_enemyDead");
5100 }
5101 string id = this.id;
5102 if (!(id == "littleOne"))
5103 {
5104 if (id == "big_daddy")
5105 {
5106 if (!this.IsPCFaction)
5107 {
5108 Chara t = CharaGen.Create("littleOne", -1);
5109 EClass._zone.AddCard(t, this.pos.Copy());
5110 Msg.Say("little_pop");
5111 }
5112 }
5113 }
5114 else
5115 {
5116 EClass.player.flags.little_killed = true;
5117 EClass.player.little_dead++;
5118 }
5119 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5120 {
5121 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV, -1);
5122 EClass._zone.AddCard(chara2, this.pos.Copy());
5123 if (chara2.LV < base.LV)
5124 {
5125 chara2.SetLv(base.LV);
5126 }
5127 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5128 Msg.Say("plant_pop", this, chara2, null, null);
5129 }
5130 foreach (ZoneEvent zoneEvent in EClass._zone.events.list)
5131 {
5132 zoneEvent.OnCharaDie(this);
5133 }
5134 }
5135
5136 // Token: 0x060014DB RID: 5339 RVA: 0x0008BD9C File Offset: 0x00089F9C
5137 public void TryDropBossLoot()
5138 {
5139 if (this.IsPCFaction || this.IsPCFactionMinion)
5140 {
5141 return;
5142 }
5143 int num = 0;
5144 bool flag = false;
5145 bool flag2 = false;
5146 Point point = this.pos.GetNearestPoint(true, false, false, true) ?? this.pos;
5147 TreasureType type = TreasureType.BossQuest;
5148 if (EClass._zone.Boss == this)
5149 {
5150 type = TreasureType.BossNefia;
5151 num = 2 + EClass.rnd(2);
5152 flag2 = (flag = true);
5153 EClass._zone.Boss = null;
5154 Msg.Say("boss_win", EClass._zone.Name, null, null, null);
5155 if (EClass._zone is Zone_Void && (!EClass.player.flags.KilledBossInVoid || EClass.debug.enable))
5156 {
5157 Msg.Say("boss_win_void", EClass._zone.Name, null, null, null);
5158 EClass.player.flags.KilledBossInVoid = true;
5159 }
5160 if (EClass._zone.IsNefia)
5161 {
5162 EClass._zone.GetTopZone().isConquered = true;
5163 }
5164 EClass.player.ModFame(EClass.rndHalf(30 + EClass._zone.DangerLv * 2));
5165 EClass.player.ModKarma(5);
5166 }
5167 string id = this.id;
5168 if (!(id == "vernis_boss"))
5169 {
5170 if (!(id == "melilith_boss"))
5171 {
5172 if (!(id == "isygarad"))
5173 {
5174 if (id == "swordkeeper")
5175 {
5176 num = 10;
5177 flag = true;
5178 SE.Play("kill_boss");
5179 SoundManager.ForceBGM();
5180 LayerDrama.Activate("_event", "event", "swordkeeper_defeat", null, null, "");
5181 }
5182 }
5183 else
5184 {
5185 num = 5;
5186 flag2 = (flag = true);
5187 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5188 if (questExploration != null)
5189 {
5190 SE.Play("kill_boss");
5191 questExploration.ChangePhase(3);
5192 EClass.Sound.StopBGM(3f, false);
5193 EClass._zone.SetBGM(1, false);
5194 }
5195 }
5196 }
5197 else
5198 {
5199 num = 5;
5200 flag2 = (flag = true);
5201 EClass.Sound.StopBGM(3f, false);
5202 EClass._zone.SetBGM(1, false);
5203 }
5204 }
5205 else
5206 {
5207 num = 5;
5208 flag2 = (flag = true);
5209 EClass.Sound.StopBGM(3f, false);
5210 EClass._zone.SetBGM(1, false);
5211 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5212 {
5213 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5214 }
5215 }
5216 if (flag)
5217 {
5218 SE.Play("kill_boss");
5219 }
5220 if (num != 0)
5221 {
5222 EClass.player.willAutoSave = true;
5223 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5224 point.SetBlock(0, 0);
5225 point.SetObj(0, 1, 0);
5226 EClass._zone.AddCard(thing, point).Install();
5227 ThingGen.TryLickChest(thing);
5228 }
5229 if (flag2)
5230 {
5231 EClass._zone.AddCard(ThingGen.CreateScroll(8221, 1), this.pos);
5232 }
5233 }
5234
5235 // Token: 0x060014DC RID: 5340 RVA: 0x0008C06C File Offset: 0x0008A26C
5236 public void Kick(Point p, bool ignoreSelf = false)
5237 {
5238 foreach (Chara t in p.ListCharas())
5239 {
5240 this.Kick(t, ignoreSelf, true);
5241 }
5242 }
5243
5244 // Token: 0x060014DD RID: 5341 RVA: 0x0008C0C4 File Offset: 0x0008A2C4
5245 public void Kick(Chara t, bool ignoreSelf = false, bool karmaLoss = true)
5246 {
5247 if (!this.IsAliveInCurrentZone)
5248 {
5249 return;
5250 }
5251 if (t.IsPC)
5252 {
5253 ActionMode.Adv.ClearPlans();
5254 }
5255 if (t.host != null)
5256 {
5257 return;
5258 }
5259 if (t == this)
5260 {
5261 if (!ignoreSelf)
5262 {
5263 Debug.Log(t.pos.GetNearestPoint(false, true, true, false));
5264 if (this.TryMove(t.pos.GetNearestPoint(false, true, true, false), true) != Card.MoveResult.Success)
5265 {
5266 t.MoveImmediate(this.pos.GetNearestPoint(false, true, true, false) ?? t.pos, true, true);
5267 return;
5268 }
5269 }
5270 }
5271 else
5272 {
5273 base.Say("kick", this, t, null, null);
5274 base.PlaySound("kick", 1f, true);
5275 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5276 {
5277 t.MoveByForce(t.pos.GetNearestPoint(false, false, true, true), this, !t.pos.IsBlocked);
5278 }
5279 if (t.conSleep != null)
5280 {
5281 t.conSleep.Kill(false);
5282 }
5283 if (this.IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5284 {
5285 EClass.player.ModKarma(-1);
5286 }
5287 t.PlayEffect("kick", true, 0f, default(Vector3));
5288 }
5289 }
5290
5291 // Token: 0x060014DE RID: 5342 RVA: 0x0008C238 File Offset: 0x0008A438
5292 public bool UseAbility(string idAct, Card tc = null, Point pos = null, bool pt = false)
5293 {
5294 Element element = this.elements.GetElement(idAct);
5295 return this.UseAbility(((element != null) ? element.act : null) ?? ACT.Create(idAct), tc, pos, pt);
5296 }
5297
5298 // Token: 0x060014DF RID: 5343 RVA: 0x0008C268 File Offset: 0x0008A468
5299 public bool UseAbility(Act a, Card tc = null, Point pos = null, bool pt = false)
5300 {
5301 Chara.<>c__DisplayClass371_0 CS$<>8__locals1 = new Chara.<>c__DisplayClass371_0();
5302 CS$<>8__locals1.<>4__this = this;
5303 CS$<>8__locals1.tc = tc;
5304 CS$<>8__locals1.a = a;
5305 CS$<>8__locals1.pos = pos;
5306 CS$<>8__locals1.pt = pt;
5307 if (!this.IsPC && this.HasCooldown(CS$<>8__locals1.a.id))
5308 {
5309 return false;
5310 }
5311 int num = 1;
5312 Act.Cost cost = CS$<>8__locals1.a.GetCost(this);
5313 CS$<>8__locals1.a.GetPower(this);
5314 CS$<>8__locals1.n = 1;
5315 int num2 = 0;
5316 if (this.IsPC && this.HasCondition<StanceManaCost>())
5317 {
5318 num2 = base.Evalue(1657);
5319 }
5320 Chara._pts.Clear();
5321 if (CS$<>8__locals1.a.TargetType.ForceParty)
5322 {
5323 CS$<>8__locals1.pt = true;
5324 }
5325 if (CS$<>8__locals1.pt)
5326 {
5327 CS$<>8__locals1.n = 0;
5328 CS$<>8__locals1.<UseAbility>g__ForeachParty|0(delegate(Chara c)
5329 {
5330 int n = CS$<>8__locals1.n;
5331 CS$<>8__locals1.n = n + 1;
5332 });
5333 }
5334 int num3 = 100;
5335 if (!CS$<>8__locals1.a.TargetType.ForceParty && CS$<>8__locals1.n > 1)
5336 {
5337 num3 = (this.IsPC ? (CS$<>8__locals1.n * 100) : (50 + CS$<>8__locals1.n * 50));
5338 }
5339 int num4 = cost.cost * num3 / 100;
5340 if (cost.type == Act.CostType.MP && base.Evalue(483) > 0)
5341 {
5342 num4 = num4 * 100 / (100 + (int)Mathf.Sqrt((float)(base.Evalue(483) * 10)) * 3);
5343 }
5344 if (CS$<>8__locals1.n == 0)
5345 {
5346 if (this.IsPC)
5347 {
5348 Msg.SayNothingHappen();
5349 }
5350 return false;
5351 }
5352 if (!this.IsPC && cost.type == Act.CostType.MP && this.mana.value < 0 && (EClass.rnd(4) != 0 || this.IsPCFaction || (base.IsPowerful && this.mana.value < -20)))
5353 {
5354 return false;
5355 }
5356 if (this.IsPC)
5357 {
5358 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && this.mana.value < num4 && !EClass.debug.godMode)
5359 {
5360 ActPlan.warning = true;
5361 Dialog.TryWarnMana(delegate
5362 {
5363 if (CS$<>8__locals1.<>4__this.UseAbility(CS$<>8__locals1.a, CS$<>8__locals1.tc, CS$<>8__locals1.pos, CS$<>8__locals1.pt))
5364 {
5365 EClass.player.EndTurn(true);
5366 }
5367 });
5368 return false;
5369 }
5370 EClass.ui.CloseLayers();
5371 }
5372 if ((this.isConfused && EClass.rnd(4) == 0) || (this.isBlind && (CS$<>8__locals1.pt || (CS$<>8__locals1.pos != null && !CS$<>8__locals1.pos.Equals(this.pos)) || (CS$<>8__locals1.tc != null && CS$<>8__locals1.tc.pos != null && !CS$<>8__locals1.tc.pos.Equals(this.pos))) && EClass.rnd(2) == 0))
5373 {
5374 base.Say("shakeHead", this, null, null);
5375 return true;
5376 }
5377 if (CS$<>8__locals1.tc != null && CS$<>8__locals1.tc != this)
5378 {
5379 this.LookAt(CS$<>8__locals1.tc.pos);
5380 }
5381 if (CS$<>8__locals1.pos != null && !this.pos.Equals(CS$<>8__locals1.pos))
5382 {
5383 this.LookAt(CS$<>8__locals1.pos);
5384 }
5385 if (CS$<>8__locals1.a.CanRapidFire && base.HasElement(1648, 1))
5386 {
5387 num = 1 + base.Evalue(1648);
5388 }
5389 if (this.IsPC && cost.cost > 0 && CS$<>8__locals1.a.Value == 0)
5390 {
5391 Msg.SayNothingHappen();
5392 return false;
5393 }
5394 if (CS$<>8__locals1.a is Spell)
5395 {
5396 string s = this.isConfused ? "_cast_confuse" : (this.HasCondition<ConDim>() ? "_cast_dim" : "");
5397 if (!CS$<>8__locals1.a.source.tag.Contains("useHand"))
5398 {
5399 base.Say(this.race.castStyle.IsEmpty("cast"), this, CS$<>8__locals1.a.source.GetName().ToLower(), s.lang());
5400 }
5401 if (this.IsPC)
5402 {
5403 int num5 = (CS$<>8__locals1.n + 1) / 2;
5404 if (CS$<>8__locals1.a.vPotential < CS$<>8__locals1.n)
5405 {
5406 CS$<>8__locals1.n = 1;
5407 Chara._pts.Clear();
5408 Chara._pts.Add(this);
5409 }
5410 if (CS$<>8__locals1.a.vPotential < CS$<>8__locals1.n)
5411 {
5412 Msg.Say("noSpellStock");
5413 EInput.Consume(false, 1);
5414 return false;
5415 }
5416 if (num2 > 0 && CS$<>8__locals1.a.vPotential >= CS$<>8__locals1.n * 2)
5417 {
5418 CS$<>8__locals1.a.vPotential -= CS$<>8__locals1.n * 2;
5419 num4 = num4 * (100 - num2 * 20) / 100;
5420 }
5421 else
5422 {
5423 CS$<>8__locals1.a.vPotential -= CS$<>8__locals1.n;
5424 }
5425 LayerAbility.SetDirty(CS$<>8__locals1.a);
5426 }
5427 }
5428 else if (CS$<>8__locals1.a.source.langAct.Length != 0 && CS$<>8__locals1.tc != null)
5429 {
5430 string text = CS$<>8__locals1.a.source.langAct[0];
5431 string text2 = (CS$<>8__locals1.a.source.langAct.Length >= 2) ? CS$<>8__locals1.a.source.langAct[1] : "";
5432 if (text == "spell_hand")
5433 {
5434 string[] list = Lang.GetList("attack" + this.race.meleeStyle.IsEmpty("Touch"));
5435 string @ref = text2.lang(list[4], null, null, null, null);
5436 base.Say(CS$<>8__locals1.tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, CS$<>8__locals1.tc, @ref, CS$<>8__locals1.tc.IsPCParty ? list[1] : list[2]);
5437 }
5438 else
5439 {
5440 base.Say(text, this, CS$<>8__locals1.tc, text2.IsEmpty() ? "" : text2.lang(), null);
5441 }
5442 if (CS$<>8__locals1.a.source.id == 6630)
5443 {
5444 base.Talk("insult_" + (base.IsMale ? "m" : "f"), null, null, false);
5445 }
5446 }
5447 Act.CostType type = cost.type;
5448 if (type != Act.CostType.MP)
5449 {
5450 if (type == Act.CostType.SP)
5451 {
5452 this.stamina.Mod(-num4);
5453 }
5454 }
5455 else
5456 {
5457 if (base.Evalue(1421) >= 2 && base.hp <= this.MaxHP / (9 - base.Evalue(1421) * 2))
5458 {
5459 num4 /= 2;
5460 }
5461 this.mana.Mod(-num4);
5462 if (this.isDead)
5463 {
5464 return true;
5465 }
5466 this.elements.ModExp(304, Mathf.Clamp(num4 * 2, 1, 200), false);
5467 }
5468 if (CS$<>8__locals1.a is Spell && this.GetCondition<ConSilence>() != null)
5469 {
5470 base.Say("cast_silence", this, null, null);
5471 return true;
5472 }
5473 if (this.isDead)
5474 {
5475 return true;
5476 }
5477 int spellExp = this.elements.GetSpellExp(this, CS$<>8__locals1.a, num3);
5478 if (EClass.rnd(100) >= this.CalcCastingChance(CS$<>8__locals1.a, CS$<>8__locals1.n) && !EClass.debug.godMode)
5479 {
5480 base.PlayEffect("fizzle", true, 0f, default(Vector3));
5481 base.PlaySound("fizzle", 1f, true);
5482 if (cost.cost > 0 && CS$<>8__locals1.a.source.lvFactor > 0)
5483 {
5484 base.ModExp(CS$<>8__locals1.a.id, spellExp / 5);
5485 }
5486 this.RemoveCondition<ConInvisibility>();
5487 return true;
5488 }
5489 bool flag = true;
5490 if (CS$<>8__locals1.pt)
5491 {
5492 Act.forcePt = true;
5493 CS$<>8__locals1.<UseAbility>g__ForeachParty|0(delegate(Chara c)
5494 {
5495 CS$<>8__locals1.a.Perform(CS$<>8__locals1.<>4__this, c, c.pos);
5496 });
5497 Act.forcePt = false;
5498 }
5499 else
5500 {
5501 int num6 = 0;
5502 while (num6 < num && (CS$<>8__locals1.a.TargetType == TargetType.SelfParty || CS$<>8__locals1.tc == null || CS$<>8__locals1.tc.IsAliveInCurrentZone))
5503 {
5504 ActEffect.RapidCount = num6;
5505 ActEffect.RapidDelay = CS$<>8__locals1.a.RapidDelay;
5506 flag = CS$<>8__locals1.a.Perform(this, CS$<>8__locals1.tc, CS$<>8__locals1.pos);
5507 num6++;
5508 }
5509 }
5510 if (flag && !this.isDead && cost.cost > 0 && CS$<>8__locals1.a.source.lvFactor > 0)
5511 {
5512 base.ModExp(CS$<>8__locals1.a.id, spellExp);
5513 }
5514 ActEffect.RapidCount = 0;
5515 if (!this.IsPC && CS$<>8__locals1.a.source.cooldown > 0)
5516 {
5517 this.AddCooldown(CS$<>8__locals1.a.id, CS$<>8__locals1.a.source.cooldown);
5518 }
5519 if (flag && !CS$<>8__locals1.a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
5520 {
5521 this.RemoveCondition<ConInvisibility>();
5522 }
5523 return flag;
5524 }
5525
5526 // Token: 0x060014E0 RID: 5344 RVA: 0x0008CB04 File Offset: 0x0008AD04
5527 public int EvalueRiding()
5528 {
5529 if (this.ride != null && this.ride.HasCondition<ConTransmuteBroom>() && base.HasElement(1417, 1))
5530 {
5531 return 25 + base.Evalue(226) * 125 / 100;
5532 }
5533 return base.Evalue(226);
5534 }
5535
5536 // Token: 0x060014E1 RID: 5345 RVA: 0x0008CB54 File Offset: 0x0008AD54
5537 public int CalcCastingChance(Element e, int num = 1)
5538 {
5539 if (!(e is Spell))
5540 {
5541 return 100;
5542 }
5543 if (!this.IsPC)
5544 {
5545 int num2 = 95;
5546 if (this.host != null)
5547 {
5548 if (this.host.ride == this)
5549 {
5550 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + this.host.EvalueRiding()));
5551 }
5552 if (this.host.parasite == this)
5553 {
5554 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + this.host.Evalue(227)));
5555 }
5556 }
5557 return num2;
5558 }
5559 int num3 = base.Evalue(304);
5560 if (!this.IsPCFaction)
5561 {
5562 num3 = Mathf.Max(num3, base.LV + 5);
5563 }
5564 int num4 = 0;
5565 bool flag = this.GetArmorSkill() == 122;
5566 AttackStyle attackStyle = this.body.GetAttackStyle();
5567 int num5;
5568 if (flag)
5569 {
5570 num5 = 20 - base.Evalue(122) / 5;
5571 num4 += 10 - base.Evalue(1654) * 4;
5572 }
5573 else
5574 {
5575 num5 = 10 - base.Evalue(120) / 5;
5576 }
5577 if (num5 < 5)
5578 {
5579 num5 = 5;
5580 }
5581 if (this.ride != null)
5582 {
5583 num5 += 5;
5584 }
5585 if (this.parasite != null)
5586 {
5587 num5 += 10;
5588 }
5589 if (attackStyle == AttackStyle.TwoWield)
5590 {
5591 num5 += 5;
5592 }
5593 if (attackStyle == AttackStyle.Shield)
5594 {
5595 num5 += 5;
5596 num4 += 10 - base.Evalue(1654) * 4;
5597 }
5598 if (this.isConfused)
5599 {
5600 num5 += 10000;
5601 }
5602 if (this.HasCondition<ConDim>())
5603 {
5604 num5 += ((base.Evalue(1654) >= 3) ? 1500 : 2500);
5605 }
5606 if (num > 1)
5607 {
5608 num5 += 5 * num;
5609 }
5610 if (num4 < 0)
5611 {
5612 num4 = 0;
5613 }
5614 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num5 / (10 + num3 * 10), 0, 100 - num4);
5615 }
5616
5617 // Token: 0x060014E2 RID: 5346 RVA: 0x0008CD20 File Offset: 0x0008AF20
5618 public void DoAI(int wait, Action onPerform)
5619 {
5620 this.SetAI(new DynamicAIAct("", delegate()
5621 {
5622 onPerform();
5623 return true;
5624 }, false)
5625 {
5626 wait = wait
5627 });
5628 }
5629
5630 // Token: 0x170005F2 RID: 1522
5631 // (get) Token: 0x060014E3 RID: 5347 RVA: 0x0008CD5F File Offset: 0x0008AF5F
5632 public bool IsMofuable
5633 {
5634 get
5635 {
5636 return this.race.tag.Contains("mofu");
5637 }
5638 }
5639
5640 // Token: 0x060014E4 RID: 5348 RVA: 0x0008CD78 File Offset: 0x0008AF78
5641 public void Cuddle(Chara c, bool headpat = false)
5642 {
5643 base.Talk("goodBoy", null, null, false);
5644 base.Say(headpat ? "headpat" : "cuddle", this, c, null, null);
5645 c.ShowEmo(Emo.love, 0f, true);
5646 if (EClass.rnd(this.IsPC ? 100 : 5000) == 0)
5647 {
5648 c.MakeEgg(true, 1, true);
5649 }
5650 if (headpat && this != c)
5651 {
5652 if (c.interest > 0)
5653 {
5654 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3), true);
5655 c.interest -= 20 + EClass.rnd(10);
5656 }
5657 if (this.faith == EClass.game.religions.MoonShadow && c.IsPCParty)
5658 {
5659 foreach (Chara chara in this.party.members)
5660 {
5661 if (!chara.IsPC && this.CanSeeLos(chara, -1, false))
5662 {
5663 chara.AddCondition<ConEuphoric>(100 + base.Evalue(6904) * 5, false);
5664 }
5665 }
5666 }
5667 }
5668 }
5669
5670 // Token: 0x060014E5 RID: 5349 RVA: 0x0008CEAC File Offset: 0x0008B0AC
5671 public Chara SetEnemy(Chara c = null)
5672 {
5673 this.enemy = c;
5674 if (c != null)
5675 {
5676 this.calmCheckTurn = 10 + EClass.rnd(30);
5677 }
5678 return c;
5679 }
5680
5681 // Token: 0x060014E6 RID: 5350 RVA: 0x0008CECC File Offset: 0x0008B0CC
5682 public void TrySetEnemy(Chara c)
5683 {
5684 if (this.IsPC && EClass.game.config.autoCombat.bDontChangeTarget)
5685 {
5686 return;
5687 }
5688 if (this.enemy != null && (EClass.rnd(5) != 0 || base.Dist(c) > 1))
5689 {
5690 return;
5691 }
5692 if (((this.IsPCFaction || this.IsPCFactionMinion) && (c.IsPCFaction || c.IsPCFactionMinion)) || (this.hostility == Hostility.Enemy && c.hostility == Hostility.Enemy))
5693 {
5694 return;
5695 }
5696 if (c.IsPC && this.hostility >= Hostility.Neutral)
5697 {
5698 return;
5699 }
5700 this.SetEnemy(c);
5701 }
5702
5703 // Token: 0x060014E7 RID: 5351 RVA: 0x0008CF60 File Offset: 0x0008B160
5704 private void GoHostile(Card _tg)
5705 {
5706 if (this.enemy == null && !this.IsPC)
5707 {
5708 if (base.GetInt(106, null) == 0)
5709 {
5710 this.TalkTopic("aggro");
5711 }
5712 if (this.OriginalHostility != Hostility.Enemy)
5713 {
5714 base.ShowEmo(Emo.angry, 0f, true);
5715 }
5716 this.SetEnemy(_tg.Chara);
5717 }
5718 if (!this.IsPCFaction && !this.IsPCFactionMinion && (_tg.IsPCFaction || _tg.IsPCFactionMinion))
5719 {
5720 if (this.hostility >= Hostility.Neutral)
5721 {
5722 base.Say("angry", this, null, null);
5723 }
5724 this.hostility = Hostility.Enemy;
5725 }
5726 }
5727
5728 // Token: 0x060014E8 RID: 5352 RVA: 0x0008D000 File Offset: 0x0008B200
5729 public void DoHostileAction(Card _tg, bool immediate = false)
5730 {
5731 if (_tg == null || !_tg.isChara)
5732 {
5733 return;
5734 }
5735 Chara chara = _tg.Chara;
5736 if (chara.IsPC)
5737 {
5738 EClass.pc.combatCount = 10;
5739 }
5740 if (!chara.IsAliveInCurrentZone || !this.IsAliveInCurrentZone || chara == this)
5741 {
5742 return;
5743 }
5744 if ((this.IsPCFaction || this.IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
5745 {
5746 chara.Say("frown", this, chara, null, null);
5747 return;
5748 }
5749 if (EClass._zone.IsRegion)
5750 {
5751 return;
5752 }
5753 if (this.IsPC)
5754 {
5755 if (chara.IsFriendOrAbove() && !immediate)
5756 {
5757 chara.Say("frown", this, chara, null, null);
5758 chara.ShowEmo(Emo.sad, 0f, true);
5759 chara.hostility = Hostility.Neutral;
5760 return;
5761 }
5762 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral)
5763 {
5764 bool flag = chara.id == "fanatic";
5765 if (EClass.rnd(4) == 0 || flag)
5766 {
5767 chara.Say("callHelp", chara, null, null);
5768 chara.CallHelp(this, flag);
5769 }
5770 }
5771 if (chara.hostility > Hostility.Enemy)
5772 {
5773 goto IL_1B9;
5774 }
5775 using (List<Chara>.Enumerator enumerator = EClass.pc.party.members.GetEnumerator())
5776 {
5777 while (enumerator.MoveNext())
5778 {
5779 Chara chara2 = enumerator.Current;
5780 if (chara2 != EClass.pc && chara2.enemy == null)
5781 {
5782 chara2.SetEnemy(chara);
5783 }
5784 }
5785 goto IL_1B9;
5786 }
5787 }
5788 if (chara.IsPC && this.hostility <= Hostility.Enemy)
5789 {
5790 foreach (Chara chara3 in EClass.pc.party.members)
5791 {
5792 if (chara3 != EClass.pc && chara3.enemy == null)
5793 {
5794 chara3.SetEnemy(this);
5795 }
5796 }
5797 }
5798 IL_1B9:
5799 if (chara.calmCheckTurn <= 0 || this.IsPC)
5800 {
5801 chara.calmCheckTurn = (this.IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
5802 }
5803 if (this.hostility == Hostility.Enemy && chara.hostility == Hostility.Enemy)
5804 {
5805 return;
5806 }
5807 this.GoHostile(chara);
5808 chara.GoHostile(this);
5809 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(6) == 0)
5810 {
5811 Thing t = ThingGen.Create("49", -1, -1);
5812 ActThrow.Throw(chara, this.pos, t, ThrowMethod.Default, 0f);
5813 }
5814 }
5815
5816 // Token: 0x060014E9 RID: 5353 RVA: 0x0008D28C File Offset: 0x0008B48C
5817 public void CallHelp(Chara tg, bool fanatic = false)
5818 {
5819 foreach (Chara chara in EClass._map.charas)
5820 {
5821 if (!chara.IsPCFaction && chara.OriginalHostility == this.OriginalHostility && (fanatic || base.Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
5822 {
5823 chara.GoHostile(tg);
5824 }
5825 }
5826 }
5827
5828 // Token: 0x060014EA RID: 5354 RVA: 0x0008D314 File Offset: 0x0008B514
5829 public bool FindNewEnemy()
5830 {
5831 if (EClass._zone.isPeace && base.IsPCFactionOrMinion)
5832 {
5833 return false;
5834 }
5835 if (this.enemy != null && !this.enemy.IsAliveInCurrentZone)
5836 {
5837 this.enemy = null;
5838 }
5839 if (this.enemy != null)
5840 {
5841 return false;
5842 }
5843 bool flag = this.enemy != null || this.ai is GoalCombat;
5844 int num = (base.PER + base.Evalue(210) * 2) * (flag ? 2 : 1);
5845 bool flag2 = this.IsPCParty && !this.IsPC && EClass.game.config.tactics.dontWander;
5846 bool flag3 = !this.IsPCParty;
5847 for (int i = 0; i < EClass._map.charas.Count; i++)
5848 {
5849 Chara chara = EClass._map.charas[i];
5850 if (chara != this && this.IsHostile(chara) && this.CanSee(chara))
5851 {
5852 int num2 = base.Dist(chara);
5853 int num3 = base.GetSightRadius() + (flag ? 1 : 0);
5854 if (num2 <= num3)
5855 {
5856 if (flag3 && EClass.rnd(chara.Evalue(152) + 5) * (100 + num2 * num2 * 10) / 100 > EClass.rnd(num))
5857 {
5858 chara.ModExp(152, Mathf.Clamp((num - chara.Evalue(152)) / 2, 1, 20));
5859 }
5860 else if (Los.IsVisible(this.pos.x, chara.pos.x, this.pos.z, chara.pos.z, null, true) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara, -1, false)))
5861 {
5862 if (this.IsPCFaction)
5863 {
5864 AI_Shear ai_Shear = EClass.pc.ai as AI_Shear;
5865 if (ai_Shear != null && ai_Shear.target == chara)
5866 {
5867 goto IL_1EC;
5868 }
5869 }
5870 this.DoHostileAction(chara, false);
5871 this.enemy = chara;
5872 return true;
5873 }
5874 }
5875 }
5876 IL_1EC:;
5877 }
5878 return false;
5879 }
5880
5881 // Token: 0x060014EB RID: 5355 RVA: 0x0008D52C File Offset: 0x0008B72C
5882 public bool FindNearestNewEnemy()
5883 {
5884 for (int i = 0; i < EClass._map.charas.Count; i++)
5885 {
5886 Chara chara = EClass._map.charas[i];
5887 if (chara != this && chara != this.enemy && this.IsHostile(chara) && base.Dist(chara) <= 1 && this.CanInteractTo(chara.pos))
5888 {
5889 this.DoHostileAction(chara, false);
5890 this.enemy = chara;
5891 return true;
5892 }
5893 }
5894 return false;
5895 }
5896
5897 // Token: 0x060014EC RID: 5356 RVA: 0x0008D5A4 File Offset: 0x0008B7A4
5898 public bool IsHostile()
5899 {
5900 return this.hostility <= Hostility.Enemy;
5901 }
5902
5903 // Token: 0x060014ED RID: 5357 RVA: 0x0008D5B4 File Offset: 0x0008B7B4
5904 public bool IsHostile(Chara c)
5905 {
5906 if (c == null)
5907 {
5908 return false;
5909 }
5910 if (base.IsPCFactionOrMinion)
5911 {
5912 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
5913 {
5914 return true;
5915 }
5916 }
5917 else
5918 {
5919 if (this.trait is TraitGuard && c.IsPCParty && EClass.player.IsCriminal && EClass._zone.instance == null)
5920 {
5921 return true;
5922 }
5923 if (this.OriginalHostility >= Hostility.Friend)
5924 {
5925 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
5926 {
5927 return true;
5928 }
5929 }
5930 else if (this.OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
5931 {
5932 return true;
5933 }
5934 }
5935 return false;
5936 }
5937
5938 // Token: 0x060014EE RID: 5358 RVA: 0x0008D660 File Offset: 0x0008B860
5939 public bool IsNeutral()
5940 {
5941 return this.hostility == Hostility.Neutral;
5942 }
5943
5944 // Token: 0x060014EF RID: 5359 RVA: 0x0008D66B File Offset: 0x0008B86B
5945 public bool IsNeutralOrAbove()
5946 {
5947 return this.hostility >= Hostility.Neutral;
5948 }
5949
5950 // Token: 0x060014F0 RID: 5360 RVA: 0x0008D679 File Offset: 0x0008B879
5951 public bool IsBranchMember()
5952 {
5953 return this.faction == EClass.Home && this.homeZone == EClass.game.activeZone;
5954 }
5955
5956 // Token: 0x060014F1 RID: 5361 RVA: 0x0008D69C File Offset: 0x0008B89C
5957 public bool IsHomeMember()
5958 {
5959 return this.faction == EClass.Home;
5960 }
5961
5962 // Token: 0x060014F2 RID: 5362 RVA: 0x0008D6AB File Offset: 0x0008B8AB
5963 public bool IsInHomeZone()
5964 {
5965 return EClass.game.activeZone == this.homeZone;
5966 }
5967
5968 // Token: 0x060014F3 RID: 5363 RVA: 0x0008D6C0 File Offset: 0x0008B8C0
5969 public bool IsInSpot<T>() where T : TraitSpot
5970 {
5971 foreach (T t in EClass._map.props.installed.traits.List<T>(null))
5972 {
5973 foreach (Point obj in t.ListPoints(null, true))
5974 {
5975 if (this.pos.Equals(obj))
5976 {
5977 return true;
5978 }
5979 }
5980 }
5981 return false;
5982 }
5983
5984 // Token: 0x060014F4 RID: 5364 RVA: 0x0008D778 File Offset: 0x0008B978
5985 public bool IsGuest()
5986 {
5987 return this.memberType == FactionMemberType.Guest;
5988 }
5989
5990 // Token: 0x060014F5 RID: 5365 RVA: 0x0008D783 File Offset: 0x0008B983
5991 public bool IsFriendOrAbove()
5992 {
5993 return this.hostility >= Hostility.Friend;
5994 }
5995
5996 // Token: 0x060014F6 RID: 5366 RVA: 0x0008D794 File Offset: 0x0008B994
5997 public bool IsFriendOrAbove(Chara c)
5998 {
5999 if (base.IsPCFactionOrMinion || this.IsFriendOrAbove())
6000 {
6001 if (c.IsPCFactionOrMinion || c.IsFriendOrAbove())
6002 {
6003 return true;
6004 }
6005 }
6006 else if (this.IsHostile() && c.IsHostile())
6007 {
6008 return true;
6009 }
6010 return this.race == c.race;
6011 }
6012
6013 // Token: 0x060014F7 RID: 5367 RVA: 0x0008D7E4 File Offset: 0x0008B9E4
6014 public override CardRenderer _CreateRenderer()
6015 {
6016 CharaRenderer charaRenderer = new CharaRenderer();
6017 if (this.source.moveAnime == "hop")
6018 {
6019 charaRenderer.hopCurve = EClass.setting.render.anime.hop;
6020 }
6021 if (this.host != null)
6022 {
6023 charaRenderer.pccData = PCCData.Create("ride");
6024 string text = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First<string>());
6025 charaRenderer.pccData.SetPart("body", "ride", text, null);
6026 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(text);
6027 }
6028 else
6029 {
6030 foreach (Condition condition in this.conditions)
6031 {
6032 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6033 if (rendererReplacer != null)
6034 {
6035 charaRenderer.replacer = rendererReplacer;
6036 charaRenderer.data = rendererReplacer.data;
6037 break;
6038 }
6039 }
6040 if (charaRenderer.replacer == null)
6041 {
6042 charaRenderer.pccData = this.pccData;
6043 }
6044 }
6045 this.renderer = charaRenderer;
6046 this.renderer.SetOwner(this);
6047 return charaRenderer;
6048 }
6049
6050 // Token: 0x060014F8 RID: 5368 RVA: 0x0008D940 File Offset: 0x0008BB40
6051 public void SetPCCState(PCCState state)
6052 {
6053 if (this.IsPCC)
6054 {
6055 PCC.Get(this.pccData).Build(state, false);
6056 }
6057 }
6058
6059 // Token: 0x060014F9 RID: 5369 RVA: 0x0008D95C File Offset: 0x0008BB5C
6060 public override Sprite GetSprite(int dir = 0)
6061 {
6062 if (this.IsPCC)
6063 {
6064 PCC pcc = PCC.Get(this.pccData);
6065 pcc.Build(false);
6066 return pcc.variation.idle[0, 0];
6067 }
6068 return this.sourceCard.GetSprite((this.sourceCard._tiles.Length > 1) ? ((base.idSkin != 0 || this.source.staticSkin) ? base.idSkin : (base.uid % this.sourceCard._tiles.Length / 2 * 2 + (base.IsMale ? 0 : 1))) : 0, 0, false);
6069 }
6070
6071 // Token: 0x060014FA RID: 5370 RVA: 0x0008D9F8 File Offset: 0x0008BBF8
6072 public void SetTempHand(int right = 0, int left = 0)
6073 {
6074 if (!this.IsPC)
6075 {
6076 return;
6077 }
6078 if (this.IsPC)
6079 {
6080 return;
6081 }
6082 this.pccData.tempRight = EClass.scene.screenElin.renderTempEQ.ConvertTile(right);
6083 this.pccData.tempLeft = EClass.scene.screenElin.renderTempEQ.ConvertTile(left);
6084 }
6085
6086 // Token: 0x060014FB RID: 5371 RVA: 0x0008DA57 File Offset: 0x0008BC57
6087 public override SubPassData GetSubPassData()
6088 {
6089 if (this.IsPCC && (this.IsDeadOrSleeping || (!EClass.player.altHeldPos && this.parent is Chara)))
6090 {
6091 return EClass.setting.pass.subDeadPCC;
6092 }
6093 return SubPassData.Default;
6094 }
6095
6096 // Token: 0x060014FC RID: 5372 RVA: 0x0008DA98 File Offset: 0x0008BC98
6097 public override void SetRenderParam(RenderParam p)
6098 {
6099 p.mat = base.material;
6100 p.matColor = (float)base.colorInt;
6101 if (!this.renderer.usePass)
6102 {
6103 return;
6104 }
6105 if (this.renderer.replacer != null)
6106 {
6107 p.tile = (float)(this.renderer.replacer.tile * (this.flipX ? -1 : 1));
6108 }
6109 else if (this.source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6110 {
6111 if (this.source._tiles_snow.Length > 1)
6112 {
6113 int num = (base.idSkin != 0 || this.source.staticSkin) ? base.idSkin : (base.uid % this.source._tiles_snow.Length / 2 * 2 + (base.IsMale ? 0 : 1));
6114 p.tile = (float)(this.source._tiles_snow[(num < this.source._tiles_snow.Length) ? num : 0] * (this.flipX ? -1 : 1));
6115 }
6116 else
6117 {
6118 p.tile = (float)(this.source._tiles_snow[0] * (this.flipX ? -1 : 1));
6119 }
6120 }
6121 else if (this.sourceCard._tiles.Length > 1)
6122 {
6123 int num2 = (base.idSkin != 0 || this.source.staticSkin) ? base.idSkin : (base.uid % this.sourceCard._tiles.Length / 2 * 2 + (base.IsMale ? 0 : 1));
6124 p.tile = (float)(this.sourceCard._tiles[(num2 < this.sourceCard._tiles.Length) ? num2 : 0] * (this.flipX ? -1 : 1));
6125 }
6126 else
6127 {
6128 p.tile = (float)(this.sourceCard._tiles[0] * (this.flipX ? -1 : 1));
6129 }
6130 p.dir = base.dir;
6131 }
6132
6133 // Token: 0x060014FD RID: 5373 RVA: 0x0008DC8C File Offset: 0x0008BE8C
6134 public override string GetHoverText()
6135 {
6136 string text = base.Name;
6137 if (this.IsFriendOrAbove())
6138 {
6139 text = text.TagColor(EClass.Colors.colorFriend);
6140 }
6141 else if (this.IsHostile())
6142 {
6143 text = text.TagColor(EClass.Colors.colorHostile);
6144 }
6145 int num = 2;
6146 int lv = EClass.pc.LV;
6147 if (base.LV >= lv * 5)
6148 {
6149 num = 0;
6150 }
6151 else if (base.LV >= lv * 2)
6152 {
6153 num = 1;
6154 }
6155 else if (base.LV <= lv / 4)
6156 {
6157 num = 4;
6158 }
6159 else if (base.LV <= lv / 2)
6160 {
6161 num = 3;
6162 }
6163 string text2 = Lang.GetList("lvComparison")[num];
6164 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6165 string s = this.IsFriendOrAbove() ? "HostilityAlly" : (this.IsNeutral() ? "HostilityNeutral" : "HostilityEnemy");
6166 s = (" (" + s.lang() + ") ").TagSize(14);
6167 if (!EClass.pc.IsMoving)
6168 {
6169 if (EClass.pc.HasHigherGround(this))
6170 {
6171 text2 += "lowerGround".lang();
6172 }
6173 else if (this.HasHigherGround(EClass.pc))
6174 {
6175 text2 += "higherGround".lang();
6176 }
6177 }
6178 if (base.Evalue(1232) > 0)
6179 {
6180 text2 = "milkBaby".lang().TagSize(14) + text2;
6181 }
6182 if (EClass.pc.HasElement(481, 1))
6183 {
6184 text2 += ("( " + this.faith.Name + ")").TagSize(14);
6185 }
6186 return text + text2;
6187 }
6188
6189 // Token: 0x060014FE RID: 5374 RVA: 0x0008DE54 File Offset: 0x0008C054
6190 public override string GetHoverText2()
6191 {
6192 string str = "";
6193 if (this.knowFav)
6194 {
6195 str += Environment.NewLine;
6196 str = str + "<size=14>" + "favgift".lang(this.GetFavCat().GetName().ToLower(), this.GetFavFood().GetName(), null, null, null) + "</size>";
6197 }
6198 string text = "";
6199 if (EClass.debug.showExtra)
6200 {
6201 text += Environment.NewLine;
6202 text = string.Concat(new string[]
6203 {
6204 text,
6205 "Lv:",
6206 base.LV.ToString(),
6207 " HP:",
6208 base.hp.ToString(),
6209 "/",
6210 this.MaxHP.ToString(),
6211 " MP:",
6212 this.mana.value.ToString(),
6213 "/",
6214 this.mana.max.ToString(),
6215 " DV:",
6216 this.DV.ToString(),
6217 " PV:",
6218 this.PV.ToString(),
6219 " Hunger:",
6220 this.hunger.value.ToString()
6221 });
6222 text += Environment.NewLine;
6223 string[] array = new string[7];
6224 array[0] = text;
6225 array[1] = "Global:";
6226 array[2] = this.IsGlobal.ToString();
6227 array[3] = " AI:";
6228 int num = 4;
6229 AIAct aiact = this.ai;
6230 array[num] = ((aiact != null) ? aiact.ToString() : null);
6231 array[5] = " ";
6232 int num2 = 6;
6233 string tactics = this.source.tactics;
6234 SourceTactics.Row row = EClass.sources.tactics.map.TryGetValue(this.id, null);
6235 string defaultStr;
6236 if ((defaultStr = ((row != null) ? row.id : null)) == null)
6237 {
6238 SourceTactics.Row row2 = EClass.sources.tactics.map.TryGetValue(this.job.id, null);
6239 defaultStr = (((row2 != null) ? row2.id : null) ?? "predator");
6240 }
6241 array[num2] = tactics.IsEmpty(defaultStr);
6242 text = string.Concat(array);
6243 text += Environment.NewLine;
6244 string[] array2 = new string[7];
6245 array2[0] = text;
6246 array2[1] = base.uid.ToString();
6247 array2[2] = this.IsMinion.ToString();
6248 array2[3] = "/";
6249 array2[4] = base.c_uidMaster.ToString();
6250 array2[5] = "/";
6251 int num3 = 6;
6252 Chara chara = this.master;
6253 array2[num3] = ((chara != null) ? chara.ToString() : null);
6254 text = string.Concat(array2);
6255 }
6256 string text2 = "";
6257 if (this.conditions.Count > 0)
6258 {
6259 str = "";
6260 text2 += Environment.NewLine;
6261 text2 += "<size=14>";
6262 IEnumerable<BaseStats> first = this.conditions;
6263 IEnumerable<BaseStats> second;
6264 if (!this.IsPCFaction)
6265 {
6266 second = new BaseStats[0];
6267 }
6268 else
6269 {
6270 BaseStats[] array3 = new BaseStats[2];
6271 array3[0] = this.hunger;
6272 second = array3;
6273 array3[1] = this.stamina;
6274 }
6275 foreach (BaseStats baseStats in first.Concat(second))
6276 {
6277 string text3 = baseStats.GetPhaseStr();
6278 if (!text3.IsEmpty() && !(text3 == "#"))
6279 {
6280 Color c = Color.white;
6281 string group = baseStats.source.group;
6282 if (!(group == "Bad") && !(group == "Debuff") && !(group == "Disease"))
6283 {
6284 if (group == "Buff")
6285 {
6286 c = EClass.Colors.colorBuff;
6287 }
6288 }
6289 else
6290 {
6291 c = EClass.Colors.colorDebuff;
6292 }
6293 if (EClass.debug.showExtra)
6294 {
6295 text3 = text3 + "(" + baseStats.GetValue().ToString() + ")";
6296 if (this.resistCon != null && this.resistCon.ContainsKey(baseStats.id))
6297 {
6298 text3 = text3 + "{" + this.resistCon[baseStats.id].ToString() + "}";
6299 }
6300 }
6301 text2 = text2 + text3.TagColor(c) + ", ";
6302 }
6303 }
6304 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6305 }
6306 return str + text + text2;
6307 }
6308
6309 // Token: 0x060014FF RID: 5375 RVA: 0x0008E2FC File Offset: 0x0008C4FC
6310 public string GetTopicText(string topic = "calm")
6311 {
6312 string key = this.source.idText.IsEmpty(this.id);
6313 if (this.id == "littleOne" && EClass._zone is Zone_LittleGarden)
6314 {
6315 key = "littleOne2";
6316 }
6317 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key, null);
6318 if (row == null)
6319 {
6320 return null;
6321 }
6322 string text = row.GetText(topic, true);
6323 if (text.IsEmpty())
6324 {
6325 return null;
6326 }
6327 if (text.StartsWith("@"))
6328 {
6329 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""), null);
6330 if (row == null)
6331 {
6332 return null;
6333 }
6334 text = row.GetText(topic, true);
6335 if (text.IsEmpty())
6336 {
6337 return null;
6338 }
6339 }
6340 return text.Split(Environment.NewLine.ToCharArray()).RandomItem<string>();
6341 }
6342
6343 // Token: 0x06001500 RID: 5376 RVA: 0x0008E3D4 File Offset: 0x0008C5D4
6344 public unsafe string TalkTopic(string topic = "calm")
6345 {
6346 if (this.host == null && !this.IsInActiveZone)
6347 {
6348 return null;
6349 }
6350 if (!this.isSynced && (this.host == null || !this.host.isSynced) && topic != "dead")
6351 {
6352 return null;
6353 }
6354 if (this.IsPCParty)
6355 {
6356 int num = EClass.pc.party.members.Count - 1;
6357 if (!(topic == "calm"))
6358 {
6359 if (!(topic == "aggro"))
6360 {
6361 if (!(topic == "kill"))
6362 {
6363 if (topic == "fov")
6364 {
6365 return null;
6366 }
6367 }
6368 else if (EClass.rnd(num * 3) != 0)
6369 {
6370 return null;
6371 }
6372 }
6373 else if (EClass.rnd(num * 10) != 0)
6374 {
6375 return null;
6376 }
6377 }
6378 else if (EClass.rnd(num * 5) != 0)
6379 {
6380 return null;
6381 }
6382 }
6383 string text = this.GetTopicText(topic);
6384 if (text.IsEmpty())
6385 {
6386 return null;
6387 }
6388 string text2 = "_bracketTalk".lang();
6389 bool flag = text.StartsWith("*");
6390 bool flag2 = text.StartsWith("(");
6391 bool flag3 = text.StartsWith(text2) || (text.Length > 0 && text[0] == text2[0]) || text[0] == '“';
6392 text = base.ApplyTone(text, false);
6393 text = text.Replace("~", "*");
6394 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6395 Msg.Say(text.Replace("&", ""));
6396 if (topic == "dead")
6397 {
6398 EClass.ui.popGame.PopText(base.ApplyNewLine(text.StripBrackets()), null, "PopTextDead", default(Color), *this.pos.Position() + EClass.setting.render.tc.textPosDead, 0f);
6399 }
6400 else if (flag || flag3 || flag2)
6401 {
6402 (this.host ?? this).renderer.Say(base.ApplyNewLine(text.StripBrackets()), default(Color), this.IsPCParty ? 0.6f : 0f);
6403 }
6404 return text;
6405 }
6406
6407 // Token: 0x06001501 RID: 5377 RVA: 0x0008E61B File Offset: 0x0008C81B
6408 public override Sprite GetImageSprite()
6409 {
6410 return this.GetSprite(0);
6411 }
6412
6413 // Token: 0x06001502 RID: 5378 RVA: 0x0008E624 File Offset: 0x0008C824
6414 public void ChangeMemberType(FactionMemberType type)
6415 {
6416 this.memberType = type;
6417 }
6418
6419 // Token: 0x06001503 RID: 5379 RVA: 0x0008E630 File Offset: 0x0008C830
6420 public void ShowDialog()
6421 {
6422 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6423 if (this.IsDeadOrSleeping)
6424 {
6425 this.ShowDialog("_chara", "sleep", "");
6426 return;
6427 }
6428 if (base.isRestrained)
6429 {
6430 this.ShowDialog("_chara", "strain", "");
6431 return;
6432 }
6433 if (EClass.pc.isHidden && !this.CanSee(EClass.pc))
6434 {
6435 this.ShowDialog("_chara", "invisible", "");
6436 return;
6437 }
6438 if (this.IsEscorted())
6439 {
6440 this.ShowDialog("_chara", "escort", "");
6441 return;
6442 }
6443 if (EClass._zone is Zone_Music)
6444 {
6445 this.ShowDialog("_chara", "party", "");
6446 return;
6447 }
6448 if (LayerDrama.forceJump == null && EClass.game.quests.OnShowDialog(this))
6449 {
6450 return;
6451 }
6452 string id = this.id;
6453 if (!(id == "loytel"))
6454 {
6455 if (!(id == "farris"))
6456 {
6457 if (!(id == "ashland"))
6458 {
6459 if (!(id == "fiama"))
6460 {
6461 if (id == "big_sister")
6462 {
6463 if (EClass.player.flags.little_saved)
6464 {
6465 this.ShowDialog("big_sister", "little_saved", "");
6466 EClass.player.flags.little_saved = false;
6467 return;
6468 }
6469 if (EClass.player.flags.little_killed)
6470 {
6471 this.ShowDialog("big_sister", "little_dead", "");
6472 EClass.player.flags.little_killed = false;
6473 return;
6474 }
6475 }
6476 }
6477 else
6478 {
6479 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv)
6480 {
6481 SoundManager.ForceBGM();
6482 LayerDrama.ActivateMain("mono", "nymelle_crystal", null, null, "");
6483 return;
6484 }
6485 if (!EClass.player.EnableDreamStory)
6486 {
6487 this.ShowDialog("fiama", "main", "");
6488 return;
6489 }
6490 if (!EClass.player.flags.fiamaFirstDream && EClass.player.flags.storyFiama >= 10)
6491 {
6492 EClass.player.flags.fiamaFirstDream = true;
6493 this.ShowDialog("fiama", "firstDream", "");
6494 return;
6495 }
6496 if (!EClass.player.flags.fiamaStoryBookGiven && EClass.player.flags.storyFiama >= 30)
6497 {
6498 this.ShowDialog("fiama", "giveStoryBook", "").SetOnKill(delegate
6499 {
6500 EClass.player.flags.fiamaStoryBookGiven = true;
6501 EClass.player.DropReward(ThingGen.Create("book_story", -1, -1), false);
6502 });
6503 return;
6504 }
6505 this.ShowDialog("fiama", "main", "");
6506 return;
6507 }
6508 }
6509 else
6510 {
6511 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv)
6512 {
6513 SoundManager.ForceBGM();
6514 LayerDrama.ActivateMain("mono", "nymelle_crystal", null, null, "");
6515 return;
6516 }
6517 this.ShowDialog("ashland", "main", "");
6518 return;
6519 }
6520 }
6521 else
6522 {
6523 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3")
6524 {
6525 this.ShowDialog("_chara", "main", "");
6526 return;
6527 }
6528 int phase = EClass.game.quests.GetPhase<QuestExploration>();
6529 if (phase == -1)
6530 {
6531 this.ShowDialog("farris", "nymelle_noQuest", "");
6532 return;
6533 }
6534 if (phase == 0)
6535 {
6536 this.ShowDialog("farris", "nymelle_first", "");
6537 return;
6538 }
6539 if (phase == 1)
6540 {
6541 this.ShowDialog("farris", "home_first", "");
6542 return;
6543 }
6544 this.ShowDialog("_chara", "main", "");
6545 return;
6546 }
6547 }
6548 else
6549 {
6550 if (EClass.player.flags.loytelEscaped)
6551 {
6552 EClass.game.quests.Get("pre_debt_runaway").Complete();
6553 EClass.player.flags.loytelEscaped = false;
6554 EClass.game.quests.Add("debt", "loytel");
6555 this.ShowDialog("loytel", "loytelEscaped", "");
6556 return;
6557 }
6558 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
6559 if (questDebt != null && questDebt.paid)
6560 {
6561 questDebt.stage++;
6562 this.ShowDialog("loytel", "debt" + questDebt.stage.ToString(), "");
6563 return;
6564 }
6565 }
6566 if (this.trait is TraitGuildDoorman)
6567 {
6568 string tag = (this.trait is TraitDoorman_Fighter) ? "fighter" : ((this.trait is TraitDoorman_Mage) ? "mage" : "thief");
6569 this.ShowDialog("guild_doorman", "main", tag);
6570 return;
6571 }
6572 if (this.trait is TraitGuildClerk)
6573 {
6574 string tag2 = (this.trait is TraitClerk_Fighter) ? "fighter" : ((this.trait is TraitClerk_Mage) ? "mage" : "thief");
6575 this.ShowDialog("guild_clerk", "main", tag2);
6576 return;
6577 }
6578 if (File.Exists(CorePath.DramaData + this.id + ".xlsx"))
6579 {
6580 this.ShowDialog(this.id, "main", "");
6581 return;
6582 }
6583 this.ShowDialog("_chara", "main", "");
6584 }
6585
6586 // Token: 0x06001504 RID: 5380 RVA: 0x0008EB8E File Offset: 0x0008CD8E
6587 public LayerDrama ShowDialog(string book, string step = "main", string tag = "")
6588 {
6589 return this._ShowDialog(book, null, step, tag);
6590 }
6591
6592 // Token: 0x06001505 RID: 5381 RVA: 0x0008EB9A File Offset: 0x0008CD9A
6593 private LayerDrama _ShowDialog(string book, string sheet, string step = "main", string tag = "")
6594 {
6595 EClass.Sound.Play("pop_drama");
6596 if (book == "_chara" && this.IsPC)
6597 {
6598 step = "pc";
6599 }
6600 return LayerDrama.Activate(book, sheet, step, this, null, tag);
6601 }
6602
6603 // Token: 0x06001506 RID: 5382 RVA: 0x0008EBD4 File Offset: 0x0008CDD4
6604 public Point GetDestination()
6605 {
6606 return (this.ai.IsRunning ? this.ai.GetDestination() : this.pos).Copy();
6607 }
6608
6609 // Token: 0x06001507 RID: 5383 RVA: 0x0008EBFB File Offset: 0x0008CDFB
6610 public int GetHireCost()
6611 {
6612 return base.LV / 2 + 4;
6613 }
6614
6615 // Token: 0x06001508 RID: 5384 RVA: 0x0008EC08 File Offset: 0x0008CE08
6616 public int GetHappiness()
6617 {
6618 int num = 50;
6619 if (this.FindBed() != null)
6620 {
6621 num += 50;
6622 }
6623 return num;
6624 }
6625
6626 // Token: 0x06001509 RID: 5385 RVA: 0x0008EC28 File Offset: 0x0008CE28
6627 public string GetTextHappiness()
6628 {
6629 return this.GetHappiness().ToString() ?? "";
6630 }
6631
6632 // Token: 0x0600150A RID: 5386 RVA: 0x0008EC4C File Offset: 0x0008CE4C
6633 public string GetActionText()
6634 {
6635 string result = "?????";
6636 if (this.ai != null)
6637 {
6638 result = this.ai.GetCurrentActionText();
6639 }
6640 return result;
6641 }
6642
6643 // Token: 0x0600150B RID: 5387 RVA: 0x0008EC74 File Offset: 0x0008CE74
6644 public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
6645 {
6646 n.Clear();
6647 UIItem uiitem = n.AddHeaderCard(base.Name.ToTitleCase(false), null);
6648 this.SetImage(uiitem.image2);
6649 uiitem.text2.SetText(this.race.GetText("name", false).ToTitleCase(true) + " " + this.job.GetText("name", false).ToTitleCase(true));
6650 n.AddText("", FontColor.DontChange);
6651 n.Build();
6652 }
6653
6654 // Token: 0x0600150C RID: 5388 RVA: 0x0008ED00 File Offset: 0x0008CF00
6655 public override void SetSortVal(UIList.SortMode m, CurrencyType currency = CurrencyType.Money)
6656 {
6657 if (m <= UIList.SortMode.ByRace)
6658 {
6659 if (m == UIList.SortMode.ByJob)
6660 {
6661 this.sortVal = this.job._index * 10000 + this.sourceCard._index;
6662 return;
6663 }
6664 if (m == UIList.SortMode.ByRace)
6665 {
6666 this.sortVal = this.race._index * 10000 * (this.IsHuman ? -1 : 1) + this.sourceCard._index;
6667 return;
6668 }
6669 }
6670 else
6671 {
6672 if (m == UIList.SortMode.ByWorkk)
6673 {
6674 return;
6675 }
6676 if (m == UIList.SortMode.ByFeat)
6677 {
6678 this.sortVal = -this.GetTotalFeat();
6679 return;
6680 }
6681 }
6682 this.sortVal = this.sourceCard._index * (this.IsHuman ? -1 : 1);
6683 }
6684
6685 // Token: 0x0600150D RID: 5389 RVA: 0x0008EDAC File Offset: 0x0008CFAC
6686 public void ClearBed(Map map = null)
6687 {
6688 if (map == null)
6689 {
6690 map = EClass._map;
6691 }
6692 foreach (Card card in map.props.installed.all.Values)
6693 {
6694 TraitBed traitBed = card.trait as TraitBed;
6695 if (traitBed != null && traitBed.IsHolder(this))
6696 {
6697 traitBed.RemoveHolder(this);
6698 }
6699 }
6700 }
6701
6702 // Token: 0x0600150E RID: 5390 RVA: 0x0008EE30 File Offset: 0x0008D030
6703 public TraitBed FindBed()
6704 {
6705 foreach (Card card in EClass._map.props.installed.all.Values)
6706 {
6707 TraitBed traitBed = card.trait as TraitBed;
6708 if (traitBed != null && traitBed.IsHolder(this))
6709 {
6710 return traitBed;
6711 }
6712 }
6713 return null;
6714 }
6715
6716 // Token: 0x0600150F RID: 5391 RVA: 0x0008EEAC File Offset: 0x0008D0AC
6717 public TraitBed TryAssignBed()
6718 {
6719 if (this.memberType == FactionMemberType.Livestock || (!this.IsPCFaction && !this.IsGuest()))
6720 {
6721 return null;
6722 }
6723 foreach (Card card in EClass._map.props.installed.all.Values)
6724 {
6725 TraitBed traitBed = card.trait as TraitBed;
6726 if (traitBed != null && traitBed.CanAssign(this))
6727 {
6728 traitBed.AddHolder(this);
6729 Msg.Say("claimBed", this, null, null, null);
6730 return traitBed;
6731 }
6732 }
6733 return null;
6734 }
6735
6736 // Token: 0x06001510 RID: 5392 RVA: 0x0008EF5C File Offset: 0x0008D15C
6737 public void TryPutSharedItems(IEnumerable<Thing> containers, bool msg = true)
6738 {
6739 if (base.GetInt(113, null) != 0)
6740 {
6741 return;
6742 }
6743 Chara._ListItems.Clear();
6744 Thing bestRangedWeapon = this.GetBestRangedWeapon();
6745 foreach (Thing thing in this.things)
6746 {
6747 if (thing.category.slot != 0 && !thing.isEquipped)
6748 {
6749 Chara._ListItems.Add(thing);
6750 }
6751 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
6752 {
6753 Chara._ListItems.Add(thing);
6754 }
6755 }
6756 if (Chara._ListItems.Count == 0)
6757 {
6758 return;
6759 }
6760 List<Thing> containers2 = containers.ToList<Thing>();
6761 foreach (Thing t in Chara._ListItems)
6762 {
6763 EClass._zone.TryAddThingInSharedContainer(t, containers2, true, true, this, true);
6764 }
6765 }
6766
6767 // Token: 0x06001511 RID: 5393 RVA: 0x0008F07C File Offset: 0x0008D27C
6768 public void TryPutSharedItems(bool msg = true)
6769 {
6770 this.TryPutSharedItems(EClass._map.props.installed.containers, true);
6771 }
6772
6773 // Token: 0x06001512 RID: 5394 RVA: 0x0008F099 File Offset: 0x0008D299
6774 public void TryTakeSharedItems(bool msg = true)
6775 {
6776 this.TryTakeSharedItems(EClass._map.props.installed.containers, true, true);
6777 }
6778
6779 // Token: 0x06001513 RID: 5395 RVA: 0x0008F0B8 File Offset: 0x0008D2B8
6780 public void TryTakeSharedItems(IEnumerable<Thing> containers, bool msg = true, bool shouldEat = true)
6781 {
6782 if (base.isSummon)
6783 {
6784 return;
6785 }
6786 int num = 2;
6787 int num2 = 2;
6788 bool flag = base.GetInt(113, null) == 0;
6789 int num3 = 2;
6790 int num4 = 1;
6791 int num5 = 1;
6792 foreach (Thing thing in this.things)
6793 {
6794 if (this.CanEat(thing, shouldEat))
6795 {
6796 num -= thing.Num;
6797 }
6798 if (thing.trait.GetHealAction(this) != null)
6799 {
6800 num2 -= thing.Num;
6801 }
6802 if (thing.id == "polish_powder")
6803 {
6804 num3 -= thing.Num;
6805 }
6806 }
6807 Chara._ListItems.Clear();
6808 foreach (Thing thing2 in containers)
6809 {
6810 if (thing2.IsSharedContainer)
6811 {
6812 foreach (Thing thing3 in thing2.things)
6813 {
6814 if (!thing3.c_isImportant)
6815 {
6816 if (num3 > 0 && thing3.id == "polish_powder")
6817 {
6818 Chara._ListItems.Add(thing3);
6819 num3 -= thing3.Num;
6820 }
6821 else if (num4 > 0 && thing3.trait is TraitBlanketColdproof)
6822 {
6823 Chara._ListItems.Add(thing3);
6824 num4 -= thing3.Num;
6825 }
6826 else if (num5 > 0 && thing3.trait is TraitBlanketFireproof)
6827 {
6828 Chara._ListItems.Add(thing3);
6829 num5 -= thing3.Num;
6830 }
6831 else if (num > 0 && this.CanEat(thing3, shouldEat))
6832 {
6833 Chara._ListItems.Add(thing3);
6834 num -= thing3.Num;
6835 }
6836 else if (num2 > 0 && thing3.trait.GetHealAction(this) != null)
6837 {
6838 Chara._ListItems.Add(thing3);
6839 num2 -= thing3.Num;
6840 }
6841 else if (flag && thing3.IsEquipmentOrRanged && !thing3.HasTag(CTAG.gift) && this.ShouldEquip(thing3, true))
6842 {
6843 Chara._ListItems.Add(thing3);
6844 }
6845 }
6846 }
6847 }
6848 }
6849 if (Chara._ListItems.Count == 0)
6850 {
6851 return;
6852 }
6853 Chara._ListItems.ForeachReverse(delegate(Thing t)
6854 {
6855 if (!t.IsEquipmentOrRanged)
6856 {
6857 return;
6858 }
6859 bool flag3 = false;
6860 int slot = t.category.slot;
6861 int equipValue = t.GetEquipValue();
6862 foreach (Thing thing7 in Chara._ListItems)
6863 {
6864 if (thing7.category.slot == slot && thing7.GetEquipValue() > equipValue)
6865 {
6866 flag3 = true;
6867 break;
6868 }
6869 }
6870 if (flag3)
6871 {
6872 Chara._ListItems.Remove(t);
6873 }
6874 });
6875 bool flag2 = false;
6876 foreach (Thing thing4 in Chara._ListItems)
6877 {
6878 Thing thing5 = thing4;
6879 if (this.things.IsFull(thing5, true, true))
6880 {
6881 break;
6882 }
6883 Thing thing6 = thing4.parent as Thing;
6884 if (thing5.Num > 2)
6885 {
6886 thing5 = thing5.Split(2);
6887 }
6888 if (msg)
6889 {
6890 base.Say("takeSharedItem", this, thing5, thing6.GetName(NameStyle.Full, -1), null);
6891 }
6892 base.AddCard(thing5);
6893 if (this.ShouldEquip(thing5, true) && thing5.category.slot != 0)
6894 {
6895 this.TryEquip(thing5, true);
6896 flag2 = true;
6897 }
6898 }
6899 if (flag2 && flag)
6900 {
6901 this.TryPutSharedItems(containers, true);
6902 }
6903 }
6904
6905 // Token: 0x06001514 RID: 5396 RVA: 0x0008F470 File Offset: 0x0008D670
6906 public void InstantEat(Thing t = null, bool sound = true)
6907 {
6908 if (t == null)
6909 {
6910 t = this.things.Find((Thing a) => this.CanEat(a, true), true);
6911 }
6912 if (t == null)
6913 {
6914 t = this.things.Find((Thing a) => this.CanEat(a, false), true);
6915 }
6916 if (t == null)
6917 {
6918 return;
6919 }
6920 base.Say("eat_start", this, t.Duplicate(1), null, null);
6921 if (sound)
6922 {
6923 base.PlaySound("eat", 1f, true);
6924 }
6925 FoodEffect.Proc(this, t);
6926 t.ModNum(-1, true);
6927 }
6928
6929 // Token: 0x06001515 RID: 5397 RVA: 0x0008F4F4 File Offset: 0x0008D6F4
6930 public bool CanEat(Thing t, bool shouldEat = false)
6931 {
6932 return (!t.IsDecayed || base.HasElement(480, 1)) && (!shouldEat || t.trait is TraitFoodPrepared) && (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped) && t.trait.CanEat(this);
6933 }
6934
6935 // Token: 0x06001516 RID: 5398 RVA: 0x0008F554 File Offset: 0x0008D754
6936 public bool ShouldEquip(Thing t, bool useFav = false)
6937 {
6938 if (t.IsRangedWeapon && t.category.slot == 0)
6939 {
6940 if (!this.CanEquipRanged(t))
6941 {
6942 return false;
6943 }
6944 int num = 0;
6945 foreach (Thing thing in this.things)
6946 {
6947 if (thing.IsRangedWeapon)
6948 {
6949 if (thing.category.slot != 0 && thing.isEquipped)
6950 {
6951 return false;
6952 }
6953 if (this.CanEquipRanged(thing) && thing.GetEquipValue() > num)
6954 {
6955 num = thing.GetEquipValue();
6956 }
6957 }
6958 }
6959 return t.GetEquipValue() > num;
6960 }
6961 else
6962 {
6963 BodySlot bodySlot = this.body.GetSlot(t, false, false);
6964 if (bodySlot == null)
6965 {
6966 return false;
6967 }
6968 if (useFav)
6969 {
6970 switch (this.GetFavAttackStyle())
6971 {
6972 case AttackStyle.Default:
6973 case AttackStyle.TwoHand:
6974 if (t.IsMeleeWeapon)
6975 {
6976 bodySlot = this.body.slotMainHand;
6977 }
6978 else if (bodySlot.elementId == 35)
6979 {
6980 return false;
6981 }
6982 break;
6983 case AttackStyle.TwoWield:
6984 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
6985 {
6986 return false;
6987 }
6988 break;
6989 case AttackStyle.Shield:
6990 if (t.IsMeleeWeapon)
6991 {
6992 bodySlot = this.body.slotMainHand;
6993 }
6994 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
6995 {
6996 return false;
6997 }
6998 break;
6999 }
7000 }
7001 return this.body.IsEquippable(t, bodySlot, false) && (bodySlot.thing == null || (bodySlot.thing.blessedState > BlessedState.Cursed && bodySlot.thing.GetEquipValue() < t.GetEquipValue()));
7002 }
7003 }
7004
7005 // Token: 0x06001517 RID: 5399 RVA: 0x0008F6F0 File Offset: 0x0008D8F0
7006 public bool TryEquip(Thing t, bool useFav = false)
7007 {
7008 if (!this.ShouldEquip(t, useFav))
7009 {
7010 return false;
7011 }
7012 if (t.category.slot == 0)
7013 {
7014 return false;
7015 }
7016 if (useFav)
7017 {
7018 BodySlot slot = this.body.GetSlot(t, false, false);
7019 AttackStyle favAttackStyle = this.GetFavAttackStyle();
7020 if (favAttackStyle > AttackStyle.TwoHand)
7021 {
7022 if (favAttackStyle == AttackStyle.Shield)
7023 {
7024 if (t.IsMeleeWeapon)
7025 {
7026 slot = this.body.slotMainHand;
7027 }
7028 }
7029 }
7030 else if (t.IsMeleeWeapon)
7031 {
7032 slot = this.body.slotMainHand;
7033 }
7034 this.body.Equip(t, slot, true);
7035 }
7036 else
7037 {
7038 this.body.Equip(t, null, true);
7039 }
7040 base.Say("equip", this, t, null, null);
7041 return true;
7042 }
7043
7044 // Token: 0x06001518 RID: 5400 RVA: 0x0008F795 File Offset: 0x0008D995
7045 public bool CanEquipRanged(Thing t)
7046 {
7047 return !this.body.IsTooHeavyToEquip(t);
7048 }
7049
7050 // Token: 0x06001519 RID: 5401 RVA: 0x0008F7A8 File Offset: 0x0008D9A8
7051 public Thing TryGetThrowable()
7052 {
7053 Chara.<>c__DisplayClass431_0 CS$<>8__locals1 = new Chara.<>c__DisplayClass431_0();
7054 CS$<>8__locals1.<>4__this = this;
7055 CS$<>8__locals1.dest = null;
7056 if (!this.IsPC)
7057 {
7058 this.things.Foreach(delegate(Thing t)
7059 {
7060 if (t.HasTag(CTAG.throwWeapon) || (!CS$<>8__locals1.<>4__this.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7061 {
7062 CS$<>8__locals1.dest = t;
7063 return;
7064 }
7065 }, true);
7066 return CS$<>8__locals1.dest;
7067 }
7068 if (EClass.game.config.autoCombat.bUseHotBar)
7069 {
7070 return CS$<>8__locals1.<TryGetThrowable>g__FindThrowable|0(true);
7071 }
7072 return null;
7073 }
7074
7075 // Token: 0x0600151A RID: 5402 RVA: 0x0008F810 File Offset: 0x0008DA10
7076 public Thing GetBestRangedWeapon()
7077 {
7078 Thing result = null;
7079 int num = 0;
7080 foreach (Thing thing in this.things)
7081 {
7082 if (thing.IsRangedWeapon && this.CanEquipRanged(thing) && thing.GetEquipValue() > num)
7083 {
7084 num = thing.GetEquipValue();
7085 result = thing;
7086 }
7087 }
7088 return result;
7089 }
7090
7091 // Token: 0x0600151B RID: 5403 RVA: 0x0008F884 File Offset: 0x0008DA84
7092 public bool TryEquipRanged()
7093 {
7094 if (this.IsPC)
7095 {
7096 Thing thing = EClass.player.currentHotItem.Thing;
7097 if (((thing != null) ? thing.trait : null) is TraitToolRange && this.CanEquipRanged(thing))
7098 {
7099 this.ranged = thing;
7100 return true;
7101 }
7102 return false;
7103 }
7104 else
7105 {
7106 if (this.ranged != null && this.ranged.parent == this)
7107 {
7108 return true;
7109 }
7110 this.ranged = this.GetBestRangedWeapon();
7111 return this.ranged != null;
7112 }
7113 }
7114
7115 // Token: 0x0600151C RID: 5404 RVA: 0x0008F8FD File Offset: 0x0008DAFD
7116 public override int GetArmorSkill()
7117 {
7118 if (this.body.GetWeight(true) <= 30000)
7119 {
7120 return 120;
7121 }
7122 return 122;
7123 }
7124
7125 // Token: 0x0600151D RID: 5405 RVA: 0x0008F918 File Offset: 0x0008DB18
7126 public bool TryUse(Thing t)
7127 {
7128 if (t.id == "338")
7129 {
7130 Thing thing = this.things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof, true);
7131 if (thing != null)
7132 {
7133 base.Say("dip", this, thing, t.GetName(NameStyle.Full, 1), null);
7134 SE.Change();
7135 t.trait.OnBlend(thing, this);
7136 return true;
7137 }
7138 return false;
7139 }
7140 else
7141 {
7142 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7143 {
7144 return false;
7145 }
7146 if (t.trait.CanEat(this) && this.hunger.GetPhase() > ((this.IsPCFaction || this.IsPCFactionMinion) ? 2 : 0))
7147 {
7148 this.SetAIImmediate(new AI_Eat
7149 {
7150 target = t
7151 });
7152 return true;
7153 }
7154 if (t.trait.CanDrink(this))
7155 {
7156 this.Drink(t);
7157 return true;
7158 }
7159 if (t.trait.CanRead(this))
7160 {
7161 this.SetAIImmediate(new AI_Read
7162 {
7163 target = t
7164 });
7165 return true;
7166 }
7167 return false;
7168 }
7169 }
7170
7171 // Token: 0x0600151E RID: 5406 RVA: 0x0008FA28 File Offset: 0x0008DC28
7172 public Room FindRoom()
7173 {
7174 TraitBed traitBed = this.FindBed();
7175 if (traitBed == null)
7176 {
7177 return null;
7178 }
7179 return traitBed.owner.pos.cell.room;
7180 }
7181
7182 // Token: 0x0600151F RID: 5407 RVA: 0x0008FA58 File Offset: 0x0008DC58
7183 public void ModAffinity(Chara c, int a, bool show = true)
7184 {
7185 if (c == this)
7186 {
7187 return;
7188 }
7189 if (this.IsPC)
7190 {
7191 c.ModAffinity(EClass.pc, a, show);
7192 return;
7193 }
7194 if (c.IsPC)
7195 {
7196 a = this.affinity.Mod(a);
7197 }
7198 bool flag = a > 0;
7199 if (show)
7200 {
7201 if (a == 0)
7202 {
7203 base.Say("affinityNone", this, c, null, null);
7204 return;
7205 }
7206 base.ShowEmo(flag ? Emo.love : Emo.angry, 0f, true);
7207 c.ShowEmo(flag ? Emo.love : Emo.sad, 0f, true);
7208 base.Say(flag ? "affinityPlus" : "affinityMinus", this, c, null, null);
7209 }
7210 }
7211
7212 // Token: 0x06001520 RID: 5408 RVA: 0x0008FAF0 File Offset: 0x0008DCF0
7213 public bool TryIdentify(Thing t, int count = 1, bool show = true)
7214 {
7215 int num = base.Evalue(289);
7216 if (num == 0)
7217 {
7218 return false;
7219 }
7220 int lv = t.LV;
7221 if (EClass.rnd(num * num + 5) > EClass.rnd(lv * lv) * 20)
7222 {
7223 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7224 int num2 = 50;
7225 if (lv > num)
7226 {
7227 num2 += (lv - num) * 10;
7228 }
7229 this.elements.ModExp(289, Mathf.Min(num2, 1000), false);
7230 return true;
7231 }
7232 return false;
7233 }
7234
7235 // Token: 0x06001521 RID: 5409 RVA: 0x0008FB6C File Offset: 0x0008DD6C
7236 public Chara CreateReplacement()
7237 {
7238 Chara chara = CharaGen.Create(this.id, -1);
7239 chara.c_originalHostility = base.c_originalHostility;
7240 if (chara.c_originalHostility != (Hostility)0)
7241 {
7242 chara.hostility = chara.c_originalHostility;
7243 }
7244 if (this.orgPos != null)
7245 {
7246 chara.orgPos = this.orgPos.Copy();
7247 }
7248 chara.pos = this.pos.Copy();
7249 chara.isImported = true;
7250 chara.c_editorTags = base.c_editorTags;
7251 chara.c_editorTraitVal = base.c_editorTraitVal;
7252 chara.c_idTrait = base.c_idTrait;
7253 chara.homeZone = this.homeZone;
7254 return chara;
7255 }
7256
7257 // Token: 0x06001522 RID: 5410 RVA: 0x0008FC08 File Offset: 0x0008DE08
7258 public SourceThing.Row GetFavFood()
7259 {
7260 if (Chara._listFavFood.Count == 0)
7261 {
7262 foreach (SourceThing.Row row in EClass.sources.things.rows)
7263 {
7264 if (row._origin == "dish" && row.value != 0)
7265 {
7266 Chara._listFavFood.Add(row);
7267 }
7268 }
7269 }
7270 SourceThing.Row r = null;
7271 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7272 {
7273 r = Chara._listFavFood.RandomItem<SourceThing.Row>();
7274 });
7275 return r;
7276 }
7277
7278 // Token: 0x06001523 RID: 5411 RVA: 0x0008FCC4 File Offset: 0x0008DEC4
7279 public SourceCategory.Row GetFavCat()
7280 {
7281 SourceCategory.Row r = null;
7282 if (Chara._listFavCat.Count == 0)
7283 {
7284 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7285 {
7286 if (row.gift > 0)
7287 {
7288 Chara._listFavCat.Add(row);
7289 }
7290 }
7291 }
7292 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7293 {
7294 r = Chara._listFavCat.RandomItem<SourceCategory.Row>();
7295 });
7296 return r;
7297 }
7298
7299 // Token: 0x06001524 RID: 5412 RVA: 0x0008FD70 File Offset: 0x0008DF70
7300 public int GetTotalFeat()
7301 {
7302 int num = 0;
7303 if (base.c_upgrades != null)
7304 {
7305 num += base.c_upgrades.spent;
7306 }
7307 if (base.c_genes != null)
7308 {
7309 num += base.c_genes.GetTotalCost();
7310 }
7311 return num + base.feat;
7312 }
7313
7314 // Token: 0x06001525 RID: 5413 RVA: 0x0008FDB4 File Offset: 0x0008DFB4
7315 public bool CanInsult()
7316 {
7317 using (List<ActList.Item>.Enumerator enumerator = this.ability.list.items.GetEnumerator())
7318 {
7319 while (enumerator.MoveNext())
7320 {
7321 if (enumerator.Current.act.id == 6630)
7322 {
7323 return true;
7324 }
7325 }
7326 }
7327 return false;
7328 }
7329
7330 // Token: 0x06001526 RID: 5414 RVA: 0x0008FE24 File Offset: 0x0008E024
7331 public string GetIdPortraitCat()
7332 {
7333 string id = this.race.id;
7334 if ((id == "mifu" || id == "nefu") && EClass.rnd(2) == 0)
7335 {
7336 return "foxfolk";
7337 }
7338 if (this.trait is TraitGuard)
7339 {
7340 return "guard";
7341 }
7342 return "";
7343 }
7344
7345 // Token: 0x06001527 RID: 5415 RVA: 0x0008FE80 File Offset: 0x0008E080
7346 public string GetIdPortrait()
7347 {
7348 if (this.id == "olderyoungersister")
7349 {
7350 if (base.idSkin != 2)
7351 {
7352 return "UN_olderyoungersister";
7353 }
7354 return "UN_olderyoungersister_alt";
7355 }
7356 else
7357 {
7358 if (Portrait.allIds.Contains("UN_" + this.id + ".png"))
7359 {
7360 return "UN_" + this.id;
7361 }
7362 return base.c_idPortrait;
7363 }
7364 }
7365
7366 // Token: 0x06001528 RID: 5416 RVA: 0x0008FEEC File Offset: 0x0008E0EC
7367 public Thing GiveBirth(Thing t, bool effect)
7368 {
7369 EClass.player.forceTalk = true;
7370 base.Talk("giveBirth", null, null, false);
7371 EClass._zone.TryAddThing(t, this.pos, false);
7372 if (effect)
7373 {
7374 base.PlayEffect("revive", true, 0f, default(Vector3));
7375 base.PlaySound("egg", 1f, true);
7376 base.PlayAnime(AnimeID.Shiver, false);
7377 this.AddCondition<ConDim>(200, false);
7378 }
7379 return t;
7380 }
7381
7382 // Token: 0x06001529 RID: 5417 RVA: 0x0008FF6B File Offset: 0x0008E16B
7383 public Thing MakeGene(DNA.Type? type = null)
7384 {
7385 return DNA.GenerateGene(this, type);
7386 }
7387
7388 // Token: 0x0600152A RID: 5418 RVA: 0x0008FF74 File Offset: 0x0008E174
7389 public Thing MakeBraineCell()
7390 {
7391 return DNA.GenerateGene(this, new DNA.Type?(DNA.Type.Brain));
7392 }
7393
7394 // Token: 0x0600152B RID: 5419 RVA: 0x0008FF84 File Offset: 0x0008E184
7395 public Thing MakeMilk(bool effect = true, int num = 1, bool addToZone = true)
7396 {
7397 Thing thing = ThingGen.Create("milk", -1, -1).SetNum(num);
7398 thing.MakeRefFrom(this, null);
7399 int num2 = base.LV - this.source.LV;
7400 if (num2 >= 10)
7401 {
7402 thing.SetEncLv(num2 / 10);
7403 }
7404 if (!addToZone)
7405 {
7406 return thing;
7407 }
7408 return this.GiveBirth(thing, effect);
7409 }
7410
7411 // Token: 0x0600152C RID: 5420 RVA: 0x0008FFDC File Offset: 0x0008E1DC
7412 public Thing MakeEgg(bool effect = true, int num = 1, bool addToZone = true)
7413 {
7414 Thing thing = ThingGen.Create((EClass.rnd(EClass.debug.enable ? 1 : 20) == 0) ? "egg_fertilized" : "_egg", -1, -1).SetNum(num);
7415 thing.MakeFoodFrom(this);
7416 thing.c_idMainElement = base.c_idMainElement;
7417 if (!addToZone)
7418 {
7419 return thing;
7420 }
7421 return this.GiveBirth(thing, effect);
7422 }
7423
7424 // Token: 0x0600152D RID: 5421 RVA: 0x0009003C File Offset: 0x0008E23C
7425 public void OnInsulted()
7426 {
7427 if (this.isDead)
7428 {
7429 return;
7430 }
7431 if (base.HasElement(1231, 1))
7432 {
7433 base.Talk("insulted", null, null, false);
7434 this.AddCondition<ConEuphoric>(100, false);
7435 return;
7436 }
7437 if (EClass.rnd(20) == 0)
7438 {
7439 this.SetFeat(1231, 1, true);
7440 }
7441 }
7442
7443 // Token: 0x0600152E RID: 5422 RVA: 0x00090090 File Offset: 0x0008E290
7444 public bool IsValidGiftWeight(Card t, int num = -1)
7445 {
7446 int num2 = base.HasElement(1411, 1) ? 3 : 1;
7447 return this.GetBurden(t, num) < num2;
7448 }
7449
7450 // Token: 0x0600152F RID: 5423 RVA: 0x000900C0 File Offset: 0x0008E2C0
7451 public bool CanAcceptItem(Card t, int num = -1)
7452 {
7453 return this.IsValidGiftWeight(t, num) && !t.c_isImportant && ((!t.category.IsChildOf("furniture") && !t.category.IsChildOf("junk")) || base.HasElement(1411, 1));
7454 }
7455
7456 // Token: 0x06001530 RID: 5424 RVA: 0x00090118 File Offset: 0x0008E318
7457 public bool CanAcceptGift(Chara c, Card t)
7458 {
7459 return !this.things.IsFull(0) && !t.c_isImportant && (t.id == "1084" || t.trait is TraitBookSecret || (!t.trait.CanOnlyCarry && !t.trait.CanExtendBuild && t.rarity != Rarity.Artifact && !t.IsContainer));
7460 }
7461
7462 // Token: 0x06001531 RID: 5425 RVA: 0x00090190 File Offset: 0x0008E390
7463 public void GiveGift(Chara c, Thing t)
7464 {
7465 if (c.IsHostile() || c.IsDeadOrSleeping)
7466 {
7467 Msg.Say("affinityNone", c, this, null, null);
7468 return;
7469 }
7470 if (t.IsCursed && t.IsEquipmentOrRanged && c.HasElement(1414, 1))
7471 {
7472 bool flag = t.blessedState == BlessedState.Doomed;
7473 int num = 200 + t.LV * 3;
7474 if (t.rarity == Rarity.Legendary)
7475 {
7476 num *= 3;
7477 }
7478 if (t.rarity >= Rarity.Mythical)
7479 {
7480 num *= 5;
7481 }
7482 if (flag)
7483 {
7484 num *= 2;
7485 }
7486 EClass.pc.PlayEffect("identify", true, 0f, default(Vector3));
7487 EClass.pc.PlaySound("identify", 1f, true);
7488 c.PlayEffect("mutation", true, 0f, default(Vector3));
7489 c.Say("draw_curse", c, t, null, null);
7490 t.Destroy();
7491 List<Element> list = new List<Element>();
7492 foreach (Element element in EClass.pc.elements.dict.Values)
7493 {
7494 if (element is Spell)
7495 {
7496 list.Add(element);
7497 }
7498 }
7499 if (list.Count == 0)
7500 {
7501 EClass.pc.SayNothingHappans();
7502 return;
7503 }
7504 Element element2 = list.RandomItem<Element>();
7505 EClass.pc.ModExp(element2.id, num);
7506 EClass.pc.Say("draw_curse2", EClass.pc, element2.Name, null);
7507 return;
7508 }
7509 else
7510 {
7511 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
7512 {
7513 this.GiveLovePotion(c, t);
7514 return;
7515 }
7516 if (t.trait is TraitErohon && c.id == t.c_idRefName)
7517 {
7518 c.OnGiveErohon(t);
7519 return;
7520 }
7521 if (!(t.trait is TraitTicketMassage))
7522 {
7523 if (t.id == "flyer")
7524 {
7525 this.stamina.Mod(-1);
7526 if (c.things.Find((Thing a) => a.id == "flyer", true) != null)
7527 {
7528 c.Talk("flyer_miss", null, null, false);
7529 this.DoHostileAction(c, false);
7530 return;
7531 }
7532 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + base.Evalue(291) * 3 + 10))
7533 {
7534 Msg.Say("affinityNone", c, this, null, null);
7535 t.Destroy();
7536 this.elements.ModExp(291, 10, false);
7537 return;
7538 }
7539 this.elements.ModExp(291, 30, false);
7540 }
7541 if (t.id == "statue_weird")
7542 {
7543 EClass.pc.Say("statue_sell", null, null);
7544 }
7545 t.isGifted = true;
7546 c.nextUse = c.affinity.OnGift(t);
7547 if (!t.isDestroyed)
7548 {
7549 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
7550 {
7551 q.OnGiveItem(c, t);
7552 });
7553 if (c.TryEquip(t, false))
7554 {
7555 c.nextUse = null;
7556 }
7557 }
7558 return;
7559 }
7560 t.ModNum(-1, true);
7561 c.Talk("ticket", null, null, false);
7562 string id = t.id;
7563 if (id == "ticket_massage")
7564 {
7565 c.ModAffinity(EClass.pc, 10, true);
7566 EClass.pc.SetAI(new AI_Massage
7567 {
7568 target = c
7569 });
7570 return;
7571 }
7572 if (id == "ticket_armpillow")
7573 {
7574 c.ModAffinity(EClass.pc, 20, true);
7575 EClass.pc.AddCondition<ConSleep>(300, true);
7576 c.SetAI(new AI_ArmPillow
7577 {
7578 target = EClass.pc
7579 });
7580 return;
7581 }
7582 if (!(id == "ticket_champagne"))
7583 {
7584 return;
7585 }
7586 c.ModAffinity(EClass.pc, 10, true);
7587 c.AddCondition<ConChampagne>(100, false);
7588 return;
7589 }
7590 }
7591
7592 // Token: 0x06001532 RID: 5426 RVA: 0x000906B0 File Offset: 0x0008E8B0
7593 public void OnGiveErohon(Thing t)
7594 {
7595 base.Say("give_erohon", this, null, null);
7596 this.AddCondition<ConParalyze>(50, true);
7597 this.AddCondition<ConConfuse>(50, true);
7598 this.AddCondition<ConFear>(1000, true);
7599 this.ModAffinity(EClass.pc, 100, true);
7600 t.Destroy();
7601 base.Talk("pervert", null, null, false);
7602 }
7603
7604 // Token: 0x06001533 RID: 5427 RVA: 0x00090710 File Offset: 0x0008E910
7605 public void GiveLovePotion(Chara c, Thing t)
7606 {
7607 c.Say("give_love", c, t, null, null);
7608 c.PlaySound(t.material.GetSoundDead(null), 1f, true);
7609 c.ShowEmo(Emo.angry, 0f, true);
7610 c.ModAffinity(EClass.pc, -20, false);
7611 c.Talk("pervert", null, null, false);
7612 t.Destroy();
7613 }
7614
7615 // Token: 0x06001534 RID: 5428 RVA: 0x00090774 File Offset: 0x0008E974
7616 public void RequestProtection(Chara attacker, Action<Chara> action)
7617 {
7618 if (this.HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
7619 {
7620 return;
7621 }
7622 if (this.host != null && this.host.isRestrained)
7623 {
7624 return;
7625 }
7626 if (this.IsPCFaction && attacker.IsPCFaction)
7627 {
7628 return;
7629 }
7630 bool flag = false;
7631 foreach (Chara chara in EClass._map.charas)
7632 {
7633 if (chara != attacker && chara.enemy != this && chara != this && chara.host == null && !chara.IsDisabled && chara.IsFriendOrAbove(this) && chara.conSuspend == null && (!chara.IsPCParty || this.IsPCParty) && (!this.IsPCFaction || chara.IsPCFaction))
7634 {
7635 bool flag2 = chara.HasElement(1225, 1);
7636 if ((flag2 || (!flag && EClass.rnd(2) != 0 && chara.HasCondition<StanceTaunt>())) && !chara.HasCooldown(1225))
7637 {
7638 int num = Mathf.Max(chara.Evalue(1649), chara.IsPC ? 0 : (flag2 ? 3 : 1));
7639 int num2 = base.Dist(chara);
7640 if (num2 <= 25)
7641 {
7642 if (num2 > num || !chara.CanSeeLos(this.pos, num2))
7643 {
7644 if (!flag2)
7645 {
7646 continue;
7647 }
7648 if (base.Dist(chara) < 5)
7649 {
7650 chara.GoHostile(attacker);
7651 chara.SetEnemy(attacker);
7652 attacker.SetEnemy(chara);
7653 continue;
7654 }
7655 Point nearestPoint = this.pos.GetNearestPoint(false, false, true, true);
7656 if (!nearestPoint.IsValid)
7657 {
7658 continue;
7659 }
7660 chara.Teleport(nearestPoint, false, false);
7661 chara.AddCooldown(1225, 10);
7662 num2 = base.Dist(chara);
7663 base.Say("intercept_loyal", chara, this, null, null);
7664 chara.SetEnemy(attacker);
7665 attacker.SetEnemy(chara);
7666 if (num2 > num || !chara.CanSeeLos(this.pos, num2))
7667 {
7668 continue;
7669 }
7670 }
7671 if (!flag && !base.HasElement(1225, 1))
7672 {
7673 base.Say("intercept", chara, this, null, null);
7674 if (EClass.rnd(10) == 0)
7675 {
7676 chara.Talk("intercept", base.NameSimple, null, false);
7677 }
7678 if (attacker.enemy == this)
7679 {
7680 attacker.SetEnemy(chara);
7681 }
7682 action(chara);
7683 flag = true;
7684 }
7685 }
7686 }
7687 }
7688 }
7689 }
7690
7691 // Token: 0x06001535 RID: 5429 RVA: 0x00090A00 File Offset: 0x0008EC00
7692 public void ClearInventory(ClearInventoryType type)
7693 {
7694 int num = 0;
7695 bool flag = this.trait is TraitBard;
7696 for (int i = this.things.Count - 1; i >= 0; i--)
7697 {
7698 Thing thing = this.things[i];
7699 if ((!this.IsPCFaction || ((!thing.IsFood || !(thing.category.id != "fish") || thing.IsDecayed) && !thing.HasTag(CTAG.throwWeapon) && thing.trait.GetHealAction(this) == null && !thing.IsThrownWeapon && !thing.IsRangedWeapon)) && !thing.isEquipped && thing.rarity < Rarity.Legendary && (!flag || !(thing.trait is TraitToolMusic)) && !(thing.trait is TraitCurrency))
7700 {
7701 if (type == ClearInventoryType.Party)
7702 {
7703 if (!thing.isGifted && !thing.isNPCProperty)
7704 {
7705 goto IL_15D;
7706 }
7707 }
7708 else if ((this.IsPCFaction && this.things.Count < this.things.GridSize * 3 / 2) || (!(thing.id == "flyer") && ((!thing.IsDecayed && EClass.rnd(3) == 0) || (thing.IsRangedWeapon && !this.things.IsFull(0)))))
7709 {
7710 goto IL_15D;
7711 }
7712 num += thing.GetPrice(CurrencyType.Money, true, PriceType.Default, this) * thing.Num;
7713 thing.Destroy();
7714 }
7715 IL_15D:;
7716 }
7717 if (num > 0)
7718 {
7719 base.ModCurrency(num, "money");
7720 if (type == ClearInventoryType.Party)
7721 {
7722 Msg.Say("party_sell", this, num.ToString() ?? "", null, null);
7723 base.PlaySound("pay", 1f, true);
7724 }
7725 }
7726 }
7727
7728 // Token: 0x06001536 RID: 5430 RVA: 0x00090BB9 File Offset: 0x0008EDB9
7729 public void ResetUpgrade()
7730 {
7731 CharaUpgrade c_upgrades = base.c_upgrades;
7732 }
7733
7734 // Token: 0x06001537 RID: 5431 RVA: 0x00090BC4 File Offset: 0x0008EDC4
7735 public void TryUpgrade(bool msg = true)
7736 {
7737 if (!EClass.debug.enable)
7738 {
7739 return;
7740 }
7741 if (this.IsPC || !this.IsGlobal || !this.IsPCFaction)
7742 {
7743 return;
7744 }
7745 for (int i = 0; i < 100; i++)
7746 {
7747 if (base.feat == 0)
7748 {
7749 return;
7750 }
7751 if (base.c_upgrades == null)
7752 {
7753 base.c_upgrades = new CharaUpgrade();
7754 }
7755 if (base.c_upgrades.halt)
7756 {
7757 return;
7758 }
7759 Rand.SetSeed(base.uid + base.c_upgrades.count);
7760 int num = EClass.rnd(100);
7761 int num2 = 0;
7762 int num3 = 1;
7763 int num4 = 0;
7764 bool flag = false;
7765 IEnumerable<SourceElement.Row> ie = from a in EClass.sources.elements.rows
7766 where !this.elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet")
7767 select a;
7768 List<Element> list = this.ListAvailabeFeats(true);
7769 if (num >= 90 && list.Count > 0)
7770 {
7771 Element element = list.RandomItem<Element>();
7772 num2 = element.id;
7773 num4 = element.CostLearn;
7774 }
7775 else if (num >= 60 && ie.Any<SourceElement.Row>())
7776 {
7777 num2 = ie.RandomItem<SourceElement.Row>().id;
7778 num4 = 3;
7779 }
7780 else
7781 {
7782 num2 = Element.List_MainAttributesMajor.RandomItem<int>();
7783 num4 = 1;
7784 num3 = 2;
7785 flag = true;
7786 }
7787 Rand.SetSeed(-1);
7788 if (num4 > base.feat)
7789 {
7790 return;
7791 }
7792 base.feat -= num4;
7793 base.c_upgrades.count++;
7794 base.c_upgrades.spent += num4;
7795 bool flag2 = false;
7796 if (flag)
7797 {
7798 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
7799 {
7800 if (item.idEle == num2)
7801 {
7802 item.value += num3;
7803 item.cost += num4;
7804 flag2 = true;
7805 break;
7806 }
7807 }
7808 }
7809 if (!flag2)
7810 {
7811 base.c_upgrades.items.Add(new CharaUpgrade.Item
7812 {
7813 idEle = num2,
7814 value = num3,
7815 cost = num4
7816 });
7817 }
7818 SourceElement.Row row = EClass.sources.elements.map[num2];
7819 if (row.category == "feat")
7820 {
7821 this.SetFeat(num2, this.elements.ValueWithoutLink(num2) + 1, true);
7822 }
7823 else if (this.elements.ValueWithoutLink(row.id) == 0)
7824 {
7825 this.elements.Learn(row.id, 1);
7826 }
7827 else
7828 {
7829 this.elements.ModBase(num2, num3);
7830 }
7831 }
7832 }
7833
7834 // Token: 0x06001538 RID: 5432 RVA: 0x00090E4C File Offset: 0x0008F04C
7835 public void AddCooldown(int idEle, int turns = 0)
7836 {
7837 if (this._cooldowns == null)
7838 {
7839 this._cooldowns = new List<int>();
7840 }
7841 if (turns != 0)
7842 {
7843 this._cooldowns.Add(idEle * 1000 + turns);
7844 return;
7845 }
7846 SourceElement.Row row = EClass.sources.elements.map[idEle];
7847 if (row.cooldown > 0)
7848 {
7849 this._cooldowns.Add(idEle * 1000 + row.cooldown);
7850 }
7851 }
7852
7853 // Token: 0x06001539 RID: 5433 RVA: 0x00090EBC File Offset: 0x0008F0BC
7854 public bool HasCooldown(int idEle)
7855 {
7856 if (this._cooldowns != null)
7857 {
7858 for (int i = 0; i < this._cooldowns.Count; i++)
7859 {
7860 if (this._cooldowns[i] / 1000 == idEle)
7861 {
7862 return true;
7863 }
7864 }
7865 }
7866 return false;
7867 }
7868
7869 // Token: 0x0600153A RID: 5434 RVA: 0x00090F00 File Offset: 0x0008F100
7870 public void TickCooldown()
7871 {
7872 for (int i = this._cooldowns.Count - 1; i >= 0; i--)
7873 {
7874 if (this._cooldowns[i] % 1000 == 1)
7875 {
7876 this._cooldowns.RemoveAt(i);
7877 }
7878 else
7879 {
7880 List<int> cooldowns = this._cooldowns;
7881 int index = i;
7882 int num = cooldowns[index];
7883 cooldowns[index] = num - 1;
7884 }
7885 }
7886 if (this._cooldowns.Count == 0)
7887 {
7888 this._cooldowns = null;
7889 }
7890 }
7891
7892 // Token: 0x0600153B RID: 5435 RVA: 0x00090F78 File Offset: 0x0008F178
7893 public void ChooseNewGoal()
7894 {
7895 if (this.IsPC && EClass.AdvMode)
7896 {
7897 this.SetNoGoal();
7898 return;
7899 }
7900 if (this.IsPCParty || base.noMove)
7901 {
7902 this.SetAI(new GoalIdle());
7903 return;
7904 }
7905 if ((this.IsHomeMember() && this.IsInHomeZone()) || this.IsGuest())
7906 {
7907 Goal goalFromTimeTable = this.GetGoalFromTimeTable(EClass.world.date.hour);
7908 if (goalFromTimeTable != null)
7909 {
7910 this.SetAI(goalFromTimeTable);
7911 if (goalFromTimeTable is GoalWork)
7912 {
7913 goalFromTimeTable.Tick();
7914 }
7915 return;
7916 }
7917 }
7918 if (this.goalList.index == -2)
7919 {
7920 this.goalList.Refresh(this, this.goalListType);
7921 }
7922 this.SetAI(this.goalList.Next());
7923 }
7924
7925 // Token: 0x0600153C RID: 5436 RVA: 0x00091038 File Offset: 0x0008F238
7926 public Goal GetGoalFromTimeTable(int hour)
7927 {
7928 if (this.IsPC)
7929 {
7930 return null;
7931 }
7932 switch (TimeTable.GetSpan(this.idTimeTable, hour))
7933 {
7934 case TimeTable.Span.Free:
7935 if (this.IsGuest())
7936 {
7937 return new GoalIdle();
7938 }
7939 return this.GetGoalHobby();
7940 case TimeTable.Span.Eat:
7941 return new GoalIdle();
7942 case TimeTable.Span.Work:
7943 if (this.IsGuest())
7944 {
7945 return new GoalIdle();
7946 }
7947 return this.GetGoalWork();
7948 case TimeTable.Span.Sleep:
7949 if (this.sleepiness.value > 10 || EClass._zone.isSimulating)
7950 {
7951 return new GoalSleep();
7952 }
7953 break;
7954 }
7955 return null;
7956 }
7957
7958 // Token: 0x0600153D RID: 5437 RVA: 0x000910C6 File Offset: 0x0008F2C6
7959 public Goal GetGoalWork()
7960 {
7961 if (this.IsPrisoner)
7962 {
7963 return new GoalIdle();
7964 }
7965 if (this.memberType == FactionMemberType.Livestock)
7966 {
7967 return new GoalGraze();
7968 }
7969 return new GoalWork();
7970 }
7971
7972 // Token: 0x0600153E RID: 5438 RVA: 0x000910EA File Offset: 0x0008F2EA
7973 public Goal GetGoalHobby()
7974 {
7975 if (this.IsPrisoner)
7976 {
7977 return new GoalIdle();
7978 }
7979 if (this.memberType == FactionMemberType.Livestock)
7980 {
7981 return new GoalGraze();
7982 }
7983 return new GoalHobby();
7984 }
7985
7986 // Token: 0x0600153F RID: 5439 RVA: 0x0009110E File Offset: 0x0008F30E
7987 public void SetAIIdle()
7988 {
7989 }
7990
7991 // Token: 0x06001540 RID: 5440 RVA: 0x00091110 File Offset: 0x0008F310
7992 public void SetAIAggro()
7993 {
7994 this.SetAI(new GoalCombat());
7995 }
7996
7997 // Token: 0x06001541 RID: 5441 RVA: 0x0009111E File Offset: 0x0008F31E
7998 public AIAct SetNoGoal()
7999 {
8000 return this.SetAI(Chara._NoGoalPC);
8001 }
8002
8003 // Token: 0x06001542 RID: 5442 RVA: 0x0009112C File Offset: 0x0008F32C
8004 public AIAct SetAI(AIAct g)
8005 {
8006 if (this.IsPC)
8007 {
8008 EClass.player.queues.OnSetGoal(g);
8009 }
8010 if (this.ai.IsRunning)
8011 {
8012 if (this.ai == g && this.ai.IsNoGoal)
8013 {
8014 return g;
8015 }
8016 this.ai.Cancel();
8017 if (this.ai == g)
8018 {
8019 string str = "goal is g:";
8020 AIAct aiact = this.ai;
8021 Debug.Log(str + ((aiact != null) ? aiact.ToString() : null) + "/" + ((this != null) ? this.ToString() : null));
8022 return g;
8023 }
8024 }
8025 if (this.HasCondition<ConWait>())
8026 {
8027 this.RemoveCondition<ConWait>();
8028 }
8029 this.ai = g;
8030 this.ai.SetOwner(this);
8031 return g;
8032 }
8033
8034 // Token: 0x06001543 RID: 5443 RVA: 0x000911E4 File Offset: 0x0008F3E4
8035 public void SetAIImmediate(AIAct g)
8036 {
8037 bool hasNoGoal = this.HasNoGoal;
8038 this.SetAI(g);
8039 if (EClass.scene.actionMode == ActionMode.Sim && EClass.scene.paused)
8040 {
8041 return;
8042 }
8043 if (hasNoGoal && !(this.renderer as CharaRenderer).IsMoving)
8044 {
8045 this.Tick();
8046 }
8047 }
8048
8049 // Token: 0x06001544 RID: 5444 RVA: 0x0009123C File Offset: 0x0008F43C
8050 public List<Hobby> ListWorks(bool useMemberType = true)
8051 {
8052 Chara.listHobby.Clear();
8053 if (useMemberType && this.memberType == FactionMemberType.Livestock)
8054 {
8055 Chara.listHobby.Add(new Hobby
8056 {
8057 id = 45
8058 });
8059 }
8060 else
8061 {
8062 if (this._works == null)
8063 {
8064 this.RerollHobby(true);
8065 }
8066 foreach (int id in this._works)
8067 {
8068 Chara.listHobby.Add(new Hobby
8069 {
8070 id = id
8071 });
8072 }
8073 }
8074 return Chara.listHobby;
8075 }
8076
8077 // Token: 0x06001545 RID: 5445 RVA: 0x000912E4 File Offset: 0x0008F4E4
8078 public List<Hobby> ListHobbies(bool useMemberType = true)
8079 {
8080 Chara.listHobby.Clear();
8081 if (!useMemberType || this.memberType != FactionMemberType.Livestock)
8082 {
8083 if (this._hobbies == null)
8084 {
8085 this.RerollHobby(true);
8086 }
8087 foreach (int id in this._hobbies)
8088 {
8089 Chara.listHobby.Add(new Hobby
8090 {
8091 id = id
8092 });
8093 }
8094 }
8095 return Chara.listHobby;
8096 }
8097
8098 // Token: 0x06001546 RID: 5446 RVA: 0x00091370 File Offset: 0x0008F570
8099 public Hobby GetWork(string id)
8100 {
8101 foreach (Hobby hobby in this.ListWorks(true))
8102 {
8103 if (hobby.source.alias == id)
8104 {
8105 return hobby;
8106 }
8107 }
8108 foreach (Hobby hobby2 in this.ListHobbies(true))
8109 {
8110 if (hobby2.source.alias == id)
8111 {
8112 return hobby2;
8113 }
8114 }
8115 return null;
8116 }
8117
8118 // Token: 0x06001547 RID: 5447 RVA: 0x0009142C File Offset: 0x0008F62C
8119 public void RefreshWorkElements(ElementContainer parent = null)
8120 {
8121 if (this.workElements != null)
8122 {
8123 this.workElements.SetParent(null);
8124 }
8125 this.workElements = null;
8126 if (this.IsPCParty || this.homeBranch == null || this.homeBranch.owner == null)
8127 {
8128 return;
8129 }
8130 foreach (Hobby h in this.ListHobbies(true))
8131 {
8132 this.<RefreshWorkElements>g__TryAdd|483_0(h);
8133 }
8134 foreach (Hobby h2 in this.ListWorks(true))
8135 {
8136 this.<RefreshWorkElements>g__TryAdd|483_0(h2);
8137 }
8138 if (this.workElements != null)
8139 {
8140 this.workElements.SetParent(parent);
8141 }
8142 }
8143
8144 // Token: 0x06001548 RID: 5448 RVA: 0x00091510 File Offset: 0x0008F710
8145 public string GetTextHobby(bool simple = false)
8146 {
8147 string text = simple ? "" : ("hobby".lang() + ":");
8148 foreach (Hobby hobby in this.ListHobbies(true))
8149 {
8150 text = text + " " + hobby.Name.TagColor((hobby.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning, null) + ",";
8151 }
8152 return text.TrimEnd(',');
8153 }
8154
8155 // Token: 0x06001549 RID: 5449 RVA: 0x000915B0 File Offset: 0x0008F7B0
8156 public string GetTextWork(bool simple = false)
8157 {
8158 string text = simple ? "" : ("work".lang() + ":");
8159 foreach (Hobby hobby in this.ListWorks(true))
8160 {
8161 text = text + " " + hobby.Name.TagColor((hobby.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning, null) + ",";
8162 }
8163 return text.TrimEnd(',');
8164 }
8165
8166 // Token: 0x0600154A RID: 5450 RVA: 0x00091650 File Offset: 0x0008F850
8167 public void AddHobby(int id)
8168 {
8169 using (List<int>.Enumerator enumerator = this._hobbies.GetEnumerator())
8170 {
8171 while (enumerator.MoveNext())
8172 {
8173 if (enumerator.Current == id)
8174 {
8175 return;
8176 }
8177 }
8178 }
8179 this._hobbies.Add(id);
8180 }
8181
8182 // Token: 0x0600154B RID: 5451 RVA: 0x000916AC File Offset: 0x0008F8AC
8183 public void AddWork(int id)
8184 {
8185 using (List<int>.Enumerator enumerator = this._works.GetEnumerator())
8186 {
8187 while (enumerator.MoveNext())
8188 {
8189 if (enumerator.Current == id)
8190 {
8191 return;
8192 }
8193 }
8194 }
8195 this._works.Add(id);
8196 }
8197
8198 // Token: 0x0600154C RID: 5452 RVA: 0x00091708 File Offset: 0x0008F908
8199 public void RerollHobby(bool extraSlotChance = true)
8200 {
8201 if (this._hobbies != null && this._works != null)
8202 {
8203 this._hobbies.Clear();
8204 this._works.Clear();
8205 }
8206 else
8207 {
8208 this._hobbies = new List<int>();
8209 this._works = new List<int>();
8210 }
8211 if (this.source.hobbies.IsEmpty())
8212 {
8213 this.AddHobby(EClass.sources.hobbies.listHobbies.RandomItem<SourceHobby.Row>().id);
8214 }
8215 else
8216 {
8217 foreach (string key in this.source.hobbies)
8218 {
8219 this.AddHobby(EClass.sources.hobbies.alias[key].id);
8220 }
8221 }
8222 if (this.source.works.IsEmpty())
8223 {
8224 this.AddWork(EClass.sources.hobbies.listWorks.RandomItem<SourceHobby.Row>().id);
8225 }
8226 else
8227 {
8228 foreach (string key2 in this.source.works)
8229 {
8230 this.AddWork(EClass.sources.hobbies.alias[key2].id);
8231 }
8232 }
8233 this.GetWorkSummary().Reset();
8234 }
8235
8236 // Token: 0x0600154D RID: 5453 RVA: 0x00091840 File Offset: 0x0008FA40
8237 public WorkSummary GetWorkSummary()
8238 {
8239 if (this._workSummary == null)
8240 {
8241 this._workSummary = new WorkSummary();
8242 }
8243 return this._workSummary;
8244 }
8245
8246 // Token: 0x0600154E RID: 5454 RVA: 0x0009185C File Offset: 0x0008FA5C
8247 public void TickWork(VirtualDate date)
8248 {
8249 TimeTable.Span span = TimeTable.GetSpan(this.idTimeTable, date.hour);
8250 if (span != TimeTable.Span.Work && span != TimeTable.Span.Free)
8251 {
8252 return;
8253 }
8254 WorkSummary workSummary = this.GetWorkSummary();
8255 if (span == TimeTable.Span.Work)
8256 {
8257 if (workSummary.work != null)
8258 {
8259 this.PerformWork(workSummary.work, false, date.IsRealTime);
8260 return;
8261 }
8262 }
8263 else if (workSummary.hobbies.Count > 0)
8264 {
8265 this.PerformWork(workSummary.hobbies.RandomItem<WorkSession>(), true, date.IsRealTime);
8266 }
8267 }
8268
8269 // Token: 0x0600154F RID: 5455 RVA: 0x000918D0 File Offset: 0x0008FAD0
8270 public bool TryWorkOutside(SourceHobby.Row sourceWork)
8271 {
8272 if (EClass.world.date.IsExpired(base.GetInt(51, null)))
8273 {
8274 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum(true));
8275 base.SetInt(51, EClass.world.date.GetRaw(0) + 60 * (expedition.hours + 24));
8276 this.homeBranch.expeditions.Add(expedition);
8277 return true;
8278 }
8279 return false;
8280 }
8281
8282 // Token: 0x06001550 RID: 5456 RVA: 0x0009194C File Offset: 0x0008FB4C
8283 public void PerformWork(WorkSession session, bool isHobby = false, bool IsRealTime = false)
8284 {
8285 Chara.<>c__DisplayClass494_0 CS$<>8__locals1;
8286 CS$<>8__locals1.session = session;
8287 Hobby hobby = new Hobby();
8288 hobby.id = CS$<>8__locals1.session.id;
8289 WorkSummary workSummary = this._workSummary;
8290 hobby.GetAI(this).OnPerformWork(IsRealTime);
8291 if (!isHobby)
8292 {
8293 workSummary.progress += EClass.rnd(5) + 5;
8294 }
8295 int num = Chara.<PerformWork>g__PerformWork|494_0(hobby, 0, isHobby, ref CS$<>8__locals1);
8296 int num2 = Chara.<PerformWork>g__PerformWork|494_0(hobby, 1, isHobby, ref CS$<>8__locals1);
8297 int num3 = Chara.<PerformWork>g__PerformWork|494_0(hobby, 2, isHobby, ref CS$<>8__locals1);
8298 int num4 = Chara.<PerformWork>g__PerformWork|494_0(hobby, 3, isHobby, ref CS$<>8__locals1);
8299 workSummary.money += num;
8300 workSummary.food += num2;
8301 workSummary.knowledge += num3;
8302 workSummary.material += num4;
8303 }
8304
8305 // Token: 0x06001551 RID: 5457 RVA: 0x00091A0A File Offset: 0x0008FC0A
8306 public void ValidateWorks()
8307 {
8308 Chara._goalWork.FindWork(this, false);
8309 Chara._goalHobby.ValidateHobby(this);
8310 }
8311
8312 // Token: 0x170005F3 RID: 1523
8313 // (get) Token: 0x06001552 RID: 5458 RVA: 0x00091A24 File Offset: 0x0008FC24
8314 public Stats hunger
8315 {
8316 get
8317 {
8318 return Stats.Hunger.Set(this._cints, 10, this);
8319 }
8320 }
8321
8322 // Token: 0x170005F4 RID: 1524
8323 // (get) Token: 0x06001553 RID: 5459 RVA: 0x00091A39 File Offset: 0x0008FC39
8324 public Stats burden
8325 {
8326 get
8327 {
8328 return Stats.Burden.Set(this._cints, 11, this);
8329 }
8330 }
8331
8332 // Token: 0x170005F5 RID: 1525
8333 // (get) Token: 0x06001554 RID: 5460 RVA: 0x00091A4E File Offset: 0x0008FC4E
8334 public Stats stamina
8335 {
8336 get
8337 {
8338 return Stats.Stamina.Set(this._cints, 12, this);
8339 }
8340 }
8341
8342 // Token: 0x170005F6 RID: 1526
8343 // (get) Token: 0x06001555 RID: 5461 RVA: 0x00091A63 File Offset: 0x0008FC63
8344 public Stats depression
8345 {
8346 get
8347 {
8348 return Stats.Depression.Set(this._cints, 13, this);
8349 }
8350 }
8351
8352 // Token: 0x170005F7 RID: 1527
8353 // (get) Token: 0x06001556 RID: 5462 RVA: 0x00091A78 File Offset: 0x0008FC78
8354 public Stats bladder
8355 {
8356 get
8357 {
8358 return Stats.Bladder.Set(this._cints, 14, this);
8359 }
8360 }
8361
8362 // Token: 0x170005F8 RID: 1528
8363 // (get) Token: 0x06001557 RID: 5463 RVA: 0x00091A8D File Offset: 0x0008FC8D
8364 public Stats hygiene
8365 {
8366 get
8367 {
8368 return Stats.Hygiene.Set(this._cints, 15, this);
8369 }
8370 }
8371
8372 // Token: 0x170005F9 RID: 1529
8373 // (get) Token: 0x06001558 RID: 5464 RVA: 0x00091AA2 File Offset: 0x0008FCA2
8374 public Stats mana
8375 {
8376 get
8377 {
8378 return Stats.Mana.Set(this._cints, 16, this);
8379 }
8380 }
8381
8382 // Token: 0x170005FA RID: 1530
8383 // (get) Token: 0x06001559 RID: 5465 RVA: 0x00091AB7 File Offset: 0x0008FCB7
8384 public Stats sleepiness
8385 {
8386 get
8387 {
8388 return Stats.Sleepiness.Set(this._cints, 17, this);
8389 }
8390 }
8391
8392 // Token: 0x170005FB RID: 1531
8393 // (get) Token: 0x0600155A RID: 5466 RVA: 0x00091ACC File Offset: 0x0008FCCC
8394 public Stats SAN
8395 {
8396 get
8397 {
8398 return Stats.SAN.Set(this._cints, 17, this);
8399 }
8400 }
8401
8402 // Token: 0x0600155B RID: 5467 RVA: 0x00091AE4 File Offset: 0x0008FCE4
8403 public void InitStats(bool onDeserialize = false)
8404 {
8405 if (!onDeserialize)
8406 {
8407 this._cints[10] = 20;
8408 this._cints[11] = 70;
8409 this._cints[13] = 70;
8410 this._cints[14] = 70;
8411 this._cints[15] = 70;
8412 this._cints[17] = 0;
8413 }
8414 foreach (Condition condition in this.conditions)
8415 {
8416 condition.SetOwner(this, onDeserialize);
8417 }
8418 }
8419
8420 // Token: 0x0600155C RID: 5468 RVA: 0x00091B7C File Offset: 0x0008FD7C
8421 public Condition AddCondition<T>(int p = 100, bool force = false) where T : Condition
8422 {
8423 return this.AddCondition(typeof(T).Name, p, force);
8424 }
8425
8426 // Token: 0x0600155D RID: 5469 RVA: 0x00091B95 File Offset: 0x0008FD95
8427 public Condition AddCondition(string id, int p = 100, bool force = false)
8428 {
8429 return this.AddCondition(Condition.Create(id, p, null), force);
8430 }
8431
8432 // Token: 0x0600155E RID: 5470 RVA: 0x00091BA8 File Offset: 0x0008FDA8
8433 public Condition AddCondition(Condition c, bool force = false)
8434 {
8435 c.owner = this;
8436 if (!(c is ConBurning))
8437 {
8438 if (c is ConBleed)
8439 {
8440 if (base.ResistLv(964) >= 3)
8441 {
8442 return null;
8443 }
8444 }
8445 }
8446 else if (base.ResistLv(950) >= 3)
8447 {
8448 return null;
8449 }
8450 if (c.GainResistFactor > 0 && this.CanGainConResist)
8451 {
8452 if (c.GainResistFactor >= 400)
8453 {
8454 c.power /= 2;
8455 }
8456 this.ResistCon(c);
8457 if (c.power <= 0)
8458 {
8459 return null;
8460 }
8461 }
8462 if (!force)
8463 {
8464 if (c.source.negate.Length != 0)
8465 {
8466 foreach (string id in c.source.negate)
8467 {
8468 if (base.HasElement(id, 1))
8469 {
8470 return null;
8471 }
8472 }
8473 }
8474 Element defenseAttribute = c.GetDefenseAttribute(this);
8475 if (defenseAttribute != null)
8476 {
8477 c.power = 100 * c.power / (100 + defenseAttribute.Value);
8478 }
8479 if (c.source.resistance.Length != 0)
8480 {
8481 int num = base.ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
8482 if (num > 0)
8483 {
8484 c.power /= num * num + 1;
8485 if (c.power <= 40)
8486 {
8487 return null;
8488 }
8489 }
8490 }
8491 c.power = c.EvaluatePower(c.power);
8492 if (c.power <= 0)
8493 {
8494 return null;
8495 }
8496 }
8497 for (int j = 0; j < this.conditions.Count; j++)
8498 {
8499 if (this.conditions[j].id == c.id)
8500 {
8501 if (c.Type == ConditionType.Stance || c.IsToggle)
8502 {
8503 this.conditions[j].Kill(false);
8504 return null;
8505 }
8506 if (this.conditions[j].CanStack(c))
8507 {
8508 if (this.conditions[j].WillOverride)
8509 {
8510 this.conditions[j].Kill(true);
8511 goto IL_243;
8512 }
8513 if (this.CanGainConResist)
8514 {
8515 this.AddResistCon(c);
8516 }
8517 this.conditions[j].OnStacked(c.power);
8518 this.conditions[j].OnStartOrStack();
8519 this.conditions[j].PlayEffect();
8520 }
8521 if (!this.conditions[j].AllowMultipleInstance)
8522 {
8523 return null;
8524 }
8525 }
8526 IL_243:;
8527 }
8528 using (List<Condition>.Enumerator enumerator = this.conditions.GetEnumerator())
8529 {
8530 while (enumerator.MoveNext())
8531 {
8532 if (enumerator.Current.TryNullify(c))
8533 {
8534 return null;
8535 }
8536 }
8537 }
8538 int num2 = c.EvaluateTurn(c.power);
8539 if (num2 == 0)
8540 {
8541 return null;
8542 }
8543 c.value = num2;
8544 this.conditions.Add(c);
8545 if (this.CanGainConResist)
8546 {
8547 this.AddResistCon(c);
8548 }
8549 c.SetOwner(this, false);
8550 c.Start();
8551 this.SetDirtySpeed();
8552 if (c.ShouldRefresh)
8553 {
8554 this.Refresh(false);
8555 }
8556 if (this.IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
8557 {
8558 EClass.player.EndTurn(true);
8559 }
8560 if (c.SyncRide && (this.ride != null || this.parasite != null))
8561 {
8562 if (this.ride != null)
8563 {
8564 this.ride.AddCondition(Condition.Create(c.source.alias, c.power, null), false);
8565 }
8566 if (this.parasite != null)
8567 {
8568 this.parasite.AddCondition(Condition.Create(c.source.alias, c.power, null), false);
8569 }
8570 }
8571 return c;
8572 }
8573
8574 // Token: 0x0600155F RID: 5471 RVA: 0x00091F54 File Offset: 0x00090154
8575 public override bool HasCondition<T>()
8576 {
8577 for (int i = 0; i < this.conditions.Count; i++)
8578 {
8579 if (this.conditions[i] is T)
8580 {
8581 return true;
8582 }
8583 }
8584 return false;
8585 }
8586
8587 // Token: 0x06001560 RID: 5472 RVA: 0x00091F90 File Offset: 0x00090190
8588 public bool HasCondition(string alias)
8589 {
8590 for (int i = 0; i < this.conditions.Count; i++)
8591 {
8592 if (this.conditions[i].source.alias == alias)
8593 {
8594 return true;
8595 }
8596 }
8597 return false;
8598 }
8599
8600 // Token: 0x06001561 RID: 5473 RVA: 0x00091FD4 File Offset: 0x000901D4
8601 public Element GetBuffStats(string alias)
8602 {
8603 return this.GetBuffStats(EClass.sources.elements.alias[alias].id);
8604 }
8605
8606 // Token: 0x06001562 RID: 5474 RVA: 0x00091FF8 File Offset: 0x000901F8
8607 public Element GetBuffStats(int ele)
8608 {
8609 for (int i = 0; i < this.conditions.Count; i++)
8610 {
8611 ConBuffStats conBuffStats = this.conditions[i] as ConBuffStats;
8612 if (conBuffStats != null && conBuffStats.refVal == ele)
8613 {
8614 return conBuffStats.elements.GetElement(ele);
8615 }
8616 }
8617 return null;
8618 }
8619
8620 // Token: 0x06001563 RID: 5475 RVA: 0x00092048 File Offset: 0x00090248
8621 public void CureCondition<T>(int v = 99999) where T : Condition
8622 {
8623 T condition = this.GetCondition<T>();
8624 if (condition == null)
8625 {
8626 return;
8627 }
8628 ref T ptr = ref condition;
8629 ptr.value -= v;
8630 if (condition.value <= 0)
8631 {
8632 condition.Kill(false);
8633 }
8634 }
8635
8636 // Token: 0x06001564 RID: 5476 RVA: 0x0009209C File Offset: 0x0009029C
8637 public T GetCondition<T>() where T : Condition
8638 {
8639 for (int i = 0; i < this.conditions.Count; i++)
8640 {
8641 if (this.conditions[i] is T)
8642 {
8643 return this.conditions[i] as T;
8644 }
8645 }
8646 return default(T);
8647 }
8648
8649 // Token: 0x06001565 RID: 5477 RVA: 0x000920F4 File Offset: 0x000902F4
8650 public void RemoveCondition<T>() where T : Condition
8651 {
8652 for (int i = this.conditions.Count - 1; i >= 0; i--)
8653 {
8654 if (this.conditions[i] is T)
8655 {
8656 this.conditions[i].Kill(false);
8657 return;
8658 }
8659 }
8660 }
8661
8662 // Token: 0x06001566 RID: 5478 RVA: 0x0009213F File Offset: 0x0009033F
8663 public void CureHost(CureType type, int p = 100, BlessedState state = BlessedState.Normal)
8664 {
8665 if (this.parasite != null)
8666 {
8667 this.parasite.Cure(type, p, state);
8668 }
8669 if (this.ride != null)
8670 {
8671 this.ride.Cure(type, p, state);
8672 }
8673 this.Cure(type, p, state);
8674 }
8675
8676 // Token: 0x06001567 RID: 5479 RVA: 0x00092178 File Offset: 0x00090378
8677 public void Cure(CureType type, int p = 100, BlessedState state = BlessedState.Normal)
8678 {
8679 bool flag = state == BlessedState.Blessed;
8680 switch (type)
8681 {
8682 case CureType.Heal:
8683 case CureType.Prayer:
8684 this.CureCondition<ConFear>(99999);
8685 this.CureCondition<ConBlind>(2 * p / 100 + 5);
8686 this.CureCondition<ConPoison>(5 * p / 100 + 5);
8687 this.CureCondition<ConConfuse>(10 * p / 100 + 10);
8688 this.CureCondition<ConDim>(p / 100 + 5);
8689 this.CureCondition<ConBleed>(2 * p / 100 + 10);
8690 if (flag)
8691 {
8692 this.SAN.Mod(-5);
8693 return;
8694 }
8695 break;
8696 case CureType.HealComplete:
8697 case CureType.Death:
8698 case CureType.Jure:
8699 case CureType.Boss:
8700 this.CureTempElements(p * 100, true, true);
8701 for (int i = this.conditions.Count - 1; i >= 0; i--)
8702 {
8703 Condition condition = this.conditions[i];
8704 if (condition.Type == ConditionType.Bad || condition.Type == ConditionType.Debuff || condition.Type == ConditionType.Disease)
8705 {
8706 condition.Kill(false);
8707 }
8708 else if (type == CureType.Death && condition.isPerfume)
8709 {
8710 condition.Kill(false);
8711 }
8712 }
8713 this.CureCondition<ConWait>(99999);
8714 this.CureCondition<ConSleep>(99999);
8715 if (type == CureType.Death)
8716 {
8717 this.hunger.value = 30;
8718 }
8719 if (type == CureType.Jure)
8720 {
8721 this.SAN.Mod(-999);
8722 if (base.HasElement(1206, 1))
8723 {
8724 this.SetFeat(1206, 0, true);
8725 }
8726 }
8727 break;
8728 case CureType.Sleep:
8729 {
8730 for (int j = this.conditions.Count - 1; j >= 0; j--)
8731 {
8732 Condition condition2 = this.conditions[j];
8733 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
8734 {
8735 if (condition2.isPerfume)
8736 {
8737 condition2.Mod(-1, true);
8738 }
8739 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
8740 {
8741 condition2.Kill(false);
8742 }
8743 }
8744 }
8745 this.CureCondition<ConWait>(99999);
8746 this.CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
8747 bool flag2 = this.HasCondition<ConAnorexia>();
8748 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
8749 if (base.c_vomit < 0)
8750 {
8751 base.c_vomit = 0;
8752 if (flag2)
8753 {
8754 this.RemoveCondition<ConAnorexia>();
8755 return;
8756 }
8757 }
8758 break;
8759 }
8760 case CureType.CureBody:
8761 this.CureCondition<ConBlind>(5 * p / 100 + 15);
8762 this.CureCondition<ConPoison>(10 * p / 100 + 15);
8763 this.CureCondition<ConBleed>(5 * p / 100 + 20);
8764 this.CureTempElements(p, true, false);
8765 return;
8766 case CureType.CureMind:
8767 this.CureCondition<ConFear>(99999);
8768 this.CureCondition<ConDim>(3 * p / 100 + 10);
8769 this.CureTempElements(p, false, true);
8770 return;
8771 default:
8772 return;
8773 }
8774 }
8775
8776 // Token: 0x06001568 RID: 5480 RVA: 0x00092404 File Offset: 0x00090604
8777 public bool TryNeckHunt(Chara TC, int power, bool harvest = false)
8778 {
8779 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
8780 {
8781 return false;
8782 }
8783 if (TC.hp > TC.MaxHP * Mathf.Min(5 + (int)Mathf.Sqrt((float)power), harvest ? 35 : 25) / 100)
8784 {
8785 return false;
8786 }
8787 if (TC.HasElement(427, 1))
8788 {
8789 return false;
8790 }
8791 base.PlaySound("hit_finish", 1f, true);
8792 base.Say("finish", null, null);
8793 base.Say("finish2", this, TC, null, null);
8794 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
8795 return false;
8796 }
8797
8798 // Token: 0x170005FC RID: 1532
8799 // (get) Token: 0x06001569 RID: 5481 RVA: 0x000924AE File Offset: 0x000906AE
8800 public bool CanGainConResist
8801 {
8802 get
8803 {
8804 return base.rarity >= Rarity.Legendary && !this.IsPCFaction;
8805 }
8806 }
8807
8808 // Token: 0x0600156A RID: 5482 RVA: 0x000924C4 File Offset: 0x000906C4
8809 public void AddResistCon(Condition con)
8810 {
8811 if (con.power <= 0 || con.GainResistFactor <= 0)
8812 {
8813 return;
8814 }
8815 int id = con.id;
8816 if (this.resistCon == null)
8817 {
8818 this.resistCon = new Dictionary<int, int>();
8819 }
8820 if (this.resistCon.ContainsKey(id))
8821 {
8822 Dictionary<int, int> dictionary = this.resistCon;
8823 int key = id;
8824 dictionary[key] += con.power * con.GainResistFactor / 100;
8825 return;
8826 }
8827 this.resistCon[id] = con.power * con.GainResistFactor / 100;
8828 }
8829
8830 // Token: 0x0600156B RID: 5483 RVA: 0x00092554 File Offset: 0x00090754
8831 public void ResistCon(Condition con)
8832 {
8833 if (con.power <= 0 || this.resistCon == null)
8834 {
8835 return;
8836 }
8837 int a = this.resistCon.TryGetValue(con.id, 0);
8838 if (1000 < EClass.rnd(a))
8839 {
8840 con.power = 0;
8841 return;
8842 }
8843 if (500 < EClass.rnd(a))
8844 {
8845 con.power /= 5;
8846 return;
8847 }
8848 if (200 < EClass.rnd(a))
8849 {
8850 con.power /= 2;
8851 }
8852 }
8853
8854 // Token: 0x0600156C RID: 5484 RVA: 0x000925D4 File Offset: 0x000907D4
8855 public void Sleep(Thing bed = null, Thing pillow = null, bool pickup = false, ItemPosition posBed = null, ItemPosition posPillow = null)
8856 {
8857 this.AddCondition(Condition.Create<ConSleep>(100, delegate(ConSleep con)
8858 {
8859 con.pcSleep = 15;
8860 con.pcBed = bed;
8861 con.pcPillow = pillow;
8862 con.pickup = pickup;
8863 con.posBed = posBed;
8864 con.posPillow = posPillow;
8865 }), true);
8866 }
8867
8868 // Token: 0x0600156D RID: 5485 RVA: 0x00092628 File Offset: 0x00090828
8869 public void OnSleep(Thing bed = null, int days = 1)
8870 {
8871 TraitPillow traitPillow = this.pos.FindThing<TraitPillow>();
8872 int num = (bed == null) ? 20 : bed.Power;
8873 if (traitPillow != null)
8874 {
8875 num += traitPillow.owner.Power / 2;
8876 }
8877 num += base.Evalue(750) * 5;
8878 this.OnSleep(num, days);
8879 }
8880
8881 // Token: 0x0600156E RID: 5486 RVA: 0x0009267C File Offset: 0x0009087C
8882 public void OnSleep(int power, int days = 1)
8883 {
8884 if (days < 1)
8885 {
8886 days = 1;
8887 }
8888 int num = power * days;
8889 if (this.stamina.value < 0)
8890 {
8891 this.stamina.Set(1);
8892 }
8893 this.HealHP(num, HealSource.None);
8894 this.stamina.Mod(10 + 25 * num / 100 * (100 + this.elements.GetFeatRef(1642, 0)) / 100);
8895 this.mana.Mod(num);
8896 if (this.IsPCFaction)
8897 {
8898 this.hunger.Mod(20);
8899 }
8900 this.sleepiness.Set(0);
8901 this.interest = 100;
8902 this.Cure(CureType.Sleep, power, BlessedState.Normal);
8903 }
8904
8905 // Token: 0x0600156F RID: 5487 RVA: 0x00092724 File Offset: 0x00090924
8906 public void ModHeight(int a)
8907 {
8908 int num = this.bio.height;
8909 num = num * (100 + a) / 100 + ((a > 0) ? 1 : -1);
8910 if (num < 1)
8911 {
8912 num = 1;
8913 }
8914 if (num == this.bio.height)
8915 {
8916 return;
8917 }
8918 this.bio.height = num;
8919 base.Say((a > 0) ? "height_gain" : "height_lose", this, null, null);
8920 }
8921
8922 // Token: 0x06001570 RID: 5488 RVA: 0x0009278C File Offset: 0x0009098C
8923 public void ModWeight(int a, bool ignoreLimit = false)
8924 {
8925 if (a == 0)
8926 {
8927 return;
8928 }
8929 int num = this.bio.weight;
8930 int height = this.bio.height;
8931 int num2 = height * height * 18 / 25000;
8932 int num3 = height * height * 24 / 10000;
8933 if (!ignoreLimit && (num <= num2 || num >= num3))
8934 {
8935 return;
8936 }
8937 num = num * (100 + a) / 100 + ((a > 0) ? 1 : -1);
8938 if (num < 1)
8939 {
8940 num = 1;
8941 }
8942 if (num == this.bio.weight)
8943 {
8944 return;
8945 }
8946 this.bio.weight = num;
8947 base.Say((a > 0) ? "weight_gain" : "weight_lose", this, null, null);
8948 }
8949
8950 // Token: 0x06001571 RID: 5489 RVA: 0x00092828 File Offset: 0x00090A28
8951 public void ModCorruption(int a)
8952 {
8953 if (a > 0 && base.ResistLv(962) > 0 && EClass.rnd(base.ResistLv(962) + 1) != 0)
8954 {
8955 return;
8956 }
8957 int num = (this.corruption + a) / 100 - this.corruption / 100;
8958 int num2 = 0;
8959 while (num2 < Mathf.Abs(num) && this.MutateRandom((num > 0) ? 1 : -1, 100, true, BlessedState.Normal))
8960 {
8961 num2++;
8962 }
8963 this.corruption += a;
8964 int num3 = 0;
8965 foreach (Element element in this.elements.dict.Values)
8966 {
8967 if (element.source.category == "ether")
8968 {
8969 num3 += element.Value;
8970 }
8971 }
8972 if (num3 > 0 && this.IsPC)
8973 {
8974 Tutorial.Reserve("ether", null);
8975 }
8976 this.corruption = num3 * 100 + this.corruption % 100;
8977 }
8978
8979 // Token: 0x06001572 RID: 5490 RVA: 0x00092940 File Offset: 0x00090B40
8980 public List<Element> ListAvailabeFeats(bool pet = false)
8981 {
8982 List<Element> list = new List<Element>();
8983 foreach (SourceElement.Row row in from a in EClass.sources.elements.rows
8984 where a.@group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()
8985 select a)
8986 {
8987 Feat feat = this.elements.GetOrCreateElement(row.id) as Feat;
8988 int num = (feat.ValueWithoutLink > 0) ? (feat.ValueWithoutLink + 1) : 1;
8989 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && feat.IsAvailable(this.elements, feat.Value))
8990 {
8991 list.Add(Element.Create(feat.id, num) as Feat);
8992 }
8993 }
8994 return list;
8995 }
8996
8997 // Token: 0x06001573 RID: 5491 RVA: 0x00092A60 File Offset: 0x00090C60
8998 public void SetFeat(int id, int value = 1, bool msg = false)
8999 {
9000 Feat feat = this.elements.GetElement(id) as Feat;
9001 int num = 0;
9002 if (feat != null && feat.Value > 0)
9003 {
9004 if (value == feat.Value)
9005 {
9006 return;
9007 }
9008 num = feat.Value;
9009 feat.Apply(-feat.Value, this.elements, false);
9010 }
9011 if (value > 0)
9012 {
9013 feat = (this.elements.SetBase(id, value - ((feat != null) ? feat.vSource : 0), 0) as Feat);
9014 feat.Apply(feat.Value, this.elements, false);
9015 }
9016 else
9017 {
9018 this.elements.Remove(id);
9019 }
9020 if (EClass.core.IsGameStarted)
9021 {
9022 this.Refresh(false);
9023 this.CalculateMaxStamina();
9024 }
9025 if (msg)
9026 {
9027 if (feat.source.textInc.IsEmpty())
9028 {
9029 base.PlaySound("ding_skill", 1f, true);
9030 Msg.SetColor(Msg.colors.Ding);
9031 base.Say("gainFeat", this, feat.FullName, null);
9032 }
9033 else
9034 {
9035 bool flag = value < num;
9036 if (feat.source.tag.Contains("neg"))
9037 {
9038 flag = !flag;
9039 }
9040 base.PlaySound("mutation", 1f, true);
9041 Msg.SetColor(flag ? Msg.colors.Negative : Msg.colors.Ding);
9042 base.Say((value > num) ? feat.source.GetText("textInc", false) : feat.source.GetText("textDec", false), this, feat.FullName, null);
9043 }
9044 this.elements.CheckSkillActions();
9045 }
9046 }
9047
9048 // Token: 0x06001574 RID: 5492 RVA: 0x00092BF8 File Offset: 0x00090DF8
9049 public bool MutateRandom(int vec = 0, int tries = 100, bool ether = false, BlessedState state = BlessedState.Normal)
9050 {
9051 if (!ether && vec >= 0 && base.HasElement(406, 1) && EClass.rnd(5) != 0)
9052 {
9053 base.Say("resistMutation", this, null, null);
9054 return false;
9055 }
9056 IEnumerable<SourceElement.Row> ie = from a in EClass.sources.elements.rows
9057 where a.category == (ether ? "ether" : "mutation")
9058 select a;
9059 for (int i = 0; i < tries; i++)
9060 {
9061 SourceElement.Row row = ie.RandomItem<SourceElement.Row>();
9062 Element element = this.elements.GetElement(row.id);
9063 int num = 1;
9064 if ((vec >= 0 || (element != null && element.Value > 0)) && (vec <= 0 || element == null || element.Value < row.max))
9065 {
9066 if (element == null && !row.aliasParent.IsEmpty() && this.elements.Has(row.aliasParent))
9067 {
9068 row = EClass.sources.elements.alias[row.aliasParent];
9069 element = this.elements.GetElement(row.id);
9070 }
9071 bool flag = row.tag.Contains("neg");
9072 if (vec > 0)
9073 {
9074 if (state >= BlessedState.Blessed && flag)
9075 {
9076 goto IL_31C;
9077 }
9078 if (state <= BlessedState.Cursed && !flag)
9079 {
9080 goto IL_31C;
9081 }
9082 }
9083 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9084 {
9085 goto IL_31C;
9086 }
9087 bool flag2 = true;
9088 if (element != null)
9089 {
9090 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : -1));
9091 if (num > element.source.max)
9092 {
9093 num = element.source.max - 1;
9094 }
9095 flag = ((flag && num > element.Value) || (!flag && num < element.Value));
9096 flag2 = (num > element.Value);
9097 if (vec > 0 && !flag2)
9098 {
9099 goto IL_31C;
9100 }
9101 }
9102 base.Say(flag2 ? "mutation_gain" : "mutation_loose", this, null, null);
9103 this.SetFeat(row.id, num, false);
9104 if ((flag2 & ether) && this.IsPC && !EClass.player.flags.gotEtherDisease)
9105 {
9106 EClass.player.flags.gotEtherDisease = true;
9107 Thing thing = ThingGen.Create("parchment", -1, -1);
9108 thing.SetStr(53, "letter_ether");
9109 Thing thing2 = ThingGen.Create("1165", -1, -1);
9110 thing2.SetBlessedState(BlessedState.Normal);
9111 Thing p = ThingGen.CreateParcel(null, new Thing[]
9112 {
9113 thing2,
9114 thing
9115 });
9116 EClass.world.SendPackage(p);
9117 }
9118 if (EClass.core.IsGameStarted && this.pos != null)
9119 {
9120 base.PlaySound("mutation", 1f, true);
9121 base.PlayEffect("mutation", true, 0f, default(Vector3));
9122 Msg.SetColor(flag ? Msg.colors.MutateBad : Msg.colors.MutateGood);
9123 base.Say(row.GetText(flag ? "textDec" : "textInc", true) ?? row.alias, this, null, null);
9124 }
9125 return true;
9126 }
9127 IL_31C:;
9128 }
9129 base.Say("nothingHappens", null, null);
9130 return false;
9131 }
9132
9133 // Token: 0x06001575 RID: 5493 RVA: 0x00092F3C File Offset: 0x0009113C
9134 public void GainAbility(int ele, int mtp = 100)
9135 {
9136 Element orCreateElement = this.elements.GetOrCreateElement(ele);
9137 if (orCreateElement.ValueWithoutLink == 0)
9138 {
9139 this.elements.ModBase(orCreateElement.id, 1);
9140 }
9141 if (orCreateElement is Spell)
9142 {
9143 int num = mtp * orCreateElement.source.charge * (100 + base.Evalue(307) + (base.HasElement(307, 1) ? 20 : 0)) / 100 / 100;
9144 if (orCreateElement.source.charge == 1)
9145 {
9146 num = 1;
9147 }
9148 orCreateElement.vPotential += Mathf.Max(1, num / 2 + EClass.rnd(num / 2 + 1));
9149 }
9150 base.Say("spell_gain", this, orCreateElement.Name, null);
9151 LayerAbility.SetDirty(orCreateElement);
9152 }
9153
9154 // Token: 0x06001576 RID: 5494 RVA: 0x00092FFC File Offset: 0x000911FC
9155 public bool TryNullifyCurse()
9156 {
9157 if (this.IsPCParty)
9158 {
9159 using (List<Chara>.Enumerator enumerator = EClass.pc.party.members.GetEnumerator())
9160 {
9161 while (enumerator.MoveNext())
9162 {
9163 Chara chara = enumerator.Current;
9164 if (chara.HasElement(1641, 1) && EClass.rnd(3) != 0)
9165 {
9166 Msg.Say("curse_nullify", chara, null, null, null);
9167 return true;
9168 }
9169 }
9170 goto IL_8F;
9171 }
9172 }
9173 if (base.HasElement(1641, 1) && EClass.rnd(3) != 0)
9174 {
9175 base.Say("curse_nullify", this, null, null);
9176 return true;
9177 }
9178 IL_8F:
9179 if (this.GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
9180 {
9181 base.Say("curse_nullify", this, null, null);
9182 return true;
9183 }
9184 return false;
9185 }
9186
9187 // Token: 0x06001577 RID: 5495 RVA: 0x000930CC File Offset: 0x000912CC
9188 public int GetPietyValue()
9189 {
9190 if (base._IsPC)
9191 {
9192 return 10 + (int)(Mathf.Sqrt((float)base.c_daysWithGod) * 2f + (float)base.Evalue(85)) / 2;
9193 }
9194 return 10 + (int)(Mathf.Sqrt((float)base.LV) * 5f + (float)base.Evalue(306)) / 2;
9195 }
9196
9197 // Token: 0x06001578 RID: 5496 RVA: 0x0009312C File Offset: 0x0009132C
9198 public void RefreshFaithElement()
9199 {
9200 if (this.faithElements != null)
9201 {
9202 this.faithElements.SetParent(null);
9203 }
9204 this.faithElements = new ElementContainer();
9205 if (this.idFaith == "eyth" && !base.HasElement(1228, 1))
9206 {
9207 return;
9208 }
9209 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(this.idFaith, null);
9210 if (row == null)
9211 {
9212 return;
9213 }
9214 this.faithElements = new ElementContainer();
9215 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1", null);
9216 if (row2 != null)
9217 {
9218 this.faithElements.SetBase(row2.id, 1, 0);
9219 }
9220 if (!this.HasCondition<ConExcommunication>())
9221 {
9222 int[] elements = row.elements;
9223 int num = this.GetPietyValue() * (120 + base.Evalue(1407) * 15) / 100;
9224 for (int i = 0; i < elements.Length; i += 2)
9225 {
9226 int num2 = elements[i + 1] * num / 50;
9227 if (elements[i] == 79)
9228 {
9229 num2 = EClass.curve(num2, 100, 20, 60);
9230 }
9231 if (num2 >= 20 && elements[i] >= 950 && elements[i] < 970)
9232 {
9233 num2 = 20;
9234 }
9235 this.faithElements.SetBase(elements[i], Mathf.Max(num2, 1), 0);
9236 }
9237 }
9238 this.faithElements.SetParent(this);
9239 }
9240
9241 // Token: 0x06001579 RID: 5497 RVA: 0x00093290 File Offset: 0x00091490
9242 public void ModTempElement(int ele, int a, bool naturalDecay = false)
9243 {
9244 if (a < 0 && !naturalDecay)
9245 {
9246 SourceElement.Row row = EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias];
9247 if (base.HasElement((row != null) ? row.id : 0, 1))
9248 {
9249 return;
9250 }
9251 }
9252 if (this.tempElements == null)
9253 {
9254 this.tempElements = new ElementContainer();
9255 this.tempElements.SetParent(this);
9256 }
9257 if (a > 0 && this.tempElements.Base(ele) > a)
9258 {
9259 a = a * 100 / (200 + (this.tempElements.Base(ele) - a) * 10);
9260 }
9261 Element element = this.tempElements.ModBase(ele, a);
9262 if (element.vBase == 0)
9263 {
9264 this.tempElements.Remove(element.id);
9265 if (this.tempElements.dict.Count == 0)
9266 {
9267 this.tempElements = null;
9268 }
9269 }
9270 }
9271
9272 // Token: 0x0600157A RID: 5498 RVA: 0x00093382 File Offset: 0x00091582
9273 public void DamageTempElements(int p, bool body, bool mind)
9274 {
9275 if (body)
9276 {
9277 this.DamageTempElement(Element.List_Body.RandomItem<int>(), p);
9278 }
9279 if (mind)
9280 {
9281 this.DamageTempElement(Element.List_Mind.RandomItem<int>(), p);
9282 }
9283 }
9284
9285 // Token: 0x0600157B RID: 5499 RVA: 0x000933AC File Offset: 0x000915AC
9286 public void DamageTempElement(int ele, int p)
9287 {
9288 this.ModTempElement(ele, -(p / 100 + EClass.rnd(p / 100 + 1) + 1), false);
9289 }
9290
9291 // Token: 0x0600157C RID: 5500 RVA: 0x000933C9 File Offset: 0x000915C9
9292 public void EnhanceTempElements(int p, bool body, bool mind)
9293 {
9294 if (body)
9295 {
9296 this.EnhanceTempElement(Element.List_Body.RandomItem<int>(), p);
9297 }
9298 if (mind)
9299 {
9300 this.EnhanceTempElement(Element.List_Mind.RandomItem<int>(), p);
9301 }
9302 }
9303
9304 // Token: 0x0600157D RID: 5501 RVA: 0x000933F3 File Offset: 0x000915F3
9305 public void EnhanceTempElement(int ele, int p)
9306 {
9307 this.ModTempElement(ele, p / 100 + EClass.rnd(p / 100 + 1), false);
9308 }
9309
9310 // Token: 0x0600157E RID: 5502 RVA: 0x00093410 File Offset: 0x00091610
9311 public void DiminishTempElements(int a = 1)
9312 {
9313 if (this.tempElements == null)
9314 {
9315 return;
9316 }
9317 foreach (Element element in this.tempElements.dict.Values.ToList<Element>())
9318 {
9319 if (element.vBase > 0)
9320 {
9321 this.ModTempElement(element.id, -Mathf.Min(a, element.vBase), true);
9322 }
9323 }
9324 }
9325
9326 // Token: 0x0600157F RID: 5503 RVA: 0x00093498 File Offset: 0x00091698
9327 public void CureTempElements(int p, bool body, bool mind)
9328 {
9329 Chara.<>c__DisplayClass553_0 CS$<>8__locals1;
9330 CS$<>8__locals1.<>4__this = this;
9331 CS$<>8__locals1.p = p;
9332 if (this.tempElements == null)
9333 {
9334 return;
9335 }
9336 if (body)
9337 {
9338 this.<CureTempElements>g__Cure|553_0(Element.List_Body, ref CS$<>8__locals1);
9339 }
9340 if (mind)
9341 {
9342 this.<CureTempElements>g__Cure|553_0(Element.List_Mind, ref CS$<>8__locals1);
9343 }
9344 }
9345
9346 // Token: 0x06001583 RID: 5507 RVA: 0x000935A6 File Offset: 0x000917A6
9347 [CompilerGenerated]
9348 private void <RestockInventory>g__Restock|354_0(string id, int num)
9349 {
9350 if (this.things.Find(id, -1, -1) == null)
9351 {
9352 base.AddCard(ThingGen.Create(id, -1, -1).SetNum(num));
9353 }
9354 }
9355
9356 // Token: 0x06001587 RID: 5511 RVA: 0x00093618 File Offset: 0x00091818
9357 [CompilerGenerated]
9358 private void <RefreshWorkElements>g__TryAdd|483_0(Hobby h)
9359 {
9360 if (h.source.elements.IsEmpty())
9361 {
9362 return;
9363 }
9364 if (this.workElements == null)
9365 {
9366 this.workElements = new ElementContainer();
9367 }
9368 int i = 0;
9369 while (i < h.source.elements.Length)
9370 {
9371 int num = h.source.elements[i];
9372 int num2 = h.source.elements[i + 1];
9373 int num3 = 100;
9374 if (num == 2115)
9375 {
9376 goto IL_6E;
9377 }
9378 num3 = h.GetEfficiency(this) * this.homeBranch.efficiency / 100;
9379 if (num3 > 0)
9380 {
9381 goto IL_6E;
9382 }
9383 IL_A2:
9384 i += 2;
9385 continue;
9386 IL_6E:
9387 this.workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9388 goto IL_A2;
9389 }
9390 }
9391
9392 // Token: 0x06001588 RID: 5512 RVA: 0x000936E0 File Offset: 0x000918E0
9393 [CompilerGenerated]
9394 internal static int <PerformWork>g__PerformWork|494_0(Hobby work, int idx, bool isHobby, ref Chara.<>c__DisplayClass494_0 A_3)
9395 {
9396 if (idx >= work.source.resources.Length)
9397 {
9398 return 0;
9399 }
9400 int num = work.source.resources[idx];
9401 int num2 = num;
9402 num = Rand.Range(num * (100 - work.source.resources[idx]) / 100, num);
9403 num = num * (isHobby ? 50 : 100) * A_3.session.efficiency / 10000;
9404 if (num2 > 0 && num <= 0)
9405 {
9406 num = 1;
9407 }
9408 return num;
9409 }
9410
9411 // Token: 0x06001589 RID: 5513 RVA: 0x00093754 File Offset: 0x00091954
9412 [CompilerGenerated]
9413 private void <CureTempElements>g__Cure|553_0(int[] eles, ref Chara.<>c__DisplayClass553_0 A_2)
9414 {
9415 foreach (int num in eles)
9416 {
9417 if (this.tempElements == null)
9418 {
9419 return;
9420 }
9421 Element element = this.tempElements.GetElement(num);
9422 if (element != null && element.vBase < 0)
9423 {
9424 this.ModTempElement(num, Mathf.Clamp(A_2.p / 20 + EClass.rnd(A_2.p / 20), 1, -element.vBase), false);
9425 }
9426 }
9427 }
9428
9429 // Token: 0x04000FBB RID: 4027
9430 private static Point shared = new Point();
9431
9432 // Token: 0x04000FBC RID: 4028
9433 private static List<Hobby> listHobby = new List<Hobby>();
9434
9435 // Token: 0x04000FBD RID: 4029
9436 public static string[] IDTimeTable = new string[]
9437 {
9438 "default",
9439 "owl"
9440 };
9441
9442 // Token: 0x04000FBE RID: 4030
9443 [JsonProperty]
9444 public int contribution;
9445
9446 // Token: 0x04000FBF RID: 4031
9447 [JsonProperty]
9448 public Point orgPos;
9449
9450 // Token: 0x04000FC0 RID: 4032
9451 [JsonProperty]
9452 public Quest quest;
9453
9454 // Token: 0x04000FC1 RID: 4033
9455 [JsonProperty]
9456 public Chara ride;
9457
9458 // Token: 0x04000FC2 RID: 4034
9459 [JsonProperty]
9460 public Chara parasite;
9461
9462 // Token: 0x04000FC3 RID: 4035
9463 [JsonProperty]
9464 public Chara host;
9465
9466 // Token: 0x04000FC4 RID: 4036
9467 [JsonProperty]
9468 public ElementContainer tempElements;
9469
9470 // Token: 0x04000FC5 RID: 4037
9471 public ElementContainer faithElements;
9472
9473 // Token: 0x04000FC6 RID: 4038
9474 public ElementContainer workElements;
9475
9476 // Token: 0x04000FC7 RID: 4039
9477 [JsonProperty(PropertyName = "T1")]
9478 public Party party;
9479
9480 // Token: 0x04000FC8 RID: 4040
9481 [JsonProperty(PropertyName = "T2")]
9482 public FactionMemberType memberType;
9483
9484 // Token: 0x04000FC9 RID: 4041
9485 [JsonProperty(PropertyName = "T3")]
9486 public List<int> _hobbies;
9487
9488 // Token: 0x04000FCA RID: 4042
9489 [JsonProperty(PropertyName = "T4")]
9490 public List<int> _works;
9491
9492 // Token: 0x04000FCB RID: 4043
9493 [JsonProperty(PropertyName = "T5")]
9494 public WorkSummary _workSummary;
9495
9496 // Token: 0x04000FCC RID: 4044
9497 [JsonProperty(PropertyName = "T6")]
9498 public List<int> _cooldowns;
9499
9500 // Token: 0x04000FCD RID: 4045
9501 [JsonProperty(PropertyName = "T7")]
9502 public List<int> _listAbility;
9503
9504 // Token: 0x04000FCE RID: 4046
9505 [JsonProperty(PropertyName = "1")]
9506 public PCCData pccData;
9507
9508 // Token: 0x04000FCF RID: 4047
9509 [JsonProperty(PropertyName = "2")]
9510 public Card held;
9511
9512 // Token: 0x04000FD0 RID: 4048
9513 [JsonProperty(PropertyName = "3")]
9514 public int[] rawSlots;
9515
9516 // Token: 0x04000FD1 RID: 4049
9517 [JsonProperty(PropertyName = "4")]
9518 public GlobalData global;
9519
9520 // Token: 0x04000FD2 RID: 4050
9521 [JsonProperty(PropertyName = "8")]
9522 public string[] _strs = new string[5];
9523
9524 // Token: 0x04000FD3 RID: 4051
9525 [JsonProperty(PropertyName = "9")]
9526 public int[] _cints = new int[30];
9527
9528 // Token: 0x04000FD4 RID: 4052
9529 public BitArray32 _cbits1;
9530
9531 // Token: 0x04000FD5 RID: 4053
9532 public Chara enemy;
9533
9534 // Token: 0x04000FD6 RID: 4054
9535 public Chara master;
9536
9537 // Token: 0x04000FD7 RID: 4055
9538 public Point lastPos = new Point();
9539
9540 // Token: 0x04000FD8 RID: 4056
9541 public PathProgress path = new PathProgress();
9542
9543 // Token: 0x04000FD9 RID: 4057
9544 public CharaBody body = new CharaBody();
9545
9546 // Token: 0x04000FDA RID: 4058
9547 public CharaAbility _ability;
9548
9549 // Token: 0x04000FDB RID: 4059
9550 public Thing ranged;
9551
9552 // Token: 0x04000FDC RID: 4060
9553 public Thing nextUse;
9554
9555 // Token: 0x04000FDD RID: 4061
9556 public ConSleep conSleep;
9557
9558 // Token: 0x04000FDE RID: 4062
9559 public ConSuspend conSuspend;
9560
9561 // Token: 0x04000FDF RID: 4063
9562 public Emo2 emoIcon;
9563
9564 // Token: 0x04000FE0 RID: 4064
9565 public int happiness;
9566
9567 // Token: 0x04000FE1 RID: 4065
9568 public int turnLastSeen = -100;
9569
9570 // Token: 0x04000FE2 RID: 4066
9571 public int idleActTimer;
9572
9573 // Token: 0x04000FE3 RID: 4067
9574 public int combatCount;
9575
9576 // Token: 0x04000FE4 RID: 4068
9577 public int calmCheckTurn;
9578
9579 // Token: 0x04000FE5 RID: 4069
9580 public int sharedCheckTurn;
9581
9582 // Token: 0x04000FE6 RID: 4070
9583 public float idleTimer;
9584
9585 // Token: 0x04000FE7 RID: 4071
9586 public bool isDrunk;
9587
9588 // Token: 0x04000FE8 RID: 4072
9589 public bool isConfused;
9590
9591 // Token: 0x04000FE9 RID: 4073
9592 public bool isFainted;
9593
9594 // Token: 0x04000FEA RID: 4074
9595 public bool isBlind;
9596
9597 // Token: 0x04000FEB RID: 4075
9598 public bool isParalyzed;
9599
9600 // Token: 0x04000FEC RID: 4076
9601 public bool isLevitating;
9602
9603 // Token: 0x04000FED RID: 4077
9604 public bool isCreated;
9605
9606 // Token: 0x04000FEE RID: 4078
9607 public bool canSeeInvisible;
9608
9609 // Token: 0x04000FEF RID: 4079
9610 public bool hasTelepathy;
9611
9612 // Token: 0x04000FF0 RID: 4080
9613 public bool isWet;
9614
9615 // Token: 0x04000FF1 RID: 4081
9616 public bool bossText;
9617
9618 // Token: 0x04000FF2 RID: 4082
9619 private Faction _faction;
9620
9621 // Token: 0x04000FF3 RID: 4083
9622 public SourceChara.Row source;
9623
9624 // Token: 0x04000FF4 RID: 4084
9625 public SourceRace.Row _race;
9626
9627 // Token: 0x04000FF5 RID: 4085
9628 public SourceJob.Row _job;
9629
9630 // Token: 0x04000FF6 RID: 4086
9631 public Tactics _tactics;
9632
9633 // Token: 0x04000FF7 RID: 4087
9634 public static List<SourceRace.Row> ListAdvRace = new List<SourceRace.Row>();
9635
9636 // Token: 0x04000FF8 RID: 4088
9637 public static List<SourceJob.Row> ListAdvJob = new List<SourceJob.Row>();
9638
9639 // Token: 0x04000FF9 RID: 4089
9640 public bool dirtySpeed = true;
9641
9642 // Token: 0x04000FFA RID: 4090
9643 private int _Speed;
9644
9645 // Token: 0x04000FFB RID: 4091
9646 private static Point _sharedPos = new Point();
9647
9648 // Token: 0x04000FFC RID: 4092
9649 private bool hasMovedThisTurn;
9650
9651 // Token: 0x04000FFD RID: 4093
9652 public float actTime = 0.3f;
9653
9654 // Token: 0x04000FFE RID: 4094
9655 public static bool consumeTurn;
9656
9657 // Token: 0x04000FFF RID: 4095
9658 public static bool preventRegen;
9659
9660 // Token: 0x04001000 RID: 4096
9661 public static bool isOnCreate;
9662
9663 // Token: 0x04001001 RID: 4097
9664 private static List<Chara> _pts = new List<Chara>();
9665
9666 // Token: 0x04001002 RID: 4098
9667 private static List<Thing> _ListItems = new List<Thing>();
9668
9669 // Token: 0x04001003 RID: 4099
9670 private static List<SourceThing.Row> _listFavFood = new List<SourceThing.Row>();
9671
9672 // Token: 0x04001004 RID: 4100
9673 private static List<SourceCategory.Row> _listFavCat = new List<SourceCategory.Row>();
9674
9675 // Token: 0x04001005 RID: 4101
9676 public static NoGoal _NoGoalPC = new NoGoal();
9677
9678 // Token: 0x04001006 RID: 4102
9679 public static NoGoal _NoGoalRepeat = new NoGoal();
9680
9681 // Token: 0x04001007 RID: 4103
9682 public GoalList goalList = new GoalList();
9683
9684 // Token: 0x04001008 RID: 4104
9685 public AIAct ai = new NoGoal();
9686
9687 // Token: 0x04001009 RID: 4105
9688 private static GoalWork _goalWork = new GoalWork();
9689
9690 // Token: 0x0400100A RID: 4106
9691 private static GoalHobby _goalHobby = new GoalHobby();
9692
9693 // Token: 0x0400100B RID: 4107
9694 [JsonProperty]
9695 public List<Condition> conditions = new List<Condition>();
9696
9697 // Token: 0x0400100C RID: 4108
9698 [JsonProperty]
9699 public Dictionary<int, int> resistCon;
9700}
Definition ACT.cs:6
Definition AIAct.cs:7
Definition Act.2.cs:7
Definition Card.cs:13
Definition Cell.cs:10
Definition Chara.cs:12
Definition DNA.cs:9
Definition FLOOR.cs:5
Definition Feat.2.cs:8
Definition Goal.cs:5
Definition Hobby.cs:5
Definition Los.cs:6
Definition Map.cs:15
Definition Msg.cs:7
Definition Party.cs:8
Definition Point.cs:11
Definition Quest.cs:8
Definition Room.cs:6
Definition Scene.cs:10
Definition Stats.cs:6
Definition TC.cs:6
Definition Thing.cs:10
Definition Zone.cs:14