[ogs-changes] dist/c++/ogs/creatures/undeads Makefile.am,NONE,1.1 Namespace.h,NONE,1.1 Wraith.cpp,NO
Status: Alpha
Brought to you by:
elemings
|
From: <ele...@us...> - 2003-04-15 16:58:45
|
Update of /cvsroot/ogs/dist/c++/ogs/creatures/undeads
In directory sc8-pr-cvs1:/tmp/cvs-serv20206/c++/ogs/creatures/undeads
Added Files:
Makefile.am Namespace.h Wraith.cpp Wraith.h
Log Message:
See C++ ChangeLog (Apr 15) for details.
--- NEW FILE: Makefile.am ---
##
## Makefile.am -- Automake file for Open Gaming System (OGS)
## Copyright (C) 2003 Eric Lemings <ele...@us...>
##
## This software 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 software 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 software; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA
##
## RCS: $Id: Makefile.am,v 1.1 2003/04/15 16:58:40 elemings Exp $
##
pkgincludedir = $(includedir)/ogs/creatures/undeads
pkginclude_HEADERS = \
Namespace.h \
Wraith.h
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/intl
noinst_LTLIBRARIES = libogs-undeads.la
localedir = $(datadir)/locale
libogs_undeads_la_DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
libogs_undeads_la_SOURCES = \
Wraith.cpp
--- NEW FILE: Namespace.h ---
/*
* Namespace.h -- namespace for undead creatures
* Copyright (C) 2002 Eric Lemings <ele...@us...>
*
* This software 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 software 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 software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA
*
* RCS: $Id: Namespace.h,v 1.1 2003/04/15 16:58:40 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CREATURES_UNDEADS_NAMESPACE_H
# define OGS_CREATURES_UNDEADS_NAMESPACE_H
# include <ogs/creatures/Namespace.h>
/**
* @namespace ogs::creatures::undeads
*
* A collection of restless undead creatures.
*/
# define OGS_BEGIN_CREATURES_UNDEADS_NAMESPACE \
OGS_BEGIN_CREATURES_NAMESPACE \
namespace undeads {
# define OGS_END_CREATURES_UNDEADS_NAMESPACE \
} \
OGS_END_CREATURES_NAMESPACE
# endif /* !defined OGS_CREATURES_UNDEADS_NAMESPACE_H */
#endif /* defined __cplusplus */
--- NEW FILE: Wraith.cpp ---
/*
* Wraith.cpp -- class implementation for wraiths
* Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software 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 software 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 software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA
*
* RCS: $Id: Wraith.cpp,v 1.1 2003/04/15 16:58:40 elemings Exp $
*/
#include "ogs/core/Abilities.h"
#include "ogs/core/Die.h"
#include "ogs/core/Modifier.h"
#include "ogs/core/Skill.h"
#include "ogs/core/details/Alignment.h"
#include "ogs/Skills.h"
#include "ogs/feats/Alertness.h"
#include "ogs/feats/ImprovedInitiative.h"
//#include "ogs/combat/feats/BlindFighting.h"
//#include "ogs/combat/feats/CombatReflexes.h"
#include "ogs/creatures/Undead.h"
#include "ogs/creatures/undeads/Wraith.h"
using ogs::core::Abilities;
using ogs::core::Die;
using ogs::core::Modifier;
using ogs::core::Skill;
using ogs::creatures::undeads::Wraith;
using ogs::skills::SkillFactory;
/**
* Create a hit dice object for this type of creature. The die object
* is created within the range of hit dice for this type of creature.
*
* @param hitDieCount Number of hit die to create.
* @return A hit dice object.
*/
Die Wraith::createHitDice (Die::Count hitDieCount) {
if (hitDieCount < DEFAULT_HIT_DIE_COUNT) {
hitDieCount = DEFAULT_HIT_DIE_COUNT;
} else if (hitDieCount > MAXIMUM_HIT_DIE_COUNT) {
hitDieCount = MAXIMUM_HIT_DIE_COUNT;
}
using ogs::creatures::Undead;
return (Die (Undead::HIT_DIE, hitDieCount));
}
/**
* Create a set of abilities for this type of creature.
*
* @return A set of abilities for this type of creature.
*/
Abilities Wraith::createAbilities () {
using ogs::core::Ability;
Abilities::PartialMethod::Value dex (Ability::DEX, 16);
Abilities::PartialMethod::Value intl (Ability::INT, 14);
Abilities::PartialMethod::Value wis (Ability::WIS, 14);
Abilities::PartialMethod::Value cha (Ability::CHA, 15);
Abilities::PartialMethod::Value values [] = { dex, intl, wis, cha };
Abilities::PartialMethod partialMethod (& values [0], & values [4]);
return (Abilities (partialMethod));
}
/**
* Create a new wraith. Wraiths normally use 5d12 for hit dice although
* exceptional specimens can have up to 10d12 hit dice. If the given
* hit dice is outside this range, this constructor will round off to
* the nearest value.
*
* @param hitDieCount Number of hit dice of the wraith.
*/
Wraith::Wraith (Die::Count hitDieCount):
Undead (createHitDice (hitDieCount), createAbilities ()) {
using ogs::skills::CommonSkills;
CommonSkills commonSkills;
addSkill (*(commonSkills.createSkill (CommonSkills::HIDE, +8)));
addSkill (*(commonSkills.createSkill (CommonSkills::INTIMIDATE, +8)));
//addSkill (*(commonSkills.createSkill (CommonSkills::INTUIT_DIRECTION, +6 (total))));
addSkill (*(commonSkills.createSkill (CommonSkills::LISTEN, +8)));
addSkill (*(commonSkills.createSkill (CommonSkills::SEARCH, +8)));
addSkill (*(commonSkills.createSkill (CommonSkills::SENSE_MOTIVE, +6)));
addSkill (*(commonSkills.createSkill (CommonSkills::SPOT, +8)));
using ogs::feats::Alertness;
using ogs::feats::ImprovedInitiative;
//using ogs::combat::feats::BlindFighting;
//using ogs::combat::feats::CombatReflexes;
addFeat (*(new Alertness ()));
addFeat (*(new ImprovedInitiative ()));
//addFeat (new BlindFighting ());
//addFeat (new CombatReflexes ());
using ogs::core::details::Alignment;
addFeature (*(new Alignment (Alignment::LAWFUL_EVIL)));
}
--- NEW FILE: Wraith.h ---
/*
* Wraith.h -- class interface for wraiths
* Copyright (C) 2003 Eric Lemings <ele...@us...>
*
* This software 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 software 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 software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA
*
* RCS: $Id: Wraith.h,v 1.1 2003/04/15 16:58:40 elemings Exp $
*/
#ifdef __cplusplus
# ifndef OGS_CREATURES_UNDEADS_WRAITH_H
# define OGS_CREATURES_UNDEADS_WRAITH_H
# include <map>
# include <boost/shared_ptr.hpp>
# include <ogs/core/Abilities.h>
# include <ogs/core/Die.h>
# include <ogs/core/Skill.h>
# include <ogs/skills/SkillFactory.h>
# include <ogs/creatures/Undead.h>
# include <ogs/creatures/undeads/Namespace.h>
OGS_BEGIN_CREATURES_UNDEADS_NAMESPACE
using ogs::core::Die;
/**
* An incorporeal undead creature composed of darkness and evil. A
* wraith appears vaguely humanoid in shape with two glowing red eyes.
* Some may carry some semblance of their former life but this has no
* effect on their abilities. Their touch is deadly as it permanently
* drains Constitution from living creatures and those unfortunate souls
* slain by a wraith will themselves rise as undead in a matter of
* seconds. Natural daylight (not from magic) however renders them
* totally powerless and they will flee in fear from it. Wraiths also
* radiate an unnatural aura such that all animals (wild or domestic)
* within 30 ft. can automatically sense their presence.
*/
class Wraith: public ogs::creatures::Undead {
public:
Wraith (Die::Count hitDieCount = DEFAULT_HIT_DIE_COUNT);
protected:
static const Die::Count DEFAULT_HIT_DIE_COUNT = 5;
static const Die::Count MAXIMUM_HIT_DIE_COUNT = 10;
static Die createHitDice (Die::Count hitDieCount);
static ogs::core::Abilities createAbilities ();
};
OGS_END_CREATURES_UNDEADS_NAMESPACE
# endif /* !defined OGS_CREATURES_UNDEADS_WRAITH_H */
#endif /* defined __cplusplus */
|