616{
634
636
637
638
639
640
642 {
643 m_Name = config_OnFire_entry;
644
645
647
648
650
651
653
655 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
656 {
658 }
659
660
663
664
667
668
671
672 if (health_limit.Count() == 2)
673 {
676 }
677 else
678 {
679
682 }
683
684
687
688 if (overheat_limit.Count() == 2)
689 {
692 }
693 else
694 {
695
698 }
699
700
703
704 if (rain_limit.Count() == 2)
705 {
708 }
709 else
710 {
711
714 }
715
716
719
722
723
724 string particle_name = "";
726
727 if (particle_name != "")
728 {
730 }
731 else
732 {
734 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
736 }
737
738
741
743 {
744
746
748 {
750 }
751 }
752
753
756
757 if (v.Count() == 3)
758 {
759 float v1 = v.Get(0);
760 float v2 = v.Get(1);
761 float v3 = v.Get(2);
763 }
764 }
765
766
767
768
769
770
771
772
774 {
776 {
777
779 {
781 {
783 {
785 {
787 {
789 {
791 {
793 {
795 {
796
798
800 {
801
804
805
807
808
810 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
811 }
812 else
813 {
814 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
815 }
816
817
819 {
820 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
822 if ( randX > 8 )
824 else if ( randX > 4 )
826 else
828 }
829 }
830 }
831 }
832 }
833 }
834 }
835 }
836 }
837 }
838 }
839 }
840
842 {
843
844 }
845
847 {
848
849 }
850
852 {
853
854 }
855
856
857
858
859
860
861
862
864 {
866 {
870 }
871
872 return true;
873 }
874
875
877 {
879 }
880
881
883 {
885 }
886
887
889 {
891 }
892
893
895 {
897
898 string particle_file = "";
899 string cfg_path = "CfgAmmo " + ammoType + " muzzleFlashParticle";
900 if (
GetGame().ConfigGetText( cfg_path, particle_file))
902
903
904
906 {
907 if (particle_file == "")
908 {
909 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
910 }
911 else
912 {
914
916 {
917 string devStr;
918 #ifdef DEVELOPER
919 devStr = " Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
920 #endif
921 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
923 }
924 }
925 }
926 else
927 {
929 }
930
932 }
933
934
936 {
937 vector particle_ori =
"0 0 0";
939 {
943 }
944 else
945 {
947 {
949 }
950
952 {
953 particle_ori = particle_ori +
Vector(0,0,270);
954 }
955 }
956
957 return particle_ori;
958 }
959}
960
961
963
964
966
967
969{
971 {
973 }
974
976 {
978 {
979 weapon.KillAllOverheatingParticles();
980 }
981 }
982
984 {
985 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
986 }
987}
988
990{
996
999
1001 {
1003 }
1004
1006 {
1008 }
1009
1011 {
1013 }
1014
1016 {
1018 }
1019
1021 {
1023 }
1024
1026 {
1028 }
1029
1031 {
1036 }
1037
1039 {
1041 }
1042
1044 {
1046 }
1047
1049 {
1051 }
1052
1054 {
1056 }
1057}
class GP5GasMask extends MaskBase ItemBase
void MuzzleFlashLight_1()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
bool CheckRainCondition(float rain_coef)
void OnDeactivate(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
float m_OnlyWithinOverheatLimitsMin
vector m_OverrideDirectionVector
string m_OverrideDirectionPoint
float m_OnlyWithinRainLimitsMax
class WeaponParticlesBase OnParticleCreated(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search, Particle p)
void WeaponParticlesBase(ItemBase muzzle_owner, string config_OnFire_entry)
int CheckParticleOverride(string ammoType)
float m_OnlyWithinRainLimitsMin
vector CheckOrientationOverride(vector local_pos, ItemBase muzzle_owner)
bool CheckHealthCondition(int health_label)
bool m_IgnoreIfSuppressed
int m_OnlyWithinHealthLabelMin
bool CheckBoltStateCondition(ItemBase weapon)
float m_OnlyWithinOverheatLimitsMax
int m_OnlyWithinHealthLabelMax
bool CheckOverheatingCondition(float overheating_coef)
proto native vector ConfigGetVector(string path)
Get vector value from config on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
float GetOverheatingLimitMax()
float m_OverheatingLimitMax
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
Object GetParticleParent()
float GetOverheatingLimitMin()
float m_OverheatingLimitMin
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
vector m_DefaultPos
Used for Wiggle API, to restore after unparenting.
vector m_DefaultOri
Used for Wiggle API, to restore after unparenting.
int GetParticleID()
Gets particle id.
Legacy way of using particles in the game.
static int GetParticleIDByName(string name)
Returns particle's ID based on the filename (without .ptc suffix)
static bool IsValidId(int id)
Purely checks for an invalid number, does NOT mean it is actually registered.
static bool m_GunParticlesState
void OnDeactivate(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnParticleCreated(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search, Particle p)
represent weapon state base
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].