EA 23.75
January 11, 2025
31 files modified. 1 new file created.
Important Changes
None.
AI_PlayMusic
@@ -65,7 +65,7 @@ public override IEnumerable<Status> Run()
{
yield return DoGoto(tool.pos, tool.pos.IsBlocked ? 1 : 0);
}
if (owner.IsPCC && EClass.game.config.preference.keepPlayingMusic)
if (owner.IsPC && EClass.game.config.preference.keepPlayingMusic)
{
keepPlaying = true;
playingTool = tool;
ActEffect
@@ -534,7 +534,8 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po
}
chara2 = actRef.n1 switch
{
"yeek" => CharaGen.CreateFromFilter(SpawnListChara.Get("yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10),
"yeek" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_yeek", (SourceChara.Row r) => r.race == "yeek"), power / 10),
"orc" => CharaGen.CreateFromFilter(SpawnListChara.Get("summon_orc", (SourceChara.Row r) => r.race == "orc"), power / 10),
"pawn" => CharaGen.CreateFromFilter("c_pawn", power / 10),
"monster" => CharaGen.CreateFromFilter("c_dungeon", power / 10),
"animal" => CharaGen.CreateFromFilter("c_animal", power / 15),
ActMelee
@@ -153,7 +153,11 @@ public bool Attack(float dmgMulti = 1f, bool maxRoll = false)
{
if (!item.Equals(obj))
{
item.FirstChara?.IsHostile(Act.CC);
Chara firstChara = item.FirstChara;
if (firstChara != null && firstChara.IsHostile(Act.CC))
{
Attack(firstChara, item);
}
}
}
}
BackerContent
@@ -25,7 +25,7 @@ public static void GakiConvert(ref string text, string idLang = "zako")
{
text = idLang.lang().Split(',').RandomItem() + " (" + text + ")";
}
else if (idLang == "mokyu")
else if (idLang == "mokyu" || idLang == "babu")
{
text = idLang.lang().Split(',').RandomItem() + " " + text;
}
BaseListPeople
@@ -109,11 +109,11 @@ public override void OnInstantiate(Chara a, ItemGeneral b)
t.note.AddHeader("infoWork".lang((roomWork != null) ? roomWork.Name : "none".lang()));
foreach (Hobby item2 in a.ListWorks())
{
AddText(item2, "work");
AddText(item2, "work", a.source.works.Contains(item2.source.alias));
}
foreach (Hobby item3 in a.ListHobbies())
{
AddText(item3, "hobby");
AddText(item3, "hobby", a.source.hobbies.Contains(item3.source.alias));
}
t.note.Build();
_ = roomWork;
@@ -162,24 +162,29 @@ public override void OnInstantiate(Chara a, ItemGeneral b)
{
b.gameObject.AddComponent<CanvasGroup>().alpha = 0.6f;
}
void AddText(Hobby h, string lang)
void AddText(Hobby h, string lang, bool fix)
{
int efficiency = h.GetEfficiency(a);
string text = h.Name.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
string text = h.Name;
if (fix)
{
text += "*";
}
text = text.TagColor((efficiency == 0) ? FontColor.Warning : FontColor.Good);
string[] array = Lang.GetList("work_lv");
string text2 = array[Mathf.Clamp(efficiency / 50, (efficiency != 0) ? 1 : 0, array.Length - 1)];
P_2.t.note.AddTopic("TopicLeft", lang.lang(), text + " (" + text2 + ")");
P_3.t.note.AddTopic("TopicLeft", lang.lang(), text + " (" + text2 + ")");
if (!h.source.destTrait.IsEmpty())
{
bool flag2 = EClass._map.FindThing(Type.GetType("Trait" + h.source.destTrait + ", Elin"), a) != null;
List<CardRow> obj = EClass.sources.cards.rows.Where((CardRow t) => t.trait.Length != 0 && Type.GetType("Trait" + h.source.destTrait).IsAssignableFrom(Type.GetType("Trait" + t.trait[0]))).ToList();
obj.Sort((CardRow a, CardRow b) => a.LV - b.LV);
CardRow cardRow = obj[0];
P_2.t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag2 ? FontColor.Good : FontColor.Warning)));
P_3.t.note.AddText("NoteText_small", "・ " + "workDestTrait".lang(cardRow.GetName().ToTitleCase().TagColor(flag2 ? FontColor.Good : FontColor.Warning)));
}
if (efficiency == 0)
{
P_2.t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
P_3.t.note.AddText("NoteText_small", "・ " + "workNotActive".lang());
}
else
{
@@ -188,7 +193,7 @@ void AddText(Hobby h, string lang)
int num = Mathf.Max(1, h.source.things[i + 1].ToInt() * efficiency * a.homeBranch.GetProductBonus(a) / 100 / 1000);
string text3 = h.source.things[i];
string s = (text3.StartsWith("#") ? EClass.sources.categories.map[text3.Replace("#", "")].GetName() : EClass.sources.cards.map[h.source.things[i]].GetName());
P_2.t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
P_3.t.note.AddText("NoteText_small", "・ " + "work_produce".lang(s.ToTitleCase(), num.ToString() ?? ""));
}
if (!h.source.elements.IsEmpty())
{
@@ -197,7 +202,7 @@ void AddText(Hobby h, string lang)
SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
int num2 = h.source.elements[j + 1];
int num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? (num2 / 10) : Mathf.Max(0, num2 * h.GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000));
P_2.t.note.AddText("NoteText_small", "・ " + "workBonus_skill".lang(row.GetName().ToTitleCase(), ((num2 > 0) ? "+" : "") + num3) + ((row.id == 2115 || row.id == 2207) ? (" " + "fixedFactionSkill".lang()) : ""), (num2 >= 0) ? FontColor.Default : FontColor.Bad);
P_3.t.note.AddText("NoteText_small", "・ " + "workBonus_skill".lang(row.GetName().ToTitleCase(), ((num2 > 0) ? "+" : "") + num3) + ((row.id == 2115 || row.id == 2207) ? (" " + "fixedFactionSkill".lang()) : ""), (num2 >= 0) ? FontColor.Default : FontColor.Bad);
}
}
string[] array2 = h.source.GetDetail().SplitNewline();
@@ -205,11 +210,11 @@ void AddText(Hobby h, string lang)
{
if (!text4.IsEmpty())
{
P_2.t.note.AddText("NoteText_small", "・ " + text4);
P_3.t.note.AddText("NoteText_small", "・ " + text4);
}
}
}
P_2.t.note.Space(1);
P_3.t.note.Space(1);
}
}
Card
@@ -2397,6 +2397,11 @@ public int Evalue(int ele)
return elements.Value(ele);
}
public int EvalueMax(int ele, int min = 0)
{
return Mathf.Max(elements.Value(ele), min);
}
public int Evalue(string alias)
{
return elements.Value(EClass.sources.elements.alias[alias].id);
GameLang.refDrama1 = ref1;
GameLang.refDrama2 = ref2;
string text = GetTalkText(idTopic, stripPun: true);
string text2 = id;
if (!(text2 == "adv_gaki"))
if (HasElement(1232) && idTopic != "baby")
{
if (text2 == "corgon")
{
BackerContent.GakiConvert(ref text, "mokyu");
}
BackerContent.GakiConvert(ref text, "babu");
}
else
{
BackerContent.GakiConvert(ref text);
string text2 = id;
if (!(text2 == "adv_gaki"))
{
if (text2 == "corgon")
{
BackerContent.GakiConvert(ref text, "mokyu");
}
}
else
{
BackerContent.GakiConvert(ref text);
}
}
TalkRaw(text, ref1, ref2, forceSync);
}
return 20;
case "wrench_tent_elec":
return 3;
case "wrench_tent_soil":
return 3;
case "wrench_bed":
return 3;
case "wrench_storage":
CardRenderer
@@ -154,7 +154,7 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)
else
{
SubPassData.Current = owner.GetSubPassData();
SourcePref pref = owner.Pref;
SourcePref pref = GetPref();
RenderData renderData = data;
int prefIndex = owner.PrefIndex;
if (Player.seedHallucination != 0 && CanBeHallucinated())
@@ -233,33 +233,17 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)
pref = replacer.pref;
SubPassData.Current = SubPassData.Default;
}
int num2 = pref.shadow;
bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.race.visibleWithTelepathy);
if (isChara)
{
p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1));
if (owner.idSkin > 0)
{
switch (owner.sourceCard.tiles.TryGet(owner.idSkin))
{
case 2319:
num2 = 33;
p.x += 0.04f * (float)((!owner.flipX) ? 1 : (-1));
p.y += 0.08f;
break;
case 2320:
num2 = 7;
p.x += 0.08f * (float)((!owner.flipX) ? 1 : (-1));
p.y += 0.2f;
break;
}
}
}
p.y += pref.y;
if (drawShadow && num2 != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC))
int shadow = pref.shadow;
bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.race.visibleWithTelepathy);
if (drawShadow && shadow != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC))
{
bool flag3 = ((!isChara) ? (owner.dir % 2 == 1) : (owner.dir == 1 || owner.dir == 2));
EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - RenderObject.altitudeFix * (float)owner.altitude, position.z + renderData.offsetShadow.z, ShadowData.Instance.items[num2], pref, prefIndex, p.snow);
EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - RenderObject.altitudeFix * (float)owner.altitude, position.z + renderData.offsetShadow.z, ShadowData.Instance.items[shadow], pref, prefIndex, p.snow);
}
if (usePass)
{
@@ -330,9 +314,9 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)
{
RenderObject.tempV = position;
RenderObject.tempV.y += data.offset.y + data.size.y;
for (int num3 = listTC.Count - 1; num3 >= 0; num3--)
for (int num2 = listTC.Count - 1; num2 >= 0; num2--)
{
listTC[num3].OnDraw(ref RenderObject.tempV);
listTC[num2].OnDraw(ref RenderObject.tempV);
}
}
if (owner.trait.RenderExtra)
@@ -368,6 +352,21 @@ public virtual void DrawHeld()
{
}
public SourcePref GetPref()
{
if (isChara && owner.idSkin > 0)
{
switch (owner.sourceCard.tiles.TryGet(owner.idSkin))
{
case 2319:
return EClass.core.refs.prefs.sonwputit1;
case 2320:
return EClass.core.refs.prefs.snowputit2;
}
}
return owner.Pref;
}
public void RefreshSprite()
{
if (hasActor)
Chara
num2 += 20;
num *= 1.8f;
}
num2 = num2 * 100 / (100 + Evalue(240) + Evalue(407) * 5);
num2 = num2 * 100 / (100 + EvalueMax(240, -20) + EvalueMax(407, -5) * 5);
EClass.world.date.AdvanceMin(num2 * 6);
EClass.player.lastZonePos = null;
EClass.player.distanceTravel++;
{
text = cell.matObj.soundFoot;
}
if (IsPC)
{
foreach (Thing thing2 in newPoint.Things)
{
if (thing2.IsInstalled && (thing2.trait.CanChangeHeight || thing2.Pref.Surface))
{
text = thing2.material.soundFoot;
}
}
}
if (!text.IsEmpty())
{
SoundManager.altLastData = IsPC;
}
if (cell.hasDoor)
{
foreach (Thing thing2 in newPoint.Things)
foreach (Thing thing3 in newPoint.Things)
{
if (thing2.trait is TraitDoor traitDoor2)
if (thing3.trait is TraitDoor traitDoor2)
{
traitDoor2.TryOpen(this);
}
@@ -6510,7 +6520,7 @@ public void TryTakeSharedItems(bool msg = true)
public void TryTakeSharedItems(IEnumerable<Thing> containers, bool msg = true, bool shouldEat = true)
{
if (base.isSummon)
if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
{
return;
}
c.ModAffinity(EClass.pc, a, show);
return;
}
if (c.IsPC)
{
a = affinity.Mod(a);
}
int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase());
if (IsPCFaction && homeBranch != null)
{
{
a = a * num / 100;
}
if (c.IsPC)
{
a = affinity.Mod(a);
}
if (!show)
{
return;
@@ -8566,7 +8576,7 @@ public void ResistCon(Condition con)
{
if (con.power > 0 && resistCon != null)
{
int a = resistCon.TryGetValue(con.id, 0);
int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
if (1000 < EClass.rnd(a))
{
con.power = 0;
CharaRenderer
@@ -299,10 +299,10 @@ public void DrawHat()
if (pccData == null || !owner.IsDeadOrSleeping)
{
CardRow cardRow = Zone.sourceHat ?? owner.hat;
SourcePref pref = cardRow.pref;
SourcePref pref = GetPref();
bool flag = currentDir == 1 || currentDir == 3;
int liquidLv = RenderObject.currentParam.liquidLv;
float num = ((replacer != null) ? replacer.pref.hatY : owner.Pref.hatY);
float num = ((replacer != null) ? replacer.pref.hatY : pref.hatY);
if (pccData != null)
{
num += RenderObject.renderSetting.hatPos[actor.GetFrame()].y;
CoreRef
@@ -288,6 +288,14 @@ public class DefaultRoof
public int idRamp;
}
[Serializable]
public class PrefData
{
public SourcePref sonwputit1;
public SourcePref snowputit2;
}
public Biomes biomes;
public Crawlers crawlers;
@@ -362,6 +370,8 @@ public class DefaultRoof
public UD_Int_String dictSketches;
public PrefData prefs;
public float testColor;
public float testColor2;
DramaActor
@@ -46,17 +46,24 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno
text = GameLang.ConvertDrama(text, owner.chara);
if (chara != null)
{
string text2 = chara.id;
if (!(text2 == "adv_gaki"))
if (chara.HasElement(1232))
{
if (text2 == "corgon")
{
BackerContent.GakiConvert(ref text, "mokyu");
}
BackerContent.GakiConvert(ref text, "babu");
}
else
{
BackerContent.GakiConvert(ref text);
string text2 = chara.id;
if (!(text2 == "adv_gaki"))
{
if (text2 == "corgon")
{
BackerContent.GakiConvert(ref text, "mokyu");
}
}
else
{
BackerContent.GakiConvert(ref text);
}
}
}
text = text.Replace("((", "(").Replace("))", ")").Replace("((", "(")
DropdownGrid
@@ -116,7 +116,7 @@ public void BuildIngredients(Recipe _recipe, Image _icon, Action _onValueChange,
if (uid != 0)
{
Thing thing = EMono.pc.things.Find((Thing t) => t.uid == uid) ?? EMono._map.Stocked.Find(uid);
if (thing != null && (!(thing.parent is Card card) || card.GetWindowSaveData() == null || !card.GetWindowSaveData().excludeCraft))
if (thing != null && ingredient.IsValidIngredient(thing) && (!(thing.parent is Card card) || card.GetWindowSaveData() == null || !card.GetWindowSaveData().excludeCraft))
{
ingredient.SetThing(thing);
flag = true;
FactionBranch
@@ -1219,6 +1219,10 @@ public void ValidateUpgradePolicies()
{
policies.AddPolicy(2709);
}
if (!policies.HasPolicy(2715))
{
policies.AddPolicy(2715);
}
}
foreach (int globalPolicy in EClass.pc.faction.globalPolicies)
{
LayerInventory
@@ -149,7 +149,11 @@ public static void TryShowGuide(UIList list)
public static void TryShowGuide(List<ButtonGrid> list)
{
bool flag = InvOwner.HasTrader && InvOwner.Trader.UseGuide;
bool flag2 = (bool)WidgetSearch.Instance && WidgetSearch.selected != null;
if (flag)
{
WidgetSearch.selected = null;
}
bool flag2 = (bool)WidgetSearch.Instance && WidgetSearch.selected != null && !ELayer.ui.IsDragging;
if (!flag2 && WidgetEquip.dragEquip == null && LayerAbility.hotElement == null && !flag)
{
return;
POLICY
@@ -5,7 +5,7 @@ public class POLICY
{
public const int store_ripoff = 2816;
public const int forcePanty = 2712;
public const int livestock_priv = 2715;
public const int home_discount = 2800;
@@ -33,7 +33,7 @@ public class POLICY
public const int celeb = 2822;
public const int incomeTransfer = 2711;
public const int forcePanty = 2712;
public const int license_stolen = 2824;
@@ -47,14 +47,14 @@ public class POLICY
public const int license_food = 2818;
public const int noMother = 2710;
public const int inquisition = 2507;
public const int incomeTransfer = 2711;
public const int noDM = 2708;
public const int nocturnal_life = 2508;
public const int noAnimal = 2709;
public const int noMother = 2710;
public const int prohibition = 2503;
public const int food_for_people = 2502;
@@ -67,7 +67,7 @@ public class POLICY
public const int human_right = 2506;
public const int nocturnal_life = 2508;
public const int wealth_tax = 2500;
public const int vaccination = 2509;
@@ -77,39 +77,42 @@ public class POLICY
public const int resident_tax = 2512;
public const int wealth_tax = 2500;
public const int inquisition = 2507;
public const int taxfree = 2514;
public const int resident_wanted = 2513;
public const int auto_farm = 2707;
public const int demon_invocation = 2706;
public const int taxTransfer = 2705;
public const int weed_no = 2703;
public const int trash_no = 2702;
public const int border_watch = 2704;
public const int trash_sort = 2701;
public const int energy_conservation = 2700;
public const int speed_growth = 2516;
public const int stop_growth = 2515;
public const int trash_sort = 2701;
public const int trash_no = 2702;
public const int auto_farm = 2707;
public const int noDM = 2708;
public static readonly int[] IDS = new int[50]
public static readonly int[] IDS = new int[51]
{
2816, 2712, 2800, 2810, 2811, 2812, 2813, 2814, 2815, 2817,
2823, 2819, 2820, 2821, 2822, 2711, 2824, 2825, 2826, 2827,
2828, 2818, 2710, 2507, 2708, 2709, 2503, 2502, 2501, 2504,
2505, 2506, 2508, 2509, 2510, 2511, 2512, 2500, 2514, 2513,
2706, 2705, 2703, 2702, 2704, 2700, 2516, 2515, 2701, 2707
2816, 2715, 2800, 2810, 2811, 2812, 2813, 2814, 2815, 2817,
2823, 2819, 2820, 2821, 2822, 2712, 2824, 2825, 2826, 2827,
2828, 2818, 2711, 2508, 2709, 2710, 2503, 2502, 2501, 2504,
2505, 2506, 2500, 2509, 2510, 2511, 2512, 2507, 2514, 2513,
2707, 2706, 2705, 2703, 2704, 2701, 2700, 2516, 2515, 2702,
2708
};
}
public class Policy : EClass
Recipe
@@ -122,6 +122,37 @@ static string CatName(string id)
return EClass.sources.categories.map[id].GetName();
}
}
public bool IsValidIngredient(Thing t)
{
if (useCat)
{
if (t.category.IsChildOf(id))
{
return true;
}
foreach (string item in idOther)
{
if (t.category.IsChildOf(item))
{
return true;
}
}
return false;
}
if (t.id == id || t.source._origin == id)
{
return true;
}
foreach (string item2 in idOther)
{
if (t.id == id || t.source._origin == item2)
{
return true;
}
}
return false;
}
}
public static Dictionary<string, Recipe> recipeCache = new Dictionary<string, Recipe>();
RecipeManager
@@ -243,9 +243,11 @@ public bool CanCeomUpWithRecipe(string idRecipe)
return false;
}
int id = recipeSource.GetReqSkill().id;
_ = EClass.pc.Evalue(id) + 5;
_ = recipeSource.row.LV;
return false;
if (EClass.pc.Evalue(id) + 5 < recipeSource.row.LV)
{
return false;
}
return true;
}
public void ComeUpWithRecipe(string idRecipe, int chanceForRandomRecipe = 0)
SKILL
@@ -2,16 +2,16 @@ public class SKILL
{
public const int tactics = 132;
public const int armorHeavy = 122;
public const int shield = 123;
public const int twowield = 131;
public const int twohand = 130;
public const int shield = 123;
public const int fireproof = 50;
public const int armorLight = 120;
public const int weaponBlunt = 111;
public const int weaponScythe = 110;
@@ -20,11 +20,11 @@ public class SKILL
public const int marksman = 133;
public const int armorLight = 120;
public const int armorHeavy = 122;
public const int eyeofmind = 134;
public const int riding = 226;
public const int parasite = 227;
public const int evasion = 150;
@@ -40,10 +40,10 @@ public class SKILL
public const int digging = 230;
public const int parasite = 227;
public const int acidproof = 51;
public const int riding = 226;
public const int lumberjack = 225;
public const int mining = 220;
@@ -62,7 +62,7 @@ public class SKILL
public const int PDR = 55;
public const int weaponAxe = 102;
public const int weaponSword = 101;
public const int evasionPerfect = 57;
@@ -112,7 +112,7 @@ public class SKILL
public const int martial = 100;
public const int weaponSword = 101;
public const int weaponAxe = 102;
public const int weaponStaff = 103;
@@ -264,12 +264,12 @@ public class SKILL
public static readonly int[] IDS = new int[131]
{
132, 122, 131, 130, 123, 50, 111, 110, 109, 133,
120, 134, 226, 150, 242, 241, 240, 237, 235, 230,
227, 51, 225, 220, 210, 207, 200, 152, 151, 135,
55, 102, 57, 245, 61, 62, 64, 65, 66, 67,
132, 123, 131, 130, 50, 120, 111, 110, 109, 133,
122, 134, 227, 150, 242, 241, 240, 237, 235, 230,
51, 226, 225, 220, 210, 207, 200, 152, 151, 135,
55, 101, 57, 245, 61, 62, 64, 65, 66, 67,
68, 70, 71, 72, 73, 74, 75, 56, 76, 78,
79, 80, 90, 91, 92, 100, 101, 103, 104, 105,
79, 80, 90, 91, 92, 100, 102, 103, 104, 105,
106, 107, 60, 77, 250, 108, 256, 916, 917, 918,
919, 920, 921, 922, 923, 924, 925, 950, 951, 952,
953, 954, 955, 956, 957, 958, 959, 960, 961, 962,
SerializedCards
@@ -617,7 +617,7 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu
continue;
}
}
if (isUserZone && dictionary.TryGetValue(index, 0) >= 3)
if (isUserZone && ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)dictionary, index, 0) >= 3)
{
continue;
}
}
if (isUserZone)
{
dictionary[index] = dictionary.TryGetValue(index, 0) + 1;
dictionary[index] = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)dictionary, index, 0) + 1;
}
}
else
{
PlaceState placeState = card4.placeState.ToEnum<PlaceState>();
if (isUserZone && ((dictionary2.TryGetValue(index, 0) >= 20 && text != "waystone" && text != "core_zone") || (placeState != PlaceState.installed && !card4.bits1.IsOn(13)) || text == "medal"))
if (isUserZone && ((ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)dictionary2, index, 0) >= 20 && text != "waystone" && text != "core_zone") || (placeState != PlaceState.installed && !card4.bits1.IsOn(13)) || text == "medal"))
{
continue;
}
@@ -668,7 +668,7 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu
card2.c_lightColor = card4.lightColor;
if (isUserZone)
{
dictionary2[index] = dictionary2.TryGetValue(index, 0) + 1;
dictionary2[index] = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)dictionary2, index, 0) + 1;
}
}
if (num < 0)
card2.refVal = card4.refVal;
card2.idSkin = card4.idSkin;
card2.c_idDeity = card4.idDeity;
if (isUserZone && (card2.isHidden || card2.isMasked) && ((card2.TileType.IsBlockPass && card2.IsInstalled) || card2.trait is TraitCoreZone || card2.trait is TraitWaystone))
{
Card card3 = card2;
bool isHidden = (card2.isMasked = false);
card3.isHidden = isHidden;
}
if (card4.idBacker != 0)
{
Debug.Log(card4.idBacker);
Debug.LogWarning("Could not convert editor tag:" + card2.Name + "/" + card4.tags);
}
}
if (isUserZone && card2.IsContainer && card4.isEmpty)
if (isUserZone)
{
card2.things.DestroyAll();
if ((card2.isHidden || card2.isMasked) && ((card2.TileType.IsBlockPass && card2.IsInstalled) || card2.trait is TraitCoreZone || card2.trait is TraitWaystone))
{
Card card3 = card2;
bool isHidden = (card2.isMasked = false);
card3.isHidden = isHidden;
}
if (card2.IsContainer && card4.isEmpty)
{
card2.things.DestroyAll();
}
}
if (card2.isChara)
{
SourceThingV
@@ -231,6 +231,9 @@ public override void OnAfterImportData()
array2[4].ToInt()
});
break;
case "skin":
row.skins = new int[1] { array2[1].ToInt() };
break;
case "alt":
row.altTiles = new int[1] { array2[1].ToInt() };
row.ignoreAltFix = true;
StatsHygiene
@@ -12,7 +12,7 @@ public class StatsHygiene : Stats
public const int Garbage = 0;
public static int[] listMod = new int[6] { 10, 50, 80, 100, 110, 120 };
public static int[] listMod = new int[6] { 10, 50, 80, 100, 110, 115 };
public override int max => 100;
StatsMana
@@ -34,7 +34,7 @@ public override void Mod(int a)
{
return;
}
int num = -value * 400 / (100 + BaseStats.CC.Evalue(303) * 10);
int num = -value * 400 / (100 + BaseStats.CC.EvalueMax(303, -5) * 10);
if (BaseStats.CC.HasElement(1201))
{
num /= 3;
Trait
@@ -1721,6 +1721,7 @@ public void OnBarter()
Add("container_magic", 1, 0).ChangeMaterial("iron").idSkin = 1;
Add("container_magic", 1, 0).ChangeMaterial("bamboo").idSkin = 2;
Add("wrench_tent_elec", 1, 0);
Add("wrench_tent_soil", 1, 0);
Add("wrench_bed", 1, 0).SetNum(20);
Add("wrench_storage", 1, 0).SetNum(10);
Add("wrench_fridge", 1, 0).SetNum(1);
TraitBaseSpellbook
@@ -275,7 +275,7 @@ public override void SetName(ref string s)
string c_idRefName = owner.c_idRefName;
if (!c_idRefName.IsEmpty())
{
string @ref = ((BookType == Type.Dojin) ? EClass.game.religions.dictAll[c_idRefName].Name : EClass.sources.charas.map[c_idRefName].GetName());
string @ref = ((BookType == Type.Dojin) ? EClass.game.religions.dictAll[c_idRefName].Name : EClass.sources.charas.map.TryGetValue(c_idRefName, "putty").GetName());
s = "_'s".lang(@ref, s);
}
break;
TraitCanvas
@@ -17,4 +17,18 @@ public override void OnSetCardGrid(ButtonGrid b)
b.Attach<Image>("canvas", rightAttach: false).sprite = paintSprite;
}
}
public override void TrySetAct(ActPlan p)
{
if (EClass._zone.IsUserZone && owner.Num == 1 && owner.c_textureData != null && owner.IsInstalled)
{
p.TrySetAct("actTakeOut", delegate
{
owner.noSell = true;
owner.isNPCProperty = false;
EClass.pc.PickOrDrop(owner.pos, owner.Thing);
return true;
}, owner);
}
}
}
TraitDrawingPaper
@@ -8,6 +8,7 @@ public class TraitDrawingPaper : TraitCanvas
public override void TrySetAct(ActPlan p)
{
base.TrySetAct(p);
if (p.altAction)
{
p.TrySetAct("actPaint", delegate
TraitFoodEggFertilized
@@ -25,12 +25,8 @@ public static Chara Incubate(Thing egg, Point pos, Card incubator = null)
EClass._zone.AddCard(chara, pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? EClass.pc.pos);
chara.SetLv(1);
chara.SetMainElement(egg.c_idMainElement, 10, elemental: true);
chara.SetFeat(1232, (incubator != null) ? 3 : 2, msg: true);
chara.things.DestroyAll();
if (chara.id == "putty_snow" && chara.idSkin == 0)
{
chara.idSkin = 4 + EClass.rnd(2);
}
MakeBaby(chara, (incubator == null) ? 2 : 3);
if (chara.Evalue(1644) > 0)
{
for (int i = 0; i < chara.Evalue(1644); i++)
@@ -65,6 +61,15 @@ public static Chara Incubate(Thing egg, Point pos, Card incubator = null)
return chara;
}
public static void MakeBaby(Chara c, int baby)
{
c.SetFeat(1232, baby, msg: true);
if (c.id == "putty_snow" && c.idSkin == 0)
{
c.idSkin = 4 + EClass.rnd(2);
}
}
public override bool CanStackTo(Thing to)
{
if (to.c_idMainElement != owner.c_idMainElement)
+TraitFoodPreparedPackage
File Created
public class TraitFoodPreparedPackage : TraitFood
{
public override string LangUse => "actContainer";
public override bool CanEat(Chara c)
{
return owner.idSkin == 1;
}
public override bool CanUse(Chara c)
{
if (EClass._zone.IsUserZone && owner.isNPCProperty)
{
return false;
}
return owner.idSkin == 0;
}
public override bool OnUse(Chara c)
{
SE.Play("open");
c.Say("openDoor", c, owner);
owner.idSkin = 1;
LayerInventory.SetDirty(owner.Thing);
return true;
}
}
TraitWrench
@@ -12,6 +12,19 @@ public bool IsValidTarget(Thing t)
}
switch (ID)
{
case "tent_soil":
{
if (!(t.trait is TraitTent))
{
return false;
}
Zone zone = (t.trait as TraitTent).zone;
if (zone == null)
{
return false;
}
return zone.Evalue(2200) < 10;
}
case "tent_elec":
if (t.trait is TraitTent)
{
@@ -46,6 +59,9 @@ public bool Upgrade(Thing t)
case "tent_elec":
(t.trait as TraitTent).zone.elements.ModBase(2201, 2);
break;
case "tent_soil":
(t.trait as TraitTent).zone.elements.ModBase(2200, 5);
break;
case "bed":
t.c_containerSize++;
if (EClass.debug.enable)
WindowChara
@@ -481,7 +481,7 @@ public void RefreshInfo()
textMom.text = chara.bio.nameMom.ToTitleCase();
textDad.text = chara.bio.nameDad.ToTitleCase();
textBirthplace.text = chara.bio.nameBirthplace.ToTitleCase();
textLike.text = EClass.sources.cards.map[bio.idLike].GetName();
textLike.text = EClass.sources.cards.map.TryGetValue(bio.idLike, EClass.sources.cards.map["ash"]).GetName();
textHobby.text = EClass.sources.elements.map[bio.idHobby].GetText();
textFaction.text = ((chara.faction == null) ? "???" : chara.faction.name.ToTitleCase());
textFaith.text = chara.faith.Name.ToTitleCase();
ZonePreEnterEncounter
@@ -29,6 +29,10 @@ public override void Execute()
chara.hostility = hostility2;
chara.enemy = EClass.pc.party.members.RandomItem();
leader = chara;
if (EClass.rnd(5) == 0)
{
TraitFoodEggFertilized.MakeBaby(chara, 1);
}
list.Add(chara);
}
}
Zone_Tent
@@ -8,7 +8,7 @@ public class Zone_Tent : Zone
public override bool GrowPlant => true;
public override int MaxSoil => 50;
public override int MaxSoil => 50 + Evalue(2200) * 5;
public override ZoneTransition.EnterState RegionEnterState => ZoneTransition.EnterState.Bottom;