Пример #1
0
 public Demoman()
 {
     _weapon1    = new GrenadeLauncher();
     _weapon2    = new PipebombLauncher();
     _weapon3    = new Shotgun();
     _weapon4    = new Axe();
     _gren1      = Ammunition.FragGrenade;
     _gren2      = Ammunition.MIRVGrenade;
     _health     = 90;
     _armour     = 120;
     _maxShells  = 50;
     _maxNails   = 50;
     _maxRockets = 50;
     _maxCells   = 50;
     _maxGren1   = 4;
     _maxGren2   = 4;
 }
Пример #2
0
    private Weapon SetupWeapon(WEAPONTYPE weapon)
    {
        Weapon weap = null;

        switch (weapon)
        {
        case WEAPONTYPE.SYRINGE:
            weap = new Syringe();
            break;

        case WEAPONTYPE.AXE:
            weap = new Axe();
            break;

        case WEAPONTYPE.SHOTGUN:
            weap = new Shotgun();
            break;

        case WEAPONTYPE.SUPERSHOTGUN:
            weap = new SuperShotgun();
            break;

        case WEAPONTYPE.NAILGUN:
            weap = new NailGun();
            break;

        case WEAPONTYPE.SUPERNAILGUN:
            weap = new SuperNailGun();
            break;

        case WEAPONTYPE.GRENADELAUNCHER:
            weap = new GrenadeLauncher();
            break;

        case WEAPONTYPE.PIPEBOMBLAUNCHER:
            weap = new PipebombLauncher();
            break;

        case WEAPONTYPE.ROCKETLAUNCHER:
            weap = new RocketLauncher();
            break;

        case WEAPONTYPE.MINIGUN:
            weap = new Minigun();
            break;

        case WEAPONTYPE.INCENDIARYCANNON:
            weap = new IncendiaryCannon();
            break;

        case WEAPONTYPE.FLAMETHROWER:
            weap = new Flamethrower();
            break;

        case WEAPONTYPE.NONE:
        default:

            break;
        }

        if (weap != null)
        {
            weap.Init(_game);
            weap.Spawn(this, nameof(weap));
        }

        return(weap);
    }