EA 23.140
May 15, 2025
26 files modified. 1 new file created.
Important Changes
None.
AI_Steal
@@ -40,7 +40,11 @@ public override bool IsValidTC(Card c)
public override bool CanPerform()
{
return Act.TC != null;
if (Act.TC != null)
{
return Act.TC.trait.CanBeStolen;
}
return false;
}
public override bool Perform()
ActPlan
@@ -549,13 +549,28 @@ public void _Update(PointTarget target)
{
TrySetAct("ActBanishSummon", delegate
{
EClass.pc.Say("summon_vanish", c2);
c2.pos.PlayEffect("vanish");
c2.pos.PlaySound("vanish");
c2.pos.PlayEffect("teleport");
c2.Destroy();
Banish(c2);
return true;
}, c2, null, 99);
List<Chara> list2 = new List<Chara>();
foreach (Chara chara in EClass._map.charas)
{
if (chara.IsPCPartyMinion && !chara.IsEscorted())
{
list2.Add(chara);
}
}
if (list2.Count > 1)
{
TrySetAct("ActBanishSummonAll", delegate
{
foreach (Chara item in list2)
{
Banish(item);
}
return true;
}, c2, null, 99);
}
}
}
}
@@ -812,11 +827,11 @@ void func()
IList<Card> _cards = items.Copy();
TrySetAct("actPickAll", delegate
{
foreach (Card item in _cards)
foreach (Card item2 in _cards)
{
if (item.isThing && item.placeState == PlaceState.roaming)
if (item2.isThing && item2.placeState == PlaceState.roaming)
{
EClass.pc.Pick(item.Thing);
EClass.pc.Pick(item2.Thing);
}
}
return true;
@@ -962,5 +977,13 @@ void func()
WidgetCurrentTool.Instance.placer.Refresh();
}
}
static void Banish(Chara m)
{
EClass.pc.Say("summon_vanish", m);
m.pos.PlayEffect("vanish");
m.pos.PlaySound("vanish");
m.pos.PlayEffect("teleport");
m.Destroy();
}
}
}
BaseTileMap
@@ -1270,8 +1270,8 @@ public virtual void DrawTile()
fogged = true;
}
}
goto IL_7b88;
IL_6fcd:
goto IL_7b8d;
IL_6fd2:
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;
@@ -1494,7 +1494,7 @@ public virtual void DrawTile()
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7b88;
goto IL_7b8d;
IL_1683:
if (this.cell.isSlopeEdge)
{
@@ -2507,7 +2507,7 @@ public virtual void DrawTile()
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
}
if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.isToggleWallPillar)
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);
@@ -2691,26 +2691,26 @@ public virtual void DrawTile()
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_6f6d;
goto IL_6f72;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_6f6d;
goto IL_6f72;
}
}
}
goto IL_6fcd;
IL_6f6d:
goto IL_6fd2;
IL_6f72:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num14;
rendererFov.Draw(param);
}
goto IL_6fcd;
IL_7b88:
goto IL_6fd2;
IL_7b8d:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
Biography
@@ -472,6 +472,9 @@ public void SetPortrait(Chara c)
case "sister_penguin":
c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlesister");
break;
case "citizen_exile":
c.c_idPortrait = "special_n-exile";
break;
default:
c.c_idPortrait = Portrait.GetRandomPortrait(gender, c.GetIdPortraitCat());
break;
Card
@@ -402,6 +402,18 @@ public int tier
}
}
public int version
{
get
{
return _ints[29];
}
set
{
_ints[29] = value;
}
}
public bool isCensored
{
get
@@ -2592,6 +2604,7 @@ private void _OnSerializing(StreamingContext context)
_ints[0] = _bits1.ToInt();
_ints[2] = _bits2.ToInt();
_placeState = placeState;
version = 1;
OnSerializing();
}
text2 = text.Replace("{", "").Replace("}", "");
}
}
if (c != null)
{
text2 = text2.Replace("#me", c.NameSimple);
}
if (!stripPun || !Lang.setting.stripPuns)
{
return text2;
@@ -6411,21 +6428,25 @@ public void SetRandomTone()
{
MOD.tones.Initialize();
List<Dictionary<string, string>> list = MOD.tones.list;
if (list.Count == 0)
{
return;
}
string text = list.RandomItem()["id"];
for (int i = 0; i < 10; i++)
if (list.Count != 0)
{
Dictionary<string, string> dictionary = list.RandomItem();
if (EClass.rnd(100) <= dictionary["chance"].ToInt())
int mtp = EClass.core.config.test.extraToneMTP switch
{
text = dictionary["id"];
break;
4 => 10,
3 => 5,
2 => 2,
1 => 1,
0 => 0,
_ => 0,
};
if (EClass.debug.enable)
{
mtp *= 100;
}
string text = list.RandomItem()["id"];
text = list.RandomItemWeighted((Dictionary<string, string> a) => a["chance"].ToInt() * ((!a["tag"].Contains("meta")) ? 1 : mtp))["id"];
c_idTone = MOD.tones.GetToneID(text, bio?.gender ?? 0);
}
c_idTone = MOD.tones.GetToneID(text, bio?.gender ?? 0);
}
public bool HasCraftBonusTrait()
Chara
@@ -1670,7 +1670,7 @@ public void RefreshSpeed(Element.BonusInfo info = null)
if (EClass._zone.IsUnderwater)
{
int num2 = Evalue(200);
num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5, 0, 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, 0, 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
if (info != null && num != 100)
{
info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
@@ -6506,7 +6506,7 @@ public void ShowDialog()
questDebt.stage++;
if (questDebt.stage > 7)
{
questDebt.stage = 1;
questDebt.stage = 7;
}
ShowDialog("loytel", "debt" + questDebt.stage);
return;
ContentConfigTest
@@ -9,6 +9,8 @@ public class ContentConfigTest : ContentConfig
public UIButtonLR buttonAnimeFramePCC;
public UIButtonLR buttonExtraToneMTP;
public UIButton toggleAlwaysRun;
public UIButton toggleShowNumber;
@@ -48,6 +50,7 @@ public override void OnInstantiate()
base.config.ApplySkin();
});
List<string> langs = new List<string> { "ani0", "ani1", "ani2", "ani3", "ani4" };
List<string> langs2 = new List<string> { "0x", "1x", "2x", "5x", "10x" };
toggleRefIcon.SetToggle(base.config.test.showRefIcon, delegate(bool on)
{
base.config.test.showRefIcon = on;
@@ -56,6 +59,11 @@ public override void OnInstantiate()
LayerInventory.SetDirtyAll();
}
});
buttonExtraToneMTP.SetOptions(base.config.test.extraToneMTP, langs2, delegate(int i)
{
base.config.test.extraToneMTP = i;
base.config.Apply();
}, invoke: false, "extraToneMTP");
buttonAnimeFrame.SetOptions(base.config.test.animeFrame, langs, delegate(int i)
{
base.config.test.animeFrame = i;
CoreConfig
@@ -524,6 +524,8 @@ public class Test
public int animeFrame;
public int extraToneMTP;
public bool showNumbers;
public bool stackNumbers;
@@ -670,6 +672,10 @@ public static CoreConfig TryLoadConfig()
coreConfig.game.backupInterval = 8;
coreConfig.game.autoBackup = true;
}
if (coreConfig.version.IsBelow(0, 23, 138))
{
coreConfig.test.extraToneMTP = 1;
}
if (coreConfig.version.IsBelow(0, 23, 63))
{
coreConfig.graphic.floorEx = true;
CoreDebug
@@ -1646,6 +1646,16 @@ public void InitDebugCommands()
}
});
});
Add(cat2, "Reset Certain obj materials", delegate
{
EClass._map.ForeachCell(delegate(Cell c)
{
if (c.HasObj && c.obj == 79)
{
c.objMat = (byte)c.sourceObj.DefaultMaterial.id;
}
});
});
Add(cat2, "Fix Floors under Blocks", delegate
{
EClass._map.ForeachCell(delegate(Cell c)
@@ -1927,6 +1937,19 @@ public static string Fix_RemoveDemitas()
return "Not enough Demitas!";
}
[ConsoleCommand("")]
public static string Fix_RemoveDesignations()
{
EClass._map.ForeachCell(delegate(Cell c)
{
if (c.detail != null && c.detail.designation != null)
{
c.detail.designation.taskList.Remove(c.detail.designation);
}
});
return "Done.";
}
[ConsoleCommand("")]
public static string ListChara()
{
GrowSystem
@@ -92,6 +92,8 @@ public int Convert(int tile)
public virtual bool NeedSunlight => true;
public virtual bool NeedUndersea => false;
public virtual AnimeID AnimeProgress => AnimeID.HitObj;
public Stage stage => stages[cell.objVal / 30];
@@ -282,6 +284,10 @@ public bool CanGrow(VirtualDate date)
return false;
}
}
if (NeedUndersea && !EClass._zone.IsUnderwater && !cell.sourceFloor.tileType.IsDeepWater)
{
return false;
}
return true;
}
@@ -320,7 +326,7 @@ public void EqualizePlants(Point pos)
public void Grow(int mtp = 1)
{
bool flag = cell.isWatered || (cell.IsTopWater && source.tag.Contains("flood"));
bool flag = cell.isWatered || (cell.IsTopWater && (source.tag.Contains("flood") || source.tag.Contains("undersea")));
PlantData plantData = EClass._map.TryGetPlant(cell);
if (plantData != null && flag)
{
+GrowSystemSeaweed
File Created
public class GrowSystemSeaweed : GrowSystemWheat
{
public override int HarvestStage => -1;
public override bool NeedUndersea => true;
public override bool NeedSunlight => false;
public override bool GenerateStraw => false;
public override bool CanReapSeed()
{
return base.stage.idx >= 1;
}
public override void OnMineObj(Chara c = null)
{
if (IsWithered() || base.stage.idx == 0)
{
base.OnMineObj(c);
return;
}
int num = 1 + EClass.rnd(base.stage.idx * 2) + ((base.stage.idx >= 2) ? 1 : 0);
PopHarvest(c, "seaweed2", num);
}
}
GrowSystemWheat
@@ -6,6 +6,8 @@ public class GrowSystemWheat : GrowSystemCrop
public override int AutoMineStage => 3;
public virtual bool GenerateStraw => true;
public override string GetSoundProgress()
{
return source.DefaultMaterial.GetSoundImpact();
@@ -22,7 +24,7 @@ public override int GetStageTile()
public override void OnMineObj(Chara c = null)
{
if (IsWithered() || IsHarvestStage(base.stage.idx))
if (GenerateStraw && (IsWithered() || IsHarvestStage(base.stage.idx)))
{
TryPick(GrowSystem.cell, ThingGen.Create("grass", "straw"), c);
}
Map
@@ -1886,7 +1886,7 @@ public void MineObj(Point point, Task task = null, Chara c = null)
}
int num3 = EClass.rnd(EClass.rnd(sourceObj.components.Length) + 1);
string[] array = sourceObj.components[num3].Split('/');
Thing thing = ThingGen.Create(array[0], matObj_fixed.alias);
Thing thing = ThingGen.Create(array[0].Split('|')[0], matObj_fixed.alias);
if (array.Length > 1)
{
thing.SetNum(EClass.rnd(array[1].ToInt()) + 1);
MapGenDungen
using System.Collections.Generic;
using System.Linq;
using Dungen;
using UnityEngine;
@@ -35,8 +36,16 @@ protected override bool OnGenerateTerrain()
}
if (biome.name == "Dungeon_Water")
{
int id = ((EClass.rnd(2) == 0) ? 187 : 188);
biome.exterior.block.id = (biome.interior.block.id = id);
int num = ((EClass.rnd(3) == 0) ? 187 : ((EClass.rnd(2) == 0) ? 188 : 189));
biome.exterior.block.id = (biome.interior.block.id = num);
if (num == 189)
{
biome.exterior.block.mat = (biome.interior.block.mat = (byte)EClass.sources.materials.rows.Where((SourceMaterial.Row r) => r.tag.Contains("coral")).RandomItem().id);
}
else
{
biome.exterior.block.mat = (biome.interior.block.mat = 3);
}
}
BiomeProfile.TileFloor floor = biome.exterior.floor;
BiomeProfile.TileBlock block = biome.exterior.block;
@@ -161,15 +170,15 @@ protected override bool OnGenerateTerrain()
}
Dictionary<int, GenRoom> rooms = new Dictionary<int, GenRoom>();
int count = 0;
int num = 0;
int num2 = 0;
foreach (Dungen.Room room in mapData.rooms)
{
if (room.width != 0 && room.height != 0)
{
num++;
num2++;
}
}
if (num == 0)
if (num2 == 0)
{
mapData.rooms.Clear();
}
@@ -196,13 +205,13 @@ protected override bool OnGenerateTerrain()
zone.OnGenerateRooms(this);
map.ReloadRoom();
Debug.Log("Dungen: room:" + rooms.Count + "/" + mapData.rooms.Count + " width:" + width + " height:" + height);
int num2 = EClass.rnd(Size * Size / 50 + EClass.rnd(20)) + 5;
num2 = num2 * Mathf.Min(20 + zone.DangerLv * 5, 100) / 100;
int num3 = EClass.rnd(Size * Size / 50 + EClass.rnd(20)) + 5;
num3 = num3 * Mathf.Min(20 + zone.DangerLv * 5, 100) / 100;
if (zone is Zone_RandomDungeonNature)
{
num2 /= 5;
num3 /= 5;
}
for (int k = 0; k < num2; k++)
for (int k = 0; k < num3; k++)
{
point = EClass._map.GetRandomPoint();
if (!point.cell.isModified && !point.HasThing && !point.HasBlock && !point.HasObj)
@@ -217,25 +226,37 @@ protected override bool OnGenerateTerrain()
{
zone.SpawnMob(null, SpawnSetting.Fish());
}
}
if (zone is Zone_RandomDungeonPlain)
{
Crawler crawler = Crawler.Create("pasture");
int tries = 3;
crawler.CrawlUntil(EClass._map, () => EClass._map.GetRandomPoint(), tries, delegate(Crawler.Result r)
Crawler.Create("pasture").CrawlUntil(tries: EClass.rnd(EClass.rnd(EClass.rnd(EClass.rnd(5) + 1) + 1) + 1), map: EClass._map, onStart: () => EClass._map.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
{
int id2 = ((EClass.rnd(3) == 0) ? 108 : 105);
int id2 = 137;
foreach (Point point2 in r.points)
{
if (!point2.cell.isModified && !point2.HasThing && !point2.HasBlock && !point2.HasObj)
{
map.SetObj(point2.x, point2.z, id2);
int num3 = 3;
int idx = 3 + ((EClass.rnd(3) == 0) ? 1 : 0) + ((EClass.rnd(3) == 0) ? (-1) : 0) + ((EClass.rnd(3) == 0) ? (-1) : 0);
point2.growth.SetStage(idx);
}
}
return false;
});
}
if (zone is Zone_RandomDungeonPlain)
{
Crawler.Create("pasture").CrawlUntil(tries: EClass.rnd(EClass.rnd(3) + 1), map: EClass._map, onStart: () => EClass._map.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
{
int id = ((EClass.rnd(3) == 0) ? 108 : 105);
foreach (Point point3 in r.points)
{
if (!point3.cell.isModified && !point3.HasThing && !point3.HasBlock && !point3.HasObj)
{
map.SetObj(point3.x, point3.z, id);
int num4 = 3;
if (EClass.rnd(6) == 0)
{
num3++;
num4++;
}
point2.growth.SetStage(num3);
point3.growth.SetStage(num4);
}
}
return false;
Player
Msg.Say("voidClosed");
return;
}
if (zone is Zone_Exile && EClass.player.CountKeyItem("key_exile") == 0)
if (zone is Zone_Exile && EClass.player.CountKeyItem("key_exile") == 0 && !EClass.debug.enable)
{
Msg.Say("exileClosed");
return;
QuestDebt
using System;
using Newtonsoft.Json;
public class QuestDebt : QuestProgression
@@ -36,7 +37,7 @@ public override bool CanUpdateOnTalk(Chara c)
public override string GetTextProgress()
{
return "progressDebt".lang(Lang._currency(EClass.player.debt, showUnit: true));
return "progressDebt".lang(Lang._currency(EClass.player.debt, showUnit: true)) + ((!EClass.debug.showExtra) ? "" : (Environment.NewLine + phase + "/" + gaveBill + "/" + paid + "/" + stage));
}
public bool CanGiveBill()
Religion
@@ -423,6 +423,16 @@ public void JoinFaith(Chara c, ConvertType type = ConvertType.Default)
if (c.IsPC)
{
EClass.pc.faction.charaElements.OnJoinFaith();
if (EClass._zone is Zone_Mifu)
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
EClass.screen.RefreshWeather();
}
if (EClass._zone is Zone_Nefu)
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
EClass.screen.RefreshWeather();
}
}
}
Trait
@@ -1714,6 +1714,11 @@ public void OnBarter()
Add("1237", 1, -1);
Add("1239", 1, -1);
Add("candle9", 1, -1);
Add("candle9", 1, -1);
Add("candle9", 1, -1);
Add("candle8", 1, 0);
Add("candle8b", 1, 0);
Add("candle8c", 1, 0);
}
}
break;
TraitFloorSwitch
@@ -2,7 +2,7 @@ public class TraitFloorSwitch : TraitSwitch
{
public override void OnStepped(Chara c)
{
if (!IsNegativeEffect || !EClass._zone.IsPCFaction || c.IsHostile())
if (!IsNegativeEffect || (!EClass._zone.IsPCFaction && !EClass._zone.IsUserZone) || c.IsHostile())
{
owner.SetHidden(hide: false);
if (IgnoreWhenLevitating() && c.IsLevitating)
TraitPowerStatue
public class TraitPowerStatue : TraitItem
{
public override bool CanBeDestroyed
{
get
{
if (!owner.isNPCProperty)
{
return base.CanBeDestroyed;
}
return false;
}
}
public override bool CanBeStolen => false;
public override bool CanUseFromInventory => false;
public override bool UseExtra => owner.isOn;
@@ -47,8 +61,8 @@ public override bool OnUse(Chara c)
if (flag)
{
owner.ChangeMaterial("onyx");
owner.rarity = Rarity.Normal;
}
owner.rarity = Rarity.Normal;
owner.renderer.RefreshExtra();
return true;
}
TraitSeed
@@ -46,6 +46,10 @@ public override void WriteNote(UINote n, bool identified)
{
n.AddText("isWaterCrop");
}
if (row.tag.Contains("undersea"))
{
n.AddText("isUnderseaCrop");
}
if (row.growth != null && row.growth.NeedSunlight)
{
n.AddText("isNeedSun");
TraitTicketFurniture
@@ -24,7 +24,7 @@ public override void TrySetHeldAct(ActPlan p)
}
p.pos.Things.ForEach(delegate(Thing t)
{
if (t.IsInstalled && t.isNPCProperty && t.trait.CanBeHeld && !t.trait.IsDoor && !t.isMasked && t.source.value != 0 && (EClass._zone is Zone_LittleGarden || !(t.trait is TraitNewZone)))
if (t.IsInstalled && t.isNPCProperty && t.trait.CanBeHeld && t.trait.CanBeStolen && !t.trait.IsDoor && !t.isMasked && t.source.value != 0 && (EClass._zone is Zone_LittleGarden || !(t.trait is TraitNewZone)))
{
int price = GetPrice(t) * t.Num;
p.TrySetAct("actCollectFurniture".lang(price.ToString() ?? "", t.Name) + ((t.category.ticket >= 10) ? "ticketNotIntended".lang() : ""), delegate
Zone
@@ -721,15 +721,22 @@ public void Activate()
}
map.things.ForeachReverse(delegate(Thing t)
{
if (t.trait is TraitNewZone)
if (t.trait is TraitNewZone || t.trait is TraitPowerStatue)
{
foreach (Thing thing in orgMap.things)
{
if (t.id == thing.id && t.pos.Equals(thing.pos))
{
RemoveCard(t);
map.things.Insert(0, thing);
thing.stackOrder = 0;
if (t.trait is TraitNewZone)
{
RemoveCard(t);
map.things.Insert(0, thing);
thing.stackOrder = 0;
}
else
{
t.ChangeMaterial(thing.material);
}
break;
}
}
Zone_Exile
public class Zone_Exile : Zone_SubTown
{
public override bool CanSpawnAdv => false;
public override void OnActivate()
{
if (EClass.game.quests.GetPhase<QuestNegotiationDarkness>() == 0)
Zone_Mifu
public class Zone_Mifu : Zone_SubTown
{
public override void OnActivate()
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
base.OnActivate();
}
}
Zone_Nefu
public class Zone_Nefu : Zone_SubTown
{
public override void OnActivate()
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
base.OnActivate();
}
}
Zone_Specwing
public class Zone_Specwing : Zone_SubTown
{
public override bool CanSpawnAdv => true;
}