8 public override void OnSetOwner()
10 this.owner = (base.owner as
Chara);
12 this.goIcon.transform.SetLocalPositionY(data.offset.y + data.size.y + 0.32f);
17 public override void Refresh()
19 this.timer += Time.deltaTime;
20 if (this.timer > 0.2f)
25 if ((!this.owner.isHidden ||
EMono.pc.CanSee(
this.owner)) && (
this.showHP ||
this.showHP2 ||
this.showIcon))
27 if (!base.gameObject.activeSelf)
29 base.gameObject.SetActive(
true);
31 base.transform.position = this.owner.renderer.position;
34 if (base.gameObject.activeSelf)
36 base.gameObject.SetActive(
false);
41 public void RefreshAll()
43 this.showHP = (this.showHP2 = (this.showIcon =
false));
44 if (this.owner.isDead ||
this.owner.host !=
null)
48 AIAct ai = this.owner.ai;
50 Emo2 emo = this.owner.emoIcon;
53 if (this.owner.isRestocking && !
this.owner.IsPCParty &&
this.owner.trait.GetRestockedIcon() != Emo2.none && !(
EMono._zone is
Zone_Dungeon))
55 emo = this.owner.trait.GetRestockedIcon();
57 else if (
EMono.player.currentHotItem.Thing !=
null &&
EMono.player.currentHotItem.Thing.trait.GetHeldEmo(
this.owner) != Emo2.none)
59 emo =
EMono.player.currentHotItem.Thing.trait.GetHeldEmo(this.owner);
64 if (this.owner.quest !=
null &&
EMono.game.quests.list.Contains(
this.owner.quest))
68 else if (this.owner.IsUnique)
70 string id = this.owner.id;
71 if (!(
id ==
"ashland"))
75 if (
EMono.game.quests.GetPhase<
QuestMain>() >= 200 &&
EMono.player.dialogFlags.TryGetValue(
"fiama1", 0) == 0)
79 else if (
EMono.pc.homeBranch !=
null)
81 foreach (
Chara chara
in EMono.pc.homeBranch.members)
83 if (chara.isDead && chara.GetInt(100,
null) != 0)
95 if ((phase == 0 &&
EMono.player.dialogFlags.TryGetValue(
"ash1", 0) == 0) || phase == 200)
107 this.showIcon = (emo > Emo2.none);
110 this.iconStatus.sprite =
EMono.core.refs.spritesEmo[(int)emo];
112 this.iconStatus.SetActive(this.showIcon);
113 float num = (float)this.owner.hp / (
float)this.owner.MaxHP;
114 this.showHP = (num < 0.9f && (this.owner.IsPCParty || this.owner.IsHostile() || (this.owner.enemy !=
null &&
this.owner.enemy.IsPCParty)));
117 this.barHP.transform.SetLocalScaleX(num);
118 this.barHP.SetActive(
true);
119 this.bgHP.SetActive(
true);
123 this.barHP.SetActive(
false);
124 this.bgHP.SetActive(
false);
130 float num2 = Mathf.Min(
new float[]
133 (this.owner.parasite !=
null) ? ((
float)this.owner.parasite.hp / (
float)
this.owner.parasite.MaxHP) : 1f,
134 (this.owner.ride !=
null) ? ((
float)this.owner.ride.hp / (
float)
this.owner.ride.MaxHP) : 1f
136 this.showHP2 = (num2 < 0.9f);
139 this.barHP2.transform.SetLocalScaleX(num2);
140 this.barHP2.SetActive(
true);
141 this.bgHP2.SetActive(
true);
144 this.barHP2.SetActive(
false);
145 this.bgHP2.SetActive(
false);
149 public GameObject goIcon;
152 public SpriteRenderer iconRelation;
155 public SpriteRenderer iconStatus;
158 public SpriteRenderer barHP;
161 public SpriteRenderer bgHP;
164 public SpriteRenderer barHP2;
167 public SpriteRenderer bgHP2;
170 public new Chara owner;
179 private bool showIcon;
182 private bool showHP2;