Exemple #1
0
            private static bool Prefix(XmlNode ___mInfo, Trigger ___mTrigger)
            {
                if (!enabled)
                {
                    return(true);
                }

                int dead = (int)Util.GetVarRefOrValue(___mInfo, "dead", VarValue.EType.Int, ___mTrigger).Value;

                if (dead == -1)
                {
                    int actorId = StoryHelper.GetActorId(___mInfo, ___mTrigger, true);
                    Dbgl($"restoring {actorId} favor");
                    Module <FavorManager> .Self.RemoveFromBlackList(actorId);

                    return(false);
                }

                return(true);
            }
Exemple #2
0
            static bool Prefix(CheckMarriage __instance, ref bool __result, ref int ___npcId, bool ___flag)
            {
                if (!enabled)
                {
                    return(true);
                }

                ___npcId = StoryHelper.GetActorId(mInfoByRef(__instance), mTriggerByRef(__instance), false);

                if (___npcId == -1)
                {
                    int s = GetCurrentSpouse();
                    __result = (s != 0) == ___flag;
                    Dbgl("Checking married: " + (s != 0) + " (needed " + ___flag + ")");
                }
                else
                {
                    __result = IsSpouse(___npcId) == ___flag;
                    Dbgl("Checking married to " + StoryHelper.GetActor(___npcId).ActorName + ": " + IsSpouse(___npcId) + " (needed " + ___flag + ")");
                }
                return(false);
            }