private void InvalidateAchievement(On.EntityStates.Captain.Weapon.CallSupplyDropBase.orig_OnEnter orig, CallSupplyDropBase self) { orig(self); SupportAchievementHandler component = self.characterBody.master.gameObject.GetComponent <SupportAchievementHandler>(); if (component) { component.Invalidate(); } }
private void ResetCaptainComponent(Stage stage) { if (base.meetsBodyRequirement) { SupportAchievementHandler component = base.localUser.cachedMasterController.master.gameObject.GetComponent <SupportAchievementHandler>(); if (!component) { component = base.localUser.cachedMasterController.master.gameObject.AddComponent <SupportAchievementHandler>(); } component.Revalidate(); } }
private void CheckCaptainComponent(TeleporterInteraction interaction) { if (base.isUserAlive && base.meetsBodyRequirement) { SupportAchievementHandler component = base.localUser.cachedMasterController.master.gameObject.GetComponent <SupportAchievementHandler>(); if (!component) { component = base.localUser.cachedMasterController.master.gameObject.AddComponent <SupportAchievementHandler>(); } if (component.IsValid()) { PlayerStatsComponent statsComponent = base.localUser.cachedStatsComponent; if (statsComponent && statsComponent.currentStats.GetStatValueULong(StatDef.highestStagesCompleted) >= 2UL) { base.Grant(); } } } }