public override bool CanUseItem(Item item, Player player) { FargoSoulsPlayer modPlayer = player.GetModPlayer <FargoSoulsPlayer>(); if (modPlayer.NoUsingItems) { return(false); } //if (modPlayer.AdamantiteEnchantActive && modPlayer.AdamantiteCD == 0) //{ //// ??? tm //} //dont use hotkeys in stasis if (player.HasBuff(ModContent.BuffType <GoldenStasis>())) { if (item.type == ItemID.RodofDiscord) { player.ClearBuff(ModContent.BuffType <GoldenStasis>()); } else { return(false); } } if (item.DamageType == DamageClass.Magic && player.GetModPlayer <FargoSoulsPlayer>().ReverseManaFlow) { int damage = (int)(item.mana / (1f - player.endurance) + player.statDefense); player.Hurt(PlayerDeathReason.ByCustomReason(player.name + " was destroyed by their own magic."), damage, 0); player.immune = false; player.immuneTime = 0; } if (modPlayer.BuilderMode && (item.createTile != -1 || item.createWall != -1) && item.type != ItemID.PlatinumCoin && item.type != ItemID.GoldCoin) { item.useTime = 1; item.useAnimation = 1; } if (item.damage > 0 && player.HasAmmo(item) && !(item.mana > 0 && player.statMana < item.mana) && //non weapons and weapons with no ammo begone item.type != ItemID.ExplosiveBunny && item.type != ItemID.Cannonball && item.useTime > 0 && item.createTile == -1 && item.createWall == -1 && item.ammo == AmmoID.None && item.hammer == 0 && item.pick == 0 && item.axe == 0) { modPlayer.TryAdditionalAttacks(item.damage, item.DamageType); } // //critter attack timer // if (modPlayer.WoodEnchant && player.altFunctionUse == ItemAlternativeFunctionID.ActivatedAndUsed && item.makeNPC > 0) // { // if (modPlayer.CritterAttackTimer == 0) // { // Vector2 vel = Vector2.Normalize(Main.MouseWorld - player.Center); // float damageMultiplier = player.GetDamage(DamageClass.Summon); // int type = -1; // int damage = 0; // int attackCooldown = 0; // switch (item.type) // { // //case ItemID.Bunny: // // type = ProjectileID.ExplosiveBunny; // // damage = 10; // // attackCooldown = 10; // // break; // case ItemID.Bird: // type = ModContent.ProjectileType<BirdProj>(); // damage = 15; // attackCooldown = 15; // break; // case ItemID.BlueJay: // type = ModContent.ProjectileType<BlueJayProj>(); // damage = 10; // attackCooldown = 10; // break; // case ItemID.Cardinal: // type = ModContent.ProjectileType<CardinalProj>(); // damage = 20; // attackCooldown = 20; // break; // } // if (type != -1) // { // Projectile.NewProjectile(player.Center, vel * 2f, type, damage, 2, player.whoAmI); // modPlayer.CritterAttackTimer = attackCooldown; // } // } // return false; // } if (item.type == ItemID.RodofDiscord && player.chaosState) { player.GetModPlayer <FargoSoulsPlayer>().WasHurtBySomething = true; //with abom rebirth, die to chaos state } if (item.damage > 0 && (item.DamageType == DamageClass.Melee || item.DamageType == DamageClass.Ranged || item.DamageType == DamageClass.Magic) && item.pick == 0 && item.axe == 0 && item.hammer == 0) { player.GetModPlayer <FargoSoulsPlayer>().WeaponUseTimer = Math.Max(item.useTime + item.reuseDelay, 30); } return(true); }