mwg API
    Preparing search index...

    Class Difficulty

    Named difficulty levels, each a set of aspect overrides - Wesnoth's native difficulty ladder, which is really "the same AI with different numbers". A level is applied on top of a base aspect set, so a game writes its normal AI once and a level only lists what it changes.

    import { Aspects, Difficulty } from '@datamoc/mw_games/ai';

    const difficulty = new Difficulty(
    [{ id: 'hard', aspects: { aggression: 2, keep_away: 3 } }],
    { aggression: 1 },
    );
    console.log(difficulty.aspectsFor('hard').number('aggression')); // 2
    Index