EA 23.87 Nightly
February 6, 2025
14 files modified. 1 new file created.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
SourceElement (2)
public bool IsEncAppliable(Thing t, bool isMaterial)
public bool IsEncAppliable(Thing t)
public bool IsMaterialEncAppliable(Thing t)
TileType (1)
public Vector3 GetRampFix(int dir)
public Vector3 GetRampFix(int dir, SourcePref pref = null)
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 num5 = power / 50 + 1 + EClass.rnd(3);
int num = power / 50 + 1 + EClass.rnd(3);
List<Thing> source = TC.things.List((Thing t) => t.c_IDTState == 0);
for (int j = 0; j < num5; j++)
for (int i = 0; i < num; i++)
{
source.RandomItem().c_IDTState = 5;
}
case EffectId.EnchantArmorGreat:
{
bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
bool flag3 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
bool flag4 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
if (!tc.isThing)
{
LayerDragGrid.CreateEnchant(CC, armor, flag3, state);
LayerDragGrid.CreateEnchant(CC, armor, flag4, 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 num3 = (flag3 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num3)
int num5 = (flag4 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num5)
{
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:
Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
bool flag4 = tc.IsEquipmentOrRanged || tc.IsThrownWeapon || tc.IsAmmo;
bool flag3 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
if (flag)
{
num4 = (int)(0.01f * (float)num4 * (float)power * 0.75f + 500f);
if (num4 < 0 || num4 > 10000000)
{
num4 = 10000000;
flag4 = false;
flag3 = false;
}
if (flag4)
if (flag3)
{
if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
{
{
power /= 4;
}
if (flag4)
if (flag3)
{
if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
{
string name = tc.Name;
if (row == null)
{
bool num = id == EffectId.ChangeMaterialGreater;
bool num2 = id == EffectId.ChangeMaterialGreater;
bool flag2 = id == EffectId.ChangeMaterialLesser;
string text2 = tc.Thing.source.tierGroup;
Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
int num2 = 1;
int num3 = 1;
if (flag)
{
num2 -= 2;
num3 -= 2;
}
if (blessed)
{
num2++;
num3++;
}
if (num)
if (num2)
{
num2++;
num3++;
}
if (flag2)
{
num2 -= 2;
num3 -= 2;
}
num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4);
num3 = Mathf.Clamp(num3 + EClass.rnd(2), 0, 4);
if (EClass.rnd(10) == 0)
{
text2 = ((text2 == "metal") ? "leather" : "metal");
}
SourceMaterial.TierList tierList = (text2.IsEmpty() ? tierMap.RandomItem() : tierMap[text2]);
for (int i = 0; i < 1000; i++)
for (int j = 0; j < 1000; j++)
{
row = tierList.tiers[num2].Select();
row = tierList.tiers[num3].Select();
if (row != tc.material)
{
break;
BaseTileMap
@@ -1367,7 +1367,7 @@ public virtual void DrawTile()
{
if (t.TileType.IsRamp)
{
Vector3 rampFix2 = t.TileType.GetRampFix(t.dir);
Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
orgX += rampFix2.x;
orgY += rampFix2.y;
orgZ += rampFix2.z;
@@ -3204,7 +3204,7 @@ public Vector3 GetThingPosition(Card tg, Point p)
}
if (thing.TileType.IsRamp)
{
Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir);
Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir, pref);
zero.x += rampFix2.x;
zero.y += rampFix2.y;
zero.z += rampFix2.z;
ButtonGrid
@@ -373,7 +373,7 @@ void RefreshBG()
else
{
Sprite sprite = refs.bgDefault;
if (c.rarity >= Rarity.Superior && c.IsIdentified && (c.IsEquipmentOrRanged || c.IsAmmo))
if (c.rarity >= Rarity.Superior && c.IsIdentified && c.IsEquipmentOrRangedOrAmmo)
{
sprite = ((c.rarity >= Rarity.Artifact) ? refs.bgArtifact : ((c.rarity >= Rarity.Mythical) ? refs.bgMythical : ((c.rarity < Rarity.Legendary) ? refs.bgSuperior : refs.bgLegendary)));
}
Card
@@ -2042,7 +2042,7 @@ public bool ShowFoodEnc
{
get
{
if (!IsFood && (Evalue(10) <= 0 || IsEquipmentOrRanged) && !category.IsChildOf("seed") && !(id == "pasture") && !(id == "grass"))
if (!IsFood && (Evalue(10) <= 0 || IsEquipmentOrRangedOrAmmo) && !category.IsChildOf("seed") && !(id == "pasture") && !(id == "grass"))
{
return category.IsChildOf("drug");
}
@@ -2074,6 +2074,18 @@ public bool IsEquipmentOrRanged
}
}
public bool IsEquipmentOrRangedOrAmmo
{
get
{
if (category.slot == 0 && !IsRangedWeapon)
{
return IsAmmo;
}
return true;
}
}
public bool IsMeleeWeapon => category.IsChildOf("melee");
public bool IsRangedWeapon => trait is TraitToolRange;
@@ -3455,7 +3467,7 @@ public void ModEncLv(int a)
ApplyMaterialElements(remove: true);
encLV += a;
ApplyMaterialElements(remove: false);
if (IsEquipmentOrRanged || IsAmmo)
if (IsEquipmentOrRangedOrAmmo)
{
if (IsWeapon || IsAmmo)
{
@@ -3484,7 +3496,7 @@ public virtual void SetBlessedState(BlessedState s)
{
num = -1;
}
if (num != 0 && (IsEquipmentOrRanged || IsAmmo))
if (num != 0 && IsEquipmentOrRangedOrAmmo)
{
if (IsWeapon || IsAmmo)
{
@@ -6285,7 +6297,7 @@ public int GetValue(bool sell = false)
num *= 0.5f;
}
float num2;
if (IsEquipmentOrRanged || trait is TraitMod)
if (IsEquipmentOrRangedOrAmmo || trait is TraitMod)
{
if (sell)
{
Chara
{
EClass.player.doneBackers.Add(base.sourceBacker.id);
}
if (IsPCParty)
if (base.IsPCFactionOrMinion)
{
if (!IsPC)
if (!IsPC && !IsMinion && EClass.game.config.autoCombat.abortOnAllyDead && EClass.player.TryAbortAutoCombat())
{
EClass.pc.party.RemoveMember(this);
base.c_wasInPcParty = true;
EClass.pc.Say("allyDead");
if (EClass.game.config.autoCombat.abortOnAllyDead && EClass.player.TryAbortAutoCombat())
{
Msg.Say("abort_allyDead");
}
Msg.Say("abort_allyDead");
}
}
else if (EClass.game.config.autoCombat.abortOnEnemyDead && EClass.player.TryAbortAutoCombat())
{
Msg.Say("abort_enemyDead");
}
if (IsPCParty && !IsPC)
{
EClass.pc.party.RemoveMember(this);
base.c_wasInPcParty = true;
EClass.pc.Say("allyDead");
}
text4 = id;
if (!(text4 == "littleOne"))
{
ElementContainer
@@ -108,7 +108,7 @@ public void ApplyMaterialElementMap(Thing t, bool invert = false)
continue;
}
Element orCreateElement = GetOrCreateElement(item.Key);
if (!orCreateElement.source.IsEncAppliable(t))
if (!orCreateElement.source.IsMaterialEncAppliable(t))
{
if (orCreateElement.vBase == 0 && orCreateElement.vSource == 0 && orCreateElement.vLink == 0 && orCreateElement.vExp == 0 && orCreateElement.vPotential == 0)
{
@@ -812,8 +812,7 @@ public void AddNote(UINote n, Func<Element, bool> isValid = null, Action onAdd =
uIItem.image1.SetActive(enable: true);
uIItem.image1.sprite = sprite;
}
bool enable = e.HasTag("weaponEnc") || e is Ability || e.source.categorySub == "eleConvert" || e.source.categorySub == "eleAttack";
uIItem.image2.SetActive(enable);
uIItem.image2.SetActive(e.source.IsWeaponEnc);
onAddNote?.Invoke(n, e);
continue;
}
ElementContainerCard
@@ -23,7 +23,7 @@ public override bool IsMeleeWeapon
public void SetOwner(Card c, bool applyFeat)
{
owner = c;
SourceValueType sourceValueType = ((c.IsEquipmentOrRanged && c.rarity < Rarity.Artifact) ? SourceValueType.EquipmentRandom : SourceValueType.Fixed);
SourceValueType sourceValueType = ((c.IsEquipmentOrRangedOrAmmo && c.rarity < Rarity.Artifact) ? SourceValueType.EquipmentRandom : SourceValueType.Fixed);
ApplyElementMap(c.uid, sourceValueType, c.sourceCard.elementMap, (sourceValueType != SourceValueType.EquipmentRandom) ? 1 : c.LV, invert: false, applyFeat);
}
LayerCraft
@@ -507,7 +507,7 @@ public void RefreshProduct()
{
thing.sockets.Clear();
}
if (thing.IsEquipmentOrRanged)
if (thing.IsEquipmentOrRangedOrAmmo)
{
foreach (Element item in thing.elements.dict.Values.ToList())
{
Map
@@ -1251,7 +1251,7 @@ public void TryShatter(Point pos, int ele, int power)
continue;
}
Card rootCard3 = item3.GetRootCard();
if (item3.IsEquipmentOrRanged && (EClass.rnd(4) != 0 || ((item3.IsRangedWeapon || item3.Thing.isEquipped) && rootCard3.IsPCFaction && EClass.rnd(4) != 0)))
if (item3.IsEquipmentOrRangedOrAmmo && (EClass.rnd(4) != 0 || ((item3.IsRangedWeapon || item3.Thing.isEquipped) && rootCard3.IsPCFaction && EClass.rnd(4) != 0)))
{
continue;
}
SourceElement
@@ -133,6 +133,9 @@ public class Row : BaseRow
[NonSerialized]
public bool isSpell;
[NonSerialized]
public bool isTrait;
public int idMold;
[NonSerialized]
@@ -169,6 +172,18 @@ public class Row : BaseRow
public override string GetAlias => alias;
public bool IsWeaponEnc
{
get
{
if (!tag.Contains("weaponEnc") && !(categorySub == "eleConvert") && !(categorySub == "eleAttack"))
{
return category == "ability";
}
return true;
}
}
public override string GetName()
{
if (idMold != 0)
@@ -201,40 +216,27 @@ public string GetAltname(int i)
return GetText("altname").Split(',').TryGet(i);
}
public bool IsEncAppliable(Thing t, bool isMaterial)
{
if (isMaterial && t.IsEquipmentOrRanged)
{
return true;
}
if (tag.Contains("trait"))
{
return !t.IsEquipmentOrRanged;
}
return IsEncAppliable(t.category);
}
public bool IsEncAppliable(Thing t)
public bool IsMaterialEncAppliable(Thing t)
{
if (id == 10)
{
return true;
}
if (tag.Contains("trait"))
if (isTrait)
{
if (t.IsEquipmentOrRanged || t.IsAmmo)
if (t.IsEquipmentOrRangedOrAmmo)
{
return false;
}
return true;
}
if (!t.IsEquipmentOrRanged)
if (!t.IsEquipmentOrRangedOrAmmo && !t.IsThrownWeapon)
{
return false;
}
if (t.IsAmmo)
if (!t.IsEquipment)
{
IsEncAppliable(t.category);
return IsWeaponEnc;
}
return true;
}
@@ -252,7 +254,7 @@ public bool IsEncAppliable(SourceCategory.Row cat)
int slot = cat.slot;
if (slot == 0)
{
return false;
return IsWeaponEnc;
}
string text = encSlot;
if (!(text == "all"))
@@ -352,6 +354,7 @@ public override void OnInit()
row.isPrimaryAttribute = row.isAttribute && row.tag.Contains("primary");
row.isSkill = row.category == "skill";
row.isSpell = row.categorySub == "spell";
row.isTrait = row.tag.Contains("trait");
}
}
TaskHarvest
@@ -461,7 +461,7 @@ public override void OnCreateProgress(Progress_Custom p)
public string GetIdDismantled()
{
string result = target.source.components[0].Split('|')[0].Split('/')[0];
if (target.IsEquipmentOrRanged || target.IsAmmo)
if (target.IsEquipmentOrRangedOrAmmo)
{
result = target.material.thing;
}
Thing
@@ -413,7 +413,7 @@ public override void ApplyMaterial(bool remove = false)
SetBase(65, source.defense[1] / 3);
}
}
if (base.IsEquipmentOrRanged || base.IsAmmo)
if (base.IsEquipmentOrRangedOrAmmo)
{
if (base.IsWeapon || base.IsAmmo)
{
@@ -503,7 +503,7 @@ public override string GetName(NameStyle style, int _num = -1)
string text6 = source.GetText("unit");
ArticleStyle style2 = ((style == NameStyle.FullNoArticle) ? ArticleStyle.None : ArticleStyle.Default);
bool num2 = base.IsIdentified || source.unknown.IsEmpty();
bool isEquipmentOrRanged = base.IsEquipmentOrRanged;
bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
bool flag = Lang.setting.nameStyle == 0;
if (num2)
{
@@ -524,11 +524,11 @@ public override string GetName(NameStyle style, int _num = -1)
{
text = id;
}
if (!isEquipmentOrRanged || !base.IsIdentified || base.rarity < Rarity.Legendary)
if (!isEquipmentOrRangedOrAmmo || !base.IsIdentified || base.rarity < Rarity.Legendary)
{
if (source.naming == "m" || (source.naming == "ms" && base.material != source.DefaultMaterial))
{
if (isEquipmentOrRanged)
if (isEquipmentOrRangedOrAmmo)
{
string[] textArray = base.material.GetTextArray("altName");
if (textArray != null && textArray.Length >= 2)
@@ -655,13 +655,13 @@ public override string GetName(NameStyle style, int _num = -1)
case Rarity.Artifact:
style2 = ArticleStyle.None;
text3 = "★";
text = (isEquipmentOrRanged ? text.Bracket(3) : text);
text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
break;
case Rarity.Legendary:
case Rarity.Mythical:
style2 = ArticleStyle.The;
text3 = "☆";
if (isEquipmentOrRanged)
if (isEquipmentOrRangedOrAmmo)
{
Rand.UseSeed(base.uid + EClass.game.seed, delegate
{
@@ -843,7 +843,7 @@ public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns
n.Clear();
string text2 = "";
TraitAbility traitAbility = trait as TraitAbility;
bool showEQStats = base.IsEquipmentOrRanged || base.IsAmmo;
bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
bool flag = mode == IInspect.NoteMode.Product;
bool flag2 = base.IsIdentified || flag;
text2 = base.Name;
{
AddText("isBed".lang(traitBed.MaxHolders.ToString() ?? ""), FontColor.Default);
}
bool flag3 = base.IsEquipmentOrRanged || base.IsAmmo || base.IsThrownWeapon;
bool flag3 = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon;
if (flag2)
{
if (flag3)
IDTSource.Skill => Rarity.Superior,
_ => Rarity.Normal,
};
if (rarity != 0 && ((base.IsEquipmentOrRanged && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
{
base.c_IDTState = 3;
}
TileType
@@ -8,7 +8,8 @@ public enum RampType
{
None,
Full,
Half
Half,
Flat
}
public static TileTypeNone None = new TileTypeNone();
@@ -21,6 +22,8 @@ public enum RampType
public static TileTypeSlope Slope = new TileTypeSlope();
public static TileTypeSlopeFlat SlopeFlat = new TileTypeSlopeFlat();
public static TileTypeHalfBlock HalfBlock = new TileTypeHalfBlock();
public static TileTypeStairs Stairs = new TileTypeStairs();
v += EClass.screen.tileMap.altitudeFix * target.altitude;
}
public Vector3 GetRampFix(int dir)
public Vector3 GetRampFix(int dir, SourcePref pref = null)
{
int num = (int)Ramp * 2 - 2 + ((dir > 1) ? 1 : 0);
Vector3 vector = EClass.setting.render.rampFix[num];
if (pref != null && Ramp == RampType.Flat)
{
vector.y += pref.height;
}
return new Vector3(vector.x * (float)((dir % 2 == 0) ? 1 : (-1)), vector.y, vector.z);
}
}
+TileTypeSlopeFlat
File Created
public class TileTypeSlopeFlat : TileTypeSlope
{
public override RampType Ramp => RampType.Flat;
}
TraitDrink
@@ -69,7 +69,7 @@ public override bool CanBlend(Thing t)
case EffectId.Acidproof:
if (!t.isAcidproof)
{
return t.IsEquipmentOrRanged;
return t.IsEquipmentOrRangedOrAmmo;
}
return false;
case EffectId.DrinkWater: