Skip to content

EA 23.339.0 Nightly โ€‹

August 27, 2026

60 files modified. 1 new file created.

Important Changes โ€‹

Possible breaking changes. Click the filename to view the chunk.

CustomBiographyContent (1) โ€‹

cs
public static CustomBiographyContent CreateFromId(string biographyId, ModPackage owner = null) 
public static CustomBiographyContent CreateFromId(string biographyId, ModPackage owner = null, string charaId = null) 

CustomGunEffectData (2) โ€‹

cs
public GameSetting.EffectData CreateEffectData() 
public CustomGunEffectData() 
cs
public static CustomGunEffectData CreateFromId(string id) 
public void ResolveSprite() 

Religion (2) โ€‹

cs
public virtual int GetGiftRank() 
public virtual int GetGiftRank(Chara chara = null) 
cs
public virtual bool TryGetGift() 
public virtual bool TryGetGift(Chara chara = null) 

AI_Fuck โ€‹

void Brush(Chara c)

cs
	num6 = 10;
}
totalAffinity += num4;
c.ModAffinity(EClass.pc, num4, show: true, showOnlyEmo: true); 
c.ModAffinity(cc, num4, show: true, showOnlyEmo: true); 
cc.elements.ModExp(237, num6);
if (EClass.rnd(4) == 0)
{

AI_Slaughter โ€‹

public class AI_Slaughter : AI_TargetCard

cs
{
	public static bool slaughtering;

	public static Chara slaughterer; 
	public override bool CanManualCancel()
	{
		return true;

public override IEnumerable<Status> Run()

cs
	EClass._zone.AddCard(fur, target.pos);
}
slaughtering = true;
slaughterer = owner; 
target.SetSale(sale: false);
if (target.IsPCParty && !target.IsPC)
{

public override IEnumerable<Status> Run()

cs
target.Die();
Msg.Say("goto_heaven", target);
slaughtering = false;
slaughterer = null; 
if (!target.IsPC)
{
	if (target.Chara.trait.IsUnique)

ActPray โ€‹

public static bool TryPray(Chara c, bool passive = false)

cs
if (c.faith.IsEyth && !c.HasElement(1228))
{
	c.Say("pray", c);
	if (passive && c.Evalue(1655) >= 2 && EClass.pc.party.members.Count > 1) 
	if (passive && c.Evalue(1655) >= 2 && c.party.members.Count > 1) 
	{
		foreach (Chara member in EClass.pc.party.members) 
		foreach (Chara member in c.party.members) 
		{
			if (member != EClass.pc) 
			if (member != c) 
			{
				member.Say("pray2", member, member.faith.Name);
				member.ModExp(306, 200);
			}
		}
	}
	if (EClass.player.prayed) 
	if (c.IsPC && EClass.player.prayed) 
	{
		c.PlaySound("pray_ignore");
	}
	else
	{
		EClass.player.prayed = true; 
		if (c.IsPC) 
		{ 
			EClass.player.prayed = true; 
		} 
		c.ModExp(306, 100);
	}
	return true;
}
foreach (Chara member2 in EClass.pc.party.members) 
foreach (Chara member2 in c.party.members) 
{
	if (member2 == EClass.pc || (passive && c.Evalue(1655) >= 2)) 
	if (member2 == c || (passive && c.Evalue(1655) >= 2)) 
	{
		member2.Say("pray2", member2, member2.faith.Name);
	}
}
if (passive || !c.faith.TryGetGift()) 
if (passive || !c.faith.TryGetGift(c)) 
{
	if (c.IsPC && EClass.player.prayed)
	{

public static void Pray(Chara c, bool passive)

cs
}
if (!passive)
{
	c.Say("pray_answer", c, Act.CC.faith.Name); 
	c.Say("pray_answer", c, c.faith.Name); 
	c.faith.Revelation((EClass.rnd(2) == 0) ? "random" : "chat", c);
}
foreach (Chara member in EClass.pc.party.members) 
foreach (Chara member in c.party.members) 
{
	if (member == EClass.pc || (passive && c.Evalue(1655) >= 2)) 
	if (member == c || (passive && c.Evalue(1655) >= 2)) 
	{
		member.ModExp(306, 200);
	}

AttackProcess โ€‹

public void PlayRangedAnime(int numFire, float delay = 0f)

cs
bool isGun = toolRange is TraitToolRangeGun;
bool isCane = toolRange is TraitToolRangeCane;
GameSetting.EffectData data = EClass.setting.effect.guns.TryGetValue(weapon.id) ?? EClass.setting.effect.guns[isCane ? "cane" : (isGun ? "gun" : "bow")];
CustomGunEffectData customData = data as CustomGunEffectData; 
bool isPCC = CC.IsPCC && CC.renderer.hasActor;
Vector2 firePos = (isPCC ? new Vector2(data.firePos.x * (float)((CC.renderer.actor.currentDir != 0 && CC.renderer.actor.currentDir != 1) ? 1 : (-1)), data.firePos.y) : Vector2.zero);
Chara _CC = CC;

public void PlayRangedAnime(int numFire, float delay = 0f)

cs
	{
		effColor = EClass.Colors.elementColors.TryGetValue(element.source.alias, "eleFire");
	}
	if (!string.IsNullOrEmpty(customData?.caneColor)) 
	if (data.caneColor.a > 0f) 
	{
		Color color = customData.caneColor.ToColor(); 
		effColor = (customData.caneColorBlend ? Color.Lerp(effColor, color, 0.5f) : color); 
		effColor = (data.caneColorBlend ? Color.Lerp(effColor, data.caneColor, 0.5f) : data.caneColor); 
	}
}
bool isLaser = toolRange is TraitToolRangeGunEnergy || (customData?.forceLaser ?? false); 
bool isRail = isLaser && (weapon.id == "gun_rail" || (customData?.forceRail ?? false)); 
bool isLaser = toolRange is TraitToolRangeGunEnergy || data.forceLaser; 
bool isRail = isLaser && (weapon.id == "gun_rail" || data.forceRail); 
Vector3 muzzleFix = (data.fireFromMuzzle ? ((Vector3)firePos) : Vector3.zero); 
for (int num = 0; num < numFire; num++)
{
	TweenUtil.Delay((float)num * data.delay + delay, delegate
	{
		if (EClass.core.IsGameStarted && _CC.IsAliveInCurrentZone && _zone == _CC.currentZone)
		{
			Vector3 fromV = (_CC.isSynced ? _CC.renderer.position : _CC.pos.Position()); 
			Vector3 fromV = (_CC.isSynced ? _CC.renderer.position : _CC.pos.Position()) + muzzleFix; 
			switch (_weapon.id)
			{
			case "gun_rail":
				_CC.PlayEffect("laser_rail").GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
				_CC.PlayEffect("laser_rail", useRenderPos: true, 0f, muzzleFix).GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
				break;
			case "gun_laser":
				_CC.PlayEffect("laser").GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
				_CC.PlayEffect("laser", useRenderPos: true, 0f, muzzleFix).GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
				break;
			case "gun_laser_assault":
				Effect.Get("ranged_laser")._Play(_CC.pos, fromV, 0f, _TP, data.sprite);

public void PlayRangedAnime(int numFire, float delay = 0f)

cs
if (isLaser)
{
	string id = (isRail ? "laser_rail" : "laser");
	_CC.PlayEffect(id).GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
	_CC.PlayEffect(id, useRenderPos: true, 0f, muzzleFix).GetComponent<SpriteBasedLaser>().Play(_TP.PositionCenter()); 
}
else
{

public void PlayRangedAnime(int numFire, float delay = 0f)

cs
{
	if (!ignoreSound)
	{
		_CC.PlaySound(customData?.idSoundEject.IsEmpty("bullet_drop")); 
		_CC.PlaySound(data.idSoundEject.IsEmpty("bullet_drop")); 
	}
	_CC.PlayEffect("bullet").Emit(1);
}

BaseTileMap โ€‹

public virtual void DrawTile()

cs
}
if (this.cell._roofBlock != 0 && (isSeen || !EMono._zone.UseFog) && showRoof && !lowBlock)
{
	SourceBlock.Row row = Cell.blockList[this.cell._roofBlock]; 
	SourceMaterial.Row row2 = Cell.matList[this.cell._roofBlockMat]; 
	SourceBlock.Row row = Cell.blockSource[this.cell._roofBlock]; 
	SourceMaterial.Row row2 = Cell.matSource[this.cell._roofBlockMat]; 
	this.tileType = row.tileType;
	param.mat = row2;
	param.dir = this.cell._roofBlockDir % 4;

public virtual void DrawTile()

cs
	break;
}
case BlockRenderMode.HalfBlock:
	_sourceBlock = ((row.id == 5) ? EMono.sources.blocks.rows[row2.defBlock] : row); 
	_sourceBlock = ((row.id == 5) ? EMono.sources.blocks[row2.defBlock] : row); 
	param.tile = _sourceBlock._tiles[0];
	param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, _sourceBlock.colorMod));
	param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];

public virtual void DrawTile()

cs
bool flag4 = this.cell.isSurrounded && innerMode != InnerMode.None && sourceBlock.tileType.IsFullBlock;
if (!(!isSeen || flag4))
{
	goto IL_16c3; 
	goto IL_16be; 
}
bool isRoomEdge = this.cell.IsRoomEdge;
orgY = param.y;

public virtual void DrawTile()

cs
{
	if (isRoomEdge)
	{
		goto IL_16c3; 
		goto IL_16be; 
	}
	if (detail == null || !(EMono.pc.hasTelepathy || flag4))
	{

public virtual void DrawTile()

cs
		fogged = true;
	}
}
goto IL_7d72; 
IL_16c3: 
goto IL_7d3b; 
IL_16be: 
if (this.cell.isSlopeEdge)
{
	float num3 = (float)height * _heightMod.y;

public virtual void DrawTile()

cs
int num12 = (int)(num11 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
{
	row4 = EMono.sources.blocks.rows[this.cell.bridgePillar]; 
	row4 = EMono.sources.blocks[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));

public virtual void DrawTile()

cs
{
	if (room.lot.idDeco != 0 && !this.cell.hasDoor)
	{
		param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco); 
		param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco); 
		param.matColor = room.lot.colDeco;
		float y = param.y;
		param.y += (float)room.lot.decoFix * 0.01f;

public virtual void DrawTile()

cs
}
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.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2); 
	param.matColor = room.lot.colDeco2;
	float y2 = param.y;
	float num18 = param.z;

public virtual void DrawTile()

cs
{
	if (room.lot.idDeco != 0 && !this.cell.hasDoor)
	{
		param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco) * -1; 
		param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco) * -1; 
		param.matColor = room.lot.colDeco;
		float y3 = param.y;
		param.y += (float)room.lot.decoFix * 0.01f;

public virtual void DrawTile()

cs
}
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) * -1; 
	param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2) * -1; 
	param.matColor = room.lot.colDeco2;
	float y4 = param.y;
	float num19 = param.z;

public virtual void DrawTile()

cs
{
	if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
	{
		param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco); 
		param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco); 
		param.matColor = room2.lot.colDeco;
		param.y += (float)room2.lot.decoFix * 0.01f;
		rendererWallDeco.Draw(param);

public virtual void DrawTile()

cs
}
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.tile = EMono.sources.blocks[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;

public virtual void DrawTile()

cs
{
	if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
	{
		param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco); 
		param.tile = -EMono.sources.blocks[0].ConvertTile(1000 + room3.lot.idDeco); 
		param.matColor = room3.lot.colDeco;
		param.y += (float)room3.lot.decoFix * 0.01f;
		rendererWallDeco.Draw(param);

public virtual void DrawTile()

cs
}
if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag9 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
	param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco2); 
	param.tile = -EMono.sources.blocks[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;

public virtual void DrawTile()

cs
}
case BlockRenderMode.HalfBlock:
	param.color = floorLight;
	_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock); 
	_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks[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];

public virtual void DrawTile()

cs
{
	if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
	{
		goto IL_71e1; 
		goto IL_71aa; 
	}
	if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
	{
		Room obj = this.cell.FrontRight.room;
		if (obj == null || !obj.HasRoof)
		{
			goto IL_71e1; 
			goto IL_71aa; 
		}
	}
}
goto IL_7241; 
IL_71e1: 
goto IL_720a; 
IL_71aa: 
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: 
goto IL_720a; 
IL_7d3b: 
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
	return;

public virtual void DrawTile()

cs
	param.z = orgZ;
}
return;
IL_7241: 
IL_720a: 
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
{
	snowed = true;

public virtual void DrawTile()

cs
	param.matColor = 104025f;
	renderFootmark.Draw(param);
}
goto IL_7d72; 
goto IL_7d3b; 
void Draw(int tile)
{
	pass = passEdge;

public void DrawRoof(Lot lot)

cs
}
int num6 = num4 + (reverse ? roofStyle.w : roofStyle.h) * 2 - num2;
int idRoofTile = lot.idRoofTile;
int num7 = lot.idBlock; 
int num8 = num7; 
if (num7 >= EMono.sources.blocks.rows.Count) 
{ 
	num7 = EMono.sources.blocks.rows.Count - 1; 
} 
if (num8 >= EMono.sources.floors.rows.Count) 
{ 
	num8 = EMono.sources.floors.rows.Count - 1; 
} 
int num9 = lot.idRamp; 
if (num9 >= EMono.sources.blocks.rows.Count) 
{ 
	num9 = EMono.sources.blocks.rows.Count - 1; 
} 
int idBlock = lot.idBlock; 
int idRamp = lot.idRamp; 
bool flag = false;
int num10 = num6 / 2 - roofStyle.flatW; 
int num11 = num6 / 2 + roofStyle.flatW + ((num6 % 2 != 0) ? 1 : 0); 
SourceBlock.Row row = (roofStyle.useDefBlock ? cell.sourceFloor._defBlock : EMono.sources.blocks.rows[num7]); 
int num12 = 0; 
int num13 = ((num5 != 0) ? (-1) : 0); 
int num14 = 0; 
int num7 = num6 / 2 - roofStyle.flatW; 
int num8 = num6 / 2 + roofStyle.flatW + ((num6 % 2 != 0) ? 1 : 0); 
SourceBlock.Row row = (roofStyle.useDefBlock ? cell.sourceFloor._defBlock : EMono.sources.blocks[idBlock]); 
int num9 = 0; 
int num10 = ((num5 != 0) ? (-1) : 0); 
int num11 = 0; 
Vector3 vector = (lot.fullblock ? roofStyle.posFixBlock : roofStyle.posFix);
switch (roofStyle.type)
{

public void DrawRoof(Lot lot)

cs
	break;
case RoofStyle.Type.Flat:
case RoofStyle.Type.FlatFloor:
	num10 = roofStyle.flatW; 
	num11 = num6 - roofStyle.flatW; 
	if (num10 == 0) 
	num7 = roofStyle.flatW; 
	num8 = num6 - roofStyle.flatW; 
	if (num7 == 0) 
	{
		num14 = 1; 
		num11 = 1; 
	}
	if (roofStyle.type != RoofStyle.Type.FlatFloor)
	{

public void DrawRoof(Lot lot)

cs
	}
	break;
case RoofStyle.Type.Triangle:
	num10 = 999; 
	num11 = 999; 
	num7 = 999; 
	num8 = 999; 
	break;
}
for (cz = num2; cz < num4; cz++)

public void DrawRoof(Lot lot)

cs
{
	continue;
}
int num15; 
int num16; 
int num12; 
int num13; 
if (reverse)
{
	num15 = cz; 
	num16 = cx; 
	cell = map.cells[num15, num16]; 
	num12 = cz; 
	num13 = cx; 
	cell = map.cells[num12, num13]; 
	if (roofStyle.wing && cz == num4 - 1 && cell.Right.Right.room != null && cell.Right.Right.room.lot != lot)
	{
		continue;

public void DrawRoof(Lot lot)

cs
}
else
{
	num15 = cx; 
	num16 = cz; 
	cell = map.cells[num15, num16]; 
	num12 = cx; 
	num13 = cz; 
	cell = map.cells[num12, num13]; 
	if (roofStyle.wing && cz == 0 && cell.Front.Front.room != null && cell.Front.Front.room.lot != lot)
	{
		continue;
	}
}
int num17 = num16 - num15; 
int num14 = num13 - num12; 
room = cell.room;
if (room != null && room.lot != lot)
{

public void DrawRoof(Lot lot)

cs
	{
		if (!cell.HasFullBlock || cell.room != null)
		{
			num14 = ((cell.Left.room != null && cell.Left.room.lot == lot) ? ((cell.Right.room != null && cell.Right.room.lot == lot) ? 1 : ((cell.HasFullBlock && cell.Right.HasFullBlock && cell.Right.room != null) ? 1 : 2)) : (cell.Left.HasFullBlock ? 1 : 0)); 
			num11 = ((cell.Left.room != null && cell.Left.room.lot == lot) ? ((cell.Right.room != null && cell.Right.room.lot == lot) ? 1 : ((cell.HasFullBlock && cell.Right.HasFullBlock && cell.Right.room != null) ? 1 : 2)) : (cell.Left.HasFullBlock ? 1 : 0)); 
		}
		else if (cell.Left.room?.lot == lot && cell.Right.room != null)
		{
			num14 = 1; 
			num11 = 1; 
			flag2 = true;
		}
		else if (cell.Front.room?.lot == lot)
		{
			num14 = ((cell.FrontRight.room?.lot == lot) ? 1 : 2); 
			num11 = ((cell.FrontRight.room?.lot == lot) ? 1 : 2); 
			flag2 = true;
		}
		else if (cell.Right.room?.lot == lot || cell.FrontRight.room?.lot == lot)
		{
			num14 = 0; 
			num11 = 0; 
			flag2 = true;
		}
	}
	else if (!cell.HasFullBlock || cell.room != null)
	{
		num14 = ((cell.Front.room != null && cell.Front.room.lot == lot) ? ((cell.Back.room != null && cell.Back.room.lot == lot) ? 1 : (cell.Back.HasFullBlock ? 1 : 2)) : ((cell.HasFullBlock && cell.Front.HasFullBlock && cell.Front.room != null) ? 1 : 0)); 
		num11 = ((cell.Front.room != null && cell.Front.room.lot == lot) ? ((cell.Back.room != null && cell.Back.room.lot == lot) ? 1 : (cell.Back.HasFullBlock ? 1 : 2)) : ((cell.HasFullBlock && cell.Front.HasFullBlock && cell.Front.room != null) ? 1 : 0)); 
	}
	else if (cell.Right.room?.lot == lot)
	{
		num14 = ((cell.FrontRight.room?.lot == lot) ? 1 : 0); 
		num11 = ((cell.FrontRight.room?.lot == lot) ? 1 : 0); 
		flag2 = true;
	}
	else if (cell.Front.room?.lot == lot || cell.FrontRight.room?.lot == lot)
	{
		num14 = 2; 
		num11 = 2; 
		flag2 = true;
	}
	num13 = 0; 
	num10 = 0; 
}
bool flag3 = isSnowCovered && !cell.isClearSnow;
if (room == null && !roofStyle.coverLot && !flag2 && !(cell.HasFullBlock && cell.IsRoomEdge && flag3))

public void DrawRoof(Lot lot)

cs
}
index = cx + cz * Size;
height = cell.TopHeight;
float num18 = (float)num17 * screen.tileAlign.y + (float)lot.mh * _heightMod.y + lot.realHeight + roofFix.y + vector.y; 
float num19 = 1000f + param.x * screen.tileWeight.x + (float)lot.mh * _heightMod.z + lot.realHeight * roofFix3.z + roofFix.z + vector.z; 
float num15 = (float)num14 * screen.tileAlign.y + (float)lot.mh * _heightMod.y + lot.realHeight + roofFix.y + vector.y; 
float num16 = 1000f + param.x * screen.tileWeight.x + (float)lot.mh * _heightMod.z + lot.realHeight * roofFix3.z + roofFix.z + vector.z; 
if (lot.height == 1 && lot.heightFix < 20)
{
	num18 += roofStyle.lowRoofFix.y; 
	num19 += roofStyle.lowRoofFix.z; 
	num15 += roofStyle.lowRoofFix.y; 
	num16 += roofStyle.lowRoofFix.z; 
}
param.x = (float)(cx + cz) * screen.tileAlign.x + roofFix.x + (float)num13 * roofFix2.x + vector.x * (float)(reverse ? 1 : (-1)); 
param.y = num18 + (float)num13 * roofFix2.y; 
param.z = num19 + param.y * screen.tileWeight.z + (float)num13 * roofFix2.z; 
param.x = (float)(cx + cz) * screen.tileAlign.x + roofFix.x + (float)num10 * roofFix2.x + vector.x * (float)(reverse ? 1 : (-1)); 
param.y = num15 + (float)num10 * roofFix2.y; 
param.z = num16 + param.y * screen.tileWeight.z + (float)num10 * roofFix2.z; 
param.color = GetRoofLight(lot);
param.snow = idRoofTile == 0 && flag3;
param.shadowFix = 0f;
if (num14 == 1) 
if (num11 == 1) 
{
	SourceMaterial.Row mat = matBlock;
	RenderRow renderRow;

public void DrawRoof(Lot lot)

cs
	{
		continue;
	}
	renderRow = EMono.sources.floors.rows[num8]; 
	renderRow = EMono.sources.floors[idBlock]; 
	renderRow.SetRenderParam(param, mat, 0);
	param.matColor = lot.colRoof;
}

public void DrawRoof(Lot lot)

cs
renderRow.renderData.Draw(param);
if (idRoofTile != 0)
{
	renderRow = EMono.sources.blocks.rows[EMono.sources.objs.rows[idRoofTile].idRoof]; 
	int num20 = (reverse ? 1 : 0) + ((!flag) ? 2 : 0); 
	renderRow.SetRenderParam(param, MATERIAL.sourceGold, num20); 
	renderRow = EMono.sources.blocks[EMono.sources.objs[idRoofTile].idRoof]; 
	int num17 = (reverse ? 1 : 0) + ((!flag) ? 2 : 0); 
	renderRow.SetRenderParam(param, MATERIAL.sourceGold, num17); 
	param.matColor = lot.colRoof;
	if (roofStyle.type == RoofStyle.Type.FlatFloor)
	{

public void DrawRoof(Lot lot)

cs
	{
		param.z += roofStyle.snowZ;
	}
	param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num20; 
	param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num17; 
	renderRow.renderData.Draw(param);
}
else

public void DrawRoof(Lot lot)

cs
{
	if (idRoofTile != 0)
	{
		int num21 = ((!reverse) ? ((num14 != 0) ? 2 : 0) : ((num14 != 0) ? 1 : 3)); 
		int num18 = ((!reverse) ? ((num11 != 0) ? 2 : 0) : ((num11 != 0) ? 1 : 3)); 
		if (lot.altRoof && !flag && (roofStyle.type == RoofStyle.Type.Default || roofStyle.type == RoofStyle.Type.DefaultNoTop))
		{
			param.shadowFix = num21 + 1; 
			param.shadowFix = num18 + 1; 
		}
		RenderRow renderRow = EMono.sources.objs.rows[idRoofTile]; 
		renderRow.SetRenderParam(param, MATERIAL.sourceGold, num21); 
		RenderRow renderRow = EMono.sources.objs[idRoofTile]; 
		renderRow.SetRenderParam(param, MATERIAL.sourceGold, num18); 
		param.matColor = lot.colRoof;
		if (flag3)
		{
			param.matColor = 104025f;
			param.z += roofStyle.snowZ;
			param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num21 + (lot.altRoof ? 8 : 0); 
			param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num18 + (lot.altRoof ? 8 : 0); 
			renderRow.renderData.Draw(param);
		}
		else

public void DrawRoof(Lot lot)

cs
	}
	param.shadowFix = 0f;
}
if (num13 >= 0) 
if (num10 >= 0) 
{
	param.y += roofRampFix.y;
	param.z += roofRampFix.z;
	RenderRow renderRow = EMono.sources.blocks.rows[num9]; 
	renderRow.SetRenderParam(param, MATERIAL.sourceGold, (!reverse) ? ((num14 != 0) ? 2 : 0) : ((num14 != 0) ? 1 : 3)); 
	RenderRow renderRow = EMono.sources.blocks[idRamp]; 
	renderRow.SetRenderParam(param, MATERIAL.sourceGold, (!reverse) ? ((num11 != 0) ? 2 : 0) : ((num11 != 0) ? 1 : 3)); 
	param.matColor = lot.colBlock;
	renderRow.renderData.Draw(param);
}

public void DrawRoof(Lot lot)

cs
{
	rendererEffect.Draw(param, cell.effect.FireAmount);
}
if (num13 < 1) 
if (num10 < 1) 
{
	continue;
}

public void DrawRoof(Lot lot)

cs
{
	param.snow = false;
}
for (int i = 0; i < num13; i++) 
for (int i = 0; i < num10; i++) 
{
	param.x = (float)(cx + cz) * screen.tileAlign.x + roofFix.x + (float)i * roofFix2.x + vector.x * (float)(reverse ? 1 : (-1));
	param.y = num18 + (float)i * roofFix2.y; 
	param.z = num19 + param.y * screen.tileWeight.z + (float)i * roofFix2.z; 
	param.y = num15 + (float)i * roofFix2.y; 
	param.z = num16 + param.y * screen.tileWeight.z + (float)i * roofFix2.z; 
	RenderRow renderRow = row;
	renderRow.SetRenderParam(param, MATERIAL.sourceGold, 0);
	param.matColor = lot.colBlock;

public void DrawRoof(Lot lot)

cs
		}
	}
}
num12++; 
num9++; 
if (roofStyle.type != RoofStyle.Type.Flat)
{
	if (num12 == num10) 
	if (num9 == num7) 
	{
		num14 = 1; 
		num11 = 1; 
	}
	if (num12 == num11) 
	if (num9 == num8) 
	{
		num14 = 2; 
		num13++; 
		num11 = 2; 
		num10++; 
	}
	num13 += num14 switch
	num10 += num11 switch 
	{
		1 => 0, 
		0 => 1,

BiomeProfile โ€‹

public class Item : BaseItem

cs
{
	public int idObj;

	public override bool IsSpawnOnBlock => EClass.sources.objs.map[idObj].tileType.IsBlockMount; 
	public override bool IsSpawnOnBlock => EClass.sources.objs[idObj].tileType.IsBlockMount; 

	public override bool IsSpawnOnWater => EClass.sources.objs.map[idObj].tileType.CanSpawnOnWater; 
	public override bool IsSpawnOnWater => EClass.sources.objs[idObj].tileType.CanSpawnOnWater; 

	public string obj
	{

public TileGroup interior

cs
	}
}

public SourceMaterial.Row MatFloor => _mat ?? (_mat = EClass.sources.materials.map[exterior.floor.mat]); 
public SourceMaterial.Row MatFloor => _mat ?? (_mat = EClass.sources.materials[exterior.floor.mat]); 

public SourceMaterial.Row MatSub => _matSub ?? (_matSub = ((exterior.floor.matSub == 0) ? MatFloor : EClass.sources.materials.map[exterior.floor.matSub])); 
public SourceMaterial.Row MatSub => _matSub ?? (_matSub = ((exterior.floor.matSub == 0) ? MatFloor : EClass.sources.materials[exterior.floor.matSub])); 

public void Populate(Point point, bool interior = false, float mtpDensity = 1f)
{

Card โ€‹

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
		}
	}
}
long num3 = 99999999L; 
if (!IsPCFaction && LV > 50) 
{ 
	dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(LV - 50) * 2.5f)) / 100; 
} 
if (origin != null && origin.HasElement(1208))
{
	switch (attackSource)

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
if (!e.source.aliasRef.IsEmpty() && attackSource != AttackSource.ManaBackfire)
{
	dmg = Element.GetResistDamage(dmg, Evalue(e.source.aliasRef), (resistPenetrationLevel != 0) ? resistPenetrationLevel : GetResistPenetrationLevel(e.id, attackSource, origin));
	num3 = Element.GetResistDamage(num3, Evalue(e.source.aliasRef), (resistPenetrationLevel != 0) ? resistPenetrationLevel : GetResistPenetrationLevel(e.id, attackSource, origin)); 
	if (dmg > num3) 
	{ 
		dmg = num3; 
	} 
	dmg = dmg * 100 / (100 + Mathf.Clamp(Evalue(961) * 5, -50, 200));
	dmg = dmg * Mathf.Max(100 - Evalue(93), 10) / 100;
}

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
}
if (attackSource != AttackSource.Finish)
{
	if (!IsPCFaction && LV > 50) 
	{ 
		dmg = dmg * (100 - (int)Mathf.Min(80f, Mathf.Sqrt(LV - 50) * 2.5f)) / 100; 
	} 
	if (origin != null && origin.HasCondition<ConBerserk>())
	{
		dmg = dmg * 3 / 2;
	}
	if (EClass.game.principal.enableDamageReduction && IsPCFaction)
	{
		int num3 = ((origin != null) ? origin.LV : EClass._zone.DangerLv); 
		if (num3 > 50) 
		int num4 = ((origin != null) ? origin.LV : EClass._zone.DangerLv); 
		if (num4 > 50) 
		{
			dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num3 - 50))) / 100; 
			dmg = dmg * (100 - (int)Mathf.Min(95f, Mathf.Sqrt(num4 - 50))) / 100; 
		}
	}
	if (attackSource == AttackSource.Throw || attackSource == AttackSource.Range)

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
{
	dmg = dmg * 90 / 100;
}
int num4 = EClass.pc.party.EvalueTotal(1207); 
if (num4 > 0 && isChara) 
int num5 = EClass.pc.party.EvalueTotal(1207); 
if (num5 > 0 && isChara) 
{
	int num5 = 0; 
	int num6 = 0;
	int num7 = 0; 
	foreach (Condition condition3 in Chara.conditions)
	{
		if (condition3.Type == ConditionType.Buff)
		{
			num5++; 
			num6++; 
		}
		else if (condition3.Type == ConditionType.Debuff)
		{
			num6++; 
			num7++; 
		}
	}
	if (IsPCFactionOrMinion)
	{
		dmg = dmg * 100 / Mathf.Min(100 + num5 * (3 + num4 * 2), 120); 
		dmg = dmg * 100 / Mathf.Min(100 + num6 * (3 + num5 * 2), 120); 
	}
	else if (origin != null && origin.IsPCFactionOrMinion)
	{
		dmg = dmg * Mathf.Min(100 + num6 * (3 + num4 + 2), 120) / 100; 
		dmg = dmg * Mathf.Min(100 + num7 * (3 + num5 + 2), 120) / 100; 
	}
}
if (IsPCParty && EClass.pc.ai is GoalAutoCombat)

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
	}
	if (dmg >= MaxHP / 10 && Evalue(68) > 0)
	{
		int num7 = MaxHP / 10; 
		long num8 = dmg - num7; 
		num8 = num8 * 100 / (200 + Evalue(68) * 10); 
		dmg = num7 + num8; 
		int num8 = MaxHP / 10; 
		long num9 = dmg - num8; 
		num9 = num9 * 100 / (200 + Evalue(68) * 10); 
		dmg = num8 + num9; 
	}
}
if (origin != null && origin.IsPC && EClass.pc.Evalue(654) > 0)

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
{
	dmg = 0L;
}
long num9 = 99999999L; 
if (origin != null && (attackSource == AttackSource.Melee || attackSource == AttackSource.Range))
{
	ConStrife condition = origin.GetCondition<ConStrife>();
	if (condition != null)
	{
		num9 = num9 * (100 + condition.lv * 5) / 100; 
		num3 = num3 * (100 + condition.lv * 5) / 100; 
	}
}
if (dmg > num9) 
if (dmg > num3) 
{
	dmg = num9; 
	dmg = num3; 
}
float num10 = Mathf.Clamp(dmg * 6 / MaxHP, 0f, 4f) + (float)((dmg > 0) ? 1 : 0);
int num11 = hp;

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
			Chara.AddCondition<ConFractured>((int)Mathf.Max(10f, 30f - Mathf.Sqrt(Evalue(436))));
			hp = Mathf.Min(half * (int)Mathf.Sqrt(Evalue(436) * 2) / 100, MaxHP / 3);
		});
		goto IL_1128; 
		goto IL_117a; 
	}
}
if (zoneInstanceBout != null && (bool)LayerDrama.Instance)

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
	if (EClass.player.invlunerable)
	{
		EvadeDeath(null);
		goto IL_1128; 
		goto IL_117a; 
	}
}
if (Evalue(1220) > 0 && Chara.stamina.value >= (IsPC ? (Chara.stamina.max / 2) : (Chara.stamina.max / 3 * 2)))

