protected internal override void Apply(Hero hero) { SetKnown(); Buff.Affect <Levitation>(hero, Levitation.Duration); GLog.Information("You float into the air!"); }
public virtual void Press(int cell, actors.Character ch) { if (pit[cell] && ch == Dungeon.Hero) { Chasm.HeroFall(cell); return; } var trap = false; switch (map[cell]) { case Terrain.SECRET_TOXIC_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.TOXIC_TRAP; case Terrain.TOXIC_TRAP: trap = true; ToxicTrap.Trigger(cell, ch); break; case Terrain.SECRET_FIRE_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.FIRE_TRAP; case Terrain.FIRE_TRAP: trap = true; FireTrap.Trigger(cell, ch); break; case Terrain.SECRET_PARALYTIC_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.PARALYTIC_TRAP; case Terrain.PARALYTIC_TRAP: trap = true; ParalyticTrap.Trigger(cell, ch); break; case Terrain.SECRET_POISON_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.POISON_TRAP; case Terrain.POISON_TRAP: trap = true; PoisonTrap.Trigger(cell, ch); break; case Terrain.SECRET_ALARM_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.ALARM_TRAP; case Terrain.ALARM_TRAP: trap = true; AlarmTrap.Trigger(cell, ch); break; case Terrain.SECRET_LIGHTNING_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.LIGHTNING_TRAP; case Terrain.LIGHTNING_TRAP: trap = true; LightningTrap.Trigger(cell, ch); break; case Terrain.SECRET_GRIPPING_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.GRIPPING_TRAP; case Terrain.GRIPPING_TRAP: trap = true; GrippingTrap.Trigger(cell, ch); break; case Terrain.SECRET_SUMMONING_TRAP: GLog.Information(TXT_HIDDEN_PLATE_CLICKS); goto case Terrain.SUMMONING_TRAP; case Terrain.SUMMONING_TRAP: trap = true; SummoningTrap.Trigger(cell, ch); break; case Terrain.HIGH_GRASS: HighGrass.Trample(this, cell, ch); break; case Terrain.WELL: WellWater.AffectCell(cell); break; case Terrain.ALCHEMY: if (ch == null) { Alchemy.Transmute(cell); } break; case Terrain.DOOR: Door.Enter(cell); break; } if (trap) { Sample.Instance.Play(Assets.SND_TRAP); if (ch == Dungeon.Hero) { Dungeon.Hero.Interrupt(); } Set(cell, Terrain.INACTIVE_TRAP); GameScene.UpdateMap(cell); } var plant = plants[cell]; if (plant != null) { plant.Activate(ch); } }
public override void Interact() { Sprite.TurnTo(pos, Dungeon.Hero.pos); if (!Quest.given) { var wndQuest = new WndQuest(this, Quest.alternative ? TXT_BLOOD_1 : TXT_GOLD_1); wndQuest.BackPressedAction = () => { Quest.given = true; Quest.completed = false; var pick = new Pickaxe(); if (pick.DoPickUp(Dungeon.Hero)) { GLog.Information(Hero.TxtYouNowHave, pick.Name); } else { Dungeon.Level.Drop(pick, Dungeon.Hero.pos).Sprite.Drop(); } }; GameScene.Show(wndQuest); Journal.Add(Journal.Feature.TROLL); } else if (!Quest.completed) { if (Quest.alternative) { var pick = Dungeon.Hero.Belongings.GetItem <Pickaxe>(); if (pick == null) { Tell(TXT2); } else if (!pick.BloodStained) { Tell(TXT4); } else { if (pick.IsEquipped(Dungeon.Hero)) { pick.DoUnequip(Dungeon.Hero, false); } pick.Detach(Dungeon.Hero.Belongings.Backpack); Tell(TXT_COMPLETED); Quest.completed = true; Quest.reforged = false; } } else { var pick = Dungeon.Hero.Belongings.GetItem <Pickaxe>(); var gold = Dungeon.Hero.Belongings.GetItem <DarkGold>(); if (pick == null) { Tell(TXT2); } else if (gold == null || gold.Quantity() < 15) { Tell(TXT3); } else { if (pick.IsEquipped(Dungeon.Hero)) { pick.DoUnequip(Dungeon.Hero, false); } pick.Detach(Dungeon.Hero.Belongings.Backpack); gold.DetachAll(Dungeon.Hero.Belongings.Backpack); Tell(TXT_COMPLETED); Quest.completed = true; Quest.reforged = false; } } } else if (!Quest.reforged) { GameScene.Show(new WndBlacksmith(this, Dungeon.Hero)); } else { Tell(TXT_GET_LOST); } }