public override void EnterBonus() { base.EnterBonus(); Market.Instance.Seeds++; AchievementsController.AddToAchievement(AchievementsController.Type.JacobAndTheBeanstalk, 1); GameController.Instance.SeedsCollectedOnLevel++; }
public override void EnterBonus() { base.EnterBonus(); Market.Instance.Ruby++; AchievementsController.AddToAchievement(AchievementsController.Type.RubyRubyRubyRuby, 1); GameController.Instance.RubiesCollectedOnLevel++; }
private void AdeptAchievement() { string lastEnter = m_DateManager.GetPlayerDate("AdeptAchievement"); if (lastEnter != "") { int days = m_DateManager.HowTimePassed(lastEnter, DateManager.DateType.day); if (days == 1) { m_DateManager.SetDate("AdeptAchievement", m_DateManager.GetCurrentDateString()); AchievementsController.AddToAchievement(AchievementsController.Type.Adept, 1); } else if (days > 1) { m_DateManager.SetDate("AdeptAchievement", m_DateManager.GetCurrentDateString()); AchievementsController.DiscardAchievement(AchievementsController.Type.Adept); AchievementsController.AddToAchievement(AchievementsController.Type.Adept, 1); } } else { m_DateManager.SetDate("AdeptAchievement", m_DateManager.GetCurrentDateString()); AchievementsController.AddToAchievement(AchievementsController.Type.Adept, 1); } }
public override void EnterBonus() { base.EnterBonus(); GameController.Instance.BombsCollectedOnLevel++; Market.Instance.Bomb++; AchievementsController.AddToAchievement(AchievementsController.Type.ExplosiveBehavior, 1); }
private void CheckLeveledAchievements() { AchievementsController.DiscardAchievement(AchievementsController.Type.SelfDestructive); AchievementsController.AddToAchievement(AchievementsController.Type.Survivor, 1); if (GameController.Instance.LevelsData[GameController.Instance.CurrentLevel].diamondsCollected == GameController.Instance.DiamondsOnLevel) { if (GameController.Instance.AchievementRevards.Achievements[(int)AchievementsController.Type.GoodStart].m_NeedToAchieve[0] == GameController.Instance.CurrentLevel) { AchievementsController.AddToAchievement(AchievementsController.Type.GoodStart, GameController.Instance.CurrentLevel); AchievementsController.AddToAchievement(AchievementsController.Type.GoodStart, 1); } if (GameController.Instance.AchievementRevards.Achievements[(int)AchievementsController.Type.RockyRoad].m_NeedToAchieve[0] == GameController.Instance.CurrentLevel) { AchievementsController.AddToAchievement(AchievementsController.Type.RockyRoad, GameController.Instance.CurrentLevel); } if (GameController.Instance.AchievementRevards.Achievements[(int)AchievementsController.Type.DoingGreyt].m_NeedToAchieve[0] == GameController.Instance.CurrentLevel) { AchievementsController.AddToAchievement(AchievementsController.Type.DoingGreyt, GameController.Instance.CurrentLevel); } if (GameController.Instance.AchievementRevards.Achievements[(int)AchievementsController.Type.LetItBee].m_NeedToAchieve[0] == GameController.Instance.CurrentLevel) { AchievementsController.AddToAchievement(AchievementsController.Type.LetItBee, GameController.Instance.CurrentLevel); } if (GameController.Instance.AchievementRevards.Achievements[(int)AchievementsController.Type.CameToTheDarkSide].m_NeedToAchieve[0] == GameController.Instance.CurrentLevel) { AchievementsController.AddToAchievement(AchievementsController.Type.CameToTheDarkSide, GameController.Instance.CurrentLevel); } } }
private void SetReward(int indexInResource) { int[] needToAchieve = GameController.Instance.AchievementRevards.Achievements[indexInResource].m_NeedToAchieve; int currentValue = AchievementsController.GetAchievement(GetType(indexInResource)); string rewardString = "+"; for (int i = 0; i < achievements[indexInResource].m_LeveledRevards.Length; i++) { if (i > 0) { rewardString += "/"; } string leveledRew = achievements[indexInResource].m_LeveledRevards[i].ToString(); if (currentValue >= needToAchieve[i]) { leveledRew = "<color=#b73535ff>" + leveledRew + "</color>"; } rewardString += leveledRew; } m_Reward.text = rewardString; m_RewardImage.sprite = GameController.Instance.AchievementRevards.RewardSprites[(int)achievements[indexInResource].m_RevardType]; }
private void Awake() { if (instance == null) { instance = this; } }
async Task UpdateUserAchievements(User user) { AchievementsController achievementsController = AchievementsController.GetInstance(); if (achievementsController == null) { return; } List <Achievement> achievements = await DBUserAchievements.GetUserAchievements(user.id); achievements.ForEach(a => { AchievementObject achievement = achievementsController.achievements.Find(achievement => a.id == achievement.id); if (achievement.title != a.title) { achievement.title = a.title; } if (achievement.description != a.description) { achievement.title = a.title; } if (achievement.received != a.received) { achievement.received = a.received; } if (achievement.receiveDate != a.receiveDate) { achievement.receiveDate = a.receiveDate; } }); }
void OnTriggerEnter2D(Collider2D other) { var player = other.gameObject.GetComponent <PlayerBehaviour>(); if (player) { if (m_VictoryObj.OnBonusLevel) { m_VictoryObj.SetWin(); } else { player.enabled = false; if (needRunAdsPanel && player.IsPlayerFall) { StartCoroutine("RunAdsPanel"); } else { AchievementsController.AddToAchievement(AchievementsController.Type.SelfDestructive, 1); AchievementsController.DiscardAchievement(AchievementsController.Type.Survivor); StartCoroutine("StopGame"); } } } }
public void OpenPage(string url) { AchievementsController.AddToAchievement(AchievementsController.Type.BeOurGuest, 1); if (url != "") { Application.OpenURL(url); } }
public void GrabAfterFall() { hitObject = grabObject; isPlayerFall = false; rig2D.bodyType = RigidbodyType2D.Static; animController.SetFall(isPlayerFall); AchievementsController.AddToAchievement(AchievementsController.Type.Catchy, 1); LerpCoroutine = StartCoroutine("Lerp"); }
IEnumerator Lerp() { if (onPlatformAfterFall) { yield return(new WaitForSeconds(.3f)); } transform.parent = hitObject.transform; if (LevelGenerator.Instance.IsRunLevel == false) { LevelGenerator.Instance.StartLevel(); } var boxColl = GetComponent <BoxCollider2D>().enabled; boxColl = false; Vector2 _from = transform.localPosition; Vector2 _to = Vector3.zero; float _t = 0f; while (_t < 1) { _t += Time.deltaTime * m_SpeedMultiplayer; transform.localPosition = Vector2.Lerp(_from, _to, _t); //перемещаем тело в позицию объекта, на который нажали yield return(null); } if (hitJumpPoint && hitJumpPoint.IsSeed && Market.Instance.Seeds > 0) { Market.Instance.Seeds--; } onPlatformAfterFall = true; if (hitJumpPoint) { idLine = hitJumpPoint.Line; } AchievementsController.AddToAchievement(AchievementsController.Type.GotHigh, 1); if (PlayerChangeLine != null) { PlayerChangeLine.Invoke(idLine); } if (hitJumpPoint) { idCollumn = hitJumpPoint.Collumn; } LerpCoroutine = null; boxColl = true; grabObject = transform.parent.gameObject; LevelGenerator.Instance.SpeedPusher = speedPusher; }
// Token: 0x0600051A RID: 1306 public void OnMenuItemPressed() { if (this.CurrentSkillItem == null) { return; } if (this.CurrentSkillItem.HasSkillItem) { if (this.OnAlreadyEarnedAbility) { this.RequirementsLineAShake.Restart(); this.OnAlreadyEarnedAbility.Perform(null); } return; } if (this.CurrentSkillItem.CanEarnSkill) { this.CurrentSkillItem.HasSkillItem = true; Characters.Sein.PlayerAbilities.SetAbility(this.CurrentSkillItem.Ability, true); Characters.Sein.PlayerAbilities.GainAbilityAction = this.CurrentSkillItem.GainSkillSequence; InstantiateUtility.Instantiate(this.GainSkillEffect, this.CurrentSkillItem.transform.position, Quaternion.identity); RandomizerBonus.SpentAP(this.CurrentSkillItem.ActualRequiredSkillPoints); BingoController.OnGainAbility(this.CurrentSkillItem.Ability); Characters.Sein.Level.SkillPoints -= this.CurrentSkillItem.ActualRequiredSkillPoints; if (this.OnGainAbility) { this.OnGainAbility.Perform(null); } SeinLevel.HasSpentSkillPoint = true; AchievementsController.AwardAchievement(this.SpentFirstSkillPointAchievement); GameController.Instance.CreateCheckpoint(); RandomizerStatsManager.OnSave(false); GameController.Instance.SaveGameController.PerformSave(); this.UpdateRequirementsText(); return; } if (!this.CurrentSkillItem.SoulRequirementMet) { if (this.CurrentSkillItem.RequiresAbilitiesOrItems) { this.RequirementsLineAShake.Restart(); } else { this.RequirementsLineAShake.Restart(); } } if (!this.CurrentSkillItem.AbilitiesRequirementMet) { this.RequirementsLineAShake.Restart(); } if (this.OnCantEarnSkill) { this.OnCantEarnSkill.Perform(null); } }
void Start() { view = HudView.instance; view.UpdateFire(currentFire); PlayerParticleHandler.instance.onFireExtinct += IncreaseFire; PlayerDistanceController.instance.onIncreaseDistance += IncreaseDistance; ReloadHandler.instance.onClickRetry += ResetCounters; AchievementsController inst = AchievementsController.instance; inst.onReachAchievement += OnReachAchievement; }
public void Receive() { AchievementsController achievementsController = AchievementsController.GetInstance(); if (achievement == null || achievementsController == null) { return; } achievementsController.Receive(achievement); }
public void Action() { Animator anim = GetComponent <Animator>(); anim.SetBool("Use", true); Market.Instance.Bomb -= 1; AchievementsController.AddToAchievement(AchievementsController.Type.BigBang, 1); Destroy(this.gameObject, 1f); } //действие колетблза
void MakeSingleton() { if (instance != null) { Destroy(gameObject); } else { instance = this; DontDestroyOnLoad(gameObject); } }
public void GetAchievements() { // Arrange var controller = new AchievementsController(); // Act var achievements = controller.GetAchievements().ToList(); // Assert Assert.IsNotNull(achievements); achievements.ForEach(x => Console.WriteLine("{0}", x.Title)); }
public void SetFailGame() { AchievementsController.AddToAchievement(AchievementsController.Type.SelfDestructive, 1); AchievementsController.DiscardAchievement(AchievementsController.Type.Survivor); if (LevelAchievementPanel) { LevelAchievementPanel.ShowBonusPanel(false); } else { GameController.Instance.FailGame(); } }
public override void EnterBonus() { base.EnterBonus(); Market.Instance.Dimond++; AchievementsController.AddToAchievement(AchievementsController.Type.EverybodysBestFriend, 1); GameController.Instance.DiamondsCollectedOnLevel++; GameController.Instance.LevelsData[GameController.Instance.CurrentLevel].diamondsCollected++; if (LevelDiamondKeeper.Instance != null) { LevelDiamondKeeper.Instance.SetCollected(this); } }
protected virtual int GetAchievementLevel(int indexInResource) { int[] needToAchieve = GameController.Instance.AchievementRevards.Achievements[indexInResource].m_NeedToAchieve; int currentValue = AchievementsController.GetAchievement(GetType(indexInResource)); int level = -1; //locked for (int i = (needToAchieve.Length - 1); i >= 0; i--) { if (currentValue >= needToAchieve[i]) { return(i); } } return(level); }
public void Awake() { gameManager = GameManager.Instance; sequenceDetector = SequenceDetector.Instance; achievementsController = AchievementsController.Instance; GameManager.RunningStateChanged += OnRunningStateChanged; GameManager.ToggleMute += UpdateMuteButtons; SetAchievementsOpen(false); UpdateMuteButtons(gameManager.IsMuted); overlay.SetActive(false); sensitivitySlider.GetComponent <Slider>().value = SequenceDetector.INITIAL_SENSITIVITY; SetMicSensitivity(SequenceDetector.INITIAL_SENSITIVITY); }
public void StartLevel() { if (Market.Instance.Health > 0)//если есть жизни, то можно играть { isRunLevel = true; Market.Instance.Health--; //отнимаем одну использованную жизнь, т.к. запустили левел int playLevelTimes = ++GameController.Instance.LevelsData[GameController.Instance.CurrentLevel].playLevelTimes; int neverGiveUpVal; if ((neverGiveUpVal = AchievementsController.GetAchievement(AchievementsController.Type.NeverGiveUp)) < playLevelTimes) { AchievementsController.AddToAchievement(AchievementsController.Type.NeverGiveUp, playLevelTimes - neverGiveUpVal); } if (Market.Instance.Health == 0) { AchievementsController.AddToAchievement(AchievementsController.Type.HeartBreaker, 1); } StartCoroutine("GeneratorLines"); } }
private void SetProgress(int indexInResource) { int[] needToAchieve = GameController.Instance.AchievementRevards.Achievements[indexInResource].m_NeedToAchieve; int currentValue = AchievementsController.GetAchievement(GetType(indexInResource)); int level = GetAchievementLevel(indexInResource); string progressString = currentValue.ToString() + "/"; if (level < (needToAchieve.Length - 1)) { progressString += "<color=#b73535ff>" + needToAchieve[level + 1].ToString() + "</color>"; } else if (level == (needToAchieve.Length - 1)) { progressString += "<color=#b73535ff>" + needToAchieve[needToAchieve.Length - 1].ToString() + "</color>"; } m_Progress.text = progressString; }
// Init the classes and the differents gameObjects private void Start() { Debug.Log("Entramos en controlador Partida"); menuPausa = GameObject.Find("Canvas"); UIController = this.GetComponentInParent <controladorMenus>(); //controladorMenus.menuIniciDeDia(dia_actual); feedbackGenerator = new FeedbackGenerator(); orderGenerator = new ComandaContChef(); cardinalitatyController = new ControlCardinalitats(); achievementsController = new AchievementsController(); subject.AddObserver(achievementsController); this.userControl = GameObject.Find("UserControl").GetComponent <UserController>(); this.lettuceGenerator = GameObject.Find("lettuce_generator"); this.lettuceGenerator.SetActive(false); this.actualDay = this.userControl.getCurrentDay(); this.totalExp = this.userControl.getTotalExp(); GameObject.Find("MusicController").GetComponent <musicController>().setVolume(this.userControl.getVolume()); }
// Token: 0x06001382 RID: 4994 private void CastSoulFlame() { if (this.ChargingSound) { this.ChargingSound.StopAndFadeOut(0.1f); } this.m_sein.Energy.Spend(this.SoulFlameCost); this.m_cooldownRemaining = 1f; this.m_holdDownTime = 0f; if (this.m_sein.PlayerAbilities.Regroup.HasAbility) { this.m_sein.Mortality.Health.GainHealth(4); } if (this.m_sein.PlayerAbilities.UltraSoulFlame.HasAbility) { this.m_sein.Mortality.Health.GainHealth(4); } this.m_sceneCheckpoint = new MoonGuid(Scenes.Manager.CurrentScene.SceneMoonGuid); if (this.m_checkpointMarkerGameObject) { this.m_checkpointMarkerGameObject.GetComponent <SoulFlame>().Disappear(); } this.SpawnSoulFlame(Characters.Sein.Position); RandomizerBonusSkill.LastSoulLink = Characters.Sein.Position; RandomizerStatsManager.OnSave(); SeinSoulFlame.OnSoulFlameCast(); SaveSlotBackupsManager.CreateCurrentBackup(); GameController.Instance.CreateCheckpoint(); GameController.Instance.SaveGameController.PerformSave(); this.m_numberOfSoulFlamesCast++; if (this.m_numberOfSoulFlamesCast == 50) { AchievementsController.AwardAchievement(AchievementsLogic.Instance.SoulLinkManyTimesAchievementAsset); } if (this.CheckpointSequence) { this.CheckpointSequence.Perform(null); } }
public void PostAchievements() { var controller = new AchievementsController(); //create 5 achievements for (int i = 0; i < 5; i++) { Achievement achievement = new Achievement(); achievement.DateCreated = DateTime.Now; achievement.Description = String.Format("This is my {0} achievement", i); achievement.Title = String.Format("Awesome Achievement #{0}", i); achievement.UserEmail = "*****@*****.**"; achievement.UserId = 1; var result = controller.PostAchievement(achievement); var createdResult = result as CreatedAtRouteNegotiatedContentResult <Achievement>; // Assert Assert.IsNotNull(createdResult); Assert.AreEqual("DefaultApi", createdResult.RouteName); Assert.IsNotNull(createdResult.RouteValues["id"]); Console.WriteLine(createdResult.RouteValues["id"]); } }
// Token: 0x060000C7 RID: 199 public void DealDamage() { Vector3 position = base.transform.position; IAttackable[] array = Targets.Attackables.ToArray(); for (int i = 0; i < array.Length; i++) { IAttackable attackable = array[i]; if (!InstantiateUtility.IsDestroyed(attackable as Component) && !this.m_damageAttackables.Contains(attackable) && attackable.CanBeChargeFlamed()) { Vector3 position2 = attackable.Position; Vector3 vector = position2 - position; if (vector.magnitude <= this.BurstRadius) { this.m_damageAttackables.Add(attackable); GameObject gameObject = ((Component)attackable).gameObject; new Damage(RandomizerBonus.ExplosionPower() ? (this.DamageAmount * 2f) : this.DamageAmount, vector.normalized * 3f, position, DamageType.ChargeFlame, base.gameObject).DealToComponents(gameObject); bool expr_D8 = attackable.IsDead(); if (!expr_D8) { GameObject expr_F2 = (GameObject)InstantiateUtility.Instantiate(this.BurstImpactEffectPrefab, position2, Quaternion.identity); expr_F2.transform.eulerAngles = new Vector3(0f, 0f, MoonMath.Angle.AngleFromVector(vector.normalized)); expr_F2.GetComponent <FollowPositionRotation>().SetTarget(gameObject.transform); } if (expr_D8 && attackable is IChargeFlameAttackable && ((IChargeFlameAttackable)attackable).CountsTowardsPowerOfLightAchievement()) { this.m_simultaneousEnemies++; } } } } if (this.m_simultaneousEnemies >= 4) { AchievementsController.AwardAchievement(Characters.Sein.Abilities.ChargeFlame.KillEnemiesSimultaneouslyAchievement); } this.m_waitDelay = 0.1f; }
// Inicializamos todas las clases y los diferentes gameobjects que tengamos. private void Start() { menuPausa = GameObject.Find("Canvas"); UIController = this.GetComponentInParent <ControllerMenuTutorial>(); //controladorMenus.menuIniciDeDia(dia_actual); feedbackGenerator = new FeedbackGenerator(); orderGenerator = new ComandaContChef(); controlCardinalities = new ControlCardinalitats(); soundControl = GameObject.Find("ControllerSonidos").GetComponent <ControllerSonidos>(); achievementsController = new AchievementsController(); subject.AddObserver(achievementsController); this.userControl = GameObject.Find("UserControl").GetComponent <UserController>(); this.lettuceGenerator = GameObject.Find("lettuce_generator"); this.lettuceGenerator.SetActive(false); this.actualDay = this.userControl.getCurrentDay(); this.totalExp = this.userControl.getTotalExp(); this.isNextStateBlocked = false; this.isGeneratoringGrabbed = false; this.controlCardinalities.generateCardinalities(); }
void Start() { achievementsC = FindObjectOfType(typeof(AchievementsController)) as AchievementsController; }