Example #1
0
 public static void RecordJournalEntry(this EnemyDeathEffects ede)
 {
     try
     {
         var recordmethod = typeof(EnemyDeathEffects).GetMethod("RecordKillForJournal", BindingFlags.NonPublic | BindingFlags.Instance);
         recordmethod.Invoke(ede, new object[] { });
     }
     catch (Exception e)
     {
         Log("Journal Extentions", e);
     }
 }
Example #2
0
 public static void SetJournalEntry(this EnemyDeathEffects ede, JournalHelper jh)
 {
     try
     {
         string s = "CustomJournal" + jh.entrynumber;
         Modding.ReflectionHelper.SetField <EnemyDeathEffects, string>(ede, "playerDataName", s);
     }
     catch (Exception e)
     {
         Log("Journal Extentions", e);
     }
 }
Example #3
0
        private static void OnEmitInfected(On.EnemyDeathEffects.orig_EmitInfectedEffects orig, EnemyDeathEffects self)
        {
            self.EmitSound();

            if (self.GetAttr <GameObject>("corpse") != null)
            {
                var component = self.GetAttr <GameObject>("corpse").GetComponent <SpriteFlash>();

                if (component != null)
                {
                    component.FlashShadowRecharge();
                    component.flashShadeGet();
                }
            }

            GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake");
        }
Example #4
0
 private static void No(On.EnemyDeathEffects.orig_EmitEffects orig, EnemyDeathEffects self)
 {
     // no
 }
Example #5
0
 private static void EmitCorpse(On.EnemyDeathEffects.orig_EmitCorpse orig, EnemyDeathEffects self, float?attackdirection, bool iswatery, bool spellburn)
 {
     orig(self, attackdirection, true, true);
 }
    private static void EnemyDeathEffects_RecieveDeathEvent(On.EnemyDeathEffects.orig_RecieveDeathEvent orig, EnemyDeathEffects self, float?attackDirection, bool resetDeathEvent, bool spellBurn, bool isWatery)
    {
        if (self is EnemyDeathEffectsProxy)
        {
            var proxy = (EnemyDeathEffectsProxy)self;
            if (DeathEventFunc == null)
            {
                var deathEventMethod = typeof(ModHooks).GetMethod("OnRecieveDeathEvent", BindingFlags.Instance | BindingFlags.NonPublic);
                DeathEventFunc = (RecieveDeathDelegate)Delegate.CreateDelegate(typeof(RecieveDeathDelegate), deathEventMethod);
                DidFireField   = typeof(EnemyDeathEffects).GetField("didFire", BindingFlags.Instance | BindingFlags.NonPublic);
            }
            DeathEventFunc.Invoke(null, self, (bool)DidFireField.GetValue(self), ref attackDirection, ref resetDeathEvent, ref spellBurn, ref isWatery);
            self.GetComponent <IDeathEffects>().PlayDeathEffects(proxy.health.LastAttackInfo);

            //DeathEventFunc.Invoke(ModHooks.Instance, new object[] { self, DidFireField.GetValue(self), });
        }
        else
        {
            orig(self, attackDirection, resetDeathEvent, spellBurn, isWatery);
        }
    }
 private static void EnemyDeathEffects_EmitSound(On.EnemyDeathEffects.orig_EmitSound orig, EnemyDeathEffects self)
 {
     if (self is EnemyDeathEffectsProxy)
     {
         var proxy = (EnemyDeathEffectsProxy)self;
         self.GetComponent <IDeathEffects>().EmitSounds();
     }
     else
     {
         orig(self);
     }
 }
Example #8
0
 //gain soul when you kill an enemy
 private void OnKill(EnemyDeathEffects enemydeatheffects, string playerdataname, string killedboolplayerdatalookupkey, string killcountintplayerdatalookupkey, string newdataboolplayerdatalookupkey)
 {
     _soul = true;
     HeroController.instance.SoulGain();
     _soul = false;
 }