예제 #1
0
 public void TollPaid(bool chargeFee)
 {
     if (chargeFee)
     {
         var num = Game.PlayerStats.Gold * (1f - SkillSystem.GetSkill(SkillType.Prices_Down).ModifierAmount);
         Game.PlayerStats.Gold -= (int)num;
         if (num > 0f)
         {
             Player.AttachedLevel.TextManager.DisplayNumberStringText(-(int)num, "gold", Color.Yellow,
                                                                      new Vector2(Player.X, Player.Bounds.Top));
         }
     }
     if (Game.PlayerStats.SpokeToTollCollector && Game.PlayerStats.SpecialItem != 1 &&
         Game.PlayerStats.SpecialItem != 12 && Game.PlayerStats.SpecialItem != 13 &&
         Game.PlayerStats.SpecialItem != 11 && Game.PlayerStats.SpecialItem != 9 &&
         Game.PlayerStats.SpecialItem != 10)
     {
         Player.AttachedLevel.ImpactEffectPool.DisplayDeathEffect(m_tollCollector.Position);
         SoundManager.PlaySound("Charon_Laugh");
         HideTollCollector();
     }
     else
     {
         Game.PlayerStats.SpokeToTollCollector = true;
         SoundManager.PlaySound("Charon_Laugh");
         m_tollCollector.ChangeSprite("NPCTollCollectorLaugh_Character");
         m_tollCollector.AnimationDelay = 0.05f;
         m_tollCollector.PlayAnimation();
         Tween.RunFunction(1f, Player.AttachedLevel.ImpactEffectPool, "DisplayDeathEffect",
                           m_tollCollector.Position);
         Tween.RunFunction(1f, this, "HideTollCollector");
     }
     if (Game.PlayerStats.SpecialItem == 1 || Game.PlayerStats.SpecialItem == 10 ||
         Game.PlayerStats.SpecialItem == 9 || Game.PlayerStats.SpecialItem == 13 ||
         Game.PlayerStats.SpecialItem == 11 || Game.PlayerStats.SpecialItem == 12)
     {
         if (Game.PlayerStats.SpecialItem == 9)
         {
             Game.PlayerStats.ChallengeEyeballUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 10)
         {
             Game.PlayerStats.ChallengeSkullUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 11)
         {
             Game.PlayerStats.ChallengeFireballUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 12)
         {
             Game.PlayerStats.ChallengeBlobUnlocked = true;
         }
         else if (Game.PlayerStats.SpecialItem == 13)
         {
             Game.PlayerStats.ChallengeLastBossUnlocked = true;
         }
         Game.PlayerStats.SpecialItem = 0;
         Player.AttachedLevel.UpdatePlayerHUDSpecialItem();
     }
 }
예제 #2
0
        public StartingRoomObj()
        {
            m_blacksmith                   = new BlacksmithObj();
            m_blacksmith.Flip              = SpriteEffects.FlipHorizontally;
            m_blacksmith.Scale             = new Vector2(2.5f, 2.5f);
            m_blacksmith.Position          = new Vector2(700f, 660f - (m_blacksmith.Bounds.Bottom - m_blacksmith.Y) - 1f);
            m_blacksmith.OutlineWidth      = 2;
            m_blacksmithBoard              = new SpriteObj("StartRoomBlacksmithBoard_Sprite");
            m_blacksmithBoard.Scale        = new Vector2(2f, 2f);
            m_blacksmithBoard.OutlineWidth = 2;
            m_blacksmithBoard.Position     = new Vector2(m_blacksmith.X - m_blacksmithBoard.Width / 2 - 35f,
                                                         m_blacksmith.Bounds.Bottom - m_blacksmithBoard.Height - 1);
            m_blacksmithIcon                 = new SpriteObj("UpArrowBubble_Sprite");
            m_blacksmithIcon.Scale           = new Vector2(2f, 2f);
            m_blacksmithIcon.Visible         = false;
            m_blacksmithIconPosition         = new Vector2(m_blacksmith.X - 60f, m_blacksmith.Y - 10f);
            m_blacksmithIcon.Flip            = m_blacksmith.Flip;
            m_blacksmithIcon.OutlineWidth    = 2;
            m_blacksmithNewIcon              = new SpriteObj("ExclamationSquare_Sprite");
            m_blacksmithNewIcon.Visible      = false;
            m_blacksmithNewIcon.OutlineWidth = 2;
            m_enchantressNewIcon             = (m_blacksmithNewIcon.Clone() as SpriteObj);
            m_enchantress          = new ObjContainer("Enchantress_Character");
            m_enchantress.Scale    = new Vector2(2f, 2f);
            m_enchantress.Flip     = SpriteEffects.FlipHorizontally;
            m_enchantress.Position = new Vector2(1150f,
                                                 660f - (m_enchantress.Bounds.Bottom - m_enchantress.AnchorY) - 2f);
            m_enchantress.PlayAnimation();
            m_enchantress.AnimationDelay = 0.1f;
            (m_enchantress.GetChildAt(4) as IAnimateableObj).StopAnimation();
            m_enchantress.OutlineWidth = 2;
            m_tent              = new SpriteObj("StartRoomGypsyTent_Sprite");
            m_tent.Scale        = new Vector2(1.5f, 1.5f);
            m_tent.OutlineWidth = 2;
            m_tent.Position     = new Vector2(m_enchantress.X - m_tent.Width / 2 + 5f,
                                              m_enchantress.Bounds.Bottom - m_tent.Height);
            m_enchantressIcon              = new SpriteObj("UpArrowBubble_Sprite");
            m_enchantressIcon.Scale        = new Vector2(2f, 2f);
            m_enchantressIcon.Visible      = false;
            m_enchantressIconPosition      = new Vector2(m_enchantress.X - 60f, m_enchantress.Y - 100f);
            m_enchantressIcon.Flip         = m_enchantress.Flip;
            m_enchantressIcon.OutlineWidth = 2;
            m_architect          = new ObjContainer("ArchitectIdle_Character");
            m_architect.Flip     = SpriteEffects.FlipHorizontally;
            m_architect.Scale    = new Vector2(2f, 2f);
            m_architect.Position = new Vector2(1550f, 660f - (m_architect.Bounds.Bottom - m_architect.AnchorY) - 2f);
            m_architect.PlayAnimation();
            m_architect.AnimationDelay = 0.1f;
            m_architect.OutlineWidth   = 2;
            (m_architect.GetChildAt(1) as IAnimateableObj).StopAnimation();
            m_architectIcon              = new SpriteObj("UpArrowBubble_Sprite");
            m_architectIcon.Scale        = new Vector2(2f, 2f);
            m_architectIcon.Visible      = false;
            m_architectIconPosition      = new Vector2(m_architect.X - 60f, m_architect.Y - 100f);
            m_architectIcon.Flip         = m_architect.Flip;
            m_architectIcon.OutlineWidth = 2;
            m_architectRenovating        = false;
            m_screw                      = new SpriteObj("ArchitectGear_Sprite");
            m_screw.Scale                = new Vector2(2f, 2f);
            m_screw.OutlineWidth         = 2;
            m_screw.Position             = new Vector2(m_architect.X + 30f, m_architect.Bounds.Bottom - 1);
            m_screw.AnimationDelay       = 0.1f;
            m_tollCollector              = new PhysicsObjContainer("NPCTollCollectorIdle_Character");
            m_tollCollector.Flip         = SpriteEffects.FlipHorizontally;
            m_tollCollector.Scale        = new Vector2(2.5f, 2.5f);
            m_tollCollector.IsWeighted   = false;
            m_tollCollector.IsCollidable = true;
            m_tollCollector.Position     = new Vector2(2565f,
                                                       420f - (m_tollCollector.Bounds.Bottom - m_tollCollector.AnchorY));
            m_tollCollector.PlayAnimation();
            m_tollCollector.AnimationDelay   = 0.1f;
            m_tollCollector.OutlineWidth     = 2;
            m_tollCollector.CollisionTypeTag = 1;
            m_tollCollectorIcon              = new SpriteObj("UpArrowBubble_Sprite");
            m_tollCollectorIcon.Scale        = new Vector2(2f, 2f);
            m_tollCollectorIcon.Visible      = false;
            m_tollCollectorIcon.Flip         = m_tollCollector.Flip;
            m_tollCollectorIcon.OutlineWidth = 2;
            m_rainFG = new List <RaindropObj>();
            var num = 400;

            if (LevelEV.SAVE_FRAMES)
            {
                num /= 2;
            }
            for (var i = 0; i < num; i++)
            {
                var item =
                    new RaindropObj(new Vector2(CDGMath.RandomInt(-100, 2540), CDGMath.RandomInt(-400, 720)));
                m_rainFG.Add(item);
            }
        }