JuanPablo2655 / cobalt-network-rewrite

2 stars 0 forks source link

companions #5

Open JuanPablo2655 opened 3 years ago

JuanPablo2655 commented 3 years ago

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.

JuanPablo2655 commented 3 years ago

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
    };
}
rand0m-cloud commented 3 years ago

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.

JuanPablo2655 commented 3 years ago

Oh yeah, CompanionData sounds a lot better.

JuanPablo2655 commented 3 years ago

add a companion system

JuanPablo2655 commented 3 years ago

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;
}
rand0m-cloud commented 3 years ago

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

JuanPablo2655 commented 3 years ago

Yeah, that works also moved killable to Npc.