629{
647
649
650
651
652
653
655 {
656 m_Name = config_OnFire_entry;
657
658
660
661
663
664
666
668 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
669 {
671 }
672
673
676
677
680
681
684
685 if (health_limit.Count() == 2)
686 {
689 }
690 else
691 {
692
695 }
696
697
700
701 if (overheat_limit.Count() == 2)
702 {
705 }
706 else
707 {
708
711 }
712
713
716
717 if (rain_limit.Count() == 2)
718 {
721 }
722 else
723 {
724
727 }
728
729
732
735
736
737 string particle_name = "";
739
740 if (particle_name != "")
741 {
743 }
744 else
745 {
747 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
749 }
750
751
754
756 {
757
759
761 {
763 }
764 }
765
766
769
770 if (v.Count() == 3)
771 {
772 float v1 = v.Get(0);
773 float v2 = v.Get(1);
774 float v3 = v.Get(2);
776 }
777 }
778
779
780
781
782
783
784
785
787 {
789 {
790
792 {
794 {
796 {
798 {
800 {
802 {
804 {
806 {
808 {
809
811
813 {
814
817
818
820
821
823 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
824 }
825 else
826 {
827 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
828 }
829
830
832 {
833 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
835 if ( randX > 8 )
837 else if ( randX > 4 )
839 else
841 }
842 }
843 }
844 }
845 }
846 }
847 }
848 }
849 }
850 }
851 }
852 }
853
855 {
856
857 }
858
860 {
861
862 }
863
865 {
866
867 }
868
869
870
871
872
873
874
875
877 {
879 {
883 }
884
885 return true;
886 }
887
888
890 {
892 }
893
894
896 {
898 }
899
900
902 {
904 }
905
906
908 {
910
911 string particle_file = "";
912 string cfg_path = "CfgAmmo " + ammoType + " muzzleFlashParticle";
913 if (
GetGame().ConfigGetText( cfg_path, particle_file))
915
916
917
919 {
920 if (particle_file == "")
921 {
922 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
923 }
924 else
925 {
927
929 {
930 string devStr;
931 #ifdef DEVELOPER
932 devStr = " Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
933 #endif
934 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
936 }
937 }
938 }
939 else
940 {
942 }
943
945 }
946
947
949 {
950 vector particle_ori =
"0 0 0";
952 {
956 }
957 else
958 {
960 {
962 }
963
965 {
966 particle_ori = particle_ori +
Vector(0,0,270);
967 }
968 }
969
970 return particle_ori;
971 }
972}
973
974
976
977
979
980
982{
984 {
986 }
987
989 {
991 {
992 weapon.KillAllOverheatingParticles();
993 }
994 }
995
997 {
998 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
999 }
1000}
1001
1003{
1009
1012
1014 {
1016 }
1017
1019 {
1021 }
1022
1024 {
1026 }
1027
1029 {
1031 }
1032
1034 {
1036 }
1037
1039 {
1041 }
1042
1044 {
1049 }
1050
1052 {
1054 }
1055
1057 {
1059 }
1060
1062 {
1064 }
1065
1067 {
1069 }
1070}
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].