Elin Decompiled Documentation EA 23.199 Nightly
Loading...
Searching...
No Matches
CharaRenderer Class Reference
Inheritance diagram for CharaRenderer:
CardRenderer RenderObject EClass IRenderer ISyncScreen

Public Member Functions

override void SetOwner (Card c)
 
override void OnEnterScreen ()
 
override void Draw (RenderParam p, ref Vector3 v, bool drawShadow)
 
override void NextFrame ()
 
override void UpdatePosition (ref Vector3 destPos, RenderParam p)
 
void DrawHat ()
 
override void DrawHeld ()
 
override void RefreshStateIcon ()
 
override void SetFirst (bool first)
 
override void SetFirst (bool first, Vector3 pos)
 
override void Refresh ()
 
- Public Member Functions inherited from CardRenderer
Vector3 PositionCenter ()
 
virtual void SetOwner (Card c)
 
override void Draw (RenderParam p)
 
override void RenderToRenderCam (RenderParam p)
 
override void Draw (RenderParam p, ref Vector3 v, bool drawShadow)
 
virtual void UpdatePosition (ref Vector3 destPos, RenderParam p)
 
virtual void DrawHeld ()
 
void RefreshSprite ()
 
override void OnEnterScreen ()
 
void AddExtra (string id)
 
void RefreshExtra ()
 
void RemoveExtra (string id)
 
override void OnLeaveScreen ()
 
void KillActor ()
 
void PlayAnime (AnimeID id, bool force)
 
void PlayAnime (AnimeID id, Card dest)
 
void PlayAnime (AnimeID id, Point dest)
 
void PlayAnime (AnimeID id, Vector3 dest=default(Vector3), bool force=false)
 
virtual void KillAnime ()
 
virtual void IdleFrame ()
 
virtual void NextFrame ()
 
virtual void NextDir ()
 
AddTC< T > (TC tc)
 
GetTC< T > ()
 
TC GetTC (string id)
 
GetOrCreateTC< T > (Func< T > func)
 
void RemoveTC< T > ()
 
void RemoveTC (TC tc)
 
void RemoveTC (int index)
 
void TrySpawnOrbit ()
 
bool IsTalking ()
 
TCSimpleText SpawnSimpleText ()
 
void DespawnSimpleText ()
 
void SetCensored (bool enable)
 
virtual void RefreshStateIcon ()
 
void Say (string text, Color c=default(Color), float duration=0f)
 
void ShowEmo (Emo emo, float duration=0f)
 
virtual void SetFirst (bool first, Vector3 pos)
 
virtual void SetFirst (bool first)
 
virtual void Refresh ()
 
SourcePref GetPref ()
 
virtual void OnEnterScreen ()
 
virtual void OnLeaveScreen ()
 
virtual void RenderToRenderCam (RenderParam p)
 
virtual void Draw (RenderParam p)
 
virtual void Draw (RenderParam p, ref Vector3 v, bool drawShadow)
 
void RenderToRenderCam (RenderParam p)
 
void Draw (RenderParam p)
 
void OnEnterScreen ()
 
void OnLeaveScreen ()
 

Public Attributes

new Chara owner
 
Vector3 orgPos
 
bool first = true
 
bool ignoreFirst
 
Point movePoint = new Point()
 
AnimationCurve hopCurve
 
PCCData pccData
 
int step
 
bool isMoving
 
- Public Attributes inherited from CardRenderer
TCOrbit orbit
 
Card owner
 
CardActor actor
 
bool hasActor
 
bool hasText
 
bool isChara
 
bool skip
 
Vector3 position
 
TransAnime anime
 
List< TClistTC = new List<TC>()
 
TCSimpleText simpleText
 
RendererReplacer replacer
 
- Public Attributes inherited from RenderObject
bool usePass
 
bool isSynced
 
long sync
 
RenderData data
 

Static Public Attributes

static int _animeFramePC
 
static int _animeFramePCC
 
static int _animeFrame
 
static bool smoothmove
 
- Static Public Attributes inherited from RenderObject
static float gameDelta
 
static float gameSpeed
 
static float altitudeFix
 
