morph beta
Function of @v12-engine/engine
export declare function morph(world: World, entity: Entity, into: string, options?: MorphOptions): void;Turns an entity into another type, where it stands: a building upgraded, a unit transformed (a druid into a bear, a siege tank set up). Everything of the type is the new one's: stats, how it moves (and on the ground or in the air), whether it fights, gathers or carries, its abilities (those of the old type it keeps are kept as they were, at their levels and cooldowns), and what it makes. What it went through stays: health lost, mana, buffs, experience, items. The parts of the game it had none of are given it as spawn gives them (Component.onSpawn), and the morphed hook runs: what a pack gives it of its own for its new type (the heroes pack: a hero's level, a shop's wares). options keep its orders and the shares of its health and mana, and say its abilities: what a hero's form takes (takeForm)