Move player skills and exp to their struct

This commit is contained in:
Olivier Gagnon
2022-07-26 23:54:17 -04:00
parent 3e4f26ac0a
commit 326d9fd7ef
45 changed files with 546 additions and 487 deletions
+4 -4
View File
@@ -403,10 +403,10 @@ export function NetscriptBladeburner(player: IPlayer, workerScript: WorkerScript
if (player.bladeburner instanceof Bladeburner) {
return true; // Already member
} else if (
player.strength >= 100 &&
player.defense >= 100 &&
player.dexterity >= 100 &&
player.agility >= 100
player.skills.strength >= 100 &&
player.skills.defense >= 100 &&
player.skills.dexterity >= 100 &&
player.skills.agility >= 100
) {
player.bladeburner = new Bladeburner(player);
ctx.log(() => "You have been accepted into the Bladeburner division");
+1 -1
View File
@@ -1257,7 +1257,7 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
const wd = GetServer(SpecialServers.WorldDaemon);
if (!(wd instanceof Server))
throw new Error("WorldDaemon was not a normal server. This is a bug contact dev.");
if (player.hacking < wd.requiredHackingSkill) return false;
if (player.skills.hacking < wd.requiredHackingSkill) return false;
if (!wd.hasAdminRights) return false;
return true;
};
+8 -8
View File
@@ -40,12 +40,12 @@ export function NetscriptSleeve(player: IPlayer): InternalAPI<ISleeve> {
shock: 100 - sl.shock,
sync: sl.sync,
memory: sl.memory,
hacking: sl.hacking,
strength: sl.strength,
defense: sl.defense,
dexterity: sl.dexterity,
agility: sl.agility,
charisma: sl.charisma,
hacking: sl.skills.hacking,
strength: sl.skills.strength,
defense: sl.skills.defense,
dexterity: sl.skills.dexterity,
agility: sl.skills.agility,
charisma: sl.skills.charisma,
};
};
@@ -206,10 +206,10 @@ export function NetscriptSleeve(player: IPlayer): InternalAPI<ISleeve> {
return {
tor: false,
city: sl.city,
hp: sl.hp,
hp: sl.hp.current,
jobs: Object.keys(player.jobs), // technically sleeves have the same jobs as the player.
jobTitle: Object.values(player.jobs),
maxHp: sl.max_hp,
maxHp: sl.hp.max,
mult: {
agility: sl.mults.agility,