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

Public Types

enum  Type { None , Light , Effect , QuestBoard }
 
enum  Hack { None , Candle }
 

Public Member Functions

override void OnDraw (ref Vector3 pos)
 
override void OnSetOwner ()
 
void RefreshColor ()
 
- 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

Type type
 
Hack hack
 
Vector3 fixPos
 
Vector3 heldPos
 
Vector3 heldPosFlip
 
float flipFixX
 
bool flipSR
 
bool flipSelf
 
bool onlyInstalled = true
 
bool useOffsetBack = true
 
bool alwaysFlip
 
bool flipBack
 
bool colorParticle
 
SpriteRenderer sr
 
Transform[] listTrans
 
Vector3[] dirPos
 
- Public Attributes inherited from TC
CardRenderer render
 

Properties

override Vector3 FixPos [get]
 
- 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]
 

Private Member Functions

void Awake ()
 

Private Attributes

SourceMaterial.Row _mat
 
Vector3 v
 
Vector3 originalScale
 
Vector3 originalAngle
 

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
 

Detailed Description

Definition at line 3 of file TCExtra.cs.

Member Enumeration Documentation

◆ Hack

Enumerator
None 
Candle 

Definition at line 13 of file TCExtra.cs.

14 {
15 None,
16 Candle
17 }

◆ Type

Enumerator
None 
Light 
Effect 
QuestBoard 

Definition at line 5 of file TCExtra.cs.

Member Function Documentation

◆ Awake()

void TCExtra.Awake ( )
inlineprivate

Definition at line 61 of file TCExtra.cs.

62 {
63 originalScale = base.transform.localScale;
64 originalAngle = base.transform.localEulerAngles;
65 }
Vector3 originalScale
Definition: TCExtra.cs:55
Vector3 originalAngle
Definition: TCExtra.cs:57

References originalAngle, and originalScale.

◆ OnDraw()

override void TCExtra.OnDraw ( ref Vector3  pos)
inlinevirtual

Reimplemented from TC.

Definition at line 67 of file TCExtra.cs.

