Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс SoftSkillsManager

Защищенные члены

void SoftSkillsManager (PlayerBase player)
 
void InitSpecialty (float specialty_level)
 
void ~SoftSkillsManager ()
 
float AddLinearPrecise (float specialty_weight)
 
float AddLinearRough (float specialty_weight)
 
float AddExponentialPrecise (float specialty_weight)
 
float AddExponentialRough (float specialty_weight)
 
void AddSpecialty (float specialty_weight)
 
float AddSpecialtyBonus (float base_value, float specialty_weight, bool is_cacomponent=false, float limit_efficiency=2)
 
float SubtractSpecialtyBonus (float base_value, float specialty_weight, bool is_cacomponent=false, float limit_efficiency=2)
 
float AdjustCraftingTime (float base_time, float specialty_weight, float limit_efficiency=2)
 
PlayerBase GetSoftSkillsPlayer ()
 
void SetSpecialtyLevel (float specialty_level)
 
float GetSpecialtyLevel ()
 
void SynchSpecialtyLevel ()
 
void SetSoftSkillsState (bool state)
 
bool GetSoftSkillsState ()
 
void SetLinearState (bool model)
 
bool IsLinear ()
 
void GetPreciseRoughLevels ()
 
void StartCoolDownTimer (float cooldown_value)
 
bool IsCoolDown ()
 
void SetCoolDown (bool cool_down)
 
void CreateDebugWindow (bool create)
 
void SynchDebugStats ()
 
void SetIsDebug (bool is_debug)
 
bool IsDebug ()
 
void SetCoolDownValue (float cooldown_value)
 
float GetCoolDownValue ()
 
float GetLastUAValue ()
 
void SetLastUAValue (float last_ua_value)
 
void SetBonusBefore (bool is_cacomponent, float base_value)
 
void SetBonusAfter (bool is_cacomponent, float adjusted_value)
 
float GetComponentBonusBefore ()
 
void SetComponentBonusBefore (float component_bonus_before)
 
float GetComponentBonusAfter ()
 
void SetComponentBonusAfter (float component_bonus_after)
 
float GetGeneralBonusBefore ()
 
void SetGeneralBonusBefore (float general_bonus_before)
 
float GetGeneralBonusAfter ()
 
void SetGeneralBonusAfter (float general_bonus_after)
 
void StartSynchTimer ()
 
void StopSynchTimer ()
 
void ResetDebugWindow ()
 

Защищенные данные

PlayerBase m_Player
 
float m_SpecialtyLevel
 
float m_RoughLevel
 
float m_PreciseLevel
 
bool m_IsLinear
 
bool m_IsActive
 
bool m_IsCoolDown
 
int m_UserActionsCounter
 
ref Timer m_CoolDownTimer = new Timer()
 
bool m_IsDebugMode
 
float m_CoolDownValue
 
float m_LastUAValue
 
float m_ComponentBonusBefore
 
float m_ComponentBonusAfter
 
float m_GeneralBonusBefore
 
float m_GeneralBonusAfter
 
ref SoftSkillManagerDebug m_DebugWindow
 
ref Timer m_SynchTimer
 

Статические защищенные данные

const int DEFAULT_EFFICIENCY = 0
 
const float PRECISE_WEIGHT_LIMIT = -1
 
const float ROUGH_WEIGHT_LIMIT = 1
 
const float COOLDOWN_TIMER = 5
 

Подробное описание

Конструктор(ы)

◆ SoftSkillsManager()

void SoftSkillsManager ( PlayerBase player)
inlineprotected
34 {
36 m_IsCoolDown = false;
37 m_IsLinear = false;
38 m_IsActive = true;
39 m_IsDebugMode = false;
40 }
Definition EntityAI.c:95
PlayerBase m_Player
Definition SoftSkillsManager.c:3
bool m_IsDebugMode
Definition SoftSkillsManager.c:21
bool m_IsActive
Definition SoftSkillsManager.c:9
bool m_IsLinear
Definition SoftSkillsManager.c:8
bool m_IsCoolDown
Definition SoftSkillsManager.c:10

Перекрестные ссылки m_IsActive, m_IsCoolDown, m_IsDebugMode, m_IsLinear и m_Player.