public void DamageHP(long dmg, int ele, int eleP = 100, AttackSource attackSourcโ€ฆ)

cs
		}
	}
}
goto IL_1128; 
IL_1128: 
goto IL_117a; 
IL_117a: 
if (trait.CanBeAttacked)
{
	renderer.PlayAnime(AnimeID.HitObj);

public void SpawnLoot(Card origin)

cs
if (AI_Slaughter.slaughtering)
{
	flag2 = true;
	num = EClass.rndHalf(4 + 10 * (50 + Mathf.Max(0, (int)MathF.Sqrt(EClass.pc.Evalue(290) * 10))) / 100); 
	num = EClass.rndHalf(4 + 10 * (50 + Mathf.Max(0, (int)MathF.Sqrt((AI_Slaughter.slaughterer ?? EClass.pc).Evalue(290) * 10))) / 100); 
}
else if (origin != null && origin.HasElement(290) && !IsMinion)
{

public void SpawnLoot(Card origin)

cs
int num3 = 10;
if (AI_Slaughter.slaughtering)
{
	num3 += (int)Mathf.Min(Mathf.Sqrt(EClass.pc.Evalue(290)), 20f); 
	num3 += (int)Mathf.Min(Mathf.Sqrt((AI_Slaughter.slaughterer ?? EClass.pc).Evalue(290)), 20f); 
}
if (num2 && num3 > EClass.rnd(100))
{

public virtual Sprite GetSprite(int dir = 0)

cs
{
	if (trait is TraitFakeBlock)
	{
		return EClass.sources.blocks.map[refVal].GetSprite(dir, trait.IdSkin, (IsInstalled && pos != null && pos.IsValid && pos.cell.IsSnowTile) ? true : false); 
		return EClass.sources.blocks[refVal].GetSprite(dir, trait.IdSkin, (IsInstalled && pos != null && pos.IsValid && pos.cell.IsSnowTile) ? true : false); 
	}
	return EClass.sources.objs.map[refVal].GetSprite(dir, trait.IdSkin, (IsInstalled && pos != null && pos.IsValid && pos.cell.IsSnowTile) ? true : false); 
	return EClass.sources.objs[refVal].GetSprite(dir, trait.IdSkin, (IsInstalled && pos != null && pos.IsValid && pos.cell.IsSnowTile) ? true : false); 
}
if (trait is TraitAbility)
{

Cell โ€‹

public class Cell : WeightCell, IFloodCell

cs
public static List<SourceObj.Row> objList;

public static SourceMaterial matSource; 
public static SourceBlock blockSource; 
public static SourceFloor floorSource; 
public static SourceDeco decoSource; 
public static SourceCellEffect effectSource; 
public static SourceObj objSource; 
public static int Size;

public static Cell[,] cells;

public bool IsNotWaterEdge

cs
{
	get
	{
		if (!HasFullBlock && !floorList[_floor].tileType.IsWater) 
		if (!HasFullBlock && !floorSource[_floor].tileType.IsWater) 
		{
			return floorList[_floor].edge == 0; 
			return floorSource[_floor].edge == 0; 
		}
		return true;
	}

public bool IsTopWater

cs
	{
		if (_bridge != 0)
		{
			return floorList[_bridge].tileType.IsWater; 
			return floorSource[_bridge].tileType.IsWater; 
		}
		return floorList[_floor].tileType.IsWater; 
		return floorSource[_floor].tileType.IsWater; 
	}
}

public bool IsTopWaterAndNoSnow

cs
	}
}

public bool IsFloorWater => floorList[_floor].tileType.IsWater; 
public bool IsFloorWater => floorSource[_floor].tileType.IsWater; 

public bool IsFarmField
{

public bool IsBridgeWater

cs
{
	if (_bridge != 0)
	{
		return floorList[_bridge].tileType.IsWater; 
		return floorSource[_bridge].tileType.IsWater; 
	}
	return false;
}

public bool IsIceTile

cs
	}
}

public bool HasFullBlock => blockList[_block].tileType.IsFullBlock; 
public bool HasFullBlock => blockSource[_block].tileType.IsFullBlock; 

public bool HasFullBlockOrWallOrFence
{

public bool HasFullBlockOrWallOrFence

cs
	}
}

