mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +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:
parent
4c9ca53b32
commit
f1970492c1
@ -52,7 +52,8 @@ class Arrow extends Projectile{
|
||||
protected $gravity = 0.05;
|
||||
protected $drag = 0.01;
|
||||
|
||||
protected $damage = 2;
|
||||
/** @var float */
|
||||
protected $damage = 2.0;
|
||||
|
||||
/** @var int */
|
||||
protected $pickupMode = self::PICKUP_ANY;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user