This repository has been archived on 2021-07-14. You can view files and clone it, but cannot push or open issues or pull requests.
scriptcraft/src/main/js/plugins/drone/contrib/spiral_stairs.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2013-12-24 01:18:43 +01:00
var Drone = require('../drone').Drone;
var blocks = require('blocks');
/************************************************************************
### Drone.spiral_stairs() method
2013-12-28 09:44:40 +01:00
Constructs a spiral staircase with slabs at each corner.
#### Parameters
* stairBlock - The block to use for stairs, should be one of the following...
- 'oak'
- 'spruce'
- 'birch'
- 'jungle'
- 'cobblestone'
- 'brick'
- 'stone'
- 'nether'
- 'sandstone'
- 'quartz'
* flights - The number of flights of stairs to build.
![Spiral Staircase](img/spiralstair1.png)
#### Example
2013-12-28 09:44:40 +01:00
To construct a spiral staircase 5 floors high made of oak...
spiral_stairs('oak', 5);
***/
Drone.extend("spiral_stairs",function(stairBlock, flights){
this.chkpt('spiral_stairs');
for (var i = 0; i < flights; i++){
this
.box(blocks.stairs[stairBlock] + ':' + Drone.PLAYER_STAIRS_FACING[this.dir])
.up().fwd()
.box(blocks.stairs[stairBlock] + ':' + Drone.PLAYER_STAIRS_FACING[this.dir])
.up().fwd()
.box(blocks.slab[stairBlock])
.turn().fwd();
}
return this.move('spiral_stairs');
});