Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2015, 9:05:26 PM (9 years ago)
Author:
fvultier
Message:

promised wor for Jannis.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/particleEffectsHS15/src/modules/weapons/weaponmodes/MineGun.cc

    r10836 r10889  
    5151        RegisterObject(MineGun);
    5252
     53        this->speed_ = 0.0f;
    5354        this->reloadTime_ = 1.0f;
    5455        this->damage_ = 0.0f;
    55         this->speed_ = 0.0f;
    56         this->lifeTime_ = 7500.0f;
     56        this->maxTimeUntilExplosion_ = 0.0f;
    5757
    5858        this->setMunitionName("MineMunition");
     
    6666    /**
    6767    @brief
    68         XMLPort for the MineGun. You can define how often the projectiles Mine, how many childs should be created per Mine, the spread and the time between two Mines.
     68        XMLPort for the MineGun.
    6969    */
    7070    void MineGun::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    7171    {
    7272        SUPER(MineGun, XMLPort, xmlelement, mode);
    73         XMLPortParam(MineGun, "Lifetime", setLifeTime, getLifeTime, xmlelement, mode);
     73
     74        XMLPortParam(MineGun, "maxtimeuntilexplosion", setMaxTimeUntilExplosion, getMaxTimeUntilExplosion, xmlelement, mode).defaultValues(10.0f);
     75        XMLPortParam(MineGun, "timeuntilactivation", setTimeUntilActivation, getTimeUntilActivation, xmlelement, mode).defaultValues(3.0f);
    7476    }
    7577
     
    8183    {
    8284        MineProjectile* projectile = new MineProjectile(this->getContext());
    83         //projectile->setMaterial("Flares/energyflare");
    8485
    8586        this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
     
    8889        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    8990
    90         // Pass important information to the projectile: Number of Mines, Number of childs, Mine time, spread and the damage reduction
    91         /*projectile->setNumberOfMines(getNumberOfMines());
    92         projectile->setNumberOfChilds(getNumberOfChilds());*/
    93         projectile->setLifeTime(getLifeTime());
    94         /*projectile->setSpread(getSpread());
    95         projectile->setDamageReduction(getDamageReduction());*/
     91        projectile->setMaxTimeUntilExplosion(getMaxTimeUntilExplosion());
     92        projectile->setTimeUntilActivation(getTimeUntilActivation());
    9693
    9794        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Note: See TracChangeset for help on using the changeset viewer.