public virtual void OnEnter() { this.m_tripStat1.Visible = false; this.m_tripStat2.Visible = false; this.m_tripStat1.Scale = Vector2.One; this.m_tripStat2.Scale = Vector2.One; if (this.m_itemType != 7) { (base.ScreenManager.Game as Game).SaveManager.SaveFiles(new SaveType[] { SaveType.PlayerData, SaveType.UpgradeData }); } this.m_itemSprite.Rotation = 0f; this.m_itemSprite.Scale = Vector2.One; this.m_itemStartPos.X = this.m_itemStartPos.X - base.Camera.TopLeftCorner.X; this.m_itemStartPos.Y = this.m_itemStartPos.Y - base.Camera.TopLeftCorner.Y; this.m_storedMusicVolume = SoundManager.GlobalMusicVolume; this.m_songName = SoundManager.GetCurrentMusicName(); this.m_lockControls = true; this.m_continueText.Opacity = 0f; this.m_continueText.Text = "[Input:0] to continue"; this.m_itemFoundText.Position = this.m_itemEndPos; this.m_itemFoundText.Y += 70f; this.m_itemFoundText.Scale = Vector2.Zero; this.m_tripStat1FoundText.Position = this.m_itemFoundText.Position; this.m_tripStat2FoundText.Position = this.m_itemFoundText.Position; this.m_tripStat1FoundText.Scale = Vector2.Zero; this.m_tripStat2FoundText.Scale = Vector2.Zero; this.m_tripStat1FoundText.Visible = false; this.m_tripStat2FoundText.Visible = false; switch (this.m_itemType) { case 1: this.m_itemSpinning = true; this.m_itemSprite.ChangeSprite("BlueprintIcon_Sprite"); this.m_itemFoundSprite.ChangeSprite("BlueprintFoundText_Sprite"); this.m_itemFoundText.Text = Game.EquipmentSystem.GetEquipmentData((int)this.m_itemInfo.X, (int)this.m_itemInfo.Y).DisplayName; // string.Concat(EquipmentBaseType.ToString((int)this.m_itemInfo.Y), " ", EquipmentCategoryType.ToString2((int)this.m_itemInfo.X)); break; case 2: this.m_itemSpinning = true; this.m_itemSprite.ChangeSprite("RuneIcon_Sprite"); this.m_itemFoundSprite.ChangeSprite("RuneFoundText_Sprite"); this.m_itemFoundText.Text = EquipmentAbilityType.ToString((int)this.m_itemInfo.Y) + " Rune (" + EquipmentCategoryType.ToString2((int)this.m_itemInfo.X) + ")"; this.m_itemSprite.AnimationDelay = 0.05f; GameUtil.UnlockAchievement("LOVE_OF_MAGIC"); break; case 3: case 6: this.m_itemSprite.ChangeSprite(this.GetStatSpriteName((int)this.m_itemInfo.X)); this.m_itemFoundText.Text = this.GetStatText((int)this.m_itemInfo.X); this.m_itemSprite.AnimationDelay = 0.05f; this.m_itemFoundSprite.ChangeSprite("StatFoundText_Sprite"); if (this.m_itemType == 6) { this.m_tripStat1FoundText.Visible = true; this.m_tripStat2FoundText.Visible = true; this.m_tripStat1.ChangeSprite(this.GetStatSpriteName((int)this.m_tripStatData.X)); this.m_tripStat2.ChangeSprite(this.GetStatSpriteName((int)this.m_tripStatData.Y)); this.m_tripStat1.Visible = true; this.m_tripStat2.Visible = true; this.m_tripStat1.AnimationDelay = 0.05f; this.m_tripStat2.AnimationDelay = 0.05f; Tween.RunFunction(0.1f, this.m_tripStat1, "PlayAnimation", new object[] { true }); Tween.RunFunction(0.2f, this.m_tripStat2, "PlayAnimation", new object[] { true }); this.m_tripStat1FoundText.Text = this.GetStatText((int)this.m_tripStatData.X); this.m_tripStat2FoundText.Text = this.GetStatText((int)this.m_tripStatData.Y); this.m_itemFoundText.Y += 50f; this.m_tripStat1FoundText.Y = this.m_itemFoundText.Y + 50f; } break; case 4: this.m_itemSprite.ChangeSprite(SpellType.Icon((byte)this.m_itemInfo.X)); this.m_itemFoundSprite.ChangeSprite("SpellFoundText_Sprite"); this.m_itemFoundText.Text = SpellDefinition.GetById((byte)this.m_itemInfo.X).DisplayName; break; case 5: this.m_itemSprite.ChangeSprite(SpecialItemType.SpriteName((byte)this.m_itemInfo.X)); this.m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite"); this.m_itemFoundText.Text = SpecialItemType.ToString((byte)this.m_itemInfo.X); break; case 7: this.m_itemSprite.ChangeSprite(this.GetMedallionImage((int)this.m_itemInfo.X)); this.m_itemFoundSprite.ChangeSprite("ItemFoundText_Sprite"); if (this.m_itemInfo.X != 19f) { this.m_itemFoundText.Text = "You've collected a medallion piece!"; } else { this.m_itemFoundText.Text = "Medallion completed!"; } break; } this.m_itemSprite.PlayAnimation(true); this.ItemSpinAnimation(); base.OnEnter(); }
public override void OnEnter() { (ScreenManager.Game as Game).SaveManager.ResetAutosave(); m_player.DisableAllWeight = false; m_player.StopAllSpells(); m_player.Scale = new Vector2(2f, 2f); ShoutMagnitude = 3f; //if (Game.PlayerStats.Traits.X == 6f || Game.PlayerStats.Traits.Y == 6f) // m_player.Scale *= 1.5f; //else if (Game.PlayerStats.Traits.X == 7f || Game.PlayerStats.Traits.Y == 7f) // m_player.Scale = new Vector2(1.35f, 1.35f); //if (Game.PlayerStats.Traits.X == 10f || Game.PlayerStats.Traits.Y == 10f) //{ // m_player.ScaleX *= 0.825f; // m_player.ScaleY *= 1.15f; //} //else if (Game.PlayerStats.Traits.X == 9f || Game.PlayerStats.Traits.Y == 9f) //{ // m_player.ScaleX *= 1.25f; // m_player.ScaleY *= 1.175f; //} m_player.CurrentHealth = Game.PlayerStats.CurrentHealth; m_player.CurrentMana = Game.PlayerStats.CurrentMana; if (LevelEV.RUN_TESTROOM) { Game.ScreenManager.Player.CurrentHealth = Game.ScreenManager.Player.MaxHealth; Game.ScreenManager.Player.CurrentMana = Game.ScreenManager.Player.MaxMana; } BuildRenderChain(); var args = new RogueAPI.LevelEnterEventArgs(this, m_player, _renderChain); RogueAPI.Event <RogueAPI.LevelEnterEventArgs> .Trigger(args); m_player.UpdateInternalScale(); CheckForRoomTransition(); UpdateCamera(); UpdatePlayerHUDAbilities(); m_player.UpdateEquipmentColours(); m_player.StopAllSpells(); if (Game.PlayerStats.Class == 13) { m_miniMapDisplay.AddAllIcons(RoomList); (ScreenManager as RCScreenManager).AddIconsToMap(RoomList); } if (Game.PlayerStats.EyeballBossBeaten) { GameUtil.UnlockAchievement("FEAR_OF_EYES"); } if (Game.PlayerStats.FairyBossBeaten) { GameUtil.UnlockAchievement("FEAR_OF_GHOSTS"); } if (Game.PlayerStats.BlobBossBeaten) { GameUtil.UnlockAchievement("FEAR_OF_SLIME"); } if (Game.PlayerStats.FireballBossBeaten) { GameUtil.UnlockAchievement("FEAR_OF_FIRE"); } if (Game.PlayerStats.LastbossBeaten || Game.PlayerStats.TimesCastleBeaten > 0) { GameUtil.UnlockAchievement("FEAR_OF_FATHERS"); } if (Game.PlayerStats.TimesCastleBeaten > 1) { GameUtil.UnlockAchievement("FEAR_OF_TWINS"); } if (Game.PlayerStats.ChallengeEyeballBeaten) { GameUtil.UnlockAchievement("FEAR_OF_BLINDNESS"); } if (Game.PlayerStats.ChallengeSkullBeaten) { GameUtil.UnlockAchievement("FEAR_OF_BONES"); } if (Game.PlayerStats.ChallengeFireballBeaten) { GameUtil.UnlockAchievement("FEAR_OF_CHEMICALS"); } if (Game.PlayerStats.ChallengeBlobBeaten) { GameUtil.UnlockAchievement("FEAR_OF_SPACE"); } if (Game.PlayerStats.ChallengeLastBossBeaten) { GameUtil.UnlockAchievement("FEAR_OF_RELATIVES"); } if (Game.PlayerStats.EnemiesKilledList[5].W > 0f && Game.PlayerStats.EnemiesKilledList[12].W > 0f && Game.PlayerStats.EnemiesKilledList[15].W > 0f && Game.PlayerStats.EnemiesKilledList[22].W > 0f && Game.PlayerStats.EnemiesKilledList[32].W > 0f) { GameUtil.UnlockAchievement("FEAR_OF_ANIMALS"); } if (Game.PlayerStats.TotalHoursPlayed + Game.PlaySessionLength >= 20f) { GameUtil.UnlockAchievement("FEAR_OF_SLEEP"); } if (Game.PlayerStats.TotalRunesFound > 10) { GameUtil.UnlockAchievement("LOVE_OF_MAGIC"); } base.OnEnter(); }