public static void mineLevelChanged(object sender, WarpedEventArgs e) { if (e.NewLocation is MineShaft mine) { if (shouldUpdateAugment(e)) { if (TwitchIntergration.isConnected()) { if (!TwitchIntergration.hasMinePollStarted) { TwitchIntergration.StartMinePoll(getRandomBuff(3)); } } else { AugmentOption aug = getRandomBuff(1)[0]; CurrentAugment = aug.id; Game1.addHUDMessage(new HUDMessage(aug.DisplayName + ": " + aug.desc, null)); } } if (CurrentAugment != null) { UpdateLocation(e); } } }
public void PickAugment(AugmentOption optionPicked) { // resolve augment and close menu optionPicked.UpgradeMultipliers(); playerCharacterSettings.augmentsPicked[mapIndex] = optionPicked; Time.timeScale = 1; gameObject.SetActive(false); }
public static AugmentOption[] getRandomBuff(int count) { List<AugmentOption> list = Enumerable.ToList(Augments.Values); List<AugmentOption> returnList = new List<AugmentOption>(); while (returnList.Count < 3) { int num = Game1.random.Next(list.Count); AugmentOption item = list[num]; if (item != null && !returnList.Contains(item)) returnList.Add(item); } return returnList.ToArray(); }
public void SetupAugmentMenuItem(AugmentOption augment, AugmentMenu menu) { targetAugment = augment; buttonDescription.text = augment.augmentDescription; augmentMenu = menu; }