mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
monsters are separated now
This commit is contained in:
parent
27be94ad1b
commit
dbc199f34b
10 changed files with 112 additions and 79 deletions
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class Creeper extends Monster{
|
||||
const TYPE = MOB_CREEPER;
|
||||
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"]:20, "generic");
|
||||
$this->update();
|
||||
//$this->setName('Creeper');
|
||||
$this->size = 1.6; //not original
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
return array(
|
||||
array(GUNPOWDER, 0, mt_rand(0,2)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class PigZombie extends Monster{
|
||||
const TYPE = MOB_PIGMAN;
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 20, "generic");
|
||||
$this->update();
|
||||
//$this->setName('Pigman');
|
||||
$this->size = 1.8; //not original
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
return array(
|
||||
array(COOKED_PORKCHOP, 0, mt_rand(0,2)),
|
||||
array(GOLD_INGOT, 0, mt_rand(0,1)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
class Skeleton extends Monster{
|
||||
const TYPE = MOB_SKELETON;
|
||||
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 20, "generic");
|
||||
$this->update();
|
||||
//$this->setName('Skeleton');
|
||||
$this->size = 1.9;
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
return array(
|
||||
array(ARROW, 0, mt_rand(0,2)),
|
||||
array(BONE, 0, mt_rand(0,2)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
class Spider extends Monster{
|
||||
const TYPE = MOB_SPIDER;
|
||||
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"]:20, "generic");
|
||||
$this->update();
|
||||
//$this->setName('Spider');
|
||||
$this->size = 0.6; //not original
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
return array(
|
||||
array(STRING, 0, mt_rand(0,2)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
class Zombie extends Monster{
|
||||
const TYPE = MOB_ZOMBIE;
|
||||
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 20, "generic");
|
||||
$this->update();
|
||||
//$this->setName('Zombie');
|
||||
$this->size = 1.95;
|
||||
}
|
||||
|
||||
public function getDrops(){
|
||||
return array(
|
||||
array(CARROT, 0, Utils::chance(0.83) ? 1 : 0),
|
||||
array(POTATO, 0, Utils::chance(0.83) ? 1 : 0),
|
||||
array(FEATHER, 0, mt_rand(0,2)),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue