DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
FireworksLauncherAnniversary.c
См. документацию.
2{
3 override protected int GetExplParticleFromSequence()
4 {
5 switch (m_Color)
6 {
7 case "1":
9 case "2":
11 case "3":
13 case "4":
15 case "5":
17 default:
18 ErrorEx("Incorrect explosion particle color in the sequence");
19 }
21 }
22
23 override protected void SetupLight(PointLightBase light)
24 {
25 switch (m_Color)
26 {
27 case "1":
28 light.SetDiffuseColor(255,51,51);
29 light.SetAmbientColor(255,51,51);
30
31 break;
32 case "2":
33 light.SetDiffuseColor(0,255,128);
34 light.SetAmbientColor(0,255,128);
35 break;
36 case "3":
37 light.SetDiffuseColor(51,153,255);
38 light.SetAmbientColor(51,153,255);
39 break;
40 case "4":
41 light.SetDiffuseColor(255,255,51);
42 light.SetAmbientColor(255,255,51);
43 break;
44 case "5":
45 light.SetDiffuseColor(255,102,255);
46 light.SetAmbientColor(255,102,255);
47 break;
48 default:
49 ErrorEx("Incorrect explosion particle color in the sequence");
50 }
51 }
52
53 override protected void SpawnSecondaryExplosion()
54 {
55 AnniversaryFireworksLauncherClientEventSecondary evnt = new AnniversaryFireworksLauncherClientEventSecondary(m_Item,m_Index);
56 evnt.Init(GetExplosionPosition());
57 evnt.OnExplode();
58 m_Events.Insert(evnt);
60 }
61}
62//--------------------------------------------------------------------------------------
63class AnniversaryFireworksLauncherClientEventSecondary : AnniversaryFireworksLauncherClientEvent
64{
65 protected vector m_ShotPos;
66
67 override protected vector GetExplosionPosition()
68 {
69 return GetShotPos() + m_ShotDir * GetExplosionDistance();
70 }
71
72 void Init(vector pos)
73 {
74 m_ShotPos = pos;
75 m_ShotDir[0] = Math.RandomFloatInclusive(-1,1);
76 m_ShotDir[1] = Math.RandomFloatInclusive(-1,1);
77 m_ShotDir[2] = Math.RandomFloatInclusive(-1,1);
78 m_ShotDir.Normalize();
79 }
80 override protected vector GetShotPos()
81 {
82 return m_ShotPos;
83 }
84
85 override protected float GetExplosionDistance()
86 {
87 return Math.RandomFloatInclusive(10,15);
88 }
89
90 override void OnExplode()
91 {
92 GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( PlayExplosionSound, GetSoundDelay(), false);
95 }
96}
97//--------------------------------------------------------------------------------------
99{
100 int sequence = 0;
101
102 override protected void SetupColorSequences()
103 {
104 m_ColorSequence.Insert("1234512345123451234512345");
105 }
106
107 override protected FireworksLauncherClientEventBase SpawnEvent()
108 {
109 FireworksLauncherClientEventBase evnt = new AnniversaryFireworksLauncherClientEvent(this,m_Index);
110 evnt.OnFired();
111 return evnt;
112 }
113
114 override bool IsTakeable()
115 {
116 return false;
117 }
118
119 override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
120 {
121 return false;
122 }
123
124 override bool DisableVicinityIcon()
125 {
126 return true;
127 }
128
129 override protected int GetMaxShots()
130 {
131 return 25;
132 }
133
134 override protected float GetFuseDelay()
135 {
136 return 1;
137 }
138
140 override protected void OnEventServer(int type)
141 {
142 m_Index++;
143 DamageSystem.ExplosionDamage(this, NULL, GetAmmoType(), GetPosition(), GetDamageType());
144
145 if(m_Index > 16)
146 {
147 sequence++;
148 m_Index = 1;
149 }
150
151 SetSynchDirty();
152 if (m_Index + (sequence*16)> GetMaxShots())
153 {
155 m_TimerEvent = null;
156 SetState(EFireworksState.FINISHED);
157 }
158 else
159 {
161 }
162 }
163
164}
override Widget Init()
Определения DayZGame.c:127
Particle m_ParticleExplosion
particle
Определения ExplosivesBase.c:34
ref Timer m_TimerEvent
Определения FireworksBase.c:15
EFireworksState
Определения FireworksBase.c:3
FireworksLauncherClientEvent m_ShotPos
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
void SetState(bool state)
Определения StaminaHandler.c:32
override bool DisableVicinityIcon()
Определения FireworksLauncherAnniversary.c:124
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
Определения FireworksLauncherAnniversary.c:119
FireworksLauncherClientEventBase SpawnEvent()
Определения FireworksLauncherAnniversary.c:107
void OnEventServer(int type)
Called periodically but only after the entity gets ignited.
Определения FireworksLauncherAnniversary.c:140
void SetupLight(PointLightBase light)
Определения FireworksLauncherAnniversary.c:23
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
Определения Building.c:6
void RestartEventTimer()
Starts event timer.
Определения FireworksLauncher.c:561
int GetDamageType()
Определения FireworksLauncher.c:435
string GetAmmoType()
Определения FireworksLauncher.c:430
void FireworksLauncher()
Определения FireworksLauncher.c:332
int m_Index
Определения FireworksLauncher.c:321
ref array< string > m_ColorSequence
Определения FireworksLauncher.c:330
FireworksLauncher m_Item
Определения FireworksLauncher.c:31
void FireworksLauncherClientEvent(FireworksLauncher item, int index)
Определения FireworksLauncher.c:88
vector GetShotPos()
Определения FireworksLauncher.c:137
ref array< ref FireworksLauncherClientEventBase > m_Events
Определения FireworksLauncher.c:43
float GetExplosionDistance()
Определения FireworksLauncher.c:63
void RequestSecondaryExplosion()
Определения FireworksLauncher.c:194
vector GetExplosionPosition()
Определения FireworksLauncher.c:160
InventoryLocation.
Определения InventoryLocation.c:29
Определения EnMath.c:7
static const int FIREWORKS_EXPLOSION_THANKS2
Определения ParticleList.c:319
static const int FIREWORKS_EXPLOSION_THANKS4
Определения ParticleList.c:321
static const int FIREWORKS_EXPLOSION_THANKS1
Определения ParticleList.c:318
static const int FIREWORKS_EXPLOSION_RED
Определения ParticleList.c:307
static const int FIREWORKS_EXPLOSION_THANKS5
Определения ParticleList.c:322
static const int FIREWORKS_EXPLOSION_THANKS3
Определения ParticleList.c:320
Определения ParticleList.c:12
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 ...
Определения EnConvert.c:106
proto native CGame GetGame()
enum ShapeType ErrorEx
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8