Crossfire Server, Trunk  R20513
Functions
CREMainWindow.cpp File Reference
#include <Qt>
#include <QtGui>
#include <CREMainWindow.h>
#include <CREResourcesWindow.h>
#include "CREMapInformationManager.h"
#include "CREExperienceWindow.h"
#include "QuestManager.h"
#include "MessageManager.h"
#include "CREReportDisplay.h"
#include "CREPixmap.h"
#include "CRESmoothFaceMaker.h"
#include "CREHPBarMaker.h"
#include "ResourcesManager.h"
#include "CRECombatSimulator.h"
#include "Quest.h"
#include "ScriptFileManager.h"
#include "global.h"
#include "sproto.h"
#include "image.h"
Include dependency graph for CREMainWindow.cpp:

Go to the source code of this file.

Functions

static QString alchemyTable (const QString &skill)
 
static QString buildShopReport (const QString &title, const QStringList &types, const QList< CREMapInformation * > &maps, QStringList &items)
 
static int monsterFight (archetype *monster, archetype *skill, int level)
 Simulates a fight between a player and a monster. More...
 
static int monsterFight (archetype *monster, archetype *skill, int level, int count)
 Simulates a fight between a player and a monster. More...
 
static QString monsterFight (archetype *monster, archetype *skill)
 Generate a report cell for player versus monster fight. More...
 
static QString monsterTable (archetype *monster, QList< archetype * > skills)
 Generate an HTML table line for a player versus monster fight statistics. More...
 
void readDirectory (const QString &path, QHash< QString, QHash< QString, bool > > &states)
 
static QString reportSummon (const archetype *summon, const object *other, QString name)
 
static QString spellsTable (const QString &skill)
 

Function Documentation

static QString alchemyTable ( const QString &  skill)
static
static QString buildShopReport ( const QString &  title,
const QStringList &  types,
const QList< CREMapInformation * > &  maps,
QStringList &  items 
)
static

Definition at line 1099 of file CREMainWindow.cpp.

References CREMapInformation::name, CREMapInformation::path, CREMapInformation::shopGreed(), CREMapInformation::shopItems(), CREMapInformation::shopMax(), CREMapInformation::shopMin(), and CREMapInformation::shopRace().

Referenced by CREMainWindow::onReportShops().

Here is the call graph for this function:

Here is the caller graph for this function:

static int monsterFight ( archetype monster,
archetype skill,
int  level 
)
static

Simulates a fight between a player and a monster.

Player is a dwarf, with low statistics, no equipment. A maximum of 50 rounds are fighted (can be changed by modifying 'limit').

Parameters
monsterevil guy being fighted.
skillwhat the player attacks the monster with.
levelwhat skill level to use.
Returns
1 if the player could kill the monster, 0 else.

Definition at line 703 of file CREMainWindow.cpp.

References attack_ob(), pl::bed_x, pl::bed_y, archt::clone, obj::contr, obj::count, delete_map(), do_some_living(), FABS, socket_struct::faces_sent, find_archetype(), fix_object(), FLAG_APPLIED, FREE_OBJ_FREE_INVENTORY, get_empty_map(), liv::hp, obj::level, obj::map, MAX_BUF, liv::maxhp, monster_do_living(), move_player(), nrofpixmaps, pl::ob, object_create_arch(), object_free2(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_was_destroyed, pl::savebed_map, SET_FLAG, SK_TWO_HANDED_WEAPON, pl::socket, obj::speed, obj::speed_left, obj::stats, obj::subtype, archt::tail_x, archt::tail_y, test_map, obj::weapon_speed, and obj::weapon_speed_left.

Referenced by monsterFight(), and monsterTable().

Here is the call graph for this function:

Here is the caller graph for this function:

static int monsterFight ( archetype monster,
archetype skill,
int  level,
int  count 
)
static

Simulates a fight between a player and a monster.

Player is a dwarf, with low statistics, no equipment. A maximum of 50 rounds are fighted per round.

Parameters
monsterevil guy being fighted.
skillwhat the player attacks the monster with.
levelwhat skill level to use.
counthow many fights to simulate.
Returns
how many fights, on count, the player could kill the monster.

Definition at line 806 of file CREMainWindow.cpp.

References monsterFight().

Here is the call graph for this function:

static QString monsterFight ( archetype monster,
archetype skill 
)
static

Generate a report cell for player versus monster fight.

Cell will contain the first level the player could defeat the monster. This level is determined via a kind of dichotomic search, trying levels and using the middle ground for next iteration.

Parameters
monstermonster being fighted.
skillwhat the player uses to fight the monster.
Returns
full HTML table line for the statistics.

Definition at line 824 of file CREMainWindow.cpp.

References archt::clone, delete_map(), has_been_loaded(), mapdef::in_memory, MAP_IN_MEMORY, Settings::max_level, monsterFight(), obj::name, mapdef::reset_time, and settings.

Here is the call graph for this function:

static QString monsterTable ( archetype monster,
QList< archetype * >  skills 
)
static

Generate an HTML table line for a player versus monster fight statistics.

Parameters
monsterwhat is being attacked.
skillslist of skills to fight with.
Returns
HTML line for the monster and skills.

Definition at line 884 of file CREMainWindow.cpp.

References liv::ac, archt::clone, liv::Con, liv::dam, liv::hp, obj::level, monsterFight(), obj::name, obj::speed, obj::stats, and liv::wc.

Referenced by CREMainWindow::onReportPlayer().

Here is the call graph for this function:

Here is the caller graph for this function:

void readDirectory ( const QString &  path,
QHash< QString, QHash< QString, bool > > &  states 
)

Definition at line 1203 of file CREMainWindow.cpp.

References quests.

Referenced by CREMainWindow::onReportQuests().

Here is the caller graph for this function:

static QString reportSummon ( const archetype summon,
const object other,
QString  name 
)
static

Definition at line 982 of file CREMainWindow.cpp.

References liv::ac, archt::clone, liv::dam, obj::dam_modifier, obj::duration, obj::duration_modifier, FABS, liv::hp, obj::level, MIN, object_get_value(), obj::range_modifier, obj::speed, obj::stats, and liv::wc.

Referenced by CREMainWindow::onReportSummon().

Here is the call graph for this function:

Here is the caller graph for this function:

static QString spellsTable ( const QString &  skill)
static

Definition at line 635 of file CREMainWindow.cpp.

References archt::clone, first_archetype, obj::level, levels, obj::name, archt::next, obj::skill, SPELL, and obj::type.

Referenced by CREMainWindow::onReportSpells().

Here is the caller graph for this function: