Combat - UQcsse3200/2024-studio-2 GitHub Wiki

1. Introduction

In each kingdom, the player has to engage in combat with enemy NPCs and (mini-)bosses in order to progress in the game. Combat with enemies should provide some kind of reward to players, whether that be gaining experience points (xp), collecting items, and/or progressing to the next animal kingdom. The victor of a battle will be decided by whoever makes their opponent run out of health points (HP) first.

2. Initiating Combat

Enemies always "agro" on the player and try to attack them when they are in line of sight. Some enemies can only attack by getting close to the player (melee) while others can hit the player at distance (ranged attacks). If a player does not wish to engage in combat, they can "de-agro" the enemy by escaping the enemies line of sight. When the player or an enemy lands an attack on one another in the main game, combat begins.

The conditions for initiating combat with a boss are different.

THIS SECTION IS A W.I.P.

3. Health in Battle

The HP of an animal at the start of battle is equal to their health stat. If an animal uses an item or special move to heal their health, then it cannot be healed above the starting amount.

4. Combat

  • See Combat Screen for more details on the combat layout.
  • See Combat System for more details on how combat is performed between the player and enemy.

5. Victory

If a player successfully defeats an enemy or boss, then they receive xp which is commensurate with the strength of their enemy (see Experience System). Enemies may also drop an item that is added to the player's inventory. In the case of defeating a kingdom's boss, the player progresses to the next kingdom.

The defeated enemy is converted to a friendly NPC.

6. Defeat

If a player is defeated in battle, then there should be some sort of penalty.

UML Diagram

image

The UML diagram above illustrates the overall architecture of the combat system within the game. It includes key components such as the CombatScreen, CombatManager, CombatButtonDisplay, and their interactions with game areas and entities. The CombatScreen handles rendering the combat interface, while the CombatManager manages the logic behind combat actions. Components like CombatStatsComponent and CombatActions help facilitate the tracking of player and enemy statistics as well as the actions performed during a combat sequence. This structure ensures that combat events, such as attacking, guarding, or using items, are handled efficiently and effectively in the game’s flow.

THIS SECTION IS A W.I.P.