private void CreateUnLoadState() { _unloadState = (fsm, fsmGameObject) => { // target bonfire is null... if (Target == null) { Bonfire bonfire = FindObjectOfType <Bonfire>(); if (bonfire == null) { fsm.PopState(); fsm.PushState(_idleState); return; } Target = bonfire.gameObject; } // target too far... if ((Target.transform.position - transform.position).magnitude > MaxTargetRange) { fsm.PushState(_moveState); } else { BackPack = 0; fsm.PopState(); fsm.PushState(_idleState); } }; }
public void ShowTryToSavePopup(Bonfire bonfire) { Debug.Log("?"); Debug.Log("Bonfire: " + bonfire); Show(PopupID.TrySave); // _tryToSavePopup.BonfireTarget = bonfire; }
private void Update() { if (gameManagerMaster.isGamePaused || gameManagerMaster.isGameOver) { return; } if (Input.GetKeyDown(KeyCode.E)) { if (itemDetector.collider) { Bonfire b = itemDetector.collider.GetComponent <Bonfire>(); if (b) { if (inventory.GetTotalItemCount(wood) > 0) { inventory.RemoveItem(wood, 1); b.Refuel(1); Balloon text = Instantiate(balloon, Camera.main.WorldToScreenPoint(transform.position), Quaternion.identity, balloonParent.transform).GetComponent <Balloon>(); text.SetText("-1 " + wood.name); } } } } }
private void Start() { playerController = FindObjectOfType <PlayerController>(); mouseLook = FindObjectOfType <MouseLook>(); weaponSelector = FindObjectOfType <WeaponSelector>(); bonfire = FindObjectOfType <Bonfire>(); FindObjectOfType <AudioManager>().Play("Ambient"); Cursor.visible = false; }
public static void EndBurn(int amount) { Bonfire bonfire = GameObject.Find("Bonfire").GetComponent <Bonfire>(); bonfire._resource.Amount -= amount; ResourceManager.AddRemoveResource(ResourceManager.ResourceType.Fire, 1, MethodHandler.Command.Remove); bonfire.UpdateBonfireLevel(); EventHandler.current.ConsumeFire(); }
public override void OnBegin(Level level) { maxDashes = level.Session.Inventory.Dashes; level.Session.Inventory.Dashes = 1; bonfire = sitFire ? Scene.Tracker.GetEntity <Bonfire>() : null; Add(new Coroutine(Cutscene(level))); }
public void EnterBonfire(Bonfire bonfire) { waveMan.OnBonfireEnter(bonfire); if (bonfire.ID == 3) { GameFinishUI.SetActive(true); } else { boss.Reset();//just in case } }
public void OnReturnToB1() { GameFinishUI.SetActive(false); foreach (Bonfire bf in Bonfires) { if (bf.ID == 1) { LastBonfire = bf; break; } } OnRetry(); }
public void OnBonfireEnter(Bonfire bonfire) { if (bonfire.ID == 1) { OpenGate1(true); ResetWaves(); RestoreBossGate(); } else if (bonfire.ID == 2) { OpenGate2(true); ResetWaves(); RestoreBossGate(); } }
/// <summary> /// Gets all Heretics which are residing in houses on a perticular bonfire /// </summary> /// <param name="bonfire">The Bonfire to check</param> /// <returns>List of Heretics, otherwise empty list</returns> public List <VillagerAI> GetResidingHereticsFromBonfire(Bonfire bonfire) { List <VillagerAI> villagers = new List <VillagerAI>(); if (bonfire != null) { if (PlanetDatalayer.Instance.GetManager <BuildingManager>().GetHouseListFromBonfire(bonfire) != null) { foreach (House h in PlanetDatalayer.Instance.GetManager <BuildingManager>().GetHouseListFromBonfire(bonfire)) { villagers.AddRange(h.Residents); } } } return(villagers.Where((v) => v.GetVillagerStats().IsHeretic).ToList()); }
public void SetBonfire(Transform tileTransform) { Tile tile = tileTransform.GetComponent <Tile>(); GameObject bonfire = Instantiate(Resources.Load("Buildings/" + bonfirePrefab.name), tileTransform.position, Quaternion.identity, tileTransform) as GameObject; bonfire.name = bonfirePrefab.name; Bonfire fire = bonfire.GetComponent <Bonfire>(); fire.currTile = tile; tile.Passable = false; tile.tag = TagHandler.buildingBonfireString; MeshRenderer t_meshRen = tile.GetComponent <MeshRenderer>(); t_meshRen.material = (dirtMaterial) ? dirtMaterial : UnityEditor.AssetDatabase.GetBuiltinExtraResource <Material>("Default-Diffuse.mat"); SelectionStatusHandler vH = tile.GetComponent <SelectionStatusHandler>(); vH.originalMat = t_meshRen.material; }
void Start() { // Initialize Base Stats if (GetComponent <Unit>()) { lightObject = GetComponent <Unit>(); lightRange = GetComponent <Stats>().GetLightRange; EventHandler.current.onStatsChanged += () => SendLightRays(GetComponent <Stats>().GetLightRange); } if (GetComponent <Bonfire>()) { bonfire = GetComponent <Bonfire>(); } _grid = GameObject.Find("HexGen").GetComponent <Grid>(); _lightManager = GameObject.Find("LightManager").GetComponent <LightManager>(); StartCoroutine(SysHelper.WaitForAndExecute(.5f, () => SendLightRays(lightRange))); }
void Start() { //Initialisiere Arrays mit Objekten und Positionen m_HouseStages = new GameObject[] { m_FirstStage, m_SecondStage, m_ThirdStage, m_FinalStage, m_FinalStage_Res, m_FinalStage_Chur, m_FinalStage_Love }; m_SpawnPositions = new Vector3[] { new Vector3(248, 121, 106), new Vector3(241, 121, 100), new Vector3(247, 121, 94), new Vector3(252, 121, 100) }; m_Rotation = new Quaternion[] { Quaternion.Euler(0, 90, 0), Quaternion.identity, Quaternion.Euler(0, -90, 0), Quaternion.Euler(0, -180, 0) }; // Hol eine referenz zum Inventar des Bonfeuers m_InventoryRef = GetComponent <Bonfire>().m_ResourceInventory; m_Timer.SetActive(false); m_TimerDone = false; isConstructing = false; counterStages = 0; counterHouses = 0; maxHouses = 4; m_BuiltHouses = new GameObject[m_SpawnPositions.Length]; m_ThisBonfire = gameObject.GetComponent <Bonfire>(); }
void Start() { timer = 10f; index = -1; stages = 0; startTimer = false; m_ThisBonfire = gameObject.GetComponent <Bonfire>(); m_InventoryRef = GetComponent <Bonfire>().m_ResourceInventory; //Waiting Queue has the indexes of the houses that are waiting to be built m_WaitingQueue.Add(0); m_WaitingQueue.Add(1); m_WaitingQueue.Add(2); m_WaitingQueue.Add(3); //Built Houses has the houses that have already been built m_BuiltHouses = new GameObject [4]; m_BuiltHouses[0] = null; m_BuiltHouses[1] = null; m_BuiltHouses[2] = null; m_BuiltHouses[3] = null; }
public void ActivateBonfire(Bonfire bonfire) { LastBonfire = bonfire; foreach (Bonfire bf in Bonfires) { bf.Deactivate(); } bonfire.Activate(); foreach (EnemyRoom er in EnemyRooms) { er.ResetEnemy(); } waveMan.OnBonfireEnter(bonfire); ResetAllProj(); if (bonfire.ID == 3) { GameFinishUI.SetActive(true); } }
private void Start() { current = this; fire = ResourceManager.resourceAmountAtStartFire; bonfire = GameObject.Find("Bonfire").GetComponent <Bonfire>(); }
private void Awake() { _bonfire = GetComponent <Bonfire>(); }
private void OverlayEntities(MapElement entities, Bitmap map, VirtualMap <char> solids, bool background) { CassetteBlock.Blocks.Clear(); using (Graphics g = Graphics.FromImage(map)) { List <Entity> ents = new List <Entity>(); for (int i = entities.Children.Count - 1; i >= 0; i--) { MapElement child = entities.Children[i]; Entity entity = null; if (child.Name.IndexOf("spikes", StringComparison.OrdinalIgnoreCase) == 0) { entity = background ? Spikes.FromElement(child) : null; } else if (child.Name.IndexOf("triggerSpikes", StringComparison.OrdinalIgnoreCase) == 0) { entity = background ? TriggerSpikes.FromElement(child) : null; } else if (child.Name.IndexOf("strawberry", StringComparison.OrdinalIgnoreCase) == 0) { entity = background ? Strawberry.FromElement(child) : null; } else if (child.Name.Equals("goldenBerry", StringComparison.OrdinalIgnoreCase)) { entity = background ? Strawberry.FromElement(child) : null; } else if (child.Name.Equals("redBlocks", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClutterBlock.FromElement(child) : null; } else if (child.Name.Equals("greenBlocks", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClutterBlock.FromElement(child) : null; } else if (child.Name.Equals("yellowBlocks", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClutterBlock.FromElement(child) : null; } else if (child.Name.Equals("clutterCabinet", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClutterCabinet.FromElement(child) : null; } else if (child.Name.Equals("introCar", StringComparison.OrdinalIgnoreCase)) { entity = background ? IntroCar.FromElement(child) : null; } else if (child.Name.Equals("clothesLine", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClothesLine.FromElement(child) : null; } else if (child.Name.Equals("colorSwitch", StringComparison.OrdinalIgnoreCase)) { entity = background ? ColorSwitch.FromElement(child) : null; } else if (child.Name.Equals("memorialTextController", StringComparison.OrdinalIgnoreCase)) { entity = background ? Strawberry.FromElement(child) : null; } else if (child.Name.Equals("bonfire", StringComparison.OrdinalIgnoreCase)) { entity = background ? Bonfire.FromElement(child) : null; } else if (child.Name.Equals("trapDoor", StringComparison.OrdinalIgnoreCase)) { entity = background ? TrapDoor.FromElement(child) : null; } else if (child.Name.Equals("movingPlatform", StringComparison.OrdinalIgnoreCase)) { entity = background ? MovingPlatform.FromElement(child) : null; } else if (child.Name.Equals("sinkingPlatform", StringComparison.OrdinalIgnoreCase)) { entity = background ? SinkingPlatform.FromElement(child) : null; } else if (child.Name.Equals("clutterDoor", StringComparison.OrdinalIgnoreCase)) { entity = background ? ClutterDoor.FromElement(child) : null; } else if (child.Name.Equals("bridge", StringComparison.OrdinalIgnoreCase)) { entity = background ? Bridge.FromElement(child) : null; } else if (child.Name.Equals("bridgeFixed", StringComparison.OrdinalIgnoreCase)) { entity = background ? BridgeFixed.FromElement(child) : null; } else if (child.Name.Equals("jumpThru", StringComparison.OrdinalIgnoreCase)) { entity = background ? JumpThru.FromElement(child) : null; } else if (child.Name.Equals("door", StringComparison.OrdinalIgnoreCase)) { entity = background ? Door.FromElement(child) : null; } else if (child.Name.Equals("blockField", StringComparison.OrdinalIgnoreCase)) { entity = background ? BlockField.FromElement(child) : null; } else if (child.Name.Equals("lamp", StringComparison.OrdinalIgnoreCase)) { entity = background ? Lamp.FromElement(child) : null; } else if (child.Name.Equals("hahaha", StringComparison.OrdinalIgnoreCase)) { entity = background ? Haha.FromElement(child) : null; } else if (child.Name.Equals("waterFall", StringComparison.OrdinalIgnoreCase)) { entity = background ? WaterFall.FromElement(child) : null; } else if (child.Name.Equals("water", StringComparison.OrdinalIgnoreCase)) { entity = background ? Water.FromElement(child) : null; } else if (child.Name.Equals("key", StringComparison.OrdinalIgnoreCase)) { entity = background ? Key.FromElement(child) : null; } else if (child.Name.Equals("resortLantern", StringComparison.OrdinalIgnoreCase)) { entity = background ? ResortLantern.FromElement(child) : null; } else if (child.Name.Equals("bird", StringComparison.OrdinalIgnoreCase)) { entity = background ? Bird.FromElement(child) : null; } else if (child.Name.Equals("memorial", StringComparison.OrdinalIgnoreCase)) { entity = background ? Memorial.FromElement(child) : null; } else if (child.Name.Equals("player", StringComparison.OrdinalIgnoreCase)) { entity = background ? PlayerSpawn.FromElement(child) : null; } else if (child.Name.Equals("zipMover", StringComparison.OrdinalIgnoreCase)) { entity = background ? ZipMover.FromElement(child) : null; } else if (child.Name.Equals("wire", StringComparison.OrdinalIgnoreCase)) { entity = background ? Wire.FromElement(child) : null; } else if (child.Name.Equals("crumbleBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? CrumbleBlock.FromElement(child) : null; } else if (child.Name.Equals("refill", StringComparison.OrdinalIgnoreCase)) { entity = background ? Refill.FromElement(child) : null; } else if (child.Name.Equals("spring", StringComparison.OrdinalIgnoreCase)) { entity = background ? Spring.FromElement(child) : null; } else if (child.Name.Equals("fakeWall", StringComparison.OrdinalIgnoreCase)) { entity = background ? FakeWall.FromElement(child) : null; } else if (child.Name.Equals("exitBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? FakeWall.FromElement(child) : null; } else if (child.Name.Equals("lightBeam", StringComparison.OrdinalIgnoreCase)) { entity = background ? LightBeam.FromElement(child) : null; } else if (child.Name.Equals("cobweb", StringComparison.OrdinalIgnoreCase)) { entity = background ? Cobweb.FromElement(child) : null; } else if (child.Name.Equals("cassette", StringComparison.OrdinalIgnoreCase)) { entity = background ? Cassette.FromElement(child) : null; } else if (child.Name.Equals("flutterBird", StringComparison.OrdinalIgnoreCase)) { entity = background ? FlutterBird.FromElement(child) : null; } else if (child.Name.Equals("checkpoint", StringComparison.OrdinalIgnoreCase)) { entity = background ? Checkpoint.FromElement(child) : null; } else if (child.Name.Equals("fallingBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? FallingBlock.FromElement(child) : null; } else if (child.Name.Equals("introCrusher", StringComparison.OrdinalIgnoreCase)) { entity = background ? FallingBlock.FromElement(child) : null; } else if (child.Name.Equals("cassetteBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? CassetteBlock.FromElement(child) : null; } else if (child.Name.Equals("dashBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? DashBlock.FromElement(child) : null; } else if (child.Name.Equals("coverupWall", StringComparison.OrdinalIgnoreCase)) { entity = background ? CoverupWall.FromElement(child) : null; } else if (child.Name.Equals("npc", StringComparison.OrdinalIgnoreCase)) { entity = background ? NPC.FromElement(child) : null; } else if (child.Name.Equals("birdForsakenCityGem", StringComparison.OrdinalIgnoreCase)) { entity = background ? ForsakenCityGem.FromElement(child) : null; } else if (child.Name.Equals("soundSource", StringComparison.OrdinalIgnoreCase)) { entity = background ? SoundSource.FromElement(child) : null; } else if (child.Name.Equals("friendlyGhost", StringComparison.OrdinalIgnoreCase)) { entity = background ? FriendlyGhost.FromElement(child) : null; } else if (child.Name.Equals("floatingDebris", StringComparison.OrdinalIgnoreCase)) { entity = background ? FloatingDebris.FromElement(child) : null; } else if (child.Name.Equals("hangingLamp", StringComparison.OrdinalIgnoreCase)) { entity = background ? HangingLamp.FromElement(child) : null; } else if (child.Name.Equals("lockBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? LockBlock.FromElement(child) : null; } else if (child.Name.Equals("heartGem", StringComparison.OrdinalIgnoreCase)) { entity = background ? HeartGem.FromElement(child) : null; } else if (child.Name.Equals("blackGem", StringComparison.OrdinalIgnoreCase)) { entity = background ? HeartGem.FromElement(child) : null; } else if (child.Name.Equals("dreamMirror", StringComparison.OrdinalIgnoreCase)) { entity = background ? DreamMirror.FromElement(child) : null; } else if (child.Name.Equals("darkChaser", StringComparison.OrdinalIgnoreCase)) { entity = background ? DarkChaser.FromElement(child) : null; } else if (child.Name.Equals("dreamBlock", StringComparison.OrdinalIgnoreCase)) { entity = background ? DreamBlock.FromElement(child) : null; } else if (child.Name.Equals("touchSwitch", StringComparison.OrdinalIgnoreCase)) { entity = background ? TouchSwitch.FromElement(child) : null; } else if (child.Name.Equals("switchGate", StringComparison.OrdinalIgnoreCase)) { entity = background ? SwitchGate.FromElement(child) : null; } else if (child.Name.Equals("invisibleBarrier", StringComparison.OrdinalIgnoreCase)) { entity = background ? InvisibleBarrier.FromElement(child) : null; } else if (child.Name.Equals("payphone", StringComparison.OrdinalIgnoreCase)) { entity = background ? Payphone.FromElement(child) : null; } else if (child.Name.Equals("spinner", StringComparison.OrdinalIgnoreCase)) { entity = background ? Spinner.FromElement(child) : null; } else if (child.Name.Equals("rotateSpinner", StringComparison.OrdinalIgnoreCase)) { entity = background ? RotateSpinner.FromElement(child) : null; } else if (child.Name.Equals("trackSpinner", StringComparison.OrdinalIgnoreCase)) { entity = background ? TrackSpinner.FromElement(child) : null; } else if (child.Name.Equals("towerViewer", StringComparison.OrdinalIgnoreCase)) { entity = background ? TowerViewer.FromElement(child) : null; } else if (child.Name.Equals("foregroundDebris", StringComparison.OrdinalIgnoreCase)) { entity = !background?ForegroundDebris.FromElement(child) : null; } else if (background) { Console.WriteLine(child.Name); } if (entity != null) { ents.Add(entity); } } ents.Sort(delegate(Entity one, Entity two) { int comp = two.Depth.CompareTo(one.Depth); return(comp == 0 ? one.ID.CompareTo(two.ID) : comp); }); for (int i = 0; i < ents.Count; i++) { Entity entity = ents[i]; entity.Render(g, solids); } } }
// Start is called before the first frame update void Start() { bonfire = GameObject.Find("Bonfire"); bonfireScript = bonfire.GetComponent <Bonfire>(); audioSource = GetComponent <AudioSource>(); }
void Start() { m_ThisHouse = gameObject.transform.parent.parent.GetComponent <House>(); m_Bonfire = gameObject.transform.parent.parent.parent.parent.GetComponent <Bonfire>(); m_InventoryRef = m_Bonfire.m_ResourceInventory; }
// Start is called before the first frame update void Awake() { int pieces = FindObjectOfType <DungeonMaster>().GetProgress(); Debug.Log("Disabling House Objects"); FloorL.GetComponent <Renderer>().enabled = false; FloorR.GetComponent <Renderer>().enabled = false; WallL.GetComponent <Renderer>().enabled = false; WallR.GetComponent <Renderer>().enabled = false; fillerDisable(); Roof.GetComponent <Renderer>().enabled = false; door.GetComponent <Renderer>().enabled = false; window1.GetComponent <Renderer>().enabled = false; Bonfire.GetComponent <Renderer>().enabled = false; Debug.Log("Case : " + pieces); switch (pieces) { case 0: //Nothing Enabled break; case 1: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; break; case 2: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; WallL.GetComponent <Renderer>().enabled = true; WallR.GetComponent <Renderer>().enabled = true; break; case 3: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; WallL.GetComponent <Renderer>().enabled = true; WallR.GetComponent <Renderer>().enabled = true; fillerEnable(); door.GetComponent <Renderer>().enabled = true; break; case 4: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; WallL.GetComponent <Renderer>().enabled = true; WallR.GetComponent <Renderer>().enabled = true; fillerEnable(); door.GetComponent <Renderer>().enabled = true; window1.GetComponent <Renderer>().enabled = true; break; case 5: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; WallL.GetComponent <Renderer>().enabled = true; WallR.GetComponent <Renderer>().enabled = true; fillerEnable(); door.GetComponent <Renderer>().enabled = true; window1.GetComponent <Renderer>().enabled = true; Roof.GetComponent <Renderer>().enabled = true; break; default: FloorL.GetComponent <Renderer>().enabled = true; FloorR.GetComponent <Renderer>().enabled = true; WallL.GetComponent <Renderer>().enabled = true; WallR.GetComponent <Renderer>().enabled = true; fillerEnable(); door.GetComponent <Renderer>().enabled = true; window1.GetComponent <Renderer>().enabled = true; Bonfire.GetComponent <Renderer>().enabled = true; break; } }
public void OnRetry(Bonfire bonfire) { OnBonfireEnter(bonfire); }
static void Main(string[] args) { Bonfire _bonfire = new Bonfire(); _bonfire.MainLoop(); }
public static void OnBonfireInteracted(Bonfire bonfire) { BonfireInteracted?.Invoke(bonfire); }
// Use this for initialization void Start() { bonfire = gameObject.GetComponentInParent <Bonfire>(); }