Coder Social home page Coder Social logo

bosses's Introduction

Bosses

Custom boss plugin for PocketMine-MP.

What is this plugin?

This plugin adds entities that they have so much things to configure!

How to create boss?

Type /boss and select Create new Boss

Select Spawn now?

Select boss's attributes and press Create at the bottom of the menu

How to make a boss auto spawn?

Simply type /boss and if you are creating new boss press Create new Boss and type the second amount to Auto spawn countdown(seconds).

Example: 10

If you are not creating new boss click to Manage existing Boss and select your boss.

Type the second amount to Auto spawn countdown(seconds)

API

How to get most damager(s) of boss?

/** @var BossEntity $boss */
$killers = $boss->mostDamages;
/*
 * [
 *   firstPlayerName => damage
 *   secondPlayerName => damage
 *   .....
 *   lastPlayerName => damage
 * ]
 * */
$firstPlayerName = array_keys($killers)[0];
$firstPlayer = $killers[$firstPlayerName];

$secondPlayerName = array_keys($killers)[1];
$secondPlayer = $killers[$secondPlayerName];

How to get online most damager(s) of boss?

/** @var BossEntity $boss */
$killers = $boss->getOnlineDamagePlayers();
/*
 * [
 *   firstPlayerName => damage
 *   secondPlayerName => damage
 *   .....
 *   lastPlayerName => damage
 * ]
 * */
$firstPlayerName = array_keys($killers)[0];
$firstPlayer = $killers[$firstPlayerName];

$secondPlayerName = array_keys($killers)[1];
$secondPlayer = $killers[$secondPlayerName];

How to add death listener for a single boss?

use pocketmine\Server;
use OguzhanUmutlu\Bosses\entities\BossEntity;
/** @var BossEntity $boss */
$boss->onDie[] = function() {
    $onlineDamagers = $boss->getOnlineDamagePlayers();
    $firstPlayerName = array_keys($onlineDamagers)[0];
    Server::getInstance()->broadcastMessage(
        "Boss's most damager is $firstPlayerName!"
    );
};

How to add death listener for a single boss?

use pocketmine\Server;
use OguzhanUmutlu\Bosses\entities\BossEntity;
/** @var BossEntity $boss */
$boss->onDie[] = function() {
    $onlineDamagers = $boss->getOnlineDamagePlayers();
    $firstPlayerName = array_keys($onlineDamagers)[0];
    Server::getInstance()->broadcastMessage(
        "Boss's most damager is $firstPlayerName!"
    );
};

How to add death listener for a single boss?

use pocketmine\Server;
use OguzhanUmutlu\Bosses\entities\BossEntity;
/** @var BossEntity $boss */
$boss->onDie[] = function() {
    $onlineDamagers = $boss->getOnlineDamagePlayers();
    $firstPlayerName = array_keys($onlineDamagers)[0];
    Server::getInstance()->broadcastMessage(
        "Boss's most damager is $firstPlayerName!"
    );
};

Events:

use OguzhanUmutlu\Bosses\events\boss\BossDeathEvent;
use OguzhanUmutlu\Bosses\events\boss\BossShootEvent;
use OguzhanUmutlu\Bosses\events\boss\BossDamageEvent;
use OguzhanUmutlu\Bosses\events\minion\MinionDeathEvent;
use OguzhanUmutlu\Bosses\events\minion\MinionShootEvent;
use OguzhanUmutlu\Bosses\events\minion\MinionDamageEvent;
use pocketmine\event\entity\EntityDamageByEntityEvent;
/** @var BossDeathEvent|BossShootEvent|BossDamageEvent $event */
$boss = $event->getBoss();

/** @var MinionDeathEvent|MinionShootEvent|MinionDamageEvent $event */
$minion = $event->getMinion();

/** @var BossDeathEvent|MinionDeathEvent $event */
$drops = $event->getDrops();

/** @var BossDeathEvent|MinionDeathEvent $event */
$event->setDrops($drops);

/** @var BossShootEvent|MinionShootEvent $event */
$projectile = $event->getProjectile();

/** @var BossShootEvent|MinionShootEvent $event */
$event->setProjectile($projectile);

/** @var EntityDamageByEntityEvent $damage */
/** @var BossDamageEvent $event */
$damage = $event->getDamage();

TODO

  • more attributes
  • add Fly AI

Reporting bugs

You may open an issue on the Bosses GitHub repository for report bugs https://github.com/OguzhanUmutlu/Bosses/issues

bosses's People

Contributors

oguzhanumutlu avatar poggit-bot avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.