public override void Update(Player player, ref int buffIndex) { AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); modPlayer.sanityRegen += 3; modPlayer.AddSanityRegen(3, "SanityPotion"); }
public override void OnCraft(Recipe recipe) { Player player = Main.player[Main.myPlayer]; AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); if (!MyWorld.awakenedMode) { Main.NewText("Enable Awakened Mode for this book to have any functionality"); } }
public static void Update() { if (Main.gameMenu) { return; } var mod = ModLoader.GetMod("ElementsAwoken"); Player player = Main.player[Main.myPlayer]; AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); transparency = MathHelper.Lerp(0.2f, 0f, modPlayer.sanity / (modPlayer.sanityMax * 0.5f)); gbValues = (int)Math.Round(MathHelper.Lerp(155, 255, modPlayer.sanity / (modPlayer.sanityMax * 0.5f))); }
public override bool CanKillTile(int i, int j, int type, ref bool blockDamaged) { Player player = Main.player[Main.myPlayer]; AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); if (player.position.Y > Main.maxTilesY * .25f * 16) { modPlayer.mineTileCooldown = modPlayer.mineTileCooldownMax; // 3 minutes of not mining resets the mining countdown //ElementsAwoken.DebugModeText("digging tile below surface"); } return(base.CanKillTile(i, j, type, ref blockDamaged)); }
public override bool UseItem(Player player) { AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); if (player.altFunctionUse != 2) { modPlayer.sanity++; } else { modPlayer.sanity--; } return(true); }
public override void RightClick(Player player) { AwakenedPlayer modPlayer = player.GetModPlayer <AwakenedPlayer>(mod); if (MyWorld.awakenedMode) { if (!modPlayer.openSanityBook) { modPlayer.openSanityBook = true; } else { modPlayer.openSanityBook = false; } } else { modPlayer.openSanityBook = false; } item.stack++; }
public override void Update(Player player, ref int buffIndex) { AwakenedPlayer modPlayer = player.GetModPlayer<AwakenedPlayer>(mod); modPlayer.sanityRegen = -5; }