mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
Projectile: added API to modify projectile base damage multiplier
This adds two new methods: - Projectile->getBaseDamage() - Projectile->setBaseDamage()
This commit is contained in:
@ -46,7 +46,8 @@ abstract class Projectile extends Entity{
|
||||
|
||||
public const DATA_SHOOTER_ID = 17;
|
||||
|
||||
protected $damage = 0;
|
||||
/** @var float */
|
||||
protected $damage = 0.0;
|
||||
|
||||
/** @var Vector3|null */
|
||||
protected $blockHit;
|
||||
@ -112,6 +113,25 @@ abstract class Projectile extends Entity{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base damage applied on collision. This is multiplied by the projectile's speed to give a result
|
||||
* damage.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getBaseDamage() : float{
|
||||
return $this->damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the base amount of damage applied by the projectile.
|
||||
*
|
||||
* @param float $damage
|
||||
*/
|
||||
public function setBaseDamage(float $damage) : void{
|
||||
$this->damage = $damage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the amount of damage this projectile will deal to the entity it hits.
|
||||
* @return int
|
||||
|
Reference in New Issue
Block a user