Example #1
0
 // Token: 0x06000FA0 RID: 4000 RVA: 0x000447EC File Offset: 0x000429EC
 private void OnTriggerStay(Collider other)
 {
     if (NetworkServer.active)
     {
         if (this.previousColliderList.Contains(other))
         {
             return;
         }
         this.previousColliderList.Add(other);
         CharacterBody component = other.GetComponent <CharacterBody>();
         if (component && component.mainHurtBox)
         {
             DamageOrb damageOrb = new DamageOrb();
             damageOrb.attacker        = null;
             damageOrb.damageOrbType   = DamageOrb.DamageOrbType.ClayGooOrb;
             damageOrb.procCoefficient = this.procCoefficient;
             damageOrb.damageValue     = this.baseDamage * Run.instance.teamlessDamageCoefficient;
             damageOrb.target          = component.mainHurtBox;
             damageOrb.teamIndex       = TeamIndex.None;
             RaycastHit raycastHit;
             if (Physics.Raycast(damageOrb.target.transform.position + UnityEngine.Random.insideUnitSphere * 3f, Vector3.down, out raycastHit, 1000f, LayerIndex.world.mask))
             {
                 damageOrb.origin = raycastHit.point;
                 OrbManager.instance.AddOrb(damageOrb);
             }
         }
     }
 }
Example #2
0
        //tar healing tar-immune enemies
        private void DamageOrb_OnArrival(On.RoR2.Orbs.DamageOrb.orig_OnArrival orig, DamageOrb self)
        {
            bool          hasBody = self != null && self.attacker;
            CharacterBody body    = null;

            if (hasBody)
            {
                body    = self.attacker.GetComponent <CharacterBody>();
                hasBody = body;
            }
            if (hasBody)
            {
                healingSourceStack.Push(body);
            }
            orig(self);
            if (hasBody)
            {
                healingSourceStack.Pop();
            }
        }