MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / GetCurrentSpeedMultiplier

Method GetCurrentSpeedMultiplier

src/Ext/Techno/Body.cpp:170–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170double TechnoExt::GetCurrentSpeedMultiplier(FootClass* pThis)
171{
172 double houseMultiplier = 1.0;
173 auto const whatAmI = pThis->WhatAmI();
174
175 if (whatAmI == AbstractType::Aircraft)
176 houseMultiplier = pThis->Owner->Type->SpeedAircraftMult;
177 else if (whatAmI == AbstractType::Infantry)
178 houseMultiplier = pThis->Owner->Type->SpeedInfantryMult;
179 else
180 houseMultiplier = pThis->Owner->Type->SpeedUnitsMult;
181
182 auto const pExt = TechnoExt::ExtMap.Find(pThis);
183
184 return pThis->SpeedMultiplier * houseMultiplier * pExt->AE.SpeedMultiplier *
185 (pThis->HasAbility(Ability::Faster) ? RulesClass::Instance->VeteranSpeed : 1.0);
186}
187
188double TechnoExt::GetCurrentFirepowerMultiplier(TechnoClass* pThis)
189{

Callers

nothing calls this directly

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected