コード例 #1
0
        public virtual void DestroyHat(Character character, bool resetStats, bool removeCosmetic = false)
        {
            character.hat = null;

            // Reset Default Hat to Suit's Cosmetic Version (if applicable)
            if (!removeCosmetic)
            {
                if (character.suit.DefaultCosmeticHat is Hat)
                {
                    character.suit.DefaultCosmeticHat.ApplyHat(character, false);
                }
                else if (character.head.DefaultCosmeticHat is Hat)
                {
                    character.head.DefaultCosmeticHat.ApplyHat(character, false);
                }
            }

            // Create Hat Particle
            EndBounceParticle.SetParticle(character.room, Systems.mapper.atlas[(byte)AtlasGroup.Objects], this.SpriteName + (character.FaceRight ? "" : "Left"), new Vector2(character.posX, character.posY + this.yOffset), Systems.timer.Frame + 40);

            if (resetStats)
            {
                character.stats.ResetCharacterStats();
            }
        }
コード例 #2
0
        public override void Destroy(DirCardinal dir = DirCardinal.None, GameObject obj = null)
        {
            base.Destroy();

            EndBounceParticle particle = EndBounceParticle.SetParticle(this.room, Systems.mapper.atlas[(byte)AtlasGroup.Objects], this.SpriteName, new Vector2(this.posX + this.bounds.Left - 2, this.posY + this.bounds.Top - 2), Systems.timer.Frame + 10, 3, 0.5f, 0.12f);

            if (dir == DirCardinal.Right || dir == DirCardinal.Left)
            {
                particle.vel.Y -= (float)CalcRandom.FloatBetween(0, 3);
                particle.vel.X  = dir == DirCardinal.Right ? CalcRandom.FloatBetween(-3, 0) : CalcRandom.FloatBetween(0, 3);
            }

            else if (dir == DirCardinal.Down || dir == DirCardinal.Up)
            {
                particle.vel.Y = dir == DirCardinal.Down ? CalcRandom.FloatBetween(-4, -2) : CalcRandom.FloatBetween(-1, 1);
                particle.vel.X = (float)this.physics.velocity.X.ToDouble() * 0.35f + CalcRandom.FloatBetween(-1, 1);
            }

            this.room.PlaySound(Systems.sounds.shellThud, 0.4f, this.posX + 16, this.posY + 16);
        }
コード例 #3
0
ファイル: Shell.cs プロジェクト: tarsupin/Nexus
 public override void Destroy()
 {
     EndBounceParticle.SetParticle(this.room, Systems.mapper.atlas[(byte)AtlasGroup.Objects], this.SpriteName, new Vector2(this.posX + this.bounds.Left - 2, this.posY + this.bounds.Top - 10), Systems.timer.Frame + 40);
     this.room.PlaySound(Systems.sounds.shellBoop, 0.15f, this.posX + 16, this.posY + 16);
     base.Destroy();
 }
コード例 #4
0
ファイル: ProjectileEarth.cs プロジェクト: tarsupin/Nexus
 public override void Destroy(DirCardinal dir = DirCardinal.None, GameObject obj = null)
 {
     EndBounceParticle.SetParticle(this.room, Systems.mapper.atlas[(byte)AtlasGroup.Objects], "Projectiles/Earth1", new Vector2(this.posX + this.bounds.Left - 2, this.posY + this.bounds.Top - 2), Systems.timer.Frame + 10);
     this.room.PlaySound(Systems.sounds.shellThud, 1f, this.posX + 16, this.posY + 16);
     base.Destroy();
 }