◆ ~SoftSkillsManager()

void ~SoftSkillsManager ( )
inlineprotected
49 {
50 delete m_CoolDownTimer;
51 }
ref Timer m_CoolDownTimer
Definition SoftSkillsManager.c:19

Перекрестные ссылки m_CoolDownTimer.

Методы

◆ AddExponentialPrecise()

float AddExponentialPrecise ( float specialty_weight)
inlineprotected
75 {
77
78 if( m_UserActionsCounter == 0)
79 {
82 }
83
85
87
90
91 return m_SpecialtyLevel;
92 }
Definition EnMath.c:7
const float PRECISE_WEIGHT_LIMIT
Definition SoftSkillsManager.c:15
const float ROUGH_WEIGHT_LIMIT
Definition SoftSkillsManager.c:16
float m_SpecialtyLevel
Definition SoftSkillsManager.c:4
int m_UserActionsCounter
Definition SoftSkillsManager.c:12
void SetLastUAValue(float last_ua_value)
Definition SoftSkillsManager.c:433
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto int AbsInt(int i)
Returns absolute value.
static proto float Sqrt(float val)
Returns square root.

Перекрестные ссылки Math::AbsInt(), Math::Clamp(), m_SpecialtyLevel, m_UserActionsCounter, PRECISE_WEIGHT_LIMIT, ROUGH_WEIGHT_LIMIT, SetLastUAValue() и Math::Sqrt().

Используется в AddSpecialty().

◆ AddExponentialRough()

float AddExponentialRough ( float specialty_weight)
inlineprotected

◆ AddLinearPrecise()

float AddLinearPrecise ( float specialty_weight)
inlineprotected

◆ AddLinearRough()

float AddLinearRough ( float specialty_weight)
inlineprotected

◆ AddSpecialty()

void AddSpecialty ( float specialty_weight)
inlineprotected
117 {
118 if( GetSoftSkillsState() )
119 {
120 if( !IsCoolDown() )
121 {
122 if( specialty_weight < 0 )
123 {
124 if( IsLinear() )
125 {
127 }
128 else
129 {
131 }
132
133 m_Player.GetStatSpecialty().Set( m_SpecialtyLevel );
136 }
137 else if( specialty_weight > 0 )
138 {
139 if( IsLinear() )
140 {
142 }
143 else
144 {
146 }
147
148 m_Player.GetStatSpecialty().Set( m_SpecialtyLevel );
151 }
152 else
153 {
154 //if the specialty weight for a recipe or UA is set to 0, it will increase neither specialty, nor UA counter
155 return;
156 }
157 }
158 else
159 {
161 }
162 }
163 }
bool IsLinear()
Definition SoftSkillsManager.c:329
void StartCoolDownTimer(float cooldown_value)
Definition SoftSkillsManager.c:355
bool IsCoolDown()
Definition SoftSkillsManager.c:363
void SynchSpecialtyLevel()
Definition SoftSkillsManager.c:302
bool GetSoftSkillsState()
Definition SoftSkillsManager.c:317
float AddLinearRough(float specialty_weight)
Definition SoftSkillsManager.c:64
float AddLinearPrecise(float specialty_weight)
Definition SoftSkillsManager.c:54
float AddExponentialPrecise(float specialty_weight)
Definition SoftSkillsManager.c:74
float AddExponentialRough(float specialty_weight)
Definition SoftSkillsManager.c:95
const float COOLDOWN_TIMER
Definition SoftSkillsManager.c:17
void SetSpecialtyLevel(float specialty_level)
Definition SoftSkillsManager.c:290
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), AddExponentialPrecise(), AddExponentialRough(), AddLinearPrecise(), AddLinearRough(), COOLDOWN_TIMER, GetSoftSkillsState(), IsCoolDown(), IsLinear(), m_Player, m_SpecialtyLevel, SetSpecialtyLevel(), StartCoolDownTimer() и SynchSpecialtyLevel().

◆ AddSpecialtyBonus()

