示例#1
0
        public void ReloadGunF()
        {
            Player          player    = Main.player[Main.myPlayer];
            ElementalPlayer modPlayer = player.GetModPlayer <ElementalPlayer>();

            modPlayer.reloadgun = true;
            //player.HeldItem.ReloadGun();
        }
示例#2
0
        public override bool CanBeHitByProjectile(Projectile proj)
        {
            ElementalPlayer modPlayer = player.GetModPlayer <ElementalPlayer>();

            if (modPlayer.reflect)
            {
                return(false);
            }
            return(base.CanBeHitByProjectile(proj));
        }
示例#3
0
        public void Stone()
        {
            Player          player    = Main.player[Main.myPlayer];
            ElementalPlayer modPlayer = player.GetModPlayer <ElementalPlayer>();

            modPlayer.stone = !modPlayer.stone;
            if (!modPlayer.stone && player.HasBuff(BuffType("StoneDamageDebuff")))
            {
                PlayerDeathReason YUdie = new PlayerDeathReason();
                YUdie.SourceCustomReason = player.name + " got too stoned.";
                player.Hurt(YUdie, player.buffTime[player.FindBuffIndex(BuffType("StoneDamageDebuff"))], 0);
                player.DelBuff(player.FindBuffIndex(BuffType("StoneDamageDebuff")));
            }
            player.chatOverhead.NewMessage(modPlayer.stone + "", 30);
        }
示例#4
0
        public override void ModifyHitByProjectile(Projectile proj, ref int damage, ref bool crit)
        {
            ElementalPlayer modPlayer = player.GetModPlayer <ElementalPlayer>();

            if (modPlayer.reflect)
            {
                Main.projectile[proj.whoAmI].owner    = player.whoAmI;
                Main.projectile[proj.whoAmI].hostile  = false;
                Main.projectile[proj.whoAmI].friendly = true;
                if (Math.Abs(Main.projectile[proj.whoAmI].velocity.ToRotation() - (float)Math.Atan2((player.Center - Main.MouseWorld).Y, (player.Center - Main.MouseWorld).X)) <= 20)
                {
                    Vector2 vel = player.Center - Main.MouseWorld;
                    vel.Normalize();
                    vel *= -Main.projectile[proj.whoAmI].velocity.Length();
                    Main.projectile[proj.whoAmI].velocity = vel;
                }
                //Main.projectile[proj.whoAmI].velocity *= -1;
                damage            = 0;
                crit              = true;
                player.immuneTime = 0;
                player.immune     = false;
            }
        }