/******************************************************************************
 Copyright (c) 2000-2001 Richard Woolcock

 Permission is hereby granted, free of charge, to any person obtaining a copy 
 of this software and associated documentation files (the "Software"), to deal 
 in the Software without restriction, including without limitation the rights 
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 copies of the Software, and to permit persons to whom the Software is 
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in all 
 copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
 SOFTWARE.
 ******************************************************************************/

/******************************************************************************
 File Name        : combat.h
 ******************************************************************************
 Description      : The combat system.
 ******************************************************************************/

#ifndef COMBAT_HEADER
#define COMBAT_HEADER

/******************************************************************************
 Required macros.
 ******************************************************************************/

#define CMBT(f)      void Cmbt##f(body_t* pstBody, ap_t eLocation)

/******************************************************************************
 Required types.
 ******************************************************************************/

typedef struct
{
   char  *szRequirements; /* The move requirements                      */
   void (*pfnFunction)(body_t* pstBody, ap_t eLocation); 
                          /* A pointer to the attack function           */
   int    iSpeed;         /* Speed delay                                */
   int    iAttack;        /* Attack bonus                               */
   int    iDefence;       /* Defense bonus                              */
   int    iDamage;        /* Damage bonus                               */
   char  *szBlockTxt;     /* The text you see when an attack is blocked */
} cmbt_table_t;

/******************************************************************************
 Externally available commands.
 ******************************************************************************/

extern const cmbt_table_t *kstCmbtTable[];

/******************************************************************************
 Global operation prototypes.
 ******************************************************************************/

void Combat     ( body_t *pstBody, ap_t eLocation, char chMove, table_t eTable );
void (*CombatCmd( body_t *pstBody, char *szCmd, ap_t eLocation ))(body_t*, ap_t);
void PushMove   ( char *szTxt, char chMove );
bool IsBlocked  ( body_t *pstBody, char *szAttack, int iAttack );
int  GetEnhancedDamage( body_t *pstBody );

CMBT(Null);

#endif /* COMBAT_HEADER */