2023-06-12 06:34:20 +02:00
|
|
|
import type { Skills } from "./Skills";
|
|
|
|
import type { HP } from "./HP";
|
|
|
|
import type { Person as IPerson } from "@nsdefs";
|
|
|
|
|
2022-09-20 07:57:46 +02:00
|
|
|
import * as personMethods from "./PersonMethods";
|
2023-06-12 06:34:20 +02:00
|
|
|
import { CityName } from "@enums";
|
2022-09-27 21:14:34 +02:00
|
|
|
import { PlayerOwnedAugmentation } from "../Augmentation/PlayerOwnedAugmentation";
|
2021-03-31 06:45:21 +02:00
|
|
|
import { calculateSkill } from "./formulas/skill";
|
2022-09-20 07:57:46 +02:00
|
|
|
import { defaultMultipliers } from "./Multipliers";
|
|
|
|
import { IReviverValue } from "../utils/JSONReviver";
|
2018-12-07 11:54:26 +01:00
|
|
|
|
2022-04-14 17:40:59 +02:00
|
|
|
// Base class representing a person-like object
|
2022-11-09 13:26:26 +01:00
|
|
|
export abstract class Person implements IPerson {
|
2022-07-27 05:54:17 +02:00
|
|
|
hp: HP = { current: 10, max: 10 };
|
|
|
|
skills: Skills = {
|
|
|
|
hacking: 1,
|
|
|
|
strength: 1,
|
|
|
|
defense: 1,
|
|
|
|
dexterity: 1,
|
|
|
|
agility: 1,
|
|
|
|
charisma: 1,
|
2022-08-15 15:38:10 +02:00
|
|
|
intelligence: 0,
|
2022-07-27 05:54:17 +02:00
|
|
|
};
|
|
|
|
exp: Skills = {
|
|
|
|
hacking: 0,
|
|
|
|
strength: 0,
|
|
|
|
defense: 0,
|
|
|
|
dexterity: 0,
|
|
|
|
agility: 0,
|
|
|
|
charisma: 0,
|
|
|
|
intelligence: 0,
|
|
|
|
};
|
2018-12-07 11:54:26 +01:00
|
|
|
|
2022-07-15 00:43:33 +02:00
|
|
|
mults = defaultMultipliers();
|
2022-03-27 06:26:43 +02:00
|
|
|
|
2022-09-27 19:27:17 +02:00
|
|
|
/** Augmentations */
|
2022-09-27 21:14:34 +02:00
|
|
|
augmentations: PlayerOwnedAugmentation[] = [];
|
|
|
|
queuedAugmentations: PlayerOwnedAugmentation[] = [];
|
2018-12-07 11:54:26 +01:00
|
|
|
|
2022-09-27 19:27:17 +02:00
|
|
|
/** City that the person is in */
|
2021-09-05 01:09:30 +02:00
|
|
|
city: CityName = CityName.Sector12;
|
2018-12-07 11:54:26 +01:00
|
|
|
|
2022-09-20 07:57:46 +02:00
|
|
|
gainHackingExp = personMethods.gainHackingExp;
|
|
|
|
gainStrengthExp = personMethods.gainStrengthExp;
|
|
|
|
gainDefenseExp = personMethods.gainDefenseExp;
|
|
|
|
gainDexterityExp = personMethods.gainDexterityExp;
|
|
|
|
gainAgilityExp = personMethods.gainAgilityExp;
|
|
|
|
gainCharismaExp = personMethods.gainCharismaExp;
|
|
|
|
gainIntelligenceExp = personMethods.gainIntelligenceExp;
|
|
|
|
gainStats = personMethods.gainStats;
|
|
|
|
regenerateHp = personMethods.regenerateHp;
|
|
|
|
updateSkillLevels = personMethods.updateSkillLevels;
|
2022-09-27 22:23:53 +02:00
|
|
|
hasAugmentation = personMethods.hasAugmentation;
|
2022-09-20 07:57:46 +02:00
|
|
|
calculateSkill = calculateSkill; //Class version is equal to imported version
|
2021-09-05 01:09:30 +02:00
|
|
|
|
2022-09-27 19:27:17 +02:00
|
|
|
/** Reset all multipliers to 1 */
|
2022-09-20 07:57:46 +02:00
|
|
|
resetMultipliers() {
|
2022-07-15 00:43:33 +02:00
|
|
|
this.mults = defaultMultipliers();
|
2021-09-05 01:09:30 +02:00
|
|
|
}
|
|
|
|
|
2022-04-14 17:40:59 +02:00
|
|
|
abstract takeDamage(amt: number): boolean;
|
|
|
|
abstract whoAmI(): string;
|
2022-09-20 07:57:46 +02:00
|
|
|
abstract toJSON(): IReviverValue;
|
2018-12-07 11:54:26 +01:00
|
|
|
}
|