Skip to content

Commit

Permalink
Merge pull request #4 from velara/main
Browse files Browse the repository at this point in the history
Reduce Difficulty of Terrain by Environment
  • Loading branch information
ironmonk88 authored Mar 29, 2021
2 parents 53aef97 + bf7b61a commit 8275db9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/terrainlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class TerrainLayer extends PlaceablesLayer {
!((terrain.data.terraintype == 'ground' && elevation > 0) || (terrain.data.terraintype == 'air' && elevation <= 0)) &&
terrain.shape.contains(testX, testY)) {
cost = Math.max(terrain.cost(options), cost);
if (cost > 1 && options.reduce?.includes(terrain.environment)) {cost -= 1};
}
}

Expand All @@ -114,6 +115,7 @@ export class TerrainLayer extends PlaceablesLayer {
!((measType == 'ground' && elevation > 0) || (measType == 'air' && elevation <= 0)) &&
measure.shape.contains(testX, testY)) {
cost = Math.max(measMult, cost);
if (cost > 1 && options.reduce?.includes(measEnv)) {cost -= 1};
}
}

Expand Down Expand Up @@ -606,4 +608,4 @@ export class TerrainLayer extends PlaceablesLayer {
object.destroy({ children: true });
canvas.scene.data.terrain.findSplice(t => { return t._id == id; });
}
}
}

0 comments on commit 8275db9

Please sign in to comment.