Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }