An effectiveness matrix between arbitrary types - mwg supplies the matrix, not a type chart. Type names are whatever strings a game defines; an unset pairing multiplies by 1, so a matrix only has to name the pairings that are not neutral.
mwg
import { TypeMatrix } from '@datamoc/mw_games/battle';const matrix = new TypeMatrix();matrix.set('fire', 'grass', 2); // super effectivematrix.set('fire', 'water', 0.5); // not very effectiveconst total = matrix.multiplierFor('fire', ['grass', 'ice']); // 2 * 1 = 2 Copy
import { TypeMatrix } from '@datamoc/mw_games/battle';const matrix = new TypeMatrix();matrix.set('fire', 'grass', 2); // super effectivematrix.set('fire', 'water', 0.5); // not very effectiveconst total = matrix.multiplierFor('fire', ['grass', 'ice']); // 2 * 1 = 2
the combined multiplier of one attacking type against every one of a target's types
An effectiveness matrix between arbitrary types -
mwgsupplies the matrix, not a type chart. Type names are whatever strings a game defines; an unset pairing multiplies by 1, so a matrix only has to name the pairings that are not neutral.Example