Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SWRS::Trait Class Reference

generic class for character binary trait - requirements, modifiers etcetera More...

#include <trait.hpp>

Inheritance diagram for SWRS::Trait:
Inheritance graph
Collaboration diagram for SWRS::Trait:
Collaboration graph

Public Member Functions

const std::string & GetBaseName () const
 Generic name of trait.
 
void LockLevel ()
 make it impossible to decrease trait below current level
 
void UnlockLevel ()
 cancel effect of LockLevel;
 
const std::string & GetRequiredEdge () const
 if an edge is required to posess a trait
 
const std::string & GetCustomName () const
 return customized name (if exists);
 
const std::string & GetFlavorText () const
 Get fluff description.
 
 Trait (const Trait &cSource)
 Copy constructor.
 
void SetLevelModifier (int i)
 
const std::string & GetName () const
 
virtual bool Increase ()
 
virtual bool Decrease ()
 
int GetMainDie () const
 if trait is at d6 level, 6 is returned; for d12+2, 12 is returned
 
bool SetHeroic (bool heroic)
 set if heroic die is used
 
int Roll (int modifier) const
 
std::string GetSW () const
 Returns SW description of trait level.
 
std::string GetSWVerbose () const
 returns detailet version of GetSW()
 
int PrintSW () const
 print GetSW() to stdout
 
virtual int GetPointValue () const
 in point build system;
 
int PrintVerbal () const
 Print verbal representation of a trait (i.e. "novice (1)" or "skilled (3)")
 
std::string GetVerbal () const
 Get verbal representation of a trait (i.e. "novice (1)" or "skilled (3)")
 
int PrintVerbatim () const
 data dump, all modifiers etc to stdout
 
int GetHalfNumericValue () const
 0-2-3-4-5-6 ; i.e. for purpose of parry/toughness calculation
 
bool IsUntrained () const
 if it is an untrained characteristic, return true
 

Protected Member Functions

 Trait (const TraitRecord *tr)
 
int GetObjectiveLevel () const
 0 - untrained; 1-d4, 2-d6, 3-d8, 4-d10, 5-d12
 
void SetCustomName (std::string s)
 set custom name (see above)
 
virtual int GetMaxObjectiveLevel () const
 For limitations in point build system.
 
virtual int GetMinObjectiveLevel () const
 For limitations in point build system.
 

Protected Attributes

int constant_modifier
 from race/edges/whatever
 
int heroic_die
 roll additional d6 to chose higher result?
 
int main_die
 proper trait value
 
bool untrained
 untrained? If so, -2 to both main and heroic die
 
int level_modifier
 For point build system; affects how real level is calculated.
 
int min_level
 cannot be decreased below
 
std::string custom_name
 alternative names of traits
 
const TraitRecordtrait_record
 data record pointer
 

Friends

class Skill
 
class TraitMap
 

Detailed Description

generic class for character binary trait - requirements, modifiers etcetera

Constructor & Destructor Documentation

Trait::Trait ( const TraitRecord tr)
protected

constructor is protected for object of this class can only be factory generated, and never constructed of nothing

Member Function Documentation

bool Trait::Decrease ( )
virtual

decrease by one level; true is returned if it was impossible; false is returned upon success

const std::string& SWRS::Trait::GetName ( ) const
inlinevirtual

get trait name; if custom name is set, it is returned; otherwise default name is returned

Implements SWRS::IOption.

bool Trait::Increase ( )
virtual

increase by one level; true is returned if it was impossible; false is returned upon success

int Trait::Roll ( int  modifier) const

if roll is marginally successful - result is 0; if roll is failed - result is negative (amount of pips missing to success) if roll is successful over requirement - result is positive (as above).

void Trait::SetLevelModifier ( int  i)

Set level modifier for particular trait (i.e. it may always count as one die higher)


The documentation for this class was generated from the following files: