mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 19:14:32 +02:00
DNET: Player feedback (#2545)
This commit is contained in:
committed by
GitHub
parent
73b7921ef0
commit
1b6b07faae
@@ -55,6 +55,9 @@ export class CodingContract {
|
||||
processed outside of this file */
|
||||
reward: ICodingContractReward | null;
|
||||
|
||||
/* Scalar for the reward, used to generate lower-value CCTs more frequently */
|
||||
rewardScaling: number = 1;
|
||||
|
||||
/* Number of times the Contract has been attempted */
|
||||
tries = 0;
|
||||
|
||||
@@ -65,6 +68,7 @@ export class CodingContract {
|
||||
fn = "default.cct",
|
||||
type = CodingContractName.FindLargestPrimeFactor,
|
||||
reward: ICodingContractReward | null = null,
|
||||
rewardScaling: number = 1,
|
||||
) {
|
||||
const path = resolveContractFilePath(fn);
|
||||
if (!path) {
|
||||
@@ -78,6 +82,7 @@ export class CodingContract {
|
||||
this.type = type;
|
||||
this.state = CodingContractTypes[type].generate();
|
||||
this.reward = reward;
|
||||
this.rewardScaling = rewardScaling;
|
||||
}
|
||||
|
||||
getAnswer() {
|
||||
|
||||
@@ -130,6 +130,7 @@ interface IGenerateContractParams {
|
||||
server?: string;
|
||||
filename?: ContractFilePath;
|
||||
reward?: ICodingContractReward;
|
||||
rewardScaling?: number;
|
||||
}
|
||||
|
||||
export function generateContract(params: IGenerateContractParams): void {
|
||||
@@ -163,7 +164,7 @@ export function generateContract(params: IGenerateContractParams): void {
|
||||
if (filename == null) {
|
||||
return;
|
||||
}
|
||||
const contract = new CodingContract(filename, problemType, reward);
|
||||
const contract = new CodingContract(filename, problemType, reward, params.rewardScaling);
|
||||
server.addContract(contract);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user