float AddSpecialtyBonus ( float base_value,
float specialty_weight,
bool is_cacomponent = false,
float limit_efficiency = 2 )
inlineprotected
169 {
170 if ( specialty_weight == 0 )
171 {
172 return base_value;
173 }
174
176
177 float adjusted_value;
178
180
181 if ( limit_efficiency != 0 )
182 {
183 if ( specialty_weight < 0 )
184 {
186 }
187 else
188 {
190 }
191 }
192 else
193 {
194 if ( specialty_weight < 0 )
195 {
197 }
198 else
199 {
201 }
202 }
203
205
206 return adjusted_value;
207 }
float m_RoughLevel
Definition SoftSkillsManager.c:5
void SetBonusAfter(bool is_cacomponent, float adjusted_value)
Definition SoftSkillsManager.c:455
float m_PreciseLevel
Definition SoftSkillsManager.c:6
void GetPreciseRoughLevels()
Definition SoftSkillsManager.c:335
void SetBonusBefore(bool is_cacomponent, float base_value)
Definition SoftSkillsManager.c:439

Перекрестные ссылки GetPreciseRoughLevels(), m_PreciseLevel, m_RoughLevel, SetBonusAfter() и SetBonusBefore().

◆ AdjustCraftingTime()

float AdjustCraftingTime ( float base_time,
float specialty_weight,
float limit_efficiency = 2 )
inlineprotected
257 {
258 if ( specialty_weight == 0 )
259 {
260 return base_time;
261 }
262
263 SetBonusBefore( false, base_time);
264
265 float adjusted_time;
266
268
269 if ( specialty_weight < 0 )
270 {
272 }
273 else
274 {
276 }
277
279
280 return adjusted_time;
281 }

Перекрестные ссылки GetPreciseRoughLevels(), m_PreciseLevel, m_RoughLevel, SetBonusAfter() и SetBonusBefore().

◆ CreateDebugWindow()

void CreateDebugWindow ( bool create)
inlineprotected
378 {
379 if ( create )
380 {
383 }
384 else
385 {
388 delete m_DebugWindow;
389 }
390 }
void SoftSkillManagerDebug(SoftSkillsManager softskill_manager)
Definition SoftSkillsManager.c:570
void ResetDebugWindow()
Definition SoftSkillsManager.c:539
ref SoftSkillManagerDebug m_DebugWindow
Definition SoftSkillsManager.c:29
void SetIsDebug(bool is_debug)
Definition SoftSkillsManager.c:403

Перекрестные ссылки m_DebugWindow, ResetDebugWindow(), SetIsDebug() и SoftSkillManagerDebug().

◆ GetComponentBonusAfter()

float GetComponentBonusAfter ( )
inlineprotected
484 {
486 }
float m_ComponentBonusAfter
Definition SoftSkillsManager.c:25

Перекрестные ссылки m_ComponentBonusAfter.

◆ GetComponentBonusBefore()

float GetComponentBonusBefore ( )
inlineprotected
472 {
474 }
float m_ComponentBonusBefore
Definition SoftSkillsManager.c:24

Перекрестные ссылки m_ComponentBonusBefore.

◆ GetCoolDownValue()

float GetCoolDownValue ( )
inlineprotected
422 {
423 return m_CoolDownValue;
424 }
float m_CoolDownValue
Definition SoftSkillsManager.c:22

Перекрестные ссылки m_CoolDownValue.

◆ GetGeneralBonusAfter()

float GetGeneralBonusAfter ( )
inlineprotected
508 {
509 return m_GeneralBonusAfter;
510 }
float m_GeneralBonusAfter
Definition SoftSkillsManager.c:27

Перекрестные ссылки m_GeneralBonusAfter.

◆ GetGeneralBonusBefore()

float GetGeneralBonusBefore ( )
inlineprotected
496 {
498 }
float m_GeneralBonusBefore
Definition SoftSkillsManager.c:26

Перекрестные ссылки m_GeneralBonusBefore.

◆ GetLastUAValue()

float GetLastUAValue ( )
inlineprotected
428 {
429 return m_LastUAValue;
430 }
float m_LastUAValue
Definition SoftSkillsManager.c:23

Перекрестные ссылки m_LastUAValue.

◆ GetPreciseRoughLevels()

