DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
XmasLights.c
См. документацию.
1class XmasLights extends Inventory_Base
2{
3 private ItemBase m_AttachedTo = NULL;
4
5 void XmasLights()
6 {
7 TurnOffItem( this );
8 }
9
10 override bool IsElectricAppliance()
11 {
12 return true;
13 }
14
15 override void OnWorkStart()
16 {
18 TurnOnItem( this );
19 }
20
21 override void OnWorkStop()
22 {
24 TurnOffItem( this );
25 }
26
28 {
29 //SetPilotLight( false );
30
31 m_AttachedTo = parent;
32 TurnOnItem( parent );
33
34 if ( GetCompEM().IsPlugged() )
35 {
36 parent.SetAnimationPhase( "Cord_plugged", 0);
37 parent.SetAnimationPhase( "Cord_folded", 1);
38 }
39 else
40 {
41 parent.SetAnimationPhase( "Cord_plugged", 1);
42 parent.SetAnimationPhase( "Cord_folded", 0);
43 }
44 }
45
47 {
48 m_AttachedTo = NULL;
49 HideOnItem( parent );
50 TurnOnItem( this );
51
52 GetCompEM().UnplugThis();
53 }
54
56 {
57 if ( item != NULL )
58 {
59 if ( GetCompEM().IsWorking() )
60 {
61 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_r"), "dz\\gear\\camping\\data\\christmas_lights_red_on.rvmat" );
62 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_g"), "dz\\gear\\camping\\data\\christmas_lights_green_on.rvmat" );
63 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_b"), "dz\\gear\\camping\\data\\christmas_lights_blue_on.rvmat" );
64 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_y"), "dz\\gear\\camping\\data\\christmas_lights_yellow_on.rvmat" );
65 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_r"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
66 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_g"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
67 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_b"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
68 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_y"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
69 //item.SetPilotLight(true);
70 }
71 else
72 {
73 TurnOffItem( item );
74 }
75 }
76 }
77
79 {
80 if ( item != NULL )
81 {
82 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_r"), "dz\\gear\\camping\\data\\christmass_ligths_string.rvmat" );
83 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_g"), "dz\\gear\\camping\\data\\christmass_ligths_string.rvmat" );
84 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_b"), "dz\\gear\\camping\\data\\christmass_ligths_string.rvmat" );
85 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_y"), "dz\\gear\\camping\\data\\christmass_ligths_string.rvmat" );
86 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_r"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
87 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_g"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
88 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_b"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
89 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_y"), "dz\\gear\\camping\\data\\christmas_lights_string_ca.paa" );
90 //item.SetPilotLight(false);
91 }
92 }
93
95 {
96 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_r"), "" );
97 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_g"), "" );
98 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_b"), "" );
99 item.SetObjectMaterial( item.GetHiddenSelectionIndex("xlights_glass_y"), "" );
100 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_r"), "" );
101 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_g"), "" );
102 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_b"), "" );
103 item.SetObjectTexture( item.GetHiddenSelectionIndex("xlights_glass_y"), "" );
104// item.SetPilotLight(false);
105 item.SetAnimationPhase( "Cord_plugged", 1);
106 item.SetAnimationPhase( "Cord_folded", 1);
107 }
108
109 // --------------------------------------------------
110 // Advanced placement
111 //---------------------------------------------------
112
113 override void SetActions()
114 {
115 super.SetActions();
116
120 }
121
122}
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
Определения ActionPlugIn.c:2
override bool IsElectricAppliance()
Определения XmasLights.c:10
void TurnOffItem(ItemBase item)
Определения XmasLights.c:78
override void OnWorkStart()
Определения XmasLights.c:15
override void OnWorkStop()
Определения XmasLights.c:21
void HideOnItem(ItemBase item)
Определения XmasLights.c:94
void AttachToObject(ItemBase parent)
Определения XmasLights.c:27
void TurnOnItem(ItemBase item)
Определения XmasLights.c:55
override void SetActions()
Определения XmasLights.c:113
ItemBase m_AttachedTo
Определения XmasLights.c:3
void DetachFromObject(ItemBase parent)
Определения XmasLights.c:46
void XmasLights()
Определения XmasLights.c:5
Определения InventoryItem.c:731