public Particle(Blizzard owner) { this.owner = owner; this.xSway = UnityEngine.Random.Range(15f, 25f) * UnityEngine.Random.Range(1f, 1.5f); this.ySway = UnityEngine.Random.Range(7f, 12f) * UnityEngine.Random.Range(1f, 1.5f); this.pos = new Vector2(UnityEngine.Random.Range(0f, 1400f), UnityEngine.Random.Range(0f, 900f)); }
public ISpell GenerateAttack() { if (isBlizzardNext) { var blizzard = new Blizzard(this.Unit.AttackPoints * 2); Validator.HasEnoughEnergy(this.Unit, blizzard); isBlizzardNext = false; Unit.EnergyPoints -= blizzard.EnergyCost; return(blizzard); } else { var fireBreath = new FireBreath(this.Unit.AttackPoints); Validator.HasEnoughEnergy(this.Unit, fireBreath); isBlizzardNext = true; Unit.EnergyPoints -= fireBreath.EnergyCost; return(fireBreath); } }
public override ISpell GenerateAttack() { if (lastSuccessfulAttack == "FireBreath") { int energyCost = new Blizzard(0).EnergyCost; if (this.Unit.EnergyPoints >= energyCost) { lastSuccessfulAttack = "Blizzard"; this.Unit.EnergyPoints -= energyCost; return new Blizzard(this.Unit.AttackPoints * 2); } } else if (lastSuccessfulAttack == "Blizzard") { int energyCost = new FireBreath(0).EnergyCost; if (this.Unit.EnergyPoints >= energyCost) { lastSuccessfulAttack = "FireBreath"; this.Unit.EnergyPoints -= energyCost; return new FireBreath(this.Unit.AttackPoints); } } throw new NotEnoughEnergyException(string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, lastSuccessfulAttack == "Blizzard" ? "FireBreath" : "Blizzard")); }
public override ISpell GenerateAttack() { ISpell attack; if (this.spellCount % 2 == 0) { attack = new FireBreath(this.Unit.AttackPoints); } else { attack = new Blizzard(this.Unit.AttackPoints * 2); } if (this.Unit.EnergyPoints < attack.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name)); } this.spellCount++; this.Unit.EnergyPoints -= attack.EnergyCost; return(attack); }
public void SelectInSpell(int s) { clean(); switch (s) { case 0: spellText = GameObject.Instantiate(Resources.Load("SpellTexts/MeteorText")) as GameObject; Destroy(escolhida [3].icon); escolhida[3] = new Meteor(); spellbook.UpdateSpellIcons(); break; case 1: spellText = GameObject.Instantiate(Resources.Load("SpellTexts/BlizzardText")) as GameObject; if (liberada [3] == 1) { Destroy(escolhida [3].icon); escolhida [3] = new Blizzard(); spellbook.UpdateSpellIcons(); } else { buttonLiberar = GameObject.Instantiate(Resources.Load("ButC")) as GameObject; buttonLiberar.GetComponent <CompItem>().setSpSelec(3); } break; } }
public override ISpell GenerateAttack() { ISpell attack; if (this.spellCount % 2 == 0) { attack = new FireBreath(this.Unit.AttackPoints); } else { attack = new Blizzard(this.Unit.AttackPoints * 2); } if (this.Unit.EnergyPoints < attack.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name)); } this.spellCount++; this.Unit.EnergyPoints -= attack.EnergyCost; return attack; }
public override ISpell GenerateAttack() { ISpell currentSpell; if (this.firstAttack) { currentSpell = new FireBreath(this.Unit.AttackPoints); } else { currentSpell = new Blizzard(this.Unit.AttackPoints * 2); } if (this.Unit.EnergyPoints < currentSpell.EnergyCost) { throw new NotEnoughEnergyException( string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, currentSpell.GetType().Name)); } this.firstAttack = !this.firstAttack; this.Unit.EnergyPoints -= currentSpell.EnergyCost; return currentSpell; }
public override ISpell GenerateAttack() { ISpell currentSpell; if (this.firstAttack) { currentSpell = new FireBreath(this.Unit.AttackPoints); } else { currentSpell = new Blizzard(this.Unit.AttackPoints * 2); } if (this.Unit.EnergyPoints < currentSpell.EnergyCost) { throw new NotEnoughEnergyException( string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, currentSpell.GetType().Name)); } this.firstAttack = !this.firstAttack; this.Unit.EnergyPoints -= currentSpell.EnergyCost; return(currentSpell); }
public ISpell GenerateAttack() { if (isBlizzardNext) { var blizzard = new Blizzard(this.Unit.AttackPoints * 2); Validator.HasEnoughEnergy(this.Unit, blizzard); isBlizzardNext = false; Unit.EnergyPoints -= blizzard.EnergyCost; return blizzard; } else { var fireBreath = new FireBreath(this.Unit.AttackPoints); Validator.HasEnoughEnergy(this.Unit, fireBreath); isBlizzardNext = true; Unit.EnergyPoints -= fireBreath.EnergyCost; return fireBreath; } }
public Skill CreateSkill(Player player) { List <Skill> playerSkills = player.ListOfSkills; Skill known = CheckContent(playerSkills); if (known == null) { Blizzard s1 = new Blizzard(); LightningChain s2 = new LightningChain(); EarthShield s3 = new EarthShield(); List <Skill> tmp = new List <Skill>(); if (s1.MinimumLevel <= player.Level) { tmp.Add(s1); } if (s2.MinimumLevel <= player.Level) { tmp.Add(s2); } if (s3.MinimumLevel <= player.Level) { tmp.Add(s3); } if (tmp.Count == 0) { return(null); } return(tmp[Index.RNG(0, tmp.Count)]); } else if (known.decoratedSkill == null) { BlizzardDecorator s1 = new BlizzardDecorator(known); LightningChainDecorator s2 = new LightningChainDecorator(known); EarthShieldDecorator s3 = new EarthShieldDecorator(known); List <Skill> tmp = new List <Skill>(); if (s1.MinimumLevel <= player.Level) { tmp.Add(s1); } if (s2.MinimumLevel <= player.Level) { tmp.Add(s2); } if (s3.MinimumLevel <= player.Level) { tmp.Add(s3); } if (tmp.Count == 0) { return(null); } return(tmp[Index.RNG(0, tmp.Count)]); } else { return(null); } }
public ScrollingTexture(Room room, Blizzard owner, string sprite, float scrollSpeed, float alpha) { this.owner = owner; this.spriteName = sprite; this.scrollSpeed = scrollSpeed; this.alpha = Mathf.Lerp(0f, alpha, room.roomSettings.RainIntensity); Debug.Log("DOWNPOUR: ScrollingTexture Added"); }
public ActionResult DeleteConfirmed(int id) { Blizzard blizzard = db.Blizzards.Find(id); db.Blizzards.Remove(blizzard); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BlizzardId,Employees,Games,CreationDate")] Blizzard blizzard) { if (ModelState.IsValid) { db.Entry(blizzard).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(blizzard)); }
public ActionResult Create([Bind(Include = "BlizzardId,Employees,Games,CreationDate")] Blizzard blizzard) { if (ModelState.IsValid) { db.Blizzards.Add(blizzard); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(blizzard)); }
public override ISpell GenerateAttack() { Spell attack; if (this.previousSpell == null) { attack = new FireBreath(); this.previousSpell = attack; if (this.Unit.EnergyPoints >= attack.EnergyCost) { attack.Damage = this.Unit.AttackPoints; this.Unit.EnergyPoints -= attack.EnergyCost; return(attack); } } else { if (this.previousSpell is FireBreath) { attack = new Blizzard(); if (this.Unit.EnergyPoints >= attack.EnergyCost) { attack.Damage = this.Unit.AttackPoints * 2; this.Unit.EnergyPoints -= attack.EnergyCost; this.previousSpell = attack; return(attack); } } else { attack = new FireBreath(); if (this.Unit.EnergyPoints >= attack.EnergyCost) { attack.Damage = this.Unit.AttackPoints; this.Unit.EnergyPoints -= attack.EnergyCost; this.previousSpell = attack; return(attack); } } } throw new NotEnoughEnergyException( string.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name)); }
// GET: Blizzards/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Blizzard blizzard = db.Blizzards.Find(id); if (blizzard == null) { return(HttpNotFound()); } return(View(blizzard)); }
public ISpell Blizzard() { int damage = this.Unit.AttackPoints * 2; ISpell spell = new Blizzard(damage); if (this.Unit.EnergyPoints < spell.EnergyCost) { throw new NotEnoughEnergyException(this.Unit.Name + " does not have enough energy to cast Blizzard"); } else { this.Unit.EnergyPoints -= spell.EnergyCost; this._flag = 0; return(spell); } }
public override ISpell GenerateAttack() { ISpell spell; if (this.attackCount % 2 == 0) { spell = new FireBreath(this.Unit.AttackPoints); } else { spell = new Blizzard(this.Unit.AttackPoints * 2); } this.ValidateEnergyPoints(this.Unit, spell); this.attackCount++; this.Unit.EnergyPoints -= spell.EnergyCost; return spell; }
public override ISpell GenerateAttack() { if (!fireBreathCasted) { var fireBreath = new FireBreath(this.Unit.AttackPoints); if (this.Unit.EnergyPoints >= fireBreath.EnergyCost) { this.fireBreathCasted = true; this.Unit.EnergyPoints -= fireBreath.EnergyCost; return fireBreath; } else { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, fireBreath.GetType().Name )); } } else { var blizzard = new Blizzard(this.Unit.AttackPoints * 2); if (this.Unit.EnergyPoints >= blizzard.EnergyCost) { fireBreathCasted = false; this.Unit.EnergyPoints -= blizzard.EnergyCost; return blizzard; } else { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, blizzard.GetType().Name )); } } }
public override ISpell GenerateAttack() { ISpell spell; if (this.attackCount % 2 == 0) { spell = new FireBreath(this.Unit.AttackPoints); } else { spell = new Blizzard(this.Unit.AttackPoints * 2); } this.ValidateEnergyPoints(this.Unit, spell); this.attackCount++; this.Unit.EnergyPoints -= spell.EnergyCost; return(spell); }
public void SwitchBlizzard() { if (this.player.room != null) { for (int i = 0; i < this.player.room.updateList.Count; i++) { if (this.player.room.updateList[i] is Blizzard) { this.blizzard = this.player.room.updateList[i] as Blizzard; if (Downpour.debug) { Debug.Log("UPDATED BLIZZARD TO " + this.player.room.abstractRoom.name); } return; } } this.blizzard = null; } }
public override ISpell GenerateAttack() { ISpell spell = null; if (this.prevSpell.GetType() == typeof(FireBreath)) { spell = new Blizzard(2 * base.Unit.AttackPoints); } else { spell = new FireBreath(base.Unit.AttackPoints); } base.TakeEnergy(spell); prevSpell = spell; return(spell); }
void TypeThree() { foreach (Collider intrud in targets) { if (intrud == null) { continue; } Enemy intruder = intrud.GetComponent <Enemy> (); if (intruder == null) { continue; } if (!intruder.isAttackable()) { continue; } if (Time.time - cooldown < rate) { break; } cooldown = Time.time; Vector3 pos = new Vector3(intrud.transform.position.x, intrud.transform.position.y + 0.25f, intrud.transform.position.z); GameObject clone = Instantiate(proyectile, pos, transform.rotation) as GameObject; Blizzard proy = clone.GetComponentInParent <Blizzard> (); proy.target = intrud.transform; proy.lifeTime = rate; proy.slowAmount = 0.1f * (level + 1); if (proy.slowAmount > 0.6f) { proy.slowAmount = 0.6f; } proy.timeSlow = 0.1f * (level + 1); break; } }
public override ISpell GenerateAttack() { ISpell spell = null; if (this.lastSuccessfullSpell == null || this.lastSuccessfullSpell is Blizzard) { spell = new FireBreath(this.Unit.AttackPoints); } else { spell = new Blizzard(this.Unit.AttackPoints * 2); } if (this.Unit.EnergyPoints >= spell.EnergyCost) { this.lastSuccessfullSpell = spell; this.Unit.EnergyPoints -= spell.EnergyCost; return(spell); } throw new NotEnoughEnergyException(string.Format(Messages.NotEnoughEnergyException, this.Unit.Name, spell.GetType().Name)); }
public SorceressAbility CreateAbility(string name) { SorceressAbility ability; switch (name) { case "Blizzard": ability = new Blizzard(); break; case "Lightning": ability = new Lightning(); break; default: throw new ArgumentException($"Invalid ability \"{name}\""); } return(ability); }
public override ISpell GenerateAttack() { /////. Casts Fire Breath and Blizzard, alternating each time he successfully casts a spell /////(i.e. first Fire Breath, next time Blizzard, then Fire Breath again, etc.). ///// Fire Breath damage: Equals the mage's attack points. ///// Blizzard damage: Equals the mage's attack points * 2 ISpell spell; if (this.attackCount % 2 == 0) { spell = new FireBreath(this.Unit.AttackPoints); } else { spell = new Blizzard(this.Unit.AttackPoints * 2); } this.ValidateEnergyPoints(this.Unit, spell); this.attackCount++; this.Unit.EnergyPoints -= spell.EnergyCost; return(spell); }
public Spell GetSpell(SpellId spellId) { Spell s = Spells[(int)spellId]; if (s != null) { return(s); } //Spell s = null; //if (Spells.TryGetValue((int)spellId, out s)) return s; switch (spellId) { case SpellId.ArcaneBolt: s = new ArcaneBolt(this); break; case SpellId.LightningBolt: s = new LightningBolt(this); break; case SpellId.ArcaneMissiles: s = new ArcaneMissiles(this, false); break; case SpellId.ArcaneMissilesMB: s = new ArcaneMissiles(this, true); break; case SpellId.ArcaneMissilesCC: s = new ArcaneMissilesCC(this); break; case SpellId.ArcaneMissilesNoProc: s = new ArcaneMissiles(this, false, true, false, false); break; /*case SpellId.ArcaneMissilesFTF: * s = new ArcaneMissiles(this); * break; * case SpellId.ArcaneMissilesFTT: * s = new ArcaneMissiles(this); * break;*/ case SpellId.Frostbolt: s = new Frostbolt(this); break; case SpellId.FrostboltNoCC: s = new Frostbolt(this, true, false, false); break; case SpellId.Fireball: s = new Fireball(this, false); break; case SpellId.FrostfireBolt: s = new FrostfireBolt(this, false); break; case SpellId.Pyroblast: s = new Pyroblast(this, false); break; case SpellId.FireBlast: s = new FireBlast(this); break; case SpellId.Scorch: s = new Scorch(this); break; case SpellId.ScorchNoCC: s = new Scorch(this, false); break; case SpellId.ArcaneBarrage: s = new ArcaneBarrage(this); break; case SpellId.ArcaneBlast33: s = new ArcaneBlast(this, 3, 3); break; case SpellId.ArcaneBlast33NoCC: s = new ArcaneBlast(this, 3, 3, true, false, false); break; case SpellId.ArcaneBlast00: s = new ArcaneBlast(this, 0, 0); break; case SpellId.ArcaneBlast00NoCC: s = new ArcaneBlast(this, 0, 0, true, false, false); break; case SpellId.ArcaneBlast10: s = new ArcaneBlast(this, 1, 0); break; case SpellId.ArcaneBlast01: s = new ArcaneBlast(this, 0, 1); break; case SpellId.ArcaneBlast11: s = new ArcaneBlast(this, 1, 1); break; case SpellId.ArcaneBlast11NoCC: s = new ArcaneBlast(this, 1, 1, true, false, false); break; case SpellId.ArcaneBlast22: s = new ArcaneBlast(this, 2, 2); break; case SpellId.ArcaneBlast22NoCC: s = new ArcaneBlast(this, 2, 2, true, false, false); break; case SpellId.ArcaneBlast12: s = new ArcaneBlast(this, 1, 2); break; case SpellId.ArcaneBlast23: s = new ArcaneBlast(this, 2, 3); break; case SpellId.ArcaneBlast30: s = new ArcaneBlast(this, 3, 0); break; case SpellId.ABAM: s = new ABAM(this); break; case SpellId.ABMBAM: s = new ABMBAM(this); break; case SpellId.ABABar: s = new ABABar(this); break; case SpellId.ABAMP: s = new ABAMP(this); break; case SpellId.AB3AMSc: s = new AB3AMSc(this); break; case SpellId.ABAM3Sc: s = new ABAM3Sc(this); break; case SpellId.ABAM3Sc2: s = new ABAM3Sc2(this); break; case SpellId.ABAM3FrB: s = new ABAM3FrB(this); break; case SpellId.ABAM3FrB2: s = new ABAM3FrB2(this); break; case SpellId.ABFrB: s = new ABFrB(this); break; case SpellId.AB3FrB: s = new AB3FrB(this); break; case SpellId.ABFrB3FrB: s = new ABFrB3FrB(this); break; case SpellId.ABFrB3FrB2: s = new ABFrB3FrB2(this); break; case SpellId.ABFrB3FrBSc: s = new ABFrB3FrBSc(this); break; case SpellId.ABFB3FBSc: s = new ABFB3FBSc(this); break; case SpellId.AB3Sc: s = new AB3Sc(this); break; case SpellId.FireballScorch: s = new FireballScorch(this); break; case SpellId.FireballFireBlast: s = new FireballFireBlast(this); break; case SpellId.ABAM3ScCCAM: s = new ABAM3ScCCAM(this); break; case SpellId.ABAM3Sc2CCAM: s = new ABAM3Sc2CCAM(this); break; case SpellId.ABAM3FrBCCAM: s = new ABAM3FrBCCAM(this); break; case SpellId.ABAM3FrBCCAMFail: s = new ABAM3FrBCCAMFail(this); break; case SpellId.ABAM3FrBScCCAM: s = new ABAM3FrBScCCAM(this); break; case SpellId.ABAMCCAM: s = new ABAMCCAM(this); break; case SpellId.ABAM3CCAM: s = new ABAM3CCAM(this); break; case SpellId.ArcaneExplosion: s = new ArcaneExplosion(this); break; case SpellId.FlamestrikeSpammed: s = new Flamestrike(this, true); break; case SpellId.FlamestrikeSingle: s = new Flamestrike(this, false); break; case SpellId.Blizzard: s = new Blizzard(this); break; case SpellId.BlastWave: s = new BlastWave(this); break; case SpellId.DragonsBreath: s = new DragonsBreath(this); break; case SpellId.ConeOfCold: s = new ConeOfCold(this); break; case SpellId.ArcaneBlast0POM: s = new ArcaneBlast(this, 0, 0, false, false, true); break; case SpellId.FireballPOM: s = new Fireball(this, true); break; case SpellId.FrostboltPOM: s = new Frostbolt(this, false, false, true); break; case SpellId.PyroblastPOM: s = new Pyroblast(this, true); break; case SpellId.CustomSpellMix: s = new SpellCustomMix(this); break; } if (s != null) { s.SpellId = spellId; Spells[(int)spellId] = s; } return(s); }
public Spells() { Items = new List <BaseSpell>(); goblinWave = new GoblinWave(); Items.Add(goblinWave); wolfPack = new WolfPack(); Items.Add(wolfPack); siege = new Siege(); Items.Add(siege); orcWave = new OrcWave(); Items.Add(orcWave); trollWave = new TrollWave(); Items.Add(trollWave); blackHorsemen = new BlackHorsemen(); Items.Add(blackHorsemen); giant = new Giant(); Items.Add(giant); dragon = new Dragon(); Items.Add(dragon); spark = new Spark(); Items.Add(spark); eletroCharge = new EletroCharge(); Items.Add(eletroCharge); lightning = new Lightning(); Items.Add(lightning); discharge = new Discharge(); Items.Add(discharge); thunderShock = new ThunderShock(); Items.Add(thunderShock); thunderBolt = new ThunderBolt(); Items.Add(thunderBolt); lightningStorm = new LightningStorm(); Items.Add(lightningStorm); thunder = new Thunder(); Items.Add(thunder); mudStrike = new MudStrike(); Items.Add(mudStrike); rockThrow = new RockThrow(); Items.Add(rockThrow); vineWhip = new VineWhip(); Items.Add(vineWhip); razorLeaf = new RazorLeaf(); Items.Add(razorLeaf); seedBombs = new SeedBombs(); Items.Add(seedBombs); rockBlast = new RockBlast(); Items.Add(rockBlast); photosynthesis = new Photosynthesis(); Items.Add(photosynthesis); earthQuake = new Earthquake(); Items.Add(earthQuake); wave = new Wave(); Items.Add(wave); whirlwind = new Whirlwind(); Items.Add(whirlwind); icyspikes = new IcySpikes(); Items.Add(icyspikes); ringoffrost = new RingOfFrost(); Items.Add(ringoffrost); frozenPillar = new FrozenPillar(); Items.Add(frozenPillar); frostWave = new FrostWave(); Items.Add(frostWave); storm = new Storm(); Items.Add(storm); blizzard = new Blizzard(); Items.Add(blizzard); fireball = new Fireball(); Items.Add(fireball); firewave = new Firewave(); Items.Add(firewave); imoloate = new Imoloate(); Items.Add(imoloate); fireblast = new FireBlast(); Items.Add(fireblast); ringoffire = new RingOfFire(); Items.Add(ringoffire); lavastrike = new LavaStrike(); Items.Add(lavastrike); dragonBreath = new DragonBreath(); Items.Add(dragonBreath); }
public override void Update(bool eu) { base.Update(eu); if (Downpour.debug && this.room.BeingViewed && Input.GetKeyDown(KeyCode.Minus)) { Debug.Log("LIGHTNING STRIKE!"); this.room.AddObject(new LightningStrike(this)); } if (this.room.BeingViewed) { this.camPos = this.room.game.cameras[0].pos + new Vector2(this.room.game.rainWorld.screenSize.x / 2, this.room.game.rainWorld.screenSize.y / 2); } this.isSnow = Downpour.snow; if (isSnow) { if (Downpour.blizzard && (this.room.world.rainCycle.timer - this.room.world.rainCycle.cycleLength) / 2400f > -0.5f && this.blizzard == null) { this.blizzard = new Blizzard(this); this.room.AddObject(this.blizzard); } this.rainAmount = Mathf.Lerp(Downpour.rainAmount * 0.5f, Downpour.rainAmount, RainFall.rainIntensity); this.rainLimit = (int)Mathf.Lerp(Mathf.Lerp(0f, this.rainAmount * 50, this.room.roomSettings.RainIntensity), Mathf.Lerp(this.rainAmount * 50, (this.rainAmount * 80), this.room.roomSettings.RainIntensity), RainFall.rainIntensity); } else { this.rainAmount = Mathf.Lerp(0, Downpour.rainAmount, RainFall.rainIntensity); this.rainLimit = (int)Mathf.Lerp(0, Mathf.Lerp(0f, (this.rainAmount * 9), this.room.roomSettings.RainIntensity), RainFall.rainIntensity); } this.player = (room.game.Players.Count <= 0) ? null : (room.game.Players[0].realizedCreature as Player); if (this.room.game != null && this.room != null && !room.abstractRoom.gate && this.room.ReadyForPlayer) { if (this.room.game != null && !this.room.abstractRoom.shelter && Downpour.lightning && this.room.roomRain != null) { if (this.room.roomRain.dangerType == RoomRain.DangerType.Rain && RainFall.rainIntensity > 0.7f && this.room.lightning == null) { this.room.lightning = new Lightning(this.room, 1f, false); this.room.lightning.bkgOnly = true; this.room.AddObject(this.room.lightning); } if (this.room.roomRain.dangerType == RoomRain.DangerType.FloodAndRain && RainFall.rainIntensity > 0.7f && this.room.lightning == null) { this.room.lightning = new Lightning(this.room, 1f, false); this.room.lightning.bkgOnly = true; this.room.AddObject(this.room.lightning); } } if (!isSnow) { this.snowFlakes = 0; if (!RainFall.noRainThisCycle && this.rainDrops < ((this.room.Width - this.ceilingCount) * this.rainLimit) / this.room.Width) { this.AddRaindrops(rainLimit - this.rainDrops); } if (this.room.lightning != null && this.room.BeingViewed && this.room.roomRain != null && this.room.roomRain.dangerType == RoomRain.DangerType.Rain && Downpour.strike && UnityEngine.Random.value < RainFall.rainIntensity * 0.0010f) { this.room.AddObject(new LightningStrike(this)); } } else { this.rainDrops = 0; if (!RainFall.noRainThisCycle && this.snowFlakes < ((this.room.Width - this.ceilingCount) * this.rainLimit) / this.room.Width) { this.AddSnowflakes(rainLimit - this.snowFlakes); } if (this.room.lightning != null && this.room.BeingViewed && this.room.roomRain != null && this.room.roomRain.dangerType == RoomRain.DangerType.Rain && Downpour.strike && UnityEngine.Random.value < RainFall.rainIntensity * 0.0010f) { this.room.AddObject(new LightningStrike(this)); } } } if (Downpour.snow && Downpour.dust && RainFall.rainList.Contains(this.room.abstractRoom.name)) { for (int i = 0; i < this.room.game.Players.Count; i++) { if (this.room.game.Players[i].realizedCreature != null && this.room.game.Players[i].realizedCreature.room == this.room) { for (int j = 0; j < this.room.game.Players[i].realizedCreature.bodyChunks.Length; j++) { if (this.room.game.Players[i].realizedCreature.bodyChunks[j].ContactPoint.y < 0) { if (this.room.game.Players[i].realizedCreature.bodyChunks[j].lastContactPoint.y >= 0 && this.room.game.Players[i].realizedCreature.bodyChunks[j].lastPos.y - this.room.game.Players[i].realizedCreature.bodyChunks[j].pos.y > 5f) { this.room.AddObject(new SnowDust(this.room.game.Players[i].realizedCreature.bodyChunks[j].pos + new Vector2(0f, -this.room.game.Players[i].realizedCreature.bodyChunks[j].rad), Custom.LerpMap(this.room.game.Players[i].realizedCreature.bodyChunks[j].lastPos.y - this.room.game.Players[i].realizedCreature.bodyChunks[j].pos.y, 5f, 10f, 0.5f, 1f))); } else if (UnityEngine.Random.value < 0.1f && Mathf.Abs(this.room.game.Players[i].realizedCreature.bodyChunks[j].lastPos.x - this.room.game.Players[i].realizedCreature.bodyChunks[j].pos.x) > 3f) { this.room.AddObject(new SnowDust(this.room.game.Players[i].realizedCreature.bodyChunks[j].pos + new Vector2(0f, -this.room.game.Players[i].realizedCreature.bodyChunks[j].rad), 0.25f * UnityEngine.Random.value)); } } } } } } }
void Awake() { g_instance = this; }