Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 18, 2009, 6:14:52 PM (16 years ago)
Author:
landauf
Message:

Added many new features in the Munition class:

  • there are now 3 modes: a) every weapon has it's own magazine b) all weapons use the same magazin c) no magazines, just a big munition pool
  • the Munition class handles the reloading of the magazine

Split the Weapon class into Weapon and WeaponMode. WeaponMode creates the fire of the Weapon. A weapon can own several WeaponModes (for example primary and secondary fire). But it's also possible to have a weapon with several muzzles which all fire at the same time (there's a WeaponMode for each muzzle).

Renamed LaserGun to LaserFire and Fusion to FusionFire. They inherit now from WeaponMode.

Changed the code in the Weapon class to use the new Munition functionality.

Added ReplenishingMunition, a subclass of Munition that replenishes itself (used for LaserGunMunition).

Added a reload command to reload magazines.

Location:
code/branches/weapons/src/orxonox/objects/controllers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weapons/src/orxonox/objects/controllers/HumanController.cc

    r2912 r2918  
    4646    SetConsoleCommand(HumanController, rotateRoll,    true).setAsInputCommand();
    4747    SetConsoleCommand(HumanController, fire,          true).keybindMode(KeybindMode::OnHold);
     48    SetConsoleCommand(HumanController, reload,        true);
    4849    SetConsoleCommand(HumanController, boost,         true).keybindMode(KeybindMode::OnHold);
    4950    SetConsoleCommand(HumanController, greet,         true);
     
    114115    }
    115116
     117    void HumanController::reload()
     118    {
     119        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
     120            HumanController::localController_s->controllableEntity_->reload();
     121    }
     122
    116123    void HumanController::boost()
    117124    {
  • code/branches/weapons/src/orxonox/objects/controllers/HumanController.h

    r2912 r2918  
    5252
    5353            static void fire(unsigned int firemode);
     54            static void reload();
    5455
    5556            static void boost();
Note: See TracChangeset for help on using the changeset viewer.