EA 23.82 Patch 1
January 26, 2025
20 files modified.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
Card (3)
public Card ChangeMaterial(int idNew)
public Card ChangeMaterial(int idNew, bool ignoreFixedMaterial = false)
public Card ChangeMaterial(string idNew)
public Card ChangeMaterial(string idNew, bool ignoreFixedMaterial = false)
public Card ChangeMaterial(SourceMaterial.Row row)
public Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial = false)
ActEffect
{
return;
}
Thing thing = ThingGen.Create("mine");
thing.c_idRefCard = "dog_mine";
Thing thing3 = ThingGen.Create("mine");
thing3.c_idRefCard = "dog_mine";
Zone.ignoreSpawnAnime = true;
EClass._zone.AddCard(thing, CC.pos).Install();
EClass._zone.AddCard(thing3, CC.pos).Install();
break;
}
case EffectId.MagicMap:
@@ -913,9 +913,9 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po
TC.PlaySound("curse3");
TC.PlayEffect("curse");
TC.Say("forgetItems", TC);
int num = power / 50 + 1 + EClass.rnd(3);
int num4 = power / 50 + 1 + EClass.rnd(3);
List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
for (int i = 0; i < num; i++)
for (int j = 0; j < num4; j++)
{
source.RandomItem().c_IDTState = 5;
}
case EffectId.EnchantArmorGreat:
{
bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
bool flag2 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
if (!tc.isThing)
{
LayerDragGrid.CreateEnchant(CC, armor, flag4, state);
LayerDragGrid.CreateEnchant(CC, armor, flag2, state);
return;
}
cc.PlaySound("identify");
@@ -941,8 +941,8 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po
tc.ModEncLv(-1);
break;
}
int num5 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num5)
int num = (flag2 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num)
{
cc.Say("enc_resist", tc);
break;
LayerDragGrid.CreateUncurse(CC, state);
return;
}
Thing thing3 = tc.Thing;
if (thing3.blessedState == BlessedState.Cursed)
Thing thing = tc.Thing;
if (thing.blessedState == BlessedState.Cursed)
{
thing3.SetBlessedState(BlessedState.Normal);
thing.SetBlessedState(BlessedState.Normal);
}
else if (thing3.blessedState == BlessedState.Doomed)
else if (thing.blessedState == BlessedState.Doomed)
{
thing3.SetBlessedState(BlessedState.Normal);
thing.SetBlessedState(BlessedState.Normal);
}
thing3.GetRootCard()?.TryStack(thing3);
LayerInventory.SetDirty(thing3);
thing.GetRootCard()?.TryStack(thing);
LayerInventory.SetDirty(thing);
break;
}
case EffectId.Lighten:
}
cc.PlaySound("offering");
cc.PlayEffect("buff");
int num4 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
int num5 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
tc.isWeightChanged = true;
Element orCreateElement = tc.elements.GetOrCreateElement(64);
Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
bool flag3 = tc.IsEquipmentOrRanged || tc.IsThrownWeapon || tc.IsAmmo;
bool flag4 = tc.IsEquipmentOrRanged || tc.IsThrownWeapon || tc.IsAmmo;
if (flag)
{
num4 = (int)(0.01f * (float)num4 * (float)power * 0.75f + 500f);
if (num4 < 0 || num4 > 10000000)
num5 = (int)(0.01f * (float)num5 * (float)power * 0.75f + 500f);
if (num5 < 0 || num5 > 10000000)
{
num4 = 10000000;
flag3 = false;
num5 = 10000000;
flag4 = false;
}
if (flag3)
if (flag4)
{
if (tc.IsWeapon || tc.IsThrownWeapon)
{
}
else
{
num4 = num4 * (100 - power / 10) / 100;
num5 = num5 * (100 - power / 10) / 100;
if (blessed)
{
power /= 4;
}
if (flag3)
if (flag4)
{
if (tc.IsWeapon || tc.IsThrownWeapon)
if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
{
tc.elements.ModBase(67, -Mathf.Clamp(orCreateElement3.vBase * power / 1000, 1, 5));
tc.elements.ModBase(66, Mathf.Clamp(orCreateElement4.vBase * power / 1000, 1, 5));
}
cc.Say("lighten", cc, tc);
}
tc.c_weight = num4;
tc.c_weight = num5;
tc.SetDirtyWeight();
if (tc.parent == null)
{
if (row == null)
{
bool num2 = id == EffectId.ChangeMaterialGreater;
bool flag2 = id == EffectId.ChangeMaterialLesser;
bool flag3 = id == EffectId.ChangeMaterialLesser;
string text2 = tc.Thing.source.tierGroup;
Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
int num3 = 1;
{
num3++;
}
if (flag2)
if (flag3)
{
num3 -= 2;
}
text2 = ((text2 == "metal") ? "leather" : "metal");
}
SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
for (int j = 0; j < 1000; j++)
for (int i = 0; i < 1000; i++)
{
row = tierList.tiers[num3].Select();
if (row != tc.material)
ActMelee
@@ -343,7 +343,7 @@ void AttackWithFlurry(Card _tc, Point _tp, float mtp, bool subAttack)
}
int GetWeaponEnc(int ele)
{
return ((w != null) ? w.Evalue(ele) : 0) + EClass.pc.faction.charaElements.Value(ele);
return ((w != null) ? w.Evalue(ele) : 0) + (Act.CC.IsPCFactionOrMinion ? EClass.pc.faction.charaElements.Value(ele) : 0);
}
}
if (!flag)
ActRanged
@@ -257,7 +257,25 @@ public override bool Perform()
return true;
int GetWeaponEnc(int ele)
{
return weapon.Evalue(ele) + EClass.pc.faction.charaElements.Value(ele);
return weapon.Evalue(ele) + (Act.CC.IsPCFactionOrMinion ? EClass.pc.faction.charaElements.Value(ele) : 0);
}
void Prepare()
{
AttackProcess.Current.Prepare(Act.CC, weapon, Act.TC, Act.TP);
AttackProcess.Current.numFire = numFire;
AttackProcess.Current.numFireWithoutDamageLoss = numFireWithoutDamageLoss;
AttackProcess.Current.posRangedAnime = Act.TP.Copy();
AttackProcess.Current.ignoreAnime = index > 1;
AttackProcess.Current.ignoreAttackSound = false;
if (drill > 0 && points.Count > 0)
{
AttackProcess.Current.posRangedAnime = points.LastItem();
}
else if (scatter > 0)
{
AttackProcess.Current.ignoreAnime = false;
AttackProcess.Current.ignoreAttackSound = index > 1;
}
}
void Shoot(Card _tc, Point _tp)
{
@@ -272,7 +290,6 @@ void Shoot(Card _tc, Point _tp)
Act.TC = c;
});
}
AttackProcess.Current.Prepare(Act.CC, weapon, Act.TC, Act.TP);
CellEffect effect = Act.TP.cell.effect;
if (effect != null && effect.id == 6 && EClass.rnd(2) == 0)
{
@@ -282,49 +299,32 @@ void Shoot(Card _tc, Point _tp)
}
else
{
AttackProcess.Current.numFire = numFire;
AttackProcess.Current.numFireWithoutDamageLoss = numFireWithoutDamageLoss;
AttackProcess.Current.posRangedAnime = Act.TP.Copy();
AttackProcess.Current.ignoreAnime = index > 1;
AttackProcess.Current.ignoreAttackSound = false;
if (drill > 0 && points.Count > 0)
{
AttackProcess.Current.posRangedAnime = points.LastItem();
}
else if (scatter > 0)
{
AttackProcess.Current.ignoreAnime = false;
AttackProcess.Current.ignoreAttackSound = index > 1;
}
if (scatter > 0)
{
dmgMulti = Mathf.Clamp(1.2f - 0.2f * (float)Act.CC.Dist(Act.TP) - (Act.TP.Equals(orgTP) ? 0f : 0.4f), 0.2f, 1f);
}
int num5 = 1;
bool flag3 = false;
if (chaser > 0)
for (int j = 0; j < numFire; j++)
{
for (int j = 0; j < 10; j++)
Act.TC = _tc;
Prepare();
if (AttackProcess.Current.Perform(j, hasHit, dmgMulti))
{
if (chaser > EClass.rnd(4 + (int)Mathf.Pow(4f, j + 2)))
{
num5++;
}
hasHit = true;
}
}
for (int k = 0; k < numFire + num5; k++)
{
if (k >= numFire)
else if (chaser > 0)
{
if (flag3)
for (int k = 0; k < 10; k++)
{
break;
if (chaser > EClass.rnd(4 + (int)Mathf.Pow(4f, k + 2 + j)))
{
Act.CC.Say("attack_chaser");
if (AttackProcess.Current.Perform(j, hasHit, dmgMulti))
{
hasHit = true;
break;
}
}
}
Act.CC.Say("attack_chaser");
}
if (AttackProcess.Current.Perform(k, hasHit, dmgMulti))
{
flag3 = (hasHit = true);
}
if (Act.TC == null || !Act.TC.IsAliveInCurrentZone)
{
Card
@@ -2786,19 +2786,19 @@ public virtual void ApplyMaterial(bool remove = false)
_colorInt = 0;
}
public Card ChangeMaterial(int idNew)
public Card ChangeMaterial(int idNew, bool ignoreFixedMaterial = false)
{
return ChangeMaterial(EClass.sources.materials.map[idNew]);
return ChangeMaterial(EClass.sources.materials.map[idNew], ignoreFixedMaterial);
}
public Card ChangeMaterial(string idNew)
public Card ChangeMaterial(string idNew, bool ignoreFixedMaterial = false)
{
return ChangeMaterial(EClass.sources.materials.alias[idNew]);
return ChangeMaterial(EClass.sources.materials.alias[idNew], ignoreFixedMaterial);
}
public Card ChangeMaterial(SourceMaterial.Row row)
public Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial = false)
{
if (sourceCard.fixedMaterial)
if (sourceCard.fixedMaterial && !ignoreFixedMaterial)
{
return this;
}
@@ -3125,7 +3125,7 @@ public bool IsStackable(Thing tg)
public Thing Duplicate(int num)
{
Thing thing = ThingGen.Create(id);
thing.ChangeMaterial(idMaterial);
thing.ChangeMaterial(idMaterial, ignoreFixedMaterial: true);
thing._bits1 = _bits1;
thing._bits2 = _bits2;
thing.dir = dir;
Chara
@@ -716,14 +716,26 @@ public override int DV
{
if (IsPCFaction)
{
return elements.Value(64) / ((!HasCondition<ConWeakness>()) ? 1 : 2);
return WeaknessMod(elements.Value(64));
}
int num = base.LV;
if (num > 50)
{
num = 50 + (num - 50) / 10;
}
return (num + elements.Value(64) * (100 + num + race.DV * 5) / 100) / ((!HasCondition<ConWeakness>()) ? 1 : 2);
return WeaknessMod(num + elements.Value(64) * (100 + num + race.DV * 5) / 100);
int WeaknessMod(int a)
{
if (HasCondition<ConWeakness>())
{
if (a <= 0)
{
return a * 2;
}
return a / 2;
}
return a;
}
}
}
@@ -733,14 +745,26 @@ public override int PV
{
if (IsPCFaction)
{
return elements.Value(65) / ((!HasCondition<ConWeakness>()) ? 1 : 2);
return WeaknessMod(elements.Value(65));
}
int num = base.LV;
if (num > 50)
{
num = 50 + (num - 50) / 10;
}
return (num + elements.Value(65) * (100 + num + race.PV * 5) / 100) / ((!HasCondition<ConWeakness>()) ? 1 : 2);
return WeaknessMod(num + elements.Value(65) * (100 + num + race.PV * 5) / 100);
int WeaknessMod(int a)
{
if (HasCondition<ConWeakness>())
{
if (a <= 0)
{
return a * 2;
}
return a / 2;
}
return a;
}
}
}
@@ -1332,10 +1356,7 @@ public override void OnCreate(int genLv)
if (source.mainElement.Length != 0)
{
int _genLv = Mathf.Min(genLv, 100);
if (EClass._zone != null && EClass._zone.ScaleMonsterLevel)
{
_genLv = ((genLv - 1) % 50 + 5) * 150 / 100;
}
Debug.Log(genLv + "/" + _genLv);
List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
string[] mainElement = source.mainElement;
for (int i = 0; i < mainElement.Length; i++)
@@ -1356,7 +1377,7 @@ public override void OnCreate(int genLv)
SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
if (list.Count >= 2)
{
num = tuple.Item3;
num = tuple.Item3 + base.LV - source.LV;
}
}
if (source.name == "*r")
CoreDebug
@@ -1950,6 +1950,10 @@ public static string TestSpawn(int lv, int num, int lvRange = -1)
{
return EnableCheat;
}
if (EClass._zone is Zone_Arena)
{
EClass._zone._dangerLv = lv;
}
foreach (Chara item in EClass._map.charas.Where((Chara c) => c.HasEditorTag(EditorTag.SpawnTest)).ToList())
{
item.Destroy();
GoalCombat
@@ -479,10 +479,25 @@ public virtual bool TryUseAbility(int dist, bool beforeMove = false)
continue;
}
string text = s.abilityType[0];
if ((flag5 && !(text == "melee") && !(text == "range") && EClass.rnd(2) == 0) || (id == 6602 && (dist <= 1 || tc.HasCondition<ConEntangle>())))
if (flag5 && !(text == "melee") && !(text == "range") && EClass.rnd(2) == 0)
{
continue;
}
switch (id)
{
case 6602:
if (dist <= 1 || tc.HasCondition<ConEntangle>())
{
continue;
}
break;
case 6450:
if (isPCFaction && (tc.HasElement(1221) || tc.HasElement(1223) || tc.id == "hedgehog_ether"))
{
continue;
}
break;
}
bool isHOT;
switch (text)
{
HotbarManager
@@ -126,11 +126,18 @@ public void ResetHotbar(int id)
id = "Deconstruct"
});
}
}
else if (EClass._zone is Zone_Tent)
{
hotbar.SetItem(new HotItemActionMode
{
id = "ExitBuild"
id = "Terrain"
});
}
hotbar.SetItem(new HotItemActionMode
{
id = "ExitBuild"
});
break;
}
case 4:
MapMetaData
using System;
using Newtonsoft.Json;
public class MapMetaData : EClass
@@ -19,6 +20,8 @@ public class MapMetaData : EClass
public string path;
public DateTime date;
public bool IsValidVersion()
{
return !Version.Get(version).IsBelow(EClass.core.versionMoongate);
Props
@@ -177,7 +177,7 @@ public bool ShouldListAsResource(Thing t)
{
return false;
}
if (card.isSale || !card.IsContainer || card.c_lockLv != 0 || card.trait is TraitChestMerchant)
if (card.isSale || !card.trait.CanUseContent)
{
return false;
}
QuestDeliver
@@ -96,7 +96,7 @@ public override void OnStart()
public virtual bool IsDestThing(Thing t)
{
if (t.parentCard != null && (t.parentCard.c_lockLv != 0 || t.parentCard.trait is TraitChestMerchant))
if (t.parentCard != null && !t.parentCard.trait.CanUseContent)
{
return false;
}
Thing
@@ -82,7 +82,7 @@ public bool CanSearchContents
{
if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
{
return trait.CanSearchContents;
return trait.CanSearchContent;
}
return false;
}
ThingContainer
@@ -819,7 +819,7 @@ public List<Thing> List(Func<Thing, bool> func, bool onlyAccessible = false)
public void _List(Func<Thing, bool> func, bool onlyAccessible = false)
{
if (onlyAccessible && !owner.trait.CanSearchContents)
if (onlyAccessible && !owner.trait.CanSearchContent)
{
return;
}
Trait
@@ -204,15 +204,21 @@ public virtual InvGridSize InvGridSize
public virtual bool IsContainer => false;
public virtual bool CanUseContent => CanSearchContent;
public virtual bool CanSearchContent
{
get
{
if (IsContainer)
if (!owner.isChara)
{
return owner.c_lockLv == 0;
if (IsContainer)
{
return owner.c_lockLv == 0;
}
return false;
}
return false;
return true;
}
}
@@ -280,8 +286,6 @@ public virtual bool CanBeStolen
public virtual bool CanBeHallucinated => true;
public virtual bool CanSearchContents => true;
public virtual bool CanBeDropped => true;
public virtual string ReqHarvest => null;
TraitChestMerchant
public class TraitChestMerchant : TraitContainer
{
public override bool CanUseContent => false;
public override string IDInvStyle
{
get
TraitMagicChest
@@ -36,7 +36,7 @@ public override int DecaySpeedChild
}
}
public override bool CanSearchContents
public override bool CanSearchContent
{
get
{
TraitMannequin
@@ -6,6 +6,8 @@ public class TraitMannequin : TraitItem
public override bool CanSearchContent => true;
public override bool CanUseContent => false;
public override bool UseAltTiles => owner.things.Count > 0;
public override bool CanUseFromInventory => false;
TraitMoongateEx
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -29,6 +30,7 @@ public void _OnUse()
if (metaData != null && metaData.IsValidVersion())
{
metaData.path = item.FullName;
metaData.date = item.LastWriteTime;
list.Add(metaData);
}
}
@@ -38,6 +40,7 @@ public void _OnUse()
EClass.pc.SayNothingHappans();
return;
}
list.Sort((MapMetaData a, MapMetaData b) => DateTime.Compare(a.date, b.date));
LayerList layer = null;
bool skipDialog = false;
layer = EClass.ui.AddLayer<LayerList>().SetList2(list, (MapMetaData a) => a.name, delegate(MapMetaData a, ItemGeneral b)
TraitTent
@@ -24,11 +24,14 @@ public override void OnChangePlaceState(PlaceState state)
{
EClass._zone.AddChild(base.zone);
}
return;
}
else
EClass._zone.RemoveChild(base.zone);
int num = owner.Thing.source.weight + base.zone.GetInt(1) * 150 / 100;
if (owner.HasElement(652))
{
EClass._zone.RemoveChild(base.zone);
owner.ChangeWeight(owner.Thing.source.weight + base.zone.GetInt(1) * 150 / 100);
num = num * 100 / 110;
}
owner.ChangeWeight(num);
}
}
TraitWhipLove
@@ -50,7 +50,7 @@ public override void TrySetHeldAct(ActPlan p)
EClass.pc.Say("spellbookCrumble", owner);
owner.Destroy();
}
return false;
return true;
}, c);
}
}