1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Renamed LibClasses * VLC to GameLibrary * LIBRARY

This commit is contained in:
Ivan Savenko
2025-02-14 16:23:37 +00:00
parent 156de5b17e
commit 645b95ba02
287 changed files with 2032 additions and 2032 deletions

View File

@@ -16,7 +16,7 @@
#include "CGObjectInstance.h"
#include "CObjectHandler.h"
#include "../VCMI_Lib.h"
#include "../GameLibrary.h"
VCMI_LIB_NAMESPACE_BEGIN
@@ -33,8 +33,8 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode)
{
double effectiveness = std::min((getMarketEfficiency() + 1.0) / 20.0, 0.5);
double r = VLC->objh->resVals[id1]; //value of given resource
double g = VLC->objh->resVals[id2] / effectiveness; //value of wanted resource
double r = LIBRARY->objh->resVals[id1]; //value of given resource
double g = LIBRARY->objh->resVals[id2] / effectiveness; //value of wanted resource
if(r>g) //if given resource is more expensive than wanted
{
@@ -53,8 +53,8 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode)
const double effectivenessArray[] = {0.0, 0.3, 0.45, 0.50, 0.65, 0.7, 0.85, 0.9, 1.0};
double effectiveness = effectivenessArray[std::min(getMarketEfficiency(), 8)];
double r = VLC->creatures()->getByIndex(id1)->getRecruitCost(EGameResID::GOLD); //value of given creature in gold
double g = VLC->objh->resVals[id2] / effectiveness; //value of wanted resource
double r = LIBRARY->creatures()->getByIndex(id1)->getRecruitCost(EGameResID::GOLD); //value of given creature in gold
double g = LIBRARY->objh->resVals[id2] / effectiveness; //value of wanted resource
if(r>g) //if given resource is more expensive than wanted
{
@@ -75,8 +75,8 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode)
case EMarketMode::RESOURCE_ARTIFACT:
{
double effectiveness = std::min((getMarketEfficiency() + 3.0) / 20.0, 0.6);
double r = VLC->objh->resVals[id1]; //value of offered resource
double g = VLC->artifacts()->getByIndex(id2)->getPrice() / effectiveness; //value of bought artifact in gold
double r = LIBRARY->objh->resVals[id1]; //value of offered resource
double g = LIBRARY->artifacts()->getByIndex(id2)->getPrice() / effectiveness; //value of bought artifact in gold
if(id1 != 6) //non-gold prices are doubled
r /= 2;
@@ -88,8 +88,8 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode)
case EMarketMode::ARTIFACT_RESOURCE:
{
double effectiveness = std::min((getMarketEfficiency() + 3.0) / 20.0, 0.6);
double r = VLC->artifacts()->getByIndex(id1)->getPrice() * effectiveness;
double g = VLC->objh->resVals[id2];
double r = LIBRARY->artifacts()->getByIndex(id1)->getPrice() * effectiveness;
double g = LIBRARY->objh->resVals[id2];
// if(id2 != 6) //non-gold prices are doubled
// r /= 2;
@@ -101,7 +101,7 @@ bool IMarket::getOffer(int id1, int id2, int &val1, int &val2, EMarketMode mode)
case EMarketMode::CREATURE_EXP:
{
val1 = 1;
val2 = (CreatureID(id1).toEntity(VLC)->getAIValue() / 40) * 5;
val2 = (CreatureID(id1).toEntity(LIBRARY)->getAIValue() / 40) * 5;
}
break;
case EMarketMode::ARTIFACT_EXP: