DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Vehicles/InheritedMotorbikes/Motorbike_01.c
См. документацию.
2{
4 {
5 m_VehicleContactDamageCoef = 0.03;
6 m_CrewContactDamageCoef = 0.018;
7
9 m_EngineStartOK = "Motorbike_01_engine_start_SoundSet";
12 m_EngineStartFuel = "Motorbike_01_engine_failed_start_fuel_SoundSet";
13 m_EngineStop = "Motorbike_01_engine_stop_SoundSet";
14 m_EngineStopFuel = "Motorbike_01_engine_stop_fuel_SoundSet";
15
16 m_LightsComponent.RegisterLight("Front", new VehicleLightData(new Motorbike_01LightProfileFront()));
17 m_LightsComponent.RegisterLight("Rear", new VehicleLightData(new Motorbike_01LightProfileRear()));
18
19 m_LightsComponent.RegisterSelection("BrakeOn", {new VehicleLightSelectionData(2, "brakeReflectorMatOn")});
20 m_LightsComponent.RegisterSelection("BrakeOff", {new VehicleLightSelectionData(2, "brakeReflectorMatOff")});
21
22 m_HornComponent.RegisterSound(VehicleHornMode.SHORT, "Motorbike_01_Horn_Short_SoundSet");
23 m_HornComponent.RegisterSound(VehicleHornMode.LONG, "Motorbike_01_Horn_SoundSet");
24
25 SetEnginePos("0 0.3 -0.06");
26 }
27
29 {
30 return true;
31 }
32
34 {
35 return false;
36 }
37
39 {
40 return 2.5;
41 }
42
44 {
45 return "0 1.3 -0.25";
46 }
47
48 override int GetAnimInstance()
49 {
50 return VehicleAnimInstances.MOTO1;
51 }
52
54 {
55 return true;
56 }
57
58 override int GetSeatAnimationTypeDirectional(int posIdx, int directionIndex)
59 {
60 if (posIdx == 0)
61 {
62 if (directionIndex == 0)
63 return 0;
64 else
65 return 1;
66 }
67
68 return 0;
69 }
70
71 override string GetAnimSourceFromSelection(string selection)
72 {
73 switch (selection)
74 {
75 case "seat_driver":
76 return "SeatDriver";
77 }
78
79 return super.GetAnimSourceFromSelection(selection);
80 }
81
82 override bool IsVitalGlowPlug()
83 {
84 return false;
85 }
86
87 override float GetWeightCoef()
88 {
89 return 0.5;
90 }
91
92 override bool CanGetIn()
93 {
94 if (!super.CanGetIn())
95 return false;
96
97 return GetAnimationPhase("SeatDriver") == 0.0;
98 }
99
100 override void SetActions()
101 {
102 super.SetActions();
103
105 }
106
107 override void OnAnimationPhaseStarted(string animSource, float phase)
108 {
109 super.OnAnimationPhaseStarted(animSource, phase);
110
111 #ifndef SERVER
112 #ifndef NO_GUI
113 switch (animSource)
114 {
115 case "seatdriver":
116 EffectSound sound = CreateSoundForAnimationSource(animSource);
117 if (phase == 0.0)
118 {
119 sound.SetSoundSet("Motorbike_01_Seat_FlipUp_SoundSet");
120 }
121 else
122 {
123 sound.SetSoundSet("Motorbike_01_Seat_FlipDown_SoundSet");
124 }
125
126 sound.SetSoundFadeIn(0.1);
127 sound.SetSoundFadeOut(0.1);
128
130 sound.SoundPlay();
131
132 break;
133 }
134 #endif
135 #endif
136 }
137
138
139 // --------------------------------------------------------------------------------
140
141 override protected void PlayCrashLightSound()
142 {
143 PlaySoundEx("Motorbike_01_hit_character_SoundSet", m_CrashSoundLight, m_PlayCrashSoundLight);
144 }
145
146 // --------------------------------------------------------------------------------
147
148 override protected void PlayCrashHeavySound()
149 {
150 PlaySoundEx("Motorbike_01_hit_heavy_SoundSet", m_CrashSoundHeavy, m_PlayCrashSoundHeavy);
151 }
152
153 // --------------------------------------------------------------------------------
154
155 override void OnDebugSpawn()
156 {
158
159 float amount = GetFluidCapacity(MotorbikeFluid.FUEL);
160 Fill(MotorbikeFluid.FUEL, amount);
161
162 //-----ATTACHMENTS
163 GetInventory().CreateInInventory("Motorbike_01_Wheel_1");
164 GetInventory().CreateInInventory("Motorbike_01_Wheel_2");
165 }
166}
167
168
169class Motorbike_01_Blue : Motorbike_01_ColorBase {};
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
MotorbikeFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Motorbike.c:14
proto native void Fill(MotorbikeFluid fluid, float amount)
Adds to the specified fluid the specified amount.
proto native void SetEnginePos(vector pos)
Override the position of engine (model space)
proto native float GetFluidCapacity(MotorbikeFluid fluid)
void SpawnUniversalParts()
Определения MotorbikeScript.c:1425
string m_EngineStartOK
Определения MotorbikeScript.c:89
string m_EngineStartBattery
Определения MotorbikeScript.c:90
string m_EngineStarting
Sounds.
Определения MotorbikeScript.c:88
string m_EngineStartPlug
Определения MotorbikeScript.c:91
string m_EngineStartFuel
Определения MotorbikeScript.c:92
ref VehicleHornComponent m_HornComponent
Определения MotorbikeScript.c:75
EffectSound CreateSoundForAnimationSource(string animSource)
Определения MotorbikeScript.c:277
void MotorbikeScript()
Определения MotorbikeScript.c:105
string m_EngineStopFuel
Определения MotorbikeScript.c:94
ref VehicleLightsComponent m_LightsComponent
Определения MotorbikeScript.c:74
string m_EngineStop
Определения MotorbikeScript.c:93
Motorbike_01LightProfileFront VehicleLightProfileFront Motorbike_01LightProfileRear()
VehicleAnimInstances
Определения VehicleAnimInstances.c:2
void VehicleLightData(VehicleLightProfileBase profile)
Определения VehicleLightsComponent.c:21
void SetSoundSet(string snd)
Set soundset for the sound.
Определения EffectSound.c:798
void SetSoundFadeIn(float fade_in)
Set the sound fade in duration.
Определения EffectSound.c:899
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
Определения EffectSound.c:908
bool SoundPlay()
Plays sound.
Определения EffectSound.c:199
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
override vector GetTransportCameraOffset()
override string GetAnimSourceFromSelection(string selection)
override int GetSeatAnimationTypeDirectional(int posIdx, int directionIndex)
override bool HasGangedTailAndBrakeLights()
override void OnAnimationPhaseStarted(string animSource, float phase)
override float GetTransportCameraDistance()
override bool NeedElectricitySourceDevice()
override bool HasDirectionalInOutAction()
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
Определения EffectManager.c:331
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
const int LONG
Определения VehicleHornComponent.c:5
const int SHORT
Определения VehicleHornComponent.c:4
Определения EnConvert.c:119