Skip to content

Commit a8c1023

Browse files
committed
Changed setting name and function.
* noBorder is now noOuterBorder. * Allow wall, but not WallOuterArea.
1 parent 7059aec commit a8c1023

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Note that `eatables.apple` can either be `null` or a number. The number only rep
2222
| --- | --- |---|
2323
| `arena` | `size` | Defines the size (length of each side) of the arena. |
2424
| `arena` | `threeDimensions` | If enable the size of the arena is `size*size*size` instead of `size*size`. |
25-
| `border` | `noBorder` | If enable the worm will appear of the opposite side of the arena instead of colliding with a wall. |
25+
| `border` | `noOuterBorder` | If enable the worm will appear of the opposite side of the arena instead of colliding with a wall. |
2626
| `border` | `movesPerArenaShrink` | How many moves a worm can make before the arena shrinks. |
2727
| `border` | `shrinkMode` |`RandomPlacedWall_single`<br>A random wall is placed anywhere on the arena. <br>• `RandomPlacedWall_fourSymmetry`<br>Four walls are placed symmetrically on the arena. <br>• `RandomPlacedWall_perWorm`<br>One random wall pere living worm is placed anywhere on the arena. <br>• `WallOuterArea`<br>Playable arena shrinks my placing a wall on the most outer sides. |
2828
| `rules` | `startLength` | How long the worm will start as. |

arena.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function getNextPos(pos, direction){
262262
let zUnder = pos.z < 0;
263263
let zOver = (_settings.arena.threeDimensions ? _settings.arena.size : 1) <= pos.z;
264264
if(xUnder || xOver || yUnder || yOver || zUnder || zOver){
265-
if(_settings.border.noBorder){
265+
if(_settings.border.noOuterBorder){
266266
if(xUnder){
267267
pos.x = _settings.arena.size-1;
268268
}else if(xOver){
@@ -618,8 +618,10 @@ ArenaHelper.init = (participants, settings) => {
618618
ArenaHelper.postAbort('', 'Can not play `FourSymmetry` or `FourRandom_asymmetric` with more than 4 participants.');
619619
}else if(4 < _participants.countTeams() && _settings.border.shrinkMode === 'RandomPlacedWall_fourSymmetry'){
620620
ArenaHelper.postAbort('', 'RandomPlacedWall_fourSymmetry not symmetric with arena.threeDimensions.');
621+
}else if(_settings.border.shrinkMode === 'WallOuterArea' && _settings.border.noOuterBorder){
622+
ArenaHelper.postAbort('', 'WallOuterArea is not compatible with noOuterBorder.');
621623
}else{
622-
let shrinkSetting = _settings.border.noBorder || _settings.rules.apples === 'AppleLess' ? -1 : _settings.border.movesPerArenaShrink;
624+
let shrinkSetting = _settings.rules.apples === 'AppleLess' ? -1 : _settings.border.movesPerArenaShrink;
623625
if(shrinkSetting < 0){
624626
_shrinkOnTick = null;
625627
}else if(shrinkSetting === 0){

properties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
}
1717
},
1818
"border": {
19-
"noBorder": false,
19+
"noOuterBorder": false,
2020
"movesPerArenaShrink": 0,
2121
"shrinkMode": ["RandomPlacedWall_single", "RandomPlacedWall_fourSymmetry", "RandomPlacedWall_perWorm", "WallOuterArea"],
2222
"_meta": {
23-
"noBorder": {"comment": {"message": "Snakes reappears on the opposite side when traveling through a border. Disables border.movesPerArenaShrink.", "width": "333px"}},
23+
"noOuterBorder": {"comment": {"message": "Snakes reappears on the opposite side when traveling through a border. Not compatible with WallOuterArea.", "width": "333px"}},
2424
"movesPerArenaShrink": {"min": -1, "max": null, "step": 1, "comment": {"message": "How many moves the snakes can make before the playable area shrinks.<br>Special values:<br>-1: Disabled, area will not shrink.<br>&nbsp;0: The playable area's current width. Shrinks faster and faster."}},
2525
"shrinkMode": {"default": "WallOuterArea", "comment": {"message": "RandomPlacedWall_fourSymmetry not symmetric with arena.threeDimensions."}}
2626
}

0 commit comments

Comments
 (0)