public bool HasWallOrFence => blockList[_block].tileType.IsWallOrFence; 
public bool HasWallOrFence => blockSource[_block].tileType.IsWallOrFence; 

public bool HasWall => blockList[_block].tileType.IsWall; 
public bool HasWall => blockSource[_block].tileType.IsWall; 

public bool HasFence => blockList[_block].tileType.IsFence; 
public bool HasFence => blockSource[_block].tileType.IsFence; 

public bool HasRamp => blockList[_block].tileType.IsRamp; 
public bool HasRamp => blockSource[_block].tileType.IsRamp; 

public bool HasLadder => blockList[_block].tileType.IsLadder; 
public bool HasLadder => blockSource[_block].tileType.IsLadder; 

public bool HasRampOrLadder
{

public bool HasRampOrLadder

cs
	}
}

public bool HasSlope => blockList[_block].tileType == TileType.Slope; 
public bool HasSlope => blockSource[_block].tileType == TileType.Slope; 

public bool HasStairs => blockList[_block].tileType == TileType.Stairs; 
public bool HasStairs => blockSource[_block].tileType == TileType.Stairs; 

public bool HasHalfBlock => blockList[_block].tileType == TileType.HalfBlock; 
public bool HasHalfBlock => blockSource[_block].tileType == TileType.HalfBlock; 

public bool HasBlockOrRamp => blockList[_block].isBlockOrRamp; 
public bool HasBlockOrRamp => blockSource[_block].isBlockOrRamp; 

public bool UseLowBlock => blockList[_block].tileType.UseLowBlock; 
public bool UseLowBlock => blockSource[_block].tileType.UseLowBlock; 

public bool CastShadow => blockList[_block].tileType.CastShadowSelf; 
public bool CastShadow => blockSource[_block].tileType.CastShadowSelf; 

