This repository has been archived by the owner on Feb 23, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a7c61b
commit 13296c5
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?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; | ||
use function mt_rand; | ||
|
||
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; | ||
} | ||
} |