Compare commits

..

No commits in common. "641c971f95e6b755b15705b2bd957c50c237c89d" and "64f1ad7808c32b6d5c8ccbbb7c52470d184b89da" have entirely different histories.

21 changed files with 170 additions and 142 deletions

4
.readme_generator.py Executable file → Normal file
View file

@ -21,8 +21,8 @@ def main():
doc += f"## {mod['Title']}\n" doc += f"## {mod['Title']}\n"
doc += str( doc += str(
f'<img src="{dir.name}{sep}{mod["ImagePath"]}" ' f'<img src="{dir.name}{sep}{mod["ImagePath"]}" '
+ 'alt="mod preview" ' + 'alt="mod preview"'
+ 'width="48" height="48" /><br/>\n\n', + ' width="48" height="48" /><br/>\n\n',
) )
doc += f"{mod['Description']}\n\n" doc += f"{mod['Description']}\n\n"
doc += "[Link to the Steam Workshop page]" doc += "[Link to the Steam Workshop page]"

0
AutoDropBedding/AutoDropBeddingMenu.cs Normal file → Executable file
View file

0
AutoDropBedding/Config.cs Normal file → Executable file
View file

0
AutoDropBedding/Extensions.cs Normal file → Executable file
View file

0
AutoDropBedding/HarmonyPatches/Patch_Survival_Camp.cs Normal file → Executable file
View file

0
AutoDropBedding/Helpers.cs Normal file → Executable file
View file

0
AutoDropBedding/ObjectBlueprints.xml Normal file → Executable file
View file

0
AutoDropBedding/Options.xml Normal file → Executable file
View file

0
AutoDropBedding/manifest.json Normal file → Executable file
View file

0
AutoDropBedding/preview.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
AutoDropBedding/screenshot_campfire.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

0
AutoDropBedding/screenshot_menu.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

0
AutoDropBedding/workshop.json Normal file → Executable file
View file

284
CyberneticHearingAid/CyberneticHeightenedHearingEffect.cs Normal file → Executable file
View file

