688{
706
708
709
710
711
712
714 {
715 m_Name = config_OnFire_entry;
716
717
719
720
722
723
725
727 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
728 {
730 }
731
732
735
736
739
740
743
744 if (health_limit.Count() == 2)
745 {
748 }
749 else
750 {
751
754 }
755
756
759
760 if (overheat_limit.Count() == 2)
761 {
764 }
765 else
766 {
767
770 }
771
772
775
776 if (rain_limit.Count() == 2)
777 {
780 }
781 else
782 {
783
786 }
787
788
791
794
795
796 string particle_name = "";
798
799 if (particle_name != "")
800 {
802 }
803 else
804 {
806 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
808 }
809
810
813
815 {
816
818
820 {
822 }
823 }
824
825
828
829 if (v.Count() == 3)
830 {
831 float v1 = v.Get(0);
832 float v2 = v.Get(1);
833 float v3 = v.Get(2);
835 }
836 }
837
838
839
840
841
842
843
844
846 {
848 {
849
851 {
853 {
855 {
857 {
859 {
861 {
863 {
865 {
867 {
868
870
872 {
873
876
877
879
880
882 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
883 }
884 else
885 {
886 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
887 }
888
889
891 {
892 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
894 if ( randX > 8 )
896 else if ( randX > 4 )
898 else
900 }
901 }
902 }
903 }
904 }
905 }
906 }
907 }
908 }
909 }
910 }
911 }
912
914 {
915
916 }
917
919 {
920
921 }
922
924 {
925
926 }
927
928
929
930
931
932
933
934
936 {
938 {
942 }
943
944 return true;
945 }
946
947
949 {
951 }
952
953
955 {
957 }
958
959
961 {
963 }
964
965
967 {
969
970 string particle_file = "";
971 string cfg_path = "CfgAmmo " + ammoType + " muzzleFlashParticle";
972 if (
GetGame().ConfigGetText( cfg_path, particle_file))
974
975
976
978 {
979 if (particle_file == "")
980 {
981 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
982 }
983 else
984 {
986
988 {
989 string devStr;
990 #ifdef DEVELOPER
991 devStr = " Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
992 #endif
993 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
995 }
996 }
997 }
998 else
999 {
1001 }
1002
1004 }
1005
1006
1008 {
1009 vector particle_ori =
"0 0 0";
1011 {
1015 }
1016 else
1017 {
1019 {
1021 }
1022
1024 {
1025 particle_ori = particle_ori +
Vector(0,0,270);
1026 }
1027 }
1028
1029 return particle_ori;
1030 }
1031}
1032
1033
1035
1036
1038
1039
1041{
1043 {
1045 }
1046
1048 {
1050 {
1051 weapon.KillAllOverheatingParticles();
1052 }
1053 }
1054
1056 {
1057 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
1058 }
1059}
1060
1062{
1068
1071
1073 {
1075 }
1076
1078 {
1080 }
1081
1083 {
1085 }
1086
1088 {
1090 }
1091
1093 {
1095 }
1096
1098 {
1100 }
1101
1103 {
1108 }
1109
1111 {
1113 }
1114
1116 {
1118 }
1119
1121 {
1123 }
1124
1126 {
1128 }
1129}
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].