Advertisement
Krythic

Item Generator Usage

Dec 16th, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.51 KB | None | 0 0
  1. using GrimoireTacticsGame.Client;
  2. using System;
  3. using System.Collections.Generic;
  4. using VoidwalkerEngine.Framework.Algorithms;
  5. using VoidwalkerEngine.Framework.Collections;
  6. using VoidwalkerEngine.Framework.DataTypes;
  7. using VoidwalkerEngine.Framework.Logic;
  8. using VoidwalkerEngine.Framework.Maths;
  9. using VoidwalkerEngine.Framework.Systems.Items;
  10. using VoidwalkerEngine.Framework.Systems.Items.Templates;
  11.  
  12. namespace GrimoireTacticsGame
  13. {
  14.     public static class Program
  15.     {
  16.         /// <summary>
  17.         /// The main entry point for the application.
  18.         /// </summary>
  19.         [STAThread]
  20.         public static void Main()
  21.         {
  22.             using (GameWindow client = new GameWindow())
  23.             {
  24.                 LegendaryTemplate template = new LegendaryTemplate
  25.                 {
  26.                     Header = "Wraithskin",
  27.                     FlavorText = "Some legendary flavor text",
  28.                     ItemConstraints = new List<ItemConstraint>
  29.                     {
  30.                         ItemConstraint.MediumChestwear
  31.                     },
  32.                     LevelBracket = new Range(0, 100),
  33.                     Modifiers = new ItemModifiers()
  34.                     {
  35.                         ExplicitModifiers = new ItemModifierList()
  36.                         {
  37.                             new ItemModifier(ItemModifierTrait.EnhancedArmorRating,25),
  38.                             new ItemModifier(ItemModifierTrait.ExtraShadowDamage,10,20),
  39.                             new ItemModifier(ItemModifierTrait.ShadowResistance,25),
  40.                             new ItemModifier(ItemModifierTrait.RepairDurability,10)
  41.                         }
  42.                     }
  43.                 };
  44.                 // Create the base item
  45.                 Armor armor = new Armor
  46.                 {
  47.                     Name = "Leather Vest",
  48.                     Weight = ArmorWeight.Medium,
  49.                     Category = ArmorCategory.Chestwear,
  50.                     BaseDurability = 75,
  51.                     BaseArmorRating = 20,
  52.                 };
  53.                 for(int i = 0; i < 10; i++)
  54.                 {
  55.                     Console.WriteLine();
  56.                     LootDropArgs lootParams = new LootDropArgs(75, 50, 25);
  57.                     LootGenerator generator = new LootGenerator(new List<LegendaryTemplate>() { template });
  58.                     Armor rolledArmor = generator.Generate(armor, lootParams, 30, 0);
  59.                     rolledArmor.Repair();
  60.  
  61.  
  62.                     // Print the generated item
  63.                     Console.WriteLine(rolledArmor.Header);
  64.                     Console.WriteLine(rolledArmor.Name);
  65.                     Console.WriteLine(rolledArmor.Weight.ToString() + " " + rolledArmor.Category.ToString());
  66.                     Console.WriteLine(rolledArmor.GetMaximumArmorRating() + " Armor");
  67.                     Console.WriteLine(rolledArmor.Durability + "/" + rolledArmor.GetMaximumDurability() + " Durability");
  68.                     ItemModifierList accumulativeModifiers = rolledArmor.Modifiers.GetModifiers();
  69.                     foreach (ItemModifier modifier in accumulativeModifiers)
  70.                     {
  71.                         Console.WriteLine(modifier.ToToolTipText());
  72.                     }
  73.                     if (!String.IsNullOrEmpty(rolledArmor.FlavorText))
  74.                     {
  75.                         Console.WriteLine("\"" + rolledArmor.FlavorText + "\"");
  76.                     }
  77.                 }
  78.                 client.Run();
  79.             }
  80.         }
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement