private void LoadCardColour() { var textureColor = Color.Red; var textureColor2 = Color.Red; switch (Game.PlayerStats.Class) { case 0: case 8: textureColor2 = (textureColor = Color.White); break; case 1: case 9: textureColor2 = (textureColor = Color.Blue); break; case 2: case 10: textureColor2 = (textureColor = Color.Red); break; case 3: case 11: textureColor2 = (textureColor = Color.Green); break; case 4: case 12: textureColor2 = (textureColor = Color.Gray); break; case 5: case 13: textureColor2 = (textureColor = Color.Gold); break; case 6: case 14: textureColor = Color.Blue; textureColor2 = Color.Red; break; case 7: case 15: textureColor2 = (textureColor = Color.Black); break; case 16: textureColor = Color.White; textureColor2 = Color.Green; break; } m_frontCard.GetChildAt(0).TextureColor = textureColor; m_frontCard.GetChildAt(3).TextureColor = textureColor; m_backCard.GetChildAt(0).TextureColor = textureColor2; m_backCard.GetChildAt(2).TextureColor = textureColor2; m_frontCard.GetChildAt(2).TextureColor = new Color(235, 220, 185); m_backCard.GetChildAt(1).TextureColor = new Color(235, 220, 185); }
public override void LoadContent() { var textObj = new TextObj(Game.JunicodeFont); textObj.FontSize = 12f; textObj.Align = Types.TextAlign.Left; var textObj2 = new TextObj(Game.JunicodeFont); textObj2.FontSize = 14f; textObj2.Text = "Blacksmith"; textObj2.DropShadow = new Vector2(2f, 2f); textObj2.TextureColor = new Color(236, 197, 132); m_dialogContainer = new ObjContainer("DialogBox_Character"); m_dialogContainer.Position = new Vector2(660f, 100f); m_dialogContainer.AddChild(textObj2); m_dialogContainer.ForceDraw = true; textObj2.Position = new Vector2(-(float)m_dialogContainer.Width / 2.2f, -(float)m_dialogContainer.Height / 1.6f); m_dialogContainer.AddChild(textObj); textObj.Position = new Vector2(-(float)m_dialogContainer.Width / 2.15f, -(float)m_dialogContainer.Height / 3.5f); textObj.Text = "This is a test to see how much text I can fit onto this dialog box without it running out of space. The text needs to be defined after the dialog text position is set, because the dialogtext width affects the entire width of the dialog container, which in END."; textObj.WordWrap(850); textObj.DropShadow = new Vector2(2f, 3f); var spriteObj = new SpriteObj("ContinueTextIcon_Sprite"); spriteObj.Position = new Vector2(m_dialogContainer.GetChildAt(2).Bounds.Right, m_dialogContainer.GetChildAt(2).Bounds.Bottom); m_dialogContainer.AddChild(spriteObj); m_dialogContinueIconY = spriteObj.Y; var textObj3 = new TextObj(Game.JunicodeFont); textObj3.FontSize = 12f; textObj3.Text = "Yes"; textObj3.Align = Types.TextAlign.Centre; var textObj4 = new TextObj(Game.JunicodeFont); textObj4.FontSize = 12f; textObj4.Text = "No"; textObj4.Align = Types.TextAlign.Centre; m_dialogChoiceContainer = new ObjContainer(); var obj = new SpriteObj("GameOverStatPlate_Sprite"); m_dialogChoiceContainer.AddChild(obj); var spriteObj2 = new SpriteObj("DialogueChoiceHighlight_Sprite"); m_dialogChoiceContainer.AddChild(spriteObj2); m_dialogChoiceContainer.ForceDraw = true; m_dialogChoiceContainer.Position = new Vector2(660f, 360f); m_dialogChoiceContainer.AddChild(textObj3); textObj3.Y -= 40f; m_dialogChoiceContainer.AddChild(textObj4); textObj4.Y += 7f; spriteObj2.Position = new Vector2(textObj3.X, textObj3.Y + spriteObj2.Height / 2 + 3f); m_dialogChoiceContainer.Scale = Vector2.Zero; m_dialogChoiceContainer.Visible = false; base.LoadContent(); }
private void LoadFrontCard() { var textObj = new TextObj(Game.JunicodeFont); textObj.Text = ""; textObj.FontSize = 10f; textObj.ForceDraw = true; textObj.TextureColor = Color.Black; m_playerName = (textObj.Clone() as TextObj); m_playerName.Text = "Sir Archibald the IV"; m_playerName.Position = new Vector2(50f, 43f); m_frontCard.AddChild(m_playerName); m_money = (textObj.Clone() as TextObj); m_money.Position = new Vector2(m_frontCard.GetChildAt(3).X + 30f, m_playerName.Y); m_money.Text = "0"; m_frontCard.AddChild(m_money); m_levelClass = (textObj.Clone() as TextObj); m_levelClass.Text = "Lvl 43 Knight"; m_levelClass.Position = new Vector2(m_playerName.X, 370f); m_frontCard.AddChild(m_levelClass); m_playerBG = new SpriteObj("CardDungeonBG_Sprite"); m_playerBG.Position = new Vector2(45f, 80f); m_frontCard.AddChildAt(1, m_playerBG); m_playerHUD = new PlayerHUDObj(); m_playerHUD.ForceDraw = true; m_playerHUD.ShowBarsOnly = true; m_playerHUD.SetPosition(new Vector2(m_frontCard.X + 46f, m_frontCard.Y + 64f)); m_frontCard.AddChild(m_playerHUD); m_frontTrait1 = new TextObj(Game.JunicodeFont); m_frontTrait1.FontSize = 7f; m_frontTrait1.TextureColor = Color.Black; m_frontTrait1.Position = new Vector2(50f, 550f); m_frontTrait1.Text = "Color Blind"; m_frontCard.AddChild(m_frontTrait1); m_frontTrait2 = (m_frontTrait1.Clone() as TextObj); m_frontTrait2.Y -= 20f; m_frontTrait2.Text = "Myopic"; m_frontCard.AddChild(m_frontTrait2); m_classDescription = new TextObj(Game.JunicodeFont); m_classDescription.FontSize = 8f; m_classDescription.TextureColor = Color.Black; m_classDescription.Text = "0"; m_classDescription.Position = new Vector2(50f, 410f); m_frontCard.AddChild(m_classDescription); m_author = new TextObj(Game.JunicodeFont); m_author.FontSize = 8f; m_author.TextureColor = Color.White; m_author.Text = "Glauber Kotaki"; m_author.X = m_playerName.X; m_author.Y = 590f; m_frontCard.AddChild(m_author); m_playerStats = (textObj.Clone() as TextObj); m_playerStats.Text = "10/10"; m_playerStats.Align = Types.TextAlign.Centre; m_playerStats.Position = new Vector2(387f, 579f); m_frontCard.AddChild(m_playerStats); }
private void CheckSaveHeaders(ObjContainer container, byte profile) { var textObj = container.GetChildAt(1) as TextObj; var textObj2 = container.GetChildAt(3) as TextObj; var textObj3 = container.GetChildAt(4) as TextObj; textObj2.Text = ""; textObj3.Text = ""; string text = null; byte classType = 0; var num = 0; var flag = false; var num2 = 0; try { (ScreenManager.Game as Game).SaveManager.GetSaveHeader(profile, out classType, out text, out num, out flag, out num2); if (text == null) { textObj.Text = "- START NEW LEGACY -"; container.ID = 0; } else { var isFemale = text.Contains("Lady"); if (!flag) { textObj.Text = text + " the " + ClassType.ToString(classType, isFemale); } else { textObj.Text = text + " the Deceased"; } textObj2.Text = "Lvl. " + num; if (num2 > 0) { textObj3.Text = "NG+ " + num2; } container.ID = 1; } } catch { textObj.Text = "- START NEW LEGACY -"; container.ID = 0; } }
public void ActivateTarget() { if (m_numTargets - m_currentTargetIndex < m_targetIcons.NumChildren) { m_targetIcons.GetChildAt(m_numTargets - m_currentTargetIndex).Visible = false; GiveGold(); } if (m_currentTargetIndex >= m_numTargets) { m_currentTarget = null; return; } if (m_currentTarget != null) { m_targetSpeed += m_targetSpeedMod; } m_currentTarget = m_targetList[m_currentTargetIndex]; m_currentTarget.Visible = true; if (!IsReversed) { Tween.By(m_currentTarget, 2f, Quad.EaseOut, "X", (-400 + CDGMath.RandomInt(-200, 200)).ToString()); return; } Tween.By(m_currentTarget, 2f, Quad.EaseOut, "X", (400 + CDGMath.RandomInt(-200, 200)).ToString()); }
public override void OnEnter() { m_initialCameraPos = Camera.Position; SetObjectKilledPlayerText(); m_playerFrame.Opacity = 0f; m_playerFrame.Position = m_lastBoss.Position; m_playerFrame.SetTraits(Vector2.Zero); m_playerFrame.IsFemale = false; m_playerFrame.Class = 0; m_playerFrame.Y -= 120f; m_playerFrame.SetPortrait(8, 1, 1); m_playerFrame.UpdateData(); Tween.To(m_playerFrame, 1f, Tween.EaseNone, "delay", "4", "Opacity", "1"); SoundManager.StopMusic(0.5f); m_lockControls = false; SoundManager.PlaySound("Player_Death_FadeToBlack"); m_continueText.Text = "Press [Input:" + 0 + "] to move on"; m_lastBoss.Visible = true; m_lastBoss.Opacity = 1f; m_continueText.Opacity = 0f; m_dialoguePlate.Opacity = 0f; m_playerGhost.Opacity = 0f; m_spotlight.Opacity = 0f; m_playerGhost.Position = new Vector2(m_lastBoss.X - m_playerGhost.Width / 2, m_lastBoss.Bounds.Top - 20); Tween.RunFunction(3f, typeof(SoundManager), "PlaySound", "Player_Ghost"); Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "3", "Opacity", "0.4"); Tween.By(m_playerGhost, 2f, Linear.EaseNone, "delay", "3", "Y", "-150"); m_playerGhost.Opacity = 0.4f; Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "4", "Opacity", "0"); m_playerGhost.Opacity = 0f; m_playerGhost.PlayAnimation(); Tween.To(this, 0.5f, Linear.EaseNone, "BackBufferOpacity", "1"); Tween.To(m_spotlight, 0.1f, Linear.EaseNone, "delay", "1", "Opacity", "1"); Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", "Player_Death_Spotlight"); Tween.RunFunction(2f, typeof(SoundManager), "PlaySound", "FinalBoss_St1_DeathGrunt"); Tween.RunFunction(1.2f, typeof(SoundManager), "PlayMusic", "GameOverBossStinger", false, 0.5f); Tween.To(Camera, 1f, Quad.EaseInOut, "X", m_lastBoss.AbsX.ToString(), "Y", (m_lastBoss.Bounds.Bottom - 10).ToString()); Tween.RunFunction(2f, m_lastBoss, "PlayAnimation", false); (m_dialoguePlate.GetChildAt(2) as TextObj).Text = "The sun... I had forgotten how it feels..."; (m_dialoguePlate.GetChildAt(3) as TextObj).Text = "-" + m_lastBoss.Name + "'s Parting Words"; Tween.To(m_dialoguePlate, 0.5f, Tween.EaseNone, "delay", "2", "Opacity", "1"); Tween.RunFunction(4f, this, "DropStats"); Tween.To(m_continueText, 0.4f, Linear.EaseNone, "delay", "4", "Opacity", "1"); base.OnEnter(); }
private void UpdateIconSelectionText() { m_equipmentDescriptionText.Position = new Vector2(-1000f, -1000f); m_textInfoTitleContainer.Visible = false; m_textInfoStatContainer.Visible = false; m_textInfoStatModContainer.Visible = false; m_addPropertiesTitleText.Visible = false; m_addPropertiesText.Visible = false; m_unlockCostContainer.Visible = false; m_equipmentTitleText.Visible = false; if (m_inCategoryMenu) { m_equipmentDescriptionText.Text = "Select a category"; return; } if (Game.PlayerStats.GetBlueprintArray[m_currentCategoryIndex - 6][m_currentEquipmentIndex] == 0) { m_equipmentDescriptionText.Position = new Vector2(230f, -20f); m_equipmentDescriptionText.Text = "Blueprint needed"; return; } if (Game.PlayerStats.GetBlueprintArray[m_currentCategoryIndex - 6][m_currentEquipmentIndex] < 3) { m_equipmentDescriptionText.Text = "Purchase Info Here"; (m_unlockCostContainer.GetChildAt(1) as TextObj).Text = Game.EquipmentSystem.GetEquipmentData(m_currentCategoryIndex - 6, m_currentEquipmentIndex) .Cost + " to unlock"; m_unlockCostContainer.Visible = true; m_textInfoTitleContainer.Visible = true; m_textInfoStatContainer.Visible = true; m_textInfoStatModContainer.Visible = true; m_addPropertiesTitleText.Visible = true; m_addPropertiesText.Visible = true; m_equipmentTitleText.Visible = true; m_textInfoTitleContainer.Opacity = 0.5f; m_textInfoStatContainer.Opacity = 0.5f; m_textInfoStatModContainer.Opacity = 0.5f; m_addPropertiesTitleText.Opacity = 0.5f; m_addPropertiesText.Opacity = 0.5f; m_equipmentTitleText.Opacity = 0.5f; UpdateEquipmentDataText(); return; } m_textInfoTitleContainer.Visible = true; m_textInfoStatContainer.Visible = true; m_textInfoStatModContainer.Visible = true; m_addPropertiesTitleText.Visible = true; m_addPropertiesText.Visible = true; m_equipmentTitleText.Visible = true; m_textInfoTitleContainer.Opacity = 1f; m_textInfoStatContainer.Opacity = 1f; m_textInfoStatModContainer.Opacity = 1f; m_addPropertiesTitleText.Opacity = 1f; m_addPropertiesText.Opacity = 1f; m_equipmentTitleText.Opacity = 1f; UpdateEquipmentDataText(); }
private void UpdatePlayerMP(PlayerObj player) { var num = (int)(player.MaxMana - player.BaseMana); var num2 = player.CurrentMana / player.MaxMana; var num3 = (int)(88f + num / 5f); if (num3 > m_maxBarLength) { num3 = m_maxBarLength; } var scaleX = (num3 - 28 - 28) / 32f; m_mpBarContainer.GetChildAt(1).ScaleX = scaleX; m_mpBarContainer.GetChildAt(2).X = m_mpBarContainer.GetChildAt(1).Bounds.Right; m_mpBarContainer.CalculateBounds(); m_mpBar.ScaleX = 1f; m_mpBar.ScaleX = (m_mpBarContainer.Width - 8) / (float)m_mpBar.Width * num2; }
public void ActivateArchitect() { Player.LockControls(); Player.CurrentSpeed = 0f; m_architectIcon.Visible = false; m_architectRenovating = true; m_architect.ChangeSprite("ArchitectPull_Character"); (m_architect.GetChildAt(1) as SpriteObj).PlayAnimation(false); m_screw.AnimationDelay = 0.0333333351f; Tween.RunFunction(0.5f, m_architect.GetChildAt(0), "PlayAnimation", true); Tween.RunFunction(0.5f, typeof(SoundManager), "PlaySound", "Architect_Lever"); Tween.RunFunction(1f, typeof(SoundManager), "PlaySound", "Architect_Screw"); Tween.RunFunction(1f, m_screw, "PlayAnimation", false); Tween.By(m_architectBlock, 0.8f, Tween.EaseNone, "delay", "1.1", "Y", "135"); Tween.RunFunction(1f, this, "ShakeScreen", 2, true, false); Tween.RunFunction(1.5f, this, "StopScreenShake"); Tween.RunFunction(1.5f, Player.AttachedLevel.ImpactEffectPool, "SkillTreeDustEffect", new Vector2(m_screw.X - m_screw.Width / 2f, m_screw.Y - 40f), true, m_screw.Width); Tween.RunFunction(3f, this, "StopArchitectActivation"); }
public override void Update(GameTime gameTime) { if (m_gameCrashed) { (ScreenManager.Game as Game).SaveManager.ForceBackup(); } if (m_isLoading && m_loadingComplete && !m_gameCrashed) { EndLoading(); } var num = (float)gameTime.ElapsedGameTime.TotalSeconds; m_gateSprite.GetChildAt(1).Rotation += 120f * num; m_gateSprite.GetChildAt(2).Rotation -= 120f * num; if (m_shakeScreen) { UpdateShake(); } base.Update(gameTime); }
public override void Initialize() { m_boss1 = (EnemyList[0] as EnemyObj_Blob); m_boss1.PauseEnemy(true); m_boss1.DisableAllWeight = false; m_desiredBossScale = m_boss1.Scale.X; m_blobArray = new List <ObjContainer>(); for (var i = 0; i < m_numIntroBlobs; i++) { var objContainer = new ObjContainer("EnemyBlobBossAir_Character"); objContainer.Position = m_boss1.Position; objContainer.Scale = new Vector2(0.4f, 0.4f); objContainer.GetChildAt(0).TextureColor = Color.White; objContainer.GetChildAt(2).TextureColor = Color.LightSkyBlue; objContainer.GetChildAt(2).Opacity = 0.8f; (objContainer.GetChildAt(1) as SpriteObj).OutlineColour = Color.Black; objContainer.Y -= 1000f; m_blobArray.Add(objContainer); GameObjList.Add(objContainer); } base.Initialize(); }
protected override bool OnCast(Entity source) { var obj = source.GameObject; if (_shadowSprite == null) { _shadowSprite = new ObjContainer(obj.SpriteName) { OutlineColour = Color.Blue, OutlineWidth = 2, TextureColor = Color.Black } } ; else { _shadowSprite.ChangeSprite(obj.SpriteName); } _shadowSprite.Position = obj.Position; _shadowSprite.Flip = obj.Flip; _shadowSprite.Scale = Vector2.Zero; _shadowSprite.Visible = true; _shadowSprite.GoToFrame(obj.CurrentFrame); for (var i = 0; i < obj.NumChildren; i++) { var src = obj.GetChildAt(i) as SpriteObj; var dst = _shadowSprite.GetChildAt(i) as SpriteObj; var show = src.Visible; if (source is Player && ( i == 16 || ( Player.Class is Classes.Spellthief && (i == 10 || i == 11) ))) { show = false; } dst.ChangeSprite(src.SpriteName); dst.Visible = show; } Tween.To(_shadowSprite, 0.4f, Linear.EaseNone, "ScaleX", obj.ScaleX.ToString(), "ScaleY", obj.ScaleY.ToString()); Effects.InverseEmitEffect.Display(_shadowSprite.Position); return(true); }
public override void LoadContent() { m_frontCard = new ObjContainer("CardFront_Character"); m_frontCard.ForceDraw = true; m_frontCard.Position = new Vector2(145f, 30f); m_frontCard.GetChildAt(0).TextureColor = Color.Red; m_frontCard.GetChildAt(2).TextureColor = Color.Red; LoadFrontCard(); m_backCard = new ObjContainer("CardBack_Character"); m_backCard.ForceDraw = true; m_backCard.Position = new Vector2(m_frontCard.X + m_backCard.Width + 100f, m_frontCard.Y); m_backCard.AddChild(m_playerName.Clone() as GameObj); m_backCard.GetChildAt(0).TextureColor = Color.Red; m_backCard.GetChildAt(2).TextureColor = Color.Red; LoadBackCard(); m_playerSprite = new ObjContainer("PlayerIdle_Character"); m_playerSprite.ForceDraw = true; m_playerSprite.Scale = new Vector2(2f, 2f); m_playerSprite.OutlineWidth = 2; m_tombStoneSprite = new SpriteObj("Tombstone_Sprite"); m_tombStoneSprite.ForceDraw = true; m_tombStoneSprite.Scale = new Vector2(3f, 3f); m_tombStoneSprite.OutlineWidth = 2; m_spellIcon = new SpriteObj(SpellType.Icon(12)); m_spellIcon.Position = new Vector2(350f, 295f); m_spellIcon.OutlineWidth = 2; m_spellIcon.ForceDraw = true; m_cancelText = new KeyIconTextObj(Game.JunicodeFont); m_cancelText.Text = "to exit options"; m_cancelText.Align = Types.TextAlign.Right; m_cancelText.DropShadow = new Vector2(2f, 2f); m_cancelText.FontSize = 12f; m_cancelText.Position = new Vector2(1290f, 650f); m_cancelText.ForceDraw = true; base.LoadContent(); }
private void HandleInput() { if (m_isPlayingGame && (Game.GlobalInput.JustPressed(24) || (Game.GlobalInput.JustPressed(12) && Game.PlayerStats.Class == 16)) && Player.SpellCastDelay <= 0f) { m_daggersThrown++; Player.CurrentMana = Player.MaxMana; if (m_daggersThrown <= m_numTries) { m_daggerIcons.GetChildAt(m_numTries - m_daggersThrown).Visible = false; } if (m_daggersThrown > m_numTries) { Game.PlayerStats.Spell = 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); } }
public override void LoadContent() { m_impactEffectPool.Initialize(); m_manor = new ObjContainer("TraitsCastle_Character"); m_manor.Scale = new Vector2(2f, 2f); m_manor.ForceDraw = true; for (var i = 0; i < m_manor.NumChildren; i++) { m_manor.GetChildAt(i).Visible = false; m_manor.GetChildAt(i).Opacity = 0f; } m_dialoguePlate = new ObjContainer("TraitsScreenPlate_Container"); m_dialoguePlate.ForceDraw = true; m_dialoguePlate.Position = new Vector2(1320 - m_dialoguePlate.Width / 2, 360f); m_skillIcon = new SpriteObj("Icon_Health_Up_Sprite"); m_skillIcon.Position = new Vector2(-110f, -200f); m_dialoguePlate.AddChild(m_skillIcon); m_skillTitle = new TextObj(Game.JunicodeFont); m_skillTitle.Text = "Skill name"; m_skillTitle.DropShadow = new Vector2(2f, 2f); m_skillTitle.TextureColor = new Color(236, 197, 132); m_skillTitle.Position = new Vector2(m_skillIcon.Bounds.Right + 15, m_skillIcon.Y); m_skillTitle.FontSize = 12f; m_dialoguePlate.AddChild(m_skillTitle); m_skillDescription = new TextObj(Game.JunicodeFont); m_skillDescription.Text = "Description text goes here. Let's see how well the word wrap function works."; m_skillDescription.Position = new Vector2(m_dialoguePlate.GetChildAt(1).X - 30f, m_dialoguePlate.GetChildAt(1).Bounds.Bottom + 20); m_skillDescription.FontSize = 10f; m_skillDescription.DropShadow = new Vector2(2f, 2f); m_skillDescription.TextureColor = new Color(228, 218, 208); m_skillDescription.WordWrap(m_dialoguePlate.Width - 50); m_dialoguePlate.AddChild(m_skillDescription); m_inputDescription = new KeyIconTextObj(Game.JunicodeFont); m_inputDescription.Text = "Input descriptions go here.."; m_inputDescription.Position = new Vector2(m_skillIcon.X - 30f, m_skillDescription.Bounds.Bottom + 20); m_inputDescription.FontSize = 10f; m_inputDescription.DropShadow = new Vector2(2f, 2f); m_inputDescription.TextureColor = new Color(228, 218, 208); m_inputDescription.WordWrap(m_dialoguePlate.Width - 50); m_dialoguePlate.AddChild(m_inputDescription); m_descriptionDivider = new SpriteObj("Blank_Sprite"); m_descriptionDivider.ScaleX = 250f / m_descriptionDivider.Width; m_descriptionDivider.ScaleY = 0.25f; m_descriptionDivider.ForceDraw = true; m_descriptionDivider.DropShadow = new Vector2(2f, 2f); m_skillCurrent = new TextObj(Game.JunicodeFont); m_skillCurrent.Position = new Vector2(m_inputDescription.X, m_inputDescription.Bounds.Bottom + 10); m_skillCurrent.FontSize = 10f; m_skillCurrent.DropShadow = new Vector2(2f, 2f); m_skillCurrent.TextureColor = new Color(228, 218, 208); m_skillCurrent.WordWrap(m_dialoguePlate.Width - 50); m_dialoguePlate.AddChild(m_skillCurrent); m_skillUpgrade = (m_skillCurrent.Clone() as TextObj); m_skillUpgrade.Y += 15f; m_dialoguePlate.AddChild(m_skillUpgrade); m_skillLevel = (m_skillUpgrade.Clone() as TextObj); m_skillLevel.Y += 15f; m_dialoguePlate.AddChild(m_skillLevel); m_skillCost = new TextObj(Game.JunicodeFont); m_skillCost.X = m_skillIcon.X; m_skillCost.Y = 182f; m_skillCost.FontSize = 10f; m_skillCost.DropShadow = new Vector2(2f, 2f); m_skillCost.TextureColor = Color.Yellow; m_dialoguePlate.AddChild(m_skillCost); m_skillCostBG = new SpriteObj("SkillTreeGoldIcon_Sprite"); m_skillCostBG.Position = new Vector2(-180f, 180f); m_dialoguePlate.AddChild(m_skillCostBG); m_dialoguePlate.ForceDraw = true; m_bg = new SpriteObj("TraitsBG_Sprite"); m_bg.Scale = new Vector2(1320f / m_bg.Width, 1320f / m_bg.Width); m_bg.ForceDraw = true; m_cloud1 = new SpriteObj("TraitsCloud1_Sprite") { ForceDraw = true }; m_cloud2 = new SpriteObj("TraitsCloud2_Sprite") { ForceDraw = true }; m_cloud3 = new SpriteObj("TraitsCloud3_Sprite") { ForceDraw = true }; m_cloud4 = new SpriteObj("TraitsCloud4_Sprite") { ForceDraw = true }; m_cloud5 = new SpriteObj("TraitsCloud5_Sprite") { ForceDraw = true }; var opacity = 1f; m_cloud1.Opacity = opacity; m_cloud2.Opacity = opacity; m_cloud3.Opacity = opacity; m_cloud4.Opacity = opacity; m_cloud5.Opacity = opacity; m_cloud1.Position = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360)); m_cloud2.Position = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360)); m_cloud3.Position = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360)); m_cloud4.Position = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360)); m_cloud5.Position = new Vector2(CDGMath.RandomInt(0, 1520), CDGMath.RandomInt(0, 360)); m_selectionIcon = new SpriteObj("IconHalo_Sprite"); m_selectionIcon.ForceDraw = true; m_selectionIcon.AnimationDelay = 0.1f; m_selectionIcon.PlayAnimation(); m_selectionIcon.Scale = new Vector2(1.1f, 1.1f); m_titleText = new SpriteObj("ManorTitleText_Sprite"); m_titleText.X = m_titleText.Width / 2f + 20f; m_titleText.Y = 64.8f; m_titleText.ForceDraw = true; m_continueText = new KeyIconTextObj(Game.JunicodeFont); m_continueText.ForceDraw = true; m_continueText.FontSize = 12f; m_continueText.DropShadow = new Vector2(2f, 2f); m_continueText.Position = new Vector2(1300f, 630f); m_continueText.Align = Types.TextAlign.Right; m_toggleIconsText = new KeyIconTextObj(Game.JunicodeFont); m_toggleIconsText.ForceDraw = true; m_toggleIconsText.FontSize = 12f; m_toggleIconsText.DropShadow = new Vector2(2f, 2f); m_toggleIconsText.Position = new Vector2(m_continueText.X, m_continueText.Y + 40f); m_toggleIconsText.Align = Types.TextAlign.Right; m_confirmText = new KeyIconTextObj(Game.JunicodeFont); m_confirmText.Align = Types.TextAlign.Right; m_confirmText.FontSize = 12f; m_confirmText.DropShadow = new Vector2(2f, 2f); m_confirmText.Position = new Vector2(1300f, 10f); m_confirmText.ForceDraw = true; m_navigationText = new KeyIconTextObj(Game.JunicodeFont); m_navigationText.Align = Types.TextAlign.Right; m_navigationText.FontSize = 12f; m_navigationText.DropShadow = new Vector2(2f, 2f); m_navigationText.Position = new Vector2(m_confirmText.X, m_confirmText.Y + 40f); m_navigationText.ForceDraw = true; m_coinIcon = new SpriteObj("CoinIcon_Sprite"); m_coinIcon.Position = new Vector2(1100f, 585f); m_coinIcon.Scale = new Vector2(0.9f, 0.9f); m_coinIcon.ForceDraw = true; m_playerMoney = new TextObj(Game.GoldFont); m_playerMoney.Align = Types.TextAlign.Left; m_playerMoney.Text = "1000"; m_playerMoney.FontSize = 30f; m_playerMoney.Position = new Vector2(m_coinIcon.X + 35f, m_coinIcon.Y); m_playerMoney.ForceDraw = true; base.LoadContent(); }
public override void OnEnter() { var flag = true; foreach (var current in SkillSystem.SkillArray) { if (current.CurrentLevel < 1) { flag = false; break; } } if (flag) { GameUtil.UnlockAchievement("FEAR_OF_DECISIONS"); } if (Game.PlayerStats.CurrentLevel >= 50) { GameUtil.UnlockAchievement("FEAR_OF_WEALTH"); } m_lockControls = false; m_manor.GetChildAt(23).Visible = true; m_manor.GetChildAt(23).Opacity = 1f; Camera.Position = new Vector2(660f, 360f); var skillArray = SkillSystem.GetSkillArray(); for (var i = 0; i < skillArray.Length; i++) { if (skillArray[i].CurrentLevel > 0) { SetVisible(skillArray[i], false); } } if (!SoundManager.IsMusicPlaying) { SoundManager.PlayMusic("SkillTreeSong", true, 1f); } var skill = SkillSystem.GetSkill((int)m_selectedTraitIndex.X, (int)m_selectedTraitIndex.Y); m_selectionIcon.Position = SkillSystem.GetSkillPosition(skill); UpdateDescriptionPlate(skill); m_dialoguePlate.Visible = true; m_confirmText.Text = "[Input:" + 0 + "] to purchase/upgrade skill"; m_toggleIconsText.Text = "[Input:" + 9 + "] to toggle icons off"; m_continueText.Text = "[Input:" + 2 + "] to exit the manor"; if (InputManager.GamePadIsConnected(PlayerIndex.One)) { m_navigationText.Text = "[Button:LeftStick] to navigate skills"; } else { m_navigationText.Text = "Arrow keys to navigate skills"; } SkillSystem.UpdateAllTraitSprites(); base.OnEnter(); }
private void EquipmentSelectionInput() { var categoryIndex = m_currentCategoryIndex - 6; int oldIndex = m_currentEquipmentIndex; if (InputManager.IsNewlyPressed(InputFlags.PlayerUp1 | InputFlags.PlayerUp2)) { oldIndex = (oldIndex + 10) % 15; } else if (InputManager.IsNewlyPressed(InputFlags.PlayerDown1 | InputFlags.PlayerDown2)) { oldIndex = (oldIndex + 5) % 15; } if (InputManager.IsNewlyPressed(InputFlags.PlayerLeft1 | InputFlags.PlayerLeft2)) { oldIndex += oldIndex % 5 == 0 ? 4 : -1; } if (InputManager.IsNewlyPressed(InputFlags.PlayerRight1 | InputFlags.PlayerRight2)) { oldIndex += oldIndex % 5 == 4 ? -4 : 1; } var bpArr = Game.PlayerStats.GetBlueprintArray[categoryIndex]; if (oldIndex != m_currentEquipmentIndex) { m_currentEquipmentIndex = oldIndex; if (bpArr[oldIndex] == 1) { bpArr[oldIndex] = 2; } UpdateNewIcons(); UpdateIconSelectionText(); m_selectionIcon.Position = m_activeIconArray[oldIndex].AbsPosition; SoundManager.PlaySound("ShopBSMenuMove"); } if (InputManager.IsNewlyPressed(InputFlags.MenuCancel1 | InputFlags.MenuCancel2)) { SoundManager.PlaySound("ShopMenuCancel"); m_inCategoryMenu = true; m_selectionIcon.Position = m_blacksmithUI.GetChildAt(m_currentCategoryIndex).AbsPosition; UpdateIconSelectionText(); } if (InputManager.IsNewlyPressed(InputFlags.MenuConfirm1 | InputFlags.MenuConfirm2)) { var player = this.Player; int item = bpArr[oldIndex]; var equipArray = Game.PlayerStats.GetEquippedArray; var currentEquipped = equipArray[categoryIndex]; if (item < 3 && item > 0) { EquipmentBase equipmentData = Game.EquipmentSystem.GetEquipmentData(categoryIndex, oldIndex); if (Game.PlayerStats.Gold < equipmentData.Cost) { SoundManager.PlaySound("ShopMenuUnlockFail"); } else { SoundManager.PlaySound("ShopMenuUnlock"); Game.PlayerStats.Gold -= equipmentData.Cost; bpArr[oldIndex] = 3; ObjContainer firstColour = this.m_masterIconArray[categoryIndex][oldIndex]; firstColour.ChangeSprite("BlacksmithUI_" + EquipmentCategoryType.ToString(categoryIndex) + (oldIndex % 5 + 1) + "Icon_Character"); for (int i = 1; i < firstColour.NumChildren; i++) { firstColour.GetChildAt(i).Opacity = 1f; } int num1 = categoryIndex == 0 ? 2 : 1; firstColour.GetChildAt(num1).TextureColor = equipmentData.FirstColour; if (categoryIndex != 4) { firstColour.GetChildAt(num1 + 1).TextureColor = equipmentData.SecondColour; } item = 3; this.UpdateIconSelectionText(); } } if (currentEquipped != oldIndex && item == 3) { EquipmentBase equipmentDatum = Game.EquipmentSystem.GetEquipmentData(categoryIndex, oldIndex); //int getEquippedArray1 = Game.PlayerStats.GetEquippedArray[categoryIndex]; int weight = 0; if (currentEquipped != -1) { weight = Game.EquipmentSystem.GetEquipmentData(categoryIndex, currentEquipped).Weight; } if (equipmentDatum.Weight + player.CurrentWeight - weight > player.MaxWeight) { Console.WriteLine(string.Concat("cannot equip. too heavy. Weight:", equipmentDatum.Weight + player.CurrentWeight - weight)); return; } SoundManager.PlaySound("ShopBSEquip"); equipArray[categoryIndex] = (sbyte)oldIndex; this.UpdateIconSelectionText(); Vector3 partIndices = PlayerPart.GetPartIndices(categoryIndex); if (partIndices.X != -1f) { player.GetChildAt((int)partIndices.X).TextureColor = equipmentDatum.FirstColour; } if (partIndices.Y != -1f) { player.GetChildAt((int)partIndices.Y).TextureColor = equipmentDatum.SecondColour; } if (partIndices.Z != -1f) { player.GetChildAt((int)partIndices.Z).TextureColor = equipmentDatum.SecondColour; } if (categoryIndex == 2 && partIndices.X != -1f) { player.GetChildAt(5).TextureColor = equipmentDatum.FirstColour; } this.UpdateNewIcons(); return; } if (currentEquipped == oldIndex) { equipArray[categoryIndex] = -1; player.UpdateEquipmentColours(); this.UpdateIconSelectionText(); this.UpdateNewIcons(); } } }
private void LoadBackCardStats(PlayerObj player) { TextObj obj1, obj2; int ix = 0, count = m_dataList1.Count; while (ix < count) { obj1 = m_dataList1[ix]; obj2 = m_dataList2[ix]; switch (ix) { case 0: obj1.Text = player.MaxHealth.ToString(); obj2.Text = player.Damage.ToString(); break; case 1: obj1.Text = player.MaxMana.ToString(); obj2.Text = player.TotalMagicDamage.ToString(); break; case 2: obj1.Text = player.TotalArmor + "(" + (int)(player.TotalDamageReduc * 100f) + "%)"; obj2.Text = (int)Math.Round(player.TotalCritChance * 100f, MidpointRounding.AwayFromZero) + "%"; break; case 3: obj1.Text = player.CurrentWeight + "/" + player.MaxWeight; obj2.Text = (int)(player.TotalCriticalDamage * 100f) + "%"; break; } ix++; } var getEquippedArray = Game.PlayerStats.GetEquippedArray; ix = 0; count = getEquippedArray.Length; int posY = (int)m_equipmentTitle.Y + 40; while (ix < count) { int id = getEquippedArray[ix]; obj1 = m_equipmentList[ix]; if (id >= 0) { obj1.Y = posY; obj1.Visible = true; obj1.Text = Game.EquipmentSystem.EquipmentDataArray[ix][id].DisplayName; posY += 20; } else { obj1.Visible = false; } ix++; } ix = 0; count = m_runeBackTitleList.Count; posY = (int)m_runesTitle.Y + 40; while (ix < count) { obj1 = m_runeBackTitleList[ix]; obj2 = m_runeBackDescriptionList[ix]; float value = 0f; switch (ix) { case 0: value = player.TotalDoubleJumps; break; case 1: value = player.TotalAirDashes; break; case 2: value = player.TotalVampBonus; break; case 3: value = player.TotalFlightTime; break; case 4: value = player.ManaGain; break; case 5: value = player.TotalDamageReturn * 100f; break; case 6: value = player.TotalGoldBonus * 100f; break; case 7: value = player.TotalMovementSpeedPercent * 100f - 100f; break; case 8: value = Game.PlayerStats.GetNumberOfEquippedRunes(8) * 8; break; case 9: value = Game.PlayerStats.GetNumberOfEquippedRunes(9) * 0.75f; break; case 10: value = Game.PlayerStats.HasArchitectFee ? 1f : 0f; break; case 11: value = Game.PlayerStats.TimesCastleBeaten * 50; break; } if (value > 0f) { obj2.Text = "(" + EquipmentAbilityType.ShortDescription(ix + (ix > 9 ? 10 : 0), value) + ")"; obj1.Visible = true; obj2.Visible = true; obj1.Y = posY; obj2.Y = posY; posY += 20; } else { obj1.Visible = false; obj2.Visible = false; } ix++; } (m_backCard.GetChildAt(3) as TextObj).Text = Game.PlayerStats.PlayerName; }
public override void Draw(GameTime gametime) { m_playerHUD.SetPosition(new Vector2(m_frontCard.X + 46f, m_frontCard.Y + 64f)); Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, null, null); Camera.Draw(Game.GenericTexture, new Rectangle(0, 0, 1320, 720), Color.Black * BackBufferOpacity); m_frontCard.Draw(Camera); m_backCard.Draw(Camera); m_cancelText.Draw(Camera); Camera.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp; if (!Game.PlayerStats.IsDead) { if (!m_playerInAir) { ObjContainer mPlayerSprite = m_playerSprite; Rectangle bounds = m_playerSprite.Bounds; mPlayerSprite.Position = new Vector2(m_frontCard.X + 160f, m_frontCard.Y + 280f - ((float)bounds.Bottom - m_playerSprite.Y)); } else { m_playerSprite.Position = new Vector2(m_frontCard.X + 180f, m_frontCard.Y + 202f); } m_playerSprite.Draw(Camera); EffectParameter item = Game.ColourSwapShader.Parameters["desiredTint"]; Color textureColor = m_playerSprite.GetChildAt(12).TextureColor; item.SetValue(textureColor.ToVector4()); var args = RogueAPI.Game.Player.PipeSkinShaderArgs(this, m_playerSprite); Game.ColourSwapShader.Parameters["Opacity"].SetValue(args.Target.Opacity); Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(args.Target.ColorSwappedOut1.ToVector4()); Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(args.Target.ColorSwappedIn1.ToVector4()); Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(args.Target.ColorSwappedOut2.ToVector4()); Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(args.Target.ColorSwappedIn2.ToVector4()); //if (Game.PlayerStats.Class == 7 || Game.PlayerStats.Class == 15) //{ // Game.ColourSwapShader.Parameters["Opacity"].SetValue(this.m_playerSprite.Opacity); // Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(this.m_lichColour1.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(this.m_lichColour2.ToVector4()); //} //else if (Game.PlayerStats.Class == 3 || Game.PlayerStats.Class == 11) //{ // Game.ColourSwapShader.Parameters["Opacity"].SetValue(this.m_playerSprite.Opacity); // Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(Color.Black.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(Color.Black.ToVector4()); //} //else //{ // Game.ColourSwapShader.Parameters["Opacity"].SetValue(1); // Game.ColourSwapShader.Parameters["ColourSwappedOut1"].SetValue(this.m_skinColour1.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn1"].SetValue(this.m_skinColour1.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedOut2"].SetValue(this.m_skinColour2.ToVector4()); // Game.ColourSwapShader.Parameters["ColourSwappedIn2"].SetValue(this.m_skinColour2.ToVector4()); //} Camera.End(); Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, Game.ColourSwapShader); m_playerSprite.GetChildAt(12).Draw(Camera); Camera.End(); Camera.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null); if (Game.PlayerStats.IsFemale) { m_playerSprite.GetChildAt(13).Draw(Camera); } m_playerSprite.GetChildAt(15).Draw(Camera); } else { m_tombStoneSprite.Position = new Vector2(m_frontCard.X + 240f, m_frontCard.Y + 280f); m_tombStoneSprite.Draw(Camera); } m_spellIcon.Position = new Vector2(m_frontCard.X + 380f, m_frontCard.Y + 320f); m_spellIcon.Draw(Camera); Camera.End(); base.Draw(gametime); }
public override void HandleInput() { if (!m_lockControls && m_inputDelayTimer <= 0f) { if (!m_dialogChoiceContainer.Visible) { if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1) || Game.GlobalInput.JustPressed(2) || Game.GlobalInput.JustPressed(3)) { if (m_dialogCounter < m_dialogText.Length - 1) { var textObj = m_dialogContainer.GetChildAt(2) as TextObj; if (!textObj.IsTypewriting) { m_dialogCounter += 1; (m_dialogContainer.GetChildAt(1) as TextObj).Text = m_dialogTitles[m_dialogCounter]; textObj.Text = m_dialogText[m_dialogCounter]; if (Game.PlayerStats.Traits.X == 5f || Game.PlayerStats.Traits.Y == 5f) { textObj.RandomizeSentence(false); (m_dialogContainer.GetChildAt(1) as TextObj).RandomizeSentence(false); } textObj.WordWrap(850); textObj.BeginTypeWriting(m_dialogText[m_dialogCounter].Length * m_textScrollSpeed, "dialogue_tap"); } else { textObj.StopTypeWriting(true); } } else if (!m_runChoiceDialogue && !(m_dialogContainer.GetChildAt(2) as TextObj).IsTypewriting) { m_lockControls = true; SoundManager.PlaySound("DialogMenuClose"); Tween.To(m_dialogContainer, 0.3f, Quad.EaseIn, "Opacity", "0", "Y", "0"); Tween.To(this, 0.3f, Linear.EaseNone, "BackBufferOpacity", "0"); Tween.AddEndHandlerToLastTween(this, "ExitScreen"); } else { (m_dialogContainer.GetChildAt(2) as TextObj).StopTypeWriting(true); } var spriteObj = m_dialogContainer.GetChildAt(3) as SpriteObj; if (m_dialogCounter == m_dialogText.Length - 1) { spriteObj.ChangeSprite("EndTextIcon_Sprite"); if (m_runChoiceDialogue) { var textObj2 = m_dialogContainer.GetChildAt(2) as TextObj; textObj2.StopTypeWriting(true); m_dialogChoiceContainer.Visible = true; Tween.To(m_dialogChoiceContainer, 0.3f, Back.EaseOut, "ScaleX", "1", "ScaleY", "1"); SoundManager.PlaySound("DialogOpenBump"); } } else { spriteObj.ChangeSprite("ContinueTextIcon_Sprite"); } } } else { if (Game.GlobalInput.JustPressed(18) || Game.GlobalInput.JustPressed(19)) { SoundManager.PlaySound("frame_swap"); m_highlightedChoice += 1; if (m_highlightedChoice > 3) { m_highlightedChoice = 2; } m_dialogChoiceContainer.GetChildAt(1).Y = m_dialogChoiceContainer.GetChildAt(m_highlightedChoice).Y + m_dialogChoiceContainer.GetChildAt(1).Height / 2 + 3f; } else if (Game.GlobalInput.JustPressed(16) || Game.GlobalInput.JustPressed(17)) { SoundManager.PlaySound("frame_swap"); m_highlightedChoice -= 1; if (m_highlightedChoice < 2) { m_highlightedChoice = 3; } m_dialogChoiceContainer.GetChildAt(1).Y = m_dialogChoiceContainer.GetChildAt(m_highlightedChoice).Y + m_dialogChoiceContainer.GetChildAt(1).Height / 2 + 3f; } if (Game.GlobalInput.JustPressed(0) || Game.GlobalInput.JustPressed(1)) { m_runCancelEndHandler = false; if (m_highlightedChoice == 3) { m_runCancelEndHandler = true; SoundManager.PlaySound("DialogueMenuCancel"); } else { SoundManager.PlaySound("DialogueMenuConfirm"); } m_lockControls = true; SoundManager.PlaySound("DialogMenuClose"); Tween.To(m_dialogContainer, 0.3f, Quad.EaseInOut, "Opacity", "0", "Y", "100"); Tween.To(this, 0.3f, Linear.EaseNone, "BackBufferOpacity", "0"); Tween.To(m_dialogChoiceContainer, 0.3f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0"); Tween.AddEndHandlerToLastTween(this, "ExitScreen"); } else if (Game.GlobalInput.JustPressed(2) || Game.GlobalInput.JustPressed(3)) { m_highlightedChoice = 3; m_dialogChoiceContainer.GetChildAt(1).Y = m_dialogChoiceContainer.GetChildAt(m_highlightedChoice).Y + m_dialogChoiceContainer.GetChildAt(1).Height / 2 + 3f; m_runCancelEndHandler = true; SoundManager.PlaySound("DialogueMenuCancel"); m_lockControls = true; SoundManager.PlaySound("DialogMenuClose"); Tween.To(m_dialogContainer, 0.3f, Quad.EaseInOut, "Opacity", "0", "Y", "100"); Tween.To(this, 0.3f, Linear.EaseNone, "BackBufferOpacity", "0"); Tween.To(m_dialogChoiceContainer, 0.3f, Back.EaseIn, "ScaleX", "0", "ScaleY", "0"); Tween.AddEndHandlerToLastTween(this, "ExitScreen"); } } } base.HandleInput(); }
private void CheckSaveHeaders(ObjContainer container, byte profile) { TextObj textObj = container.GetChildAt(1) as TextObj; TextObj textObj2 = container.GetChildAt(3) as TextObj; TextObj textObj3 = container.GetChildAt(4) as TextObj; textObj2.Text = ""; textObj3.Text = ""; string text = null; byte classType = 0; int num = 0; bool flag = false; int num2 = 0; try { (base.ScreenManager.Game as Game).SaveManager.GetSaveHeader(profile, out classType, out text, out num, out flag, out num2); if (text == null) { textObj.Text = "- START NEW LEGACY -"; container.ID = 0; } else { bool isFemale = text.Contains("Lady"); if (!flag) { textObj.Text = text + " the " + ClassType.ToString(classType, isFemale); } else { textObj.Text = text + " the Deceased"; } textObj2.Text = "Lvl. " + num; if (num2 > 0) { textObj3.Text = "NG+ " + num2; } container.ID = 1; } } catch { textObj.Text = "- START NEW LEGACY -"; container.ID = 0; } }
public LineageObj(LineageScreen screen, bool createEmpty = false) { Name = ""; m_frameSprite = new SpriteObj("LineageScreenFrame_Sprite"); m_frameSprite.Scale = new Vector2(2.8f, 2.8f); m_frameSprite.DropShadow = new Vector2(4f, 6f); m_plaqueSprite = new SpriteObj("LineageScreenPlaque1Long_Sprite"); m_plaqueSprite.Scale = new Vector2(1.8f, 2f); m_playerSprite = new ObjContainer("PlayerIdle_Character"); m_playerSprite.AnimationDelay = 0.1f; m_playerSprite.Scale = new Vector2(2f, 2f); m_playerSprite.OutlineWidth = 2; m_playerSprite.GetChildAt(10).Visible = false; m_playerSprite.GetChildAt(11).Visible = false; m_playerSprite.GetChildAt(1).TextureColor = Color.Red; m_playerSprite.GetChildAt(7).TextureColor = Color.Red; m_playerSprite.GetChildAt(14).Visible = false; m_playerSprite.GetChildAt(16).Visible = false; var textureColor = new Color(251, 156, 172); m_playerSprite.GetChildAt(13).TextureColor = textureColor; m_playerName = new TextObj(Game.JunicodeFont); m_playerName.FontSize = 10f; m_playerName.Text = "Sir Skunky IV"; m_playerName.Align = Types.TextAlign.Centre; m_playerName.OutlineColour = new Color(181, 142, 39); m_playerName.OutlineWidth = 2; m_playerName.Y = m_textYPos; m_playerName.LimitCorners = true; AddChild(m_playerName); m_classTextObj = new TextObj(Game.JunicodeFont); m_classTextObj.FontSize = 8f; m_classTextObj.Align = Types.TextAlign.Centre; m_classTextObj.OutlineColour = new Color(181, 142, 39); m_classTextObj.OutlineWidth = 2; m_classTextObj.Text = "the Knight"; m_classTextObj.Y = m_playerName.Y + m_playerName.Height - 8f; m_classTextObj.LimitCorners = true; AddChild(m_classTextObj); m_trait1Title = new TextObj(Game.JunicodeFont); m_trait1Title.FontSize = 8f; m_trait1Title.Align = Types.TextAlign.Centre; m_trait1Title.OutlineColour = new Color(181, 142, 39); m_trait1Title.OutlineWidth = 2; m_trait1Title.Y = m_classTextObj.Y + m_classTextObj.Height + 5f; m_trait1Title.Text = ""; m_trait1Title.LimitCorners = true; AddChild(m_trait1Title); m_trait2Title = (m_trait1Title.Clone() as TextObj); m_trait2Title.Y += 20f; m_trait2Title.Text = ""; m_trait2Title.LimitCorners = true; AddChild(m_trait2Title); m_ageText = (m_trait1Title.Clone() as TextObj); m_ageText.Text = "xxx - xxx"; m_ageText.Visible = false; m_ageText.LimitCorners = true; AddChild(m_ageText); m_spellIcon = new SpriteObj("Blank_Sprite"); m_spellIcon.OutlineWidth = 1; m_spellIconHolder = new SpriteObj("BlacksmithUI_IconBG_Sprite"); if (!createEmpty) { IsFemale = false; if (CDGMath.RandomInt(0, 1) > 0) { IsFemale = true; } if (IsFemale) { CreateFemaleName(screen); } else { CreateMaleName(screen); } Traits = TraitType.CreateRandomTraits(); Class = ClassType.GetRandomClass(); m_classTextObj.Text = "the " + ClassType.ToString(Class, IsFemale); while (Class == 7 || Class == 15) { if (Traits.X != 12f && Traits.Y != 12f) { break; } Traits = TraitType.CreateRandomTraits(); } while ((Class == 1 || Class == 9 || Class == 16) && (Traits.X == 31f || Traits.Y == 31f)) { Traits = TraitType.CreateRandomTraits(); } var spellList = ClassType.GetSpellList(Class); do { Spell = spellList[CDGMath.RandomInt(0, spellList.Length - 1)]; } while ((Spell == 11 || Spell == 4 || Spell == 6) && (Traits.X == 31f || Traits.Y == 31f)); Array.Clear(spellList, 0, spellList.Length); Age = (byte)CDGMath.RandomInt(18, 30); ChildAge = (byte)CDGMath.RandomInt(2, 5); UpdateData(); } }
public override void Initialize() { this.m_boss1 = (base.EnemyList[0] as EnemyObj_Blob); this.m_boss1.PauseEnemy(true); this.m_boss1.DisableAllWeight = false; this.m_desiredBossScale = this.m_boss1.Scale.X; this.m_blobArray = new List<ObjContainer>(); for (int i = 0; i < this.m_numIntroBlobs; i++) { ObjContainer objContainer = new ObjContainer("EnemyBlobBossAir_Character"); objContainer.Position = this.m_boss1.Position; objContainer.Scale = new Vector2(0.4f, 0.4f); objContainer.GetChildAt(0).TextureColor = Color.White; objContainer.GetChildAt(2).TextureColor = Color.LightSkyBlue; objContainer.GetChildAt(2).Opacity = 0.8f; (objContainer.GetChildAt(1) as SpriteObj).OutlineColour = Color.Black; objContainer.Y -= 1000f; this.m_blobArray.Add(objContainer); base.GameObjList.Add(objContainer); } base.Initialize(); }
public override void LoadContent() { Game.HSVEffect.Parameters["Saturation"].SetValue(0); m_background = new BackgroundObj("LineageScreenBG_Sprite"); m_background.SetRepeated(true, true, Camera); m_background.X -= 6600f; m_bgShadow = new SpriteObj("LineageScreenShadow_Sprite"); m_bgShadow.Scale = new Vector2(11f, 11f); m_bgShadow.Y -= 10f; m_bgShadow.ForceDraw = true; m_bgShadow.Opacity = 0.9f; m_bgShadow.Position = new Vector2(660f, 360f); m_titleText = new SpriteObj("LineageTitleText_Sprite"); m_titleText.X = 660f; m_titleText.Y = 72f; m_titleText.ForceDraw = true; var num = 20; m_descriptionPlate = new ObjContainer("LineageScreenPlate_Character"); m_descriptionPlate.ForceDraw = true; m_descriptionPlate.Position = new Vector2(1320 - m_descriptionPlate.Width - 30, (720 - m_descriptionPlate.Height) / 2f); var textObj = new TextObj(Game.JunicodeFont); textObj.FontSize = 12f; textObj.Align = Types.TextAlign.Centre; textObj.OutlineColour = new Color(181, 142, 39); textObj.OutlineWidth = 2; textObj.Text = "Sir Skunky the IV"; textObj.OverrideParentScale = true; textObj.Position = new Vector2(m_descriptionPlate.Width / 2f, 15f); textObj.LimitCorners = true; m_descriptionPlate.AddChild(textObj); var textObj2 = textObj.Clone() as TextObj; textObj2.FontSize = 10f; textObj2.Text = "Knight"; textObj2.Align = Types.TextAlign.Left; textObj2.X = num; textObj2.Y += 40f; m_descriptionPlate.AddChild(textObj2); var keyIconTextObj = new KeyIconTextObj(Game.JunicodeFont); keyIconTextObj.FontSize = 8f; keyIconTextObj.OutlineColour = textObj2.OutlineColour; keyIconTextObj.OutlineWidth = 2; keyIconTextObj.OverrideParentScale = true; keyIconTextObj.Position = textObj2.Position; keyIconTextObj.Text = "Class description goes here"; keyIconTextObj.Align = Types.TextAlign.Left; keyIconTextObj.Y += 30f; keyIconTextObj.X = num + 20; keyIconTextObj.LimitCorners = true; m_descriptionPlate.AddChild(keyIconTextObj); for (var i = 0; i < 2; i++) { var textObj3 = textObj2.Clone() as TextObj; textObj3.Text = "TraitName"; textObj3.X = num; textObj3.Align = Types.TextAlign.Left; if (i > 0) { textObj3.Y = m_descriptionPlate.GetChildAt(m_descriptionPlate.NumChildren - 1).Y + 50f; } m_descriptionPlate.AddChild(textObj3); var textObj4 = textObj2.Clone() as TextObj; textObj4.Text = "TraitDescription"; textObj4.X = num + 20; textObj4.FontSize = 8f; textObj4.Align = Types.TextAlign.Left; m_descriptionPlate.AddChild(textObj4); } var textObj5 = textObj2.Clone() as TextObj; textObj5.Text = "SpellName"; textObj5.FontSize = 10f; textObj5.X = num; textObj5.Align = Types.TextAlign.Left; m_descriptionPlate.AddChild(textObj5); var keyIconTextObj2 = new KeyIconTextObj(Game.JunicodeFont); keyIconTextObj2.OutlineColour = new Color(181, 142, 39); keyIconTextObj2.OutlineWidth = 2; keyIconTextObj2.OverrideParentScale = true; keyIconTextObj2.Position = new Vector2(m_descriptionPlate.Width / 2f, 15f); keyIconTextObj2.Y += 40f; keyIconTextObj2.Text = "SpellDescription"; keyIconTextObj2.X = num + 20; keyIconTextObj2.FontSize = 8f; keyIconTextObj2.Align = Types.TextAlign.Left; keyIconTextObj2.LimitCorners = true; m_descriptionPlate.AddChild(keyIconTextObj2); m_masterArray = new List <LineageObj>(); m_currentBranchArray = new List <LineageObj>(); var arg_47E_0 = Vector2.Zero; m_confirmText = new KeyIconTextObj(Game.JunicodeFont); m_confirmText.ForceDraw = true; m_confirmText.FontSize = 12f; m_confirmText.DropShadow = new Vector2(2f, 2f); m_confirmText.Position = new Vector2(1280f, 630f); m_confirmText.Align = Types.TextAlign.Right; m_navigationText = new KeyIconTextObj(Game.JunicodeFont); m_navigationText.Align = Types.TextAlign.Right; m_navigationText.FontSize = 12f; m_navigationText.DropShadow = new Vector2(2f, 2f); m_navigationText.Position = new Vector2(m_confirmText.X, m_confirmText.Y + 40f); m_navigationText.ForceDraw = true; m_rerollText = new KeyIconTextObj(Game.JunicodeFont); m_rerollText.Align = Types.TextAlign.Right; m_rerollText.FontSize = 12f; m_rerollText.DropShadow = new Vector2(2f, 2f); m_rerollText.ForceDraw = true; m_rerollText.Position = new Vector2(1280f, 40f); base.LoadContent(); }
private void Player_PlayerStyleUpdating(ObjContainer player, string animationType) { player.GetChildAt(15).Visible = true; player.GetChildAt(15).ChangeSprite("Player" + animationType + "Shield_Sprite"); }
private void UpdateEquipmentDataText() { (m_textInfoStatContainer.GetChildAt(0) as TextObj).Text = Player.MaxHealth.ToString(); (m_textInfoStatContainer.GetChildAt(1) as TextObj).Text = Player.MaxMana.ToString(); (m_textInfoStatContainer.GetChildAt(2) as TextObj).Text = Player.Damage.ToString(); (m_textInfoStatContainer.GetChildAt(3) as TextObj).Text = Player.TotalMagicDamage.ToString(); (m_textInfoStatContainer.GetChildAt(4) as TextObj).Text = Player.TotalArmor.ToString(); (m_textInfoStatContainer.GetChildAt(5) as TextObj).Text = Player.CurrentWeight + "/" + Player.MaxWeight; var num = m_currentCategoryIndex - 6; var equipmentData = Game.EquipmentSystem.GetEquipmentData(num, m_currentEquipmentIndex); int num2 = Game.PlayerStats.GetEquippedArray[num]; var equipmentData2 = new EquipmentData(); if (num2 > -1) { equipmentData2 = Game.EquipmentSystem.GetEquipmentData(num, num2); } var flag = Game.PlayerStats.GetEquippedArray[CurrentCategoryIndex] == m_currentEquipmentIndex; var num3 = equipmentData.BonusHealth - equipmentData2.BonusHealth; if (flag) { num3 = -equipmentData.BonusHealth; } var textObj = m_textInfoStatModContainer.GetChildAt(0) as TextObj; if (num3 > 0) { textObj.TextureColor = Color.Cyan; textObj.Text = "+" + num3; } else if (num3 < 0) { textObj.TextureColor = Color.Red; textObj.Text = num3.ToString(); } else { textObj.Text = ""; } var textObj2 = m_textInfoStatModContainer.GetChildAt(1) as TextObj; var num4 = equipmentData.BonusMana - equipmentData2.BonusMana; if (flag) { num4 = -equipmentData.BonusMana; } if (num4 > 0) { textObj2.TextureColor = Color.Cyan; textObj2.Text = "+" + num4; } else if (num4 < 0) { textObj2.TextureColor = Color.Red; textObj2.Text = num4.ToString(); } else { textObj2.Text = ""; } var textObj3 = m_textInfoStatModContainer.GetChildAt(2) as TextObj; var num5 = equipmentData.BonusDamage - equipmentData2.BonusDamage; if (flag) { num5 = -equipmentData.BonusDamage; } if (num5 > 0) { textObj3.TextureColor = Color.Cyan; textObj3.Text = "+" + num5; } else if (num5 < 0) { textObj3.TextureColor = Color.Red; textObj3.Text = num5.ToString(); } else { textObj3.Text = ""; } var textObj4 = m_textInfoStatModContainer.GetChildAt(3) as TextObj; var num6 = equipmentData.BonusMagic - equipmentData2.BonusMagic; if (flag) { num6 = -equipmentData.BonusMagic; } if (num6 > 0) { textObj4.TextureColor = Color.Cyan; textObj4.Text = "+" + num6; } else if (num6 < 0) { textObj4.TextureColor = Color.Red; textObj4.Text = num6.ToString(); } else { textObj4.Text = ""; } var textObj5 = m_textInfoStatModContainer.GetChildAt(4) as TextObj; var num7 = equipmentData.BonusArmor - equipmentData2.BonusArmor; if (flag) { num7 = -equipmentData.BonusArmor; } if (num7 > 0) { textObj5.TextureColor = Color.Cyan; textObj5.Text = "+" + num7; } else if (num7 < 0) { textObj5.TextureColor = Color.Red; textObj5.Text = num7.ToString(); } else { textObj5.Text = ""; } var textObj6 = m_textInfoStatModContainer.GetChildAt(5) as TextObj; var num8 = equipmentData.Weight - equipmentData2.Weight; if (flag) { num8 = -equipmentData.Weight; } if (num8 > 0) { textObj6.TextureColor = Color.Red; textObj6.Text = "+" + num8; } else if (num8 < 0) { textObj6.TextureColor = Color.Cyan; textObj6.Text = num8.ToString(); } else { textObj6.Text = ""; } var secondaryAttribute = equipmentData.SecondaryAttribute; m_addPropertiesText.Text = ""; if (secondaryAttribute != null) { var array = secondaryAttribute; for (var i = 0; i < array.Length; i++) { var vector = array[i]; if (vector.X != 0f) { if (vector.X < 7f) { var expr_4FE = m_addPropertiesText; var text = expr_4FE.Text; expr_4FE.Text = string.Concat(text, "+", (vector.Y * 100f).ToString(), "% ", EquipmentSecondaryDataType.ToString((int)vector.X), "\n"); } else { var expr_56E = m_addPropertiesText; var text2 = expr_56E.Text; var array2 = new string[6]; array2[0] = text2; array2[1] = "+"; var arg_5A0_0 = array2; var arg_5A0_1 = 2; var y = vector.Y; arg_5A0_0[arg_5A0_1] = y.ToString(); array2[3] = " "; array2[4] = EquipmentSecondaryDataType.ToString((int)vector.X); array2[5] = "\n"; expr_56E.Text = string.Concat(array2); } } } if (secondaryAttribute.Length == 0) { m_addPropertiesText.Text = "None"; } } else { m_addPropertiesText.Text = "None"; } m_equipmentTitleText.Text = EquipmentBaseType.ToString(m_currentEquipmentIndex) + " " + EquipmentCategoryType.ToString(num); }
public override void OnEnter() { m_playerFrame.Opacity = 0f; m_playerFrame.Position = m_player.Position; m_playerFrame.SetTraits(Game.PlayerStats.Traits); m_playerFrame.IsFemale = Game.PlayerStats.IsFemale; m_playerFrame.Class = Game.PlayerStats.Class; m_playerFrame.Y -= 120f; m_playerFrame.SetPortrait(Game.PlayerStats.HeadPiece, Game.PlayerStats.ShoulderPiece, Game.PlayerStats.ChestPiece); m_playerFrame.UpdateData(); Tween.To(m_playerFrame, 1f, Tween.EaseNone, "delay", "4", "Opacity", "1"); var item = new FamilyTreeNode { Name = Game.PlayerStats.PlayerName, Age = Game.PlayerStats.Age, ChildAge = Game.PlayerStats.ChildAge, Class = Game.PlayerStats.Class, HeadPiece = Game.PlayerStats.HeadPiece, ChestPiece = Game.PlayerStats.ChestPiece, ShoulderPiece = Game.PlayerStats.ShoulderPiece, NumEnemiesBeaten = Game.PlayerStats.NumEnemiesBeaten, BeatenABoss = Game.PlayerStats.NewBossBeaten, Traits = Game.PlayerStats.Traits, IsFemale = Game.PlayerStats.IsFemale }; var traits = Game.PlayerStats.Traits; Game.PlayerStats.FamilyTreeArray.Add(item); if (Game.PlayerStats.CurrentBranches != null) { Game.PlayerStats.CurrentBranches.Clear(); } Game.PlayerStats.IsDead = true; Game.PlayerStats.Traits = Vector2.Zero; Game.PlayerStats.NewBossBeaten = false; Game.PlayerStats.RerolledChildren = false; Game.PlayerStats.HasArchitectFee = false; Game.PlayerStats.NumEnemiesBeaten = 0; Game.PlayerStats.LichHealth = 0; Game.PlayerStats.LichMana = 0; Game.PlayerStats.LichHealthMod = 1f; Game.PlayerStats.TimesDead++; Game.PlayerStats.LoadStartingRoom = true; Game.PlayerStats.EnemiesKilledInRun.Clear(); if (Game.PlayerStats.SpecialItem != 1 && Game.PlayerStats.SpecialItem != 9 && Game.PlayerStats.SpecialItem != 10 && Game.PlayerStats.SpecialItem != 11 && Game.PlayerStats.SpecialItem != 12 && Game.PlayerStats.SpecialItem != 13) { Game.PlayerStats.SpecialItem = 0; } (ScreenManager.Game as Game).SaveManager.SaveFiles(SaveType.PlayerData, SaveType.Lineage, SaveType.MapData); (ScreenManager.Game as Game).SaveManager.SaveAllFileTypes(true); Game.PlayerStats.Traits = traits; if (Game.PlayerStats.TimesDead >= 20) { GameUtil.UnlockAchievement("FEAR_OF_LIFE"); } SoundManager.StopMusic(0.5f); m_droppingStats = false; m_lockControls = false; SoundManager.PlaySound("Player_Death_FadeToBlack"); m_continueText.Text = "Press [Input:" + 0 + "] to move on"; m_player.Visible = true; m_player.Opacity = 1f; m_continueText.Opacity = 0f; m_dialoguePlate.Opacity = 0f; m_playerGhost.Opacity = 0f; m_spotlight.Opacity = 0f; m_playerGhost.Position = new Vector2(m_player.X - m_playerGhost.Width / 2, m_player.Bounds.Top - 20); Tween.RunFunction(3f, typeof(SoundManager), "PlaySound", "Player_Ghost"); Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "3", "Opacity", "0.4"); Tween.By(m_playerGhost, 2f, Linear.EaseNone, "delay", "3", "Y", "-150"); m_playerGhost.Opacity = 0.4f; Tween.To(m_playerGhost, 0.5f, Linear.EaseNone, "delay", "4", "Opacity", "0"); m_playerGhost.Opacity = 0f; m_playerGhost.PlayAnimation(); Tween.To(this, 0.5f, Linear.EaseNone, "BackBufferOpacity", "1"); Tween.To(m_spotlight, 0.1f, Linear.EaseNone, "delay", "1", "Opacity", "1"); Tween.AddEndHandlerToLastTween(typeof(SoundManager), "PlaySound", "Player_Death_Spotlight"); Tween.RunFunction(1.2f, typeof(SoundManager), "PlayMusic", "GameOverStinger", false, 0.5f); Tween.To(Camera, 1f, Quad.EaseInOut, "X", m_player.AbsX.ToString(), "Y", (m_player.Bounds.Bottom - 10).ToString(), "Zoom", "1"); Tween.RunFunction(2f, m_player, "RunDeathAnimation1"); if (Game.PlayerStats.Traits.X == 13f || Game.PlayerStats.Traits.Y == 13f) { (m_dialoguePlate.GetChildAt(2) as TextObj).Text = "#)!(%*#@!%^"; (m_dialoguePlate.GetChildAt(2) as TextObj).RandomizeSentence(true); } else { (m_dialoguePlate.GetChildAt(2) as TextObj).Text = GameEV.GAME_HINTS[CDGMath.RandomInt(0, GameEV.GAME_HINTS.Length - 1)]; } (m_dialoguePlate.GetChildAt(3) as TextObj).Text = "-" + Game.PlayerStats.PlayerName + "'s Parting Words"; Tween.To(m_dialoguePlate, 0.5f, Tween.EaseNone, "delay", "2", "Opacity", "1"); Tween.RunFunction(4f, this, "DropStats"); Tween.To(m_continueText, 0.4f, Linear.EaseNone, "delay", "4", "Opacity", "1"); base.OnEnter(); }
public void SetDialogueChoice(string dialogueObjName) { var text = DialogueManager.GetText(dialogueObjName); (m_dialogChoiceContainer.GetChildAt(2) as TextObj).Text = text.Speakers[0]; (m_dialogChoiceContainer.GetChildAt(3) as TextObj).Text = text.Dialogue[0]; if (Game.PlayerStats.Traits.X == 5f || Game.PlayerStats.Traits.Y == 5f) { (m_dialogChoiceContainer.GetChildAt(2) as TextObj).RandomizeSentence(false); (m_dialogChoiceContainer.GetChildAt(3) as TextObj).RandomizeSentence(false); } m_runChoiceDialogue = true; }
private void UpdateDescriptionPlate() { var lineageObj = m_currentBranchArray[m_selectedLineageIndex]; var textObj = m_descriptionPlate.GetChildAt(1) as TextObj; textObj.Text = lineageObj.PlayerName; var textObj2 = m_descriptionPlate.GetChildAt(2) as TextObj; textObj2.Text = "Class - " + ClassType.ToString(lineageObj.Class, lineageObj.IsFemale); var keyIconTextObj = m_descriptionPlate.GetChildAt(3) as KeyIconTextObj; keyIconTextObj.Text = ClassType.Description(lineageObj.Class); keyIconTextObj.WordWrap(340); var textObj3 = m_descriptionPlate.GetChildAt(4) as TextObj; textObj3.Y = keyIconTextObj.Y + keyIconTextObj.Height + 5f; var textObj4 = m_descriptionPlate.GetChildAt(5) as TextObj; textObj4.Y = textObj3.Y + 30f; var num = (int)textObj3.Y; if (lineageObj.Traits.X > 0f) { textObj3.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.X); textObj4.Text = TraitType.Description((byte)lineageObj.Traits.X, lineageObj.IsFemale); textObj4.WordWrap(340); num = (int)textObj4.Y + textObj4.Height + 5; } else { num = (int)textObj3.Y + textObj3.Height + 5; textObj3.Text = "Traits - None"; textObj4.Text = ""; } var textObj5 = m_descriptionPlate.GetChildAt(6) as TextObj; textObj5.Y = textObj4.Y + textObj4.Height + 5f; var textObj6 = m_descriptionPlate.GetChildAt(7) as TextObj; textObj6.Y = textObj5.Y + 30f; if (lineageObj.Traits.Y > 0f) { textObj5.Text = "Trait - " + TraitType.ToString((byte)lineageObj.Traits.Y); textObj6.Text = TraitType.Description((byte)lineageObj.Traits.Y, lineageObj.IsFemale); textObj6.WordWrap(340); num = (int)textObj6.Y + textObj6.Height + 5; } else { textObj5.Text = ""; textObj6.Text = ""; } var textObj7 = m_descriptionPlate.GetChildAt(8) as TextObj; textObj7.Text = "Spell - " + SpellType.ToString(lineageObj.Spell); textObj7.Y = num; var keyIconTextObj2 = m_descriptionPlate.GetChildAt(9) as KeyIconTextObj; keyIconTextObj2.Text = SpellType.Description(lineageObj.Spell); keyIconTextObj2.Y = textObj7.Y + 30f; keyIconTextObj2.WordWrap(340); }
public void SetPortrait(byte headPiece, byte shoulderPiece, byte chestPiece) { HeadPiece = headPiece; ShoulderPiece = shoulderPiece; ChestPiece = chestPiece; var text = (m_playerSprite.GetChildAt(12) as IAnimateableObj).SpriteName; var startIndex = text.IndexOf("_") - 1; text = text.Remove(startIndex, 1); text = text.Replace("_", HeadPiece + "_"); m_playerSprite.GetChildAt(12).ChangeSprite(text); var text2 = (m_playerSprite.GetChildAt(4) as IAnimateableObj).SpriteName; startIndex = text2.IndexOf("_") - 1; text2 = text2.Remove(startIndex, 1); text2 = text2.Replace("_", ChestPiece + "_"); m_playerSprite.GetChildAt(4).ChangeSprite(text2); var text3 = (m_playerSprite.GetChildAt(9) as IAnimateableObj).SpriteName; startIndex = text3.IndexOf("_") - 1; text3 = text3.Remove(startIndex, 1); text3 = text3.Replace("_", ShoulderPiece + "_"); m_playerSprite.GetChildAt(9).ChangeSprite(text3); var text4 = (m_playerSprite.GetChildAt(3) as IAnimateableObj).SpriteName; startIndex = text4.IndexOf("_") - 1; text4 = text4.Remove(startIndex, 1); text4 = text4.Replace("_", ShoulderPiece + "_"); m_playerSprite.GetChildAt(3).ChangeSprite(text4); }
private void Player_PlayerStyleUpdating(ObjContainer player, string animationType) { player.GetChildAt(7).Visible = false; }