EA 23.344 Nightly โ
September 11, 2026
62 files modified. 10 new files created.
Important Changes โ
Possible breaking changes. Click the filename to view the chunk.
Lot (1) โ
public static Dictionary<int, int> roofCount = new Dictionary<int, int>();
public static Dictionary<long, int> roofCount = new Dictionary<long, int>(); Map (1) โ
public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridge = 0, int dir = 0, byte idPillar = 0)
public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridge = 0, int dir = 0, int idPillar = 0, bool hidePillar = false) Room (1) โ
public Dictionary<int, int> roofCount = new Dictionary<int, int>();
public Dictionary<long, int> roofCount = new Dictionary<long, int>(); AI_Idle โ
public override IEnumerable<Status> Run()
switch (idAct)
{
case "torture_snail":
DoSomethingToNearChara((Chara chara6) => chara6.race.id == "snail", delegate(Chara chara6)
DoSomethingToNearChara((Chara chara6) => chara6.race.id == "snail" || chara6.HasElement(1211), delegate(Chara chara6)
{
owner.Say("use_whip3", owner, chara6);
owner.PlaySound("whip");AM_Adv โ
if (EClass.scene.mouseTarget.pos.Distance(EClass.pc.pos) <= 1 && HotItemHeld.CanChangeHeightByWheel())
{
textWheel = "textWheel_changeHeight".lang();
if (HotItemHeld.taskBuild != null && HotItemHeld.taskBuild.altitude > 0)
if (HotItemHeld.taskBuild != null && HotItemHeld.taskBuild.altitude != 0)
{
textWheel = textWheel + " (+" + HotItemHeld.taskBuild.altitude + ")";
textWheel = textWheel + " (" + ((HotItemHeld.taskBuild.altitude >= 0) ? "+" : "") + HotItemHeld.taskBuild.altitude + ")";
}
}
else if (HotItemHeld.CanRotate())AM_Build โ
public override int TopHeight(Point p)
{
if (!recipe.IsThing)
{
return bridgeHeight + ((!recipe.tileType.AltitudeAsDir) ? altitude : 0);
return 1 + bridgeHeight + ((!recipe.tileType.AltitudeAsDir) ? altitude : 0);
}
if (altitude != 0)
{
return altitude;
}
return -1;
return 0;
}
public override HitResult HitResultOnDesignation(Point p)public void FixBridge(Point point, Recipe recipe)
bridgeHeight = -1;
if (recipe.IsBridge)
{
bridgeHeight = (byte)((point.cell.bridgeHeight == 0) ? (point.cell.height + recipe.tileType.MinAltitude) : point.cell.bridgeHeight);
bridgeHeight = (byte)((point.cell.bridgeHeight == 0) ? (point.cell.height + recipe.tileType.MinBridgeAltitude) : point.cell.bridgeHeight);
}
}public override void InputWheel(int wheel)
public void ModAltitude(int a)
{
altitude += a;
if (altitude < (recipe.IsBridge ? (-10) : 0))
if (altitude < (recipe.IsBridge ? (-10) : recipe.tileType.MinAltitude))
{
altitude = MaxAltitude;
}AM_FlagCell โ
flagSnow,
flagFloat,
flagWallPillar,
flagClear,
flagShadow,
flagOcclusion,
flagClear,
flagWall
}public override HitResult HitTest(Point point, Point start)
return HitResult.Default;
}
break;
case Mode.flagOcclusion:
if (start != null && start.cell.toggleOcclusion != point.cell.toggleOcclusion)
{
return HitResult.Default;
}
break;
}
return HitResult.Valid;
}public override void OnProcessTiles(Point point, int dir)
t.noShadow = !t.noShadow;
});
break;
case Mode.flagOcclusion:
point.cell.toggleOcclusion = !point.cell.toggleOcclusion;
break;
case Mode.flagFloat:
point.cell.isForceFloat = !point.cell.isForceFloat;
break;public override void OnClickSubMenu(int a)
public override string OnSetSubMenuButton(int a, UIButton b)
{
if (a < 5)
if (a < 6)
{
Mode mode = a.ToEnum<Mode>();
if (a >= 3 && mode != Mode.flagShadow)
if (mode == Mode.flagClear || mode == Mode.flagWall)
{
return null;
}AM_MoveInstalled โ
public override int TopHeight(Point p)
{
return moldCard.altitude;
}
return -1;
return 0;
}
public override MeshPass GetGuidePass(Point point)AM_Picker โ
public RecipeSource TryGetRecipe(string id)
public new bool Select(Result r)
{
ActionMode.ignoreSound = true;
EClass.player.recipes.lastIngredients[r.source.id] = null;
BM.Select(r);
return true;
}ActionMode โ
public static void OnGameInstantiated()
public virtual int TopHeight(Point p)
{
return -1;
return 0;
}
public virtual void SEExecuteSummary() {
row2 = lastEditorMat;
}
hitPoint.cell.objMat = (byte)row2.id;
hitPoint.cell.objMat = row2.id;
lastEditorMat = row2;
Msg.Say(row2.GetName());
} {
row3 = lastEditorMat;
}
hitPoint.cell._blockMat = (byte)row3.id;
hitPoint.cell._blockMat = row3.id;
lastEditorMat = row3;
Msg.Say(row3.GetName());
} {
row4 = lastEditorMat;
}
hitPoint.cell._floorMat = (byte)row4.id;
hitPoint.cell._floorMat = row4.id;
lastEditorMat = row4;
Msg.Say(row4.GetName());
}public virtual void RotateUnderMouse()
return;
}
hitPoint.cell.RotateAll();
if (EClass.debug.enable)
if (EClass.debug.enable && !Input.GetKey(KeyCode.LeftShift))
{
hitPoint.growth?.Grow(100);
if (hitPoint.Installed?.trait is TraitSeed)BaseListPeople โ
public override void OnInstantiate(Chara a, ItemGeneral b)
}
if (IsDisabled(a))
{
b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
b.GetOrCreate<CanvasGroup>().alpha = 0.6f;
return;
}
CanvasGroup component = b.GetComponent<CanvasGroup>();
if ((bool)component)
{
component.alpha = 1f;
}
}BaseTaskHarvest โ
using System;
using UnityEngine;
public class BaseTaskHarvest : TaskDesignationpublic void SetTarget(Chara c, Thing _tool = null)
row = pos.matBlock;
break;
}
array = new string[pos.sourceFloor.reqHarvest.Length];
Array.Copy(pos.sourceFloor.reqHarvest, array, pos.sourceFloor.reqHarvest.Length);
array[0] = "mining";
array = pos.sourceFloor.reqHarvest?.Clone() as string[];
if (array != null && array.Length != 0)
{
array[0] = "mining";
}
row = pos.matFloor;
break;
}
if (array == null || array.Length < 2 || !EClass.sources.elements.alias.ContainsKey(array[0]))
{
Debug.LogWarning(string.Format("#source {0} at {1} has no valid reqHarvest 'skill,level' ({2}), using default", this.harvestType, pos, (array == null) ? "null" : string.Join(',', array)));
string text = this.harvestType switch
{
HarvestType.Obj => "gathering",
HarvestType.Floor => "digging",
_ => "mining",
};
array = new string[2] { text, "1" };
}
matHardness = row.hardness;
if (this.harvestType == HarvestType.Obj)
{BaseTileMap โ
public virtual void DrawTile()
fogged = true;
}
}
goto IL_7d3b;
goto IL_7d7f;
IL_7215:
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
{
snowed = true;
}
if (this.cell.effect != null)
{
if (this.cell.effect.IsLiquid)
{
SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
param.tile = tile + this.cell.sourceEffect._tiles[0];
param.mat = defaultMaterial;
param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
sourceEffect.renderData.Draw(param);
}
else
{
param.tile = this.cell.effect.source._tiles[0];
SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
if (sourceEffect2.anime.Length != 0)
{
if (sourceEffect2.anime.Length > 2)
{
float num3 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num3 >= (float)sourceEffect2.anime[0]))
{
param.tile += num3;
}
}
else
{
float num4 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num4;
}
}
if (this.cell.effect.IsFire)
{
rendererEffect.Draw(param);
}
else
{
this.cell.effect.source.renderData.Draw(param);
}
}
}
param.color = floorLight;
if (this.cell.critter != null)
{
Critter critter = this.cell.critter;
int snowTile = critter.tile;
if (snowed && critter.SnowTile != 0)
{
critter.x = 0.06f;
critter.y = -0.06f;
snowTile = critter.SnowTile;
}
else
{
critter.Update();
}
pass = passObjSS;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
batch.colors[pass.idx] = floorLight;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (detail != null)
{
TransAnime anime3 = detail.anime;
if (anime3 != null && !anime3.animeBlock)
{
TransAnime anime4 = detail.anime;
param.x += anime4.v.x;
param.y += anime4.v.y;
param.z += anime4.v.z;
}
}
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
SourceObj.Row sourceObj = this.cell.sourceObj;
if (!snowed || sourceObj.snowTile <= 0)
{
param.snow = snowed;
param.mat = this.cell.matObj;
orgY = param.y;
if (param.liquidLv > 0)
{
if (sourceObj.pref.Float)
{
param.y += 0.01f * floatY;
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
}
if (sourceObj.tileType.IsWaterTop)
{
param.liquidLv = 0;
}
else
{
param.liquidLv += sourceObj.pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquid = 1f;
}
else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
{
param.liquidLv = 99 + sourceObj.pref.liquidModMax;
}
}
}
if (sourceObj.useAltColor)
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
}
else
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
}
if (sourceObj.HasGrowth)
{
this.cell.growth.OnRenderTileMap(param);
}
else
{
if (this.cell.autotileObj != 0)
{
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
}
else if (sourceObj.tileType.IsUseBlockDir)
{
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
}
else
{
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
}
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
{
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
}
orgY = param.y;
orgZ = param.z;
param.y += sourceObj.pref.y;
param.z += sourceObj.pref.z;
sourceObj.renderData.Draw(param);
param.y = orgY;
param.z = orgZ;
int shadow2 = sourceObj.pref.shadow;
if (shadow2 > 1 && !this.cell.ignoreObjShadow)
{
passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow2], sourceObj.pref, 0, param.snow);
}
param.y = orgY;
}
}
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
{
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagOcclusion:
if (this.cell.toggleOcclusion)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
{
passArea.Add(param, 34f, 0f);
}
break;
}
}
if (detail == null)
{
return;
}
if (highlightArea && detail.area != null)
{
passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
param.tile = detail.footmark.tile;
param.mat = matFloor;
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7d7f;
IL_16be:
if (this.cell.isSlopeEdge)
{
float num3 = (float)height * _heightMod.y;
float num5 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;public virtual void DrawTile()
param.matColor = 104025f;
}
}
for (int j = 0; (float)j < num3 / heightBlockSize; j++)
for (int j = 0; (float)j < num5 / heightBlockSize; j++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)j;
defBlock.renderData.Draw(param);
if (this.cell.pcSync && EMono.player.lightPower > 0f)
{
float num4 = param.tile;
float num6 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num4;
param.tile = num6;
}
}
param.y = orgY;public virtual void DrawTile()
{
orgY = param.y;
orgZ = param.z;
int num5 = 0;
int num7 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
SourceBlock.Row row3 = sourceBlock;
num5 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
num7 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num5 = row3._tiles[this.cell.blockDir % row3._tiles.Length];
num7 = row3._tiles[this.cell.blockDir % row3._tiles.Length];
}
if (((this.cell.Front.shore / 12) & 1) == 0 && this.cell.Front.sourceFloor.tileType.IsWater && this.cell.Front.height <= height && this.cell.Front.sourceBlock.tileType.RenderWaterBlock)
{
param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Front.height * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
param.tile = num5 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
param.tile = num7 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
if (((this.cell.Right.shore / 12) & 8) == 0 && this.cell.Right.sourceFloor.tileType.IsWater && this.cell.Right.height <= height && this.cell.Right.sourceBlock.tileType.RenderWaterBlock)
{
param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Right.height * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
param.tile = num5 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
param.tile = num7 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
param.y = orgY;public virtual void DrawTile()
param.snow = snowed;
if (sourceFloor.anime.Length != 0)
{
int num6 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num6;
int num8 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num8;
}
if (this.cell.isDeck)
{public virtual void DrawTile()
}
sourceFloor.renderData.Draw(param);
}
int num7 = 0;
int num9 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
num7++;
num9++;
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
num7 += 2;
num9 += 2;
}
if (num7 != 0)
if (num9 != 0)
{
param.tile = 448 + num7 + 12;
param.tile = 448 + num9 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;public virtual void DrawTile()
}
}
}
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num7 == 0)
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num9 == 0)
{
pass = (isWater ? passAutoTileWater : passAutoTile);
batch = pass.batches[pass.batchIdx];public virtual void DrawTile()
}
if (isWater)
{
int num8 = 12;
int num9 = this.cell.shore / num8;
int num10 = this.cell.shore % num8;
int num10 = 12;
int num11 = this.cell.shore / num10;
int num12 = this.cell.shore % num10;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
Cell cell = (((num9 & 1) != 0) ? this.cell.Back : (((num9 & 2) != 0) ? this.cell.Right : (((num9 & 4) != 0) ? this.cell.Front : this.cell.Left)));
Cell cell = (((num11 & 1) != 0) ? this.cell.Back : (((num11 & 2) != 0) ? this.cell.Right : (((num11 & 4) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
cell = (((num9 & 8) != 0) ? this.cell.Left : (((num9 & 4) != 0) ? this.cell.Front : (((num9 & 2) != 0) ? this.cell.Right : this.cell.Back)));
cell = (((num11 & 8) != 0) ? this.cell.Left : (((num11 & 4) != 0) ? this.cell.Front : (((num11 & 2) != 0) ? this.cell.Right : this.cell.Back)));
}
if (!cell.IsSnowTile)
{public virtual void DrawTile()
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = 768 + this.cell.shore / num8;
batch.tiles[pass.idx] = 768 + this.cell.shore / num10;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;public virtual void DrawTile()
{
pass.NextBatch();
}
num10 = 2;
num12 = 2;
}
else
{
num10 = cell.sourceFloor.edge;
num12 = cell.sourceFloor.edge;
}
param.tile = (24 + num10 / 2) * 32 + num10 % 2 * 16 + num9;
param.tile = (24 + num12 / 2) * 32 + num12 % 2 * 16 + num11;
rendererShore.Draw(param);
}
}
if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num8) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num8) & 1) != 0)
if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num10) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num10) & 1) != 0)
{
param.tile = 785f;
param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(60);
}
if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num8) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num8) & 1) != 0)
if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num10) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num10) & 1) != 0)
{
param.tile = 786f;
param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(56);
}
if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num8) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num8) & 4) != 0)
if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num10) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num10) & 4) != 0)
{
param.tile = 787f;
param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(48);
}
if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num8) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num8) & 4) != 0)
if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num10) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num10) & 4) != 0)
{
param.tile = 788f;
param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(52);
}
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && !this.cell.hidePillar)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];public virtual void DrawTile()
bool flag6 = false;
if (isShoreSand)
{
if ((num9 & 1) != 0)
if ((num11 & 1) != 0)
{
if ((num9 & 8) != 0)
if ((num11 & 8) != 0)
{
if ((num9 & 2) == 0 && (num9 & 4) == 0)
if ((num11 & 2) == 0 && (num11 & 4) == 0)
{
Draw(16);
}
flag6 = true;
}
if ((num9 & 2) != 0)
if ((num11 & 2) != 0)
{
if ((num9 & 8) == 0 && (num9 & 4) == 0)
if ((num11 & 8) == 0 && (num11 & 4) == 0)
{
Draw(20);
}
flag6 = true;
}
}
if ((num9 & 4) != 0)
if ((num11 & 4) != 0)
{
if ((num9 & 8) != 0)
if ((num11 & 8) != 0)
{
if ((num9 & 2) == 0 && (num9 & 1) == 0)
if ((num11 & 2) == 0 && (num11 & 1) == 0)
{
Draw(24);
}
flag6 = true;
}
if ((num9 & 2) != 0)
if ((num11 & 2) != 0)
{
if ((num9 & 8) == 0 && (num9 & 1) == 0)
if ((num11 & 8) == 0 && (num11 & 1) == 0)
{
Draw(28);
}public virtual void DrawTile()
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((this.cell.shore / num8) & 1) != 0)
if (((this.cell.shore / num10) & 1) != 0)
{
if (isShoreSand)
{public virtual void DrawTile()
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((this.cell.shore / num8) & 8) != 0)
if (((this.cell.shore / num10) & 8) != 0)
{
if (isShoreSand)
{public virtual void DrawTile()
}
}
}
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && !this.cell.hidePillar && !noSlopMode)
{
orgY = param.y;
orgZ = param.z;public virtual void DrawTile()
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num11 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
float num13 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
{
num11 += (float)EMono._map.config.skyBlockHeight;
num13 += (float)EMono._map.config.skyBlockHeight;
}
int num12 = (int)(num11 / heightBlockSize) + 2;
int num14 = (int)(num13 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
{
row4 = EMono.sources.blocks[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num12 == 2) ? 32 : 0);
param.tile = row4._tiles[0] + ((num14 == 2) ? 32 : 0);
param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
}public virtual void DrawTile()
}
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int l = 0; l < num12; l++)
for (int l = 0; l < num14; l++)
{
if (l == num12 - 1)
if (l == num14 - 1)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;public virtual void DrawTile()
{
snowed = false;
}
int num13 = 0;
int num15 = 0;
if (sourceBlock.id != 0)
{
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool num14 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool num16 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool flag7 = false;
if (!num14)
if (!num16)
{
switch (wallClipMode)
{public virtual void DrawTile()
roomHeight = 0f;
break;
}
int num15 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num15) ? this.room.lot.height : num15) + 0.01f * (float)this.room.lot.heightFix;
int num17 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num17) ? this.room.lot.height : num17) + 0.01f * (float)this.room.lot.heightFix;
}
break;
case WallClipMode.ByLot:public virtual void DrawTile()
}
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
num13 = 1;
num15 = 1;
}
else if (lowBlock)
{
num13 = 2;
num15 = 2;
}
param.mat = matBlock;
param.dir = this.cell.blockDir;public virtual void DrawTile()
}
if (!_lowblock)
{
int num17 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num17) ? currentRoom.lot.height : num17) + 0.01f * (float)currentRoom.lot.heightFix;
int num19 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num19) ? currentRoom.lot.height : num19) + 0.01f * (float)currentRoom.lot.heightFix;
}
}
if (flag7)public virtual void DrawTile()
param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2);
param.matColor = room.lot.colDeco2;
float y2 = param.y;
float num18 = param.z;
float num20 = param.z;
param.y += (float)room.lot.decoFix2 * 0.01f;
param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y2;
param.z = num18;
param.z = num20;
}
}
room = this.cell.Right.room ?? this.cell.room;public virtual void DrawTile()
param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2) * -1;
param.matColor = room.lot.colDeco2;
float y4 = param.y;
float num19 = param.z;
float num21 = param.z;
param.y += (float)room.lot.decoFix2 * 0.01f;
param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y4;
param.z = num19;
param.z = num21;
}
}
break;public virtual void DrawTile()
}
param.x = orgX;
}
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar && !this.cell.Left.isToggleWallPillar)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);public virtual void DrawTile()
}
else
{
int num20 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num20) ? room4.lot.height : num20) + 0.01f * (float)room4.lot.heightFix;
int num22 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num22) ? room4.lot.height : num22) + 0.01f * (float)room4.lot.heightFix;
}
}
Cell back2 = this.cell.Back;public virtual void DrawTile()
RenderData renderData2 = sourceBlock.renderData;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
int num16 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num16 == 0)
int num18 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num18 == 0)
{
renderData2.Draw(param);
}
else
{
renderData2.DrawRepeat(param, num16, sourceBlock.tileType.RepeatSize);
renderData2.DrawRepeat(param, num18, sourceBlock.tileType.RepeatSize);
}
param.tile = renderData2.idShadow;
SourcePref shadowPref2 = renderData2.shadowPref;
int shadow2 = shadowPref2.shadow;
passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow2], shadowPref2, 0, param.snow);
int shadow3 = shadowPref2.shadow;
passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow3], shadowPref2, 0, param.snow);
break;
}
case BlockRenderMode.Floor:public virtual void DrawTile()
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_71aa;
goto IL_71b5;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_71aa;
goto IL_71b5;
}
}
}
goto IL_720a;
IL_71aa:
goto IL_7215;
IL_71b5:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num13;
param.tile = num15;
rendererFov.Draw(param);
}
goto IL_720a;
IL_7d3b:
goto IL_7215;
IL_7d7f:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
int num21 = 0;
int num23 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;public virtual void DrawTile()
param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow3 = liquidLv == 0;
float num22 = 0f;
float num23 = 0f;
bool shadow4 = liquidLv == 0;
float num24 = 0f;
float num25 = 0f;
bool flag10 = false;
float num26 = 0f;
bool flag11 = false;
float num27 = 0f;
bool flag10 = false;
float num28 = 0f;
bool flag11 = false;
float num29 = 0f;
if (detail.things.Count > 0 && isSeen)
{
_ = zSetting.max1;
float num28 = 0f;
float num30 = 0f;
for (int m = 0; m < detail.things.Count; m++)
{
Thing t = detail.things[m];public virtual void DrawTile()
{
pref = rendererObjDummy.shadowPref;
}
float num29 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
float num31 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
{
thingPos.y -= num22;
thingPos -= altitudeFix * num23;
thingPos.y -= num24;
thingPos -= altitudeFix * num25;
}
shadow4 = thingPos.y < 0.16f && num29 < 0.16f && t.altitude >= 0;
if (flag10 && t.altitude > 0)
{
shadow4 = false;
}
shadow3 = thingPos.y < 0.16f && num27 < 0.16f;
_ = pref.bypassShadow;
param.shadowFix = 0f - thingPos.y;
param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);public virtual void DrawTile()
SetRoofHeight(param, this.cell, cx, cz);
_actorPos.x = param.x;
_actorPos.y = param.y;
_actorPos.z = param.z + num28;
_actorPos.z = param.z + num30;
if (this.room != null)
{
param.color = GetRoofLight(this.room.lot);
}
shadow3 = false;
shadow4 = false;
param.liquidLv = 0;
}
else
{
param.snow = snowed;
_actorPos.x = orgX + num25;
_actorPos.x = orgX + num27;
_actorPos.y = orgY;
_actorPos.z = orgZ + num28 + thingPos.z;
_actorPos.z = orgZ + num30 + thingPos.z;
if (tileType.CanStack || !isInstalled)
{
if (thing?.id != t.id)public virtual void DrawTile()
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
{
thingPos.y -= num22;
thingPos.y -= num24;
if (thing != null)
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
_actorPos.y -= num22;
_actorPos.y -= num24;
}
_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
}public virtual void DrawTile()
freePos.z += rampFix2.z;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num27 += rampFix2.y;
num29 += rampFix2.y;
}
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)public virtual void DrawTile()
}
else if (!flag11 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
{
orgY += num29 + (float)t.altitude * altitudeFix.y;
orgY += num31 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num29 + (float)t.altitude * altitudeFix.y;
freePos.y += num31 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num27 += num29 + (float)t.altitude * altitudeFix.y;
num29 += num31 + (float)t.altitude * altitudeFix.y;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
liquidLv -= (int)(num29 * 150f);
liquidLv -= (int)(num31 * 150f);
if (liquidLv < 0)
{
liquidLv = 0;public virtual void DrawTile()
}
else
{
thingPos.y += num29;
thingPos.y += num31;
if (tileType.UseMountHeight)
{
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow)
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow && !this.cell.toggleOcclusion)
{
if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
{public virtual void DrawTile()
flag10 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
shadow3 = false;
shadow4 = false;
param.liquidLv = 0;
if (t.freePos)
{public virtual void DrawTile()
}
else
{
thingPos.y += num29;
thingPos.y += num31;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;public virtual void DrawTile()
if (t.isFloating && isWater && !hasBridge && !flag)
{
flag = true;
float num30 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num30;
float num32 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num32;
if (!t.trait.IsChangeFloorHeight)
{
num26 = num29;
num28 = num31;
}
_actorPos.y += 0.01f * floatY - num30;
_actorPos.y += 0.01f * floatY - num32;
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;public virtual void DrawTile()
}
param.liquidLv = liquidLv;
}
num22 = num29;
num24 = num31;
if (t.sourceCard.multisize && !t.trait.IsGround)
{
num28 += zSetting.multiZ;
num30 += zSetting.multiZ;
}
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)public virtual void DrawTile()
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
{
num24 += (float)t.altitude;
num23 = t.altitude;
num26 += (float)t.altitude;
num25 = t.altitude;
}
}
if (num24 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
if (num26 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
continue;
}public virtual void DrawTile()
{
if (iconMode != CardIconMode.None)
{
int num31 = 0;
int num33 = 0;
switch (iconMode)
{
case CardIconMode.Visibility:
if (t.isMasked)
{
num31 = 17;
num33 = 17;
}
break;
case CardIconMode.State:
if (t.placeState == PlaceState.installed)
{
num31 = 18;
num33 = 18;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
{
num31 = 14;
num33 = 14;
}
break;
}
if (t.isNPCProperty && !EMono.debug.godBuild)
{
num31 = 13;
num33 = 13;
}
if (num31 != 0)
if (num33 != 0)
{
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num31);
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num33);
}
}
t.SetRenderParam(param);public virtual void DrawTile()
_actorPos.x = EMono.pc.renderer.position.x;
_actorPos.y = EMono.pc.renderer.position.y - pref.height;
_actorPos.z = EMono.pc.renderer.position.z + 0.02f;
t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow3 || tileType.AlwaysShowShadow));
t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow));
});
}
else
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow3 || tileType.AlwaysShowShadow));
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow));
}
}
if (isInstalled)
{
num25 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
num27 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
}
param.x = orgX;
param.y = orgY;public virtual void DrawTile()
}
}
}
orgY += num26;
orgY += num28;
if (detail.charas.Count <= 0)
{
return;
}
param.shadowFix = 0f - num27;
param.shadowFix = 0f - num29;
param.color += 1310720f;
float max = zSetting.max2;
for (int num32 = 0; num32 < detail.charas.Count; num32++)
for (int num34 = 0; num34 < detail.charas.Count; num34++)
{
Chara chara = detail.charas[num32];
Chara chara = detail.charas[num34];
if (chara.host != null)
{
continue;public virtual void DrawTile()
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num33 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
float num35 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
_actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : (-1));
_actorPos.y = position.y + num33;
_actorPos.y = position.y + num35;
_actorPos.z = position.z + getRestrainPos.z;
param.liquidLv = 0;
param.shadowFix = orgY - _actorPos.y;public virtual void DrawTile()
{
if (chara.IsDeadOrSleeping && chara.IsPCC)
{
float num34 = chara.renderer.data.size.y * 0.3f;
float num36 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num35 = thingPos.y + num34;
float num36 = (float)num32 * -0.01f;
if (num35 > zSetting.thresh1)
float num37 = thingPos.y + num36;
float num38 = (float)num34 * -0.01f;
if (num37 > zSetting.thresh1)
{
num36 = zSetting.mod1;
num38 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num36;
_actorPos.z += renderSetting.laydownZ + num38;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num34 * 0.8f;
thingPos.y += num36 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
elsepublic virtual void DrawTile()
{
if (chara.Pref.FloatUnderwater)
{
float num37 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num38 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num38 - num37;
_actorPos.y += 0.01f * num38 - num37;
param.shadowFix -= 0.01f * num38 - num37;
float num39 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num40 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num40 - num39;
_actorPos.y += 0.01f * num40 - num39;
param.shadowFix -= 0.01f * num40 - num39;
}
}
else if (liquidLv > 0)public virtual void DrawTile()
{
if (liquidLv > 20)
{
float num39 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num39;
_actorPos.y += 0.01f * floatY - num39;
int num40 = TileType.FloorWaterShallow.LiquidLV * 10;
num40 -= (int)(floatY * 0.5f);
param.liquidLv = num40;
float num41 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num41;
_actorPos.y += 0.01f * floatY - num41;
int num42 = TileType.FloorWaterShallow.LiquidLV * 10;
num42 -= (int)(floatY * 0.5f);
param.liquidLv = num42;
}
else
{public virtual void DrawTile()
}
if (!chara.IsPC && EMono.pc.host != chara && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
{
_actorPos += renderSetting.charaPos[1 + ((num21 < 4) ? num21 : 3)];
_actorPos += renderSetting.charaPos[1 + ((num23 < 4) ? num23 : 3)];
}
_actorPos.z += 0.01f * (float)num32 + renderSetting.charaZ;
num21++;
_actorPos.z += 0.01f * (float)num34 + renderSetting.charaZ;
num23++;
if (flag10)
{
_actorPos.z += chara.renderer.data.hangedFixZ;public virtual void DrawTile()
param.y = orgY;
param.z = orgZ;
}
return;
IL_720a:
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
{
snowed = true;
}
if (this.cell.effect != null)
{
if (this.cell.effect.IsLiquid)
{
SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
param.tile = tile + this.cell.sourceEffect._tiles[0];
param.mat = defaultMaterial;
param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
sourceEffect.renderData.Draw(param);
}
else
{
param.tile = this.cell.effect.source._tiles[0];
SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
if (sourceEffect2.anime.Length != 0)
{
if (sourceEffect2.anime.Length > 2)
{
float num41 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num41 >= (float)sourceEffect2.anime[0]))
{
param.tile += num41;
}
}
else
{
float num42 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num42;
}
}
if (this.cell.effect.IsFire)
{
rendererEffect.Draw(param);
}
else
{
this.cell.effect.source.renderData.Draw(param);
}
}
}
param.color = floorLight;
if (this.cell.critter != null)
{
Critter critter = this.cell.critter;
int snowTile = critter.tile;
if (snowed && critter.SnowTile != 0)
{
critter.x = 0.06f;
critter.y = -0.06f;
snowTile = critter.SnowTile;
}
else
{
critter.Update();
}
pass = passObjSS;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
batch.colors[pass.idx] = floorLight;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (detail != null)
{
TransAnime anime3 = detail.anime;
if (anime3 != null && !anime3.animeBlock)
{
TransAnime anime4 = detail.anime;
param.x += anime4.v.x;
param.y += anime4.v.y;
param.z += anime4.v.z;
}
}
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
SourceObj.Row sourceObj = this.cell.sourceObj;
if (!snowed || sourceObj.snowTile <= 0)
{
param.snow = snowed;
param.mat = this.cell.matObj;
orgY = param.y;
if (param.liquidLv > 0)
{
if (sourceObj.pref.Float)
{
param.y += 0.01f * floatY;
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
}
if (sourceObj.tileType.IsWaterTop)
{
param.liquidLv = 0;
}
else
{
param.liquidLv += sourceObj.pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquid = 1f;
}
else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
{
param.liquidLv = 99 + sourceObj.pref.liquidModMax;
}
}
}
if (sourceObj.useAltColor)
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
}
else
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
}
if (sourceObj.HasGrowth)
{
this.cell.growth.OnRenderTileMap(param);
}
else
{
if (this.cell.autotileObj != 0)
{
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
}
else if (sourceObj.tileType.IsUseBlockDir)
{
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
}
else
{
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
}
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
{
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
}
orgY = param.y;
orgZ = param.z;
param.y += sourceObj.pref.y;
param.z += sourceObj.pref.z;
sourceObj.renderData.Draw(param);
param.y = orgY;
param.z = orgZ;
int shadow4 = sourceObj.pref.shadow;
if (shadow4 > 1 && !this.cell.ignoreObjShadow)
{
passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow4], sourceObj.pref, 0, param.snow);
}
param.y = orgY;
}
}
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
{
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
{
passArea.Add(param, 34f, 0f);
}
break;
}
}
if (detail == null)
{
return;
}
if (highlightArea && detail.area != null)
{
passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
param.tile = detail.footmark.tile;
param.mat = matFloor;
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7d3b;
void Draw(int tile)
{
pass = passEdge;BaseTileSelector โ
public void RefreshMouseInfo(bool force = false)
{
EMono.ui.mouseInfo.textCost.text = num.ToString() ?? "";
}
if (mode.TopHeight(hitPoint) != -1)
if (mode.TopHeight(hitPoint) != 0)
{
text += "hintAltitude".lang(mode.TopHeight(hitPoint).ToString() ?? "");
text += "hintAltitude".lang(((mode.TopHeight(hitPoint) >= 0) ? "+" : "") + mode.TopHeight(hitPoint));
}
if (EMono.scene.actionMode == ActionMode.Picker)
{BiomeProfile โ
public override bool TryCreate(Point p)
int idMaterial = item.GetIdMaterial();
if (idMaterial != -1)
{
cell.objMat = (byte)idMaterial;
cell.objMat = idMaterial;
}
cell.objDir = EScriptable.rnd(8);
if (cell.sourceObj.HasGrowth && !EClass._zone.IsPCFactionOrTent && cell.sourceObj.id != 103)Card โ
public virtual void Die(Element e = null, Card origin = null, AttackSource attacโฆ)
{
Explode(pos, origin);
}
trait.OnDie();
}
public void Explode(Point p, Card origin)public virtual void Rotate(bool reverse = false)
public void ChangeAltitude(int a)
{
altitude += a;
if (altitude < 0)
if (altitude < TileType.MinAltitude)
{
altitude = 0;
altitude = TileType.MinAltitude;
}
if (altitude > TileType.MaxAltitude)
{CardActor โ
private int spriteIndex;
private bool visible = true;
private Vector3 originalScale;
protected static Vector3 tempV;public virtual void OnRender(RenderParam p)
{
this.SetActive(enable: true);
if (!visible)
{
SetVisible(enable: true);
}
SubPassData current = SubPassData.Current;
RenderData data = owner.renderer.data;
if (data.useOffsetBack && owner != EMono.pc.held)public virtual void OnRender(RenderParam p)
{
if (p.dir == 1)
{
goto IL_006a;
goto IL_0079;
}
num = p.dir == 2;
}public virtual void OnRender(RenderParam p)
}
if (num)
{
goto IL_006a;
goto IL_0079;
}
}
tempV.x = p.x + data.offset.x + current.offset.x;
tempV.y = p.y + data.offset.y + current.offset.y;
tempV.z = p.z + data.offset.z + current.offset.z;
goto IL_015c;
IL_006a:
tempV.x = p.x + data.offsetBack.x + current.offset.x;
tempV.y = p.y + data.offsetBack.y + current.offset.y;
tempV.z = p.z + data.offsetBack.z + current.offset.z;
goto IL_015c;
IL_015c:
goto IL_016b;
IL_016b:
if (isPCC)
{
RenderDataPcc renderDataPcc = data as RenderDataPcc;public virtual void OnRender(RenderParam p)
mpb.SetTexture("_MainTex", sr.sprite.texture);
}
}
return;
IL_0079:
tempV.x = p.x + data.offsetBack.x + current.offset.x;
tempV.y = p.y + data.offsetBack.y + current.offset.y;
tempV.z = p.z + data.offsetBack.z + current.offset.z;
goto IL_016b;
}
public virtual void ReloadSprite() sr.sprite = null;
PoolManager.Despawn(base.transform);
}
public void SetVisible(bool enable)
{
if (visible != enable)
{
visible = enable;
if ((bool)sr)
{
sr.enabled = visible;
}
if ((bool)sr2)
{
sr2.enabled = visible;
}
}
}
}CardRenderer โ
public void RemoveExtra(string id)
public override void OnLeaveScreen()
{
isSynced = false;
if (hasActor && (!owner.ExistsOnMap || !data.persistActor || owner.isMasked))
if (hasActor)
{
KillActor();
if (!owner.ExistsOnMap || !data.persistActor || owner.isMasked)
{
KillActor();
}
else if (data.persistActor)
{
actor.SetVisible(enable: false);
}
}
for (int num = listTC.Count - 1; num >= 0; num--)
{Cell โ
public class Cell : WeightCell, IFloodCell
public const int DivAutotile = 12;
public byte _dirs;
public int _block;
public byte _block;
public int _blockMat;
public byte _blockMat;
public int _floor;
public byte _floor;
public int _floorMat;
public byte _floorMat;
public int obj;
public byte obj;
public int objMat;
public byte objVal;
public int _bridge;
public byte objMat;
public int _bridgeMat;
public byte decal;
public int _roofBlock;
public byte _bridge;
public int _roofBlockMat;
public byte _bridgeMat;
public int _deco;
public byte _roofBlock;
public int _decoMat;
public byte _roofBlockMat;
public byte _dirs;
public byte _roofBlockDir;
public byte objVal;
public byte decal;
public byte _deco;
public byte _roofBlockDir;
public byte _decoMat;
public int bridgePillar;
public byte x;public class Cell : WeightCell, IFloodCell
public byte minHeight;
public byte bridgePillar;
public byte highlight;
public ushort lightR; }
}
public bool hidePillar
{
get
{
return bits2[6];
}
set
{
bits2[6] = value;
}
}
public bool toggleOcclusion
{
get
{
return bits2[7];
}
set
{
bits2[7] = value;
}
}
public bool HasObj => obj != 0;
public bool HasBlock => _block != 0;public void Reset()
{
_block = (_blockMat = (_floor = (_floorMat = (obj = (decal = (objVal = (objMat = 0)))))));
_block = (_blockMat = (_floor = (_floorMat = (obj = (objMat = 0)))));
decal = (objVal = 0);
bits.Bits = 0u;
bits2.Bits = 0u;
}public PlantData TryGetPlant()
public void DyeObj(string id)
{
isObjDyed = true;
objMat = (byte)EClass.sources.materials.alias[id].id;
objMat = EClass.sources.materials.alias[id].id;
}
public float GetSurfaceHeight()Chara โ
public override void Die(Element e = null, Card origin = null, AttackSource attaโฆ)
}
EClass._zone.RefreshDeathSentense();
EClass._zone.events.OnCharaDie(this);
trait.OnDie();
}
public void TryDropBossLoot()Core โ
scene.InitPass();
textures.Init();
textures.RefreshTextures();
TileManager.Apply();
SoundManager.current.Reset();
if (debug.validatePref)
{CoreDebug โ
public void InitDebugCommands()
{
if (c.HasObj)
{
c.objMat = (byte)c.sourceObj.DefaultMaterial.id;
c.objMat = c.sourceObj.DefaultMaterial.id;
}
});
});public void InitDebugCommands()
{
if (c.HasObj && c.obj == 79)
{
c.objMat = (byte)c.sourceObj.DefaultMaterial.id;
c.objMat = c.sourceObj.DefaultMaterial.id;
}
});
});+CustomBlockContent โ
File Created
public class CustomBlockContent : CustomSourceContent
{
public override string SourceType => "SourceBlock";
public static CustomBlockContent CreateFromRow(SourceBlock.Row r, ModPackage owner = null)
{
if (owner == null)
{
owner = ModUtil.FindSourceRowPackage(r);
}
return new CustomBlockContent
{
ContentId = "Block/" + r.alias,
SourceId = r.alias,
Owner = owner
};
}
}+CustomCellEffectContent โ
File Created
public class CustomCellEffectContent : CustomSourceContent
{
public override string SourceType => "SourceCellEffect";
public static CustomCellEffectContent CreateFromRow(SourceCellEffect.Row r, ModPackage owner = null)
{
if (owner == null)
{
owner = ModUtil.FindSourceRowPackage(r);
}
return new CustomCellEffectContent
{
ContentId = "CellEffect/" + r.alias,
SourceId = r.alias,
Owner = owner
};
}
}+CustomDecoContent โ
File Created
public class CustomDecoContent : CustomSourceContent
{
public override string SourceType => "SourceDeco";
public static CustomDecoContent CreateFromRow(SourceDeco.Row r, ModPackage owner = null)
{
if (owner == null)
{
owner = ModUtil.FindSourceRowPackage(r);
}
return new CustomDecoContent
{
ContentId = "Deco/" + r.alias,
SourceId = r.alias,
Owner = owner
};
}
}+CustomFloorContent โ
File Created
public class CustomFloorContent : CustomSourceContent
{
public override string SourceType => "SourceFloor";
public static CustomFloorContent CreateFromRow(SourceFloor.Row r, ModPackage owner = null)
{
if (owner == null)
{
owner = ModUtil.FindSourceRowPackage(r);
}
return new CustomFloorContent
{
ContentId = "Floor/" + r.alias,
SourceId = r.alias,
Owner = owner
};
}
}+CustomObjContent โ
File Created
public class CustomObjContent : CustomSourceContent
{
public override string SourceType => "SourceObj";
public static CustomObjContent CreateFromRow(SourceObj.Row r, ModPackage owner = null)
{
if (owner == null)
{
owner = ModUtil.FindSourceRowPackage(r);
}
return new CustomObjContent
{
ContentId = "Obj/" + r.alias,
SourceId = r.alias,
Owner = owner
};
}
}DNA โ
public void Generate(Type _type, Chara model = null)
AddSpecial();
}
AddSpecial();
if (EClass.rnd(3) != 0)
if (EClass.rnd(3) != 0 && lv > 10)
{
IEnumerable<SourceElement.Row> enumerable = EClass.sources.elements.map.Values.Where(delegate(SourceElement.Row row)
{public void Generate(Type _type, Chara model = null)
AddVal(e.id, (!(e.category == "ability")) ? 1 : 100, allowStack: false, (int v) => e.cost[0], allowNegative: false);
}
}
else
{
AddSpecial();
}
cost = cost / 2 - 10;
break;
} }
}
}
if (slot < 0)
if (type == Type.Brain || type == Type.Inferior)
{
slot = 0;
if (slot < 0)
{
slot = 0;
}
}
else if (slot < 1)
{
slot = 1;
}
}public void WriteNote(UINote n, Thing owner = null, Chara tg = null)
n.AddText("NoteText_enc", "isPermaGene".lang(), FontColor.Warning);
}
n.Space(4);
IList<int> vals = this.vals.Copy();
vals = (from i in Enumerable.Range(0, vals.Count / 2)
select new
{
id = vals[i * 2],
value = vals[i * 2 + 1]
} into x
orderby x.id
select x).SelectMany(x => new int[2] { x.id, x.value }).ToList();
if (type == Type.Brain)
{
SourceChara.Row row = EClass.sources.charas.map.TryGetValue(id);public void WriteNote(UINote n, Thing owner = null, Chara tg = null)
string key = row.tactics.IsEmpty(EClass.sources.tactics.map.TryGetValue(row.id)?.id ?? EClass.sources.tactics.map.TryGetValue(row.job)?.id ?? "predator");
n.AddText("NoteText_enc", "gene_info".lang(EClass.sources.tactics.map[key].GetName().ToTitleCase(), ""), FontColor.ButtonGeneral);
}
for (int i = 0; i < vals.Count; i += 2)
for (int num = 0; num < vals.Count; num += 2)
{
int num = vals[i];
int num2 = vals[i + 1];
FontColor color = ((num2 >= 0) ? FontColor.Good : FontColor.Bad);
string @ref = (num + 1).ToString() ?? "";
int num2 = vals[num];
int num3 = vals[num + 1];
FontColor color = ((num3 >= 0) ? FontColor.Good : FontColor.Bad);
string @ref = (num2 + 1).ToString() ?? "";
string text = "";
num2 = Mathf.Abs(num2 / 20) + 1;
text = text + "[" + "*".Repeat(Mathf.Clamp(num2, 1, 5)) + ((num2 > 5) ? "+" : "") + "]";
num3 = Mathf.Abs(num3 / 20) + 1;
text = text + "[" + "*".Repeat(Mathf.Clamp(num3, 1, 5)) + ((num3 > 5) ? "+" : "") + "]";
n.AddText("NoteText_enc", "gene_info_brain".lang(@ref, text), color);
}
return;
}
for (int j = 0; j < vals.Count; j += 2)
for (int num4 = 0; num4 < vals.Count; num4 += 2)
{
Element element = Element.Create(vals[j], vals[j + 1]);
Element element = Element.Create(vals[num4], vals[num4 + 1]);
string text2 = "";
int num3 = element.Value / 10;
int num5 = element.Value / 10;
FontColor color2 = FontColor.Good;
bool flag = false;
string text3 = "";
switch (element.source.category)
{
case "slot":
color2 = FontColor.Myth;
num3 = -1;
num5 = -1;
break;
case "feat":
color2 = FontColor.FoodMisc;
num3 = -1;
num5 = -1;
break;
case "ability":
color2 = FontColor.Topic2;
num3 = -1;
num5 = -1;
if (element.Value < 0)
{
text3 = " (" + "party".lang() + ") ";
}
break;
default:
flag = true;
break;
}
if (num3 >= 0)
if (num5 >= 0)
{
text2 = text2 + "[" + "*".Repeat(Mathf.Clamp(num3, 1, 5)) + ((num3 > 5) ? "+" : "") + "]";
text2 = text2 + "[" + "*".Repeat(Mathf.Clamp(num5, 1, 5)) + ((num5 > 5) ? "+" : "") + "]";
}
if (flag)
{public void WriteNote(UINote n, Thing owner = null, Chara tg = null)
{
color2 = FontColor.Bad;
}
n.AddText("NoteText_enc", "gene_info".lang(element.Name.ToTitleCase(wholeText: true), text2), color2);
n.AddText("NoteText_enc", "gene_info".lang(element.Name.ToTitleCase(wholeText: true) + text3, text2), color2);
}
}GenBounds โ
public void SetBlock(BiomeProfile.Tile t, int x, int z, int idMat = -1)
public void SetFloor(int x, int z, int idMat, int idFloor, int direction = 0)
{
Cell cell = map.cells[x, z];
cell._floorMat = (byte)idMat;
cell._floor = (byte)idFloor;
cell._floorMat = idMat;
cell._floor = idFloor;
cell.floorDir = direction;
}
public void SetBlock(int x, int z, int idMat, int idBlock, int direction = 0)
{
Cell cell = map.cells[x, z];
cell._blockMat = (byte)idMat;
cell._block = (byte)idBlock;
cell._blockMat = idMat;
cell._block = idBlock;
cell.blockDir = direction;
cell.effect = null;
}GoalCombat โ
{
if (tc.pos.HasBridge)
{
EClass._map.SetBridge(tc.pos.x, tc.pos.z, 0, 0, 0, 0, 0);
EClass._map.SetBridge(tc.pos.x, tc.pos.z);
}
else
{
EClass._map.SetBridge(owner.pos.x, owner.pos.z, 0, 0, 0, 0, 0);
EClass._map.SetBridge(owner.pos.x, owner.pos.z);
}
}
if (EClass.debug.logCombat)GrowSystemFlower โ
public override void OnSetObj()
GrowSystem.cell.objDir = EClass.rnd(4);
}
}
public override int GetStageTile()
{
return source._tiles[GrowSystem.cell.objDir % source._tiles.Length];
}
}GrowSystemTreeCoralwood โ
public override void OnSetObj()
{
GrowSystem.cell.isObjDyed = true;
GrowSystem.cell.objDir = EClass.rnd(source.tiles.Length);
GrowSystem.cell.objMat = (byte)EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.tag.Contains("coral")).RandomItem().id;
GrowSystem.cell.objMat = EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.tag.Contains("coral")).RandomItem().id;
}
public override int GetStageTile()LayerMod โ
private UIList.Callback<ModPackage, ItemMod> CreateCallbacks(UIList target, boolโฆ)
onInstantiate = delegate(ModPackage a, ItemMod b)
{
b.package = a;
string s = ELayer.core.mods.packages.IndexOf(a) + 1 + ". " + (a.isInPackages ? "[Local] " : "") + a.title.IsEmpty(a.dirInfo.Name);
b.buttonActivate.mainText.SetText(s, (!a.IsValidVersion() || a.blockedBy != null || !a.langDepError.IsEmpty()) ? FontColor.Bad : (a.activated ? FontColor.ButtonGeneral : FontColor.Passive));
string title = ELayer.core.mods.packages.IndexOf(a) + 1 + ". " + (a.isInPackages ? "[Local] " : "") + a.title.IsEmpty(a.dirInfo.Name);
b.buttonActivate.mainText.SetText(FitTitle(b.buttonActivate.mainText, title), (!a.IsValidVersion() || a.blockedBy != null || !a.langDepError.IsEmpty()) ? FontColor.Bad : (a.activated ? FontColor.ButtonGeneral : FontColor.Passive));
b.buttonActivate.subText.text = a.version;
b.buttonLock.mainText.text = a.author;
b.buttonUp.SetActive(!a.builtin);private UIList.Callback<ModPackage, ItemMod> CreateCallbacks(UIList target, boolโฆ)
{
Move(a, 1);
});
(b.buttonActivate.GetComponent<HoverRelay>() ?? b.buttonActivate.gameObject.AddComponent<HoverRelay>()).onEnter = delegate
b.buttonActivate.GetOrCreate<HoverRelay>().onEnter = delegate
{
ShowInfo(a);
};private UIList.Callback<ModPackage, ItemMod> CreateCallbacks(UIList target, boolโฆ)
};
}
private static string FitTitle(UIText text, string title)
{
TextGenerationSettings generationSettings = text.GetGenerationSettings(Vector2.zero);
TextGenerator cachedTextGeneratorForLayout = text.cachedTextGeneratorForLayout;
float num = text.rectTransform.rect.width * text.pixelsPerUnit;
if (cachedTextGeneratorForLayout.GetPreferredWidth(title, generationSettings) <= num)
{
return title;
}
int num2 = title.Length;
while (num2 > 1 && cachedTextGeneratorForLayout.GetPreferredWidth(title[..num2].TrimEnd() + "..", generationSettings) > num)
{
num2--;
}
return title[..num2].TrimEnd() + "..";
}
private bool Match(BaseModPackage p)
{
if (!searchCache.TryGetValue(p, out var value))Lot โ
{
public static Lot Void = new Lot();
public static Dictionary<int, int> roofCount = new Dictionary<int, int>();
public static Dictionary<long, int> roofCount = new Dictionary<long, int>();
public int id;public void SetBaseRoom(Room r)
{
fullblock = true;
}
foreach (KeyValuePair<int, int> item2 in item.roofCount)
foreach (KeyValuePair<long, int> item2 in item.roofCount)
{
if (!roofCount.ContainsKey(item2.Key))
{public void SetBaseRoom(Room r)
}
}
int num = 0;
int num2 = 0;
foreach (KeyValuePair<int, int> item3 in roofCount)
long num2 = 0L;
foreach (KeyValuePair<long, int> item3 in roofCount)
{
if (item3.Value > num)
{public void SetBaseRoom(Room r)
if (board.data == null)
{
TraitHouseBoard.Data data = (board.data = new TraitHouseBoard.Data());
CoreRef.DefaultRoof defaultRoof = EClass.core.refs.defaultRoofs[EClass.sources.blocks[num2 / 1000].roof];
CoreRef.DefaultRoof defaultRoof = EClass.core.refs.defaultRoofs[EClass.sources.blocks[(int)(num2 >> 32)].roof];
data.height = (fullblock ? 1 : 2);
data.heightFix = (fullblock ? 40 : 0);
data.reverse = EClass.rnd(2) == 0;
data.idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
data.idBlock = defaultRoof.idBlock;
data.idRamp = defaultRoof.idRamp;
SourceMaterial.Row row = EClass.sources.materials[num2 % 1000];
SourceMaterial.Row row = EClass.sources.materials[(int)(num2 & 0xFFFFFFFFu)];
data.colRoof = IntColor.ToInt(row.matColor);
}
RefreshData(board.data);
}
else
{
CoreRef.DefaultRoof defaultRoof2 = EClass.core.refs.defaultRoofs[EClass.sources.blocks[num2 / 1000].roof];
CoreRef.DefaultRoof defaultRoof2 = EClass.core.refs.defaultRoofs[EClass.sources.blocks[(int)(num2 >> 32)].roof];
height = (fullblock ? 1 : 2);
heightFix = (fullblock ? 40 : 0);
idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);public void SetBaseRoom(Room r)
realHeight = (float)height * EClass.setting.render.roomHeightMod + 0.01f * (float)heightFix;
Color matColor = EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f);
colRoof = (colBlock = (colDeco = BaseTileMap.GetColorInt(ref matColor, 100)));
SourceMaterial.Row row2 = EClass.sources.materials[num2 % 1000];
SourceMaterial.Row row2 = EClass.sources.materials[(int)(num2 & 0xFFFFFFFFu)];
colRoof = BaseTileMap.GetColorInt(ref row2.matColor, 100);
}
int num3 = (mx - x + pointMinX.z - z) / 2;Map โ
public class Map : MapBounds, IPathfindGrid
[JsonProperty]
public IO.Compression compression;
[JsonProperty]
public Dictionary<string, int> cellWidths = new Dictionary<string, int>();
[JsonProperty]
public Version version;public class Map : MapBounds, IPathfindGrid
public FowProfile fowProfile;
private static readonly int[] CellIdWidths = new int[3] { 1, 2, 4 };
public bool revealed;
private HashSet<int> roomHash = new HashSet<int>();public void Save(string path, ZoneExportData export = null, PartialMap partial =โฆ)
}
int num5 = num3 * num4;
byte[] array = new byte[num5];
byte[] array2 = new byte[num5];
byte[] array3 = new byte[num5];
byte[] array4 = new byte[num5];
byte[] array5 = new byte[num5];
byte[] array6 = new byte[num5];
byte[] array7 = new byte[num5];
int[] array2 = new int[num5];
int[] array3 = new int[num5];
int[] array4 = new int[num5];
int[] array5 = new int[num5];
int[] array6 = new int[num5];
int[] array7 = new int[num5];
byte[] array8 = new byte[num5];
byte[] array9 = new byte[num5];
byte[] array10 = new byte[num5];
byte[] array11 = new byte[num5];
byte[] array12 = new byte[num5];
byte[] array13 = new byte[num5];
byte[] array14 = new byte[num5];
int[] array13 = new int[num5];
int[] array14 = new int[num5];
byte[] array15 = new byte[num5];
byte[] array16 = new byte[num5];
int[] array16 = new int[num5];
byte[] array17 = new byte[num5];
byte[] array18 = new byte[num5];
byte[] array19 = new byte[num5];
byte[] array20 = new byte[num5];
byte[] array21 = new byte[num5];
int[] array18 = new int[num5];
int[] array19 = new int[num5];
int[] array20 = new int[num5];
int[] array21 = new int[num5];
cellEffects.Clear();
int num6 = 0;
for (int i = num; i < num + num3; i++)public void Save(string path, ZoneExportData export = null, PartialMap partial =โฆ)
array11[num6] = array11[num6].SetBit(0, cell.isWatered);
array11[num6] = array11[num6].SetBit(1, cell.isObjDyed);
array11[num6] = array11[num6].SetBit(2, cell.crossWall);
array11[num6] = array11[num6].SetBit(3, cell.hidePillar);
array11[num6] = array11[num6].SetBit(4, cell.toggleOcclusion);
if (cell.effect != null)
{
cellEffects[j * num4 + i] = cell.effect;public void Save(string path, ZoneExportData export = null, PartialMap partial =โฆ)
}
}
compression = ((!EClass.core.config.test.compressSave) ? IO.Compression.None : IO.Compression.LZ4);
Write(path + "objVals", array);
Write(path + "blocks", array2);
Write(path + "blockMats", array3);
Write(path + "floors", array4);
Write(path + "floorMats", array5);
Write(path + "objs", array6);
Write(path + "objMats", array7);
Write(path + "decal", array8);
Write(path + "flags", array10);
Write(path + "flags2", array11);
Write(path + "dirs", array9);
Write(path + "heights", array12);
Write(path + "bridges", array13);
Write(path + "bridgeMats", array14);
Write(path + "bridgeHeights", array15);
Write(path + "bridgePillars", array16);
Write(path + "roofBlocks", array18);
Write(path + "roofBlockMats", array19);
Write(path + "roofBlockDirs", array17);
Write(path + "decos", array20);
Write(path + "decoMats", array21);
cellWidths.Clear();
Write("objVals", array);
WriteIds("blocks", array2);
WriteIds("blockMats", array3);
WriteIds("floors", array4);
WriteIds("floorMats", array5);
WriteIds("objs", array6);
WriteIds("objMats", array7);
Write("decal", array8);
Write("flags", array10);
Write("flags2", array11);
Write("dirs", array9);
Write("heights", array12);
WriteIds("bridges", array13);
WriteIds("bridgeMats", array14);
Write("bridgeHeights", array15);
WriteIds("bridgePillars", array16);
WriteIds("roofBlocks", array18);
WriteIds("roofBlockMats", array19);
Write("roofBlockDirs", array17);
WriteIds("decos", array20);
WriteIds("decoMats", array21);
things.Sort((Thing a, Thing b) => a.stackOrder - b.stackOrder);
if (export == null)
{public void Save(string path, ZoneExportData export = null, PartialMap partial =โฆ)
things = list;
}
serializedCharas.Clear();
void Write(string _path, byte[] bytes)
void Write(string name, byte[] bytes)
{
IO.WriteLZ4(_path, bytes, compression);
IO.WriteLZ4(path + name, bytes, compression);
}
void WriteIds(string name, int[] ids)
{
int num7 = WriteCellIds(path + name, ids, compression);
if (num7 > 1)
{
cellWidths[name] = num7;
}
}
}public byte[] TryLoadFile(string path, string s, int size)
return array;
}
private static string CellIdPath(string path, int width)
{
if (width != 1)
{
return path + ".w" + width;
}
return path;
}
private static int WriteCellIds(string path, int[] ids, IO.Compression compression)
{
int num = 0;
int[] array = ids;
foreach (int b in array)
{
num = Mathf.Max(num, b);
}
int num2 = ((num <= 255) ? 1 : ((num <= 65535) ? 2 : 4));
byte[] array2 = new byte[ids.Length * num2];
for (int j = 0; j < ids.Length; j++)
{
for (int k = 0; k < num2; k++)
{
array2[j * num2 + k] = (byte)(ids[j] >> 8 * k);
}
}
IO.WriteLZ4(CellIdPath(path, num2), array2, compression);
array = CellIdWidths;
foreach (int num3 in array)
{
if (num3 != num2)
{
string text = CellIdPath(path, num3);
IO.DeleteFile(text);
for (int l = 1; l < 5; l++)
{
IO.DeleteFile(text + ".b" + l);
}
}
}
return num2;
}
private int[] ReadCellIds(string file, string s, int size, int width)
{
byte[] array = IO.ReadLZ4(file, size * width, compression);
if (array == null)
{
return null;
}
if ((width != 1 && width != 2 && width != 4) || array.Length != (long)size * (long)width)
{
Debug.Log("Couldn't load:" + s);
return null;
}
int[] array2 = new int[size];
for (int i = 0; i < size; i++)
{
for (int j = 0; j < width; j++)
{
array2[i] |= array[i * width + j] << 8 * j;
}
}
return array2;
}
public void Load(string path, bool import = false, PartialMap partial = null)
{
if (partial == null)public void Load(string path, bool import = false, PartialMap partial = null)
bounds.SetBounds(0, 0, num - 1, num2 - 1);
}
SetBounds(0, 0, num - 1, num2 - 1);
byte[] bytes = TryLoad("objVals");
byte[] bytes2 = TryLoad("blockMats");
byte[] bytes3 = TryLoad("blocks");
byte[] bytes4 = TryLoad("floorMats");
byte[] bytes5 = TryLoad("floors");
byte[] bytes6 = TryLoad("objs");
byte[] bytes7 = TryLoad("objMats");
byte[] bytes8 = TryLoad("decal");
byte[] bytes9 = TryLoad("decos");
byte[] bytes10 = TryLoad("decoMats");
byte[] bytes11 = TryLoad("dirs");
byte[] bytes12 = TryLoad("flags");
byte[] bytes13 = TryLoad("flags2");
byte[] bytes14 = TryLoad("heights");
byte[] bytes15 = TryLoad("bridges");
byte[] bytes16 = TryLoad("bridgeMats");
byte[] bytes17 = TryLoad("bridgeHeights");
byte[] bytes18 = TryLoad("bridgePillars");
byte[] bytes19 = TryLoad("roofBlocks");
byte[] bytes20 = TryLoad("roofBlockMats");
byte[] bytes21 = TryLoad("roofBlockDirs");
if (bytes18.Length < size)
{
bytes18 = new byte[size];
}
if (bytes.Length < size)
{
bytes = new byte[size];
}
if (bytes13.Length < size)
{
bytes13 = new byte[size];
}
Validate(ref bytes, "objVals");
Validate(ref bytes2, "blockMats");
Validate(ref bytes3, "blocks");
Validate(ref bytes4, "floorMats");
Validate(ref bytes5, "floors");
Validate(ref bytes6, "objs");
Validate(ref bytes7, "objMats");
Validate(ref bytes8, "decal");
Validate(ref bytes9, "decos");
Validate(ref bytes10, "decoMats");
Validate(ref bytes11, "dirs");
Validate(ref bytes12, "flags");
Validate(ref bytes13, "flags2");
Validate(ref bytes14, "heights");
Validate(ref bytes15, "bridges");
Validate(ref bytes16, "bridgeMats");
Validate(ref bytes17, "bridgeHeights");
Validate(ref bytes18, "bridgePillars");
Validate(ref bytes19, "roofBlocks");
Validate(ref bytes20, "roofBlockMats");
Validate(ref bytes21, "roofBlockDirs");
byte[] data = TryLoad("objVals");
int[] data2 = TryLoadIds("blockMats");
int[] data3 = TryLoadIds("blocks");
int[] data4 = TryLoadIds("floorMats");
int[] data5 = TryLoadIds("floors");
int[] data6 = TryLoadIds("objs");
int[] data7 = TryLoadIds("objMats");
byte[] data8 = TryLoad("decal");
int[] data9 = TryLoadIds("decos");
int[] data10 = TryLoadIds("decoMats");
byte[] data11 = TryLoad("dirs");
byte[] data12 = TryLoad("flags");
byte[] data13 = TryLoad("flags2");
byte[] data14 = TryLoad("heights");
int[] data15 = TryLoadIds("bridges");
int[] data16 = TryLoadIds("bridgeMats");
byte[] data17 = TryLoad("bridgeHeights");
int[] data18 = TryLoadIds("bridgePillars");
int[] data19 = TryLoadIds("roofBlocks");
int[] data20 = TryLoadIds("roofBlockMats");
byte[] data21 = TryLoad("roofBlockDirs");
if (data18.Length < size)
{
data18 = new int[size];
}
if (data.Length < size)
{
data = new byte[size];
}
if (data13.Length < size)
{
data13 = new byte[size];
}
Validate<byte>(ref data, "objVals");
Validate<int>(ref data2, "blockMats");
Validate<int>(ref data3, "blocks");
Validate<int>(ref data4, "floorMats");
Validate<int>(ref data5, "floors");
Validate<int>(ref data6, "objs");
Validate<int>(ref data7, "objMats");
Validate<byte>(ref data8, "decal");
Validate<int>(ref data9, "decos");
Validate<int>(ref data10, "decoMats");
Validate<byte>(ref data11, "dirs");
Validate<byte>(ref data12, "flags");
Validate<byte>(ref data13, "flags2");
Validate<byte>(ref data14, "heights");
Validate<int>(ref data15, "bridges");
Validate<int>(ref data16, "bridgeMats");
Validate<byte>(ref data17, "bridgeHeights");
Validate<int>(ref data18, "bridgePillars");
Validate<int>(ref data19, "roofBlocks");
Validate<int>(ref data20, "roofBlockMats");
Validate<byte>(ref data21, "roofBlockDirs");
int num3 = 0;
for (int i = 0; i < num; i++)
{public void Load(string path, bool import = false, PartialMap partial = null)
{
x = (byte)i,
z = (byte)j,
objVal = bytes[num3],
_blockMat = bytes2[num3],
_block = bytes3[num3],
_floorMat = bytes4[num3],
_floor = bytes5[num3],
obj = bytes6[num3],
objMat = bytes7[num3],
decal = bytes8[num3],
_deco = bytes9[num3],
_decoMat = bytes10[num3],
_dirs = bytes11[num3],
height = bytes14[num3],
_bridge = bytes15[num3],
_bridgeMat = bytes16[num3],
bridgeHeight = bytes17[num3],
bridgePillar = bytes18[num3],
_roofBlock = bytes19[num3],
_roofBlockMat = bytes20[num3],
_roofBlockDir = bytes21[num3],
isSeen = bytes12[num3].GetBit(1),
isHarvested = bytes12[num3].GetBit(2),
impassable = bytes12[num3].GetBit(3),
isModified = bytes12[num3].GetBit(4),
isClearSnow = bytes12[num3].GetBit(5),
isForceFloat = bytes12[num3].GetBit(6),
isToggleWallPillar = bytes12[num3].GetBit(7),
isWatered = bytes13[num3].GetBit(0),
isObjDyed = bytes13[num3].GetBit(1),
crossWall = bytes13[num3].GetBit(2)
objVal = data[num3],
_blockMat = data2[num3],
_block = data3[num3],
_floorMat = data4[num3],
_floor = data5[num3],
obj = data6[num3],
objMat = data7[num3],
decal = data8[num3],
_deco = data9[num3],
_decoMat = data10[num3],
_dirs = data11[num3],
height = data14[num3],
_bridge = data15[num3],
_bridgeMat = data16[num3],
bridgeHeight = data17[num3],
bridgePillar = data18[num3],
_roofBlock = data19[num3],
_roofBlockMat = data20[num3],
_roofBlockDir = data21[num3],
isSeen = data12[num3].GetBit(1),
isHarvested = data12[num3].GetBit(2),
impassable = data12[num3].GetBit(3),
isModified = data12[num3].GetBit(4),
isClearSnow = data12[num3].GetBit(5),
isForceFloat = data12[num3].GetBit(6),
isToggleWallPillar = data12[num3].GetBit(7),
isWatered = data13[num3].GetBit(0),
isObjDyed = data13[num3].GetBit(1),
crossWall = data13[num3].GetBit(2),
hidePillar = data13[num3].GetBit(3),
toggleOcclusion = data13[num3].GetBit(4)
});
if (version.IsBelow(0, 23, 344) && cell.bridgePillar == 255)
{
cell.bridgePillar = 0;
cell.hidePillar = true;
}
if (!EClass.sources.floors.map.ContainsKey(cell._bridge))
{
cell._bridge = 0; {
return TryLoadFile(path, s, size);
}
void Validate(ref byte[] reference, string id)
int[] TryLoadIds(string s)
{
int value;
int width = ((cellWidths == null || !cellWidths.TryGetValue(s, out value)) ? 1 : value);
return ReadCellIds(CellIdPath(path + s, width), s, size, width) ?? new int[size];
}
void Validate<T>(ref T[] reference, string id)
{
if (reference.Length < size)
{
Debug.LogError("expection: size invalid:" + id + " " + reference.Length + "/" + size);
reference = new byte[size];
Debug.LogError("exception: size invalid:" + id + " " + reference.Length + "/" + size);
reference = new T[size];
}
}
}public void SetFloor(int x, int z, int idMat = 0, int idFloor = 0)
public void SetFloor(int x, int z, int idMat, int idFloor, int dir)
{
Cell cell = cells[x, z];
cell._floorMat = (byte)idMat;
cell._floor = (byte)idFloor;
cell._floorMat = idMat;
cell._floor = idFloor;
cell.floorDir = dir;
cell.isWatered = false;
Critter.RebuildCritter(cell);public void SetFloor(int x, int z, int idMat, int idFloor, int dir)
public void SetDeco(int x, int z, int idMat, int idDeco)
{
Cell cell = cells[x, z];
cell._decoMat = (byte)idMat;
cell._deco = (byte)idDeco;
cell._decoMat = idMat;
cell._deco = idDeco;
RefreshNeighborTiles(x, z);
}
public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridge = 0, int dir = 0, byte idPillar = 0)
public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridge = 0, int dir = 0, int idPillar = 0, bool hidePillar = false)
{
Cell cell = cells[x, z];
cell.bridgeHeight = (byte)height;
cell._bridgeMat = (byte)idMat;
cell._bridge = (byte)idBridge;
cell._bridgeMat = idMat;
cell._bridge = idBridge;
cell.bridgePillar = idPillar;
cell.hidePillar = hidePillar;
cell.floorDir = dir;
if (cell.room != null)
{public void SetBridge(int x, int z, int height = 0, int idMat = 0, int idBridgeโฆ)
public void SetRoofBlock(int x, int z, int idMat, int idBlock, int dir, int height)
{
Cell cell = cells[x, z];
cell._roofBlockMat = (byte)idMat;
cell._roofBlock = (byte)idBlock;
cell._roofBlockMat = idMat;
cell._roofBlock = idBlock;
cell._roofBlockDir = (byte)(dir + height * 4);
RefreshSingleTile(x, z);
}public void SetBlock(int x, int z, int idMat, int idBlock, int dir)
{
Cell cell = cells[x, z];
bool hasFloodBlock = cell.HasFloodBlock;
cell._blockMat = (byte)idMat;
cell._block = (byte)idBlock;
cell._blockMat = idMat;
cell._block = idBlock;
cell.blockDir = dir;
if (cell.effect == null || !cell.effect.IsFire)
{public void TryAddRoom(int x, int z)
public void SetBlockDir(int x, int z, int dir)
{
Cell cell = cells[x, z];
cell._block = (byte)cell.sourceBlock.id;
cell._block = cell.sourceBlock.id;
cell.blockDir = dir;
}public void ClearRainAndDecal()
public void SetObj(int x, int z, int id = 0, int value = 1, int dir = 0)
{
SetObj(x, z, (byte)EClass.sources.objs[id].DefaultMaterial.id, id, value, dir);
SetObj(x, z, EClass.sources.objs[id].DefaultMaterial.id, id, value, dir);
}
public void SetObj(int x, int z, int idMat, int idObj, int value, int dir, bool ignoreRandomMat = false)public void SetObj(int x, int z, int idMat, int idObj, int value, int dir, boolโฆ)
{
EClass._zone.dirtyElectricity = true;
}
cell.obj = (byte)idObj;
cell.obj = idObj;
cell.objVal = (byte)value;
cell.objMat = (byte)idMat;
cell.objMat = idMat;
cell.objDir = dir;
cell.isHarvested = false;
cell.isObjDyed = false;public void SetObj(int x, int z, int idMat, int idObj, int value, int dir, boolโฆ)
{
num += EClass.pc.Evalue(1656) * 5;
}
cell.objMat = (byte)MATERIAL.GetRandomMaterialFromCategory(num, sourceObj.matCategory.Split(','), cell.matObj).id;
cell.objMat = MATERIAL.GetRandomMaterialFromCategory(num, sourceObj.matCategory.Split(','), cell.matObj).id;
}
if (backerObjs.ContainsKey(cell.index))
{public void MineBlock(Point point, bool recoverBlock = false, Chara c = null, boโฆ)
return;
}
SourceMaterial.Row row = (flag ? point.matRoofBlock : point.matBlock);
byte b = (flag ? point.cell._roofBlock : point.cell._block);
SourceBlock.Row row2 = EClass.sources.blocks[b];
int num = (flag ? point.cell._roofBlock : point.cell._block);
SourceBlock.Row row2 = EClass.sources.blocks[num];
Effect.Get("smoke").Play(point);
Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
.Emit(10 + EClass.rnd(10));public void MineBlock(Point point, bool recoverBlock = false, Chara c = null, boโฆ)
RefreshFOV(point.x, point.z);
if (flag2 && !point.cell.isModified && !flag)
{
if (b == 17 || EClass.rnd(100) == 0)
if (num == 17 || EClass.rnd(100) == 0)
{
zone.AddCard(ThingGen.Create("money2"), point);
}public void MineRamp(Point point, int ramp, bool recoverBlock = false)
if (point.IsValid && point.cell.HasFullBlock)
{
SourceMaterial.Row matBlock = point.matBlock;
byte block = point.cell._block;
int block = point.cell._block;
Effect.Get("smoke").Play(point);
Effect.Get("mine").Play(point).SetParticleColor(point.matBlock.GetColor())
.Emit(10 + EClass.rnd(10));public void MineFloor(Point point, Chara c = null, bool recoverBlock = false, boโฆ)
if (point.cell.HasBridge && removePlatform)
{
DropBlockComponent(EClass.pc.pos, point.sourceBridge, point.matBridge, recoverBlock, isPlatform: true, c);
EClass._map.SetBridge(point.x, point.z, 0, 0, 0, 0, 0);
EClass._map.SetBridge(point.x, point.z);
if (point.IsSky)
{
EClass.pc.Kick(point, ignoreSelf: true);MapGen โ
protected override bool OnGenerateTerrain()
}
else if (biomeProfile2.floor_height != 0 && (int)heights2[num11, num12] + zp.bushMod >= 4)
{
SetFloor(num11, num12, (byte)row3.id, biomeProfile2.floor_height, dir);
SetFloor(num11, num12, row3.id, biomeProfile2.floor_height, dir);
}
else
{
SetFloor(num11, num12, (byte)row3.id, (biomeProfile2.exterior.floor.id != 0) ? biomeProfile2.exterior.floor.id : row3.defFloor, dir);
SetFloor(num11, num12, row3.id, (biomeProfile2.exterior.floor.id != 0) ? biomeProfile2.exterior.floor.id : row3.defFloor, dir);
}
}
}MapGenDungen โ
protected override bool OnGenerateTerrain()
biome.exterior.block.id = (biome.interior.block.id = num);
if (num == 189)
{
biome.exterior.block.mat = (biome.interior.block.mat = (byte)EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.tag.Contains("coral")).RandomItem().id);
biome.exterior.block.mat = (biome.interior.block.mat = EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.tag.Contains("coral")).RandomItem().id);
}
else
{ModPackage โ
public override void GenerateCustomContentProfiles()
{
if (!(sourceRow is SourceThing.Row r6))
{
if (!(sourceRow is SourceFaction.Row) && sourceRow is SourceQuest.Row)
if (!(sourceRow is SourceBlock.Row r7))
{
if (!(sourceRow is SourceFloor.Row r8))
{
if (!(sourceRow is SourceObj.Row r9))
{
if (!(sourceRow is SourceDeco.Row r10))
{
if (!(sourceRow is SourceCellEffect.Row r11))
{
if (!(sourceRow is SourceFaction.Row) && sourceRow is SourceQuest.Row)
{
}
}
else
{
customContent.Add(CustomCellEffectContent.CreateFromRow(r11, this));
}
}
else
{
customContent.Add(CustomDecoContent.CreateFromRow(r10, this));
}
}
else
{
customContent.Add(CustomObjContent.CreateFromRow(r9, this));
}
}
else
{
customContent.Add(CustomFloorContent.CreateFromRow(r8, this));
}
}
else
{
customContent.Add(CustomBlockContent.CreateFromRow(r7, this));
}
}
elsePartialMap โ
public void Apply(Point _point, ApplyMode mode)
{
if (cell._block == 149 && !editMode)
{
c1._block = (byte)interior.block.id;
c1._blockMat = (byte)interior.block.mat;
c1._block = interior.block.id;
c1._blockMat = interior.block.mat;
}
else if (cell._block == 150 && !editMode)
{
c1._block = (byte)exterior.block.id;
c1._blockMat = (byte)exterior.block.mat;
c1._block = exterior.block.id;
c1._blockMat = exterior.block.mat;
}
else
{public void Apply(Point _point, ApplyMode mode)
}
if (cell._floor == 2 && !editMode)
{
c1._floor = (byte)interior.floor.id;
c1._floorMat = (byte)interior.floor.mat;
c1._floor = interior.floor.id;
c1._floorMat = interior.floor.mat;
}
else if (cell._floor == 3 && !editMode)
{
c1._floor = (byte)exterior.floor.id;
c1._floorMat = (byte)exterior.floor.mat;
c1._floor = exterior.floor.id;
c1._floorMat = exterior.floor.mat;
}
else
{public void Apply(Point _point, ApplyMode mode)
c1._bridge = cell._bridge;
c1._bridgeMat = cell._bridgeMat;
c1.bridgePillar = cell.bridgePillar;
c1.hidePillar = cell.hidePillar;
c1.toggleOcclusion = cell.toggleOcclusion;
c1.isModified = true;
if (c1.HasWall)
{Portrait โ
public class Portrait : UIButton
public float charaScale = 1f;
private bool defaultsCached;
private Material defaultMaterial;
private Color defaultColor;
private Vector2 defaultPivot;
private Vector2 defaultAnchoredPosition;
private Vector3 defaultScale;
private bool defaultPreserveAspect;
private FilterMode filter;
public static List<ModItem<Sprite>> ListPlayerPortraits(int gender, bool nullPortrait = false)public static bool Exists(string id)
return modPortraits.dict.ContainsKey(id);
}
private void CacheDefaults()
{
if (!defaultsCached && (bool)portrait)
{
defaultsCached = true;
RectTransform rectTransform = portrait.rectTransform;
defaultMaterial = portrait.material;
defaultColor = portrait.color;
defaultPivot = rectTransform.pivot;
defaultAnchoredPosition = rectTransform.anchoredPosition;
defaultScale = portrait.transform.localScale;
defaultPreserveAspect = portrait.preserveAspect;
}
}
private void RestoreDefaults()
{
if (defaultsCached && (bool)portrait)
{
RectTransform rectTransform = portrait.rectTransform;
portrait.material = defaultMaterial;
portrait.color = defaultColor;
rectTransform.pivot = defaultPivot;
rectTransform.anchoredPosition = defaultAnchoredPosition;
portrait.transform.localScale = defaultScale;
portrait.preserveAspect = defaultPreserveAspect;
}
}
public void SetPerson(Person p)
{
base.gameObject.SetActive(value: true);public Color GetRandomHairColor(Chara c)
public void SetPortrait(bool isPortrait, Sprite spritePortrait, Sprite spriteOverlay = null, Color colorOverlay = default(Color), Sprite spriteFull = null)
{
CacheDefaults();
if (isPortrait)
{
RestoreDefaults();
}
filter = ((isPortrait && Core.Instance.config.test.aaPortrait) ? FilterMode.Bilinear : FilterMode.Point);
portrait.rectTransform.anchorMin = overlay.rectTransform.anchorMin;
portrait.rectTransform.anchorMax = overlay.rectTransform.anchorMax;Recipe โ
public virtual void Build(Chara chara, Card t, Point pos, int mat, int dir, intโฆ)
EClass._map.SetDeco(pos.x, pos.z, mat, (pos.cell._deco == 0) ? tileRow.id : 0);
break;
case "Bridge":
{
if (pos.sourceObj.tileType.RemoveOnFloorChange)
{
EClass._map.SetObj(pos.x, pos.z);
}
byte idPillar = (byte)((tileRow.id == 130) ? 255u : 0u);
EClass._map.SetBridge(pos.x, pos.z, Mathf.Clamp(bridgeHeight + altitude, 0, 255), mat, tileRow.id, dir, idPillar);
EClass._map.SetBridge(pos.x, pos.z, Mathf.Clamp(bridgeHeight + altitude, 0, 255), mat, tileRow.id, dir, 0, tileRow.id == 130);
break;
}
case "Obj":
EClass._map.SetObj(pos.x, pos.z, mat, tileRow.id, 1, dir, ignoreRandomMat: true);
if (tileRow.tag.Contains("dyeable") && EClass.debug.godBuild)
{
EClass._map.SetObj(pos.x, pos.z, tileRow.DefaultMaterial.id, tileRow.id, 1, dir, ignoreRandomMat: true);
pos.cell.DyeObj(EClass.sources.materials.map[mat].alias);
}
else
{
EClass._map.SetObj(pos.x, pos.z, mat, tileRow.id, 1, dir, ignoreRandomMat: true);
}
if (tileType.ChangeBlockDir || pos.growth is GrowSystemTreeSingle)
{
EClass._map.SetBlockDir(pos.x, pos.z, dir);RecipeBridgePillar โ
public class RecipeBridgePillar : Recipe
public override void Build(Chara chara, Card t, Point pos, int mat, int dir, int altitude, int bridgeHeight)
{
if (pos.cell.bridgePillar == tileRow.id)
if (!pos.cell.hidePillar && pos.cell.bridgePillar == tileRow.id)
{
pos.cell.bridgePillar = byte.MaxValue;
pos.cell.bridgePillar = 0;
pos.cell.hidePillar = true;
}
else
{
pos.cell.bridgePillar = (byte)tileRow.id;
pos.cell.bridgePillar = tileRow.id;
pos.cell.hidePillar = false;
}
}RecipeManager โ
public static void BuildList()
Debug.Log("Rebuilding recipe list");
list.Clear();
dict.Clear();
Recipe.recipeCache.Clear();
foreach (CardRow row in EClass.sources.cards.rows)
{
if (!row.isOrigin)public static void Create(RenderRow row, string type, string suffix = "")
recipeSource.type = type;
recipeSource.row = row;
recipeSource.isChara = row is SourceChara.Row;
if (!row.factory.IsEmpty() && !recipeSource.isBridge && !recipeSource.isBridgePillar)
{
string text = row.factory[0];
if (text != "x" && text != "none" && text != "None" && text != "self" && !EClass.sources.cards.map.ContainsKey(text))
{
Debug.LogWarning("Recipe '" + recipeSource.id + "' (" + row.GetAlias + ") has unknown factory '" + text + "'");
recipeSource.noListing = true;
}
}
if (!row.factory.IsEmpty() && row.factory[0] == "x")
{
recipeSource.noListing = true;public List<RecipeSource> ListSources(Thing factory, List<RecipeSource> newRecipโฆ)
if (!EClass.debug.godCraft && !EClass.player.recipes.knownRecipes.ContainsKey(item.id))
{
bool flag = false;
if (item.row.recipeKey != null && item.row.recipeKey.Length != 0 && item.row.recipeKey[0][0] == '*')
if (item.row.recipeKey != null && item.row.recipeKey.Length != 0 && item.row.recipeKey[0].Length > 0 && item.row.recipeKey[0][0] == '*')
{
flag = true;
}RecipeSource โ
{
return EClass.sources.elements.map[6012].GetName();
}
return EClass.sources.cards.map[idFactory].GetName();
if (!EClass.sources.cards.map.TryGetValue(idFactory, out var value))
{
return idFactory;
}
return value.GetName();
}
}Region โ
public void CheckRandomSites()
TryAddZone("temple_undersea");
TryAddZone("curryruin");
TryAddZone("cave_dead");
TryAddZone("oldkeep");
elomap.objmap.UpdateMeshImmediate();
void TryAddZone(string id)
{RenderRow โ
public class RenderRow : SourceData.BaseRow, IRenderSource
public virtual string prefabName => "ThingActor";
public SourceCategory.Row Category => _category ?? (_category = sources.categories.map[category]);
public SourceCategory.Row Category
{
get
{
if (_category == null && !sources.categories.map.TryGetValue(category, out _category))
{
Debug.LogError("#source unknown category '" + category + "' for " + GetType().DeclaringType?.Name + " " + RecipeID + ", using 'obj'");
_category = sources.categories.map["obj"];
}
return _category;
}
}
public string RecipeCat => _recipeCat ?? (_recipeCat = Category.recipeCat);public virtual void SetTiles()
{
if ((bool)renderData && (bool)renderData.pass && _tiles.Length != tiles.Length)
if (!renderData || !renderData.pass)
{
return;
}
if (tiles == null || tiles.Length == 0)
{
_tiles = new int[1];
}
else if (_tiles.Length != tiles.Length)
{
_tiles = new int[tiles.Length];
for (int i = 0; i < tiles.Length; i++)Room โ
public Point pointMaxX;
public Dictionary<int, int> roofCount = new Dictionary<int, int>();
public Dictionary<long, int> roofCount = new Dictionary<long, int>();
public bool HasRoof => lot.idRoofStyle != 0; {
num++;
}
int key = point.sourceBlock.id * 1000 + point.matBlock.id;
if (!roofCount.ContainsKey(key))
{
roofCount[key] = 0;
}
long key = ((long)point.sourceBlock.id << 32) | (uint)point.matBlock.id;
roofCount.TryAdd(key, 0);
roofCount[key]++;
}
if (plate == null)SourceBlock โ
using System;
using System.Collections.Generic;
using UnityEngine;
public class SourceBlock : SourceDataInt<SourceBlock.Row>
{public override void OnAfterImportData()
row.sort = num;
num++;
}
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public override void OnInit() Cell.blockSource = this;
Cell.blockList = rows;
SourceFloor floors = Core.Instance.sources.floors;
foreach (Row row in rows)
foreach (Row row2 in rows)
{
row.Init();
row.sourceAutoFloor = (row.autoFloor.IsEmpty() ? floors[40] : floors.alias[row.autoFloor]);
row2.Init();
SourceFloor.Row row = (row2.autoFloor.IsEmpty() ? null : floors.alias.TryGetValue(row2.autoFloor));
if (row == null && !row2.autoFloor.IsEmpty())
{
Debug.LogWarning($"#source block {row2.id}/{row2.alias} has invalid floor alias '{row2.autoFloor}'");
}
row2.sourceAutoFloor = row ?? floors[40];
}
}
}SourceCard โ
public TraitCrafter GetModelCrafter(string id)
{
return crafters.GetOrCreate(id, () => (map[id].model.trait as TraitCrafter) ?? Trait.SelfFactory);
CardRow value;
return crafters.GetOrCreate(id, () => (map.TryGetValue(id, out value) ? (value.model.trait as TraitCrafter) : null) ?? Trait.SelfFactory);
}
public void AddRow(CardRow row, bool isChara = false)public void AddRow(CardRow row, bool isChara = false)
{
row2.tileType = TileType.Obj;
}
else
else if (!TileType.dict.TryGetValue(row2._tileType, out row2.tileType))
{
row2.tileType = TileType.dict[row2._tileType];
Debug.LogError("#source unknown tile type '" + row2._tileType + "' for thing row " + row2.id);
row2.tileType = TileType.Obj;
}
}
if (!row._origin.IsEmpty())SourceCellEffect โ
public override void OnAfterImportData()
row.sort = num;
num++;
}
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public override void OnInit()SourceDeco โ
public override void OnAfterImportData()
row.sort = num;
num++;
}
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public override void OnInit()SourceFloor โ
using System;
using System.Collections.Generic;
using UnityEngine;
public class SourceFloor : SourceDataInt<SourceFloor.Row>
{public override void OnAfterImportData()
row.sort = num;
num++;
}
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public override void OnInit() public void OnAfterInit()
{
foreach (Row row in rows)
SourceBlock blocks = EClass.sources.blocks;
foreach (Row row2 in rows)
{
row2._defBlock = Resolve(row2, row2.defBlock);
row2._bridgeBlock = Resolve(row2, row2.bridgeBlock);
row2.nonGradient = row2.ContainsTag("nonGradient");
}
SourceBlock.Row Resolve(Row r, string aliasName)
{
row._defBlock = EClass.sources.blocks.alias[row.defBlock];
row._bridgeBlock = EClass.sources.blocks.alias[row.bridgeBlock];
row.nonGradient = row.ContainsTag("nonGradient");
SourceBlock.Row row = blocks.alias.TryGetValue(aliasName);
if (row == null)
{
Debug.LogWarning($"#source floor {r.id}/{r.alias} has invalid block alias '{aliasName}'");
row = blocks[0];
}
return row;
}
}
}SourceImporter โ
public SourceData FindSourceByName(string name)
IList rows = EClass.sources.things.rows;
list = rows;
}
IList list2 = list;
int count = list2.Count;
IList source = list;
HashSet<SourceData.BaseRow> existing = new HashSet<SourceData.BaseRow>(source.OfType<SourceData.BaseRow>());
Debug.Log("#source loading sheet " + sheetName);
ExcelParser.path = file;
ERROR.lastImported = 0;public SourceData FindSourceByName(string name)
}
if (ERROR.lastImported > 0)
{
SourceData.BaseRow[] item = list2.OfType<SourceData.BaseRow>().Skip(count).Take(ERROR.lastImported)
.ToArray();
SourceData.BaseRow[] item = (from r in source.OfType<SourceData.BaseRow>()
where !existing.Contains(r)
select r).Take(ERROR.lastImported).ToArray();
return (sourceData, item);
}
}public static void HotInit(IEnumerable<SourceData> sourceData)
{
Debug.Log("#source resetting data...");
foreach (SourceData sourceDatum in sourceData)
SourceData[] order = new SourceData[7]
{
EClass.sources.elements,
EClass.sources.materials,
EClass.sources.floors,
EClass.sources.decos,
EClass.sources.blocks,
EClass.sources.cellEffects,
EClass.sources.objs
};
List<SourceData> list = sourceData.Distinct().OrderBy(delegate(SourceData s)
{
int num = Array.IndexOf(order, s);
return (num >= 0) ? num : order.Length;
}).ToList();
if (list.Any((SourceData s) => Array.IndexOf(order, s) > 0))
{
if (!list.Contains(EClass.sources.elements))
{
EClass.sources.elements.Init();
}
if (!list.Contains(EClass.sources.materials))
{
EClass.sources.materials.Init();
}
}
if (list.Contains(EClass.sources.blocks) && !list.Contains(EClass.sources.floors))
{
EClass.sources.floors.Init();
}
foreach (SourceData item in list)
{
try
{
sourceDatum.Reset();
sourceDatum.Init();
item.Reset();
item.Init();
}
catch (Exception arg)
{
Debug.LogError($"#source failed to reset dirty data {sourceDatum.GetType().Name}\n{arg}");
Debug.LogError($"#source failed to reset dirty data {item.GetType().Name}\n{arg}");
}
}
if (EClass.sources.blocks.initialized && (list.Contains(EClass.sources.floors) || list.Contains(EClass.sources.blocks)))
{
EClass.sources.floors.OnAfterInit();
}
if (list.Contains(EClass.sources.things) || list.Contains(EClass.sources.charas))
{
EClass.sources.cards.Init();
}
if (list.Any((SourceData s) => s == EClass.sources.blocks || s == EClass.sources.floors || s == EClass.sources.objs || s == EClass.sources.decos || s == EClass.sources.cellEffects))
{
TileManager.ReapplyRows();
}
RecipeManager.rebuild = true;
Debug.Log("#source initialized data");
}SourceMaterial โ
{
row.Init();
row.elementMap = Element.GetElementMap(row.elements);
int tier = row.tier;
if (tier < 0 || tier > 7)
{
Debug.LogWarning($"#source material {row.id}/{row.alias} tier {row.tier} is not within 0~{7}");
row.tier = Mathf.Clamp(row.tier, 0, 7);
}
if (!row.groups.IsEmpty())
{
string[] groups = row.groups;public override void OnAfterImportData()
{
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public void OnImportRow(Row r)SourceObj โ
using System;
using System.Collections.Generic;
using UnityEngine;
public class SourceObj : SourceDataInt<SourceObj.Row>
{ public override void OnInit()
{
objValType = ((!valType.IsEmpty()) ? valType.ToEnum<ObjValType>() : ObjValType.None);
if (valType.IsEmpty())
{
objValType = ObjValType.None;
}
else if (!Enum.TryParse<ObjValType>(valType, ignoreCase: true, out objValType))
{
Debug.LogWarning($"#source obj {id}/{alias} has unknown val type '{valType}', using 'None'");
objValType = ObjValType.None;
}
autoTile = tag.Contains("autotile");
if (!_growth.IsEmpty())
HasGrowth = false;
growth = null;
if (_growth.IsEmpty())
{
return;
}
string arg = "GrowSystem" + _growth[0];
growth = ClassCache.Create<GrowSystem>(arg, "Elin");
if (growth == null)
{
Debug.LogWarning($"#source obj {id}/{alias} has unknown growth class '{arg}', growing disabled");
return;
}
try
{
growth = ClassCache.Create<GrowSystem>("GrowSystem" + _growth[0], "Elin");
growth.Init(this);
HasGrowth = true;
}
else
catch (Exception ex)
{
HasGrowth = false;
Debug.LogWarning($"#source obj {id}/{alias} has invalid _growth '{string.Join(',', _growth)}', growing disabled\n{ex.Message}");
growth = null;
}
}
}public override void OnAfterImportData()
row.sort = num;
num++;
}
rows.Sort((Row a, Row b) => a.id - b.id);
rows.Sort((Row r) => r.id);
}
public override void OnInit()TaskDrawWater โ
SourceFloor.Row row = EClass.sources.floors.alias[id];
if (point.HasBridge)
{
point.cell._bridge = (byte)row.id;
point.cell._bridge = row.id;
if (id == "floor_raw3")
{
point.cell._bridgeMat = 45;}
else
{
point.cell._floor = (byte)row.id;
point.cell._floor = row.id;
if (id == "floor_raw3")
{
point.cell._floorMat = 45;TaskPourWater โ
SourceFloor.Row row = EClass.sources.floors.alias[id];
if (point.HasBridge)
{
point.cell._bridge = (byte)row.id;
point.cell._bridgeMat = (byte)pot.owner.DyeMat.id;
point.cell._bridge = row.id;
point.cell._bridgeMat = pot.owner.DyeMat.id;
}
else
{
point.cell._floor = (byte)row.id;
point.cell._floorMat = (byte)pot.owner.DyeMat.id;
point.cell._floor = row.id;
point.cell._floorMat = pot.owner.DyeMat.id;
}
EClass._map.SetLiquid(point.x, point.z);
point.RefreshNeighborTiles();TextureData โ
public int tileH;
[NonSerialized]
public int extraRows;
[NonSerialized]
public string path;public void Load(bool dateMatched)
{
Debug.Log(path);
}
if (tex.width != texture2D.width || tex.height != texture2D.height)
int num = extraRows * tileH;
if (tex.width != texture2D.width || tex.height != texture2D.height + num)
{
Debug.Log(id + "/" + texture2D.width + "/" + texture2D.height + "/" + path);
tex.Reinitialize(texture2D.width, texture2D.height + num, tex.format, tex.mipmapCount > 1);
}
if (num > 0)
{
tex.SetPixels32(0, 0, tex.width, num, new Color32[tex.width * num]);
}
tex.SetPixels32(texture2D.GetPixels32());
tex.SetPixels32(0, num, texture2D.width, texture2D.height, texture2D.GetPixels32());
tex.Apply();
UnityEngine.Object.Destroy(texture2D);
Debug.Log("Reloaded Texture:" + path);+TileManager โ
File Created
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEngine;
public class TileManager : EClass
{
private struct TileBounds
{
public int left;
public int width;
public int up;
public int down;
}
private class Grid
{
public bool[] used;
public int cols;
public int rows;
public void SetUsedSequence(int linear, int span)
{
for (int i = 0; i < span; i++)
{
int num = linear + i;
if (num >= 0 && num < used.Length)
{
used[num] = true;
}
}
}
public void AddRows(int n)
{
Array.Resize(ref used, cols * (rows + n));
rows += n;
}
}
private class Entry
{
public string source;
public string alias;
public TileRow row;
public FileInfo file;
public FileInfo snowFile;
public int[] tiles;
public string[] growth;
}
private static readonly (string source, Func<IEnumerable<TileRow>> rows)[] _sourceData = new(string, Func<IEnumerable<TileRow>>)[5]
{
("Block", () => EClass.sources.blocks.rows),
("Floor", () => EClass.sources.floors.rows),
("Obj", () => EClass.sources.objs.rows),
("Deco", () => EClass.sources.decos.rows),
("CellEffect", () => EClass.sources.cellEffects.rows)
};
private static readonly List<Entry> _allocated = new List<Entry>();
private static bool _applied;
private const int GrowChunkRows = 8;
private static readonly Dictionary<TextureData, (int w, int h)> _grownTex = new Dictionary<TextureData, (int, int)>();
private static readonly Dictionary<ProceduralMesh, Vector2> _grownMesh = new Dictionary<ProceduralMesh, Vector2>();
private static readonly Dictionary<Material, Vector4> _grownMat = new Dictionary<Material, Vector4>();
private static readonly int _tiling = Shader.PropertyToID("_Tiling");
public static void Apply()
{
if (!_applied)
{
_applied = true;
AllocateTiles();
}
}
private static void AllocateTiles()
{
Dictionary<MeshPass, TextureData> dictionary = BuildPassData();
Dictionary<TextureData, TextureData> dictionary2 = new Dictionary<TextureData, TextureData>();
foreach (TextureData value2 in EClass.core.textures.texMap.Values)โฆ File
TileRow โ
using System;
using UnityEngine;
public class TileRow : RenderRow
{public class TileRow : RenderRow
public void Init()
{
tileType = TileType.dict[_tileType];
if (!TileType.dict.TryGetValue(_tileType, out tileType))
{
Debug.LogError($"#source unknown tile type '{_tileType}' for tile row {id}/{alias}");
tileType = TileType.None;
}
SetRenderData();
OnInit();
}TileType โ
public static TileTypeVine Vine = new TileTypeVine();
public static TileTypeWallArch WallArch = new TileTypeWallArch();
public static TileTypeWallMount WallMount = new TileTypeWallMount();
public static TileTypePaint Paint = new TileTypePaint();public virtual bool CanInstaComplete => false;
public virtual int MinAltitude => 1;
public virtual int MinBridgeAltitude => 1;
public virtual int MinAltitude
{
get
{
if (!EInput.isShiftDown)
{
return 0;
}
return -20;
}
}
public virtual int MaxAltitude
{TileTypeBridgeDeco โ
public class TileTypeBridgeDeco : TileTypeFloor
public override BaseTileSelector.SelectType SelectType => BaseTileSelector.SelectType.Single;
public override int MinAltitude => 1;
public override bool CastShadowSelf => false;
}TileTypeVine โ
using UnityEngine;
public class TileTypeVine : TileTypeObj
{
public override bool CanStack => true;
public override bool IsBlockMount => true;
public override bool UseMountHeight => true;
public override bool UseHangZFix => true;
public override int GetDesiredDir(Point p, int d)
{
if (p.cell.Back.HasFullBlockOrWallOrFence)public override int GetDesiredDir(Point p, int d)
}
return -1;
}
public override void GetMountHeight(ref Vector3 v, Point p, int d, Card target = null)
{
Point.shared2.Set(p.x, p.z);
Vector3 vector = Point.shared2.Position();
v.x = vector.x;
v.y = vector.y + Point.shared2.sourceBlock.tileType.MountHeight;
v.z = vector.z;
v += EClass.screen.tileMap.altitudeFix * target.altitude;
if (target != null)
{
v.z += target.Pref.z;
}
}
}+TileTypeWallArch โ
File Created
public class TileTypeWallArch : TileTypeVine
{
}Trait โ
public virtual void OnSetCardGrid(ButtonGrid b)
{
}
public virtual void OnDie()
{
}
public virtual void OnStepped(Chara c)
{
}public virtual void OnBarter(bool reroll = false)
break;
}
ShopType shopType = ShopType;
if ((uint)(shopType - 24) <= 1u)
{
if (EClass._zone is Zone_Yowyn)
{
Add("milk_kumiromi", EClass.rndHalf(6), 0);
}
if (EClass._zone is Zone_Nefu)
{
Add("milk_horome", EClass.rndHalf(6), 0);
}
}
_ = shopType - 24;
_ = 1;
switch (owner.id)
{
case "rodwyn":TraitDye โ
public override void OnThrowGround(Chara c, Point p)
{
if (p.HasObj)
{
p.cell.objMat = (byte)owner.material.id;
p.cell.objMat = owner.material.id;
p.cell.isObjDyed = true;
owner.Die();
}TraitFakeObj โ
GrowSystem.cell = cell;
cell.objVal = (byte)(owner.dir % obj.growth.StageLength * 30);
cell.objDir = owner.dir;
cell.obj = (byte)owner.refVal;
cell.obj = owner.refVal;
return obj.growth;
}
}TraitSeed โ
public void TrySprout(bool force = false, bool sucker = false, VirtualDate dateโฆ)
if (owner.isDyed && pos.sourceObj.ContainsTag("dyeable"))
{
pos.cell.isObjDyed = true;
pos.cell.objMat = (byte)owner.DyeMat.id;
pos.cell.objMat = owner.DyeMat.id;
}
if (sucker)
{+TraitStrangeStatue โ
File Created
public class TraitStrangeStatue : TraitVase
{
public override void OnDie()
{
if (!EClass._zone.IsRegion && EClass.rnd(2) != 0)
{
Chara chara = EClass._zone.SpawnMob(owner.pos.GetNearestPoint(allowBlock: false, allowChara: false), new SpawnSetting
{
idSpawnList = "c_statue",
filterLv = EClass._zone.DangerLv + 30
});
chara.SetHostility((EClass.rnd(3) != 0) ? Hostility.Enemy : Hostility.Neutral);
Msg.Say("statue_chara", chara, owner);
}
}
}TraitToolBrushStrip โ
public override void TrySetHeldAct(ActPlan p)
SE.Play("build_area");
p.pos.PlayEffect("buff");
p.pos.cell.isObjDyed = false;
p.pos.cell.objMat = (byte)p.pos.sourceObj.DefaultMaterial.id;
p.pos.cell.objMat = p.pos.sourceObj.DefaultMaterial.id;
return false;
});
}UIInventory โ
{
if (_owner.trait.CurrencyRerollShop == CurrencyType.BlueCapsule)
{
if (EMono.pc.GetCurrency("drug_blue") < cost)
if (!EMono.debug.enable && EMono.pc.GetCurrency("drug_blue") < cost)
{
SE.Beep();
Msg.Say("notEnoughSomething", EMono.sources.things.map["drug_blue"].GetName());Wall โ
{
public static Map map;
public byte id;
public int id;
public byte idMat;
public int idMat;
public SourceBlock.Row source => Cell.blockSource[id];Zone โ
flag = true;
}
break;
case "oldkeep":
if (!(this is Zone_OldKeep))
{
flag = true;
}
break;
}
Zone topZone = GetTopZone();
if (!flag)}
Crawler.Create("ore").CrawlUntil(tries: EClass.rnd((int)((float)(map.bounds.Width * map.bounds.Height / 200 + 1) * OreChance + 2f)), map: EClass._map, onStart: () => EClass._map.bounds.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
{
byte b = 18;
int num = 18;
string text = "ore";
if (EClass.rnd(5) == 0)
{
b++;
num++;
text = "gem";
}
SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(DangerLv, text);{
if (point.sourceBlock.ContainsTag("ore"))
{
map.SetObj(point.x, point.z, randomMaterial.id, b, 1, 0);
map.SetObj(point.x, point.z, randomMaterial.id, num, 1, 0);
}
}
return false;+Zone_OldKeep โ
File Created
public class Zone_OldKeep : Zone_Civilized
{
public override bool AllowCriminal => true;
public override ZoneTransition.EnterState RegionEnterState => ZoneTransition.EnterState.Bottom;
public override string GetNewZoneID(int level)
{
if (level <= -1)
{
return "oldkeep_dungeon";
}
return base.GetNewZoneID(level);
}
}+Zone_OldKeepDungeon โ
File Created
using UnityEngine;
public class Zone_OldKeepDungeon : Zone_QuestDungeon
{
public const int LvBoss = -5;
public bool IsBossLv => base.lv == -5;
public override int DangerLv => 33 + Mathf.Abs(base.lv);
public override bool LockExit => base.lv <= -1;
public override bool CanUnlockExit => EClass.game.quests.IsStarted<QuestCurry>();
public override string idExport
{
get
{
if (base.lv != -5)
{
return base.idExport;
}
return "curry_boss";
}
}
public override bool HasLaw => IsBossLv;
public override bool SetAlarmOnBreakLaw => IsBossLv;
public override void OnGenerateMap()
{
if (IsBossLv)
{
SetAlarm(enable: false);
FindChara("doga").SetHostility(Hostility.Enemy);
return;
}
PlaceRail();
EClass._map.ForeachCell(delegate(Cell c)
{
if (EClass.rnd(5) != 0 && c._block != 0 && !c.HasObj && !c.isSurrounded && !c.hasDoor)
{
c.GetSharedPoint().SetObj(24, 1, EClass.rnd(3));
}
});
base.OnGenerateMap();
}
public override void SetAlarm(bool enable)
{
base.SetAlarm(enable);
if (!enable)
{
return;
}
foreach (Thing thing in EClass._map.things)
{
if (thing.IsInstalled && thing.id == "candle3")
{
thing.c_lightColor = 30720;
thing.RecalculateFOV();
}
}
SetBGM(110);
}
}