EA 23.176 Nightly Patch 1
August 7, 2025
39 files modified. 4 new files created.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
ElementContainer (1)
public void ModExp(int ele, int a, bool chain = false)
public void ModExp(int ele, float a, bool chain = false)
LayerEditSkin (1)
public void RefreshImage()
public void RefreshImage(SpriteData data = null)
ABILITY
public class ABILITY
{
public const int ActPick = 5047;
public const int ActInstall = 5046;
public const int AI_Drink = 5045;
public const int ActInstall = 5046;
public const int ActPick = 5047;
public const int ActItem = 5048;
public const int ActLulwyTrick = 6902;
public const int ActKizuamiTrick = 6903;
public const int ActGazeMutation = 6622;
public const int ActKizuamiTrick = 6903;
public const int ActSwarm = 6662;
public const int ActSteal = 6640;
public static readonly int[] IDS = new int[124]
{
5047, 5045, 5046, 5048, 5049, 5050, 5051, 5052, 5053, 5054,
5046, 5045, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054,
5055, 6001, 6003, 6011, 6012, 5044, 6013, 6018, 6019, 6020,
6050, 6400, 6410, 6420, 6450, 6500, 6601, 6602, 6603, 6604,
6610, 6015, 6611, 5043, 5041, 5011, 5012, 5013, 5014, 5015,
5006, 5007, 5008, 5009, 5010, 50215, 50200, 50211, 6904, 6631,
6630, 6627, 6626, 6641, 6621, 6623, 6642, 6650, 6660, 7000,
6661, 6663, 6664, 6700, 6720, 6750, 6751, 6900, 6901, 6902,
6903, 6622, 6662, 6640
6622, 6903, 6662, 6640
};
}
public class Ability : Act
AI_Fuck
public override IEnumerable<Status> Run()
case FuckType.tame:
{
int num = 100;
if (!tc.race.IsAnimal)
if (!tc.IsAnimal)
{
num += 50;
}
if (tc.race.IsHuman)
if (tc.IsHuman)
{
num += 50;
}
public override IEnumerable<Status> Run()
num3 = -5 + ((!tc.IsPCFaction) ? Mathf.Clamp(num2 / 10, -30, 0) : 0);
fails++;
}
int a = 20;
int num4 = 20;
if (tc.IsPCFactionOrMinion && tc.affinity.CurrentStage >= Affinity.Stage.Love)
{
num3 = ((EClass.rnd(3) == 0) ? 4 : 0);
a = 10;
num4 = 10;
}
totalAffinity += num3;
tc.ModAffinity(EClass.pc, num3, show: true, showOnlyEmo: true);
cc.elements.ModExp(237, a);
cc.elements.ModExp(237, num4);
if (EClass.rnd(4) == 0)
{
cc.stamina.Mod(-1);
AI_PlayMusic
public override IEnumerable<Status> Run()
item2.Say("musicBad", item2, owner);
}
item2.ShowEmo(Emo.sad);
owner.elements.ModExp(241, 10);
owner.elements.ModExp(241, 10f);
if (EClass.rnd(5) == 0)
{
ThrowReward(item2, punish: true);
AI_Slaughter
public override IEnumerable<Status> Run()
}
if (owner != null)
{
owner.elements.ModExp(290, 200);
owner.elements.ModExp(290, 200f);
}
if (!EClass.pc.isDead)
{
AI_Steal
public override IEnumerable<Status> Run()
target.isStolen = true;
}
owner.Pick(target.Thing);
owner.elements.ModExp(281, 50);
owner.elements.ModExp(281, 50f);
if (EClass.rnd(2) == 0)
{
EClass.pc.stamina.Mod(-1);
AttackProcess
public bool Perform(int count, bool hasHit, float dmgMulti = 1f, bool maxRoll =
int bane;
if (TC?.Chara != null)
{
SourceRace.Row race = TC.Chara.race;
bane = 0;
AddBane(valid: true, 468, 50);
AddBane(race.IsUndead, 461, 100);
AddBane(race.IsAnimal, 463, 100);
AddBane(race.IsHuman, 464, 100);
AddBane(race.IsDragon, 460, 100);
AddBane(race.IsGod, 466, 100);
AddBane(race.IsMachine, 465, 100);
AddBane(race.IsFish, 467, 100);
AddBane(race.IsFairy, 462, 100);
AddBane(TC.Chara.IsUndead, 461, 100);
AddBane(TC.Chara.IsAnimal, 463, 100);
AddBane(TC.Chara.IsHuman, 464, 100);
AddBane(TC.Chara.IsDragon, 460, 100);
AddBane(TC.Chara.IsGod, 466, 100);
AddBane(TC.Chara.IsMachine, 465, 100);
AddBane(TC.Chara.IsFish, 467, 100);
AddBane(TC.Chara.IsFairy, 462, 100);
if (bane != 0)
{
num = num * (100 + bane * 3) / 100;
BaseListPeople
public override void OnClick(Chara c, ItemGeneral i)
}
list.Refresh();
SE.Click();
WidgetRoster.SetDirty();
});
}
else
public override void OnClick(Chara c, ItemGeneral i)
c.renderer.OnEnterScreen();
}
list.Refresh();
WidgetRoster.SetDirty();
});
}
}
CTAG
noRandomEnc,
noMix,
bigFish,
noSkinRecipe
noSkinRecipe,
animal,
human,
undead,
machine,
horror,
fish,
fairy,
god,
dragon,
plant
}
Card
public const int MaxWeight = 10000000;
public const int SocketDiv = 1000;
[JsonProperty(PropertyName = "A")]
public int[] _ints = new int[30];
private void _OnSerializing(StreamingContext context)
_ints[0] = _bits1.ToInt();
_ints[2] = _bits2.ToInt();
_placeState = placeState;
version = 1;
version = 2;
OnSerializing();
}
protected virtual void OnSerializing()
[OnDeserialized]
private void _OnDeserialized(StreamingContext context)
{
if (version < 2)
{
if (sockets != null)
{
for (int i = 0; i < sockets.Count; i++)
{
sockets[i] = sockets[i] / 100 * 1000 + sockets[i] % 100;
}
}
version = 2;
}
_bits1.SetInt(_ints[0]);
_bits2.SetInt(_ints[2]);
placeState = _placeState;
public void ApplySocket(int id, int lv, Card mod = null)
{
if (sockets[i] == 0)
{
if (lv >= 100)
if (lv >= 1000)
{
lv = 99;
lv = 999;
}
sockets[i] = id * 100 + lv;
sockets[i] = id * 1000 + lv;
elements.ModBase(id, lv);
mod?.Destroy();
break;
if (num != 0)
{
Thing thing = ThingGen.Create(isCopy ? "ash3" : "mod_ranged");
int ele = num / 100;
int num2 = num % 100;
int ele = num / 1000;
int num2 = num % 1000;
elements.ModBase(ele, -num2);
if (!isCopy)
{
public void SpawnLoot(Card origin)
bool isUserZone = EClass._zone.IsUserZone;
bool flag = EClass._zone is Zone_Music;
List<Card> list = new List<Card>();
SourceRace.Row race = Chara.race;
if (!IsPCFaction && !isUserZone && sourceCard.idActor.IsEmpty())
{
int i2 = 500;
public void SpawnLoot(Card origin)
}
bool flag2 = Chara.race.corpse[1].ToInt() > EClass.rnd(1500) || (Chara.IsPowerful && !IsPCFaction) || EClass.debug.godFood;
int num = 1;
if (!IsMinion && Chara.race.IsAnimal && EClass.rnd(EClass._zone.IsPCFaction ? 3 : 5) == 0)
if (!IsMinion && Chara.IsAnimal && EClass.rnd(EClass._zone.IsPCFaction ? 3 : 5) == 0)
{
flag2 = true;
}
public void SpawnLoot(Card origin)
if (!flag2 && Chara.race.corpse[1].ToInt() > EClass.rnd(150000 / (100 + (int)Mathf.Sqrt(origin.Evalue(290)) * 5)))
{
flag2 = true;
origin.elements.ModExp(290, 100);
origin.elements.ModExp(290, 100f);
}
else
{
origin.elements.ModExp(290, 5);
origin.elements.ModExp(290, 5f);
}
}
if (id == "littleOne" && IsPCFactionOrMinion)
public void SpawnLoot(Card origin)
list.Add(ThingGen.Create(array[0]).SetNum((num4 < 1000) ? 1 : (num4 / 1000 + ((EClass.rnd(1000) > num4 % 1000) ? 1 : 0))));
}
}
if (race.IsMachine)
if (Chara.IsMachine)
{
if (chance(20))
{
public void SpawnLoot(Card origin)
}
else
{
if (race.IsAnimal)
if (Chara.IsAnimal)
{
if (chance(15))
{
public Card MakeFoodFrom(Card c)
}
if (flag2)
{
if (race.IsHuman)
if (c.Chara.IsHuman)
{
elements.SetBase(708, 1);
}
if (race.IsUndead)
if (c.Chara.IsUndead)
{
elements.SetBase(709, 1);
}
public Card MakeFoodFrom(Card c)
Tuple<int, int> tuple = list[i];
elements.SetBase(tuple.Item1, tuple.Item2 * tuple.Item2 / 4);
}
if (race.IsUndead)
if (c.Chara.IsUndead)
{
elements.ModBase(73, -20);
}
public virtual int GetPrice(CurrencyType currency = CurrencyType.Money, bool sel
return 500;
case "whip_egg":
return 3000;
case "hammer_strip":
return 5000;
case "helm_chef":
return 40000;
}
Chara
public override SourcePref Pref
{
if (spriteReplacer != null)
{
return EClass.core.refs.prefs.replacer1;
return spriteReplacer.data?.pref ?? EClass.core.refs.prefs.replacer1;
}
if (base.idSkin > 0)
{
public bool IsInCombat => ai is GoalCombat;
public bool IsAnimal
{
get
{
if (!race.IsAnimal)
{
return HasTag(CTAG.animal);
}
return true;
}
}
public bool IsHuman
{
get
{
if (!race.IsHuman)
{
return HasTag(CTAG.human);
}
return true;
}
}
public bool IsUndead
{
get
{
if (!race.IsUndead)
{
return HasTag(CTAG.undead);
}
return true;
}
}
public bool IsMachine
{
get
{
if (!race.IsMachine)
{
return HasTag(CTAG.machine);
}
return true;
}
}
public bool IsHorror
{
get
{
if (!race.IsHorror)
{
return HasTag(CTAG.horror);
}
return true;
}
}
public bool IsFish
{
get
{
if (!race.IsFish)
{
return HasTag(CTAG.fish);
}
return true;
}
}
public bool IsFairy
{
get
{
if (!race.IsFairy)
{
return HasTag(CTAG.fairy);
}
return true;
}
}
public bool IsGod
{
get
{
if (!race.IsGod)
{
return HasTag(CTAG.god);
}
return true;
}
}
public bool IsDragon
{
get
{
if (!race.IsDragon)
{
return HasTag(CTAG.dragon);
}
return true;
}
}
public bool IsPlant
{
get
{
if (!race.IsPlant)
{
return HasTag(CTAG.plant);
}
return true;
}
}
public int DestDist => tactics.DestDist;
public bool HasNoGoal => ai.IsNoGoal;
{
get
{
if (!race.IsHuman && !race.IsFairy && !race.IsGod)
if (!IsHuman && !IsFairy && !IsGod)
{
return race.id == "mutant";
}
}
}
public bool IsHuman => race.tag.Contains("human");
public bool IsHumanSpeak
{
get
if (EClass.rnd(25) == 0 && base.hp < MaxHP)
{
HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
elements.ModExp(300, 8);
elements.ModExp(300, 8f);
}
if (EClass.rnd(8) == 0 && mana.value < mana.max)
{
mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
elements.ModExp(301, 8);
elements.ModExp(301, 8f);
}
if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
{
public void ApplyDeathPenalty()
{
if (EClass.rnd(5) == 0 && value.IsMainAttribute)
{
EClass.pc.elements.ModExp(value.id, -500);
EClass.pc.elements.ModExp(value.id, -500f);
}
}
}
public override void Die(Element e = null, Card origin = null, AttackSource atta
EClass.player.stats.allyDeath++;
}
}
if (id == "mandrake")
if (id == "mandrake" || HasElement(488))
{
Say("a_scream", this);
ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
public void GiveGift(Chara c, Thing t)
{
Msg.Say("affinityNone", c, this);
t.Destroy();
elements.ModExp(291, 10);
elements.ModExp(291, 10f);
return;
}
elements.ModExp(291, 50);
elements.ModExp(291, 50f);
}
if (t.id == "statue_weird")
{
CharaRenderer
public override void SetOwner(Card c)
SpriteReplacer spriteReplacer = SpriteReplacer.dictSkins.TryGetValue(owner.c_idSpriteReplacer);
if (spriteReplacer != null)
{
data = ResourceCache.Load<RenderData>("Scene/Render/Data/chara_custom");
data = ResourceCache.Load<RenderData>("Scene/Render/Data/chara_custom_" + ((spriteReplacer.data.GetSprite().texture.height <= 128) ? "128" : "256"));
owner.spriteReplacer = spriteReplacer;
}
}
Core
public void OnApplicationFocus(bool focus)
}
foreach (CardRow row in sources.cards.rows)
{
if (row.replacer.hasChacked && row.replacer.data != null)
if (row.replacer.isChecked && row.replacer.data != null)
{
row.replacer.data.GetSprite();
}
}
foreach (SpriteReplacer value in SpriteReplacer.dictSkins.Values)
{
value.data?.LoadPref();
}
WidgetRoster.SetDirty();
}
});
});
}
if (IsGameStarted && debug.enable)
{
foreach (PCC.Part value in pccs.allParts.Values)
foreach (PCC.Part value2 in pccs.allParts.Values)
{
foreach (ModItem<Texture2D> value2 in value.modTextures.Values)
foreach (ModItem<Texture2D> value3 in value2.modTextures.Values)
{
value2.ClearCache();
value3.ClearCache();
}
}
CharaActorPCC[] array = UnityEngine.Object.FindObjectsOfType<CharaActorPCC>();
CraftUtil
public static Card MixIngredients(Card product, List<Thing> ings, MixType type,
product.elements.SetTo(10, 1);
}
}
if (creative)
if (creative && isFood)
{
product.elements.SetBase(764, 1);
}
ELEMENT
AddFix(100, EClass.sources.elements.map[663].GetName());
}
}
if (!c.race.IsMachine && !(c.id == "android"))
if (!c.IsMachine && !(c.id == "android"))
{
return;
}
ENC
public const int r_DV = 650;
public const int r_mana = 641;
public const int mod_frustration = 624;
public const int mod_flurry = 621;
public const int mod_cleave = 622;
public const int mod_feint = 623;
public const int r_life = 640;
public const int noDamage = 654;
public const int r_mana = 641;
public const int r_life = 640;
public const int onlyPet = 655;
public const int convertFire = 850;
public const int mod_flurry = 621;
public const int mod_chaser = 620;
public const int convertImpact = 865;
public const int permaCurse = 656;
public const int mod_chaser = 620;
public const int mod_talisman = 609;
public const int negateFear = 423;
public const int mod_splash = 608;
public const int mod_scatter = 607;
public const int negateShockwave = 430;
public const int corruption = 409;
public const int mod_talisman = 609;
public const int mod_splash = 608;
public const int travelSpeed = 407;
public const int revealFaith = 481;
public const int mod_ammo = 600;
public const int deathagony = 488;
public const int mod_rapid = 602;
public const int mod_ammo_knockback = 603;
public const int mod_drill = 606;
public const int mod_scatter = 607;
public const int sustain_DEX = 442;
public const int mod_reload = 601;
public const int mod_ammo = 600;
public const int strongStomach = 480;
public const int mod_rapid = 602;
public const int mod_reload = 601;
public const int bane_fish = 467;
public const int sustain_LER = 444;
public static readonly int[] IDS = new int[90]
public static readonly int[] IDS = new int[91]
{
653, 652, 651, 650, 624, 622, 623, 640, 654, 641,
655, 851, 660, 661, 662, 663, 664, 665, 666, 850,
621, 865, 852, 656, 620, 423, 608, 430, 429, 428,
427, 426, 425, 424, 422, 421, 420, 419, 418, 417,
416, 415, 414, 412, 411, 410, 409, 609, 407, 406,
405, 404, 403, 402, 401, 400, 440, 441, 408, 443,
482, 483, 484, 485, 486, 487, 481, 600, 603, 604,
605, 606, 607, 442, 601, 480, 602, 467, 468, 445,
446, 447, 461, 462, 460, 463, 464, 465, 466, 444
653, 652, 651, 650, 641, 624, 621, 622, 623, 654,
640, 655, 851, 660, 661, 662, 663, 664, 665, 666,
850, 620, 865, 852, 656, 609, 423, 607, 430, 429,
428, 427, 426, 425, 424, 422, 421, 420, 419, 418,
417, 416, 415, 414, 412, 411, 410, 409, 608, 407,
406, 405, 404, 403, 402, 401, 400, 440, 441, 408,
443, 482, 483, 484, 485, 486, 487, 481, 488, 602,
603, 604, 605, 606, 442, 600, 480, 601, 467, 468,
445, 446, 447, 461, 462, 460, 463, 464, 465, 466,
444
};
}
ElementContainer
public void Train(int ele, int a = 10)
ModTempPotential(ele, a);
}
public void ModExp(int ele, int a, bool chain = false)
public void ModExp(int ele, float a, bool chain = false)
{
if ((Card != null && Card.isChara && Card.Chara.isDead) || a == 0)
if ((Card != null && Card.isChara && Card.Chara.isDead) || a == 0f)
{
return;
}
public void ModExp(int ele, int a, bool chain = false)
{
return;
}
if (!chain)
if (a > 0f)
{
if (a > 0 && Card != null && Card.isChara)
if (!chain && Card != null && Card.isChara)
{
a = a * Card.Chara.GetDaysTogetherBonus() / 100;
a = a * (float)Card.Chara.GetDaysTogetherBonus() / 100f;
}
if (element.source.parentFactor > 0f && Card != null && !element.source.aliasParent.IsEmpty())
if (element.UseExpMod)
{
Element element2 = element.GetParent(Card);
if (element2.CanGainExp)
a = a * (float)Mathf.Clamp(element.UsePotential ? element.Potential : 100, 10, 1000) / (float)(100 + Mathf.Max(0, element.ValueWithoutLink) * 25);
if (EClass.rndf(1f) < a % 1f + 0.1f)
{
ModExp(element2.id, (int)Math.Max(1f, (float)a * element.source.parentFactor / (float)(100 + Mathf.Max(0, element2.ValueWithoutLink * 5))), chain: true);
a += 1f;
}
}
}
if (element.UseExpMod && a >= 0)
{
int value = (element.UsePotential ? element.Potential : 100);
float num = (float)a * (float)Mathf.Clamp(value, 10, 1000) / (float)(100 + Mathf.Max(0, element.ValueWithoutLink) * 25);
a = (int)num;
if (EClass.rndf(1f) < num % 1f)
if (!chain && element.source.parentFactor > 0f && Card != null && !element.source.aliasParent.IsEmpty())
{
a++;
Element element2 = element.GetParent(Card);
if (element2.CanGainExp)
{
ModExp(element2.id, Mathf.Clamp(a * element.source.parentFactor / 100f, 1f, 1000f), chain: true);
}
}
}
element.vExp += a;
element.vExp += (int)a;
if (element.vExp >= element.ExpToNext)
{
int num2 = element.vExp - element.ExpToNext;
int num = element.vExp - element.ExpToNext;
int vBase = element.vBase;
ModBase(ele, 1);
OnLevelUp(element, vBase);
element.vExp = Mathf.Clamp(num2 / 2, 0, element.ExpToNext / 2);
element.vExp = Mathf.Clamp(num / 2, 0, element.ExpToNext / 2);
if (element.vTempPotential > 0)
{
element.vTempPotential -= element.vTempPotential / 4 + EClass.rnd(5) + 5;
ElementContainerCard
public override int ValueBonus(Element e)
num = num * 2 + (e.ValueWithoutLink + e.vLink);
}
}
if (e.id != 664 && (owner.Chara.race.IsMachine || owner.id == "android"))
if (e.id != 664 && (owner.Chara.IsMachine || owner.id == "android"))
{
int num4 = owner.Evalue(664);
if (num4 > 0)
FACTION
public bool HasMember(string id, bool includeReserve = true)
public bool IsWearingPanty(Chara c)
{
if ((!c.IsUnique || c.bio.gender != 2) && (c.race.IsHuman || c.race.IsFairy) && !(c.trait is TraitMerchant))
if ((!c.IsUnique || c.bio.gender != 2) && (c.IsHuman || c.IsFairy) && !(c.trait is TraitMerchant))
{
return true;
}
FoodEffect
public static void Proc(Chara c, Thing food)
}
c.Say("little_eat", c);
c.PlaySound("ding_potential");
c.elements.ModExp(306, -1000);
c.elements.ModExp(306, -1000f);
c.SetInt(117, int2 + 1);
break;
}
GoalCombat
public override IEnumerable<Status> Run()
{
tc.TrySetEnemy(owner);
}
if (!tc.IsMinion && EClass.rnd(10) == 0 && EClass.rnd(tc.DEX + 10) > owner.LV && tc.HasElement(1315) && !owner.HasElement(1315) && owner.race.IsMachine && owner.CanBeTempAlly(tc))
if (!tc.IsMinion && EClass.rnd(10) == 0 && EClass.rnd(tc.DEX + 10) > owner.LV && tc.HasElement(1315) && !owner.HasElement(1315) && owner.IsMachine && owner.CanBeTempAlly(tc))
{
owner.Say("dominate_machine", tc, owner);
owner.PlayEffect("boost");
public override IEnumerable<Status> Run()
owner.MakeMinion(tc.IsPCParty ? EClass.pc : tc);
yield return Success();
}
if (EClass.rnd(5) == 0 && tc.HasElement(1325) && owner.race.IsPlant && owner.CanBeTempAlly(tc))
if (EClass.rnd(5) == 0 && tc.HasElement(1325) && owner.IsPlant && owner.CanBeTempAlly(tc))
{
owner.Say("dominate_plant", tc, owner);
owner.ShowEmo(Emo.love);
LayerEditSkin
public class LayerEditSkin : ELayer
public UIDynamicList list;
public SpriteData currentData;
public void Activate(Chara _chara)
{
chara = _chara;
public void Activate(Chara _chara)
RefreshList();
}
public void RefreshImage()
public void RefreshImage(SpriteData data = null)
{
data?.LoadPref();
imageSkin.sprite = chara.GetSprite();
imageSkin.SetNativeSize();
if ((bool)WidgetRoster.Instance)
{
WidgetRoster.Instance.Build();
}
WidgetRoster.SetDirty();
currentData = data ?? chara.spriteReplacer?.data;
}
public void OnClickClear()
RefreshImage();
}
public void OnClickEdit()
{
if (currentData == null)
{
SE.Beep();
return;
}
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(currentData.path);
string text = CorePath.custom + "Skin/" + fileNameWithoutExtension + ".pref";
if (!File.Exists(text))
{
(currentData.pref ?? chara.Pref).WriteIni(text);
}
SE.Click();
Util.Run(text);
}
public void RefreshList()
{
list.Clear();
SE.Click();
chara.c_idSpriteReplacer = Path.GetFileName(a.path);
chara._CreateRenderer();
RefreshImage();
RefreshImage(a);
},
onRedraw = delegate(SpriteData a, UIButton b, int i)
{
b.mainText.SetText(Path.GetFileName(a.path));
a.Init();
b.icon.sprite = a.GetSprite();
b.icon.SetNativeSize();
b.tooltip.lang = a.path;
},
onList = delegate
};
list.List();
}
private void OnApplicationFocus(bool focus)
{
if (focus && currentData != null)
{
RefreshImage(currentData);
}
}
}
Map
int num = 0;
foreach (Chara chara in charas)
{
if (!chara.IsPCFaction && chara.race.IsAnimal)
if (!chara.IsPCFaction && chara.IsAnimal)
{
num++;
}
POLICY
public void SetOwner(FactionBranch _branch)
public void OnAdvanceHour(VirtualDate date)
{
EClass._zone.elements.ModExp(id, 10);
EClass._zone.elements.ModExp(id, 10f);
}
public void RefreshEffect(UINote note = null)
QuestDeliver
public class QuestDeliver : QuestDestZone
private static List<SourceCategory.Row> _listDeliver = new List<SourceCategory.Row>();
public virtual bool ConsumeGoods => true;
public virtual bool ConsumeGoods => false;
public SourceThing.Row sourceThing => EClass.sources.things.map[idThing.IsEmpty("generator_snowman")];
public override bool Deliver(Chara c, Thing t = null)
}
else
{
c.Pick(thing);
thing = c.Pick(thing);
if (c.CanEat(thing))
{
c.SetAIImmediate(new AI_Eat
{
target = thing
});
}
else
{
c.TryUse(thing);
}
}
EClass.game.quests.Complete(this);
c.quest = null;
QuestShowSupply
public class QuestShowSupply : QuestSupply
public class QuestShowSupply : QuestSupply
{
public override bool ConsumeGoods => false;
}
RecipeCard
public override void BuildIngredientList()
{
return;
}
if (EClass.pc.HasElement(487))
if (EClass.pc.HasElement(487) && !EClass.scene.actionMode.IsBuildMode)
{
ingredients[0].ingType = IngType.CreativeFood;
}
SourcePref
using System;
using System.IO;
using System.Text;
using IniParser;
using IniParser.Model;
using Newtonsoft.Json;
using UnityEngine;
Array.Resize(ref ints, 25);
}
}
public void WriteIni(string path)
{
FileIniDataParser fileIniDataParser = new FileIniDataParser();
if (File.Exists(path))
{
EClass.ui.Say("Ini file already exists.");
return;
}
File.CreateText(path).Close();
IniData iniData = fileIniDataParser.ReadFile(path, Encoding.UTF8);
iniData.Global["x"] = ints[4].ToString() ?? "";
iniData.Global["y"] = ints[5].ToString() ?? "";
iniData.Global["z"] = ints[2].ToString() ?? "";
iniData.Global["pivotX"] = pivotX.ToString() ?? "";
iniData.Global["pivotY"] = pivotY.ToString() ?? "";
iniData.Global["shadow"] = shadow.ToString() ?? "";
iniData.Global["shadowX"] = shadowX.ToString() ?? "";
iniData.Global["shadowY"] = shadowY.ToString() ?? "";
iniData.Global["height"] = ints[3].ToString() ?? "";
iniData.Global["scaleIcon"] = scaleIcon.ToString() ?? "";
iniData.Global["liquidMod"] = liquidMod.ToString() ?? "";
iniData.Global["hatY"] = ints[23].ToString() ?? "";
iniData.Global["flags"] = ints[1].ToString() ?? "";
fileIniDataParser.WriteFile(path, iniData);
}
public static SourcePref ReadFromIni(string path)
{
SourcePref sourcePref = new SourcePref();
IniData iniData = new FileIniDataParser().ReadFile(path, Encoding.UTF8);
sourcePref.ints[4] = iniData.Global["x"].ToInt();
sourcePref.ints[5] = iniData.Global["y"].ToInt();
sourcePref.ints[2] = iniData.Global["z"].ToInt();
sourcePref.pivotX = iniData.Global["pivotX"].ToInt();
sourcePref.pivotY = iniData.Global["pivotY"].ToInt();
sourcePref.shadow = iniData.Global["shadow"].ToInt();
sourcePref.shadowX = iniData.Global["shadowX"].ToInt();
sourcePref.shadowY = iniData.Global["shadowY"].ToInt();
sourcePref.ints[3] = iniData.Global["height"].ToInt();
sourcePref.scaleIcon = iniData.Global["scaleIcon"].ToInt();
sourcePref.liquidMod = iniData.Global["liquidMod"].ToInt();
sourcePref.ints[23] = iniData.Global["hatY"].ToInt();
sourcePref.ints[1] = iniData.Global["flags"].ToInt();
return sourcePref;
}
}
+SpriteData
File Created
using System;
using System.Globalization;
using System.IO;
using System.Text;
using IniParser;
using IniParser.Model;
using UnityEngine;
public class SpriteData
{
public DateTime date;
public Texture2D tex;
public Texture2D texSnow;
public string path;
public Sprite[] sprites;
public Sprite[] spritesSnow;
public SourcePref pref;
public int frame = 1;
public int scale = 50;
public float time = 0.2f;
public void Init()
{
try
{
if (File.Exists(path + ".ini"))
{
IniData iniData = new FileIniDataParser().ReadFile(path + ".ini", Encoding.UTF8);
frame = int.Parse(iniData.GetKey("frame") ?? "1");
scale = int.Parse(iniData.GetKey("scale") ?? "50");
time = float.Parse(iniData.GetKey("time") ?? "0.2", CultureInfo.InvariantCulture);
}
}
catch (Exception message)
{
Debug.Log(message);
Debug.Log("exception: Failed to parse:" + path + ".ini");
time = 0.2f;
scale = 50;
}
}
public Sprite[] GetSprites()
{
Validate();
return sprites;
}
public void LoadPref()
{
pref = null;
if (File.Exists(path + ".pref"))
{
pref = SourcePref.ReadFromIni(path + ".pref");
}
}
public Sprite GetSprite(bool snow = false)
{
Validate();
if (!snow || spritesSnow == null)
{
return sprites[0];
}
return spritesSnow[0];
}
public void Validate()
{
DateTime lastWriteTime = File.GetLastWriteTime(path + ".png");
bool flag = date.Year != 1 && date == lastWriteTime;
if (!flag)
{
Load(flag, ref tex, ref sprites, "");
if (File.Exists(path + "_snow.png"))
{
Load(flag, ref texSnow, ref spritesSnow, "_snow");
}
date = lastWriteTime;
}
}
public void Load(bool dateMatched, ref Texture2D tex, ref Sprite[] sprites, string suffix)
{
if (dateMatched && (bool)tex)
{
return;
}
if ((bool)tex)
{
Texture2D texture2D = IO.LoadPNG(path + suffix + ".png");
if (texture2D.width != tex.width || texture2D.height != tex.height)
{
Debug.Log(texture2D.width + "/" + texture2D.height + "/" + path);
tex.Reinitialize(texture2D.width, texture2D.height);
}
tex.SetPixels32(texture2D.GetPixels32());
tex.Apply();
UnityEngine.Object.Destroy(texture2D);
}
else
{
tex = IO.LoadPNG(path + suffix + ".png");
int num = tex.width / frame;
int height = tex.height;
sprites = new Sprite[frame];
for (int i = 0; i < frame; i++)
{
sprites[i] = Sprite.Create(tex, new Rect(i * num, 0f, num, height), new Vector2(0.5f, 0.5f), 100f, 0u, SpriteMeshType.FullRect);
}
}
LoadPref();
}
}
+SpriteReplacer
File Created
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
public class SpriteReplacer
{
public static Dictionary<string, SpriteReplacer> dictSkins = new Dictionary<string, SpriteReplacer>();
public static Dictionary<string, string> dictModItems = new Dictionary<string, string>();
public bool isChecked;
public SpriteData data;
public static Dictionary<string, SpriteReplacer> ListSkins()
{
List<string> list = new List<string>();
foreach (KeyValuePair<string, SpriteReplacer> dictSkin in dictSkins)
{
if (!File.Exists(dictSkin.Value.data.path + ".png"))
{
list.Add(dictSkin.Key);
}
}
foreach (string item in list)
{
dictSkins.Remove(item);
}
FileInfo[] files = new DirectoryInfo(CorePath.custom + "Skin").GetFiles();
foreach (FileInfo fileInfo in files)
{
if (fileInfo.Extension == ".png")
{
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileInfo.FullName);
if (!dictSkins.ContainsKey(fileNameWithoutExtension))
{
SpriteReplacer spriteReplacer = new SpriteReplacer();
spriteReplacer.data = new SpriteData
{
path = fileInfo.GetFullFileNameWithoutExtension()
};
spriteReplacer.data.Init();
dictSkins.Add(fileNameWithoutExtension, spriteReplacer);
}
}
}
return dictSkins;
}
public bool HasSprite(string id)
{
if (!isChecked)
{
try
{
if (dictModItems.ContainsKey(id))
{
Debug.Log(id + ":" + dictModItems[id]);
data = new SpriteData
{
path = dictModItems[id]
};
data.Init();
}
else
{
string text = CorePath.packageCore + "Texture/Item/" + id;
if (File.Exists(text + ".png"))
{
data = new SpriteData
{
path = text
};
data.Init();
}
}
isChecked = true;
}
catch (Exception ex)
{
Debug.Log("Error during fetching spirte:" + ex);
}
}
return data != null;
}
}
+SpriteReplacerAnimation
File Created
using System;
using System.Collections.Generic;
using UnityEngine;
public class SpriteReplacerAnimation : MonoBehaviour
{
public enum Type
{
Default,
Boat
}
public static Dictionary<string, SpriteData> dict = new Dictionary<string, SpriteData>();
public Type type;
public string id;
public SpriteData data;
[NonSerialized]
public SpriteRenderer sr;
private int index;
private void Awake()
{
if (!id.IsEmpty())
{
SetData(id);
}
}
public void SetData(string id)
{
this.id = id;
string text = id.IsEmpty(base.name + "_anime");
string path = CorePath.packageCore + "Texture/Item/" + text;
data = dict.TryGetValue(text);
if (data == null)
{
data = new SpriteData
{
path = path
};
data.Init();
dict.Add(text, data);
}
sr = GetComponent<SpriteRenderer>();
sr.sprite = data.GetSprite();
if (type == Type.Default)
{
CancelInvoke();
InvokeRepeating("Refresh", 0f, data.time);
}
}
private void Refresh()
{
index++;
if (index >= data.frame)
{
index = 0;
}
sr.sprite = data.GetSprites()[index];
}
}
TaskChopWood
public override void OnCreateProgress(Progress_Custom p)
Thing thing = ThingGen.Create("plank", material.id).SetNum(1 + EClass.rnd(2));
CraftUtil.MixIngredients(thing, new List<Thing> { log }, CraftUtil.MixType.General, 999);
log.ModNum(-1);
owner.elements.ModExp(225, 30);
owner.elements.ModExp(225, 30f);
owner.stamina.Mod(-1);
EClass._map.TrySmoothPick(pos, thing, EClass.pc);
};
TaskCraft
public override void OnProgress()
{
Element orCreateElement = owner.elements.GetOrCreateElement(recipe.source.GetReqSkill());
owner.PlaySound(recipe.GetMainMaterial().GetSoundCraft(recipe.renderRow));
owner.elements.ModExp(orCreateElement.id, 20);
owner.elements.ModExp(orCreateElement.id, 20f);
}
public override IEnumerable<Status> Run()
public override void OnProgressComplete()
return;
}
recipe.Craft(blessed, i == 0);
owner.elements.ModExp(orCreateElement.id, 200);
owner.elements.ModExp(orCreateElement.id, 200f);
resources.Clear();
}
EClass.Sound.Play("craft");
TaskDig
public override void OnCreateProgress(Progress_Custom p)
owner.PlaySound(row.GetSoundImpact());
row.PlayHitEffect(pos);
row.AddBlood(pos);
owner.elements.ModExp(230, 5);
owner.elements.ModExp(230, 5f);
owner.renderer.NextFrame();
if (EClass._zone.IsCrime(owner, this))
{
TaskDrawWater
public override void OnCreateProgress(Progress_Custom p)
break;
}
pot.owner.ModCharge(1);
owner.elements.ModExp(286, 5);
owner.elements.ModExp(286, 5f);
if (EClass.rnd(3) == 0)
{
owner.stamina.Mod(-1);
TaskMine
public override void OnCreateProgress(Progress_Custom p)
pos.matBlock.PlayHitEffect(pos);
pos.matBlock.AddBlood(pos);
owner.renderer.NextFrame();
owner.elements.ModExp(220, 5);
owner.elements.ModExp(220, 5f);
if (EClass._zone.IsCrime(owner, this))
{
owner.pos.TryWitnessCrime(owner);
TaskPlow
public override void OnCreateProgress(Progress_Custom p)
{
pos.SetFloor(pos.matFloor.id, 4);
}
owner.elements.ModExp(286, 30);
owner.elements.ModExp(286, 30f);
if (owner.IsPC)
{
EClass.player.stats.plow++;
TaskPourWater
public override void OnCreateProgress(Progress_Custom p)
{
pot.owner.Dye(EClass.sources.materials.alias["void"]);
}
owner.elements.ModExp(286, 5);
owner.elements.ModExp(286, 5f);
if (EClass.rnd(3) == 0)
{
owner.stamina.Mod(-1);
Thing
public override void ApplyMaterial(bool remove = false)
for (int i = 0; i < sockets.Count; i++)
{
int num2 = sockets[i];
int num3 = num2 / 100;
int num3 = num2 / 1000;
if (num3 == 67 && dmgSet)
{
elements.ModBase(67, num2 % 100);
elements.ModBase(67, num2 % 1000);
}
if (num3 == 66 && hitSet)
{
elements.ModBase(66, num2 % 100);
elements.ModBase(66, num2 % 1000);
}
if (num3 == 65 && pvSet)
{
elements.ModBase(65, num2 % 100);
elements.ModBase(65, num2 % 1000);
}
}
}
public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns
{
foreach (int socket in sockets)
{
AddText((socket == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[socket / 100].GetName(), (socket % 100).ToString() ?? ""), FontColor.Gray);
AddText((socket == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[socket / 1000].GetName(), (socket % 1000).ToString() ?? ""), FontColor.Gray);
}
}
}
Trait
Add("ecomark", 5, 0);
Add("whip_egg", 1, 0);
Add("helm_chef", 1, 0);
Add("hammer_strip", 1, 0);
Add("1165", 1, 0);
Add("plat", 100, 0);
AddThing(ThingGen.CreateScroll(9160).SetNum(5));
TraitAltar
public override bool CanOffer(Card c)
{
return true;
}
if (base.CanOffer(c) && (EClass.pc.faith.GetOfferingValue(c as Thing) > 0 || c.id == "water"))
if (base.CanOffer(c) && (EClass.pc.faith.GetOfferingValue(c as Thing) > 0 || c.id == "water") && !c.isCopy)
{
return !c.isCopy;
return !c.HasElement(764);
}
return false;
}
TraitScrollStatic
public override void OnRead(Chara c)
n1 = N1,
refThing = owner.Thing
});
c.elements.ModExp(285, 50);
c.elements.ModExp(285, 50f);
}
}
+TraitToolHammerStrip
File Created
public class TraitToolHammerStrip : TraitTool
{
public override bool IsTool => true;
public override void TrySetHeldAct(ActPlan p)
{
p.pos.Things.ForEach(delegate(Thing t)
{
if (t.category.tag.Contains("enc") && t.encLV > 0)
{
p.TrySetAct("actHammerFurniture".lang(t.Name), delegate
{
Msg.Say("upgrade", t, owner.GetName(NameStyle.Full, 1));
SE.Play("build_area");
t.PlayEffect("buff");
t.SetEncLv(0);
return false;
});
}
});
}
}
Zone
public Chara SpawnMob(Point pos = null, SpawnSetting setting = null)
if (ScaleMonsterLevel)
{
num = ((dangerLv - 1) % 50 + 5) * 150 / 100;
if (num >= 20 && EClass.rnd(100) < num)
{
num = dangerLv;
}
}
CardRow cardRow = (setting.id.IsEmpty() ? spawnList.Select(num, setting.levelRange) : EClass.sources.cards.map[setting.id]);
int num2 = ((setting.fixedLv == -1) ? cardRow.LV : setting.fixedLv);