122 if( specialty_weight < 0 )
137 else if( specialty_weight > 0 )
168 float AddSpecialtyBonus(
float base_value,
float specialty_weight,
bool is_cacomponent =
false,
float limit_efficiency = 2 )
170 if ( specialty_weight == 0 )
177 float adjusted_value;
181 if ( limit_efficiency != 0 )
183 if ( specialty_weight < 0 )
185 adjusted_value = base_value + ( ( base_value *
m_PreciseLevel ) / limit_efficiency );
189 adjusted_value = base_value + ( ( base_value *
m_RoughLevel ) / limit_efficiency );
194 if ( specialty_weight < 0 )
196 adjusted_value = base_value + ( ( base_value *
m_PreciseLevel ) );
200 adjusted_value = base_value + ( ( base_value *
m_RoughLevel ) );
206 return adjusted_value;
212 float SubtractSpecialtyBonus(
float base_value,
float specialty_weight,
bool is_cacomponent =
false,
float limit_efficiency = 2 )
214 if ( specialty_weight == 0 )
221 float adjusted_value;
225 if ( limit_efficiency != 0 )
227 if ( specialty_weight < 0 )
229 adjusted_value = base_value - ( ( base_value *
m_PreciseLevel ) / limit_efficiency );
233 adjusted_value = base_value - ( ( base_value *
m_RoughLevel ) / limit_efficiency );
238 if ( specialty_weight < 0 )
240 adjusted_value = base_value - ( ( base_value *
m_PreciseLevel ) );
244 adjusted_value = base_value - ( ( base_value *
m_RoughLevel ) );
250 return adjusted_value;
258 if ( specialty_weight == 0 )
269 if ( specialty_weight < 0 )
271 adjusted_time = base_time - ( ( base_time *
m_PreciseLevel ) / limit_efficiency );
275 adjusted_time = base_time - ( ( base_time *
m_RoughLevel ) / limit_efficiency );
280 return adjusted_time;
359 m_CoolDownTimer.Run( cooldown_value,
this,
"SetCoolDown",
new Param1<bool>(
false ) );
397 Param5<float, float, float, float, bool> debug_stats =
new Param5<float, float, float, float, bool>(
m_GeneralBonusBefore,
m_GeneralBonusAfter,
m_LastUAValue,
m_CoolDownValue,
m_IsCoolDown );
443 if ( is_cacomponent )
459 if ( is_cacomponent )
523 m_SynchTimer.Run( 2,
this,
"SynchDebugStats", NULL,
true );
617 speciality = speciality * 100;
619 speciality = speciality * 0.01;
void SoftSkillManagerDebug(SoftSkillsManager softskill_manager)
void ~SoftSkillManagerDebug()
TextWidget SpecialtyTotal
TextWidget SpecialtyChange
TextWidget GeneralBonusAfter
SoftSkillsManager GetActiveSoftSkillManager()
TextWidget ComponentBonusAfter
TextWidget GeneralBonusBefore
TextWidget ComponentBonusBefore
ref Widget m_PanelSoftSkills
class SoftSkillsManager m_SoftSkillManager
override ScriptInvoker GetUpdateQueue(int call_category)
void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
proto native WorkspaceWidget GetWorkspace()
Super root of all classes in Enforce script.
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
protected float m_PreciseLevel
static protected const float ROUGH_WEIGHT_LIMIT
void AddSpecialty(float specialty_weight)
protected bool m_IsActive
void StartCoolDownTimer(float cooldown_value)
static protected const float COOLDOWN_TIMER
float AddSpecialtyBonus(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)
void SoftSkillsManager(PlayerBase player)
void SynchSpecialtyLevel()
void SetCoolDown(bool cool_down)
PlayerBase GetSoftSkillsPlayer()
protected float m_LastUAValue
protected float m_ComponentBonusBefore
protected int m_UserActionsCounter
protected float m_ComponentBonusAfter
void SetGeneralBonusBefore(float general_bonus_before)
void SetGeneralBonusAfter(float general_bonus_after)
void ~SoftSkillsManager()
void SetBonusAfter(bool is_cacomponent, float adjusted_value)
void SetComponentBonusAfter(float component_bonus_after)
float SubtractSpecialtyBonus(float base_value, float specialty_weight, bool is_cacomponent=false, float limit_efficiency=2)
bool GetSoftSkillsState()
float AddLinearRough(float specialty_weight)
float GetGeneralBonusBefore()
protected float m_RoughLevel
float AddLinearPrecise(float specialty_weight)
protected bool m_IsLinear
float AddExponentialPrecise(float specialty_weight)
protected float m_GeneralBonusAfter
protected ref Timer m_SynchTimer
float AddExponentialRough(float specialty_weight)
static protected const float PRECISE_WEIGHT_LIMIT
protected PlayerBase m_Player
protected float m_GeneralBonusBefore
protected bool m_IsDebugMode
protected ref Timer m_CoolDownTimer
void SetCoolDownValue(float cooldown_value)
void SetSoftSkillsState(bool state)
void SetComponentBonusBefore(float component_bonus_before)
void SetIsDebug(bool is_debug)
void GetPreciseRoughLevels()
float GetGeneralBonusAfter()
float GetComponentBonusBefore()
void SetLastUAValue(float last_ua_value)
void CreateDebugWindow(bool create)
void InitSpecialty(float specialty_level)
protected float m_CoolDownValue
protected ref SoftSkillManagerDebug m_DebugWindow
static protected const int DEFAULT_EFFICIENCY
float GetComponentBonusAfter()
protected bool m_IsCoolDown
protected float m_SpecialtyLevel
float GetSpecialtyLevel()
void SetBonusBefore(bool is_cacomponent, float base_value)
void SetLinearState(bool model)
void SetSpecialtyLevel(float specialty_level)
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Round(float f)
Returns mathematical round of value.
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 float AbsFloat(float f)
Returns absolute value.
static proto int AbsInt(int i)
Returns absolute value.
static proto float Sqrt(float val)
Returns square root.