public bool CastAmbientShadow => blockList[_block].tileType.CastAmbientShadow; 
public bool CastAmbientShadow => blockSource[_block].tileType.CastAmbientShadow; 

public bool IsRoomEdge
{

public bool HasFloodBlock

cs
	}
}

public SourceMaterial.Row matRoofBlock => matList[_roofBlockMat]; 
public SourceMaterial.Row matRoofBlock => matSource[_roofBlockMat]; 

public SourceMaterial.Row matBlock => matList[_blockMat]; 
public SourceMaterial.Row matBlock => matSource[_blockMat]; 

public SourceMaterial.Row matFloor => matList[_floorMat]; 
public SourceMaterial.Row matFloor => matSource[_floorMat]; 

public SourceMaterial.Row matDeco => matList[_decoMat]; 
public SourceMaterial.Row matDeco => matSource[_decoMat]; 

public SourceMaterial.Row matBridge => matList[_bridgeMat]; 
public SourceMaterial.Row matBridge => matSource[_bridgeMat]; 

public SourceMaterial.Row matObj => matList[objMat]; 
public SourceMaterial.Row matObj => matSource[objMat]; 

public SourceMaterial.Row matObj_fixed
{

public SourceMaterial.Row matObj_fixed

cs
	{
		if (!isObjDyed)
		{
			return matList[objMat]; 
			return matSource[objMat]; 
		}
		return sourceObj.DefaultMaterial;
	}
}

public SourceBlock.Row sourceRoofBlock => blockList[_roofBlock]; 
public SourceBlock.Row sourceRoofBlock => blockSource[_roofBlock]; 

public SourceBlock.Row sourceBlock => blockList[_block]; 
public SourceBlock.Row sourceBlock => blockSource[_block]; 

public SourceFloor.Row sourceFloor => floorList[_floor]; 
public SourceFloor.Row sourceFloor => floorSource[_floor]; 

public SourceFloor.Row sourceBridge => floorList[_bridge]; 
public SourceFloor.Row sourceBridge => floorSource[_bridge]; 

public SourceFloor.Row sourceSurface
{

public SourceFloor.Row sourceSurface

cs
	}
}

public SourceDeco.Row sourceDeco => decoList[_deco]; 
public SourceDeco.Row sourceDeco => decoSource[_deco]; 

public SourceCellEffect.Row sourceEffect => effect?.source ?? effectList[0]; 
public SourceCellEffect.Row sourceEffect => effect?.source ?? effectSource[0]; 

public SourceObj.Row sourceObj => objList[obj]; 
public SourceObj.Row sourceObj => objSource[obj]; 

public BiomeProfile biome
{

public void Refresh()

cs
isSkyFloor = tileType2 != TileType.Sky && (cell2.sourceFloor.tileType == TileType.Sky || cell3.sourceFloor.tileType == TileType.Sky);
openPath = false;
openSight = tileType.IsOpenSight || (cell3.hasWindow && !cell3.isCurtainClosed) || (cell2.hasWindow && !cell2.isCurtainClosed);
blockSight = tileType.IsBlockSight || ((objList[obj].growth != null) ? objList[obj].growth.BlockSight(this) : objList[obj].tileType.IsBlockSight); 
blocked = outOfBounds || tileType.IsBlockPass || (tileType2.IsBlockPass && !hasBridge) || ((objList[obj].growth != null) ? objList[obj].growth.BlockPass(this) : objList[obj].tileType.IsBlockPass) || impassable; 
blockSight = tileType.IsBlockSight || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockSight(this) : objSource[obj].tileType.IsBlockSight); 
blocked = outOfBounds || tileType.IsBlockPass || (tileType2.IsBlockPass && !hasBridge) || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockPass(this) : objSource[obj].tileType.IsBlockPass) || impassable; 
isSlopeEdge = height > cell2.height || height > cell3.height;
if (hasBridge && sourceBridge.tileType.ShowPillar)
{

CellEffect โ€‹

public string n1

cs
	}
}

public SourceCellEffect.Row source => _source ?? (_source = EClass.sources.cellEffects.rows[id]); 
public SourceCellEffect.Row source => _source ?? (_source = EClass.sources.cellEffects[id]); 

public bool IsFire => id == 3;

Chara โ€‹

public override MoveResult _Move(Point newPoint, MoveType type = MoveType.Walk)

