JuanPablo2655/cobalt-network-rewrite

companions

Opened this issue · 7 comments

Is your feature request related to a problem? Please describe.
I've been trying to figure out the best stats for companions. So far I have this:

export interface RaceData {
	race: RaceOptions;
	description: string;
	health: number;
	magicka: number;
	defense: number;
	attack: number;
}

Describe the ideal solution
probably refactor raceData I don't know.

Yeah this is gonna have to get refactored into something like this:

export interface RaceData {
	race: RaceOptions;
	description: string;
	health: number;
	mana: number;
	stats: {
		strength: number;
		dexterity: number;
		endurance: number;
		intelligence: number;
		luck: number; // ?? maybe
	};
}

RaceData isn't so clear on what it does. CompanionData or PetData should be better.

Maybe the companion stats should be separated into its own class to separate responsibilities.

Oh yeah, CompanionData sounds a lot better.

okay I've been messing around with the idea and this is what I've come up with so far:

export interface Companion {
	_id: Snowflake;
	name: string;
	exp: Experience;
	data: EntityData;
}

export interface Npc {
	name: string;
	data: EntityData;
	killable: boolean;
}

export interface EntityData {
	dna: DnaOptions;
	gender: string;
	class: ClassOptions;
	health: number;
	mana: number;
	stats: Stats;
	mutation: 'Vampire' | 'Werewolf' | 'Undead' | null;
}

export interface Experience {
	level: number;
	xp: number;
}

export interface Stats {
	strength: number;
	dexterity: number;
	endurance: number;
	intelligence: number;
}

Data=> EntityData?
I would avoid using race and opting for dna.

Yeah, that works also moved killable to Npc.