15 return this.actor.currentDir;
17 if (!this.owner.flipX)
26 public override void SetOwner(
Card c)
28 this.owner = (c as
Chara);
29 if (this.pccData !=
null)
31 this.data = ((this.pccData.GetBodySet2().
id ==
"unique") ?
EClass.core.refs.renderers.pcc_L :
EClass.core.refs.renderers.pcc);
37 public override void OnEnterScreen()
40 if (!this.ignoreFirst)
44 this.ignoreFirst =
false;
45 this.nextframeTimer = 0f;
46 if (this.owner.ExistsOnMap &&
this.owner.IsHostile())
48 EClass.player.enemySpotted =
true;
53 public override void Draw(
RenderParam p, ref Vector3 v,
bool drawShadow)
55 base.Draw(p, ref v, drawShadow);
56 if (
Zone.sourceHat !=
null &&
this.owner.Pref.hatY != 0f &&
this.owner.host ==
null)
62 if (this.owner.held !=
null && !
this.owner.IsDeadOrSleeping && (!
this.owner.held.trait.ShowAsTool ||
HotItemHeld.disableTool))
68 else if (this.owner.held !=
null && !
this.owner.IsDeadOrSleeping && !
this.owner.held.trait.ShowAsTool)
75 public override void NextFrame()
78 this.owner.idleTimer =
RenderObject.animeSetting.idleTime;
83 public override bool IsMoving
92 public override void UpdatePosition(ref Vector3 destPos,
RenderParam p)
94 bool isPC = this.owner.IsPC;
95 int num = isPC ? CharaRenderer._animeFramePC : (this.hasActor ? CharaRenderer._animeFramePCC :
CharaRenderer._animeFrame);
96 bool flag = isPC || num >= 10;
97 if (num == 0 ||
Scene.skipAnime ||
this.first || !
this.data.animate || (
this.owner.IsDeadOrSleeping &&
this.pccData !=
null && !
this.owner.IsPC))
100 this.position = destPos;
103 EClass.player.position = this.position;
105 this.movePoint.Set(this.owner.pos);
107 this.isMoving =
false;
109 base.RefreshSprite();
110 p.x = this.position.x;
111 p.y = this.position.y;
112 p.z = this.position.z;
113 this.lastShadowFix = (this.lastShadowFix2 = p.shadowFix);
116 if (!this.owner.pos.Equals(
this.movePoint))
120 p.shadowFix = (this.lastShadowFix = 0f);
124 p.shadowFix = (this.lastShadowFix = this.lastShadowFix2);
126 this.movePoint.Set(this.owner.pos);
127 this.orgPos = this.position;
128 this.actTime = this.owner.actTime;
129 base.RefreshSprite();
133 this.isMoving =
true;
134 this.nextframeTimer = (RenderObject.animeSetting.nextFrameInterval + this.actTime / 4f) / 2f;
140 num = (int)((
float)num / 0.3f * this.actTime);
142 float num2 = (this.actTime + ((!isPC && this.owner.IsPCParty) ? RenderObject.animeSetting.animeExtraTimeParty :
RenderObject.animeSetting.animeExtraTime) *
RenderObject.gameSpeed) / (
float)num;
144 if (this.step >= num)
146 if (this.position == destPos)
148 if (this.isMoving && isPC)
150 EClass.player.position = this.position;
152 this.isMoving =
false;
157 this.position = destPos;
159 else if (this.moveTimer >= num2)
161 int num3 = (int)(this.moveTimer / num2);
162 this.moveTimer -= (float)num3 * num2;
163 if (Vector3.Distance(
this.position, destPos) <
RenderObject.animeSetting.destRadius)
165 this.position = destPos;
166 if (this.isMoving && isPC)
168 EClass.player.position = this.position;
170 this.isMoving =
false;
174 this.position.z = destPos.z;
175 Vector3 position = Vector3.MoveTowards(this.position, destPos, (
float)num3 *
RenderObject.animeSetting.slowSpeed / (
float)
this.step);
176 this.position = position;
179 if (this.owner.idleTimer > 0f)
182 if (flag && this.owner.idleTimer <= 0f)
185 this.nextframeTimer = 0f;
188 p.x = this.position.x;
189 p.y = this.position.y;
190 p.z = this.position.z;
191 this.lastShadowFix = (this.lastShadowFix2 = p.shadowFix);
195 if (detail ==
null || detail.anime ==
null)
197 this.position.z = destPos.z;
198 Vector3 position2 = Vector3.MoveTowards(this.position, destPos, 0.1f);
199 this.position = position2;
200 EClass.player.position = Vector3.Lerp(
EClass.player.position,
this.position, 0.6f);
205 if (this.moveTimer >= num2)
207 int num4 = (int)(this.moveTimer / num2);
209 this.moveTimer -= (float)num4 * num2;
210 if (this.step >= num)
215 this.owner.idleTimer =
RenderObject.animeSetting.idleTime;
216 float num5 = (float)this.step / (
float)num;
217 p.shadowFix = p.shadowFix * num5 + this.lastShadowFix * (1f - num5);
218 this.lastShadowFix2 = p.shadowFix;
219 Vector3 position3 = this.orgPos + (destPos - this.orgPos) * num5 * ((flag &&
CharaRenderer.smoothmove) ?
RenderObject.animeSetting.fixedMove : 1f);
220 if (destPos.z <
this.orgPos.z)
222 position3.z = this.orgPos.z + (destPos.z - this.orgPos.z) *
RenderObject.animeSetting.gradientZForward.Evaluate(num5);
226 position3.z = this.orgPos.z + (destPos.z - this.orgPos.z) *
RenderObject.animeSetting.gradientZBack.Evaluate(num5);
228 this.position = position3;
231 if (
EClass.core.config.graphic.spriteFrameMode == 0)
233 this.nextframeTimer += RenderObject.gameDelta * 0.5f;
234 float nextFrameInterval =
RenderObject.animeSetting.nextFrameInterval;
235 if (this.nextframeTimer > nextFrameInterval)
239 this.actor.IdleFrame();
243 this.actor.NextFrame();
245 this.nextframeTimer -= nextFrameInterval;
251 float num6 = RenderObject.animeSetting.nextFrameInterval + this.actTime / 4f * (0.5f + RenderObject.gameSpeed / 2f);
252 if (this.nextframeTimer > num6)
256 this.actor.IdleFrame();
260 this.actor.NextFrame();
262 this.nextframeTimer -= num6;
266 p.x = this.position.x;
267 p.y = this.position.y;
268 p.z = this.position.z;
271 EClass.player.position = position3;
274 if (!this.hasActor && num >= 5 && this.hopCurve !=
null)
276 p.y += this.hopCurve.Evaluate(num5) *
RenderObject.animeSetting.hopStrength;
281 public void DrawHat()
283 if (this.pccData !=
null && this.owner.IsDeadOrSleeping)
289 bool flag = this.currentDir == 1 || this.currentDir == 3;
291 float num = (this.replacer !=
null) ? this.replacer.pref.hatY : this.owner.Pref.hatY;
292 if (this.pccData !=
null)
294 num +=
RenderObject.renderSetting.hatPos[this.actor.GetFrame()].y;
296 RenderObject.currentParam.liquidLv = 0;
297 RenderObject.currentParam.y += num;
298 RenderObject.currentParam.tile = (float)(sourceHat._tiles[
this.owner.uid % sourceHat._tiles.Length] * (flag ? -1 : 1));
300 RenderObject.currentParam.y -= num;
301 RenderObject.currentParam.liquidLv = liquidLv;
305 public override void DrawHeld()
307 int currentDir = this.currentDir;
308 RenderData data = this.owner.held.renderer.data;
310 bool flag = currentDir == 1 || currentDir == 3;
311 if (this.owner.held.isChara)
313 Vector3[] array = EClass.player.altHeldPos ? RenderObject.renderSetting.heldPosChara2 :
RenderObject.renderSetting.heldPosChara;
314 RenderObject.currentParam.x += array[currentDir].x;
315 RenderObject.currentParam.y += array[currentDir].y;
316 RenderObject.currentParam.z += array[currentDir].z + this.data.offset.z - data.offset.z;
317 if (
EClass.player.altHeldPos)
319 this.owner.held.SetDir((this.owner.dir == 0) ? 2 : ((
this.owner.dir == 1) ? 1 : ((
this.owner.dir == 2) ? 0 : 3)));
323 this.owner.held.SetDir((this.owner.dir == 0) ? 2 :
this.owner.dir);
331 RenderObject.currentParam.x += heldPos[currentDir].x;
332 RenderObject.currentParam.y += heldPos[currentDir].y + 0.02f * (float)(this.actor.GetFrame() % 2);
333 RenderObject.currentParam.z += heldPos[currentDir].z + this.data.offset.z - data.offset.z;
337 RenderObject.currentParam.x += heldPos[4].x;
338 RenderObject.currentParam.y += heldPos[4].y;
339 RenderObject.currentParam.z += heldPos[4].z + this.data.offset.z - data.offset.z;
341 if (this.owner.held.trait.NoHeldDir || !
this.owner.held.sourceCard.ContainsTag(
"noHeldDir"))
343 this.owner.held.dir = (this.owner.flipX ? 1 : 0);
346 if (this.owner.Cell.sourceSurface.tileType.IsDeepWater)
351 if (this.owner.held.isChara)
353 RenderObject.currentParam.liquidLv = 0;
355 this.owner.held.SetRenderParam(
RenderObject.currentParam);
356 RenderObject.currentParam.x += data.heldPos.x - data.offset.x + (flag ? 0.01f : -0.01f) * (
float)pref.equipX;
357 RenderObject.currentParam.y += data.heldPos.y - data.offset.y + 0.01f * (float)pref.equipY;
358 RenderObject.currentParam.z += data.heldPos.z;
363 RenderObject.currentParam.liquidLv = liquidLv;
367 public override void RefreshStateIcon()
374 MultiSprite stateIcon = this.owner.ai.GetStateIcon();
375 if (stateIcon ==
null)
379 base.RemoveTC(tcstate);
387 tcstate.SetSprite(stateIcon);
391 public override void SetFirst(
bool first)
394 this.ignoreFirst = !first;
398 public override void SetFirst(
bool first, Vector3 pos)
401 this.ignoreFirst = !first;
405 EClass.player.position = this.position;
407 this.movePoint.Set(this.owner.pos);
409 this.isMoving =
false;
414 public override void Refresh()
419 public new Chara owner;
422 public Vector3 orgPos;
425 private float moveTimer;
428 private float nextframeTimer;
431 public bool first =
true;
434 public bool ignoreFirst;
440 public AnimationCurve hopCurve;
443 public PCCData pccData;
446 private float actTime = 0.3f;
449 private float lastShadowFix;
452 private float lastShadowFix2;
458 public bool isMoving;
461 public static int _animeFramePC;
464 public static int _animeFramePCC;
467 public static int _animeFrame;
470 public static bool smoothmove;