static GameSetting.RenderSetting.AnimeSetting animeSetting
 
static GameSetting.RenderSetting renderSetting
 
static RenderParam shared = new RenderParam()
 
static RenderParam currentParam
 
static Vector3 tempV
 
static bool enableAnime
 
static List< ISyncScreensyncList
 
static long syncFrame
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

int currentDir [get]
 
override bool IsMoving [get]
 
- Properties inherited from CardRenderer
virtual bool IsMoving [get]
 
- Properties inherited from RenderObject
long Sync [get]
 
- Properties inherited from EClass
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 Faction Wilds [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 SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
- Properties inherited from ISyncScreen
long Sync [get]
 

Private Attributes

float moveTimer
 
float nextframeTimer
 
float actTime = 0.3f
 
float lastShadowFix
 
float lastShadowFix2
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Detailed Description

Definition at line 3 of file CharaRenderer.cs.

Member Function Documentation

◆ Draw()

override void CharaRenderer.Draw ( RenderParam  p,
ref Vector3  v,
bool  drawShadow 
)
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 98 of file CharaRenderer.cs.

99 {
100 base.Draw(p, ref v, drawShadow);
101 if ((Zone.sourceHat != null || owner.hat != null) && owner.Pref.hatY != 0f && owner.host == null)
102 {
103 DrawHat();
104 }
105 if (owner.IsPC)
106 {
108 {
109 DrawHeld();
110 }
111 }
112 else if (owner.held != null && !owner.IsDeadOrSleeping && !owner.held.trait.ShowAsTool)
113 {
114 DrawHeld();
115 }
116 }
Trait trait
Definition: Card.cs:51
CardRow hat
Definition: Card.cs:61
new Chara owner
Definition: CharaRenderer.cs:5
override void DrawHeld()
override SourcePref Pref
Definition: Chara.cs:785
Card held
Definition: Chara.cs:70
override bool IsPC
Definition: Chara.cs:610
Chara host
Definition: Chara.cs:33
override bool IsDeadOrSleeping
Definition: Chara.cs:571
static bool disableTool
Definition: HotItemHeld.cs:11
float hatY
Definition: SourcePref.cs:87
virtual bool ShowAsTool
Definition: Trait.cs:334
Definition: Zone.cs:12
static CardRow sourceHat
Definition: Zone.cs:29

References HotItemHeld.disableTool, DrawHat(), DrawHeld(), Card.hat, SourcePref.hatY, Chara.held, Chara.host, Chara.IsDeadOrSleeping, Chara.IsPC, owner, Chara.Pref, Trait.ShowAsTool, Zone.sourceHat, and Card.trait.

◆ DrawHat()

void CharaRenderer.DrawHat ( )
inline

Definition at line 311 of file CharaRenderer.cs.

312 {
313 if (pccData != null)
314 {
316 {
317 return;
318 }
319 }
320 else if (owner.conSleep != null && owner.host == null && owner.pos.Equals(EClass.pc.pos) && owner.IsHuman && owner.GetBool(123))
321 {
322 return;
323 }
324 CardRow cardRow = Zone.sourceHat ?? owner.hat;
325 SourcePref pref = GetPref();
326 bool flag = currentDir == 1 || currentDir == 3;
327 int liquidLv = RenderObject.currentParam.liquidLv;
328 float num = ((replacer != null) ? replacer.pref.hatY : pref.hatY);
329 if (pccData != null)
330 {
331 num += RenderObject.renderSetting.hatPos[actor.GetFrame()].y;
332 }
333 RenderObject.currentParam.liquidLv = 0;
334 RenderObject.currentParam.x += 0.01f * (float)pref.equipX;
335 RenderObject.currentParam.y += num + 0.01f * (float)(pref.equipY + cardRow.pref.equipY);
336 RenderObject.currentParam.z -= pref.hatY;
337 RenderObject.currentParam.tile = cardRow._tiles[owner.uid % cardRow._tiles.Length] * ((!flag) ? 1 : (-1));
338 RenderObject.currentParam.mat = cardRow.DefaultMaterial;
339 RenderObject.currentParam.matColor = cardRow.GetColorInt(RenderObject.currentParam.mat);
341 RenderObject.currentParam.x -= 0.01f * (float)pref.equipX;
342 RenderObject.currentParam.y -= num + 0.01f * (float)(pref.equipY + cardRow.pref.equipY);
343 RenderObject.currentParam.z += pref.hatY;
344 RenderObject.currentParam.liquidLv = liquidLv;
345 }
bool GetBool(int id)
Definition: BaseCard.cs:15
virtual int GetFrame()
Definition: CardActor.cs:98
SourcePref GetPref()
RendererReplacer replacer
Definition: CardRenderer.cs:29
CardActor actor
Definition: CardRenderer.cs:11
Point pos
Definition: Card.cs:57
PCCData pccData
bool IsHuman
Definition: Chara.cs:877
ConSleep conSleep
Definition: Chara.cs:102
Definition: EClass.cs:5
static Chara pc
Definition: EClass.cs:14
bool Equals(int _x, int _z)
Definition: Point.cs:944
void Draw(RenderParam p, int tile)
Definition: RenderData.cs:128
static RenderParam currentParam
Definition: RenderObject.cs:18
static GameSetting.RenderSetting renderSetting
Definition: RenderObject.cs:14
SourceMaterial.Row mat
Definition: RenderParam.cs:17
int liquidLv
Definition: RenderParam.cs:7
int GetColorInt(SourceMaterial.Row mat)
Definition: RenderRow.cs:424
RenderData renderData
Definition: RenderRow.cs:71
SourcePref pref
Definition: RenderRow.cs:68
int[] _tiles
Definition: RenderRow.cs:12
SourceMaterial.Row DefaultMaterial
Definition: RenderRow.cs:86

References RenderRow._tiles, CardRenderer.actor, Chara.conSleep, currentDir, RenderObject.currentParam, RenderRow.DefaultMaterial, RenderData.Draw(), Point.Equals(), SourcePref.equipX, SourcePref.equipY, BaseCard.GetBool(), RenderRow.GetColorInt(), CardActor.GetFrame(), CardRenderer.GetPref(), Card.hat, SourcePref.hatY, Chara.host, Chara.IsDeadOrSleeping, Chara.IsHuman, RenderParam.liquidLv, RenderParam.mat, owner, EClass.pc, pccData, Card.pos, RendererReplacer.pref, RenderRow.pref, RenderRow.renderData, RenderObject.renderSetting, CardRenderer.replacer, and MeshPassParam.y.

Referenced by Draw().

◆ DrawHeld()

override void CharaRenderer.DrawHeld ( )
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 347 of file CharaRenderer.cs.

348 {
349 Card held = owner.held;
350 int num = currentDir;
351 RenderData renderData = held.renderer.data;
352 SourcePref pref = held.Pref;
353 bool flag = num == 1 || num == 3;
354 if (held.isChara)
355 {
356 Vector3[] array = (EClass.player.altHeldPos ? RenderObject.renderSetting.heldPosChara2 : RenderObject.renderSetting.heldPosChara);
357 RenderObject.currentParam.x += array[num].x;
358 RenderObject.currentParam.y += array[num].y;
359 RenderObject.currentParam.z += array[num].z + data.offset.z - renderData.offset.z;
361 {
362 held.SetDir((owner.dir == 0) ? 2 : ((owner.dir == 1) ? 1 : ((owner.dir != 2) ? 3 : 0)));
363 }
364 else
365 {
366 held.SetDir((owner.dir == 0) ? 2 : owner.dir);
367 }
368 }
369 else
370 {
371 Vector3[] heldPos = RenderObject.renderSetting.heldPos;
372 if (hasActor)
373 {
374 RenderObject.currentParam.x += heldPos[num].x;
375 RenderObject.currentParam.y += heldPos[num].y + 0.02f * (float)(actor.GetFrame() % 2);
376 RenderObject.currentParam.z += heldPos[num].z + data.offset.z - renderData.offset.z;
377 }
378 else
379 {
380 RenderObject.currentParam.x += heldPos[4].x;
381 RenderObject.currentParam.y += heldPos[4].y;
382 RenderObject.currentParam.z += heldPos[4].z + data.offset.z - renderData.offset.z;
383 }
384 if (held.trait.NoHeldDir || !held.sourceCard.ContainsTag("noHeldDir"))
385 {
386 held.dir = (owner.flipX ? 1 : 0);
387 }
388 }
389 if (!owner.Cell.sourceSurface.tileType.IsDeepWater)
390 {
391 int liquidLv = RenderObject.currentParam.liquidLv;
392 if (held.isChara)
393 {
394 RenderObject.currentParam.liquidLv = 0;
395 }
397 RenderObject.currentParam.x += renderData.heldPos.x - renderData.offset.x + (flag ? 0.01f : (-0.01f)) * (float)pref.equipX;
398 RenderObject.currentParam.y += renderData.heldPos.y - renderData.offset.y + 0.01f * (float)pref.equipY;
399 RenderObject.currentParam.z += renderData.heldPos.z;
400 RenderObject.tempV.x = RenderObject.currentParam.x;
401 RenderObject.tempV.y = RenderObject.currentParam.y;
402 RenderObject.tempV.z = RenderObject.currentParam.z;
403 held.renderer.Draw(RenderObject.currentParam, ref RenderObject.tempV, drawShadow: false);
404 RenderObject.currentParam.liquidLv = liquidLv;
405 }
406 }
override void Draw(RenderParam p)
Definition: CardRenderer.cs:53
Definition: Card.cs:11
virtual void SetDir(int d)
Definition: Card.cs:5995
virtual SourcePref Pref
Definition: Card.cs:2069
virtual void SetRenderParam(RenderParam p)
Definition: Card.cs:5786
virtual bool isChara
Definition: Card.cs:2045
Cell Cell
Definition: Card.cs:2017
int dir
Definition: Card.cs:144
virtual CardRow sourceCard
Definition: Card.cs:2093
CardRenderer renderer
Definition: Card.cs:59
SourceFloor.Row sourceSurface
Definition: Cell.cs:1059
static Player player
Definition: EClass.cs:12
bool altHeldPos
Definition: Player.cs:1109
Vector3 offset
Definition: RenderData.cs:18
Vector3 heldPos
Definition: RenderData.cs:24
static Vector3 tempV
Definition: RenderObject.cs:20
RenderData data
Definition: RenderObject.cs:34
bool ContainsTag(string _tag)
Definition: RenderRow.cs:148
virtual bool NoHeldDir
Definition: Trait.cs:350

References CardRenderer.actor, Player.altHeldPos, Card.Cell, RenderRow.ContainsTag(), currentDir, RenderObject.currentParam, RenderObject.data, Card.dir, CardRenderer.Draw(), SourcePref.equipX, SourcePref.equipY, CardActor.GetFrame(), CardRenderer.hasActor, Chara.held, RenderData.heldPos, Card.isChara, RenderParam.liquidLv, Trait.NoHeldDir, RenderData.offset, owner, EClass.player, Card.Pref, Card.renderer, RenderObject.renderSetting, Card.SetDir(), Card.SetRenderParam(), Card.sourceCard, Cell.sourceSurface, RenderObject.tempV, Card.trait, MeshPassParam.x, SourcePref.x, MeshPassParam.y, and MeshPassParam.z.

Referenced by Draw().

◆ NextFrame()

override void CharaRenderer.NextFrame ( )
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 118 of file CharaRenderer.cs.

119 {
120 base.NextFrame();
121 owner.idleTimer = RenderObject.animeSetting.idleTime;
122 }
static GameSetting.RenderSetting.AnimeSetting animeSetting
Definition: RenderObject.cs:12

References RenderObject.animeSetting.

◆ OnEnterScreen()

override void CharaRenderer.OnEnterScreen ( )
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 83 of file CharaRenderer.cs.

84 {
85 base.OnEnterScreen();
86 if (!ignoreFirst)
87 {
88 first = true;
89 }
90 ignoreFirst = false;
91 nextframeTimer = 0f;
93 {
94 EClass.player.enemySpotted = true;
95 }
96 }
bool ExistsOnMap
Definition: Card.cs:2047
float nextframeTimer
bool CanSeeLos(Card c, int dist=-1)
Definition: Chara.cs:1232
bool IsHostile()
Definition: Chara.cs:6298
new GameConfig game
Definition: CoreConfig.cs:604
CoreConfig config
Definition: Core.cs:70
static Core core
Definition: EClass.cs:6
static Zone _zone
Definition: EClass.cs:20
virtual bool IsRegion
Definition: Spatial.cs:503

References EClass._zone, Chara.CanSeeLos(), Core.config, EClass.core, Card.ExistsOnMap, first, CoreConfig.game, CoreConfig.GameConfig.haltOnSpotEnemy, ignoreFirst, Chara.IsHostile(), Spatial.IsRegion, nextframeTimer, owner, and EClass.pc.

◆ Refresh()

override void CharaRenderer.Refresh ( )
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 452 of file CharaRenderer.cs.

453 {
454 }

◆ RefreshStateIcon()

override void CharaRenderer.RefreshStateIcon ( )
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 408 of file CharaRenderer.cs.

409 {
410 if (!isSynced)
411 {
412 return;
413 }
414 TCState tCState = GetTC<TCState>();
415 MultiSprite stateIcon = owner.ai.GetStateIcon();
416 if (stateIcon == null)
417 {
418 if ((bool)tCState)
419 {
420 RemoveTC(tCState);
421 }
422 return;
423 }
424 if (!tCState)
425 {
426 tCState = AddTC<TCState>(PoolManager.Spawn(EClass.core.refs.tcs.state));
427 }
428 tCState.SetSprite(stateIcon);
429 }
override MultiSprite GetStateIcon()
Definition: AIAct.cs:129
void RemoveTC(TC tc)
AIAct ai
Definition: Chara.cs:200
TCState state
Definition: CoreRef.cs:240
TCs tcs
Definition: CoreRef.cs:353
CoreRef refs
Definition: Core.cs:51
static Transform Spawn(string id, string path, Transform parent)
Definition: PoolManager.cs:86
void SetSprite(MultiSprite _sprites)
Definition: TCState.cs:13

References Chara.ai, EClass.core, AIAct.GetStateIcon(), RenderObject.isSynced, owner, Core.refs, CardRenderer.RemoveTC(), TCState.SetSprite(), PoolManager.Spawn(), CoreRef.TCs.state, and CoreRef.tcs.

◆ SetFirst() [1/2]

override void CharaRenderer.SetFirst ( bool  first)
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 431 of file CharaRenderer.cs.

432 {
433 this.first = first;
435 }

References first, and ignoreFirst.

◆ SetFirst() [2/2]

override void CharaRenderer.SetFirst ( bool  first,
Vector3  pos 
)
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 437 of file CharaRenderer.cs.

438 {
439 this.first = first;
441 position = pos;
442 if (owner.IsPC)
443 {
444 EClass.player.position = position;
445 }
447 step = 9999999;
448 isMoving = false;
449 moveTimer = 0f;
450 }
Vector3 position
Definition: CardRenderer.cs:21
Point Set(int _x, int _z)
Definition: Point.cs:491

References first, ignoreFirst, isMoving, Chara.IsPC, movePoint, moveTimer, owner, Card.pos, CardRenderer.position, Point.Set(), and step.

◆ SetOwner()

override void CharaRenderer.SetOwner ( Card  c)
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 59 of file CharaRenderer.cs.

60 {
61 owner = c as Chara;
62 owner.spriteReplacer = null;
63 if (pccData != null)
64 {
65 data = ((pccData.GetBodySet2().id == "unique") ? EClass.core.refs.renderers.pcc_L : EClass.core.refs.renderers.pcc);
66 }
67 else if (replacer == null && !owner.c_idSpriteReplacer.IsEmpty())
68 {
70 if (spriteReplacer != null)
71 {
72 data = ResourceCache.Load<RenderData>("Scene/Render/Data/chara_custom_" + ((spriteReplacer.data.GetSprite().texture.height <= 128) ? "128" : "256"));
73 owner.spriteReplacer = spriteReplacer;
74 }
75 }
76 if (owner.source.moveAnime == "hop")
77 {
79 }
80 base.SetOwner(c);
81 }
string c_idSpriteReplacer
Definition: Card.cs:1531
AnimationCurve hopCurve
Definition: Chara.cs:10
SourceChara.Row source
Definition: Chara.cs:156
RenderData pcc_L
Definition: CoreRef.cs:300
RenderData pcc
Definition: CoreRef.cs:298
Renderers renderers
Definition: CoreRef.cs:357
static GameSetting setting
Definition: EClass.cs:34
RenderSetting render
Definition: GameSetting.cs:301
Sprite GetSprite(bool snow=false)
Definition: SpriteData.cs:67
SpriteData data
static Dictionary< string, SpriteReplacer > dictSkins

References GameSetting.RenderSetting.anime, Card.c_idSpriteReplacer, EClass.core, RenderObject.data, SpriteReplacer.data, SpriteReplacer.dictSkins, SpriteData.GetSprite(), GameSetting.RenderSetting.AnimeSetting.hop, hopCurve, owner, CoreRef.Renderers.pcc, CoreRef.Renderers.pcc_L, pccData, Core.refs, GameSetting.render, CoreRef.renderers, CardRenderer.replacer, EClass.setting, and Chara.source.

Referenced by Chara._CreateRenderer().

◆ UpdatePosition()

override void CharaRenderer.UpdatePosition ( ref Vector3  destPos,
RenderParam  p 
)
inlinevirtual

Reimplemented from CardRenderer.

Definition at line 124 of file CharaRenderer.cs.

125 {
126 bool isPC = owner.IsPC;
127 int num = (isPC ? _animeFramePC : ((pccData != null) ? _animeFramePCC : _animeFrame));
128 bool flag = isPC || num >= 10;
129 if (num == 0 || Scene.skipAnime || first || !data.animate || (owner.IsDeadOrSleeping && pccData != null && !owner.IsPC))
130 {
131 first = false;
132 position = destPos;
133 if (isPC)
134 {
135 EClass.player.position = position;
136 }
138 step = 9999999;
139 isMoving = false;
140 moveTimer = 0f;
142 p.x = position.x;
143 p.y = position.y;
144 p.z = position.z;
146 return;
147 }
149 {
150 if (RenderObject.gameSpeed > 1f)
151 {
152 p.shadowFix = (lastShadowFix = 0f);
153 }
154 else
155 {
156 p.shadowFix = (lastShadowFix = lastShadowFix2);
157 }
162 step = 1;
163 if (!isMoving)
164 {
165 isMoving = true;
166 nextframeTimer = (RenderObject.animeSetting.nextFrameInterval + actTime / 4f) / 2f;
167 }
168 moveTimer = 0f;
169 }
170 if (num < 100)
171 {
172 num = (int)((float)num / 0.3f * actTime);
173 }
174 float num2 = (actTime + ((!isPC && owner.IsPCParty) ? RenderObject.animeSetting.animeExtraTimeParty : RenderObject.animeSetting.animeExtraTime) * RenderObject.gameSpeed) / (float)num;
176 if (step >= num)
177 {
178 if (position == destPos)
179 {
180 if (isMoving && isPC)
181 {
182 EClass.player.position = position;
183 }
184 isMoving = false;
185 moveTimer = 0f;
186 }
187 else if (!flag)
188 {
189 position = destPos;
190 }
191 else if (moveTimer >= num2)
192 {
193 int num3 = (int)(moveTimer / num2);
194 moveTimer -= (float)num3 * num2;
195 if (Vector3.Distance(position, destPos) < RenderObject.animeSetting.destRadius)
196 {
197 position = destPos;
198 if (isMoving && isPC)
199 {
200 EClass.player.position = position;
201 }
202 isMoving = false;
203 }
204 else
205 {
206 position.z = destPos.z;
207 Vector3 vector = Vector3.MoveTowards(position, destPos, (float)num3 * RenderObject.animeSetting.slowSpeed / (float)step);
208 position = vector;
209 }
210 }
211 if (owner.idleTimer > 0f)
212 {
213 owner.idleTimer -= RenderObject.gameDelta;
214 if (flag && owner.idleTimer <= 0f)
215 {
216 IdleFrame();
217 nextframeTimer = 0f;
218 }
219 }
220 p.x = position.x;
221 p.y = position.y;
222 p.z = position.z;
224 if (isPC)
225 {
226 CellDetail detail = EClass.pc.Cell.detail;
227 if (detail == null || detail.anime == null)
228 {
229 position.z = destPos.z;
230 Vector3 vector2 = Vector3.MoveTowards(position, destPos, 0.1f);
231 position = vector2;
232 EClass.player.position = Vector3.Lerp(EClass.player.position, position, 0.6f);
233 }
234 }
235 return;
236 }
237 if (moveTimer >= num2)
238 {
239 int num4 = (int)(moveTimer / num2);
240 step += num4;
241 moveTimer -= (float)num4 * num2;
242 if (step >= num)
243 {
244 step = num;
245 }
246 }
247 owner.idleTimer = RenderObject.animeSetting.idleTime;
248 float num5 = (float)step / (float)num;
249 p.shadowFix = p.shadowFix * num5 + lastShadowFix * (1f - num5);
251 Vector3 vector3 = orgPos + (destPos - orgPos) * num5 * ((flag && smoothmove) ? RenderObject.animeSetting.fixedMove : 1f);
252 if (destPos.z < orgPos.z)
253 {
254 vector3.z = orgPos.z + (destPos.z - orgPos.z) * RenderObject.animeSetting.gradientZForward.Evaluate(num5);
255 }
256 else
257 {
258 vector3.z = orgPos.z + (destPos.z - orgPos.z) * RenderObject.animeSetting.gradientZBack.Evaluate(num5);
259 }
260 position = vector3;
261 if (hasActor)
262 {
264 {
265 nextframeTimer += RenderObject.gameDelta * 0.5f;
266 float nextFrameInterval = RenderObject.animeSetting.nextFrameInterval;
267 if (nextframeTimer > nextFrameInterval)
268 {
269 if (owner.ai is AI_Trolley)
270 {
272 }
273 else
274 {
276 }
277 nextframeTimer -= nextFrameInterval;
278 }
279 }
280 else
281 {
283 float num6 = RenderObject.animeSetting.nextFrameInterval + actTime / 4f * (0.5f + RenderObject.gameSpeed / 2f);
284 if (nextframeTimer > num6)
285 {
286 if (owner.ai is AI_Trolley)
287 {
289 }
290 else
291 {
293 }
294 nextframeTimer -= num6;
295 }
296 }
297 }
298 p.x = position.x;
299 p.y = position.y;
300 p.z = position.z;
301 if (isPC)
302 {
303 EClass.player.position = vector3;
304 }
305 else if (!hasActor && num >= 5 && hopCurve != null)
306 {
307 p.y += hopCurve.Evaluate(num5) * RenderObject.animeSetting.hopStrength;
308 }
309 }
virtual void NextFrame()
Definition: CardActor.cs:90
virtual void IdleFrame()
Definition: CardActor.cs:86
void RefreshSprite()
virtual void IdleFrame()
TransAnime anime
Definition: CellDetail.cs:21
CellDetail detail
Definition: Cell.cs:92
static int _animeFramePCC
float lastShadowFix2
Vector3 orgPos
Definition: CharaRenderer.cs:7
static int _animeFramePC
float lastShadowFix
static bool smoothmove
static int _animeFrame
float idleTimer
Definition: Chara.cs:120
override bool IsPCParty
Definition: Chara.cs:613
float actTime
Definition: Chara.cs:176
GraphicSetting graphic
Definition: CoreConfig.cs:602
Vector3 position
Definition: Player.cs:1171
bool animate
Definition: RenderData.cs:34
static float gameDelta
Definition: RenderObject.cs:6
static float gameSpeed
Definition: RenderObject.cs:8
float shadowFix
Definition: RenderParam.cs:21
Definition: Scene.cs:8
static bool skipAnime
Definition: Scene.cs:25

References _animeFrame, _animeFramePC, _animeFramePCC, CardRenderer.actor, Chara.actTime, actTime, Chara.ai, RenderData.animate, CellDetail.anime, RenderObject.animeSetting, Card.Cell, Core.config, EClass.core, RenderObject.data, Cell.detail, Point.Equals(), first, RenderObject.gameDelta, RenderObject.gameSpeed, CoreConfig.graphic, CardRenderer.hasActor, hopCurve, CardActor.IdleFrame(), CardRenderer.IdleFrame(), Chara.idleTimer, Chara.IsDeadOrSleeping, isMoving, Chara.IsPC, Chara.IsPCParty, lastShadowFix, lastShadowFix2, movePoint, moveTimer, CardActor.NextFrame(), nextframeTimer, orgPos, owner, EClass.pc, pccData, EClass.player, Card.pos, CardRenderer.position, Player.position, CardRenderer.RefreshSprite(), Point.Set(), RenderParam.shadowFix, Scene.skipAnime, smoothmove, CoreConfig.GraphicSetting.spriteFrameMode, and step.

Member Data Documentation

◆ _animeFrame

int CharaRenderer._animeFrame
static

Definition at line 37 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ _animeFramePC

int CharaRenderer._animeFramePC
static

Definition at line 33 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ _animeFramePCC

int CharaRenderer._animeFramePCC
static

Definition at line 35 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ actTime

float CharaRenderer.actTime = 0.3f
private

Definition at line 23 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ first

bool CharaRenderer.first = true

Definition at line 13 of file CharaRenderer.cs.

Referenced by OnEnterScreen(), SetFirst(), and UpdatePosition().

◆ hopCurve

AnimationCurve CharaRenderer.hopCurve

Definition at line 19 of file CharaRenderer.cs.

Referenced by SetOwner(), and UpdatePosition().

◆ ignoreFirst

bool CharaRenderer.ignoreFirst

Definition at line 15 of file CharaRenderer.cs.

Referenced by OnEnterScreen(), and SetFirst().

◆ isMoving

bool CharaRenderer.isMoving

Definition at line 31 of file CharaRenderer.cs.

Referenced by SetFirst(), and UpdatePosition().

◆ lastShadowFix

float CharaRenderer.lastShadowFix
private

Definition at line 25 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ lastShadowFix2

float CharaRenderer.lastShadowFix2
private

Definition at line 27 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ movePoint

Point CharaRenderer.movePoint = new Point()

Definition at line 17 of file CharaRenderer.cs.

Referenced by SetFirst(), and UpdatePosition().

◆ moveTimer

float CharaRenderer.moveTimer
private

Definition at line 9 of file CharaRenderer.cs.

Referenced by SetFirst(), and UpdatePosition().

◆ nextframeTimer

float CharaRenderer.nextframeTimer
private

Definition at line 11 of file CharaRenderer.cs.

Referenced by OnEnterScreen(), and UpdatePosition().

◆ orgPos

Vector3 CharaRenderer.orgPos

Definition at line 7 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ owner

new Chara CharaRenderer.owner

◆ pccData

PCCData CharaRenderer.pccData

Definition at line 21 of file CharaRenderer.cs.

Referenced by Chara._CreateRenderer(), DrawHat(), SetOwner(), and UpdatePosition().

◆ smoothmove

bool CharaRenderer.smoothmove
static

Definition at line 39 of file CharaRenderer.cs.

Referenced by UpdatePosition().

◆ step

int CharaRenderer.step

Definition at line 29 of file CharaRenderer.cs.

Referenced by SetFirst(), and UpdatePosition().

Property Documentation

◆ currentDir

int CharaRenderer.currentDir
get

Definition at line 41 of file CharaRenderer.cs.

42 {
43 get
44 {
45 if (!hasActor)
46 {
47 if (!owner.flipX)
48 {
49 return 1;
50 }
51 return 0;
52 }
53 return actor.currentDir;
54 }
55 }
virtual int currentDir
Definition: CardActor.cs:41
override bool flipX
Definition: Chara.cs:545

Referenced by DrawHat(), and DrawHeld().

◆ IsMoving

override bool CharaRenderer.IsMoving
get

Definition at line 57 of file CharaRenderer.cs.


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