Skip to content

Commit

Permalink
Merge pull request #154 from mainIine/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
TH3C0D3R authored Aug 31, 2021
2 parents e911804 + 7d3ff3f commit be98f2f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 5 deletions.
3 changes: 2 additions & 1 deletion js/web/_i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,12 +621,13 @@
"Boxes.Productions.Headings.earning": "Ernte",
"Boxes.Productions.Headings.efficiency": "Effizienz",
"Boxes.Productions.Headings.era": "Zeitalter",
"Boxes.Productions.Headings.generic_building": "???",
"Boxes.Productions.Headings.generic_building": "Andere Gebäude",
"Boxes.Productions.Headings.goods": "Gütergebäude",
"Boxes.Productions.Headings.greatbuilding": "Legendäre Bauwerke",
"Boxes.Productions.Headings.main_building": "Rathaus",
"Boxes.Productions.Headings.name": "Name",
"Boxes.Productions.Headings.number": "Anzahl",
"Boxes.Productions.Headings.off_grid": "Spezialgebäude",
"Boxes.Productions.Headings.production": "Produktionsgebäude",
"Boxes.Productions.Headings.random_production": "Zufalls Produktionen",
"Boxes.Productions.Headings.residential": "Wohngebäude",
Expand Down
1 change: 1 addition & 0 deletions js/web/_i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@
"Boxes.Productions.Headings.main_building": "Town Hall",
"Boxes.Productions.Headings.name": "Item",
"Boxes.Productions.Headings.number": "Qty",
"Boxes.Productions.Headings.off_grid": "Special buildings",
"Boxes.Productions.Headings.production": "Production Buildings",
"Boxes.Productions.Headings.random_production": "Random Productions",
"Boxes.Productions.Headings.residential": "Residential Buildings",
Expand Down
5 changes: 4 additions & 1 deletion js/web/_main/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1223,9 +1223,12 @@ let MainParser = {
'supplies_boost': ['supply_production'],
'happiness': ['happiness_amount'],
'military_boost': ['att_boost_attacker', 'def_boost_attacker'],
'att_def_boost_attacker': ['att_boost_attacker', 'def_boost_attacker'],
'fierce_resistance': ['att_boost_defender', 'def_boost_defender'],
'att_def_boost_defender': ['att_boost_defender', 'def_boost_defender'],
'advanced_tactics': ['att_boost_attacker', 'def_boost_attacker', 'att_boost_defender', 'def_boost_defender'],
'money_boost': ['coin_production']
'money_boost': ['coin_production'],

},


Expand Down
2 changes: 1 addition & 1 deletion js/web/part-calc/js/part-calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ let Parts = {

h.push('<div class="bottom-buttons text-center dark-bg">');
h.push('<div class="btn-group">');
if (Parts.SafePlaces.length > 0) { //Copy bzw. Note Button nur einblenden wenn zumindest ein Platz safe ist
if (Parts.SafePlaces.length > 0 || Parts.CopyModeAll) { //Copy bzw. Note Button nur einblenden wenn zumindest ein Platz safe ist
h.push('<span class="btn-default button-own">' + i18n('Boxes.OwnpartCalculator.CopyValues') + '</span>');
if (Parts.CityMapEntity['player_id'] === ExtPlayerID) h.push('<span class="btn-default button-save-own">' + i18n('Boxes.OwnpartCalculator.Note') + '</span>');
}
Expand Down
44 changes: 42 additions & 2 deletions js/web/productions/js/productions.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ let Productions = {
'culture',
'main_building',
'clan_power_production',
'off_grid',
'generic_building'
],

Expand Down Expand Up @@ -123,10 +124,10 @@ let Productions = {
{
if (!d.hasOwnProperty(i)) continue;

if (d[i]['id'] >= 2000000000) continue;
if (d[i]['id'] >= 2000000000 && d[i]['cityentity_id'] !== 'V_AllAge_CastleSystem1') continue; //Exclude all off grid buildings except Castle

// dem Rathaus evt Boosts hinzufügen (tägliche FP, Botschafter Bonus)
if(d[i]['id'] === 1 && !d[i]['mainBuildingPrepared']){
if (d[i]['id'] === 1 && !d[i]['mainBuildingPrepared']) {
d[i] = Productions.prepareMainBuilding(d[i]);
}

Expand Down Expand Up @@ -576,6 +577,45 @@ let Productions = {
}
}

if (d['cityentity_id'] === 'V_AllAge_CastleSystem1') {
for (let i in MainParser.Boosts) {
if (!MainParser.Boosts.hasOwnProperty(i)) continue;

let BoostList = MainParser.Boosts[i],
NewBoostList = [];

for (let j = 0; j < BoostList.length; j++) {
let Boost = BoostList[j];

if (Boost['origin'] !== 'castle_system') continue;

if (MainParser.BoostMapper[Boost['type']]) {
let MappedBoosts = MainParser.BoostMapper[Boost['type']];
for (let k = 0; k < MappedBoosts.length; k++) {
let NewBoost = Object.assign({}, Boost);
NewBoost['type'] = MappedBoosts[k];
NewBoostList.push(NewBoost);
}
}
else {
NewBoostList.push(Boost);
}
}

for (let j = 0; j < NewBoostList.length; j++) {
let Boost = NewBoostList[j];

let ResName = Boost['type'],
Value = Boost['value'];

if (!Productions.Types.includes(ResName)) continue;

if (!Products[ResName]) Products[ResName] = 0;
Products[ResName] += Value;
}
}
}

let AdditionalProduct,
MotivatedProducts = [];

Expand Down

0 comments on commit be98f2f

Please sign in to comment.