Crossfire Server, Trunk
CREMainWindow.cpp File Reference
#include <Qt>
#include <QtWidgets>
#include <memory>
#include <CREMainWindow.h>
#include <CREResourcesWindow.h>
#include "CREMapInformationManager.h"
#include "CREExperienceWindow.h"
#include "MessageManager.h"
#include "CREReportDisplay.h"
#include "CREPixmap.h"
#include "CRESmoothFaceMaker.h"
#include "CREHPBarMaker.h"
#include "ResourcesManager.h"
#include "CRECombatSimulator.h"
#include "scripts/ScriptFileManager.h"
#include "FaceMakerDialog.h"
#include "EditMonstersDialog.h"
#include "random_maps/RandomMap.h"
#include "global.h"
#include "sproto.h"
#include "image.h"
#include "assets.h"
#include "AssetsManager.h"
#include "CRESettings.h"
#include "LicenseManager.h"
#include "AllAssets.h"
#include "assets/AssetModel.h"
#include "ChangesDock.h"
#include "HelpManager.h"
#include "MonsterResistances.h"
+ Include dependency graph for CREMainWindow.cpp:

Go to the source code of this file.

Functions

static QString alchemyTable (const QString &skill, QStringList &noChance, std::vector< std::pair< QString, int >> &allIngredients)
 
static QString buildShopReport (const QString &title, const QStringList &types, const QList< CREMapInformation * > &maps, QStringList &items)
 
static void doIngredients (const std::vector< std::pair< QString, int >> &allIngredients, const QString &criteria, QString &report)
 
static QString monsterFight (archetype *monster, archetype *skill)
 
static int monsterFight (archetype *monster, archetype *skill, int level)
 
static int monsterFight (archetype *monster, archetype *skill, int level, int count)
 
static QString monsterTable (archetype *monster, QList< archetype * > skills)
 
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

◆ alchemyTable()

static QString alchemyTable ( const QString &  skill,
QStringList &  noChance,
std::vector< std::pair< QString, int >> &  allIngredients 
)
static

◆ buildShopReport()

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

Definition at line 1344 of file CREMainWindow.cpp.

References say::item, is_valid_types_gen::line, disinfect::map, maps, report::report(), and types.

Referenced by CREMainWindow::onReportShops().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doIngredients()

static void doIngredients ( const std::vector< std::pair< QString, int >> &  allIngredients,
const QString &  criteria,
QString &  report 
)
static

Definition at line 733 of file CREMainWindow.cpp.

Referenced by CREMainWindow::onReportAlchemy().

+ Here is the caller graph for this function:

◆ monsterFight() [1/3]

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 1070 of file CREMainWindow.cpp.

References archetype::clone, disinfect::count, delete_map(), has_been_loaded(), mapstruct::in_memory, level, MAP_IN_MEMORY, say::max, Settings::max_level, monsterFight(), object::name, mapstruct::reset_time, and settings.

+ Here is the call graph for this function:

◆ monsterFight() [2/3]

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 938 of file CREMainWindow.cpp.

References attack_ob(), archetype::clone, object::contr, object::count, delete_map(), do_some_living(), FABS, dragon_attune::faces, socket_struct::faces_sent, find_archetype(), fix_object(), FLAG_APPLIED, FREE_OBJ_FREE_INVENTORY, get_empty_map(), get_faces_count(), living::hp, object::level, level, object::map, MAX_BUF, living::maxhp, monster_do_living(), move_player(), object_create_arch(), object_free(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_was_destroyed, altar_valkyrie::pl, rotate-tower::result, SET_FLAG, SK_TWO_HANDED_WEAPON, object::speed, object::speed_left, object::stats, object::subtype, archetype::tail_x, archetype::tail_y, test_map, object::weapon_speed, and object::weapon_speed_left.

Referenced by monsterFight(), and monsterTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monsterFight() [3/3]

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 1052 of file CREMainWindow.cpp.

References disinfect::count, and monsterFight().

+ Here is the call graph for this function:

◆ monsterTable()

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 1130 of file CREMainWindow.cpp.

References living::ac, archetype::clone, living::Con, living::dam, living::hp, object::level, is_valid_types_gen::line, monsterFight(), object::name, object::speed, object::stats, and living::wc.

+ Here is the call graph for this function:

◆ readDirectory()

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

Definition at line 1448 of file CREMainWindow.cpp.

References mad_mage_user::file, is_valid_types_gen::line, give::name, python_init::path, and quests.

Referenced by CREMainWindow::onReportQuests().

+ Here is the caller graph for this function:

◆ reportSummon()

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

◆ spellsTable()

static QString spellsTable ( const QString &  skill)
static

Definition at line 873 of file CREMainWindow.cpp.

References AssetsManager::archetypes(), archetype::clone, AssetsCollection< T, Key >::each(), getManager(), level, levels, report::report(), object::skill, SPELL, spell_arrow::spells, and object::type.

Referenced by CREMainWindow::onReportSpells().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: