コード例 #1
0
ファイル: Potion.cs プロジェクト: exallium/DotNetHack
 /// <summary>
 /// Creates a (base) instance of Potion/
 /// </summary>
 /// <param name="aType">The type of potion</param>
 /// <param name="aName">The name of the potion.</param>
 /// <param name="aColor">The color of the potion.</param>
 public Potion(PotionType aPotionType, PotionStrength aPotionStrength,
     string aName, Colour aColor)
     : base(ItemType.Potion, aName, '!', aColor)
 {
     PotionType = aPotionType;
     PotionStrength = aPotionStrength;
 }
コード例 #2
0
 public ManaPotion(PotionStrength potionStrength)
 {
     Weight             = 1;
     ManaPotionStrength = potionStrength;
     Name       = GetPotionName();
     ManaAmount = GetPotionManaAmount();
     ItemValue  = ManaAmount / 2;
     Desc       = $"A {Name} that restores {ManaAmount} mana.";
 }
コード例 #3
0
 public HealthPotion(PotionStrength potionStrength)
 {
     Weight = 1;
     HealthPotionStrength = potionStrength;
     Name         = GetPotionName();
     HealthAmount = GetPotionHealthAmount();
     ItemValue    = HealthAmount / 2;
     Desc         = $"A {Name} that restores {HealthAmount} health.";
 }
コード例 #4
0
 public StatPotion(PotionStrength potionStrength, StatType statType)
 {
     Weight         = 1;
     PotionStrength = potionStrength;
     StatPotionType = statType;
     Name           = GetPotionName();
     StatAmount     = GetStatPotionAmount();
     ItemValue      = StatAmount * 10 / 2;
     Desc           = $"A {Name} that increases {StatPotionType.ToString().ToLower()} by {StatAmount}.";
     _statEffectDurationInSeconds = 600;
 }
コード例 #5
0
 public string GetPotionName()
 {
     // Potion naming format is "<potion type> potion" for normal potion
     if (PotionStrength == PotionStrength.Normal)
     {
         return($"{StatPotionType.ToString().ToLower()} potion");
     }
     else
     {
         // Potion naming format is "<potion strength> <potion type> potion" for minor or greater potions
         return($"{PotionStrength.ToString().ToLower()} {StatPotionType.ToString().ToLower()} potion");
     }
 }
コード例 #6
0
 public ElixerOfStrength(PotionStrength aElixerStr)
     : base(aElixerStr)
 {
 }
コード例 #7
0
ファイル: HealthPotion.cs プロジェクト: exallium/DotNetHack
 /// <summary>
 /// HealthPotion
 /// </summary>
 public HealthPotion(PotionStrength aPotionStrength)
     : base(PotionType.Healing, aPotionStrength, "", Colour.White)
 {
 }
コード例 #8
0
ファイル: Elixer.cs プロジェクト: exallium/DotNetHack
 /// <summary>
 /// Elixer
 /// </summary>
 public Elixer(PotionStrength aPotionStrength)
     : base(PotionType.Elixer, aPotionStrength, "", new Colour(ConsoleColor.Magenta))
 {
 }