sleeve ui says bonus time and sleeves cant consume all bonus time at once.

This commit is contained in:
Olivier Gagnon
2021-09-24 23:02:27 -04:00
parent 2d45784102
commit 69c9b20e68
2 changed files with 11 additions and 0 deletions

View File

@ -479,6 +479,7 @@ export class Sleeve extends Person {
let time = this.storedCycles * CONSTANTS.MilliPerCycle;
let cyclesUsed = this.storedCycles;
cyclesUsed = Math.min(cyclesUsed, 15);
if (this.currentTaskMaxTime !== 0 && this.currentTaskTime + time > this.currentTaskMaxTime) {
time = this.currentTaskMaxTime - this.currentTaskTime;
cyclesUsed = Math.floor(time / CONSTANTS.MilliPerCycle);

View File

@ -1,6 +1,8 @@
import { Sleeve } from "../Sleeve";
import { numeralWrapper } from "../../../ui/numeralFormat";
import * as React from "react";
import { convertTimeMsToTimeElapsedString } from "../../../../utils/StringHelperFunctions";
import { CONSTANTS } from "../../../Constants";
interface IProps {
sleeve: Sleeve;
@ -77,6 +79,14 @@ export function StatsElement(props: IProps): React.ReactElement {
{numeralWrapper.formatSleeveMemory(props.sleeve.memory)}
</td>
</tr>
{props.sleeve.storedCycles > 15 && (
<tr>
<td>Bonus time: </td>
<td style={style}>
{convertTimeMsToTimeElapsedString((props.sleeve.storedCycles / (1000 / CONSTANTS._idleSpeed)) * 1000)}
</td>
</tr>
)}
</tbody>
</table>
</>