forked from themrdemonized/xray-monolith
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWeapon.h
More file actions
1156 lines (938 loc) · 28.8 KB
/
Weapon.h
File metadata and controls
1156 lines (938 loc) · 28.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include "../xrphysics/PhysicsShell.h"
#include "weaponammo.h"
#include "PHShellCreator.h"
#include "ShootingObject.h"
#include "hud_item_object.h"
#include "Actor_Flags.h"
#include "../Include/xrRender/KinematicsAnimated.h"
#include "firedeps.h"
#include "game_cl_single.h"
#include "first_bullet_controller.h"
#include "CameraRecoil.h"
#include "NewZoomFlag.h"
class CEntity;
class ENGINE_API CMotionDef;
class CSE_ALifeItemWeapon;
class CSE_ALifeItemWeaponAmmo;
class CWeaponMagazined;
class CParticlesObject;
class CUIWindow;
class CBinocularsVision;
class CNightVisionEffector;
extern float f_weapon_deterioration;
extern std::map<shared_str, float> listScopeRadii;
extern float scope_scrollpower;
extern float sens_multiple;
struct PickParam
{
collide::rq_result RQ;
float power;
u32 pass;
};
struct SafemodeAnm
{
LPCSTR name;
float power, speed;
};
class CWeapon : public CHudItemObject,
public CShootingObject
{
private:
typedef CHudItemObject inherited;
public:
CWeapon();
virtual ~CWeapon();
// Generic
virtual void Load(LPCSTR section);
virtual BOOL net_Spawn(CSE_Abstract* DC);
virtual void net_Destroy();
virtual void net_Export(NET_Packet& P);
virtual void net_Import(NET_Packet& P);
virtual CWeapon* cast_weapon()
{
return this;
}
virtual CWeaponMagazined* cast_weapon_magazined()
{
return 0;
}
//serialization
virtual void save(NET_Packet& output_packet);
virtual void load(IReader& input_packet);
virtual BOOL net_SaveRelevant()
{
return inherited::net_SaveRelevant();
}
float CWeapon::GetSecondVPFov() const;
IC float GetZRotatingFactor() const { return m_zoom_params.m_fZoomRotationFactor; }
IC float GetSecondVPZoomFactor() const { return m_zoom_params.m_fSecondVPFovFactor; }
IC float IsSecondVPZoomPresent() const { return GetSecondVPZoomFactor() > 0.005f; }
// Up
// Magazine system & etc
xr_vector<shared_str> bullets_bones;
int bullet_cnt;
int last_hide_bullet;
bool bHasBulletsToHide;
//--DSR-- SilencerOverheat_start
float temperature;
virtual void FireBullet(const Fvector& pos,
const Fvector& shot_dir,
float fire_disp,
const CCartridge& cartridge,
u16 parent_id,
u16 weapon_id,
bool send_hit, int iShotNum);
virtual float GetGlowing();
//--DSR-- SilencerOverheat_end
virtual void HUD_VisualBulletUpdate(bool force = false, int force_idx = -1);
void UpdateSecondVP();
virtual void UpdateCL();
virtual void shedule_Update(u32 dt);
virtual void renderable_Render();
virtual void render_hud_mode();
virtual bool need_renderable();
virtual void render_item_ui();
virtual bool render_item_ui_query();
virtual void OnH_B_Chield();
virtual void OnH_A_Chield();
virtual void OnH_B_Independent(bool just_before_destroy);
virtual void OnH_A_Independent();
virtual void OnEvent(NET_Packet& P, u16 type); // {inherited::OnEvent(P,type);}
virtual void Hit(SHit* pHDS);
virtual void reinit();
virtual void reload(LPCSTR section);
// demonized: World model on stalkers adjustments
void set_mOffset(Fvector position, Fvector orientation);
void set_mStrapOffset(Fvector position, Fvector orientation);
void set_mFirePoint(Fvector &fire_point);
void set_mFirePoint2(Fvector &fire_point);
void set_mShellPoint(Fvector &fire_point);
virtual void create_physic_shell();
virtual void activate_physic_shell();
virtual void setup_physic_shell();
virtual void SwitchState(u32 S);
virtual void OnActiveItem();
virtual void OnHiddenItem();
virtual void SendHiddenItem(); //same as OnHiddenItem but for client... (sends message to a server)...
virtual bool NeedBlendAnm();
virtual void OnEmptyClick() {};
public:
virtual bool can_kill() const;
virtual CInventoryItem* can_kill(CInventory* inventory) const;
virtual const CInventoryItem* can_kill(const xr_vector<const CGameObject*>& items) const;
virtual bool ready_to_kill() const;
virtual bool NeedToDestroyObject() const;
virtual ALife::_TIME_ID TimePassedAfterIndependant() const;
protected:
//âðåìÿ óäàëåíèÿ îðóæèÿ
ALife::_TIME_ID m_dwWeaponRemoveTime;
ALife::_TIME_ID m_dwWeaponIndependencyTime;
virtual bool IsHudModeNow();
virtual bool SOParentIsActor() { return ParentIsActor(); }
u8 last_idx;
public:
void signal_HideComplete();
virtual bool Action(u16 cmd, u32 flags);
enum EWeaponStates
{
eFire = eLastBaseState + 1,
eFire2,
eReload,
eMisfire,
eSwitch,
eSwitchMode,
eAimStart,
eAimEnd,
};
enum EWeaponSubStates
{
eSubstateReloadBegin = 0,
eSubstateReloadInProcess,
eSubstateReloadEnd,
eSubstateReloadInProcessEmptyEnd,
};
enum
{
undefined_ammo_type = u8(-1)
};
IC BOOL IsValid() const
{
return iAmmoElapsed;
}
// Does weapon need's update?
BOOL IsUpdating();
bool IsMisfire() const;
void SetMisfireScript(bool b);
BOOL CheckForMisfire();
BOOL AutoSpawnAmmo() const
{
return m_bAutoSpawnAmmo;
};
bool IsTriStateReload() const
{
return m_bTriStateReload;
}
EWeaponSubStates GetReloadState() const
{
return (EWeaponSubStates)m_sub_state;
}
protected:
bool m_bTriStateReload;
// a misfire happens, you'll need to rearm weapon
bool bMisfire;
bool bClearJamOnly; //used for "reload" misfire animation
bool m_playFullShotAnim;
BOOL m_bAutoSpawnAmmo;
virtual bool AllowBore();
public:
u8 m_sub_state;
bool IsCustomReloadAvaible;
bool IsGrenadeLauncherAttached() const;
bool IsScopeAttached() const;
bool IsSilencerAttached() const;
virtual bool GrenadeLauncherAttachable();
virtual bool ScopeAttachable();
virtual bool SilencerAttachable();
ALife::EWeaponAddonStatus get_GrenadeLauncherStatus() const
{
return m_eGrenadeLauncherStatus;
}
ALife::EWeaponAddonStatus get_ScopeStatus() const
{
return m_eScopeStatus;
}
ALife::EWeaponAddonStatus get_SilencerStatus() const
{
return m_eSilencerStatus;
}
virtual bool UseScopeTexture()
{
return true;
};
//îáíîâëåíèå âèäèìîñòè äëÿ êîñòî÷åê àääîíîâ
void UpdateAddonsVisibility();
void UpdateHUDAddonsVisibility();
//èíèöèàëèçàöèÿ ñâîéñòâ ïðèñîåäèíåííûõ àääîíîâ
virtual void InitAddons();
//äëÿ îòîáðîàæåíèÿ èêîíîê àïãðåéäîâ â èíòåðôåéñå
int GetScopeX()
{
return pSettings->r_s32(m_scopes[m_cur_scope], "scope_x");
}
int GetScopeY()
{
return pSettings->r_s32(m_scopes[m_cur_scope], "scope_y");
}
int GetSilencerX()
{
return m_iSilencerX;
}
int GetSilencerY()
{
return m_iSilencerY;
}
int GetGrenadeLauncherX()
{
return m_iGrenadeLauncherX;
}
int GetGrenadeLauncherY()
{
return m_iGrenadeLauncherY;
}
const shared_str& GetGrenadeLauncherName() const
{
return m_sGrenadeLauncherName;
}
const shared_str GetScopeName() const
{
if (m_scopes.size() < 1)
{
return {};
}
if (m_modular_attachments) {
return m_scopes[m_cur_scope];
}
return pSettings->r_string(m_scopes[m_cur_scope], "scope_name");
}
const shared_str& GetSilencerName() const
{
return m_sSilencerName;
}
IC void ForceUpdateAmmo()
{
m_BriefInfo_CalcFrame = 0;
}
u8 GetAddonsState() const
{
return m_flagsAddOnState;
};
void SetAddonsState(u8 st)
{
m_flagsAddOnState = st;
} //dont use!!! for buy menu only!!!
protected:
//ñîñòîÿíèå ïîäêëþ÷åííûõ àääîíîâ
u8 m_flagsAddOnState;
//âîçìîæíîñòü ïîäêëþ÷åíèÿ ðàçëè÷íûõ àääîíîâ
ALife::EWeaponAddonStatus m_eScopeStatus;
ALife::EWeaponAddonStatus m_eSilencerStatus;
ALife::EWeaponAddonStatus m_eGrenadeLauncherStatus;
shared_str m_sScopeName;
shared_str m_sSilencerName;
shared_str m_sGrenadeLauncherName;
//ñìåùåíèå èêîíîâ àïãðåéäîâ â èíâåíòàðå
int m_iScopeX, m_iScopeY;
int m_iSilencerX, m_iSilencerY;
int m_iGrenadeLauncherX, m_iGrenadeLauncherY;
protected:
struct SZoomParams
{
float m_fMinBaseZoomFactor;
float m_fZoomStepCount;
bool m_bZoomEnabled;
bool m_bHideCrosshairInZoom;
bool m_bZoomDofEnabled;
bool m_bIsZoomModeNow;
float m_fCurrentZoomFactor;
float m_fZoomRotateTime;
float m_fBaseZoomFactor;
float m_fScopeZoomFactor;
float m_fZoomRotationFactor;
float m_fSecondVPFovFactor;
Fvector m_ZoomDof;
Fvector4 m_ReloadDof;
Fvector4 m_ReloadEmptyDof; //Swartz: reload when empty mag. DOF
BOOL m_bUseDynamicZoom;
BOOL m_bUseDynamicZoom_Primary;
BOOL m_bUseDynamicZoom_Alt;
BOOL m_bUseDynamicZoom_GL;
shared_str m_sUseZoomPostprocess;
shared_str m_sUseBinocularVision;
CBinocularsVision* m_pVision;
CNightVisionEffector* m_pNight_vision;
} m_zoom_params;
float m_fRTZoomFactor; //run-time zoom factor
CUIWindow* m_UIScope;
private:
bool firstZoomDone;
public:
IC bool IsZoomEnabled() const
{
return m_zoom_params.m_bZoomEnabled;
}
virtual float GetMinScopeZoomFactor() const;
virtual void ZoomInc();
virtual void ZoomDec();
virtual void OnZoomIn();
virtual void OnZoomOut();
IC bool IsZoomed() const
{
return m_zoom_params.m_bIsZoomModeNow;
};
CUIWindow* ZoomTexture();
bool ZoomHideCrosshair();
IC float GetZoomFactor() const
{
return m_zoom_params.m_fCurrentZoomFactor;
}
IC void SetZoomFactor(float f)
{
m_zoom_params.m_fCurrentZoomFactor = f;
}
virtual float CurrentZoomFactor();
//ïîêàçûâàåò, ÷òî îðóæèå íàõîäèòñÿ â ñîîñòîÿíèè ïîâîðîòà äëÿ ïðèáëèæåííîãî ïðèöåëèâàíèÿ
bool IsRotatingToZoom() const
{
return (m_zoom_params.m_fZoomRotationFactor < 1.f);
}
virtual u8 GetCurrentHudOffsetIdx();
// Tronex script exports
void AmmoTypeForEach(const luabind::functor<bool>& funct);
float GetMagazineWeightScript() const { return GetMagazineWeight(m_magazine); }
int GetAmmoCount_forType_Script(LPCSTR type) const { return GetAmmoCount_forType(type); }
LPCSTR GetGrenadeLauncherNameScript() const { return *GetGrenadeLauncherName(); }
LPCSTR GetSilencerNameScript() const { return *GetSilencerName(); }
LPCSTR GetScopeNameScript() const { return *GetScopeName(); }
float GetFireDispersionScript() const { return fireDispersionBase; }
float RPMScript() const { return fOneShotTime; }
float RealRPMScript() const { return 60.0f / fOneShotTime; } // Return actual RPM like in configs
float ModeRPMScript() const { return fModeShotTime; }
float ModeRealRPMScript() const { return 60.0f / fModeShotTime; }
//Setters
void SetFireDispersionScript(float val) { fireDispersionBase = val; }
void SetRPM(float newOneShotTime) { fOneShotTime = newOneShotTime; } // Input - time between shots like received from getter
void SetRealRPM(float rpm) { fOneShotTime = 60.0f / rpm; } // Input - actual RPM like in configs
void SetModeRPM(float newOneShotTime) { fModeShotTime = newOneShotTime; } // Input - time between shots like received from getter
void SetModeRealRPM(float rpm) { fModeShotTime = 60.0f / rpm; } // Input - actual RPM like in configs
virtual float Weight() const;
virtual u32 Cost() const;
public:
virtual EHandDependence HandDependence() const
{
return eHandDependence;
}
bool IsSingleHanded() const
{
return m_bIsSingleHanded;
}
public:
IC LPCSTR strap_bone0() const
{
return m_strap_bone0;
}
IC LPCSTR strap_bone1() const
{
return m_strap_bone1;
}
IC void strapped_mode(bool value)
{
m_strapped_mode = value;
}
IC bool strapped_mode() const
{
return m_strapped_mode;
}
protected:
LPCSTR m_strap_bone0;
LPCSTR m_strap_bone1;
Fmatrix m_StrapOffset;
bool m_strapped_mode;
bool m_can_be_strapped;
bool isGrenadeLauncherActive = false;
u8 zoomTypeBeforeLauncher = 0;
float m_fSafeModeRotateTime;
SafemodeAnm m_safemode_anm[2];
Fmatrix m_Offset;
Fvector m_hud_offset[2];
Fvector m_hud_aim_rot;
// 0-èñïîëüçóåòñÿ áåç ó÷àñòèÿ ðóê, 1-îäíà ðóêà, 2-äâå ðóêè
EHandDependence eHandDependence;
bool m_bIsSingleHanded;
public:
//çàãðóæàåìûå ïàðàìåòðû
Fvector vLoadedFirePoint;
Fvector vLoadedFirePoint2;
Fvector vLoadedFirePointSilencer;
bool m_bCanBeLowered;
bool m_modular_attachments;
private:
firedeps m_current_firedeps;
public:
Fmatrix m_shoot_shake_mat;
void UpdateZoomParams();
void SetUIScope(LPCSTR scope_texture);
shared_str m_scope_tex_name;
shared_str m_primary_scope_tex_name;
shared_str m_secondary_scope_tex_name;
private:
float m_nearwall_zoomed_range;
public:
float GetTargetNearWallOffset();
float GetTargetHudFov();
public:
Fmatrix RayTransform();
void g_fireParams(SPickParam& pp);
protected:
virtual void UpdateFireDependencies_internal();
void UpdateUIScope();
void SwitchZoomType();
void ToggleGrenadeLauncher();
void SetZoomType(u8 new_zoom_type);
void SetZoomTypeAndParams(u8 zoomType);
virtual void UpdatePosition(const Fmatrix& transform); //.
virtual void UpdateXForm();
void InterpolateOffset(Fvector& current, const Fvector& target, const float factor) const;
virtual void UpdateHudAdditional(Fmatrix& trans);
IC void UpdateFireDependencies()
{
if (dwFP_Frame == Device.dwFrame) return;
UpdateFireDependencies_internal();
};
virtual void LoadFireParams(LPCSTR section);
public:
IC const Fvector& get_LastFP()
{
UpdateFireDependencies();
return m_current_firedeps.vLastFP;
}
IC const Fvector& get_LastFP2()
{
UpdateFireDependencies();
return m_current_firedeps.vLastFP2;
}
IC const Fvector& get_LastFPSilencer()
{
UpdateFireDependencies();
return m_current_firedeps.vLastFPSilencer;
}
IC const Fvector& get_LastFD()
{
UpdateFireDependencies();
return m_current_firedeps.vLastFD;
}
IC const Fvector& get_LastSP()
{
UpdateFireDependencies();
return m_current_firedeps.vLastSP;
}
virtual const Fvector& get_CurrentFirePoint()
{
if (SilencerAttachable() && IsSilencerAttached()) {
return get_LastFPSilencer();
}
return get_LastFP();
}
virtual const Fvector& get_CurrentFirePoint2()
{
return get_LastFP2();
}
virtual const Fvector& get_CurrentFirePointSilencer()
{
return get_LastFPSilencer();
}
virtual const Fmatrix& get_ParticlesXFORM()
{
UpdateFireDependencies();
return m_current_firedeps.m_FireParticlesXForm;
}
virtual void ForceUpdateFireParticles();
virtual void debug_draw_firedeps();
protected:
virtual void SetDefaults();
virtual bool MovingAnimAllowedNow();
virtual void OnStateSwitch(u32 S, u32 oldState);
virtual void OnAnimationEnd(u32 state);
//òðàññèðîâàíèå ïîëåòà ïóëè
virtual void FireTrace(const Fvector& P, const Fvector& D);
virtual float GetWeaponDeterioration();
virtual void FireStart();
virtual void FireEnd();
virtual void Reload();
void StopShooting();
// îáðàáîòêà âèçóàëèçàöèè âûñòðåëà
virtual void OnShot()
{
};
virtual void AddShotEffector();
virtual void RemoveShotEffector();
virtual void ClearShotEffector();
virtual void StopShotEffector();
public:
float GetBaseDispersion(float cartridge_k);
float GetFireDispersion(bool with_cartridge, bool for_crosshair = false);
virtual float GetFireDispersion(float cartridge_k, bool for_crosshair = false);
virtual int ShotsFired()
{
return 0;
}
virtual int GetCurrentFireMode()
{
return 1;
}
//ïàðàìåòû îðóæèÿ â çàâèñèìîòè îò åãî ñîñòîÿíèÿ èñïðàâíîñòè
float GetConditionDispersionFactor() const;
float GetConditionMisfireProbability() const;
virtual float GetConditionToShow() const;
public:
CameraRecoil cam_recoil; // simple mode (walk, run)
CameraRecoil zoom_cam_recoil; // using zoom =(ironsight or scope)
// Getters
float GetCamRelaxSpeed() { return cam_recoil.RelaxSpeed; };
float GetCamRelaxSpeed_AI() { return cam_recoil.RelaxSpeed_AI; };
float GetCamDispersion() { return cam_recoil.Dispersion; };
float GetCamDispersionInc() { return cam_recoil.DispersionInc; };
float GetCamDispersionFrac() { return cam_recoil.DispersionFrac; };
float GetCamMaxAngleVert() { return cam_recoil.MaxAngleVert; };
float GetCamMaxAngleHorz() { return cam_recoil.MaxAngleHorz; };
float GetCamStepAngleHorz() { return cam_recoil.StepAngleHorz; };
float GetZoomCamRelaxSpeed() { return zoom_cam_recoil.RelaxSpeed; };
float GetZoomCamRelaxSpeed_AI() { return zoom_cam_recoil.RelaxSpeed_AI; };
float GetZoomCamDispersion() { return zoom_cam_recoil.Dispersion; };
float GetZoomCamDispersionInc() { return zoom_cam_recoil.DispersionInc; };
float GetZoomCamDispersionFrac() { return zoom_cam_recoil.DispersionFrac; };
float GetZoomCamMaxAngleVert() { return zoom_cam_recoil.MaxAngleVert; };
float GetZoomCamMaxAngleHorz() { return zoom_cam_recoil.MaxAngleHorz; };
float GetZoomCamStepAngleHorz() { return zoom_cam_recoil.StepAngleHorz; };
// Setters
void SetCamRelaxSpeed(float val) { cam_recoil.RelaxSpeed = val; };
void SetCamRelaxSpeed_AI(float val) { cam_recoil.RelaxSpeed_AI = val; };
void SetCamDispersion(float val) { cam_recoil.Dispersion = val; };
void SetCamDispersionInc(float val) { cam_recoil.DispersionInc = val; };
void SetCamDispersionFrac(float val) { cam_recoil.DispersionFrac = val; };
void SetCamMaxAngleVert(float val) { cam_recoil.MaxAngleVert = val; };
void SetCamMaxAngleHorz(float val) { cam_recoil.MaxAngleHorz = val; };
void SetCamStepAngleHorz(float val) { cam_recoil.StepAngleHorz = val; };
void SetZoomCamRelaxSpeed(float val) { zoom_cam_recoil.RelaxSpeed = val; };
void SetZoomCamRelaxSpeed_AI(float val) { zoom_cam_recoil.RelaxSpeed_AI = val; };
void SetZoomCamDispersion(float val) { zoom_cam_recoil.Dispersion = val; };
void SetZoomCamDispersionInc(float val) { zoom_cam_recoil.DispersionInc = val; };
void SetZoomCamDispersionFrac(float val) { zoom_cam_recoil.DispersionFrac = val; };
void SetZoomCamMaxAngleVert(float val) { zoom_cam_recoil.MaxAngleVert = val; };
void SetZoomCamMaxAngleHorz(float val) { zoom_cam_recoil.MaxAngleHorz = val; };
void SetZoomCamStepAngleHorz(float val) { zoom_cam_recoil.StepAngleHorz = val; };
protected:
//ôàêòîð óâåëè÷åíèÿ äèñïåðñèè ïðè ìàêñèìàëüíîé èçíîøåíîñòè
//(íà ñêîëüêî ïðîöåíòîâ óâåëè÷èòñÿ äèñïåðñèÿ)
float fireDispersionConditionFactor;
//âåðîÿòíîñòü îñå÷êè ïðè ìàêñèìàëüíîé èçíîøåíîñòè
// modified by Peacemaker [17.10.08]
// float misfireProbability;
// float misfireConditionK;
float misfireStartCondition; //èçíîøåííîñòü, ïðè êîòîðîé ïîÿâëÿåòñÿ øàíñ îñå÷êè
float misfireEndCondition; //èçíîøåíîñòü ïðè êîòîðîé øàíñ îñå÷êè ñòàíîâèòñÿ êîíñòàíòíûì
float misfireStartProbability; //øàíñ îñå÷êè ïðè èçíîøåíîñòè áîëüøå ÷åì misfireStartCondition
float misfireEndProbability; //øàíñ îñå÷êè ïðè èçíîøåíîñòè áîëüøå ÷åì misfireEndCondition
float conditionDecreasePerQueueShot; //óâåëè÷åíèå èçíîøåíîñòè ïðè âûñòðåëå î÷åðåäüþ
float conditionDecreasePerShot; //óâåëè÷åíèå èçíîøåíîñòè ïðè îäèíî÷íîì âûñòðåëå
public:
float GetMisfireStartCondition() const
{
return misfireStartCondition;
};
float GetMisfireEndCondition() const
{
return misfireEndCondition;
};
// Setters
void SetMisfireStartCondition(float val)
{
misfireStartCondition = val;
};
void SetMisfireEndCondition(float val)
{
misfireEndCondition = val;
};
protected:
struct SPDM
{
float m_fPDM_disp_base;
float m_fPDM_disp_vel_factor;
float m_fPDM_disp_accel_factor;
float m_fPDM_disp_crouch;
float m_fPDM_disp_crouch_no_acc;
float m_fPDM_disp_buckShot;
};
SPDM m_pdm;
float m_crosshair_inertion;
first_bullet_controller m_first_bullet_controller;
protected:
//äëÿ îòäà÷è îðóæèÿ
Fvector m_vRecoilDeltaAngle;
//äëÿ ñòàëêåðîâ, ÷òîá îíè çíàëè ýôôåêòèâíûå ãðàíèöû èñïîëüçîâàíèÿ
//îðóæèÿ
float m_fMinRadius;
float m_fMaxRadius;
float m_fZoomRotateModifier;
protected:
//äëÿ âòîðîãî ñòâîëà
void StartFlameParticles2();
void StopFlameParticles2();
void UpdateFlameParticles2();
protected:
shared_str m_sFlameParticles2;
//îáúåêò ïàðòèêëîâ äëÿ ñòðåëüáû èç 2-ãî ñòâîëà
CParticlesObject* m_pFlameParticles2;
protected:
int GetAmmoCount(u8 ammo_type) const;
public:
IC int GetAmmoElapsed() const
{
return iAmmoElapsed;
}
IC int GetAmmoMagSize() const
{
return iMagazineSize;
}
int GetSuitableAmmoTotal(bool use_item_to_spawn = false) const;
void SetAmmoElapsed(int ammo_count);
virtual void OnMagazineEmpty();
void SpawnAmmo(u32 boxCurr = 0xffffffff,
LPCSTR ammoSect = NULL,
u32 ParentID = 0xffffffff);
bool SwitchAmmoType(u32 flags);
float m_APk;
virtual float Get_PDM_Base() const
{
return m_pdm.m_fPDM_disp_base;
};
virtual float Get_Silencer_PDM_Base() const
{
return cur_silencer_koef.pdm_base;
};
virtual float Get_Scope_PDM_Base() const
{
return cur_scope_koef.pdm_base;
};
virtual float Get_Launcher_PDM_Base() const
{
return cur_launcher_koef.pdm_base;
};
virtual float Get_PDM_BuckShot() const
{
return m_pdm.m_fPDM_disp_buckShot;
};
virtual float Get_PDM_Vel_F() const
{
return m_pdm.m_fPDM_disp_vel_factor;
};
virtual float Get_Silencer_PDM_Vel() const
{
return cur_silencer_koef.pdm_vel;
};
virtual float Get_Scope_PDM_Vel() const
{
return cur_scope_koef.pdm_vel;
};
virtual float Get_Launcher_PDM_Vel() const
{
return cur_launcher_koef.pdm_vel;
};
virtual float Get_PDM_Accel_F() const
{
return m_pdm.m_fPDM_disp_accel_factor;
};
virtual float Get_Silencer_PDM_Accel() const
{
return cur_silencer_koef.pdm_accel;
};
virtual float Get_Scope_PDM_Accel() const
{
return cur_scope_koef.pdm_accel;
};
virtual float Get_Launcher_PDM_Accel() const
{
return cur_launcher_koef.pdm_accel;
};
virtual float Get_PDM_Crouch() const
{
return m_pdm.m_fPDM_disp_crouch;
};
virtual float Get_PDM_Crouch_NA() const
{
return m_pdm.m_fPDM_disp_crouch_no_acc;
};
virtual float GetCrosshairInertion() const
{
return m_crosshair_inertion;
};
virtual float Get_Silencer_CrosshairInertion() const
{
return cur_silencer_koef.crosshair_inertion;
};
virtual float Get_Scope_CrosshairInertion() const
{
return cur_scope_koef.crosshair_inertion;
};
virtual float Get_Launcher_CrosshairInertion() const
{
return cur_launcher_koef.crosshair_inertion;
};
float GetFirstBulletDisp() const
{
return m_first_bullet_controller.get_fire_dispertion();
};
// Setters
virtual void Set_PDM_Base(float val)
{
m_pdm.m_fPDM_disp_base = val;
};
virtual void Set_Silencer_PDM_Base(float val)
{
cur_silencer_koef.pdm_base = val;
};
virtual void Set_Scope_PDM_Base(float val)
{
cur_scope_koef.pdm_base = val;
};
virtual void Set_Launcher_PDM_Base(float val)
{
cur_launcher_koef.pdm_base = val;
};
virtual void Set_PDM_BuckShot(float val)
{
m_pdm.m_fPDM_disp_buckShot = val;
};
virtual void Set_PDM_Vel_F(float val)
{
m_pdm.m_fPDM_disp_vel_factor = val;
};
virtual void Set_Silencer_PDM_Vel(float val)
{
cur_silencer_koef.pdm_vel = val;
};
virtual void Set_Scope_PDM_Vel(float val)
{
cur_scope_koef.pdm_vel = val;
};
virtual void Set_Launcher_PDM_Vel(float val)
{
cur_launcher_koef.pdm_vel = val;
};
virtual void Set_PDM_Accel_F(float val)
{
m_pdm.m_fPDM_disp_accel_factor = val;
};
virtual void Set_Silencer_PDM_Accel(float val)
{
cur_silencer_koef.pdm_accel = val;
};
virtual void Set_Scope_PDM_Accel(float val)
{
cur_scope_koef.pdm_accel = val;
};
virtual void Set_Launcher_PDM_Accel(float val)
{
cur_launcher_koef.pdm_accel = val;
};
virtual void Set_PDM_Crouch(float val)
{
m_pdm.m_fPDM_disp_crouch = val;
};
virtual void Set_PDM_Crouch_NA(float val)
{
m_pdm.m_fPDM_disp_crouch_no_acc = val;
};
virtual void SetCrosshairInertion(float val)
{
m_crosshair_inertion = val;
};
virtual void Set_Silencer_CrosshairInertion(float val)
{
cur_silencer_koef.crosshair_inertion = val;
};
virtual void Set_Scope_CrosshairInertion(float val)
{
cur_scope_koef.crosshair_inertion = val;
};
virtual void Set_Launcher_CrosshairInertion(float val)
{
cur_launcher_koef.crosshair_inertion = val;
};
void SetFirstBulletDisp(float val)