39 RegisterNetSyncVariableBool(
"m_IsLocked" );
40 RegisterNetSyncVariableInt(
"m_Combination", 0, combination_length - 1 );
41 RegisterNetSyncVariableInt(
"m_DialIndex", 0,
m_LockDigits - 1 );
42 RegisterNetSyncVariableInt(
"m_LockActionPerformed", 0,
LockAction.COUNT );
77 super.OnItemLocationChanged( old_owner, new_owner );
92 super.OnStoreSave( ctx );
101 if ( !super.OnStoreLoad( ctx, version ) )
122 bool is_lock_attached;
123 if ( !ctx.
Read( is_lock_attached ) )
134 super.AfterStoreLoad();
139 EntityAI parent = GetHierarchyParent();
170 super.OnVariablesSynchronized();
209 for (
int i = 0; i < length_diff; ++i )
211 combination_text =
"0" + combination_text;
215 for (
int j = 0; j < combination_text.
Length(); ++j )
219 int next_dialed_number = combination_text.
Get( j ).
ToInt() + 1;
220 if ( next_dialed_number > 9 )
222 next_dialed_number = 0;
225 dialed_text += next_dialed_number.ToString();
229 dialed_text += combination_text.
Get( j );
277 if ( !ignore_combination )
283 GetInventory().GetCurrentInventoryLocation( inventory_location );
284 parent.GetInventory().SetSlotLock( inventory_location.
GetSlot(),
true );
304 Fence fence = Fence.Cast( parent );
308 GetInventory().GetCurrentInventoryLocation( inventory_location );
309 fence.GetInventory().SetSlotLock( inventory_location.
GetSlot(),
false );
317 parent.GetInventory().DropEntity(
InventoryMode.SERVER, parent,
this);
324 parent.GetInventory().DropEntity(
InventoryMode.LOCAL, parent,
this);
345 string shuffled_text;
349 for (
int i = 0; i < length_diff; ++i )
351 combination_text =
"0" + combination_text;
355 for (
int j = 0; j < combination_text.
Length(); ++j )
357 int dial_number = combination_text.
Get( j ).
ToInt();
359 shuffled_text = shuffled_text + dial_number.ToString();
377 Fence fence = Fence.Cast( GetHierarchyParent() );
391 Fence fence = Fence.Cast( GetHierarchyParent() );
452 SetAnimationPhase(
"Combination_Lock_Item", 0 );
453 SetAnimationPhase(
"Lock_Item_1", 0 );
454 SetAnimationPhase(
"Lock_Item_2", 0 );
459 SetAnimationPhase(
"Combination_Lock_Item", 1 );
460 SetAnimationPhase(
"Lock_Item_1", 1 );
461 SetAnimationPhase(
"Lock_Item_2", 1 );
466 SetAnimationPhase(
"Combination_Lock_Attached", 0 );
467 SetAnimationPhase(
"Lock_Attached_1", 0 );
468 SetAnimationPhase(
"Lock_Attached_2", 0 );
473 SetAnimationPhase(
"Combination_Lock_Attached", 1 );
474 SetAnimationPhase(
"Lock_Attached_1", 1 );
475 SetAnimationPhase(
"Lock_Attached_2", 1 );
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ActionDialCombinationLockCB ActionContinuousBaseCB ActionDialCombinationLock()
ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget()
void AddAction(typename actionName)
override void OnVariablesSynchronized()
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
override bool IsInitialized()
const string SOUND_LOCK_CHANGE_NUMBER
const string SOUND_LOCK_CHANGE_DIAL
void LockServer(EntityAI parent, bool ignore_combination=false)
void SoundLockChangeNumber()
const string SOUND_LOCK_OPEN
enum LockAction m_LockDigits
void CheckLockedStateServer()
void SetCombination(int combination)
void SetCombinationLocked(int combination)
void SoundLockChangeDial()
const string SOUND_LOCK_CLOSE
void UnlockServer(EntityAI player, EntityAI parent)
LockAction m_LockActionPerformed
override void SetTakeable(bool pState)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
void OnStoreSave(ParamsWriteContext ctx)
bool OnStoreLoad(ParamsReadContext ctx, int version)
override ScriptCallQueue GetCallQueue(int call_category)
proto native void ObjectDelete(Object obj)
override void SetBaseLockValues()
Wrapper class for managing sound through SEffectManager.
override bool ServerDropEntity(notnull EntityAI item)
override bool LocalDropEntity(notnull EntityAI item)
proto native int GetSlot()
returns slot id if current type is Attachment
static bool IsBaseBuildingLogEnable()
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
Serializer ParamsReadContext
proto native CGame GetGame()
Serializer ParamsWriteContext
proto native void SetPosition(vector position)
Set the world position of the Effect.
static proto float Pow(float v, float power)
Return power of v ^ power.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
proto native int ToInt()
Converts string to integer.