cs
			Msg.Say(Lang.GetList("walk_storm").RandomItem());
		}
	}
	ActWait.Search(EClass.pc); 
	ActWait.Search(this); 
}
if (IsPCC)
{

public void GiveGift(Chara c, Thing t)

cs
{
	num2 *= 2;
}
EClass.pc.PlayEffect("identify"); 
EClass.pc.PlaySound("identify"); 
PlayEffect("identify"); 
PlaySound("identify"); 
c.PlayEffect("mutation");
c.Say("draw_curse", c, t);
t.Destroy();
List<Element> list = new List<Element>();
foreach (Element value in EClass.pc.elements.dict.Values) 
foreach (Element value in elements.dict.Values) 
{
	if (value is Spell)
	{

public void GiveGift(Chara c, Thing t)

cs
	}
	if (list.Count == 0)
	{
		EClass.pc.SayNothingHappans(); 
		SayNothingHappans(); 
		return;
	}
	Element element = list.RandomItem();
	EClass.pc.ModExp(element.id, num2); 
	EClass.pc.Say("draw_curse2", EClass.pc, element.Name); 
	ModExp(element.id, num2); 
	Say("draw_curse2", this, element.Name); 
	c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
	return;
}

CoreConfig โ€‹

public class Test

cs
public int screenExtraHeight;

public int maxSimHour; 
public bool showNumbers;

public bool stackNumbers;

CustomBiographyContent โ€‹

public class CustomBiographyContent : CustomFileContent

cs
private int[] _tempLangKey = new int[4];

private bool _initialized; 
[JsonIgnore] 
public string BioId { get; private set; } 

public static CustomBiographyContent CreateFromId(string biographyId, ModPackage owner = null) 
public static CustomBiographyContent CreateFromId(string biographyId, ModPackage owner = null, string charaId = null) 
{
	var (fileInfo, eMod) = PackageIterator.GetFilesEx("Data/bio_" + biographyId + ".json").LastOrDefault();
	if (fileInfo == null)

public static CustomBiographyContent CreateFromId(string biographyId, ModPackageโ€ฆ)

cs
}
return new CustomBiographyContent
{
	ContentId = "Biography/" + biographyId, 
	ContentId = "Biography/" + charaId.IsEmpty(biographyId), 
	BioId = biographyId, 
	Owner = owner,
	File = fileInfo
};

public static CustomBiographyContent CreateFromId(string biographyId, ModPackageโ€ฆ)

cs
public override void OnSetLang(string lang)
{
	CustomBiographyContent customBiographyContent = CreateFromId(base.ContentId.Split('/')[^1]); 
	CustomBiographyContent customBiographyContent = CreateFromId(BioId.IsEmpty(base.ContentId.Split('/')[^1])); 
	if (customBiographyContent != null)
	{
		base.File = customBiographyContent.File;

public override void OnSetLang(string lang)

cs
public void RefreshCharaBio(Chara chara)
{
	Load();
	if (_initialized) 
	{ 
		return; 
	} 
	Biography bio = chara.bio;
	if (birthDay != 0)
	{

public void RefreshCharaBio(Chara chara)

cs
		bio.idHobby = element;
	}
}
_initialized = true; 
int SetTempWord(string text, int tempIndex)
{
	int num = _tempLangKey[tempIndex];

protected override void LoadContent()

cs
		likeHobby = customBiographyContent.likeHobby;
		favCategory = customBiographyContent.favCategory;
		favFood = customBiographyContent.favFood;
		_initialized = false; 
	}
}

CustomCharaContent โ€‹

public static CustomCharaContent CreateFromRow(SourceChara.Row r, ModPackage ownโ€ฆ)

cs
{
	string text4 = text2.IsEmpty(r.id);
	customCharaContent.mapStr["biography_override"] = text4;
	if (!ModUtil.HasContent("Biography/" + text4)) 
	if (!ModUtil.HasContent("Biography/" + r.id)) 
	{
		CustomBiographyContent customBiographyContent = CustomBiographyContent.CreateFromId(text4, owner); 
		CustomBiographyContent customBiographyContent = CustomBiographyContent.CreateFromId(text4, owner, r.id); 
		if (customBiographyContent != null)
		{
			ModUtil.AddContent(customBiographyContent);

public static SpawnType GetSpawnTypeFromTrait(string trait)

cs
		return value;
	}
	Trait trait2 = ClassCache.Create<Trait>("Trait" + trait, "Elin");
	if (!(trait2 is TraitChara traitChara)) 
	{ 
		goto IL_005f; 
	} 
	SpawnType spawnType; 
	if (traitChara.AdvType == TraitChara.Adv_Type.None) 
	{ 
		if (!(trait2 is TraitMerchant)) 
		{ 
			if (!(trait2 is TraitUniqueChara)) 
			{ 
				goto IL_005f; 
			} 
			spawnType = SpawnType.Unique; 
		} 
		else
		{ 
			spawnType = SpawnType.Merchant; 
		} 
	} 
	else
	{ 
		spawnType = SpawnType.Adventurer; 
	} 
	goto IL_0061; 
	IL_0061: 
	SpawnType spawnType = ((trait2 is TraitAdventurer) ? SpawnType.Adventurer : ((trait2 is TraitMerchant) ? SpawnType.Merchant : ((trait2 is TraitUniqueChara) ? SpawnType.Unique : SpawnType.Common))); 
	return _cachedSpawnTypes[trait] = spawnType;
	IL_005f: 
	spawnType = SpawnType.Common; 
	goto IL_0061; 
}

public void OnCharaCreated(Chara chara)

public override void OnGameLoad(GameIOContext context)

cs
{
	if (num2 != 1)
	{
		goto IL_01cf; 
		goto IL_01d6; 
	}
	if (IsAdventurer)
	{
		goto IL_0178; 
		goto IL_017f; 
	}
}
else if (IsAdventurer)

public override void OnGameLoad(GameIOContext context)

cs
}
if (num == 0)
{
	goto IL_0178; 
	goto IL_017f; 
}
goto IL_01cf; 
IL_0178: 
goto IL_01d6; 
IL_017f: 
Debug.Log("#mod-content skipping existing character '" + base.SourceId + "', " + $"{count} at {string.Join(',', list2.Select((Chara c) => c.currentZone?.ZoneFullName))}");
return;
IL_01cf: 
for (int num3 = 0; num3 < num; num3++) 
IL_01d6: 
HashSet<Zone> occupied = list2.Select((Chara c) => c.homeZone).ToHashSet(); 
foreach (Zone item in list.Where((Zone z) => !occupied.Contains(z)).Take(num)) 
{
	Zone z = list[num3]; 
	Chara chara = SpawnToZone(z); 
	Chara chara = SpawnToZone(item); 
	if (chara == null)
	{
		ModUtil.LogModError("can't spawn character '" + base.SourceId + "'", base.Owner);

public override void OnGameLoad(GameIOContext context)

cs
			break;
		}
	}
	Chara SpawnToZone(Zone zone2) 
	Chara SpawnToZone(Zone z) 
	{
		Chara chara2 = CharaGen.Create(base.SourceId);
		if (chara2.id == "chicken")
		{
			return null;
		}
		chara2.SetHomeZone(zone2); 
		chara2.MoveZone(zone2, ZoneTransition.EnterState.RandomVisit); 
		Debug.Log("#mod-content spawned character '" + base.SourceId + "' to " + zone2.ZoneFullName); 
		chara2.SetHomeZone(z); 
		chara2.MoveZone(z, ZoneTransition.EnterState.RandomVisit); 
		Debug.Log("#mod-content spawned character '" + base.SourceId + "' to " + z.ZoneFullName); 
		return chara2;
	}
}

CustomGunEffectData โ€‹

using Newtonsoft.Json;

cs
using Newtonsoft.Json;
using UnityEngine;

[JsonObject(MemberSerialization.OptOut)] 
public class CustomGunEffectData : GameSetting.EffectData
{
	public bool forceLaser; 
	public bool forceRail; 
	public string caneColor; 
	public bool caneColorBlend; 
	public string idSprite = "ranged_gun"; 
	public string idSoundEject = "bullet_drop"; 
	public static readonly JsonSerializerSettings JsonSettings = new JsonSerializerSettings
	{ 
		NullValueHandling = NullValueHandling.Ignore, 
		ContractResolver = new GameIOContext.WritablePropertiesOnlyResolver() 
	}; 

	public GameSetting.EffectData CreateEffectData() 
	public CustomGunEffectData() 
	{
		return new CustomGunEffectData
		{ 
			sprite = (ModUtil.LoadSprite(idSprite) ?? Resources.Load<Sprite>("Media/Effect/General/" + idSprite)), 
			eject = eject, 
			firePos = firePos, 
			num = num, 
			delay = delay, 
			idEffect = idEffect, 
			idSound = idSound 
		}; 
		num = 1; 
		delay = 0.1f; 
		eject = true; 
		firePos = new Vector2(0.23f, 0.04f); 
		idSprite = "ranged_gun"; 
		idSoundEject = "bullet_drop"; 
	}

	public static CustomGunEffectData CreateFromId(string id) 
	public void ResolveSprite() 
	{
		if (!EClass.setting.effect.guns.TryGetValue(id, out var value)) 
		if (!idSprite.IsEmpty()) 
		{
			return null; 
			string spritePath = idSprite; 
			string name = idSprite; 
			sprite = ModUtil.LoadSprite(spritePath, null, name) ?? Resources.Load<Sprite>("Media/Effect/General/" + idSprite) ?? Resources.Load<Sprite>(idSprite) ?? Resources.Load<Sprite>("Media/Effect/General/ranged_gun"); 
		}
		return new CustomGunEffectData
		{ 
			num = value.num, 
			delay = value.delay, 
			idEffect = value.idEffect, 
			idSound = value.idSound, 
			idSprite = (value.sprite ? value.sprite.name : ""), 
			eject = value.eject, 
			firePos = value.firePos 
		}; 
	}
}

CustomGunEffectSetting โ€‹

public class CustomGunEffectSetting : CustomFileContent

cs
public class CustomGunEffectSetting : CustomFileContent
{
	public Dictionary<string, CustomGunEffectData> items; 
	public Dictionary<string, CustomGunEffectData> items = new Dictionary<string, CustomGunEffectData>(); 

	public static CustomGunEffectSetting CreateFromFile(FileInfo file, ModPackage owner = null)
	{

public static CustomGunEffectSetting CreateFromFile(FileInfo file, ModPackage owโ€ฆ)

cs
protected override void LoadContent()
{
	Dictionary<string, CustomGunEffectData> dictionary = IO.LoadFile<Dictionary<string, CustomGunEffectData>>(base.File.FullName, compress: false, GameIOContext.Settings); 
	items = dictionary; 
	Dictionary<string, CustomGunEffectData> dictionary = IO.LoadFile<Dictionary<string, CustomGunEffectData>>(base.File.FullName, compress: false, CustomGunEffectData.JsonSettings); 
	items = dictionary ?? new Dictionary<string, CustomGunEffectData>(); 
}

public override string ToString()

CustomMerchantStock โ€‹

public List<Thing> Generate(Card owner)

cs
Load();
List<Thing> list = new List<Thing>();
int createLv = owner?.trait?.ShopLv ?? (-1);
foreach (CustomThingContent item2 in items) 
foreach (CustomThingContent item in items) 
{
	try
	{
		Thing item = item2.Create(createLv); 
		list.Add(item); 
		Thing thing = item.Create(createLv); 
		if (thing != null) 
		{ 
			list.Add(thing); 
			continue; 
		} 
		ModUtil.LogModError("can't create stock item '" + item.id + "' in '" + base.ContentId + "'", base.Owner); 
	}
	catch (Exception ex)
	{
		ModUtil.LogModError("can't create stock item '" + item2.ContentId + "'\n" + ex.Message, base.Owner); 
		ModUtil.LogModError("can't create stock item '" + item.id + "' in '" + base.ContentId + "'\n" + ex.Message, base.Owner); 
		Debug.LogException(ex);
	}
}

CustomReligionContent โ€‹

public class CustomReligionContent : CustomSourceContent

cs
public override string SourceType => "SourceReligion";

public string ChunkName => "custom_religion_" + base.SourceId; 
public static CustomReligionContent CreateFromRow(SourceReligion.Row r, ModPackage owner = null)
{
	string text = r.id.Split('#')[0];

public static CustomReligionContent CreateFromRow(SourceReligion.Row r, ModPackaโ€ฆ)

cs
	isMinorGod = r.id.Contains("#minor")
};
EClass.sources.religions.map[text] = r;
if (!Portrait.modPortraits.dict.ContainsKey("UN_" + r.id) && SpriteReplacer.dictModItems.TryGetValue(r.id, out var value)) 
if (!Portrait.modPortraits.dict.ContainsKey("UN_" + text) && SpriteReplacer.dictModItems.TryGetValue(text, out var value)) 
{
	Portrait.modPortraits.Add("UN_" + r.id, new FileInfo(value + ".png")); 
	Portrait.modPortraits.Add("UN_" + text, new FileInfo(value + ".png")); 
	Portrait.allIds.Add("UN_" + text + ".png"); 
}
obj.RegisterCustomReligion();
return obj;

public static void Init()

cs
{
	value.content.canJoin = customReligionContent2.canJoin;
	value.content.isMinorGod = customReligionContent2.isMinorGod;
	value.content.noPunish = customReligionContent2.noPunish; 
	value.content.noPunishTakeover = customReligionContent2.noPunishTakeover; 
	value.content.artifacts = customReligionContent2.artifacts;
	value.content.elements = customReligionContent2.elements; 
	value.content.offeringMtp = customReligionContent2.offeringMtp;
	value.content.offeringValue = customReligionContent2.offeringValue;
	value.content.godAbilities = customReligionContent2.godAbilities;

static void LoadDeprecatedCwlSpec()

cs
{
	if (row.HasTag(CTAG.godArtifact))
	{
		managed.Values.FirstOrDefault((ReligionCustom r) => row.tag.Contains(r.id))?.content.artifacts.Add(row.id); 
		ReligionCustom religionCustom = managed.Values.FirstOrDefault((ReligionCustom r) => row.tag.Contains(r.id)); 
		if (religionCustom != null && !religionCustom.content.artifacts.Contains(row.id)) 
		{ 
			religionCustom.content.artifacts.Add(row.id); 
		} 
	}
}
foreach (SourceElement.Row row2 in EClass.sources.elements.rows)
{
	if (row2.tag.Contains("godAbility"))
	{
		managed.Values.FirstOrDefault((ReligionCustom r) => row2.tag.Contains(r.id))?.content.godAbilities.Add(row2.alias); 
		ReligionCustom religionCustom2 = managed.Values.FirstOrDefault((ReligionCustom r) => row2.tag.Contains(r.id)); 
		if (religionCustom2 != null && !religionCustom2.content.godAbilities.Contains(row2.alias)) 
		{ 
			religionCustom2.content.godAbilities.Add(row2.alias); 
		} 
	}
}
(FileInfo, EMod)[] filesEx2 = PackageIterator.GetFilesEx("Data/religion_elements.json");

internal static void LoadReligionData(GameIOContext context)

cs
internal static void SaveReligionData(GameIOContext context)
{
	if (!context.Load<Dictionary<string, ReligionCustom>>("custom_religion_data", out var data)) 
	Dictionary<string, ReligionCustom> data = null; 
	try
	{ 
		context.Load<Dictionary<string, ReligionCustom>>("custom_religion_data", out data); 
	} 
	catch (Exception ex) 
	{ 
		Debug.LogWarning("#mod-content rebuilding corrupted religion data chunk\n" + ex.Message); 
	} 
	if (data == null) 
	{
		data = new Dictionary<string, ReligionCustom>();
	}

CustomThingContent โ€‹

public enum SpawnType

cs
public string material = "";

public bool forceRarity; 
public bool noCopy;

public bool noRandomSocket;

public static CustomThingContent CreateFromRow(SourceThing.Row r, ModPackage modโ€ฆ)

cs
switch (text)
{
case "forceRarity":
	customThingContent.forceRarity = true; 
	customThingContent.rarity = r.quality.ToEnum<Rarity>();
	break;
case "noCopy":

public void OnThingCreated(Thing thing)

cs
	int value3 = value2;
	thing.SetInt(text2, value3);
}
if (thing.source.ContainsTag("forceRarity")) 
if (forceRarity) 
{
	thing.ChangeRarity(rarity);
}

void ApplyRangedSocket(string socket)

cs
		{
			float num4 = Mathf.Sqrt((float)(thing.genLv * value4.encFactor) / 100f);
			float num5 = (float)num3 + num4;
			int num6 = (value4.mtp + EClass.rnd(value4.mtp + (int)num5)) / value4.mtp; 
			if (value4.encFactor == 0 && num6 > 25) 
			int num6 = Mathf.Max(1, value4.mtp); 
			int num7 = (num6 + EClass.rnd(num6 + (int)num5)) / num6; 
			if (value4.encFactor == 0 && num7 > 25) 
			{
				num6 = 25; 
				num7 = 25; 
			}
			thing.ApplySocket(value4.id, num6); 
			thing.ApplySocket(value4.id, num7); 
		}
	}
}

ElinGameIOPropertyAttribute โ€‹

using System.Linq;

cs
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Newtonsoft.Json.Linq; 
using UnityEngine;

[AttributeUsage(AttributeTargets.Property)]

private static void LoadGameIOProperty(GameIOContext context)

cs
		{
			string key2 = propertyInfo.DeclaringType.FullName + ":" + text;
			object valueOrDefault = data.GetValueOrDefault(key2);
			action(valueOrDefault); 
			action(CoerceValue(valueOrDefault, propertyInfo.PropertyType)); 
		}
		catch (Exception arg)
		{
			Debug.LogError($"#io failed to populate context var {text}\n{arg}");
			_contextVars.Remove(text); 
		}
	}
	static object CoerceValue(object obj, Type type) 
	{ 
		if (obj == null) 
		{ 
			return type.IsValueType ? Activator.CreateInstance(type) : null; 
		} 
		if (obj is JToken jToken) 
		{ 
			return jToken.ToObject(type); 
		} 
		if (type.IsInstanceOfType(obj)) 
		{ 
			return obj; 
		} 
		if (obj is IConvertible) 
		{ 
			return Convert.ChangeType(obj, type); 
		} 
		return obj; 
	} 
}

private static void SaveGameIOProperty(GameIOContext context)

private static void SaveGameIOProperty(GameIOContext context)

cs
	catch (Exception arg)
	{
		Debug.LogError($"#io failed to save context var {text}\n{arg}");
		_contextVars.Remove(text); 
	}
}
context.Save("context_vars", dictionary);

FLOOR โ€‹

public class FLOOR : EClass

cs
public const int floor_shore = 33;

public static SourceFloor.Row sourceSnow = EClass.sources.floors.rows[39]; 
public static SourceFloor.Row sourceSnow; 

public static SourceFloor.Row sourceSnow2 = EClass.sources.floors.rows[56]; 
public static SourceFloor.Row sourceSnow2; 

public static SourceFloor.Row sourceIce = EClass.sources.floors.rows[38]; 
public static SourceFloor.Row sourceIce; 

public static SourceFloor.Row sourceWood = EClass.sources.floors.rows[21]; 
public static SourceFloor.Row sourceWood; 

public static bool IsTatami(int id)
{

GameSetting โ€‹

using System;

cs
using System;
using System.Collections.Generic;
using Newtonsoft.Json; 
using UnityEngine;

public class GameSetting : ScriptableObject

public class EffectData

cs
	public string idSound;

	public Sprite sprite; 
	public string idSoundEject; 
	public string idSprite; 

	public bool eject;

	public bool fireFromMuzzle; 
	public bool forceLaser; 
	public bool forceRail; 
	public bool caneColorBlend; 
	[JsonIgnore] 
	public Sprite sprite; 
	[JsonIgnore] 
	public Color caneColor; 
	public Vector2 firePos;
	[JsonProperty("caneColor")] 
	public string CaneColorHex 
	{ 
		get 
		{ 
			if (!(caneColor.a <= 0f)) 
			{ 
				return "#" + ((caneColor.a < 1f) ? ColorUtility.ToHtmlStringRGBA(caneColor) : ColorUtility.ToHtmlStringRGB(caneColor)); 
			} 
			return null; 
		} 
		set 
		{ 
			caneColor = default(Color); 
			if (!value.IsEmpty()) 
			{ 
				ColorUtility.TryParseHtmlString("#" + value.Replace("#", "").Replace("0x", ""), out caneColor); 
			} 
		} 
	} 
	public EffectData Clone() 
	{ 
		return (EffectData)MemberwiseClone(); 
	} 
}

public AudioSetting audio;

GoalCombat โ€‹

public override IEnumerable<Status> Run()

cs
}
if (this is GoalAutoCombat)
{
	ActionMode.Adv.SetTurbo(EClass.game.config.autoCombat.turbo ? (-1) : 0); 
	EClass.pc.ModExp(135, 20); 
	if (owner.IsPC) 
	{ 
		ActionMode.Adv.SetTurbo(EClass.game.config.autoCombat.turbo ? (-1) : 0); 
	} 
	owner.ModExp(135, 20); 
}
int dist = owner.Dist(tc);
bool move = owner.host == null && (tactics.ChanceMove > EClass.rnd(100) || (owner.IsPC && tc.HasCondition<ConFear>() && dist >= EClass.pc.GetSightRadius() - 1));

GrowSystem โ€‹

public static SourceObj.Row[] SourceSnowTree

