Elin Modding Docs Doc
Loading...
Searching...
No Matches
AI_Torture.cs
1using System;
2using System.Collections.Generic;
3using System.Runtime.CompilerServices;
4
5// Token: 0x02000206 RID: 518
6public class AI_Torture : AIAct
7{
8 // Token: 0x170003C9 RID: 969
9 // (get) Token: 0x06000EC6 RID: 3782 RVA: 0x0006DE51 File Offset: 0x0006C051
10 public override CursorInfo CursorIcon
11 {
12 get
13 {
14 return CursorSystem.IconMelee;
15 }
16 }
17
18 // Token: 0x170003CA RID: 970
19 // (get) Token: 0x06000EC7 RID: 3783 RVA: 0x0006DE58 File Offset: 0x0006C058
20 public override bool HasProgress
21 {
22 get
23 {
24 return true;
25 }
26 }
27
28 // Token: 0x06000EC8 RID: 3784 RVA: 0x0006DE5B File Offset: 0x0006C05B
29 public override bool CanManualCancel()
30 {
31 return true;
32 }
33
34 // Token: 0x170003CB RID: 971
35 // (get) Token: 0x06000EC9 RID: 3785 RVA: 0x0006DE5E File Offset: 0x0006C05E
36 public override bool CancelWhenDamaged
37 {
38 get
39 {
40 return false;
41 }
42 }
43
44 // Token: 0x06000ECA RID: 3786 RVA: 0x0006DE61 File Offset: 0x0006C061
45 public override IEnumerable<AIAct.Status> Run()
46 {
47 this._owner = this.owner;
48 this.isFail = (() => this.shackle == null || !this.shackle.owner.ExistsOnMap || !this.owner.isRestrained || !this.shackle.owner.pos.Equals(this.owner.pos) || this.owner.stamina.value <= 0);
49 while (!this.owner.IsPC && this.owner.stamina.value < this.owner.stamina.max * 4 / 5)
50 {
51 yield return base.KeepRunning();
52 }
53 yield return base.DoProgress();
54 yield break;
55 }
56
57 // Token: 0x06000ECB RID: 3787 RVA: 0x0006DE74 File Offset: 0x0006C074
58 public override AIProgress CreateProgress()
59 {
60 Progress_Custom progress_Custom = new Progress_Custom();
61 progress_Custom.canProgress = (() => !this.isFail());
62 progress_Custom.onProgressBegin = delegate()
63 {
64 };
65 progress_Custom.onProgress = delegate(Progress_Custom p)
66 {
67 if (p.progress % 8 == 0)
68 {
69 this.owner.PlayAnime(this.shackle.animeId, false);
70 }
71 if (EClass.rnd(20) == 0)
72 {
73 this.owner.Talk("restrained", null, null, false);
74 }
75 List<Chara> list = new List<Chara>();
76 foreach (Chara chara in EClass._map.charas)
77 {
78 if (!chara.IsDisabled && chara.IsPCFaction && chara != this.owner && !chara.IsPC && !chara.isRestrained && chara.host == null && !chara.noMove && !chara.IsInCombat)
79 {
80 list.Add(chara);
81 }
82 }
83 list.Sort((Chara a, Chara b) => this.<CreateProgress>g__SortVal|10_4(a) - this.<CreateProgress>g__SortVal|10_4(b));
84 int num = 1 + EClass.Branch.members.Count / 5;
85 int num2 = 0;
86 foreach (Chara chara2 in list)
87 {
88 if (EClass.rnd(3) == 0)
89 {
90 chara2.SetEnemy(this.owner);
91 }
92 num2++;
93 if (num2 >= num)
94 {
95 break;
96 }
97 }
98 };
99 progress_Custom.onProgressComplete = delegate()
100 {
101 };
102 progress_Custom.cancelWhenDamaged = false;
103 return progress_Custom.SetDuration(10000, 2);
104 }
105
106 // Token: 0x06000ECC RID: 3788 RVA: 0x0006DF08 File Offset: 0x0006C108
107 public override void OnCancelOrSuccess()
108 {
109 if (this._owner != null)
110 {
111 foreach (Chara chara in EClass._map.charas)
112 {
113 if (chara != this._owner && (chara.enemy == this._owner || chara.enemy == this._owner.parasite || chara.enemy == this._owner.ride))
114 {
115 chara.SetEnemy(null);
116 if (!(chara.ai is AI_Torture))
117 {
118 chara.ai.Cancel();
119 }
120 }
121 }
122 }
123 }
124
125 // Token: 0x06000ED1 RID: 3793 RVA: 0x0006E1B0 File Offset: 0x0006C3B0
126 [CompilerGenerated]
127 private int <CreateProgress>g__SortVal|10_4(Chara c)
128 {
129 return this.owner.Dist(c);
130 }
131
132 // Token: 0x04000D62 RID: 3426
133 public TraitShackle shackle;
134
135 // Token: 0x04000D63 RID: 3427
136 public Chara _owner;
137}
Definition AIAct.cs:7
Definition Chara.cs:12