Need help?
Create a topic in the appropriate section
Don't write everything in the chat!Take a look at the marketplace
There you can buy
everything related to game serversDon't want a ban?
Please read our rules
Don't disturb the order!Sell or buy?
Use services of the guarantor
We will make your deal safe
- 0
-
Our picks
Такой вопрос.
Есть вот такие константы
const float ENVIRO_ABSORBENCY_HEALTHFACTOR_PRISTINE = 1.0; const float ENVIRO_ABSORBENCY_HEALTHFACTOR_WORN = 0.75; const float ENVIRO_ABSORBENCY_HEALTHFACTOR_DAMAGED = 0.55; const float ENVIRO_ABSORBENCY_HEALTHFACTOR_B_DAMAGED = 0.25; const float ENVIRO_ABSORBENCY_HEALTHFACTOR_RUINED = 0.0;
static float GetCurrentItemAbsorbency( ItemBase pItem ) { float healthFactor; float absorb = pItem.ConfigGetFloat("varWetMax"); float itemHealthLabel = pItem.GetHealthLevel(); switch (itemHealthLabel) { case GameConstants.STATE_PRISTINE: healthFactor = GameConstants.ENVIRO_ABSORBENCY_HEALTHFACTOR_PRISTINE; break; case GameConstants.STATE_WORN: healthFactor = GameConstants.ENVIRO_ABSORBENCY_HEALTHFACTOR_WORN; break; case GameConstants.STATE_DAMAGED: healthFactor = GameConstants.ENVIRO_ABSORBENCY_HEALTHFACTOR_DAMAGED; break; case GameConstants.STATE_BADLY_DAMAGED: healthFactor = GameConstants.ENVIRO_ABSORBENCY_HEALTHFACTOR_B_DAMAGED; break; case GameConstants.STATE_RUINED: healthFactor = 0.01; break; } if (absorb != 0) absorb /= healthFactor; return absorb; }
И есть функция получения значений грубо говоря промокаемости вещей. Проблема в том, что показатели обновляються только при изменении состояния вещи, может кто подскажет как сделать что бы показатели менялись и в диапазоне от Prestin к Worn например.
Share this post
Link to post
Share on other sites