EA 23.141 Nightly
May 18, 2025
19 files modified.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
CardRenderer (1)
public SourcePref GetPref()
RenderRow (1)
public void SetImage(Image image, Sprite sprite = null, int matCol = 0, bool setNativeSize = true, int dir = 0, int idSkin = 0)
public void SetImage(Image image, Sprite sprite = null, int matCol = 0, bool setNativeSize = true, int dir = 0, int idSkin = 0, Card card = null)
ThingGen (1)
public static Thing Create(string id, string idMat)
public static Thing Create(string id, string idMat, int lv = -1)
BaseTileMap
@@ -3217,8 +3217,9 @@ public Vector3 GetThingPosition(Card tg, Point p)
{
zero.z -= 1f;
}
zero.x += tg.Pref.x * (float)((!tg.flipX) ? 1 : (-1));
zero.z += tg.Pref.z;
SourcePref pref = tg.Pref;
zero.x += pref.x * (float)((!tg.flipX) ? 1 : (-1));
zero.z += pref.z;
detail = cell.detail;
if (tg.isChara)
{
@@ -3248,16 +3249,16 @@ public Vector3 GetThingPosition(Card tg, Point p)
for (int i = 0; i < detail.things.Count; i++)
{
Thing thing = detail.things[i];
SourcePref pref = thing.Pref;
SourcePref pref2 = thing.Pref;
TileType tileType = thing.trait.tileType;
float num4 = (tileType.UseMountHeight ? 0f : ((pref.height == 0f) ? 0.1f : pref.height));
float num4 = (tileType.UseMountHeight ? 0f : ((pref2.height == 0f) ? 0.1f : pref2.height));
if (!thing.IsInstalled || thing == ActionMode.Inspect.target)
{
continue;
}
if (thing.TileType.IsRamp)
{
Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir, pref);
Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir, pref2);
zero.x += rampFix2.x;
zero.y += rampFix2.y;
zero.z += rampFix2.z;
@@ -3269,8 +3270,8 @@ public Vector3 GetThingPosition(Card tg, Point p)
zero.y -= num3;
}
zero.y += num4;
zero.x += pref.stackX * (float)((!thing.flipX) ? 1 : (-1));
zero.z += pref.z + thing.renderer.data.stackZ;
zero.x += pref2.stackX * (float)((!thing.flipX) ? 1 : (-1));
zero.z += pref2.z + thing.renderer.data.stackZ;
if (!tileType.UseMountHeight && thing.altitude != 0)
{
zero += altitudeFix * thing.altitude;
Card
@@ -5489,6 +5489,19 @@ public bool HasGlobalElement(int ele)
return elements.GetElement(ele)?.IsGlobalElement ?? false;
}
public bool HasElementNoCopy()
{
if (HasElement(759))
{
return true;
}
if (HasElement(703))
{
return true;
}
return false;
}
public virtual CardRenderer _CreateRenderer()
{
renderer = new CardRenderer();
@@ -5617,7 +5630,7 @@ public virtual Sprite GetImageSprite()
public void SetImage(Image image, int dir, int idSkin = 0)
{
sourceRenderCard.SetImage(image, GetSprite(dir), colorInt, setNativeSize: true, dir, idSkin);
sourceRenderCard.SetImage(image, GetSprite(dir), colorInt, setNativeSize: true, dir, idSkin, this);
}
public virtual void SetImage(Image image)
@@ -5628,7 +5641,7 @@ public virtual void SetImage(Image image)
}
else
{
sourceRenderCard.SetImage(image, GetSprite(), colorInt);
sourceRenderCard.SetImage(image, GetSprite(), colorInt, setNativeSize: true, 0, 0, this);
}
}
CardRenderer
@@ -371,38 +371,6 @@ public virtual void DrawHeld()
{
}
public SourcePref GetPref()
{
if (isChara)
{
if (owner.IsPCC || (owner.HasHost && owner.Chara.host.ride == owner))
{
return EClass.core.refs.prefs.pcc;
}
if (owner.idSkin > 0)
{
switch (owner.sourceCard.tiles.TryGet(owner.idSkin))
{
case 2319:
case 2619:
case 2621:
case 2623:
case 2625:
return EClass.core.refs.prefs.sonwputit1;
case 2320:
case 2611:
case 2620:
case 2622:
case 2624:
case 2626:
case 2828:
return EClass.core.refs.prefs.snowputit2;
}
}
}
return owner.Pref;
}
public void RefreshSprite()
{
if (hasActor)
@@ -753,4 +721,13 @@ public virtual void SetFirst(bool first)
public virtual void Refresh()
{
}
public SourcePref GetPref()
{
if (owner.IsPCC || (owner.HasHost && owner.Chara.host.ride == owner))
{
return EClass.core.refs.prefs.pcc;
}
return owner.Pref;
}
}
Chara
@@ -777,6 +777,38 @@ int WeaknessMod(int a)
}
}
public override SourcePref Pref
{
get
{
if (spriteReplacer != null)
{
return EClass.core.refs.prefs.replacer1;
}
if (base.idSkin > 0)
{
switch (sourceCard.tiles.TryGet(base.idSkin))
{
case 2319:
case 2619:
case 2621:
case 2623:
case 2625:
return EClass.core.refs.prefs.sonwputit1;
case 2320:
case 2611:
case 2620:
case 2622:
case 2624:
case 2626:
case 2828:
return EClass.core.refs.prefs.snowputit2;
}
}
return sourceCard.pref;
}
}
public bool CanOpenDoor
{
get
CoreRef
@@ -322,6 +322,8 @@ public class PrefData
public SourcePref snowputit2;
public SourcePref pcc;
public SourcePref replacer1;
}
public Biomes biomes;
GameLang
@@ -90,7 +90,7 @@ public static string ConvertDrama(string text, Chara c = null)
stringBuilder.Replace("#zone", EClass._zone.Name);
stringBuilder.Replace("#guild_title", Guild.Current.relation.TextTitle);
stringBuilder.Replace("#guild", Guild.Current.Name);
stringBuilder.Replace("#race", EClass.pc.race.GetName().AddArticle());
stringBuilder.Replace("#race", EClass.pc.race.GetName());
stringBuilder.Replace("#pc", EClass.pc.NameSimple);
stringBuilder.Replace("#aka", EClass.pc.Aka);
stringBuilder.Replace("#bigdaddy", "bigdaddy".lang());
LayerEditSkin
@@ -22,6 +22,10 @@ public void RefreshImage()
{
imageSkin.sprite = chara.GetSprite();
imageSkin.SetNativeSize();
if ((bool)WidgetRoster.Instance)
{
WidgetRoster.Instance.Build();
}
}
public void OnClickClear()
Map
@@ -1856,8 +1856,19 @@ public void MineObj(Point point, Task task = null, Chara c = null)
}
else if (!EClass._zone.IsUserZone)
{
Thing t2 = TraitSeed.MakeSeed(sourceObj, TryGetPlant(cell)).SetNum(num2);
EClass.pc.PickOrDrop(point, t2);
Thing thing = TraitSeed.MakeSeed(sourceObj, TryGetPlant(cell)).SetNum(num2);
if (EClass._zone is Zone_Dungeon)
{
int num3 = Mathf.Min(EClass._zone.DangerLv, EClass.pc.Evalue(286) * 2 / 3);
if (num3 > 0)
{
Rand.SetSeed(EClass._zone.uid * 10 + num3);
TraitSeed.LevelSeed(thing, (thing.trait as TraitSeed).row, num3);
Rand.SetSeed();
thing.elements.SetBase(2, EClass.curve(thing.encLV, 50, 10, 80));
}
}
EClass.pc.PickOrDrop(point, thing);
}
if (cell.growth.IsTree)
{
@@ -1884,14 +1895,14 @@ public void MineObj(Point point, Task task = null, Chara c = null)
}
break;
}
int num3 = EClass.rnd(EClass.rnd(sourceObj.components.Length) + 1);
string[] array = sourceObj.components[num3].Split('/');
Thing thing = ThingGen.Create(array[0].Split('|')[0], matObj_fixed.alias);
int num4 = EClass.rnd(EClass.rnd(sourceObj.components.Length) + 1);
string[] array = sourceObj.components[num4].Split('/');
Thing thing2 = ThingGen.Create(array[0].Split('|')[0], matObj_fixed.alias);
if (array.Length > 1)
{
thing.SetNum(EClass.rnd(array[1].ToInt()) + 1);
thing2.SetNum(EClass.rnd(array[1].ToInt()) + 1);
}
Pop(thing);
Pop(thing2);
}
}
SetObj(point.x, point.z);
Religion
@@ -420,9 +420,13 @@ public void JoinFaith(Chara c, ConvertType type = ConvertType.Default)
{
c.elements.Learn(306);
}
if (c.IsPC)
if (!c.IsPC)
{
return;
}
EClass.pc.faction.charaElements.OnJoinFaith();
if (EClass._zone.lv == 0)
{
EClass.pc.faction.charaElements.OnJoinFaith();
if (EClass._zone is Zone_Mifu)
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
@@ -433,6 +437,11 @@ public void JoinFaith(Chara c, ConvertType type = ConvertType.Default)
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
EClass.screen.RefreshWeather();
}
if (EClass._zone is Zone_Aquli)
{
EClass._map.config.fixedCondition = ((EClass.pc.faith == EClass.game.religions.Strife) ? Weather.Condition.Ether : Weather.Condition.None);
EClass.screen.RefreshWeather();
}
}
}
RenderRow
@@ -348,7 +348,7 @@ public virtual SourcePref GetPref()
return pref;
}
public void SetImage(Image image, Sprite sprite = null, int matCol = 0, bool setNativeSize = true, int dir = 0, int idSkin = 0)
public void SetImage(Image image, Sprite sprite = null, int matCol = 0, bool setNativeSize = true, int dir = 0, int idSkin = 0, Card card = null)
{
image.sprite = sprite ?? GetSprite(dir, idSkin);
int num = ((matCol == 0) ? 104025 : matCol);
@@ -357,7 +357,9 @@ public void SetImage(Image image, Sprite sprite = null, int matCol = 0, bool set
color.a = 1f;
image.color = color;
RectTransform rectTransform = image.Rect();
SourcePref sourcePref = GetPref();
bool num3 = card != null && card.isChara && card.Chara.spriteReplacer != null && !card.HasHost;
SourcePref sourcePref = ((card != null) ? card.Pref : GetPref());
RenderData renderData = (num3 ? card.renderer.data : this.renderData);
rectTransform.pivot = renderData.imagePivot - new Vector2(0.01f * (float)sourcePref.pivotX, 0.01f * (float)sourcePref.pivotY);
float x = Mathf.Abs(image.transform.localScale.x) * (float)((_tiles == null || _tiles.Length == 0 || _tiles[dir % _tiles.Length] >= 0) ? 1 : (-1));
float y = image.transform.localScale.y;
SourceAsset
@@ -13,6 +13,8 @@ public class Prefs
public int version;
public PrefData things = new PrefData();
public PrefData charas = new PrefData();
}
public string idLoad = "prefs";
@@ -36,6 +38,7 @@ public static void _SavePrefs(string id = "prefs")
Prefs prefs = new Prefs();
prefs.version = 2;
Debug.Log(EClass.sources.things.rows.Count);
Debug.Log(EClass.sources.charas.rows.Count);
foreach (SourceThing.Row row in EClass.sources.things.rows)
{
if (prefs.things.dict.ContainsKey(row.id))
@@ -47,6 +50,17 @@ public static void _SavePrefs(string id = "prefs")
prefs.things.dict.Add(row.id, row.pref);
}
}
foreach (SourceChara.Row row2 in EClass.sources.charas.rows)
{
if (prefs.charas.dict.ContainsKey(row2.id))
{
Debug.LogError("exception: duplicate id:" + row2.id + "/" + row2.name);
}
else
{
prefs.charas.dict.Add(row2.id, row2.pref);
}
}
IO.SaveFile(PrefPath + id, prefs);
Debug.Log("Exported Prefs:" + id);
}
@@ -65,6 +79,7 @@ public static void _LoadPrefs(string id = "prefs")
{
IO.CopyAs(PrefPath + id, PrefPath + id + "_loadbk");
Prefs prefs = IO.LoadFile<Prefs>(PrefPath + id);
Debug.Log(prefs);
foreach (SourceThing.Row row in EClass.sources.things.rows)
{
if (prefs.things.dict.ContainsKey(row.id))
@@ -76,6 +91,13 @@ public static void _LoadPrefs(string id = "prefs")
row.pref.y = 0f;
}
}
foreach (SourceChara.Row row2 in EClass.sources.charas.rows)
{
if (prefs.charas.dict.ContainsKey(row2.id))
{
row2.pref = prefs.charas.dict[row2.id];
}
}
Debug.Log("Imported Prefs:" + id);
}
}
ThingGen
@@ -55,9 +55,9 @@ public static Thing Create(string id, int idMat = -1, int lv = -1)
return _Create(id, idMat, lv);
}
public static Thing Create(string id, string idMat)
public static Thing Create(string id, string idMat, int lv = -1)
{
return Create(id, idMat.IsEmpty() ? (-1) : EClass.sources.materials.alias[idMat].id);
return Create(id, idMat.IsEmpty() ? (-1) : EClass.sources.materials.alias[idMat].id, lv);
}
public static Thing CreateFromFilter(string id, int lv = -1)
TraitCrafter
@@ -17,7 +17,8 @@ public enum MixType
Incubator,
Fortune,
RuneMold,
FixedResource
FixedResource,
SeedWork
}
public enum AnimeType
@@ -109,6 +110,10 @@ public bool IsIngredient(int idx, SourceRecipe.Row r, Card c)
{
return false;
}
if (r.tag.Contains("debug") && !EClass.debug.enable)
{
return false;
}
string[] array = ((idx == 0) ? r.ing1 : r.ing2);
if (r.type.ToEnum<MixType>() == MixType.Grind && idx == 1)
{
@@ -320,10 +325,10 @@ public virtual Thing Craft(AI_UseCrafter ai)
case MixType.Sculpture:
{
t = ThingGen.Create(thing3);
List<CardRow> list2 = EClass.player.codex.ListKills();
list2.Add(EClass.sources.cards.map["putty"]);
list2.Add(EClass.sources.cards.map["snail"]);
CardRow cardRow = list2.RandomItemWeighted((CardRow a) => Mathf.Max(50 - a.LV, Mathf.Clamp(EClass.pc.Evalue(258) / 2, 1, a.LV * 2)));
List<CardRow> list = EClass.player.codex.ListKills();
list.Add(EClass.sources.cards.map["putty"]);
list.Add(EClass.sources.cards.map["snail"]);
CardRow cardRow = list.RandomItemWeighted((CardRow a) => Mathf.Max(50 - a.LV, Mathf.Clamp(EClass.pc.Evalue(258) / 2, 1, a.LV * 2)));
t.c_idRefCard = cardRow.id;
t.ChangeMaterial(thing.material);
t.SetEncLv(Mathf.Min(EClass.rnd(EClass.rnd(Mathf.Max(5 + EClass.pc.Evalue(258) - cardRow.LV, 1))), 12));
@@ -335,13 +340,13 @@ public virtual Thing Craft(AI_UseCrafter ai)
Thing eq = ai.ings[0];
Thing thing7 = eq.Duplicate(1);
thing7.SetEncLv(0);
List<Element> list = thing7.elements.ListRune();
if (list.Count == 0)
List<Element> list2 = thing7.elements.ListRune();
if (list2.Count == 0)
{
Msg.SayNothingHappen();
break;
}
foreach (Element item in list)
foreach (Element item in list2)
{
SocketData runeEnc = eq.GetRuneEnc(item.id);
item.vLink = 0;
@@ -360,7 +365,7 @@ public virtual Thing Craft(AI_UseCrafter ai)
Msg.Say("rune_tooHard", owner);
break;
}
EClass.ui.AddLayer<LayerList>().SetList2(list, (Element a) => a.Name, delegate(Element a, ItemGeneral b)
EClass.ui.AddLayer<LayerList>().SetList2(list2, (Element a) => a.Name, delegate(Element a, ItemGeneral b)
{
owner.ModNum(-1);
eq.Destroy();
@@ -387,20 +392,41 @@ public virtual Thing Craft(AI_UseCrafter ai)
.SetTitles("wRuneMold");
break;
}
case MixType.SeedWork:
{
TraitSeed traitSeed = thing.trait as TraitSeed;
string id = thing2.id;
if (id == "mercury" || id == "blood_angel")
{
int num7 = thing.encLV;
if (thing2.id == "mercury")
{
num7 = num7 * 2 / 3;
}
t = TraitSeed.MakeSeed(traitSeed.row);
TraitSeed.LevelSeed(t, traitSeed.row, num7);
t.elements.SetBase(2, EClass.curve(t.encLV, 50, 10, 80));
}
else
{
t = TraitSeed.MakeSeed(traitSeed.row);
}
break;
}
case MixType.Talisman:
{
int num4 = EClass.pc.Evalue(1418);
Thing thing5 = ai.ings[1];
SourceElement.Row source2 = (thing5.trait as TraitSpellbook).source;
int num5 = thing5.c_charges * source2.charge * (100 + num4 * 50) / 500 + 1;
int num6 = 100;
Thing thing6 = ThingGen.Create("talisman").SetNum(num5);
thing6.refVal = source2.id;
thing6.encLV = num6 * (100 + num4 * 10) / 100;
thing.ammoData = thing6;
thing.c_ammo = num5;
EClass.pc.Say("talisman", thing, thing6);
thing5.Destroy();
int num2 = EClass.pc.Evalue(1418);
Thing thing4 = ai.ings[1];
SourceElement.Row source2 = (thing4.trait as TraitSpellbook).source;
int num3 = thing4.c_charges * source2.charge * (100 + num2 * 50) / 500 + 1;
int num4 = 100;
Thing thing5 = ThingGen.Create("talisman").SetNum(num3);
thing5.refVal = source2.id;
thing5.encLV = num4 * (100 + num2 * 10) / 100;
thing.ammoData = thing5;
thing.c_ammo = num3;
EClass.pc.Say("talisman", thing, thing5);
thing4.Destroy();
break;
}
case MixType.Scratch:
@@ -415,28 +441,28 @@ public virtual Thing Craft(AI_UseCrafter ai)
case MixType.Fortune:
{
EClass.player.seedFortune++;
int num2 = 0;
int num5 = 0;
FortuneRollData orCreateFortuneRollData = EClass._zone.GetOrCreateFortuneRollData(refresh: false);
int seed = orCreateFortuneRollData.seed + orCreateFortuneRollData.count + EClass.player.seedFortune;
Rand.SetSeed(seed);
for (int num3 = 3; num3 > 0; num3--)
for (int num6 = 3; num6 > 0; num6--)
{
if (EClass.rnd(FortuneRollData.chances[num3]) == 0)
if (EClass.rnd(FortuneRollData.chances[num6]) == 0)
{
num2 = num3;
num5 = num6;
break;
}
}
Rand.SetSeed();
if (num2 != 0)
if (num5 != 0)
{
owner.PlaySound((num2 == 3) ? "fortuneroll_winBig" : "fortuneroll_win");
owner.PlaySound((num5 == 3) ? "fortuneroll_winBig" : "fortuneroll_win");
}
Thing thing4 = ThingGen.Create("fortune_ball");
thing4.ChangeMaterial(FortuneRollData.mats[num2]);
EClass._zone.AddCard(thing4, owner.pos);
Thing thing6 = ThingGen.Create("fortune_ball");
thing6.ChangeMaterial(FortuneRollData.mats[num5]);
EClass._zone.AddCard(thing6, owner.pos);
owner.PlaySound("fortuneroll_ball");
orCreateFortuneRollData.GetPrize(num2, seed);
orCreateFortuneRollData.GetPrize(num5, seed);
if ((bool)LayerDragGrid.Instance)
{
LayerDragGrid.Instance.info.Refresh();
TraitDemitas
@@ -52,7 +52,7 @@ public override ShopType ShopType
public override bool CanCopy(Thing t)
{
if (t.HasElement(759))
if (t.HasElementNoCopy())
{
return false;
}
TraitKettle
@@ -60,7 +60,7 @@ public override bool CanCopy(Thing t)
{
return false;
}
if (t.HasElement(759))
if (t.HasElementNoCopy())
{
return false;
}
Zone
@@ -736,6 +736,7 @@ public void Activate()
else
{
t.ChangeMaterial(thing.material);
t.isOn = thing.isOn;
}
break;
}
@@ -1178,7 +1179,8 @@ public void Simulate()
}
}
}
if (HourSinceLastActive <= 1)
Debug.Log("Last Active:" + base.lastActive);
if (base.lastActive == 0 || HourSinceLastActive <= 1 || IsRegion)
{
return;
}
@@ -2300,9 +2302,9 @@ public void Generate()
for (int i = 0; i < num; i++)
{
Point randomSurface = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
if (!randomSurface.HasObj)
if (!randomSurface.HasObj && !randomSurface.HasThing)
{
Thing t = ThingGen.Create("pearl_oyster", new string[3] { "wood_birch", "poplar", "coralwood" }.RandomItem());
Thing t = ThingGen.Create("pearl_oyster", new string[3] { "wood_birch", "poplar", "coralwood" }.RandomItem(), ContentLv);
EClass._zone.AddCard(t, randomSurface).Install();
}
}
@@ -2310,9 +2312,9 @@ public void Generate()
for (int j = 0; j < num; j++)
{
Point randomSurface2 = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
if (!randomSurface2.HasObj && (IsUnderwater || randomSurface2.cell.IsTopWaterAndNoSnow || EClass.rnd(6) == 0))
if (!randomSurface2.HasObj && !randomSurface2.HasThing && (IsUnderwater || randomSurface2.cell.IsTopWaterAndNoSnow || EClass.rnd(6) == 0))
{
EClass._zone.AddCard(ThingGen.Create("70"), randomSurface2);
EClass._zone.AddCard(ThingGen.Create("70", -1, ContentLv), randomSurface2);
}
}
}
@@ -2324,7 +2326,7 @@ public void Generate()
for (int k = 0; k < num2; k++)
{
Point randomSurface3 = EClass._map.bounds.GetRandomSurface();
if (!randomSurface3.HasObj)
if (!randomSurface3.HasObj && !randomSurface3.HasThing)
{
Card t2 = ThingGen.Create("chest3").ChangeMaterial(biome.style.matDoor);
EClass._zone.AddCard(t2, randomSurface3).Install();
Zone_Aquli
public class Zone_Aquli : Zone_Town
{
public override void OnActivate()
{
if (base.lv == 0)
{
EClass._map.config.fixedCondition = ((EClass.pc.faith == EClass.game.religions.Strife) ? Weather.Condition.Ether : Weather.Condition.None);
}
base.OnActivate();
}
}
Zone_Mifu
@@ -2,7 +2,10 @@ public class Zone_Mifu : Zone_SubTown
{
public override void OnActivate()
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
if (base.lv == 0)
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.Trickery;
}
base.OnActivate();
}
}
Zone_Nefu
@@ -2,7 +2,10 @@ public class Zone_Nefu : Zone_SubTown
{
public override void OnActivate()
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
if (base.lv == 0)
{
EClass._map.config.blossom = EClass.pc.faith == EClass.game.religions.MoonShadow;
}
base.OnActivate();
}
}