cs
{
	obj = new SourceObj.Row[2]
	{
		EClass.sources.objs.map[54], 
		EClass.sources.objs.map[55] 
		EClass.sources.objs[54], 
		EClass.sources.objs[55] 
	};
	_sourceSnowTree = (SourceObj.Row[])obj;
}

public void PopHarvest(Chara c, Thing t = null, int num = -1)

cs
	}
	t.SetNum(num2);
}
else if (Application.isEditor) 
{ 
	Debug.Log("harvest count not set:" + source.id + "/" + source.alias); 
} 
if (num > 0)
{
	t.SetNum(num);

Lot โ€‹

public void SetBaseRoom(Room r)

cs
	if (board.data == null)
	{
		TraitHouseBoard.Data data = (board.data = new TraitHouseBoard.Data());
		CoreRef.DefaultRoof defaultRoof = EClass.core.refs.defaultRoofs[EClass.sources.blocks.map[num2 / 1000].roof]; 
		CoreRef.DefaultRoof defaultRoof = EClass.core.refs.defaultRoofs[EClass.sources.blocks[num2 / 1000].roof]; 
		data.height = (fullblock ? 1 : 2);
		data.heightFix = (fullblock ? 40 : 0);
		data.reverse = EClass.rnd(2) == 0;
		data.idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);
		data.idBlock = defaultRoof.idBlock;
		data.idRamp = defaultRoof.idRamp;
		SourceMaterial.Row row = EClass.sources.materials.map[num2 % 1000]; 
		SourceMaterial.Row row = EClass.sources.materials[num2 % 1000]; 
		data.colRoof = IntColor.ToInt(row.matColor);
	}
	RefreshData(board.data);
}
else
{
	CoreRef.DefaultRoof defaultRoof2 = EClass.core.refs.defaultRoofs[EClass.sources.blocks.map[num2 / 1000].roof]; 
	CoreRef.DefaultRoof defaultRoof2 = EClass.core.refs.defaultRoofs[EClass.sources.blocks[num2 / 1000].roof]; 
	height = (fullblock ? 1 : 2);
	heightFix = (fullblock ? 40 : 0);
	idRoofStyle = ((!EClass._map.IsIndoor && flag) ? 2 : 0);

public void SetBaseRoom(Room r)

cs
	realHeight = (float)height * EClass.setting.render.roomHeightMod + 0.01f * (float)heightFix;
	Color matColor = EClass.sources.materials.alias["oak"].matColor.SetAlpha(1f);
	colRoof = (colBlock = (colDeco = BaseTileMap.GetColorInt(ref matColor, 100)));
	SourceMaterial.Row row2 = EClass.sources.materials.map[num2 % 1000]; 
	SourceMaterial.Row row2 = EClass.sources.materials[num2 % 1000]; 
	colRoof = BaseTileMap.GetColorInt(ref row2.matColor, 100);
}
int num3 = (mx - x + pointMinX.z - z) / 2;

MATERIAL โ€‹

public class MATERIAL : EClass

cs
public const int MaxTier = 7;

public static SourceMaterial.Row sourceSnow => EClass.sources.materials.map[48]; 
public static SourceMaterial.Row sourceSnow => EClass.sources.materials[48]; 

public static SourceMaterial.Row sourceIce => EClass.sources.materials.map[61]; 
public static SourceMaterial.Row sourceIce => EClass.sources.materials[61]; 

public static SourceMaterial.Row sourceGold => EClass.sources.materials.map[12]; 
public static SourceMaterial.Row sourceGold => EClass.sources.materials[12]; 

public static SourceMaterial.Row sourceOak => EClass.sources.materials.map[1]; 
public static SourceMaterial.Row sourceOak => EClass.sources.materials[1]; 

public static SourceMaterial.Row sourceWaterSea => EClass.sources.materials.map[88]; 
public static SourceMaterial.Row sourceWaterSea => EClass.sources.materials[88]; 

public static SourceMaterial.Row FromElement(int id)
{

Map โ€‹

public void Load(string path, bool import = false, PartialMap partial = null)

cs
Validate(ref bytes19, "roofBlocks");
Validate(ref bytes20, "roofBlockMats");
Validate(ref bytes21, "roofBlockDirs");
int count = EClass.sources.floors.rows.Count; 
int count2 = EClass.sources.materials.rows.Count; 
int num3 = 0;
for (int i = 0; i < num; i++)
{

public void Load(string path, bool import = false, PartialMap partial = null)

cs
	isObjDyed = bytes13[num3].GetBit(1),
	crossWall = bytes13[num3].GetBit(2)
});
if (cell._bridge >= count) 
if (!EClass.sources.floors.map.ContainsKey(cell._bridge)) 
{
	cell._bridge = 0;
}
if (cell._bridgeMat >= count2) 
if (!EClass.sources.materials.map.ContainsKey(cell._bridgeMat)) 
{
	cell._bridgeMat = 1;
}

public void ClearRainAndDecal()

cs
public void SetObj(int x, int z, int id = 0, int value = 1, int dir = 0)
{
	SetObj(x, z, (byte)EClass.sources.objs.rows[id].DefaultMaterial.id, id, value, dir); 
	SetObj(x, z, (byte)EClass.sources.objs[id].DefaultMaterial.id, id, value, dir); 
}

public void SetObj(int x, int z, int idMat, int idObj, int value, int dir, bool ignoreRandomMat = false)

public void MineBlock(Point point, bool recoverBlock = false, Chara c = null, boโ€ฆ)

cs
}
SourceMaterial.Row row = (flag ? point.matRoofBlock : point.matBlock);
byte b = (flag ? point.cell._roofBlock : point.cell._block);
SourceBlock.Row row2 = EClass.sources.blocks.rows[b]; 
SourceBlock.Row row2 = EClass.sources.blocks[b]; 
Effect.Get("smoke").Play(point);
Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
	.Emit(10 + EClass.rnd(10));

public void MineRamp(Point point, int ramp, bool recoverBlock = false)

cs
		Effect.Get("mine").Play(point).SetParticleColor(point.matBlock.GetColor())
			.Emit(10 + EClass.rnd(10));
		MineObj(point);
		int rampDir = EClass._map.GetRampDir(point.x, point.z, EClass.sources.blocks.rows[ramp].tileType); 
		int rampDir = EClass._map.GetRampDir(point.x, point.z, EClass.sources.blocks[ramp].tileType); 
		RemoveLonelyRamps(point.cell);
		SetBlock(point.x, point.z, point.cell._blockMat, ramp, rampDir);
		DropBlockComponent(point, EClass.sources.blocks.rows[block], matBlock, recoverBlock); 
		DropBlockComponent(point, EClass.sources.blocks[block], matBlock, recoverBlock); 
	}
}

public void MineFloor(Point point, Chara c = null, bool recoverBlock = false, boโ€ฆ)

cs
	}
	if (!EClass._zone.IsRegion && !point.sourceFloor.components[0].Contains("chunk@soil"))
	{
		point.SetFloor(EClass.sources.floors.rows[1].DefaultMaterial.id, 40); 
		point.SetFloor(EClass.sources.floors[1].DefaultMaterial.id, 40); 
	}
}

MapGen โ€‹

protected override bool OnGenerateTerrain()

cs
	continue;
}
biomeProfiles[num4].layerBlock.FillHeightMap(heights1, OX, 0, OZ, Size, Size, zp.seeds.biome);
bool flag = EClass.sources.floors.rows[biomeProfiles[num4].exterior.floor.id].tag.Contains("soil"); 
bool flag = EClass.sources.floors[biomeProfiles[num4].exterior.floor.id].tag.Contains("soil"); 
for (int num5 = 0; num5 < Size; num5++)
{
	if (zp.clearEdge && ((num5 > map.bounds.x - 4 && num5 <= map.bounds.x + 4) || (num5 > map.bounds.maxX - 4 && num5 <= map.bounds.maxX + 4)))

protected override bool OnGenerateTerrain()

cs
{
	if ((!zp.clearEdge || ((num6 <= map.bounds.z - 4 || num6 > map.bounds.z + 4) && (num6 <= map.bounds.maxZ - 4 || num6 > map.bounds.maxZ + 4))) && !(biomes[num5, num6] != biomeProfiles[num4]) && heights1[num5, num6] > (float)blockHeight)
	{
		SourceBlock.Row row = EClass.sources.blocks.rows[biomeProfiles[num4].exterior.block.id]; 
		SourceBlock.Row row = EClass.sources.blocks[biomeProfiles[num4].exterior.block.id]; 
		if (!flag || row.alias == "block_ice")
		{
			SourceFloor.Row row2 = EClass.sources.floors.alias[row.autoFloor];

MapGenRegion โ€‹

protected override bool OnGenerateTerrain()

cs
		map.cells[j, i].impassable = row.attribs[0] == 0;
		if (row.floor != 0)
		{
			SetFloor(j, i, EClass.sources.floors.rows[row.floor].DefaultMaterial.id, row.floor); 
			SetFloor(j, i, EClass.sources.floors[row.floor].DefaultMaterial.id, row.floor); 
		}
	}
}

ModUtil โ€‹

public static void LogModError(string message, BaseModPackage package = null)

cs
{
	string text = "#mod/" + package?.title + " (" + package?.id + ")\n" + message;
	UnityEngine.Debug.LogWarning(text.RemoveAllTags());
	if ((package?.isInPackages ?? false) || Application.isEditor) 
	if ((package != null && package.isInPackages && !package.builtin) || Application.isEditor) 
	{
		EGui.CreatePopup(text);
	}

private static void OnPostLoadInit(GameIOContext context)

cs
	}
}
List<ICustomContent> contents = new List<ICustomContent>();
CustomReligionContent.LoadReligionData(context); 
try
{ 
	CustomReligionContent.LoadReligionData(context); 
} 
catch (Exception ex) 
{ 
	LogModError("exception while loading custom religion data\n" + ex.Message); 
	UnityEngine.Debug.LogException(ex); 
} 
LoadCustomContent<CustomZoneContent>();
LoadCustomContent<CustomCharaContent>();
LoadOtherCustomContent();

void LoadCustomContent<T>() where T : class, ICustomContent

cs
	UnityEngine.Debug.Log("#mod-content loading " + typeof(T).Name + "...");
	foreach (T item in _customContent.Values.OfType<T>())
	{
		contents.Add(item); 
		try
		{
			item.OnGameLoad(context);
			contents.Add(item); 
		}
		catch (Exception ex) 
		catch (Exception ex2) 
		{
			LogModError("exception while loading custom content '" + item.ContentId + "'\n" + ex.Message, item.Owner); 
			UnityEngine.Debug.LogException(ex); 
			LogModError("exception while loading custom content '" + item.ContentId + "'\n" + ex2.Message, item.Owner); 
			UnityEngine.Debug.LogException(ex2); 
		}
	}
}

void LoadOtherCustomContent()

cs
		{
			item2.OnGameLoad(context);
		}
		catch (Exception ex) 
		catch (Exception ex2) 
		{
			LogModError("exception while loading custom content '" + item2.ContentId + "'\n" + ex.Message, item2.Owner); 
			UnityEngine.Debug.LogException(ex); 
			LogModError("exception while loading custom content '" + item2.ContentId + "'\n" + ex2.Message, item2.Owner); 
			UnityEngine.Debug.LogException(ex2); 
		}
	}
}

private static void OnPreSaveInit(GameIOContext context)

cs
[ElinPostSave]
private static void OnPostSaveInit(GameIOContext context)
{
	CustomReligionContent.SaveReligionData(context); 
	try
	{ 
		CustomReligionContent.SaveReligionData(context); 
	} 
	catch (Exception ex) 
	{ 
		LogModError("exception while saving custom religion data\n" + ex.Message); 
		UnityEngine.Debug.LogException(ex); 
	} 
	foreach (ICustomContent value in _customContent.Values)
	{
		try
		{
			value.OnGameSave(context);
		}
		catch (Exception ex) 
		catch (Exception ex2) 
		{
			LogModError("exception while saving custom content '" + value.ContentId + "'\n" + ex.Message, value.Owner); 
			UnityEngine.Debug.LogException(ex); 
			LogModError("exception while saving custom content '" + value.ContentId + "'\n" + ex2.Message, value.Owner); 
			UnityEngine.Debug.LogException(ex2); 
		}
	}
}

public static List<string> LoadCharaTalk()

cs
	foreach (FileInfo fileInfo in files)
	{
		list.Add(fileInfo.FullName);
		UnityEngine.Debug.Log("#mod-content loaded chara tone " + fileInfo.ShortPath()); 
		UnityEngine.Debug.Log("#mod-content loaded chara talk " + fileInfo.ShortPath()); 
	}
	return list;
}

public static List<string> LoadCharaTone()

cs
	foreach (FileInfo fileInfo in files)
	{
		list.Add(fileInfo.FullName);
		UnityEngine.Debug.Log("#mod-content loaded chara talk " + fileInfo.ShortPath()); 
		UnityEngine.Debug.Log("#mod-content loaded chara tone " + fileInfo.ShortPath()); 
	}
	return list;
}

