Beispiel #1
0
        // 00x66CCEE
        public static void Trigger(int pos, Character ch)
        {
            if (ch != null)
            {
                ch.Damage(Math.Max(1, Random.Int(ch.HP / 3, 2 * ch.HP / 3)), LIGHTNING);
                if (ch == Dungeon.Hero)
                {
                    Camera.Main.Shake(2, 0.3f);

                    if (!ch.IsAlive)
                    {
                        Dungeon.Fail(Utils.Format(ResultDescriptions.TRAP, name, Dungeon.Depth));
                        GLog.Negative("You were killed by a discharge of a lightning trap...");
                    }
                    else
                    {
                        ((Hero)ch).Belongings.Charge(false);
                    }
                }

                var points = new int[2];

                points[0] = pos - Level.Width;
                points[1] = pos + Level.Width;
                ch.Sprite.Parent.Add(new Lightning(points, 2, null));

                points[0] = pos - 1;
                points[1] = pos + 1;
                ch.Sprite.Parent.Add(new Lightning(points, 2, null));
            }

            CellEmitter.Center(pos).Burst(SparkParticle.Factory, Random.IntRange(3, 4));
        }
Beispiel #2
0
        public override int AttackProc(Character enemy, int damage)
        {
            if (Random.Int(2) == 0)
            {
                buffs.Buff.Affect <Burning>(enemy).Reignite(enemy);
            }

            return(damage);
        }
Beispiel #3
0
 public static void Trigger(int pos, Character c)
 {
     if (c != null)
     {
         var damage = Math.Max(0, (Dungeon.Depth + 3) - Random.IntRange(0, c.Dr() / 2));
         Buff.Affect <Bleeding>(c).Set(damage);
         Buff.Prolong <Cripple>(c, Cripple.Duration);
         Wound.Hit(c);
     }
     else
     {
         Wound.Hit(pos);
     }
 }
Beispiel #4
0
        public override int AttackProc(Character enemy, int damage)
        {
            if (Random.Int(6) != 0 || enemy != Dungeon.Hero)
            {
                return(damage);
            }

            var hero   = Dungeon.Hero;
            var weapon = hero.Belongings.Weapon;

            if (weapon == null || weapon is Knuckles || weapon.cursed)
            {
                return(damage);
            }

            hero.Belongings.Weapon = null;
            Dungeon.Level.Drop(weapon, hero.pos).Sprite.Drop();
            GLog.Warning(TxtDisarm, Name, weapon.Name);

            return(damage);
        }
Beispiel #5
0
        public override void Add(Buff buff)
        {
            if (buff is Burning)
            {
                if (HP >= HT)
                {
                    return;
                }

                HP++;
                Sprite.Emitter().Burst(Speck.Factory(Speck.HEALING), 1);
            }
            else
            {
                if (buff is Frost)
                {
                    Damage(Random.NormalIntRange(1, HT * 2 / 3), buff);
                }

                Actor.Add(buff);
            }
        }
Beispiel #6
0
 public override int DamageRoll()
 {
     return(Random.NormalIntRange(16, 20));
 }