Are you sure you want to rent this Castle
@@ -466,26 +492,55 @@ */ $('div[class="confirm-text"] span.question').each((i, e) => { - //const cost=e.children[1].innerText.trim().split(' ')[1]; - //const period=isRent?e.children[1].innerText.trim().split(' ')[6]:null; - const propName=e.firstElementChild.innerText.trim().split(' ').slice(8).join(' '); + const propName = e.firstElementChild.innerText.trim().split(' ').slice(8).join(' '); - const hasAnother=$(e).text().indexOf('another')>0; - if(hasAnother){ - e.firstElementChild.firstChild.nodeValue='你确定要'; - e.firstElementChild.firstChild.nodeValue+=isRent?'租用':'购买'; - e.firstElementChild.childNodes[1].firstChild.nodeValue='另一个'; - e.firstElementChild.childNodes[2].nodeValue=propertyDict[propName]; + const hasAnother = $(e).text().indexOf('another') > 0; + if (hasAnother) { + e.firstElementChild.firstChild.nodeValue = '你确定要'; + e.firstElementChild.firstChild.nodeValue += isRent ? '租用' : '购买'; + e.firstElementChild.childNodes[1].firstChild.nodeValue = '另一个'; + e.firstElementChild.childNodes[2].nodeValue = propertyDict[propName]; + } else { + e.firstElementChild.firstChild.nodeValue = '你确定要'; + e.firstElementChild.firstChild.nodeValue += isRent ? '租用' : '购买'; + e.firstElementChild.firstChild.nodeValue += propertyDict[propName]; } - else{ - e.firstElementChild.firstChild.nodeValue='你确定要'; - e.firstElementChild.firstChild.nodeValue+=isRent?'租用':'购买'; - e.firstElementChild.firstChild.nodeValue+=propertyDict[propName]; + e.children[1].firstChild.nodeValue = '花费 '; + e.children[1].childNodes[2].nodeValue = isRent ? ' 租期 ' : '?'; + if (isRent) + e.children[1].childNodes[4].nodeValue = ' 天?'; + }); + + // 房屋详情表格 + $('div.info-block span.bold').each((i, e) => { + // 2 6 10 14 18 22 26 30 ... + if (i % 4 === 2) { + /** + * + On + "Market" + Price + ":" + + */ + e.firstElementChild.firstChild.nodeValue = ''; + e.childNodes[2].nodeValue = '市场价'; + e.childNodes[3].firstChild.nodeValue = ''; + e.childNodes[4].nodeValue = ':'; + } else { + if (propertyDict[e.firstChild.nodeValue.trim()]) + e.firstChild.nodeValue = propertyDict[e.firstChild.nodeValue.trim()]; } - e.children[1].firstChild.nodeValue='花费 '; - e.children[1].childNodes[2].nodeValue=isRent?' 租期 ':'?'; - if(isRent) - e.children[1].childNodes[4].nodeValue=' 天?'; + }); + // 窄边 cost happy + $('span.title-laptop.bold').each((i, e) => { + if (propertyDict[$(e).text().trim()]) + $(e).text(propertyDict[$(e).text().trim()]); + }); + // modification + $('div.title.bold.left').each((i, e) => { + if (propertyDict[e.firstChild.nodeValue]) + e.firstChild.nodeValue = propertyDict[e.firstChild.nodeValue]; }); propertyOB.observe($('div#properties-page-wrap')[0], {childList: true, subtree: true}); @@ -559,26 +614,26 @@ const pos = e.childNodes[1].firstChild.nodeValue.match(/[0-9]+/)[0]; const splitList = e.childNodes[2].nodeValue.split(' '); - const bestLap = e.childNodes[2].nodeValue.split(' best lap was ')[1].split(' ')[0]; + const bestLap = e.childNodes[2].nodeValue.split(' best lap was ')[1].slice(0, 8);//.split(' ')[0]; let map = splitList[3]; map = map === 'Two' ? 'Two Islands' : map; map = map === 'Stone' ? 'Stone Park' : map; - e.firstChild.nodeValue = '你在赛车比赛 ' + map + ' 中获得了第 '; + e.firstChild.nodeValue = '你在赛车比赛 ' + map + ' 中获得第 '; e.childNodes[1].firstChild.nodeValue = pos; - e.childNodes[2].nodeValue = ' 名。'; + e.childNodes[2].nodeValue = ' 名,'; if (isGainRacingPoint >= 0) { - e.childNodes[2].nodeValue += '你获得了' + racingPoint + '赛车点数。'; + e.childNodes[2].nodeValue += '获得' + racingPoint + '赛车点数(Racing Points)。'; } - e.childNodes[2].nodeValue += '你的最佳成绩是 ' + bestLap; + e.childNodes[2].nodeValue += '你的最佳圈速是 ' + bestLap; if (isBeat) e.childNodes[2].nodeValue += ',比之前最佳 ' + record + ' 快 ' + bestBy; e.childNodes[2].nodeValue += '。' - e.childNodes[2].nodeValue += ' ['; + e.childNodes[2].nodeValue += '['; e.childNodes[3].firstChild.nodeValue = '查看'; return; } @@ -913,12 +968,18 @@ * failed to bust you out of jail. */ if ($(e).text().indexOf('bust') >= 0) { - if ($(e).text().indexOf('to bust') >= 0) { // 失败 - e.childNodes[1].nodeValue = ' 尝试把你从监狱里救出来,但是失败了。'; + if (e.childNodes[1].nodeValue[1] === 'f') { // 失败 + e.childNodes[1].nodeValue = ' 没能把你从监狱救出来。'; + return; + } + if (e.childNodes[1].nodeValue[1] === 'w') { // 失败被抓 + e.childNodes[1].nodeValue = ' 在尝试救你出狱时被抓了。'; + return; + } + if (e.childNodes[1].nodeValue[1] === 's') { + e.childNodes[1].nodeValue = ' 成功把你从监狱里救了出来。'; return; } - e.childNodes[1].nodeValue = ' 成功把你从监狱里救了出来。'; - return; } /** @@ -930,6 +991,30 @@ return; } + /** + * 收到帮派的pt + */ + if ($(e).text().indexOf('points from') >= 0) { + const pt = e.firstChild.nodeValue.split(' ')[3]; + e.firstChild.nodeValue = '你得到了从帮派取出的 ' + pt + ' PT。' + return; + } + + /** + * 收到帮派的钱 + */ + if ($(e).text().indexOf('given $') >= 0) { + const money = e.firstChild.nodeValue.split(' ')[3]; + let isNamed = e.childNodes.length > 1; + if (isNamed) { + e.firstChild.nodeValue = ''; + e.childNodes[2].nodeValue = ' 为你从帮派取了 ' + money + '。'; + } else { + e.firstChild.nodeValue = '你得到了从帮派取出的 ' + money + '。'; + } + return; + } + /** * 教育完成 * The education course you were taking has ended. Please click here. @@ -1035,4 +1120,4 @@ $('h4#skip-to-content').text(titleDict[$('h4#skip-to-content').text().trim()]); } -})(); +}());