public static void inheritShamanBond(Projectile projectileReference, Projectile projectile) { OrchidModGlobalProjectile modProjectileReference = projectileReference.GetGlobalProjectile <OrchidModGlobalProjectile>(); OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); modProjectile.shamanEmpowermentType = modProjectileReference.shamanEmpowermentType; }
public override void OnHitNPCWithProj(Projectile projectile, NPC target, int damage, float knockback, bool crit) { OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); if (modProjectile.shamanProjectile) { OrchidModShamanHelper.OnHitNPCWithProjShaman(projectile, target, damage, knockback, crit, player, this, mod); } }
public override bool?CanHitNPC(Projectile projectile, NPC target) { OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); Player player = Main.player[projectile.owner]; if (modProjectile.gamblerDummyProj) { if (target.type != 488 && player.HeldItem.type != ItemType <Gambler.GamblerDummyTest>()) { return(false); } } return(null); }
public static int spawnGenericExplosion(Projectile projectile, int damage, float kb, int dimensions = 250, int damageType = 0, bool explosionGore = false, int soundType = 14) { if (soundType != 0) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, soundType); } if (explosionGore) { OrchidModProjectile.spawnExplosionGore(projectile); } int projType = ModContent.ProjectileType <General.Projectiles.GenericExplosion>(); int newProjectileInt = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, projType, damage, kb, projectile.owner); Projectile newProjectile = Main.projectile[newProjectileInt]; newProjectile.width = dimensions; newProjectile.height = dimensions; newProjectile.position.X = projectile.Center.X - (newProjectile.width / 2); newProjectile.position.Y = projectile.Center.Y - (newProjectile.width / 2); newProjectile.netUpdate = true; if (damageType != 0) { OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); OrchidModGlobalProjectile modProjectileNew = newProjectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); modProjectileNew.baseCritChance = modProjectile.baseCritChance; if (damageType == 1) { modProjectileNew.shamanProjectile = true; } if (damageType == 2) { modProjectileNew.alchemistProjectile = true; } if (damageType == 3) { modProjectileNew.gamblerProjectile = true; } if (damageType == 4) { modProjectileNew.dancerProjectile = true; } } return(newProjectileInt); }
public override void ModifyHitNPCWithProj(Projectile projectile, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); if (modProjectile.alchemistProjectile) { if (Main.rand.Next(101) <= this.alchemistCrit + modProjectile.baseCritChance) { crit = true; } else { crit = false; } } if (modProjectile.gamblerProjectile) { if (Main.rand.Next(101) <= this.gamblerCrit + modProjectile.baseCritChance) { crit = true; } else { crit = false; } OrchidModGamblerHelper.ModifyHitNPCWithProjGambler(projectile, target, ref damage, ref knockback, ref crit, ref hitDirection, player, this, mod); } if (modProjectile.shamanProjectile) { if (Main.rand.Next(101) <= this.shamanCrit + modProjectile.baseCritChance) { crit = true; } else { crit = false; } OrchidModShamanHelper.ModifyHitNPCWithProjShaman(projectile, target, ref damage, ref knockback, ref crit, ref hitDirection, player, this, mod); } }
public static void setShamanBond(Projectile projectile, int empowermentType) { OrchidModGlobalProjectile modProjectile = projectile.GetGlobalProjectile <OrchidModGlobalProjectile>(); modProjectile.shamanEmpowermentType = empowermentType; }