Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitShackle.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000454 RID: 1108
5public class TraitShackle : Trait
6{
7 // Token: 0x1700099E RID: 2462
8 // (get) Token: 0x06001EFE RID: 7934 RVA: 0x000B0DA1 File Offset: 0x000AEFA1
9 public virtual Vector3 GetRestrainPos
10 {
11 get
12 {
13 return EClass.setting.render.posShackle;
14 }
15 }
16
17 // Token: 0x1700099F RID: 2463
18 // (get) Token: 0x06001EFF RID: 7935 RVA: 0x000B0DB2 File Offset: 0x000AEFB2
19 public virtual AnimeID animeId
20 {
21 get
22 {
23 return AnimeID.Shiver;
24 }
25 }
26
27 // Token: 0x06001F00 RID: 7936 RVA: 0x000B0DB5 File Offset: 0x000AEFB5
28 public override bool CanStackTo(Thing to)
29 {
30 return false;
31 }
32
33 // Token: 0x170009A0 RID: 2464
34 // (get) Token: 0x06001F01 RID: 7937 RVA: 0x000B0DB8 File Offset: 0x000AEFB8
35 public override bool CanBeHeld
36 {
37 get
38 {
39 return !this.IsRestraining();
40 }
41 }
42
43 // Token: 0x06001F02 RID: 7938 RVA: 0x000B0DC4 File Offset: 0x000AEFC4
44 public override bool CanUse(Chara c)
45 {
46 return EClass._zone.IsPCFaction && this.owner.IsInstalled && !EClass.pc.isRestrained && (this.owner.pos.FirstChara == null || !this.owner.pos.FirstChara.isRestrained);
47 }
48
49 // Token: 0x170009A1 RID: 2465
50 // (get) Token: 0x06001F03 RID: 7939 RVA: 0x000B0E24 File Offset: 0x000AF024
51 public override string LangUse
52 {
53 get
54 {
55 return "ActRestrain";
56 }
57 }
58
59 // Token: 0x06001F04 RID: 7940 RVA: 0x000B0E2B File Offset: 0x000AF02B
60 public override void TrySetHeldAct(ActPlan p)
61 {
62 p.TrySetAct(new ActRestrain
63 {
64 shackle = this
65 }, p.pos.FirstChara);
66 }
67
68 // Token: 0x06001F05 RID: 7941 RVA: 0x000B0E4B File Offset: 0x000AF04B
69 public override bool OnUse(Chara c)
70 {
71 c.MoveImmediate(this.owner.pos, true, true);
72 new ActRestrain
73 {
74 shackle = this
75 }.Perform(c, c, c.pos);
76 return true;
77 }
78
79 // Token: 0x06001F06 RID: 7942 RVA: 0x000B0E7B File Offset: 0x000AF07B
80 public void Restrain(Card tc, bool msg = false)
81 {
82 tc.isRestrained = true;
83 this.owner.c_uidRefCard = tc.uid;
84 if (msg)
85 {
86 tc.Say("restrained", tc, null, null);
87 }
88 }
89
90 // Token: 0x06001F07 RID: 7943 RVA: 0x000B0EA8 File Offset: 0x000AF0A8
91 public bool IsRestraining()
92 {
93 foreach (Chara chara in this.owner.pos.Charas)
94 {
95 if (chara.isRestrained && this.owner.c_uidRefCard == chara.uid)
96 {
97 return true;
98 }
99 }
100 foreach (Chara chara2 in EClass._map.charas)
101 {
102 if (chara2.isChara && chara2.isRestrained && chara2.pos.Equals(this.owner.pos))
103 {
104 this.owner.c_uidRefCard = chara2.uid;
105 return true;
106 }
107 }
108 return false;
109 }
110}
Definition Card.cs:13
Definition Chara.cs:12
Definition Thing.cs:10
Definition Trait.cs:9