Advertisement
Krythic

Rune

Nov 25th, 2019
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.03 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using VoidwalkerEngine.Framework.Collections;
  3. using VoidwalkerEngine.Framework.Interfaces;
  4. using VoidwalkerEngine.Framework.Logic;
  5. using VoidwalkerEngine.Framework.Systems.Items.Base;
  6.  
  7. namespace VoidwalkerEngine.Framework.Systems.Items.Augmentations
  8. {
  9.     public class Rune : GameItem, IStackable, IModifierProvider
  10.     {
  11.         public RuneType RuneType { get; set; }
  12.         public int Count { get; set; }
  13.         public int StackSize { get; set; }
  14.         public List<ItemConstraint> ItemConstraints { get; set; }
  15.         public ItemModifierList Modifiers { get; set; }
  16.  
  17.         public Rune()
  18.         {
  19.             this.StackSize = 20;
  20.         }
  21.  
  22.         public Rune(RuneType runeType)
  23.             : this()
  24.         {
  25.             this.RuneType = runeType;
  26.         }
  27.  
  28.         public int GetRemainingStackSpace()
  29.         {
  30.             return this.StackSize - this.Count;
  31.         }
  32.  
  33.         public bool IsStackableWith(IStackable other)
  34.         {
  35.             if (other is Rune rune)
  36.             {
  37.                 if (this.RuneType == rune.RuneType)
  38.                 {
  39.                     return true;
  40.                 }
  41.             }
  42.             return false;
  43.         }
  44.  
  45.         public static Rune CreateRune(RuneType runeType)
  46.         {
  47.             return new Rune
  48.             {
  49.                 Header = runeType.GetRuneHeader(),
  50.                 Name = "Rune",
  51.                 Quality = QualityType.Rune,
  52.                 ItemConstraints = runeType.GetItemConstraints(),
  53.                 FlavorText = runeType.GetFlavorText(),
  54.                 BaseSellPrice = runeType.GetBaseSellPrice(),
  55.                 Modifiers = new ItemModifierList()
  56.                 {
  57.                     runeType.GetModifier()
  58.                 },
  59.                 Identifier = "Rune_" + runeType.GetRuneHeader() + "_" + (int)runeType,
  60.                 Level = runeType.GetItemLevel(),
  61.                 // Icon = blah, blah, unqiue icon for each Rune and shit
  62.                  
  63.             };
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement