/// <summary> /// Creates an Achievement. You must also mirror the data provided here in /// https://partner.steamgames.com/apps/achievements/yourappid /// </summary> /// <param name="achievement">The "API Name Progress Stat" used to uniquely identify the achievement.</param> /// <param name="name">The "Display Name" that will be shown to players in game and on the Steam Community.</param> /// <param name="desc">The "Description" that will be shown to players in game and on the Steam Community.</param> public Achievement_t(Achievement achievementID, string name, string desc) { _eAchievementID = achievementID; m_strName = name; m_strDescription = desc; _bAchieved = false; }
// Update is called once per frame void Update () { // Saving should probably go in another thread.... if(mSaveRequired && (Time.time - mLastSaveTime) >= 15) SaveProgress(); if(mOnScreen != null) { var text = achievementTextElement.GetComponent<Text>(); if(!mOnScreenFadeStarted) { if(Time.time - mOnScreenTime >= 5) { mOnScreenFadeStarted = true; text.CrossFadeAlpha(0, 0.5f, false); } } else if(text.canvasRenderer.GetColor().a < 0.001f) { mOnScreen = null; mOnScreenTime = Time.time; achievementTextElement.SetActive(false); } } // Need to show achieved text? if(mOnScreen == null && mAchievedList.Count > 0 && Time.time - mOnScreenTime >= 1) { mOnScreen = mAchievedList.First(); mAchievedList.RemoveFirst(); mOnScreenTime = Time.time; mOnScreenFadeStarted = false; var text = achievementTextElement.GetComponent<Text>(); text.text = string.Format("Achieved!\n\n{0}\n{1}", mOnScreen.Name, mOnScreen.Description); achievementTextElement.SetActive(true); if(audioSource && achievedSound) audioSource.PlayOneShot(achievedSound); } }
// Use this for initialization void Start () { this.inventory = new List<Item>(); this.offered = new List<Item>(); var manager = GameObject.Find("GameHandler").GetComponent<AchievementManager>(); achHungryPanda = manager.GetAchievement("hungry_panda"); }
public PlayerWithAchievement(Player player, int levelOfAchievement, string toNextLevelLabel, Achievement achievement) { Player = player; LevelOfAchievement = levelOfAchievement; ToNextLevelLabel = toNextLevelLabel; Achievement = achievement; }
public AchievementSellScreen(Game game, Achievement achievement) : base(game) { this.achievement = achievement; this.UpdateOrder = -1; this.DrawOrder = 1002; }
private static Achievement createAchievement2() { Achievement a = new Achievement(); a.name = "Beatles and Rolling Stones"; a.description = "Sing at least one beatles and at least one rolling stones song."; a.ID = 0; a.image = AchievementImage.Image1; a.statementsAnd = true; a.selectList = new AchievementSelect[2]; AchievementSelect select = new AchievementSelect(); select.startDate = DateTime.MinValue; select.endDate = DateTime.MaxValue; select.selectKeyword = SelectKeyword.CountGTE; select.selectValue = "1"; select.clauseKeyword = ClauseKeyword.Artist; select.clauseValue = "Rolling Stones"; a.selectList[0] = select; AchievementSelect select2 = new AchievementSelect(); select2.startDate = DateTime.MinValue; select2.endDate = DateTime.MaxValue; select2.selectKeyword = SelectKeyword.CountGTE; select2.selectValue = "1"; select2.clauseKeyword = ClauseKeyword.Artist; select2.clauseValue = "Beatles"; a.selectList[1] = select2; a.isPermanant = false; a.visible = true; return a; }
public void TestAchievement() { var achievement = new Achievement(Name, Description); Assert.AreEqual(Name, achievement.Name); Assert.AreEqual(Description, achievement.Description); Assert.IsFalse(achievement.IsAchieved); }
/// <summary> /// Constructor /// </summary> /// <param name="achv">Associated achievement</param> /// <param name="duration">Duration to stay visible (ms)</param> /// <param name="position">Starting position</param> /// <param name="width"></param> /// <param name="height"></param> public AchievementToast(Achievement achv, int duration, Vector2 position, int width, int height) { title = achv.Name; description = achv.Description; age = 0; lifespan = duration; this.position = position; this.width = width; this.height = height; banner = SpriteDatabase.GetAnimation("achievement_banner").Texture; // Yellow particles spew out on the left and right in semi-circles away from the banner leftSpewer = new ParticleSpewer( position.X+53, position.Y + 52, 10000, 30, MathHelper.ToRadians(90), MathHelper.ToRadians(270), 0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f); leftSpewer.Absolute = true; leftSpewer.Start(); rightSpewer = new ParticleSpewer( position.X + width, position.Y + 52, 10000, 30, MathHelper.ToRadians(-90), MathHelper.ToRadians(90), 0, 500, 2, 120, 60, 60, 0, 1, 1, 1, true, 0.5f); rightSpewer.Absolute = true; rightSpewer.Start(); }
public static void InvokeIfNotNull(this AchievementUnlockedDelegate achievementUnlockedDelegate, Achievement achievement) { if (achievementUnlockedDelegate != null) { achievementUnlockedDelegate(achievement); } }
public override void Frame(double frameTime) { base.Frame(frameTime); Achievement achv = m_guinan.GetCurrentAchievement(); //send achievement if it's different than the last one or more than 5s have passed if (((achv != null && m_achievementStopwatch.IsRunning == false) ||(achv != null && m_achievementStopwatch.ElapsedMilliseconds > 5000)) ||(achv != m_lastAchivement && achv != null)) { m_achievementStopwatch.Reset(); m_achievementStopwatch.Start(); m_lastAchivement = achv; sendAchievement(achv); } //send player data if session is started and data hasnt been set yet if(m_statTracker.SessionStarted() && !m_playerdatasent) { RecursionTracker.StatTracker.SessionStats sessionStats = m_statTracker.GetSessionStats(); Player player = m_statTracker.GetPlayer(); m_playerdatasent = true; sendPlayerData(player, sessionStats); } //reset playerdata bool else if(!m_statTracker.SessionStarted() && m_playerdatasent) { m_playerdatasent = false; } }
public UIAchievementListItem(Achievement achievement) { this.BackgroundColor = new Color(26, 40, 89) * 0.8f; this.BorderColor = new Color(13, 20, 44) * 0.8f; this._achievement = achievement; this.Height.Set(82f, 0f); this.Width.Set(0f, 1f); this.PaddingTop = 8f; this.PaddingLeft = 9f; int iconIndex = Main.Achievements.GetIconIndex(achievement.Name); this._iconIndex = iconIndex; this._iconFrameUnlocked = new Rectangle(iconIndex % 8 * 66, iconIndex / 8 * 66, 64, 64); this._iconFrameLocked = this._iconFrameUnlocked; this._iconFrameLocked.X = this._iconFrameLocked.X + 528; this._iconFrame = this._iconFrameLocked; this.UpdateIconFrame(); this._achievementIcon = new UIImageFramed(TextureManager.Load("Images/UI/Achievements"), this._iconFrame); base.Append(this._achievementIcon); this._achievementIconBorders = new UIImage(TextureManager.Load("Images/UI/Achievement_Borders")); this._achievementIconBorders.Left.Set(-4f, 0f); this._achievementIconBorders.Top.Set(-4f, 0f); base.Append(this._achievementIconBorders); this._innerPanelTopTexture = TextureManager.Load("Images/UI/Achievement_InnerPanelTop"); this._innerPanelBottomTexture = TextureManager.Load("Images/UI/Achievement_InnerPanelBottom"); this._categoryTexture = TextureManager.Load("Images/UI/Achievement_Categories"); }
public static void ShowAchievement(Achievement a, string comm) { if (a == null) return; AchievementForm f = new AchievementForm(); f.achievement = a; ShowNotification(f, comm); }
public bool AlreadyContainsAchievement(Achievement.Categ type) { foreach (Achievement achiev in Achievements) if (achiev.categ.Equals(type)) return true; return false; }
public HttpResponseMessage Post(Achievement achievement) { var hubContext = GlobalHost.ConnectionManager.GetHubContext<Notify>(); hubContext.Clients.NewAchievement(achievement.Message); return Request.CreateResponse(HttpStatusCode.OK); }
protected override void UpdateInner(UpdateContext updateContext) { _achievementShowTimer.Update(updateContext); if (_currentAchievement != null && _achievementShowTimer.HasFinished) { _currentAchievement = null; } }
public DrawableAchievement(SceneManager sceneManager, Achievement achievement) { _title = achievement.Name; _description = achievement.Description; _imagePath = achievement.ImagePath; _isOwned = achievement.IsOwned; _sceneManager = sceneManager; }
void Awake() { if (achievement == null) { DontDestroyOnLoad (gameObject); achievement = this; } else if (achievement != this){ Destroy(gameObject); } }
public DrawCache(Achievement achievement) { this.theAchievement = achievement; this.Title = achievement.FriendlyName; int iconIndex = Main.Achievements.GetIconIndex(achievement.Name); this.IconIndex = iconIndex; this.Frame = new Rectangle(iconIndex % 8 * 66, iconIndex / 8 * 66, 64, 64); this.TimeLeft = 300; }
/// <summary> /// /// </summary> public AchievementsPopup(Achievement data, Camera2D camera, Int32 width) : base() { this.Name = data.Name; this.Description = data.Description; this.Mood = data.Alignment; _width = width; _camera = camera; }
// Use this for initialization void Start() { ach_1 = new Achievement { Name = "To the rescue!", isUnlocked = false, levelToUnlock = 1 }; ach_2 = new Achievement { Name = "Save an adult", isUnlocked = false, levelToUnlock = 1 }; ach_3 = new Achievement { Name = "Save an infant", isUnlocked = false, levelToUnlock = 1 }; ach_4 = new Achievement { Name = "You are just like a medic!", isUnlocked = false, levelToUnlock = 1 }; ach_5 = new Achievement { Name = "Achievement #5", isUnlocked = false, levelToUnlock = 1 }; achievementList.Add(new Achievement { Name = "To the rescue!", isUnlocked = false, levelToUnlock = 1 }); }
private void UnlockAchievement(Achievement achievement) { String achievementName = achievement.GetName(); if (!PlayerPrefs.HasKey(achievementName) && PlayerPrefs.GetString(achievementName) == LOCKED) { PlayerPrefs.SetString(achievementName, UNLOCKED); AchievementUnlocked(achievement); Social.ReportProgress(KILLVAMPIRES_ID, 100.0, OnUnlockAC); } }
public void display(Achievement ach) { List<AchievementSpriteComponent> spriteList = ((NumBlockGame)this.Game).achSpriteList; this.achievement = ach; this.position.X = 118; this.position.Y = 200 + 85 * spriteList.Count(); spriteList.Add(this); this.Game.Components.Add(this); }
private bool CalculateGoalsScored(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context, int level, int top, int nextStep, out string comment) { comment = ""; int i = 0; List<Match> playerMatches = context.Matches.Where(p => p.TeamMatches.Any(x => x.TeamMatchPlayers.Any(z => z.PlayerId == player.Id))).ToList(); if (playerMatches.Any()) { foreach (Match pm in playerMatches) { foreach (TeamMatch tm in pm.TeamMatches) { var tmp = tm.TeamMatchPlayers.FirstOrDefault(w => w.PlayerId == player.Id); if (tmp != null) { i += tmp.TeamMatch.GoalsScored; } } } } if (i == top) { if (level < 3) comment = "Brakuje " + nextStep + " " + GramaticHelper(nextStep) + " z rzędu do kolejnego poziomu"; else comment = "Zdobyto najwyższy poziom w tym osiągnięciu"; return true; } else if (i > top) { if (level < 3) { int t = top + nextStep - i; comment = "Brakuje " + t + " " + GramaticHelper(t) + " do kolejnego poziomu"; } else comment = "Zdobyto najwyższy poziom w tym osiągnięciu"; } else { int t = top - i; comment = "Brakuje " + t + " " + GramaticHelper(t) + " do kolejnego poziomu"; return false; } if (i >= top) return true; else return false; }
private static string achievementString(Achievement a) { string s = String.Empty; s += a.ID + ", " + a.name + ", " + a.description + " P: " + a.isPermanant + " V: " + a.visible + "\n"; foreach (AchievementSelect select in a.selectList) { s += "\t" + select.selectKeyword.ToString() + " = '" + select.selectValue + "' where " + select.clauseKeyword.ToString() + " = '" + select.clauseValue + "' "; if (a.statementsAnd) s += "and\n"; else s += "or\n"; } return s; }
/// <summary> /// UNIMPLEMENTED: Unlocks an achievement. /// </summary> /// <param name="achievement">The achievement to unlock.</param> public static void UnlockAchievement(Achievement achievement) { if (achievement.achieved) { return; } if (Globals.steamEnabled) { // string ID = achievement.achievementID; // Call SetAchievement in the Steamworks API using the achievement's ID. } achievement.achieved = true; // TODO: Write acheivement unlock code. }
void SetUpAchievements() { string line; System.IO.StreamReader file = new System.IO.StreamReader(@"Assets\Data\General\Achievements.txt"); while((line = file.ReadLine())!=null){ Achievement currentAchievement = new Achievement(); string[] data = line.Split('|'); currentAchievement.title = data[0]; currentAchievement.description = data[1]; currentAchievement.sprite = Resources.Load("Achievements/"+data[2], typeof(Sprite)) as Sprite; achievements.Add(data[0], currentAchievement); } file.Close(); }
private bool CalculatePlayedMatchesCount(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context, int level, int top, int nextStep, out string comment) { comment = ""; int i = 0; List<Match> playerMatches = context.Matches.Where(p => p.TeamMatches.Any(x => x.TeamMatchPlayers.Any(z => z.PlayerId == player.Id))).ToList(); if (playerMatches.Any()) { i = playerMatches.Count; if (i == top) { if (level < 3) comment = "Brakuje " + nextStep + " " + GramaticHelper(nextStep) + " z rzędu do kolejnego poziomu"; else comment = "Zdobyto najwyższy poziom w tym osiągnięciu"; return true; } else if (i > top) { if (level < 3) { int t = top + nextStep - i; comment = "Brakuje " + t + " " + GramaticHelper(t) + " do kolejnego poziomu"; } else comment = "Zdobyto najwyższy poziom w tym osiągnięciu"; } else { int t = top - i; comment = "Brakuje " + t + " " + GramaticHelper(t) + " do kolejnego poziomu"; return false; } if (i >= top) return true; else return false; } else { comment = "Brakuje " + top + " " + GramaticHelper(top) + " do kolejnego poziomu"; return false; } }
private bool CaseLevel1(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context, ref string label, ref int newLevel, ref string comment) { if (CalculateLevel1(firstTime, player, achievement, context, out comment)) { string currentComment = comment; newLevel = 1; label = achievement.Level1Label; if (!CaseLevel2(firstTime, player, achievement, context, ref label, ref newLevel, ref comment)) { comment = currentComment; } return true; } else return false; }
internal static ServerMessage Compose(Achievement Achievement, int Level, int PointReward, int PixelReward) { ServerMessage Message = new ServerMessage(437); Message.AppendUInt(Achievement.Id); // Achievement ID Message.AppendInt32(Level); // Achieved level Message.AppendInt32(144); // Unknown. Random useless number. Message.AppendStringWithBreak(Achievement.GroupName + Level); // Achieved name Message.AppendInt32(PointReward); // Point reward Message.AppendInt32(PixelReward); // Pixel reward Message.AppendInt32(0); // Unknown. Message.AppendInt32(10); // Unknown. Message.AppendInt32(21); // Unknown. (Extra reward?) Message.AppendStringWithBreak(Level > 1 ? Achievement.GroupName + (Level - 1) : string.Empty); Message.AppendStringWithBreak(Achievement.Category); return Message; }
/// <summary> /// Creates an achievement and adds it to a dictionary containing all achievements /// </summary> /// <param name="achievementName">Name to be used for accessing the achievement. This name will also be displayed at the top of the Achievement Popup</param> /// <param name="bodyText">Text that will be displayed on the Achievement Popup directly beneath the Achievement Name</param> /// <param name="triggerNamesArray">An array of the names of the Triggers which must be active for this achievement to be accomplished</param> /// <param name="initiallyUnlockable">Whether or not the achievement can be unlocked straight away. For a series of achievements, this should probably be set to false</param> /// <param name="points">The amount of points awarded for completing the achievement</param> /// <returns>Returns the achievement that has been created.</returns> public Achievement CreateAchievement(string achievementName, string bodyText, string[] triggerNamesArray, bool initiallyUnlockable, int points) { if (String.IsNullOrEmpty(achievementName)) { throw new ArgumentNullException("achievementName", "Argument must be a valid string corresponding the name of an achievement"); } if (triggerNamesArray == null || triggerNamesArray.Length == 0) { throw new ArgumentNullException("triggerArray", "Array must be initialised and contain at least one element"); } Achievement achievement = new Achievement(achievementName, bodyText, triggerNamesArray, initiallyUnlockable, points); achievements.Add(achievement.AchievementName, achievement); return achievement; }
public void render(midp.Graphics g, int top_offset) { this.top_offset = top_offset; switch (this.type) { case XNAButton.Type.BACK_BTN: case XNAButton.Type.UNLOCK_GAME: Color color1 = Color.White; if (this.state == XNAButton.State.PRESSED || this.state == XNAButton.State.ANIM_GRAY) { color1 = Color.Gray; } g.spriteBatch.Draw(this.texture, new Rectangle(this.pos.X, this.pos.Y - top_offset, this.pos.Width, this.pos.Height), color1); break; case XNAButton.Type.LEADERBOARD_BTN_1: case XNAButton.Type.LEADERBOARD_BTN_2: case XNAButton.Type.LEADERBOARD_BTN_3: case XNAButton.Type.LEADERBOARD_BTN_4: case XNAButton.Type.LEADERBOARD_BTN_5: case XNAButton.Type.LEADERBOARD_BTN_6: case XNAButton.Type.LEADERBOARD_BTN_7: case XNAButton.Type.LEADERBOARD_BTN_8: case XNAButton.Type.LEADERBOARD_BTN_9: Color color2 = Color.White; if (this.state == XNAButton.State.PRESSED || this.state == XNAButton.State.ANIM_GRAY) { color2 = Color.Gray; } if (this.Highlight) { g.spriteBatch.Draw(this.texture_high, new Rectangle(this.pos.X, this.pos.Y - top_offset, this.pos.Width, this.pos.Height), color2); break; } g.spriteBatch.Draw(this.texture, new Rectangle(this.pos.X, this.pos.Y - top_offset, this.pos.Width, this.pos.Height), color2); break; case XNAButton.Type.ACHIEVEMENT_BTN_1: case XNAButton.Type.ACHIEVEMENT_BTN_2: case XNAButton.Type.ACHIEVEMENT_BTN_3: case XNAButton.Type.ACHIEVEMENT_BTN_4: case XNAButton.Type.ACHIEVEMENT_BTN_5: case XNAButton.Type.ACHIEVEMENT_BTN_6: case XNAButton.Type.ACHIEVEMENT_BTN_7: case XNAButton.Type.ACHIEVEMENT_BTN_8: case XNAButton.Type.ACHIEVEMENT_BTN_9: case XNAButton.Type.ACHIEVEMENT_BTN_10: case XNAButton.Type.ACHIEVEMENT_BTN_11: case XNAButton.Type.ACHIEVEMENT_BTN_12: case XNAButton.Type.ACHIEVEMENT_BTN_13: case XNAButton.Type.ACHIEVEMENT_BTN_14: case XNAButton.Type.ACHIEVEMENT_BTN_15: case XNAButton.Type.ACHIEVEMENT_BTN_16: case XNAButton.Type.ACHIEVEMENT_BTN_17: case XNAButton.Type.ACHIEVEMENT_BTN_18: Color color3 = Color.Black; if (this.state == XNAButton.State.PRESSED || this.state == XNAButton.State.ANIM_GRAY) { color3 = Color.Gray; } g.spriteBatch.Draw(this.texture, new Rectangle(this.pos.X, this.pos.Y - top_offset, this.pos.Width, this.pos.Height), color3); XNAButton.tm.drawString(g, this.label, 6, this.pos.X + 5, this.pos.Y + (this.pos.Height >> 1) - top_offset, 10); if (XNAButton.AC == null) { break; } Achievement achievement = XNAButton.AC.ElementAt <Achievement>((int)(this.type - 10)); g.drawImage(achievement.IsEarned ? XNAButton.AchievementUnlocked : XNAButton.AchievementLocked, (float)(this.pos.X + this.pos.Width - 70), (float)(this.pos.Y + (this.pos.Height >> 1) - top_offset), 10); break; case XNAButton.Type.UNLOCKFULL_STORE: case XNAButton.Type.UNLOCKFULL_BACK: Color color4 = Color.White; if (this.state == XNAButton.State.PRESSED || this.state == XNAButton.State.ANIM_GRAY) { color4 = Color.Gray; } g.spriteBatch.Draw(this.texture, new Rectangle(this.pos.X, this.pos.Y, this.pos.Width, this.pos.Height), color4); XNAButton.tm.drawString(g, this.label, 6, this.pos.X + (this.pos.Width >> 1), this.pos.Y + (this.pos.Height >> 1), 18); break; } }
public static void Description_is_not_null(Achievement actual) => Assert.NotNull(actual.Description);
public static void Requirement_is_not_null(Achievement actual) => Assert.NotNull(actual.Requirement);
public static void Flags_is_not_empty(Achievement actual) => Assert.NotEmpty(actual.Flags);
public static void Tiers_does_not_contain_null(Achievement actual) => Assert.DoesNotContain(null, actual.Tiers);
public bool ProgressUserAchievement(Habbo user, Achievement achievement) { return(ProgressUserAchievement(user.Info, achievement, 1, user)); }
public string CalculateAchievement(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context) { int level = 0; string label = ""; int newLevel = 0; var currentAchievement = context.AchievementPlayer.FirstOrDefault(w => w.AchievementId == achievement.Id && w.PlayerId == player.Id); if (currentAchievement != null) { level = currentAchievement.LevelOfAchievement; } else { level = 0; } string comment = ""; switch (level) { case 0: CaseLevel1(firstTime, player, achievement, context, ref label, ref newLevel, ref comment); break; case 1: CaseLevel2(firstTime, player, achievement, context, ref label, ref newLevel, ref comment); break; case 2: CaseLevel3(firstTime, player, achievement, context, ref label, ref newLevel, ref comment); break; } //if (newLevel > level) //{ if (currentAchievement == null) { currentAchievement = new AchievementPlayer(); currentAchievement.LevelOfAchievement = newLevel; currentAchievement.AchievementId = achievement.Id; currentAchievement.ToNextLevelLabel = comment; currentAchievement.PlayerId = player.Id; context.AchievementPlayer.InsertOnSubmit(currentAchievement); } else { if (newLevel > level) { currentAchievement.LevelOfAchievement = newLevel; } if (!string.IsNullOrEmpty(comment)) { currentAchievement.ToNextLevelLabel = comment; } } if (newLevel > level) { string levelName = Common.GetAchievementsLevelName(newLevel); return(string.Format("Gracz {0} {1} uzyskał poziom {2} ({3}) w osiągnięciu \"{4}\".", player.FirstName, player.LastName, levelName, label, achievement.Title)); } else { return(""); } //} //else if (comment != "" && currentAchievement != null) //{ // currentAchievement.ToNextLevelLabel = comment; //} //return ""; }
/// <summary> /// Invoked when <see cref="ToDTO"/> operation is about to return. /// </summary> /// <param name="dto"><see cref="PhoneDTO"/> converted from <see cref="Phone"/>.</param> static partial void OnDTO(this Achievement entity, AchievementDTO dto) { }
public void SeedData(DbContext context) { Achievement manyLogins = new Achievement() { Description = "You logged in at least 10 times", Name = "Addicted", Icon = "some/icon.png" }; Achievement firstBet = new Achievement() { Description = "You were the first to place a bet for the next race", Name = "Speedy Gonzales", Icon = "some/speedy.png" }; Badge seasonWinner = new Badge() { Description = "You won a season", Name = "Champion", Icon = "badges/champion.png" }; UserAccount admin = new UserAccount() { Admin = true, DisplayName = "admin", Email = "*****@*****.**", LastSeen = DateTime.Now, Enabled = true, Registered = DateTime.Now, Achievements = new Collection <Achievement>(), Badges = new Collection <Badge>() }; Race melRace = new Race() { City = "Melbourne", Country = "Australia", Picture = "city/melbourne.png", Qualifying = DateTime.Now.AddDays(1), RaceTime = DateTime.Now.AddDays(2) }; Track melbourne = new Track() { Name = "Melbourne", Picture = "tracks/melbourne", Race = melRace }; Driver alonso = new Driver() { Name = "Fernando Alonso", Image = "drivers/alonso.png" }; Driver vettel = new Driver() { Name = "Sebastian Vettel", Image = "drivers/vettel.png" }; Club mclaren = new Club() { Name = "Mclaren", Logo = "clubs/mclaren.png", Drivers = new Collection <Driver>() }; Season season2014 = new Season() { Year = 2014, Clubs = new Collection <Club>(), Players = new Collection <UserAccount>(), Tracks = new Collection <Track>() }; mclaren.Drivers.Add(alonso); mclaren.Drivers.Add(vettel); admin.Achievements.Add(firstBet); admin.Achievements.Add(manyLogins); admin.Badges.Add(seasonWinner); season2014.Players.Add(admin); season2014.Clubs.Add(mclaren); season2014.Tracks.Add(melbourne); ((AppDb)context).Seasons.Add(season2014); context.SaveChanges(); }
/// <summary> /// /// </summary> public AchievementsPopup(Achievement data) : base() { this.Name = data.Name; this.Description = data.Description; }
private static void OnAchievementCompleted(Achievement achievement) { }
public static void Load() { if (Main.netMode == 2) { return; } Achievement achievement = new Achievement("TIMBER", "Timber!!", "Chop down your first tree."); short[] numArray = new short[] { 9, 619, 2504, 620, 2503, 2260, 621, 911, 1729 }; achievement.AddCondition(ItemPickupCondition.Create(numArray)); Main.Achievements.Register(achievement); achievement = new Achievement("NO_HOBO", "No Hobo", "Build a house suitable enough for your first town NPC, such as the guide, to move into."); achievement.AddCondition(ProgressionEventCondition.Create(8)); Main.Achievements.Register(achievement); achievement = new Achievement("OBTAIN_HAMMER", "Stop! Hammer Time!", "Obtain your first hammer via crafting or otherwise."); short[] numArray1 = new short[] { 2775, 2746, 3505, 654, 3517, 7, 3493, 2780, 1513, 2516, 660, 3481, 657, 922, 3511, 2785, 3499, 3487, 196, 367, 104, 797, 2320, 787, 1234, 1262, 3465, 204, 217, 1507, 3524, 3522, 3525, 3523, 1305 }; achievement.AddCondition(ItemPickupCondition.Create(numArray1)); Main.Achievements.Register(achievement); achievement = new Achievement("OOO_SHINY", "Ooo! Shiny!", "Mine your first nugget of ore with a pickaxe."); ushort[] numArray2 = new ushort[] { 7, 6, 9, 8, 166, 167, 168, 169, 22, 204, 58, 107, 108, 111, 221, 222, 223, 211 }; achievement.AddCondition(TileDestroyedCondition.Create(numArray2)); Main.Achievements.Register(achievement); achievement = new Achievement("HEART_BREAKER", "Heart Breaker", "Discover and smash your first heart crystal underground."); ushort[] numArray3 = new ushort[] { 12 }; achievement.AddCondition(TileDestroyedCondition.Create(numArray3)); Main.Achievements.Register(achievement); achievement = new Achievement("HEAVY_METAL", "Heavy Metal", "Obtain an anvil made from iron or lead."); short[] numArray4 = new short[] { 35, 716 }; achievement.AddCondition(ItemPickupCondition.Create(numArray4)); Main.Achievements.Register(achievement); achievement = new Achievement("I_AM_LOOT", "I Am Loot!", "Discover a golden chest underground and take a peek at its contents."); achievement.AddCondition(CustomFlagCondition.Create("Peek")); Main.Achievements.Register(achievement); achievement = new Achievement("STAR_POWER", "Star Power", "Craft a mana crystal out of fallen stars, and consume it."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("HOLD_ON_TIGHT", "Hold on Tight!", "Equip your first grappling hook."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); achievement = new Achievement("EYE_ON_YOU", "Eye on You", "Defeat the Eye of Cthulhu, an ocular menace who only appears at night."); achievement.AddCondition(NPCKilledCondition.Create(4)); Main.Achievements.Register(achievement); achievement = new Achievement("SMASHING_POPPET", "Smashing, Poppet!", "Using explosives or your trusty hammer, smash a Shadow Orb or Crimson Heart in the evil parts of your world."); achievement.AddCondition(ProgressionEventCondition.Create(7)); Main.Achievements.Register(achievement); achievement = new Achievement("WORM_FODDER", "Worm Fodder", "Defeat the Eater of Worlds, a massive worm whom dwells in the corruption."); short[] numArray5 = new short[] { 13, 14, 15 }; achievement.AddCondition(NPCKilledCondition.Create(numArray5)); Main.Achievements.Register(achievement); achievement = new Achievement("MASTERMIND", "Mastermind", "Defeat the Brain of Cthulhu, an enourmous demon brain which haunts the creeping crimson."); achievement.AddCondition(NPCKilledCondition.Create(266)); Main.Achievements.Register(achievement); achievement = new Achievement("WHERES_MY_HONEY", "Where's My Honey?", "Discover a large bee's hive deep in the jungle."); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("STING_OPERATION", "Sting Operation", "Defeat the Queen Bee, the matriarch of the jungle hives."); achievement.AddCondition(NPCKilledCondition.Create(222)); Main.Achievements.Register(achievement); achievement = new Achievement("BONED", "Boned", "Defeat Skeletron, the cursed guardian of the dungeon."); achievement.AddCondition(NPCKilledCondition.Create(35)); Main.Achievements.Register(achievement); achievement = new Achievement("DUNGEON_HEIST", "Dungeon Heist", "Steal a key from dungeon's undead denizens, and unlock one of their precious golden chests."); achievement.AddCondition(ItemPickupCondition.Create(327)); achievement.AddCondition(ProgressionEventCondition.Create(19)); Main.Achievements.Register(achievement); achievement = new Achievement("ITS_GETTING_HOT_IN_HERE", "It's Getting Hot in Here", "Spelunk deep enough to reach the molten underworld."); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("MINER_FOR_FIRE", "Miner for Fire", "Craft a molten pickaxe using the hottest of materials."); achievement.AddCondition(ItemCraftCondition.Create(122)); Main.Achievements.Register(achievement); achievement = new Achievement("STILL_HUNGRY", "Still Hungry", "Defeat the Wall of Flesh, the master and core of the world who arises after a great, burning sacrifice."); short[] numArray6 = new short[] { 113, 114 }; achievement.AddCondition(NPCKilledCondition.Create(numArray6)); Main.Achievements.Register(achievement); achievement = new Achievement("ITS_HARD", "It's Hard!", "Unleash the ancient spirits of light and darkness across your world, enabling much stronger foes and showering the world with dazzling treasures (and rainbows!)."); achievement.AddCondition(ProgressionEventCondition.Create(9)); Main.Achievements.Register(achievement); achievement = new Achievement("BEGONE_EVIL", "Begone, Evil!", "Smash a demon or crimson altar with a powerful, holy hammer."); achievement.AddCondition(ProgressionEventCondition.Create(6)); Main.Achievements.Register(achievement); achievement = new Achievement("EXTRA_SHINY", "Extra Shiny!", "Mine a powerful ore that has been newly blessed upon your world."); ushort[] numArray7 = new ushort[] { 107, 108, 111, 221, 222, 223 }; achievement.AddCondition(TileDestroyedCondition.Create(numArray7)); Main.Achievements.Register(achievement); achievement = new Achievement("HEAD_IN_THE_CLOUDS", "Head in the Clouds", "Equip a pair of wings."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); achievement = new Achievement("LIKE_A_BOSS", "Like a Boss", "Obtain a boss-summoning item."); short[] numArray8 = new short[] { 1133, 1331, 1307, 267, 1293, 557, 544, 556, 560, 43, 70 }; achievement.AddCondition(ItemPickupCondition.Create(numArray8)); Main.Achievements.Register(achievement); achievement = new Achievement("BUCKETS_OF_BOLTS", "Buckets of Bolts", "Defeat the three nocturnal mechanical menaces: the Twins, the Destroyer, and Skeletron Prime."); short[] numArray9 = new short[] { 125, 126 }; achievement.AddCondition(NPCKilledCondition.Create(numArray9)); short[] numArray10 = new short[] { 127, 134 }; achievement.AddConditions(NPCKilledCondition.CreateMany(numArray10)); achievement.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement); achievement = new Achievement("DRAX_ATTAX", "Drax Attax", "Craft a drax or pickaxe axe using hallowed bars, and the souls of the three mechanical bosses."); short[] numArray11 = new short[] { 579, 990 }; achievement.AddCondition(ItemCraftCondition.Create(numArray11)); Main.Achievements.Register(achievement); achievement = new Achievement("PHOTOSYNTHESIS", "Photosynthesis", "Mine chlorophyte, an organic ore found deep among the thickest of flora."); ushort[] numArray12 = new ushort[] { 211 }; achievement.AddCondition(TileDestroyedCondition.Create(numArray12)); Main.Achievements.Register(achievement); achievement = new Achievement("GET_A_LIFE", "Get a Life", "Consume a life fruit, which grows in the thick of subterranean jungle grass."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("THE_GREAT_SOUTHERN_PLANTKILL", "The Great Southern Plantkill", "Defeat Plantera, the overgrown monstrosity of the jungle's depths."); achievement.AddCondition(NPCKilledCondition.Create(262)); Main.Achievements.Register(achievement); achievement = new Achievement("TEMPLE_RAIDER", "Temple Raider", "Breach the impenetrable walls of the jungle temple."); ushort[] numArray13 = new ushort[] { 226 }; achievement.AddCondition(TileDestroyedCondition.Create(numArray13)); Main.Achievements.Register(achievement); achievement = new Achievement("LIHZAHRDIAN_IDOL", "Lihzahrdian Idol", "Defeat Golem, the stone-faced ritualistic idol of the lihzahrd tribe."); achievement.AddCondition(NPCKilledCondition.Create(245)); Main.Achievements.Register(achievement); achievement = new Achievement("ROBBING_THE_GRAVE", "Robbing the Grave", "Obtain a rare treasure from a difficult monster in the dungeon."); short[] numArray14 = new short[] { 1513, 938, 963, 977, 1300, 1254, 1514, 679, 759, 1446, 1445, 1444, 1183, 1266, 671 }; achievement.AddCondition(ItemPickupCondition.Create(numArray14)); Main.Achievements.Register(achievement); achievement = new Achievement("BIG_BOOTY", "Big Booty", "Unlock one of the dungeon's large, mysterious chests with a special key."); achievement.AddCondition(ProgressionEventCondition.Create(20)); Main.Achievements.Register(achievement); achievement = new Achievement("FISH_OUT_OF_WATER", "Fish Out of Water", "Defeat Duke Fishron, mutant terror of the sea."); achievement.AddCondition(NPCKilledCondition.Create(370)); Main.Achievements.Register(achievement); achievement = new Achievement("OBSESSIVE_DEVOTION", "Obsessive Devotion", "Defeat the Ancient Cultist, fanatical leader of the dungeon coven."); achievement.AddCondition(NPCKilledCondition.Create(439)); Main.Achievements.Register(achievement); achievement = new Achievement("STAR_DESTROYER", "Star Destroyer", "Defeat the four celestial towers of the moon."); short[] numArray15 = new short[] { 517, 422, 507, 493 }; achievement.AddConditions(NPCKilledCondition.CreateMany(numArray15)); Main.Achievements.Register(achievement); achievement = new Achievement("CHAMPION_OF_TERRARIA", "Champion of Terraria", "Defeat the Moon Lord."); achievement.AddCondition(NPCKilledCondition.Create(398)); Main.Achievements.Register(achievement); achievement = new Achievement("BLOODBATH", "Bloodbath", "Survive a blood moon, a nocturnal event where the rivers run red and monsters swarm aplenty."); achievement.AddCondition(ProgressionEventCondition.Create(5)); Main.Achievements.Register(achievement); achievement = new Achievement("SLIPPERY_SHINOBI", "Slippery Shinobi", "Defeat King Slime, the lord of all things slimy."); achievement.AddCondition(NPCKilledCondition.Create(50)); Main.Achievements.Register(achievement); achievement = new Achievement("GOBLIN_PUNTER", "Goblin Punter", "Triumph over a goblin invasion, a ragtag regiment of crude, barbaric, pointy-eared warriors and their shadowflame sorcerers."); achievement.AddCondition(ProgressionEventCondition.Create(10)); Main.Achievements.Register(achievement); achievement = new Achievement("WALK_THE_PLANK", "Walk the Plank", "Triumph over a pirate invasion, a group of pillagers from the sea out for your booty... and your life!"); achievement.AddCondition(ProgressionEventCondition.Create(11)); Main.Achievements.Register(achievement); achievement = new Achievement("KILL_THE_SUN", "Kill the Sun", "Survive a solar eclipse, a day darker than night filled with creatures of horror."); achievement.AddCondition(ProgressionEventCondition.Create(3)); Main.Achievements.Register(achievement); achievement = new Achievement("DO_YOU_WANT_TO_SLAY_A_SNOWMAN", "Do You Want to Slay a Snowman?", "Triumph over the frost legion, a festive family of maniacal snowman mobsters."); achievement.AddCondition(ProgressionEventCondition.Create(12)); Main.Achievements.Register(achievement); achievement = new Achievement("TIN_FOIL_HATTER", "Tin-Foil Hatter", "Triumph over a martian invasion, when beings from out of this world come to scramble your brains and probe you in uncomfortable places."); achievement.AddCondition(ProgressionEventCondition.Create(13)); Main.Achievements.Register(achievement); achievement = new Achievement("BALEFUL_HARVEST", "Baleful Harvest", "Reach the 15th wave of a pumpkin moon, where evil lurks among the autumn harvest."); achievement.AddCondition(ProgressionEventCondition.Create(15)); Main.Achievements.Register(achievement); achievement = new Achievement("ICE_SCREAM", "Ice Scream", "Reach the 15th wave of a frost moon, where the festive season quickly degrades into madness."); achievement.AddCondition(ProgressionEventCondition.Create(14)); Main.Achievements.Register(achievement); achievement = new Achievement("STICKY_SITUATION", "Sticky Situation", "Survive the slime rain, where gelatinous organisms fall from the sky in droves."); achievement.AddCondition(ProgressionEventCondition.Create(16)); Main.Achievements.Register(achievement); achievement = new Achievement("REAL_ESTATE_AGENT", "Real Estate Agent", "Have all possible town NPCs living in your world."); achievement.AddCondition(ProgressionEventCondition.Create(17)); Main.Achievements.Register(achievement); achievement = new Achievement("NOT_THE_BEES", "Not the Bees!", "Fire a Bee Gun while wearing a full set of Bee Armor."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("JEEPERS_CREEPERS", "Jeepers Creepers", "Stumble into a spider cavern in the underground."); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("FUNKYTOWN", "Funkytown", "Build or encounter a glowing mushroom field above the surface."); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("INTO_ORBIT", "Into Orbit", "You can only go down from here!"); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("ROCK_BOTTOM", "Rock Bottom", "The only way is up!"); achievement.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement); achievement = new Achievement("MECHA_MAYHEM", "Mecha Mayhem", "Do battle against the Twins, the Destroyer, and Skeletron Prime simultaneously and emerge victorious."); achievement.AddCondition(ProgressionEventCondition.Create(21)); Main.Achievements.Register(achievement); achievement = new Achievement("GELATIN_WORLD_TOUR", "Gelatin World Tour", "Defeat every type of slime there is!"); short[] numArray16 = new short[] { -5, -6, 1, 81, 71, -3, 147, 138, -10, 50, 59, 16, -7, 244, -8, -1, -2, 184, 204, 225, -9, 141, 183, -4 }; achievement.AddConditions(NPCKilledCondition.CreateMany(numArray16)); achievement.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement); achievement = new Achievement("FASHION_STATEMENT", "Fashion Statement", "Equip armor or vanity clothing in all three social slots."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); achievement = new Achievement("VEHICULAR_MANSLAUGHTER", "Vehicular Manslaughter", "Defeat an enemy by running it over with a minecart."); achievement.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement); achievement = new Achievement("BULLDOZER", "Bulldozer", "Destroy a total of 10,000 tiles."); achievement.AddCondition(CustomIntCondition.Create("Pick", 10000)); achievement.UseTrackerFromCondition("Pick"); Main.Achievements.Register(achievement); achievement = new Achievement("THERE_ARE_SOME_WHO_CALL_HIM", "There are Some Who Call Him...", "Kill Tim."); achievement.AddCondition(NPCKilledCondition.Create(45)); Main.Achievements.Register(achievement); achievement = new Achievement("DECEIVER_OF_FOOLS", "Deceiver of Fools", "Kill a nymph."); achievement.AddCondition(NPCKilledCondition.Create(196)); Main.Achievements.Register(achievement); achievement = new Achievement("SWORD_OF_THE_HERO", "Sword of the Hero", "Obtain a Terra Blade, forged from the finest blades of light and darkness."); achievement.AddCondition(ItemPickupCondition.Create(757)); Main.Achievements.Register(achievement); achievement = new Achievement("LUCKY_BREAK", "Lucky Break", "Survive a long fall with just a sliver of health remaining."); achievement.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement); achievement = new Achievement("THROWING_LINES", "Throwing Lines", "Throw a yoyo."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("DYE_HARD", "Dye Hard", "Equip a dye in every possible dye slot."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); achievement = new Achievement("SICK_THROW", "Sick Throw", "Obtain the Terrarian."); achievement.AddCondition(ItemPickupCondition.Create(3389)); Main.Achievements.Register(achievement); achievement = new Achievement("FREQUENT_FLYER", "The Frequent Flyer", "Spend over 1 gold being treated by the nurse."); achievement.AddCondition(CustomFloatCondition.Create("Pay", 10000f)); achievement.UseTrackerFromCondition("Pay"); Main.Achievements.Register(achievement); achievement = new Achievement("THE_CAVALRY", "The Cavalry", "Equip a mount."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); achievement = new Achievement("COMPLETELY_AWESOME", "Completely Awesome", "Obtain a minishark."); achievement.AddCondition(ItemPickupCondition.Create(98)); Main.Achievements.Register(achievement); achievement = new Achievement("TIL_DEATH", "Til Death...", "Kill the groom."); achievement.AddCondition(NPCKilledCondition.Create(53)); Main.Achievements.Register(achievement); achievement = new Achievement("ARCHAEOLOGIST", "Archaeologist", "Kill Doctor Bones."); achievement.AddCondition(NPCKilledCondition.Create(52)); Main.Achievements.Register(achievement); achievement = new Achievement("PRETTY_IN_PINK", "Pretty in Pink", "Kill pinky."); achievement.AddCondition(NPCKilledCondition.Create(-4)); Main.Achievements.Register(achievement); achievement = new Achievement("RAINBOWS_AND_UNICORNS", "Rainbows and Unicorns", "Fire a rainbow gun while riding on a unicorn."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("YOU_AND_WHAT_ARMY", "You and What Army?", "Command nine summoned minions simultaneously."); achievement.AddCondition(CustomFlagCondition.Create("Spawn")); Main.Achievements.Register(achievement); achievement = new Achievement("PRISMANCER", "Prismancer", "Obtain a rainbow rod."); achievement.AddCondition(ItemPickupCondition.Create(495)); Main.Achievements.Register(achievement); achievement = new Achievement("IT_CAN_TALK", "It Can Talk?!", "Build a house in a mushroom biome and have Truffle move in."); achievement.AddCondition(ProgressionEventCondition.Create(18)); Main.Achievements.Register(achievement); achievement = new Achievement("WATCH_YOUR_STEP", "Watch Your Step!", "Become a victim to a nasty underground trap."); achievement.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement); achievement = new Achievement("MARATHON_MEDALIST", "Marathon Medalist", "Travel a total of 26.2 miles on foot."); achievement.AddCondition(CustomFloatCondition.Create("Move", 1106688f)); achievement.UseTrackerFromCondition("Move"); Main.Achievements.Register(achievement); achievement = new Achievement("GLORIOUS_GOLDEN_POLE", "Glorious Golden Pole", "Obtain a golden fishing rod."); achievement.AddCondition(ItemPickupCondition.Create(2294)); Main.Achievements.Register(achievement); achievement = new Achievement("SERVANT_IN_TRAINING", "Servant-in-Training", "Complete your 1st quest for the angler."); achievement.AddCondition(CustomFlagCondition.Create("Finish")); Main.Achievements.Register(achievement); achievement = new Achievement("GOOD_LITTLE_SLAVE", "Good Little Slave", "Complete your 10th quest for the angler."); achievement.AddCondition(CustomFloatCondition.Create("Finish", 10f)); achievement.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement); achievement = new Achievement("TROUT_MONKEY", "Trout Monkey", "Complete your 25th quest for the angler."); achievement.AddCondition(CustomFloatCondition.Create("Finish", 25f)); achievement.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement); achievement = new Achievement("FAST_AND_FISHIOUS", "Fast and Fishious", "Complete your 50th quest for the angler."); achievement.AddCondition(CustomFloatCondition.Create("Finish", 50f)); achievement.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement); achievement = new Achievement("SUPREME_HELPER_MINION", "Supreme Helper Minion!", "Complete a grand total of 200 quests for the angler."); achievement.AddCondition(CustomFloatCondition.Create("Finish", 200f)); achievement.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement); achievement = new Achievement("TOPPED_OFF", "Topped Off", "Attain maximum health and mana possible without accessories or buffs."); achievement.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement); achievement = new Achievement("SLAYER_OF_WORLDS", "Slayer of Worlds", "Defeat every boss in Terraria."); short[] numArray17 = new short[] { 13, 14, 15 }; achievement.AddCondition(NPCKilledCondition.Create(numArray17)); short[] numArray18 = new short[] { 113, 114 }; achievement.AddCondition(NPCKilledCondition.Create(numArray18)); short[] numArray19 = new short[] { 125, 126 }; achievement.AddCondition(NPCKilledCondition.Create(numArray19)); short[] numArray20 = new short[] { 4, 35, 50, 222, 113, 134, 127, 262, 245, 439, 398, 370 }; achievement.AddConditions(NPCKilledCondition.CreateMany(numArray20)); achievement.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement); achievement = new Achievement("YOU_CAN_DO_IT", "You Can Do It!", "Survive your character's first full night."); achievement.AddCondition(ProgressionEventCondition.Create(1)); Main.Achievements.Register(achievement); achievement = new Achievement("MATCHING_ATTIRE", "Matching Attire", "Equip armor in all three armor slots: head, chest, and feet."); achievement.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement); int num = 0; int num1 = num + 1; Main.Achievements.RegisterIconIndex("TIMBER", num); int num2 = num1; num1 = num2 + 1; Main.Achievements.RegisterIconIndex("NO_HOBO", num2); int num3 = num1; num1 = num3 + 1; Main.Achievements.RegisterIconIndex("OBTAIN_HAMMER", num3); int num4 = num1; num1 = num4 + 1; Main.Achievements.RegisterIconIndex("HEART_BREAKER", num4); int num5 = num1; num1 = num5 + 1; Main.Achievements.RegisterIconIndex("OOO_SHINY", num5); int num6 = num1; num1 = num6 + 1; Main.Achievements.RegisterIconIndex("HEAVY_METAL", num6); int num7 = num1; num1 = num7 + 1; Main.Achievements.RegisterIconIndex("I_AM_LOOT", num7); int num8 = num1; num1 = num8 + 1; Main.Achievements.RegisterIconIndex("STAR_POWER", num8); int num9 = num1; num1 = num9 + 1; Main.Achievements.RegisterIconIndex("HOLD_ON_TIGHT", num9); int num10 = num1; num1 = num10 + 1; Main.Achievements.RegisterIconIndex("EYE_ON_YOU", num10); int num11 = num1; num1 = num11 + 1; Main.Achievements.RegisterIconIndex("SMASHING_POPPET", num11); int num12 = num1; num1 = num12 + 1; Main.Achievements.RegisterIconIndex("WORM_FODDER", num12); int num13 = num1; num1 = num13 + 1; Main.Achievements.RegisterIconIndex("MASTERMIND", num13); int num14 = num1; num1 = num14 + 1; Main.Achievements.RegisterIconIndex("WHERES_MY_HONEY", num14); int num15 = num1; num1 = num15 + 1; Main.Achievements.RegisterIconIndex("STING_OPERATION", num15); int num16 = num1; num1 = num16 + 1; Main.Achievements.RegisterIconIndex("BONED", num16); int num17 = num1; num1 = num17 + 1; Main.Achievements.RegisterIconIndex("DUNGEON_HEIST", num17); int num18 = num1; num1 = num18 + 1; Main.Achievements.RegisterIconIndex("ITS_GETTING_HOT_IN_HERE", num18); int num19 = num1; num1 = num19 + 1; Main.Achievements.RegisterIconIndex("MINER_FOR_FIRE", num19); int num20 = num1; num1 = num20 + 1; Main.Achievements.RegisterIconIndex("STILL_HUNGRY", num20); int num21 = num1; num1 = num21 + 1; Main.Achievements.RegisterIconIndex("ITS_HARD", num21); int num22 = num1; num1 = num22 + 1; Main.Achievements.RegisterIconIndex("BEGONE_EVIL", num22); int num23 = num1; num1 = num23 + 1; Main.Achievements.RegisterIconIndex("EXTRA_SHINY", num23); int num24 = num1; num1 = num24 + 1; Main.Achievements.RegisterIconIndex("HEAD_IN_THE_CLOUDS", num24); int num25 = num1; num1 = num25 + 1; Main.Achievements.RegisterIconIndex("LIKE_A_BOSS", num25); int num26 = num1; num1 = num26 + 1; Main.Achievements.RegisterIconIndex("BUCKETS_OF_BOLTS", num26); int num27 = num1; num1 = num27 + 1; Main.Achievements.RegisterIconIndex("DRAX_ATTAX", num27); int num28 = num1; num1 = num28 + 1; Main.Achievements.RegisterIconIndex("PHOTOSYNTHESIS", num28); int num29 = num1; num1 = num29 + 1; Main.Achievements.RegisterIconIndex("GET_A_LIFE", num29); int num30 = num1; num1 = num30 + 1; Main.Achievements.RegisterIconIndex("THE_GREAT_SOUTHERN_PLANTKILL", num30); int num31 = num1; num1 = num31 + 1; Main.Achievements.RegisterIconIndex("TEMPLE_RAIDER", num31); int num32 = num1; num1 = num32 + 1; Main.Achievements.RegisterIconIndex("LIHZAHRDIAN_IDOL", num32); int num33 = num1; num1 = num33 + 1; Main.Achievements.RegisterIconIndex("ROBBING_THE_GRAVE", num33); int num34 = num1; num1 = num34 + 1; Main.Achievements.RegisterIconIndex("BIG_BOOTY", num34); int num35 = num1; num1 = num35 + 1; Main.Achievements.RegisterIconIndex("FISH_OUT_OF_WATER", num35); int num36 = num1; num1 = num36 + 1; Main.Achievements.RegisterIconIndex("OBSESSIVE_DEVOTION", num36); int num37 = num1; num1 = num37 + 1; Main.Achievements.RegisterIconIndex("STAR_DESTROYER", num37); int num38 = num1; num1 = num38 + 1; Main.Achievements.RegisterIconIndex("CHAMPION_OF_TERRARIA", num38); int num39 = num1; num1 = num39 + 1; Main.Achievements.RegisterIconIndex("BLOODBATH", num39); int num40 = num1; num1 = num40 + 1; Main.Achievements.RegisterIconIndex("GOBLIN_PUNTER", num40); int num41 = num1; num1 = num41 + 1; Main.Achievements.RegisterIconIndex("KILL_THE_SUN", num41); int num42 = num1; num1 = num42 + 1; Main.Achievements.RegisterIconIndex("WALK_THE_PLANK", num42); int num43 = num1; num1 = num43 + 1; Main.Achievements.RegisterIconIndex("DO_YOU_WANT_TO_SLAY_A_SNOWMAN", num43); int num44 = num1; num1 = num44 + 1; Main.Achievements.RegisterIconIndex("TIN_FOIL_HATTER", num44); int num45 = num1; num1 = num45 + 1; Main.Achievements.RegisterIconIndex("BALEFUL_HARVEST", num45); int num46 = num1; num1 = num46 + 1; Main.Achievements.RegisterIconIndex("ICE_SCREAM", num46); int num47 = num1; num1 = num47 + 1; Main.Achievements.RegisterIconIndex("SLIPPERY_SHINOBI", num47); int num48 = num1; num1 = num48 + 1; Main.Achievements.RegisterIconIndex("STICKY_SITUATION", num48); int num49 = num1; num1 = num49 + 1; Main.Achievements.RegisterIconIndex("REAL_ESTATE_AGENT", num49); int num50 = num1; num1 = num50 + 1; Main.Achievements.RegisterIconIndex("NOT_THE_BEES", num50); int num51 = num1; num1 = num51 + 1; Main.Achievements.RegisterIconIndex("JEEPERS_CREEPERS", num51); int num52 = num1; num1 = num52 + 1; Main.Achievements.RegisterIconIndex("FUNKYTOWN", num52); int num53 = num1; num1 = num53 + 1; Main.Achievements.RegisterIconIndex("INTO_ORBIT", num53); int num54 = num1; num1 = num54 + 1; Main.Achievements.RegisterIconIndex("ROCK_BOTTOM", num54); int num55 = num1; num1 = num55 + 1; Main.Achievements.RegisterIconIndex("MECHA_MAYHEM", num55); int num56 = num1; num1 = num56 + 1; Main.Achievements.RegisterIconIndex("GELATIN_WORLD_TOUR", num56); int num57 = num1; num1 = num57 + 1; Main.Achievements.RegisterIconIndex("FASHION_STATEMENT", num57); int num58 = num1; num1 = num58 + 1; Main.Achievements.RegisterIconIndex("VEHICULAR_MANSLAUGHTER", num58); int num59 = num1; num1 = num59 + 1; Main.Achievements.RegisterIconIndex("BULLDOZER", num59); int num60 = num1; num1 = num60 + 1; Main.Achievements.RegisterIconIndex("THERE_ARE_SOME_WHO_CALL_HIM", num60); int num61 = num1; num1 = num61 + 1; Main.Achievements.RegisterIconIndex("DECEIVER_OF_FOOLS", num61); int num62 = num1; num1 = num62 + 1; Main.Achievements.RegisterIconIndex("SWORD_OF_THE_HERO", num62); int num63 = num1; num1 = num63 + 1; Main.Achievements.RegisterIconIndex("LUCKY_BREAK", num63); int num64 = num1; num1 = num64 + 1; Main.Achievements.RegisterIconIndex("THROWING_LINES", num64); int num65 = num1; num1 = num65 + 1; Main.Achievements.RegisterIconIndex("DYE_HARD", num65); int num66 = num1; num1 = num66 + 1; Main.Achievements.RegisterIconIndex("FREQUENT_FLYER", num66); int num67 = num1; num1 = num67 + 1; Main.Achievements.RegisterIconIndex("THE_CAVALRY", num67); int num68 = num1; num1 = num68 + 1; Main.Achievements.RegisterIconIndex("COMPLETELY_AWESOME", num68); int num69 = num1; num1 = num69 + 1; Main.Achievements.RegisterIconIndex("TIL_DEATH", num69); int num70 = num1; num1 = num70 + 1; Main.Achievements.RegisterIconIndex("ARCHAEOLOGIST", num70); int num71 = num1; num1 = num71 + 1; Main.Achievements.RegisterIconIndex("PRETTY_IN_PINK", num71); int num72 = num1; num1 = num72 + 1; Main.Achievements.RegisterIconIndex("RAINBOWS_AND_UNICORNS", num72); int num73 = num1; num1 = num73 + 1; Main.Achievements.RegisterIconIndex("YOU_AND_WHAT_ARMY", num73); int num74 = num1; num1 = num74 + 1; Main.Achievements.RegisterIconIndex("PRISMANCER", num74); int num75 = num1; num1 = num75 + 1; Main.Achievements.RegisterIconIndex("IT_CAN_TALK", num75); int num76 = num1; num1 = num76 + 1; Main.Achievements.RegisterIconIndex("WATCH_YOUR_STEP", num76); int num77 = num1; num1 = num77 + 1; Main.Achievements.RegisterIconIndex("MARATHON_MEDALIST", num77); int num78 = num1; num1 = num78 + 1; Main.Achievements.RegisterIconIndex("GLORIOUS_GOLDEN_POLE", num78); int num79 = num1; num1 = num79 + 1; Main.Achievements.RegisterIconIndex("SERVANT_IN_TRAINING", num79); int num80 = num1; num1 = num80 + 1; Main.Achievements.RegisterIconIndex("GOOD_LITTLE_SLAVE", num80); int num81 = num1; num1 = num81 + 1; Main.Achievements.RegisterIconIndex("TROUT_MONKEY", num81); int num82 = num1; num1 = num82 + 1; Main.Achievements.RegisterIconIndex("FAST_AND_FISHIOUS", num82); int num83 = num1; num1 = num83 + 1; Main.Achievements.RegisterIconIndex("SUPREME_HELPER_MINION", num83); int num84 = num1; num1 = num84 + 1; Main.Achievements.RegisterIconIndex("TOPPED_OFF", num84); int num85 = num1; num1 = num85 + 1; Main.Achievements.RegisterIconIndex("SLAYER_OF_WORLDS", num85); int num86 = num1; num1 = num86 + 1; Main.Achievements.RegisterIconIndex("YOU_CAN_DO_IT", num86); int num87 = num1; num1 = num87 + 1; Main.Achievements.RegisterIconIndex("SICK_THROW", num87); int num88 = num1; num1 = num88 + 1; Main.Achievements.RegisterIconIndex("MATCHING_ATTIRE", num88); AchievementCategory achievementCategory = AchievementCategory.Slayer; Main.Achievements.RegisterAchievementCategory("EYE_ON_YOU", achievementCategory); Main.Achievements.RegisterAchievementCategory("SLIPPERY_SHINOBI", achievementCategory); Main.Achievements.RegisterAchievementCategory("WORM_FODDER", achievementCategory); Main.Achievements.RegisterAchievementCategory("MASTERMIND", achievementCategory); Main.Achievements.RegisterAchievementCategory("STING_OPERATION", achievementCategory); Main.Achievements.RegisterAchievementCategory("BONED", achievementCategory); Main.Achievements.RegisterAchievementCategory("STILL_HUNGRY", achievementCategory); Main.Achievements.RegisterAchievementCategory("BUCKETS_OF_BOLTS", achievementCategory); Main.Achievements.RegisterAchievementCategory("THE_GREAT_SOUTHERN_PLANTKILL", achievementCategory); Main.Achievements.RegisterAchievementCategory("LIHZAHRDIAN_IDOL", achievementCategory); Main.Achievements.RegisterAchievementCategory("FISH_OUT_OF_WATER", achievementCategory); Main.Achievements.RegisterAchievementCategory("OBSESSIVE_DEVOTION", achievementCategory); Main.Achievements.RegisterAchievementCategory("STAR_DESTROYER", achievementCategory); Main.Achievements.RegisterAchievementCategory("CHAMPION_OF_TERRARIA", achievementCategory); Main.Achievements.RegisterAchievementCategory("GOBLIN_PUNTER", achievementCategory); Main.Achievements.RegisterAchievementCategory("DO_YOU_WANT_TO_SLAY_A_SNOWMAN", achievementCategory); Main.Achievements.RegisterAchievementCategory("WALK_THE_PLANK", achievementCategory); Main.Achievements.RegisterAchievementCategory("BALEFUL_HARVEST", achievementCategory); Main.Achievements.RegisterAchievementCategory("ICE_SCREAM", achievementCategory); Main.Achievements.RegisterAchievementCategory("TIN_FOIL_HATTER", achievementCategory); Main.Achievements.RegisterAchievementCategory("TIL_DEATH", achievementCategory); Main.Achievements.RegisterAchievementCategory("THERE_ARE_SOME_WHO_CALL_HIM", achievementCategory); Main.Achievements.RegisterAchievementCategory("ARCHAEOLOGIST", achievementCategory); Main.Achievements.RegisterAchievementCategory("PRETTY_IN_PINK", achievementCategory); Main.Achievements.RegisterAchievementCategory("DECEIVER_OF_FOOLS", achievementCategory); Main.Achievements.RegisterAchievementCategory("VEHICULAR_MANSLAUGHTER", achievementCategory); achievementCategory = AchievementCategory.Explorer; Main.Achievements.RegisterAchievementCategory("SMASHING_POPPET", achievementCategory); Main.Achievements.RegisterAchievementCategory("BEGONE_EVIL", achievementCategory); Main.Achievements.RegisterAchievementCategory("ITS_HARD", achievementCategory); Main.Achievements.RegisterAchievementCategory("FUNKYTOWN", achievementCategory); Main.Achievements.RegisterAchievementCategory("WATCH_YOUR_STEP", achievementCategory); Main.Achievements.RegisterAchievementCategory("YOU_CAN_DO_IT", achievementCategory); Main.Achievements.RegisterAchievementCategory("BLOODBATH", achievementCategory); Main.Achievements.RegisterAchievementCategory("KILL_THE_SUN", achievementCategory); Main.Achievements.RegisterAchievementCategory("STICKY_SITUATION", achievementCategory); Main.Achievements.RegisterAchievementCategory("NO_HOBO", achievementCategory); Main.Achievements.RegisterAchievementCategory("IT_CAN_TALK", achievementCategory); Main.Achievements.RegisterAchievementCategory("HEART_BREAKER", achievementCategory); Main.Achievements.RegisterAchievementCategory("I_AM_LOOT", achievementCategory); Main.Achievements.RegisterAchievementCategory("ROBBING_THE_GRAVE", achievementCategory); Main.Achievements.RegisterAchievementCategory("GET_A_LIFE", achievementCategory); Main.Achievements.RegisterAchievementCategory("JEEPERS_CREEPERS", achievementCategory); Main.Achievements.RegisterAchievementCategory("WHERES_MY_HONEY", achievementCategory); Main.Achievements.RegisterAchievementCategory("DUNGEON_HEIST", achievementCategory); Main.Achievements.RegisterAchievementCategory("BIG_BOOTY", achievementCategory); Main.Achievements.RegisterAchievementCategory("ITS_GETTING_HOT_IN_HERE", achievementCategory); Main.Achievements.RegisterAchievementCategory("INTO_ORBIT", achievementCategory); Main.Achievements.RegisterAchievementCategory("ROCK_BOTTOM", achievementCategory); Main.Achievements.RegisterAchievementCategory("OOO_SHINY", achievementCategory); Main.Achievements.RegisterAchievementCategory("EXTRA_SHINY", achievementCategory); Main.Achievements.RegisterAchievementCategory("PHOTOSYNTHESIS", achievementCategory); achievementCategory = AchievementCategory.Challenger; Main.Achievements.RegisterAchievementCategory("GELATIN_WORLD_TOUR", achievementCategory); Main.Achievements.RegisterAchievementCategory("SLAYER_OF_WORLDS", achievementCategory); Main.Achievements.RegisterAchievementCategory("REAL_ESTATE_AGENT", achievementCategory); Main.Achievements.RegisterAchievementCategory("YOU_AND_WHAT_ARMY", achievementCategory); Main.Achievements.RegisterAchievementCategory("TOPPED_OFF", achievementCategory); Main.Achievements.RegisterAchievementCategory("MECHA_MAYHEM", achievementCategory); Main.Achievements.RegisterAchievementCategory("BULLDOZER", achievementCategory); Main.Achievements.RegisterAchievementCategory("NOT_THE_BEES", achievementCategory); Main.Achievements.RegisterAchievementCategory("RAINBOWS_AND_UNICORNS", achievementCategory); Main.Achievements.RegisterAchievementCategory("THROWING_LINES", achievementCategory); Main.Achievements.RegisterAchievementCategory("FREQUENT_FLYER", achievementCategory); Main.Achievements.RegisterAchievementCategory("LUCKY_BREAK", achievementCategory); Main.Achievements.RegisterAchievementCategory("MARATHON_MEDALIST", achievementCategory); Main.Achievements.RegisterAchievementCategory("SERVANT_IN_TRAINING", achievementCategory); Main.Achievements.RegisterAchievementCategory("GOOD_LITTLE_SLAVE", achievementCategory); Main.Achievements.RegisterAchievementCategory("TROUT_MONKEY", achievementCategory); Main.Achievements.RegisterAchievementCategory("FAST_AND_FISHIOUS", achievementCategory); Main.Achievements.RegisterAchievementCategory("SUPREME_HELPER_MINION", achievementCategory); achievementCategory = AchievementCategory.Collector; Main.Achievements.RegisterAchievementCategory("OBTAIN_HAMMER", achievementCategory); Main.Achievements.RegisterAchievementCategory("HEAVY_METAL", achievementCategory); Main.Achievements.RegisterAchievementCategory("STAR_POWER", achievementCategory); Main.Achievements.RegisterAchievementCategory("MINER_FOR_FIRE", achievementCategory); Main.Achievements.RegisterAchievementCategory("HEAD_IN_THE_CLOUDS", achievementCategory); Main.Achievements.RegisterAchievementCategory("DRAX_ATTAX", achievementCategory); Main.Achievements.RegisterAchievementCategory("PRISMANCER", achievementCategory); Main.Achievements.RegisterAchievementCategory("SWORD_OF_THE_HERO", achievementCategory); Main.Achievements.RegisterAchievementCategory("HOLD_ON_TIGHT", achievementCategory); Main.Achievements.RegisterAchievementCategory("THE_CAVALRY", achievementCategory); Main.Achievements.RegisterAchievementCategory("DYE_HARD", achievementCategory); Main.Achievements.RegisterAchievementCategory("MATCHING_ATTIRE", achievementCategory); Main.Achievements.RegisterAchievementCategory("FASHION_STATEMENT", achievementCategory); Main.Achievements.RegisterAchievementCategory("COMPLETELY_AWESOME", achievementCategory); Main.Achievements.RegisterAchievementCategory("TIMBER", achievementCategory); Main.Achievements.RegisterAchievementCategory("SICK_THROW", achievementCategory); Main.Achievements.RegisterAchievementCategory("GLORIOUS_GOLDEN_POLE", achievementCategory); Main.Achievements.RegisterAchievementCategory("TEMPLE_RAIDER", achievementCategory); Main.Achievements.RegisterAchievementCategory("LIKE_A_BOSS", achievementCategory); Main.Achievements.Load(); Main.Achievements.OnAchievementCompleted += new Achievement.AchievementCompleted(AchievementInitializer.OnAchievementCompleted); AchievementsHelper.Initialize(); }
internal static async Task UpdateCacheAchievementAsync(long userId, string name, Achievement achievement) { var cache = MikiApp.Instance.GetService <ICacheClient>(); string key = $"achievement:{userId}:{name}"; await cache.UpsertAsync(key, achievement); }
public void MergeFrom(AtlasInventoryItem other) { if (other == null) { return; } switch (other.TypeCase) { case TypeOneofCase.Profile: if (Profile == null) { Profile = new global::WUProtos.Data.Player.PlayerProfile(); } Profile.MergeFrom(other.Profile); break; case TypeOneofCase.VaultItem: if (VaultItem == null) { VaultItem = new global::WUProtos.Inventory.InventoryVaultItem(); } VaultItem.MergeFrom(other.VaultItem); break; case TypeOneofCase.CollectionItem: if (CollectionItem == null) { CollectionItem = new global::WUProtos.Inventory.InventoryCollectionItem(); } CollectionItem.MergeFrom(other.CollectionItem); break; case TypeOneofCase.CollectionFamily: if (CollectionFamily == null) { CollectionFamily = new global::WUProtos.Inventory.InventoryCollectionFamily(); } CollectionFamily.MergeFrom(other.CollectionFamily); break; case TypeOneofCase.Walkbox: if (Walkbox == null) { Walkbox = new global::WUProtos.Inventory.InventoryWalkboxItem(); } Walkbox.MergeFrom(other.Walkbox); break; case TypeOneofCase.PlayerFlags: if (PlayerFlags == null) { PlayerFlags = new global::WUProtos.Inventory.InventoryFeatureFlags(); } PlayerFlags.MergeFrom(other.PlayerFlags); break; case TypeOneofCase.Portkey: if (Portkey == null) { Portkey = new global::WUProtos.Inventory.InventoryPortkeyItem(); } Portkey.MergeFrom(other.Portkey); break; case TypeOneofCase.PlayerActiveBuffList: if (PlayerActiveBuffList == null) { PlayerActiveBuffList = new global::WUProtos.Data.Buff.ActiveBuffList(); } PlayerActiveBuffList.MergeFrom(other.PlayerActiveBuffList); break; case TypeOneofCase.CollectionPage: if (CollectionPage == null) { CollectionPage = new global::WUProtos.Inventory.InventoryCollectionPage(); } CollectionPage.MergeFrom(other.CollectionPage); break; case TypeOneofCase.VaultCapacity: if (VaultCapacity == null) { VaultCapacity = new global::WUProtos.Inventory.InventoryVaultCapacity(); } VaultCapacity.MergeFrom(other.VaultCapacity); break; case TypeOneofCase.Cauldron: if (Cauldron == null) { Cauldron = new global::WUProtos.Inventory.InventoryCauldron(); } Cauldron.MergeFrom(other.Cauldron); break; case TypeOneofCase.EscrowedRewards: if (EscrowedRewards == null) { EscrowedRewards = new global::WUProtos.Inventory.InventoryEscrowedRewards(); } EscrowedRewards.MergeFrom(other.EscrowedRewards); break; case TypeOneofCase.ProfessionsProgressV3: if (ProfessionsProgressV3 == null) { ProfessionsProgressV3 = new global::WUProtos.Data.Player.PlayerProfessionsProgressV3(); } ProfessionsProgressV3.MergeFrom(other.ProfessionsProgressV3); break; case TypeOneofCase.QuestLog: if (QuestLog == null) { QuestLog = new global::WUProtos.Inventory.InventoryQuestLog(); } QuestLog.MergeFrom(other.QuestLog); break; case TypeOneofCase.Achievement: if (Achievement == null) { Achievement = new global::WUProtos.Data.Player.PlayerAchievement(); } Achievement.MergeFrom(other.Achievement); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public abstract bool CalculateLevel3(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context, out string toNext);
/// <summary> /// Invoked when <see cref="ToEntity"/> operation is about to return. /// </summary> /// <param name="entity"><see cref="Phone"/> converted from <see cref="PhoneDTO"/>.</param> static partial void OnEntity(this AchievementDTO dto, Achievement entity) { }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { Achievement Achievement = new Achievement(); JObject item = JObject.Load(reader); if (existingValue != null) { Achievement = (Achievement)existingValue; } JToken ID = item["ID"]; JToken GameID = item["GameID"]; JToken GameTitle = item["GameTitle"]; JToken Title = item["Title"]; JToken Description = item["Description"]; JToken Points = item["Points"]; JToken TrueRatio = item["TrueRatio"]; JToken HardcoreAchieved = item["HardcoreAchieved"]; JToken DateAwarded = item["DateAwarded"]; JToken DateEarnedHardcore = item["DateEarnedHardcore"]; JToken BadgeName = item["BadgeName"]; JToken DisplayOrder = item["DisplayOrder"]; if (ID != null) { Achievement.Id = int.Parse(ID.ToString()); } if (GameID != null) { Achievement.GameId = int.Parse(GameID.ToString()); } if (GameTitle != null) { Achievement.GameTitle = GameTitle.ToString(); } if (Description != null) { Achievement.Description = Description.ToString(); } if (Title != null) { Achievement.Title = Title.ToString(); } if (Points != null) { Achievement.Points = int.Parse(Points.ToString()); } if (TrueRatio != null) { Achievement.TrueRatio = int.Parse(TrueRatio.ToString()); } if (DateAwarded != null && !string.IsNullOrEmpty(DateAwarded.ToString())) { Achievement.DateEarned = DateTime.Parse(DateAwarded.ToString()); } if (DateEarnedHardcore != null && !string.IsNullOrEmpty(DateEarnedHardcore.ToString())) { Achievement.DateEarned = DateTime.Parse(DateEarnedHardcore.ToString()); } if (BadgeName != null) { Achievement.BadgeNumber = Convert.ToString(BadgeName); } if (DisplayOrder != null) { Achievement.DisplayOrder = int.Parse(DisplayOrder.ToString()); } Achievement.HardcoreAchieved = Achievement.DateEarned.HasValue || (HardcoreAchieved != null && "1".Equals(HardcoreAchieved.ToString())); return(Achievement); }
public override int GetHashCode() { int hash = 1; if (typeCase_ == TypeOneofCase.Profile) { hash ^= Profile.GetHashCode(); } if (typeCase_ == TypeOneofCase.VaultItem) { hash ^= VaultItem.GetHashCode(); } if (typeCase_ == TypeOneofCase.CollectionItem) { hash ^= CollectionItem.GetHashCode(); } if (typeCase_ == TypeOneofCase.CollectionFamily) { hash ^= CollectionFamily.GetHashCode(); } if (typeCase_ == TypeOneofCase.Walkbox) { hash ^= Walkbox.GetHashCode(); } if (typeCase_ == TypeOneofCase.PlayerFlags) { hash ^= PlayerFlags.GetHashCode(); } if (typeCase_ == TypeOneofCase.Portkey) { hash ^= Portkey.GetHashCode(); } if (typeCase_ == TypeOneofCase.PlayerActiveBuffList) { hash ^= PlayerActiveBuffList.GetHashCode(); } if (typeCase_ == TypeOneofCase.CollectionPage) { hash ^= CollectionPage.GetHashCode(); } if (typeCase_ == TypeOneofCase.VaultCapacity) { hash ^= VaultCapacity.GetHashCode(); } if (typeCase_ == TypeOneofCase.Cauldron) { hash ^= Cauldron.GetHashCode(); } if (typeCase_ == TypeOneofCase.EscrowedRewards) { hash ^= EscrowedRewards.GetHashCode(); } if (typeCase_ == TypeOneofCase.ProfessionsProgressV3) { hash ^= ProfessionsProgressV3.GetHashCode(); } if (typeCase_ == TypeOneofCase.QuestLog) { hash ^= QuestLog.GetHashCode(); } if (typeCase_ == TypeOneofCase.Achievement) { hash ^= Achievement.GetHashCode(); } hash ^= (int)typeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public static void PointCap_is_negative_1_for_repeatable_achievements_without_points(Achievement actual) { if (actual.Flags.Contains(AchievementFlag.Repeatable) && actual.Tiers.All(tier => tier.Points == 0)) { Assert.Equal(-1, actual.PointCap); } }
public override bool CalculateLevel3(bool firstTime, Player player, Achievement achievement, TrambambuleDBContextDataContext context, out string comment) { return(CalculatePlayedMatchesCount(firstTime, player, achievement, context, 3, 300, 100, out comment)); }
public static void Tiers_is_not_empty(Achievement actual) => Assert.NotEmpty(actual.Tiers);
public void AwardAchievement(Achievement achievement) { this.IsAchievementSave = true; CommunityExpress.Instance.UserAchievements.UnlockAchievement(achievement, true); }
public static void LockedText_is_not_null(Achievement actual) => Assert.NotNull(actual.LockedText);
public NumberOfBlocksCondition(Achievement p_achievement, Int32 p_count, String p_parameterString) : base(p_achievement, p_count, p_parameterString) { }
IEnumerator DoIt() { Achievement achieve = Achievement.instance; WaitForFixedUpdate wait = new WaitForFixedUpdate(); //wait for services to be completed while (!achieve.isReady) { yield return(wait); } Debug.Log("retro active ready"); //wait for user slot UserSlotData usd = UserData.instance as UserSlotData; if (usd) { while (usd.slot == -1) { yield return(wait); } } //now for the checks Debug.Log("retro active check"); if (LevelController.IsLevelComplete("level_katgirl")) { achieve.NotifyUpdate(achieve.GetDataById(7041), 0, true); } if (LevelController.IsLevelComplete("level_lightninggirl")) { achieve.NotifyUpdate(achieve.GetDataById(7038), 0, true); } if (LevelController.IsLevelComplete("level_tankgirl")) { achieve.NotifyUpdate(achieve.GetDataById(7039), 0, true); } if (LevelController.IsLevelComplete("level_valleygirl")) { achieve.NotifyUpdate(achieve.GetDataById(7033), 0, true); } if (LevelController.IsLevelComplete("level_clonegirl")) { achieve.NotifyUpdate(achieve.GetDataById(7036), 0, true); } if (LevelController.IsLevelComplete("level_hipster")) { achieve.NotifyUpdate(achieve.GetDataById(7034), 0, true); } if (LevelController.IsLevelComplete("level_final_0")) { achieve.NotifyUpdate(achieve.GetDataById(7037), 0, true); } if (LevelController.IsLevelComplete("level_final_1")) { achieve.NotifyUpdate(achieve.GetDataById(7035), 0, true); } if (LevelController.IsLevelComplete("level_final_2")) { achieve.NotifyUpdate(achieve.GetDataById(7032), 0, true); } if (LevelController.IsLevelComplete("level_final_boss_boss")) { achieve.NotifyUpdate(achieve.GetDataById(7040), 0, true); if (SlotInfo.GetGameMode(usd.slot) == SlotInfo.GameMode.Hardcore) { achieve.NotifyUpdate(achieve.GetDataById(7049), 0, true); if (PlayerStats.deathCount < 1) { achieve.NotifyUpdate(achieve.GetDataById(7054), 0, true); } } } int heartFlags = SlotInfo.GetHeartFlags(usd.slot); int itemFlags = SlotInfo.GetItemsFlags(usd.slot); if (heartFlags == 255 && itemFlags == 31) { achieve.NotifyUpdate(achieve.GetDataById(7052), 0, true); } }
public void Fill(Achievement achievement) { Name.text = achievement.Name; Text.text = achievement.Text; ProgressText.text = achievement.ProgressText; }
public static void Name_is_not_empty(Achievement actual) => Assert.NotEmpty(actual.Name);
public static void OpenAchievementsAndGoto(Achievement achievement) { OpenAchievements(); Main.AchievementsMenu.GotoAchievement(achievement); }
public AchievementCompletedEventArgs(Achievement achievement) { Achievement = achievement; }
public Achievement JsonToAchievement(string json_string) { Achievement achievement = JsonMapper.ToObject <Achievement>(json_string); return(achievement); }