예제 #1
0
        public override void UpdateSkeleton()
        {
            int num   = 6;
            int frame = 0;

            if (this.sliding)
            {
                frame = 12;
            }
            else if (this.crouch)
            {
                frame = 11;
            }
            this._skeleton.head.position       = this.Offset(DuckRig.GetHatPoint(frame) + new Vec2(0.0f, (float)-num));
            this._skeleton.upperTorso.position = this.Offset(DuckRig.GetChestPoint(frame) + new Vec2(0.0f, (float)-num));
            this._skeleton.lowerTorso.position = this.position + new Vec2(0.0f, (float)(10 - num));
            if (this.sliding)
            {
                this._skeleton.head.orientation       = Maths.DegToRad(90f);
                this._skeleton.upperTorso.orientation = Maths.DegToRad(90f);
            }
            else
            {
                this._skeleton.head.orientation       = 0.0f;
                this._skeleton.upperTorso.orientation = 0.0f;
            }
        }
        public override void Draw(float x, float y, Depth depth)
        {
            y -= 9f;
            float num1 = 0.0f;

            if (this._teams.Count == 3)
            {
                num1 = 18f;
            }
            int num2 = 0;

            foreach (Team team in this._teams)
            {
                if (team != null)
                {
                    float num3 = x;
                    float y1   = y + 8f;
                    this._persona.sprite.depth = depth;
                    this._persona.sprite.color = Color.White;
                    Graphics.Draw(this._persona.sprite, 0, num3 - num1 + (float)(num2 * 18), y1);
                    this._persona.armSprite.frame = this._persona.sprite.imageIndex;
                    this._persona.armSprite.scale = new Vec2(1f, 1f);
                    this._persona.armSprite.depth = depth + 4;
                    Graphics.Draw((Sprite)this._persona.armSprite, (float)((double)num3 - (double)num1 + (double)(num2 * 18) - 3.0), y1 + 6f);
                    Vec2 hatPoint = DuckRig.GetHatPoint(this._persona.sprite.imageIndex);
                    team.hat.depth  = depth + 2;
                    team.hat.center = new Vec2(16f, 16f) + team.hatOffset;
                    Graphics.Draw(team.hat, team.hat.frame, num3 - num1 + (float)(num2 * 18) + hatPoint.x, y1 + hatPoint.y);
                }
                ++num2;
            }
        }
