Elin Modding Docs Doc
All Classes Namespaces
ActRide.cs
1using System;
2using System.Collections.Generic;
3
4// Token: 0x020001D8 RID: 472
5public class ActRide : Ability
6{
7 // Token: 0x17000362 RID: 866
8 // (get) Token: 0x06000D5E RID: 3422 RVA: 0x00067F07 File Offset: 0x00066107
9 public virtual bool IsParasite
10 {
11 get
12 {
13 return false;
14 }
15 }
16
17 // Token: 0x06000D5F RID: 3423 RVA: 0x00067F0C File Offset: 0x0006610C
18 public override bool Perform()
19 {
20 List<Chara> list = Act.TP.ListCharas();
21 list.Reverse();
22 bool flag = false;
23 foreach (Chara chara in list)
24 {
25 if (chara.host == null && !chara.IsMultisize)
26 {
27 if (chara == Act.CC)
28 {
29 if ((this.IsParasite && Act.CC.parasite != null) || (!this.IsParasite && Act.CC.ride != null))
30 {
31 ActRide.Unride(Act.CC, this.IsParasite);
32 flag = true;
33 break;
34 }
35 }
36 else
37 {
38 if (!chara.trait.CanJoinPartyResident)
39 {
40 Msg.Say("ride_req");
41 return false;
42 }
43 if (EClass.debug.enable || (chara.IsPCFaction && chara.trait.CanJoinParty))
44 {
45 ActRide.Ride(Act.CC, chara, this.IsParasite);
46 flag = true;
47 break;
48 }
49 }
50 }
51 }
52 if (!flag)
53 {
54 Msg.Say("noTargetFound");
55 }
56 return false;
57 }
58
59 // Token: 0x06000D60 RID: 3424 RVA: 0x00068028 File Offset: 0x00066228
60 public static void Ride(Chara host, Chara t, bool parasite = false)
61 {
62 if (parasite)
63 {
64 if (host.parasite != null)
65 {
66 ActRide.Unride(host, true);
67 }
68 host.parasite = t;
69 host.Say("parasite", host, t, null, null);
70 }
71 else
72 {
73 if (host.ride != null)
74 {
75 ActRide.Unride(host, false);
76 }
77 host.ride = t;
78 host.Say("ride", host, t, null, null);
79 }
80 if (!t.IsPCFaction)
81 {
82 t.MakeAlly(true);
83 }
84 EClass.pc.party.AddMemeber(t);
85 if (!parasite)
86 {
87 if (t.race.tag.Contains("ride"))
88 {
89 Msg.Say("ride_good");
90 }
91 if (t.race.tag.Contains("noRide"))
92 {
93 Msg.Say("ride_bad");
94 }
95 if (host.HasElement(1417, 1) && t.HasCondition<ConTransmuteBroom>())
96 {
97 Msg.Say("ride_broom");
98 }
99 }
100 t.host = host;
101 t._CreateRenderer();
102 host.PlaySound("ride", 1f, true);
103 t.Talk(parasite ? "parasite" : "ride", null, null, false);
104 host.SetDirtySpeed();
105 t.SetDirtySpeed();
106 host.SyncRide();
107 t.noMove = false;
108 host.Refresh(false);
109 }
110
111 // Token: 0x06000D61 RID: 3425 RVA: 0x00068164 File Offset: 0x00066364
112 public static void Unride(Chara host, bool parasite = false)
113 {
114 Chara chara;
115 if (parasite)
116 {
117 chara = host.parasite;
118 host.parasite = null;
119 host.Say("parasite_unride", host, chara, null, null);
120 }
121 else
122 {
123 chara = host.ride;
124 host.ride = null;
125 host.Say("ride_unride", host, chara, null, null);
126 }
127 chara.host = null;
128 chara._CreateRenderer();
129 chara.Talk(parasite ? "parasite_unride" : "ride_unride", null, null, true);
130 host.PlaySound("ride", 1f, true);
131 host.SetDirtySpeed();
132 chara.SetDirtySpeed();
133 host.Refresh(false);
134 }
135}
Definition Act.2.cs:7
Definition Chara.cs:12
Definition Msg.cs:7