EA 23.55 Hotfix 2
December 13, 2024
25 files modified. 1 new file created.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
CoreDebug (1)
public static string Spawn(string id, int num = 1, string aliasMat = "")
public static string Spawn(string id, int num = 1, string aliasMat = "", int objLv = -1)
Player (1)
public List<Point> lastMarkedHighlights = new List<Point>();
ACT
@@ -246,7 +246,7 @@ public virtual bool Perform()
int num = id;
if ((num == 8230 || num == 8232) && TC.isThing)
{
int power = CC.elements.GetOrCreateElement(base.source.id).GetPower(CC) * powerMod / 100;
int power = CC.elements.GetOrCreateElement(base.source.id).GetPower(CC);
ActEffect.Proc(base.source.proc[0].ToEnum<EffectId>(), power, BlessedState.Normal, CC, TC);
return true;
}
@@ -267,7 +267,7 @@ public virtual bool Perform()
TC = CC;
TP.Set(CC.pos);
}
int power2 = CC.elements.GetOrCreateElement(base.source.id).GetPower(CC) * powerMod / 100;
int power2 = CC.elements.GetOrCreateElement(base.source.id).GetPower(CC);
ActEffect.ProcAt(base.source.proc[0].ToEnum<EffectId>(), power2, BlessedState.Normal, CC, TC, TP, base.source.tag.Contains("neg"), new ActRef
{
n1 = base.source.proc.TryGet(1, returnNull: true),
@@ -450,8 +450,7 @@ public virtual void OnMarkMapHighlights()
{
if (!p.HasBlock && ShouldMapHighlight(p))
{
p.cell.highlight = 8;
EClass.player.lastMarkedHighlights.Add(p.Copy());
p.SetHighlight(8);
}
});
}
AI_Idle
@@ -47,6 +47,17 @@ public override IEnumerable<Status> Run()
}
yield return KeepRunning();
}
if (owner.pos.cell.HasFire)
{
if (EClass.rnd(5) == 0)
{
owner.Talk("onFire");
}
if (owner.MoveNeighborDefinitely())
{
yield return Restart();
}
}
if (EClass.rnd(owner.IsPCParty ? 10 : 100) == 0 && owner.hunger.GetPhase() >= 3)
{
Thing thing = owner.things.Find((Thing a) => owner.CanEat(a, owner.IsPCFaction) && !a.c_isImportant, recursive: false);
AI_PlayMusic
@@ -505,19 +505,16 @@ public void ThrowReward(Chara c, bool punish)
if (!owner.IsPC && owner.things.IsFull())
{
thing.Destroy();
return;
}
else
{
owner.Pick(thing);
}
owner.Pick(thing);
if (thing.id == "money" && !owner.IsPC)
{
int num2 = (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType == FactionMemberType.Default) ? 1 : 10);
int num3 = owner.GetCurrency() - num2;
if (num3 > 0)
if (owner.GetCurrency() - num2 > 0)
{
owner.c_allowance += num3;
owner.ModCurrency(-num3);
owner.c_allowance += num;
owner.ModCurrency(-num);
}
}
}
ActBolt
using System.Collections.Generic;
public class ActBolt : Spell
{
public override bool CanAutofire => true;
@@ -7,4 +9,23 @@ public class ActBolt : Spell
public override bool CanRapidFire => true;
public override float RapidDelay => 0.25f;
public override bool ShowMapHighlight => true;
public override void OnMarkMapHighlights()
{
if (!EClass.scene.mouseTarget.pos.IsValid)
{
return;
}
List<Point> list = EClass._map.ListPointsInLine(EClass.pc.pos, EClass.scene.mouseTarget.pos, 10);
if (list.Count == 0)
{
list.Add(Act.CC.pos.Copy());
}
foreach (Point item in list)
{
item.SetHighlight(8);
}
}
}
ActEffect
{
num5 += EClass.pc.Evalue(302);
}
if (CC.HasElement(1214))
{
num5 *= 2;
}
if (num5 > 0)
{
if (num5 * 10 > EClass.rnd(num4 + 1))
break;
}
}
if (RapidCount > 0)
{
num4 = num4 * 100 / (100 + RapidCount * 50);
}
num4 = num4 * Act.powerMod / 100;
c.DamageHP(num4, e.id, power * num / 100, AttackSource.None, chara ?? CC);
if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
{
}
Debug.Log(angle);
}
if (RapidCount > 0)
{
power = power * 100 / (100 + RapidCount * 50);
}
switch (id)
{
case EffectId.Earthquake:
ActRush
@@ -15,8 +15,7 @@ public override void OnMarkMapHighlights()
{
if (!p.Equals(EClass.pc.pos))
{
p.cell.highlight = (byte)((blocked || p.IsBlocked || (!p.Equals(dest) && p.HasChara)) ? 4u : ((p.Distance(EClass.pc.pos) <= 2) ? 2u : 8u));
EClass.player.lastMarkedHighlights.Add(p.Copy());
p.SetHighlight((blocked || p.IsBlocked || (!p.Equals(dest) && p.HasChara)) ? 4 : ((p.Distance(EClass.pc.pos) <= 2) ? 2 : 8));
}
});
}
BuildMenu
@@ -96,7 +96,11 @@ public static void Toggle()
EMono.player.hotbars.bars[3].dirty = true;
EMono.player.hotbars.ResetHotbar(4);
EMono.player.hotbars.bars[4].dirty = true;
if (ActionMode.LastBuildMode != null)
if (ActionMode.LastBuildMode == ActionMode.Build)
{
ActionMode.Inspect.Activate();
}
else if (ActionMode.LastBuildMode != null)
{
ActionMode.LastBuildMode.Activate();
}
Chara
@@ -5728,7 +5728,7 @@ public bool IsFriendOrAbove(Chara c)
{
return true;
}
return race == c.race;
return false;
}
public override CardRenderer _CreateRenderer()
CoreDebug
@@ -1868,7 +1868,7 @@ public static string SetElement(string alias, int value, int potential = 100)
}
[ConsoleCommand("")]
public static string Spawn(string id, int num = 1, string aliasMat = "")
public static string Spawn(string id, int num = 1, string aliasMat = "", int objLv = -1)
{
if (!CheatEnabled())
{
@@ -1876,7 +1876,7 @@ public static string Spawn(string id, int num = 1, string aliasMat = "")
}
if (EClass.sources.things.map.ContainsKey(id))
{
Thing thing = ThingGen.Create(id).SetNum(num);
Thing thing = ThingGen.Create(id, -1, objLv).SetNum(num);
if (!aliasMat.IsEmpty())
{
thing.ChangeMaterial(aliasMat);
@@ -1887,6 +1887,10 @@ public static string Spawn(string id, int num = 1, string aliasMat = "")
if (EClass.sources.charas.map.ContainsKey(id))
{
Chara chara = CharaGen.Create(id);
if (objLv != -1)
{
chara.SetLv(objLv);
}
EClass._zone.AddCard(chara, EClass.pc.pos);
return "Spawned " + chara.Name;
}
ELEMENT
@@ -416,7 +416,7 @@ public virtual int GetSourceValue(int v, int lv, SourceValueType type)
{
SourceValueType.Chara => v * (100 + (lv - 1 + EClass.rnd(lv / 2 + 1)) * source.lvFactor / 10) / 100 + EClass.rnd(lv / 3) * source.lvFactor / 100,
SourceValueType.Fixed => v,
_ => v * ((source.encFactor == 0) ? 100 : (50 + EClass.rnd(100) + EClass.rnd((int)Mathf.Sqrt(lv * 100)) * source.encFactor / 100)) / 100,
_ => v * (50 + EClass.rnd(100) + EClass.rnd((int)Mathf.Sqrt(lv * 100)) * source.encFactor / 100) / 100,
};
}
GameIO
@@ -14,7 +14,8 @@ public class GameIO : EClass
DefaultValueHandling = DefaultValueHandling.Ignore,
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
TypeNameHandling = TypeNameHandling.Auto,
Error = IO.OnError
Error = IO.OnError,
SerializationBinder = GameSerializationBinder.Instance
};
public static JsonSerializerSettings jsWriteGame = new JsonSerializerSettings
+GameSerializationBinder
File Created
using System;
using Newtonsoft.Json.Serialization;
using UnityEngine;
public class GameSerializationBinder : DefaultSerializationBinder, ISerializationBinder
{
internal static readonly GameSerializationBinder Instance = new GameSerializationBinder();
public override Type BindToType(string assemblyName, string typeName)
{
try
{
return base.BindToType(assemblyName, typeName);
}
catch (Exception ex)
{
Debug.LogError(ex.Message);
return typeof(object);
}
}
}
HotItemContext
@@ -110,6 +110,10 @@ public static void Show(string id, Vector3 pos)
{
EClass.ui.AddLayer<LayerTextureViewer>();
});
uIContextMenu2.AddButton("OpenCustomFolder", delegate
{
Util.ShowExplorer(CorePath.custom + "Portrait");
});
m.AddSeparator();
m.AddButton("help", delegate
{
ModManager
@@ -108,6 +108,13 @@ public override void Init(string path, string defaultPackage = "_Elona")
AddPackage(directoryInfo, isInPackages: true);
}
}
DirectoryInfo[] directories2 = new DirectoryInfo(CorePath.custom).GetDirectories();
ModPackage package = new ModPackage();
array = directories2;
foreach (DirectoryInfo dir in array)
{
ParseExtra(dir, package);
}
}
private void HandleResults(UgcQuery query)
Player
@@ -903,7 +903,7 @@ public void OnLeaveZone()
public ZoneTransition lastTransition;
public List<Point> lastMarkedHighlights = new List<Point>();
public List<Cell> lastMarkedHighlights = new List<Cell>();
public HotItem lastHotItem;
@@ -2151,9 +2151,9 @@ public bool TryAbortAutoCombat()
public void ClearMapHighlights()
{
foreach (Point lastMarkedHighlight in lastMarkedHighlights)
foreach (Cell lastMarkedHighlight in lastMarkedHighlights)
{
lastMarkedHighlight.cell.highlight = 0;
lastMarkedHighlight.highlight = 0;
}
lastMarkedHighlights.Clear();
}
Point
@@ -1374,4 +1374,10 @@ public Point ToRegionPos()
point.z += EClass.scene.elomap.minY;
return point;
}
public void SetHighlight(int id)
{
cell.highlight = (byte)id;
EClass.player.lastMarkedHighlights.Add(cell);
}
}
SourceElement
@@ -23,17 +23,29 @@ public class Row : BaseRow
public string aliasParent;
public string aliasRef;
public string aliasMtp;
public float parentFactor;
public int lvFactor;
public int encFactor;
public string encSlot;
public int mtp;
public string aliasRef;
public int LV;
public string aliasMtp;
public int chance;
public int value;
public int[] cost;
public int geneSlot;
public int sort;
@@ -59,16 +71,6 @@ public class Row : BaseRow
public int cooldown;
public int LV;
public int chance;
public int value;
public int[] cost;
public int geneSlot;
public int charge;
public float radius;
@@ -79,8 +81,6 @@ public class Row : BaseRow
public string idTrainer;
public string encSlot;
public int partySkill;
public string tagTrainer;
@@ -273,35 +273,35 @@ public override Row CreateRow()
altname_JP = SourceData.GetString(4),
altname = SourceData.GetString(5),
aliasParent = SourceData.GetString(6),
parentFactor = SourceData.GetFloat(7),
lvFactor = SourceData.GetInt(8),
encFactor = SourceData.GetInt(9),
mtp = SourceData.GetInt(10),
aliasRef = SourceData.GetString(11),
aliasMtp = SourceData.GetString(12),
sort = SourceData.GetInt(13),
target = SourceData.GetString(14),
proc = SourceData.GetStringArray(15),
type = SourceData.GetString(16),
group = SourceData.GetString(17),
category = SourceData.GetString(18),
categorySub = SourceData.GetString(19),
abilityType = SourceData.GetStringArray(20),
tag = SourceData.GetStringArray(21),
thing = SourceData.GetString(22),
eleP = SourceData.GetInt(23),
cooldown = SourceData.GetInt(24),
LV = SourceData.GetInt(25),
chance = SourceData.GetInt(26),
value = SourceData.GetInt(27),
cost = SourceData.GetIntArray(28),
geneSlot = SourceData.GetInt(29),
charge = SourceData.GetInt(30),
radius = SourceData.GetFloat(31),
max = SourceData.GetInt(32),
req = SourceData.GetStringArray(33),
idTrainer = SourceData.GetString(34),
encSlot = SourceData.GetString(35),
aliasRef = SourceData.GetString(7),
aliasMtp = SourceData.GetString(8),
parentFactor = SourceData.GetFloat(9),
lvFactor = SourceData.GetInt(10),
encFactor = SourceData.GetInt(11),
encSlot = SourceData.GetString(12),
mtp = SourceData.GetInt(13),
LV = SourceData.GetInt(14),
chance = SourceData.GetInt(15),
value = SourceData.GetInt(16),
cost = SourceData.GetIntArray(17),
geneSlot = SourceData.GetInt(18),
sort = SourceData.GetInt(19),
target = SourceData.GetString(20),
proc = SourceData.GetStringArray(21),
type = SourceData.GetString(22),
group = SourceData.GetString(23),
category = SourceData.GetString(24),
categorySub = SourceData.GetString(25),
abilityType = SourceData.GetStringArray(26),
tag = SourceData.GetStringArray(27),
thing = SourceData.GetString(28),
eleP = SourceData.GetInt(29),
cooldown = SourceData.GetInt(30),
charge = SourceData.GetInt(31),
radius = SourceData.GetFloat(32),
max = SourceData.GetInt(33),
req = SourceData.GetStringArray(34),
idTrainer = SourceData.GetString(35),
partySkill = SourceData.GetInt(36),
tagTrainer = SourceData.GetString(37),
levelBonus_JP = SourceData.GetString(38),
TaskHarvest
@@ -498,7 +498,7 @@ public void HarvestThing()
}
int decay = target.decay;
int lV = target.LV;
target.Die();
target.Die(null, EClass.pc);
if (target.trait is TraitGrave || text.Contains("$") || text.Contains("#") || text.Contains("@") || text.Contains("-") || text == target.id || !EClass.sources.cards.map.ContainsKey(text) || (int)num <= 0 || target.source.components.IsEmpty())
{
return;
Thing
@@ -1846,15 +1846,19 @@ public void DoAct(Act act)
}
int num4 = EClass.rnd(num);
int num5 = 0;
foreach (SourceElement.Row item2 in list)
foreach (SourceElement.Row item in list)
{
num5 += item2.chance;
num5 += item.chance;
if (num4 < num5)
{
string text = EClass.sources.elements.map[item2.id].category;
string text = EClass.sources.elements.map[item.id].category;
bool flag = text == "skill" || text == "attribute" || text == "resist";
int item = (item2.mtp + EClass.rnd(item2.mtp + (int)num3)) / item2.mtp * ((!(flag && neg)) ? 1 : (-1));
return new Tuple<SourceElement.Row, int>(item2, item);
int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num3)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
if (item.encFactor == 0 && num6 > 25)
{
num6 = 25;
}
return new Tuple<SourceElement.Row, int>(item, num6);
}
}
return null;
Trait
@@ -1982,45 +1982,45 @@ public Thing CreateStock()
return FromFilter("shop_magic");
case ShopType.Ecopo:
{
Thing thing3 = TraitSeed.MakeRandomSeed(enc: true);
TraitSeed.LevelSeed(thing3, (thing3.trait as TraitSeed).row, 1);
return thing3;
Thing thing = TraitSeed.MakeRandomSeed(enc: true);
TraitSeed.LevelSeed(thing, (thing.trait as TraitSeed).row, 1);
return thing;
}
case ShopType.Healer:
{
Thing thing = null;
Thing thing2 = null;
for (int i = 0; i < 1000; i++)
{
thing = FromFilter("shop_healer");
if (thing.trait is TraitScroll { source: not null } traitScroll)
thing2 = FromFilter("shop_healer");
if (thing2.trait is TraitScroll { source: not null } traitScroll)
{
if (!(traitScroll.source.aliasParent != "WIL") && !(traitScroll.source.categorySub == "attack"))
{
break;
}
}
else if (thing.trait is TraitPotionRandom { source: not null } traitPotionRandom)
else if (thing2.trait is TraitPotionRandom { source: not null } traitPotionRandom)
{
if (!(traitPotionRandom.source.aliasParent != "WIL") && !(traitPotionRandom.source.categorySub == "attack"))
{
thing.SetNum(EClass.rnd(5) + 1);
thing2.SetNum(EClass.rnd(5) + 1);
break;
}
}
else if (thing.trait is TraitRodRandom { source: not null } traitRodRandom && !(traitRodRandom.source.aliasParent != "WIL") && !(traitRodRandom.source.categorySub == "attack"))
else if (thing2.trait is TraitRodRandom { source: not null } traitRodRandom && !(traitRodRandom.source.aliasParent != "WIL") && !(traitRodRandom.source.categorySub == "attack"))
{
break;
}
}
return thing;
return thing2;
}
case ShopType.Milk:
if (EClass._zone is Zone_Nefu && EClass.rnd(2) == 0)
{
Thing thing2 = ThingGen.Create("milk");
thing2.MakeRefFrom(EClass.sources.charas.rows.Where((SourceChara.Row r) => r.race == "mifu" || r.race == "nefu").RandomItem().model);
Debug.Log(thing2);
return thing2;
Thing thing3 = ThingGen.Create("milk");
thing3.MakeRefFrom(EClass.sources.charas.rows.Where((SourceChara.Row r) => r.race == "mifu" || r.race == "nefu").RandomItem().model);
Debug.Log(thing3);
return thing3;
}
return Create("milk");
case ShopType.Map:
@@ -2047,6 +2047,10 @@ public Thing CreateStock()
{
num = 15;
}
if (EClass.debug.enable)
{
num = 1;
}
CardBlueprint.SetRarity((EClass.rnd(num * 5) == 0) ? Rarity.Mythical : ((EClass.rnd(num) == 0) ? Rarity.Legendary : ((EClass.rnd(5) == 0) ? Rarity.Superior : Rarity.Normal)));
return FromFilter("shop_blackmarket");
}
TraitHitchingPost
@@ -12,7 +12,7 @@ public override void OnActivateTrap(Chara c)
{
foreach (Chara chara in owner.pos.Charas)
{
if (chara.IsPCFaction && !chara.IsPC && !chara.IsPCParty)
if (chara.IsPCFaction && !chara.IsPC && !chara.IsPCParty && chara.trait.CanJoinParty)
{
ActRide.Ride(EClass.pc, chara);
return;
TraitLoytel
@@ -7,4 +7,6 @@ public class TraitLoytel : TraitUniqueMerchant
public override string LangBarter => "daBuyStarter";
public override bool CanBeBanished => false;
public override bool CanJoinParty => EClass.game.quests.Get("pre_debt_runaway") == null;
}
TraitMerchantBlack
@@ -17,4 +17,16 @@ public override ShopType ShopType
}
public override bool CanSellStolenGoods => true;
public override int ShopLv
{
get
{
if (!EClass.debug.enable)
{
return base.ShopLv;
}
return EClass.debug.startSetting.lv;
}
}
}
WidgetStatsBar
@@ -46,6 +46,8 @@ public class Extra
public bool maxAlly;
public bool maxMinion;
public bool hearthLv;
public bool tourism_value;
@@ -53,6 +55,8 @@ public class Extra
public bool fame;
public bool dv;
public bool fertility;
}
public static WidgetStatsBar Instance;
@@ -87,6 +91,10 @@ public class Extra
public Sprite iconDvPv;
public Sprite iconMaxMinion;
public Sprite iconFertility;
private UIItem mold;
public Extra extra => base.config.extra as Extra;
@@ -106,6 +114,10 @@ public override void OnActivate()
{
Instance = this;
mold = layout.CreateMold<UIItem>();
if (extra == null)
{
base.config.extra = CreateExtra();
}
Build();
InvokeRepeating("Refresh", 0.2f, 0.2f);
}
@@ -130,6 +142,10 @@ public void Build()
{
Add(null, "maxAlly", iconMaxAlly, () => EMono.pc.party.members.Count - 1 + "/" + EMono.player.MaxAlly, () => (EMono.player.lastEmptyAlly >= 0) ? FontColor.Default : FontColor.Bad);
}
if (extra.maxMinion)
{
Add(null, "maxMinion", iconMaxMinion, () => EMono._zone.CountMinions(EMono.pc) + "/" + EMono.pc.MaxSummon, () => (EMono.pc.MaxSummon - EMono._zone.CountMinions(EMono.pc) >= 0) ? FontColor.Default : FontColor.Bad);
}
if (extra.money)
{
Add(null, "money", iconMoney, () => EMono.pc.GetCurrency().ToString("#,0") ?? "");
@@ -170,6 +186,26 @@ public void Build()
{
Add(null, "hearth_lv", iconHearth, () => (EMono.Branch != null) ? EMono.Branch.TextLv : "", () => (EMono.Branch != null && EMono.Branch.exp < EMono.Branch.GetNextExp()) ? FontColor.Default : FontColor.Good, () => EMono._zone.IsPCFaction);
}
if (extra.fertility)
{
Add(null, "fertility", iconFertility, delegate
{
object obj;
if (EMono.Branch != null)
{
obj = (EMono.Branch.MaxSoil - EMono._zone.GetSoilCost()).ToString();
if (obj == null)
{
return "";
}
}
else
{
obj = "";
}
return (string)obj;
}, () => (EMono.Branch == null || EMono.Branch.MaxSoil - EMono._zone.GetSoilCost() >= 0) ? FontColor.Default : FontColor.Bad, () => EMono._zone.IsPCFaction);
}
if (extra.weight)
{
Add(null, "weight", iconWeight, () => ((float)EMono.pc.ChildrenWeight / 1000f).ToString("F1") + " / " + ((float)EMono.pc.WeightLimit / 1000f).ToString("F1"), () => EMono.pc.burden.GetPhase() switch
@@ -287,6 +323,11 @@ public override void OnSetContextMenu(UIContextMenu m)
extra.maxAlly = a;
Build();
});
uIContextMenu.AddToggle("maxMinion", extra.maxMinion, delegate(bool a)
{
extra.maxMinion = a;
Build();
});
uIContextMenu.AddToggle("money", extra.money, delegate(bool a)
{
extra.money = a;
@@ -340,6 +381,11 @@ public override void OnSetContextMenu(UIContextMenu m)
extra.hearthLv = a;
Build();
});
uIContextMenu.AddToggle("fertility", extra.fertility, delegate(bool a)
{
extra.fertility = a;
Build();
});
uIContextMenu.AddToggle("invWeight", extra.weight, delegate(bool a)
{
extra.weight = a;
Zone_EmbassyPalmia
@@ -3,4 +3,6 @@ public class Zone_EmbassyPalmia : Zone_Civilized
public override ZoneTransition.EnterState RegionEnterState => ZoneTransition.EnterState.Bottom;
public override bool AllowCriminal => false;
public override bool AllowInvest => true;
}