static bool Prefix(ListCard __instance, bool useRemover) { var card = __instance; RunCtrl runCtrl = card.deCtrl.runCtrl; if (!CustomHell.IsHellEnabled(runCtrl, CustomHellPassEffect.TWO_REMOVES_FOR_PACT)) { return(true); } if (!IsNormalPact(card) || !useRemover) { return(true); } DeckScreen deckScreen = GetDeckScreen(card); if (deckScreen.busy) { return(true); } // This is clunky, but so is using a transpiler. if (runCtrl.currentRun.removals < HELL_PRICE) { PlayForbiddenEffect(card, deckScreen); return(false); } runCtrl.currentRun.removals -= HELL_PRICE; deckScreen.UpdateRemoverCountText(); PlayRemoveCardEffect(card); return(false); }
public static bool PlayCredits(MusicCtrl __instance, Ending ending) { MusicCtrl musicCtrl = __instance; if (CustomHell.IsHellEnabled(musicCtrl.runCtrl, CustomHellPassEffect.SPECIAL_CREDITS_THEME)) { Debug.Log("Custom hell credits achieved!"); if (ending == Ending.Genocide) { if (playGhostOfEden(musicCtrl)) { return(false); } } } return(true); // debugging var clip = MusicHelper.GetAudioClipOrNull(MusicHelper.GHOST_OF_EDEN_KEY); if (clip == null) { return(true); } Debug.Log("Playing hopefully"); __instance.StopIntroLoop(); __instance.Play(clip); return(false); }
static void DecreaseManaRegen(StatsScreen __instance, Player player = null) { StatsScreen statsScreen = __instance; // This is how the base function works if (player == null) { player = S.I.batCtrl?.currentPlayer; } if (player == null) { return; } if (!CustomHell.IsHellEnabled(player, CustomHellPassEffect.HALF_MANA_REGEN)) { return; } float manaRegenFromArtifacts = 0.0f; foreach (var a in player.artObjs) { manaRegenFromArtifacts += a.manaRegen; } // Debug.Log($"{manaRegenFromArtifacts} being halved. Old number was {player.manaRegen}"); player.manaRegen -= manaRegenFromArtifacts / 2; // Debug.Log($"{manaRegenFromArtifacts} being halved. New number is {player.manaRegen}"); }
static void SetFocusedBrand(FocusCtrl __instance) { var focusCtrl = __instance; var postCtrl = S.I.poCtrl; if (CustomHell.IsHellEnabled(S.I.runCtrl, CustomHellPassEffect.DOUBLE_FOCUS_LUCK_PENALTY) && HasDoubleFocus(focusCtrl)) { Debug.Log("Double focus; decreasing focus luck"); postCtrl.focusLuck -= DOUBLE_FOCUS_LUCK_PENALTY; focusCtrl.deCtrl.statsScreen.UpdateStatsText(null); } }
static void Postfix(Enemy __instance) { Enemy enemy = __instance; // enemy.ctrl.StartCoroutine(WinDebug(enemy)); // return; if (!CustomHell.IsHellEnabled(enemy.runCtrl, CustomHellPassEffect.NO_BUSY_ROOM_SLOWDOWN)) { return; } var newDelay = enemy.baseLoopDelay * EnemyDelayMultiplier(enemy) * SlowStartMultiplier(enemy); singletonDelayTracker.trackDelay(enemy, enemy.beingObj.loopDelay, newDelay); enemy.beingObj.loopDelay = newDelay; }
static int GetAdjustment(Boss boss) { if (!CustomHell.IsHellEnabled(boss.runCtrl, CustomHellPassEffect.LATE_BOSSES_HARDER)) { return(0); } // 3455667 // - 3445566 // = 0010101 switch (boss.runCtrl.currentRun.worldTierNum) { case 2: case 4: case 6: return(1); default: return(0); } }
private static bool shouldRunHack(ItemObject itemObj, FTrigger fTrigger, Being hitBeing) { if (itemObj.spellObj == null) { return(false); } SpellObject obj = itemObj.spellObj; if (!(fTrigger == FTrigger.OnHit && CustomHell.IsHellEnabled(obj?.ctrl?.runCtrl, CustomHellPassEffect.LOSE_DEF_ON_HIT) && SELF_DAMAGE_SPELLS.Contains(obj.itemID))) { return(false); } Player player = hitBeing?.player; if (!player) { Debug.LogWarning($"Unexpected hitBeing for ${obj.itemID} (${hitBeing}, ${hitBeing?.player}); moving on"); return(false); } return(true); }