Elin Decompiled Documentation EA 23.291 Nightly Patch 1
Loading...
Searching...
No Matches
ConTransmuteHuman.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Newtonsoft.Json;
3
5{
6 [JsonProperty]
7 public Chara chara;
8
9 public override Card Card => chara;
10
11 public override bool HasDuration => false;
12
13 public override bool ShouldRevealOnContact => false;
14
15 public override bool ShouldRevealOnPush => false;
16
17 public override bool ShouldRevealOnDamage => (float)EClass.rnd(50) > (float)owner.hp / (float)owner.MaxHP * 100f;
18
19 public override bool ShouldEndMimicry(Act act)
20 {
21 return false;
22 }
23
25 {
27 }
28
29 public override void OnBeforeStart()
30 {
31 List<Chara> list = owner.pos.ListCharasInRadius(owner, 5, delegate(Chara c)
32 {
33 if (c.IsHumanSpeak)
34 {
35 CardRenderer renderer = c.renderer;
36 if (renderer != null && !renderer.hasActor)
37 {
38 return !c.HasElement(1427);
39 }
40 }
41 return false;
42 });
43 if (list.Count > 0)
44 {
45 chara = list.RandomItem().Duplicate();
46 }
47 else
48 {
49 chara = CharaGen.CreateFromFilter("c_guest");
50 }
51 base.OnBeforeStart();
52 }
53}
Definition: ACT.cs:62
Definition: Card.cs:11
string id
Definition: Card.cs:36
int hp
Definition: Card.cs:243
Point pos
Definition: Card.cs:60
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
Definition: Chara.cs:10
bool IsHumanSpeak
Definition: Chara.cs:1029
Chara Duplicate()
Definition: Chara.cs:1817
override bool ShouldRevealOnDamage
override RendererReplacer GetRendererReplacer()
override bool ShouldRevealOnContact
override void OnBeforeStart()
override bool HasDuration
override bool ShouldRevealOnPush
override bool ShouldEndMimicry(Act act)
Definition: EClass.cs:6
static int rnd(long a)
Definition: EClass.cs:59
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220
static RendererReplacer CreateFrom(string id, int shift=0, int mat=-1)