68 {
69 if (_mat != base.owner.material)
70 {
71 _mat = base.owner.material;
73 }
74 RenderData data = base.owner.renderer.data;
75 bool flag = base.owner.dir == 2 || base.owner.dir == 3;
76 bool flag2 = base.owner.parent is Chara && (base.owner.parent as Chara).held == base.owner;
77 bool flag3 = base.owner.dir % 2 == 1;
78 bool flag4 = (alwaysFlip || !flag2) && flag3;
79 if (flag && flipBack)
80 {
81 flag4 = !flag4;
82 }
83 bool flag5 = useOffsetBack && data.useOffsetBack && flag;
84 if (base.owner.renderer.hasActor && base.owner.isChara)
85 {
86 v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x);
87 v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y);
88 v.z = base.owner.renderer.position.z + (flag5 ? data.offsetBack.z : data.offset.z) + FixPos.z + (flag2 ? (-0.5f) : 0f) + ((!flag2) ? 0f : (flag3 ? heldPosFlip.z : heldPos.z));
89 }
90 else if (dirPos.Length == 0)
91 {
92 v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x) * (float)((!flag4) ? 1 : (-1)) + FixPos.x + flipFixX * (float)((!flag4) ? 1 : (-1)) + ((!flag2) ? 0f : (flag3 ? heldPosFlip.x : heldPos.x));
93 v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y) + FixPos.y + ((!flag2) ? 0f : (flag3 ? heldPosFlip.y : heldPos.y));
94 v.z = base.owner.renderer.position.z + (flag5 ? data.offsetBack.z : data.offset.z) + FixPos.z + (flag2 ? (-0.5f) : 0f) + ((!flag2) ? 0f : (flag3 ? heldPosFlip.z : heldPos.z));
95 }
96 else
97 {
98 v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x) + dirPos[base.owner.dir % dirPos.Length].x + ((!flag2) ? 0f : (flag3 ? heldPosFlip.x : heldPos.x));
99 v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y) + dirPos[base.owner.dir % dirPos.Length].y + ((!flag2) ? 0f : (flag3 ? heldPosFlip.y : heldPos.y));
100 v.z = base.owner.renderer.position.z + (flag5 ? data.offsetBack.z : data.offset.z) + dirPos[base.owner.dir % dirPos.Length].z + (flag2 ? (-0.5f) : 0f) + ((!flag2) ? 0f : (flag3 ? heldPosFlip.z : heldPos.z));
101 }
102 base.transform.position = v;
103 if (flipSR && sr.flipX != flag4)
104 {
105 sr.flipX = flag4;
106 }
107 if (flipSelf)
108 {
109 base.transform.localScale = (flag4 ? new Vector3(originalScale.x * -1f, originalScale.y, originalScale.z) : originalScale);
110 base.transform.localEulerAngles = (flag4 ? new Vector3(originalAngle.x * -1f, originalAngle.y, originalAngle.z) : originalAngle);
111 }
112 bool flag6 = (!onlyInstalled || base.owner.IsInstalled || base.owner.isRoofItem) && base.owner.trait.UseExtra;
113 switch (type)
114 {
115 case Type.QuestBoard:
116 flag6 = false;
117 foreach (Quest global in EMono.game.quests.globalList)
118 {
119 if (global.IsVisibleOnQuestBoard() && global.isNew)
120 {
121 flag6 = true;
122 }
123 }
124 break;
125 case Type.Effect:
126 if (flag6)
127 {
128 TraitEffect traitEffect = base.owner.trait as TraitEffect;
129 if (traitEffect.timer < Time.realtimeSinceStartup)
130 {
131 traitEffect.timer = Time.realtimeSinceStartup - Time.realtimeSinceStartup % traitEffect.Interval + traitEffect.Interval + traitEffect.data.delay;
132 traitEffect.Proc(v);
133 }
134 }
135 break;
136 }
137 if (hack == Hack.Candle)
138 {
139 Transform[] array = listTrans;
140 foreach (Transform transform in array)
141 {
142 if (flag4)
143 {
144 if (transform.localPosition.z > 0f)
145 {
146 transform.localPosition = transform.localPosition.SetZ(0f - transform.localPosition.z);
147 }
148 }
149 else if (transform.localPosition.z < 0f)
150 {
151 transform.localPosition = transform.localPosition.SetZ(0f - transform.localPosition.z);
152 }
153 }
154 }
155 if (base.owner.isHidden && base.owner.isChara && !EMono.pc.CanSee(base.owner.Chara))
156 {
157 flag6 = false;
158 }
159 if (base.gameObject.activeSelf != flag6)
160 {
161 base.gameObject.SetActive(flag6);
162 }
163 }
int dir
Definition: Card.cs:142
Definition: Chara.cs:10
bool CanSee(Card c)
Definition: Chara.cs:1027
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
static Game game
Definition: EMono.cs:7
QuestManager quests
Definition: Game.cs:179
List< Quest > globalList
Definition: QuestManager.cs:14
Definition: Quest.cs:7
bool isNew
Definition: Quest.cs:64
virtual bool IsVisibleOnQuestBoard()
Definition: Quest.cs:292
Vector3 offset
Definition: RenderData.cs:18
SpriteRenderer sr
Definition: TCExtra.cs:45
bool flipSR
Definition: TCExtra.cs:31
bool alwaysFlip
Definition: TCExtra.cs:39
Type type
Definition: TCExtra.cs:19
Vector3 v
Definition: TCExtra.cs:53
bool flipSelf
Definition: TCExtra.cs:33
Vector3 heldPos
Definition: TCExtra.cs:25
Type
Definition: TCExtra.cs:6
Transform[] listTrans
Definition: TCExtra.cs:47
bool onlyInstalled
Definition: TCExtra.cs:35
Vector3[] dirPos
Definition: TCExtra.cs:49
void RefreshColor()
Definition: TCExtra.cs:171
float flipFixX
Definition: TCExtra.cs:29
bool flipBack
Definition: TCExtra.cs:41
override Vector3 FixPos
Definition: TCExtra.cs:59
Hack hack
Definition: TCExtra.cs:21
SourceMaterial.Row _mat
Definition: TCExtra.cs:51
bool useOffsetBack
Definition: TCExtra.cs:37
void Proc(Vector3 v=default(Vector3))
Definition: TraitEffect.cs:76
float timer
Definition: TraitEffect.cs:21

References _mat, alwaysFlip, Chara.CanSee(), TraitEffect.data, TraitEffect.Data.delay, Card.dir, dirPos, FixPos, flipBack, flipFixX, flipSelf, flipSR, EMono.game, QuestManager.globalList, hack, heldPos, Quest.isNew, Quest.IsVisibleOnQuestBoard(), listTrans, RenderData.offset, onlyInstalled, originalAngle, originalScale, EMono.pc, TraitEffect.Proc(), Game.quests, RefreshColor(), sr, TraitEffect.timer, type, useOffsetBack, and v.

