Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2016, 5:04:41 PM (9 years ago)
Author:
sagerj
Message:

done/fixed everything, weaponmode/discharger fully commented only hudchargebar left

Location:
code/branches/sagerjFS16/src/modules/weapons/weaponmodes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.cc

    r11185 r11189  
    2121 *
    2222 *   Author:
    23  *      God of everything
     23 *      Johannes Sager
    2424 *   Co-authors:
    2525 *   
     
    5151        RegisterObject(Discharger);
    5252
    53         this->reloadTime_ = 3.14159f;
    54         this->damage_ = 0.0f;
    55         this->speed_ = 100.0f;
    56         this->chargeable_ = true;
     53        this->reloadTime_ = 3.14159f;           // how long you cannot charge after fire
     54        this->damage_ = 0.0f;                   // if 0.0f then it uses weaponsettings.oxi
     55        this->speed_ = 100.0f;                  // base projectile speed
     56        this->chargeable_ = true;               // true if weapon chargeable
    5757
    5858        this->setMunitionName("LaserMunition");
     
    7070        projectile->setOrientation(this->getMuzzleOrientation());
    7171        projectile->setPosition(this->getMuzzlePosition());
    72         projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * this->charges_ / 5);
    73 
     72        projectile->setVelocity(this->getMuzzleDirection() * this->speed_ * this->charges_ / 5);// we scale the projectile speed with the current charges / 5
    7473        projectile->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    7574        projectile->setDamage(this->getDamage() * this->charges_);
    76         projectile->setShieldDamage(this->getShieldDamage() * this->charges_);
    77         projectile->setHealthDamage(this->getHealthDamage() * this->charges_);
    78         this->charges_ = 0;
     75        projectile->setShieldDamage(this->getShieldDamage() * this->charges_);                  // we scale both types of damage with the current charges as
     76        projectile->setHealthDamage(this->getHealthDamage() * this->charges_);                  // well since this is the whole purpose of a chareable weapon
     77        this->charges_ = 0;                                                                     // firing "consumes" the current charges (reset after fire)
    7978    }
    8079}
  • code/branches/sagerjFS16/src/modules/weapons/weaponmodes/Discharger.h

    r11185 r11189  
    2121 *
    2222 *   Author:
    23  *       God of everything
     23 *       Johannes Sager
    2424 *   Co-authors:
    2525 *     
Note: See TracChangeset for help on using the changeset viewer.