void GetPreciseRoughLevels ( )
inlineprotected
336 {
337 if ( m_SpecialtyLevel > 0)
338 {
341 }
342 else if ( m_SpecialtyLevel < 0)
343 {
346 }
347 else
348 {
351 }
352 }
const int DEFAULT_EFFICIENCY
Definition SoftSkillsManager.c:14

Перекрестные ссылки Math::AbsFloat(), DEFAULT_EFFICIENCY, m_PreciseLevel, m_RoughLevel и m_SpecialtyLevel.

Используется в AddSpecialtyBonus(), AdjustCraftingTime() и SubtractSpecialtyBonus().

◆ GetSoftSkillsPlayer()

PlayerBase GetSoftSkillsPlayer ( )
inlineprotected
285 {
286 return m_Player;
287 }

Перекрестные ссылки m_Player.

◆ GetSoftSkillsState()

bool GetSoftSkillsState ( )
inlineprotected
318 {
319 return m_IsActive;
320 }

Перекрестные ссылки m_IsActive.

Используется в AddSpecialty().

◆ GetSpecialtyLevel()

float GetSpecialtyLevel ( )
inlineprotected
297 {
298 return m_SpecialtyLevel;
299 }

Перекрестные ссылки m_SpecialtyLevel.

Используется в OnUpdate().

◆ InitSpecialty()

void InitSpecialty ( float specialty_level)
inlineprotected

Перекрестные ссылки SetSpecialtyLevel() и SynchSpecialtyLevel().

◆ IsCoolDown()

bool IsCoolDown ( )
inlineprotected
364 {
365 return m_IsCoolDown;
366 }

Перекрестные ссылки m_IsCoolDown.

Используется в AddSpecialty().

◆ IsDebug()

bool IsDebug ( )
inlineprotected
410 {
411 return m_IsDebugMode;
412 }

Перекрестные ссылки m_IsDebugMode.

Используется в SetBonusAfter() и SetBonusBefore().

◆ IsLinear()

bool IsLinear ( )
inlineprotected
330 {
331 return m_IsLinear;
332 }

Перекрестные ссылки m_IsLinear.

Используется в AddSpecialty().

◆ ResetDebugWindow()

void ResetDebugWindow ( )
inlineprotected
540 {
542 SetLastUAValue( 0 );
547 SetCoolDownValue( 0 );
548
550 }
void SetGeneralBonusBefore(float general_bonus_before)
Definition SoftSkillsManager.c:501
void SetGeneralBonusAfter(float general_bonus_after)
Definition SoftSkillsManager.c:513
void SetComponentBonusAfter(float component_bonus_after)
Definition SoftSkillsManager.c:489
void SetCoolDownValue(float cooldown_value)
Definition SoftSkillsManager.c:415
void SetComponentBonusBefore(float component_bonus_before)
Definition SoftSkillsManager.c:477

Перекрестные ссылки SetComponentBonusAfter(), SetComponentBonusBefore(), SetCoolDownValue(), SetGeneralBonusAfter(), SetGeneralBonusBefore(), SetLastUAValue(), SetSpecialtyLevel() и SynchSpecialtyLevel().

Используется в CreateDebugWindow().

◆ SetBonusAfter()

void SetBonusAfter ( bool is_cacomponent,
float adjusted_value )
inlineprotected
456 {
457 if ( IsDebug() )
458 {
459 if ( is_cacomponent )
460 {
462 }
463 else
464 {
466 }
467 }
468 }
bool IsDebug()
Definition SoftSkillsManager.c:409

Перекрестные ссылки IsDebug(), SetComponentBonusAfter() и SetGeneralBonusAfter().

Используется в AddSpecialtyBonus(), AdjustCraftingTime() и SubtractSpecialtyBonus().

◆ SetBonusBefore()

void SetBonusBefore ( bool is_cacomponent,
float base_value )
inlineprotected
440 {
441 if ( IsDebug() )
442 {
443 if ( is_cacomponent )
444 {
446 }
447 else
448 {
450 }
451 }
452 }

Перекрестные ссылки IsDebug(), SetComponentBonusBefore() и SetGeneralBonusBefore().

Используется в AddSpecialtyBonus(), AdjustCraftingTime() и SubtractSpecialtyBonus().

◆ SetComponentBonusAfter()

