private void Transport(Heap heap) { var item = heap.PickUp(); if (item.DoPickUp(CurUser)) { if (item is Dewdrop) { return; } if ((item is ScrollOfUpgrade && ((ScrollOfUpgrade)item).IsKnown) || (item is PotionOfStrength && ((PotionOfStrength)item).IsKnown)) { GLog.Positive(TxtYouNowHave, item.Name); } else { GLog.Information(TxtYouNowHave, item.Name); } } else { Dungeon.Level.Drop(item, CurUser.pos).Sprite.Drop(); } }
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 Apply(Hero hero) { SetKnown(); hero.STR++; hero.Sprite.ShowStatus(CharSprite.Positive, "+1 str"); GLog.Positive("Newfound strength surges through your body."); Badge.ValidateStrengthAttained(); }
protected internal override void Apply(Hero hero) { SetKnown(); hero.STR++; hero.HT += 5; hero.HP += 5; hero.Sprite.ShowStatus(CharSprite.Positive, "+1 str, +5 ht"); GLog.Positive("Newfound strength surges through your body."); }
private bool ActPickUp(HeroAction.PickUp action) { var dst = action.Dst; if (pos == dst) { var heap = Dungeon.Level.heaps[pos]; if (heap != null) { var item = heap.PickUp(); if (item.DoPickUp(this)) { if (!(item is Dewdrop)) { if ((item is ScrollOfUpgrade && ((ScrollOfUpgrade)item).IsKnown) || (item is PotionOfStrength && ((PotionOfStrength)item).IsKnown)) { GLog.Positive(TxtYouNowHave, item.Name); } else { GLog.Information(TxtYouNowHave, item.Name); } } if (!heap.IsEmpty) { GLog.Information(TxtSomethingElse); } curAction = null; } else { Dungeon.Level.Drop(item, pos).Sprite.Drop(); Ready(); } } else { Ready(); } return(false); } if (GetCloser(dst)) { return(true); } Ready(); return(false); }
protected internal override void OnItemSelected(Item item) { ScrollOfRemoveCurse.Uncurse(Dungeon.Hero, item); item.Upgrade(); GLog.Positive(TxtLooksBetter, item.Name); Badge.ValidateItemLevelAquired(item); Upgrade(CurUser); }
public virtual void collectDew(Dewdrop dew) { GLog.Information(TxtCollected); _volume += dew.quantity; if (_volume >= MaxVolume) { _volume = MaxVolume; GLog.Positive(TxtFull); } UpdateQuickslot(); }
protected internal override void OnItemSelected(Item item) { var weapon = (Weapon)item; ScrollOfRemoveCurse.Uncurse(Dungeon.Hero, weapon); weapon.Upgrade(true); GLog.Positive(TxtLooksBetter, weapon.Name); Badge.ValidateItemLevelAquired(weapon); CurUser.Sprite.Emitter().Start(Speck.Factory(Speck.UP), 0.2f, 3); }
public virtual void EarnExp(int exp) { Exp += exp; var levelUp = false; while (Exp >= MaxExp()) { Exp -= MaxExp(); Lvl++; HT += 5; HP += 5; _attackSkill++; _defenseSkill++; if (Lvl < 10) { UpdateAwareness(); } levelUp = true; } if (levelUp) { GLog.Positive(TxtNewLevel, Lvl); Sprite.ShowStatus(CharSprite.Positive, TxtLevelUp); Sample.Instance.Play(Assets.SND_LEVELUP); Badge.ValidateLevelReached(); } if (subClass != HeroSubClass.WARLOCK) { return; } var value = Math.Min(HT - HP, 1 + (Dungeon.Depth - 1) / 5); if (value > 0) { HP += value; Sprite.Emitter().Burst(Speck.Factory(Speck.HEALING), 1); } Buff <Hunger>().Satisfy(10); }
public virtual int Hit(Character enemy, int damage) { Count++; if (Count >= 3) { Badge.ValidateMasteryCombo(Count); GLog.Positive(TxtCombo, Count); Postpone(1.41f - Count / 10f); return((int)(damage * (Count - 2) / 5f)); } Postpone(1.1f); return(0); }
protected internal override bool AffectHero(Hero hero) { Sample.Instance.Play(Assets.SND_DRINK); PotionOfHealing.Heal(hero); hero.Belongings.UncurseEquipped(); hero.Buff <Hunger>().Satisfy(Hunger.Starving); CellEmitter.Get(Pos).Start(ShaftParticle.Factory, 0.2f, 3); Dungeon.Hero.Interrupt(); GLog.Positive(TxtProcced); Journal.Remove(Journal.Feature.WELL_OF_HEALTH); return(true); }
public static void Apply(Weapon weapon, bool forSpeed) { weapon.Detach(weapon.CurUser.Belongings.Backpack); if (forSpeed) { weapon.imbue = Weapon.Imbue.Speed; GLog.Positive(TxtFast, weapon.Name); } else { weapon.imbue = Weapon.Imbue.Accuracy; GLog.Positive(TxtAccurate, weapon.Name); } weapon.CurUser.Sprite.DoOperate(weapon.CurUser.pos); Sample.Instance.Play(Assets.SND_MISS); weapon.CurUser.Spend(TimeToApply); weapon.CurUser.Busy(); }
public void Upgrade(Item item1, Item item2) { Item first, second; if (item2.level > item1.level) { first = item2; second = item1; } else { first = item1; second = item2; } Sample.Instance.Play(Assets.SND_EVOKE); ScrollOfUpgrade.Upgrade(Dungeon.Hero); Item.Evoke(Dungeon.Hero); if (first.IsEquipped(Dungeon.Hero)) { ((EquipableItem)first).DoUnequip(Dungeon.Hero, true); } first.Upgrade(); GLog.Positive(TXT_LOOKS_BETTER, first.Name); Dungeon.Hero.SpendAndNext(2f); Badge.ValidateItemLevelAquired(first); if (second.IsEquipped(Dungeon.Hero)) { ((EquipableItem)second).DoUnequip(Dungeon.Hero, false); } second.DetachAll(Dungeon.Hero.Belongings.Backpack); Quest.reforged = true; Journal.Remove(Journal.Feature.TROLL); }
protected internal override bool AffectHero(Hero hero) { Sample.Instance.Play(Assets.SND_DRINK); Emitter.Parent.Add(new Identification(DungeonTilemap.TileCenterToWorld(Pos))); hero.Belongings.Observe(); for (var i = 0; i < Level.Length; i++) { var terr = Dungeon.Level.map[i]; if ((Terrain.Flags[terr] & Terrain.SECRET) == 0) { continue; } Level.Set(i, Terrain.discover(terr)); GameScene.UpdateMap(i); if (Dungeon.Visible[i]) { GameScene.DiscoverTile(i, terr); } } Buff.Affect <Awareness>(hero, Awareness.Duration); Dungeon.Observe(); Dungeon.Hero.Interrupt(); GLog.Positive(TXT_PROCCED); Journal.Remove(Journal.Feature.WELL_OF_AWARENESS); return(true); }
protected internal override void Shatter(int cell) { PathFinder.BuildDistanceMap(cell, BArray.not(Level.losBlocking, null), DISTANCE); var procd = false; Blob[] blobs = { Dungeon.Level.Blobs[typeof(ToxicGas)], Dungeon.Level.Blobs[typeof(ParalyticGas)] }; foreach (var blob in blobs) { if (blob == null) { continue; } for (var i = 0; i < Level.Length; i++) { if (PathFinder.Distance[i] >= int.MaxValue) { continue; } var value = blob.Cur[i]; if (value <= 0) { continue; } blob.Cur[i] = 0; blob.Volume -= value; procd = true; CellEmitter.Get(i).Burst(Speck.Factory(Speck.DISCOVER), 1); } } var heroAffected = PathFinder.Distance[Dungeon.Hero.pos] < int.MaxValue; if (procd) { splash(cell); Sample.Instance.Play(Assets.SND_SHATTER); SetKnown(); if (heroAffected) { GLog.Positive(TXT_FRESHNESS); } } else { base.Shatter(cell); if (!heroAffected) { return; } GLog.Information(TXT_FRESHNESS); SetKnown(); } }
protected internal override void Apply(Hero hero) { SetKnown(); Heal(Dungeon.Hero); GLog.Positive("Your wounds heal completely."); }