mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-23 05:54:36 +00:00
66 lines
1.5 KiB
PHP
66 lines
1.5 KiB
PHP
<?php
|
|
|
|
/*
|
|
*
|
|
* ____ _ _ __ __ _ __ __ ____
|
|
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
|
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
|
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
|
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* @author PocketMine Team
|
|
* @link http://www.pocketmine.net/
|
|
*
|
|
*
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace pocketmine\entity;
|
|
|
|
use pocketmine\item\Item;
|
|
use pocketmine\item\ItemFactory;
|
|
|
|
class Zombie extends Monster{
|
|
public const NETWORK_ID = self::ZOMBIE;
|
|
|
|
public $width = 0.6;
|
|
public $height = 1.8;
|
|
|
|
public function getName() : string{
|
|
return "Zombie";
|
|
}
|
|
|
|
public function getDrops() : array{
|
|
$drops = [
|
|
ItemFactory::get(Item::ROTTEN_FLESH, 0, mt_rand(0, 2))
|
|
];
|
|
|
|
if(mt_rand(0, 199) < 5){
|
|
switch(mt_rand(0, 2)){
|
|
case 0:
|
|
$drops[] = ItemFactory::get(Item::IRON_INGOT, 0, 1);
|
|
break;
|
|
case 1:
|
|
$drops[] = ItemFactory::get(Item::CARROT, 0, 1);
|
|
break;
|
|
case 2:
|
|
$drops[] = ItemFactory::get(Item::POTATO, 0, 1);
|
|
break;
|
|
}
|
|
}
|
|
|
|
return $drops;
|
|
}
|
|
|
|
public function getXpDropAmount() : int{
|
|
//TODO: check for equipment and whether it's a baby
|
|
return 5;
|
|
}
|
|
}
|