public override void AI() { Player player = Main.player[projectile.owner]; YoshiPlayer modPlayer = player.GetModPlayer <YoshiPlayer>(mod); if (player.dead) { modPlayer.examplePet = false; } if (modPlayer.examplePet) { projectile.timeLeft = 2; } }
public override void Update(Player player, ref int buffIndex) { player.buffImmune[BuffID.Confused] = true; player.buffTime[buffIndex] = 18000; YoshiPlayer modPlayer = (YoshiPlayer)player.GetModPlayer(mod, "YoshiPlayer"); modPlayer.examplePet = true; bool petProjectileNotSpawned = true; if (player.ownedProjectileCounts[mod.ProjectileType("HintBlock")] > 0) { petProjectileNotSpawned = false; } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("HintBlock"), 0, 0f, player.whoAmI, 0f, 0f); } }
public override void Update(Player player, ref int buffIndex) { player.noFallDmg = true; player.accFlipper = true; player.doubleJumpUnicorn = true; player.spikedBoots = 1; player.dash = 20; player.buffTime[buffIndex] = 18000; YoshiPlayer modPlayer = (YoshiPlayer)player.GetModPlayer(mod, "YoshiPlayer"); modPlayer.examplePet = true; bool petProjectileNotSpawned = true; if (player.ownedProjectileCounts[mod.ProjectileType("ChainChomp")] > 0) { petProjectileNotSpawned = false; } if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) { Projectile.NewProjectile(player.position.X + player.width / 2, player.position.Y + player.height / 2, 0f, 0f, mod.ProjectileType("ChainChomp"), 0, 0f, player.whoAmI, 0f, 0f); } }