Caves of Qud

Caves of Qud

More Rewarding Psionic Fights
flemingluiz  [developer] 9 Dec, 2023 @ 8:54am
Help me Fix This Mod
since the last major update this mod have been quite broken in a way neither me or my friend who understands C# way better than me and made this mod with me were able to fix it or make a patch for it. if anyone interrested in helping fix the mod i would appretiate it.
< >
Showing 1-15 of 15 comments
OrphanSlayer 23 Jan, 2024 @ 7:35pm 
try asking on the qud discord, I think they have a mod support channel, I would but they wouldn't let me join ;-;
flemingluiz  [developer] 24 Jan, 2024 @ 4:48am 
Originally posted by That Guy:
try asking on the qud discord, I think they have a mod support channel, I would but they wouldn't let me join ;-;
i dont think i would join either havent heard very good things about it. but if by any chance someone comes here and help me would be great in the meanwhile im looking more into coding to see if i can find a way to fix it and make more mods.
Last edited by flemingluiz; 24 Jan, 2024 @ 4:49am
OrphanSlayer 24 Jan, 2024 @ 8:44pm 
yeah I heard their really awful, I wish you the best of luck, this is a great mod
hey friend did you still need help with the mod, it looks interesting and id like to try to help :)
reach out to me if so
flemingluiz  [developer] 13 Feb, 2024 @ 4:30am 
Originally posted by your average trans girl:
hey friend did you still need help with the mod, it looks interesting and id like to try to help :)
reach out to me if so
from what has been told me i must patch the mods code with a harmonypatch so just the part of the mod works and dont include the rest of the absordablepsyche file. the problem is that neither me or the other friend i have been making this mod with were able to do that.
Last edited by flemingluiz; 13 Feb, 2024 @ 4:31am
flemingluiz  [developer] 15 Feb, 2024 @ 5:38am 
heres the full mod code what i need is to patch the class. but havent found a way to create a harmonypatch that worked. if anyone do it or at least tell me How i would be glad.

using Qud.API; using System; using XRL.Language; using XRL.UI; using XRL.World.Encounters; namespace XRL.World.Parts { [Serializable] public class AbsorbablePsyche : IPart { private static readonly int _ABSORB_CHANCE = 10; public int ABSORB_CHANCE { get { return _ABSORB_CHANCE + (5 * Convert.ToInt32(Math.Floor((IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue + EgoBonus) / 6.0))); } } public int EgoBonus = 1; public override bool SameAs(IPart p) => true; public override bool WantEvent(int ID, int cascade) => base.WantEvent(ID, cascade) || ID == BeforeDeathRemovalEvent.ID || ID == KilledEvent.ID || ID == ReplicaCreatedEvent.ID; public override bool HandleEvent(ReplicaCreatedEvent E) { if (E.Object == this.ParentObject) E.WantToRemove((IPart) this); return base.HandleEvent(E); } public override bool HandleEvent(KilledEvent E) { if (E.Dying.GetPsychicGlimmer() >= PsychicManager.GLIMMER_FLOOR) { if (this.ParentObject.GetPrimaryFaction() == "Seekers") { E.Reason = "You were resorbed into the Mass Mind."; E.ThirdPersonReason = E.Dying.It + E.Dying.GetVerb("were") + " @@resorbed into the Mass Mind."; } else if (ABSORB_CHANCE.in100()) { E.Reason = "Your psyche exploded, and its psionic bits were encoded on the holographic boundary surrounding the psyche of " + Grammar.MakePossessive(this.ParentObject.BaseDisplayName) + "."; E.ThirdPersonReason = E.Dying.Its + " psyche exploded, and its psionic bits were encoded on the holographic boundary surrounding the psyche of " + Grammar.MakePossessive(this.ParentObject.BaseDisplayName) + "."; } } return base.HandleEvent(E); } public override bool HandleEvent(BeforeDeathRemovalEvent E) { if (this.EgoBonus > 0) { GameObject killer = E.Killer; if ((killer != null ? (killer.IsPlayer() ? 1 : 0) : 0) != 0) { int egoBonus = this.EgoBonus; this.EgoBonus = 0; if (ABSORB_CHANCE.in100()) { if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + this.ParentObject.BaseDisplayName + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)") == DialogResult.Yes) { IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus; Popup.Show("You encode the psyche of " + this.ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!"); JournalAPI.AddAccomplishment("You slew " + this.ParentObject.BaseDisplayName + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", "After a climactic battle of wills, =name= slew " + this.ParentObject.the + this.ParentObject.BaseDisplayName + " and absorbed " + this.ParentObject.its + " psyche, thickening toward Godhood.", muralCategory: JournalAccomplishment.MuralCategory.Slays, muralWeight: JournalAccomplishment.MuralWeight.High); ; } else { Popup.Show("You pause as the psyche of " + this.ParentObject.BaseDisplayName + " radiates into nothingness."); JournalAPI.AddAccomplishment("You slew " + this.ParentObject.BaseDisplayName + " and watched their psyche radiate into nothingness.", "After a climactic battle of wills, =name= slew " + this.ParentObject.the + this.ParentObject.BaseDisplayName + " and watched " + this.ParentObject.its + " psyche radiate into nothingness.", muralCategory: JournalAccomplishment.MuralCategory.Slays); } } else JournalAPI.AddAccomplishment("You slew " + this.ParentObject.BaseDisplayName + ".", "After a climactic battle of wills, =name= slew " + this.ParentObject.the + this.ParentObject.BaseDisplayName + ".", muralCategory: JournalAccomplishment.MuralCategory.Slays); } } return base.HandleEvent(E); } } }
Gravenwitch 23 Feb, 2024 @ 8:23pm 
using System;
using Qud.API;
using XRL.Language;
using XRL.UI;
using XRL.World.Encounters;
using XRL.World.Parts;
using HarmonyLib;

namespace MoreRewardingPsionicFights.HarmonyPatches
{
[HarmonyPatch(typeof(XRL.World.Parts.AbsorbablePsyche))]
public class PsycheAlterer
{
[HarmonyPrefix]
[HarmonyPatch("HandleEvent", new Type[] { typeof(XRL.World.BeforeDeathRemovalEvent) })]
static bool Prefix(XRL.World.BeforeDeathRemovalEvent E, AbsorbablePsyche __instance)
{
if (__instance.EgoBonus > 0)
{
XRL.World.GameObject killer = E.Killer;
if (killer != null && killer.IsPlayer())
{
int egoBonus = 1;
int chance = 10 + (5 * Convert.ToInt32(Math.Floor((XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue) / 6.0)));
if (chance.in100())
{
if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + __instance.ParentObject.GetReferenceDisplayName(2147483647, null, null, false, false, false, false, false, false, false, true, null, false) + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)", true, DialogResult.Yes) == DialogResult.Yes)
{
XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus;
Popup.Show("You encode the psyche of " + __instance.ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!", true, true, true, true);
JournalAPI.AddAccomplishment("You slew " + __instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, true, null, false) + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", string.Concat(new string[]
{
"After a climactic battle of wills, =name= slew ",
__instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, true, null, false),
" and absorbed ",
__instance.ParentObject.its,
" psyche, thickening toward Godhood."
}), "general", MuralCategory.Slays, MuralWeight.High, null, -1L, true);
XRL.Achievement.ABSORB_PSYCHE.Unlock();
}
else
{
Popup.Show("You pause as the psyche of " + __instance.ParentObject.BaseDisplayName + " radiates into nothingness.", true, true, true, true);
JournalAPI.AddAccomplishment("You slew " + __instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, false, null, false) + " and watched their psyche radiate into nothingness.", string.Concat(new string[]
{
"After a climactic battle of wills, =name= slew ",
__instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, true, null, false),
" and watched ",
__instance.ParentObject.its,
" psyche radiate into nothingness."
}), "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L, true);
}
}
else
{
JournalAPI.AddAccomplishment("You slew " + __instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, true, null, false) + ".", "After a climactic battle of wills, =name= slew " + __instance.ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, false, false, false, false, false, false, false, true, null, false) + ".", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L, true);
}
}
}
return true;
}
}
}
Gravenwitch 23 Feb, 2024 @ 8:23pm 
oh rip that didnt format at all, ill just post a mod that has the updated harmony patch. Feel free to use it to update the original if you have access
flemingluiz  [developer] 24 Feb, 2024 @ 9:07am 
Originally posted by Gravenwitch:
oh rip that didnt format at all, ill just post a mod that has the updated harmony patch. Feel free to use it to update the original if you have access
My God thank you so much.
discord9 6 Jul, 2024 @ 12:29am 
This patch works, feel free to update it
```csharp
// Assembly-CSharp, Version=2.0.207.75, Culture=neutral, PublicKeyToken=null
// XRL.World.Parts.AbsorbablePsyche
using System;
using Qud.API;
using XRL;
using XRL.Language;
using XRL.UI;
using XRL.World;
using XRL.World.Encounters;
using HarmonyLib;


namespace MoreRewardPsiFight.HarmonyPatches
{
[HarmonyPatch(typeof(XRL.World.Parts.AbsorbablePsyche))]
[HarmonyPatch(nameof(XRL.World.Parts.AbsorbablePsyche.HandleEvent))]
[HarmonyPatch(new Type[] {typeof(BeforeDeathRemovalEvent)})]
[Serializable]
public class MyAbsorbablePsyche
{
public static readonly int ABSORB_CHANCE = 100;

[HarmonyPrefix]
static bool HandleEvent(ref BeforeDeathRemovalEvent E, ref bool __result, XRL.World.Parts.AbsorbablePsyche __instance)
{
XRL.Messages.MessageQueue.AddPlayerMessage("Handling AbsorbablePsyche event.");
int EgoBonus = __instance.EgoBonus;
GameObject ParentObject = __instance.ParentObject;
if (EgoBonus > 0)
{
GameObject killer = E.Killer;
if (killer != null && killer.IsPlayer())
{
int egoBonus = EgoBonus;
__instance.EgoBonus = 0;
int chance = 10 + (5 * Convert.ToInt32(Math.Floor((XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue) / 6.0)));
if (chance.in100())
{
if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes, and you feel like abosrb it. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)") == DialogResult.Yes)
{
IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus;
Popup.Show("You encode the psyche of " + ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!");
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and absorbed " + ParentObject.its + " psyche, thickening toward Godhood.", "general", MuralCategory.Slays, MuralWeight.High, null, -1L);
Achievement.ABSORB_PSYCHE.Unlock();
}
else
{
Popup.Show("You pause as the psyche of " + ParentObject.BaseDisplayName + " radiates into nothingness.");
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName() + " and watched their psyche radiate into nothingness.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and watched " + ParentObject.its + " psyche radiate into nothingness.", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L);
}
}
else
{
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L);
}
}
}
// skip original method, hence replace it
__result = false; //__instance.HandleEvent(E);
return false;
}
}

}

```
flemingluiz  [developer] 6 Jul, 2024 @ 5:17am 
Originally posted by discord9:
This patch works, feel free to update it
```csharp
// Assembly-CSharp, Version=2.0.207.75, Culture=neutral, PublicKeyToken=null
// XRL.World.Parts.AbsorbablePsyche
using System;
using Qud.API;
using XRL;
using XRL.Language;
using XRL.UI;
using XRL.World;
using XRL.World.Encounters;
using HarmonyLib;


namespace MoreRewardPsiFight.HarmonyPatches
{
[HarmonyPatch(typeof(XRL.World.Parts.AbsorbablePsyche))]
[HarmonyPatch(nameof(XRL.World.Parts.AbsorbablePsyche.HandleEvent))]
[HarmonyPatch(new Type[] {typeof(BeforeDeathRemovalEvent)})]
[Serializable]
public class MyAbsorbablePsyche
{
public static readonly int ABSORB_CHANCE = 100;

[HarmonyPrefix]
static bool HandleEvent(ref BeforeDeathRemovalEvent E, ref bool __result, XRL.World.Parts.AbsorbablePsyche __instance)
{
XRL.Messages.MessageQueue.AddPlayerMessage("Handling AbsorbablePsyche event.");
int EgoBonus = __instance.EgoBonus;
GameObject ParentObject = __instance.ParentObject;
if (EgoBonus > 0)
{
GameObject killer = E.Killer;
if (killer != null && killer.IsPlayer())
{
int egoBonus = EgoBonus;
__instance.EgoBonus = 0;
int chance = 10 + (5 * Convert.ToInt32(Math.Floor((XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue) / 6.0)));
if (chance.in100())
{
if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes, and you feel like abosrb it. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)") == DialogResult.Yes)
{
IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus;
Popup.Show("You encode the psyche of " + ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!");
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and absorbed " + ParentObject.its + " psyche, thickening toward Godhood.", "general", MuralCategory.Slays, MuralWeight.High, null, -1L);
Achievement.ABSORB_PSYCHE.Unlock();
}
else
{
Popup.Show("You pause as the psyche of " + ParentObject.BaseDisplayName + " radiates into nothingness.");
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName() + " and watched their psyche radiate into nothingness.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and watched " + ParentObject.its + " psyche radiate into nothingness.", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L);
}
}
else
{
JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L);
}
}
}
// skip original method, hence replace it
__result = false; //__instance.HandleEvent(E);
return false;
}
}

}

```
post this agan using [[code]] [[/code]] (without the second "[ ]") so it doesnt break when i copy paste it.
Last edited by flemingluiz; 6 Jul, 2024 @ 5:18am
discord9 6 Jul, 2024 @ 6:53am 
// Assembly-CSharp, Version=2.0.207.75, Culture=neutral, PublicKeyToken=null // XRL.World.Parts.AbsorbablePsyche using System; using Qud.API; using XRL; using XRL.Language; using XRL.UI; using XRL.World; using XRL.World.Encounters; using HarmonyLib; namespace MoreRewardPsiFight.HarmonyPatches { [HarmonyPatch(typeof(XRL.World.Parts.AbsorbablePsyche))] [HarmonyPatch(nameof(XRL.World.Parts.AbsorbablePsyche.HandleEvent))] [HarmonyPatch(new Type[] {typeof(BeforeDeathRemovalEvent)})] [Serializable] public class MyAbsorbablePsyche { public static readonly int ABSORB_CHANCE = 100; [HarmonyPrefix] static bool HandleEvent(ref BeforeDeathRemovalEvent E, ref bool __result, XRL.World.Parts.AbsorbablePsyche __instance) { XRL.Messages.MessageQueue.AddPlayerMessage("Handling AbsorbablePsyche event."); int EgoBonus = __instance.EgoBonus; GameObject ParentObject = __instance.ParentObject; if (EgoBonus > 0) { GameObject killer = E.Killer; if (killer != null && killer.IsPlayer()) { int egoBonus = EgoBonus; __instance.EgoBonus = 0; int chance = 10 + (5 * Convert.ToInt32(Math.Floor((XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue) / 6.0))); if (chance.in100()) { if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes, and you feel like abosrb it. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)") == DialogResult.Yes) { IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus; Popup.Show("You encode the psyche of " + ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!"); JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and absorbed " + ParentObject.its + " psyche, thickening toward Godhood.", "general", MuralCategory.Slays, MuralWeight.High, null, -1L); Achievement.ABSORB_PSYCHE.Unlock(); } else { Popup.Show("You pause as the psyche of " + ParentObject.BaseDisplayName + " radiates into nothingness."); JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName() + " and watched their psyche radiate into nothingness.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + " and watched " + ParentObject.its + " psyche radiate into nothingness.", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L); } } else { JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue, null, null, NoColor: false, Stripped: false, ColorOnly: false, WithoutTitles: false, Short: false, BaseOnly: false, WithIndefiniteArticle: false, WithDefiniteArticle: true) + ".", "general", MuralCategory.Slays, MuralWeight.Medium, null, -1L); } } } // skip original method, hence replace it __result = false; //__instance.HandleEvent(E); return false; } } }
|_| Clyax 26 Dec, 2024 @ 5:03pm 
The current problems as listed for 1.0.1:
"
=== More Rewarding Psionic Fights Errors ===
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(50,735): error CS1503: Argument 4: cannot convert from 'Qud.API.MuralCategory' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(50,756): error CS1503: Argument 5: cannot convert from 'Qud.API.MuralWeight' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(50,774): error CS1503: Argument 6: cannot convert from '<null>' to 'MuralCategory'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(50,780): error CS1503: Argument 7: cannot convert from 'long' to 'Qud.API.MuralWeight'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(56,510): error CS1503: Argument 4: cannot convert from 'Qud.API.MuralCategory' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(56,531): error CS1503: Argument 5: cannot convert from 'Qud.API.MuralWeight' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(56,551): error CS1503: Argument 6: cannot convert from '<null>' to 'MuralCategory'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(56,557): error CS1503: Argument 7: cannot convert from 'long' to 'Qud.API.MuralWeight'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(61,575): error CS1503: Argument 4: cannot convert from 'Qud.API.MuralCategory' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(61,596): error CS1503: Argument 5: cannot convert from 'Qud.API.MuralWeight' to 'string'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(61,616): error CS1503: Argument 6: cannot convert from '<null>' to 'MuralCategory'
<...>\steamapps\workshop\content\333640\2992992143\More rewarding psionic fights.cs(61,622): error CS1503: Argument 7: cannot convert from 'long' to 'Qud.API.MuralWeight'
== Warnings ==
None
"
It failed to approve after saving and reloading the modlist.
Updated code

