C# Class DivineRightGame.CombatHandling.CombatManager

Contains functions pertaining to combat
Mostra file Open project: Haedrian/Divine-Right

Public Methods

Method Description
Attack ( Actor attacker, Actor defender, AttackLocation location, SpecialAttack special = null ) : ActionFeedback[]

Performs an attack on a character. Will also give an amount of feedback. Also reduces the health of the defender if the attack hits

CalculateHitPercentage ( Actor attacker, Actor defender, AttackLocation location ) : int

Calculates the chance of hitting a particular body part.

GetRandomAttackLocation ( Actor attacker, Actor defender ) : AttackLocation?

Gets a random attack location to attack. Will prefer attack locations which have more chance of hitting, and will never return any locations which have a 0 chance to hit. If this is not possible, return null

KillCharacter ( Actor actor ) : void

Kills the current character

PerformSpecialAttack ( Actor attacker, Actor target, SpecialAttack attack ) : ActionFeedback[]

Attack a particular target using this special attack

Private Methods

Method Description
CombatManager ( ) : System
GetStanceEffect ( int &attack, int &defence, ActorStance stance ) : void

Gets the effect the stance has on attack and defence

LogAction ( Actor attacker, Actor defender, AttackLocation loc, DamageType type, LogMessageStatus status, int diceroll ) : ActionFeedback

Returns a particular logged action.

Method Details

Attack() public static method

Performs an attack on a character. Will also give an amount of feedback. Also reduces the health of the defender if the attack hits
public static Attack ( Actor attacker, Actor defender, AttackLocation location, SpecialAttack special = null ) : ActionFeedback[]
attacker DRObjects.Actor
defender DRObjects.Actor
location AttackLocation
special DRObjects.ActorHandling.SpecialAttacks.SpecialAttack Special attack modifications to make. THIS DOES NOT CONSIDER TARGETS OR ATTACKS
return ActionFeedback[]

CalculateHitPercentage() public static method

Calculates the chance of hitting a particular body part.
public static CalculateHitPercentage ( Actor attacker, Actor defender, AttackLocation location ) : int
attacker DRObjects.Actor
defender DRObjects.Actor
location AttackLocation
return int

GetRandomAttackLocation() public static method

Gets a random attack location to attack. Will prefer attack locations which have more chance of hitting, and will never return any locations which have a 0 chance to hit. If this is not possible, return null
public static GetRandomAttackLocation ( Actor attacker, Actor defender ) : AttackLocation?
attacker DRObjects.Actor
defender DRObjects.Actor
return AttackLocation?

KillCharacter() public static method

Kills the current character
public static KillCharacter ( Actor actor ) : void
actor DRObjects.Actor
return void

PerformSpecialAttack() public static method

Attack a particular target using this special attack
public static PerformSpecialAttack ( Actor attacker, Actor target, SpecialAttack attack ) : ActionFeedback[]
attacker DRObjects.Actor
target DRObjects.Actor
attack DRObjects.ActorHandling.SpecialAttacks.SpecialAttack
return ActionFeedback[]