Elin Decompiled Documentation EA 23.189 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:59
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:516
bool CanSee(Card c)
Definition: Chara.cs:1200
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 {
72 {
73 emo = Emo2.hintEvent;
74 }
75 else if (owner.isRestocking && (!owner.IsPCParty || EMono._zone.IsPCFaction) && owner.trait.GetRestockedIcon() != 0 && !(EMono._zone is Zone_Dungeon))
76 {
78 }
79 else
80 {
81 bool flag = false;
82 if (owner.quest != null && EMono.game.quests.list.Contains(owner.quest))
83 {
84 flag = true;
85 }
86 else if (owner.IsUnique && !EMono.game.IsSurvival)
87 {
88 string id = owner.id;
89 if (!(id == "ashland"))
90 {
91 if (id == "fiama")
92 {
93 if (EMono.game.quests.GetPhase<QuestMain>() >= 200 && EMono.player.dialogFlags.TryGetValue("fiama1", 0) == 0)
94 {
95 flag = true;
96 }
97 else if (EMono.pc.homeBranch != null)
98 {
99 foreach (Chara member in EMono.pc.homeBranch.members)
100 {
101 if (member.isDead && member.GetInt(100) != 0)
102 {
103 flag = true;
104 break;
105 }
106 }
107 }
108 }
109 }
110 else
111 {
112 int phase = EMono.game.quests.GetPhase<QuestMain>();
113 if ((phase == 0 && EMono.player.dialogFlags.TryGetValue("ash1", 0) == 0) || phase == 200)
114 {
115 flag = true;
116 }
117 }
118 }
119 if (flag)
120 {
121 emo = Emo2.hint;
122 }
123 }
124 }
126 {
128 }
129 showIcon = emo != Emo2.none;
130 if (showIcon)
131 {
132 iconStatus.sprite = EMono.core.refs.spritesEmo[(int)emo];
133 }
134 iconStatus.SetActive(showIcon);
135 float num = (float)owner.hp / (float)owner.MaxHP;
136 showHP = num < 0.9f && (owner.IsPCParty || owner.IsHostile() || (owner.enemy != null && owner.enemy.IsPCParty));
137 if (showHP)
138 {
139 barHP.transform.SetLocalScaleX(Mathf.Max(0f, num));
140 barHP.SetActive(enable: true);
141 bgHP.SetActive(enable: true);
142 }
143 else
144 {
145 barHP.SetActive(enable: false);
146 bgHP.SetActive(enable: false);
147 }
148 if ((bool)barHP2)
149 {
150 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);
151 showHP2 = num2 < 0.9f;
152 if (showHP2)
153 {
154 barHP2.transform.SetLocalScaleX(Mathf.Max(0f, num2));
155 barHP2.SetActive(enable: true);
156 bgHP2.SetActive(enable: true);
157 }
158 else
159 {
160 barHP2.SetActive(enable: false);
161 bgHP2.SetActive(enable: false);
162 }
163 }
164 }
Emo2
Definition: Emo2.cs:2
bool CanGiveCard()
Definition: Affinity.cs:63
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
string id
Definition: Card.cs:33
bool IsUnique
Definition: Card.cs:2053
bool isRestocking
Definition: Card.cs:876
int hp
Definition: Card.cs:228
Trait trait
Definition: Card.cs:51
new TraitChara trait
Definition: Chara.cs:501
AIAct ai
Definition: Chara.cs:200
override bool IsPC
Definition: Chara.cs:610
Chara host
Definition: Chara.cs:33
override bool IsPCParty
Definition: Chara.cs:613
Emo2 emoIcon
Definition: Chara.cs:106
override int MaxHP
Definition: Chara.cs:706
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
Affinity affinity
Definition: Chara.cs:312
Chara enemy
Definition: Chara.cs:86
Quest quest
Definition: Chara.cs:24
FactionBranch homeBranch
Definition: Chara.cs:1052
bool IsHostile()
Definition: Chara.cs:6229
bool isDead
Definition: Chara.cs:387
bool DroppedCard(string id)
Definition: CodexManager.cs:46
List< Sprite > spritesEmo
Definition: CoreRef.cs:375
OrbitIcons orbitIcons
Definition: CoreRef.cs:345
CoreRef refs
Definition: Core.cs:51
static Core core
Definition: EMono.cs:5
static Player player
Definition: EMono.cs:11
static Zone _zone
Definition: EMono.cs:19
static Game game
Definition: EMono.cs:7
List< Chara > members
bool IsSurvival
Definition: Game.cs:272
QuestManager quests
Definition: Game.cs:179
virtual Thing Thing
Definition: HotItem.cs:38
CodexManager codex
Definition: Player.cs:1035
Dictionary< string, int > dialogFlags
Definition: Player.cs:960
HotItem currentHotItem
Definition: Player.cs:1020
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:1474
virtual Emo2 GetHeldEmo(Chara c)
Definition: Trait.cs:627
bool IsPCFaction
Definition: Zone.cs:468

References EMono._zone, Chara.affinity, Chara.ai, barHP, barHP2, bgHP, bgHP2, Affinity.CanGiveCard(), Player.codex, EMono.core, Player.currentHotItem, Player.dialogFlags, CodexManager.DroppedCard(), 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.IsPC, Zone.IsPCFaction, Chara.IsPCParty, Card.isRestocking, Game.IsSurvival, 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: