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
proto native void RPCSingleParam(Object target, int rpc_type, Param param, bool guaranteed, PlayerIdentity recipient=null)
see CGame.RPC
override ScriptInvoker GetUpdateQueue(int call_category)
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
ref SoftSkillManagerDebug m_DebugWindow
void AddSpecialty(float specialty_weight)
void SynchSpecialtyLevel()
float GetSpecialtyLevel()
float AddSpecialtyBonus(float base_value, float specialty_weight, bool is_cacomponent=false, float limit_efficiency=2)
PlayerBase GetSoftSkillsPlayer()
float GetGeneralBonusBefore()
void SetCoolDown(bool cool_down)
void ~SoftSkillsManager()
void SetComponentBonusAfter(float component_bonus_after)
void SetLastUAValue(float last_ua_value)
float m_GeneralBonusBefore
const float COOLDOWN_TIMER
float m_ComponentBonusAfter
float m_ComponentBonusBefore
void SetGeneralBonusBefore(float general_bonus_before)
float GetComponentBonusBefore()
float SubtractSpecialtyBonus(float base_value, float specialty_weight, bool is_cacomponent=false, float limit_efficiency=2)
const float PRECISE_WEIGHT_LIMIT
void SetIsDebug(bool is_debug)
void SetLinearState(bool model)
float GetGeneralBonusAfter()
void SetCoolDownValue(float cooldown_value)
bool GetSoftSkillsState()
float AddLinearRough(float specialty_weight)
float AddExponentialPrecise(float specialty_weight)
void SetGeneralBonusAfter(float general_bonus_after)
ref Timer m_CoolDownTimer
float AddLinearPrecise(float specialty_weight)
void SetBonusAfter(bool is_cacomponent, float adjusted_value)
void SoftSkillsManager(PlayerBase player)
void SetSoftSkillsState(bool state)
void SetComponentBonusBefore(float component_bonus_before)
void GetPreciseRoughLevels()
float AddExponentialRough(float specialty_weight)
float GetComponentBonusAfter()
void SetBonusBefore(bool is_cacomponent, float base_value)
const float ROUGH_WEIGHT_LIMIT
void StartCoolDownTimer(float cooldown_value)
void InitSpecialty(float specialty_level)
void SetSpecialtyLevel(float specialty_level)
const int DEFAULT_EFFICIENCY
float AdjustCraftingTime(float base_time, float specialty_weight, float limit_efficiency=2)
float m_GeneralBonusAfter
void CreateDebugWindow(bool create)
proto string ToString(bool simple=true)
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 Sqrt(float val)
Returns square root.
static proto int AbsInt(int i)
Returns absolute value.
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.