Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Altay is ok
Browse files Browse the repository at this point in the history
  • Loading branch information
haniokasai committed Mar 20, 2019
1 parent 9a7c61b commit 13296c5
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/pocketmine/entity/Zombie.php
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;
}
}

0 comments on commit 13296c5

Please sign in to comment.