647{
665
667
668
669
670
671
673 {
674 m_Name = config_OnFire_entry;
675
676
678
679
681
682
684
686 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
687 {
689 }
690
691
694
695
698
699
702
703 if (health_limit.Count() == 2)
704 {
707 }
708 else
709 {
710
713 }
714
715
718
719 if (overheat_limit.Count() == 2)
720 {
723 }
724 else
725 {
726
729 }
730
731
734
735 if (rain_limit.Count() == 2)
736 {
739 }
740 else
741 {
742
745 }
746
747
750
753
754
755 string particle_name = "";
757
758 if (particle_name != "")
759 {
761 }
762 else
763 {
765 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
767 }
768
769
772
774 {
775
777
779 {
781 }
782 }
783
784
787
788 if (v.Count() == 3)
789 {
790 float v1 = v.Get(0);
791 float v2 = v.Get(1);
792 float v3 = v.Get(2);
794 }
795 }
796
797
798
799
800
801
802
803
805 {
807 {
808
810 {
812 {
814 {
816 {
818 {
820 {
822 {
824 {
826 {
827
829
831 {
832
835
836
838
839
841 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
842 }
843 else
844 {
845 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
846 }
847
848
850 {
851 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
853 if ( randX > 8 )
855 else if ( randX > 4 )
857 else
859 }
860 }
861 }
862 }
863 }
864 }
865 }
866 }
867 }
868 }
869 }
870 }
871
873 {
874
875 }
876
878 {
879
880 }
881
883 {
884
885 }
886
887
888
889
890
891
892
893
895 {
897 {
901 }
902
903 return true;
904 }
905
906
908 {
910 }
911
912
914 {
916 }
917
918
920 {
922 }
923
924
926 {
928
929 string particle_file = "";
930 string cfg_path = "CfgAmmo " + ammoType + " muzzleFlashParticle";
931 if (
GetGame().ConfigGetText( cfg_path, particle_file))
933
934
935
937 {
938 if (particle_file == "")
939 {
940 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
941 }
942 else
943 {
945
947 {
948 string devStr;
949 #ifdef DEVELOPER
950 devStr = " Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
951 #endif
952 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
954 }
955 }
956 }
957 else
958 {
960 }
961
963 }
964
965
967 {
968 vector particle_ori =
"0 0 0";
970 {
974 }
975 else
976 {
978 {
980 }
981
983 {
984 particle_ori = particle_ori +
Vector(0,0,270);
985 }
986 }
987
988 return particle_ori;
989 }
990}
991
992
994
995
997
998
1000{
1002 {
1004 }
1005
1007 {
1009 {
1010 weapon.KillAllOverheatingParticles();
1011 }
1012 }
1013
1015 {
1016 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
1017 }
1018}
1019
1021{
1027
1030
1032 {
1034 }
1035
1037 {
1039 }
1040
1042 {
1044 }
1045
1047 {
1049 }
1050
1052 {
1054 }
1055
1057 {
1059 }
1060
1062 {
1067 }
1068
1070 {
1072 }
1073
1075 {
1077 }
1078
1080 {
1082 }
1083
1085 {
1087 }
1088}
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].