~armagetronad-ap/armagetronad/BattleMania

« back to all changes in this revision

Viewing changes to src/special/bounty.php

  • Committer: zodiacsohma1 at gmail
  • Date: 2014-03-02 08:09:55 UTC
  • Revision ID: zodiacsohma1@gmail.com-20140302080955-r5ot6eipfe0nlpww
Simplified all fields and code in all areas for better as they seem to repeat themselves.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        {
43
43
            foreach (Base::$base->PLAYERS as $p)
44
44
            {
45
 
                if (isset($p) && !is_null($p) && $p instanceof Player && isset($p->cycle) && $p->cycle instanceof Cycle)
 
45
                if (isset($p) && $p instanceof Player && isset($p->cycle) && $p->cycle instanceof Cycle)
46
46
                {
47
47
                    $Cycles[] = $p;
48
48
                }
55
55
            while (!$bounty_set)
56
56
            {
57
57
                $bounty_player = $Cycles[rand(0, count($Cycles) - 1)];
58
 
                if (isset($bounty_player) && !is_null($bounty_player) && $bounty_player instanceof Player)
 
58
                if (isset($bounty_player) && $bounty_player instanceof Player)
59
59
                {
60
 
                    if (isset($bounty_player->cycle) && !is_null($bounty_player->cycle) && $bounty_player->cycle instanceof Cycle && is_null($bounty_player->cycle->bounty))
 
60
                    if (isset($bounty_player->cycle) && $bounty_player->cycle instanceof Cycle && !isset($bounty_player->cycle->bounty))
61
61
                    {
62
62
                        $bounty_exp_min = getSetting("BOUNTY_EXP_MIN");
63
63
                        $bounty_exp_max = getSetting("BOUNTY_EXP_MAX");
82
82
 
83
83
function bountyTrigger(Player $killed, Player $killer, Record $killer_record)
84
84
{
85
 
    if (isset($killed->cycle->bounty) && !is_null($killed->cycle->bounty) && $killed->cycle->bounty instanceof Bounty)
 
85
    if (isset($killed->cycle->bounty) && $killed->cycle->bounty instanceof Bounty)
86
86
    {
87
87
        if ($killer->human)
88
88
        {