Skip to content

Instantly share code, notes, and snippets.

@socketwiz
Created May 13, 2017 22:21
Show Gist options
  • Save socketwiz/3f29967136d8b1dc29dcc0a8852ae6fe to your computer and use it in GitHub Desktop.
Save socketwiz/3f29967136d8b1dc29dcc0a8852ae6fe to your computer and use it in GitHub Desktop.
Screeps refactor idea
const DATA = {
'rooms': [
{
'name': 'sim',
'spawn': {
'name': 'SpawnSim',
'position': {
'x': 7,
'y': 42
}
},
'links': [
{
'type': 'send',
'position': {
'x': 0,
'y': 0
},
'linkTo': 'receiver-1'
},
{
'id': 'receiver-1',
'type': 'receive',
'position': {
'x': 0,
'y': 0
}
}
],
'roles': [
{'name': 'build'},
{'name': 'depositExtension'},
{'name': 'depositSpawn'},
{'name': 'depositStorage'},
{'name': 'depositTower'},
{'name': 'depositLink'},
{'name': 'dps'},
{'name': 'harvestDropped'},
{'name': 'harvestEnergy'},
{'name': 'harvestLink'},
{'name': 'heal'},
{'name': 'repair'},
{'name': 'tank'},
{'name': 'upgrade'}
],
// MOVE = 50
// WORK = 100
// CARRY = 50
// ATTACK = 80
// RANGED_ATTACK = 150
// HEAL = 250
// CLAIM = 600
// TOUGH = 10
/**
* Each body part (except MOVE) generates fatigue points when the
* creep moves: 1 point per body part on roads, 2 on plain land,
* 10 on swamp. Each MOVE body part decreases fatigue points by
* 2 per tick.
*/
'units': [
{
'count': 1,
'features': {
'needed': [[WORK, 1], [CARRY, 1], [MOVE, 3]],
'wanted': [[TOUGH, 8], [WORK, 4], [CARRY, 2], [MOVE, 8], [ATTACK, 3], [MOVE, 1]]
},
// In priority order
'roles': ['harvestEnergy', 'depositLink', 'tank'],
'energy': {
'x': 0,
'y': 0
},
'link': {
'x': 0,
'y': 0
}
},
{
'count': 1,
'features': {
'needed': [[WORK, 1], [CARRY, 1], [MOVE, 3]],
'wanted': [[TOUGH, 8], [WORK, 4], [CARRY, 2], [MOVE, 8], [ATTACK, 3], [MOVE, 1]]
},
// In priority order
'roles': ['harvestLink', 'depositStorage', 'tank'],
'link': {
'x': 0,
'y': 0
}
},
{
'count': 3,
'features': {
'needed': [[WORK, 1], [CARRY, 1], [MOVE, 3]],
'wanted': [[TOUGH, 5], [WORK, 4], [CARRY, 2], [MOVE, 7], [RANGED_ATTACK, 2], [MOVE, 1]]
},
// In priority order
'roles': ['harvestDropped', 'harvestEnergy', 'depositSpawn', 'depositExtension', 'upgrade', 'dps'],
'energy': {
'x': 0,
'y': 0
}
},
{
'count': 1,
'features': {
'needed': [[WORK, 1], [CARRY, 1], [MOVE, 3]],
'wanted': [[TOUGH, 8], [WORK, 4], [CARRY, 2], [MOVE, 8], [ATTACK, 3], [MOVE, 1]]
},
// In priority order
'roles': ['harvestDropped', 'harvestEnergy', 'depositSpawn', 'depositExtension', 'build', 'repair', 'tank'],
'energy': {
'x': 0,
'y': 0
},
// In priority order
'repair': [STRUCTURE_RAMPART, STRUCTURE_WALL]
},
{
'count': 2,
'features': {
'needed': [[WORK, 1], [CARRY, 1], [MOVE, 3]],
'wanted': [[TOUGH, 10], [WORK, 4], [CARRY, 2], [MOVE, 8], [HEAL, 1], [MOVE, 1]]
},
// In priority order
'roles': ['harvestDropped', 'harvestEnergy', 'depositSpawn', 'depositExtension', 'depositTower', 'repair', 'heal'],
'energy': {
'x': 0,
'y': 0
},
// In priority order
'repair': [STRUCTURE_ROAD, STRUCTURE_TOWER]
}
]
}
]
};
module.exports = DATA;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment