EnemyBase

Description

This will be the abstract class that all specific enemies will inherit and so it will hold everything that will be common between all enemies. This includes health, physical defense, magical defense, position, velocity, whether it’s possessed, if it’s alive, speed, will power, a list of debuffs, and its 3 abilities. Each enemy will take care of drawing itself(through its animation manager)and updating its debuffs.When it is possessed the player will tell it when to move and use abilities, otherwise the AI will control when these happen.

Relationships:

  • LevelManager : Will be made in the LevelManager class
  • AnimationManager : Will have its own AnimationManager
  • Player : Player class will control the enemy when it is possessing it, instead of AI
  • Debuff : Will use the Debuff struct to describe all the debuffs that are currently affecting him
  • Ability : Will use the Ability struct to describe the abilities(1, 2, special) it has
  • AI : Will reference AI which will be used in the update method to move, jump, and perform abilities
  • EnemyState : Will use the EnemyState enum in the EnumClass

Members

  • int health - health of the enemy
  • float physicalDefense - a percentage of physical damage that is reduced
  • float magicalDefense - a percentage of magical damage that is reduced
  • bool isPossessed - whether it is currently possessed
  • float speedModifier - a multiplier on the default speed, will be 1 if it has normal speed
  • Vector3 position - x,y,z position of enemy
  • Vector3 velocity - x,y,z velocities of enemy
  • AnimationManager animation - the enemies animation manager
  • int willPower - a value between 1 and 10 describing how difficult it is to possess the enemy where 10 is the hardest
  • Debuff[] debuffs - a array of debuffs that are affecting the enemy with a maximum of 3
  • Ability ability1 - the enemies first ability
  • Ability ability2 - the enemies second ability
  • Ability specialAbility - the enemies special ability
  • AI_Style currentStyle - Style the AI is performing right now
  • AI_Degree currentDegree - What degre at which the AI is performing, how fast, how hard, etc.
  • float howPowerful - heuristic used for supportive AI. Judges health, frequency of losing health, degree, style, abilities, frequency of special, defenses, debuffs, and willpower and comes up with a number of how powerful this character is.
  • EnemyState state - what state the enemy is in, which is used for animation purposes.

Methods

  • Update
    • if not possessed
      • moves, jumps, and uses abilities based on certain AI behaviors. The behaviors will be decided for each enemy.
    • if possessed
      • the enemy will be controlled via the player class
    • will check each ability and see if the isUsed property is true, if so it will call the corresponding abilities method
    • checks for death, calls Death method if it has died
    • updates the animation based on the current state
  • Draw
    • draws itself at its current position using it's animation manager
    • the enemies's position is passed in to it's animation manager, and it takes care of the rest
  • Movement
    • updates the position based on the players velocity.
  • Jump
    • will set the y component of the velocity(will have to test for a value that looks good)
  • PerformAbility1
    • This method will do any updating that the ability would need while it is still in the process of being used. For example, for a bullet this would update the ray used for collision based on a changing position of the bullet.
    • Will take into account the abilities castTime and Cooldown to decide when the ability's isUsed property should remain true.
  • PerformAbility2
    • will perform its second ability
  • PerformSpecial
    • will perform its special ability
  • Reset
    • will reset its health, isPossessed, isAlive, position, velocity, animation, and debuffs
  • Death
    • sets isActive to false
    • when it is dead it can be reused in a later section by resetting it and setting its position to where the new enemy has to go
  • PerformAI
    • pass in an enemy, a AI_Style, and a AI_Degree
    • the method will then tell the enemy what to do based on the style/degree passed in
    • will use the Grid Manager for info about whats happening onscreen
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License