EA 23.53 Nightly
December 9, 2024
17 files modified.
Important Changes
Possible breaking changes. Click the filename to view the chunk.
ActRide (2)
public static void Ride(Chara host, Chara t, bool parasite = false)
public static void Ride(Chara host, Chara t, bool parasite = false, bool talk = true)
public static void Unride(Chara host, bool parasite = false)
public static void Unride(Chara host, bool parasite = false, bool talk = true)
ActRide
@@ -44,7 +44,7 @@ public override bool Perform()
return false;
}
public static void Ride(Chara host, Chara t, bool parasite = false)
public static void Ride(Chara host, Chara t, bool parasite = false, bool talk = true)
{
if (parasite)
{
@@ -86,8 +86,11 @@ public static void Ride(Chara host, Chara t, bool parasite = false)
}
t.host = host;
t._CreateRenderer();
host.PlaySound("ride");
t.Talk(parasite ? "parasite" : "ride");
if (talk)
{
host.PlaySound("ride");
t.Talk(parasite ? "parasite" : "ride");
}
host.SetDirtySpeed();
t.SetDirtySpeed();
host.SyncRide();
@@ -95,7 +98,7 @@ public static void Ride(Chara host, Chara t, bool parasite = false)
host.Refresh();
}
public static void Unride(Chara host, bool parasite = false)
public static void Unride(Chara host, bool parasite = false, bool talk = true)
{
Chara chara = null;
if (parasite)
@@ -112,10 +115,15 @@ public static void Unride(Chara host, bool parasite = false)
}
chara.host = null;
chara._CreateRenderer();
chara.Talk(parasite ? "parasite_unride" : "ride_unride", null, null, forceSync: true);
if (talk)
{
chara.Talk(parasite ? "parasite_unride" : "ride_unride", null, null, forceSync: true);
}
host.PlaySound("ride");
host.SetDirtySpeed();
chara.SetDirtySpeed();
host.Refresh();
Point randomNeighbor = host.pos.GetRandomNeighbor();
chara.MoveImmediate(randomNeighbor);
}
}
Card
@@ -22,6 +22,8 @@ public enum MoveType
Force
}
public const int MaxWeight = 10000000;
[JsonProperty(PropertyName = "A")]
public int[] _ints = new int[30];
@@ -64,6 +66,8 @@ public enum MoveType
public float angle = 180f;
public float animeCounter;
public bool isDestroyed;
public CardBlueprint bp;
@@ -1828,9 +1832,9 @@ public int ChildrenWeight
{
Chara.CalcBurden();
}
if (_childrenWeight < 0 || _childrenWeight >= 10000000)
if (_childrenWeight < 0 || _childrenWeight > 10000000)
{
_childrenWeight = 9999999;
_childrenWeight = 10000000;
}
}
}
CardActor
@@ -247,7 +247,7 @@ public virtual void RefreshSprite()
Sprite sprite2 = (sr.sprite = owner.GetSprite(dir));
Sprite sprite4 = (spriteRenderer.sprite = sprite2);
Sprite sprite5 = sprite4;
sr.flipX = (dir == 1 || dir == 3) && (owner.Thing == null || !owner.Thing.isEquipped);
sr.flipX = dir == 1 || dir == 3;
mpb.SetTexture("_MainTex", sprite5.texture);
Vector4 value = new Vector4(sprite5.textureRect.min.x / (float)sprite5.texture.width, sprite5.textureRect.min.y / (float)sprite5.texture.height, sprite5.textureRect.max.x / (float)sprite5.texture.width, sprite5.textureRect.max.y / (float)sprite5.texture.height);
mpb.SetVector("_Rect", value);
Chara
@@ -2875,10 +2875,7 @@ public void MoveZone(Zone z, ZoneTransition transition)
EClass.player.nextZone = z;
if (IsInActiveZone && !EClass.player.simulatingZone)
{
if (held != null && held.trait.CanOnlyCarry)
{
DropHeld();
}
TryDropCarryOnly();
if (z.instance == null && currentZone.instance == null && !EClass.player.deathZoneMove && !EClass.pc.isDead && (z.IsPCFaction || z.WillAutoSave) && z.GetTopZone() != EClass._zone.GetTopZone())
{
if (EClass.player.returnInfo != null)
@@ -3292,9 +3289,16 @@ public void TickConditions()
}
if (IsPC)
{
if (phase2 >= 5 && !(ai is AI_Eat) && EClass.rnd(5) == 0)
if (phase2 >= 5)
{
DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
{
DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
}
if (!isDead && EClass.rnd(3) == 0)
{
stamina.Mod(-1);
}
}
if (isDead)
{
@@ -4013,6 +4017,18 @@ public Card SplitHeld(int a)
return held.Split(a);
}
public void TryDropCarryOnly()
{
if (held != null && held.trait.CanOnlyCarry)
{
DropHeld();
}
foreach (Thing item in EClass.pc.things.List((Thing t) => t.trait.CanOnlyCarry))
{
DropThing(item);
}
}
public Card DropHeld(Point dropPos = null)
{
if (held == null)
@@ -4055,6 +4071,10 @@ public void DropThing(Thing t, int num = -1)
t.ignoreAutoPick = true;
PlaySound("drop");
EClass._zone.AddCard(t, pos);
if (t.trait.CanOnlyCarry)
{
t.Install();
}
}
public AttackStyle GetFavAttackStyle()
Msg.SetColor();
SpawnLoot(origin);
}
if (held != null && held.trait.CanOnlyCarry)
{
DropHeld();
}
TryDropCarryOnly();
}
if (IsPCFaction)
{
@@ -5540,7 +5557,7 @@ public void CallHelp(Chara tg, bool fanatic = false)
public bool FindNewEnemy()
{
if (EClass._zone.isPeace && base.IsPCFactionOrMinion)
if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
{
return false;
}
for (int num = conditions.Count - 1; num >= 0; num--)
{
Condition condition = conditions[num];
if (condition.Type == ConditionType.Bad || condition.Type == ConditionType.Debuff || condition.Type == ConditionType.Disease)
if (!(condition is ConAnorexia) || type == CureType.Death)
{
condition.Kill();
}
else if (type == CureType.Death && condition.isPerfume)
{
condition.Kill();
if (condition.Type == ConditionType.Bad || condition.Type == ConditionType.Debuff || condition.Type == ConditionType.Disease)
{
condition.Kill();
}
else if (type == CureType.Death && condition.isPerfume)
{
condition.Kill();
}
}
}
CureCondition<ConWait>();
CharaActor
@@ -27,6 +27,10 @@ public override void RefreshSprite()
Sprite sprite = sr.sprite;
Texture2D texture = sprite.texture;
Rect textureRect = sprite.textureRect;
if (!isPCC)
{
sr.flipX = owner.flipX;
}
Vector4 value = new Vector4(textureRect.x / (float)texture.width, textureRect.min.y / (float)texture.height, textureRect.max.x / (float)texture.width, textureRect.max.y / (float)texture.height);
mpb.SetVector("_Rect", value);
mpb.SetFloat("_PixelHeight", sprite.rect.height);
CharaActorPCC
@@ -124,6 +124,10 @@ public override void OnRender(RenderParam p)
p.v.x = p.x;
p.v.y = p.y;
p.v.z = p.z;
if (thing.renderer.hasActor)
{
thing.renderer.RefreshSprite();
}
thing.renderer.Draw(p, ref p.v, drawShadow: false);
}
break;
@@ -148,24 +152,31 @@ public override void OnRender(RenderParam p)
break;
}
case 0:
if (!flag && owner.body.slotOffHand != null && EMono.core.config.game.showOffhand)
{
if (flag || owner.body.slotOffHand == null || !EMono.core.config.game.showOffhand)
{
Thing thing2 = owner.body.slotOffHand.thing;
if (thing2 != null)
break;
}
Thing thing2 = owner.body.slotOffHand.thing;
if (thing2 != null)
{
bool flag4 = num == 1 || num == 3;
Vector3[] offHandPos = EMono.setting.render.offHandPos;
Vector3[] offHand = EMono.setting.render.animeWalk[provider.currentFrame].offHand;
SourcePref pref2 = thing2.source.pref;
thing2.dir = ((!flag4) ? 1 : 0);
thing2.SetRenderParam(p);
p.x = org.x + offHandPos[num].x + offHand[num].x + (flag4 ? 0.01f : (-0.01f)) * (float)pref2.equipX;
p.y = org.y + offHandPos[num].y + offHand[num].y + 0.01f * (float)pref2.equipY;
p.z = org.z - thing2.renderer.data.offset.z + offHandPos[num].z + offHand[num].z;
if (thing2.renderer.hasActor)
{
bool flag4 = num == 1 || num == 3;
Vector3[] offHandPos = EMono.setting.render.offHandPos;
Vector3[] offHand = EMono.setting.render.animeWalk[provider.currentFrame].offHand;
SourcePref pref2 = thing2.source.pref;
thing2.dir = ((!flag4) ? 1 : 0);
thing2.SetRenderParam(p);
p.x = org.x + offHandPos[num].x + offHand[num].x + (flag4 ? 0.01f : (-0.01f)) * (float)pref2.equipX;
p.y = org.y + offHandPos[num].y + offHand[num].y + 0.01f * (float)pref2.equipY;
p.z = org.z - thing2.renderer.data.offset.z + offHandPos[num].z + offHand[num].z;
thing2.renderer.Draw(p);
thing2.renderer.RefreshSprite();
}
thing2.renderer.Draw(p);
}
break;
}
case -1:
break;
}
ConBoost
@@ -12,15 +12,12 @@ public override void OnRemoved()
public override RendererReplacer GetRendererReplacer()
{
string text = owner.id;
if (!(text == "black_angel"))
return owner.id switch
{
if (text == "adv_verna")
{
return RendererReplacer.CreateFrom("adv_verna", 2);
}
return null;
}
return RendererReplacer.CreateFrom("black_angel", -1);
"black_angel" => RendererReplacer.CreateFrom("black_angel", -1),
"adv_verna" => RendererReplacer.CreateFrom("adv_verna", 2),
"griffin" => RendererReplacer.CreateFrom("griffin", 1),
_ => null,
};
}
}
ConSleep
@@ -25,6 +25,12 @@ public class ConSleep : BadCondition
[JsonProperty]
public bool slept;
[JsonProperty]
public int uidRide;
[JsonProperty]
public int uidParasite;
public override Emo2 EmoIcon => Emo2.speeing;
public override bool ConsumeTurn => true;
@@ -64,6 +70,19 @@ public override void Tick()
}
if (owner.IsPC && pcSleep > 0)
{
if (!EClass._zone.IsRegion)
{
if (EClass.pc.ride != null)
{
uidRide = EClass.pc.ride.uid;
ActRide.Unride(EClass.pc, parasite: false, talk: false);
}
if (EClass.pc.parasite != null)
{
uidParasite = EClass.pc.parasite.uid;
ActRide.Unride(EClass.pc, parasite: true, talk: false);
}
}
pcSleep--;
if (pcSleep != 0)
{
@@ -213,71 +232,88 @@ public override void OnRemoved()
if (!owner.IsPC)
{
owner.sleepiness.Set(0);
return;
}
else
if (owner.IsPC)
{
if (owner.isDead)
if (uidRide != 0)
{
return;
Chara chara = EClass._map.FindChara(uidRide);
if (chara != null)
{
ActRide.Ride(EClass.pc, chara, parasite: false, talk: false);
}
}
TraitPillow traitPillow = (pcPillow?.trait as TraitPillow) ?? EClass.pc.pos.FindThing<TraitPillow>();
if (pickup)
if (uidParasite != 0)
{
TryPick(pcBed, posBed);
TryPick(pcPillow, posPillow);
Chara chara2 = EClass._map.FindChara(uidParasite);
if (chara2 != null)
{
ActRide.Ride(EClass.pc, chara2, parasite: true, talk: false);
}
}
if (slept)
}
if (owner.isDead)
{
return;
}
TraitPillow traitPillow = (pcPillow?.trait as TraitPillow) ?? EClass.pc.pos.FindThing<TraitPillow>();
if (pickup)
{
TryPick(pcBed, posBed);
TryPick(pcPillow, posPillow);
}
if (slept)
{
Thing thing = EClass.pc.things.Find<TraitGrimoire>();
if (thing != null && thing.c_lockLv == 0 && !EClass._zone.IsRegion)
{
Thing thing = EClass.pc.things.Find<TraitGrimoire>();
if (thing != null && thing.c_lockLv == 0 && !EClass._zone.IsRegion)
foreach (Thing item in thing.things.List((Thing _t) => _t.trait is TraitSpellbook || _t.trait is TraitAncientbook || _t.id == "234"))
{
foreach (Thing item in thing.things.List((Thing _t) => _t.trait is TraitSpellbook || _t.trait is TraitAncientbook || _t.id == "234"))
TraitBaseSpellbook traitBaseSpellbook = item.trait as TraitBaseSpellbook;
if (item.trait is TraitAncientbook && item.isOn)
{
continue;
}
int c_charges = item.c_charges;
for (int i = 0; i < c_charges; i++)
{
TraitBaseSpellbook traitBaseSpellbook = item.trait as TraitBaseSpellbook;
if (item.trait is TraitAncientbook && item.isOn)
if (EClass.pc.isDead)
{
continue;
return;
}
int c_charges = item.c_charges;
for (int i = 0; i < c_charges; i++)
int num = traitBaseSpellbook.GetActDuration(EClass.pc) + 1;
bool flag = false;
for (int j = 0; j < num; j++)
{
if (EClass.pc.isDead)
if (!traitBaseSpellbook.TryProgress(new AIProgress
{
return;
}
int num = traitBaseSpellbook.GetActDuration(EClass.pc) + 1;
bool flag = false;
for (int j = 0; j < num; j++)
owner = EClass.pc
}))
{
if (!traitBaseSpellbook.TryProgress(new AIProgress
{
owner = EClass.pc
}))
flag = true;
if (!EClass.pc.isDead)
{
flag = true;
if (!EClass.pc.isDead)
{
break;
}
return;
break;
}
return;
}
if (!flag)
{
traitBaseSpellbook.OnRead(EClass.pc);
}
}
if (!flag)
{
traitBaseSpellbook.OnRead(EClass.pc);
}
}
}
}
if (!EClass.pc.isDead && slept)
}
if (!EClass.pc.isDead && slept)
{
EClass.player.recipes.OnSleep(traitPillow is TraitPillowEhekatl);
EClass.player.DreamSpell();
if (traitPillow is TraitPillowGod traitPillowGod)
{
EClass.player.recipes.OnSleep(traitPillow is TraitPillowEhekatl);
EClass.player.DreamSpell();
if (traitPillow is TraitPillowGod traitPillowGod)
{
traitPillowGod.Deity.Talk("morning");
}
traitPillowGod.Deity.Talk("morning");
}
}
static void TryPick(Thing t, ItemPosition pos)
HotItemHeld
@@ -274,19 +274,7 @@ public override bool TrySetAct(ActPlan p)
build.recipe = taskBuild.recipe;
build.mold = taskBuild;
build.SetAltitude(recipe.tileType.AltitudeAsDir ? recipe._dir : build.altitude);
if (recipe.IsBlock && thing.trait is TraitBlock && p.pos.HasBlock && !thing.trait.IsDoor)
{
p.TrySetAct("actRotateWall", delegate
{
SE.Rotate();
p.pos.cell.RotateBlock(1);
return false;
});
}
else
{
p.TrySetAct(taskBuild);
}
p.TrySetAct(taskBuild);
}
}
}
Lot
@@ -163,7 +163,7 @@ public void SetBaseRoom(Room r)
}
int num3 = (mx - x + pointMinX.z - z) / 2;
int num4 = pointMaxX.x - pointMinX.x + pointMaxX.z - pointMinX.z + 1;
int num5 = (mx - x + mz - z) / 2 + 2;
int num5 = (mx - x + mz - z) / 2 + 4;
int num6 = pointMinX.x + num3 - num5;
int num7 = pointMinX.z - num3 + num5;
int num8 = 0;
TaskBuild
@@ -30,6 +30,8 @@ public class TaskBuild : TaskBaseBuild
public bool freePos;
public bool disableRotateBlock;
public Card target;
public Point lastPos;
@@ -69,8 +71,25 @@ public override bool CanManualCancel()
return true;
}
public bool CanRotateBlock()
{
if (!EInput.rightMouse.pressing)
{
disableRotateBlock = false;
}
if (useHeld && EClass.pc.held != null && EClass.pc.held.trait is TraitBlock && pos.HasBlock && !EClass.pc.held.trait.IsDoor && !disableRotateBlock)
{
return true;
}
return false;
}
public override string GetText(string str = "")
{
if (CanRotateBlock())
{
return "actRotateWall".lang();
}
if (useHeld && EClass.pc.held != null)
{
if (EClass.pc.held.category.id == "seed")
@@ -133,6 +152,10 @@ public override HitResult GetHitResult()
{
return HitResult.Invalid;
}
if (CanRotateBlock())
{
return HitResult.Valid;
}
if (pos.HasBlock && EClass.pc.held.TileType.IsDoor && pos.HasWallOrFence && pos.cell.blockDir != 2)
{
recipe.SetDir((pos.cell.blockDir != 0) ? 1 : 0);
@@ -248,6 +271,14 @@ public override void OnProgressComplete()
{
return;
}
if (CanRotateBlock())
{
SE.Rotate();
pos.cell.RotateBlock(1);
disableRotateBlock = true;
return;
}
disableRotateBlock = true;
ActionMode.Build.FixBridge(pos, recipe);
bridgeHeight = ActionMode.Build.bridgeHeight;
target = (EClass.pc.held.category.installOne ? EClass.pc.held.Split(1) : EClass.pc.held);
Thing
@@ -1408,33 +1408,56 @@ public override void SetRenderParam(RenderParam p)
}
if (source.anime.Length > 2)
{
float num3 = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[2];
if ((int)num3 == source.anime[0] - 1 && source.anime.Length > 3)
float num = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[2];
if ((int)num == source.anime[0] - 1 && source.anime.Length > 3)
{
PlaySound("anime_sound" + source.anime[3]);
}
if (!(num3 >= (float)source.anime[0]))
if (!(num >= (float)source.anime[0]))
{
p.tile += num3 * (float)((!flipX) ? 1 : (-1));
p.tile += num * (float)((!flipX) ? 1 : (-1));
}
}
else
{
float num4 = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[0];
p.tile += num4 * (float)((!flipX) ? 1 : (-1));
float num2 = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[0];
p.tile += num2 * (float)((!flipX) ? 1 : (-1));
}
break;
case Trait.TileMode.SignalAnime:
if (source._altTiles.Length != 0 && trait.UseAltTiles)
{
p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
}
else
{
p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
}
if (animeCounter > 0f)
{
animeCounter += Time.deltaTime;
int num3 = (int)(animeCounter / (0.001f * (float)source.anime[1]));
if (num3 > source.anime[2])
{
animeCounter = 0f;
}
else
{
p.tile += num3 % source.anime[0] * ((!flipX) ? 1 : (-1));
}
}
break;
case Trait.TileMode.Illumination:
if (base.isOn || base.isRoofItem)
{
int num = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
int num2 = (int)(Time.realtimeSinceStartup * 5f);
p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num % 3 + 1) * ((!flipX) ? 1 : (-1));
if (num2 % 16 == 0)
int num4 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
int num5 = (int)(Time.realtimeSinceStartup * 5f);
p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
if (num5 % 16 == 0)
{
p.color = 5242880f;
}
else if (num2 % 11 == 0)
else if (num5 % 11 == 0)
{
p.color = 7864320f;
}
@@ -1469,10 +1492,10 @@ public override void SetRenderParam(RenderParam p)
}
if (base.idSkin != 0)
{
int num5 = base.idSkin - 1;
int num6 = base.idSkin - 1;
if (sourceCard.skins.Length != 0)
{
p.tile += ((p.tile < 0f) ? (-sourceCard.skins[num5]) : sourceCard.skins[num5]);
p.tile += ((p.tile < 0f) ? (-sourceCard.skins[num6]) : sourceCard.skins[num6]);
}
}
}
Trait
@@ -10,7 +10,8 @@ public enum TileMode
Default,
Door,
Illumination,
DefaultNoAnime
DefaultNoAnime,
SignalAnime
}
public enum CopyShopType
TraitDoorBell
public class TraitDoorBell : Trait
{
public override TileMode tileMode => TileMode.SignalAnime;
public override void OnOpenDoor(Chara c)
{
owner.PlaySound(GetParam(1));
owner.animeCounter = 0.01f;
}
}
TraitEcoMark
@@ -14,7 +14,8 @@ public override void TrySetHeldAct(ActPlan p)
SE.Play("click_paper");
owner.ModNum(-1);
t.elements.SetBase(652, 10);
t.ChangeWeight(t.source.weight * 100 / 110);
int num = (t.isWeightChanged ? t.c_weight : t.source.weight);
t.ChangeWeight(num * 100 / 110);
return false;
});
}
Zone_Tent
@@ -16,6 +16,11 @@ public override void OnBeforeDeactivate()
foreach (Thing thing in EClass._map.things)
{
num += thing.ChildrenAndSelfWeight;
if (num >= 10000000 || num < 0)
{
num = 10000000;
break;
}
}
SetInt(1, num);
}