public static Sprite LoadSprite(string spritePath, Vector2? pivot = null, stringโ€ฆ)

cs
{
	return null;
}
if (resizeWidth != 0 && resizeHeight != 0 && value2.width != resizeWidth && value2.height != resizeHeight) 
if (resizeWidth != 0 && resizeHeight != 0 && (value2.width != resizeWidth || value2.height != resizeHeight)) 
{
	Texture2D texture2D = value2.Rescale(resizeWidth, resizeHeight);
	UnityEngine.Object.Destroy(value2);

public static Dictionary<string, CustomGunEffectData> LoadGunEffects()

cs
public static void ImportAllGunEffectSettings()
{
	foreach (KeyValuePair<string, CustomGunEffectData> item in LoadGunEffects()) 
	foreach (var (key, customGunEffectData2) in LoadGunEffects()) 
	{
		item.Deconstruct(out var key, out var value); 
		string key2 = key; 
		GameSetting.EffectData value2 = value.CreateEffectData(); 
		EClass.setting.effect.guns[key2] = value2; 
		customGunEffectData2.ResolveSprite(); 
		EClass.setting.effect.guns[key] = customGunEffectData2; 
	}
}

public static string ExportAllGunEffectSettings()
{
	UD_String_EffectData guns = EClass.setting.effect.guns; 
	string text = CorePath.rootExe + "/guns.json";
	Dictionary<string, CustomGunEffectData> dictionary = new Dictionary<string, CustomGunEffectData>(); 
	foreach (string key in guns.Keys) 
	Dictionary<string, GameSetting.EffectData> dictionary = new Dictionary<string, GameSetting.EffectData>(); 
	foreach (KeyValuePair<string, GameSetting.EffectData> gun in EClass.setting.effect.guns) 
	{
		CustomGunEffectData value = CustomGunEffectData.CreateFromId(key); 
		dictionary[key] = value; 
		gun.Deconstruct(out var key, out var value); 
		string key2 = key; 
		GameSetting.EffectData effectData = value; 
		GameSetting.EffectData effectData2 = effectData.Clone(); 
		if (effectData2.idSprite.IsEmpty() && (bool)effectData.sprite) 
		{ 
			effectData2.idSprite = effectData.sprite.name; 
		} 
		dictionary[key2] = effectData2; 
	}
	File.WriteAllText(text, JsonConvert.SerializeObject(dictionary, Formatting.Indented, GameIOContext.Settings)); 
	File.WriteAllText(text, JsonConvert.SerializeObject(dictionary, Formatting.Indented, CustomGunEffectData.JsonSettings)); 
	return $"dumped {dictionary.Count} guns data to {text}";
}

AssemblyInfo โ€‹

using System.Security;

cs
using System.Security;
using System.Security.Permissions;

[assembly: AssemblyFileVersion("0.23.339.0")] 
[assembly: AssemblyInformationalVersion("0.23.339.0+Nightly")] 
[assembly: AssemblyMetadata("GameVersion", "0.23.339.0")] 
[assembly: AssemblyMetadata("GameVersionText", "EA 23.339")] 
[assembly: AssemblyMetadata("GameVersionInt", "23339")] 
[assembly: AssemblyMetadata("ReleaseChannel", "Nightly")] 
[assembly: AssemblyVersion("0.0.0.0")]

QuestTrackCraft โ€‹

public class QuestTrackCraft : Quest

cs
public override string GetTitle()
{
	if (recipe == null) 
	{ 
		return "???"; 
	} 
	return "trackCraft_title".lang(recipe.Name, recipe.NameFactory);
}

public void SetRecipe(Recipe r)

cs
public override string GetDetail(bool onJournal = false)
{
	if (recipe == null) 
	{ 
		return "???"; 
	} 
	if (ingredients == null)
	{
		ingredients = recipe.GetIngredients();

Religion โ€‹

void SetValue(SourceCategory.Row cat, int mtp)

cs
	}
}

public virtual int GetGiftRank() 
public virtual int GetGiftRank(Chara chara = null) 
{
	if (IsEyth || source.rewards.Length == 0)
	{
		return -1;
	}
	int num = EClass.pc.Evalue(85); 
	int num = (chara ?? EClass.pc).Evalue(85); 
	if (giftRank == 0 && (num >= 15 || EClass.debug.enable))
	{
		return 1;

public virtual int GetGiftRank()

cs
	return -1;
}

public virtual bool TryGetGift() 
public virtual bool TryGetGift(Chara chara = null) 
{
	int num = GetGiftRank(); 
	if (chara == null) 
	{ 
		chara = EClass.pc; 
	} 
	int num = GetGiftRank(chara); 
	if (num == -1)
	{
		return false;
	}
	Point point = EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false) ?? EClass.pc.pos; 
	Point point = chara.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false) ?? chara.pos; 
	switch (num)
	{
	case 1:
	{
		Talk("pet");
		Chara chara = CharaGen.Create(source.rewards[0]); 
		EClass._zone.AddCard(chara, point); 
		chara.MakeAlly(); 
		chara.PlayEffect("aura_heaven"); 
		Chara chara2 = CharaGen.Create(source.rewards[0]); 
		EClass._zone.AddCard(chara2, point); 
		chara2.MakeAlly(); 
		chara2.PlayEffect("aura_heaven"); 
		giftRank = 1;
		return true;
	}

ReligionCustom โ€‹

using Newtonsoft.Json;

cs
using Newtonsoft.Json; 
using UnityEngine;

public class ReligionCustom : Religion
{
	[JsonIgnore] 
	public CustomReligionContent content;

	public override string id => content?.SourceId ?? "";

SourceBlock โ€‹

public override RenderParam GetRenderParam(SourceMaterial.Row mat, int dir, Poinโ€ฆ)

cs
if (tileType == TileType.HalfBlock)
{
	int num = 104025;
	Row row = ((id == 5) ? base.sources.blocks.rows[mat.defBlock] : this); 
	Row row = ((id == 5) ? base.sources.blocks[mat.defBlock] : this); 
	renderParam.tile = row._tiles[0];
	renderParam.matColor = ((row.colorMod == 0) ? num : BaseTileMap.GetColorInt(ref mat.matColor, row.colorMod));
	renderParam.tile2 = row.sourceAutoFloor._tiles[0];

public override RenderParam GetRenderParam(SourceMaterial.Row mat, int dir, Poinโ€ฆ)

cs
public static RenderData FallbackRenderData;

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override Row CreateRow()
{
	return new Row

public override void OnAfterImportData()

cs
	public override void OnInit()
	{
		Lookup.Build(); 
		FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/block");
		Cell.blockSource = this; 
		Cell.blockList = rows;
		SourceFloor floors = Core.Instance.sources.floors;
		foreach (Row row in rows)
		{
			row.Init();
			row.sourceAutoFloor = (row.autoFloor.IsEmpty() ? floors.rows[40] : floors.alias[row.autoFloor]); 
			row.sourceAutoFloor = (row.autoFloor.IsEmpty() ? floors[40] : floors.alias[row.autoFloor]); 
		}
	}
}

SourceCellEffect โ€‹

public override int GetTile(SourceMaterial.Row mat, int dir = 0)

cs
public static RenderData FallbackRenderData;

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override Row CreateRow()
{
	return new Row

public override void OnAfterImportData()

cs
public override void OnInit()
{
	Lookup.Build(); 
	FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/liquid");
	Cell.effectSource = this; 
	Cell.effectList = rows;
	foreach (Row row in rows)
	{

SourceDeco โ€‹

public override int GetTile(SourceMaterial.Row mat, int dir = 0)

cs
public Dictionary<int, Row> _rows = new Dictionary<int, Row>();

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override Row CreateRow()
{
	return new Row

public override void OnAfterImportData()

cs
public override void OnInit()
{
	Lookup.Build(); 
	Cell.decoSource = this; 
	Cell.decoList = rows;
	foreach (Row row in rows)
	{

SourceFloor โ€‹

public override int GetTile(SourceMaterial.Row mat, int dir = 0)

cs
public static RenderData FallbackRenderData;

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override Row CreateRow()
{
	return new Row

public override void OnAfterImportData()

cs
public override void OnInit()
{
	Lookup.Build(); 
	FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/floor");
	Cell.floorSource = this; 
	Cell.floorList = rows;
	FLOOR.sourceSnow = this[39]; 
	FLOOR.sourceSnow2 = this[56]; 
	FLOOR.sourceIce = this[38]; 
	FLOOR.sourceWood = this[21]; 
	foreach (Row row in rows)
	{
		row.Init();

SourceMaterial โ€‹

public Row Select()

cs
public static Dictionary<string, TierList> tierMap = new Dictionary<string, TierList>();

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override string[] ImportFields => new string[1] { "altName" };

public override Row CreateRow()

public override IReadOnlyDictionary<string, string> GetTypeMapping()

cs
public override void OnInit()
{
	Lookup.Build(); 
	Cell.matSource = this; 
	Cell.matList = rows;
	tierMap.Clear();
	tierMap.Add("gem", new TierList());

SourceObj โ€‹

public class Stage

cs
public static RenderData FallbackRenderData;

[NonSerialized] 
private TileLookup<Row> _lookup; 
private TileLookup<Row> Lookup => _lookup ?? (_lookup = new TileLookup<Row>(map)); 
public Row this[int id] => Lookup[id]; 
public override Row CreateRow()
{
	return new Row

public override void OnAfterImportData()

cs
public override void OnInit()
{
	Lookup.Build(); 
	FallbackRenderData = ResourceCache.Load<RenderData>("Scene/Render/Data/obj");
	Cell.objSource = this; 
	Cell.objList = rows;
	foreach (Row row in rows)
	{

TCText โ€‹

public void Say(string s, float duration = 0f)

cs
{
	return;
}
string id; 
float chance; 
while (ExtractSoundTag(ref s, out id, out chance)) 
{ 
	if (Rand.rndf(1f) <= chance) 
	{ 
		base.owner.PlaySound(id); 
	} 
} 
PopItem p;
switch (s[0])
{

public override void OnKill()

cs
		pop.CopyAll(EMono.ui.rectDynamic);
		pop.KillAll(instant: true);
	}
	private static bool ExtractSoundTag(ref string text, out string id, out float chance) 
	{ 
		id = null; 
		chance = 1f; 
		int num = text.IndexOf("<sound", StringComparison.Ordinal); 
		if (num == -1) 
		{ 
			return false; 
		} 
		int num2 = text.IndexOf('>', num); 
		if (num2 == -1) 
		{ 
			return false; 
		} 
		int num3 = num + 6; 
		string text2 = text.Substring(num3, num2 - num3); 
		int num4 = text2.IndexOf(','); 
		if (num4 == -1) 
		{ 
			id = text2; 
		} 
		else
		{ 
			id = text2[..num4]; 
			float.TryParse(text2[(num4 + 1)..], out chance); 
		} 
		text = text.Remove(num, num2 - num + 1); 
		chance = Mathf.Clamp01(chance); 
		return true; 
	} 
}

TaskChopWood โ€‹

public override void OnCreateProgress(Progress_Custom p)

cs
			log.ModNum(-1);
			owner.elements.ModExp(225, 30f);
			owner.stamina.Mod(-1);
			EClass._map.TrySmoothPick(pos, thing, EClass.pc); 
			EClass._map.TrySmoothPick(pos, thing, owner); 
		};
	}
}

TaskClean โ€‹

public override IEnumerable<Status> Run()

cs
	owner.renderer.NextFrame();
	yield return KeepRunning();
}
EClass.pc.Say("clean", owner); 
EClass.pc.PlaySound("clean_floor"); 
owner.Say("clean", owner); 
owner.PlaySound("clean_floor"); 
if (range > 1)
{
	List<Point> list = EClass._map.ListPointsInSquare(dest, range - 1, mustBeWalkable: false);
	list.Sort((Point a, Point b) => a.Distance(dest) - b.Distance(dest));
	foreach (Point item in list)
	{
		if (owner == null || owner.isDead) 
		if (owner != null && !owner.isDead) 
		{
			break; 
			Clean(item); 
			continue; 
		}
		Clean(item); 
		break; 
	}
}
else

public override IEnumerable<Status> Run()

cs
		}
		yield return KeepRunning();
	}
	static void Clean(Point p) 
	void Clean(Point p) 
	{
		if (CanClean(p))
		{
			EClass._map.SetDecal(p.x, p.z);
			EClass._map.SetLiquid(p.x, p.z, 0, 0);
			p.PlayEffect("vanish");
			EClass.pc.ModExp(293, 30); 
			EClass.player.stats.clean++; 
			EClass.pc.stamina.Mod(-1); 
			owner.ModExp(293, 30); 
			if (owner.IsPC) 
			{ 
				EClass.player.stats.clean++; 
			} 
			owner.stamina.Mod(-1); 
		}
	}
}

TaskCraft โ€‹

public override void OnProgressComplete()

cs
	Effect.Get("smoke").Play(CraftPos);
	Effect.Get("mine").Play(CraftPos).SetParticleColor(recipe.GetColorMaterial().GetColor())
		.Emit(10 + EClass.rnd(10));
	EClass.pc.stamina.Mod(-costSP); 
	owner.stamina.Mod(-costSP); 
}

public void PutOutResources()

TaskMine โ€‹

public override HitResult GetHitResult()

cs
{
	return HitResult.Default;
}
if (mode == Mode.Ramp && (pos.cell.HasRamp || EClass._map.GetRampDir(pos.x, pos.z, EClass.sources.blocks.rows[ramp].tileType) == -1)) 
if (mode == Mode.Ramp && (pos.cell.HasRamp || EClass._map.GetRampDir(pos.x, pos.z, EClass.sources.blocks[ramp].tileType) == -1)) 
{
	return HitResult.Default;
}

Thing โ€‹

public override RenderRow TileRow

cs
	{
		if (trait is TraitFakeBlock)
		{
			return EClass.sources.blocks.map[base.refVal]; 
			return EClass.sources.blocks[base.refVal]; 
		}
		return EClass.sources.objs.map[base.refVal]; 
		return EClass.sources.objs[base.refVal]; 
	}
	return base.TileRow;
}

public override void SetRenderParam(RenderParam p)

cs
	break;
case Trait.TileMode.FakeBlock:
{
	SourceBlock.Row row2 = EClass.sources.blocks.map[base.refVal]; 
	SourceBlock.Row row2 = EClass.sources.blocks[base.refVal]; 
	p.tile = row2._tiles[base.dir % row2._tiles.Length];
	if (row2.tileType.IsFullBlock)
	{

public override void SetRenderParam(RenderParam p)

cs
}
case Trait.TileMode.FakeObj:
{
	SourceObj.Row row = EClass.sources.objs.map[base.refVal]; 
	SourceObj.Row row = EClass.sources.objs[base.refVal]; 
	p.tile = row._tiles[base.dir % row._tiles.Length];
	break;
}

ThingGen โ€‹

public static Thing CreateBill(int pay, bool tax)

cs
public static Thing CreateBlock(int id, int idMat)
{
	Thing thing = Create(EClass.sources.blocks.rows[id].idThing, idMat); 
	Thing thing = Create(EClass.sources.blocks[id].idThing, idMat); 
	thing.refVal = id;
	return thing;
}

public static Thing CreateFloor(int id, int idMat, bool platform = false)
{
	_ = EClass.sources.floors.rows[id]; 
	_ = EClass.sources.floors[id]; 
	Thing thing = Create(platform ? "platform" : "floor", idMat);
	thing.refVal = id;
	return thing;

public static Thing CreateFloor(int id, int idMat, bool platform = false)

cs
public static Thing CreateDeco(int id, int idMat)
{
	_ = EClass.sources.decos.rows[id]; 
	_ = EClass.sources.decos[id]; 
	Thing thing = Create("deco", idMat);
	thing.refVal = id;
	return thing;

public static Thing CreateDeco(int id, int idMat)

cs
public static Thing CreateObj(int id, int idMat)
{
	_ = EClass.sources.objs.rows[id]; 
	_ = EClass.sources.objs[id]; 
	Thing thing = Create("obj", idMat);
	thing.refVal = id;
	return thing;

+TileLookup โ€‹

File Created
cs
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public class TileLookup<T> where T : SourceData.BaseRow
{
	private const int DefaultRange = 1024;

	private readonly Dictionary<int, T> _map;

	private T[] _builtin = Array.Empty<T>();

	private T _fallback;

	private HashSet<int> _missing;

	public T this[int id]
	{
		get
		{
			T[] builtin = _builtin;
			if ((uint)id < (uint)builtin.Length)
			{
				T val = builtin[id];
				if (val != null)
				{
					return val;
				}
			}
			return Resolve(id);
		}
	}

	public TileLookup(Dictionary<int, T> rowsById)
	{
		_map = rowsById;
	}

	public void Build()
	{
		_missing = null;
		_fallback = _map.TryGetValue(0);
		int maxId = -1;
		foreach (int item in _map.Keys.Where((int id) => id > maxId && id < 1024))
		{
			maxId = item;
		}
		_builtin = ((maxId < 0) ? Array.Empty<T>() : new T[maxId + 1]);
		foreach (KeyValuePair<int, T> item2 in _map.Where((KeyValuePair<int, T> kv) => kv.Key <= maxId))
		{
			_builtin[item2.Key] = item2.Value;
		}
	}

	private T Resolve(int id)
	{
		if (_map.TryGetValue(id, out var value))
		{
			return value;
		}
		if (_missing == null)
		{
			_missing = new HashSet<int>();
		}
		if (_missing.Add(id))
		{
			Debug.LogWarning($"#source missing tile row: {typeof(T).DeclaringType?.Name}#{id}");
		}
		return _fallback ?? _map.TryGetValue(0);
	}
}

TileMapElona โ€‹

public override void DrawTile()

cs
	break;
}
case BlockRenderMode.HalfBlock:
	_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock); 
	_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks[matBlock.defBlock] : sourceBlock); 
	param.tile = _sourceBlock._tiles[0];
	param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
	param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];

TraitAltar โ€‹

public void _OnOffer(Chara c, Thing t, int takeoverMod = 0)

cs
	c.elements.ModExp(306, offeringValue / 5);
}
c.RefreshFaithElement();
if (c.faith.GetGiftRank() != -1) 
if (c.faith.GetGiftRank(c) != -1) 
{
	c.faith.Talk("like");
}

TraitBlock โ€‹

public class TraitBlock : TraitTile

cs
public class TraitBlock : TraitTile
{
	public override TileRow source => EClass.sources.blocks.rows[owner.refVal]; 
	public override TileRow source => EClass.sources.blocks[owner.refVal]; 
}

TraitDrinkMilkMother โ€‹

public override void OnDrink(Chara c)

cs
EClass.game.cards.uidNext = 1;
Rand.SetSeed(1);
Chara chara = CharaGen.Create(owner.c_idRefCard);
chara.SetLv(Mathf.Clamp(5 + owner.encLV * 5, 1, 20 + EClass.pc.Evalue(237))); 
chara.SetLv(Mathf.Clamp(5 + owner.encLV * 5, 1, 20 + (c.master ?? EClass.pc).Evalue(237))); 
Rand.SetSeed();
EClass.game.cards.uidNext = uidNext;
Debug.Log(chara.id + "/" + chara.LV);

public override void OnDrink(Chara c)

cs
		c.PlaySound("ding_potential");
	}
	c.PlayEffect("buff");
	EClass.pc.ModExp(237, 100); 
	(c.master ?? EClass.pc).ModExp(237, 100); 
}
else
{

TraitFakeTile โ€‹

public class TraitFakeTile : Trait

cs
public override RenderData GetRenderData()
{
	return EClass.sources.blocks.map[owner.refVal].renderData; 
	return EClass.sources.blocks[owner.refVal].renderData; 
}

public override void OnCrafted(Recipe recipe, List<Thing> ings)

TraitFloor โ€‹

public class TraitFloor : TraitTile

cs
public class TraitFloor : TraitTile
{
	public override TileRow source => EClass.sources.floors.rows[owner.refVal]; 
	public override TileRow source => EClass.sources.floors[owner.refVal]; 
}

TraitFloorDeco โ€‹

public class TraitFloorDeco : TraitTile

cs
{
	public override bool ConsumeOnUse => false;

	public override TileRow source => EClass.sources.decos.rows[owner.refVal]; 
	public override TileRow source => EClass.sources.decos[owner.refVal]; 
}

TraitObj โ€‹

public class TraitObj : TraitTile

cs
public class TraitObj : TraitTile
{
	public override TileRow source => EClass.sources.objs.rows[owner.refVal]; 
	public override TileRow source => EClass.sources.objs[owner.refVal]; 

	public override bool CanBeOnlyBuiltInHome => true;
}

TraitPlatform โ€‹

public class TraitPlatform : TraitTile

cs
{
	public override bool IsHomeItem => true;

	public override TileRow source => EClass.sources.floors.rows[owner.refVal]; 
	public override TileRow source => EClass.sources.floors[owner.refVal]; 

	public override string suffix => "-b";

TraitSeed โ€‹

public class TraitSeed : Trait

cs
{
	public static List<SourceObj.Row> listSeeds;

	public SourceObj.Row row => EClass.sources.objs.map[owner.refVal]; 
	public SourceObj.Row row => EClass.sources.objs[owner.refVal]; 

	public override int InstallBottomPriority => 10000;

TraitSwitch โ€‹

public bool TryDisarmTrap(Chara c)

cs
c.Say("disarm_success", c, owner);
owner.PlaySound("disarm");
c.ModExp(293, 50 + TrapLv);
int num = (EClass.debug.enable ? 10 : (c.IsPCFactionOrMinion ? EClass.pc.Evalue(1656) : 0)); 
Chara chara = (c.IsPC ? c : EClass.pc); 
int num = (EClass.debug.enable ? 10 : (c.IsPCFactionOrMinion ? chara.Evalue(1656) : 0)); 
if (!IsLaidByDog && num > 0 && num + 2 > EClass.rnd(10))
{
	string id = "scrap";
	int idMat = -1;
	int lv = num * 5 + EClass.pc.Evalue(293) / 4 + EClass.pc.Evalue(210) / 4; 
	int lv = num * 5 + chara.Evalue(293) / 4 + chara.Evalue(210) / 4; 
	if (EClass.rnd(3) == 0)
	{
		id = "junk";

public bool TryDisarmTrap(Chara c)

cs
	}
	Thing thing = ThingGen.Create(id, idMat, lv);
	thing.isHidden = false;
	EClass.pc.Say("scavenge", owner, thing); 
	EClass._map.TrySmoothPick(owner.pos, thing, EClass.pc); 
	chara.Say("scavenge", owner, thing); 
	EClass._map.TrySmoothPick(owner.pos, thing, chara); 
}
owner.Destroy();
return true;

Wall โ€‹

public struct Wall

cs
	public byte idMat;

	public SourceBlock.Row source => Cell.blockList[id]; 
	public SourceBlock.Row source => Cell.blockSource[id]; 

	public SourceMaterial.Row mat => Cell.matList[idMat]; 
	public SourceMaterial.Row mat => Cell.matSource[idMat]; 
}

Zone โ€‹

public void Simulate()

cs
VirtualDate virtualDate = new VirtualDate(HourSinceLastActive);
List<Chara> list = EClass._map.charas.ToList();
int num2 = HourSinceLastActive / 24;
int num3 = 0; 
if (num2 > 0)
{
	foreach (Chara item in list)

public void Simulate()

cs
	}
}
VirtualDate.current = virtualDate;
int num3 = EClass.core.config.test.maxSimHour; 
if (num3 <= 0) 
{ 
	num3 = 8640; 
} 
int num4 = HourSinceLastActive - num3; 
for (int i = 0; i < HourSinceLastActive; i++)
{
	virtualDate.SimulateHour(); 
	if (!virtualDate.IsWinter) 
	if (i >= num4) 
	{
		num3++; 
		virtualDate.SimulateHour(); 
	}
}
EClass._map.things.ForeachReverse(delegate(Thing t)

public void Simulate()

cs
{
	return;
}
int num4 = 0; 
int num5 = 0; 
foreach (Chara item2 in list)
{
	if (item2.IsPCParty)

public void Simulate()

cs
{
	if (item2.id == "bee")
	{
		num4++; 
		num5++; 
	}
	if (num2 > 0 && item2.IsGuest())
	{

public void Simulate()

cs
		list2.Add(thing);
	}
}
if (num4 >= list2.Count) 
if (num5 >= list2.Count) 
{
	return;
}
for (int num5 = num4; num5 < list2.Count; num5++) 
for (int num6 = num5; num6 < list2.Count; num6++) 
{
	if (EClass.rnd(200) <= HourSinceLastActive)
	{

ZoneInspector โ€‹

public void FillFloor()

cs
	EMono._map.ForeachCell(delegate(Cell c)
	{
		int dir = (randomFillDir ? EMono.rnd(4) : 0);
		EMono._map.SetFloor(c.x, c.z, EMono.sources.floors.rows[fillFloor].DefaultMaterial.id, fillFloor, dir); 
		EMono._map.SetFloor(c.x, c.z, EMono.sources.floors[fillFloor].DefaultMaterial.id, fillFloor, dir); 
	});
}

public void FillBlock()

cs
	EMono._map.ForeachCell(delegate(Cell c)
	{
		int dir = (randomFillDir ? EMono.rnd(4) : 0);
		EMono._map.SetBlock(c.x, c.z, EMono.sources.blocks.rows[fillBlock].DefaultMaterial.id, fillBlock, dir); 
		EMono._map.SetBlock(c.x, c.z, EMono.sources.blocks[fillBlock].DefaultMaterial.id, fillBlock, dir); 
	});
}