Skip to content

Player Class ~ Design

Jack Casey edited this page May 19, 2021 · 10 revisions

Design

Key Features

  • Provide basic classes for game developers to utilize
  • Provide framework for game developers to create their own classes in place of or in addition to our provided classes
  • Work with rpg-battle team to implement specific combat statistics / effects for different classes
  • Work with other teams to implement additional game functionality based on class, such as custom dialogue, custom NPC names, custom item usage, etc.
    • Currently supports npc class and class restrictions on items.
    • Does not seem to support custom or modified dialogue.

Data Structures

  • class_t struct
    • char* Name
    • char* Short description
    • char* Long description
    • obj_t* Attributes
    • stats_t* Base Stats
    • effects_hash_t* Effects
    • skill_inventory_t** Combat Actions
    • UT_hash_handle Field for use by UTHASH macros

Modules

class_structs

  • Holds the class structure, but has no functions.

class

  • Note: although these functions seem helpful, only class_new and class_free seems to have been implemented.

  • Create a new playerclass

    • class_t* class_new(char* name, char* shortdesc, char* longdesc, obj_t* attr, stats_hash_t* stat, effects_hash_t* effect);
  • Set values inside the playerclass

    • Set the name of the class
      • int class_setname(class_t* c, char* name);
    • Set the description of the class
      • int class_setdesc(class_t* c, char* desc);
    • Set the attributes of the class to a new array of attributes
      • int class_setattributes(class_t*, attribute_t** attributes);
        • This function would need to be updated to use obj_t
    • Set the player stats of the class
      • int class_setstat(class_t* c, stat_t* stat);
    • Set the combat actions of the class
      • int class_setcombat(class_t* c, combat_action_t** combat);
    • Set the non-combat actions of the class
      • int class_setcustom_actions(class_t* c, game_action_t** custom);
  • Get values inside the playerclass

    • Get the name of the class
      • char* class_getname(class_t* c);
    • Get the description of the class
      • char* class_getdesc(class_t* c);
    • Get the list of attributes of the class
      • attribute_t** class_getattributes(class_t* c);
        • This function would need to be updated to use obj_t
    • Get the statistics of the class
      • stat_t* class_getstat(class_t* c);
    • Get the list of combat actions for the class
      • combat_action_t** class_getcombat(class_t* c);
    • Get the list of game actions for the class
      • game_action_t** class_getcustom_action(class_t* c);
  • Free a playerclass

    • void class_free(class_t* c);

class_item_restriction

  • Set a class restriction on an item
    • int set_item_restriction(item_t* item, class_t* class);
  • Get the class restriction on an item
    • bool get_class_restriction(item_t* item, class_t* class);

Updated 4/23/2021 to account for changes to structures or unimplemented parts of the design.

Clone this wiki locally