示例#1
0
 private void AddBulletAchievementComponent()
 {
     if (base.meetsBodyRequirement && base.isUserAlive)
     {
         if (base.localUser != null && base.localUser.cachedBody != null)
         {
             BulletAchievementHandler bingus = base.localUser.cachedBody.gameObject.GetComponent <BulletAchievementHandler>();
             if (!bingus)
             {
                 bingus = base.localUser.cachedBody.gameObject.AddComponent <BulletAchievementHandler>();
             }
         }
     }
 }
示例#2
0
 private void BulletAchievementComponentHandler(On.RoR2.GlobalEventManager.orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
 {
     orig(self, damageReport);
     if (base.meetsBodyRequirement && base.isUserAlive)
     {
         if (damageReport.attacker)
         {
             if (damageReport.attacker.GetComponent <CharacterBody>().master.netId != null && damageReport.attacker.GetComponent <CharacterBody>().master.netId == base.localUser.cachedMasterController.master.netId)
             {
                 BulletAchievementHandler component = damageReport.attacker.GetComponent <BulletAchievementHandler>();
                 if (!component)
                 {
                     component = damageReport.attacker.AddComponent <BulletAchievementHandler>();
                 }
                 component.AddKill();
                 if (component.IsReqMet())
                 {
                     base.Grant();
                 }
             }
         }
     }
 }