to have this mc version working you need to update the dedicated server scripts
This commit is contained in:
kremsy
2017-04-13 16:12:10 +02:00
parent 09b974e2cc
commit 7a7826b4b6
17 changed files with 273 additions and 64 deletions

View File

@ -2,6 +2,8 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/**
* Structure Class for the OnArmorEmpty Structure Callback
*
@ -11,5 +13,4 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class OnArmorEmptyStructure extends OnHitNearMissArmorEmptyBaseStructure {
}

View File

@ -26,9 +26,7 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure {
private $shooter;
private $victim;
//private $shooterPoints; (was in mp3)
//private $hitDistance; (was in mp3)
private $distance;
/**
* Construct a new On Hit Structure
@ -39,9 +37,10 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure {
public function __construct(ManiaControl $maniaControl, $data) {
parent::__construct($maniaControl, $data);
$jsonObj = $this->getPlainJsonObject();
$this->time = $jsonObj->time;
$this->weapon = $jsonObj->weapon;
$jsonObj = $this->getPlainJsonObject();
$this->time = $jsonObj->time;
$this->weapon = $jsonObj->weapon;
$this->distance = $jsonObj->distance;
$this->shooterPosition = new Position();
$this->shooterPosition->setX($jsonObj->shooterposition->x);
@ -117,4 +116,14 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure {
public function getVictim() {
return $this->victim;
}
/**
* Distance Between Shooter and Victim at the time of the Event
*
* @api
* @return float
*/
public function getDistance() {
return $this->distance;
}
}

View File

@ -15,7 +15,7 @@ use ManiaControl\ManiaControl;
*/
class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure {
private $damage;
private $shooterPoints;
/**
* OnHitStructure constructor.
@ -26,7 +26,8 @@ class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure {
public function __construct(ManiaControl $maniaControl, array $data) {
parent::__construct($maniaControl, $data);
$this->damage = $this->getPlainJsonObject()->damage;
$this->damage = $this->getPlainJsonObject()->damage;
$this->shooterPoints = $this->getPlainJsonObject()->points;
}
/**
@ -38,4 +39,15 @@ class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure {
public function getDamage() {
return $this->damage;
}
/**
* Amount of points scored by the shooter
*
* @api
* @return int
*/
public function getShooterPoints() {
return $this->shooterPoints;
}
}

View File

@ -14,22 +14,4 @@ use ManiaControl\ManiaControl;
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class OnNearMissStructure extends OnHitNearMissArmorEmptyBaseStructure {
private $distance;
public function __construct(ManiaControl $maniaControl, array $data) {
parent::__construct($maniaControl, $data);
$this->distance = $this->getPlainJsonObject()->distance;
}
/**
* Returns the distance
*
*
* @api
* @return float
*/
public function getDistance() {
return $this->distance;
}
}

View File

@ -35,6 +35,7 @@ class OnScoresStructure extends CommonScoresStructure {
$playerScore->setRank($jsonPlayer->rank);
$playerScore->setRoundPoints($jsonPlayer->roundpoints);
$playerScore->setMapPoints($jsonPlayer->mappoints);
$playerScore->setMatchPoints($jsonPlayer->matchpoints);
$this->playerScores[$jsonPlayer->login] = $playerScore;
}