Stats ~ Fitting Initial Stat Ideas into Current Code Implementation Code Design - uchicago-cs/chiventure GitHub Wiki

Current Integration of players and actions: Notable modules

  • Player; header file in chiventure/game-state/include/player.h
    • Contains a pointer to player_id and inventory, as well as rudimentary level, health, and xp ints.
      • Including a change_health and get_health, change_xp/get_xp, and change_level/get_level int functions
  • Action, header file in chiventure/include/action-management/action_structs.h
    • Contains “action”
      • Enum in struct action_type_t specifying push, pull, eat, etc.
    • Contains “kind" of action
      • Enum in struct action_type_t specifying whether a player does something to an item, whether a player walks in a certain direction, or whether a player interacts with two items.
  • Game, header file in chiventure/include/game-state/game.h
    • Includes struct game with a hash-table of players, items, “current player”, etc.

Features to implement

  • Provide basic player statistics and the tools to manipulate and display them throughout gameplay, adding support for custom statuses
  • Work closely with the rpg-battle team to implement specific combat statistics/effects according to actions
    • Implement dynamic status structure inside a class_t struct to monitor buffs/nerfs and other status changes
      • Temporary stats gain
      • States e.g., stunned
      • “Dispel” certain effects incurred by items or actions
  • Work with rpg-classes to implement starting statistics
  • Work with others to add or change additional features, such as interaction with objects, rooms, npcs, level, inventory, and display messages

Modules and structs to implement: starting point

  • Struct stat_t* = stat_new(char* stat_name, int stat_threshold)
  • Some sort of stat_list with stat_t (array?) in game.h
    • If it ever dips below “stat_threshold”, the player’s behavior would change accordingly
    • Can add to player in player.h
  • “Int modify_stat(player_t* p, stat_t s, int i)” and “stat_t get_stat(player_p* p, stat_t s)”
    • Consolidate change_[STAT] and get_[STAT] functions already implemented, in other words
    • In player.h
  • display_stats(player_t* p)

Other things to consider

  • Most of our work will involve working with other teams to see where we want additional features to go; this is nothing more than a baseline for now.
  • Most immediate goal is responding to rpg-battle needs and implementing specific and set stats (see starting point)