9 public override bool isPCC
19 public override int currentDir
23 return this.provider.currentDir;
28 public override void OnSetOwner()
30 base.SetOwnerAsChara();
31 this.sr.flipX =
false;
32 this.pcc = PCC.Get((this.owner.renderer as
CharaRenderer).pccData);
33 this.provider.onSetSprite = delegate(Sprite a)
36 this.mpb.SetTexture(
"_MainTex", this.sr.sprite.texture);
38 this.provider.angle = this.owner.angle;
39 this.provider.SetPCC(this.pcc);
40 this.mpb.SetTexture(
"_MainTex", this.sr.sprite.texture);
45 public override void NextFrame()
47 if (this.lastNextFrame == Time.timeSinceLevelLoad)
51 this.provider.NextFrame();
52 this.lastNextFrame = Time.timeSinceLevelLoad;
56 public override void IdleFrame()
58 if (!this.owner.isDead)
60 this.provider.SetSpriteIdle();
65 public override int GetFrame()
67 return this.provider.currentFrame % 2;
71 public override void NextDir()
73 this.provider.NextDir(15f);
74 this.owner.angle = this.provider.angle;
75 this.provider.SetDir();
76 this.provider.SetSpriteMain();
81 public override void Kill()
85 this.provider.pcc =
null;
92 if (this.pcc.data.isUnique)
96 CharaActorPCC.org.x = p.x;
97 CharaActorPCC.org.y = p.y;
98 CharaActorPCC.org.z = p.z + this.owner.renderer.data.offset.z;
99 bool flag = this.owner.combatCount <= 0 &&
EMono.core.config.game.hideWeapons;
100 Cell cell = this.owner.Cell;
101 if ((this.owner.held ==
null || (
this.owner.held.trait.ShowAsTool && !
HotItemHeld.disableTool)) && !
this.owner.IsDeadOrSleeping &&
this.pcc.data.state != PCCState.Naked && (
this.owner.Cell.isFloating || !cell.sourceSurface.tileType.IsDeepWater || cell.IsIceTile))
103 int currentDir = this.currentDir;
104 int tempLeft = this.pcc.data.tempLeft;
105 int tempRight = this.pcc.data.tempRight;
111 bool flag2 = currentDir == 0 || currentDir == 1;
112 Vector3[] mainHandPos =
EMono.setting.render.mainHandPos;
113 Vector3[] mainHand =
EMono.setting.render.animeWalk[this.provider.currentFrame].mainHand;
114 p.tile = (float)(tempRight * (flag2 ? 1 : -1));
115 p.matColor = 104025f;
116 p.x = CharaActorPCC.org.x + mainHandPos[currentDir].x + mainHand[currentDir].x;
117 p.y = CharaActorPCC.org.y + mainHandPos[currentDir].y + mainHand[currentDir].y;
118 p.z = CharaActorPCC.org.z - renderTempEQ.offset.z + mainHandPos[currentDir].z + mainHand[currentDir].z;
119 renderTempEQ.Draw(p);
125 if (!this.owner.IsPC ||
EMono.player.currentHotItem.RenderThing ==
null)
129 BodySlot slotMainHand = this.owner.body.slotMainHand;
130 if (((slotMainHand !=
null) ? slotMainHand.thing :
null) !=
null)
132 thing = this.owner.body.slotMainHand.thing;
140 thing =
EMono.player.currentHotItem.RenderThing;
143 Thing thing2 = thing;
146 bool flag3 = currentDir == 0 || currentDir == 1;
147 if (thing2.trait.InvertHeldSprite)
151 Vector3[] mainHandPos2 =
EMono.setting.render.mainHandPos;
152 Vector3[] mainHand2 =
EMono.setting.render.animeWalk[this.provider.currentFrame].mainHand;
154 thing2.dir = (flag3 ? 0 : 1);
155 thing2.SetRenderParam(p);
156 p.x = CharaActorPCC.org.x + mainHandPos2[currentDir].x + mainHand2[currentDir].x + (flag3 ? 0.01f : -0.01f) * (
float)pref.equipX;
157 p.y = CharaActorPCC.org.y + mainHandPos2[currentDir].y + mainHand2[currentDir].y + 0.01f * (float)pref.equipY;
158 p.z = CharaActorPCC.org.z - thing2.renderer.data.offset.z + mainHandPos2[currentDir].z + mainHand2[currentDir].z;
162 thing2.renderer.Draw(p, ref p.v,
false);
170 bool flag4 = currentDir == 1 || currentDir == 3;
171 Vector3[] offHandPos =
EMono.setting.render.offHandPos;
172 Vector3[] offHand =
EMono.setting.render.animeWalk[this.provider.currentFrame].offHand;
173 p.tile = (float)(tempLeft * (flag4 ? 1 : -1));
174 p.matColor = 104025f;
175 p.x = CharaActorPCC.org.x + offHandPos[currentDir].x + offHand[currentDir].x;
176 p.y = CharaActorPCC.org.y + offHandPos[currentDir].y + offHand[currentDir].y;
177 p.z = CharaActorPCC.org.z - renderTempEQ2.offset.z + offHandPos[currentDir].z + offHand[currentDir].z;
178 renderTempEQ2.Draw(p);
181 else if (!flag && this.owner.body.slotOffHand !=
null &&
EMono.core.config.game.showOffhand)
183 Thing thing3 = this.owner.body.slotOffHand.thing;
186 bool flag5 = currentDir == 1 || currentDir == 3;
187 Vector3[] offHandPos2 =
EMono.setting.render.offHandPos;
188 Vector3[] offHand2 =
EMono.setting.render.animeWalk[this.provider.currentFrame].offHand;
190 thing3.dir = (flag5 ? 0 : 1);
191 thing3.SetRenderParam(p);
192 p.x = CharaActorPCC.org.x + offHandPos2[currentDir].x + offHand2[currentDir].x + (flag5 ? 0.01f : -0.01f) * (
float)pref2.equipX;
193 p.y = CharaActorPCC.org.y + offHandPos2[currentDir].y + offHand2[currentDir].y + 0.01f * (float)pref2.equipY;
194 p.z = CharaActorPCC.org.z - thing3.renderer.data.offset.z + offHandPos2[currentDir].z + offHand2[currentDir].z;
195 thing3.renderer.Draw(p);
201 p.z = CharaActorPCC.org.z - this.owner.renderer.data.offset.z;
205 public override void RefreshSprite()
207 this.provider.angle = this.owner.angle;
208 this.provider.SetDir();
209 this.provider.SetSpriteMain();
210 base.RefreshSprite();
214 private static Vector3 org;
220 public SpriteProvider provider =
new SpriteProvider();
223 private float lastNextFrame;
226 public static Vector3 V2 =
new Vector3(2f, 2f, 1f);