Skip to content

Commit

Permalink
Remove Mage Light from sale, retain in spellmaker
Browse files Browse the repository at this point in the history
Mage Light was intended to be an example effect only.
However it remained in game for so long during beta that many players are using and prefer it to magic candle effect.
This change will remove the example bundle "Mage Light Inferno" from sale. But player can still create their own version using spellmaker.
  • Loading branch information
Interkarma committed Oct 11, 2023
1 parent 521dd1e commit 909d1c5
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions Assets/Scripts/Game/MagicAndEffects/EntityEffectBroker.cs
Expand Up @@ -126,6 +126,8 @@ void Start()
// Below is an example of how to register a fully custom effect and spell bundle
// This call should remain commented out except for testing and example purposes
// Mods would do this kind of work after capturing OnRegisterCustomEffects event
// Historical note: The example effect MageLight is retained in spellmaker as this
// has been part of the game during beta for so long and players are using it
RegisterCustomEffectDemo();

// Raise event for custom effects to register
Expand All @@ -150,51 +152,51 @@ void RegisterCustomEffectDemo()
// No need to define settings not used by effect
// For our custom spell, we're using same Duration settings as Light spell: 1 + 4 per level
// Note these settings will also control final cost of spell to buy and cast
EffectSettings effectSettings = new EffectSettings()
{
DurationBase = 1,
DurationPlus = 4,
DurationPerLevel = 1,
};
//EffectSettings effectSettings = new EffectSettings()
//{
// DurationBase = 1,
// DurationPlus = 4,
// DurationPerLevel = 1,
//};

// Create an EffectEntry
// This links the effect key with settings
// Each effect entry in bundle needs its own settings - most spells only have a single effect
EffectEntry effectEntry = new EffectEntry()
{
Key = templateEffect.Properties.Key,
Settings = effectSettings,
};
//EffectEntry effectEntry = new EffectEntry()
//{
// Key = templateEffect.Properties.Key,
// Settings = effectSettings,
//};

// Create a custom spell bundle
// This is a portable version of the spell for other systems
// For example, every spell in the player's spellbook is a bundle
// Bundle target and elements settings should follow effect requirements
EffectBundleSettings mageLightInferoSpell = new EffectBundleSettings()
{
Version = CurrentSpellVersion,
BundleType = BundleTypes.Spell,
TargetType = TargetTypes.CasterOnly,
ElementType = ElementTypes.Magic,
Name = "Magelight Inferno",
IconIndex = 12,
Effects = new EffectEntry[] { effectEntry },
};
//EffectBundleSettings mageLightInferoSpell = new EffectBundleSettings()
//{
// Version = CurrentSpellVersion,
// BundleType = BundleTypes.Spell,
// TargetType = TargetTypes.CasterOnly,
// ElementType = ElementTypes.Magic,
// Name = "Magelight Inferno",
// IconIndex = 12,
// Effects = new EffectEntry[] { effectEntry },
//};

// Create a custom spell offer
// This informs other systems if they can use this bundle
CustomSpellBundleOffer mageLightInferoOffer = new CustomSpellBundleOffer()
{
Key = "MageLightInferno-CustomOffer", // This key is for the offer itself and must be unique
Usage = CustomSpellBundleOfferUsage.SpellsForSale| // Available in spells for sale
CustomSpellBundleOfferUsage.CastWhenUsedEnchantment| // Available for "cast on use" enchantments
CustomSpellBundleOfferUsage.CastWhenHeldEnchantment, // Available for "cast on held" enchantments
BundleSetttings = mageLightInferoSpell, // The spell bundle created earlier
EnchantmentCost = 250, // Cost to use spell at item enchanter if enabled
};
//CustomSpellBundleOffer mageLightInferoOffer = new CustomSpellBundleOffer()
//{
// Key = "MageLightInferno-CustomOffer", // This key is for the offer itself and must be unique
// Usage = CustomSpellBundleOfferUsage.SpellsForSale| // Available in spells for sale
// CustomSpellBundleOfferUsage.CastWhenUsedEnchantment| // Available for "cast on use" enchantments
// CustomSpellBundleOfferUsage.CastWhenHeldEnchantment, // Available for "cast on held" enchantments
// BundleSetttings = mageLightInferoSpell, // The spell bundle created earlier
// EnchantmentCost = 250, // Cost to use spell at item enchanter if enabled
//};

// Register the offer
RegisterCustomSpellBundleOffer(mageLightInferoOffer);
//RegisterCustomSpellBundleOffer(mageLightInferoOffer);
}

void Update()
Expand Down

0 comments on commit 909d1c5

Please sign in to comment.