DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PileOfBricks.c
См. документацию.
1class PileOfBricks extends ItemBase
2{
4 {
5 if ( GetGame().IsServer() )
6 {
7 SetAllowDamage(false);
8 }
9 }
10
11 // Shows/Hides selections. Call this in init or after every quantity change.
13 {
14 RemoveProxyPhysics( "stage_1" );
15 RemoveProxyPhysics( "stage_2" );
16 RemoveProxyPhysics( "stage_3" );
17
18 // Show/Hide selections according to the current quantity
19 if ( this )
20 {
21 SetAnimationPhase("stages", 1 - GetQuantityNormalized() );
22
23 if ( GetQuantityNormalized() > 0.67 )
24 {
25 AddProxyPhysics( "stage_1" );
26 AddProxyPhysics( "stage_2" );
27 AddProxyPhysics( "stage_3" );
28 }
29 else if ( GetQuantityNormalized() > 0.34 && GetQuantityNormalized() <= 0.67 )
30 {
31 AddProxyPhysics( "stage_2" );
32 AddProxyPhysics( "stage_3" );
33 }
34 else
35 {
36 AddProxyPhysics( "stage_3" );
37 }
38 }
39 }
40
41 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
42 {
43 super.EEItemLocationChanged(oldLoc, newLoc);
45 }
46
47 // Removes a number of bricks
48 // Returns the number of bricks
49 int RemoveBricks( int needed_brickds )
50 {
51 int available_bricks = needed_brickds;
52 if ( available_bricks > GetQuantity() )
53 {
54 available_bricks = GetQuantity();
55 }
56
57 // Remove long planks from this object
58 AddQuantity( -available_bricks, true ); // Autodelete enabled
59
60 // Return the number of removed long planks
61 return available_bricks;
62 }
63
64 override bool SetQuantity(float value, bool destroy_config = true, bool destroy_forced = false, bool allow_client = false, bool clamp_to_stack_max = true)
65 {
66 bool result = super.SetQuantity(value, destroy_config, destroy_forced, allow_client, clamp_to_stack_max);
68
69 return result;
70 }
71
72 override bool CanPutIntoHands( EntityAI parent )
73 {
74 return false;
75 }
76
77 override bool CanPutInCargo (EntityAI parent)
78 {
79 return false;
80 }
81}
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
Определения ItemBase.c:3416
override float GetQuantity()
Определения ItemBase.c:3486
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
Определения ItemBase.c:3389
InventoryLocation.
Определения InventoryLocation.c:30
override bool CanPutIntoHands(EntityAI parent)
Определения PileOfBricks.c:72
void PileOfBricks()
Определения PileOfBricks.c:3
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Определения PileOfBricks.c:41
int RemoveBricks(int needed_brickds)
Определения PileOfBricks.c:49
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfBricks.c:64
void UpdateSelections()
Определения PileOfBricks.c:12
override bool CanPutInCargo(EntityAI parent)
Определения PileOfBricks.c:77
DayZGame GetGame()
Определения gameplay.c:636