Merge pull request #1307 from Nolshine/improve_gang_ascend_modal

improve gang ascend modal
This commit is contained in:
hydroflame 2021-09-21 11:04:23 -04:00 committed by GitHub
commit db35fde42e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 27 deletions

@ -218,28 +218,41 @@ export class GangMember {
return points.hack > 0 || points.str > 0 || points.def > 0 || points.dex > 0 || points.agi > 0 || points.cha > 0;
}
getAscensionResults(): IMults {
getCurrentAscensionMults(): IMults {
return {
hack: this.calculateAscensionMult(this.hack_asc_points),
str: this.calculateAscensionMult(this.str_asc_points),
def: this.calculateAscensionMult(this.def_asc_points),
dex: this.calculateAscensionMult(this.dex_asc_points),
agi: this.calculateAscensionMult(this.agi_asc_points),
cha: this.calculateAscensionMult(this.cha_asc_points)
}
}
getAscensionMultsAfterAscend(): IMults {
const points = this.getGainedAscensionPoints();
return {
hack:
this.calculateAscensionMult(this.hack_asc_points + points.hack) /
this.calculateAscensionMult(this.hack_asc_points),
str:
this.calculateAscensionMult(this.str_asc_points + points.str) /
this.calculateAscensionMult(this.str_asc_points),
def:
this.calculateAscensionMult(this.def_asc_points + points.def) /
this.calculateAscensionMult(this.def_asc_points),
dex:
this.calculateAscensionMult(this.dex_asc_points + points.dex) /
this.calculateAscensionMult(this.dex_asc_points),
agi:
this.calculateAscensionMult(this.agi_asc_points + points.agi) /
this.calculateAscensionMult(this.agi_asc_points),
cha:
this.calculateAscensionMult(this.cha_asc_points + points.cha) /
this.calculateAscensionMult(this.cha_asc_points),
};
hack: this.calculateAscensionMult(this.hack_asc_points + points.hack),
str: this.calculateAscensionMult(this.str_asc_points + points.str),
def: this.calculateAscensionMult(this.def_asc_points + points.def),
dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),
agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),
cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),
}
}
getAscensionResults(): IMults {
const postAscend = this.getAscensionMultsAfterAscend();
const preAscend = this.getCurrentAscensionMults();
return {
hack: postAscend.hack / preAscend.hack,
str: postAscend.str / preAscend.str,
def: postAscend.def / preAscend.def,
dex: postAscend.dex / preAscend.dex,
agi: postAscend.agi / preAscend.agi,
cha: postAscend.cha / preAscend.cha,
}
}
ascend(): IAscensionResult {

@ -57,7 +57,9 @@ export function AscensionPopup(props: IProps): React.ReactElement {
removePopup(props.popupId);
}
const ascendBenefits = props.member.getAscensionResults();
// const ascendBenefits = props.member.getAscensionResults();
const preAscend = props.member.getCurrentAscensionMults();
const postAscend = props.member.getAscensionMultsAfterAscend();
return (
<>
@ -72,17 +74,17 @@ export function AscensionPopup(props: IProps): React.ReactElement {
<br />
In return, they will gain the following permanent boost to stat multipliers:
<br />
Hacking: x{numeralWrapper.format(ascendBenefits.hack, "0.000")}
Hacking: x{numeralWrapper.format(preAscend.hack, "0.000")} =&gt; x{numeralWrapper.format(postAscend.hack, "0.000")}
<br />
Strength: x{numeralWrapper.format(ascendBenefits.str, "0.000")}
Strength: x{numeralWrapper.format(preAscend.str, "0.000")} =&gt; x{numeralWrapper.format(postAscend.str, "0.000")}
<br />
Defense: x{numeralWrapper.format(ascendBenefits.def, "0.000")}
Defense: x{numeralWrapper.format(preAscend.def, "0.000")} =&gt; x{numeralWrapper.format(postAscend.def, "0.000")}
<br />
Dexterity: x{numeralWrapper.format(ascendBenefits.dex, "0.000")}
Dexterity: x{numeralWrapper.format(preAscend.dex, "0.000")} =&gt; x{numeralWrapper.format(postAscend.dex, "0.000")}
<br />
Agility: x{numeralWrapper.format(ascendBenefits.agi, "0.000")}
Agility: x{numeralWrapper.format(preAscend.agi, "0.000")} =&gt; x{numeralWrapper.format(postAscend.agi, "0.000")}
<br />
Charisma: x{numeralWrapper.format(ascendBenefits.cha, "0.000")}
Charisma: x{numeralWrapper.format(preAscend.cha, "0.000")} =&gt; x{numeralWrapper.format(postAscend.cha, "0.000")}
<br />
</pre>
<button className="std-button" onClick={confirm}>