Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NG_mapCellsEachItem(item, cell) {
- _ctu[item] = isWeapon(item) ?
- getCellsToUseWeapon(item, _enemy) :
- getCellsToUseChip(item, _enemy)
- ;
- _pl[item] =
- NG_getPathLength(
- _nctu[item] = NG_getNearestCellFromCell(_ctu[item], cell),
- cell
- )
- ;
- }
- function NG_mapCells(attaques, fonction) {
- var dbg = false;
- var cell = getCell();
- _ctu = [];
- _nctu = [];
- _pl = [];
- _cache_pathLengths = [];
- arrayIter(attaques, function(item) {
- NG_mapCellsEachItem(item, cell);
- if(_nctu[item]==null) {
- if(dbg) debug("NG_mapCells> No cell to use");
- return;
- }
- if(_pl[item]==null) {
- if(dbg) debug("NG_mapCells> No distance");
- return;
- }
- return fonction(item);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement