Exemple #1
0
        public static InvWeapon CreateLauncher(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name = "Launcher";
            weapDef.primaryRefireTime   = 0.02f;
            weapDef.secondaryRefireTime = 0.75f;
            weapDef.primaryPrjCount     = 1;
            weapDef.secondaryPrjCount   = 12;

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 25;
            primaryPrjDef.launchSpeed = 35;
            primaryPrjDef.timeToLive  = 1;

            ProjectileDef secondaryPrjDef = new ProjectileDef();

            secondaryPrjDef.damage      = 25;
            secondaryPrjDef.launchSpeed = 35;
            secondaryPrjDef.timeToLive  = 1;

            InvWeapon weapon = new InvWeapon(launchNode, weapDef, primaryPrjDef, secondaryPrjDef, ignoreBody);

            return(weapon);
        }
Exemple #2
0
        public static InvWeapon CreatePlayerShotgun(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name               = "Triple-Stick";
            weapDef.magazineSize       = 3;
            weapDef.magazineReloadTime = 2f;

            weapDef.primaryRefireTime = 0.4f;
            weapDef.primaryPrjCount   = 10;

            weapDef.secondaryRefireTime = weapDef.primaryRefireTime * weapDef.magazineSize;
            weapDef.secondaryPrjCount   = weapDef.primaryPrjCount * weapDef.magazineSize;

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 25;
            primaryPrjDef.launchSpeed = 50;
            primaryPrjDef.timeToLive  = 1;

            // No secondary def, use primary twice

            InvWeapShotgun weapon = new InvWeapShotgun(launchNode, weapDef, primaryPrjDef, primaryPrjDef, ignoreBody);

            return(weapon);
        }
Exemple #3
0
        public static InvWeapon CreateStakegun(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name = "Stakegun";
            weapDef.primaryRefireTime   = 0.2f;
            weapDef.secondaryRefireTime = 2;
            weapDef.primaryPrjCount     = 1;
            weapDef.secondaryPrjCount   = 4;
            weapDef.magazineSize        = 4;

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 25;
            primaryPrjDef.launchSpeed = 50;
            primaryPrjDef.timeToLive  = 2;
            primaryPrjDef.prefabPath  = GameFactory.Path_StakeProjectile;

            ProjectileDef secondaryPrjDef = new ProjectileDef();

            secondaryPrjDef.damage      = 25;
            secondaryPrjDef.launchSpeed = 50;
            secondaryPrjDef.timeToLive  = 2;
            secondaryPrjDef.prefabPath  = GameFactory.Path_StakeProjectile;

            InvWeapStakegun weapon = new InvWeapStakegun(launchNode, weapDef, primaryPrjDef, secondaryPrjDef, ignoreBody);

            return(weapon);
        }
Exemple #4
0
        public InvWeapShotgun(
            Spatial launchNode,
            WeaponDef weaponDef,
            ProjectileDef primaryDef,
            PatternDef primaryPatternDef)
        {
            weaponDef.Validate();

            _launchNode        = launchNode;
            _primaryPatternDef = primaryPatternDef;

            _roundsLoaded = weaponDef.magazineSize;

            _weaponDef     = weaponDef;
            _primaryPrjDef = primaryDef;
            //_secondaryPrjDef = secondaryDef;
            //for (int i = 0; i < weaponDef.primaryPrjCount; ++i)
            //{
            //    _primarySpread.Add(new Vector3());
            //}
            //for (int i = 0; i < weaponDef.secondaryPrjCount; ++i)
            //{
            //    _secondarySpread.Add(new Vector3());
            //}
        }
Exemple #5
0
        public static IEquippable CreateLauncher(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name = "Launcher";
            weapDef.primaryRefireTime   = 0.5f;
            weapDef.secondaryRefireTime = 0.75f;
            weapDef.primaryPrjCount     = 1;
            weapDef.secondaryPrjCount   = 12;

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 25;
            primaryPrjDef.launchSpeed = 50;
            primaryPrjDef.timeToLive  = 1;
            primaryPrjDef.damageType  = DamageType.Launch;
            primaryPrjDef.impactDef   = new ProjectileImpactDef()
            {
                impactType = ProjectileImpactDef.ImpactType.Explode,
                radius     = 5,
                damage     = 100
            };

            ProjectileDef secondaryPrjDef = new ProjectileDef();

            secondaryPrjDef.damage      = 25;
            secondaryPrjDef.launchSpeed = 35;
            secondaryPrjDef.timeToLive  = 1;

            InvProjectileWeapon weapon = new InvProjectileWeapon(launchNode, weapDef, primaryPrjDef, secondaryPrjDef, ignoreBody);

            return(weapon);
        }
Exemple #6
0
        public static IEquippable CreateStakegun(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name = "Stakegun";
            weapDef.primaryRefireTime   = 0.3f;
            weapDef.secondaryRefireTime = 2;
            weapDef.primarySpread       = new Vector2();
            weapDef.secondarySpread     = new Vector2(600, 400);
            weapDef.primaryPrjCount     = 1;
            weapDef.secondaryPrjCount   = 4;
            weapDef.magazineSize        = 4;

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 50;
            primaryPrjDef.launchSpeed = 150;
            primaryPrjDef.timeToLive  = 2;
            primaryPrjDef.prefabPath  = GameFactory.Path_StakeProjectile;
            primaryPrjDef.destroyMode = ProjectileDef.DestroyMode.Embed;

            InvWeapStakegun weapon = new InvWeapStakegun(launchNode, weapDef, primaryPrjDef, primaryPrjDef, ignoreBody);

            return(weapon);
        }
Exemple #7
0
        public InvWeapon(
            Spatial launchNode,
            WeaponDef weaponDef,
            ProjectileDef primaryDef,
            ProjectileDef secondaryDef,
            PhysicsBody ignoreBody)
        {
            weaponDef.Validate();

            _launchNode = launchNode;
            _ignoreBody = ignoreBody;

            _weaponDef       = weaponDef;
            _primaryPrjDef   = primaryDef;
            _secondaryPrjDef = secondaryDef;
            for (int i = 0; i < weaponDef.primaryPrjCount; ++i)
            {
                _primarySpread.Add(new Vector3());
            }
            for (int i = 0; i < weaponDef.secondaryPrjCount; ++i)
            {
                _secondarySpread.Add(new Vector3());
            }
        }
Exemple #8
0
        public static IEquippable CreatePlayerShotgun(Spatial launchNode, PhysicsBody ignoreBody)
        {
            WeaponDef weapDef = new WeaponDef();

            weapDef.name               = "Triple-Stick";
            weapDef.magazineSize       = 3;
            weapDef.magazineReloadTime = 2f;

            weapDef.primaryRefireTime = 0.4f;
            weapDef.primaryPrjCount   = 10;
            weapDef.primarySpread     = new Vector2(1000, 600);

            weapDef.secondaryRefireTime = weapDef.primaryRefireTime * weapDef.magazineSize;
            weapDef.secondaryPrjCount   = weapDef.primaryPrjCount * weapDef.magazineSize;
            weapDef.secondarySpread     = new Vector2(2000, 1200);

            ProjectileDef primaryPrjDef = new ProjectileDef();

            primaryPrjDef.damage      = 12;
            primaryPrjDef.launchSpeed = 100;
            primaryPrjDef.timeToLive  = 2f;           // 0.1f;

            PatternDef pattern = new PatternDef();

            pattern.patternType = PatternType.Cone3DRandom;
            pattern.count       = 10;
            pattern.scale.x     = 1000;
            pattern.scale.y     = 600;

            // No secondary def, use primary twice

            InvWeapShotgun weapon = new InvWeapShotgun(
                launchNode, weapDef, primaryPrjDef, pattern);

            return(weapon);
        }