526{
544
546
547
548
549
550
552 {
553 m_Name = config_OnFire_entry;
554
555
557
558
560
561
563
565 if (
GetGame().ConfigIsExisting(
string.Format(
"%1 muzzleIndex",
m_Name)))
566 {
568 }
569
570
573
574
577
578
581
582 if (health_limit.Count() == 2)
583 {
586 }
587 else
588 {
589
592 }
593
594
597
598 if (overheat_limit.Count() == 2)
599 {
602 }
603 else
604 {
605
608 }
609
610
613
614 if (rain_limit.Count() == 2)
615 {
618 }
619 else
620 {
621
624 }
625
626
629
632
633
634 string particle_name = "";
636
637 if (particle_name != "")
638 {
640 }
641 else
642 {
644 ErrorEx(
string.Format(
"'%1' does not contain a definition for 'overrideparticle'",
646 }
647
648
651
653 {
654
656
658 {
660 }
661 }
662
663
666
667 if (v.Count() == 3)
668 {
669 float v1 = v.Get(0);
670 float v2 = v.Get(1);
671 float v3 = v.Get(2);
673 }
674 }
675
676
677
678
679
680
681
682
684 {
686 {
687
689 {
691 {
693 {
695 {
697 {
699 {
701 {
703 {
705 {
706
708
710 {
711
714
715
717
718
720 OnParticleCreated(weapon, ammoType, muzzle_owner, suppressor, config_to_search, p);
721 }
722 else
723 {
724 ErrorEx(
string.Format(
"No valid particle found for: '%1'",
m_Name));
725 }
726
727
729 {
730 vector global_pos = muzzle_owner.ModelToWorld(local_pos +
Vector(-0.2, 0, 0));
732 if ( randX > 8 )
734 else if ( randX > 4 )
736 else
738 }
739 }
740 }
741 }
742 }
743 }
744 }
745 }
746 }
747 }
748 }
749 }
750
752 {
753
754 }
755
757 {
758
759 }
760
762 {
763
764 }
765
766
767
768
769
770
771
772
774 {
776 {
780 }
781
782 return true;
783 }
784
785
787 {
789 }
790
791
793 {
795 }
796
797
799 {
801 }
802
803
805 {
807
808 string particle_file = "";
809 string cfg_path = "CfgAmmo " + ammoType + " muzzleFlashParticle";
810 if (
GetGame().ConfigGetText( cfg_path, particle_file))
812
813
814
816 {
817 if (particle_file == "")
818 {
819 ErrorEx(
string.Format(
"Cannot spawn particle effect because item %1 is missing config parameter muzzleFlashParticle!", ammoType),
ErrorExSeverity.INFO);
820 }
821 else
822 {
824
826 {
827 string devStr;
828 #ifdef DEVELOPER
829 devStr = " Make sure it's registered there and then rebuild Scripts and Graphics PBOs.";
830 #endif
831 ErrorEx(
string.Format(
"Cannot play particle effect with name %1 because no such file is registered in ParticleList.c!%2", particle_file, devStr));
833 }
834 }
835 }
836 else
837 {
839 }
840
842 }
843
844
846 {
847 vector particle_ori =
"0 0 0";
849 {
853 }
854 else
855 {
857 {
859 }
860
862 {
863 particle_ori = particle_ori +
Vector(0,0,270);
864 }
865 }
866
867 return particle_ori;
868 }
869}
870
871
873
874
876
877
879{
881 {
883 }
884
886 {
888 {
889 weapon.KillAllOverheatingParticles();
890 }
891 }
892
894 {
895 OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
896 }
897}
898
900{
906
909
911 {
913 }
914
916 {
918 }
919
921 {
923 }
924
926 {
928 }
929
931 {
933 }
934
936 {
938 }
939
941 {
946 }
947
949 {
951 }
952
954 {
956 }
957
959 {
961 }
962
964 {
966 }
967}
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].