@ -1,127 +1,157 @@
using System; using System;
using XRL.UI; using XRL.UI;
using XRL.World.Capabilities; using XRL.World.Capabilities;
using XRL.World.Parts; using XRL.World.Parts;
using XRL.World.Parts.Mutation;
// this is 95% copy/pasted from decompiled vanilla HeightenedHearingEffect
// this is 95% copy/pasted from decompiled vanilla HeightenedHearingEffect // only thing added was a reference to the implant because it has the part rather than the implantee
// only thing added was a reference to the implant because it has the part rather than the implantee namespace XRL.World.Effects
namespace XRL.World.Effects {
{ [Serializable]
[Serializable] public class CyberneticHeightenedHearingEffect : Effect
public class CyberneticHeightenedHearingEffect : Effect {
{ public bool bIdentified;
public bool Identified; public int Level = 1;
public int Level = 1; public GameObject Listener;
public GameObject Listener; public GameObject Implant;
public GameObject Implant; public CyberneticHeightenedHearingEffect() => Duration = 1;
public CyberneticHeightenedHearingEffect() => this.Duration = 1; public CyberneticHeightenedHearingEffect(int Level, GameObject Listener)
: this()
public CyberneticHeightenedHearingEffect(int Level, GameObject Listener, GameObject Implant) {
: this() this.Level = Level;
{ this.Listener = Listener;
this.Level = Level; }
this.Listener = Listener;
this.Implant = Implant; public CyberneticHeightenedHearingEffect(int Level, GameObject Listener, GameObject Implant)
} : this()
{
public override int GetEffectType() => 2048; this.Level = Level;
this.Listener = Listener;
public override bool SameAs(Effect e) => false; this.Implant = Implant;
}
public override string GetDescription() => (string)null;
public override int GetEffectType() => 2048;
public override bool WantEvent(int ID, int cascade) => base.WantEvent(ID, cascade) || ID == SingletonEvent<EndTurnEvent>.ID || ID == EnteringCellEvent.ID;
public override bool SameAs(Effect e) => false;
public override bool HandleEvent(AfterPlayerBodyChangeEvent E)
{ public override string GetDescription() => (string)null;
this.CheckListen();
return base.HandleEvent(E); private bool BadListener()
} {
Listener = null;
public override bool HandleEvent(EndTurnEvent E) Object.RemoveEffect(this);
{ return true;
this.CheckListen(); }
return base.HandleEvent(E);
} public bool CheckListen()
{
public override bool HandleEvent(EnteringCellEvent E) if (!GameObject.validate(ref Listener) || !Listener.IsPlayer())
{ {
this.CheckListen(); return BadListener();
return base.HandleEvent(E); }
}
if (!(Implant.GetPart("CyberneticsHearingAid") is CyberneticsHearingAid part))
private bool BadListener() {
{ return BadListener();
this.Listener = (GameObject)null; }
this.Object?.RemoveEffect((Effect)this);
return true; int num = Object.DistanceTo(Listener);
} if (num > part.Radius)
{
public bool CheckListen() return BadListener();
{ }
if (!GameObject.Validate(this.Object))
return true; if (bIdentified)
if (!GameObject.Validate(ref this.Listener) || !this.Listener.IsPlayer()) {
return this.BadListener(); CheckInterruptAutoExplore();
CyberneticsHearingAid part = this.Listener.GetPart<CyberneticsHearingAid>(); return true;
if (part == null || part.Level <= 0) }
return this.BadListener();
if (!(Implant.GetPart("CyberneticsHearingAid") is CyberneticsHearingAid otherpart)) if (Object.CurrentCell == null)
return this.BadListener(); {
int num = this.Object.DistanceTo(this.Listener); return true;
if (num > part.GetRadius()) }
return this.BadListener();
if (this.Identified || this.Object.CurrentCell == null) if (((int)((100 + (10 * Level)) / Math.Pow(num + 9, 2.0) * 100.0)).in100())
return true; {
if (((int)((double)(100 + 10 * this.Level) / Math.Pow((double)(num + 9), 2.0) * 100.0)).in100()) bIdentified = true;
{ CheckInterruptAutoExplore();
this.Identified = true; }
if (this.Listener.IsPlayer())
AutoAct.CheckHostileInterrupt(); return false;
} }
return false;
} public void CheckInterruptAutoExplore()
{
public override bool Apply(GameObject Object) if (!bIdentified || !GameObject.validate(ref Listener) || !Listener.IsPlayer() || !AutoAct.IsInterruptable() || AutoAct.IsGathering() || !Listener.IsRelevantHostile(Object))
{ return;
this.CheckListen(); AddPlayerMessage(Listener.GenerateSpotMessage(Object, verb: "hear"));
return true; AutoAct.Interrupt(null, null, Object);
} }
public override void RegisterActive(GameObject Object, IEventRegistrar Registrar) => Registrar.Register((IEventSource)The.Game, (IEventHandler)this, PooledEvent<AfterPlayerBodyChangeEvent>.ID); public override bool Apply(GameObject Object)
{
public bool HeardAndNotSeen(GameObject obj) if (Object.pBrain != null)
{ Object.pBrain.Hibernating = false;
if (obj == null) CheckListen();
return false; return true;
if (!obj.IsVisible()) }
return true;
Cell currentCell = obj.CurrentCell; public override void Register(GameObject Object)
return currentCell != null && (!currentCell.IsLit() || !currentCell.IsExplored()); {
} Object.RegisterEffectEvent(this, "EndTurn");
base.Register(Object);
public override bool FinalRender(RenderEvent E, bool bAlt) }
{
if (!this.HeardAndNotSeen(this.Object) || !this.Object.CanHypersensesDetect()) public override void Unregister(GameObject Object)
return true; {
E.Tile = (string)null; Object.UnregisterEffectEvent(this, "EndTurn");
if (this.Identified) base.Unregister(Object);
{ }
E.HighestLayer = 0;
E.NoWake = true; public bool HeardAndNotSeen(GameObject obj)
this.Object.ComponentRender(E); {
E.RenderString = this.Object.Render.RenderString; if (obj == null)
if (Options.UseTiles) return false;
E.Tile = this.Object.Render.Tile; if (!obj.IsVisible())
} return true;
else Cell currentCell = obj.CurrentCell;
E.RenderString = "?"; return currentCell != null && (!currentCell.IsLit() || !currentCell.IsExplored());
E.ColorString = "&K"; }
E.DetailColor = "K";
E.CustomDraw = true; public override bool FinalRender(RenderEvent E, bool bAlt)
return false; {
} if (!HeardAndNotSeen(Object) || !Object.CanHypersensesDetect())
} {
} return true;
}
if (bIdentified)
{
E.HighestLayer = 0;
Object.Render(E);
E.ColorString = "&K";
E.DetailColor = "K";
E.RenderString = Object.pRender.RenderString;
E.Tile = !Options.UseTiles ? null : Object.pRender.Tile;
E.CustomDraw = true;
}
else
{
E.RenderString = "&K?";
E.Tile = null;
E.CustomDraw = true;
}
return false;
}
public override bool FireEvent(Event E)
{
if (E.ID == "EndTurn" && Object != null)
CheckListen();
return base.FireEvent(E);
}
}
}

4
CyberneticHearingAid/CyberneticsHearingAid.cs Normal file → Executable file
View file

@ -16,9 +16,7 @@ namespace XRL.World.Parts
get { return GetAvailableComputePowerEvent.GetFor(ParentObject.Implantee) + 1; } get { return GetAvailableComputePowerEvent.GetFor(ParentObject.Implantee) + 1; }
} }
public static int GetRadius(int Level) => Level < 10 ? 3 + Level * 2 : 40; public override bool SameAs(IPart p) => false;
public int GetRadius() => CyberneticsHearingAid.GetRadius(this.Level);
public override bool WantEvent(int ID, int cascade) => base.WantEvent(ID, cascade) || ID == EndTurnEvent.ID || ID == GetShortDescriptionEvent.ID; public override bool WantEvent(int ID, int cascade) => base.WantEvent(ID, cascade) || ID == EndTurnEvent.ID || ID == GetShortDescriptionEvent.ID;

0
CyberneticHearingAid/ObjectBlueprints.xml Normal file → Executable file
View file

0
CyberneticHearingAid/Textures/Items/hearingaid.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

6
CyberneticHearingAid/manifest.json Normal file → Executable file
View file

@ -2,7 +2,7 @@
"id": "CyberneticHearingAid", "id": "CyberneticHearingAid",
"title": "{{cybernetic hearing aid|Cybernetic Hearing Aid}}", "title": "{{cybernetic hearing aid|Cybernetic Hearing Aid}}",
"description": "Enhanced hearing mutation but in cybernetics form.", "description": "Enhanced hearing mutation but in cybernetics form.",
"version": "1.0.1", "version": "1.0.0",
"author": "{{paisley|Celediel}}", "author": "{{paisley|Celediel}}",
"previewImage": "preview.png" "previewImage": "preview.png"
} }

0
CyberneticHearingAid/preview.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

14
CyberneticHearingAid/workshop.json Normal file → Executable file
View file

@ -1,8 +1,8 @@
{ {
"WorkshopId": 2721172552, "WorkshopId": 2721172552,
"Title": "Cybernetic Hearing Aid", "Title": "Cybernetic Hearing Aid",
"Description": "Like the Enhanced Hearing mutation, but a cybernetic.", "Description": "Like the Enhanced Hearing mutation, but a cybernetic.",
"Tags": "Script,Cybernetic", "Tags": "Script,Cybernetic",
"Visibility": "2", "Visibility": "0",
"ImagePath": "preview.png" "ImagePath": "preview.png"
} }

0
QudMods.csproj Normal file → Executable file
View file