EA 23.316 Nightly โ
June 13, 2026
32 files modified.
Important Changes โ
Possible breaking changes. Click the filename to view the chunk.
CustomDramaExpansion (1) โ
public static bool add_item(DramaManager dm, Dictionary<string, string> line, string itemId, string materialAlias = "wood", int lv = -1, int count = 1)
public static bool add_item(DramaManager dm, Dictionary<string, string> line, string itemId, string materialAlias = "", int lv = -1, int count = 1) Map (1) โ
public void TryShatter(Point pos, int ele, int power)
public void TryShatter(Point pos, int ele, int power, Card CC = null) ABILITY โ
public class ABILITY
{
public const int ActMoneyDump = 5058;
public const int ActMoneyThrow = 5057;
public const int ActDreamBug = 6020;
public const int AI_PlayMusic = 6001;
public const int ActMoneyThrow = 5057;
public const int ActMoneyDump = 5058;
public const int ActMoneySlap = 5056;
public const int ActHeadpat = 6904;
public const int ActKiss = 6628;
public const int ActDeepKiss = 6629;
public const int ActInsult = 6630;
public const int ActSwarm = 6662;
public const int ActKiss = 6628;
public const int ActBladeStorm = 6664;
public const int ActBladeStorm2 = 6665;
public const int ActMissileBarrage = 6667;
public const int StMama = 6701;
public const int StManaCost = 6720;
public const int ActWombDark = 6801;
public const int StMama = 6701;
public const int StTaunt = 6700;
public const int ActDeathSentense = 6802;
public static readonly int[] IDS = new int[146]
{
5058, 6020, 6019, 6018, 6015, 6013, 6012, 6011, 6003, 6001,
5057, 5056, 5055, 5054, 5053, 5052, 6050, 6400, 6410, 6420,
5057, 6020, 6019, 6018, 6015, 6013, 6012, 6011, 6003, 6001,
5058, 5056, 5055, 5054, 5053, 5052, 6050, 6400, 6410, 6420,
6621, 6620, 6613, 6612, 6611, 6610, 6608, 5051, 6606, 6604,
6603, 6602, 6601, 6600, 6500, 6450, 6605, 6622, 5050, 5048,
5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 50210, 50209, 6626, 50207, 50206, 50212, 50205, 50203, 50202, 50201,
50200, 8796, 8795, 50204, 8794, 50213, 50215, 5031, 5030, 5029,
5028, 5027, 5026, 50214, 5025, 5023, 5022, 5021, 5020, 5019,
50216, 5024, 8793, 50208, 6904, 6629, 6630, 6631, 6640, 6641,
6642, 6650, 6660, 6661, 7000, 6662, 6628, 6664, 6665, 6666,
50216, 5024, 8793, 50208, 6904, 6628, 6629, 6630, 6631, 6640,
6641, 6642, 6650, 6660, 6661, 7000, 6662, 6664, 6665, 6666,
6663, 6800, 6903, 6902, 6901, 6900, 6753, 6752, 6751, 6750,
6667, 6720, 6801, 6701, 6700, 6802
6667, 6701, 6720, 6801, 6700, 6802
};
}
public class Ability : ActAI_Eat โ
public override IEnumerable<Status> Run()
{
EClass.player.forceTalk = true;
owner.Talk("eatammoth");
if (owner.IsPC)
{
Steam.GetAchievement(ID_Achievement.MAMMOTH);
}
}
}
turn++;AI_Fuck โ
public override IEnumerable<Status> Run()
}
cc.Say((this.variation == Variation.Slime) ? "slime_start" : ((this.variation == Variation.Bloodsuck) ? "suck_start" : (Type.ToString() + "_start")), cc, tc);
isFail = () => !tc.IsAliveInCurrentZone || tc.Dist(owner) > 3;
maxProgress = ((this.variation == Variation.NTR || this.variation == Variation.Bloodsuck) ? 10 : 25);
if (Type == FuckType.tame)
{
cc.SetTempHand(1104, -1);
}
maxProgress = ((this.variation == Variation.NTR || this.variation == Variation.Bloodsuck) ? 10 : 25);
Variation variation = this.variation;
if ((uint)(variation - 3) <= 2u)
{public override IEnumerable<Status> Run()
target.AddCondition<ConEntangle>(500, force: true);
break;
}
for (int i = 0; i < maxProgress; i++)
int i;
for (i = 0; i < maxProgress; i++)
{
progress = i;
if (owner.host != target)public override IEnumerable<Status> Run()
}
break;
}
int num5 = ((cc.HasElement(1216) || tc.HasElement(1216)) ? 100 : 20);
int num = ((cc.HasElement(1216) || tc.HasElement(1216)) ? 100 : 20);
if (this.variation == Variation.MotherMilk)
{
num5 *= 5;
num *= 5;
}
if (num5 > EClass.rnd(100))
if (num > EClass.rnd(100))
{
((EClass.rnd(2) == 0) ? cc : tc).PlayEffect("love2");
}public override IEnumerable<Status> Run()
break;
}
case FuckType.tame:
{
int num = 100;
if (!tc.IsAnimal)
if (i == 0 || i == 10)
{
cc.Talk("goodBoy");
}
if (i % 5 == 0)
{
tc.PlaySound("brushing");
}
if (cc.Tool != null && cc.Tool.Evalue(770) > 0)
{
foreach (Chara item in cc.pos.ListCharasInRadius(cc, 2 + cc.Tool.Evalue(770) / 10, (Chara c) => true))
{
if (cc == tc || item != cc)
{
Brush(item);
if (cc.isDead)
{
break;
}
}
}
}
else
{
num += 50;
Brush(tc);
}
if (tc.IsHuman)
break;
}
}
Finish();
void Brush(Chara c)
{
if (c.interest >= 0)
{
int num2 = 100;
if (!c.IsAnimal)
{
num += 50;
num2 += 50;
}
if (tc.IsInCombat)
if (c.IsHuman)
{
num += 100;
num2 += 50;
}
if (tc == cc)
if (c.IsInCombat)
{
num = 50;
num2 += 100;
}
else if (tc.affinity.CurrentStage < Affinity.Stage.Respected && EClass.rnd((tc.IsPCFaction ? 30 : 10) * 100 / num) == 0)
if (c == cc)
{
tc.AddCondition<ConFear>(60);
num2 = 50;
}
tc.interest -= (tc.IsPCFaction ? 20 : (2 * num / 100));
if (i == 0 || i == 10)
else if (c.affinity.CurrentStage < Affinity.Stage.Respected && EClass.rnd((c.IsPCFaction ? 30 : 10) * 100 / num2) == 0)
{
cc.Talk("goodBoy");
tc.AddCondition<ConFear>(60);
}
c.interest -= (c.IsPCFaction ? 20 : (2 * num2 / 100));
if (i % 5 == 0)
{
tc.PlaySound("brushing");
int num2 = cc.CHA / 2 + cc.Evalue(237) - tc.CHA * 2;
int num3;
if (EClass.rnd(cc.CHA / 2 + cc.Evalue(237)) > EClass.rnd(tc.CHA * num / 100))
int num3 = 0;
int num4 = cc.CHA / 2 + cc.Evalue(237) - c.CHA * 2;
if (EClass.rnd(cc.CHA / 2 + cc.Evalue(237)) > EClass.rnd(c.CHA * num2 / 100))
{
num3 = 5 + Mathf.Clamp(num2 / 20, 0, 20);
num3 = 5 + Mathf.Clamp(num4 / 20, 0, 20);
}
else
{
num3 = -5 + ((!tc.IsPCFaction) ? Mathf.Clamp(num2 / 10, -30, 0) : 0);
num3 = -5 + ((!tc.IsPCFaction) ? Mathf.Clamp(num4 / 10, -30, 0) : 0);
fails++;
}
int num4 = 20;
if (tc.IsPCFactionOrMinion && tc.affinity.CurrentStage >= Affinity.Stage.Love)
int num5 = 20;
if (c.IsPCFactionOrMinion && c.affinity.CurrentStage >= Affinity.Stage.Love)
{
num3 = ((EClass.rnd(3) == 0) ? 4 : 0);
num4 = 10;
num5 = 10;
}
totalAffinity += num3;
tc.ModAffinity(EClass.pc, num3, show: true, showOnlyEmo: true);
cc.elements.ModExp(237, num4);
c.ModAffinity(EClass.pc, num3, show: true, showOnlyEmo: true);
cc.elements.ModExp(237, num5);
if (EClass.rnd(4) == 0)
{
cc.stamina.Mod(-1);
}
}
break;
}
if (c.interest < 0 && c != tc)
{
Msg.Say("tame_end", c);
c.PlaySound("groomed");
c.PlayEffect("heal_tick");
c.hygiene.Mod(15);
if (cc == EClass.pc)
{
EClass.player.stats.brush++;
}
}
}
}
Finish();
}
public void Finish()AI_Idle โ
public override IEnumerable<Status> Run()
owner.Say("use_whip3", owner, c);
owner.PlaySound("whip");
owner.Talk("insult");
if (c.IsPC)
{
Steam.GetAchievement(ID_Achievement.SNAIL);
}
c.PlayAnime(AnimeID.Shiver);
c.OnInsulted();
});AI_Trolley โ
public override IEnumerable<Status> Run()
string idSound = trolley.GetIdSound();
if (owner.IsPC)
{
owner.PlaySound(idSound);
if (trolley.ShouldPlaySound(owner.pos))
{
owner.PlaySound(idSound);
}
else
{
EClass.Sound.Stop(idSound, Mathf.Max(1f, trolley.FadeDuration));
}
}
else if (!(EClass.pc.ai is AI_Trolley))
{
owner.PlaySound(idSound);
if (trolley.ShouldPlaySound(owner.pos))
{
owner.PlaySound(idSound);
}
EClass.Sound.Stop(idSound, Mathf.Max(1f, trolley.FadeDuration));
}
foreach (Chara item in point.ListCharas().ToList())ActEffect โ
public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po
});
}
}
bool flag3 = false;
if (CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
if (e.id == 910)
{
bool flag4 = false;
foreach (Card item in p.ListCards())
{
if (item.isChara)
{
if (item.IsPCFactionOrMinion)
{
flag4 = true;
}
}
else if ((e.id != 910 && e.id != 911) || !item.IsFood || !item.category.IsChildOf("foodstuff"))
{
flag4 = true;
}
}
flag3 = flag4;
EClass._map.TryShatter(p, 910, power, CC);
}
if (!flag3)
if (e.id == 911)
{
if (e.id == 910)
{
EClass._map.TryShatter(p, 910, power);
}
if (e.id == 911)
{
EClass._map.TryShatter(p, 911, power);
}
EClass._map.TryShatter(p, 911, power, CC);
}
foreach (Card item2 in p.ListCards().ToList())
foreach (Card item in p.ListCards().ToList())
{
Card c = item2;
if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item2 == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
Card c = item;
if ((!c.isChara && !c.trait.CanBeAttacked) || (c.IsMultisize && item == CC) || (c.isChara && (c.Chara.host == CC || c.Chara.parasite == CC || c.Chara.ride == CC)))
{
continue;
}void AddCon<T>(int rate, int power) where T : Condition
EffectId.Meteor => 50 + power / 20,
_ => (actref.refThing != null) ? actref.refThing.material.hardness : (30 + power / 20),
};
bool flag5 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
bool flag3 = EClass._zone.HasLaw && !EClass._zone.IsPCFaction && (CC.IsPC || (id == EffectId.Explosive && actref.refThing == null)) && !(EClass._zone is Zone_Vernis);
if (p.HasObj && p.cell.matObj.hardness <= num7)
{
EClass._map.MineObj(p);
if (flag5)
if (flag3)
{
EClass.player.ModKarma(-1);
}void AddCon<T>(int rate, int power) where T : Condition
if (!p.HasObj && p.HasBlock && p.matBlock.hardness <= num7)
{
EClass._map.MineBlock(p);
if (flag5)
if (flag3)
{
EClass.player.ModKarma(-1);
}void AddCon<T>(int rate, int power) where T : Condition
}
if (RapidCount == 0)
{
foreach (Card item3 in list)
foreach (Card item2 in list)
{
if (item3.ExistsOnMap)
if (item2.ExistsOnMap)
{
RapidCount += 2;
ProcAt(id, power, BlessedState.Normal, item3, null, item3.pos, isNeg: true, actref);
ProcAt(id, power, BlessedState.Normal, item2, null, item2.pos, isNeg: true, actref);
}
}
}void AddCon<T>(int rate, int power) where T : Condition
if (flag3)
{
EClass.player.stats.catDepart += list2.Count;
break;
}
else
{
EClass.player.stats.sistersDepart += list2.Count;
}
EClass.player.stats.sistersDepart += list2.Count;
Steam.GetAchievement(ID_Achievement.LITTLEMIG);
break;
}
case EffectId.MagicMap:BaseTileMap โ
public virtual void DrawTile()
fogged = true;
}
}
goto IL_7dad;
IL_7dad:
if (detail.things.Count == 0 && detail.charas.Count == 0)
goto IL_7d72;
IL_16c3:
if (this.cell.isSlopeEdge)
{
return;
float num3 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
{
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
}
else
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
}
for (int j = 0; (float)j < num3 / 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;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num4;
}
}
param.y = orgY;
param.z = orgZ;
}
int num3 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
param.x += rampFix.x;
param.y += rampFix.y;
param.z += rampFix.z;
freePos.x += rampFix.x;
freePos.y += rampFix.y;
freePos.z += rampFix.z;
orgY = param.y;
orgZ = param.z;
int num5 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
SourceBlock.Row row3 = sourceBlock;
num5 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num5 = 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);
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);
rendererWaterBlock.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
orgPos.x = (orgX = param.x);
orgPos.y = (orgY = param.y);
orgPos.z = (orgZ = param.z);
if (flag && liquidLv > 0)
if (showBorder && !this.cell.outOfBounds)
{
if (liquidLv > 10)
param.matColor = 104025f;
if (cx == EMono._map.bounds.x)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cx == EMono._map.bounds.maxX)
{
renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
}
if (cz == EMono._map.bounds.z)
{
renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cz == EMono._map.bounds.maxZ)
{
renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow = liquidLv == 0;
float num4 = 0f;
float num5 = 0f;
float num6 = 0f;
float num7 = 0f;
bool flag6 = false;
float num8 = 0f;
bool flag7 = false;
float num9 = 0f;
if (detail.things.Count > 0 && isSeen)
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
{
_ = zSetting.max1;
float num10 = 0f;
for (int j = 0; j < detail.things.Count; j++)
orgY = param.y;
orgZ = param.z;
SourceBlock.Row defBlock2 = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
if (defBlock2.id != 1)
{
Thing t = detail.things[j];
if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
for (int k = 0; k < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); k++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)k;
defBlock2.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (!sourceFloor.tileType.IsSkipFloor)
{
if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
{
floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
if (snowed)
{
continue;
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
}
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
else
{
pref = rendererObjDummy.shadowPref;
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
}
float num11 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
param.color = floorLight2;
if (this.cell.lotShade)
{
thingPos.y -= num4;
thingPos -= altitudeFix * num5;
floorLight = floorLight2;
}
shadow = thingPos.y < 0.16f && num9 < 0.16f;
_ = pref.bypassShadow;
param.shadowFix = 0f - thingPos.y;
param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
if (t.isRoofItem)
}
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (sourceFloor.anime.Length != 0)
{
param.snow = isSnowCovered && !this.cell.isClearSnow;
SetRoofHeight(param, this.cell, cx, cz);
_actorPos.x = param.x;
_actorPos.y = param.y;
_actorPos.z = param.z + num10;
if (this.room != null)
int num6 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num6;
}
if (this.cell.isDeck)
{
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
{
param.color = GetRoofLight(this.room.lot);
sourceFloor.renderData.subData.Draw(param);
}
shadow = false;
param.liquidLv = 0;
sourceFloor.renderData.Draw(param);
param.z -= 1f;
}
else
{
param.snow = snowed;
_actorPos.x = orgX + num7;
_actorPos.y = orgY;
_actorPos.z = orgZ + num10 + thingPos.z;
if (tileType.CanStack || !isInstalled)
if ((bool)sourceFloor.renderData.subData)
{
if (thing?.id != t.id)
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
}
int num7 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
num7++;
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
num7 += 2;
}
if (num7 != 0)
{
param.tile = 448 + num7 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
}
}
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
{
if (snowed)
{
if (sourceFloor == FLOOR.sourceSnow)
{
_actorPos.x += thingPos.x;
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
}
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
thingPos.y -= num4;
if (thing != null)
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
_actorPos.y -= num4;
pass.NextBatch();
}
_actorPos.z += renderSetting.thingZ + (float)j * -0.01f + zSetting.mod1 * thingPos.y;
}
if (isInstalled)
if (!sourceFloor.ignoreTransition && !snowed)
{
if (t.TileType.IsRamp)
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
orgX += rampFix2.x;
orgY += rampFix2.y;
orgZ += rampFix2.z;
freePos.x += rampFix2.x;
freePos.y += rampFix2.y;
freePos.z += rampFix2.z;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num9 += rampFix2.y;
}
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
{
orgY += num11 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num11 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num9 += num11 + (float)t.altitude * altitudeFix.y;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
liquidLv -= (int)(num11 * 150f);
if (liquidLv < 0)
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
liquidLv = 0;
pass.NextBatch();
}
}
else
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
thingPos.y += num11;
if (tileType.UseMountHeight)
{
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow)
{
if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
{
continue;
}
if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
Room room = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
if (t.trait.AlwaysHideOnLowWall)
{
if (room == null || !room.data.showWallItem)
{
continue;
}
}
else if (t.altitude >= lowWallObjAltitude)
{
continue;
}
}
}
if (tileType.UseHangZFix)
{
flag6 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
shadow = false;
param.liquidLv = 0;
if (t.freePos)
{
_actorPos.x += t.fx;
_actorPos.y += t.fy;
}
}
else
{
thingPos.y += (float)t.altitude * altitudeFix.y;
thingPos.z += (float)t.altitude * altitudeFix.z;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
if (pref.height >= 0f)
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
thingPos.z += pref.z;
pass.NextBatch();
}
}
if (!tileType.UseMountHeight && j > 10)
{
flag7 = true;
}
}
else
}
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num7 == 0)
{
pass = (isWater ? passAutoTileWater : passAutoTile);
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
thingPos.y += num11;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
pass.NextBatch();
}
if (t.isFloating && isWater && !hasBridge && !flag)
}
}
if (isWater)
{
int num8 = 12;
int num9 = this.cell.shore / num8;
int num10 = this.cell.shore % num8;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
Cell cell = ((((uint)num9 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num9 & 2u) != 0) ? this.cell.Right : ((((uint)num9 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
flag = true;
float num12 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num12;
if (!t.trait.IsChangeFloorHeight)
{
num8 = num11;
}
_actorPos.y += 0.01f * floatY - num12;
if (liquidLv > 10)
cell = ((((uint)num9 & 8u) != 0) ? this.cell.Left : ((((uint)num9 & 4u) != 0) ? this.cell.Front : ((((uint)num9 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
}
if (!cell.IsSnowTile)
{
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
pass = passShore;
batch = pass.batches[pass.batchIdx];
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.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num10 = 2;
}
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
else
{
liquidLv = 0;
num10 = cell.sourceFloor.edge;
}
param.liquidLv = liquidLv;
param.tile = (24 + num10 / 2) * 32 + num10 % 2 * 16 + num9;
rendererShore.Draw(param);
}
num4 = num11;
if (t.sourceCard.multisize && !t.trait.IsGround)
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num8) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num8) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Back.shore / num8) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num8) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Front.shore / num8) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num8) & 4u) != 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 && ((uint)(this.cell.Front.shore / num8) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num8) & 4u) != 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)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
num10 += zSetting.multiZ;
pass.NextBatch();
}
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
}
bool flag6 = false;
if (isShoreSand)
{
if (((uint)num9 & (true ? 1u : 0u)) != 0)
{
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
if (((uint)num9 & 8u) != 0)
{
param.liquidLv = 1;
if ((num9 & 2) == 0 && (num9 & 4) == 0)
{
Draw(16);
}
flag6 = true;
}
else if (param.liquidLv > 99 + pref.liquidModMax)
if (((uint)num9 & 2u) != 0)
{
param.liquidLv = 99 + pref.liquidModMax;
if ((num9 & 8) == 0 && (num9 & 4) == 0)
{
Draw(20);
}
flag6 = true;
}
}
}
if (!isInstalled || !tileType.UseMountHeight)
{
if (t.altitude != 0)
if (((uint)num9 & 4u) != 0)
{
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
if (((uint)num9 & 8u) != 0)
{
num6 += (float)t.altitude;
num5 = t.altitude;
if ((num9 & 2) == 0 && (num9 & 1) == 0)
{
Draw(24);
}
flag6 = true;
}
if (((uint)num9 & 2u) != 0)
{
if ((num9 & 8) == 0 && (num9 & 1) == 0)
{
Draw(28);
}
flag6 = true;
}
}
if (num6 >= 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;
}
if (t.freePos)
if (!flag6)
{
if (t.isRoofItem)
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
{
_actorPos.x += t.fx;
_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
Draw(8);
}
else
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
{
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
Draw(12);
}
}
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
{
_actorPos.z += -0.5f;
}
}
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
if (!flag6)
{
if (iconMode != 0)
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
{
int num13 = 0;
switch (iconMode)
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num8) & (true ? 1u : 0u)) != 0)
{
case CardIconMode.Visibility:
if (t.isMasked)
{
num13 = 17;
}
break;
case CardIconMode.State:
if (t.placeState == PlaceState.installed)
if (isShoreSand)
{
num13 = 18;
param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
else
{
num13 = 14;
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
break;
}
if (t.isNPCProperty && !EMono.debug.godBuild)
else
{
num13 = 13;
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
if (num13 != 0)
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num13);
pass.NextBatch();
}
}
t.SetRenderParam(param);
if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
{
param.tile += ((param.tile < 0f) ? (-64) : 64);
}
if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
{
RenderParam _param = new RenderParam(param);
EMono.core.actionsLateUpdate.Add(delegate
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num8) & 8u) != 0)
{
t.SetRenderParam(_param);
_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 && (shadow || tileType.AlwaysShowShadow));
});
}
else
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
if (isInstalled)
{
num7 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
param.color = floorLight;
thing = t;
if (pref.Float)
if (flag)
{
liquidLv = 0;
param.y += 0.01f * floatY;
}
}
if (flag)
{
param.z -= 1f;
}
}
orgY += num8;
if (detail.charas.Count <= 0)
if (this.cell.skipRender)
{
if (this.cell.pcSync)
{
param.tile = 0f;
rendererFov.Draw(param);
}
return;
}
param.shadowFix = 0f - num9;
param.color += 1310720f;
float max = zSetting.max2;
for (int k = 0; k < detail.charas.Count; k++)
if (hasBridge)
{
Chara chara = detail.charas[k];
if (chara.host != null)
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
if (flag)
{
continue;
param.y += 0.01f * floatY;
}
if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
{
if (chara.mimicry != null && chara.mimicry.IsThing)
{
if (flag3 || fogged || !this.cell.isSeen)
{
continue;
}
}
else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
pass = passAutoTile;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
continue;
pass.NextBatch();
}
}
_actorPos.x = orgX;
_actorPos.y = orgY;
_actorPos.z = orgZ;
if (this.cell.IsBlocked && chara.IsAstralBody)
{
_actorPos.z += EMono.setting.render.astralBodyFixZ;
}
chara.SetRenderParam(param);
_ = chara.IsAliveInCurrentZone;
if (chara.isRestrained)
if (this.cell.shadow != 0)
{
TraitShackle restrainer = chara.GetRestrainer();
if (restrainer != null)
if (sourceBridge == FLOOR.sourceSnow)
{
Vector3 getRestrainPos = restrainer.GetRestrainPos;
if (getRestrainPos != default(Vector3))
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = blockLight;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num14 = 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 + num14;
_actorPos.z = position.z + getRestrainPos.z;
param.liquidLv = 0;
param.shadowFix = orgY - _actorPos.y;
chara.renderer.SetFirst(first: true);
chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
param.shadowFix = 0f;
continue;
pass.NextBatch();
}
}
}
if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
{
if (chara.IsDeadOrSleeping && chara.IsPCC)
orgY = param.y;
orgZ = param.z;
param.y += bridgeFix.y;
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num11 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
{
float num15 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num16 = thingPos.y + num15;
float num17 = (float)k * -0.01f;
if (num16 > zSetting.thresh1)
{
num17 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num17;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num15 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
num11 += (float)EMono._map.config.skyBlockHeight;
}
int num12 = (int)(num11 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
{
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num12 == 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));
}
else
{
param.liquidLv = liquidLv;
if (isUnderwater)
{
if (chara.Pref.FloatUnderwater)
{
float num18 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num19 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num19 - num18;
_actorPos.y += 0.01f * num19 - num18;
param.shadowFix -= 0.01f * num19 - num18;
}
}
else if (liquidLv > 0)
{
if (chara.Pref.Float && !flag && !hasBridge)
{
if (liquidLv > 20)
{
float num20 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num20;
_actorPos.y += 0.01f * floatY - num20;
int num21 = TileType.FloorWaterShallow.LiquidLV * 10;
num21 -= (int)(floatY * 0.5f);
param.liquidLv = num21;
}
else
{
param.liquidLv -= 20;
}
}
param.liquidLv += chara.Pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquidLv = 1;
}
else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
{
param.liquidLv = 99 + chara.Pref.liquidModMax;
}
}
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))
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
}
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int l = 0; l < num12; l++)
{
if (l == num12 - 1)
{
_actorPos += renderSetting.charaPos[1 + ((num3 < 4) ? num3 : 3)];
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;
}
_actorPos.z += 0.01f * (float)k + renderSetting.charaZ;
num3++;
if (flag6)
else
{
_actorPos.z += chara.renderer.data.hangedFixZ;
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
}
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
row4.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
}
return;
IL_16c3:
if (this.cell.isSlopeEdge)
if (this.cell._deco != 0)
{
float num22 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
param.mat = matFloor;
param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
param.snow = snowed;
if (sourceDeco.autotile != 0)
{
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
}
else
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
}
for (int l = 0; (float)l < num22 / heightBlockSize; l++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)l;
defBlock.renderData.Draw(param);
if (this.cell.pcSync && EMono.player.lightPower > 0f)
if (this.cell.autotileDeco != 0)
{
float num23 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num23;
param.tile = (26 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
sourceDeco.renderData.Draw(param);
param.z = orgZ;
}
}
param.y = orgY;
param.z = orgZ;
}
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
orgY = param.y;
orgZ = param.z;
int num24 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
SourceBlock.Row row3 = sourceBlock;
num24 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num24 = 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 = num24 + ((!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 = num24 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
sourceDeco.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (showBorder && !this.cell.outOfBounds)
if (!buildMode && this.cell.highlight != 0)
{
param.matColor = 104025f;
if (cx == EMono._map.bounds.x)
{
renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cx == EMono._map.bounds.maxX)
{
renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
}
if (cz == EMono._map.bounds.z)
if (this.cell._block != 0 && !this.cell.hasDoor)
{
renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
}
else if (cz == EMono._map.bounds.maxZ)
else
{
renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
}
}
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
orgY = param.y;
orgZ = param.z;
SourceBlock.Row defBlock2 = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
if (defBlock2.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
for (int m = 0; m < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); m++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)m;
defBlock2.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
snowed = false;
}
if (!sourceFloor.tileType.IsSkipFloor)
int num13 = 0;
if (sourceBlock.id != 0)
{
if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
{
floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
if (snowed)
{
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
}
else
{
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
}
param.color = floorLight2;
if (this.cell.lotShade)
{
floorLight = floorLight2;
}
}
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (sourceFloor.anime.Length != 0)
{
int num25 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num25;
}
if (this.cell.isDeck)
{
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
param.z -= 1f;
}
else
{
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
}
int num26 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
num26++;
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
num26 += 2;
}
if (num26 != 0)
{
param.tile = 448 + num26 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
}
}
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
{
if (snowed)
{
if (sourceFloor == FLOOR.sourceSnow)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
}
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (!sourceFloor.ignoreTransition && !snowed)
{
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
}
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num26 == 0)
{
pass = (isWater ? passAutoTileWater : passAutoTile);
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
if (isWater)
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool num14 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool flag7 = false;
if (!num14)
{
int num27 = 12;
int num28 = this.cell.shore / num27;
int num29 = this.cell.shore % num27;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
Cell cell = ((((uint)num28 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num28 & 2u) != 0) ? this.cell.Right : ((((uint)num28 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
cell = ((((uint)num28 & 8u) != 0) ? this.cell.Left : ((((uint)num28 & 4u) != 0) ? this.cell.Front : ((((uint)num28 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
}
if (!cell.IsSnowTile)
{
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
{
pass = passShore;
batch = pass.batches[pass.batchIdx];
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 / num27;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num29 = 2;
}
else
{
num29 = cell.sourceFloor.edge;
}
param.tile = (24 + num29 / 2) * 32 + num29 % 2 * 16 + num28;
rendererShore.Draw(param);
}
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num27) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num27) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Back.shore / num27) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num27) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Front.shore / num27) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num27) & 4u) != 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 && ((uint)(this.cell.Front.shore / num27) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num27) & 4u) != 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)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
switch (wallClipMode)
{
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
{
pass.NextBatch();
break;
}
}
bool flag8 = false;
if (isShoreSand)
{
if (((uint)num28 & (true ? 1u : 0u)) != 0)
if (currentRoom == null || showFullWall)
{
if (((uint)num28 & 8u) != 0)
{
if ((num28 & 2) == 0 && (num28 & 4) == 0)
{
Draw(16);
}
flag8 = true;
}
if (((uint)num28 & 2u) != 0)
{
if ((num28 & 8) == 0 && (num28 & 4) == 0)
{
Draw(20);
}
flag8 = true;
}
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
}
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
{
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
}
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
{
this.room = this.cell.Right.room;
_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
}
else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
{
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
}
if (((uint)num28 & 4u) != 0)
else
{
if (((uint)num28 & 8u) != 0)
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
{
if ((num28 & 2) == 0 && (num28 & 1) == 0)
if (this.cell.lotWall)
{
Draw(24);
_lowblock = false;
}
flag8 = true;
}
if (((uint)num28 & 2u) != 0)
{
if ((num28 & 8) == 0 && (num28 & 1) == 0)
else if (this.room == currentRoom)
{
Draw(28);
_lowblock = !this.cell.fullWall;
}
flag8 = true;
}
}
if (!flag8)
flag7 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag7)
{
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
{
Draw(8);
}
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
{
Draw(12);
}
_lowblock = false;
}
}
if (!flag8)
{
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
if (this.room == null && alwaysLowblock)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num27) & (true ? 1u : 0u)) != 0)
_lowblock = true;
roomHeight = 0f;
}
if (this.room != null)
{
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
{
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
roomHeight = this.room.lot.realHeight;
break;
}
else
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
roomHeight = 0f;
break;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
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;
}
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
{
_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
if (!_lowblock)
{
pass.NextBatch();
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
}
break;
}
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
if (showFullWall)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num27) & 8u) != 0)
_lowblock = this.room != null;
if (_lowblock)
{
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
_lowblock = false;
}
}
else
else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
_lowblock = true;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
}
else
{
_lowblock = lowBlock;
}
if (this.tileType.RepeatBlock)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
{
pass.NextBatch();
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
}
}
}
if (flag)
{
param.y += 0.01f * floatY;
break;
}
}
if (flag)
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
param.z -= 1f;
num13 = 1;
}
}
if (this.cell.skipRender)
{
if (this.cell.pcSync)
else if (lowBlock)
{
param.tile = 0f;
rendererFov.Draw(param);
num13 = 2;
}
return;
}
if (hasBridge)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
if (flag)
param.mat = matBlock;
param.dir = this.cell.blockDir;
param.snow = snowed;
switch (this.tileType.blockRenderMode)
{
param.y += 0.01f * floatY;
}
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
case BlockRenderMode.FullBlock:
{
pass = passAutoTile;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
bool invisible = sourceBlock.tileType.Invisible;
if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
{
break;
}
if (this.cell.isSurrounded)
{
switch (innerMode)
{
case InnerMode.InnerBlock:
case InnerMode.BuildMode:
blockLight = _baseBrightness + fogBrightness;
param.color = (int)(50f * blockLight) * 262144;
param.matColor = 104025f;
param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
rendererInnerBlock.Draw(param);
return;
case InnerMode.None:
case InnerMode.Height:
param.color = blockLight;
break;
}
}
if (snowed)
{
param.color = floorLight;
}
param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
if (currentRoom != null && !showFullWall)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
{
_lowblock = false;
}
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;
}
}
if (flag7)
{
_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
if (_lowblock)
{
roomHeight = 0f;
}
}
if (invisible)
{
pass.NextBatch();
roomHeight = 0f;
_lowblock = false;
}
}
if (this.cell.shadow != 0)
{
if (sourceBridge == FLOOR.sourceSnow)
if (this.cell.Things.Count > 0)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
_lowblock = false;
}
else
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = blockLight;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
if (!this.cell.hasDoor)
{
pass.NextBatch();
sourceBlock.renderData.Draw(param);
}
}
}
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
{
orgY = param.y;
orgZ = param.z;
param.y += bridgeFix.y;
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num30 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
else
{
num30 += (float)EMono._map.config.skyBlockHeight;
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
}
int num31 = (int)(num30 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
Room room = this.cell.Front.room ?? this.cell.room;
if (room == null && this.cell.Right.room != null)
{
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num31 == 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));
room = this.cell.Right.room;
}
else
if (!invisible && room != null)
{
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
if (room.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco);
param.matColor = room.lot.colDeco;
float y = param.y;
param.y += (float)room.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y;
}
if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2);
param.matColor = room.lot.colDeco2;
float y2 = param.y;
float num18 = 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.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int n = 0; n < num31; n++)
room = this.cell.Right.room ?? this.cell.room;
if (room == null && this.cell.Front.room != null)
{
room = this.cell.Front.room;
}
if (!invisible && room != null)
{
if (n == num31 - 1)
if (room.lot.idDeco != 0 && !this.cell.hasDoor)
{
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;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco) * -1;
param.matColor = room.lot.colDeco;
float y3 = param.y;
param.y += (float)room.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y3;
}
else
if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2) * -1;
param.matColor = room.lot.colDeco2;
float y4 = param.y;
float num19 = 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;
}
row4.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
break;
}
}
if (this.cell._deco != 0)
{
param.mat = matFloor;
param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
param.snow = snowed;
if (sourceDeco.autotile != 0)
case BlockRenderMode.WallOrFence:
{
if (this.cell.autotileDeco != 0)
if (map.config.fullWallHeight)
{
param.tile = (26 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
param.z += ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
sourceDeco.renderData.Draw(param);
param.z = orgZ;
showFullWall = true;
_lowblock = false;
}
}
else
{
param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
sourceDeco.renderData.Draw(param);
}
}
if (!buildMode && this.cell.highlight != 0)
{
if (this.cell._block != 0 && !this.cell.hasDoor)
{
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
}
else
{
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
}
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
snowed = false;
}
int num32 = 0;
if (sourceBlock.id != 0)
{
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool num33 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool flag9 = false;
if (!num33)
{
switch (wallClipMode)
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag8 = blockDir == 1 || _lowblock || flag7;
bool flag9 = blockDir == 0 || _lowblock || flag7;
if (!showFullWall && currentRoom != null)
{
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
if (!flag8)
{
break;
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
{
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
flag8 = true;
}
}
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
{
flag8 = true;
}
}
if (currentRoom == null || showFullWall)
if (!flag9)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
{
if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
flag9 = true;
}
}
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
{
flag9 = true;
}
}
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
}
if (blockDir == 0 || blockDir == 2)
{
param.dir = 0;
Room room2 = this.cell.Front.room ?? this.cell.room;
if (room2 != null && this.tileType.IsWall)
{
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco);
param.matColor = room2.lot.colDeco;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = orgY;
}
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && !flag8 && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
param.matColor = room2.lot.colDeco2;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
}
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
Cell left = this.cell.Left;
if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
this.room = this.cell.Right.room;
_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
_sourceBlock = left.sourceBlock;
param.mat = left.matBlock;
}
else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
else
{
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
this.tileType = _sourceBlock.tileType;
param.tile = (tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock) ? 32 : 0));
if (_sourceBlock.useAltColor)
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
}
else
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
}
if (roomHeight == 0f || flag8 || !this.tileType.RepeatBlock)
{
if (!this.cell.hasDoor)
{
if (this.cell.lotWall)
{
_lowblock = false;
}
else if (this.room == currentRoom)
{
_lowblock = !this.cell.fullWall;
}
_sourceBlock.renderData.Draw(param);
}
}
flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag9)
else
{
_lowblock = false;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
if (this.room == null && alwaysLowblock)
param.z += cornerWallFix2.z;
if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
{
param.snow = true;
}
param.tile = _sourceBlock._tiles[0] + ((flag8 && flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag8 && flag9 && !flag7))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
}
if (this.room != null)
if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix3.x;
param.y += cornerWallFix3.y;
param.z += cornerWallFix3.z;
if (!flag7 && (roomHeight == 0f || flag8))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix.x;
param.y += cornerWallFix.y;
param.z += cornerWallFix.z;
if (!flag7 && (roomHeight == 0f || flag8))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
}
if (blockDir == 1 || blockDir == 2)
{
param.y = orgY;
param.z = orgZ;
param.dir = 1;
Room room3 = this.cell.Right.room ?? this.cell.room;
if (room3 != null && this.tileType.IsWall)
{
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
{
roomHeight = this.room.lot.realHeight;
break;
param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco);
param.matColor = room3.lot.colDeco;
param.y += (float)room3.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = orgY;
}
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag9 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
roomHeight = 0f;
break;
param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco2);
param.matColor = room3.lot.colDeco2;
param.y += (float)room3.lot.decoFix2 * 0.01f;
param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
int num34 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num34) ? this.room.lot.height : num34) + 0.01f * (float)this.room.lot.heightFix;
}
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
{
_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
if (!_lowblock)
Room room4 = this.cell.Right.room;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room4.lot.mh * _heightMod.y;
if (showRoof)
{
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
roomHeight = room4.lot.realHeight;
}
break;
}
if (showFullWall)
{
_lowblock = this.room != null;
if (_lowblock)
else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
{
_lowblock = false;
}
roomHeight = 0f;
}
else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
else
{
_lowblock = true;
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;
}
}
Cell back2 = this.cell.Back;
if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
_sourceBlock = back2.sourceBlock;
param.mat = back2.matBlock;
}
else
{
_lowblock = lowBlock;
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
if (this.tileType.RepeatBlock)
this.tileType = _sourceBlock.tileType;
param.tile = (tile = -_sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock) ? (-32) : 0));
if (_sourceBlock.useAltColor)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
{
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
}
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
}
break;
}
}
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
num32 = 1;
}
else if (lowBlock)
{
num32 = 2;
}
param.mat = matBlock;
param.dir = this.cell.blockDir;
param.snow = snowed;
switch (this.tileType.blockRenderMode)
{
case BlockRenderMode.FullBlock:
{
bool invisible = sourceBlock.tileType.Invisible;
if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
{
break;
}
if (this.cell.isSurrounded)
{
switch (innerMode)
else
{
case InnerMode.InnerBlock:
case InnerMode.BuildMode:
blockLight = _baseBrightness + fogBrightness;
param.color = (int)(50f * blockLight) * 262144;
param.matColor = 104025f;
param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
rendererInnerBlock.Draw(param);
return;
case InnerMode.None:
case InnerMode.Height:
param.color = blockLight;
break;
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
}
}
if (snowed)
{
param.color = floorLight;
}
param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
if (currentRoom != null && !showFullWall)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
param.color += _rightWallShade;
if (roomHeight == 0f || flag9 || !this.tileType.RepeatBlock)
{
_lowblock = false;
if (!this.cell.hasDoor)
{
_sourceBlock.renderData.Draw(param);
}
}
if (!_lowblock)
else
{
int num36 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num36) ? currentRoom.lot.height : num36) + 0.01f * (float)currentRoom.lot.heightFix;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
}
if (flag9)
{
_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
if (_lowblock)
if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
{
roomHeight = 0f;
if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
{
param.snow = true;
}
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (!flag7 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag9))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
param.x = orgX;
}
}
if (invisible)
param.y = orgY;
param.z = orgZ;
break;
}
case BlockRenderMode.HalfBlock:
param.color = floorLight;
_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock);
param.tile = _sourceBlock._tiles[0];
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
sourceBlock.renderData.Draw(param);
break;
case BlockRenderMode.Pillar:
{
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)
{
roomHeight = 0f;
_lowblock = false;
renderData2.Draw(param);
}
if (this.cell.Things.Count > 0)
else
{
_lowblock = false;
renderData2.DrawRepeat(param, num16, sourceBlock.tileType.RepeatSize);
}
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
param.tile = renderData2.idShadow;
SourcePref shadowPref2 = renderData2.shadowPref;
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:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
sourceBlock.renderData.Draw(param);
break;
default:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
{
if (!this.cell.hasDoor)
{
sourceBlock.renderData.Draw(param);
}
sourceBlock.renderData.Draw(param);
}
else
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
}
Room room2 = this.cell.Front.room ?? this.cell.room;
if (room2 == null && this.cell.Right.room != null)
break;
}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_71e1;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
room2 = this.cell.Right.room;
goto IL_71e1;
}
if (!invisible && room2 != null)
{
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco);
param.matColor = room2.lot.colDeco;
float y = param.y;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y;
}
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
param.matColor = room2.lot.colDeco2;
float y2 = param.y;
float num37 = param.z;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y2;
param.z = num37;
}
}
}
goto IL_7241;
IL_71e1:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num13;
rendererFov.Draw(param);
}
goto IL_7241;
IL_7d72:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
int num21 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
{
Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
param.x += rampFix.x;
param.y += rampFix.y;
param.z += rampFix.z;
freePos.x += rampFix.x;
freePos.y += rampFix.y;
freePos.z += rampFix.z;
}
param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
orgPos.x = (orgX = param.x);
orgPos.y = (orgY = param.y);
orgPos.z = (orgZ = param.z);
if (flag && liquidLv > 0)
{
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow = liquidLv == 0;
float num22 = 0f;
float num23 = 0f;
float num24 = 0f;
float num25 = 0f;
bool flag10 = false;
float num26 = 0f;
bool flag11 = false;
float num27 = 0f;
if (detail.things.Count > 0 && isSeen)
{
_ = zSetting.max1;
float num28 = 0f;
for (int m = 0; m < detail.things.Count; m++)
{
Thing t = detail.things[m];
if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
{
continue;
}
room2 = this.cell.Right.room ?? this.cell.room;
if (room2 == null && this.cell.Front.room != null)
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
{
room2 = this.cell.Front.room;
pref = rendererObjDummy.shadowPref;
}
if (!invisible && room2 != null)
float num29 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
{
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco) * -1;
param.matColor = room2.lot.colDeco;
float y3 = param.y;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y3;
}
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2) * -1;
param.matColor = room2.lot.colDeco2;
float y4 = param.y;
float num38 = param.z;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y4;
param.z = num38;
}
thingPos.y -= num22;
thingPos -= altitudeFix * num23;
}
break;
}
case BlockRenderMode.WallOrFence:
{
if (map.config.fullWallHeight)
shadow = 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);
if (t.isRoofItem)
{
showFullWall = true;
_lowblock = false;
param.snow = isSnowCovered && !this.cell.isClearSnow;
SetRoofHeight(param, this.cell, cx, cz);
_actorPos.x = param.x;
_actorPos.y = param.y;
_actorPos.z = param.z + num28;
if (this.room != null)
{
param.color = GetRoofLight(this.room.lot);
}
shadow = false;
param.liquidLv = 0;
}
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag10 = blockDir == 1 || _lowblock || flag9;
bool flag11 = blockDir == 0 || _lowblock || flag9;
if (!showFullWall && currentRoom != null)
else
{
if (!flag10)
param.snow = snowed;
_actorPos.x = orgX + num25;
_actorPos.y = orgY;
_actorPos.z = orgZ + num28 + thingPos.z;
if (tileType.CanStack || !isInstalled)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
if (thing?.id != t.id)
{
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
flag10 = true;
}
_actorPos.x += thingPos.x;
}
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
{
flag10 = true;
thingPos.y -= num22;
if (thing != null)
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
_actorPos.y -= num22;
}
_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
}
if (!flag11)
if (isInstalled)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
if (t.TileType.IsRamp)
{
if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
orgX += rampFix2.x;
orgY += rampFix2.y;
orgZ += rampFix2.z;
freePos.x += rampFix2.x;
freePos.y += rampFix2.y;
freePos.z += rampFix2.z;
if (!this.cell.IsTopWater || t.altitude > 0)
{
flag11 = true;
num27 += rampFix2.y;
}
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
{
flag11 = true;
}
}
}
if (blockDir == 0 || blockDir == 2)
{
param.dir = 0;
Room room3 = this.cell.Front.room ?? this.cell.room;
if (room3 != null && this.tileType.IsWall)
{
if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
else if (!flag11 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco);
param.matColor = room3.lot.colDeco;
param.y += (float)room3.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = orgY;
orgY += num29 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num29 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num27 += num29 + (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);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag10 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
else
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco2);
param.matColor = room3.lot.colDeco2;
param.y += (float)room3.lot.decoFix2 * 0.01f;
param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
thingPos.y += num29;
if (tileType.UseMountHeight)
{
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow)
{
if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
{
continue;
}
if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
Room room5 = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
if (t.trait.AlwaysHideOnLowWall)
{
if (room5 == null || !room5.data.showWallItem)
{
continue;
}
}
else if (t.altitude >= lowWallObjAltitude)
{
continue;
}
}
}
if (tileType.UseHangZFix)
{
flag10 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
shadow = false;
param.liquidLv = 0;
if (t.freePos)
{
_actorPos.x += t.fx;
_actorPos.y += t.fy;
}
}
else
{
thingPos.y += (float)t.altitude * altitudeFix.y;
thingPos.z += (float)t.altitude * altitudeFix.z;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
if (pref.height >= 0f)
{
thingPos.z += pref.z;
}
}
}
Cell left = this.cell.Left;
if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
_sourceBlock = left.sourceBlock;
param.mat = left.matBlock;
}
else
{
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
this.tileType = _sourceBlock.tileType;
param.tile = (tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock) ? 32 : 0));
if (_sourceBlock.useAltColor)
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
}
else
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
}
if (roomHeight == 0f || flag10 || !this.tileType.RepeatBlock)
{
if (!this.cell.hasDoor)
if (!tileType.UseMountHeight && m > 10)
{
_sourceBlock.renderData.Draw(param);
flag11 = true;
}
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
param.z += cornerWallFix2.z;
if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
{
if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
{
param.snow = true;
}
param.tile = _sourceBlock._tiles[0] + ((flag10 && flag11 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag10 && flag11 && !flag9))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
thingPos.y += num29;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
}
if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
if (t.isFloating && isWater && !hasBridge && !flag)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix3.x;
param.y += cornerWallFix3.y;
param.z += cornerWallFix3.z;
if (!flag9 && (roomHeight == 0f || flag10))
{
_sourceBlock.renderData.Draw(param);
}
else
flag = true;
float num30 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num30;
if (!t.trait.IsChangeFloorHeight)
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
num26 = num29;
}
param.x = orgX;
}
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix.x;
param.y += cornerWallFix.y;
param.z += cornerWallFix.z;
if (!flag9 && (roomHeight == 0f || flag10))
_actorPos.y += 0.01f * floatY - num30;
if (liquidLv > 10)
{
_sourceBlock.renderData.Draw(param);
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
else
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
liquidLv = 0;
}
param.x = orgX;
param.liquidLv = liquidLv;
}
}
if (blockDir == 1 || blockDir == 2)
{
param.y = orgY;
param.z = orgZ;
param.dir = 1;
Room room4 = this.cell.Right.room ?? this.cell.room;
if (room4 != null && this.tileType.IsWall)
num22 = num29;
if (t.sourceCard.multisize && !t.trait.IsGround)
{
if (room4.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room4.lot.idDeco);
param.matColor = room4.lot.colDeco;
param.y += (float)room4.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = orgY;
}
if (room4.lot.idDeco2 != 0 && roomHeight != 0f && !flag11 && (float)room4.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room4.lot.idDeco2);
param.matColor = room4.lot.colDeco2;
param.y += (float)room4.lot.decoFix2 * 0.01f;
param.z += (float)room4.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
num28 += zSetting.multiZ;
}
if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
{
Room room5 = this.cell.Right.room;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room5.lot.mh * _heightMod.y;
if (showRoof)
{
roomHeight = room5.lot.realHeight;
}
else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
{
roomHeight = 0f;
param.liquidLv = 1;
}
else
else if (param.liquidLv > 99 + pref.liquidModMax)
{
int num39 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num39) ? room5.lot.height : num39) + 0.01f * (float)room5.lot.heightFix;
param.liquidLv = 99 + pref.liquidModMax;
}
}
Cell back2 = this.cell.Back;
if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
_sourceBlock = back2.sourceBlock;
param.mat = back2.matBlock;
}
else
{
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
this.tileType = _sourceBlock.tileType;
param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock) ? (-32) : 0));
if (_sourceBlock.useAltColor)
}
if (!isInstalled || !tileType.UseMountHeight)
{
if (t.altitude != 0)
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
{
num24 += (float)t.altitude;
num23 = t.altitude;
}
}
else
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)))
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
continue;
}
param.color += _rightWallShade;
if (roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
if (t.freePos)
{
if (!this.cell.hasDoor)
if (t.isRoofItem)
{
_sourceBlock.renderData.Draw(param);
_actorPos.x += t.fx;
_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
}
else
{
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
}
}
else
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
_actorPos.z += -0.5f;
}
if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
}
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
{
if (iconMode != 0)
{
if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
int num31 = 0;
switch (iconMode)
{
param.snow = true;
case CardIconMode.Visibility:
if (t.isMasked)
{
num31 = 17;
}
break;
case CardIconMode.State:
if (t.placeState == PlaceState.installed)
{
num31 = 18;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
{
num31 = 14;
}
break;
}
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (!flag9 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag11))
if (t.isNPCProperty && !EMono.debug.godBuild)
{
_sourceBlock.renderData.Draw(param);
num31 = 13;
}
else
if (num31 != 0)
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num31);
}
param.x = orgX;
}
t.SetRenderParam(param);
if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
{
param.tile += ((param.tile < 0f) ? (-64) : 64);
}
if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
{
RenderParam _param = new RenderParam(param);
EMono.core.actionsLateUpdate.Add(delegate
{
t.SetRenderParam(_param);
_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 && (shadow || tileType.AlwaysShowShadow));
});
}
else
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
}
}
if (isInstalled)
{
num25 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
break;
}
case BlockRenderMode.HalfBlock:
param.color = floorLight;
_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock);
param.tile = _sourceBlock._tiles[0];
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
sourceBlock.renderData.Draw(param);
break;
case BlockRenderMode.Pillar:
{
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 num35 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num35 == 0)
{
renderData2.Draw(param);
}
else
thing = t;
if (pref.Float)
{
renderData2.DrawRepeat(param, num35, sourceBlock.tileType.RepeatSize);
liquidLv = 0;
}
param.tile = renderData2.idShadow;
SourcePref shadowPref2 = renderData2.shadowPref;
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:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
sourceBlock.renderData.Draw(param);
break;
default:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
}
orgY += num26;
if (detail.charas.Count <= 0)
{
return;
}
param.shadowFix = 0f - num27;
param.color += 1310720f;
float max = zSetting.max2;
for (int n = 0; n < detail.charas.Count; n++)
{
Chara chara = detail.charas[n];
if (chara.host != null)
{
continue;
}
if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
{
if (chara.mimicry != null && chara.mimicry.IsThing)
{
sourceBlock.renderData.Draw(param);
if (flag3 || fogged || !this.cell.isSeen)
{
continue;
}
}
else
else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
continue;
}
break;
}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
_actorPos.x = orgX;
_actorPos.y = orgY;
_actorPos.z = orgZ;
if (this.cell.IsBlocked && chara.IsAstralBody)
{
goto IL_721c;
_actorPos.z += EMono.setting.render.astralBodyFixZ;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
chara.SetRenderParam(param);
_ = chara.IsAliveInCurrentZone;
if (chara.isRestrained)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
TraitShackle restrainer = chara.GetRestrainer();
if (restrainer != null)
{
Vector3 getRestrainPos = restrainer.GetRestrainPos;
if (getRestrainPos != default(Vector3))
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num32 = 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 + num32;
_actorPos.z = position.z + getRestrainPos.z;
param.liquidLv = 0;
param.shadowFix = orgY - _actorPos.y;
chara.renderer.SetFirst(first: true);
chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
param.shadowFix = 0f;
continue;
}
}
}
if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
{
if (chara.IsDeadOrSleeping && chara.IsPCC)
{
float num33 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num34 = thingPos.y + num33;
float num35 = (float)n * -0.01f;
if (num34 > zSetting.thresh1)
{
num35 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num35;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num33 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
else
{
goto IL_721c;
param.liquidLv = liquidLv;
if (isUnderwater)
{
if (chara.Pref.FloatUnderwater)
{
float num36 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num37 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num37 - num36;
_actorPos.y += 0.01f * num37 - num36;
param.shadowFix -= 0.01f * num37 - num36;
}
}
else if (liquidLv > 0)
{
if (chara.Pref.Float && !flag && !hasBridge)
{
if (liquidLv > 20)
{
float num38 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num38;
_actorPos.y += 0.01f * floatY - num38;
int num39 = TileType.FloorWaterShallow.LiquidLV * 10;
num39 -= (int)(floatY * 0.5f);
param.liquidLv = num39;
}
else
{
param.liquidLv -= 20;
}
}
param.liquidLv += chara.Pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquidLv = 1;
}
else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
{
param.liquidLv = 99 + chara.Pref.liquidModMax;
}
}
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.z += 0.01f * (float)n + renderSetting.charaZ;
num21++;
if (flag10)
{
_actorPos.z += chara.renderer.data.hangedFixZ;
}
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
}
goto IL_727c;
IL_721c:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num32;
rendererFov.Draw(param);
}
goto IL_727c;
IL_727c:
return;
IL_7241:
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;public virtual void DrawTile()
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7dad;
goto IL_7d72;
void Draw(int tile)
{
pass = passEdge;Chara โ
public void OnInsulted()
{
if (!isDead)
if (isDead)
{
if (HasElement(1231))
{
Talk("insulted");
AddCondition<ConEuphoric>(100 * Evalue(1231));
}
else if (EClass.rnd(20) == 0)
return;
}
if (HasElement(1231))
{
Talk("insulted");
AddCondition<ConEuphoric>(100 * Evalue(1231));
}
else if (EClass.rnd(20) == 0)
{
SetFeat(1231, 1, msg: true);
if (IsPC)
{
SetFeat(1231, 1, msg: true);
Steam.GetAchievement(ID_Achievement.NIRVANA);
}
}
}ConSmoking โ
public override int GetPhase()
return 0;
}
public override void OnStart()
{
base.OnStart();
if (owner.IsPC)
{
Steam.GetAchievement(ID_Achievement.SMOKE);
}
}
public override void Tick()
{
base.Tick();CustomDramaExpansion โ
public static bool console_cmd(DramaManager dm, Dictionary<string, string> line,
}
[ElinDramaActionInvoke(null)]
public static bool add_item(DramaManager dm, Dictionary<string, string> line, string itemId, string materialAlias = "wood", int lv = -1, int count = 1)
public static bool add_item(DramaManager dm, Dictionary<string, string> line, string itemId, string materialAlias = "", int lv = -1, int count = 1)
{
Chara chara = dm.GetChara(line["actor"]);
SourceMaterial.Row row = EClass.sources.materials.alias.TryGetValue(materialAlias, "wood");
Thing t = ThingGen.Create(itemId, row.id, lv).SetNum(count);
int idMat = EClass.sources.materials.alias.TryGetValue(materialAlias)?.id ?? (-1);
Thing t = ThingGen.Create(itemId, idMat, lv).SetNum(count);
chara.Pick(t);
return true;
}DOMAIN โ
{
public const int domLuck = 810;
public const int domEyth = 814;
public const int domFaith = 802;
public const int domOblivion = 813;
public const int domEarth = 812;
public const int domMiracle = 803;
public const int domArcane = 804;
public const int domEyth = 814;
public const int domComm = 805;
public const int domEarth = 812;
public const int domHealing = 811;
public const int domElement = 806;
public const int domHarvest = 808;
public const int domHealing = 811;
public const int domMachine = 809;
public const int domHarmony = 815;
public const int domSurvival = 801;
public const int domFaith = 802;
public const int domTest = 800;
public const int domSurvival = 801;
public static readonly int[] IDS = new int[16]
{
810, 814, 813, 803, 804, 805, 812, 806, 807, 808,
811, 809, 815, 801, 802, 800
810, 802, 813, 812, 803, 804, 814, 805, 811, 806,
807, 808, 809, 815, 800, 801
};
}
public class Domain : EClassDramaOutcome โ
public void upgrade_miscreation()
}
}
Rand.SetSeed();
Steam.GetAchievement(ID_Achievement.UPGRADE);
}
public static bool If(DramaChoice item, Chara c)ELEMENT โ
public const int recharge = 761;
public const int effectRange = 770;
public const int comfort = 750;
public const int _void = 0;
public const int fire = 21;
public static readonly int[] IDS = new int[36]
public static readonly int[] IDS = new int[37]
{
765, 763, 762, 751, 752, 753, 754, 755, 756, 759,
760, 761, 750, 0, 10, 1, 2, 3, 5, 11,
12, 13, 14, 15, 17, 18, 20, 16, 22, 23,
24, 25, 26, 29, 85, 21
760, 761, 770, 750, 0, 10, 1, 2, 3, 5,
11, 12, 13, 14, 15, 17, 18, 20, 16, 22,
23, 24, 25, 26, 29, 85, 21
};
}
public class Element : EClassENC โ
public const int mod_feint = 623;
public const int sustain_END = 441;
public const int sustain_DEX = 442;
public const int mod_flurry = 621;
public const int slowCorruption = 412;
public const int sustain_DEX = 442;
public const int mod_rapid = 602;
public const int creativeChef = 487;
public const int deathagony = 488;
public const int music_drunk = 489;
public const int farsee = 490;
public const int negateGravity = 491;
public const int mod_chaser = 620;
public const int sustain_END = 441;
public const int safetyMeasure = 486;
public const int nonLethal = 485;
public const int mod_rapid = 602;
public const int music_drunk = 489;
public const int optimizeMana = 483;
public const int slot_rune = 484;
public const int sustain_PER = 443;
public const int sustain_LER = 444;
public const int sustain_MAG = 446;
public const int sustain_figure = 450;
public const int sustain_CHA = 447;
public const int slot_rune = 484;
public const int bane_dragon = 460;
public const int bane_fairy = 462;
public const int sustain_CHA = 447;
public const int sustain_figure = 450;
public const int bane_man = 464; {
656, 655, 654, 653, 651, 641, 650, 652, 660, 640,
661, 851, 663, 664, 665, 666, 667, 850, 624, 865,
864, 852, 662, 623, 441, 621, 419, 420, 421, 422,
864, 852, 662, 623, 442, 621, 419, 420, 421, 422,
423, 424, 425, 426, 418, 427, 429, 430, 431, 432,
435, 436, 437, 438, 428, 439, 417, 415, 380, 381,
382, 383, 400, 401, 402, 403, 416, 404, 406, 407,
408, 409, 410, 411, 622, 414, 405, 440, 412, 442,
487, 488, 489, 490, 491, 492, 493, 600, 601, 603,
604, 605, 606, 607, 608, 609, 620, 486, 485, 602,
483, 484, 443, 444, 445, 446, 450, 460, 461, 462,
447, 464, 465, 466, 467, 468, 480, 481, 463, 482
408, 409, 410, 411, 622, 414, 405, 440, 412, 602,
487, 488, 490, 491, 492, 493, 600, 601, 603, 604,
605, 606, 607, 608, 609, 620, 441, 486, 485, 489,
483, 443, 444, 445, 446, 447, 484, 460, 461, 462,
450, 464, 465, 466, 467, 468, 480, 481, 463, 482
};
}FACTION โ
public class FACTION
{
public const int bfRuin = 3702;
public const int bfGeyser = 3701;
public const int bfPlain = 3600;
public const int bfForest = 3601;
public const int bfSnow = 3602;
public const int bfHill = 3603;
public const int bfFertile = 3700;
public const int bfBeach = 3604;
public const int bfGeyser = 3701;
public const int bfSea = 3605;
public const int bfUndersea = 3606;
public const int bfFertile = 3700;
public const int bfPlain = 3600;
public const int bfSea = 3605;
public const int bfCave = 3500;
public const int fLuck = 2118;
public const int bfHill = 3603;
public const int fSafety = 2205;
public const int fRation = 2207;
public const int fAdmin = 2115;
public const int fFood = 2204;
public const int fTaxEvasion = 2119;
public const int fLuck = 2118;
public const int fLoyal = 2117;
public const int fEducation = 2116;
public const int bfTranquil = 3703;
public const int bfRuin = 3702;
public const int fRation = 2207;
public const int fAttraction = 2206;
public const int bfVolcano = 3704;
public const int bfTranquil = 3703;
public const int actBuildMine = 4001;
public const int bfFish = 3706;
public const int bfHunt = 3705;
public const int actBuildInspect = 4006;
public const int actBuildTerrain = 4002;
public const int fAdmin = 2115;
public const int actBuildCut = 4000;
public const int bfStart = 3900;
public const int bfMonster = 3707;
public const int bfHunt = 3705;
public const int bfFish = 3706;
public const int bfVolcano = 3704;
public const int fConstruction = 2003;
public const int fAttraction = 2206;
public const int fSafety = 2205;
public static readonly int[] IDS = new int[53]
{
3702, 3601, 3602, 3603, 3604, 3701, 3606, 3700, 3600, 3605,
3500, 2118, 2205, 2204, 2203, 2202, 2201, 2200, 2120, 2119,
2117, 2116, 3703, 2207, 3704, 4001, 3706, 4006, 4005, 4004,
4003, 4002, 2115, 4000, 3900, 3805, 3804, 3803, 3802, 3801,
3800, 3784, 3783, 3782, 3781, 3780, 3710, 3709, 3708, 3707,
3705, 2003, 2206
3701, 3600, 3601, 3602, 3700, 3604, 3605, 3606, 3500, 3603,
2207, 2115, 2204, 2203, 2202, 2201, 2200, 2120, 2119, 2118,
2117, 2116, 3702, 2206, 3703, 4001, 3705, 4006, 4005, 4004,
4003, 4002, 4000, 3900, 3805, 3804, 3803, 3802, 3801, 3800,
3784, 3783, 3782, 3781, 3780, 3710, 3709, 3708, 3707, 3706,
3704, 2003, 2205
};
}
public class Faction : EClassFortuneRollData โ
public void RefreshPrize()
{
prizes.Clear();
Rand.SetSeed(EClass.game.seed + seed + count);
Rand.SetSeed(EClass.debug.enable ? (-1) : (EClass.game.seed + seed + count));
List<List<string>> list = GetPrizeList();
if ((EClass._zone.IsTown && EClass._zone.lv == 0) || (EClass.game.IsSurvival && EClass._zone is Zone_StartSiteSky))
{public List<List<string>> GetPrizeList()
{
"computer", "834", "1090", "goods_figure", "goods_canvas", "mb_1", "mb_2", "mb_3", "mb_4", "mb_5",
"1174", "1085", "toilet", "714", "nobility", "plat", "1165", "mathammer", "medal", "bbq",
"panty", "beehive", "ticket_resident", "lovepotion", "crystal_sun", "goods_crim"
"panty", "beehive", "ticket_resident", "lovepotion", "crystal_sun", "goods_crim", "ride_boat"
},
new List<string>
{public List<List<string>> GetPrizeList()
"plat",
"1165",
"boat3",
"medal"
"medal",
"ride_boat2",
"play_ride_big",
"scrubber"
}
};
if (EClass.pc.faction.IsGlobalPolicyActive(2712))public void GetPrize(int grade, int seed)
card.c_idRefCard = prize.idRef;
card.rarity = Rarity.Legendary;
break;
case "scrubber":
if (grade == 3)
{
card.rarity = Rarity.Legendary;
card.elements.SetBase(770, 1 + EClass.rnd(25));
}
break;
}
}
if (grade != 3)
{
prize.claimed = true;
}
prize.claimed = true;
}
else
{ID_Achievement โ
PRIEST,
PRIEST2,
MAMA2,
MAMA3
MAMA3,
DIARY,
LITTLEMIG,
MAMMOTH,
NIRVANA,
SMOKE,
SNAIL,
UPGRADE
}InvOwner โ
public ListInteraction ListInteractions(ButtonGrid b, bool context)
}
}
ListInteractions(listInteraction, t, trait, b, context);
if (context && trait is TraitLightSource)
{
listInteraction.Add("customBrightness", 300, delegate
{
UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
uIContextMenu.AddSlider("brightness", (float a) => a.ToString() ?? "", EClass.player.customLightMod, delegate(float b)
{
EClass.player.customLightMod = (int)b;
EClass.pc.RecalculateFOV();
}, 1f, 6f, isInt: true, hideOther: false);
uIContextMenu.Show();
});
}
if (AllowHold(t) && !t.isEquipped && !HasTrader)
{
Interaction item = listInteraction.Add((EClass.pc.held == t) ? "actPick" : "actHold", 60, delegatepublic virtual void ListInteractions(ListInteraction list, Thing t, Trait trait,
});
}
}
if (!LayerChara.Instance)
{
if (trait.CanRead(EClass.pc))
{
list.Add("invRead", 110, delegate
{
t.DoAct(new AI_Read
{
target = t
});
}, "remove");
}
if (trait.CanUse(EClass.pc))
{
list.Add(trait.LangUse, 120, delegate
{
if (trait.OnUse(EClass.pc))
{
EClass.player.EndTurn();
}
}, "use");
}
if (trait.CanDrink(EClass.pc))
{
list.Add("invDrink", 130, delegate
{
t.DoAct(new AI_Drink
{
target = t
});
}, "remove");
}
if (trait.CanEat(EClass.pc))
{
list.Add("invFood", 140, delegate
{
t.DoAct(new AI_Eat
{
cook = false,
target = t
});
}, "remove");
}
if (trait.IsBlendBase)
{
list.Add("invBlend", 150, delegate
{
LayerDragGrid.Create(new InvOwnerBlend(t));
}, "blend");
}
}
if (!context)
{
return;
}
if (trait is TraitCard)
{
list.Add("invCollect", 150, delegate
{
ContentCodex.Collect(t);
});
}
if (!trait.CanName)
{
return;
}
list.Add("changeName", 200, delegate
{
Dialog.InputName("dialogChangeName", t.c_refText.IsEmpty(""), delegate(bool cancel, string text)
{
if (!cancel)
{
t.c_refText = text;
}
});
});
trait.OnListInteraction(list, b, context);
}
public virtual string GetAutoUseLang(ButtonGrid button)InvOwnerEquip โ
public override void ListInteractions(ListInteraction list, Thing t, Trait trait
}
}
});
trait.OnListInteraction(list, b, context);
}
public override bool IsFailByCurse(Thing t)Map โ
public void ModFire(int x, int z, int amount)
}
}
public void TryShatter(Point pos, int ele, int power)
public void TryShatter(Point pos, int ele, int power, Card CC = null)
{
bool flag = false;
if (CC != null && CC.IsPCFactionOrMinion && (CC.HasElement(1651) || EClass.pc.Evalue(1651) >= 2))
{
flag = true;
}
Element element = Element.Create(ele);
List<Card> list = new List<Card>();
bool fire = ele == 910;public void TryShatter(Point pos, int ele, int power)
{
continue;
}
if (flag)
{
if (item.isChara)
{
if (item.IsPCFactionOrMinion)
{
continue;
}
}
else if (!CanCook(item))
{
continue;
}
}
if (EClass._zone.IsPCFaction && EClass.Branch.HasItemProtection)
{
Card rootCard = item.GetRootCard();public void TryShatter(Point pos, int ele, int power)
}
list.Shuffle();
int num = 0;
bool flag = false;
bool flag2 = false;
foreach (Card item3 in list)
{
if (!item3.trait.CanBeDestroyed || item3.category.IsChildOf("currency") || item3.trait is TraitDoor || item3.trait is TraitFigure || item3.trait is TraitTrainingDummy || item3.rarity >= Rarity.Legendary)public void TryShatter(Point pos, int ele, int power)
{
continue;
}
bool flag2 = CanCook(item3);
bool flag3 = CanCook(item3);
string text = "";
if (flag2)
if (flag3)
{
if (fire)
{public void TryShatter(Point pos, int ele, int power)
text = "711";
}
}
if (flag2 && !text.IsEmpty())
if (flag3 && !text.IsEmpty())
{
Thing thing2 = item3.Split(1);
List<Thing> list4 = new List<Thing>();public void TryShatter(Point pos, int ele, int power)
{
ActionMode.Adv.itemLost++;
}
if (!flag)
if (!flag2)
{
pos.PlayEffect(fire ? "Element/eleFire" : "Element/eleCold");
flag = true;
flag2 = true;
}
num++;
}ModUtil โ
public static void OnModsActivated()
private static void OnSourceImporting()
{
ExcelParser.allowTrimming = true;
ImportAllModSourceSheets();
}private static void OnSourceImported()
SourceCache.FinalizeCache();
SourceCache.InvalidateCacheBlobs();
SourceCache.ClearDetail();
ExcelParser.ClearStaticRows();
if (EClass.core.launchArgs.Contains("EXPORTSOURCE"))
{
string text = CorePath.rootExe + "/SourceExport/" + EClass.core.version.GetText();public static void AddContextMenuEntry(Action onClick, string menuEntry, string
ContextMenuProxy contextMenuProxy = children.Find((ContextMenuProxy p) => p.MenuEntry == part);
if (contextMenuProxy == null)
{
contextMenuProxy = new ContextMenuProxy(part, flag ? part : displayName)
contextMenuProxy = new ContextMenuProxy(flag ? part : displayName, part)
{
onClick = ((i == array.Length - 1 && flag) ? null : new Action(SafeInvoke)),
isMenu = flagRecipeCard โ
public override void Build(Chara chara, Card t, Point pos, int mat, int dir, int
{
mat = 2;
}
SourceMaterial.Row row = EClass.sources.materials.map.TryGetValue(mat) ?? EClass.sources.materials.map[2];
EClass.pc.PlaySound(row.GetSoundImpact());
t.SetDir(dir);
t.idSkin = idSkin;
EClass._zone.AddCard(t, pos);
t.PlaySoundImpact();
if (t.trait is TraitHouseBoard && ActionMode.Build.houseBoard != null)
{
(t.trait as TraitHouseBoard).data = IO.DeepCopy(ActionMode.Build.houseBoard.data);Religion โ
public virtual void OnReforge(Thing t)
foreach (Element value in t.elements.dict.Values)
{
int num = value.id;
if ((uint)(num - 64) > 3u && IsFaithElement(value))
if ((uint)(num - 64) > 3u && num != 92 && IsFaithElement(value))
{
value.vExp = -1;
}SlaverData โ
public void TryRefresh(Chara owner)
int num = 4 + EClass.rnd(4);
for (int i = 0; i < num; i++)
{
Chara item = ((owner.trait.SlaverType != SlaverType.Animal) ? CharaGen.Create(SpawnListChara.Get("slaver_human", (SourceChara.Row s) => EClass.sources.races.map[s.race].tag.Contains("human") && s.quality == 0).Select().id) : ((!(EClass._zone is Zone_Yowyn) || EClass.rnd(3) == 0) ? CharaGen.Create(SpawnListChara.Get("slaver_animal", (SourceChara.Row s) => EClass.sources.races.map[s.race].tag.Contains("animal") && s.quality == 0).Select().id) : CharaGen.Create(SpawnListChara.Get("slaver_horse", (SourceChara.Row s) => s.id == "horse_yowyn").Select().id)));
SourceRace.Row value2;
SourceRace.Row value;
Chara item = ((owner.trait.SlaverType != SlaverType.Animal) ? CharaGen.Create(SpawnListChara.Get("slaver_human", (SourceChara.Row s) => EClass.sources.races.map.TryGetValue(s.race, out value2) && value2.tag.Contains("human") && s.quality == 0).Select().id) : ((!(EClass._zone is Zone_Yowyn) || EClass.rnd(3) == 0) ? CharaGen.Create(SpawnListChara.Get("slaver_animal", (SourceChara.Row s) => EClass.sources.races.map.TryGetValue(s.race, out value) && value.tag.Contains("animal") && s.quality == 0).Select().id) : CharaGen.Create(SpawnListChara.Get("slaver_horse", (SourceChara.Row s) => s.id == "horse_yowyn").Select().id)));
list.Add(item);
}
dateRefresh = EClass.world.date.GetRaw(168);SourceImporter โ
ISheet[] item = value2.Item3;
foreach (ISheet sheet in item)
{
SourceData.BaseRow[] item2 = LoadBySheetName(sheet, value2.Item1).Item2;
if (!item2.IsEmpty())
ExcelParser.allowTrimming = true;
try
{
sourceCache.EmplaceCache(sheet.SheetName, item2);
value?.sourceRows.UnionWith(item2);
Debug.Log($"#source workbook {arg}:{sheet.SheetName}:{item2.Length}");
SourceData.BaseRow[] item2 = LoadBySheetName(sheet, value2.Item1).Item2;
if (!item2.IsEmpty())
{
sourceCache.EmplaceCache(sheet.SheetName, item2);
value?.sourceRows.UnionWith(item2);
Debug.Log($"#source workbook {arg}:{sheet.SheetName}:{item2.Length}");
}
}
finally
{
ExcelParser.allowTrimming = false;
}
}
continue; foreach (SourceCache sourceCache2 in array2)
{
string text2 = sourceCache2.SheetFile.ShortPath();
string key;
if (sourceCache2.IsDirtyOrEmpty)
{
if (!dictionary.TryGetValue(sourceCache2, out var value3) || value3.Item2.Length == 0) {
continue;
}
var (sourceData, array4) = LoadBySheetName(sheet2, value3.Item1);
if ((object)sourceData != null)
key = sheet2.SheetName;
int allowTrimming;
switch (key)
{
int? num2 = array4?.Length;
if (num2.HasValue && num2.GetValueOrDefault() > 0)
default:
allowTrimming = ((!(key == "Word")) ? 1 : 0);
break;
case "General":
case "Game":
case "Note":
case "List":
allowTrimming = 0;
break;
}
ExcelParser.allowTrimming = (byte)allowTrimming != 0;
try
{
var (sourceData, array4) = LoadBySheetName(sheet2, value3.Item1);
if ((object)sourceData != null)
{
sourceCache2.EmplaceCache(sheet2.SheetName, array4);
sourceCache2.Mod?.sourceRows.UnionWith(array4);
hashSet.Add(sourceData);
int? num2 = array4?.Length;
if (num2.HasValue && num2.GetValueOrDefault() > 0)
{
sourceCache2.EmplaceCache(sheet2.SheetName, array4);
sourceCache2.Mod?.sourceRows.UnionWith(array4);
hashSet.Add(sourceData);
}
}
}
finally
{
ExcelParser.allowTrimming = false;
}
}
continue;
}
foreach (KeyValuePair<string, SourceData.BaseRow[]> item3 in sourceCache2.Source)
{
item3.Deconstruct(out var key, out var value4);
item3.Deconstruct(out key, out var value4);
string text3 = key;
SourceData.BaseRow[] array5 = value4;
SourceData sourceData2 = FindSourceByName(text3);SourceMaterial โ
matColors = new MatColors();
foreach (string item in hashSet)
{
var (text, s, _) = CustomSourceContent.GetParams(item);
switch (text)
if (item.StartsWith("addColorMain") || item.StartsWith("addCol_Main"))
{
case "addCol_Main":
case "addColorMain":
matColors.main = s.ToColor();
break;
case "addCol_Alt":
case "addColorAlt":
matColors.alt = s.ToColor();
break;
matColors.main = item.ExtractInBetween('(', ')').ToColor();
}
else if (item.StartsWith("addColorAlt") || item.StartsWith("addCol_Alt"))
{
matColors.alt = item.ExtractInBetween('(', ')').ToColor();
}
}
Core.Instance.Colors.matColors[alias] = matColors;
Debug.Log($"#mod-content adding new material '{alias}'/{id}, main '{matColors.main}', alt '{matColors.alt}'");
}
matColor = matColors.main;
altColor = matColors.alt;TCUI โ
public override void OnDraw(ref Vector3 pos)
Vector3 position = Camera.main.WorldToScreenPoint(_pos);
position.z = 0f;
Vector3 vector = FixPos;
if (render.hasActor && !render.actor.isPCC && (bool)render.actor && (bool)render.actor.sr.sprite)
if (render != null && render.hasActor && !render.actor.isPCC && (bool)render.actor && (bool)render.actor.sr && (bool)render.actor.sr.sprite)
{
float num = 128f / render.actor.sr.sprite.rect.height;
int pivotY = render.owner.Pref.pivotY;Trait โ
public virtual void OnRenderTile(Point point, HitResult result, int dir)
}
}
public virtual void OnListInteraction(InvOwner.ListInteraction list, ButtonGrid b, bool context)
{
Card card = owner;
Thing t = card as Thing;
if (t == null)
{
return;
}
if (!LayerChara.Instance)
{
if (CanRead(EClass.pc))
{
list.Add("invRead", 110, delegate
{
t.DoAct(new AI_Read
{
target = t
});
}, "remove");
}
if (CanUse(EClass.pc))
{
list.Add(LangUse, 120, delegate
{
if (OnUse(EClass.pc))
{
EClass.player.EndTurn();
}
}, "use");
}
if (CanDrink(EClass.pc))
{
list.Add("invDrink", 130, delegate
{
t.DoAct(new AI_Drink
{
target = t
});
}, "remove");
}
if (CanEat(EClass.pc))
{
list.Add("invFood", 140, delegate
{
t.DoAct(new AI_Eat
{
cook = false,
target = t
});
}, "remove");
}
if (IsBlendBase)
{
list.Add("invBlend", 150, delegate
{
LayerDragGrid.Create(new InvOwnerBlend(t));
}, "blend");
}
}
if (!context || !CanName)
{
return;
}
list.Add("changeName", 200, delegate
{
Dialog.InputName("dialogChangeName", t.c_refText.IsEmpty(""), delegate(bool cancel, string text)
{
if (!cancel)
{
t.c_refText = text;
}
});
});
}
public virtual int CompareTo(Card b)
{
return 0;TraitCard โ
public override int GetMatColor()
{
return -3;
}
public override void OnListInteraction(InvOwner.ListInteraction list, ButtonGrid b, bool context)
{
base.OnListInteraction(list, b, context);
if (context)
{
list.Add("invCollect", 150, delegate
{
ContentCodex.Collect(owner as Thing);
});
}
}
}TraitDiary โ
public override void OnRead(Chara c)
chara.MakeAlly(msg: false);
chara.PlaySound("identify");
chara.PlayEffect("teleport");
if (c.IsPC && GetParam(1) == "sister")
{
Steam.GetAchievement(ID_Achievement.DIARY);
}
owner.ModNum(-1);
}
}TraitLightSource โ
public class TraitLightSource : TraitTorch
public class TraitLightSource : TraitTorch
{
public int LightRadius => GetParam(1).ToInt();
public override void OnListInteraction(InvOwner.ListInteraction list, ButtonGrid b, bool context)
{
base.OnListInteraction(list, b, context);
if (!context)
{
return;
}
list.Add("customBrightness", 300, delegate
{
UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
uIContextMenu.AddSlider("brightness", (float a) => a.ToString() ?? "", EClass.player.customLightMod, delegate(float b)
{
EClass.player.customLightMod = (int)b;
EClass.pc.RecalculateFOV();
}, 1f, 6f, isInt: true, hideOther: false);
uIContextMenu.Show();
});
}
}TraitTrolley โ
public override void OnActivateTrap(Chara c)
public virtual string GetIdSound()
{
if (!(owner.id == "play_ride_kin"))
switch (owner.id)
{
case "play_ride_kin":
return "ride_kin";
case "ride_boat":
case "ride_boat2":
return "ride_boat";
case "play_ride_big":
if (owner.idSkin != 0)
{
return "ride_trolley";
}
return "ride_kin";
default:
if (owner.idSkin != 7)
{
return "ride_trolley";
}
return "ride_bike";
}
return "ride_kin";
}
public virtual bool ShouldPlaySound(Point p)
{
string id = owner.id;
if (id == "ride_boat" || id == "ride_boat2")
{
return p.cell.IsTopWaterAndNoSnow;
}
return true;
}
}