/***************************************************************************
 *   Copyright (C) 2004 by ian reinhart geiser                             *
 *   ian@geiseri.com                                                       *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef MONSTER_H
#define MONSTER_H

#include <qmap.h>
#include <qstring.h>
#include <util.h>
#include <unit.h>
#include "reference.h"
#include <QMetaType>
#include <QPixmap>

class Armor;
class Wepon;
class Player;


/**
This is the base class for all monsters.

@author ian reinhart geiser
*/
class Monster : public Unit{
public:
    Monster(const QString &name, int maxGold);

    virtual ~Monster();

    virtual int gold() const { return m_gold; }
    virtual int morale() const;
    virtual int skill( const QString &skl ) const { return m_skill; }
    virtual int dexterity() const { return m_dexterity; }
    virtual int strength() const { return m_strength; }
    virtual QPixmap sprite() const { return m_sprite; }
	virtual Attack attackType() const;

    virtual int toHit(Attack at , Armor *ac ) const;
    virtual bool melee( Unit * unit, Attack atk ) const;
    virtual bool save( const QString &vs ) const;

	static Monster *monsterFactory( const QString &monsterName );

protected:
	QString m_name;
	int m_thaco;
	int m_skill;
	int m_strength;
	int m_dexterity;
	int m_xpValue;
	int m_gold;
	int m_attacks;
	int m_morale;
	bool m_isUndead;
	QPixmap m_sprite;
	Attack m_attackType;
	QMap<QString, int> m_saves;
};

#endif

