EA 23.43 Hotfix1
25 files modified.
AM_Adv
@@ -368,7 +368,7 @@ public override void _OnUpdateInput()
if (AI_PlayMusic.keepPlaying)
{
Thing playingTool = AI_PlayMusic.playingTool;
if (EInput.IsAnyKeyDown(true) || (playingTool.GetRootCard() != EClass.pc && (!playingTool.ExistsOnMap || playingTool.Dist(EClass.pc) > 1)))
if (EInput.IsAnyKeyDown(true, true) || (playingTool.GetRootCard() != EClass.pc && (!playingTool.ExistsOnMap || playingTool.Dist(EClass.pc) > 1)))
{
AI_PlayMusic.CancelKeepPlaying();
return;
Ability.2
@@ -31,6 +31,10 @@ public override int GetPower(Card c)
if (!c.IsPC)
{
num = Mathf.Max(num, c.LV * 6 + 30);
if (c.IsPCFactionOrMinion && !base.source.aliasParent.IsEmpty())
{
num = Mathf.Max(num, c.Evalue(base.source.aliasParent) * 4 + 30);
}
}
num = EClass.curve(num, 400, 100, 75);
if (this is Spell)
ActEffect
@@ -280,6 +280,22 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po
}
}
Chara chara = CC.isChara ? CC.Chara : ((actref.refThing != null) ? EClass._map.FindChara(actref.refThing.c_uidRefCard) : null);
if (c.IsMultisize)
{
if (id <= EffectId.Meteor)
{
if (id - EffectId.Ball > 2 && id != EffectId.Meteor)
{
goto IL_BB5;
}
}
else if (id != EffectId.Earthquake && id != EffectId.Suicide)
{
goto IL_BB5;
}
num4 /= 2;
}
IL_BB5:
c.DamageHP(num4, e.id, power * num / 100, AttackSource.None, chara ?? CC, true);
if (id == EffectId.Explosive && CC.trait is TraitCookerMicrowave)
{
ActionMode
@@ -945,7 +945,7 @@ public void UpdateInput()
{
this.InputMovement();
}
if (!EClass.ui.canvas.enabled && EInput.IsAnyKeyDown(true))
if (!EClass.ui.canvas.enabled && EInput.IsAnyKeyDown(true, true))
{
EClass.ui.canvas.enabled = true;
EInput.Consume(false, 1);
ButtonAbility
@@ -194,7 +194,6 @@ public static bool SpecialHoldAction(Act act)
return;
}
EClass.pc.UseAbility(act.source.alias, t, EClass.pc.pos, false);
Debug.Log(t.IsIdentified.ToString() + "/" + ((t != null) ? t.ToString() : null));
int count = count;
count++;
first = false;
Card
@@ -1788,11 +1788,19 @@ public CardRow refCard
{
get
{
CardRow result;
if (!this.c_idRefCard.IsEmpty())
{
return EClass.sources.cards.map[this.c_idRefCard];
if ((result = EClass.sources.cards.map.TryGetValue(this.c_idRefCard, null)) == null)
{
return EClass.sources.cards.map["ash3"];
}
}
return null;
else
{
result = null;
}
return result;
}
}
@@ -1800,11 +1808,19 @@ public CardRow refCard2
{
get
{
CardRow result;
if (!this.c_idRefCard2.IsEmpty())
{
return EClass.sources.cards.map[this.c_idRefCard2];
if ((result = EClass.sources.cards.map.TryGetValue(this.c_idRefCard2, null)) == null)
{
return EClass.sources.cards.map["ash3"];
}
}
return null;
else
{
result = null;
}
return result;
}
}
@@ -5158,7 +5174,7 @@ public string TryGetFoodName(Card c)
{
return c.c_altName;
}
SourceChara.Row row = EClass.sources.cards.map[c.c_idRefCard] as SourceChara.Row;
SourceChara.Row row = c.refCard as SourceChara.Row;
if (row == null || !row.isChara)
{
return c.c_altName;
Chara
@@ -1430,6 +1430,7 @@ public Chara Duplicate()
chara.SetFaith(this.faith);
chara.bio = IO.DeepCopy<Biography>(this.bio);
chara.hp = Mathf.Max(0, (int)((float)chara.MaxHP * ((float)base.hp / (float)this.MaxHP) * 0.99f));
chara.LV = base.LV;
chara.isCopy = true;
if (base.HaveFur())
{
@@ -5017,7 +5018,7 @@ public override void Die(Element e = null, Card origin = null, AttackSource atta
}
}
}
else
else if (attackSource != AttackSource.DeathSentense)
{
EClass.player.flags.little_killed = true;
EClass.player.little_dead++;
ContentCodex
@@ -148,7 +148,10 @@ public void OnClickGetCard()
codexCreature.numCard = numCard - 1;
Thing thing = ThingGen.Create("figure3", -1, -1);
thing.MakeFigureFrom(this.currentCodex.id);
bool autoCollectCard = EClass.game.config.autoCollectCard;
EClass.game.config.autoCollectCard = false;
EClass.pc.Pick(thing, true, true);
EClass.game.config.autoCollectCard = autoCollectCard;
if (this.currentCodex.numCard == 0)
{
this.RefreshList();
Core
@@ -389,6 +389,7 @@ public void OnApplicationFocus(bool focus)
}
EInput.Consume(false, 1);
EInput.dragHack = 0f;
EInput.DisableIME();
}
}
CoreConfig
@@ -41,12 +41,12 @@ public CameraSupport camSupport
public static bool Exist()
{
return File.Exists(CoreConfig.path) && !EClass.debug.useNewConfig;
return File.Exists(CoreConfig.path) && (!EClass.debug.useNewConfig || !Application.isEditor);
}
public static CoreConfig TryLoadConfig()
{
if (!File.Exists(CoreConfig.path) || EClass.debug.useNewConfig)
if (!File.Exists(CoreConfig.path) || (EClass.debug.useNewConfig && Application.isEditor))
{
return null;
}
@@ -89,7 +89,7 @@ public static void Init()
Debug.Log("Creating new config.");
CoreConfig coreConfig = EClass.core.config = IO.DeepCopy<CoreConfig>(EClass.setting.config);
coreConfig.SetLang(EClass.core.langCode);
if (!EClass.debug.useNewConfig)
if (!Application.isEditor || !EClass.debug.useNewConfig)
{
coreConfig.Save();
}
DNA
@@ -140,7 +140,7 @@ public void Apply(Chara c, bool reverse)
}
else
{
c.SetFeat(num, c.elements.ValueWithoutLink(num) + (reverse ? -1 : 1), true);
c.SetFeat(num, c.elements.ValueWithoutLink(num) + (reverse ? -1 : 1), !reverse);
}
}
else
DramaEventEndRoll
@@ -34,7 +34,7 @@ public override bool Play()
}
if (this.list.dsv.contentAnchoredPosition <= -this.list.dsv.contentSize + this.list.dsv.viewportSize + 1f)
{
if ((!EInput.rightMouse.pressedLong || !Application.isEditor) && EInput.IsAnyKeyDown(true))
if ((!EInput.rightMouse.pressedLong || !Application.isEditor) && EInput.IsAnyKeyDown(true, true))
{
return true;
}
FactionBranch
@@ -1148,6 +1148,7 @@ public void ChangeMemberType(Chara c, FactionMemberType type)
{
c.ClearBed(null);
c.memberType = type;
this.RefreshEfficiency();
c.RefreshWorkElements(this.elements);
this.policies.Validate();
}
Feat.2
@@ -616,7 +616,7 @@ public List<string> Apply(int a, ElementContainer owner, bool hint = false)
if (row.category == "resist")
{
int num = 0;
@ref = ((a > 0) ? "+" : "-").Repeat(Mathf.Clamp(a / 5 + num, 1, 5));
@ref = ((a > 0) ? "+" : "-").Repeat(Mathf.Clamp(Mathf.Abs(a) / 5 + num, 1, 5));
this.<Apply>g__Note|17_0("modValueRes".lang(row.GetName(), @ref, null, null, null), ref A_3);
return;
}
Party
@@ -57,6 +57,7 @@ public void AddMemeber(Chara c)
if (c.homeBranch != null)
{
c.RefreshWorkElements(c.homeBranch.elements);
c.homeBranch.RefreshEfficiency();
c.homeBranch.policies.Validate();
if (c.homeBranch.owner.map != null)
{
@@ -76,6 +77,10 @@ public void RemoveMember(Chara c)
this.uidMembers.Remove(c.uid);
c.party = null;
c.SetDirtySpeed();
if (c.homeBranch != null)
{
c.homeBranch.RefreshEfficiency();
}
c.RefreshWorkElements(null);
WidgetRoster.SetDirty();
}
SerializedCards
@@ -246,7 +246,7 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu
else
{
PlaceState placeState = data.placeState.ToEnum<PlaceState>();
if (isUserZone && placeState != PlaceState.installed && !data.bits1.IsOn(13))
if (isUserZone && ((placeState != PlaceState.installed && !data.bits1.IsOn(13)) || text == "medal"))
{
continue;
}
SpatialManager
@@ -64,19 +64,23 @@ public List<Zone> ListReturnLocations()
{
if (EClass.debug.returnAnywhere)
{
return (from Zone a in
List<Zone> list = (from Zone a in
from a in this.map.Values
where a is Zone
select a
where a != EClass._zone && (a.IsReturnLocation || a.IsPCFaction || (!(a is Zone_Field) && !a.IsInstance && !a.isRandomSite)) && a.parent == EClass.world.region && !a.source.tag.Contains("closed")
select a).ToList<Zone>();
list.Sort((Zone a, Zone b) => a.GetSortVal() - b.GetSortVal());
return list;
}
return (from Zone a in
List<Zone> list2 = (from Zone a in
from a in this.map.Values
where a is Zone
select a
where a != EClass._zone && a.IsReturnLocation && a.GetTopZone().visitCount > 0 && (a.GetTopZone().FindDeepestZone() == a || EClass.pc.homeZone == a)
select a).ToList<Zone>();
list2.Sort((Zone a, Zone b) => a.GetSortVal() - b.GetSortVal());
return list2;
}
public List<Zone> Zones
Thing
@@ -557,14 +557,14 @@ public override string GetName(NameStyle style, int _num = -1)
}
if (!base.c_idRefCard.IsEmpty() && this.trait.RefCardName != RefCardName.None)
{
string text6 = base.c_altName.IsEmpty(EClass.sources.cards.map[base.c_idRefCard].GetName());
string text6 = base.c_altName.IsEmpty(base.refCard.GetName());
if (!base.c_idRefCard2.IsEmpty())
{
text6 = "_and".lang(text6, base.c_altName2.IsEmpty(EClass.sources.cards.map[base.c_idRefCard2].GetName()), null, null, null);
text6 = "_and".lang(text6, base.c_altName2.IsEmpty(base.refCard2.GetName()), null, null, null);
}
if (text6 == "*r")
{
string text7 = EClass.sources.cards.map[base.c_idRefCard].GetText("aka", false);
string text7 = base.refCard.GetText("aka", false);
if (!text7.IsEmpty())
{
text = "_of".lang(text7, text, null, null, null);
TraitAbility
@@ -46,7 +46,8 @@ public override void SetName(ref string s)
{
return;
}
s = EClass.sources.elements.alias[this.owner.c_idAbility].GetName();
SourceElement.Row row = EClass.sources.elements.alias.TryGetValue(this.owner.c_idAbility, null);
s = (((row != null) ? row.GetName() : null) ?? "???");
}
public override void SetMainText(UIText t, bool hotitem)
TraitBaseSpellbook
@@ -155,6 +155,7 @@ public override void OnRead(Chara c)
{
bool flag = this.BookType == TraitBaseSpellbook.Type.Spell || this.BookType == TraitBaseSpellbook.Type.RandomSpell;
int a = -1;
string name = this.owner.Name;
if (c.IsPCParty)
{
Thing thing = this.owner.Thing;
@@ -167,7 +168,7 @@ public override void OnRead(Chara c)
switch (this.BookType)
{
case TraitBaseSpellbook.Type.Ancient:
c.Say("book_decode", c, this.owner, null, null);
c.Say("book_decode", c, name, null);
if (!c.IsPC)
{
this.ModCharge(c, -this.owner.c_charges);
TraitDrinkMilkMother
@@ -26,8 +26,13 @@ public override void OnDrink(Chara c)
if (c.Evalue(1232) > 0)
{
c.SetFeat(1232, c.Evalue(1232) - 1, false);
int uidNext = EClass.game.cards.uidNext;
EClass.game.cards.uidNext = 1;
Rand.SetSeed(1);
Chara chara = CharaGen.Create(this.owner.c_idRefCard, -1);
chara.SetLv(Mathf.Clamp(5 + this.owner.encLV * 5, 1, 20 + EClass.pc.Evalue(237)));
Rand.SetSeed(-1);
EClass.game.cards.uidNext = uidNext;
Debug.Log(chara.id + "/" + chara.LV.ToString());
List<Element> list = chara.elements.ListBestAttributes();
List<Element> list2 = chara.elements.ListBestSkills();
TraitFigure
@@ -39,7 +39,7 @@ public override void OnSetCardGrid(ButtonGrid b)
{
return;
}
RenderRow renderRow = EClass.sources.charas.map[this.owner.c_idRefCard];
RenderRow renderRow = EClass.sources.charas.map.TryGetValue(this.owner.c_idRefCard, null) ?? EClass.sources.charas.map["putty"];
Transform transform = b.Attach<Transform>("figure", false);
renderRow.SetImage(transform.GetChild(0).GetComponent<Image>(), null, 0, false, 0, 0);
}
Zone
@@ -1964,13 +1964,33 @@ public void Deactivate()
list.Add(thing);
}
}
if (this is Zone_Tent)
{
foreach (Thing thing2 in this.map.props.stocked.Things.Concat(this.map.props.roaming.Things))
{
if (thing2.IsContainer)
{
foreach (Thing thing3 in thing2.things)
{
if (thing3.trait is TraitTent)
{
list.Add(thing3);
}
}
}
if (thing2.trait is TraitTent)
{
list.Add(thing2);
}
}
}
if (list.Count > 0)
{
Msg.Say("pick_valuable");
foreach (Thing thing2 in list)
foreach (Thing thing4 in list)
{
Msg.Say("pick_valuable2", thing2, null, null, null);
EClass.pc.AddCard(thing2);
Msg.Say("pick_valuable2", thing4, null, null, null);
EClass.pc.AddCard(thing4);
}
}
}
@@ -3277,6 +3297,19 @@ public void OnInspect()
{
}
public int GetSortVal()
{
if (this.IsPCFaction)
{
return -100000 + base.uid;
}
if (this is Zone_Civilized)
{
return -90000 + base.uid;
}
return base.uid;
}
public Chara AddRandomVisitor(bool guest = false)
{
Trait random = this.map.Installed.traits.GetTraitSet<TraitSpotExit>().GetRandom();
@@ -3401,7 +3434,7 @@ public void RainWater()
public void GrowPlants(VirtualDate date)
{
Zone.<>c__DisplayClass301_0 CS$<>8__locals1 = new Zone.<>c__DisplayClass301_0();
Zone.<>c__DisplayClass302_0 CS$<>8__locals1 = new Zone.<>c__DisplayClass302_0();
CS$<>8__locals1.date = date;
CS$<>8__locals1.<>4__this = this;
bool flag = EClass.player.isAutoFarming = (this.IsPCFaction && EClass.Branch.policies.IsActive(2707, -1));
@@ -3645,7 +3678,7 @@ public void SpawnLostItems()
{
for (int i = 0; i < 2 + EClass.rnd(4); i++)
{
Point point = Zone.<SpawnLostItems>g__GetPos|311_0();
Point point = Zone.<SpawnLostItems>g__GetPos|312_0();
if (point != null)
{
if (EClass.rnd(30) == 0)
@@ -3794,7 +3827,7 @@ public void ApplyBackerPet(bool draw)
}
[CompilerGenerated]
internal static Point <SpawnLostItems>g__GetPos|311_0()
internal static Point <SpawnLostItems>g__GetPos|312_0()
{
for (int i = 0; i < 10; i++)
{
ZonePreEnterOnCompleteQuestInstance
@@ -14,24 +14,29 @@ public override void Execute()
Chara chara = EClass._map.FindChara(this.uidClient);
if (chara == null)
{
string[] array = new string[7];
array[0] = this.uidClient.ToString();
array[1] = "/";
array[2] = this.uidQuest.ToString();
array[3] = "/";
array[4] = this.fail.ToString();
array[5] = "/";
int num = 6;
Quest quest2 = quest;
array[num] = ((quest2 != null) ? quest2.ToString() : null);
Debug.Log(string.Concat(array));
string str = "exception: quest not found:";
Chara chara2 = chara;
string str2 = (chara2 != null) ? chara2.ToString() : null;
string str3 = "/";
Quest quest3 = (chara != null) ? chara.quest : null;
Debug.LogError(str + str2 + str3 + ((quest3 != null) ? quest3.ToString() : null));
return;
chara = EClass._map.deadCharas.Find((Chara c) => c.uid == this.uidClient);
if (chara == null)
{
string[] array = new string[7];
array[0] = this.uidClient.ToString();
array[1] = "/";
array[2] = this.uidQuest.ToString();
array[3] = "/";
array[4] = this.fail.ToString();
array[5] = "/";
int num = 6;
Quest quest2 = quest;
array[num] = ((quest2 != null) ? quest2.ToString() : null);
Debug.Log(string.Concat(array));
string str = "exception: quest not found:";
Chara chara2 = chara;
string str2 = (chara2 != null) ? chara2.ToString() : null;
string str3 = "/";
Quest quest3 = (chara != null) ? chara.quest : null;
Debug.LogError(str + str2 + str3 + ((quest3 != null) ? quest3.ToString() : null));
return;
}
chara.Revive(null, false);
}
if (chara.quest == null)
{