Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 6, 2015, 9:37:11 PM (5 years ago)
Author:
fvultier
Message:

Minor improvements. Use of the Munition class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.cc

    r10606 r10627  
    5656        this->numberOfSplits_ = 2;
    5757        this->numberOfChilds_ = 3;
    58         this->splitTime_ = 0.3;
    59         this->spread_ = 0.1;
     58        this->splitTime_ = 0.3f;
     59        this->spread_ = 0.1f;
     60        this->damageReduction_ = 1.0f;
    6061
    61         this->setMunitionName("LaserMunition");
     62        this->setMunitionName("SplitMunition");
    6263        this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
    6364    }
     
    7980        XMLPortParam(SplitGun, "splittime", setSplitTime, getSplitTime, xmlelement, mode);
    8081        XMLPortParam(SplitGun, "spread", setSpread, getSpread, xmlelement, mode);
     82        XMLPortParam(SplitGun, "damagereduction", setDamageReduction, getDamageReduction, xmlelement, mode);
    8183    }
    8284
     
    9597        projectile->setVelocity(this->getMuzzleDirection() * this->speed_);
    9698
    97         // Pass important information to the projectile: Number of splits, Number of childs, split time, spread
     99        // Pass important information to the projectile: Number of splits, Number of childs, split time, spread and the damage reduction
    98100        projectile->setNumberOfSplits(getNumberOfSplits());
    99101        projectile->setNumberOfChilds(getNumberOfChilds());
    100102        projectile->setSplitTime(getSplitTime());
    101103        projectile->setSpread(getSpread());
     104        projectile->setDamageReduction(getDamageReduction());
    102105
    103106        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
Note: See TracChangeset for help on using the changeset viewer.