public void OnSelect(int?target) { if (target == null || target == _warriorArmor.CurUser.pos) { return; } target = Ballistica.Cast(_warriorArmor.CurUser.pos, target.Value, false, true); if (Actor.FindChar(target.Value) != null && target != _warriorArmor.CurUser.pos) { target = Ballistica.Trace[Ballistica.Distance - 2]; } _warriorArmor.CurUser.HP -= (_warriorArmor.CurUser.HP / 3); if (_warriorArmor.CurUser.subClass == HeroSubClass.BERSERKER && _warriorArmor.CurUser.HP <= _warriorArmor.CurUser.HT * Fury.Level) { Buff.Affect <Fury>(_warriorArmor.CurUser); } Invisibility.Dispel(); _dest = target.Value; _warriorArmor.CurUser.Busy(); ((HeroSprite)_warriorArmor.CurUser.Sprite).Jump(_warriorArmor.CurUser.pos, target.Value, this); }
public override void Move() { base.Move(); if (isInvi == Invisibility.MOVE) { if (transform.position.x <= dis && transform.position.x >= -dis) { animator.SetTrigger("isMove"); isInvi = Invisibility.NONE; } else { transform.position += new Vector3(speed, 0, 0) * Time.deltaTime; } } if(isInvi == Invisibility.INVI) { if (transform.position.x <= disAttack && transform.position.x >= -disAttack) { spriteRender.enabled = true; animator.SetTrigger("isMove"); isInvi = Invisibility.NONE; isAttack = true; } else { transform.position += new Vector3(speed, 0, 0) * Time.deltaTime; } } if (isInvi == Invisibility.ATTACK) { transform.position += new Vector3(speed, 0, 0) * Time.deltaTime; } }
protected internal override void DoRead() { new Flare(6, 32).Show(CurUser.Sprite, 2f); Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); var procced = Uncurse(CurUser, CurUser.Belongings.Backpack.Items.ToArray()); procced = Uncurse(CurUser, CurUser.Belongings.Weapon, CurUser.Belongings.Armor, CurUser.Belongings.Ring1, CurUser.Belongings.Ring2) || procced; Buff.Detach <Weakness>(CurUser); if (procced) { GLog.Positive(TxtProcced); } else { GLog.Information(TxtNotProcced); } SetKnown(); CurUser.SpendAndNext(TimeToRead); }
protected internal override void DoRead() { var respawnPoints = Level.NEIGHBOURS8.Select(t => CurUser.pos + t).Where(p => Actor.FindChar(p) == null && (Level.passable[p] || Level.avoid[p])).ToList(); var nImages = Nimages; while (nImages > 0 && respawnPoints.Count > 0) { var index = pdsharp.utils.Random.Index(respawnPoints); var mob = new MirrorImage(); mob.Duplicate(CurUser); GameScene.Add(mob); WandOfBlink.Appear(mob, respawnPoints[index]); respawnPoints.Remove(index); nImages--; } if (nImages < Nimages) { SetKnown(); } Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); CurUser.SpendAndNext(TimeToRead); }
protected internal override void DoRead() { Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); TeleportHero(CurUser); SetKnown(); CurUser.SpendAndNext(TimeToRead); }
public override void OnAttackComplete() { AttackIndicator.Target(_enemy); Attack(_enemy); curAction = null; Invisibility.Dispel(); base.OnAttackComplete(); }
protected internal override void DoRead() { const int length = Level.Length; var map = Dungeon.Level.map; var mapped = Dungeon.Level.mapped; var discoverable = Level.discoverable; var noticed = false; for (var i = 0; i < length; i++) { var terr = map[i]; if (!discoverable[i]) { continue; } mapped[i] = true; if ((Terrain.Flags[terr] & Terrain.SECRET) == 0) { continue; } Level.Set(i, Terrain.discover(terr)); GameScene.UpdateMap(i); if (!Dungeon.Visible[i]) { continue; } GameScene.DiscoverTile(i, terr); Discover(i); noticed = true; } Dungeon.Observe(); GLog.Information(TxtLayout); if (noticed) { Sample.Instance.Play(Assets.SND_SECRET); } SpellSprite.Show(CurUser, SpellSprite.Map); Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); SetKnown(); CurUser.SpendAndNext(TimeToRead); }
protected internal override void DoRead() { CurUser.Sprite.CenterEmitter().Start(Speck.Factory(Speck.NOTE), 0.3f, 5); Sample.Instance.Play(Assets.SND_LULLABY); Invisibility.Dispel(); var count = 0; Mob affected = null; foreach (var mob in Dungeon.Level.mobs) { if (!Level.fieldOfView[mob.pos]) { continue; } Buff.Affect <Sleep>(mob); if (mob.Buff <Sleep>() == null) { continue; } affected = mob; count++; } switch (count) { case 0: GLog.Information("The scroll utters a soothing melody."); break; case 1: if (affected != null) { GLog.Information("The scroll utters a soothing melody and the " + affected.Name + " falls asleep!"); } else { GLog.Information("The scroll utters a soothing melody."); } break; default: GLog.Information("The scroll utters a soothing melody and the monsters fall asleep!"); break; } SetKnown(); CurUser.SpendAndNext(TimeToRead); }
protected internal override void DoRead() { new Flare(5, 32).Color(0xFF0000, true).Show(CurUser.Sprite, 2f); Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); var count = 0; Mob affected = null; foreach (var mob in Dungeon.Level.mobs.ToArray()) { if (!Level.fieldOfView[mob.pos]) { continue; } var terror = Buff.Affect <Terror>(mob, Terror.Duration); terror.Source = CurUser; count++; affected = mob; } switch (count) { case 0: GLog.Information("The scroll emits a brilliant flash of red light"); break; case 1: if (affected != null) { GLog.Information("The scroll emits a brilliant flash of red light and the " + affected.Name + " flees!"); } else { GLog.Information("The scroll emits a brilliant flash of red light"); } break; default: GLog.Information("The scroll emits a brilliant flash of red light and the monsters flee!"); break; } SetKnown(); CurUser.SpendAndNext(TimeToRead); }
public Rogue() { heroTexture = Engine.Engine.GetTexture("Hero/RogueSprite"); Hero.loadSprite(); visible = true; heroRole = Classes.Rogue; inventory.addItem(new Dagger(1, 1)); baseHealth = 225; healthPerLevel = 35; resetLevel(); resetHealth(); canDuelWield = true; abilities[0] = new Mug(); abilities[1] = new Invisibility(); Engine.Engine.Log(health.ToString()); }
public void Invi() { //move.Invi(); if (isInvi == Invisibility.NONE && !isAttack) { spriteRender.enabled = false; isInvi = Invisibility.INVI; } if (isInvi == Invisibility.NONE && isAttack) { isInvi = Invisibility.ATTACK; boxCollider.enabled = true; } }
protected internal override void DoRead() { foreach (var mob in Dungeon.Level.mobs) { mob.Beckon(CurUser.pos); } GLog.Warning("The scroll emits a challenging roar that echoes throughout the dungeon!"); SetKnown(); CurUser.Sprite.CenterEmitter().Start(Speck.Factory(Speck.SCREAM), 0.3f, 3); Sample.Instance.Play(Assets.SND_CHALLENGE); Invisibility.Dispel(); CurUser.SpendAndNext(TimeToRead); }
public Duelist() { heroTexture = Engine.Engine.GetTexture("Hero/Duelist"); Hero.loadSprite(); heroRole = Classes.Duelist; baseHealth = 275; healthPerLevel = 35; requiredBranchLevel = 30; resetLevel(); resetHealth(); Enemies.Enemy.UpdateTargets(this); Enemies.BossEnemy.UpdateBossTargets(this); abilities[0] = new Mug(); abilities[1] = new Invisibility(); abilities[2] = new Parry(); abilities[3] = new Eviscerate(); Engine.Engine.Log(health.ToString()); }
public Ranger() { heroTexture = Engine.Engine.GetTexture("Hero/Ranger"); Hero.loadSprite(); heroRole = Classes.Ranger; baseHealth = 350; healthPerLevel = 35; requiredBranchLevel = 30; resetLevel(); resetHealth(); Enemies.Enemy.UpdateTargets(this); Enemies.BossEnemy.UpdateBossTargets(this); abilities[0] = new Mug(); abilities[1] = new Invisibility(); abilities[2] = new Volley(); abilities[3] = new SteadyShot(); Engine.Engine.Log(health.ToString()); }
public Assassin() { heroTexture = Engine.Engine.GetTexture("Hero/Assassin"); Hero.loadSprite(); heroRole = Classes.Assassin; baseHealth = 450; healthPerLevel = 35; requiredBranchLevel = int.MaxValue; resetLevel(); resetHealth(); abilities[0] = new Mug(); abilities[1] = new Invisibility(); abilities[2] = new Parry(); abilities[3] = new Eviscerate(); abilities[4] = new Assassinate(); abilities[5] = new Poison(); Enemies.Enemy.UpdateTargets(this); Enemies.BossEnemy.UpdateBossTargets(this); }
protected internal override void DoRead() { GameScene.Flash(new Color(0xFFFFFF)); Sample.Instance.Play(Assets.SND_BLAST); Invisibility.Dispel(); foreach (var mob in Dungeon.Level.mobs.Where(mob => Level.fieldOfView[mob.pos])) { Buff.Prolong <Blindness>(mob, pdsharp.utils.Random.Int(3, 6)); mob.Damage(pdsharp.utils.Random.IntRange(1, mob.HT * 2 / 3), this); } Buff.Prolong <Blindness>(CurUser, pdsharp.utils.Random.Int(3, 6)); Dungeon.Observe(); SetKnown(); CurUser.SpendAndNext(TimeToRead); }
public Marksman() { heroTexture = Engine.Engine.GetTexture("Hero/Marksman"); Hero.loadSprite(); heroRole = Classes.Marksman; baseHealth = 400; healthPerLevel = 55; canDuelWield = true; requiredBranchLevel = int.MaxValue; resetLevel(); resetHealth(); abilities[0] = new Mug(); abilities[1] = new Invisibility(); abilities[2] = new Volley(); abilities[3] = new SteadyShot(); abilities[4] = new Vault(); abilities[5] = new EagleEye(); Enemies.Enemy.UpdateTargets(this); Enemies.BossEnemy.UpdateBossTargets(this); }
public void OnSelect(Item item) { if (item != null) { _scroll.OnItemSelected(item); _scroll.CurUser.SpendAndNext(Scroll.TimeToRead); #if !DEBUG Sample.Instance.Play(Assets.SND_READ); #endif Invisibility.Dispel(); } else if (_scroll.IdentifiedByUse) { _scroll.ConfirmCancelation(); } else { _scroll.Collect(_scroll.CurUser.Belongings.Backpack); } }
protected internal override void DoRead() { var count = CurUser.Belongings.Charge(true); Charge(CurUser); Sample.Instance.Play(Assets.SND_READ); Invisibility.Dispel(); if (count > 0) { GLog.Information("a surge of energy courses through your pack, recharging your wand" + (count > 1 ? "s" : "")); SpellSprite.Show(CurUser, SpellSprite.Charge); } else { GLog.Information("a surge of energy courses through your pack, but nothing happens"); } SetKnown(); CurUser.SpendAndNext(TimeToRead); }
public void OnSelect(int?target) { if (target == null) { return; } if (target == _wand.CurUser.pos) { GLog.Information(Wand.TxtSelfTarget); return; } _wand.SetKnown(); _cell = Ballistica.Cast(_wand.CurUser.pos, target.Value, true, _wand.HitChars); _wand.CurUser.Sprite.DoZap(_cell); QuickSlot.Target(_wand, Actor.FindChar(_cell)); if (_wand.CurrrentCharges > 0) { _wand.CurUser.Busy(); _wand.Fx(_cell, this); Invisibility.Dispel(); } else { _wand.CurUser.SpendAndNext(Wand.TimeToZap); GLog.Warning(Wand.TxtFizzles); _wand.levelKnown = true; _wand.UpdateQuickslot(); } }
private static Effect GetEffect(EffectType prim) { Effect eff = null; switch (prim) { case EffectType.Speed: eff = new Speed(); break; case EffectType.Slowness: eff = new Slowness(); break; case EffectType.Haste: eff = new Haste(); break; case EffectType.MiningFatigue: eff = new MiningFatigue(); break; case EffectType.Strength: eff = new Strength(); break; case EffectType.InstantHealth: eff = new InstantHealth(); break; case EffectType.InstantDamage: eff = new InstantDamage(); break; case EffectType.JumpBoost: eff = new JumpBoost(); break; case EffectType.Nausea: eff = new Nausea(); break; case EffectType.Regeneration: eff = new Regeneration(); break; case EffectType.Resistance: eff = new Resistance(); break; case EffectType.FireResistance: eff = new FireResistance(); break; case EffectType.WaterBreathing: eff = new WaterBreathing(); break; case EffectType.Invisibility: eff = new Invisibility(); break; case EffectType.Blindness: eff = new Blindness(); break; case EffectType.NightVision: eff = new NightVision(); break; case EffectType.Hunger: eff = new Hunger(); break; case EffectType.Weakness: eff = new Weakness(); break; case EffectType.Poison: eff = new Poison(); break; case EffectType.Wither: eff = new Wither(); break; case EffectType.HealthBoost: eff = new HealthBoost(); break; case EffectType.Absorption: eff = new Absorption(); break; case EffectType.Saturation: eff = new Saturation(); break; } return(eff); }
public virtual void Consume(Player player) { Effect e = null; switch (Metadata) { case 5: e = new NightVision { Duration = 3600, Level = 0 }; break; case 6: e = new NightVision { Duration = 9600, Level = 0 }; break; case 7: e = new Invisibility { Duration = 3600, Level = 0 }; break; case 8: e = new Invisibility { Duration = 9600, Level = 0 }; break; case 9: e = new JumpBoost { Duration = 3600, Level = 0 }; break; case 10: e = new JumpBoost { Duration = 9600, Level = 0 }; break; case 11: e = new JumpBoost { Duration = 1800, Level = 1 }; break; case 12: e = new FireResistance { Duration = 3600, Level = 0 }; break; case 13: e = new FireResistance { Duration = 9600, Level = 0 }; break; case 14: e = new Speed { Duration = 3600, Level = 0 }; break; case 15: e = new Speed { Duration = 9600, Level = 0 }; break; case 16: e = new Speed { Duration = 1800, Level = 1 }; break; case 17: e = new Slowness { Duration = 3600, Level = 0 }; break; case 18: e = new Slowness { Duration = 4800, Level = 0 }; break; case 19: e = new WaterBreathing { Duration = 3600, Level = 0 }; break; case 20: e = new WaterBreathing { Duration = 9600, Level = 0 }; break; case 21: e = new InstantHealth { Duration = 0, Level = 0 }; break; case 22: e = new InstantHealth { Duration = 0, Level = 1 }; break; case 23: e = new InstantDamage { Duration = 0, Level = 0 }; break; case 24: e = new InstantDamage { Duration = 0, Level = 1 }; break; case 25: e = new Poison { Duration = 900, Level = 0 }; break; case 26: e = new Poison { Duration = 2400, Level = 0 }; break; case 27: e = new Poison { Duration = 440, Level = 1 }; break; case 28: e = new Regeneration { Duration = 900, Level = 0 }; break; case 29: e = new Regeneration { Duration = 2400, Level = 0 }; break; case 30: e = new Regeneration { Duration = 440, Level = 1 }; break; case 31: e = new Strength { Duration = 3600, Level = 0 }; break; case 32: e = new Strength { Duration = 9600, Level = 0 }; break; case 33: e = new Strength { Duration = 1800, Level = 1 }; break; case 34: e = new Weakness { Duration = 1800, Level = 0 }; break; case 35: e = new Weakness { Duration = 4800, Level = 0 }; break; } if (e != null) { player.SetEffect(e); } }
public void Effect(Player player, string effect, int level, int duration) { if ("clear".Equals(effect, StringComparison.InvariantCultureIgnoreCase)) { player.Level.BroadcastMessage($"Removed all effects for {player.Username}.", MessageType.Raw); player.RemoveAllEffects(); return; } EffectType effectType; if (Enum.TryParse(effect, true, out effectType)) { Effect eff = null; switch (effectType) { case EffectType.Speed: eff = new Speed(); break; case EffectType.Slowness: eff = new Slowness(); break; case EffectType.Haste: eff = new Haste(); break; case EffectType.MiningFatigue: eff = new MiningFatigue(); break; case EffectType.Strength: eff = new Strength(); break; case EffectType.InstantHealth: eff = new InstantHealth(); break; case EffectType.InstantDamage: eff = new InstantDamage(); break; case EffectType.JumpBoost: eff = new JumpBoost(); break; case EffectType.Nausea: eff = new Nausea(); break; case EffectType.Regeneration: eff = new Regeneration(); break; case EffectType.Resistance: eff = new Resistance(); break; case EffectType.FireResistance: eff = new FireResistance(); break; case EffectType.WaterBreathing: eff = new WaterBreathing(); break; case EffectType.Invisibility: eff = new Invisibility(); break; case EffectType.Blindness: eff = new Blindness(); break; case EffectType.NightVision: eff = new NightVision(); break; case EffectType.Hunger: eff = new Hunger(); break; case EffectType.Weakness: eff = new Weakness(); break; case EffectType.Poison: eff = new Poison(); break; case EffectType.Wither: eff = new Wither(); break; case EffectType.HealthBoost: eff = new HealthBoost(); break; case EffectType.Absorption: eff = new Absorption(); break; case EffectType.Saturation: eff = new Saturation(); break; } if (eff != null) { eff.Level = level; eff.Duration = duration; eff.Particles = false; player.SetEffect(eff); player.Level.BroadcastMessage($"{player.Username} added effect {effectType} with strenght {level}", MessageType.Raw); } } }
public void Effect(Player player, string effect, int level = 1, int duration = 20) { EffectType effectType; if (Enum.TryParse(effect, true, out effectType)) { Effect eff = null; switch (effectType) { case EffectType.Speed: eff = new Speed(); break; case EffectType.Slowness: eff = new Slowness(); break; case EffectType.Haste: eff = new Haste(); break; case EffectType.MiningFatigue: eff = new MiningFatigue(); break; case EffectType.Strenght: eff = new Strength(); break; case EffectType.InstandHealth: eff = new InstandHealth(); break; case EffectType.InstantDamage: eff = new InstantDamage(); break; case EffectType.JumpBoost: eff = new JumpBoost(); break; case EffectType.Nausea: eff = new Nausea(); break; case EffectType.Regeneration: eff = new Regeneration(); break; case EffectType.Resistance: eff = new Resistance(); break; case EffectType.FireResistance: eff = new FireResistance(); break; case EffectType.WaterBreathing: eff = new WaterBreathing(); break; case EffectType.Invisibility: eff = new Invisibility(); break; case EffectType.Blindness: eff = new Blindness(); break; case EffectType.NightVision: eff = new NightVision(); break; case EffectType.Hunger: eff = new Hunger(); break; case EffectType.Weakness: eff = new Weakness(); break; case EffectType.Poison: eff = new Poison(); break; case EffectType.Wither: eff = new Wither(); break; case EffectType.HealthBoost: eff = new HealthBoost(); break; case EffectType.Absorption: eff = new Absorption(); break; case EffectType.Saturation: eff = new Saturation(); break; case EffectType.Glowing: eff = new Glowing(); break; case EffectType.Levitation: eff = new Levitation(); break; } if (eff != null) { eff.Level = level; eff.Duration = duration; eff.Particles = false; player.SetEffect(eff); player.Level.BroadcastMessage(string.Format("{0} added effect {1} with strenght {2}", player.Username, effectType, level), MessageType.Raw); } } }
void Awake() { invisivel = GetComponent <Invisibility>(); invisivel.cargas = 0; atributos.Initialize(); }