Skip to content

Commit

Permalink
Added magic speed to 'Jack O'Lantern Blessings'
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Oct 20, 2024
1 parent bf5f7e8 commit 312e6e5
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/Persistence/Initialization/VersionSeasonSix/Items/Potions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ private ItemDefinition CreateJackOLanternBlessings()
item.Width = 1;
item.Height = 2;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternBlessing, Stats.AttackSpeed, 10, TimeSpan.FromMinutes(32));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternBlessing, TimeSpan.FromMinutes(32), (Stats.AttackSpeed, 10), (Stats.MagicSpeed, 10));
return item;
}

Expand All @@ -435,7 +435,7 @@ private ItemDefinition CreateJackOLanternWrath()
item.Width = 1;
item.Height = 2;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternWrath, Stats.BaseDamageBonus, 25, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternWrath, TimeSpan.FromMinutes(30), (Stats.BaseDamageBonus, 25));
return item;
}

Expand All @@ -449,7 +449,7 @@ private ItemDefinition CreateJackOLanternCry()
item.Width = 1;
item.Height = 2;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternCry, Stats.DefenseBase, 100, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternCry, TimeSpan.FromMinutes(30), (Stats.DefenseBase, 100));
return item;
}

Expand All @@ -463,7 +463,7 @@ private ItemDefinition CreateJackOLanternFood()
item.Width = 1;
item.Height = 1;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternFood, Stats.MaximumHealth, 500, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternFood, TimeSpan.FromMinutes(30), (Stats.MaximumHealth, 500));
return item;
}

Expand All @@ -477,7 +477,7 @@ private ItemDefinition CreateJackOLanternDrink()
item.Width = 1;
item.Height = 1;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternDrink, Stats.MaximumMana, 500, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.JackOlanternDrink, TimeSpan.FromMinutes(30), (Stats.MaximumMana, 500));
return item;
}

Expand All @@ -491,7 +491,7 @@ private ItemDefinition CreateCherryBlossomWine()
item.Width = 1;
item.Height = 2;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomWine, Stats.MaximumMana, 700, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomWine, TimeSpan.FromMinutes(30), (Stats.MaximumMana, 700));
return item;
}

Expand All @@ -505,7 +505,7 @@ private ItemDefinition CreateCherryBlossomRiceCake()
item.Width = 1;
item.Height = 1;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomRiceCake, Stats.MaximumHealth, 700, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomRiceCake, TimeSpan.FromMinutes(30), (Stats.MaximumHealth, 700));
return item;
}

Expand All @@ -519,11 +519,11 @@ private ItemDefinition CreateCherryBlossomFlowerPetal()
item.Width = 1;
item.Height = 1;
item.SetGuid(item.Group, item.Number);
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomFlowerPetal, Stats.BaseDamageBonus, 40, TimeSpan.FromMinutes(30));
this.CreateConsumeEffect(item, 16, MagicEffectNumber.CherryBlossomFlowerPetal, TimeSpan.FromMinutes(30), (Stats.BaseDamageBonus, 40));
return item;
}

private MagicEffectDefinition CreateConsumeEffect(ItemDefinition item, byte subType, MagicEffectNumber effectNumber, AttributeDefinition targetAttribute, float boostValue, TimeSpan duration)
private MagicEffectDefinition CreateConsumeEffect(ItemDefinition item, byte subType, MagicEffectNumber effectNumber, TimeSpan duration, params (AttributeDefinition targetAttribute, float boostValue)[] boosts)
{
var effect = this.Context.CreateNew<MagicEffectDefinition>();
effect.SetGuid(item.Number, (short)effectNumber);
Expand All @@ -538,11 +538,15 @@ private MagicEffectDefinition CreateConsumeEffect(ItemDefinition item, byte subT
effect.Duration = this.Context.CreateNew<PowerUpDefinitionValue>();
effect.Duration.ConstantValue.Value = (float)duration.TotalSeconds;

var powerUpDefinition = this.Context.CreateNew<PowerUpDefinition>();
effect.PowerUpDefinitions.Add(powerUpDefinition);
powerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
powerUpDefinition.Boost.ConstantValue.Value = boostValue;
powerUpDefinition.TargetAttribute = targetAttribute.GetPersistent(this.GameConfiguration);
foreach (var (targetAttribute, boostValue) in boosts)
{
var powerUpDefinition = this.Context.CreateNew<PowerUpDefinition>();
effect.PowerUpDefinitions.Add(powerUpDefinition);
powerUpDefinition.Boost = this.Context.CreateNew<PowerUpDefinitionValue>();
powerUpDefinition.Boost.ConstantValue.Value = boostValue;
powerUpDefinition.TargetAttribute = targetAttribute.GetPersistent(this.GameConfiguration);
}

return effect;
}
}

0 comments on commit 312e6e5

Please sign in to comment.