private bool BulletAttack_ProcessHit(On.RoR2.BulletAttack.orig_ProcessHit orig, BulletAttack self, ref BulletAttack.BulletHit hitInfo) { var retv = orig(self, ref hitInfo); if (hitInfo.hitHurtBox && hitInfo.hitHurtBox.name != "TempHurtbox") { bulletAttackDidHit = true; } return(retv); }
private bool BulletAttack_ProcessHit(On.RoR2.BulletAttack.orig_ProcessHit orig, BulletAttack self, ref BulletAttack.BulletHit hitInfo) { var retv = orig(self, ref hitInfo); if (!self.owner || !hitInfo.hitHurtBox) { return(retv); } var ob = self.owner.GetComponent <CharacterBody>(); var count = GetCount(ob); if (hitInfo.hitHurtBox.healthComponent && count > 0 && hitInfo.hitHurtBox.healthComponent != self.owner.GetComponent <HealthComponent>() && hitInfo.hitHurtBox.teamIndex == TeamComponent.GetObjectTeam(self.owner)) { new MsgHealTargetAndSelf(hitInfo.hitHurtBox.healthComponent, ob.healthComponent, count * self.procCoefficient, self.procChainMask) .Send(R2API.Networking.NetworkDestination.Server); } return(retv); }