import * as React from "react"; import { GangMember } from "../GangMember"; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { formatNumber } from "../../../utils/StringHelperFunctions"; import { numeralWrapper } from "../../ui/numeralFormat"; import { createPopup, removePopup } from "../../ui/React/createPopup"; interface IAscendProps { member: any; gang: any; popupId: string; } function ascendPopup(props: IAscendProps): React.ReactElement { function confirm() { props.gang.ascendMember(props.member); props.gang.updateGangMemberDisplayElement(props.member); removePopup(props.popupId); return false; } function cancel() { removePopup(props.popupId); return false; } const ascendBenefits = props.member.getAscensionResults(); return (<>
Are you sure you want to ascend this member? They will lose all of
their non-Augmentation upgrades and their stats will reset back to 1.
Furthermore, your gang will lose {numeralWrapper.formatRespect(props.member.earnedRespect)} respect
In return, they will gain the following permanent boost to stat multipliers:
Hacking: +{numeralWrapper.formatPercentage(ascendBenefits.hack)}
Strength: +{numeralWrapper.formatPercentage(ascendBenefits.str)}
Defense: +{numeralWrapper.formatPercentage(ascendBenefits.def)}
Dexterity: +{numeralWrapper.formatPercentage(ascendBenefits.dex)}
Agility: +{numeralWrapper.formatPercentage(ascendBenefits.agi)}
Charisma: +{numeralWrapper.formatPercentage(ascendBenefits.cha)}
>);
}
interface IProps {
member: any;
gang: any;
}
export function Panel1(props: IProps): React.ReactElement {
function ascend() {
const popupId = `gang-management-ascend-member ${props.member.name}`;
createPopup(popupId, ascendPopup, {
member: props.member,
gang: props.gang,
popupId: popupId,
});
}
return (<>
Hacking: {formatNumber(props.member.hack, 0)} ({numeralWrapper.formatExp(props.member.hack_exp)} exp)
Strength: {formatNumber(props.member.str, 0)} ({numeralWrapper.formatExp(props.member.str_exp)} exp)
Defense: {formatNumber(props.member.def, 0)} ({numeralWrapper.formatExp(props.member.def_exp)} exp)
Dexterity: {formatNumber(props.member.dex, 0)} ({numeralWrapper.formatExp(props.member.dex_exp)} exp)
Agility: {formatNumber(props.member.agi, 0)} ({numeralWrapper.formatExp(props.member.agi_exp)} exp)
Charisma: {formatNumber(props.member.cha, 0)} ({numeralWrapper.formatExp(props.member.cha_exp)} exp)