Перейти к содержимому

Spell Book on the Battlefield: Creature Enchantments | Heroes of Might & Magic Rebuild [Episode 54]

Первый герой меча и магии

0:00 / 0:00

Spell Book on the Battlefield: Creature Enchantments | Heroes of Might & Magic Rebuild [Episode 54]

35 просмотров · 4 месяца назад
Первый герой меча и магии
233 подписчика
35 просмотров · 4 месяца назад
In this episode of rebuilding the Heroes of Might and Magic 1 engine from scratch, we implement creature enchantment spells during battle — one of the more complex systems in the game. We start by surveying all the combat enchantment spells: positive effects like Bless, Haste, Protection, and Anti-Magic; negative effects like Slow, Blind, Curse, Paralysis, and Berserker; and the cleansing spells Cure and Dispel Magic. Each spell gets a color-coded visual treatment — blue pulsing glows for beneficial effects, red for harmful ones, and yellow when it's that creature's turn to act. From there, we build out the full spell-casting flow: opening the spell book from the General's menu, entering targeting mode, playing the cast animation over the targeted creature, applying the spell status badge (the spell icon displayed next to the creature's stack counter), and tracking spell usage so a hero can only cast once per turn. We also handle the nuances of how spell effects interact with gameplay — slowed creatures move last in the turn order, blinded or paralyzed creatures skip their turns, and Dispel Magic and Cure each have unique area-of-effect behavior with no animation. Several bugs get worked through along the way: spell animations rendering in the wrong location, status badges rendering at the wrong size and on the wrong side of the stack counter, negative spells accidentally freezing all enemy turns, and neutral creatures turning passive. We also add special creature abilities — Cyclops have a 20% chance to paralyze on attack, Unicorns have a 20% chance to blind, Dragons are fully immune to magic, and Dwarves have magic resistance. By the end, enchantment spells are working reliably in battle, with correct animations, sound effects, visual effects, spell duration tracking, and turn-order logic. Next up: damage spells — Lightning Bolt, Meteor Shower, Armageddon, and Storm.