예제 #1
0
        public static void AIActorRewardsHook(Action <AIActor> orig, AIActor self)
        {
            FieldInfo i = typeof(AIActor).GetField("m_hasGivenRewards", BindingFlags.NonPublic | BindingFlags.Instance);

            if (!(bool)i.GetValue(self) && !self.IsTransmogrified)
            {
                if (self.SetsCustomFlagOnDeath())
                {
                    AdvancedGameStatsManager.Instance.SetFlag(self.GetCustomFlagToSetOnDeath(), true);
                }
                if (self.SetsCustomCharacterSpecificFlagOnDeath())
                {
                    AdvancedGameStatsManager.Instance.SetCharacterSpecificFlag(self.GetCustomCharacterSpecificFlagToSetOnDeath(), true);
                }
            }
            orig(self);
        }