// Light weight, less flexible, but much safer public override bool CanUseItem(Player player) { if (PlayerFX.DualItemCanUseItemAlt(player, this, 28f / 15f, 1f, 1f, 1f)) { item.useStyle = 5; // Doesn't set for other clients normally item.UseSound = SoundID.Item8; // Doesn't play for other clients normally item.useTurn = false; item.magic = true; item.melee = false; item.noMelee = true; player.itemTime = 0; item.pick = 0; item.shoot = ProjectileID.Spark; } else { // we can take advantage of the fact that CanUseItem never gets called by // clients if it was an alt function item.useStyle = 1; item.UseSound = SoundID.Item1; item.useTurn = true; item.magic = false; item.melee = true; item.noMelee = false; player.manaCost = 0f; item.pick = 35; item.shoot = 0; // No projectile } return(true); }
public override bool CanUseItem(Player player) { if (PlayerFX.DualItemCanUseItemAlt(player, this, 1f, 1f, 1f, 0.4f)) { item.useAmmo = AmmoID.Rocket; item.shoot = ProjectileID.RocketI; } else { item.useAmmo = AmmoID.Bullet; item.shoot = ProjectileID.Bullet; } return(true); }
// Light weight, less flexible, but much safer public override bool CanUseItem(Player player) { if (PlayerFX.DualItemCanUseItemAlt(player, this, 1f, 1f, 1f, 0.25f)) { item.useStyle = 5; item.UseSound = SoundID.Item68; item.noMelee = true; player.manaCost *= 4f; item.shoot = mod.ProjectileType <Projectiles.ManaBolt>(); } else { item.useStyle = 1; item.UseSound = SoundID.Item28; item.noMelee = false; item.shoot = mod.ProjectileType <Projectiles.ManaBlast>(); } return(true); }
// Light weight, less flexible, but much safer public override bool CanUseItem(Player player) { float altAnim = 32f; float mainTime = 3f; if (PlayerFX.DualItemCanUseItemAlt(player, this, 1f, 1f, // 32 + 9(extra shots) / 12, 3f/32f -> ~27 (altAnim + 3f * mainTime) / (altAnim / mainTime), mainTime / altAnim)) { item.UseSound = SoundID.Item38; // Doesn't play for other clients normally item.reuseDelay = 0; player.itemTime = 0; // gotta reset anytime we mess with item time divider } else { // we can take advantage of the fact that CanUseItem never gets called by // clients if it was an alt function item.UseSound = SoundID.Item31; item.reuseDelay = 14; } return(true); }