|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
mapData=[]
|
|
|
|
files=["area0.json",
|
|
|
|
"area1.json",
|
|
|
|
"area2.json",
|
|
|
|
"area3.json",
|
|
|
|
"area4.json",
|
|
|
|
"area5.json",
|
|
|
|
"area6.json",
|
|
|
|
"area7.json",
|
|
|
|
"area8.json",
|
|
|
|
"area9.json",
|
|
|
|
"area11.json"]
|
|
|
|
|
|
|
|
for (file of files) {
|
|
|
|
mapData=[...mapData,JSON.parse(fs.readFileSync("originals/"+file))]
|
|
|
|
}
|
|
|
|
|
|
|
|
counter=0
|
|
|
|
for (data of mapData){
|
|
|
|
counter2=0
|
|
|
|
for (layer of data.layers) {
|
|
|
|
console.log(layer.name+"["+counter2+"]")
|
|
|
|
if (layer.name=="event") {
|
|
|
|
counter3=0
|
|
|
|
for (object of layer.objects){
|
|
|
|
counter3++
|
|
|
|
if (object.name=="224"){
|
|
|
|
object.name="5001"
|
|
|
|
}
|
|
|
|
if (object.name=="42"){
|
|
|
|
object.name="5001"
|
|
|
|
}
|
|
|
|
if (object.name=="44"){
|
|
|
|
object.name="5001"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (layer.name=="items")
|
|
|
|
{
|
|
|
|
for (object of layer.objects)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
counter2++
|
|
|
|
}
|
|
|
|
counter++
|
|
|
|
}
|
|
|
|
|
|
|
|
//Level 3 powerups
|
|
|
|
for (var i=0;i<mapData.length;i++){
|
|
|
|
for (item of mapData[i].layers[9].objects){
|
|
|
|
if (Number(item.name)<96){
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x-32, y: item.y, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x-32, y: item.y-32, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x, y: item.y-32, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x, y: item.y+32, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x+32, y: item.y, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x+32, y: item.y+32, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x-32, y: item.y+32, name: '529' }]
|
|
|
|
mapData[i].layers[8].objects=[...mapData[i].layers[8].objects,{ width: 32, height: 32, x: item.x+32, y: item.y-32, name: '529' }]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
//Speed Boost Level 3 at town
|
|
|
|
for (var i=0;i<9;i++){
|
|
|
|
mapData[5].layers[8].objects=[...mapData[5].layers[8].objects,{ width: 32, height: 32, x: 5536, y: 4544-32*i, name: '558' }]
|
|
|
|
mapData[5].layers[8].objects=[...mapData[5].layers[8].objects,{ width: 32, height: 32, x: 5536+32, y: 4544-32*i, name: '5006' }]
|
|
|
|
mapData[5].layers[8].objects=[...mapData[5].layers[8].objects,{ width: 32, height: 32, x: 5536+64, y: 4544-32*i, name: '5003' }]
|
|
|
|
}
|
|
|
|
|
|
|
|
//Amulet level 2
|
|
|
|
for (var i=0;i<13;i++){
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 4512, y: 2784-32*i, name: '558' }]
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 4512+32, y: 2784-32*i, name: '5033' }]
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 4512+64, y: 2784-32*i, name: '5002' }]
|
|
|
|
}
|
|
|
|
|
|
|
|
//Amulet level 3
|
|
|
|
for (var i=0;i<13;i++){
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 11072, y: 2784-32*i, name: '558' }]
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 11072+32, y: 2784-32*i, name: '5033' }]
|
|
|
|
mapData[8].layers[8].objects=[...mapData[8].layers[8].objects,{ width: 32, height: 32, x: 11072+64, y: 2784-32*i, name: '5003' }]
|
|
|
|
}*/
|
|
|
|
|
|
|
|
//console.log(JSON.stringify(mapData[0]))
|
|
|
|
for (var i=0;i<files.length;i++){
|
|
|
|
fs.writeFileSync(files[i],JSON.stringify(mapData[i]))
|
|
|
|
}
|