◆ OnSetOwner()

override void TCExtra.OnSetOwner ( )
inlinevirtual

Reimplemented from TC.

Definition at line 165 of file TCExtra.cs.

166 {
167 base.OnSetOwner();
168 RefreshColor();
169 }

References RefreshColor().

◆ RefreshColor()

void TCExtra.RefreshColor ( )
inline

Definition at line 171 of file TCExtra.cs.

172 {
173 if ((bool)sr)
174 {
175 Color color = base.owner.trait.ColorExtra ?? Color.white;
176 color.a = sr.color.a;
177 sr.color = color;
178 }
179 if (colorParticle)
180 {
181 ParticleSystem[] componentsInChildren = GetComponentsInChildren<ParticleSystem>();
182 for (int i = 0; i < componentsInChildren.Length; i++)
183 {
184 ParticleSystem.MainModule main = componentsInChildren[i].main;
185 main.startColor = (base.owner.isDyed ? base.owner.DyeMat : base.owner.material).GetColor().SetAlpha(main.startColor.color.a);
186 }
187 }
188 }
bool colorParticle
Definition: TCExtra.cs:43

References Color, colorParticle, and sr.

Referenced by ActPlan._Update(), OnDraw(), and OnSetOwner().

Member Data Documentation

◆ _mat

SourceMaterial.Row TCExtra._mat
private

Definition at line 51 of file TCExtra.cs.

Referenced by OnDraw().

◆ alwaysFlip

bool TCExtra.alwaysFlip

Definition at line 39 of file TCExtra.cs.

Referenced by OnDraw().

◆ colorParticle

bool TCExtra.colorParticle

Definition at line 43 of file TCExtra.cs.

Referenced by RefreshColor().

◆ dirPos

Vector3 [] TCExtra.dirPos

Definition at line 49 of file TCExtra.cs.

Referenced by OnDraw().

◆ fixPos

Vector3 TCExtra.fixPos

Definition at line 23 of file TCExtra.cs.

◆ flipBack

bool TCExtra.flipBack

Definition at line 41 of file TCExtra.cs.

Referenced by OnDraw().

◆ flipFixX

float TCExtra.flipFixX

Definition at line 29 of file TCExtra.cs.

Referenced by OnDraw().

◆ flipSelf

bool TCExtra.flipSelf

Definition at line 33 of file TCExtra.cs.

Referenced by OnDraw().

◆ flipSR

bool TCExtra.flipSR

Definition at line 31 of file TCExtra.cs.

Referenced by OnDraw().

◆ hack

Hack TCExtra.hack

Definition at line 21 of file TCExtra.cs.

Referenced by OnDraw().

◆ heldPos

Vector3 TCExtra.heldPos

Definition at line 25 of file TCExtra.cs.

Referenced by OnDraw().

◆ heldPosFlip

Vector3 TCExtra.heldPosFlip

Definition at line 27 of file TCExtra.cs.

◆ listTrans

Transform [] TCExtra.listTrans

Definition at line 47 of file TCExtra.cs.

Referenced by OnDraw().

◆ onlyInstalled

bool TCExtra.onlyInstalled = true

Definition at line 35 of file TCExtra.cs.

Referenced by OnDraw().

◆ originalAngle

Vector3 TCExtra.originalAngle
private

Definition at line 57 of file TCExtra.cs.

Referenced by Awake(), and OnDraw().

◆ originalScale

Vector3 TCExtra.originalScale
private

Definition at line 55 of file TCExtra.cs.

Referenced by Awake(), and OnDraw().

◆ sr

SpriteRenderer TCExtra.sr

Definition at line 45 of file TCExtra.cs.

Referenced by OnDraw(), and RefreshColor().

◆ type

Type TCExtra.type

Definition at line 19 of file TCExtra.cs.

Referenced by OnDraw().

◆ useOffsetBack

bool TCExtra.useOffsetBack = true

Definition at line 37 of file TCExtra.cs.

Referenced by OnDraw().

◆ v

Vector3 TCExtra.v
private

Definition at line 53 of file TCExtra.cs.

Referenced by OnDraw().

Property Documentation

◆ FixPos

override Vector3 TCExtra.FixPos
get

Definition at line 59 of file TCExtra.cs.

Referenced by OnDraw().


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