void SetComponentBonusAfter ( float component_bonus_after)
inlineprotected

Перекрестные ссылки m_ComponentBonusAfter.

Используется в ResetDebugWindow() и SetBonusAfter().

◆ SetComponentBonusBefore()

void SetComponentBonusBefore ( float component_bonus_before)
inlineprotected

Перекрестные ссылки m_ComponentBonusBefore.

Используется в ResetDebugWindow() и SetBonusBefore().

◆ SetCoolDown()

void SetCoolDown ( bool cool_down)
inlineprotected
370 {
372 }

Перекрестные ссылки m_IsCoolDown.

Используется в StartCoolDownTimer().

◆ SetCoolDownValue()

void SetCoolDownValue ( float cooldown_value)
inlineprotected
416 {
418 }

Перекрестные ссылки m_CoolDownValue.

Используется в ResetDebugWindow() и StartCoolDownTimer().

◆ SetGeneralBonusAfter()

void SetGeneralBonusAfter ( float general_bonus_after)
inlineprotected

Перекрестные ссылки m_GeneralBonusAfter.

Используется в ResetDebugWindow() и SetBonusAfter().

◆ SetGeneralBonusBefore()

void SetGeneralBonusBefore ( float general_bonus_before)
inlineprotected

Перекрестные ссылки m_GeneralBonusBefore.

Используется в ResetDebugWindow() и SetBonusBefore().

◆ SetIsDebug()

void SetIsDebug ( bool is_debug)
inlineprotected
404 {
406 }

Перекрестные ссылки m_IsDebugMode.

Используется в CreateDebugWindow(), StartSynchTimer() и StopSynchTimer().

◆ SetLastUAValue()

void SetLastUAValue ( float last_ua_value)
inlineprotected
434 {
436 }

Перекрестные ссылки m_LastUAValue.

Используется в AddExponentialPrecise(), AddExponentialRough(), AddLinearPrecise(), AddLinearRough() и ResetDebugWindow().

◆ SetLinearState()

void SetLinearState ( bool model)
inlineprotected
324 {
326 }

Перекрестные ссылки m_IsLinear.

◆ SetSoftSkillsState()

void SetSoftSkillsState ( bool state)
inlineprotected
312 {
314 }

Перекрестные ссылки m_IsActive.

◆ SetSpecialtyLevel()

void SetSpecialtyLevel ( float specialty_level)
inlineprotected
291 {
293 }

Перекрестные ссылки m_SpecialtyLevel.

Используется в AddSpecialty(), InitSpecialty() и ResetDebugWindow().

◆ StartCoolDownTimer()

void StartCoolDownTimer ( float cooldown_value)
inlineprotected
356 {
357 SetCoolDown( true );
359 m_CoolDownTimer.Run( cooldown_value, this, "SetCoolDown", new Param1<bool>( false ) );
360 }
void SetCoolDown(bool cool_down)
Definition SoftSkillsManager.c:369

Перекрестные ссылки m_CoolDownTimer, SetCoolDown() и SetCoolDownValue().

Используется в AddSpecialty().

◆ StartSynchTimer()

void StartSynchTimer ( )
inlineprotected
520 {
521 SetIsDebug( true );
522 m_SynchTimer = new Timer;
523 m_SynchTimer.Run( 2, this, "SynchDebugStats", NULL, true );
524 }
ref Timer m_SynchTimer
Definition SoftSkillsManager.c:31
Definition DayZPlayerImplement.c:63

Перекрестные ссылки m_SynchTimer и SetIsDebug().

◆ StopSynchTimer()

void StopSynchTimer ( )
inlineprotected
528 {
529 SetIsDebug( false );
530
531 if ( m_SynchTimer )
532 {
533 m_SynchTimer.Stop();
534 delete m_SynchTimer;
535 }
536 }

Перекрестные ссылки m_SynchTimer и SetIsDebug().

◆ SubtractSpecialtyBonus()

