Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
TCOrbitChara Class Reference
Inheritance diagram for TCOrbitChara:
TCOrbit TC EMono

Public Member Functions

override void OnSetOwner ()
 
override void Refresh ()
 
void RefreshAll ()
 
virtual void Refresh ()
 
- Public Member Functions inherited from TC
void SetOwner (CardRenderer r)
 
virtual void OnSetOwner ()
 
virtual void OnDraw (ref Vector3 pos)
 
void Kill ()
 
virtual void OnKill ()
 

Public Attributes

GameObject goIcon
 
SpriteRenderer iconRelation
 
SpriteRenderer iconStatus
 
SpriteRenderer barHP
 
SpriteRenderer bgHP
 
SpriteRenderer barHP2
 
SpriteRenderer bgHP2
 
new Chara owner
 
- Public Attributes inherited from TC
CardRenderer render
 

Private Attributes

float timer
 
bool showHP
 
bool showIcon
 
bool showHP2
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from TC
static GameSetting.RenderSetting.TCSetting _setting
 
- Static Public Attributes inherited from EMono
static Core core
 
- Properties inherited from TC
Card owner [get]
 
virtual bool isUI [get]
 
virtual Vector3 FixPos [get]
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Detailed Description

Definition at line 3 of file TCOrbitChara.cs.

Member Function Documentation

◆ OnSetOwner()

override void TCOrbitChara.OnSetOwner ( )
inlinevirtual

Reimplemented from TC.

Definition at line 29 of file TCOrbitChara.cs.

30 {
31 owner = base.owner as Chara;
33 goIcon.transform.SetLocalPositionY(data.offset.y + data.size.y + 0.32f);
34 RefreshAll();
35 }
CardRenderer renderer
Definition: Card.cs:57
Definition: Chara.cs:10
Vector3 offset
Definition: RenderData.cs:18
Vector2 size
Definition: RenderData.cs:30
RenderData data
Definition: RenderObject.cs:34
new Chara owner
Definition: TCOrbitChara.cs:19
void RefreshAll()
Definition: TCOrbitChara.cs:59
GameObject goIcon
Definition: TCOrbitChara.cs:5

References RenderObject.data, goIcon, RenderData.offset, owner, RefreshAll(), Card.renderer, and RenderData.size.

◆ Refresh()

override void TCOrbitChara.Refresh ( )
inlinevirtual

Reimplemented from TCOrbit.

Definition at line 37 of file TCOrbitChara.cs.

38 {
39 timer += Time.deltaTime;
40 if (timer > 0.2f)
41 {
42 timer = 0f;
43 RefreshAll();
44 }
45 if ((!owner.isHidden || EMono.pc.CanSee(owner)) && (showHP || showHP2 || showIcon))
46 {
47 if (!base.gameObject.activeSelf)
48 {
49 base.gameObject.SetActive(value: true);
50 }
51 base.transform.position = owner.renderer.position;
52 }
53 else if (base.gameObject.activeSelf)
54 {
55 base.gameObject.SetActive(value: false);
56 }
57 }
Vector3 position
Definition: CardRenderer.cs:21
bool isHidden
Definition: Card.cs:502
bool CanSee(Card c)
Definition: Chara.cs:1027
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13

References Chara.CanSee(), Card.isHidden, owner, EMono.pc, CardRenderer.position, RefreshAll(), Card.renderer, showHP, showHP2, showIcon, and timer.

◆ RefreshAll()

void TCOrbitChara.RefreshAll ( )
inline

Definition at line 59 of file TCOrbitChara.cs.

60 {
61 showHP = (showHP2 = (showIcon = false));
62 if (owner.isDead || owner.host != null)
63 {
64 return;
65 }
66 _ = owner.ai;
68 Emo2 emo = owner.emoIcon;
69 if (emo == Emo2.none)
70 {
71 if (owner.isRestocking && !owner.IsPCParty && owner.trait.GetRestockedIcon() != 0 && !(EMono._zone is Zone_Dungeon))
72 {
74 }
75 else
76 {
77 bool flag = false;
78 if (owner.quest != null && EMono.game.quests.list.Contains(owner.quest))
79 {
80 flag = true;
81 }
82 else if (owner.IsUnique)
83 {
84 string id = owner.id;
85 if (!(id == "ashland"))
86 {
87 if (id == "fiama")
88 {
89 if (EMono.game.quests.GetPhase<QuestMain>() >= 200 && EMono.player.dialogFlags.TryGetValue("fiama1", 0) == 0)
90 {
91 flag = true;
92 }
93 else if (EMono.pc.homeBranch != null)
94 {
95 foreach (Chara member in EMono.pc.homeBranch.members)
96 {
97 if (member.isDead && member.GetInt(100) != 0)
98 {
99 flag = true;
100 break;
101 }
102 }
103 }
104 }
105 }
106 else
107 {
108 int phase = EMono.game.quests.GetPhase<QuestMain>();
109 if ((phase == 0 && EMono.player.dialogFlags.TryGetValue("ash1", 0) == 0) || phase == 200)
110 {
111 flag = true;
112 }
113 }
114 }
115 if (flag)
116 {
117 emo = Emo2.hint;
118 }
119 }
120 }
122 {
124 }
125 showIcon = emo != Emo2.none;
126 if (showIcon)
127 {
128 iconStatus.sprite = EMono.core.refs.spritesEmo[(int)emo];
129 }
130 iconStatus.SetActive(showIcon);
131 float num = (float)owner.hp / (float)owner.MaxHP;
132 showHP = num < 0.9f && (owner.IsPCParty || owner.IsHostile() || (owner.enemy != null && owner.enemy.IsPCParty));
133 if (showHP)
134 {
135 barHP.transform.SetLocalScaleX(Mathf.Max(0f, num));
136 barHP.SetActive(enable: true);
137 bgHP.SetActive(enable: true);
138 }
139 else
140 {
141 barHP.SetActive(enable: false);
142 bgHP.SetActive(enable: false);
143 }
144 if ((bool)barHP2)
145 {
146 float num2 = Mathf.Min(1f, (owner.parasite != null) ? ((float)owner.parasite.hp / (float)owner.parasite.MaxHP) : 1f, (owner.ride != null) ? ((float)owner.ride.hp / (float)owner.ride.MaxHP) : 1f);
147 showHP2 = num2 < 0.9f;
148 if (showHP2)
149 {
150 barHP2.transform.SetLocalScaleX(Mathf.Max(0f, num2));
151 barHP2.SetActive(enable: true);
152 bgHP2.SetActive(enable: true);
153 }
154 else
155 {
156 barHP2.SetActive(enable: false);
157 bgHP2.SetActive(enable: false);
158 }
159 }
160 }
Emo2
Definition: Emo2.cs:2
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
string id
Definition: Card.cs:31
bool IsUnique
Definition: Card.cs:1967
bool isRestocking
Definition: Card.cs:862
int hp
Definition: Card.cs:226
Trait trait
Definition: Card.cs:49
new TraitChara trait
Definition: Chara.cs:488
AIAct ai
Definition: Chara.cs:187
Chara host
Definition: Chara.cs:33
override bool IsPCParty
Definition: Chara.cs:600
Emo2 emoIcon
Definition: Chara.cs:103
override int MaxHP
Definition: Chara.cs:693
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
Chara enemy
Definition: Chara.cs:83
Quest quest
Definition: Chara.cs:24
FactionBranch homeBranch
Definition: Chara.cs:889
bool IsHostile()
Definition: Chara.cs:5884
bool isDead
Definition: Chara.cs:374
List< Sprite > spritesEmo
Definition: CoreRef.cs:361
OrbitIcons orbitIcons
Definition: CoreRef.cs:331
CoreRef refs
Definition: Core.cs:51
static Core core
Definition: EMono.cs:5
static Player player
Definition: EMono.cs:11
static Game game
Definition: EMono.cs:7
List< Chara > members
QuestManager quests
Definition: Game.cs:179
virtual Thing Thing
Definition: HotItem.cs:38
Dictionary< string, int > dialogFlags
Definition: Player.cs:841
HotItem currentHotItem
Definition: Player.cs:901
List< Quest > list
Definition: QuestManager.cs:11
SpriteRenderer iconStatus
Definition: TCOrbitChara.cs:9
SpriteRenderer barHP
Definition: TCOrbitChara.cs:11
SpriteRenderer barHP2
Definition: TCOrbitChara.cs:15
SpriteRenderer bgHP2
Definition: TCOrbitChara.cs:17
SpriteRenderer bgHP
Definition: TCOrbitChara.cs:13
Emo2 GetRestockedIcon()
Definition: Trait.cs:1441
virtual Emo2 GetHeldEmo(Chara c)
Definition: Trait.cs:586

