mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
GANG: Rename equipment that uses real brand names (#2293)
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
|||||||
calculateAscensionPointsGain,
|
calculateAscensionPointsGain,
|
||||||
} from "./formulas/formulas";
|
} from "./formulas/formulas";
|
||||||
import { GangMemberExpGain } from "@nsdefs";
|
import { GangMemberExpGain } from "@nsdefs";
|
||||||
|
import { convertV2GangEquipmentNames } from "../utils/APIBreaks/3.0.0";
|
||||||
|
|
||||||
interface IMults {
|
interface IMults {
|
||||||
hack: number;
|
hack: number;
|
||||||
@@ -372,7 +373,11 @@ export class GangMember {
|
|||||||
|
|
||||||
/** Initializes a GangMember object from a JSON save state. */
|
/** Initializes a GangMember object from a JSON save state. */
|
||||||
static fromJSON(value: IReviverValue): GangMember {
|
static fromJSON(value: IReviverValue): GangMember {
|
||||||
return Generic_fromJSON(GangMember, value.data);
|
const member = Generic_fromJSON(GangMember, value.data);
|
||||||
|
for (let i = 0; i < member.upgrades.length; ++i) {
|
||||||
|
member.upgrades[i] = convertV2GangEquipmentNames(member.upgrades[i]);
|
||||||
|
}
|
||||||
|
return member;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,37 +47,37 @@ export const gangMemberUpgradesMetadata: IGangMemberUpgradeMetadata[] = [
|
|||||||
{
|
{
|
||||||
cost: 25e6,
|
cost: 25e6,
|
||||||
mults: { str: 1.1, def: 1.1, dex: 1.1, agi: 1.1 },
|
mults: { str: 1.1, def: 1.1, dex: 1.1, agi: 1.1 },
|
||||||
name: "Glock 18C",
|
name: "Malorian-3516",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 50e6,
|
cost: 50e6,
|
||||||
mults: { str: 1.12, def: 1.1, agi: 1.1 },
|
mults: { str: 1.12, def: 1.1, agi: 1.1 },
|
||||||
name: "P90C",
|
name: "Hansen-HA7",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 60e6,
|
cost: 60e6,
|
||||||
mults: { str: 1.2, def: 1.15 },
|
mults: { str: 1.2, def: 1.15 },
|
||||||
name: "Steyr AUG",
|
name: "Arasaka-HJSH18",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 100e6,
|
cost: 100e6,
|
||||||
mults: { str: 1.25, def: 1.2 },
|
mults: { str: 1.25, def: 1.2 },
|
||||||
name: "AK-47",
|
name: "Militech-M251s",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 150e6,
|
cost: 150e6,
|
||||||
mults: { str: 1.3, def: 1.25 },
|
mults: { str: 1.3, def: 1.25 },
|
||||||
name: "M15A10 Assault Rifle",
|
name: "Nokota-D5",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 225e6,
|
cost: 225e6,
|
||||||
mults: { str: 1.3, dex: 1.25, agi: 1.3 },
|
mults: { str: 1.3, dex: 1.25, agi: 1.3 },
|
||||||
name: "AWM Sniper Rifle",
|
name: "Techtronika-SPT32",
|
||||||
upgType: UpgradeType.Weapon,
|
upgType: UpgradeType.Weapon,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -107,25 +107,25 @@ export const gangMemberUpgradesMetadata: IGangMemberUpgradeMetadata[] = [
|
|||||||
{
|
{
|
||||||
cost: 3e6,
|
cost: 3e6,
|
||||||
mults: { agi: 1.04, cha: 1.04 },
|
mults: { agi: 1.04, cha: 1.04 },
|
||||||
name: "Ford Flex V20",
|
name: "Herrera Outlaw GTS",
|
||||||
upgType: UpgradeType.Vehicle,
|
upgType: UpgradeType.Vehicle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 9e6,
|
cost: 9e6,
|
||||||
mults: { agi: 1.08, cha: 1.08 },
|
mults: { agi: 1.08, cha: 1.08 },
|
||||||
name: "ATX1070 Superbike",
|
name: "Yaiba ASM-R250 Muramasa",
|
||||||
upgType: UpgradeType.Vehicle,
|
upgType: UpgradeType.Vehicle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 18e6,
|
cost: 18e6,
|
||||||
mults: { agi: 1.12, cha: 1.12 },
|
mults: { agi: 1.12, cha: 1.12 },
|
||||||
name: "Mercedes-Benz S9001",
|
name: "Rayfield Caliburn",
|
||||||
upgType: UpgradeType.Vehicle,
|
upgType: UpgradeType.Vehicle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
cost: 30e6,
|
cost: 30e6,
|
||||||
mults: { agi: 1.16, cha: 1.16 },
|
mults: { agi: 1.16, cha: 1.16 },
|
||||||
name: "White Ferrari",
|
name: "Quadra Sport R-7",
|
||||||
upgType: UpgradeType.Vehicle,
|
upgType: UpgradeType.Vehicle,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -276,7 +276,10 @@ export function NetscriptGang(): InternalAPI<IGang> {
|
|||||||
getGang(ctx);
|
getGang(ctx);
|
||||||
const member = getGangMember(ctx, memberName);
|
const member = getGangMember(ctx, memberName);
|
||||||
const equipment = GangMemberUpgrades[equipName];
|
const equipment = GangMemberUpgrades[equipName];
|
||||||
if (!equipment) return false;
|
if (!equipment) {
|
||||||
|
ctx.workerScript.log("gang.purchaseEquipment", () => `'${equipName}' is not a valid equipment`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
const res = member.buyUpgrade(equipment);
|
const res = member.buyUpgrade(equipment);
|
||||||
if (res) {
|
if (res) {
|
||||||
ctx.workerScript.log(
|
ctx.workerScript.log(
|
||||||
|
|||||||
@@ -1,5 +1,32 @@
|
|||||||
import type { VersionBreakingChange } from "./APIBreak";
|
import type { VersionBreakingChange } from "./APIBreak";
|
||||||
|
|
||||||
|
export function convertV2GangEquipmentNames(name: string): string {
|
||||||
|
switch (name) {
|
||||||
|
case "Glock 18C":
|
||||||
|
return "Malorian-3516";
|
||||||
|
case "P90C":
|
||||||
|
return "Hansen-HA7";
|
||||||
|
case "Steyr AUG":
|
||||||
|
return "Arasaka-HJSH18";
|
||||||
|
case "AK-47":
|
||||||
|
return "Militech-M251s";
|
||||||
|
case "M15A10 Assault Rifle":
|
||||||
|
return "Nokota-D5";
|
||||||
|
case "AWM Sniper Rifle":
|
||||||
|
return "Techtronika-SPT32";
|
||||||
|
case "Ford Flex V20":
|
||||||
|
return "Herrera Outlaw GTS";
|
||||||
|
case "ATX1070 Superbike":
|
||||||
|
return "Yaiba ASM-R250 Muramasa";
|
||||||
|
case "Mercedes-Benz S9001":
|
||||||
|
return "Rayfield Caliburn";
|
||||||
|
case "White Ferrari":
|
||||||
|
return "Quadra Sport R-7";
|
||||||
|
default:
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const breakingChanges300: VersionBreakingChange = {
|
export const breakingChanges300: VersionBreakingChange = {
|
||||||
additionalText: "For more information, please check https://github.com/bitburner-official/bitburner-src/issues/2148.",
|
additionalText: "For more information, please check https://github.com/bitburner-official/bitburner-src/issues/2148.",
|
||||||
apiBreakingChanges: [
|
apiBreakingChanges: [
|
||||||
@@ -297,5 +324,65 @@ export const breakingChanges300: VersionBreakingChange = {
|
|||||||
"- ns.getWeakenTime\n",
|
"- ns.getWeakenTime\n",
|
||||||
showWarning: false,
|
showWarning: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
brokenAPIs: [
|
||||||
|
{
|
||||||
|
name: "Glock 18C",
|
||||||
|
migration: { searchValue: "Glock 18C", replaceValue: convertV2GangEquipmentNames("Glock 18C") },
|
||||||
|
},
|
||||||
|
{ name: "P90C", migration: { searchValue: "P90C", replaceValue: convertV2GangEquipmentNames("P90C") } },
|
||||||
|
{
|
||||||
|
name: "Steyr AUG",
|
||||||
|
migration: { searchValue: "Steyr AUG", replaceValue: convertV2GangEquipmentNames("Steyr AUG") },
|
||||||
|
},
|
||||||
|
{ name: "AK-47", migration: { searchValue: "AK-47", replaceValue: convertV2GangEquipmentNames("AK-47") } },
|
||||||
|
{
|
||||||
|
name: "M15A10 Assault Rifle",
|
||||||
|
migration: {
|
||||||
|
searchValue: "M15A10 Assault Rifle",
|
||||||
|
replaceValue: convertV2GangEquipmentNames("M15A10 Assault Rifle"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "AWM Sniper Rifle",
|
||||||
|
migration: { searchValue: "AWM Sniper Rifle", replaceValue: convertV2GangEquipmentNames("AWM Sniper Rifle") },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Ford Flex V20",
|
||||||
|
migration: { searchValue: "Ford Flex V20", replaceValue: convertV2GangEquipmentNames("Ford Flex V20") },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ATX1070 Superbike",
|
||||||
|
migration: {
|
||||||
|
searchValue: "ATX1070 Superbike",
|
||||||
|
replaceValue: convertV2GangEquipmentNames("ATX1070 Superbike"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Mercedes-Benz S9001",
|
||||||
|
migration: {
|
||||||
|
searchValue: "Mercedes-Benz S9001",
|
||||||
|
replaceValue: convertV2GangEquipmentNames("Mercedes-Benz S9001"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "White Ferrari",
|
||||||
|
migration: { searchValue: "White Ferrari", replaceValue: convertV2GangEquipmentNames("White Ferrari") },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
info:
|
||||||
|
"Some gang equipments were renamed.\n" +
|
||||||
|
`- "Glock 18C" was renamed to "${convertV2GangEquipmentNames("Glock 18C")}".\n` +
|
||||||
|
`- "P90C" was renamed to "${convertV2GangEquipmentNames("P90C")}".\n` +
|
||||||
|
`- "Steyr AUG" was renamed to "${convertV2GangEquipmentNames("Steyr AUG")}".\n` +
|
||||||
|
`- "AK-47" was renamed to "${convertV2GangEquipmentNames("AK-47")}".\n` +
|
||||||
|
`- "M15A10 Assault Rifle" was renamed to "${convertV2GangEquipmentNames("M15A10 Assault Rifle")}".\n` +
|
||||||
|
`- "AWM Sniper Rifle" was renamed to "${convertV2GangEquipmentNames("AWM Sniper Rifle")}".\n` +
|
||||||
|
`- "Ford Flex V20" was renamed to "${convertV2GangEquipmentNames("Ford Flex V20")}".\n` +
|
||||||
|
`- "ATX1070 Superbike" was renamed to "${convertV2GangEquipmentNames("ATX1070 Superbike")}".\n` +
|
||||||
|
`- "Mercedes-Benz S9001" was renamed to "${convertV2GangEquipmentNames("Mercedes-Benz S9001")}".\n` +
|
||||||
|
`- "White Ferrari" was renamed to "${convertV2GangEquipmentNames("White Ferrari")}".\n`,
|
||||||
|
showWarning: false,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user