UNPKG

homm3-parsers

Version:

Collection of binary parsers able to parse various file formats related to Heroes of Might and Magic III

181 lines 6.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const binary_markup_1 = require("binary-markup"); const objects_1 = require("../../../helpers/objects"); const Spell_1 = require("../contracts/enums/Spell"); exports.spellEnum = { [Spell_1.Spell.SummonBoat]: 0x00, [Spell_1.Spell.ScuttleBoat]: 0x01, [Spell_1.Spell.Visions]: 0x02, [Spell_1.Spell.ViewEarth]: 0x03, [Spell_1.Spell.Disguise]: 0x04, [Spell_1.Spell.ViewAir]: 0x05, [Spell_1.Spell.Fly]: 0x06, [Spell_1.Spell.WaterWalk]: 0x07, [Spell_1.Spell.DimensionDoor]: 0x08, [Spell_1.Spell.TownPortal]: 0x09, [Spell_1.Spell.QuickSand]: 0x0a, [Spell_1.Spell.LandMine]: 0x0b, [Spell_1.Spell.ForceField]: 0x0c, [Spell_1.Spell.FireWall]: 0x0d, [Spell_1.Spell.Earthquake]: 0x0e, [Spell_1.Spell.MagicArrow]: 0x0f, [Spell_1.Spell.IceBolt]: 0x10, [Spell_1.Spell.LightningBolt]: 0x11, [Spell_1.Spell.Implosion]: 0x12, [Spell_1.Spell.ChainLightning]: 0x13, [Spell_1.Spell.FrostRing]: 0x14, [Spell_1.Spell.Fireball]: 0x15, [Spell_1.Spell.Inferno]: 0x16, [Spell_1.Spell.MeteorShower]: 0x17, [Spell_1.Spell.DeathRipple]: 0x18, [Spell_1.Spell.DestroyUndead]: 0x19, [Spell_1.Spell.Armageddon]: 0x1a, [Spell_1.Spell.Shield]: 0x1b, [Spell_1.Spell.AirShield]: 0x1c, [Spell_1.Spell.FireShield]: 0x1d, [Spell_1.Spell.ProtectionFromAir]: 0x1e, [Spell_1.Spell.ProtectionFromFire]: 0x1f, [Spell_1.Spell.ProtectionFromWater]: 0x20, [Spell_1.Spell.ProtectionFromEarth]: 0x21, [Spell_1.Spell.AntiMagic]: 0x22, [Spell_1.Spell.Dispel]: 0x23, [Spell_1.Spell.MagicMirror]: 0x24, [Spell_1.Spell.Cure]: 0x25, [Spell_1.Spell.Resurrection]: 0x26, [Spell_1.Spell.AnimateDead]: 0x27, [Spell_1.Spell.Sacrifice]: 0x28, [Spell_1.Spell.Bless]: 0x29, [Spell_1.Spell.Curse]: 0x2a, [Spell_1.Spell.Bloodlust]: 0x2b, [Spell_1.Spell.Precision]: 0x2c, [Spell_1.Spell.Weakness]: 0x2d, [Spell_1.Spell.StoneSkin]: 0x2e, [Spell_1.Spell.DisruptingRay]: 0x2f, [Spell_1.Spell.Prayer]: 0x30, [Spell_1.Spell.Mirth]: 0x31, [Spell_1.Spell.Sorrow]: 0x32, [Spell_1.Spell.Fortune]: 0x33, [Spell_1.Spell.Misfortune]: 0x34, [Spell_1.Spell.Haste]: 0x35, [Spell_1.Spell.Slow]: 0x36, [Spell_1.Spell.Slayer]: 0x37, [Spell_1.Spell.Frenzy]: 0x38, [Spell_1.Spell.TitansLightningBolt]: 0x39, [Spell_1.Spell.Counterstrike]: 0x3a, [Spell_1.Spell.Berserk]: 0x3b, [Spell_1.Spell.Hypnotize]: 0x3c, [Spell_1.Spell.Forgetfulness]: 0x3d, [Spell_1.Spell.Blind]: 0x3e, [Spell_1.Spell.Teleport]: 0x3f, [Spell_1.Spell.RemoveObstacle]: 0x40, [Spell_1.Spell.Clone]: 0x41, [Spell_1.Spell.FireElemental]: 0x42, [Spell_1.Spell.EarthElemental]: 0x43, [Spell_1.Spell.WaterElemental]: 0x44, [Spell_1.Spell.AirElemental]: 0x45, // these abilities are used in combat creature structures [Spell_1.Spell.Stone]: 0x46, [Spell_1.Spell.Poison]: 0x47, [Spell_1.Spell.Bind]: 0x48, [Spell_1.Spell.Disease]: 0x49, [Spell_1.Spell.Paralyze]: 0x4a, [Spell_1.Spell.Aging]: 0x4b, [Spell_1.Spell.DeathCloud]: 0x4c, [Spell_1.Spell.Thunderbolt]: 0x4d, [Spell_1.Spell.DragonflyDispel]: 0x4e, [Spell_1.Spell.DeathStare]: 0x4f, [Spell_1.Spell.AcidBreath]: 0x50, }; const spellBits = [ [ [1, Spell_1.Spell.SummonBoat], [2, Spell_1.Spell.ScuttleBoat], [4, Spell_1.Spell.Visions], [8, Spell_1.Spell.ViewEarth], [16, Spell_1.Spell.Disguise], [32, Spell_1.Spell.ViewAir], [64, Spell_1.Spell.Fly], [128, Spell_1.Spell.WaterWalk], ], [ [1, Spell_1.Spell.DimensionDoor], [2, Spell_1.Spell.TownPortal], [4, Spell_1.Spell.QuickSand], [8, Spell_1.Spell.LandMine], [16, Spell_1.Spell.ForceField], [32, Spell_1.Spell.FireWall], [64, Spell_1.Spell.Earthquake], [128, Spell_1.Spell.MagicArrow], ], [ [1, Spell_1.Spell.IceBolt], [2, Spell_1.Spell.LightningBolt], [4, Spell_1.Spell.Implosion], [8, Spell_1.Spell.ChainLightning], [16, Spell_1.Spell.FrostRing], [32, Spell_1.Spell.Fireball], [64, Spell_1.Spell.Inferno], [128, Spell_1.Spell.MeteorShower], ], [ [1, Spell_1.Spell.DeathRipple], [2, Spell_1.Spell.DestroyUndead], [4, Spell_1.Spell.Armageddon], [8, Spell_1.Spell.Shield], [16, Spell_1.Spell.AirShield], [32, Spell_1.Spell.FireShield], [64, Spell_1.Spell.ProtectionFromAir], [128, Spell_1.Spell.ProtectionFromFire], ], [ [1, Spell_1.Spell.ProtectionFromWater], [2, Spell_1.Spell.ProtectionFromEarth], [4, Spell_1.Spell.AntiMagic], [8, Spell_1.Spell.Dispel], [16, Spell_1.Spell.MagicMirror], [32, Spell_1.Spell.Cure], [64, Spell_1.Spell.Resurrection], [128, Spell_1.Spell.AnimateDead], ], [ [1, Spell_1.Spell.Sacrifice], [2, Spell_1.Spell.Bless], [4, Spell_1.Spell.Curse], [8, Spell_1.Spell.Bloodlust], [16, Spell_1.Spell.Precision], [32, Spell_1.Spell.Weakness], [64, Spell_1.Spell.StoneSkin], [128, Spell_1.Spell.DisruptingRay], ], [ [1, Spell_1.Spell.Prayer], [2, Spell_1.Spell.Mirth], [4, Spell_1.Spell.Sorrow], [8, Spell_1.Spell.Fortune], [16, Spell_1.Spell.Misfortune], [32, Spell_1.Spell.Haste], [64, Spell_1.Spell.Slow], [128, Spell_1.Spell.Slayer], ], [ [1, Spell_1.Spell.Frenzy], [2, Spell_1.Spell.TitansLightningBolt], [4, Spell_1.Spell.Counterstrike], [8, Spell_1.Spell.Berserk], [16, Spell_1.Spell.Hypnotize], [32, Spell_1.Spell.Forgetfulness], [64, Spell_1.Spell.Blind], [128, Spell_1.Spell.Teleport], ], [ [1, Spell_1.Spell.RemoveObstacle], [2, Spell_1.Spell.Clone], [4, Spell_1.Spell.FireElemental], [8, Spell_1.Spell.EarthElemental], [16, Spell_1.Spell.WaterElemental], [32, Spell_1.Spell.AirElemental], ], ]; exports.spellsMask = objects_1.bitMasksArray(binary_markup_1.bytes(9), spellBits); //# sourceMappingURL=spell.js.map