References Chara.ai, barHP, barHP2, bgHP, bgHP2, EMono.core, Player.currentHotItem, Player.dialogFlags, Chara.emoIcon, Chara.enemy, EMono.game, Trait.GetHeldEmo(), BaseCard.GetInt(), Trait.GetRestockedIcon(), Chara.homeBranch, Chara.host, Card.hp, iconStatus, Card.id, Chara.isDead, Chara.IsHostile(), Chara.IsPCParty, Card.isRestocking, Card.IsUnique, QuestManager.list, Chara.MaxHP, FactionBranch.members, CoreRef.orbitIcons, owner, Chara.parasite, EMono.pc, EMono.player, Chara.quest, Game.quests, Core.refs, Chara.ride, showHP, showHP2, showIcon, CoreRef.spritesEmo, HotItem.Thing, Card.trait, and Chara.trait.

Referenced by OnSetOwner(), and Refresh().

Member Data Documentation

◆ barHP

SpriteRenderer TCOrbitChara.barHP

Definition at line 11 of file TCOrbitChara.cs.

Referenced by RefreshAll().

◆ barHP2

SpriteRenderer TCOrbitChara.barHP2

Definition at line 15 of file TCOrbitChara.cs.

Referenced by RefreshAll().

◆ bgHP

SpriteRenderer TCOrbitChara.bgHP

Definition at line 13 of file TCOrbitChara.cs.

Referenced by RefreshAll().

◆ bgHP2

SpriteRenderer TCOrbitChara.bgHP2

Definition at line 17 of file TCOrbitChara.cs.

Referenced by RefreshAll().

◆ goIcon

GameObject TCOrbitChara.goIcon

Definition at line 5 of file TCOrbitChara.cs.

Referenced by OnSetOwner().

◆ iconRelation

SpriteRenderer TCOrbitChara.iconRelation

Definition at line 7 of file TCOrbitChara.cs.

◆ iconStatus

SpriteRenderer TCOrbitChara.iconStatus

Definition at line 9 of file TCOrbitChara.cs.

Referenced by RefreshAll().

◆ owner

new Chara TCOrbitChara.owner

Definition at line 19 of file TCOrbitChara.cs.

Referenced by OnSetOwner(), Refresh(), and RefreshAll().

◆ showHP

bool TCOrbitChara.showHP
private

Definition at line 23 of file TCOrbitChara.cs.

Referenced by Refresh(), and RefreshAll().

◆ showHP2

bool TCOrbitChara.showHP2
private

Definition at line 27 of file TCOrbitChara.cs.

Referenced by Refresh(), and RefreshAll().

◆ showIcon

bool TCOrbitChara.showIcon
private

Definition at line 25 of file TCOrbitChara.cs.

Referenced by Refresh(), and RefreshAll().

◆ timer

float TCOrbitChara.timer
private

Definition at line 21 of file TCOrbitChara.cs.

Referenced by Refresh().


The documentation for this class was generated from the following file: