public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { if (target.realLife != -1) { target = Main.npc[target.realLife]; } gNPC info = target.GetGlobalNPC <gNPC>(); info.voidBurn += damage; }
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { gNPC info = target.GetGlobalNPC <gNPC>(); if (target.life <= 0) { projectile.penetrate++; } info.parasiteOwner = projectile.owner; info.parasiteTimeLeft = 360; }
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { if (projectile.width >= 80) { return; } target.AddBuff(BuffID.OnFire, 300); gNPC info = target.GetGlobalNPC <gNPC>(); info.numNeedlesHellfire++; if (info.numNeedlesHellfire >= 6) { info.numNeedlesHellfire = 0; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); for (int num507 = 0; num507 < 10; num507++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); } for (int num508 = 0; num508 < 5; num508++) { int num509 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2.5f); Main.dust[num509].noGravity = true; Main.dust[num509].velocity *= 3f; num509 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); Main.dust[num509].velocity *= 2f; } int num510 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num510].velocity *= 0.4f; Gore expr_10989_cp_0 = Main.gore[num510]; expr_10989_cp_0.velocity.X = expr_10989_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f; Gore expr_109B9_cp_0 = Main.gore[num510]; expr_109B9_cp_0.velocity.Y = expr_109B9_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f; num510 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); Main.gore[num510].velocity *= 0.4f; Gore expr_10A4D_cp_0 = Main.gore[num510]; expr_10A4D_cp_0.velocity.X = expr_10A4D_cp_0.velocity.X + (float)Main.rand.Next(-10, 11) * 0.1f; Gore expr_10A7D_cp_0 = Main.gore[num510]; expr_10A7D_cp_0.velocity.Y = expr_10A7D_cp_0.velocity.Y + (float)Main.rand.Next(-10, 11) * 0.1f; if (projectile.owner == Main.myPlayer) { projectile.penetrate = -1; projectile.position.X = projectile.position.X + (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); projectile.width = 80; projectile.height = 80; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.damage = (int)((60 * Main.player[projectile.owner].thrownDamage) + (Math.Min(80, target.lifeMax * .04))); projectile.Damage(); projectile.Kill(); } } }
public override void Kill(int timeLeft) { if (stuckTarget != null) { gNPC info = stuckTarget.GetGlobalNPC <gNPC>(); info.lightSpearCount -= 10; } for (int i = 0; i < 50; i++) { int d = Dust.NewDust(new Vector2(projectile.position.X - 16, projectile.position.Y), projectile.width, projectile.height, 57, (projectile.velocity.X + Main.rand.Next(-2, 3)) * .2f, (projectile.velocity.Y + Main.rand.Next(-2, 3)) * .2f, 100, Color.White, 3f); } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 25); }
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { projectile.ai[0] = 1f; projectile.ai[1] = target.whoAmI; gNPC info = target.GetGlobalNPC <gNPC>(); info.lightSpearCount += 10; target.immune[projectile.owner] = 0; projectile.friendly = false; stuckTarget = target; projectile.timeLeft = 300; projectile.extraUpdates = 0; }
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { shotBonus++; if (crit) { shotBonus++; } if (shotBonus > 20) { shotBonus = 20; Main.PlaySound(12, player.position); } if (DoT > 0) { gNPC info = target.GetGlobalNPC <gNPC>(); info.gunbladeBurn += DoT * 60; DoT = 0; } }
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { gNPC info = target.GetGlobalNPC <gNPC>(); info.numNeedlesTeravolt++; if (info.numNeedlesTeravolt >= 6) { info.numNeedlesTeravolt = 0; if (!target.boss) { if (target.realLife != -1) { target = Main.npc[target.realLife]; } target.AddBuff(mod.BuffType("Stunned"), 40); } damage += (int)(180 * Main.player[projectile.owner].thrownDamage + Math.Min(250, target.lifeMax * .08)); Main.PlaySound(2, projectile.position, 93); } }
public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { if (moonIdol && crit && Main.rand.Next(0, 5) == 0) { damage *= 2; } if (gunbladeRangedDebuff > 0 && proj.ranged && crit) { gNPC info = target.GetGlobalNPC <gNPC>(); info.gunbladeRangedDebuff = gunbladeRangedDebuff; info.gunbladeRangedDebuffTime = 180; } if (duelistDraught) { if (duelistTarget == target.whoAmI) { damage = (int)(damage * 1.1); } duelistTarget = target.whoAmI; } }
public override void ModifyHitNPC(Item item, NPC target, ref int damage, ref float knockback, ref bool crit) { if (moonIdol && crit && Main.rand.Next(0, 5) == 0) { damage *= 2; } if (gunbladeMeleeDebuff > 0 && item.melee && crit) { gNPC info = target.GetGlobalNPC <gNPC>(); info.gunbladeMeleeDebuff = gunbladeMeleeDebuff; info.gunbladeMeleeDebuffTime = 180; } if (duelistDraught) { if (duelistTarget == target.whoAmI) { damage = (int)(damage * 1.1); } duelistTarget = target.whoAmI; } }
public override void HandlePacket(BinaryReader reader, int whoAmI) { if (!reader.ReadString().Contains("Prefixes")) { return; } //packet should contain npc.whoAmI and all prefixes/suffixes; this is where prefixes will be applied. Need to handle basic stats here too. int npcIndex = reader.ReadInt32(); NPC npc = Main.npc[npcIndex]; gNPC info = GetGlobalNPC <gNPC>(); info.readyForChecks = true; string prefixes = ""; string suffixes = ""; try { bool hasPrefix = reader.ReadBoolean(); if (hasPrefix) { prefixes = reader.ReadString(); } bool hasSuffix = reader.ReadBoolean(); if (hasSuffix) { suffixes = reader.ReadString(); } } catch { Main.NewText("Failed to get prefix"); ErrorLogger.Log("Error getting prefixes from server"); } info.prefixes = prefixes; info.suffixes = suffixes; string addToName = prefixes.Replace("#", ""); npc.GivenName = addToName + npc.GivenName + suffixes; //handle basic stats here if (prefixes.Contains("Rare")) { npc.lifeMax *= 2; npc.life = npc.lifeMax; } if (prefixes.Contains("Actually-A-Penguin")) { npc.catchItem = 2205; } if (prefixes.Contains("Actually-A-Bird")) { npc.catchItem = 2015; } if (prefixes.Contains("Tough")) { npc.lifeMax = (int)(npc.lifeMax * 1.5); npc.life = npc.lifeMax; } if (prefixes.Contains("Dangerous")) { npc.damage = (int)(npc.damage * 1.4); } if (prefixes.Contains("Armored")) { npc.defense = (int)(npc.defense * 1.2 + 4); } if (prefixes.Contains("Small")) { npc.scale *= .7f; } if (prefixes.Contains("Big")) { npc.scale *= 1.4f; } if (prefixes.Contains("Persistent")) { npc.knockBackResist /= 1.5f; } if (prefixes.Contains("Enduring")) { npc.takenDamageMultiplier *= .8f; } if (prefixes.Contains("Colossal")) { npc.scale *= 1.8f; npc.damage = (int)(npc.damage * 1.2); } if (prefixes.Contains("Miniature")) { npc.scale *= .45f; npc.damage = (int)(npc.damage * .8); } if (prefixes.Contains("Generous")) { npc.value *= 2; } if (prefixes.Contains("Philanthropic")) { npc.value *= 3; } if (suffixes.Contains("the Juggernaut")) { npc.defense *= 2; npc.lifeMax *= 3; npc.life = npc.lifeMax; npc.knockBackResist = 0; npc.scale *= 1.3f; } if (suffixes.Contains("the Reaper")) { npc.defense /= 2; npc.lifeMax = (int)(npc.lifeMax * .666); } if (suffixes.Contains("the Immortal")) { info.lives = 8; } if (suffixes.Contains("the Nullifier")) { for (int i = 0; i < npc.buffImmune.Length; i++) { npc.buffImmune[i] = true; } } if (suffixes.Contains("the Master Ninja")) { npc.damage = (int)(npc.damage * 1.5); } string[] allPfix = prefixes.Split('#'); npc.value = allPfix.Length * 1.5f; if (suffixes.Length > 0) { npc.value *= 5; } //base.HandlePacket(reader, whoAmI); }