public void giveUp() { giveUpButton.gameObject.SetActive(false); progress.gameObject.SetActive(false); statusNO.gameObject.SetActive(true); ChallengeManager.setActiveChallenge(null); }
protected void Page_Load(object sender, EventArgs e) { Page.MaintainScrollPositionOnPostBack = true; if (!this.IsPostBack) { List <S_Competition> competitions = CompetitionManager.GetRunningCompetitions(true); ListItem item = new ListItem(); item.Value = "0"; item.Text = "-- Selecteer een competitie --"; compCompetitie.Items.Add(item); foreach (S_Competition competition in competitions) { S_Challenge challenge = ChallengeManager.GetChallenge(competition.challengeid); item = new ListItem(); item.Value = competition.id.ToString(); item.Text = Conversion.DateToTitle(competition.startdate, competition.enddate) + " : " + challenge.name; compCompetitie.Items.Add(item); } bool auth = Convert.ToBoolean(Session["auth"]); if (auth) { long id = Convert.ToInt64(Session["uid"]); S_User user = UserManager.GetUserById(id); compFrequentBowlerNaam.Text = user.username; compFrequentBowlerNummer.Text = user.frequentbowlernumber.ToString(); } } }
public static string GetChallengeLeaderboardName(string level_name, bool submode, int difficulty_level) { #if UNITY_XBOXONE // Fix up level name to match Xbox One back end string first = level_name.ToUpper().Replace("TRINOMULAR", "TRIGONOMALUS").Replace(GameplayManager.CMCombinedLeaderboardNames[0], "COMBINED"); first = first[0] + first.Substring(1).ToLower(); // Difficulty (Insane+ converted to InsanePlus) string second = MenuManager.GetDifficultyLevelName(difficulty_level, true).ToLower(); second = (char.ToUpper(second[0]) + second.Substring(1)).Replace("+", "Plus"); // Mode string third = submode ? "Countdown" : "Infinite"; return(first + second + third + "Leaderboard"); #else string id = "challenge"; string diff_name = MenuManager.GetDifficultyLevelName(difficulty_level, true).ToLower(); #if UNITY_PS4 char separator = ':'; #else char separator = (CloudProvider == CloudProviders.Galaxy) ? '_' : ':'; if (CloudProvider == CloudProviders.Galaxy) { diff_name = diff_name.Replace('+', 'P'); } else if (CloudProvider == CloudProviders.Steam) { id = "challenge3"; } #endif return(id + separator + ChallengeManager.GetChallengeSubModeName(submode, true) + separator + difficulty_level.ToString() + diff_name + separator + level_name); #endif }
public ActionResult Competition(long id) { S_Challenge challenge = ChallengeManager.GetChallenge(id); ObservableCollection <CompetitionGridModel> competitionModelList = new ObservableCollection <CompetitionGridModel>(); List <S_Competition> competitionList; competitionList = CompetitionManager.GetCompetitionsByChallengeId(id); foreach (S_Competition competition in competitionList) { CompetitionGridModel cgm = new CompetitionGridModel(); cgm.Id = competition.id; cgm.challenge = challenge.name; cgm.challengeId = id; cgm.description = competition.description; cgm.EndDate = competition.enddate; cgm.Id = competition.id; cgm.price = competition.price; cgm.StartDate = competition.startdate; competitionModelList.Add(cgm); } ViewBag.challengeid = id; return(View(competitionModelList)); }
// establece la funcion a la que llamara el timer al acabarse el tiempo del reto // y la funcion a la que se llamara cuando se vea el anuncio para duplicar la recompensa obtenida private void Awake() { instance = this; timerComponent_ = gameObject.GetComponent <Timer>(); timerComponent_.SetMethod(GameOver); rewardedAdsComp.SetRewardMethod(DuplicateMoney); }
public void destroy() { int index = 0; foreach (EatableObject eO in GameManager.getCurrentLevel().getObjects()) { if (eO.getId() == id) { break; } index++; } GameManager.getCurrentLevel().getObjects().RemoveAt(index); index = 0; foreach (EatableObject eO in room.objects) { if (eO.getId() == id) { break; } index++; } room.objects.RemoveAt(index); ChallengeManager.objectDestroyed(this); Destroy(gameObject); }
void Destroy() { _stage = null; _challengeManager = null; _loadScene = null; _gameControl = null; }
private Coroutine currentCoroutine; // 현재 코루틴 // 초기화 private void Awake() { if (instance == null) { instance = this; } }
public void UpdateChallengePreview() { Vector2 indexes = LevelParser.GetLevelPackLevelIndexes(LevelLoader.GetLevelName()); ChallengeLog challengeLog = ChallengeManager.GetCurrentChallengeLog((int)indexes.x, (int)indexes.y); challengePreview.SetLevelChallengePreview(challengeLog, LevelLoader.GetLevelName()); }
void CheckOpponent() { UserManager um = new UserManager(); string token = um.getCurrentSessionToken(); string userID = um.getCurrentUserId(); ChallengeManager cm = new ChallengeManager(); UnityThreadHelper.CreateThread(() => { var N = cm.getChallengebyId(ChallengeManager.CurrentChallengeId, token); UnityThreadHelper.Dispatcher.Dispatch(() => { if (!string.IsNullOrEmpty(N["data"]["matched_user_1"]["_id"].Value) && !string.IsNullOrEmpty(N["data"]["matched_user_2"]["_id"].Value)) { if (N["data"]["matched_user_1"]["_id"].Value.Equals(userID)) { OpponentFound.adversaireName = N["data"]["matched_user_2"]["username"]; OpponentFound.Avatar = N["data"]["matched_user_2"]["avatar"]; OpponentFound.AdvCountryCode = N["data"]["matched_user_2"]["country_code"]; } else { OpponentFound.adversaireName = N["data"]["matched_user_1"]["username"]; OpponentFound.Avatar = N["data"]["matched_user_1"]["avatar"]; OpponentFound.AdvCountryCode = N["data"]["matched_user_1"]["country_code"]; } EventsController.advFound = true; } }); }); }
public static void newScore(SeedListener.PlantSeeds plant, int addScore) { switch (plant) { case SeedListener.PlantSeeds.Beet: BeetScore += addScore; break; case SeedListener.PlantSeeds.Cabbage: CabbageScore += addScore; break; case SeedListener.PlantSeeds.Tomato: TomatoScore += addScore; break; default: unknownPlantScore += addScore; break; } displayScore(); //wenn nicht alle max auf 0 sind und alle scores erreicht sind if (!(BeetMaxScore == 0 & TomatoMaxScore == 0 & CabbageMaxScore == 0) & (BeetScore >= BeetMaxScore & TomatoScore >= TomatoMaxScore & CabbageScore >= CabbageMaxScore)) { ChallengeManager.challengeAccomplished(); } }
public void activate() { ChallengeManager.setActiveChallenge(challenge); /* if (challenge.getModel() == GenericChallenge.Model.TimeDestruction || challenge.getModel() == GenericChallenge.Model.TimeSurvive) * StartCoroutine(timerCoroutine);*/ }
private void Awake() { disconnectPanel = GameObject.Find("DisconnectPanel"); challengeManagerScript = GameObject.Find("ChallengeManager").GetComponent <ChallengeManager>(); eventManager = GameObject.Find("EventManager").GetComponent <EventManager>(); playerWallLabel = GameObject.Find("PlayerWallLabel").GetComponent <TMPro.TextMeshProUGUI>(); opponentWallLabel = GameObject.Find("OpponentWallLabel").GetComponent <TMPro.TextMeshProUGUI>(); playerTurnBoxAnimator = GameObject.Find("PlayerTurnBox").GetComponent <Animator>(); redLight = GameObject.Find("RedLight"); redLight.SetActive(false); greenLight = GameObject.Find("GreenLight"); initAnimatorQueues(); eventManager.ListenToInvalidMove(SwitchTurnIndicatorToInvalidMove); eventManager.ListenToDisconnectAIEasy(SwitchToSingleplayer); eventManager.ListenToDisconnectAIHard(SwitchToSingleplayer); if (GameSession.GameMode == GameModeEnum.SINGLE_PLAYER) { eventManager.ListenToLocalPlayerMoved(GenerateMoveForAI); } else if (GameSession.GameMode == GameModeEnum.MULTIPLAYER) { //eventManager.ListenToLocalPlayerMoved(); } }
private void buildCompetitions(S_User user) { List <S_Competition> competitions = CompetitionManager.GetCompetitionsByPlayer(user.id); _competitions = "<div class='col-lg-8 col-lg-offset-2'>"; _competitions += " <h2>Jouw Competities</h2>"; if (competitions.Count() > 0) { foreach (S_Competition competition in competitions) { S_Challenge challenge = ChallengeManager.GetChallenge(competition.challengeid); List <S_CompetitonBowlingcenter> competitonBowlingcenters = CompetitionManager.GetBowlingcentersByCompetition(competition.id); _competitions += " <h3>" + challenge.name + "</h3>"; _competitions += " <p> Van " + competition.startdate.ToString("dd-MM-yyyy") + " tot " + competition.enddate.ToString("dd-MM-yyyy") + " bij de volgende bowlingcentra: "; foreach (S_CompetitonBowlingcenter competitonBowlingcenter in competitonBowlingcenters) { S_BowlingCenter bowlingCenter = BowlingCenterManager.GetBowlingCenterById(competitonBowlingcenter.bowlingcenterid); _competitions += "<br/><br/>" + bowlingCenter.name; } _competitions += "</p>"; } } else { _competitions += " <p>Je doet nog niet mee aan een competitie</p>"; } _competitions += "</div>"; }
public void GetChallenges() { var challengeAssemblies = new Assembly[] { this.GetType().Assembly }; var challengeMgr = new ChallengeManager(challengeAssemblies); var challenges = challengeMgr.GetChallenges(); Assert.IsTrue(challenges.Contains(typeof(MyFakeChallenge).Name)); }
private void CheckConnection() { challengeManager = GameObject.Find("ChallengeManager").GetComponent <ChallengeManager>(); LogChallengeEventRequest_CheckConnection checkConnectionRequest = new LogChallengeEventRequest_CheckConnection(); checkConnectionRequest.SetChallengeInstanceId(challengeManager.ChallengeID); checkConnectionRequest.Send(CheckConnectionResponse); }
public override void SetupChallenegeRuntime(ChallengeManager challengeManager) { Challenge_KillEnemiesWithWeaponTypeRuntime runtime = challengeManager.gameObject.AddComponent <Challenge_KillEnemiesWithWeaponTypeRuntime>(); runtime.challengeData = this; challengeManager.activeChalleneges.Add(runtime); runtime.Init(); }
private void OnDestroy() { //SetAllActive(); TeamChatMessage.Listener -= TeamChatMessageRouter; ScriptMessage_JoinFriendTeam.Listener -= JoinFriendTeam; gameSparksUserIDScript = null; challengeManager = null; }
public void StartInit() { _myTransform = GetComponent <RectTransform>(); _stage = GameObject.FindObjectOfType <CanvasStage>(); _gameControl = GameControl.instance; _challengeManager = GameObject.FindObjectOfType <ChallengeManager>(); _loadScene = GameObject.FindObjectOfType <LoadScene>(); }
public void setStatus(Status status) { this.status = status; if (status == Status.Completed) { ChallengeManager.challengeCompleted(); GameManager.getCurrentLevel().dropBooster(boosterReward); } }
/// <summary> /// Spawns a primary at random. /// </summary> public static void SpawnPrimary() { var max = GetMaxPrimaries(); // Do not spawn a primary if we're at or above max. var totalActive = Budget.Sum(b => b.Active); if (totalActive >= max) { return; } // Filter out lancer if we shouldn't spawn it. var spawnLancer = SpawnLancer(); var filteredBudget = Budget.Where(b => b.Type != WeaponType.LANCER || spawnLancer); // Get the total budget and the total remaining. var totalBudget = filteredBudget.Sum(b => b.Budget); var totalRemaining = filteredBudget.Sum(b => b.Remaining); // Pick a random number from 0 to totalRemaining. var random = UnityEngine.Random.Range(0f, totalRemaining); // Loop through the budget and pick out one random weapon from the budget. var current = 0f; PrimaryBudget spawn = null; foreach (var weapon in filteredBudget) { current += weapon.Remaining; if (random <= current) { spawn = weapon; break; } } // If we didn't find anything to spawn, bail! Can happen if all of the level's primaries are disallowed on the server. if (spawn == null) { return; } // Spawn the weapon. ItemPrefab item = ChallengeManager.WeaponTypeToPrefab(spawn.Type); // NetworkMatch.SpawnItem(item, false); AccessTools.Method(typeof(NetworkMatch), "SpawnItem").Invoke(null, new object[] { item, false }); // Increment the active count and decrement remaining budget accordingly. spawn.Active++; spawn.Remaining = Mathf.Max(0f, spawn.Remaining - max / totalBudget); // Reset weapon spawn timer. SpawnWeaponTimer = UnityEngine.Random.Range(30f / max, 60f / max); }
public ActionResult Insert(long id) { S_Challenge s = ChallengeManager.GetChallenge(id); CompetitionModel m = new CompetitionModel(); m.challengeId = id; m.challenge = s.name; return(View(m)); }
public static bool Prefix(ref int[] ___m_spawn_weapon_count) { // Setup the primary budget. MPPrimaries.Budget.Clear(); foreach (var weapon in RobotManager.m_multiplayer_spawnable_weapons) { var weaponType = (WeaponType)weapon.type; if (NetworkMatch.IsWeaponAllowed(weaponType)) { MPPrimaries.Budget.Add(new PrimaryBudget { Type = weaponType, Budget = weapon.percent, Remaining = weapon.percent, Active = 0 }); } Debug.Log($"MPPrimaries - Added {weaponType}, budget {weapon.percent}"); } // Spawn in initial primaries. var primaries = MPPrimaries.GetMaxPrimaries(); for (int i = 0; i < primaries; i++) { MPPrimaries.SpawnPrimary(); } // This is the rest of the PowerupLevelStart code, currently unmodified. var num = RobotManager.m_multi_missile_count; for (int n = 0; n < num; n++) { MissileType missileType = NetworkMatch.RandomAllowedMissileSpawn(); if (missileType != MissileType.NUM) { ItemPrefab item2 = ChallengeManager.MissileTypeToPrefab(missileType); // NetworkMatch.SpawnItem(item2, false); AccessTools.Method(typeof(NetworkMatch), "SpawnItem").Invoke(null, new object[] { item2, false }); } } NetworkMatch.SetSpawnMissileTimer(); NetworkMatch.SetSpawnSuperTimer(); NetworkMatch.SetSpawnBasicTimer(); // Get rid of weapon counts so they aren't triggered by the original function. for (var i = 0; i < 8; i++) { ___m_spawn_weapon_count[i] = 0; } // Short circuit the original code. return(false); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
private void Awake() { if (instance == null) { instance = this; } else if (instance != null && instance != this) { DestroyImmediate(this); } }
public void SetChallengeObjects() { ChallengeManager challengeManager = GameObject.Find("Manager(Clone)").GetComponent <ChallengeManager>(); for (int i = 0; i < challengeObject.Length; i++) { if (challengeManager.completedChallenges[i] == true) { challengeObject[i].SetActive(false); } challengeText[i].text = challengeManager.challengeDesc[challengeManager.challengeID[i]]; } }
void Awake() { if (sharedManager == null) { sharedManager = this; } else if (sharedManager != this) { Destroy(gameObject); return; } Debug.Log("challenge manager awake"); }
// Start is called before the first frame update void Start() { gamemanager = FindObjectOfType <GameManager>(); paladinShieldMaxTime = gamemanager.SkillTree["enemypaladin"]; assassinMultiplierSkill = gamemanager.SkillTree["enemyassassin"]; succubusHealPercent = gamemanager.SkillTree["enemysuccubus"]; monkSlowPercent = gamemanager.SkillTree["enemymonk"]; armorerBonusDamage = gamemanager.SkillTree["enemyarmorer"]; warlockNegateThreshhold = gamemanager.SkillTree["enemywarlock"]; tileI = 0; killWorth = health; attack = health / 3; currency = GameObject.FindGameObjectWithTag("money").GetComponent <CurrencyManager>(); //Debug.LogError(currency); playerBase = GameObject.FindGameObjectWithTag("base").GetComponent <BaseManager>(); healthBarParent = transform.GetChild(0); healthBarSprite = healthBarParent.GetChild(0).GetComponent <SpriteRenderer>(); healthBarBackground = transform.GetChild(1).GetComponent <SpriteRenderer>(); ishealthShown = false; healthShowTimer = 0; slowed = false; stunned = false; slowTimer = 0; stunTimer = 0; slowAmount = 1; challengeManager = FindObjectOfType <ChallengeManager>(); //chaos_challenge = !challengeManager.ChallengeDictionary["chaosskill"]; //fire_challenge = !challengeManager.ChallengeDictionary["fireskill"]; //nature_challenge = !challengeManager.ChallengeDictionary["natureskill"]; //earth_challenge = !challengeManager.ChallengeDictionary["earthskill"]; //enemypedia cur_found = challengeManager.Enemypedia["cur"]; knight_found = challengeManager.Enemypedia["knight"]; monk_found = challengeManager.Enemypedia["monk"]; assassin_found = challengeManager.Enemypedia["assassin"]; paladin_found = challengeManager.Enemypedia["paladin"]; armorer_found = challengeManager.Enemypedia["armorer"]; succubus_found = challengeManager.Enemypedia["succubus"]; warlock_found = challengeManager.Enemypedia["warlock"]; //sound deathSoundVolume = gamemanager.sfxVolume; }
public void DisplayLevelPreview(string levelName, int levelIndex) { // Storing the input currentLevel = $"Level_{levelPackIndex + 1}-{levelIndex + 1}"; LevelLoader.SetLevelToLoad(currentLevel); // Displaying The Level Investigation Screen levelPreviewPanel.SetActive(true); levelPreviewPanel.GetComponent <LevelPreview>().SetLevelPreview(levelPackIndex, levelIndex); levelNameText.text = $"Level {levelPackIndex + 1}-{levelIndex + 1}"; challengePreview.SetLevelChallengePreview(ChallengeManager.GetCurrentChallengeLog(levelPackIndex + 1, levelIndex + 1), $"Level_{levelPackIndex + 1}-{levelIndex + 1}"); }
// Start is called before the first frame update void Start() { // Grab UIManager instance ui = FindObjectOfType <UIManager>(); // Try to grab ChallengeManager instace, won't be able to if we aren't in challenge mode cm = FindObjectOfType <ChallengeManager>(); if (cm != null) { // Update current strokes from challenge strokes strokes = cm.strokes; } coin = FindObjectOfType <CoinController>(); }
public AzureService() { var url = new Uri(Keys.AzureDomain); var store = new MobileServiceSQLiteStore($"{url.Host}.db"); store.DefineTable<Athlete>(); store.DefineTable<League>(); store.DefineTable<Membership>(); store.DefineTable<Challenge>(); store.DefineTable<GameResult>(); Client.SyncContext.InitializeAsync(store); LeagueManager = new LeagueManager(); MembershipManager = new MembershipManager(); AthleteManager = new AthleteManager(); ChallengeManager = new ChallengeManager(); GameResultManager = new GameResultManager(); }
static void Main(string[] args) { Writer.WriteHelp(); var cm = new ChallengeManager(); while (true) { while (Console.KeyAvailable == false) Thread.Sleep(250); ConsoleKeyInfo cki = Console.ReadKey(true); if (cki.Key == ConsoleKey.Escape || cki.Key == ConsoleKey.Q) return; cm.RunChallenge(cki.KeyChar); Writer.WriteHelp(); } }
public abstract IEnumerator play(ChallengeManager manager, int difficulty);
public override IEnumerator play(ChallengeManager manager, int difficulty) { this.currentCard = 0; this.takenCards = new int[10]; this.rightInARowCount = 0; this.won(false); foreach (GUITexture card in this.cards) { card.texture = cardDeck.unturned; } this.difficulty = difficulty; if (this.difficulty == 0) { this.rightsInARowNeeded = 2; this.hpLost = 2; this.repGained = 100; } else if (this.difficulty == 1) { this.rightsInARowNeeded = 3; this.hpLost = 4; this.repGained = 150; } else if (this.difficulty == 2) { this.rightsInARowNeeded = 3; this.hpLost = 6; this.repGained = 200; } else if (this.difficulty == 3) { this.rightsInARowNeeded = 4; this.hpLost = 8; this.repGained = 250; } else if (this.difficulty == 4) { this.rightsInARowNeeded = 5; this.hpLost = 12; this.repGained = 400; } else if (this.difficulty > 5) { this.rightsInARowNeeded = 6; this.hpLost = 15; this.repGained = 1000; } selectItem(this.higher); this.active(true); this.turnCard(); // Turn the first card while (this.active()) { if (this.rightInARowCount >= this.rightsInARowNeeded) { StartCoroutine(doneWithGame()); break; } #if UNITY_IPHONE if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Ended) { if (this.higher.HitTest(Input.GetTouch(0).position)) { selectItem(this.higher); turnCard(); GameEventManager.conversation.displayText = true; audio.Play(); } else if (this.lower.HitTest(Input.GetTouch(0).position)) { selectItem(this.lower); turnCard(); GameEventManager.conversation.displayText = true; audio.Play(); } } #else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow)) { selectItem(this.higher); } else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow)) { selectItem(this.lower); } else if (Input.GetKeyDown(KeyCode.Return)) { turnCard(); GameEventManager.conversation.displayText = true; audio.Play(); } #endif yield return null; } yield return null; }