/// <summary> /// Creates guild and sets up events /// </summary> /// <param name="guild"></param> public ConfigChallengeHelper(IModHelper helper, ModConfig config, IMonitor monitor) { Helper = helper; Monitor = monitor; Config = config; ChallengeList = new List <SlayerChallenge>(); adventureGuild = new AdventureGuild(CustomAdventureGuild.StandardMapPath, CustomAdventureGuild.StandardMapName); customAdventureGuild = new CustomAdventureGuild(); if (ChallengeList == null || ChallengeList.Count == 0) { foreach (var info in config.Challenges) { ChallengeList.Add(new SlayerChallenge() { Info = info }); } } helper.Events.GameLoop.SaveCreated += SetupMonsterKilledEvent; helper.Events.GameLoop.SaveLoaded += SetupMonsterKilledEvent; helper.Events.GameLoop.Saving += PresaveData; helper.Events.GameLoop.Saved += InjectGuild; helper.Events.GameLoop.SaveLoaded += InjectGuild; helper.Events.GameLoop.SaveCreated += InjectGuild; MonsterKilled += Events_MonsterKilled; }
public void monsterKilled(string name) { if (this.specificMonstersKilled.ContainsKey(name)) { int num; if (!AdventureGuild.willThisKillCompleteAMonsterSlayerQuest(name)) { SerializableDictionary <string, int> expr_63 = this.specificMonstersKilled; num = expr_63[name]; expr_63[name] = num + 1; return; } Game1.showGlobalMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Stats.cs.5129", new object[0])); SerializableDictionary <string, int> expr_38 = this.specificMonstersKilled; num = expr_38[name]; expr_38[name] = num + 1; if (AdventureGuild.areAllMonsterSlayerQuestsComplete()) { Game1.getSteamAchievement("Achievement_KeeperOfTheMysticRings"); return; } } else { this.specificMonstersKilled.Add(name, 1); } }
public void monsterKilled(string name) { if (specificMonstersKilled.ContainsKey(name)) { if (AdventureGuild.willThisKillCompleteAMonsterSlayerQuest(name)) { specificMonstersKilled[name]++; Game1.player.hasCompletedAllMonsterSlayerQuests.Value = AdventureGuild.areAllMonsterSlayerQuestsComplete(); string localized_name2 = name; if (Game1.content.Load <Dictionary <string, string> >("Data\\Monsters").TryGetValue(name, out localized_name2)) { string[] split = localized_name2.Split('/'); localized_name2 = ((split.Length <= 14) ? name : split[14]); } else { localized_name2 = name; } Game1.showGlobalMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Stats.cs.5129")); Game1.multiplayer.globalChatInfoMessage("MonsterSlayer" + Game1.random.Next(4), Game1.player.Name, localized_name2); if (AdventureGuild.areAllMonsterSlayerQuestsComplete()) { Game1.getSteamAchievement("Achievement_KeeperOfTheMysticRings"); } } else { specificMonstersKilled[name]++; } } else { specificMonstersKilled.Add(name, 1); } }
/// <summary> /// Creates guild and sets up events /// </summary> /// <param name="guild"></param> public ConfigChallengeHelper(IModHelper helper, ModConfig config) { modHelper = helper; Config = config; ChallengeList = new List <SlayerChallenge>(); adventureGuild = new AdventureGuild(CustomAdventureGuild.StandardMapPath, CustomAdventureGuild.StandardMapName); customAdventureGuild = new CustomAdventureGuild(); if (ChallengeList == null || ChallengeList.Count == 0) { foreach (var info in config.Challenges) { ChallengeList.Add(new SlayerChallenge() { Info = info }); } } SaveEvents.AfterCreate += SetupMonsterKilledEvent; SaveEvents.AfterLoad += SetupMonsterKilledEvent; SaveEvents.BeforeSave += PresaveData; SaveEvents.AfterSave += InjectGuild; SaveEvents.AfterLoad += InjectGuild; SaveEvents.AfterCreate += InjectGuild; MonsterKilled += Events_MonsterKilled; }
/// <summary>Update known achievements and save them into config.</summary> private void SaveAwards() { SaveProfessions(); SaveStardrops(); SaveCraftingRecipes(); SaveCookingRecipes(); SaveExperience(); if (Helper.Reflection.GetMethod((Game1.getLocationFromName("Town") as Town), "checkJojaCompletePrerequisite").Invoke <Boolean>()) { Config.SetFlag("ccJoja", true); } if (Game1.player.hasCompletedCommunityCenter()) { Config.SetFlag("ccJunimo", true); } Config.SetFlagIfGreater("grandpaScore", ((Farm)Game1.getLocationFromName("Farm")).grandpaScore.Get()); Config.SetFlagIfGreater("money", Game1.player.Money); if (Game1.player.achievements.Contains(34)) { Config.SetFlag("fullShipment", true); } if (Game1.player.mailReceived.Contains("QiChallengeComplete")) { Config.SetFlag("QiChallengeComplete", true); } if (AdventureGuild.areAllMonsterSlayerQuestsComplete()) { Config.SetFlag("areAllMonsterSlayerQuestsComplete", true); } Helper.WriteConfig(Config); }
// Token: 0x06000701 RID: 1793 RVA: 0x000A5390 File Offset: 0x000A3590 public void monsterKilled(string name) { if (this.specificMonstersKilled.ContainsKey(name)) { int num; if (!AdventureGuild.willThisKillCompleteAMonsterSlayerQuest(name)) { SerializableDictionary <string, int> expr_53 = this.specificMonstersKilled; num = expr_53[name]; expr_53[name] = num + 1; return; } Game1.showGlobalMessage("Monster Slayer Goal Complete! See Gil for your reward."); SerializableDictionary <string, int> expr_28 = this.specificMonstersKilled; num = expr_28[name]; expr_28[name] = num + 1; if (AdventureGuild.areAllMonsterSlayerQuestsComplete()) { Game1.getSteamAchievement("Achievement_KeeperOfTheMysticRings"); return; } } else { this.specificMonstersKilled.Add(name, 1); } }
private void InitLocations() { if (Game1.locations == null) { throw new InvalidOperationException("Can't access Adventure Guild before the game is initialised."); } if (_adventureGuild == null) { _adventureGuild = new AdventureGuild(CustomAdventureGuild.StandardMapPath, CustomAdventureGuild.StandardMapName); _customAdventureGuild = new CustomAdventureGuild(); } }
public void checkForAchievements() { checkForCookingAchievements(); checkForCraftingAchievements(); checkForShippingAchievements(); checkForStarCropsAchievements(); checkForFishingAchievements(); checkForArchaeologyAchievements(); checkForMoneyAchievements(); checkForBuildingUpgradeAchievements(); checkForQuestAchievements(); checkForFriendshipAchievements(); Game1.player.hasCompletedAllMonsterSlayerQuests.Value = AdventureGuild.areAllMonsterSlayerQuestsComplete(); }
/********* ** Private methods *********/ /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> private void OnButtonPressed(object sender, ButtonPressedEventArgs e) { // Ignore if player hasn't loaded a save yet if (!Context.IsWorldReady) { return; } // Only opens a menu if the player isn't in an animation if (Game1.player.canMove) { if (e.Button == this.Config.CalendarKey) { Game1.activeClickableMenu = new Billboard(); return; } else if (e.Button == this.Config.RequestKey) { Game1.activeClickableMenu = new Billboard(true); return; } else if (e.Button == this.Config.MonsterEradicationKey) { AdventureGuild ag = new AdventureGuild(); ag.showMonsterKillList(); return; } else if (this.Config.CanAccessBin && e.Button == this.Config.BinKey) { // To open the shipping bin, a click is simulated on the bin on the farm Game1.getFarm().checkAction(new xTile.Dimensions.Location(71, 13), Game1.viewport, Game1.player); return; } } // Changes the bundles to allow deposits from anywhere when the menu is open if (this.Config.CanAccessBundles && Game1.activeClickableMenu is JunimoNoteMenu menu) { menu.bundles.ForEach( delegate(Bundle bundle) { bundle.depositsAllowed = true; } ); } }
public void monsterKilled(string name) { if (this.specificMonstersKilled.ContainsKey(name)) { if (AdventureGuild.willThisKillCompleteAMonsterSlayerQuest(name)) { Game1.showGlobalMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Stats.cs.5129")); SerializableDictionary <string, int> specificMonstersKilled = this.specificMonstersKilled; string str = name; string index1 = str; int num1 = specificMonstersKilled[index1]; string index2 = str; int num2 = num1 + 1; specificMonstersKilled[index2] = num2; if (!AdventureGuild.areAllMonsterSlayerQuestsComplete()) { return; } Game1.getSteamAchievement("Achievement_KeeperOfTheMysticRings"); } else { SerializableDictionary <string, int> specificMonstersKilled = this.specificMonstersKilled; string str = name; string index1 = str; int num1 = specificMonstersKilled[index1]; string index2 = str; int num2 = num1 + 1; specificMonstersKilled[index2] = num2; } } else { this.specificMonstersKilled.Add(name, 1); } }
public void monsterKilled(string name) { if (specificMonstersKilled.ContainsKey(name)) { if (AdventureGuild.willThisKillCompleteAMonsterSlayerQuest(name)) { Game1.showGlobalMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Stats.cs.5129")); Game1.multiplayer.globalChatInfoMessage("MonsterSlayer" + Game1.random.Next(4), Game1.player.Name, name); specificMonstersKilled[name]++; if (AdventureGuild.areAllMonsterSlayerQuestsComplete()) { Game1.getSteamAchievement("Achievement_KeeperOfTheMysticRings"); } } else { specificMonstersKilled[name]++; } } else { specificMonstersKilled.Add(name, 1); } }