Example #1
0
        public static void FillPattern(
            Transform source, PatternDef def, List <Transform> results)
        {
            switch (def.patternType)
            {
            case PatternType.Cone3D:
                Cone3D(source, results, def.count, def.scale.x, def.scale.y);
                break;

            case PatternType.Cone3DRandom:
                Cone3DRandom(source, results, def.count, def.scale.x, def.scale.y);
                break;

            case PatternType.HorizontalLine:
                HorizontalLine(source, results, def.count, def.scale.x);
                break;

            case PatternType.VerticalLine:
                VerticalLine(source, results, def.count, def.scale.y);
                break;

            default:
                Cone3DRandom(source, results, def.count, def.scale.x, def.scale.y);
                break;
            }
        }
Example #2
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());
            //}
        }
Example #3
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);
        }