Exemplo n.º 1
0
 private static int getCollectedHeartGems(orig_get_HeartGems orig, HeartGemDoor self)
 {
     if (self is MiniHeartDoor)
     {
         return(SaveData.Instance.GetLevelSetStatsFor((self as MiniHeartDoor).levelSet).TotalHeartGems);
     }
     return(orig(self));
 }
        private static int getCollectedHeartGems(orig_get_HeartGems orig, HeartGemDoor self)
        {
            if (self is MiniHeartDoor selfMiniHeartDoor)
            {
                if (selfMiniHeartDoor.ForceAllHearts)
                {
                    // door was told to pretend all hearts were collected, so just do that
                    return(self.Requires);
                }

                // otherwise, check how many hearts we have for the door's assigned level set
                return(SaveData.Instance.GetLevelSetStatsFor(selfMiniHeartDoor.levelSet).TotalHeartGems);
            }

            return(orig(self));
        }