float SubtractSpecialtyBonus ( float base_value,
float specialty_weight,
bool is_cacomponent = false,
float limit_efficiency = 2 )
inlineprotected
213 {
214 if ( specialty_weight == 0 )
215 {
216 return base_value;
217 }
218
220
221 float adjusted_value;
222
224
225 if ( limit_efficiency != 0 )
226 {
227 if ( specialty_weight < 0 )
228 {
230 }
231 else
232 {
234 }
235 }
236 else
237 {
238 if ( specialty_weight < 0 )
239 {
241 }
242 else
243 {
245 }
246 }
247
249
250 return adjusted_value;
251 }

Перекрестные ссылки GetPreciseRoughLevels(), m_PreciseLevel, m_RoughLevel, SetBonusAfter() и SetBonusBefore().

◆ SynchDebugStats()

void SynchDebugStats ( )
inlineprotected
394 {
395 if ( GetGame().IsServer() && GetGame().IsMultiplayer() )
396 {
398 GetGame().RPCSingleParam( m_Player, ERPCs.RPC_SOFT_SKILLS_STATS_SYNC, debug_stats, true, m_Player.GetIdentity() );
399 }
400 }
ERPCs
Definition ERPCs.c:2
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_CoolDownValue, m_GeneralBonusAfter, m_GeneralBonusBefore, m_IsCoolDown, m_LastUAValue и m_Player.

◆ SynchSpecialtyLevel()

void SynchSpecialtyLevel ( )
inlineprotected
303 {
304 #ifdef SERVER
306 GetGame().RPCSingleParam( m_Player, ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC, specialty_level, true, m_Player.GetIdentity() );
307 #endif
308 }

Перекрестные ссылки GetGame(), m_Player и m_SpecialtyLevel.

Используется в AddSpecialty(), InitSpecialty() и ResetDebugWindow().

Поля

◆ COOLDOWN_TIMER

const float COOLDOWN_TIMER = 5
staticprotected

Используется в AddSpecialty().

◆ DEFAULT_EFFICIENCY

const int DEFAULT_EFFICIENCY = 0
staticprotected

Используется в GetPreciseRoughLevels().

◆ m_ComponentBonusAfter

float m_ComponentBonusAfter
protected

Используется в GetComponentBonusAfter() и SetComponentBonusAfter().

◆ m_ComponentBonusBefore

float m_ComponentBonusBefore
protected

Используется в GetComponentBonusBefore() и SetComponentBonusBefore().

◆ m_CoolDownTimer

ref Timer m_CoolDownTimer = new Timer()
protected

Используется в StartCoolDownTimer() и ~SoftSkillsManager().

◆ m_CoolDownValue

float m_CoolDownValue
protected

Используется в GetCoolDownValue(), SetCoolDownValue() и SynchDebugStats().

◆ m_DebugWindow

ref SoftSkillManagerDebug m_DebugWindow
protected

Используется в CreateDebugWindow().

◆ m_GeneralBonusAfter

float m_GeneralBonusAfter
protected

◆ m_GeneralBonusBefore

float m_GeneralBonusBefore
protected

◆ m_IsActive

bool m_IsActive
protected

◆ m_IsCoolDown

bool m_IsCoolDown
protected

◆ m_IsDebugMode

bool m_IsDebugMode
protected

Используется в IsDebug(), SetIsDebug() и SoftSkillsManager().

◆ m_IsLinear

bool m_IsLinear
protected

Используется в IsLinear(), SetLinearState() и SoftSkillsManager().

◆ m_LastUAValue

float m_LastUAValue
protected

Используется в GetLastUAValue(), SetLastUAValue() и SynchDebugStats().

◆ m_Player

◆ m_PreciseLevel

float m_PreciseLevel
protected

◆ m_RoughLevel

float m_RoughLevel
protected

◆ m_SpecialtyLevel

◆ m_SynchTimer

ref Timer m_SynchTimer
protected

Используется в StartSynchTimer() и StopSynchTimer().

◆ m_UserActionsCounter

int m_UserActionsCounter
protected

Используется в AddExponentialPrecise() и AddExponentialRough().

◆ PRECISE_WEIGHT_LIMIT

const float PRECISE_WEIGHT_LIMIT = -1
staticprotected

◆ ROUGH_WEIGHT_LIMIT

const float ROUGH_WEIGHT_LIMIT = 1
staticprotected

Объявления и описания членов класса находятся в файле: