diff --git a/index.html b/index.html index ac3a03fb..f247ca36 100644 --- a/index.html +++ b/index.html @@ -4122,90 +4122,81 @@ - - - + + + - - - + + + - + - + - + - + + - + - - - - - + - + - - - + - - - - - + + + + - - - - - + + + - + + - + - + - - - - - + + + - - - + + + - + - + - + - + - + diff --git a/modules/resources-generator.js b/modules/resources-generator.js index b32d5fce..81975946 100644 --- a/modules/resources-generator.js +++ b/modules/resources-generator.js @@ -20,40 +20,40 @@ {i: 4, name: "Iron", icon: "resource-iron", color: "#5D686E", value: 8, chance: 8, model: "mountainsAndRareWetland", bonus: {artillery: 1, infantry: 1, defence: 1}}, {i: 5, name: "Copper", icon: "resource-copper", color: "#b87333", value: 10, chance: 3, model: "mountains", bonus: {artillery: 2, defence: 1, prestige: 1}}, {i: 6, name: "Lead", icon: "resource-lead", color: "#454343", value: 8, chance: 3, model: "mountains", bonus: {artillery: 1, defence: 1}}, - {i: 7, name: "Silver", icon: "resource-silver", color: "#ffffff", value: 15, chance: 3, model: "mountains", bonus: {prestige: 2}}, - {i: 8, name: "Gold", icon: "resource-gold", color: "#ffffff", value: 30, chance: 1, model: "upperRivers", bonus: {prestige: 3}}, - {i: 9, name: "Grain", icon: "resource-grain", color: "#ffffff", value: 1, chance: 15, model: "habitability", bonus: {population: 4}}, - {i: 10, name: "Сattle", icon: "resource-cattle", color: "#ffffff", value: 2, chance: 10, model: "pasturesAndTemperateForest", bonus: {population: 2}}, - {i: 11, name: "Fish", icon: "resource-fish", color: "#ffffff", value: 1, chance: 5, model: "waterAndRiver", bonus: {population: 2}}, - {i: 12, name: "Game", icon: "resource-game", color: "#ffffff", value: 2, chance: 3, model: "forestAndTaiga", bonus: {archers: 2, population: 1}}, - {i: 13, name: "Wine", icon: "resource-wine", color: "#ffffff", value: 3, chance: 4, model: "tropics", bonus: {population: 1, prestige: 1}}, - {i: 14, name: "Olives", icon: "resource-olives", color: "#ffffff", value: 3, chance: 4, model: "tropics", bonus: {population: 1}}, - {i: 15, name: "Honey", icon: "resource-honey", color: "#ffffff", value: 4, chance: 3, model: "deciduousForestAndTaiga", bonus: {population: 1}}, - {i: 16, name: "Salt", icon: "resource-salt", color: "#ffffff", value: 5, chance: 4, model: "aridLandAndLakes", bonus: {population: 1, defence: 1}}, - {i: 17, name: "Dates", icon: "resource-dates", color: "#ffffff", value: 3, chance: 3, model: "desert", bonus: {population: 1}}, - {i: 18, name: "Horses", icon: "resource-horses", color: "#ffffff", value: 10, chance: 6, model: "grasslandsAndColdDesert", bonus: {cavalry: 2}}, - {i: 19, name: "Elephants", icon: "resource-elephants", color: "#ffffff", value: 15, chance: 2, model: "savannaDesertTropicalForest", bonus: {cavalry: 1}}, - {i: 20, name: "Camels", icon: "resource-camels", color: "#ffffff", value: 13, chance: 4, model: "desert", bonus: {cavalry: 1}}, - {i: 21, name: "Hemp", icon: "resource-hemp", color: "#ffffff", value: 2, chance: 4, model: "forest", bonus: {fleet: 2}}, - {i: 22, name: "Pearls", icon: "resource-pearls", color: "#ffffff", value: 35, chance: 3, model: "tropicalWater", bonus: {prestige: 1}}, - {i: 23, name: "Gemstones", icon: "resource-gemstones", color: "#ffffff", value: 35, chance: 2, model: "mountains", bonus: {prestige: 1}}, - {i: 24, name: "Dyes", icon: "resource-dyes", color: "#ffffff", value: 15, chance: .5, model: "habitableOrWater", bonus: {prestige: 1}}, - {i: 25, name: "Incense", icon: "resource-incense", color: "#ffffff", value: 25, chance: 2, model: "desertAndTropicalForest", bonus: {prestige: 2}}, - {i: 26, name: "Silk", icon: "resource-silk", color: "#ffffff", value: 30, chance: 1, model: "tropicalForest", bonus: {prestige: 2}}, - {i: 27, name: "Spices", icon: "resource-spices", color: "#ffffff", value: 30, chance: 2, model: "tropicalForest", bonus: {prestige: 2}}, - {i: 28, name: "Amber", icon: "resource-amber", color: "#ffffff", value: 15, chance: 2, model: "forestSeashore", bonus: {prestige: 1}}, - {i: 29, name: "Furs", icon: "resource-furs", color: "#ffffff", value: 13, chance: 2, model: "borealForest", bonus: {prestige: 1}}, - {i: 30, name: "Sheeps", icon: "resource-sheeps", color: "#ffffff", value: 2, chance: 5, model: "pasturesAndTemperateForest", bonus: {infantry: 1}}, - {i: 31, name: "Slaves", icon: "resource-slaves", color: "#ffffff", value: 10, chance: 3, model: "lessHabitableSeashore", bonus: {population: 2}}, - {i: 32, name: "Tar", icon: "resource-tar", color: "#ffffff", value: 3, chance: 3, model: "forestAndTaiga", bonus: {fleet: 1}}, - {i: 33, name: "Saltpeter", icon: "resource-saltpeter", color: "#ffffff", value: 8, chance: 2, model: "habitability", bonus: {artillery: 3}}, - {i: 34, name: "Coal", icon: "resource-coal", color: "#ffffff", value: 2, chance: 7, model: "hills", bonus: {artillery: 2}}, - {i: 35, name: "Oil", icon: "resource-oil", color: "#ffffff", value: 5, chance: 2, model: "lessHabitableOrWater", bonus: {artillery: 1}}, - {i: 36, name: "Tropical timber", icon: "resource-tropicalTimber", color: "#ffffff", value: 20, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, + {i: 7, name: "Silver", icon: "resource-silver", color: "#C0C0C0", value: 15, chance: 3, model: "mountains", bonus: {prestige: 2}}, + {i: 8, name: "Gold", icon: "resource-gold", color: "#d4af37", value: 30, chance: 1, model: "upperRivers", bonus: {prestige: 3}}, + {i: 9, name: "Grain", icon: "resource-grain", color: "#F5DEB3", value: 1, chance: 15, model: "habitability", bonus: {population: 4}}, + {i: 10, name: "Сattle", icon: "resource-cattle", color: "#56b000", value: 2, chance: 10, model: "pasturesAndTemperateForest", bonus: {population: 2}}, + {i: 11, name: "Fish", icon: "resource-fish", color: "#7fcdff", value: 1, chance: 5, model: "waterAndRiver", bonus: {population: 2}}, + {i: 12, name: "Game", icon: "resource-game", color: "#c38a8a", value: 2, chance: 3, model: "forestAndTaiga", bonus: {archers: 2, population: 1}}, + {i: 13, name: "Wine", icon: "resource-wine", color: "#963e48", value: 3, chance: 4, model: "tropics", bonus: {population: 1, prestige: 1}}, + {i: 14, name: "Olives", icon: "resource-olives", color: "#BDBD7D", value: 3, chance: 4, model: "tropics", bonus: {population: 1}}, + {i: 15, name: "Honey", icon: "resource-honey", color: "#DCBC66", value: 4, chance: 3, model: "deciduousForestAndTaiga", bonus: {population: 1}}, + {i: 16, name: "Salt", icon: "resource-salt", color: "#E5E4E5", value: 5, chance: 4, model: "aridLandAndLakes", bonus: {population: 1, defence: 1}}, + {i: 17, name: "Dates", icon: "resource-dates", color: "#dbb2a3", value: 3, chance: 3, model: "desert", bonus: {population: 1}}, + {i: 18, name: "Horses", icon: "resource-horses", color: "#ba7447", value: 10, chance: 6, model: "grasslandsAndColdDesert", bonus: {cavalry: 2}}, + {i: 19, name: "Elephants", icon: "resource-elephants", color: "#C5CACD", value: 15, chance: 2, model: "savannaDesertTropicalForest", bonus: {cavalry: 1}}, + {i: 20, name: "Camels", icon: "resource-camels", color: "#C19A6B", value: 13, chance: 4, model: "desert", bonus: {cavalry: 1}}, + {i: 21, name: "Hemp", icon: "resource-hemp", color: "#779771", value: 2, chance: 4, model: "forest", bonus: {fleet: 2}}, + {i: 22, name: "Pearls", icon: "resource-pearls", color: "#EAE0C8", value: 35, chance: 3, model: "tropicalWater", bonus: {prestige: 1}}, + {i: 23, name: "Gemstones", icon: "resource-gemstones", color: "#d6a7eb", value: 35, chance: 2, model: "mountains", bonus: {prestige: 1}}, + {i: 24, name: "Dyes", icon: "resource-dyes", color: "#eba7e3", value: 15, chance: .5, model: "habitableOrWater", bonus: {prestige: 1}}, + {i: 25, name: "Incense", icon: "resource-incense", color: "#ebe5a7", value: 25, chance: 2, model: "desertAndTropicalForest", bonus: {prestige: 2}}, + {i: 26, name: "Silk", icon: "resource-silk", color: "#F5F4F1", value: 30, chance: 1, model: "tropicalForest", bonus: {prestige: 2}}, + {i: 27, name: "Spices", icon: "resource-spices", color: "#e99c75", value: 30, chance: 2, model: "tropicalForest", bonus: {prestige: 2}}, + {i: 28, name: "Amber", icon: "resource-amber", color: "#FFE597", value: 15, chance: 2, model: "forestSeashore", bonus: {prestige: 1}}, + {i: 29, name: "Furs", icon: "resource-furs", color: "#635948", value: 13, chance: 2, model: "borealForest", bonus: {prestige: 1}}, + {i: 30, name: "Sheeps", icon: "resource-sheeps", color: "#53b574", value: 2, chance: 5, model: "pasturesAndTemperateForest", bonus: {infantry: 1}}, + {i: 31, name: "Slaves", icon: "resource-slaves", color: "#757575", value: 10, chance: 3, model: "lessHabitableSeashore", bonus: {population: 2}}, + {i: 32, name: "Tar", icon: "resource-tar", color: "#424242", value: 3, chance: 3, model: "forestAndTaiga", bonus: {fleet: 1}}, + {i: 33, name: "Saltpeter", icon: "resource-saltpeter", color: "#e6e3e3", value: 8, chance: 2, model: "habitability", bonus: {artillery: 3}}, + {i: 34, name: "Coal", icon: "resource-coal", color: "#36454f", value: 2, chance: 7, model: "hills", bonus: {artillery: 2}}, + {i: 35, name: "Oil", icon: "resource-oil", color: "#363636", value: 5, chance: 2, model: "lessHabitableOrWater", bonus: {artillery: 1}}, + {i: 36, name: "Tropical timber", icon: "resource-tropicalTimber", color: "#dbb7b4", value: 20, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, {i: 37, name: "Whales", icon: "resource-whales", color: "#ffffff", value: 2, chance: 2, model: "colderWaters", bonus: {population: 1}}, - {i: 38, name: "Sugar", icon: "resource-sugar", color: "#ffffff", value: 3, chance: 3, model: "tropicalForest", bonus: {population: 1}}, - {i: 39, name: "Tea", icon: "resource-tea", color: "#ffffff", value: 10, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, - {i: 40, name: "Tobacco", icon: "resource-tobacco", color: "#ffffff", value: 10, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, + {i: 38, name: "Sugar", icon: "resource-sugar", color: "#7abf87", value: 3, chance: 3, model: "tropicalForest", bonus: {population: 1}}, + {i: 39, name: "Tea", icon: "resource-tea", color: "#d0f0c0", value: 10, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, + {i: 40, name: "Tobacco", icon: "resource-tobacco", color: "#6D5843", value: 10, chance: 2, model: "tropicalForest", bonus: {prestige: 1}}, ] } @@ -75,7 +75,7 @@ mountainsAndRareWetland: i => cells.h[i] >= 60 || (cells.biome[i] === 12 && !(i%8)), upperRivers: i => cells.h[i] >= 40 && cells.r[i], habitability: i => chance(biomesData.habitability[cells.biome[i]]), - waterAndRiver: i => (cells.t[i] < 0 && (group(i) === "freshwater" || group(i) === "salt")) || (cells.t[i] > 0 && cells.t[i] < 3 && cells.r[i]), + waterAndRiver: i => (cells.t[i] < 0 && ["ocean", "freshwater", "salt"].includes(group(i))) || (cells.t[i] > 0 && cells.t[i] < 3 && cells.r[i]), pasturesAndTemperateForest: i => chance(100 - cells.h[i]) && chance([0, 0, 0, 100, 100, 20, 80, 0, 0, 0, 0, 0, 0][cells.biome[i]]), tropics: i => [5, 7].includes(cells.biome[i]), aridLandAndLakes: i => chance([0, 80, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10][cells.biome[i]]) || group(i) === "salt" || group(i) === "dry", @@ -125,11 +125,11 @@ resource.cells++; break; } - } + pack.resources.sort((a, b) => a.i > b.i ? 1 : -1); console.timeEnd("generateResources"); - //console.table(pack.resources.sort((a, b) => a.i > b.i ? 1 : -1)); + console.table(pack.resources); } const draw = function() {