Example #1
0
        public static void Proc(EntModProjectile proj, NPC target, int damage)
        {
            int   statloss = 0;
            float basestat = proj.statchance;

reproc:
            float stat = statloss == 0?basestat:(basestat - (100 * statloss)) / (statloss + 1);

            if (stat >= Main.rand.NextFloat(0, 100))
            {
                int stattype = Entropy.StatTypeCalc(proj.dmgratio);

                /*if(stattype == 0){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else if(stattype == 1){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else if(stattype == 2){
                 *      target.AddBuff(ModContent.BuffType("SlashProc"), 600);
                 * }else{*/
                //if(Entropy.dmgtypes[stattype] == "Slash" && !target.HasBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc")))target.AddBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc"), 1);
                //Main.NewText(Entropy.dmgtypes[stattype]+"Proc");
                //target.AddBuff(ModContent.BuffType(Entropy.dmgtypes[stattype]+"Proc"), (int)(item.item.damage*0.35));
                BuffBase buff = BuffBase.GetFromIndex(target, stattype, damage, Main.player[proj.projectile.owner]);
                EntropyGlobalNPC.AddBuff(buff);
                //Main.NewText(buff);
                //Dust.NewDust(target.Center - new Vector2(0,target.height/2),0,0,mod.DustType(Entropy.dmgtypes[stattype]+"ProcDust"));
                //}
            }
            if (proj.reproc && (stat - 100) > 0)
            {
                statloss++;
                goto reproc;
            }
        }
Example #2
0
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            if (player.altFunctionUse == 2)
            {
                type = ModContent.ProjectileType <SovnusSlug>();
                Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 38, pitchOffset: 0f);
            }
            else
            {
                type = ModContent.ProjectileType <SovnusSpread>();
                Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 38, pitchOffset: 0.15f).Volume = 0.65f;
            }
            if (type == ModContent.ProjectileType <SovnusSlug>())
            {
                if (ability == 1)
                {
                    type       = ModContent.ProjectileType <SovnusDash>();
                    speedX    *= 1.5f;
                    speedY    *= 1.5f;
                    damage    *= 3;
                    knockBack *= 3;
                    position   = player.position;
                    int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, item.owner);
                    Main.projectile[proj].maxPenetrate += punchthrough;
                    Main.projectile[proj].penetrate    += punchthrough;
                    EntModProjectile p = Main.projectile[proj].modProjectile as EntModProjectile;
                    if (p != null)
                    {
                        p.critcombo = critcomboboost;
                    }
                    return(false);
                }
                return(base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack));
            }
            damage /= 5;
            Vector2 vec = new Vector2(speedX, speedY);

            position += vec;
            for (int i = 0; i < 6; i++)
            {
                Vector2 vec2 = vec.RotatedByRandom(0.2f);
                speedX = vec2.X;
                speedY = vec2.Y;
                base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
            }
            return(false);
        }
Example #3
0
        /*
         * public void CastAbility(int i){
         *      Player player = Main.player[item.owner];
         *      switch(i){
         *              case 1:
         *              if(!player.CheckMana(50, true))return;
         *              Projectile.NewProjectile(player.Center, (Main.MouseWorld-player.Center).SafeNormalize(new Vector2())*7.5f, ModContent.ProjectileType<VoxAbility>(), realdmg, 15, player.whoAmI);
         *              Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 38, pitchOffset:-0.55f);
         *              break;
         *              case 2:
         *              if(!player.CheckMana(75, true))return;
         *              Projectile.NewProjectile(player.Center, (Main.MouseWorld-player.Center).SafeNormalize(new Vector2())*7.5f, ModContent.ProjectileType<SovnusAbility>(), realdmg/3, 1, player.whoAmI);
         *              Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 8, pitchOffset:-0.55f);
         *              break;
         *              case 3:
         *              if(!player.CheckMana(75, true))return;
         *              Projectile.NewProjectile(player.Center, (Main.MouseWorld-player.Center).SafeNormalize(new Vector2())*7.5f, ModContent.ProjectileType<SovnusAbility>(), realdmg, 15, player.whoAmI, 1);
         *              Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 8, pitchOffset:-0.55f);
         *              break;
         *      }
         * }//*/
        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            if (player.altFunctionUse == 2)
            {
                //Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 38, pitchOffset:0f);
                switch (ability)
                {
                case 0:
                    if (!player.CheckMana((int)(35 * player.manaCost), true))
                    {
                        break;
                    }
                    type = ModContent.ProjectileType <VizenSmite>();
                    Projectile.NewProjectileDirect(Main.MouseWorld, new Vector2(), type, damage, 0, item.owner, 1).penetrate = 60;
                    Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 68, pitchOffset: 0.15f).Volume  = 0.45f;
                    Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 117, pitchOffset: 0.15f);
                    break;

                case 1:
                    type       = ModContent.ProjectileType <VizenSlash>();
                    speedX    *= 0.75f;
                    speedY    *= 0.75f;
                    knockBack *= 3;
                    position   = player.position;
                    int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, item.owner);
                    Main.projectile[proj].maxPenetrate += punchthrough;
                    Main.projectile[proj].penetrate    += punchthrough;
                    EntModProjectile p = Main.projectile[proj].modProjectile as EntModProjectile;
                    if (p != null)
                    {
                        p.dmgratio  = p.dmgratiobase = dmgratio;
                        p.critcombo = critcomboboost;
                    }
                    break;

                case 2:
                    if (!player.CheckMana((int)(50 * player.manaCost), true))
                    {
                        break;
                    }
                    int id = ModContent.BuffType <Renewal>();
                    for (int i = 0; i < Main.player.Length; i++)
                    {
                        Player target = Main.player[i];
                        if (target.active && target.team == player.team)
                        {
                            target.AddBuff(id, 300);
                        }
                    }
                    break;

                case 3:
                    if (!player.CheckMana((int)(35 * player.manaCost), true))
                    {
                        break;
                    }
                    type = ModContent.ProjectileType <VizenSmite>();
                    Vector2 vec2 = new Vector2(Main.lastMouseX + Main.screenPosition.X, Main.lastMouseY + Main.screenPosition.Y);
                    Vector2 vec3 = Main.MouseWorld;
                    vec3      = (vec3 - vec2).SafeNormalize(new Vector2()) * 32;
                    speedX    = vec3.X;
                    speedY    = vec3.Y;
                    damage   /= 3;
                    knockBack = 0;
                    position  = Main.MouseWorld;
                    base.Shoot(player, ref vec2, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
                    Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 68, pitchOffset: 0.15f).Volume = 0.45f;
                    Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 117, pitchOffset: 0.15f);
                    break;
                }
                return(false);
            }
            else
            {
                type = ModContent.ProjectileType <VizenShot>();
                Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 38, pitchOffset: 0.15f).Volume = 0.55f;
                Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 40, pitchOffset: 0.15f).Volume = 0.45f;
                Main.PlaySound(SoundID.Item, (int)player.Center.X, (int)player.Center.Y, 89, pitchOffset: 0.15f);
            }
            Vector2 vec = new Vector2(speedX, speedY);

            position += vec;
            vec       = vec.RotatedByRandom(0.02f);
            speedX    = vec.X;
            speedY    = vec.Y;
            base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
            return(false);
        }
Example #4
0
        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;
            }
        }