Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
reach out to me if so
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;
}
}
}
```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;
}
}
}
```
"
=== 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.
In the future, decompile XRL.World.Parts.AbsorbablePsyche and check for differences in the HandleEvent(BeforeDeathRemovalEvent E)