2021-02-26 17:04:05 +00:00
|
|
|
export const buildTribeURL = id => {
|
2020-07-11 18:44:52 +00:00
|
|
|
return (
|
|
|
|
window.location.origin +
|
|
|
|
TribalWars.buildURL('', {
|
|
|
|
screen: 'info_ally',
|
|
|
|
id,
|
|
|
|
})
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-02-26 17:04:05 +00:00
|
|
|
export const buildPlayerURL = id => {
|
2020-07-11 18:44:52 +00:00
|
|
|
return (
|
|
|
|
window.location.origin +
|
|
|
|
TribalWars.buildURL('', {
|
|
|
|
screen: 'info_player',
|
|
|
|
id,
|
|
|
|
})
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-02-26 17:04:05 +00:00
|
|
|
export const buildVillageURL = id => {
|
2020-07-11 18:44:52 +00:00
|
|
|
return (
|
|
|
|
window.location.origin +
|
|
|
|
TribalWars.buildURL('', {
|
|
|
|
screen: 'info_village',
|
|
|
|
id,
|
|
|
|
})
|
|
|
|
);
|
|
|
|
};
|
2020-07-12 16:17:25 +00:00
|
|
|
|
2021-01-03 12:13:05 +00:00
|
|
|
export const buildVillageName = (n = '', x = 500, y = 500) => {
|
2020-07-17 10:58:08 +00:00
|
|
|
const continent = 'K' + String(y)[0] + String(x)[0];
|
|
|
|
return `${n} (${x}|${y}) ${continent}`;
|
|
|
|
};
|
|
|
|
|
2021-01-03 12:13:05 +00:00
|
|
|
export const calcAttackDuration = (distance, baseSpeed) => {
|
|
|
|
return Math.round(distance * baseSpeed);
|
2020-07-25 13:47:49 +00:00
|
|
|
};
|
|
|
|
|
2021-02-26 17:04:05 +00:00
|
|
|
export const buildImgURL = img => {
|
2020-07-25 13:47:49 +00:00
|
|
|
return image_base + img;
|
|
|
|
};
|