static string getProfessionTitleFromNumber(int whichProfession) { string s = Professions.GetProfessionTitleFromNumber(whichProfession); if (s == null) { return(AlchemyLevelUpMenu.getProfessionTitleFromNumber(whichProfession)); } return(s); }
public AlchemySkillsPage(int x, int y, int width, int height, int skillOrderIndex) : base(x, y, width, height, false) { this.skillOrderIndex = skillOrderIndex; int x1 = this.xPositionOnScreen + IClickableMenu.spaceToClearSideBorder + Game1.tileSize * 5 / 4; int y1 = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + (int)((double)height / 2.0) + Game1.tileSize * 5 / 4; this.playerPanel = new Rectangle(this.xPositionOnScreen + Game1.tileSize, this.yPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder, Game1.tileSize * 2, Game1.tileSize * 3); int num5 = 0; int xStart = LocalizedContentManager.CurrentLanguageCode == LocalizedContentManager.LanguageCode.ru ? this.xPositionOnScreen + width - Game1.tileSize * 7 - Game1.tileSize * 3 / 4 + Game1.pixelZoom : this.xPositionOnScreen + IClickableMenu.borderWidth + IClickableMenu.spaceToClearTopBorder + 4 * Game1.tileSize - Game1.pixelZoom; int yStart = this.yPositionOnScreen + IClickableMenu.spaceToClearTopBorder + IClickableMenu.borderWidth - Game1.pixelZoom * 3; int skillIndex = 4; while (skillIndex < 10) { int whichProfession = Professions.getProfessionForSkill(skillIndex + 1); string professionBlurb = Professions.GetProfessionTitleFromNumber(whichProfession); string professionTitle = AlchemyLevelUpMenu.GetProfessionDescription(whichProfession); bool flag = EquivalentExchange.instance.currentPlayerData.AlchemyLevel > skillIndex; if (flag && (skillIndex + 1) % 5 == 0) { List <ClickableTextureComponent> skillBars = this.skillBars; ClickableTextureComponent skillTextureComponent = new ClickableTextureComponent(string.Concat(whichProfession), new Rectangle(num5 + xStart - Game1.pixelZoom + skillIndex * (Game1.tileSize / 2 + Game1.pixelZoom), yStart + skillOrderIndex * (Game1.tileSize / 2 + Game1.pixelZoom * 6), 14 * Game1.pixelZoom, 9 * Game1.pixelZoom), (string)null, professionBlurb, Game1.mouseCursors, new Rectangle(159, 338, 14, 9), (float)Game1.pixelZoom, true); skillBars.Add(skillTextureComponent); } skillIndex += 5; } num5 += Game1.pixelZoom * 6; if (this.skillBars.Count > 1 && this.skillBars.Last <ClickableTextureComponent>().myID >= 200 && this.skillBars[this.skillBars.Count - 2].myID >= 200) { this.skillBars.Last <ClickableTextureComponent>().upNeighborID = this.skillBars[this.skillBars.Count - 2].myID; } string hoverText = ""; List <ClickableTextureComponent> skillAreas = this.skillAreas; ClickableTextureComponent textureComponent = new ClickableTextureComponent("Alchemy", new Rectangle(xStart - Game1.tileSize * 2 - Game1.tileSize * 3 / 4, yStart + skillOrderIndex * (Game1.tileSize / 2 + Game1.pixelZoom * 6), Game1.tileSize * 2 + Game1.pixelZoom * 5, 9 * Game1.pixelZoom), string.Concat((object)skillOrderIndex), hoverText, (Texture2D)null, Rectangle.Empty, 1f, false); int num2 = skillOrderIndex; textureComponent.myID = num2; int num3 = skillOrderIndex < 4 ? skillOrderIndex + 1 : 10201; textureComponent.downNeighborID = num3; int num4 = skillOrderIndex > 0 ? skillOrderIndex - 1 : 12341; textureComponent.upNeighborID = num4; int num9 = 100 + skillOrderIndex; textureComponent.rightNeighborID = num9; skillAreas.Add(textureComponent); }
public override void performHoverAction(int x, int y) { this.hoverText = ""; this.hoverTitle = ""; this.professionImage = null; foreach (ClickableTextureComponent skillBar in this.skillBars) { skillBar.scale = (float)Game1.pixelZoom; if (skillBar.containsPoint(x, y) && skillBar.hoverText.Length > 0 && !skillBar.name.Equals("-1")) { this.hoverText = AlchemyLevelUpMenu.GetProfessionDescription(Convert.ToInt32(skillBar.name)); this.hoverTitle = Professions.GetProfessionTitleFromNumber(Convert.ToInt32(skillBar.name)); this.professionImage = DrawingUtil.GetProfessionTexture(Convert.ToInt32(skillBar.name)); skillBar.scale = 0.0f; } } foreach (ClickableTextureComponent skillArea in this.skillAreas) { if (skillArea.containsPoint(x, y) && skillArea.hoverText.Length > 0) { this.hoverText = skillArea.hoverText; this.hoverTitle = skillArea.name; break; } } if (this.playerPanel.Contains(x, y)) { this.playerPanelTimer = this.playerPanelTimer - Game1.currentGameTime.ElapsedGameTime.Milliseconds; if (this.playerPanelTimer > 0) { return; } this.playerPanelIndex = (this.playerPanelIndex + 1) % 4; this.playerPanelTimer = 150; } else { this.playerPanelIndex = 0; } }
public AlchemySkill() : base("EquivalentExchange.Alchemy") { Name = "Alchemy"; Icon = DrawingUtil.alchemySkillIconBordered; SkillsPageIcon = DrawingUtil.alchemySkillIcon; ExperienceCurve = Alchemy.alchemyExperienceNeededPerLevel; ExperienceBarColor = new Microsoft.Xna.Framework.Color(255, 35, 165); // Level 5 ProfessionShaper = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldShaperId)) { Icon = DrawingUtil.alchemyShaperIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldShaperId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldShaperId) }; Professions.Add(ProfessionShaper); ProfessionSage = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldSageId)) { Icon = DrawingUtil.alchemySageIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldSageId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldSageId) }; Professions.Add(ProfessionSage); ProfessionsForLevels.Add(new ProfessionPair(5, ProfessionShaper, ProfessionSage)); // Level 10 - track A ProfessionTransmuter = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldTransmuterId)) { Icon = DrawingUtil.alchemyTransmuterIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldTransmuterId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldTransmuterId) }; Professions.Add(ProfessionTransmuter); ProfessionAdept = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldAdeptId)) { Icon = DrawingUtil.alchemyAdeptIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldAdeptId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldAdeptId) }; Professions.Add(ProfessionAdept); ProfessionsForLevels.Add(new ProfessionPair(10, ProfessionTransmuter, ProfessionAdept, ProfessionShaper)); // Level 10 - track B ProfessionAurumancer = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldAurumancerId)) { Icon = DrawingUtil.alchemyAurumancerIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldAurumancerId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldAurumancerId) }; Professions.Add(ProfessionAurumancer); ProfessionConduit = new Profession(this, ProfessionHelper.GetProfessionInternalName(ProfessionHelper.OldConduitId)) { Icon = DrawingUtil.alchemyConduitIcon, Name = ProfessionHelper.GetProfessionTitleFromNumber(ProfessionHelper.OldConduitId), Description = ProfessionHelper.GetProfessionDescription(ProfessionHelper.OldConduitId) }; Professions.Add(ProfessionConduit); ProfessionsForLevels.Add(new ProfessionPair(10, ProfessionAurumancer, ProfessionConduit, ProfessionSage)); }
public override void update(GameTime time) { if (!this.isActive) { base.exitThisMenu(true); return; } for (int i = this.littleStars.Count - 1; i >= 0; i--) { if (this.littleStars[i].update(time)) { this.littleStars.RemoveAt(i); } } if (Game1.random.NextDouble() < 0.03) { Vector2 position = new Vector2(0f, (float)(Game1.random.Next(this.yPositionOnScreen - Game1.tileSize * 2, this.yPositionOnScreen - Game1.pixelZoom) / (Game1.pixelZoom * 5) * Game1.pixelZoom * 5 + Game1.tileSize / 2)); if (Game1.random.NextDouble() < 0.5) { position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 - 57 * Game1.pixelZoom, this.xPositionOnScreen + this.width / 2 - 33 * Game1.pixelZoom); } else { position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 + 29 * Game1.pixelZoom, this.xPositionOnScreen + this.width - 40 * Game1.pixelZoom); } if (position.Y < (float)(this.yPositionOnScreen - Game1.tileSize - Game1.pixelZoom * 2)) { position.X = (float)Game1.random.Next(this.xPositionOnScreen + this.width / 2 - 29 * Game1.pixelZoom, this.xPositionOnScreen + this.width / 2 + 29 * Game1.pixelZoom); } position.X = position.X / (float)(Game1.pixelZoom * 5) * (float)Game1.pixelZoom * 5f; this.littleStars.Add(new TemporaryAnimatedSprite(Game1.mouseCursors, new Rectangle(364, 79, 5, 5), 80f, 7, 1, position, false, false, 1f, 0f, Color.White, (float)Game1.pixelZoom, 0f, 0f, 0f, false) { local = true }); } if (this.timerBeforeStart > 0) { this.timerBeforeStart -= time.ElapsedGameTime.Milliseconds; return; } if (this.isActive && this.isProfessionChooser) { this.leftProfessionColor = Game1.textColor; this.rightProfessionColor = Game1.textColor; Game1.player.completelyStopAnimatingOrDoingAction(); Game1.player.freezePause = 100; if (Game1.getMouseY() > this.yPositionOnScreen + Game1.tileSize * 3 && Game1.getMouseY() < this.yPositionOnScreen + this.height) { if (Game1.getMouseX() > this.xPositionOnScreen && Game1.getMouseX() < this.xPositionOnScreen + this.width / 2) { this.leftProfessionColor = Color.Green; if (((Mouse.GetState().LeftButton == ButtonState.Pressed && this.oldMouseState.LeftButton == ButtonState.Released) || (Game1.options.gamepadControls && GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.A) && !Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose()) { Professions.EnableAlchemistProfession(this.professionsToChoose[0]); this.isActive = false; this.informationUp = false; this.isProfessionChooser = false; } } else if (Game1.getMouseX() > this.xPositionOnScreen + this.width / 2 && Game1.getMouseX() < this.xPositionOnScreen + this.width) { this.rightProfessionColor = Color.Green; if (((Mouse.GetState().LeftButton == ButtonState.Pressed && this.oldMouseState.LeftButton == ButtonState.Released) || (Game1.options.gamepadControls && GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.A) && !Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose()) { Professions.EnableAlchemistProfession(this.professionsToChoose[1]); this.isActive = false; this.informationUp = false; this.isProfessionChooser = false; } } } this.height = Game1.tileSize * 8; } this.oldMouseState = Mouse.GetState(); if (this.isActive && this.informationUp) { Game1.player.completelyStopAnimatingOrDoingAction(); if (this.okButton.containsPoint(Game1.getOldMouseX(), Game1.getOldMouseY()) && !this.isProfessionChooser) { this.okButton.scale = Math.Min(1.1f, this.okButton.scale + 0.05f); if ((this.oldMouseState.LeftButton == ButtonState.Pressed || (Game1.options.gamepadControls && Game1.oldPadState.IsButtonDown(Buttons.A))) && this.readyToClose()) { this.getLevelPerk(this.currentLevel); this.isActive = false; this.informationUp = false; } } else { this.okButton.scale = Math.Max(1f, this.okButton.scale - 0.05f); } Game1.player.freezePause = 100; } }