예제 #3
0
 protected override void OnStart()
 {
     Options.Initialize();
     Global.Initialize();
     Teams.Initialize();
     DuckRig.Initialize();
     Unlocks.Initialize();
     ConnectionStatusUI.Initialize();
     Unlocks.CalculateTreeValues();
     Profiles.Initialize();
     Dialogue.Initialize();
     DuckTitle.Initialize();
     News.Initialize();
     Script.Initialize();
     DuckNews.Initialize();
     VirtualBackground.InitializeBack();
     AmmoType.InitializeTypes();
     DestroyType.InitializeTypes();
     VirtualTransition.Initialize();
     Unlockables.Initialize();
     UIInviteMenu.Initialize();
     LevelGenerator.Initialize();
     DuckFile.CompleteSteamCloudInitializate();
     Main.ResetMatchStuff();
     foreach (Profile profile in Profiles.active)
     {
         profile.RecordPreviousStats();
     }
     Main.editor = new DuckGameEditor();
     foreach (string file in DuckFile.GetFiles(Directory.GetCurrentDirectory(), "*.hat"))
     {
         Team t = Team.Deserialize(file);
         if (t != null)
         {
             Teams.AddExtraTeam(t);
         }
     }
     Main.SetPurchaseDetails(9.99f, "USD");
     if (Main.connectID != 0UL)
     {
         NCSteam.inviteLobbyID = Main.connectID;
         Level.current         = (Level) new JoinServer(Main.connectID);
     }
     else
     {
         Level.current = !MonoMain.noIntro ? (Level) new BIOSScreen() : (!MonoMain.startInEditor ? (Level) new TitleScreen() : (Level)Main.editor);
     }
     this._font = new BitmapFont("biosFont", 8);
     Highlights.StartRound();
 }
        public override void Draw(float x, float y, Depth depth)
        {
            if (this._team == null)
            {
                return;
            }
            y -= 9f;
            float x1 = x;
            float y1 = y + 8f;

            this._persona.sprite.depth = depth;
            this._persona.sprite.color = Color.White;
            DuckGame.Graphics.Draw(this._persona.sprite, 0, x1, y1);
            this._persona.armSprite.frame = this._persona.sprite.imageIndex;
            this._persona.armSprite.scale = new Vec2(1f, 1f);
            this._persona.armSprite.depth = depth + 4;
            DuckGame.Graphics.Draw((Sprite)this._persona.armSprite, x1 - 3f, y1 + 6f);
            Vec2 hatPoint = DuckRig.GetHatPoint(this._persona.sprite.imageIndex);

            this._team.hat.depth  = depth + 2;
            this._team.hat.center = new Vec2(16f, 16f) + this._team.hatOffset;
            DuckGame.Graphics.Draw(this._team.hat, this._team.hat.frame, x1 + hatPoint.x, y1 + hatPoint.y);
            if (this._team.hat.texture.textureName == "hats/devhat" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("CAPTAIN"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
            }
            if (this._team.hat.texture.textureName == "hats/moonwalker" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("MOONWALK"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
                this._cape.SetCapeTexture((Texture2D)Content.Load <Tex2D>("hats/moonCape"));
            }
            if (this._team.hat.texture.textureName == "hats/royalty" && this._cape == null)
            {
                this._hat  = new TeamHat(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0), Teams.GetTeam("MAJESTY"));
                this._cape = new Cape(x1 + hatPoint.x, y1 + hatPoint.y, (PhysicsObject)this._hat);
                this._cape.SetCapeTexture((Texture2D)Content.Load <Tex2D>("hats/royalCape"));
            }
            if (this._cape == null)
            {
                return;
            }
            this._hat.position = new Vec2(x1 + hatPoint.x, (float)((double)y1 + (double)hatPoint.y + 5.0));
            this._cape.depth   = depth + 2;
            this._cape.Update();
            this._cape.Draw();
        }
예제 #5
0
        public override void Draw()
        {
            this._selectProjector.depth = new Depth(-0.51f);
            this._selectProjector.alpha = (float)(0.300000011920929 + (double)this._projectorSin.normalized * 0.200000002980232);
            this._selectPlatform.depth  = new Depth(-0.51f);
            int count = this._profiles.Count;
            int num1  = 0;

            foreach (Profile profile in this._profiles)
            {
                Color color = new Color(0.35f, 0.5f, 0.6f);
                profile.persona.sprite.alpha    = Maths.Clamp(this._swapFade, 0.0f, 1f);
                profile.persona.sprite.color    = color * (float)(0.699999988079071 + (double)this._projectorSin.normalized * 0.100000001490116);
                profile.persona.sprite.color    = new Color(profile.persona.sprite.color.r, profile.persona.sprite.color.g, profile.persona.sprite.color.b);
                profile.persona.armSprite.alpha = Maths.Clamp(this._swapFade, 0.0f, 1f);
                profile.persona.armSprite.color = color * (float)(0.699999988079071 + (double)this._projectorSin.normalized * 0.100000001490116);
                profile.persona.armSprite.color = new Color(profile.persona.armSprite.color.r, profile.persona.armSprite.color.g, profile.persona.armSprite.color.b);
                profile.persona.sprite.scale    = new Vec2(1f, 1f);
                profile.persona.armSprite.scale = new Vec2(1f, 1f);
                float num2 = 12f;
                float num3 = (float)((double)this.x - (double)(count - 1) * (double)num2 / 2.0 + (double)num1 * (double)num2);
                profile.persona.sprite.depth    = (Depth)(float)((double)num1 * 0.00999999977648258 - 0.400000005960464);
                profile.persona.armSprite.depth = (Depth)(float)((double)num1 * 0.00999999977648258 - 0.300000011920929);
                Graphics.Draw((Sprite)profile.persona.sprite, num3 + 1f, this.y - 17f, new Depth(-0.4f));
                Graphics.Draw((Sprite)profile.persona.armSprite, (float)((double)num3 + 1.0 - 3.0), (float)((double)this.y - 17.0 + 6.0));
                Team team = profile.team;
                if (team != null)
                {
                    Vec2 hatPoint = DuckRig.GetHatPoint(profile.persona.sprite.imageIndex);
                    team.hat.depth  = profile.persona.sprite.depth + 1;
                    team.hat.alpha  = profile.persona.sprite.alpha;
                    team.hat.color  = profile.persona.sprite.color;
                    team.hat.center = new Vec2(16f, 16f) + team.hatOffset;
                    Graphics.Draw((Sprite)team.hat, (float)((double)num3 + (double)hatPoint.x + 1.0), this.y - 17f + hatPoint.y);
                    team.hat.color = Color.White;
                }
                this._profile.persona.sprite.color    = Color.White;
                this._profile.persona.armSprite.color = Color.White;
                ++num1;
            }
            Graphics.Draw(this._selectPlatform, this.x, this.y);
            Graphics.Draw(this._selectProjector, this.x, this.y - 6f);
        }
예제 #6
0
        public void Draw()
        {
            if ((double)this._wait > 1.0)
            {
                bool flag = true;
                for (int index1 = 0; index1 < this._cool.Count; ++index1)
                {
                    if (this._sampleCool[index1] < this._cool[index1])
                    {
                        List <int> cool;
                        int        index2;
                        (cool = this._cool)[index2 = index1] = cool[index2] - 1;
                        flag = false;
                    }
                    else if (this._sampleCool[index1] > this._cool[index1])
                    {
                        List <int> cool;
                        int        index2;
                        (cool = this._cool)[index2 = index1] = cool[index2] + 1;
                        flag = false;
                    }
                    if ((double)this._upScale[index1] > 0.0)
                    {
                        List <float> upScale;
                        int          index2;
                        (upScale = this._upScale)[index2 = index1] = upScale[index2] - 0.05f;
                    }
                }
                if (flag)
                {
                    this._wait += 0.015f;
                    if ((double)this._wait > 2.0)
                    {
                        this._readyToTalk = true;
                    }
                }
            }
            else
            {
                this._wait += 0.01f;
            }
            this._redBar.depth = new Depth(0.2f);
            Graphics.Draw(this._redBar, 30f, 25f);
            this._font.depth = new Depth(0.25f);
            if (DG.isHalloween)
            {
                this._font.Draw("SPOOKY  REPORT", 44f, 28f, Color.White, new Depth(0.25f));
            }
            else
            {
                this._font.Draw("HOTNESS REPORT", 44f, 28f, Color.White, new Depth(0.25f));
            }
            this._blueBar.depth = new Depth(0.1f);
            Graphics.Draw(this._blueBar, 30f, 18f);
            Graphics.DrawRect(new Vec2(20f, 135f), new Vec2(260f, 160f), new Color(12, 90, 182), new Depth(0.1f));
            Vec2           vec2_1 = new Vec2(60f, 50f);
            Vec2           vec2_2 = new Vec2(200f, 150f);
            Vec2           vec2_3 = new Vec2(vec2_2.x - vec2_1.x, vec2_2.y - vec2_1.y);
            List <Profile> active = Profiles.active;
            int            index3 = 0;

            foreach (Profile profile in active)
            {
                float num1   = active.Count != 1 ? (active.Count != 2 ? (float)index3 * (vec2_3.x / (float)(active.Count - 1)) : (float)((double)vec2_3.x / 2.0 - (double)vec2_3.x / 4.0 + (double)index3 * ((double)vec2_3.x / 2.0))) : vec2_3.x / 2f;
                float num2   = (float)(this._cool[index3] + 50) / 250f;
                float num3   = 1f / (float)(this._tempMap.Count - 2);
                int   index1 = (int)((double)num2 * (double)(this._tempMap.Count - 2));
                if (index1 < 0)
                {
                    index1 = 0;
                }
                int   temp = this._tempMap[index1];
                float num4 = Maths.NormalizeSection(num2, num3 * (float)index1, num3 * (float)(index1 + 1));
                int   num5 = (int)((double)this._tempMap[index1] + (double)(this._tempMap[index1 + 1] - this._tempMap[index1]) * (double)num4);
                float num6 = 50f;
                float num7 = num2 + 0.28f;
                float x    = vec2_1.x + num1;
                float y    = (float)((double)vec2_2.y - 32.0 - (double)num7 * (double)num6);
                profile.persona.sprite.depth = new Depth(0.3f);
                profile.persona.sprite.color = Color.White;
                Graphics.Draw(profile.persona.sprite, 0, x, y);
                Vec2 hatPoint = DuckRig.GetHatPoint(profile.persona.sprite.imageIndex);
                profile.team.hat.depth  = new Depth(0.31f);
                profile.team.hat.center = new Vec2(16f, 16f) + profile.team.hatOffset;
                Graphics.Draw(profile.team.hat, profile.team.hat.frame, x + hatPoint.x, y + hatPoint.y);
                Graphics.DrawRect(new Vec2(x - 17f, y + 16f), new Vec2(x + 16f, 160f), profile.persona.colorUsable, new Depth(0.05f));
                string text = num5.ToString() + "=";
                this._font.depth = new Depth(0.25f);
                this._font.Draw(text, new Vec2((float)((double)x - (double)this._font.GetWidth(text) / 2.0 + 3.0), 140f), Color.White, new Depth(0.25f));
                this._icon.depth = new Depth(0.3f);
                this._icon.frame = (int)Math.Floor((double)num2 * 8.98999977111816);
                if (this._icon.frame != this._lastFrame[index3])
                {
                    this._lastFrame[index3] = this._icon.frame;
                    this._upScale[index3]   = 0.5f;
                }
                this._icon.scale = new Vec2(1f + this._upScale[index3]);
                Graphics.Draw((Sprite)this._icon, x, y + 28f);
                ++index3;
            }
        }
        public override void Update()
        {
            if ((double)this._slideWait < 0.0)
            {
                this.position = Vec2.Lerp(this.position, this._end, 0.15f);
            }
            this._slideWait -= 0.4f;
            DuckGame.Graphics.SetRenderTarget(this._faceTarget);
            DuckGame.Graphics.Clear(Color.Transparent);
            DuckGame.Graphics.screen.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.DepthRead, RasterizerState.CullNone, (MTEffect)null, Matrix.Identity);
            this._gradient.depth = new Depth(-0.6f);
            this._gradient.alpha = 0.5f;
            if (this._team.activeProfiles.Count == 1)
            {
                this._gradient.color = this._team.activeProfiles[0].persona.colorUsable;
            }
            else
            {
                switch (Teams.CurrentGameTeamIndex(this._team))
                {
                case 0:
                    this._gradient.color = Color.Red;
                    break;

                case 1:
                    this._gradient.color = Color.Blue;
                    break;

                case 2:
                    this._gradient.color = Color.LimeGreen;
                    break;
                }
            }
            DuckGame.Graphics.Draw(this._gradient, 0.0f, 0.0f);
            this._edgeOverlay.depth = new Depth(0.9f);
            this._edgeOverlay.alpha = 0.5f;
            DuckGame.Graphics.Draw(this._edgeOverlay, 0.0f, 0.0f);
            int num = 0;

            foreach (Profile activeProfile in this._team.activeProfiles)
            {
                float x = (float)((num * 8 + 8) * 2);
                float y = 16f;
                activeProfile.persona.quackSprite.depth = new Depth(0.7f);
                activeProfile.persona.quackSprite.scale = new Vec2(2f, 2f);
                DuckGame.Graphics.Draw(activeProfile.persona.quackSprite, 0, x, y, 2f, 2f);
                activeProfile.persona.quackSprite.color = Color.White;
                activeProfile.persona.quackSprite.scale = new Vec2(1f, 1f);
                Vec2 hatPoint = DuckRig.GetHatPoint(activeProfile.persona.sprite.imageIndex);
                activeProfile.team.hat.depth  = new Depth(0.8f);
                activeProfile.team.hat.center = new Vec2(16f, 16f) + activeProfile.team.hatOffset;
                activeProfile.team.hat.scale  = new Vec2(2f, 2f);
                if ((double)activeProfile.team.hat.texture.width > 16.0)
                {
                    activeProfile.team.hat.frame = 1;
                }
                DuckGame.Graphics.Draw(activeProfile.team.hat, activeProfile.team.hat.frame, x + hatPoint.x * 2f, y + hatPoint.y * 2f, 2f, 2f);
                activeProfile.team.hat.color = Color.White;
                activeProfile.team.hat.scale = new Vec2(1f, 1f);
                activeProfile.team.hat.frame = 0;
                ++num;
            }
            DuckGame.Graphics.screen.End();
            DuckGame.Graphics.SetRenderTarget((RenderTarget2D)null);
            base.Update();
        }