| 52 | CActorCondition::~CActorCondition(void) { xr_delete(monsters_feel_touch); } |
| 53 | |
| 54 | void CActorCondition::LoadCondition(LPCSTR entity_section) |
| 55 | { |
| 56 | inherited::LoadCondition(entity_section); |
| 57 | |
| 58 | LPCSTR section = READ_IF_EXISTS(pSettings, r_string, entity_section, "condition_sect", entity_section); |
| 59 | |
| 60 | m_fJumpPower = pSettings->r_float(section, "jump_power"); |
| 61 | m_fStandPower = pSettings->r_float(section, "stand_power"); |
| 62 | m_fWalkPower = pSettings->r_float(section, "walk_power"); |
| 63 | m_fJumpWeightPower = pSettings->r_float(section, "jump_weight_power"); |
| 64 | m_fWalkWeightPower = pSettings->r_float(section, "walk_weight_power"); |
| 65 | m_fOverweightWalkK = pSettings->r_float(section, "overweight_walk_k"); |
| 66 | m_fOverweightJumpK = pSettings->r_float(section, "overweight_jump_k"); |
| 67 | m_fAccelK = pSettings->r_float(section, "accel_k"); |
| 68 | m_fSprintK = pSettings->r_float(section, "sprint_k"); |
| 69 | |
| 70 | m_bJumpRequirePower = READ_IF_EXISTS(pSettings, r_bool, section, "jump_require_power", false); |
| 71 | |
| 72 | //порог силы и здоровья меньше которого актер начинает хромать |
| 73 | m_fLimpingHealthBegin = pSettings->r_float(section, "limping_health_begin"); |
| 74 | m_fLimpingHealthEnd = pSettings->r_float(section, "limping_health_end"); |
| 75 | R_ASSERT(m_fLimpingHealthBegin <= m_fLimpingHealthEnd); |
| 76 | |
| 77 | m_fLimpingPowerBegin = pSettings->r_float(section, "limping_power_begin"); |
| 78 | m_fLimpingPowerEnd = pSettings->r_float(section, "limping_power_end"); |
| 79 | R_ASSERT(m_fLimpingPowerBegin <= m_fLimpingPowerEnd); |
| 80 | |
| 81 | m_fCantWalkPowerBegin = pSettings->r_float(section, "cant_walk_power_begin"); |
| 82 | m_fCantWalkPowerEnd = pSettings->r_float(section, "cant_walk_power_end"); |
| 83 | R_ASSERT(m_fCantWalkPowerBegin <= m_fCantWalkPowerEnd); |
| 84 | |
| 85 | m_fCantSprintPowerBegin = pSettings->r_float(section, "cant_sprint_power_begin"); |
| 86 | m_fCantSprintPowerEnd = pSettings->r_float(section, "cant_sprint_power_end"); |
| 87 | R_ASSERT(m_fCantSprintPowerBegin <= m_fCantSprintPowerEnd); |
| 88 | |
| 89 | m_fPowerLeakSpeed = pSettings->r_float(section, "max_power_leak_speed"); |
| 90 | |
| 91 | m_fV_Alcohol = pSettings->r_float(section, "alcohol_v"); |
| 92 | m_fV_Power = READ_IF_EXISTS(pSettings, r_float, section, "power_v", 0.0f); |
| 93 | |
| 94 | m_fV_Satiety = pSettings->r_float(section, "satiety_v"); |
| 95 | m_fV_SatietyPower = pSettings->r_float(section, "satiety_power_v"); |
| 96 | m_fV_SatietyHealth = pSettings->r_float(section, "satiety_health_v"); |
| 97 | |
| 98 | m_fSatietyLightLimit = READ_IF_EXISTS(pSettings, r_float, section, "satiety_light_limit", 0.0f); |
| 99 | clamp(m_fSatietyLightLimit, 0.0f, 1.0f); |
| 100 | |
| 101 | m_fSatietyCriticalLimit = READ_IF_EXISTS(pSettings, r_float, section, "satiety_critical_limit", 0.0f); |
| 102 | clamp(m_fSatietyCriticalLimit, 0.0f, 1.0f); |
| 103 | |
| 104 | if (m_fSatietyCriticalLimit > m_fSatietyLightLimit) |
| 105 | { |
| 106 | m_fSatietyCriticalLimit = m_fSatietyLightLimit; |
| 107 | } |
| 108 | |
| 109 | if (Core.Features.test(xrCore::Feature::actor_thirst)) |
| 110 | { |
| 111 | m_fThirstLightLimit = READ_IF_EXISTS(pSettings, r_float, section, "thirst_light_limit", 0.0f); |