using System; using Qud.API; using XRL; using XRL.Language; using XRL.UI; using XRL.World; using XRL.World.Encounters; using HarmonyLib; namespace MoreRewardPsiFight.HarmonyPatches { [HarmonyPatch(typeof(XRL.World.Parts.AbsorbablePsyche))] [HarmonyPatch(nameof(XRL.World.Parts.AbsorbablePsyche.HandleEvent))] [HarmonyPatch(new Type[] {typeof(BeforeDeathRemovalEvent)})] [Serializable] public class MyAbsorbablePsyche { public static readonly int ABSORB_CHANCE = 100; [HarmonyPrefix] static bool HandleEvent(ref BeforeDeathRemovalEvent E, ref bool __result, XRL.World.Parts.AbsorbablePsyche __instance) { int EgoBonus = __instance.EgoBonus; GameObject ParentObject = __instance.ParentObject; if (EgoBonus > 0) { GameObject killer = E.Killer; if (killer != null && killer.IsPlayer()) { int egoBonus = EgoBonus; __instance.EgoBonus = 0; int chance = 10 + (5 * Convert.ToInt32(Math.Floor((XRL.World.IComponent<XRL.World.GameObject>.ThePlayer.GetStat("Ego").BaseValue) / 6.0))); if (chance.in100()) { if (Popup.ShowYesNo("At the moment of victory, your swelling ego curves the psychic aether and causes the psyche of " + ParentObject.GetReferenceDisplayName(int.MaxValue) + " to collide with your own. As the weaker of the two, its binding energy is exceeded and it explodes, and you feel like abosrb it. Would you like to encode its psionic bits on the holographic boundary of your own psyche?\n\n(+1 Ego permanently)") == DialogResult.Yes) { IComponent<GameObject>.ThePlayer.GetStat("Ego").BaseValue += egoBonus; Popup.Show("You encode the psyche of " + ParentObject.BaseDisplayName + " and gain +{{C|1}} {{Y|Ego}}!"); JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue) + " and encoded their psyche's psionic bits on the holographic boundary of your own psyche.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue) + " and absorbed " + ParentObject.its + " psyche, thickening toward Godhood.", category:"general", muralCategory:MuralCategory.Slays, muralWeight:MuralWeight.High); Achievement.ABSORB_PSYCHE.Unlock(); } else { Popup.Show("You pause as the psyche of " + ParentObject.BaseDisplayName + " radiates into nothingness."); //Used keyword arguments to make the code a bit more durable to updates JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName() + " and watched their psyche radiate into nothingness.", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue) + " and watched " + ParentObject.its + " psyche radiate into nothingness.", category:"general", muralCategory:MuralCategory.Slays, muralWeight:MuralWeight.High); } } else { JournalAPI.AddAccomplishment("You slew " + ParentObject.GetReferenceDisplayName(int.MaxValue) + ".", "After a climactic battle of wills, =name= slew " + ParentObject.GetReferenceDisplayName(int.MaxValue) + ".", category:"general", muralCategory:MuralCategory.Slays, muralWeight:MuralWeight.High); } } } // skip original method, hence replace it __result = false; //__instance.HandleEvent(E); return false; } } }
they adjusted the number of arguments in JournalAPI.AddAccomplishment meaning arguments 4,5, and 6 were offset by 1 from what they should be. I swapped them to keyword arguments which should make it more durable to future updates.

In the future, decompile XRL.World.Parts.AbsorbablePsyche and check for differences in the HandleEvent(BeforeDeathRemovalEvent E)
< >
Showing 1-15 of 15 comments
Per page: 1530 50