Skip to content

Commit

Permalink
Fixing some missing icons, fixing pantheon leaderboard now that it's …
Browse files Browse the repository at this point in the history
…the same as Po*, improving simulator logging, fixing monthly card text tweak for the new icons
  • Loading branch information
Numbers committed Jan 12, 2023
1 parent 1f1979b commit a157a1f
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 145 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1.28.22: Fixing some missing icons, fixing pantheon leaderboard now that it's the same as Po*, improving simulator logging, fixing monthly card text tweak for the new icons
1.28.21: Improving performance on the mythic equip upgrade page more
1.28.20: Improving performance on the mythic equip upgrade page
1.28.19: Fixing more missing tooltips
Expand Down
20 changes: 10 additions & 10 deletions dist/hh-plus-plus.dev.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/hh-plus-plus.meta.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Hentai Heroes++ BDSM version
// @description Adding things here and there in the Hentai Heroes game. Also supports HHCore-based games such as GH and CxH.
// @version 1.28.21
// @version 1.28.22
// @match https://*.hentaiheroes.com/*
// @match https://nutaku.haremheroes.com/*
// @match https://*.gayharem.com/*
Expand Down
136 changes: 68 additions & 68 deletions dist/hh-plus-plus.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hh-plus-plus",
"version": "1.28.21",
"version": "1.28.22",
"description": "Adding things here and there in the Hentai Heroes game. Also supports HHCore-based games such as GH and CxH.",
"private": "true",
"scripts": {
Expand Down
2 changes: 0 additions & 2 deletions src/i18n/labels/En.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ export const harem = {
marketRestocked: '> The <a href="../shop.html">Market</a> restocked since your last visit.',
visitMarket: '> Visit the <a href="../shop.html">Market</a> first to see an inventory summary here',
itemSummary: '{{count}} ({{value}} {{type}})',
costSC: '{{cost}} <span cur="soft_currency"></span>',
costHC: '{{cost}} <span cur="hard_currency"></span>',
haremStats: 'Harem Stats',
upgrades: 'Upgrades',
levelsAwakening: 'Levels & Awakening',
Expand Down
14 changes: 12 additions & 2 deletions src/modules/BattleSimulatorModule/Simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ class Simulator {
}

run () {
if (this.logging) {
console.log('Running simulation against', this.opponent.name)
console.groupCollapsed('Player')
console.dir({...this.player})
console.groupEnd()
console.groupCollapsed(this.opponent.name)
console.dir({...this.opponent})
console.groupEnd()
}

const setup = x => {
x.critMultiplier = 2 + x.bonuses.critDamage
x.dmg = Math.max(0, x.dmg)
Expand Down Expand Up @@ -34,7 +44,7 @@ class Simulator {
// start simulation from player's turn
ret = this.playerTurn(this.player.hp, this.opponent.hp, 0)
} catch (error) {
if (this.logging) console.log(`An error occurred during the simulation against ${this.opponent.name}`)
if (this.logging) console.log(`An error occurred during the simulation against ${this.opponent.name}`, error)
return {
points: [],
win: Number.NaN,
Expand All @@ -49,7 +59,7 @@ class Simulator {
ret.loss /= sum
ret.scoreClass = ret.win>0.9?'plus':ret.win<0.5?'minus':'close'

if (this.logging) {console.log(`Ran ${this.runs} simulations against ${this.opponent.name}, won ${ret.win * 100}% of simulated fights, average turns: ${ret.avgTurns}`)}
if (this.logging) {console.log(`Ran ${this.runs} simulations against ${this.opponent.name}; aggregated win chance: ${ret.win * 100}%, average turns: ${ret.avgTurns}`)}

if (this.preSim) {
if (ret.win <= 0) ret.impossible = true
Expand Down
2 changes: 1 addition & 1 deletion src/modules/ChampionsModule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class ChampionsModule extends CoreModule {
if (!$('.champions-bottom__ticket-amount').length) {
const {championData} = window
$('.champions-bottom__rest').css({'width': '280px'})
.before(`<div class="champions-bottom__ticket-amount"><span cur="ticket">x ${championData.champion.currentTickets}</span></div>`)
.before(`<div class="champions-bottom__ticket-amount"><span class="ticket_icn"></span>x ${championData.champion.currentTickets}</div>`)
}
}
attachCount()
Expand Down
59 changes: 29 additions & 30 deletions src/modules/HaremInfoModule/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,32 +128,32 @@ class HaremInfoModule extends CoreModule {
<h1>${this.label('haremStats')}</h1>
<div>${this.aggregates.girls} <span class="clubGirl_mix_icn"></span></div>
<ul class="summary-grid caracs-summary">
${Object.entries(this.aggregates.caracs).map(([carac, count]) => `<li><span hh_title="${GT.caracs[carac]}" tooltip><span carac="${carac}"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
${Object.entries(this.aggregates.caracs).map(([carac, count]) => `<li><span tooltip="${GT.caracs[carac]}"><span carac="${carac}"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
</ul>
<ul class="summary-grid elements-summary">
${Object.entries(this.aggregates.elements).map(([element, count]) => `<li><span hh_title="${GT.design[`${element}_flavor_element`]}" tooltip><span class="${element}_element_icn"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
${Object.entries(this.aggregates.elements).map(([element, count]) => `<li><span tooltip="${GT.design[`${element}_flavor_element`]}"><span class="${element}_element_icn"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
</ul>
<ul class="summary-grid rarity-summary">
${Object.entries(this.aggregates.rarities).map(([rarity, count]) => `<li><span hh_title="${GT.design[`girls_rarity_${rarity}`]}" tooltip><span class="rarity-icon slot ${rarity}"><span class="initial">${GT.design[`girls_rarity_${rarity}`][0].normalize('NFD').replace(/[\u0300-\u036f]/g, '')}</span></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
${Object.entries(this.aggregates.rarities).map(([rarity, count]) => `<li><span tooltip="${GT.design[`girls_rarity_${rarity}`]}"><span class="rarity-icon slot ${rarity}"><span class="initial">${GT.design[`girls_rarity_${rarity}`][0].normalize('NFD').replace(/[\u0300-\u036f]/g, '')}</span></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
</ul>
<ul class="summary-grid xp-aff-summary">
<li>
<span hh_title="${this.label('haremLevel')}" tooltip>
<span tooltip="${this.label('haremLevel')}">
<span class="xp-aff-label">${GT.design.Lvl}</span>
<span>${I18n.nThousand(this.aggregates.levelSum)}<br>/ ${I18n.nThousand(GIRL_MAX_LEVEL * this.aggregates.girls)}</span>
</span>
</li>
<li>
<span hh_title="${this.label('unlockedScenes')}" tooltip>
<span tooltip="${this.label('unlockedScenes')}">
<span class="xp-aff-label unlocked-scenes-icon" style="background-image:url(${Helpers.getCDNHost()}/design_v2/affstar.png);"></span>
<span>${I18n.nThousand(this.aggregates.unlockedScenes)}<br>/ ${I18n.nThousand(this.aggregates.totalScenes)}</span>
</span>
</li>
</ul>
<ul class="summary-grid salary-summary">
<li>
<span hh_title="${this.label('income')}" tooltip>
<span class="salary-label" cur="soft_currency"></span>
<span tooltip="${this.label('income')}">
<span class="salary-label"><span class="hudSC_mix_icn"></span></span>
<span>${I18n.nThousand(this.aggregates.scPerHour)} / ${GT.time.h}<br>${I18n.nThousand(this.aggregates.scCollectAll)} / ${GT.design.harem_collect}</span>
</span>
</li>
Expand All @@ -172,40 +172,40 @@ class HaremInfoModule extends CoreModule {
<span>${this.label('toUpgrade')}</span>
<ul class="summary-grid upgrade-costs">
<li>
<span hh_title="${GT.design.Affection}" tooltip>
<span tooltip="${GT.design.Affection}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_gifts_gray.svg)"></span>
<span class="cost-value">${I18n.nThousand(this.aggregates.aff)} ${GT.design.Aff}<br>(<span cur="soft_currency"> ${I18n.nThousand(this.aggregates.aff * SC_PER_AFF)}</span>)</span>
<span class="cost-value">${I18n.nThousand(this.aggregates.aff)} ${GT.design.Aff}<br>(<span class="hudSC_mix_icn"></span> ${I18n.nThousand(this.aggregates.aff * SC_PER_AFF)})</span>
</span>
</li>
<li>
<span hh_title="${this.label('affectionScenes')}" tooltip>
<span tooltip="${this.label('affectionScenes')}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design_v2/affstar.png)"></span>
<span class="cost-value">${this.label('or', {left: `<span cur="soft_currency"> ${I18n.nThousand(this.aggregates.affSC)}</span><br>`, right: `<span cur="hard_currency"> ${I18n.nThousand(this.aggregates.affHC)}</span>`})}</span>
<span class="cost-value">${this.label('or', {left: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(this.aggregates.affSC)}<br>`, right: `<span class="hudHC_mix_icn"></span> ${I18n.nThousand(this.aggregates.affHC)}`})}</span>
</span>
</li>
</ul>
<h1>${this.label('levelsAwakening')}</h1>
<span>${this.label('toLevelCap')}</span>
<ul class="summary-grid upgrade-costs">
<li>
<span hh_title="${GT.design.Experience}" tooltip>
<span tooltip="${GT.design.Experience}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_books_gray.svg)"></span>
<span class="cost-value">${I18n.nThousand(this.aggregates.xpToCap)} ${GT.design.XP}<br>(<span cur="soft_currency"> ${I18n.nThousand(this.aggregates.xpToCap * SC_PER_XP)}</span>)</span>
<span class="cost-value">${I18n.nThousand(this.aggregates.xpToCap)} ${GT.design.XP}<br>(<span class="hudSC_mix_icn"></span> ${I18n.nThousand(this.aggregates.xpToCap * SC_PER_XP)})</span>
</span>
</li>
</ul>
<span class="to-max-label">${this.label('toLevelMax', {max: GIRL_MAX_LEVEL})}</span>
<div class="to-max-combi">
<ul class="summary-grid upgrade-costs">
<li>
<span hh_title="${GT.design.Experience}" tooltip>
<span tooltip="${GT.design.Experience}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_books_gray.svg)"></span>
<span class="cost-value">${I18n.nThousand(this.aggregates.xpToMax)} ${GT.design.XP}<br>(<span cur="soft_currency"> ${I18n.nThousand(this.aggregates.xpToMax * SC_PER_XP)}</span>)</span>
<span class="cost-value">${I18n.nThousand(this.aggregates.xpToMax)} ${GT.design.XP}<br>(<span class="hudSC_mix_icn"></span> ${I18n.nThousand(this.aggregates.xpToMax * SC_PER_XP)})</span>
</span>
</li>
</ul>
<ul class="summary-grid gems-summary">
${Object.entries(this.aggregates.gems).map(([element, count]) => `<li><span hh_title="${GT.design[`${element}_gem`]}" tooltip><span class="gem-icon" style="background-image: url(${Helpers.getCDNHost()}/pictures/design/gems/${element}.png)"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
${Object.entries(this.aggregates.gems).map(([element, count]) => `<li><span tooltip="${GT.design[`${element}_gem`]}"><span class="gem-icon" style="background-image: url(${Helpers.getCDNHost()}/pictures/design/gems/${element}.png)"></span><span>${I18n.nThousand(count)}</span></span></li>`).join('')}
</ul>
</div>
</div>
Expand Down Expand Up @@ -237,20 +237,20 @@ class HaremInfoModule extends CoreModule {
<span>${this.label('buyable')}</span>
<ul class="summary-grid upgrade-costs">
<li>
<span hh_title="${this.label('books')}" tooltip>
<span tooltip="${this.label('books')}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_books_gray.svg)"></span>
<span class="cost-value">
${this.label('canBeBought', {item: `${I18n.nThousand(xp.sc.value)} ${GT.design.XP} (${xp.sc.count})`, amount: `<span cur="soft_currency"> ${I18n.nThousand(xp.sc.cost)}</span>`})}<br>
${this.label('canBeBought', {item: `${I18n.nThousand(xp.hc.value)} ${GT.design.XP} (${xp.hc.count})`, amount: `<span cur="hard_currency"> ${I18n.nThousand(xp.hc.cost)}</span>`})}
${this.label('canBeBought', {item: `${I18n.nThousand(xp.sc.value)} ${GT.design.XP} (${xp.sc.count})`, amount: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(xp.sc.cost)}`})}<br>
${this.label('canBeBought', {item: `${I18n.nThousand(xp.hc.value)} ${GT.design.XP} (${xp.hc.count})`, amount: `<span class="hudHC_mix_icn"></span> ${I18n.nThousand(xp.hc.cost)}`})}
</span>
</span>
</li>
<li>
<span hh_title="${this.label('gifts')}" tooltip>
<span tooltip="${this.label('gifts')}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_gifts_gray.svg)"></span>
<span class="cost-value">
${this.label('canBeBought', {item: `${I18n.nThousand(aff.sc.value)} ${GT.design.Aff} (${aff.sc.count})`, amount: `<span cur="soft_currency"> ${I18n.nThousand(aff.sc.cost)}</span>`})}<br>
${this.label('canBeBought', {item: `${I18n.nThousand(aff.hc.value)} ${GT.design.Aff} (${aff.hc.count})`, amount: `<span cur="hard_currency"> ${I18n.nThousand(aff.hc.cost)}</span>`})}
${this.label('canBeBought', {item: `${I18n.nThousand(aff.sc.value)} ${GT.design.Aff} (${aff.sc.count})`, amount: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(aff.sc.cost)}`})}<br>
${this.label('canBeBought', {item: `${I18n.nThousand(aff.hc.value)} ${GT.design.Aff} (${aff.hc.count})`, amount: `<span class="hudHC_mix_icn"></span> ${I18n.nThousand(aff.hc.cost)}`})}
</span>
</span>
</li>
Expand All @@ -272,26 +272,26 @@ class HaremInfoModule extends CoreModule {
<span>${this.label('sellable')}</span>
<ul class="summary-grid upgrade-costs">
<li>
<span hh_title="${this.label('books')}" tooltip>
<span tooltip="${this.label('books')}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_books_gray.svg)"></span>
<span class="cost-value">
${I18n.nThousand(xp.value)} ${GT.design.XP} (${xp.count})<br>
${this.label('canBeSold', {sc: `<span cur="soft_currency"> ${I18n.nThousand(xp.cost)}</span>`})}
${this.label('canBeSold', {sc: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(xp.cost)}`})}
</span>
</span>
</li>
<li>
<span hh_title="${this.label('gifts')}" tooltip>
<span tooltip="${this.label('gifts')}">
<span class="affection-label" style="background-image:url(${Helpers.getCDNHost()}/design/ic_gifts_gray.svg)"></span>
<span class="cost-value">
${I18n.nThousand(aff.value)} ${GT.design.Aff} (${aff.count})<br>
${this.label('canBeSold', {sc: `<span cur="soft_currency"> ${I18n.nThousand(aff.cost)}</span>`})}
${this.label('canBeSold', {sc: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(aff.cost)}`})}
</span>
</span>
</li>
</ul>
<ul class="summary-grid gems-stock">
${ELEMENTS.map((element) => `<li><span hh_title="${GT.design[`${element}_gem`]}" tooltip><span class="gem-icon" style="background-image: url(${Helpers.getCDNHost()}/pictures/design/gems/${element}.png)"></span><span>${I18n.nThousand(parseInt(player_gems_amount[element].amount),10)}</span></span></li>`).join('')}
${ELEMENTS.map((element) => `<li><span tooltip="${GT.design[`${element}_gem`]}"><span class="gem-icon" style="background-image: url(${Helpers.getCDNHost()}/pictures/design/gems/${element}.png)"></span><span>${I18n.nThousand(parseInt(player_gems_amount[element].amount),10)}</span></span></li>`).join('')}
</ul>
`
} else {
Expand Down Expand Up @@ -383,12 +383,11 @@ class HaremInfoModule extends CoreModule {
const ttContent = `
<div class="scene-costs-tooltip">
${I18n.nThousand(remainingAffection)} ${GT.design.Aff}<br>
${this.label('or', {left: `<span cur="soft_currency"> ${I18n.nThousand(sc)}</span><br>`, right: `<span cur="hard_currency"> ${I18n.nThousand(Math.ceil(hc * hcMultiplier))}</span>` })}
${this.label('or', {left: `<span class="hudSC_mix_icn"></span> ${I18n.nThousand(sc)}<br>`, right: `<span class="hudHC_mix_icn"></span> ${I18n.nThousand(Math.ceil(hc * hcMultiplier))}` })}
</div>
`.replace(/(\n| {4})/g, '')

$el.attr('hh_title', ttContent)
$el.attr('tooltip', '')
$el.attr('tooltip', ttContent)
})
}

Expand Down
Loading

0 comments on commit a157a1f

Please sign in to comment.