Enemy

Description

Enemies will inherit from the EnemyBase class. Each one will set its stats and define its abilities in the contructor and override the ability methods. For the most part it will not add in anything new as far as attributes and methods, but some enemies may need some.

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

  • bool hasJumped - whether or not the enemy has jumped and not yet landed
  • bool isPossessed - whether it is currently possessed
  • bool isActive - whether the enemy is alive
  • bool isAware = whether the enemy is aware there is a demon near
  • bool justPossessed - whether the enemy was just possessed
  • int iter - looping iterator
  • int health - health of the enemy
  • int willPower - a value between 1 and 10 describing how difficult it is to possess the enemy where 10 is the hardest
  • float range - how close to get to the player
  • float physicalDefense - a percentage of physical damage that is reduced
  • float magicalDefense - a percentage of magical damage that is reduced
  • float speedModifier - a multiplier on the default speed, will be 1 if it has normal speed
  • 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.
  • 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.
  • AI ai - reference to the enemies AI
  • AnimationManager animation - the enemies animation manager
  • Color shadowColor - color used in drawing the shadows
  • Debuff[] debuffs - a array of debuffs that are affecting the enemy with a maximum of 3
  • EnemyState state - what state the enemy is in, which is used for animation purposes.
  • Texture2D texture - texture used to draw the enemy (temporary)
  • Texture2D possessionIndicator - texture used to indicate enemy is possessed
  • Vector2 locScreen - x, y position on the screen
  • Vector3 [] patrolPoints - waypoint positions for patrolling
  • Vector3 currentPatrolPoint - current waypoint the enemy is patrolling to
  • Vector3 position - x,y,z position of enemy
  • Vector3 velocity - x,y,z velocities of enemy

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.
  • MoveLeft
    • sets the x component of the velocity
  • MoveRight
    • sets the x component of the velocity
  • MoveUp
    • will set the z component of the velocity
  • MoveDown
    • will set the z component of the 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
  • ChangeStyle
    • changes the AI style and initializes any associations with it
  • ChangeDegree
    • changes the AI degree and initializes any associations with it
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License