EA 23.46 Hotfix 2
December 2, 2024
19 files modified.
Breaking Changes
Click the file name to view the chunk.
Chara (1)
public bool CanSeeLos(Card c, int dist = -1, bool includeTelepathy = false)
public bool CanSeeLos(Card c, int dist = -1)
Affinity
@@ -46,7 +46,16 @@ public bool CanMarry()
{
if (!EClass.debug.marryAnytime)
{
return list.IndexOf(this) >= 7;
return list.IndexOf(this) >= 8;
}
return true;
}
public bool CanSleepBeside()
{
if (!EClass.debug.marryAnytime)
{
return list.IndexOf(this) >= 8;
}
return true;
}
BackerContent
@@ -30,7 +30,10 @@ public static void GakiConvert(ref string text, string idLang = "zako")
text = idLang.lang().Split(',').RandomItem() + " " + text;
}
text = text.Replace("。)", ")");
text = text.Replace("」", "");
if (text.EndsWith("」"))
{
text = text.Substring(0, text.Length - 1);
}
}
}
}
BaseListPeople
@@ -268,7 +268,25 @@ public override void OnClick(Chara c, ItemGeneral i)
}
});
});
if (c != EClass.pc)
if (c == EClass.pc)
{
if (EClass.game.Difficulty.tier > 0)
{
uIContextMenu.AddButton("changeDifficulty", delegate
{
Dialog.YesNo("dialog_changeDifficulty".lang(EClass.game.Difficulty.Name), delegate
{
SE.Play("mutation");
if (!EClass.game.Difficulty.allowRevive)
{
EClass.pc.SetFeat(1220, 0);
}
EClass.game.idDifficulty--;
});
});
}
}
else
{
if (c.sourceCard.idActor.IsEmpty() && c.host == null)
{
CINT
@@ -139,4 +139,6 @@ public class CINT
public const int isPrayed = 121;
public const int isDisableStockUse = 122;
public const int isSleepBeside = 123;
}
Chara
@@ -864,7 +864,19 @@ public bool IsWealthy
public FactionBranch homeBranch => homeZone?.branch;
public int MaxGene => race.geneCap;
public int MaxGeneSlot => race.geneCap;
public int CurrentGeneSlot
{
get
{
if (base.c_genes != null)
{
return base.c_genes.GetGeneSlot();
}
return 0;
}
}
public int Speed
{
@@ -1020,13 +1032,9 @@ public bool CanSee(Card c)
return true;
}
public bool CanSeeLos(Card c, int dist = -1, bool includeTelepathy = false)
public bool CanSeeLos(Card c, int dist = -1)
{
if (c.isChara && includeTelepathy && hasTelepathy && c.Chara.race.visibleWithTelepathy)
{
return true;
}
if (c.isHidden && !canSeeInvisible)
if (c.isHidden && !canSeeInvisible && (!hasTelepathy || !c.Chara.race.visibleWithTelepathy))
{
return false;
}
@@ -5748,9 +5756,16 @@ public void SetTempHand(int right = 0, int left = 0)
public override SubPassData GetSubPassData()
{
if (IsPCC && (IsDeadOrSleeping || (!EClass.player.altHeldPos && parent is Chara)))
if (IsPCC)
{
if (IsDeadOrSleeping || (!EClass.player.altHeldPos && parent is Chara))
{
return EClass.setting.pass.subDeadPCC;
}
}
else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && GetBool(123))
{
return EClass.setting.pass.subDeadPCC;
return EClass.setting.pass.subDead;
}
return SubPassData.Default;
}
CharaGenes
@@ -26,4 +26,14 @@ public int GetTotalCost()
}
return num;
}
public int GetGeneSlot()
{
int num = 0;
foreach (DNA item in items)
{
num += item.slot;
}
return num;
}
}
ConSleep
@@ -86,9 +86,30 @@ public override void Tick()
}
base.value = 1;
slept = true;
foreach (Chara chara in EClass._map.charas)
{
if (chara.host != null || chara.noMove || chara.conSuspend != null || chara.isRestrained || chara.IsPC)
{
continue;
}
bool flag = chara.GetBool(123);
if (!flag && chara.IsPCFaction && chara.race.tag.Contains("sleepBeside") && EClass.rnd(5) == 0)
{
flag = true;
}
if (flag)
{
chara.MoveImmediate(EClass.pc.pos);
chara.Say("sleep_beside", chara, EClass.pc);
if (!chara.HasCondition<ConSleep>())
{
chara.AddCondition<ConSleep>(20 + EClass.rnd(25), force: true);
}
}
}
foreach (Chara member in EClass.pc.party.members)
{
if (!member.IsPC)
if (!member.IsPC && !member.HasCondition<ConSleep>())
{
member.AddCondition<ConSleep>(5 + EClass.rnd(10), force: true);
}
DNA
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using UnityEngine;
@@ -17,11 +18,13 @@ public enum Type
public string id;
[JsonProperty]
public int[] ints = new int[4];
public int[] ints = new int[6];
[JsonProperty]
public List<int> vals = new List<int>();
public BitArray32 bits;
public Type type
{
get
@@ -70,6 +73,34 @@ public int seed
}
}
public int slot
{
get
{
return ints[5];
}
set
{
ints[5] = value;
}
}
[OnSerializing]
private void _OnSerializing(StreamingContext context)
{
ints[4] = bits.ToInt();
}
[OnDeserialized]
private void _OnDeserialized(StreamingContext context)
{
if (ints.Length < 6)
{
Array.Resize(ref ints, 6);
slot = 1;
}
}
public static Thing GenerateGene(Chara c, Type? type = null)
{
Thing thing = ThingGen.Create((type == Type.Brain) ? "gene_brain" : "gene");
@@ -255,6 +286,7 @@ public void Generate(Type _type, Chara model = null)
}
Rand.SetSeed();
CalcCost();
CalcSlot();
void AddAction()
{
if (model.ability.list.items.Count != 0)
@@ -389,6 +421,19 @@ public void CalcCost()
}
}
public void CalcSlot()
{
slot = 0;
for (int i = 0; i < vals.Count; i += 2)
{
Element element = Element.Create(vals[i], vals[i + 1]);
if (element.source.geneSlot > slot)
{
slot = element.source.geneSlot;
}
}
}
public static Type GetType(string idMat)
{
return idMat switch
@@ -436,10 +481,15 @@ public string GetText()
public void WriteNote(UINote n)
{
if (slot > 1)
{
n.AddText("isGeneReqSlots".lang(slot.ToString() ?? ""), FontColor.Warning);
}
if (!CanRemove())
{
n.AddText("isPermaGene".lang(), FontColor.Warning);
}
n.Space(4);
if (type == Type.Brain)
{
SourceChara.Row row = EClass.sources.charas.map.TryGetValue(id);
DramaActor
@@ -34,8 +34,6 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno
dialog.portrait.enableFull = sequence.fullPortrait;
dialog.portrait.SetPerson(owner);
}
text = ConvertAdv(text);
text = GameLang.ConvertDrama(text, owner.chara);
if (!owner.HumanSpeak)
{
if (!text.StartsWith("("))
@@ -44,6 +42,8 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno
}
text = text.Replace("。)", ")");
}
text = ConvertAdv(text);
text = GameLang.ConvertDrama(text, owner.chara);
if (chara != null)
{
string text2 = chara.id;
@@ -59,6 +59,8 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno
BackerContent.GakiConvert(ref text);
}
}
text = text.Replace("((", "(").Replace("))", ")").Replace("((", "(")
.Replace("))", ")");
if ((bool)dialog.goAffinity)
{
dialog.layoutInterest.SetActive(chara != null);
@@ -106,8 +108,6 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno
dialog.textNoInterest.text = "???";
}
}
text = text.Replace("((", "(").Replace("))", ")").Replace("((", "(")
.Replace("))", ")");
if ((bool)dialog.glitch)
{
dialog.glitch.enabled = useGlitch;
DramaCustomSequence
@@ -323,6 +323,7 @@ public void Build(Chara c)
{
Choice("disableMove", "_disableMove");
}
Choice((c.GetInt(123) == 0) ? "daSleepBeside" : "daSleepBeside2", "_sleepBeside");
if (c.GetInt(113) == 0)
{
Choice("daEquipSharedOff", "_toggleSharedEquip");
@@ -543,6 +544,20 @@ public void Build(Chara c)
});
_Talk("tg", GetTopic(c, (c.GetInt(106) == 0) ? "shutup" : "shutup2"));
End();
Step("_sleepBeside");
Method(delegate
{
if (c.affinity.CanSleepBeside())
{
c.SetInt(123, (c.GetInt(123) == 0) ? 1 : 0);
}
else
{
TempTalkTopic("refuse", StepEnd);
}
});
_Talk("tg", GetTopic(c, (c.GetInt(123) == 0) ? "ok" : "shutup"));
End();
Step("_insult");
Method(delegate
{
GameDifficulty
[Serializable]
public class GameDifficulty : EClass
{
public int tier;
public bool allowManualSave;
public bool allowRevive;
GoalAutoCombat
@@ -95,7 +95,7 @@ public void GetAbilities(Func<Element, bool> func)
foreach (Thing item in EClass.pc.things.Where((Thing t) => t.IsHotItem && t.trait is TraitAbility))
{
Element element = owner.elements.GetElement(item.c_idAbility);
if (element != null && func(element))
if (element != null && func(element) && (element.id != 9150 || EClass.player.favAbility.Contains(element.id)))
{
AddAbility(element.act, 15);
}
@@ -107,7 +107,7 @@ public void GetAbilities(Func<Element, bool> func)
}
foreach (Element value in owner.elements.dict.Values)
{
if ((!config.bUseFav || EClass.player.favAbility.Contains(value.id)) && func(value))
if ((!config.bUseFav || EClass.player.favAbility.Contains(value.id)) && func(value) && (value.id != 9150 || EClass.player.favAbility.Contains(value.id)))
{
AddAbility(value.act);
}
InvOwnerGene
@@ -25,7 +25,7 @@ public override bool ShouldShowGuide(Thing t)
public override void _OnProcess(Thing t)
{
DNA.Type type = t.c_DNA.type;
if (type != 0 && tg.c_genes != null && tg.c_genes.items.Count >= tg.MaxGene)
if (type != 0 && tg.c_genes != null && tg.CurrentGeneSlot >= tg.MaxGeneSlot)
{
SE.Beep();
Msg.Say("tooManyGene", tg);
@@ -78,10 +78,11 @@ public override void OnWriteNote(Thing t, UINote n)
if (ShouldShowGuide(t))
{
n.AddHeader("HeaderAdditionalTrait", "gene_hint");
int num = tg.c_genes?.items.Count ?? 0;
int num2 = num + 1;
int maxGene = tg.MaxGene;
n.AddText("gene_hint_slot".lang(num.ToString() ?? "", num2.ToString() ?? "", maxGene.ToString() ?? ""), (num2 <= maxGene) ? FontColor.Good : FontColor.Bad);
_ = tg.c_genes;
int num = tg.MaxGeneSlot - tg.CurrentGeneSlot;
int num2 = num - t.c_DNA.slot;
int maxGeneSlot = tg.MaxGeneSlot;
n.AddText("gene_hint_slot".lang(num.ToString() ?? "", num2.ToString() ?? "", maxGeneSlot.ToString() ?? ""), (num2 >= 0) ? FontColor.Good : FontColor.Bad);
int cost = t.c_DNA.cost;
int num3 = tg.feat - cost;
n.AddText("gene_hint_cost".lang(tg.feat.ToString() ?? "", cost + ((cost == t.c_DNA.cost) ? "" : ("(" + t.c_DNA.cost + ")")), num3.ToString() ?? ""), (num3 >= 0) ? FontColor.Good : FontColor.Bad);
SourceElement
@@ -67,6 +67,8 @@ public class Row : BaseRow
public int[] cost;
public int geneSlot;
public int charge;
public float radius;
@@ -293,32 +295,33 @@ public override Row CreateRow()
chance = SourceData.GetInt(26),
value = SourceData.GetInt(27),
cost = SourceData.GetIntArray(28),
charge = SourceData.GetInt(29),
radius = SourceData.GetFloat(30),
max = SourceData.GetInt(31),
req = SourceData.GetStringArray(32),
idTrainer = SourceData.GetString(33),
encSlot = SourceData.GetString(34),
partySkill = SourceData.GetInt(35),
tagTrainer = SourceData.GetString(36),
levelBonus_JP = SourceData.GetString(37),
levelBonus = SourceData.GetString(38),
foodEffect = SourceData.GetStringArray(39),
langAct = SourceData.GetStringArray(41),
detail_JP = SourceData.GetString(42),
detail = SourceData.GetString(43),
textPhase_JP = SourceData.GetString(44),
textPhase = SourceData.GetString(45),
textExtra_JP = SourceData.GetString(46),
textExtra = SourceData.GetString(47),
textInc_JP = SourceData.GetString(48),
textInc = SourceData.GetString(49),
textDec_JP = SourceData.GetString(50),
textDec = SourceData.GetString(51),
textAlt_JP = SourceData.GetStringArray(52),
textAlt = SourceData.GetStringArray(53),
adjective_JP = SourceData.GetStringArray(54),
adjective = SourceData.GetStringArray(55)
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),
partySkill = SourceData.GetInt(36),
tagTrainer = SourceData.GetString(37),
levelBonus_JP = SourceData.GetString(38),
levelBonus = SourceData.GetString(39),
foodEffect = SourceData.GetStringArray(40),
langAct = SourceData.GetStringArray(42),
detail_JP = SourceData.GetString(43),
detail = SourceData.GetString(44),
textPhase_JP = SourceData.GetString(45),
textPhase = SourceData.GetString(46),
textExtra_JP = SourceData.GetString(47),
textExtra = SourceData.GetString(48),
textInc_JP = SourceData.GetString(49),
textInc = SourceData.GetString(50),
textDec_JP = SourceData.GetString(51),
textDec = SourceData.GetString(52),
textAlt_JP = SourceData.GetStringArray(53),
textAlt = SourceData.GetStringArray(54),
adjective_JP = SourceData.GetStringArray(55),
adjective = SourceData.GetStringArray(56)
};
}
Thing
@@ -1540,6 +1540,10 @@ public override bool CanStackTo(Thing to)
{
return false;
}
if (base.c_altName != to.c_altName)
{
return false;
}
bool flag = false;
if (to.parent is Card)
{
TraitGeneMachine
@@ -106,7 +106,7 @@ public override bool OnUse(Chara c)
c.RemoveCondition<ConSleep>();
c.PlaySound("ride");
(c.AddCondition<ConSuspend>(100, force: true) as ConSuspend).uidMachine = owner.uid;
}, (Chara a) => "gene_note".lang(((a.c_genes != null) ? a.c_genes.items.Count : 0).ToString() ?? "", a.MaxGene.ToString() ?? "", a.feat.ToString() ?? "", a.GetTotalFeat() + " "));
}, (Chara a) => "gene_note".lang(a.CurrentGeneSlot.ToString() ?? "", a.MaxGeneSlot.ToString() ?? "", a.feat.ToString() ?? "", a.GetTotalFeat() + " "));
}
else if (GetProgress() >= 1f)
{
WidgetRoster
@@ -197,7 +197,7 @@ public override void OnSetContextMenu(UIContextMenu m)
extra.width = (int)a;
Build();
}, 30f, 160f, isInt: true);
uIContextMenu.AddSlider("margine", (float a) => a.ToString() ?? "", extra.margin, delegate(float a)
uIContextMenu.AddSlider("margin", (float a) => a.ToString() ?? "", extra.margin, delegate(float a)
{
extra.margin = (int)a;
Build();
WindowCharaMini
@@ -192,7 +192,7 @@ public void Refresh(int idTab)
}
note.SetActive(enable: true);
note.AddText("feat_pet".lang(chara.feat.ToString() ?? "", num.ToString() ?? ""));
note.AddText("feat_inferior".lang(((genes != null) ? genes.items.Count : 0).ToString() ?? "", chara.MaxGene.ToString() ?? "", ((genes != null) ? genes.inferior : 0).ToString() ?? ""));
note.AddText("feat_inferior".lang(chara.CurrentGeneSlot.ToString() ?? "", chara.MaxGeneSlot.ToString() ?? "", ((genes != null) ? genes.inferior : 0).ToString() ?? ""));
note.Space(8);
foreach (CharaUpgrade.Item item6 in upgrades.items)
{
Zone_Dungeon
@@ -74,10 +74,6 @@ public override float ShrineChance
public override bool IsSnowCovered => false;
public override bool GrowPlant => true;
public override bool GrowWeed => false;
public override bool CountDeepestLevel => true;
public override ZoneTransition.EnterState RegionEnterState => ZoneTransition.EnterState.Down;