public override void ModifyHitNPC(NPC target, ref int damage, ref float knockBack, ref bool crit, ref int hitDirection) { AddBuff(new CorrEffect(target, (int)(damage * 0.75f), damage > 66?(int)(damage * 0.015f):1)); EntropyPlayer modPlayer = Main.player[projectile.owner].GetModPlayer <EntropyPlayer>(); modPlayer.comboadd(1); base.ModifyHitNPC(target, ref damage, ref knockBack, ref crit, ref hitDirection); }
public void ModEffectobsolete(int modid, float level) { Player player = Main.player[projectile.owner]; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); switch (modid) { default: break; } }
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockBack, ref bool crit, ref int hitDirection) { Player player = Main.player[projectile.owner]; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); //modPlayer.comboadd(); float[] dmgarray = Entropy.GetDmgRatio(damage, dmgratio); damage = (int)Entropy.DmgCalcNPC(dmgarray, target); int usedcrit = 0; if (projectile.melee) { usedcrit = player.meleeCrit; } else if (projectile.ranged) { usedcrit = player.rangedCrit; } else if (projectile.magic) { usedcrit = player.magicCrit; } else if (projectile.thrown) { usedcrit = player.thrownCrit; } if (crit) { damage /= 2; } int cc = usedcrit; for (int i = cc; i > 0; i -= 100) { if (i < 100) { if (i < Main.rand.Next(0, 100)) { break; } } damage = (int)(damage * critDMG); } if (crit && critcombo != 0) { modPlayer.comboadd(critcombo); } PreProc(); Entropy.Proc(this, target, damage); PostProc(); }
public override void HoldItem(Player player) { base.HoldItem(player); addElement(3, 0.15f); dmgratio[3] += 0.85f; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); modPlayer.combocounter = RoundsLeft > 0?RoundsMax:0; item.autoReuse = false; reloading = Math.Max(reloading, 0); if (RoundsLeft <= 0 && reloading == 0) { reloading = 1; } }
public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) { EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); modPlayer.comboadd(1); modPlayer.Buffs.RemoveAll(PlayerBuffBase.GC); foreach (PlayerBuffBase i in modPlayer.Buffs) { i.ModifyHitItem(player, this, target, ref damage, ref crit, ref dmgratio); } float[] dmgarray = Entropy.GetDmgRatio(damage, dmgratio); damage = (int)Entropy.DmgCalcNPC(dmgarray, target); /*int cc = 0; * if(item.melee){ * cc = player.meleeCrit; * }else if(item.ranged){ * cc = player.rangedCrit; * }else if(item.magic){ * cc = player.magicCrit; * }else if(item.thrown){ * cc = player.thrownCrit; * } * if(crit){ * damage /= 2; * crit = false; * } * int ccolor = 0; * for(int i = cc; i > 0; i-=100){ * if(i < 100){ * if(i < Main.rand.Next(0,100))break; * } * damage = (int)(damage * critDMG); * crit = true; * if(++ccolor>1){ * Dust.NewDustPerfect(target.Center, 267, new Vector2(0,16).RotatedByRandom(0.5f)).noGravity = true; * } * }*/ if (crit) { damage = (int)(damage * critDMG / 2); } if (crit && critcomboboost != 0) { modPlayer.comboadd(critcomboboost); } Entropy.Proc(this, target, damage); }
public void CastAbility(int i) { Player player = Main.player[item.owner]; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); switch (i) { case 1: if (modPlayer.inferno > 0) { modPlayer.inferno = -1; return; } if (!player.CheckMana(item, (int)(50 * player.manaCost), true)) { return; } modPlayer.infernorate = 1f; modPlayer.inferno = EntropyPlayer.InfernoMax; Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 34, pitchOffset: -0.55f); break; case 2: if (!player.CheckMana(item, (int)(150 * player.manaCost), true)) { return; } if (modPlayer.inferno > 0) { modPlayer.infernorate = Math.Max(modPlayer.infernorate - 1.5f, 0.25f); modPlayer.inferno = Math.Min(modPlayer.inferno + EntropyPlayer.InfernoMax / 4, EntropyPlayer.InfernoMax); } Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType <GlassmakerBlast>(), player.GetWeaponDamage(item), item.knockBack * 1.5f, player.whoAmI); Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 34, 1f, -0.15f); break; case 3: if (modPlayer.inferno > 0) { modPlayer.infernorate = Math.Min(modPlayer.infernorate + 2f, 12.5f); } if (Projectile.NewProjectileDirect(player.Center, Vector2.Zero, ModContent.ProjectileType <GlassmakerTargeting>(), player.GetWeaponDamage(item), 0, player.whoAmI).modProjectile is GlassmakerTargeting p) { p.dmgratio = dmgratio; } break; } }
public override bool CanUseItem(Player player) { EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); if (player.altFunctionUse == 2) { if (modPlayer.combocounter > 0) { item.useTime = 8; item.useAnimation = 8; item.shoot = ModContent.ProjectileType <ClawFeather>(); item.useStyle = 5; item.autoReuse = false; modPlayer.comboadd(-1, 150); item.UseSound = SoundID.Item39; realcrit = basecrit = 5; statchance = basestat = 35; item.shootSpeed = 14.5f; } else { item.useTime = 18; item.useAnimation = 18; item.shoot = ModContent.ProjectileType <ClawFeather>(); item.useStyle = 5; item.autoReuse = false; item.UseSound = SoundID.Item39; realcrit = basecrit = 5; statchance = basestat = 15; item.shootSpeed = 7.5f; } } else { item.useTime = 10; item.useAnimation = 10; item.shoot = 0; item.useStyle = 1; item.autoReuse = true; item.UseSound = SoundID.Item1; realcrit = basecrit = 35; statchance = basestat = 5; } return(base.CanUseItem(player)); }
public override bool CanUseItem(Player player) { EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); //item.shoot = bullets[0].id; if (RoundsLeft <= 0) { player.itemAnimation = 0; return(false); } if (reloading > 0 && RoundsLeft >= RoundsMax) { reloading = 0; } item.noUseGraphic = player.altFunctionUse == 2; item.autoReuse = false; item.useTime = 1; item.useAnimation = 15; return(base.CanUseItem(player)); }
//float a; //float m; //float a2; //float m2; public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { //a = add; //m = mult; base.ModifyWeaponDamage(player, ref add, ref mult, ref flat); EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); if (modPlayer.inferno > 0) { float infernoPercent = (float)(1 - (Math.Round(modPlayer.inferno * 0.9) / EntropyPlayer.InfernoMax) * 0.9); mult /= 1 + infernoPercent / 4.5f; if (player.altFunctionUse == 2) { switch (ability) { case 0: mult *= 1 + infernoPercent * 4; break; case 1: break; case 2: mult *= 1 + infernoPercent; break; default: mult *= 1 + infernoPercent * 2; break; } } else { mult *= 1 + infernoPercent; } } //a2 = add; //m2 = mult; }
public override bool?CanHitNPC(NPC target) { Player player = Main.player[projectile.owner]; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); Vector2 pos = projectile.Center.constrained(target.TopLeft, target.BottomRight); int dist = (120 - projectile.timeLeft) * 8; Vector2 targetPos = target.Center; if (!target.friendly && (pos - projectile.Center).Length() <= dist && ((pos - targetPos - targetPos) - projectile.Center).Length() >= dist && projectile.localNPCImmunity[target.whoAmI] == 0) { if (!player.CheckMana(Entropy.ArbitraryCinder, (int)(40 * player.manaCost), true, hits++ > (player.statManaMax2 / (40 * player.manaCost)) * 5)) { projectile.Kill(); return(false); } if (target.aiStyle != 6 && target.aiStyle != 37) { AddBuff(new BlastEffect(target, target.boss?5:30)); } if (!target.buffImmune[BuffID.CursedInferno] && (!target.HasBuff <HeatEffect>() || Main.rand.Next(6) == 0)) { AddBuff(new HeatEffect(target, projectile.damage / (3 + target.CountBuff <HeatEffect>()), 180, 7, Main.player[projectile.owner], false)); } Projectile p = Projectile.NewProjectileDirect(target.Center, Vector2.Zero, ProjectileID.SolarWhipSwordExplosion, projectile.damage, 4, projectile.owner); p.direction = target.Center.X < projectile.Center.X?-1:1; p.magic = true; target.velocity.Y -= (target.knockBackResist + 0.25f) * 12; Main.PlaySound(SoundID.Item, (int)pos.X, (int)pos.Y, 34, 1f, -0.35f); projectile.localNPCImmunity[target.whoAmI] = projectile.localNPCHitCooldown; if (modPlayer.inferno > 0) { modPlayer.inferno = Math.Max(modPlayer.inferno - 30, 1); } return(true); } return(false); }
public override float MeleeSpeedMultiplier(Player player) { EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); return(combospeedmult == 0?1:(combospeedmult + 1) * comboMult(modPlayer.combocounter, combohits, comboDMG)); }
public void ModEffectobsolete(int modid, float level, int reenforcement) { Player player = Main.player[item.owner]; EntropyPlayer modPlayer = player.GetModPlayer <EntropyPlayer>(); int usedcrit = 0; if (item.melee) { usedcrit = player.meleeCrit; } else if (item.ranged) { usedcrit = player.rangedCrit; } else if (item.magic) { usedcrit = player.magicCrit; } else if (item.thrown) { usedcrit = player.thrownCrit; } level++; switch (modid) { case -1: //no damage dmgmult = 0; break; case 1: //base damage dmgmult += (level * 0.05); break; case 2: //base cc realcrit += (int)(usedcrit * (level * 0.10)); break; case 3: //base cd critDMG += (baseCD * (float)(level * 0.15)); break; case 4: //br combocritmult = (float)(level * 0.1); //realcrit = (float)((item.crit + usedcrit) * (1 + (((1 + level) * 0.15)*(1+(comboDMG*modPlayer.comboget()))))); //realcrit = (int)(basecrit * (1 + ((level * 0.15)*comboMult(modPlayer.combocounter, combohits, comboDMG)))); break; case 5: //ww combostatmult = (float)(level * 0.05); //statchance = (float)(basestat * (1 + ((level * 0.075)*comboMult(modPlayer.combocounter, combohits, comboDMG)))); break; case 6: //speed if (modPlayer.combocounter < combohits) { combospeedmult = 0; break; } //item.useAnimation = (int)(item.useAnimation / (1 + (((1 + level) * 0.15)*(1+(comboDMG*modPlayer.comboget()))))); //item.useTime = (int)(item.useTime / (1 + (((1 + level) * 0.15)*(1+(comboDMG*modPlayer.comboget()))))); combospeedmult = (float)(level * 0.0001); break; case 7: //base speed item.useTime = (int)(item.useTime * (1 - (0.1 * level))); item.useAnimation = (int)(item.useAnimation * (1 - (0.1 * level))); break; case 8: //slash dmgratio[0] += (float)(dmgratiobase[0] * (0.1 * level)); break; case 9: //impact dmgratio[1] += (float)(dmgratiobase[1] * (0.1 * level)); break; case 10: //puncure dmgratio[2] += (float)(dmgratiobase[2] * (0.1 * level)); break; case 11: //slash dmgratio[0] += (float)(dmgratiobase[0] * (0.2 * level)); break; case 12: //impact dmgratio[1] += (float)(dmgratiobase[1] * (0.2 * level)); break; case 13: //puncture dmgratio[2] += (float)(dmgratiobase[2] * (0.2 * level)); break; case 14: // addElement(3, level * 0.06f); break; case 15: // addElement(5, level * 0.06f); break; case 16: // addElement(4, level * 0.06f); break; case 17: // addElement(6, level * 0.06f); break; case 18: // critcomboboost = (int)level; break; case 19: // punchthrough += (int)level; break; case 20: //light+impact dmgratio[1] += (float)(dmgratiobase[1] * (0.10 * level)); dmgratio[11] += (float)(0.5 * reenforcement); break; default: break; } }
public void CastAbility(int i) { Player player = Main.player[item.owner]; int el = 13; if (element == 0) { el = 5; } else if (element == 1) { el = 3; } else if (element == 2) { el = 4; } else if (element == 3) { el = 6; } switch (i) { case 3: if (i == 3 && !player.CheckMana((int)(75 * player.manaCost), true)) { return; } EntModProjectile emp2 = Projectile.NewProjectileDirect(player.Center, new Vector2(), ModContent.ProjectileType <SekkalAbility2>(), (int)(player.GetWeaponDamage(item) * 1.5f), 0, player.whoAmI, el).modProjectile as EntModProjectile; if (emp2 != null) { emp2.dmgratio[el] = 1; } SoundEffectInstance eff = Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 20); eff.Volume = 1f; eff.Pitch = -1f; break; case 2: ElementBuff eb = player.GetBuff <ElementBuff>(); if (eb != null) { eb.isActive = false; el = eb.type; if (player.CheckMana((int)(15 * player.manaCost), true)) { goto case 3; } return; } if (!player.CheckMana((int)(50 * player.manaCost), true)) { return; } EntropyPlayer.AddBuff(new ElementBuff(player, 1800, el)); break; case 1: if (!player.CheckMana((int)((element == 2?2:25) * player.manaCost), true)) { return; } //int el = 13; int dmg = player.GetWeaponDamage(item); float speed = 9.5f; float spread = 0.06f; if (element == 0) { //el = 5; dmg = (int)(dmg * 1.25f); } else if (element == 1) { //el = 3; dmg = (int)(dmg * 1.75f); } else if (element == 2) { //el = 4; dmg = (int)(dmg * 2f); spread = 0.04f; } else if (element == 3) { //el = 6; dmg = (int)(dmg * 0.95f); } dmg /= 4; Vector2 vec = (Main.MouseWorld - (player.Top + new Vector2(player.direction * 3, 14))); if (vec.X != 0) { player.direction = vec.X > 1?1:-1; } for (float i2 = -2; i2 < 3; i2++) { if (element == 2) { i2 = (Main.rand.NextFloat(4) - 2); } EntModProjectile emp = (Projectile.NewProjectileDirect(player.Top + new Vector2(player.direction * 3, 14), vec.SafeNormalize(new Vector2()).RotatedBy(i2 * spread) * speed, ModContent.ProjectileType <SekkalAbility>(), dmg, 1, player.whoAmI).modProjectile as EntModProjectile); if (emp != null) { emp.dmgratio[el] = 1; } if (element == 2) { break; } } break; default: element = (element + 1) % 4; break; } }