Elin Modding Docs Doc
Loading...
Searching...
No Matches
TileMapElona.cs
1using System;
2using CreativeSpore.SuperTilemapEditor;
3using UnityEngine;
4
5// Token: 0x020001AC RID: 428
7{
8 // Token: 0x170002F4 RID: 756
9 // (get) Token: 0x06000C42 RID: 3138 RVA: 0x00058F1D File Offset: 0x0005711D
10 public EloMap elomap
11 {
12 get
13 {
14 return EMono.scene.elomapActor.elomap;
15 }
16 }
17
18 // Token: 0x06000C43 RID: 3139 RVA: 0x00058F30 File Offset: 0x00057130
19 public override void Draw()
20 {
21 Zone zone = EMono._zone;
22 float zoom = EMono.scene.camSupport.Zoom;
23 SceneProfile profile = EMono.scene.profile;
24 this.lightSetting = EMono.scene.profile.light;
25 this.map = zone.map;
26 this.Size = this.map.Size;
27 this.SizeXZ = this.map.SizeXZ;
28 this.isMining = (EMono.scene.actionMode == ActionMode.Mine);
29 this.iconMode = EMono.scene.actionMode.cardIconMode;
30 this.count = 0;
31 this.totalFire = 0;
32 this.pcX = EMono.pc.pos.x;
33 this.pcZ = EMono.pc.pos.z;
34 float num = this.lightSetting.nightRatioCurve.Evaluate(EMono.scene.timeRatio);
35 this.modSublight1 = profile.global.modSublight1 * num;
36 this.modSublight2 = profile.global.modSublight2 * num;
37 this.pcMaxLight = EMono.player.lightPower * profile.global.fovModNonGradient * 0.8f;
38 this.buildMode = EMono.scene.actionMode.IsBuildMode;
39 this.subtleHighlightArea = (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Build || (EMono.scene.actionMode.AreaHihlight != AreaHighlightMode.Edit && EMono.game.config.areaHighlight));
40 this.highlightArea = (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Edit || this.subtleHighlightArea);
41 this.lightLimit = this.lightSetting.lightLimit.Evaluate(EMono.scene.timeRatio);
42 this._lightMod = this.lightSetting.lightMod * this.lightSetting.lightModCurve.Evaluate(EMono.scene.timeRatio);
43 this._baseBrightness = this.lightSetting.baseBrightness * this.lightSetting.baseBrightnessCurve.Evaluate(EMono.scene.timeRatio);
44 Fov.nonGradientMod = profile.global.fovModNonGradient;
45 this.shadowStrength = this.lightSetting.shadowCurve.Evaluate(EMono.scene.timeRatio);
46 base.RefreshHeight();
47 this.innerMode = ((this.buildMode || ActionMode.Select.ForceInnerBlockMode()) ? this.defaultInnerMode : (ActionMode.Bird.IsActive ? BaseTileMap.InnerMode.Height : this.defaultInnerMode));
48 this.currentHeight = (int)EMono.pc.pos.cell.TopHeight;
49 this.currentRoom = EMono.pc.pos.cell.room;
50 this.map.rooms.Refresh();
51 this.lowObj = false;
52 if (this.usingHouseBoard || ActionMode.Bird.IsActive)
53 {
54 this.lowBlock = (this.hideRoomFog = (this.showFullWall = (this.hideHang = false)));
55 this.showRoof = true;
56 }
57 else if (this.buildMode)
58 {
59 this.showRoof = EMono.game.config.showRoof;
60 this.lowBlock = (!this.showRoof && !EMono.game.config.showWall);
61 this.showFullWall = (!this.showRoof && EMono.game.config.showWall);
62 this.hideRoomFog = true;
63 this.hideHang = (!this.showRoof && !EMono.game.config.showWall);
64 }
65 else if (ActionMode.IsAdv)
66 {
67 if (EMono.pc.pos.cell.Front.UseLowBlock || EMono.pc.pos.cell.Right.UseLowBlock || EMono.pc.pos.cell.Front.Right.UseLowBlock || EMono.pc.pos.cell.UseLowBlock || EMono.pc.pos.cell.UseLowBlock)
68 {
69 if (!EMono.pc.IsMoving)
70 {
71 this.lowblockTimer = 0.1f;
72 }
73 }
74 else
75 {
76 this.lowblockTimer = 0f;
77 }
78 this.lowBlock = (this.lowblockTimer > 0f);
79 this.hideRoomFog = (this.currentRoom != null && this.currentRoom.lot.idRoofStyle != 0);
80 this.x = EMono.pc.pos.x;
81 this.z = EMono.pc.pos.z;
82 this.showFullWall = this.hideRoomFog;
83 this.showRoof = (!this.lowBlock && !this.hideRoomFog && EMono.game.config.noRoof);
84 this.hideHang = (this.showFullWall || this.lowBlock);
85 EMono.game.config.showRoof = !this.hideRoomFog;
86 }
87 else
88 {
89 this.lowBlock = (this.hideRoomFog = (this.showFullWall = (this.hideHang = false)));
90 this.showRoof = true;
91 }
92 if (this.map.config.indoor)
93 {
94 this.showRoof = false;
95 }
96 int x = TilemapUtils.GetMouseGridX(this.elomap.fogmap, EMono.scene.cam) - this.elomap.minX;
97 int z = TilemapUtils.GetMouseGridY(this.elomap.fogmap, EMono.scene.cam) - this.elomap.minY;
98 WidgetDebug.output = x.ToString() + "/" + z.ToString() + "\n";
99 base.HitPoint.Set(x, z);
100 base.HitPoint.Clamp(false);
101 this.z = 0;
102 while (this.z < this.screen.height)
103 {
104 this.x = 0;
105 while (this.x < this.screen.width)
106 {
107 this.cx = this.screen.scrollX + this.x;
108 this.cz = this.screen.scrollY + this.z;
109 if (this.cx >= 0 && this.cz >= 0 && this.cx < this.Size && this.cz < this.Size)
110 {
111 this.DrawTile();
112 }
113 this.x++;
114 }
115 this.z++;
116 }
117 EMono.scene.sfxFire.SetVolume(Mathf.Clamp(0.1f * (float)this.totalFire + ((this.totalFire != 0) ? 0.2f : 0f), 0f, 1f));
118 Room currentRoom = this.currentRoom;
119 int? num2;
120 if (currentRoom == null)
121 {
122 num2 = null;
123 }
124 else
125 {
126 Lot lot = currentRoom.lot;
127 num2 = ((lot != null) ? new int?(lot.idBGM) : null);
128 }
129 int? num3 = num2;
130 int valueOrDefault = num3.GetValueOrDefault();
131 if ((valueOrDefault != 0 && (EMono.Sound.currentPlaylist != EMono.Sound.plLot || EMono.Sound.plLot.list[0].data.id != valueOrDefault)) || (valueOrDefault == 0 && EMono.Sound.currentPlaylist == EMono.Sound.plLot))
132 {
133 EMono._zone.RefreshBGM();
134 }
135 if (this.currentRoom != this.lastRoom)
136 {
137 this.screen.RefreshWeather();
138 this.lastRoom = this.currentRoom;
139 }
140 }
141
142 // Token: 0x06000C44 RID: 3140 RVA: 0x00059704 File Offset: 0x00057904
143 public override void DrawTile()
144 {
145 this.count++;
146 this.index = this.cx + this.cz * this.Size;
147 this.cell = (this.param.cell = this.map.cells[this.cx, this.cz]);
148 this.detail = this.cell.detail;
149 this.isSeen = this.cell.isSeen;
150 this.roof = this.cell.HasRoof;
151 this.matBlock = this.cell.matBlock;
152 this.matFloor = this.cell.matFloor;
153 this.sourceBlock = this.cell.sourceBlock;
154 this.sourceFloor = this.cell.sourceFloor;
155 this.light = (float)this.cell.light;
156 float num = Fov.DistanceFloat(this.cx, this.cz, this.pcX, this.pcZ);
157 if (num < 4f)
158 {
159 num = 4f;
160 }
161 if (this.light < this.pcMaxLight && num < (float)(EMono.player.lightRadius - 1))
162 {
163 float num2 = (this.light + this.pcMaxLight) / 2f * this.modSublight1 / num;
164 if (num2 > this.light)
165 {
166 this.light = num2;
167 }
168 }
169 this._lowblock = this.lowBlock;
170 this.liquidLv = (this.param.liquidLv = ((this.cell.liquidLv + (int)this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.LiquidLV : this.sourceFloor.tileType.LiquidLV) * 10);
171 if (this.liquidLv > 99)
172 {
173 this.liquidLv = (this.param.liquidLv = 99);
174 }
175 this.height = (int)this.cell.height;
176 this.hasBridge = (this.cell._bridge > 0);
177 if (this.cell.room != null)
178 {
179 this.cell.room.lot.sync = true;
180 }
181 this.blockLight = this._lightMod * this.lightLookUp[(int)this.light] + this._baseBrightness + ((this.roof || this.cell.isShadowed) ? this.shadowStrength : 0f);
182 CellEffect effect = this.cell.effect;
183 if (effect != null && effect.FireAmount > 0)
184 {
185 this.blockLight += 0.2f;
186 this.totalFire++;
187 }
188 if (this.blockLight > this.lightLimit)
189 {
190 this.blockLight = this.lightLimit;
191 }
192 this.blockLight -= 0.025f * (float)this.cell.shadowMod * this._heightMod.x;
193 this.param.color = (this.blockLight = (float)((int)(this.blockLight * 50f) * 262144 + (int)(((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096) + (int)(((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64) + (int)((this.cell.lightB >= 64) ? 63 : this.cell.lightB)));
194 this.param.x = (float)this.cx * this.screen.tileAlign.x;
195 this.param.y = (float)this.cz * this.screen.tileAlign.y + (float)this.height * this._heightMod.y;
196 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.height * this._heightMod.z;
197 if (this.detail != null)
198 {
199 TransAnime anime = this.detail.anime;
200 if (anime != null && anime.animeBlock)
201 {
202 TransAnime anime2 = this.detail.anime;
203 this.param.x += anime2.v.x;
204 this.param.y += anime2.v.y;
205 this.param.z += anime2.v.z;
206 }
207 if (this.detail.designation != null)
208 {
209 this.detail.designation.Draw(this.cx, this.cz, this.param);
210 }
211 }
212 if (this.cell.isSlopeEdge)
213 {
214 float num3 = (float)this.height * this._heightMod.y;
215 this.orgY = this.param.y;
216 this.orgZ = this.param.z;
217 this.param.dir = this.cell.blockDir;
218 if (this.cell.isSurrounded)
219 {
220 this.param.matColor = 0f;
221 this.param.color = (float)(262144 * (int)((this._baseBrightness + this.fogBrightness) * 50f));
222 this.param.tile = 0f;
223 int num4 = 0;
224 while ((float)num4 < num3 / this.heightBlockSize)
225 {
226 this.param.y += this.ugFix.y;
227 this.param.z += this.ugFix.z + this.slopeFixZ * (float)num4;
228 this.rendererInnerBlock.Draw(this.param);
229 num4++;
230 }
231 }
232 else
233 {
234 SourceBlock.Row row;
235 if (this.sourceBlock.tileType.IsFullBlock)
236 {
237 row = this.sourceBlock;
238 this.param.mat = this.matBlock;
239 this.param.tile = (float)this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length];
240 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this.sourceBlock.colorMod));
241 }
242 else
243 {
244 row = this.sourceFloor._defBlock;
245 this.param.mat = this.matFloor;
246 this.param.tile = (float)row._tiles[this.cell.blockDir % row._tiles.Length];
247 if (row.id != 1)
248 {
249 this.param.matColor = (float)((this.sourceFloor.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matFloor.matColor, this.sourceFloor.colorMod));
250 }
251 else
252 {
253 this.param.matColor = 104025f;
254 }
255 }
256 int num5 = 0;
257 while ((float)num5 < num3 / this.heightBlockSize)
258 {
259 this.param.y += this.ugFix.y;
260 this.param.z += this.ugFix.z + this.slopeFixZ * (float)num5;
261 row.renderData.Draw(this.param);
262 num5++;
263 }
264 }
265 this.param.y = this.orgY;
266 this.param.z = this.orgZ;
267 }
268 if (this.sourceBlock.id != 0)
269 {
270 this.tileType = this.sourceBlock.tileType;
271 this.room = this.cell.room;
272 this._lowblock = (this.showFullWall ? (this.room != null) : this.lowBlock);
273 if (this.tileType.RepeatBlock)
274 {
275 Room room;
276 if ((room = this.room) == null && (room = this.cell.Front.room) == null)
277 {
278 room = (this.cell.Right.room ?? this.cell.FrontRight.room);
279 }
280 this.room = room;
281 if (this.room != null)
282 {
283 this.roomHeight = ((this._lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
284 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.room.lot.mh * this._heightMod.y;
285 }
286 else
287 {
288 this.roomHeight = 0f;
289 }
290 }
291 else
292 {
293 this.roomHeight = 0f;
294 }
295 this.param.mat = this.matBlock;
296 this.param.dir = this.cell.blockDir;
297 switch (this.tileType.blockRenderMode)
298 {
299 case BlockRenderMode.FullBlock:
300 if (this.cell.isSurrounded)
301 {
302 switch (this.innerMode)
303 {
304 case BaseTileMap.InnerMode.None:
305 case BaseTileMap.InnerMode.Height:
306 this.param.color = this.blockLight;
307 break;
308 case BaseTileMap.InnerMode.InnerBlock:
309 case BaseTileMap.InnerMode.BuildMode:
310 this.param.matColor = 104025f;
311 this.param.color = (float)(262144 * (int)((this._baseBrightness + this.fogBrightness) * 50f));
312 this.param.tile = (float)(this._lowblock ? 3000000 : 0);
313 this.rendererInnerBlock.Draw(this.param);
314 return;
315 }
316 }
317 this.param.tile = (float)(this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length] + (this._lowblock ? 3000000 : 0));
318 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this.sourceBlock.colorMod));
319 if (this.roomHeight == 0f)
320 {
321 if (!this.cell.hasDoor)
322 {
323 this.sourceBlock.renderData.Draw(this.param);
324 }
325 }
326 else
327 {
328 RenderData renderData = this.sourceBlock.renderData;
329 RenderParam param = this.param;
330 float maxHeight = this.maxHeight;
331 float roomHeight = this.roomHeight;
332 GameSetting.RenderSetting renderSetting = this.renderSetting;
333 bool hasDoor = this.cell.hasDoor;
334 CellEffect effect2 = this.cell.effect;
335 renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, hasDoor, (effect2 != null) ? effect2.FireAmount : 0, false);
336 }
337 break;
338 case BlockRenderMode.WallOrFence:
339 {
340 this.orgY = this.param.y;
341 this.orgZ = this.param.z;
342 int blockDir = this.cell.blockDir;
343 if (blockDir == 0 || blockDir == 2)
344 {
345 this.param.dir = 0;
346 if (blockDir == 2 && this.cell.Left.sourceBlock.tileType.IsWallOrFence)
347 {
348 Cell left = this.cell.Left;
349 this._sourceBlock = left.sourceBlock;
350 if (this._sourceBlock.useAltColor)
351 {
352 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
353 }
354 else
355 {
356 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
357 }
358 }
359 else
360 {
361 this._sourceBlock = this.sourceBlock;
362 if (this._sourceBlock.useAltColor)
363 {
364 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
365 }
366 else
367 {
368 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
369 }
370 }
371 this.param.tile = (float)(this.tile = this._sourceBlock._tiles[0] + (this._lowblock ? 1000000 : 0));
372 if (this.roomHeight == 0f || !this.tileType.RepeatBlock)
373 {
374 if (!this.cell.hasDoor)
375 {
376 this._sourceBlock.renderData.Draw(this.param);
377 }
378 }
379 else
380 {
381 RenderData renderData2 = this._sourceBlock.renderData;
382 RenderParam param2 = this.param;
383 float maxHeight2 = this.maxHeight;
384 float roomHeight2 = this.roomHeight;
385 GameSetting.RenderSetting renderSetting2 = this.renderSetting;
386 bool hasDoor2 = this.cell.hasDoor;
387 CellEffect effect3 = this.cell.effect;
388 renderData2.DrawRepeatTo(param2, maxHeight2, roomHeight2, ref renderSetting2.peakFix, hasDoor2, (effect3 != null) ? effect3.FireAmount : 0, false);
389 }
390 this.param.z -= 0.01f;
391 if (blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0))
392 {
393 this.param.tile = (float)(this.tile + 16);
394 if (this.roomHeight == 0f || !this.tileType.RepeatBlock)
395 {
396 this._sourceBlock.renderData.Draw(this.param);
397 }
398 else
399 {
400 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix, false, 0, false);
401 }
402 }
403 if (this.cell.Left.Front.HasWallOrFence && this.cell.Left.Front.blockDir == 1)
404 {
405 this.orgX = this.param.x;
406 this.param.tile = (float)(this.tile + 16);
407 this.param.x += this.cornerWallFix.x;
408 this.param.y += this.cornerWallFix.y;
409 this.param.z += this.cornerWallFix.z;
410 if (this.roomHeight == 0f || !this.tileType.RepeatBlock)
411 {
412 this._sourceBlock.renderData.Draw(this.param);
413 }
414 else
415 {
416 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight + this.cornerWallFix.y, ref this.renderSetting.peakFix, false, 0, false);
417 }
418 this.param.x = this.orgX;
419 }
420 }
421 if (blockDir == 1 || blockDir == 2)
422 {
423 this.param.y = this.orgY;
424 this.param.z = this.orgZ;
425 this.param.dir = 1;
426 if (blockDir == 2 && this.cell.Back.sourceBlock.tileType.IsWallOrFence)
427 {
428 Cell back = this.cell.Back;
429 this._sourceBlock = back.sourceBlock;
430 if (this._sourceBlock.useAltColor)
431 {
432 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
433 }
434 else
435 {
436 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
437 }
438 }
439 else
440 {
441 this._sourceBlock = this.sourceBlock;
442 if (this._sourceBlock.useAltColor)
443 {
444 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
445 }
446 else
447 {
448 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
449 }
450 }
451 this.param.tile = (float)(this.tile = -this._sourceBlock._tiles[0] + (this._lowblock ? -1000000 : 0));
452 if (this.roomHeight == 0f || !this.tileType.RepeatBlock)
453 {
454 if (!this.cell.hasDoor)
455 {
456 this._sourceBlock.renderData.Draw(this.param);
457 }
458 }
459 else
460 {
461 RenderData renderData3 = this._sourceBlock.renderData;
462 RenderParam param3 = this.param;
463 float maxHeight3 = this.maxHeight;
464 float roomHeight3 = this.roomHeight;
465 GameSetting.RenderSetting renderSetting3 = this.renderSetting;
466 bool hasDoor3 = this.cell.hasDoor;
467 CellEffect effect4 = this.cell.effect;
468 renderData3.DrawRepeatTo(param3, maxHeight3, roomHeight3, ref renderSetting3.peakFix, hasDoor3, (effect4 != null) ? effect4.FireAmount : 0, false);
469 }
470 if (this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1)
471 {
472 this.orgX = this.param.x;
473 this.param.tile = (float)(-(float)this.tile + 16);
474 if (this.roomHeight == 0f || !this.tileType.RepeatBlock)
475 {
476 this._sourceBlock.renderData.Draw(this.param);
477 }
478 else
479 {
480 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix, false, 0, false);
481 }
482 this.param.x = this.orgX;
483 }
484 }
485 if (this.cell.room != null && !this.hideRoomFog && !this.cell.hasDoor)
486 {
487 return;
488 }
489 this.param.y = this.orgY;
490 this.param.z = this.orgZ;
491 break;
492 }
493 case BlockRenderMode.Pillar:
494 {
495 RenderData renderData4 = this.sourceBlock.renderData;
496 this.param.tile = (float)this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length];
497 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this.sourceBlock.colorMod));
498 int num6 = this.cell.objDir * 2 + 1;
499 if (num6 == 0)
500 {
501 renderData4.Draw(this.param);
502 }
503 else
504 {
505 renderData4.DrawRepeat(this.param, num6, this.sourceBlock.tileType.RepeatSize, false);
506 }
507 this.param.tile = (float)renderData4.idShadow;
508 SourcePref shadowPref = renderData4.shadowPref;
509 int shadow = shadowPref.shadow;
510 this.passShadow.AddShadow(this.param.x + renderData4.offsetShadow.x, this.param.y + renderData4.offsetShadow.y, this.param.z + renderData4.offsetShadow.z, ShadowData.Instance.items[shadow], shadowPref, 0, false);
511 break;
512 }
513 case BlockRenderMode.HalfBlock:
514 this._sourceBlock = ((this.sourceBlock.id == 5) ? EMono.sources.blocks.rows[this.matBlock.defBlock] : this.sourceBlock);
515 this.param.tile = (float)this._sourceBlock._tiles[0];
516 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this._sourceBlock.colorMod));
517 this.param.tile2 = this._sourceBlock.sourceAutoFloor._tiles[0];
518 this.param.halfBlockColor = ((this._sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this._sourceBlock.sourceAutoFloor.colorMod));
519 this.sourceBlock.renderData.Draw(this.param);
520 break;
521 default:
522 this.param.tile = (float)(this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length] + ((this._lowblock && this.tileType.UseLowWallTiles) ? 3000000 : 0));
523 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matBlock.matColor, this.sourceBlock.colorMod));
524 if (this.roomHeight == 0f)
525 {
526 this.sourceBlock.renderData.Draw(this.param);
527 }
528 else
529 {
530 this.sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFixBlock, false, 0, false);
531 }
532 break;
533 }
534 }
535 if (this.cell.effect != null)
536 {
537 if (this.cell.effect.IsLiquid)
538 {
539 SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
540 SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
541 this.tile = (int)(4 + Rand.bytes[this.index % Rand.MaxBytes] % 4);
542 this.param.tile = (float)(this.tile + this.cell.sourceEffect._tiles[0]);
543 this.param.mat = defaultMaterial;
544 this.param.matColor = (float)BaseTileMap.GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod);
545 sourceEffect.renderData.Draw(this.param);
546 }
547 else
548 {
549 this.param.tile = (float)this.cell.effect.source._tiles[0];
550 if (this.cell.effect.IsFire)
551 {
552 this.rendererEffect.Draw(this.param, 0);
553 }
554 else
555 {
556 this.cell.effect.source.renderData.Draw(this.param);
557 }
558 }
559 }
560 if (this.detail != null)
561 {
562 TransAnime anime3 = this.detail.anime;
563 if (anime3 != null && !anime3.animeBlock)
564 {
565 TransAnime anime4 = this.detail.anime;
566 this.param.x += anime4.v.x;
567 this.param.y += anime4.v.y;
568 this.param.z += anime4.v.z;
569 }
570 }
571 if (this.cell.obj != 0)
572 {
573 SourceObj.Row sourceObj = this.cell.sourceObj;
574 this.param.mat = this.cell.matObj;
575 if (sourceObj.useAltColor)
576 {
577 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, sourceObj.colorMod));
578 }
579 else
580 {
581 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, sourceObj.colorMod));
582 }
583 if (sourceObj.HasGrowth)
584 {
585 this.cell.growth.OnRenderTileMap(this.param);
586 }
587 else
588 {
589 if (sourceObj.tileType.IsUseBlockDir)
590 {
591 this.param.tile = (float)sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
592 }
593 else
594 {
595 this.param.tile = (float)sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
596 }
597 if (this._lowblock && sourceObj.tileType.IsSkipLowBlock)
598 {
599 this.param.tile += (float)(((this.param.tile > 0f) ? 1 : -1) * 3000000);
600 }
601 sourceObj.renderData.Draw(this.param);
602 int shadow2 = sourceObj.pref.shadow;
603 if (shadow2 > 1 && !this.cell.ignoreObjShadow)
604 {
605 this.passShadow.AddShadow(this.param.x + sourceObj.renderData.offsetShadow.x, this.param.y + sourceObj.renderData.offsetShadow.y, this.param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow2], sourceObj.pref, 0, false);
606 }
607 }
608 }
609 if (this.cell.decal != 0)
610 {
611 this.passDecal.Add(this.param, (float)this.cell.decal, this.blockLight, 0f);
612 }
613 if (this.detail == null)
614 {
615 return;
616 }
617 if (this.highlightArea && this.detail.area != null)
618 {
619 this.passArea.Add(this.param, (float)(this.detail.area.GetTile(this.index) - (this.subtleHighlightArea ? 0 : 1)), 0f, 0f);
620 }
621 if (this.detail.footmark != null && this.sourceFloor.id != 0)
622 {
623 this.param.tile = (float)this.detail.footmark.tile;
624 this.param.mat = this.matFloor;
625 this.param.matColor = (float)this.floorMatColor;
626 this.renderFootmark.Draw(this.param);
627 }
628 if (this.detail.things.Count == 0 && this.detail.charas.Count == 0)
629 {
630 return;
631 }
632 int num7 = 0;
633 this.thingPos.x = 0f;
634 this.thingPos.y = 0f;
635 this.param.y += ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight);
636 this.orgX = this.param.x;
637 this.orgY = this.param.y;
638 this.orgZ = this.param.z;
639 Thing thing = null;
640 bool drawShadow = this.liquidLv == 0;
641 if (this.detail.things.Count > 0)
642 {
643 float max = this.zSetting.max1;
644 int i = 0;
645 while (i < this.detail.things.Count)
646 {
647 Thing thing2 = this.detail.things[i];
648 this._actorPos.x = this.orgX;
649 this._actorPos.y = this.orgY;
650 this._actorPos.z = this.orgZ;
651 SourcePref pref = thing2.sourceCard.pref;
652 TileType tileType = thing2.trait.tileType;
653 float num8 = tileType.UseMountHeight ? 0f : ((pref.height == 0f) ? 0.1f : pref.height);
654 if (tileType.CanStack || !thing2.IsInstalled)
655 {
656 if (((thing != null) ? thing.id : null) != thing2.id)
657 {
658 this._actorPos.x = this._actorPos.x + this.thingPos.x;
659 }
660 this._actorPos.y = this._actorPos.y + this.thingPos.y;
661 this._actorPos.z = this._actorPos.z + (this.renderSetting.thingZ + (float)i * -0.01f + this.zSetting.mod1 * this.thingPos.y);
662 }
663 if (!thing2.IsInstalled || !tileType.UseMountHeight)
664 {
665 drawShadow = (this.thingPos.y == 0f && this.liquidLv == 0);
666 goto IL_1DD1;
667 }
668 if (!this.hideHang || this.cell.room != null || thing2.altitude <= 3)
669 {
670 thing2.TileType.GetMountHeight(ref this._actorPos, Point.shared.Set(this.index), thing2.dir, thing2);
671 drawShadow = false;
672 goto IL_1DD1;
673 }
674 IL_1F27:
675 i++;
676 continue;
677 IL_1DD1:
678 this.param.liquidLv = ((i == 0) ? this.liquidLv : 0);
679 this.thingPos.y = this.thingPos.y + num8;
680 if (!thing2.sourceCard.multisize || (thing2.pos.x == this.cx && thing2.pos.z == this.cz))
681 {
682 if (this.iconMode != BaseTileMap.CardIconMode.None)
683 {
684 int num9 = 0;
685 switch (this.iconMode)
686 {
687 case BaseTileMap.CardIconMode.Deconstruct:
688 if (thing2.isDeconstructing)
689 {
690 num9 = 14;
691 }
692 break;
693 case BaseTileMap.CardIconMode.State:
694 if (thing2.placeState == PlaceState.installed)
695 {
696 num9 = 18;
697 }
698 break;
699 }
700 if (thing2.isNPCProperty)
701 {
702 num9 = 13;
703 }
704 if (num9 != 0)
705 {
706 this.passGuideBlock.Add(this._actorPos.x, this._actorPos.y, this._actorPos.z - 10f, (float)num9, 0f);
707 }
708 }
709 thing2.SetRenderParam(this.param);
710 thing2.renderer.Draw(this.param, ref this._actorPos, drawShadow);
711 }
712 this.param.x = this.orgX;
713 this.param.y = this.orgY;
714 this.param.z = this.orgZ;
715 thing = thing2;
716 goto IL_1F27;
717 }
718 }
719 if (this.detail.charas.Count > 0)
720 {
721 this.param.shadowFix = 0f;
722 this.param.color += 1310720f;
723 float max2 = this.zSetting.max2;
724 bool flag = EMono.pc.fov != null && EMono.pc.fov.lastPoints.ContainsKey(this.index);
725 for (int j = 0; j < this.detail.charas.Count; j++)
726 {
727 Chara chara = this.detail.charas[j];
728 if (chara.host == null)
729 {
730 if (!flag)
731 {
732 Party party = chara.party;
733 if (((party != null) ? party.leader : null) != EMono.pc && !chara.isDead)
734 {
735 goto IL_22BC;
736 }
737 }
738 this._actorPos.x = this.orgX;
739 this._actorPos.y = this.orgY;
740 this._actorPos.z = this.orgZ;
741 chara.SetRenderParam(this.param);
742 bool isAliveInCurrentZone = chara.IsAliveInCurrentZone;
743 if (chara.IsDeadOrSleeping && chara.IsPCC)
744 {
745 float num10 = chara.renderer.data.size.y * 0.3f;
746 if (this.thingPos.y > max2)
747 {
748 this.thingPos.y = max2;
749 }
750 float num11 = this.thingPos.y + num10;
751 float num12 = (float)j * -0.01f;
752 if (num11 > this.zSetting.thresh1)
753 {
754 num12 = this.zSetting.mod1;
755 }
756 this._actorPos.x = this._actorPos.x + this.thingPos.x;
757 this._actorPos.y = this._actorPos.y + this.thingPos.y;
758 this._actorPos.z = this._actorPos.z + (this.renderSetting.laydownZ + num12);
759 this.param.liquidLv = ((this.thingPos.y == 0f && this.liquidLv > 0) ? 90 : 0);
760 this.thingPos.y = this.thingPos.y + num10 * 0.8f;
761 chara.renderer.Draw(this.param, ref this._actorPos, this.liquidLv == 0);
762 }
763 else
764 {
765 this.param.liquidLv = this.liquidLv;
766 if (!chara.IsPC && !chara.renderer.IsMoving && this.detail.charas.Count > 1 && (this.detail.charas.Count != 2 || !this.detail.charas[0].IsDeadOrSleeping || !this.detail.charas[0].IsPCC))
767 {
768 this._actorPos += this.renderSetting.charaPos[1 + ((num7 < 4) ? num7 : 3)];
769 }
770 this._actorPos.z = this._actorPos.z + (0.01f * (float)j + this.renderSetting.charaZ);
771 num7++;
772 chara.renderer.Draw(this.param, ref this._actorPos, this.liquidLv == 0);
773 }
774 this.param.x = this.orgX;
775 this.param.y = this.orgY;
776 this.param.z = this.orgZ;
777 }
778 IL_22BC:;
779 }
780 }
781 }
782}
Definition Cell.cs:10
Definition Chara.cs:12
Definition EMono.cs:6
Definition Fov.cs:7
Definition Lot.cs:7
Definition Party.cs:8
Definition Point.cs:11
Definition Room.cs:6
Definition Thing.cs:10
Definition Zone.cs:14