public override void OnObjectiveItemPickup(LevelObjective lvlObj, BaseObject item) { StickyItem obj = item as StickyItem; if (connectedItem != null && obj != null) { if (obj.UUID == connectedItem.UUID && connectedItem.UUID != -1) { connectedObjective = lvlObj; if (lvlObj.isMainObjective) { completionSound = awardMain; } else { completionSound = awardSide; } currentPickedUpItems++; if (currentPickedUpItems == (itemNumber)) { image.sprite = connectedItem.icon; FadeOpen(false); } } } }
public virtual void OnObjectiveComplete(LevelObjective lvlObj) { if (lvlObj.isMainObjective) { FadeBlack(CameraFadeCallBack); } }
public void Save(ref Board board, ref Level level, string name, int progress, LevelObjective objective = LevelObjective.Eliminate) { int step = level == null ? progress : level.step; XDocument document = CreateDocument(ref board, ref level, step); document.Save("Assets/Resources/Levels/" + name + ".xml"); }
public void OnObjectiveComplete(LevelObjective lvlObj) { if (connectedGroceries.connectedObjective == lvlObj) { StopPointing(); } }
public void OnObjectiveComplete(LevelObjective lvlObj) { if (connectedGroceries.connectedObjective == lvlObj) { MoveMe(); } }
public void OnObjectiveComplete(LevelObjective lvlObj) { if (lvlObj == keysToApartment) { StartCoroutine("WinLevel"); } }
public virtual void OnObjectiveComplete(LevelObjective lvlObj) { if (lvlObj == connectedObjective) { image.sprite = connectedItem.icon; } }
public OptionObjectiveSquare(Sprite spriteSheet, Vector2 position, LevelObjective state) : base(spriteSheet, position) { displaySprite = spriteSheet.GetSubSprite(new Rectangle(50, 0, 12, 12)); optionState = state; readyToSetDisplay = false; }
public OptionObjectiveEntry(Sprite spriteSheet, Vector2 position, LevelObjective objectiveType) : base(position) { squarePos.X += 80; this.position = position; displayText = objectiveType.ToString(); optionSquare = new OptionObjectiveSquare(spriteSheet, squarePos, objectiveType); }
public void StartGame() { currentGame = new Game(); currentGame.Initialize(LevelObjective.CreateDefaultLevel()); _gameUI.Initialize(_pieceTypeDatabase); _gameUI.UpdateUI(currentGame); CreateBoard(); }
private void LoadLevelObjective(String loadPattern) { Match objectiveModeMatch = Regex.Match(loadPattern, @"^(\w+)|"); objective = MathFunctions.ParseEnum <LevelObjective>(objectiveModeMatch.Value); Match objectiveValMatch = Regex.Match(loadPattern, @"([A-Z])(\d+)"); objectiveValue = Convert.ToInt32(objectiveValMatch.Groups[2].Value); }
public void finishLevel_DEVELOPONLY() { if (StatsManager.gameMode != GameMode.Develop && StatsManager.gameMode != GameMode.Campaign) { throw new ArgumentException("This function should ONLY be called for debug purposes // Jakob"); } levelObjective = LevelObjective.KillNumber; killCountForVictory = 0; }
public override void ClickAction() { LevelObjective newObjective = ActiveData.levelObjective; int levelObjectiveInt = EventEditor.GetObjectiveInt(newObjective); if (levelObjectiveInt >= 0) { AddAction(new SetLevelObjectiveAction(newObjective, levelObjectiveInt)); } }
void OnLevelObjectiveCompleted(LevelObjective objective) { if (targetLevelObjectives.Contains(objective)) { var winningTeam = objective.GetObjectiveOwner(); Debug.Log("Objective " + objective.GetObjectiveType() + " achieved by " + winningTeam.name); isLevelCompleted = true; LevelEvents.levelWonEvent.Invoke(winningTeam); } }
public static String GetObjectiveString() { LevelObjective currentObj = ActiveData.levelObjective; String returnString = currentObj.ToString() + "|"; SortedDictionary <string, int> objectiveSettings = ExtractValueDictionary(masterObjectiveDictionary[currentObj]); returnString += GetSaveString(objectiveSettings); return(returnString); }
private void UpdateObjectiveSettings(GameTime gameTime) { LevelObjective activeObjectiveType = ActiveData.levelObjective; ICollection <string> keys = masterObjectiveDictionary[activeObjectiveType].Keys; foreach (String key in keys) { masterObjectiveDictionary[activeObjectiveType][key].Update(gameTime); } }
public void OnObjectiveItemPickup(LevelObjective lvlObj, BaseObject item) { if (lvlObj.AllItemsCollected) { peekTime = allCollectedPeekTime; } else { peekTime = normalPeekTime; } Peek(); }
public static int GetObjectiveInt(LevelObjective objective) { SortedDictionary <string, int> dict = ExtractValueDictionary(masterObjectiveDictionary[objective]); ICollection <int> values = dict.Values; if (values.Count == 1) { return(values.ElementAt(0)); } else { return(0); } }
public void Save(ref Board board, string levelName, LevelObjective objective) { export = new LevelExporter(); Level level = null; GameObject levelObj = GameObject.Find("Level"); if (levelObj != null) { level = levelObj.GetComponent <Level>(); } export.Save(ref board, ref level, levelName, -1, objective); }
public void Update() { LevelObjective current = LevelManager.CurrentObjective; Anim.SetBool("Active", current != null); if (current != null) { float p = Mathf.Clamp01(current.GetProgress()); Bar.fillAmount = Mathf.Lerp(Bar.fillAmount, p, Time.unscaledDeltaTime * LerpSpeed); Text.text = current.GetPrompt(); } }
protected Level(Game1 Game, Sprite spriteSheet, PlayerVerticalShooter player, MissionType missionType, String identifier) { this.Game = Game; this.Identifier = identifier; border = new Sprite(Game.Content.Load <Texture2D>("Vertical-Sprites/BorderSprite"), new Rectangle(5, 5, 1, 1)); this.spriteSheet = spriteSheet; this.player = player; random = new Random(); customStartTime = -1; this.missionType = missionType; levelObjective = LevelObjective.Finish; winOnFinish = true; }
public void OnObjectiveComplete(LevelObjective lvlObj) { if (lvlObj == levelObjective) { if (particles != null) { particles.PlayOnce(); } if (objectToSpawn != null) { GameObject go = Instantiate(objectToSpawn, transform.position, transform.rotation) as GameObject; } if (!shutUp) { audioPlayer.Play(completionSound); } } }
//Called when new data is created from inside program public LevelData() { height = 10; pointWidth = 6; durationWidth = 3; pointDataGrid = new PointSquareData[pointWidth, height]; durationDataGrid = new DurationSquareData[durationWidth, height]; durationChains = new List <DurationSquareDataChain>(); objective = LevelObjective.Finish; duration = 10; widthInPixels = 400; CalculateTimeVector(); InitializePointGridData(); InitializeDurationGridData(); }
private void UpdateOverview() { if (Objectives.Count == 0 && Current == null) { Overview = "No remaining objectives."; return; } const char WHITESPACE = '\t'; str.Clear(); pending.Clear(); int indent = 0; if (Current != null) { pending.Add(Current); } pending.AddRange(Objectives); LevelObjective current = pending[0]; while (pending.Count > 0) { str.Append(WHITESPACE, indent); str.AppendLine(current.ToString().Trim()); pending.Remove(current); bool comp = current is CompoundLevelObjective; if (comp) { pending.AddRange((current as CompoundLevelObjective).Requirements); } if (pending.Count > 0) { current = pending[0]; } } Overview = str.ToString().TrimEnd(); }
protected override void LateAwake() { if (levelObjective == null) { levelObjective = GetComponent <LevelObjective>(); if (levelObjective == null) { Debug.Log("I need an objective to fulfil my purpose :("); return; } } audioPlayer = GetComponent <AudioPlayer>(); if (particles != null) { GameObject go = Instantiate(particles.gameObject, transform.position, transform.rotation) as GameObject; go.transform.parent = transform; particles = go.GetComponent <ParticleEffect>(); } }
public virtual void OnObjectiveItemPickup(LevelObjective lvlObj, BaseObject item) { StickyItem obj = item as StickyItem; if (connectedItem != null && obj != null) { if (obj.UUID == connectedItem.UUID && connectedItem.UUID != -1) { connectedObjective = lvlObj; if (lvlObj.isMainObjective) { completionSound = awardMain; } else { completionSound = awardSide; } image.sprite = connectedItem.icon; FadeOpen(false); } } }
void Start() { manager = GameObject.FindObjectOfType <LevelManager>(); objectiveMethods = new Dictionary <Objective, LevelObjective>(); objectiveMethods.Add(Objective.GetItems, GetItems); objectiveMethods.Add(Objective.PassLevel, PassLevel); objectiveMethods.Add(Objective.Time, TimeChallenge); objectiveMethods.Add(Objective.ObjectiveNotImplemented, objectiveNotImplemented); objectiveMethods.Add(Objective.WhaleSeen, PassLevel); objectiveMethods.Add(Objective.Refueled, isCopterRefueled); objectiveMethods.Add(Objective.DiverInCargo, isDiverInCargo); objectiveMethods.Add(Objective.DryCat, isCatDry); objectiveMethods.Add(Objective.MultipleCratesHooked, multipleCratesHooked); objectiveMethods.Add(Objective.NoThrowsMissed, noMissedThrows); objectiveMethods.Add(Objective.ChainFishermen, fishermenChained); objectiveMethods.Add(Objective.shipNotHit, shipNotHit); LevelObjective1 = objectiveMethods[Objective1]; LevelObjective2 = objectiveMethods[Objective2]; LevelObjective3 = objectiveMethods[Objective3]; }
public SetLevelObjectiveAction(LevelObjective objective, int objectiveInt) : base() { this.objective = objective; this.objectiveInt = objectiveInt; }
public void OnObjectiveItemPickup(LevelObjective lvlObj, BaseObject item) { }
void OnLevelWasLoaded(int level) { if (level == 0) { Cursor.visible = true; Destroy(gameObject); } GameState.SetLastLevel(howManyLevels); #if !UNITY_EDITOR Cursor.visible = false; #endif if (!initialized && level != 0) { am = gameObject.GetComponent<AnnouncementManager>(); cm = gameObject.GetComponent<CharacterManager>(); em = gameObject.GetComponent<EnemyManager>(); uim = GameObject.Find("UserInterface").GetComponent<UserInterfaceManager>(); objective = GameObject.Find("LevelLoader").GetComponent<LevelLoader>().levelObjective; am.InformLevelObjective(objective); initialized = true; levelCompleted = false; am.LevelLoadedFader(); Invoke("LateStart", 0.1f); } }
public void SetDisplay(LevelObjective newObjective, Vector2 pos) { ActiveData.levelObjective = newObjective; markerPosition = pos; }
public void SetLevelObjective(LevelObjective obj) { objective = obj; }
public void InformLevelObjective(LevelObjective obj) { if (obj == LevelObjective.KillYourCharacters) { levelStartTime = Time.time; charactersAreEnemies = true; lastLevelTipNeeded = true; } else { charactersAreEnemies = false; } if (GameState.GetLevel() > 1) { GetComponent<AudioSource>().enabled = true; } }