Examples of FireArm


Examples of de.christopherstock.shooter.game.artefact.firearm.FireArm

            }
        }

        public final void performReload( AmmoSet ammoSet, boolean playSound, Point2D.Float reloaderXY, boolean freeAmmo )
        {
            FireArm fireArm = ( (FireArm)iArtefactType.iArtefactKind );

            //put unused ammo back onto the stack!
            ammoSet.addAmmo( fireArm.iAmmoType, iMagazineAmmo );

            //check ammo stock
            int ammo = ammoSet.getAmmo( fireArm.iAmmoType );
            int ammoToReload = ( ammo >= fireArm.iMagazineSize ? fireArm.iMagazineSize : ammo );

            if ( freeAmmo ) ammoToReload = fireArm.iMagazineSize;

            //load ammoToReload into the magazine and substract it from the ammo stock
            iMagazineAmmo = ammoToReload;
            ammoSet.substractAmmo( fireArm.iAmmoType, ammoToReload );

            //play reload sound
            if ( playSound )
            {
                if ( reloaderXY == null )
                {
                    fireArm.getReloadSound().playGlobalFx();
                }
                else
                {
                    fireArm.getReloadSound().playDistancedFx( reloaderXY );
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.