EA 23.72 Nightly Hotfix 1
January 2, 2025
19 files modified.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
ConStrife (1)
public void AddKill()
public void AddKill(Chara c)
BaseListPeople
@@ -380,6 +380,10 @@ public override void OnClick(Chara c, ItemGeneral i)
c.SetInt(36, EClass.world.date.GetRaw() + 14400);
}
EClass.Branch.ChangeMemberType(c, (c.memberType != FactionMemberType.Livestock) ? FactionMemberType.Livestock : FactionMemberType.Default);
foreach (ListOwner owner in layer.multi.owners)
{
owner.RefreshTab();
}
List();
SE.Click();
}
@@ -390,12 +394,14 @@ public override void OnClick(Chara c, ItemGeneral i)
{
SE.Beep();
Msg.Say("reserveLimit");
return;
}
else
SE.MoveZone();
EClass.Home.AddReserve(c);
list.List();
foreach (ListOwner owner2 in layer.multi.owners)
{
SE.MoveZone();
EClass.Home.AddReserve(c);
list.List();
owner2.RefreshTab();
}
});
}
Card
if (!isDestroyed)
{
Die(e, origin, attackSource);
if (EClass.pc.Evalue(1355) > 0 && (IsPCFactionOrMinion || (origin != null && origin.IsPCParty)))
{
ConStrife conStrife = (EClass.pc.AddCondition<ConStrife>() as ConStrife) ?? EClass.pc.GetCondition<ConStrife>();
if (conStrife != null && isChara)
{
conStrife.AddKill(Chara);
}
}
}
if (origin != null && origin.isChara)
{
SE.Pay();
}
}
if (origin.IsPCParty && EClass.pc.Evalue(1355) > 0)
{
((EClass.pc.AddCondition<ConStrife>() as ConStrife) ?? EClass.pc.GetCondition<ConStrife>())?.AddKill();
}
if (origin.GetInt(106) == 0)
{
origin.Chara.TalkTopic("kill");
@@ -4437,7 +4441,13 @@ public void SpawnLoot(Card origin)
if (flag2 && !isUserZone)
{
string text = Chara.race.corpse[0];
if (text == "_meat" && EClass.rnd(10) == 0)
bool num2 = text == "_meat";
int num3 = 10;
if (AI_Slaughter.slaughtering)
{
num3 += (int)Mathf.Min(Mathf.Sqrt(EClass.pc.Evalue(290)), 20f);
}
if (num2 && num3 > EClass.rnd(100))
{
text = "meat_marble";
}
@@ -4461,10 +4471,10 @@ public void SpawnLoot(Card origin)
foreach (string item2 in sourceCard.loot.Concat(Chara.race.loot).ToList())
{
string[] array = item2.Split('/');
int num2 = array[1].ToInt();
if (num2 >= 1000 || num2 > EClass.rnd(1000) || EClass.debug.godMode)
int num4 = array[1].ToInt();
if (num4 >= 1000 || num4 > EClass.rnd(1000) || EClass.debug.godMode)
{
list.Add(ThingGen.Create(array[0]).SetNum((num2 < 1000) ? 1 : (num2 / 1000 + ((EClass.rnd(1000) > num2 % 1000) ? 1 : 0))));
list.Add(ThingGen.Create(array[0]).SetNum((num4 < 1000) ? 1 : (num4 / 1000 + ((EClass.rnd(1000) > num4 % 1000) ? 1 : 0))));
}
}
if (race.IsMachine)
@@ -4502,19 +4512,19 @@ public void SpawnLoot(Card origin)
}
if (!isBackerContent && !flag)
{
int num3 = ((EClass._zone.Boss == this) ? 2 : ((this.rarity >= Rarity.Legendary) ? 1 : 0));
int num5 = ((EClass._zone.Boss == this) ? 2 : ((this.rarity >= Rarity.Legendary) ? 1 : 0));
if (EClass._zone is Zone_Void)
{
num3++;
num5++;
}
if (EClass.rnd(5) == 0)
{
num3++;
num5++;
}
string text2 = id;
if (text2 == "big_daddy" || text2 == "santa")
{
num3 += 2;
num5 += 2;
}
List<Thing> list2 = new List<Thing>();
foreach (Thing thing4 in things)
@@ -4543,33 +4553,33 @@ public void SpawnLoot(Card origin)
list.Add(thing4);
}
}
if (num3 > 0 && list2.Count > 0)
if (num5 > 0 && list2.Count > 0)
{
list2.Shuffle();
for (int j = 0; j < list2.Count && j < num3; j++)
for (int j = 0; j < list2.Count && j < num5; j++)
{
list.Add(list2[j]);
num3--;
num5--;
}
}
if (this.rarity >= Rarity.Legendary && !IsUnique && c_bossType != BossType.Evolved)
{
int num4 = 0;
int num6 = 0;
foreach (Card item3 in list)
{
if (item3.rarity >= Rarity.Legendary || item3.IsContainer)
{
num4++;
num6++;
}
}
if (num4 == 0)
if (num6 == 0)
{
int num5 = ((!(EClass._zone is Zone_Void)) ? 1 : 2);
if (num3 < num5)
int num7 = ((!(EClass._zone is Zone_Void)) ? 1 : 2);
if (num5 < num7)
{
num3 = num5;
num5 = num7;
}
for (int k = 0; k < num3; k++)
for (int k = 0; k < num5; k++)
{
Rand.SetSeed(uid + k);
if (EClass.rnd((EClass._zone.events.GetEvent<ZoneEventDefenseGame>() != null) ? 3 : 2) == 0)
ConStrife
@@ -19,12 +19,26 @@ public class ConStrife : BaseBuff
public int ExpToNext => (lv + 1) * (lv + 1);
public void AddKill()
public void AddKill(Chara c)
{
exp++;
if (exp >= ExpToNext)
if (c.IsPCFactionOrMinion)
{
exp = 0;
if (c.IsMinion)
{
exp += 2;
}
else
{
exp += 30;
}
}
else
{
exp++;
}
while (exp >= ExpToNext)
{
exp -= ExpToNext;
lv++;
}
SetTurn();
@@ -32,7 +46,7 @@ public void AddKill()
public Dice GetDice()
{
return new Dice(1, 1 + lv * 2);
return new Dice(1, 1 + Mathf.Min(lv, 10) * 2);
}
public void SetTurn()
CoreDebug
@@ -905,6 +905,7 @@ public void UpdateInput()
}
if (Input.GetKeyDown(KeyCode.F2))
{
EClass.pc.SetFeat(1355);
foreach (Chara chara in EClass._map.charas)
{
chara.ModAffinity(EClass.pc, -100 + EScriptable.rnd(200));
DNA
@@ -255,6 +255,7 @@ public void Generate(Type _type, Chara model = null)
{
type = _type;
cost = 0;
slot = 0;
vals.Clear();
Debug.Log(seed);
Rand.SetSeed(seed);
FactionBranch
@@ -55,7 +55,10 @@ public class Statistics : EClass
public int incomeShop;
[JsonProperty]
public bool luckyDay;
public bool luckyMonth;
[JsonProperty]
public bool luckyMonthDone;
[JsonProperty]
public GStability stability = new GStability
@@ -376,10 +379,14 @@ public void OnSimulateHour(VirtualDate date)
int num8 = 3 + lv + Evalue(2206) / 5 + Evalue(3702) * 2 + Evalue(2202) / 2;
num8 = num8 * (100 + Evalue(3702) * 20 + Evalue(2206)) / 100;
num8 = num8 * (100 + (int)Mathf.Sqrt(Evalue(2811)) * 3) / 100;
if (luckyMonth)
{
num8 = num8 * 2 + 5;
}
if (EClass._map.CountGuest() < num8)
{
Chara chara;
if (policies.IsActive(2822) && Mathf.Sqrt(Evalue(2822) / 2) + 5f >= (float)EClass.rnd(100))
if (luckyMonth || (policies.IsActive(2822) && Mathf.Sqrt(Evalue(2822) / 2) + 5f >= (float)EClass.rnd(100)))
{
chara = CharaGen.CreateWealthy(ContentLV);
EClass._zone.AddCard(chara, EClass._zone.GetSpawnPos(SpawnPosition.Random) ?? EClass._map.GetRandomSurface());
@@ -433,7 +440,10 @@ public void OnSimulateHour(VirtualDate date)
}
if (date.hour == 5)
{
DailyOutcome(date);
for (int j = 0; j < ((!luckyMonth) ? 1 : 2); j++)
{
DailyOutcome(date);
}
GenerateGarbage(date);
if (!date.IsRealTime)
{
@@ -454,7 +464,7 @@ public void OnSimulateHour(VirtualDate date)
{
foreach (Chara item2 in EClass._map.charas.Where((Chara c) => c.memberType == FactionMemberType.Guest).ToList())
{
for (int j = 0; j < 3; j++)
for (int k = 0; k < 3; k++)
{
AI_Shopping.TryShop(item2, realtime: false);
}
@@ -531,18 +541,31 @@ public void OnSimulateDay(VirtualDate date)
member2.c_isPrayed = false;
member2.c_isTrained = false;
}
luckyDay = (float)((EClass.pc.faith == EClass.game.religions.Luck) ? 50 : 10) + Mathf.Sqrt(Evalue(2118)) * 5f > (float)EClass.rnd(2000);
if (EClass.debug.enable)
if (date.day != 1)
{
luckyDay = true;
return;
}
if (luckyDay)
luckyMonth = false;
if (date.month == 1)
{
Log("lucky_day", EClass._zone.Name);
if (date.IsRealTime)
luckyMonthDone = false;
}
if (!luckyMonthDone)
{
bool flag = EClass.pc.faith == EClass.game.religions.Luck;
luckyMonth = (float)(flag ? 30 : 5) + Mathf.Sqrt(Evalue(2118)) * (float)(flag ? 4 : 2) > (float)EClass.rnd(720);
if (EClass.debug.enable)
{
luckyMonth = true;
}
if (luckyMonth)
{
Msg.Say("lucky_day", EClass._zone.Name);
Log("lucky_month", EClass._zone.Name);
Msg.Say("lucky_month", EClass._zone.Name);
Msg.Say("umi");
SE.Play("godbless");
EClass.world.SendPackage(ThingGen.Create("book_kumiromi"));
luckyMonthDone = true;
}
}
}
@@ -1499,7 +1522,7 @@ public int CountMembers(FactionMemberType type, bool onlyAlive = false)
int num = 0;
foreach (Chara member in members)
{
if (member.memberType == type && member.trait.IsCountAsResident && (!onlyAlive || !member.isDead))
if (member.memberType == type && (!onlyAlive || !member.isDead) && (type != 0 || member.trait.IsCountAsResident))
{
num++;
}
HomeResourceWorth
@@ -40,7 +40,7 @@ public int GetPrice(Thing t, bool top = false)
}
if (top && branch.policies.IsActive(2821))
{
num = num * (150 + (int)Mathf.Sqrt(branch.Evalue(2821)) * 5) / 100;
num = (int)((long)num * (long)(150 + (int)Mathf.Sqrt(branch.Evalue(2821)) * 5) / 100);
}
return num;
}
@@ -120,7 +120,8 @@ public List<Thing> ListHeirloom()
}
}
int num7 = branch.Evalue(3780) + branch.Evalue(3781) + branch.Evalue(3782) + branch.Evalue(3783) + branch.Evalue(3784);
branch.tourism = (int)((100 + num) * (100 + num7 * 15) / 100);
num = (100 + num) * (100 + num7 * 15) / 100;
branch.tourism = (int)num;
list2.Sort((Thing a, Thing b) => GetPrice(b) - GetPrice(a));
for (int i = 0; i < branch.NumHeirloom && i < list2.Count; i++)
{
LayerCraft
@@ -322,6 +322,15 @@ public void RefreshCategory(string cat, bool first = false)
{
Recipe o2 = Recipe.Create(item);
list.Add(o2);
if (item.row.skins != null && item.row.skins.Length != 0)
{
for (int j = 0; j < item.row.skins.Length; j++)
{
o2 = Recipe.Create(item);
o2.idSkin = j + 1;
list.Add(o2);
}
}
}
SourceCategory.Row row = item.row.Category.GetSecondRoot();
if (row.id != "lightsource" && row.IsChildOf("armor"))
LayerPeople
@@ -41,17 +41,14 @@ public override void OnInit()
{
multi.AddOwner(0, new ListPeople
{
textTab = "residents",
memberType = FactionMemberType.Default
});
multi.AddOwner(0, new ListPeople
{
textTab = "livestock",
memberType = FactionMemberType.Livestock
});
multi.AddOwner(0, new ListPeople
{
textTab = "guests",
memberType = FactionMemberType.Guest
});
langHint = "h_residents";
ListOwner
@@ -26,6 +26,8 @@ public class ListOwner : EClass
public WindowMenu menu;
public Window.Setting.Tab tab;
public string textTab;
public string textHeader;
@@ -92,6 +94,11 @@ public virtual void OnRefreshMenu()
window.menuRight.Clear();
}
public void RefreshTab()
{
tab.button.mainText.SetText(TextTab);
}
public void MoveToOther(object c)
{
list.RemoveDynamic(c);
ListPeople
public class ListPeople : BaseListPeople
{
public override string TextTab
{
get
{
if (textTab.IsEmpty())
{
FactionBranch factionBranch = EClass.Branch ?? EClass.pc.homeBranch;
switch (memberType)
{
case FactionMemberType.Default:
return "residents".lang() + " (" + factionBranch.CountMembers(FactionMemberType.Default) + "/" + factionBranch.MaxPopulation + ")";
case FactionMemberType.Livestock:
return "livestock".lang() + " (" + factionBranch.CountMembers(FactionMemberType.Livestock) + ")";
case FactionMemberType.Guest:
return "guests".lang() + " (" + factionBranch.CountGuests() + ")";
}
}
return textTab;
}
}
public override bool ShowCharaSheet => true;
public override bool ShowGoto => true;
Religion
@@ -362,7 +362,7 @@ public static void Reforge(string id, Point pos = null, bool first = true)
thing.c_idDeity = EClass.game.religions.Trickery.id;
break;
case "warmonger":
if (value.id == 423 || value.id == 463 || value.id == 460 || value.id == 464 || value.id == 465)
if (value.id == 468 || value.id == 423 || value.id == 463 || value.id == 460 || value.id == 464 || value.id == 465)
{
value.vExp = -1;
}
TraitBrewery
@@ -107,7 +107,7 @@ public override bool OnChildDecay(Card c, bool firstDecay)
c.c_priceAdd = thing.GetValue() * 125 / 100;
}
OnProduce(c);
owner.AddThing(c.Thing, tryStack: false);
owner.AddThing(c.Thing);
owner.GetRootCard().Say(idMsg, thing, c);
return false;
}
TraitDetector
@@ -69,6 +69,12 @@ public void Search()
{
EClass.pc.PlaySound("detect_" + ((num <= 1) ? "detected" : ((num < 5) ? "near" : ((num < 15) ? "medium" : ((num < 30) ? "far" : ((num < 50) ? "veryFar" : "superFar"))))));
interval = ((num <= 1) ? 1 : ((num < 5) ? 2 : ((num < 15) ? 4 : ((num < 30) ? 7 : 10))));
if (EClass.core.config.sound.volumeSFX < 0.1f)
{
WidgetMainText.ignoreStack = true;
Msg.Say("beep".lang());
WidgetMainText.ignoreStack = false;
}
}
owner.PlayAnime(AnimeID.HitObj);
}
UIInventory
@@ -675,6 +675,14 @@ public void RefreshMenu()
data.compress = a;
SE.ClickOk();
});
if (!con2.IsPC)
{
uIContextMenu5.AddToggle("toggleShiftToShowMenu", data.shiftToShowMenu, delegate(bool a)
{
data.shiftToShowMenu = a;
SE.ClickOk();
});
}
}
if (con2.IsPC)
{
UIMultiList
@@ -33,7 +33,7 @@ public void AddOwner(int i, ListOwner o)
o.main = i == 0;
if (!Double && addTab)
{
o.window.AddTab(o.TextTab);
o.tab = o.window.AddTab(o.TextTab);
}
o.OnCreate();
}
WidgetDate
@@ -117,9 +117,9 @@ public void _Refresh()
{
text += item2.TextWidgetDate;
}
if (EMono.Branch != null && EMono.Branch.luckyDay)
if (EMono.Branch != null && EMono.Branch.luckyMonth)
{
text = text + " " + "lucky_day".lang().TagColor(Msg.colors.colors["save"]);
text = text + " " + "lucky_month".lang().TagColor(Msg.colors.colors["save"]);
}
if (EMono.debug.enable)
{
WidgetMainText
@@ -18,6 +18,8 @@ public class Extra
public static MsgBox boxBk;
public static bool ignoreStack;
public MsgBox box;
private UIItem currentItem;
@@ -122,7 +124,7 @@ public void Append(string s, Color col, Point pos = null)
{
s += " ";
}
if (MsgBlock.lastBlock != null && MsgBlock.lastText == s)
if (MsgBlock.lastBlock != null && MsgBlock.lastText == s && !ignoreStack)
{
MsgBlock lastBlock = MsgBlock.lastBlock;
if (lastBlock.txt != null)
Zone
{
foreach (Card item2 in item.ListCards())
{
if (item2.IsContainer && !item2.trait.IsSpecialContainer)
if (item2.IsContainer && !(item2.trait is TraitDeliveryChest))
{
list.Add(item2.Thing);
}
@@ -2030,7 +2030,7 @@ Thing SearchDest()
{
thing = EClass.game.cards.container_shipping;
}
if ((!sharedOnly || thing.IsSharedContainer) && thing.c_lockLv <= 0 && (thing.things.Count < thing.things.MaxCapacity || thing.things.CanStack(t) != null))
if ((!sharedOnly || thing.IsSharedContainer) && thing.c_lockLv <= 0 && (thing.things.Count < thing.things.MaxCapacity || thing.things.CanStack(t) != t))
{
Window.SaveData windowSaveData = thing.GetWindowSaveData();
if (windowSaveData != null)