// Get export name by ordinal DWORD CDD_Export::GetNameByOrdinal(DWORD dwOrdinal, LPSTR pName) const { DWORD dwIndex; dwIndex = GetIndexByOrdinal(dwOrdinal); return(GetNameByIndex(dwIndex, pName)); }
void C4PhysicalInfo::PromotionUpdate(int32_t iRank, bool fUpdateTrainablePhysicals, C4Def *pTrainDef) { #ifdef C4ENGINE if (iRank>=0) { CanDig=1; CanChop=1; CanConstruct=1; } if (iRank>=0) { CanScale=1; } if (iRank>=0) { CanHangle=1; } Energy= Max<int32_t>( Energy, (50+5*BoundBy<int32_t>(iRank,0,10)) *C4MaxPhysical/100 ); if (fUpdateTrainablePhysicals && pTrainDef) { // do standard training: Expect everything to be trained fully at rank 20 int32_t iTrainRank = BoundBy<int32_t>(iRank, 0,20); Scale = pTrainDef->Physical.Scale + (C4MaxPhysical - pTrainDef->Physical.Scale) * iTrainRank / 20; Hangle = pTrainDef->Physical.Hangle + (C4MaxPhysical - pTrainDef->Physical.Hangle) * iTrainRank / 20; Swim = pTrainDef->Physical.Swim + (C4MaxPhysical - pTrainDef->Physical.Swim) * iTrainRank / 20; Fight = pTrainDef->Physical.Fight + (C4MaxPhysical - pTrainDef->Physical.Fight) * iTrainRank / 20; // do script updates for any physicals as required (this will train stuff like magic) const char *szPhysName; C4PhysicalInfo::Offset PhysOff; for (int32_t iPhysIdx=0; szPhysName = GetNameByIndex(iPhysIdx, &PhysOff); ++iPhysIdx) { C4Value PhysVal(this->*PhysOff, C4V_Int); C4AulParSet Pars(C4VString(szPhysName), C4VInt(iRank), C4VRef(&PhysVal)); if (!!pTrainDef->Script.Call(PSF_GetFairCrewPhysical, &Pars)) { this->*PhysOff = PhysVal.getInt(); } } } #endif }