public void OnBlockPlaced(int x, int y, int z, byte block) { if (!Enabled) { return; } int index = (y * length + z) * width + x; if (block == (byte)Block.Lava) { Lava.Enqueue(defLavaTick | (uint)index); } else if (block == (byte)Block.Water) { Water.Enqueue(defWaterTick | (uint)index); } else if (block == (byte)Block.Sand || block == (byte)Block.Gravel) { Falling.Enqueue(defFallingTick | (uint)index); } else if (block == (byte)Block.TNT) { Explode(4, x, y, z); } else if (block == (byte)Block.Sapling) { GrowTree(x, y, z); } else if (block == (byte)Block.Sponge) { PlaceSponge(x, y, z); } }
private void Awake() { if (instance == null) { instance = this; } }
// Build noisy line paths for each of the Voronoi edges. There are // two noisy line paths for each edge, each covering half the // distance: path0 is from v0 to the midpoint and path1 is from v1 // to the midpoint. When drawing the polygons, one or the other // must be drawn in reverse order. public void buildNoisyEdges(Map map, Lava lava, System.Random random){ foreach (var p in map.centers) { foreach (var edge in p.borders) { if ((edge.d0 !=null && edge.d1 !=null) && (edge.v0 !=null && edge.v1 !=null) && !path0.ContainsKey(edge.index)) { var f = NOISY_LINE_TRADEOFF; var t = Vector2.Lerp (edge.v0.point, edge.d0.point, f); var q = Vector2.Lerp (edge.v0.point, edge.d1.point, f); var r = Vector2.Lerp (edge.v1.point, edge.d0.point, f); var s = Vector2.Lerp (edge.v1.point, edge.d1.point, f); var minLength = 10; if (edge.d0.biome != edge.d1.biome) minLength = 3; if (edge.d0.ocean && edge.d1.ocean) minLength = 100; if (edge.d0.coast || edge.d1.coast) minLength = 1; if (edge.river > 0) minLength = 1; if (lava.lava.ContainsKey(edge.index) && lava.lava[edge.index]) minLength = 1; path0 [edge.index] = buildNoisyLineSegments (random, edge.v0.point, t, edge.midpoint, q, minLength); path1 [edge.index] = buildNoisyLineSegments (random, edge.v1.point, s, edge.midpoint, r, minLength); } } } }
public void It_should_round_trip_lava(Level level, bool isFlowing, bool isFalling, int expectedId, byte expectedData) { // Create the block from IBlock Properties var original = new Lava(level, isFlowing, isFalling); javaBlockRoundTrip(level, isFlowing, isFalling, expectedId, expectedData, original); }
protected override void Awake() { base.Awake(); lava = FindObjectOfType <Lava>(); pebblePool = GameObject.Find("PebbleSpawner").GetComponent <ObjectPool>(); }
/// <summary> /// Взаимодействие лавы со стенами и бонусами под стенами /// </summary> /// <param name="plava">Объект Лава</param> public void LavaCellsBonusesCollision(Lava plava) { Bonus[,] tbonuses_mass = ListToMass(gb.Bonuses); if (gb.Cells[plava.X, plava.Y].Type == CellType.Destructible) { // gb.Cells[plava.X, plava.Y].Type = CellType.Free; DestroyedCells.Add(gb.Cells[plava.X, plava.Y]); // gb.Players.Find(c => c.ID == plava.PlayerID).Points += Config.player_cell_destroy_points; for (int i = 0; i < gb.Players.Count; i++) { if (gb.Players[i].ID == plava.PlayerID) { gb.Players[i].Points += Config.player_cell_destroy_points; } } if (tbonuses_mass[plava.X, plava.Y] != null) { tbonuses_mass[plava.X, plava.Y].Visible = true; } // PlayerAddPointsCellDestroy(plava); } }
IEnumerator Fire() { List <Vector3> targets = my_line.getFractions(bullets); StringBuilder line_string = new StringBuilder(); yield return(new WaitForSeconds(initial_delay)); foreach (Vector3 target in targets) { Lava lava = Peripheral.Instance.zoo.getObject(attack_lava, false).GetComponent <Lava>(); lava.SetLocation(this.transform, target, lava_size, Quaternion.identity); lava.Init(EffectType.Frost, level, stats, lava_life, true, null); lava.gameObject.SetActive(true); lava.SetFactor(1); line_string.Append("|"); line_string.Append(target.x); line_string.Append("_"); line_string.Append(target.y); yield return(new WaitForSeconds(intra_bullet_delay)); } Tracker.Log(PlayerEvent.SpecialSkillUsed, true, customAttributes: new Dictionary <string, string>() { { "attribute_1", EffectType.AirAttack.ToString() }, { "attribute_2", line_string.ToString() } }, customMetrics: new Dictionary <string, double>() { { "metric_1", level } }); }
private void Start() { rb = GetComponent <Rigidbody2D>(); hs = GetComponent <HealthSystem>(); dr = GetComponent <DamageReceiver>(); lava = FindObjectOfType <Lava>(); coroutines = Coroutines.GetInstance(); sf = FindObjectOfType <ScreenFader>(); anim = GetComponent <Animator>(); pc = GetComponent <PlayerController>(); sr = GetComponent <SpriteRenderer>(); tr = GetComponent <Transform>(); SetRespawnPoint(tr.position); #region delegate_subscriptions //I am fully aware of the fact that had I used unityEvents, I could do this in the inspector: pc.OnStartedRunning += (() => { sfx.TryStartPlayLooped("Run"); }); pc.OnStoppedRunning += (() => { sfx.TryStopPlayLooped("Run"); }); pc.OnStartedClimbing += (() => { sfx.TryStartPlayLooped("ClimbLadder"); }); pc.OnStoppedClimbing += (() => { sfx.TryStopPlayLooped("ClimbLadder"); }); pc.OnJumped += (() => { sfx.TryPlayOnce("Jump"); }); pc.OnHitGround += (() => { sfx.TryPlayOnce("GroundImpact"); }); pc.OnClimbedOnce += (() => { sfx.TryPlayOnce("GrabbedLadder"); }); dr.OnTakenDamage += (() => { sfx.TryPlayOnce("Damaged"); }); OnDamagedByLava += (() => { sfx.TryPlayOnce("TouchLava"); }); hs.OnDeath += Death; dr.OnDamagedBy += ProcessDamager; #endregion delegate_subscriptions }
void ResetLava() { GameObject lavaObj = GameObject.FindGameObjectWithTag("Lava"); Lava lavaScript = (Lava)lavaObj.GetComponent(typeof(Lava)); lavaScript.ResetPosition(); }
public override void Lava() { GameObject lavaObject = SkillPoolManager.Instance.PopSkill(SkillKind.kLava); Lava lava = lavaObject.GetComponent <Lava>(); lava.Burning(_monster); }
//CALAMITY public void Init(StatBit bit, HitMe target, Firearm firearm, EffectType type) { Prepare(bit, firearm, type); if (type == EffectType.Calamity) { my_lava = Peripheral.Instance.zoo.getObject("Wishes/calamity_lava", true).GetComponent <Lava>(); } else { my_lava = Peripheral.Instance.zoo.getObject("Wishes/foil_lava", true).GetComponent <Lava>(); } my_lava.auto_return = true; my_lava.my_firearm = firearm; my_lava.Init(type, bit.level, lava_stats, lava_timer, true, firearm); my_lava.SetLocation(target.transform, target.transform.position, lava_size, Quaternion.identity); my_lava.SetFactor(1); my_lava.transform.localPosition = Vector3.zero; Vector3 pos = my_lava.transform.position; pos.z = 3.75f; my_lava.transform.position = pos; my_lava.updateMyPosition = true; target.lavas.Add(my_lava); }
void Start() { bill = GameObject.FindGameObjectWithTag("BillRizer"); GameObject lavaObj = GameObject.FindGameObjectWithTag("Lava"); lava = (Lava)lavaObj.GetComponent(typeof(Lava)); }
private void BeginGame() { mazeInstance = Instantiate(mazePrefab) as Maze; StartCoroutine(mazeInstance.Generate(worldFile)); lavaInstance = Instantiate(lavaPrefab) as Lava; //playerInstance = Instantiate (playerPrefab) as Player; //StartCoroutine (playerInstance.Generate()); }
// Use this for initialization void Start() { myLava = Instantiate(lavaPrefab); myLava.transform.position = new Vector3(21, -1.5f, 21); myPlayer = Instantiate(playerPrefab); myPlayer.transform.position = new Vector3(42f, 1, 42f); }
public void OnTriggerEnter(Collider other) { Lava lava = other.GetComponent <Lava>(); if (lava != null) { ghost.velocity.y = 1; } }
public CollisionHelper(Player player, Lava lava, List <Platform> platforms, List <Hazard> hazards) { this.player = player; this.lava = lava; this.platforms = platforms; this.hazards = hazards; SimpleEvent.AddEvent(EventTypes.LISTENER, new ListenerEventData(EventTypes.RESET, this)); }
private void GenerateLava() { foreach (Line line in map.Lines.Where(l => l.Color == MapColor.Red && l.Closed)) { Lava lava = Instantiate(prefabs.lavaPrefab, levelContainer).GetComponent <Lava>(); lava.Init(line.Points); MakeLineRenderer(line, new Color(0.5f, 0.05f, 0, 0.65f), lava.transform); } }
/// <summary> /// Зачислить поинты за разрушение стены /// </summary> /// <param name="plava">Лава, разрушившая стену</param> public void PlayerAddPointsCellDestroy(Lava plava) { for (int i = 0; i < gb.Players.Count; i++) { var tplayer = gb.Players[i]; if (tplayer.ID == plava.PlayerID) { tplayer.Points += Config.player_cell_destroy_points; break; } } }
public PlatformHelper(List <Platform> platforms, Lava lava) { this.platforms = platforms; this.lava = lava; setPieces = new List <SetPiece>(); random = new Random(); SetPiece.Initialize(platforms); SimpleEvent.AddEvent(EventTypes.LISTENER, new ListenerEventData(EventTypes.RESET, this)); }
/// <summary> /// Зачислить поинты за убийство другого игрока /// </summary> /// <param name="plava">Лава, убившая другого игрока</param> public void PlayerAddPointsKill(Lava plava) { for (int i = 0; i < gb.Players.Count; i++) { var tplayer = gb.Players[i]; if (tplayer.ID != plava.PlayerID) { // tplayer.Points += Config.player_kill_points; break; } } }
void SetEverythingOnFire(float[] stats) /// DOT FINISHER { my_lava = Zoo.Instance.getObject(lava_name, false).GetComponent <Lava>(); //my_lava.SetLocation(this.transform, this.transform.position, stats[1], Quaternion.identity); StatBit[] lava_statbits = new StatBit[1]; lava_statbits[0] = new StatBit(EffectType.Fear, stats[0], 1, true); StatSum lava_stats = new StatSum(1, 0, lava_statbits, RuneType.Vexing); my_lava.SetLocation(my_hitme.transform, my_hitme.transform.position, stats[1], Quaternion.identity); my_lava.Init(EffectType.DOT, 2, lava_stats, duration, true, null); my_lava.gameObject.SetActive(true); }
void Start() { dest = transform.position; leftColor = Color.black; rightColor = Color.black; leftPower = true; brown = new Color(0.5f, 0.25f, 0); currMix = "Not a Mix!"; ice = this.GetComponent <Ice> (); quicksand = this.GetComponent <Quicksand> (); lava = this.GetComponent <Lava> (); energy = this.GetComponent <Energy> (); }
void CauseMassPanic(float[] stats) { my_lava = Zoo.Instance.getObject(lava_name, false).GetComponent <Lava>(); StatBit[] lava_statbits = new StatBit[1]; lava_statbits[0] = new StatBit(EffectType.Fear, stats[0], 0, true); StatSum lava_stats = new StatSum(1, 0, lava_statbits, RuneType.Vexing); my_lava.SetLocation(my_ai.transform, my_ai.transform.position, stats[1], Quaternion.identity); my_lava.lifespan = stats[0]; //not ideal, level is whaaaat my_lava.Init(EffectType.Fear, 2, lava_stats, lifetime, true, null); my_lava.gameObject.SetActive(true); }
static void DoTntLavaEffect(int prob1, int prob2, Vector3I pos, Block target) { int effect = rnd.Next(100); if (effect >= prob1) { map.QueueUpdate(new BlockUpdate(Player.Console, pos, Block.Lava)); lock (lavaLock) Lava.Add(pos); } else if (effect >= prob2) { map.QueueUpdate(new BlockUpdate(Player.Console, pos, target)); } }
void Fire() { foreach (Cluster target in clusters) { Lava lava = Peripheral.Instance.zoo.getObject(attack_lava, false).GetComponent <Lava>(); lava.SetLocation(this.transform, start_from, range, Quaternion.identity); lava.Init(skill_effect_type, level, stats, lava_life, true, null); target.my_lava = lava; lava.gameObject.SetActive(true); target.startLava(); active_lavas.Add(lava); } }
public LiquidPhysics(Game game, Physics physics) { this.game = game; map = game.World; info = game.BlockInfo; physics.OnPlace[Block.Lava] = (index, b) => Lava.Enqueue(defLavaTick | (uint)index); physics.OnPlace[Block.Water] = (index, b) => Water.Enqueue(defWaterTick | (uint)index); physics.OnPlace[Block.Sponge] = PlaceSponge; physics.OnDelete[Block.Sponge] = DeleteSponge; physics.OnActivate[Block.Water] = ActivateWater; physics.OnActivate[Block.StillWater] = ActivateWater; physics.OnActivate[Block.Lava] = ActivateLava; physics.OnActivate[Block.StillLava] = ActivateLava; }
/* Start Building map */ public void go(string newIslandType, string newPointType, int newNumPoints){ //roads = new Roads(); //roads = new RoadsSpanningTree (); lava = new Lava(); //watersheds = new Watersheds(); //noisyEdges = new NoisyEdges(); newIsland(newIslandType, newNumPoints); map.go(newPointType); //roads.createRoads(map); lava.createLava(map/*, map.mapRandom*/); //watersheds.createWatersheds(map); //noisyEdges.buildNoisyEdges(map, lava, map.mapRandom); /* draw data */ drawMap(mapMode); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } if (!gameStarted && Input.anyKey) { gameStarted = true; GameObject.FindGameObjectWithTag("MainMenu").SetActive(false); GameObject lavaObject = GameObject.FindGameObjectWithTag("Lava"); if (lavaObject) { Lava lava = lavaObject.GetComponent <Lava>(); lava.StartCoroutine(lava.Rise()); } } }
/* Start Building map */ public void go(string newIslandType, string newPointType, int newNumPoints) { //roads = new Roads(); //roads = new RoadsSpanningTree (); lava = new Lava(); //watersheds = new Watersheds(); //noisyEdges = new NoisyEdges(); newIsland(newIslandType, newNumPoints); map.go(newPointType); //roads.createRoads(map); lava.createLava(map /*, map.mapRandom*/); //watersheds.createWatersheds(map); //noisyEdges.buildNoisyEdges(map, lava, map.mapRandom); /* draw data */ drawMap(mapMode); }
public override void ReleaseSpell() { int maxThrowNum = Random.Range(3, 7); for (int i = 0; i < maxThrowNum; i++) { GameObject lava = poolManager.GetGameObject("Lava"); Lava a = lava.GetComponent <Lava>(); a.SetThrower(player); //设置生成位置 flyingStartPositon.x = player.transform.position.x; flyingStartPositon.y = player.transform.position.y + 1; a.SetStartPosition(flyingStartPositon); //设置方向 a.SetDirection(Random.value * 2 - 1); } }
private void OnTriggerExit2D(Collider2D collision) { GameObject collGO = collision.gameObject; if (collGO.tag == "Platform") { // Playsound Lava theLava = GameObject.Find("Lava").GetComponent <Lava>(); ticEvery = theLava.ticTimer; lavaDamage = theLava.damage; onLava = true; } else if (collGO.tag == "Lava") { //DIE gm.m_nPlayerCount--; alive = false; } }
protected override void SafeDisable() { if (my_lava != null) { my_lava.KillMe(); my_lava = null; } if (my_ai.player != finish) { my_ai.player = finish; my_ai.forward_only = true; is_active = false; if (!my_ai.dead) { my_ai.getNewPath(); } } }
void Start() { //Stores level spawners in hierarchy spawnerParent = GameObject.Find("Spawners").transform.FindChild("LevelSpawners").transform; //Used to animate a flash flash = GameObject.Find("Flash").GetComponent<LensFlare>(); wallParent = GameObject.Find("Walls").transform; walls = wallParent.GetComponentsInChildren<Wall>(); lava = FindObjectOfType<Lava>(); sunAnimator = FindObjectOfType<Sun>().GetComponent<Animator>(); overlay1 = new Overlay(GameObject.Find("Overlay").transform); overlay2 = new Overlay(GameObject.Find("Overlay2").transform); //Set up and Start level 0 SetUpLevel(); PlayLevel(); }
void Start () { bill = GameObject.FindGameObjectWithTag ("BillRizer"); GameObject lavaObj = GameObject.FindGameObjectWithTag ("Lava"); lava = (Lava) lavaObj.GetComponent(typeof(Lava)); }