public async Task StartAsync(CancellationToken cancellationToken) { var spellOptions = new SimcSpellOptions() { SpellId = 274740, PlayerLevel = 60 }; var spell = await _simcGenerationService.GenerateSpellAsync(spellOptions); }
public async Task <SimcSpell> GenerateSpellAsync(SimcSpellOptions options) { SimcSpell spell; if (options.ItemLevel != 0) { // TODO: Remove this await once the rest of the library chain supports async better spell = await _simcSpellCreationService.GenerateItemSpellAsync(options); } else { // TODO: Remove this await once the rest of the library chain supports async better spell = await _simcSpellCreationService.GeneratePlayerSpellAsync(options); } return(spell); }
public async Task SSC_Creates_Player_Spell_With_Power() { // Arrange var spellOptions = new SimcSpellOptions() { SpellId = 274740, PlayerLevel = 60 }; // Act var spell = await _spellCreationService.GeneratePlayerSpellAsync(spellOptions); // Assert Assert.IsNotNull(spell); Assert.IsNotNull(spell.Effects); Assert.AreEqual(1.32, spell.Effects[0].Coefficient); Assert.AreEqual(95, spell.Effects[0].ScaleBudget); }
public async Task <SimcSpell> GeneratePlayerSpellAsync(SimcSpellOptions spellOptions) { if (!spellOptions.PlayerLevel.HasValue) { throw new ArgumentNullException(nameof(spellOptions.PlayerLevel), "SpellOptions must include Player Level to generate a player scaled spell."); } if (spellOptions.SpellId <= 0) { throw new ArgumentNullException(nameof(spellOptions.SpellId), "SpellOptions must include Spell ID to generate a player scaled spell."); } var spell = await GeneratePlayerSpellAsync(spellOptions.PlayerLevel.Value, spellOptions.SpellId); return(spell); }
public async Task <SimcSpell> GenerateItemSpellAsync(SimcSpellOptions spellOptions) { if (!spellOptions.ItemQuality.HasValue) { throw new ArgumentNullException(nameof(spellOptions.ItemQuality), "SpellOptions must include Item Quality to generate an item spell."); } if (!spellOptions.ItemInventoryType.HasValue) { throw new ArgumentNullException(nameof(spellOptions.ItemInventoryType), "SpellOptions must include Item Inventory Type to generate an item spell."); } var spell = await BuildItemSpellAsync(spellOptions.SpellId, spellOptions.ItemLevel, spellOptions.ItemQuality.Value, spellOptions.ItemInventoryType.Value); return(spell); }
public async Task SSC_Converts_OneScale_To_SevenScale() { // Arrange var spellOptions = new SimcSpellOptions() { ItemLevel = 226, SpellId = 344227, ItemQuality = ItemQuality.ITEM_QUALITY_EPIC, ItemInventoryType = InventoryType.INVTYPE_TRINKET }; // Act var spell = await _spellCreationService.GenerateItemSpellAsync(spellOptions); // Assert Assert.IsNotNull(spell); Assert.IsNotNull(spell.Effects); Assert.AreEqual(1, spell.Effects.Count); Assert.AreEqual(202.44794180847748d, spell.Effects[0].ScaleBudget); Assert.AreEqual(1.65, spell.Effects[0].Coefficient); Assert.AreEqual(-7, spell.Effects[0].ScalingType); }
public async Task SSC_Creates_Item_Spell_Spell_Options() { // Arrange var spellOptions = new SimcSpellOptions() { ItemLevel = 226, SpellId = 343538, ItemQuality = ItemQuality.ITEM_QUALITY_EPIC, ItemInventoryType = InventoryType.INVTYPE_TRINKET }; // Act var spell = await _spellCreationService.GenerateItemSpellAsync(spellOptions); // Assert Assert.IsNotNull(spell); Assert.IsNotNull(spell.Effects); Assert.AreEqual(2, spell.Effects.Count); Assert.AreEqual(41.071998600000001d, spell.Effects[0].ScaleBudget); Assert.AreEqual(460.97500600000001d, spell.Effects[0].Coefficient); Assert.AreEqual(621.39996299999996d, spell.Effects[1].Coefficient); }
public async Task SSC_Creates_Item_Spell_RppmHasteModifiers() { // Arrange var spellOptions = new SimcSpellOptions() { ItemLevel = 226, SpellId = 339547, ItemQuality = ItemQuality.ITEM_QUALITY_EPIC, ItemInventoryType = InventoryType.INVTYPE_TRINKET }; // Act var spell = await _spellCreationService.GenerateItemSpellAsync(spellOptions); // Assert Assert.IsNotNull(spell); Assert.IsNotNull(spell.RppmModifiers); Assert.AreEqual(1, spell.RppmModifiers.Count); Assert.AreEqual(339547, spell.RppmModifiers[0].SpellId); Assert.IsTrue(spell.RppmModifiers[0].RppmIsHasted); Assert.IsFalse(spell.RppmModifiers[0].RppmIsSpecModified); Assert.AreEqual(0, spell.RppmModifiers[0].RppmSpec); Assert.AreEqual(1, spell.RppmModifiers[0].RppmCoefficient); }