/*
....[@@@..[@@@..............[@.................. MUD++ is a written from
....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and
....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++.
....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing
....[@......[@..[@@@@@..[@@@@@.................. development project. All
................................................ contributions are welcome.
....Copyright(C).1995.Melvin.Smith.............. Enjoy.
------------------------------------------------------------------------------
Melvin Smith (aka Fusion) msmith@hom.net
MUD++ development mailing list mudpp@van.ml.org
------------------------------------------------------------------------------
combat.h
*/
#ifndef _COMBAT_H
#define _COMBAT_H
#include "config.h"
#include "bit.h"
#include "vmobject.h"
const char * getDamRangeName( int, bool );
const char * getDamTypeName( int );
extern const bitType dam_types[];
const int DAM_RANGES = 7;
const int NONE = 0;
const int PUNCH = 1;
const int KICK = 2;
const int CRUSH = 3;
const int PIERCE = 4;
const int SLASH = 5;
const int WHIP = 6;
const int CLAW = 7;
const int FUMBLE = 0;
const int MISSED = 1;
const int DODGED = 2;
const int HIT = 3;
const int CRIT_HIT = 4;
const int ALREADY_APPLIED = 5; // for trigger signalisation
class Attack: public VMObject
{
private:
int type;
int min_dam;
int max_dam;
public:
Attack()
: type(PUNCH),
min_dam(1), max_dam(6)
{
}
Attack( int t, int min, int max )
: type(t),
min_dam(min), max_dam(max)
{
}
virtual vmtype getVMType() { return VMT_ATTACK; }
int getType() { return type; }
//int getHit() { return hit_mod; }
//int getDam() { return dam_mod; }
int getMin() { return min_dam; }
int getMax() { return max_dam; }
};
inline const char * getDamTypeName( int val )
{
return lookupBitName( dam_types, val );
}
inline int getDamType( const char * name )
{
return lookupBit( dam_types, name );
}
#endif